From: klehman Date: Sat, 25 Sep 2021 14:46:53 +0000 (-0400) Subject: add end_test, minor cleanup, added hdlrun.cleanup() call X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=10447554acce69654f27c0c30d8d19e92669095d;p=soc.git add end_test, minor cleanup, added hdlrun.cleanup() call --- 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<