corrections to dd-ffirst tests when VLi=0, the write to regfile
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 11 May 2023 20:02:37 +0000 (21:02 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 2 Jun 2023 18:51:18 +0000 (19:51 +0100)
is *not* carried out on the failed test. but Rc=1 does (TODO)

src/openpower/decoder/isa/test_caller_svp64_dd_ffirst.py

index 40e31b1c9a64d5abb92bdb527653ab95d686b235..200e7d81f181c3321d680a864b8b2ded676b2e7c 100644 (file)
@@ -47,9 +47,10 @@ class DecoderTestCase(FHDLTestCase):
             expected_vl = 0
             for i in range(4):
                 result = expected[i] - gprs[8]
-                expected[i] = result
                 if result <= 0:
                     break
+                # VLi=0 - test comes FIRST!
+                expected[i] = result
                 # only write out if successful
                 expected_vl += 1
             for i, v in enumerate(res):
@@ -91,9 +92,10 @@ class DecoderTestCase(FHDLTestCase):
             expected = deepcopy(vec)
             for i in range(4):
                 result = expected[i] - gprs[8]
-                expected[i] = result
                 if result == 0:
                     break
+                # VLi=0 - test comes FIRST!
+                expected[i] = result
             for i, v in enumerate(res):
                 self.assertEqual(v, expected[i])
 
@@ -133,9 +135,10 @@ class DecoderTestCase(FHDLTestCase):
             expected = deepcopy(vec)
             for i in range(4):
                 result = expected[i] - gprs[8]
-                expected[i] = result
                 if result == 0:
                     break
+                # VLi=0 - test comes FIRST!
+                expected[i] = result
             for i, v in enumerate(res):
                 self.assertEqual(v, expected[i])
 
@@ -145,6 +148,8 @@ class DecoderTestCase(FHDLTestCase):
             self.assertEqual(sim.svstate.dststep, 0)
 
     def test_sv_addi_ffirst_vli(self):
+        """data-dependent fail-first with VLi=1, the test comes *after* write
+        """
         lst = SVP64Asm(["sv.subf/ff=RC1/vli *0,8,*0"
                         ])
         lst = list(lst)
@@ -174,6 +179,7 @@ class DecoderTestCase(FHDLTestCase):
             # confirm that the results are as expected
             expected = deepcopy(vec)
             for i in range(4):
+                # VLi=1 - test comes AFTER write!
                 expected[i] -= gprs[8]
                 if expected[i] == 0:
                     break