-
Notifications
You must be signed in to change notification settings - Fork 797
Open
Labels
Description
Background Work
- Yes, I searched the mailing list
- Yes, I searched the documentation
Feature Description
For simple tests where we only need to run an assembly program, we can make the Verilator simulations more than order of magnitude faster, by removing some functionality from the test harness.
Motivating Example
On a an AMD EPYC 9554 3.75 GHz processors, single-thread Verilator simulation of a single-core RocketChip runs at about 10 kHz, but by stripping down the harness, we could make it run at 270~kHz (single-thread on EPYC), i.e., 27x faster.
Here is how I achieved a 27x speedup:
- Remove TL monitors (
WithoutTLMonitorsas stated in the documentation. - Directly load the program as a hex file into the simulated RAM (
$readmemhex), see here. - Exclusively handle
+verbosein Verilog using a simplified all-Verilog harness
The last step has the most significant effect. It seems that Verilator really struggles with how verbose printing is handled through $c(...) PLI calls. Even when simulation is non-verbose there is a huge performance impact.