cr3_sel = yield dec2.e.read_cr3.data
res['cr_c'] = sim.crl[cr3_sel].get_range().value
- # RA
+ # RA/RC
reg1_ok = yield dec2.e.read_reg1.ok
+ reg3_ok = yield dec2.e.read_reg3.ok
if reg1_ok:
data1 = yield dec2.e.read_reg1.data
res['a'] = sim.gpr(data1).value
+ if reg3_ok:
+ data1 = yield dec2.e.read_reg3.data
+ res['a'] = sim.gpr(data1).value
# RB (or immediate)
reg2_ok = yield dec2.e.read_reg2.ok
data2 = yield dec2.e.read_reg2.data
res['b'] = sim.gpr(data2).value
+ print ("get inputs", res)
return res
def check_cu_outputs(self, res, dec2, sim, code):
"""naming (res) must conform to CRFunctionUnit output regspec
"""
- print ("check extra output", repr(code))
+ print ("check extra output", repr(code), res)
# full CR
whole_reg = yield dec2.e.write_cr_whole
if whole_reg:
full_cr = res['full_cr']
expected_cr = sim.cr.get_range().value
+ print(f"expected cr {expected_cr:x}, actual: {full_cr:x}")
self.assertEqual(expected_cr, full_cr, code)
# part-CR
def __init__(self, pspec):
super().__init__(pspec)
self.o = Data(64, name="o") # RA
- self.full_cr = Data(32, name="cr_out") # CR in
- self.cr = Data(4, name="cr_o")
+ self.full_cr = Data(32, name="full_cr")
+ self.cr = Data(4, name="cr")
def __iter__(self):
yield from super().__iter__()