From: Luke Kenneth Casson Leighton Date: Tue, 1 Jun 2021 13:32:43 +0000 (+0100) Subject: check both LD and ST in qemu compare X-Git-Tag: xlen-bcd~496 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=59ef46e9a6711570500ba72b4438d39778e99165;p=openpower-isa.git check both LD and ST in qemu compare --- 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: