本文整理汇总了Python中pipeline.Pipeline.FPRegs['F2']方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.FPRegs['F2']方法的具体用法?Python Pipeline.FPRegs['F2']怎么用?Python Pipeline.FPRegs['F2']使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pipeline.Pipeline
的用法示例。
在下文中一共展示了Pipeline.FPRegs['F2']方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testPrintRegisters
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import FPRegs['F2'] [as 别名]
def testPrintRegisters(self):
pipeline = Pipeline('', False)
pipeline.FPRegs['F25'] = 15
pipeline.FPRegs['F2'] = 15.89
pipeline.FPRegs['F7'] = 78.56
sys.stdout = open('test.1', 'w')
pipeline.print_registers()
sys.stdout.close()
reg_file = open('test.1')
file_contents = reg_file.read()
self.assertEqual(file_contents, "F2 F7 F25 \n15.89 78.56 15 \n")
reg_file.close()
try:
os.remove('test.1')
except OSError:
pass
示例2: testMultInstr
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import FPRegs['F2'] [as 别名]
def testMultInstr(self):
pipeline = Pipeline('ADD.D F1, F2, F3', False)
pipeline.FPRegs['F2'] = 2
pipeline.FPRegs['F3'] = 3
pipeline.mult_instr(1)
self.assertEqual(pipeline.FPRegs['F1'], 6)
示例3: testSubInstr
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import FPRegs['F2'] [as 别名]
def testSubInstr(self):
pipeline = Pipeline('ADD.D F1, F2, F3', False)
pipeline.FPRegs['F2'] = 2
pipeline.FPRegs['F3'] = 2
pipeline.sub_instr(1)
self.assertEqual(pipeline.FPRegs['F1'], 0)