self.run_tst_program(program, [1, 2, 3])
def test_ldst_widths(self):
- lst = [" lis 1, 0xdead",
+ lst = ["addis 1, 0, 0xdead",
"ori 1, 1, 0xbeef",
"addi 2, 0, 0x1000",
"std 1, 0(2)",
with Program(lst) as program:
self.run_tst_program(program, [1])
+ @unittest.skip("broken")
def test_mulli(self):
lst = ["addi 1, 0, 3",
"mulli 1, 1, 2"
simulator = self.run_tst(prog)
prog.reset()
with run_program(prog) as q:
- qemu_register_compare(simulator, q, reglist)
+ self.qemu_register_compare(simulator, q, reglist)
+ print(simulator.gpr.dump())
-def qemu_register_compare(simulator, qemu, regs):
- for reg in regs:
- qemu_val = qemu.get_register(reg)
- #simulator.regfile.assert_gpr(reg, qemu_val)
+ def qemu_register_compare(self, simulator, qemu, regs):
+ for reg in regs:
+ qemu_val = qemu.get_register(reg)
+ sim_val = simulator.gpr(reg).value
+ self.assertEqual(qemu_val, sim_val)
if __name__ == "__main__":