qemu = run_program(generator, initial_mem=mem,
bigendian=False, start_addr=initial_pc,
continuous_run=False)
+ # TODO: SPRs. how??
+ if initial_regs is not None:
+ for reg, val in enumerate(initial_regs):
+ qemu.set_gpr(reg, val)
+ if initial_fprs is not None:
+ for fpr, val in enumerate(initial_fprs):
+ qemu.set_fpr(fpr, val)
m = Module()
comb = m.d.comb
def set_gpr(self, reg, val):
self._rcache_trash('x %d' % reg)
- self.gdb_eval('$r%d=%d' % (reg, pc))
+ self.gdb_eval('$r%d=%d' % (reg, val))
def set_fpr(self, reg, val):
self._rcache_trash('x %d' % (reg+32))
- self.gdb_eval('$fp%d=%d' % (reg, pc))
+ self.gdb_eval('$fp%d=%d' % (reg, val))
def set_pc(self, pc):
self._rcache_trash('x 64')