add an explicit PowerDecoder.is_svp64_mode flag to help with detection
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 12:26:19 +0000 (13:26 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 12:26:26 +0000 (13:26 +0100)
src/soc/simple/core.py
src/soc/simple/issuer.py

index 842b5eac81e525f19fe317d531398a6c6fb57474..a95750ccdcca3651a28dcd392880e0e9395d238e 100644 (file)
@@ -111,6 +111,7 @@ class NonProductionCore(Elaboratable):
         self.bigendian_i = Signal() # bigendian - TODO, set by MSR.BE
         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.sv_pred_sm = Signal() # TODO: SIMD width
             self.sv_pred_dm = Signal() # TODO: SIMD width
 
@@ -131,6 +132,7 @@ class NonProductionCore(Elaboratable):
             fnunit = fu.fnunit.value
             opkls = fu.opsubsetkls
             if f_name == 'TRAP':
+                # TRAP decoder is the *main* decoder
                 self.trapunit = funame
                 continue
             self.decoders[funame] = PowerDecodeSubset(None, opkls, f_name,
@@ -170,6 +172,7 @@ class NonProductionCore(Elaboratable):
                 comb += v.pred_dm.eq(self.sv_pred_dm)
                 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)
 
         # ssh, cheat: trap uses the main decoder because of the rewriting
         self.des[self.trapunit] = self.e.do
index 8bf44ae62f35a935a9ccf667d93b7c370a943468..879a455a5670107e4e5ee7f43a4f6a809bc70327 100644 (file)
@@ -337,6 +337,7 @@ class TestIssuerInternal(Elaboratable):
                         comb += svp64.bigendian.eq(self.core_bigendian_i)
                         # pass the decoded prefix (if any) to PowerDecoder2
                         sync += pdecode2.sv_rm.eq(svp64.svp64_rm)
+                        sync += pdecode2.is_svp64_mode.eq(is_svp64_mode)
                         # remember whether this is a prefixed instruction, so
                         # the FSM can readily loop when VL==0
                         sync += is_svp64_mode.eq(svp64.is_svp64_mode)
@@ -745,6 +746,8 @@ class TestIssuerInternal(Elaboratable):
                     sync += core.sv_rm.eq(pdecode2.sv_rm)
                     # set RA_OR_ZERO detection in satellite decoders
                     sync += core.sv_a_nz.eq(pdecode2.sv_a_nz)
+                    # and svp64 detection
+                    sync += core.is_svp64_mode.eq(is_svp64_mode)
 
                 m.next = "INSN_EXECUTE"  # move to "execute"