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 API
- VCD hierarchy does not match PySim's (missing
top
module) -
.gtkw
files are not written -
write_vcd(traces=)
are ignored - Reset values of undriven values are ignored
- Simulator-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-side
Memory
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 properly - Enumerated signals appear in their raw form in CXXRTL-generated VCD files
- Compilation fails out of box on macOS (Out-of-box CXXSim fails on MacOS #495); probably on other platforms too
- Display (Add support for Print in simulation #432)
- Assert (Add support for Assert in simulation #427)