debugging test_issuer.py general test cases
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Jun 2020 10:26:35 +0000 (11:26 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 18 Jun 2020 10:26:35 +0000 (11:26 +0100)
src/soc/simple/test/test_issuer.py
src/soc/simulator/test_sim.py

index b3a50c0a9c311bb19ac63d01a44ba9ea78f2b86a..953525e333098bcd13cd8d1bf7f33e36da3303e8 100644 (file)
@@ -30,6 +30,7 @@ from soc.fu.shift_rot.test.test_pipe_caller import ShiftRotTestCase
 from soc.fu.cr.test.test_pipe_caller import CRTestCase
 from soc.fu.branch.test.test_pipe_caller import BranchTestCase
 from soc.fu.ldst.test.test_pipe_caller import LDSTTestCase
+from soc.simulator.test_sim import GeneralTestCases
 
 
 def setup_i_memory(imem, startaddr, instructions):
@@ -74,9 +75,15 @@ class TestRunner(FHDLTestCase):
                 print(test.name)
                 program = test.program
                 self.subTest(test.name)
+                print ("regs", test.regs)
+                print ("sprs", test.sprs)
+                print ("cr", test.cr)
+                print ("mem", test.mem)
+                print ("msr", test.msr)
+                print ("assem", program.assembly)
                 sim = ISA(pdecode2, test.regs, test.sprs, test.cr, test.mem,
                           test.msr)
-                gen = program.generate_instructions()
+                gen = list(program.generate_instructions())
                 instructions = list(zip(gen, program.assembly.splitlines()))
 
                 pc = 0 # start address
@@ -126,6 +133,7 @@ class TestRunner(FHDLTestCase):
 if __name__ == "__main__":
     unittest.main(exit=False)
     suite = unittest.TestSuite()
+    #suite.addTest(TestRunner(GeneralTestCases.test_data))
     suite.addTest(TestRunner(LDSTTestCase.test_data))
     suite.addTest(TestRunner(CRTestCase.test_data))
     suite.addTest(TestRunner(ShiftRotTestCase.test_data))
index 78afefaa3723292430d91d8c10ab2e3e2aee8b68..9ab807d6094de356427829969d5aa8eea48b90bd 100644 (file)
@@ -201,6 +201,7 @@ class GeneralTestCases(FHDLTestCase):
 
     def run_tst_program(self, prog, initial_regs=None, initial_sprs=None,
                                     initial_mem=None):
+        initial_regs = [0] * 32
         tc = TestCase(prog, self.test_name, initial_regs, initial_sprs, 0,
                                             initial_mem, 0)
         self.test_data.append(tc)