本文整理汇总了Python中machine.Machine.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Machine.execute方法的具体用法?Python Machine.execute怎么用?Python Machine.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类machine.Machine
的用法示例。
在下文中一共展示了Machine.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_execute_trap
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import execute [as 别名]
def test_execute_trap(self):
machine = Machine()
machine.loadProgram('Tomasulo/intUnit1.hex')
instruction = Instruction(0x44800003)
machine.issue(instruction)
machine.execute()
machine.execute()
示例2: process_start_trans_tape
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import execute [as 别名]
def process_start_trans_tape(start_status, transition, tape):
print("Transition:")
print(transition)
print("Tape:")
print(tape)
if not start_status:
machine = Machine(transition,tape)
else:
machine = Machine(transition,tape,start_status)
print("Execution:")
machine.execute()
示例3: test_execute
# 需要导入模块: from machine import Machine [as 别名]
# 或者: from machine.Machine import execute [as 别名]
def test_execute(self):
machine = Machine()
machine.loadProgram('Tomasulo/intUnit1.hex')
count = 0
while True:
instruc = machine.nextInstruction()
machine.execute()
machine.issue(instruc)
count += 1
machine.PC += 4
if instruc.isHalt():
break
self.assertEquals(count, 15)
rstations = machine.dumpRStations()