add debug print statements, re-enable all tests in simple core
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Jun 2020 20:20:37 +0000 (21:20 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Jun 2020 20:20:46 +0000 (21:20 +0100)
src/soc/fu/cr/test/test_pipe_caller.py
src/soc/simple/test/test_core.py

index 82685432940dc9b3e98f69e3a6a5edfa69f200c2..7bf1e260ed4b7ab471abff5071682e475bd3ea89 100644 (file)
@@ -223,9 +223,11 @@ class TestRunner(FHDLTestCase):
             self.assertEqual(expected_cr, full_cr, code)
         elif cr_en:
             cr_sel = yield dec2.e.write_cr.data
+            expected_cr = simulator.cr.get_range().value
+            print(f"CR whole: {expected_cr:x}, sel {cr_sel}")
             expected_cr = simulator.crl[cr_sel].get_range().value
             real_cr = yield alu.n.data_o.cr.data
-            print(f"CR whole: expected {expected_cr:x}, actual: {real_cr:x}")
+            print(f"CR part: expected {expected_cr:x}, actual: {real_cr:x}")
             self.assertEqual(expected_cr, real_cr, code)
         alu_out = yield alu.n.data_o.o.data
         out_reg_valid = yield dec2.e.write_reg.ok
index cd8ca928e74de72f30ef57a0b2586993ee532892..a1e94ba94f3048ea045fe055f1ecff238ce16e24 100644 (file)
@@ -169,8 +169,8 @@ class TestRunner(FHDLTestCase):
                         cri = sim.crl[7-i].get_range().value
                         print ("cr reg", i, hex(cri), i, hex(rval))
                         # XXX https://bugs.libre-soc.org/show_bug.cgi?id=363
-                        #self.assertEqual(cri, rval,
-                        #    "cr reg %d not equal %s" % (i, repr(code)))
+                        self.assertEqual(cri, rval,
+                            "cr reg %d not equal %s" % (i, repr(code)))
 
         sim.add_sync_process(process)
         with sim.write_vcd("core_simulator.vcd", "core_simulator.gtkw",
@@ -182,10 +182,10 @@ if __name__ == "__main__":
     unittest.main(exit=False)
     suite = unittest.TestSuite()
     suite.addTest(TestRunner(CRTestCase.test_data))
-    #suite.addTest(TestRunner(ShiftRotTestCase.test_data))
-    #suite.addTest(TestRunner(LogicalTestCase.test_data))
-    #suite.addTest(TestRunner(ALUTestCase.test_data))
-    #suite.addTest(TestRunner(BranchTestCase.test_data))
+    suite.addTest(TestRunner(ShiftRotTestCase.test_data))
+    suite.addTest(TestRunner(LogicalTestCase.test_data))
+    suite.addTest(TestRunner(ALUTestCase.test_data))
+    suite.addTest(TestRunner(BranchTestCase.test_data))
 
     runner = unittest.TextTestRunner()
     runner.run(suite)