How to change timescale in vcd generated by chisel3 iotester

江枫思渺然 提交于 2019-12-11 06:08:59

问题


I already asked a similar question for chisel2 in case of C++ backend. But now I'm using The template example with iotester (peek and poke) with chisel3.

With the following code (can be found on my github project page):

class TapTempoUnitTester(t: TapTempo) extends PeekPokeTester(t) {
  private val tptmp = t

  def pushbutton(button: Bool) {
   poke(button, 0)
   step(1)
   poke(button, 1)
   step(10)
   poke(button, 0)
  }

  val tclk = 10
  val tus = 1000/tclk
  val tms = 1000*tus
  val ts = 1000*tms

  //0
  pushbutton(tptmp.io.button)
  step(2*tms)
  //1
  pushbutton(tptmp.io.button)
  step(1*tms)
  //2
  pushbutton(tptmp.io.button)
  step(1*tms)
}

If I run the testbench with sbt following command :

sbt 'test:runMain taptempo.TapTempoMain --backend-name verilator'

It's launching the testbench and generate a VCD file that can be seen with gtkwave in following directory :

test_run_dir/taptempo.TapTempoMain962904038/TapTempo.vcd

But the timescale in this vcd file is :

$timescale 1ns $end

What is the right way to change this timescale (other than open vcd file an change it directly) ?


回答1:


I believe there is limited support for modifying VCS flags, but I don't think there is equivalent support for the Verilator backend. You could ask for such support on this issue: https://github.com/freechipsproject/chisel-testers/issues/148



来源:https://stackoverflow.com/questions/49638404/how-to-change-timescale-in-vcd-generated-by-chisel3-iotester

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!