5

I'm trying to dump internal signals from a simulation executed either by modelsim or ghdl. Everything works fine using:

For modelsim, add vhdl sources, and compile all then:

vsim -novopt work.uut_testbench
vcd file ../uut.vcd;
vcd limit 50000000;
vcd add -r /uut_testbench/uut_core/*;
run 6000
quit -sim

For GHDL

ghdl -i --ieee=synopsys --warn-no-vital-generic --workdir=work --work=work ./uut*.vhd 
ghdl -m --ieee=synopsys --warn-no-vital-generic --workdir=work --work=work uut_testbench
./uut_testbench --stop-time=6000ns --vcd=../uut.vcd

I can see simulation signals, but not all. Signals defined as

Type InternalState is (Idle,Valid,Stalled);
Signal sState,sPrevState :InternalState;

are omitted from the vcd. This behavior is common for modelsim and ghdl.

I can see the following line at the ghdl-generated vcd

$comment sstate is not handled $end

Modelsim just omits those signals quietly

Is there a workaround? Alternative?

Qiu
  • 5,651
  • 10
  • 49
  • 56
Tarek Eldeeb
  • 588
  • 2
  • 6
  • 24

3 Answers3

2

As @user1155120 mentioned, GHDL's native format (.ghw) does support custom types and can also be read by GTKWave.

You can export this waveform type via --wave<=FILENAME>.

Nevertheless, I filed an issue to support custom types also in .vcd waveforms in the future!

David
  • 5,882
  • 3
  • 33
  • 44
darkdragon
  • 392
  • 5
  • 13
  • While invoking @user1155120 didn't produce an inbox event (I'm not mentioned in the original post) this 'answer' appears to be a comment or an attempt to reply to an answer. –  Sep 09 '18 at 19:36
  • It seems that mentions are only available in comments, not in answers. Thanks for the hint! Further, I am not allowed to comment, since it requires more reputation. Nevertheless, I think it gives information no other answer gives and therefor qualifies as a separate answer. – darkdragon Sep 10 '18 at 11:54
  • Thankyou !!! Awesome. Just added --wave=simu.ghw and thats it ! now i can see my cstate and nstate as well. :) macOS + Sigasi + GHDL + gtkwave combination. – Imeksbank Apr 08 '19 at 08:43
2

Try Tony Bybell's gtkwave, in which you can assign enumeration substitution for values (the gtkwave manual under Quick Start, Alias Files and Attaching External Disassemblers). Gtkwave is also compatible with ghdl's native waveform format (ghw). See Gtkwave on SourceForge, there's a link for the manual and you links to download binaries for W32 and a Mac app. It should also be available through just about any Linux distribution.

  • Thanks, I already use gtkwave. The problem i see is not with the viewer, but rather the simulator that ignores those signals. I will try the native wave formats; ghw and wlf. But AFAIK, vcd format supports such signals. – Tarek Eldeeb Mar 12 '12 at 04:25
  • Can you automatically dump all enums from Verilog and then reuse them in gtkwave? – Ciro Santilli OurBigBook.com Apr 30 '17 at 07:49
0

Your simulator does not know how to represent your InternalState type with the scalar or vector variables possible in a value change dump file. If you would use, for example, a std_ulogic vector to represent your states, they would appear in the VCD file. A good waveform viewer allows you to replace your state encoding with the state names. Gtkwave supports this, as already pointed out by user1155120. The IEEE Std 1800-2012 describes in section 21.7 VCD files and their limitations.

149
  • 45
  • 4