From 0519cc7f173cd3f3cc6655bd3b02c12ea1a58e8d Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 17 Nov 2021 16:23:45 +0000 Subject: [PATCH] add option to test_issuer.py to allow for overlapping issue of instructions. this is for Core hazard detection prior to moving to an in-order core --- src/soc/simple/test/test_issuer.py | 19 +++++++++++++------ src/soc/simple/test/test_runner.py | 6 ++++-- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/soc/simple/test/test_issuer.py b/src/soc/simple/test/test_issuer.py index 1e90784f..4f5d2c6a 100644 --- a/src/soc/simple/test/test_issuer.py +++ b/src/soc/simple/test/test_issuer.py @@ -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) diff --git a/src/soc/simple/test/test_runner.py b/src/soc/simple/test/test_runner.py index 8558303f..1316b982 100644 --- a/src/soc/simple/test/test_runner.py +++ b/src/soc/simple/test/test_runner.py @@ -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) -- 2.30.2