with m.Switch(op):
with m.Case(InternalOp.OP_TRAP):
- pass
+ with m.If(should_trap):
+ comb += self.o.nia.eq(0x700)
+ comb += self.o.srr1.eq(self.i.msr)
+ comb += self.o.srr1[63-46].eq(1)
+ comb += self.o.srr0.eq(self.i.cia)
comb += self.o.ctx.eq(self.i.ctx)
+ comb += self.o.should_trap.eq(should_trap)
return m
self.msr = Signal(64, reset_less=True) # RB/immediate
self.srr0 = Signal(64, reset_less=True) # RB/immediate
self.srr1 = Signal(64, reset_less=True) # RB/immediate
+ self.should_trap = Signal(reset_less=True)
def __iter__(self):
yield from super().__iter__()
yield self.msr
yield self.srr0
yield self.srr1
+ yield self.should_trap
def eq(self, i):
lst = super().eq(i)
return lst + [
self.nia.eq(i.nia), self.msr.eq(i.msr),
- self.srr0.eq(i.srr0), self.srr1.eq(i.srr1)]
+ self.srr0.eq(i.srr0), self.srr1.eq(i.srr1),
+ self.should_trap.eq(i.should_trap)]