-
Notifications
You must be signed in to change notification settings - Fork 175
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
Integrate the CXXSim simulator #324
Comments
Before this commit, each simulation engine (which is only pysim at the moment, but also cxxsim soon) was a subclass of SimulatorCore, and every simulation engine module would essentially duplicate the complete structure of a simulator, with code partially shared. This was a really bad idea: it was inconvenient to use, with downstream code having to branch between e.g. PySettle and CxxSettle; it had no well-defined external interface; it had multiple virtually identical entry points; and it had no separation between simulation algorithms and glue code. This commit completely rearranges simulation code. 1. sim._base defines internal simulation interfaces. The clarity of these internal interfaces is important because simulation engines mix and match components to provide a consistent API regardless of the chosen engine. 2. sim.core defines the external simulation interface: the commands and the simulator facade. The facade provides a single entry point and, when possible, validates or lowers user input. It also imports built-in simulation engines by their symbolic name, avoiding eager imports of pyvcd or ctypes. 3. sim.xxxsim (currently, only sim.pysim) defines the simulator implementation: time and state management, process scheduling, and waveform dumping. The new simulator structure has none of the downsides of the old one. See #324.
This comment has been minimized.
This comment has been minimized.
CXXSim no longer ignores contract violations, and uses an appropriate method to reset the simulation. Prepending the |
VCD hierarchy in CXXSim and PySim now matches. |
CXXSim now writes GTKW files. |
CXXSim will not support race-free memory read/write operations; see #531 (comment) for details. |
I'm happy to have a look at it on mac when time is right.. |
A while ago I've implemented the Yosys cxxrtl backend, which is very similar to the current Python simulator conceptually while being significantly (10-100×) faster, competitive with Verilator.
nMigen should tightly integrate with this simulator, providing an interface identical to that of
nmigen.sim.pysim
.CXXSim is currently developed in the
cxxsim
branch. You are encouraged to try it and report results!Remaining tasks
See also #531 for Yosys-side view of these tasks.
Blockers (to be completed pre-merge)
-DNDEBUG
because RTL contract violations (e.g. out of bounds memory reads) must not crash the host Python process. CXXRTL's VCD library currently ignores contract violations inNDEBUG
builds, potentially hiding bugs.top
module).gtkw
files are not writtenwrite_vcd(traces=)
are ignoredMemory
reads/writes from Python testbenches are not implemented in CXXSim (cxxsim: directly initializing memory #564)Non-blockers (may be completed post-merge)
WIRE
does not trigger edge-sensitive logic connected to the clock; only driving clocks of typeVALUE
works properlyThe text was updated successfully, but these errors were encountered: