Cocotb: Verilator: Offer option to use FST Tracer

Created on 25 Apr 2020  Â·  8Comments  Â·  Source: cocotb/cocotb

Hi,

very short proposal: Verilator includes FST-Wavedump support for some time now, enabling it would only require an option variabe and instantiating a VerilatedFstC instead of the vcd tracer.

FSTs are much more space efficient compared to vcd's .

simulators categoryverilator feature

Most helpful comment

Closing here as my PR was just accepted.

All 8 comments

Yes. For FST, it should something like this (without the switch yet):

#if VM_TRACE
    Verilated::traceEverOn(true);

    std::unique_ptr<VerilatedFstC> tfp(new VerilatedFstC);
    top->trace(tfp.get(), 99);
    tfp->open("dump.fst");
#endif

+1! Another really cool feature is the support for enum values.

image

I tested the above patch and it worked (just needed an extra include as well, and needed to install libz-dev).

@cmarqu Would you be open for a first time code contribution for this? It doesn't look that hard and it would benefit me so I can give it a shot.

One could reuse VM_TRACE and add recognistion for VM_TRACE=fst or VM_TRACE=dump.fst ....

@bluecmd Yes, sure!

Also, the makefile would need to change as well:

╰─ grep -ir Vcd .                                                                                                                                                                                           ─╯
./share/makefiles/simulators/Makefile.verilator:    @rm -f dump.vcd

Closing here as my PR was just accepted.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

chiggs picture chiggs  Â·  6Comments

imphil picture imphil  Â·  7Comments

marlonjames picture marlonjames  Â·  8Comments

nredd picture nredd  Â·  4Comments

raysalemi picture raysalemi  Â·  3Comments