except MemException as e: # check for memory errors
if e.args[0] == 'unaligned': # alignment error
# run a Trap but set DAR first
- print("memory unaligned exception, DAR", e.dar)
+ print("memory unaligned exception, DAR", e.dar, repr(e))
self.spr['DAR'] = SelectableInt(e.dar, 64)
self.call_trap(0x600, PIb.PRIV) # 0x600, privileged
return
remainder = address & (self.bytes_per_word - 1)
address = address >> self.word_log2
if remainder & (width - 1) != 0:
- exc = MemException("unaligned", "Unaligned access Error")
+ exc = MemException("unaligned",
+ "Unaligned access: remainder %x width %d" % \
+ (remainder, width))
exc.dar = ldaddr
raise exc
if address in self.mem:
log("Writing 0x%x to ST 0x%x memaddr 0x%x/%x swap %s" % \
(v, staddr, addr, remainder, str(swap)))
if remainder & (width - 1) != 0:
- exc = MemException("unaligned", "Unaligned access Error")
+ exc = MemException("unaligned",
+ "Unaligned access: remainder %x width %d" % \
+ (remainder, width))
exc.dar = staddr
raise exc
if swap: