add in predicate mask bit detection when zeroing is enabled
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 6 May 2021 17:45:43 +0000 (18:45 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 6 May 2021 17:45:43 +0000 (18:45 +0100)
src/soc/simple/core.py
src/soc/simple/issuer.py
src/soc/simple/test/test_issuer.py

index 0db5dfa5272d651f04b286aa0831477dd2d55d78..842b5eac81e525f19fe317d531398a6c6fb57474 100644 (file)
@@ -111,6 +111,8 @@ 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.sv_pred_sm = Signal() # TODO: SIMD width
+            self.sv_pred_dm = Signal() # TODO: SIMD width
 
         # issue/valid/busy signalling
         self.ivalid_i = Signal(reset_less=True) # instruction is valid
@@ -163,8 +165,11 @@ class NonProductionCore(Elaboratable):
             comb += v.dec.bigendian.eq(self.bigendian_i)
             # sigh due to SVP64 RA_OR_ZERO detection connect these too
             comb += v.sv_a_nz.eq(self.sv_a_nz)
-            if self.svp64_en and k != self.trapunit:
-                comb += v.sv_rm.eq(self.sv_rm) # pass through SVP64 ReMap
+            if self.svp64_en:
+                comb += v.pred_sm.eq(self.sv_pred_sm)
+                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
 
         # ssh, cheat: trap uses the main decoder because of the rewriting
         self.des[self.trapunit] = self.e.do
index 21e185286b9098f541b66c91020e75f9e980892b..44bf3b6823484ad34a91de09e4cb584b17da086f 100644 (file)
@@ -731,9 +731,15 @@ class TestIssuerInternal(Elaboratable):
                 sync += core.state.eq(cur_state)
                 sync += core.raw_insn_i.eq(dec_opcode_i)
                 sync += core.bigendian_i.eq(self.core_bigendian_i)
-                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)
+                if self.svp64_en:
+                    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)
+                    # pass predicate mask bits through to satellite decoders
+                    # TODO: for SIMD this will be *multiple* bits
+                    sync += core.sv_pred_sm.eq(self.srcmask[0])
+                    sync += core.sv_pred_dm.eq(self.dstmask[0])
+
                 m.next = "INSN_EXECUTE"  # move to "execute"
 
             # handshake with execution FSM, move to "wait" once acknowledged
index ebc529fcada9f0a3b60d2fee463890f477955f21..8694ba927a7ccd058af0623edb8186d210a3f286 100644 (file)
@@ -43,15 +43,15 @@ if __name__ == "__main__":
     unittest.main(exit=False)
     suite = unittest.TestSuite()
     # suite.addTest(TestRunner(HelloTestCases.test_data, svp64=svp64))
-    suite.addTest(TestRunner(DivTestCases().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(DivTestCases().test_data, svp64=svp64))
     # suite.addTest(TestRunner(AttnTestCase.test_data, svp64=svp64))
     suite.addTest(TestRunner(GeneralTestCases.test_data, svp64=svp64))
-    suite.addTest(TestRunner(LDSTTestCase().test_data, svp64=svp64))
-    suite.addTest(TestRunner(CRTestCase().test_data, svp64=svp64))
-    suite.addTest(TestRunner(ShiftRotTestCase().test_data, svp64=svp64))
-    suite.addTest(TestRunner(LogicalTestCase().test_data, svp64=svp64))
-    suite.addTest(TestRunner(ALUTestCase().test_data, svp64=svp64))
-    suite.addTest(TestRunner(BranchTestCase().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(LDSTTestCase().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(CRTestCase().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(ShiftRotTestCase().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(LogicalTestCase().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(ALUTestCase().test_data, svp64=svp64))
+    #suite.addTest(TestRunner(BranchTestCase().test_data, svp64=svp64))
     # suite.addTest(TestRunner(SPRTestCase.test_data, svp64=svp64))
 
     runner = unittest.TextTestRunner()