completely borked python segfault, workaround to copy last sim state
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Sep 2021 20:52:26 +0000 (21:52 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 22 Sep 2021 20:52:26 +0000 (21:52 +0100)
src/soc/simple/test/test_runner.py

index 3e478ba8a370e789ebd56682aeb0f7e966946258..045e96813767e2be0e0920934bc0f500f92b54e1 100644 (file)
@@ -369,6 +369,8 @@ class TestRunner(FHDLTestCase):
                     # 3. Compare
                     ###############
 
+                    last_sim = copy(sim_states[-1])
+
                     for simstate, hdlstate in zip(sim_states, hdl_states):
                         simstate.compare(hdlstate)     # register check
                         simstate.compare_mem(hdlstate) # memory check
@@ -389,7 +391,7 @@ class TestRunner(FHDLTestCase):
                         test.expected.state_type = "expected"
                         test.expected.code = 0
                         # do actual comparison, against last item
-                        sim_states[-1].compare(test.expected)
+                        last_sim.compare(test.expected)
 
                     self.assertTrue(len(hdl_states) == len(sim_states),
                                     "number of instructions run not the same")