From 1d1a018238c32c95f1625e955eda14b2a0c43e9c Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 22 Sep 2021 21:35:14 +0100 Subject: [PATCH] add test of expected results against last sim state --- src/soc/simple/test/test_runner.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/soc/simple/test/test_runner.py b/src/soc/simple/test/test_runner.py index d65b94ab..3e478ba8 100644 --- a/src/soc/simple/test/test_runner.py +++ b/src/soc/simple/test/test_runner.py @@ -381,6 +381,16 @@ class TestRunner(FHDLTestCase): for state in sim_states: print (state) + # compare against expected results + if test.expected is not None: + # have to put these in manually + test.expected.to_test = test.expected + test.expected.dut = self + test.expected.state_type = "expected" + test.expected.code = 0 + # do actual comparison, against last item + sim_states[-1].compare(test.expected) + self.assertTrue(len(hdl_states) == len(sim_states), "number of instructions run not the same") -- 2.30.2