From: Luke Kenneth Casson Leighton Date: Fri, 7 May 2021 11:40:41 +0000 (+0100) Subject: how we managed to get this far without noticing that test_runner.py is X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=34c8ade86d790e0bd1db603220dbada989475157;p=soc.git how we managed to get this far without noticing that test_runner.py is not using "with self.subTest" is anyones guess --- diff --git a/src/soc/simple/test/test_runner.py b/src/soc/simple/test/test_runner.py index 29824df0..7db90efd 100644 --- a/src/soc/simple/test/test_runner.py +++ b/src/soc/simple/test/test_runner.py @@ -206,128 +206,130 @@ class TestRunner(FHDLTestCase): print(test.name) program = test.program - self.subTest(test.name) - print("regs", test.regs) - print("sprs", test.sprs) - print("cr", test.cr) - print("mem", test.mem) - print("msr", test.msr) - print("assem", program.assembly) - gen = list(program.generate_instructions()) - insncode = program.assembly.splitlines() - instructions = list(zip(gen, insncode)) - - # set up the Simulator (which must track TestIssuer exactly) - sim = ISA(simdec2, test.regs, test.sprs, test.cr, test.mem, - test.msr, - initial_insns=gen, respect_pc=True, - disassembly=insncode, - bigendian=bigendian, - initial_svstate=test.svstate) - - # establish the TestIssuer context (mem, regs etc) - - pc = 0 # start address - counter = 0 # test to pause/start - - yield from setup_i_memory(imem, pc, instructions) - yield from setup_test_memory(l0, sim) - yield from setup_regs(pdecode2, core, test) - - # set PC and SVSTATE - yield pc_i.eq(pc) - yield issuer.pc_i.ok.eq(1) - - initial_svstate = test.svstate - if isinstance(initial_svstate, int): - initial_svstate = SVP64State(initial_svstate) - yield svstate_i.eq(initial_svstate.spr.value) - yield issuer.svstate_i.ok.eq(1) - yield - - print("instructions", instructions) - - # run the loop of the instructions on the current test - index = sim.pc.CIA.value//4 - while index < len(instructions): - ins, code = instructions[index] - - print("instruction: 0x{:X}".format(ins & 0xffffffff)) - print(index, code) - - if counter == 0: - # start the core - yield - yield from set_dmi(dmi, DBGCore.CTRL, 1<= len(instructions): - print ("index over, send dmi stop") - # stop at end - yield from set_dmi(dmi, DBGCore.CTRL, 1<= len(instructions): + print ("index over, send dmi stop") + # stop at end + yield from set_dmi(dmi, DBGCore.CTRL, + 1<