本文整理汇总了Python中pipeline.Pipeline.print_registers方法的典型用法代码示例。如果您正苦于以下问题:Python Pipeline.print_registers方法的具体用法?Python Pipeline.print_registers怎么用?Python Pipeline.print_registers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pipeline.Pipeline
的用法示例。
在下文中一共展示了Pipeline.print_registers方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testPrintRegisters
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import print_registers [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: Pipeline
# 需要导入模块: from pipeline import Pipeline [as 别名]
# 或者: from pipeline.Pipeline import print_registers [as 别名]
import sys
from pipeline import Pipeline
file_name = 'input4.txt'#input('Enter the name of the input data file: ')
pipeline = Pipeline(file_name)
timing_file = 't.1'#input('Enter the name of the timing file: ')
#sys.stdout = open(timing_file, 'w')
pipeline.execute_instructions()
pipeline.print_timing()
#sys.stdout.close()
register_file = 'r.1'#input('Enter the name of the register file: ')
#sys.stdout = open(register_file, 'w')
pipeline.print_registers()
#sys.stdout.close()