From 011bfe7983d5eb09f9487ff250ddf3c94c2cfea3 Mon Sep 17 00:00:00 2001 From: klehman Date: Sat, 25 Sep 2021 10:46:53 -0400 Subject: [PATCH] add end_test, minor cleanup, added hdlrun.cleanup() call --- src/soc/simple/test/test_runner.py | 50 ++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 13 deletions(-) diff --git a/src/soc/simple/test/test_runner.py b/src/soc/simple/test/test_runner.py index ff823c66..ca2b9341 100644 --- a/src/soc/simple/test/test_runner.py +++ b/src/soc/simple/test/test_runner.py @@ -294,6 +294,37 @@ class HDLRunner(StateRunner): return hdl_states + def end_test(self): + yield from set_dmi(self.dmi, DBGCore.CTRL, 1<>>expected_data<<<) + + # get CR + cr = yield from get_dmi(self.dmi, DBGCore.CR) + print("after test %s cr value %x" % (self.test.name, cr)) + + # get XER + xer = yield from get_dmi(self.dmi, DBGCore.XER) + print("after test %s XER value %x" % (self.test.name, xer)) + + # test of dmi reg get + for int_reg in range(32): + yield from set_dmi(self.dmi, DBGCore.GSPR_IDX, int_reg) + value = yield from get_dmi(self.dmi, DBGCore.GSPR_DATA) + + print("after test %s reg %2d value %x" % + (self.test.name, int_reg, value)) + + # pull a reset + yield from set_dmi(self.dmi, DBGCore.CTRL, 1<