google / xls

XLS: Accelerated HW Synthesis
http://google.github.io/xls/
Apache License 2.0
1.18k stars 173 forks source link

Add waveform traces output to testbench to simulator #763

Open vincent-mirian-google opened 1 year ago

vincent-mirian-google commented 1 year ago

Currently, XLS supports iverilog for simulating verilog module with a testbench. When simulating iverilog, the waveform of the testbench can be created for viewing by other open source tools (e.g. gtkwave).

To produce the waveform traces, the following can be added to the initial block of the testbench.

  $dumpfile("some_file_name.vcd");
  $dumpvars(0, test_bench_module_name);

Then, viewed by gtkwave:

gtkwave some_file_name.vcd
Forchapeatl commented 1 year ago

@vincent-mirian-google please may I take this issue ?

vincent-mirian-google commented 1 year ago

Hi @Forchapeatl You are welcome to tackle this issue. I assigned it to you. Thank you.

Forchapeatl commented 1 year ago
  $dumpfile("some_file_name.vcd");
  $dumpvars(0, test_bench_module_name);

Then, viewed by gtkwave:

gtkwave some_file_name.vcd

Please are we to include it in these two files

vincent-mirian-google commented 1 year ago

These files do not need to change. The GH issue is to programatically update the generated testbench (found in https://github.com/google/xls/blob/main/xls/simulation/module_testbench.h#L253) to output the waveform trace file.