self.rc = Data(1, "rc")
self.oe = Data(1, "oe")
self.input_carry = Signal(CryIn, reset_less=True)
+ self.output_carry = Signal(reset_less=True)
self.traptype = Signal(TT.size, reset_less=True) # trap main_stage.py
self.ldst_exc = LDSTException("exc")
self.trapaddr = Signal(13, reset_less=True)
CA = 1<<XERRegsEnum.CA
OV = 1<<XERRegsEnum.OV
if name == 'xer_so':
- return e.xer_out, SO # hmmm
+ return (e.xer_out | (e.do.oe.oe[0] & e.do.oe.ok),
+ SO) # hmmm
if name == 'xer_ov':
- return e.xer_out, OV # hmmm
+ return (e.xer_out | (e.do.oe.oe[0] & e.do.oe.ok),
+ OV) # hmmm
if name == 'xer_ca':
- return e.xer_out, CA # hmmm
+ return (e.xer_out | (e.do.output_carry),
+ CA) # hmmm
# STATE regfile
self.add_case(Program(lst, bigendian),
initial_regs, initial_sprs)
+ def case_addme_ca_so_4(self):
+ """test of SO being set
+ """
+ lst = ["addmeo. 6, 16"]
+ initial_regs = [0] * 32
+ initial_regs[16] = 0x7fffffffffffffff
+ initial_sprs = {}
+ xer = SelectableInt(0, 64)
+ xer[XER_bits['CA']] = 1
+ initial_sprs[special_sprs['XER']] = xer
+ self.add_case(Program(lst, bigendian),
+ initial_regs, initial_sprs)
+
def case_addme_ca_so_3(self):
"""bug where SO does not get passed through to CR0
"""