"""
from nmigen import Const
from soc.regfile.regfiles import XERRegs, FastRegs
+from soc.decoder.power_enums import CryIn
def regspec_decode(e, regfile, name):
OV = 1<<XERRegs.OV
if name == 'xer_so':
return e.oe.oe[0] & e.oe.oe_ok, SO, SO
- return Const(1), SO, SO # TODO
if name == 'xer_ov':
return e.oe.oe[0] & e.oe.oe_ok, OV, OV
- return Const(1), OV, OV # TODO
if name == 'xer_ca':
- return Const(1), CA, CA # TODO
- #return e.input_carry, CA, CA
+ return (e.input_carry == CryIn.CA.value), CA, CA
if regfile == 'FAST':
# FAST register numbering is *unary* encoded
from soc.fu.compunits.compunits import ALUFunctionUnit
from soc.fu.compunits.test.test_compunit import TestRunner
+from soc.decoder.power_enums import CryIn
+
class ALUTestRunner(TestRunner):
def __init__(self, test_data):
# XER.ca
cry_in = yield dec2.e.input_carry
- if True: #cry_in:
+ if cry_in == CryIn.CA.value:
carry = 1 if sim.spr['XER'][XER_bits['CA']] else 0
carry32 = 1 if sim.spr['XER'][XER_bits['CA32']] else 0
res['xer_ca'] = carry | (carry32<<1)