Skip to content

Integrate the CXXSim simulator #324

Open
@whitequark

Description

@whitequark

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 in NDEBUG 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)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions