本文整理汇总了Python中control.Control.getSst方法的典型用法代码示例。如果您正苦于以下问题:Python Control.getSst方法的具体用法?Python Control.getSst怎么用?Python Control.getSst使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类control.Control
的用法示例。
在下文中一共展示了Control.getSst方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Pipelinecpu
# 需要导入模块: from control import Control [as 别名]
# 或者: from control.Control import getSst [as 别名]
#.........这里部分代码省略.........
'''
elif self.opcode == 9:
self.signalWPC = not(self.exe_mem.signalWreg & (self.exe_mem.signalSld |self.exe_mem.regD == self.readReg2))
self.signalWPC = int(self.signalWPC)
self.signalWIR = self.signalWPC
'''
if self.signalWPC:
self.pc = self.nextPC
else:
self.pc = self.pc
if self.signalWIR:
self.if_id.instruction = bin_instruction
self.if_id.inst = instruction
else:
self.if_id.instruction = self.if_id.instruction
self.if_id.inst = self.if_id.inst
return self.pc
## Instruction Decode Stage
def __cpuStageID(self):
#self.id_exe = self.if_id # Pipeline shift
## instruction Decode
self.opcode = (self.if_id.instruction & 0xFC000000) >> 26 # inst[31:26]
# Sets control based on opcode and zeroResult
self.control.signalIn(self.opcode, self.exe_mem.zeroResult)
self.readReg1 = (self.if_id.instruction & 0x001F0000) >> 16 # inst[20:16]
if self.control.getSst(): # store
self.readReg2 = (self.if_id.instruction & 0x03E00000) >> 21 #inst[25:21]
else:
self.readReg2 = (self.if_id.instruction & 0x0000001F) # inst[4:0]
# Forwarding Detect
self.__forwardingUnit()
self.id_exe.regD = ((self.if_id.instruction & 0x03E00000) >> 21) # rd
# Sets ID_EXE registers based on register data
self.signalShift = self.control.getShift()
if self.signalShift:
self.id_exe.readData1 = self.readReg1 # sa for shift instructions
else:
self.id_exe.readData1 = self.register.readRegister(self.readReg1)
self.id_exe.readData2 = self.register.readRegister(self.readReg2)
# Stores the necessary control bits in ID_EXE registers
self.id_exe.signalisStore = self.control.getisSTORE()
self.id_exe.signalBtaken = self.control.getBtaken()
self.id_exe.signalQDEPEN = int(self.signalQDEPEN)
self.id_exe.signalADEPEN = self.signalADEPEN
#print 'ADEPEN', self.id_exe.signalADEPEN
self.id_exe.signalBDEPEN = self.signalBDEPEN
#print 'BDEPEN', self.id_exe.signalBDEPEN
self.id_exe.signalAluOp = self.control.getAluOp()
#print 'ALUOP', self.id_exe.signalAluOp
self.id_exe.signalWz = self.control.getWz() & (self.signalLOADDEPEN | (self.opcode == 9)) & (not self.exe_mem.signalBtaken)
self.id_exe.signalWreg = self.control.getWreg() & (self.signalLOADDEPEN | (self.opcode == 9)) & (not self.exe_mem.signalBtaken)
self.id_exe.signalWmem = self.control.getWmem() & (self.signalLOADDEPEN | (self.opcode == 9)) & (not self.exe_mem.signalBtaken)
self.id_exe.signalSld = self.control.getSld()
self.id_exe.inst = self.if_id.inst