propagate new use_svp64_ldst_dec mode through TestCore and TestIssuer
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 14:52:25 +0000 (15:52 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 14:52:25 +0000 (15:52 +0100)
src/soc/simple/core.py
src/soc/simple/issuer.py

index a95750ccdcca3651a28dcd392880e0e9395d238e..84555c37b5cf83ec0c3b099f15fa6d54090cd8aa 100644 (file)
@@ -112,6 +112,7 @@ class NonProductionCore(Elaboratable):
         if self.svp64_en:
             self.sv_rm = SVP64Rec(name="core_svp64_rm") # SVP64 RM field
             self.is_svp64_mode = Signal() # set if SVP64 mode is enabled
+            self.use_svp64_ldst_dec = Signal() # use alternative LDST decoder
             self.sv_pred_sm = Signal() # TODO: SIMD width
             self.sv_pred_dm = Signal() # TODO: SIMD width
 
@@ -173,6 +174,11 @@ class NonProductionCore(Elaboratable):
                 if k != self.trapunit:
                     comb += v.sv_rm.eq(self.sv_rm) # pass through SVP64 ReMap
                     comb += v.is_svp64_mode.eq(self.is_svp64_mode)
+                    # only the LDST PowerDecodeSubset *actually* needs to
+                    # know to use the alternative decoder.  this is all
+                    # a terrible hack
+                    if k.lower().startswith("ldst"):
+                        comb += v.use_svp64_ldst_dec.eq(self.use_svp64_ldst_dec)
 
         # ssh, cheat: trap uses the main decoder because of the rewriting
         self.des[self.trapunit] = self.e.do
index 879a455a5670107e4e5ee7f43a4f6a809bc70327..f28b45817a2133706b438ee1dda40e6ee06dc6bc 100644 (file)
@@ -748,6 +748,9 @@ class TestIssuerInternal(Elaboratable):
                     sync += core.sv_a_nz.eq(pdecode2.sv_a_nz)
                     # and svp64 detection
                     sync += core.is_svp64_mode.eq(is_svp64_mode)
+                    # and svp64 bit-rev'd ldst mode
+                    ldst_dec = pdecode2.use_svp64_ldst_dec
+                    sync += core.use_svp64_ldst_dec.eq(ldst_dec)
 
                 m.next = "INSN_EXECUTE"  # move to "execute"