From: Luke Kenneth Casson Leighton Date: Wed, 22 Sep 2021 20:52:26 +0000 (+0100) Subject: completely borked python segfault, workaround to copy last sim state X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f7b708268bf758a2cea294fd7f070be4d78acc6b;p=soc.git completely borked python segfault, workaround to copy last sim state --- diff --git a/src/soc/simple/test/test_runner.py b/src/soc/simple/test/test_runner.py index 3e478ba8..045e9681 100644 --- a/src/soc/simple/test/test_runner.py +++ b/src/soc/simple/test/test_runner.py @@ -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")