re-add rc/oe back into LDST input record
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 10 Jul 2020 13:30:28 +0000 (14:30 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 10 Jul 2020 13:30:28 +0000 (14:30 +0100)
this for later use with st*cx because it writes CR and OV (and SO)

src/soc/fu/compunits/test/test_compunit.py
src/soc/fu/compunits/test/test_ldst_compunit.py
src/soc/fu/ldst/ldst_input_record.py
src/soc/fu/ldst/test/test_pipe_caller.py

index 7fcea29eef4c9c9ddcecb3d0e1f4fe81b63ea412..cffa0316e04eb7cfa6ed7f7414eecb94c06d3c1e 100644 (file)
@@ -286,12 +286,17 @@ class TestRunner(FHDLTestCase):
                     if self.funit == Function.LDST:
                         yield from dump_sim_memory(self, l0, sim, code)
 
-                    yield from self.iodef.check_cu_outputs(res, pdecode2,
-                                                            sim, cu.alu, code)
 
                     # sigh.  hard-coded.  test memory
                     if self.funit == Function.LDST:
                         yield from check_sim_memory(self, l0, sim, code)
+                        yield from self.iodef.check_cu_outputs(res, pdecode2,
+                                                                sim, cu,
+                                                                code)
+                    else:
+                        yield from self.iodef.check_cu_outputs(res, pdecode2,
+                                                                sim, cu.alu,
+                                                                code)
 
 
         sim.add_sync_process(process)
index 921a4d286ee2d2bee7e81a477a3201e74925c27e..7cbf6d90afc96464dac2ce0c94657edaab45f853 100644 (file)
@@ -25,8 +25,8 @@ class LDSTTestRunner(TestRunner):
 
         print ("check cu outputs", code, res)
 
-        rc = yield dec2.e.rc.data
-        op = yield dec2.e.insn_type
+        rc = yield dec2.e.do.rc.data
+        op = yield dec2.e.do.insn_type
         cridx_ok = yield dec2.e.write_cr.ok
         cridx = yield dec2.e.write_cr.data
 
index 58e8f100f41c1eaac24037e69207b8cc3ea673b1..244f6789aaf955ff41ff4edce6497a75a7536ed8 100644 (file)
@@ -9,11 +9,15 @@ class CompLDSTOpSubset(Record):
     a copy of the relevant subset information from Decode2Execute1Type
     needed for LD/ST operations.  use with eq_from_execute1 (below) to
     grab subsets.
+
+    note: rc / oe is needed (later) for st*cx when it comes to setting OV/SO
     """
     def __init__(self, name=None):
         layout = (('insn_type', InternalOp),
                   ('imm_data', Layout((("imm", 64), ("imm_ok", 1)))),
                   ('zero_a', 1),
+                  ('rc', Layout((("rc", 1), ("rc_ok", 1)))), # for later
+                  ('oe', Layout((("oe", 1), ("oe_ok", 1)))), # for later
                   ('is_32bit', 1),
                   ('is_signed', 1),
                   ('data_len', 4),
index 247b0e061547703423f6f6b8e1fe3b1de01ae799..5e41cbf33eb6ee7d97036aa8a6a7e4e5870f84b0 100644 (file)
@@ -41,7 +41,7 @@ def get_cu_inputs(dec2, sim):
         res['rc'] = sim.gpr(data3).value
 
     # XER.so
-    oe = yield dec2.e.oe.data[0] & dec2.e.oe.ok
+    oe = yield dec2.e.do.oe.data[0] & dec2.e.do.oe.ok
     if oe:
         so = 1 if sim.spr['XER'][XER_bits['SO']] else 0
         res['xer_so'] = so