Schüle Daniel wrote:
> I would appreciate it very much if someone could give me some pointers
> to more (maybe simpler) examples
VCD files aren't complicated. Those weird symbols you see are base-95
encoded handles for the signal identifiers. In the value change
section they will match the corresponding encoded handle in the $var
statements. Everything else should appear straightforward: lines with
'#' as the first char indicate time values, lines with 'b' are
multi-bit value changes, and lines with '0', '1', 'x', 'z' followed by
an encoded handle are single-bit value changes.
If you want to wrap your head around it more, go to
ftp://metalab.unc.edu/pub/linux/apps/circuits/ and look at libvcddump,
specifically the fprintf statements using context->handle. The
libvcddump code is MIT licensed so you don't need to be concerned with
licensing issues if you simply want to call the library code within
your own program.
BTW, note that if you're only using gtkwave for now, you don't have to
be concerned at first with doing scope/upscope but can simply generate
flat earth signal names from your simulator. That might save you work
of generating a proper hierarchy.
You can also look at the dumper in Icarus.
-Tony
p.s.: I just noticed that gtkwave currently dies on the example vcd
emitted by libvcddump so you'll have to use --legacy at the command
line in order to use the old loader which can handle uninitialized
nets. This will be fixed in 3.0.15.