correct overflow-enable flags for rdmask specs in ALU
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 3 Jun 2020 11:43:25 +0000 (12:43 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 3 Jun 2020 11:43:25 +0000 (12:43 +0100)
src/soc/decoder/power_regspec_map.py
src/soc/fu/compunits/test/test_alu_compunit.py

index 662159a334d627537e47dcb7477c151175bdf2df..29f8e4b99b552efaa2f2ef09245fa4b08c464311 100644 (file)
@@ -70,11 +70,11 @@ def regspec_decode(e, regfile, name):
         CA = 1<<XERRegs.CA
         OV = 1<<XERRegs.OV
         if name == 'xer_so':
-            #return e.oe.oe & e.oe.oe_ok, SO, 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
-            return e.oe.oe & e.oe.oe_ok, OV, OV
         if name == 'xer_ca':
             return Const(1), CA, CA # TODO
             #return e.input_carry, CA, CA
index 87ba1bc757810548603fdbe58b1c497d6058e3f0..ff2adcc5626b6d45b0b45cffa307b48040284e07 100644 (file)
@@ -39,8 +39,8 @@ class ALUTestRunner(TestRunner):
             res['xer_ca'] = carry | (carry32<<1)
 
         # XER.so
-        oe = yield dec2.e.oe.data & dec2.e.oe.ok
-        if True: #oe:
+        oe = yield dec2.e.oe.data[0] & dec2.e.oe.ok
+        if oe:
             so = 1 if sim.spr['XER'][XER_bits['SO']] else 0
             res['xer_so'] = so