setting NIA and MSR is tricky, it involves reading some english text
that is very unclear (Book III section 4.3.1 which then in turn says
"go to section 7.5 page 1076").
given that we are not implementing hypervisor or LEV=1/2/3 it is just
simpler to call TRAP(0xc00)
SRR1[0:32] <- MSR[0:32]
SRR1[37:41] <- MSR[37:41]
SRR1[48:63] <- MSR[48:63]
- MSR <- new_value
- NIA <- 0x0000_0000_0000_0C00
+ TRAP(0xC00)
Special Registers Altered:
hence the default arguments. when calling from inside ISACaller
it is best to use call_trap()
"""
+ if isinstance(trap_addr, SelectableInt):
+ trap_addr = trap_addr.value
# https://bugs.libre-soc.org/show_bug.cgi?id=859
kaivb = self.spr['KAIVB'].value
msr = self.namespace['MSR'].value