self.last_st_addr = self.mem.last_st_addr
if int_op in [MicrOp.OP_LOAD.value,
]:
- self.last_st_addr = self.mem.last_st_addr
+ self.last_ld_addr = self.mem.last_ld_addr
log ("op", int_op, MicrOp.OP_STORE.value, MicrOp.OP_LOAD.value,
self.last_st_addr, self.last_ld_addr)
addr = simulator.last_st_addr & ~0x7 # align
sim_data = simulator.mem.ld(addr, 8, swap=False)
qdata = qemu.get_mem(addr, 8)[0]
- log ("last st", simulator.last_st_addr, sim_data, qdata)
- if sim_data !=qdata :
+ log ("last st", hex(simulator.last_st_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:
break
write_data(simulator.mem, fname, offs, length)
if qemu:
qmem = qemu.get_mem(offs, length)
+ log("qemu mem", hex(offs), length)
for i, mem in enumerate(qmem):
log(hex(offs+i*8), hex(mem))
- for reg, val in qemu._get_registers().items():
- log ("qemu reg", reg, hex(val))
+ if qemu:
+ log("final complete qemu reg dump")
+ for reg, val in qemu._get_registers().items():
+ log ("qemu reg", reg, hex(val))
# cleanup
if qemu:
def get_mem(self, addr, nbytes):
res = self.gdb.write("-data-read-memory %d u 1 1 %d" %
(addr, nbytes))
- #print ("get_mem", res)
+ print ("get_mem", res)
for x in res:
if(x["type"] == "result"):
l = list(map(int, x['payload']['memory'][0]['data']))
sim: kernel.bin
echo -n -e \\0060\\0000\\0061\\0000 > test.bin
echo -n -e \\0060\\0000\\0061\\0000 >> test.bin
- pypowersim -q --load test.bin:0 -g gpr.list -i kernel.bin
+ pypowersim -q --load test.bin:0 \
+ --dump testout.bin:0:8 \
+ --dump testout2.bin:0x20000100:8 \
+ -g gpr.list -i kernel.bin
clean:
rm *.o *.elf *.bin