Open
Description
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)
- CXXSim currently builds with
-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.CXXRTL design is reset (in response to a simulator reset) in an unreliable way because of missing CXXRTL-side APIVCD hierarchy does not match PySim's (missingtop
module).gtkw
files are not writtenwrite_vcd(traces=)
are ignoredReset values of undriven values are ignoredSimulator-only signals are not present in VCD files (cxxsim: simulator-only signals not included in VCD and GTKWave files #556)Resetting CXXRTL design corrupts debug information (cxxsim: random garbage in memory traces #565)CXXRTL-sideMemory
reads/writes from Python testbenches are not implemented in CXXSim (cxxsim: directly initializing memory #564)Python testbenches trying to wait on CXXRTL values of certain types trigger assertion failures
Non-blockers (may be completed post-merge)
- Driving CXXRTL-side clocks of type
WIRE
does not trigger edge-sensitive logic connected to the clock; only driving clocks of typeVALUE
works properlyEnumerated signals appear in their raw form in CXXRTL-generated VCD filesCompilation fails out of box on macOS (Out-of-box CXXSim fails on MacOS #495); probably on other platforms tooDisplay (Add support for Print in simulation #432)
Activity
sim: split into base, core, and engines.
cestrauss commentedon Nov 6, 2020
[-]Integrate cxxrtl simulator[/-][+]Integrate the CXXSim simulator[/+]whitequark commentedon Dec 3, 2020
CXXSim no longer ignores contract violations, and uses an appropriate method to reset the simulation.
Prepending the
top
module in CXXSim VCD files will require upstream changes, see new task in #531.whitequark commentedon Dec 3, 2020
VCD hierarchy in CXXSim and PySim now matches.
whitequark commentedon Dec 5, 2020
CXXSim now writes GTKW files.
whitequark commentedon Dec 8, 2020
CXXSim will not support race-free memory read/write operations; see #531 (comment) for details.
robtaylor commentedon Aug 16, 2022
I'm happy to have a look at it on mac when time is right..