-
Notifications
You must be signed in to change notification settings - Fork 653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verilator simulations can be made an order of magnitude faster #2000
Comments
Thanks for looking into this... that 27x speedup is quite tempting..... For 2), I believe the LOADMEM flag should accomplish the same thing... it offloads loading the program to the C++ DRAM model entirely, and happens instantaneously in simulated time. https://chipyard.readthedocs.io/en/latest/Simulation/Software-RTL-Simulation.html#fast-memory-loading For 3), I'm struggling to find the significant part of the diff between your verilog TestDriver and the one we use: https://github.com/chipsalliance/rocket-chip/blob/dev/src/main/resources/vsrc/TestDriver.v Could you clarify which changes you made to your TestDriver were significant? |
I am sorry, I've oversimplified the changes. About 2), you are right, To provide a bit of context, I tried to shave-off as much as unnecessary stuff as possible to run some bare metal tests on an RTL simulator I was working on. For instance, there is now effectively a single clock domain and no SimDTM (hence no DPI). I believe not all the changes in P.S. |
I'm more interested in simulation speedup opportunities given the same target configuration. I expect that minimizing the target design, as you have done in The flags we have chosen for verilator have not been optimized for performance, and I'd be very interested in learning more about how to tune verilator. The current |
Background Work
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:
WithoutTLMonitors
as stated in the documentation.$readmemhex
), see here.+verbose
in Verilog using a simplified all-Verilog harnessThe 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.The text was updated successfully, but these errors were encountered: