From 59ef46e9a6711570500ba72b4438d39778e99165 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 1 Jun 2021 14:32:43 +0100 Subject: [PATCH] check both LD and ST in qemu compare --- src/openpower/decoder/isa/pypowersim.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/openpower/decoder/isa/pypowersim.py b/src/openpower/decoder/isa/pypowersim.py index 0f2ed5fc..f49fe17b 100644 --- a/src/openpower/decoder/isa/pypowersim.py +++ b/src/openpower/decoder/isa/pypowersim.py @@ -225,12 +225,18 @@ def run_tst(args, generator, qemu, qemu.set_endian(False) qemu_register_compare(simulator, qemu, range(32), range(32)) # check last store address + check_addr = None if simulator.last_st_addr is not None: - addr = simulator.last_st_addr & ~0x7 # align + check_addr = simulator.last_st_addr + msg = "st" + if simulator.last_ld_addr is not None: + check_addr = simulator.last_ld_addr + msg = "ld" + if check_addr is not None: + addr = check_addr & ~0x7 # align sim_data = simulator.mem.ld(addr, 8, swap=False) qdata = qemu.get_mem(addr, 8)[0] - log ("last st", hex(simulator.last_st_addr), - hex(sim_data), hex(qdata)) + log ("last", msg, hex(check_addr), hex(sim_data), hex(qdata)) if sim_data != qdata: log("expect mem %x, %x got %x" % (addr, qdata, sim_data)) if _pc is None: -- 2.30.2