support TRAP being called without setting a trap_bit
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 7 Nov 2023 04:37:07 +0000 (20:37 -0800)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 22 Dec 2023 19:26:21 +0000 (19:26 +0000)
src/openpower/decoder/isa/caller.py

index 7f547815b3c0d2fe4bdcbe45a84a6f9f05f3fd0f..0c5199e2397471c78c8886d07b5983b42f361658 100644 (file)
@@ -1372,7 +1372,8 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop):
         if self.is_svp64_mode:
             self.spr['SVSRR0'] = self.namespace['SVSTATE'].value
         self.trap_nia = SelectableInt(trap_addr | (kaivb & ~0x1fff), 64)
-        self.spr['SRR1'][trap_bit] = 1  # change *copy* of MSR in SRR1
+        if trap_bit is not None:
+            self.spr['SRR1'][trap_bit] = 1  # change *copy* of MSR in SRR1
 
         # set exception bits.  TODO: this should, based on the address
         # in figure 66 p1065 V3.0B and the table figure 65 p1063 set these