from nmigen import Module, Signal
-from nmigen.back.pysim import Simulator, Delay, Settle
+from nmigen.back.pysim import Delay, Settle
+cxxsim = False
+if cxxsim:
+ from nmigen.sim.cxxsim import Simulator
+else:
+ from nmigen.back.pysim import Simulator
+
from nmutil.formaltest import FHDLTestCase
from nmigen.cli import rtlil
import unittest
yield from self.check_alu_outputs(alu, pdecode2, sim, code)
sim.add_sync_process(process)
- with sim.write_vcd("alu_simulator.vcd", "simulator.gtkw",
- traces=[]):
- sim.run()
+ if cxxsim:
+ sim.run()
+ else:
+ with sim.write_vcd("alu_simulator.vcd", "simulator.gtkw",
+ traces=[]):
+ sim.run()
def check_alu_outputs(self, alu, dec2, sim, code):