本文整理匯總了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()