[Libre-soc-bugs] [Bug 1073] Microwatt verilator sim - setting up chroot and documentation

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Mon May 8 20:55:58 BST 2023


--- Comment #15 from Andrey Miroshnikov <andrey at technepisteme.xyz> ---
After getting the sim to run last week, I forgot that the vcd trace file was

Luke helped out on IRC:

I discovered the reason: the tick() function has a boolean 'dump' argument
which, if set to true, will dump the trace data for the current clock cycle.
The reason it was dumping the first time 0, is because during reset condition,
tick() dump argument is hard-coded to true:

The reason there was no further dumping, is because the TRIGGER_ENABLE define
was causing the 'traceme' dump flag to be set to false:

Looking at the comment on line #130, I saw that you (Luke) suggested they
should be runtime commandline args.

I temporarily commented out TRIGGER_ENABLE, while also adding a new flag -d to
pass to microwatt-verilator.

Calling the executable like this will allow trace data to be dumped:
./microwatt-verilator hello_world/hello_world.bin -d

After seeing how big the .vcd file got (about 6GB), I realised that enabling
trace dumping by default is a *bad idea*. Thus leaving it behind a flag is
probably better. Oh, and do let me know if '-d' is acceptable, can change it to
something else.

For the purposes of the tutorial I now have all the features working, so won't
proceed with further modification. If you want me to implement some of those
other defines as commandline args (TRIGGER_OCCURANCE, TRIGGER_COUNTDOWN, etc.,
let me know).

Also, I added a -h help flag with a basic help string. It's not much, but at
least don't need to reverse engineer the code everytime to know the args.

You can call it like this:
./microwatt-verilator -h

I'll proceed with merging my wiki page into the original, as well as making a
tutorial tomorrow.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the libre-soc-bugs mailing list