CA = 1<<XERRegs.CA
OV = 1<<XERRegs.OV
if name == 'xer_so':
- return (e.do.oe.oe[0] & e.do.oe.oe_ok) | e.xer_in, SO
+ # SO needs to be read for overflow *and* for creation
+ # of CR0 and also for MFSPR
+ return ((e.do.oe.oe[0] & e.do.oe.oe_ok) | e.xer_in |
+ (e.do.rc.rc & e.do.rc.ok)), SO
if name == 'xer_ov':
return (e.do.oe.oe[0] & e.do.oe.oe_ok) | e.xer_in, OV
if name == 'xer_ca':
res['xer_ov'] = expected_ov | (expected_ov32 << 1)
def get_sim_xer_so(res, sim, dec2):
- yield
- #oe = yield dec2.e.do.oe.oe
- #oe_ok = yield dec2.e.do.oe.ok
- #xer_in = yield dec2.e.xer_in
- #if xer_in or (oe and oe_ok):
- res['xer_so'] = 1 if sim.spr['XER'][XER_bits['SO']] else 0
+ print ("XER", sim.spr.__class__, sim.spr, sim.spr['XER'])
+ oe = yield dec2.e.do.oe.oe
+ oe_ok = yield dec2.e.do.oe.ok
+ xer_in = yield dec2.e.xer_in
+ rc = yield dec2.e.do.rc.rc
+ rc_ok = yield dec2.e.do.rc.ok
+ if xer_in or (oe and oe_ok) or (rc and rc_ok):
+ res['xer_so'] = 1 if sim.spr['XER'][XER_bits['SO']] else 0
def check_slow_spr1(dut, res, sim_o, msg):
if 'spr1' in res: