def simulation_test(dut, process):
- with Simulator(dut, vcd_file=open("test.vcd", "w")) as sim:
- sim.add_clock(1e-6)
- sim.add_sync_process(process)
+ sim = Simulator(dut)
+ sim.add_clock(1e-6)
+ sim.add_sync_process(process)
+ with sim.write_vcd("test.vcd"):
sim.run()
def simulation_test(dut, process):
- with Simulator(dut, vcd_file=open("test.vcd", "w")) as sim:
- sim.add_clock(1e-6)
- sim.add_sync_process(process)
+ sim = Simulator(dut)
+ sim.add_clock(1e-6)
+ sim.add_sync_process(process)
+ with sim.write_vcd("test.vcd"):
sim.run()
yield Delay(1e-6)
self.assertEqual((yield dut.ip), 0b11)
- with Simulator(dut, vcd_file=open("test.vcd", "w")) as sim:
- sim.add_process(process)
+ sim = Simulator(dut)
+ sim.add_process(process)
+ with sim.write_vcd("test.vcd"):
sim.run()
self.assertEqual(rx_data, 0xab)
yield
- with Simulator(m, vcd_file=open("test.vcd", "w")) as sim:
- sim.add_clock(1e-6)
- sim.add_sync_process(process)
+ sim = Simulator(m)
+ sim.add_clock(1e-6)
+ sim.add_sync_process(process)
+ with sim.write_vcd("test.vcd"):
sim.run()
def simulation_test(dut, process):
- with Simulator(dut, vcd_file=open("test.vcd", "w")) as sim:
- sim.add_clock(1e-6)
- sim.add_sync_process(process)
+ sim = Simulator(dut)
+ sim.add_clock(1e-6)
+ sim.add_sync_process(process)
+ with sim.write_vcd("test.vcd"):
sim.run()
def simulation_test(dut, process):
- with Simulator(dut, vcd_file=open("test.vcd", "w")) as sim:
- sim.add_clock(1e-6)
- sim.add_sync_process(process)
+ sim = Simulator(dut)
+ sim.add_clock(1e-6)
+ sim.add_sync_process(process)
+ with sim.write_vcd("test.vcd"):
sim.run()