add option to test_issuer.py to allow for overlapping issue of
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 17 Nov 2021 16:23:45 +0000 (16:23 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 17 Nov 2021 16:23:45 +0000 (16:23 +0000)
instructions.  this is for Core hazard detection prior to moving to
an in-order core

src/soc/simple/test/test_issuer.py
src/soc/simple/test/test_runner.py

index 1e90784f9a3cbcd2536bfc8640c7f30d83fdc4b7..4f5d2c6a0eebfe0e00fc1f3ec3358ca833c493df 100644 (file)
@@ -36,10 +36,15 @@ from openpower.simulator.test_helloworld_sim import HelloTestCases
 
 if __name__ == "__main__":
     svp64 = True
-    if len(sys.argv) == 2:
-        if sys.argv[1] == 'nosvp64':
-            svp64 = False
-        sys.argv.pop()
+    if sys.argv[1] == 'nosvp64':
+        svp64 = False
+        del sys.argv[1]
+
+    # detect overlap case
+    allow_overlap = False
+    if sys.argv[1] == '--allow-overlap':
+        allow_overlap = True
+        del sys.argv[1]
 
     # allow list of testing to be selected by command-line
     testing = sys.argv[1:]
@@ -50,7 +55,8 @@ if __name__ == "__main__":
                    'logical', 'alu',
                    'branch', 'div', 'mul', 'hazard']
 
-    print ("SVP64 test mode enabled", svp64, testing)
+    print ("SVP64 test mode enabled", svp64, "overlap",
+                                      allow_overlap, "testing", testing)
 
     unittest.main(exit=False)
     suite = unittest.TestSuite()
@@ -75,7 +81,8 @@ if __name__ == "__main__":
     # walk through all tests, those requested get added
     for tname, data in tests.items():
         if tname in testing:
-            suite.addTest(TestRunner(data, svp64=svp64))
+            suite.addTest(TestRunner(data, svp64=svp64,
+                                     allow_overlap=allow_overlap))
 
     runner = unittest.TextTestRunner()
     runner.run(suite)
index 8558303f730d48a6ae37ed2377dfe64ac5714c54..1316b982baaae6dff68eba4c295874ca78bb7bb1 100644 (file)
@@ -277,10 +277,12 @@ class HDLRunner(StateRunner):
 
 class TestRunner(TestRunnerBase):
     def __init__(self, tst_data, microwatt_mmu=False, rom=None,
-                        svp64=True, run_hdl=True, run_sim=True):
+                        svp64=True, run_hdl=True, run_sim=True,
+                        allow_overlap=False):
         if run_hdl:
             run_hdl = HDLRunner
         super().__init__(tst_data, microwatt_mmu=microwatt_mmu,
                         rom=rom,
-                        svp64=svp64, run_hdl=run_hdl, run_sim=run_sim)
+                        svp64=svp64, run_hdl=run_hdl, run_sim=run_sim,
+                        allow_overlap=False)