svp64=self.svp64,
mmu=self.microwatt_mmu,
reg_wid=64)
+
+ ###### SETUP PHASE #######
+
if self.run_hdl:
#hard_reset = Signal(reset_less=True)
issuer = TestIssuerInternal(pspec)
def process():
+ ###### PREPARATION PHASE AT START OF RUNNING #######
+
if self.run_hdl:
# start in stopped
yield from set_dmi(dmi, DBGCore.CTRL, 1<<DBGCtrl.STOP)
for test in self.test_data:
- if self.run_hdl:
- # set up bigendian (TODO: don't do this, use MSR)
- yield issuer.core_bigendian_i.eq(bigendian)
- yield Settle()
+ with self.subTest(test.name):
- yield
- yield
- yield
- yield
+ ###### PREPARATION PHASE AT START OF TEST #######
- print(test.name)
- program = test.program
- with self.subTest(test.name):
+ if self.run_hdl:
+ # set up bigendian (TODO: don't do this, use MSR)
+ yield issuer.core_bigendian_i.eq(bigendian)
+ yield Settle()
+
+ yield
+ yield
+ yield
+ yield
+
+ print(test.name)
+ program = test.program
print("regs", test.regs)
print("sprs", test.sprs)
print("cr", test.cr)
insncode = program.assembly.splitlines()
instructions = list(zip(gen, insncode))
+ ###### RUNNING OF EACH TEST #######
+
# Run two tests (TODO, move these to functions)
# * first the Simulator, collate a batch of results
# * then the HDL, likewise
instructions, gen,
insncode)
+ ###### COMPARING THE TESTS #######
+
###############
# 3. Compare
###############
self.assertTrue(len(hdl_states) == len(sim_states),
"number of instructions run not the same")
+ ###### END OF A TEST #######
+
if self.run_hdl:
# stop at end
yield from set_dmi(dmi, DBGCore.CTRL, 1<<DBGCtrl.STOP)