本文整理汇总了Python中myhdl.Simulation.quit方法的典型用法代码示例。如果您正苦于以下问题:Python Simulation.quit方法的具体用法?Python Simulation.quit怎么用?Python Simulation.quit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myhdl.Simulation
的用法示例。
在下文中一共展示了Simulation.quit方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: issue_104_multiple_instance
# 需要导入模块: from myhdl import Simulation [as 别名]
# 或者: from myhdl.Simulation import quit [as 别名]
def issue_104_multiple_instance():
sim1 = Simulation(test())
sim1.run(1000)
# sim1 is "puased"
# try and create a second, third, forth simulation instance
for ii in range(4):
with raises_kind(SimulationError, _error.MultipleSim):
another_sim = Simulation(test())
# generating more sims should have failed
sim1.run(1000)
sim1.quit()
示例2: testBackupOutputFile
# 需要导入模块: from myhdl import Simulation [as 别名]
# 或者: from myhdl.Simulation import quit [as 别名]
def testBackupOutputFile(self, vcd_dir):
p = "%s.vcd" % fun.__name__
dut = traceSignals(fun)
sim = Simulation(dut)
sim.run(1000, quiet=QUIET)
sim.quit()
_simulator._tf.close()
_simulator._tracing = 0
size = path.getsize(p)
pbak = p + '.' + str(path.getmtime(p))
assert not path.exists(pbak)
dut = traceSignals(fun)
_simulator._tf.close()
_simulator._tracing = 0
assert path.exists(p)
assert path.exists(pbak)
assert path.getsize(pbak) == size
assert path.getsize(p) < size
示例3: run
# 需要导入模块: from myhdl import Simulation [as 别名]
# 或者: from myhdl.Simulation import quit [as 别名]
def run(self):
""" Start the MyHDL Simulation.
This function will start the myhdl simulator. The myhdl simulator
will run in a separate thread (this object). The outside world will
interact with the HDL simulator enviroment through the Read/Write
functions. These functions will send buffers (lists) to be read or
written to the simulation enviornment.
"""
gens = []
# use the module/function wrapper for tracing
tb_intf = slave_fifo(self, self.fx2_bus)
@always(self._stop.posedge)
def tb_mon():
raise StopSimulation
tb_intf.config_sim(trace=self.trace)
gens = [tb_intf, tb_mon, self.g]
sim = Simulation(gens)
sim.run()
sim.quit()
示例4: testTristateTrace
# 需要导入模块: from myhdl import Simulation [as 别名]
# 或者: from myhdl.Simulation import quit [as 别名]
def testTristateTrace(self, vcd_dir):
sim = Simulation(topTristate())
sim.run(100, quiet=QUIET)
sim.quit()
示例5: Signal
# 需要导入模块: from myhdl import Simulation [as 别名]
# 或者: from myhdl.Simulation import quit [as 别名]
pixel = [1, 0, 0]
clock = Signal(bool(0))
clock_drive = clock_driver(clock)
video_interface = VideoInterface(clock, res)
@instance
def test():
video_interface.reset_cursor()
video_interface.enable_video()
# iterating over the frame
for _ in range(res[0]*res[1]):
# Sending a pixel
yield video_interface.write_pixel(pixel), \
video_interface.read_pixel()
assert video_interface.get_pixel() == pixel
video_interface.disable_video()
return clock_drive, test
test_inst = test_video_interface()
sim = Simulation(test_inst)
sim.run(10000)
sim.quit()
示例6: issue_104_quit_method
# 需要导入模块: from myhdl import Simulation [as 别名]
# 或者: from myhdl.Simulation import quit [as 别名]
def issue_104_quit_method():
sim = Simulation(test())
sim.run(1000)
sim.run(500)
sim.quit()
return sim._finished