class TestCase:
def __init__(self, program, name, regs=None, sprs=None, cr=0, mem=None,
msr=0,
- do_sim=True):
+ do_sim=True,
+ extra_break_addr=None):
self.program = program
self.name = name
self.mem = mem
self.msr = msr
self.do_sim = do_sim
+ self.extra_break_addr = extra_break_addr
class ALUHelpers:
"mtspr 9, 12", # mtctr r12
"bcctrl 20,0,0", # bctrl
]
- self.run_tst_program(Program(lst), [1,12])
+ self.run_tst_program(Program(lst), [1,12], extra_break_addr=0x1014)
def run_tst_program(self, prog, initial_regs=None, initial_sprs=None,
- initial_mem=None):
+ initial_mem=None, extra_break_addr=None):
initial_regs = [0] * 32
tc = TestCase(prog, self.test_name, initial_regs, initial_sprs, 0,
- initial_mem, 0)
+ initial_mem, 0,
+ extra_break_addr=extra_break_addr)
self.test_data.append(tc)
return simulator
- def run_tst_program(self, prog, reglist, initial_mem=None):
+ def run_tst_program(self, prog, reglist, initial_mem=None,
+ extra_break_addr=None):
import sys
simulator = self.run_tst(prog, initial_mem=initial_mem,
initial_pc=0x20000000)
prog.reset()
- with run_program(prog, initial_mem) as q:
+ with run_program(prog, initial_mem, extra_break_addr) as q:
self.qemu_register_compare(simulator, q, reglist)
self.qemu_mem_compare(simulator, q, True)
print(simulator.gpr.dump())