X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fsoc%2Fsimple%2Ftest%2Ftest_issuer.py;h=b5799ecf1bc7af30f8f41b8a155f4138fa5bd1ef;hb=ab38260fedb13b7b83cf2dbec6aa2ce44e8e3e88;hp=4f5d2c6a0eebfe0e00fc1f3ec3358ca833c493df;hpb=0519cc7f173cd3f3cc6655bd3b02c12ea1a58e8d;p=soc.git diff --git a/src/soc/simple/test/test_issuer.py b/src/soc/simple/test/test_issuer.py index 4f5d2c6a..b5799ecf 100644 --- a/src/soc/simple/test/test_issuer.py +++ b/src/soc/simple/test/test_issuer.py @@ -36,27 +36,35 @@ from openpower.simulator.test_helloworld_sim import HelloTestCases if __name__ == "__main__": svp64 = True - if sys.argv[1] == 'nosvp64': + if len(sys.argv) > 1 and sys.argv[1] == 'nosvp64': svp64 = False del sys.argv[1] # detect overlap case allow_overlap = False - if sys.argv[1] == '--allow-overlap': + if len(sys.argv) >= 2 and sys.argv[1] == '--allow-overlap': allow_overlap = True del sys.argv[1] + # use in-order issuer, instead of the original FSM based one + inorder = False + if len(sys.argv) >= 2 and sys.argv[1] == '--inorder': + inorder = True + del sys.argv[1] + # allow list of testing to be selected by command-line - testing = sys.argv[1:] - sys.argv = sys.argv[:1] + testing = [] + for i in reversed(range(1, len(sys.argv))): + if not sys.argv[i].startswith('-'): + testing.append(sys.argv.pop(i)) if not testing: testing = ['general', 'ldst', 'cr', 'shiftrot', 'shiftrot2', 'logical', 'alu', 'branch', 'div', 'mul', 'hazard'] - print ("SVP64 test mode enabled", svp64, "overlap", - allow_overlap, "testing", testing) + print("SVP64 test mode enabled", svp64, "overlap", + allow_overlap, "in-order", inorder, "testing", testing) unittest.main(exit=False) suite = unittest.TestSuite() @@ -76,12 +84,12 @@ if __name__ == "__main__": 'alu': ALUTestCase().test_data, 'branch': BranchTestCase().test_data, 'spr': SPRTestCase().test_data - } + } # 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, inorder=inorder, allow_overlap=allow_overlap)) runner = unittest.TextTestRunner()