when running an exception (trap) after "reset" must copy msr/cia state
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 21 Jul 2020 14:22:28 +0000 (15:22 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Tue, 21 Jul 2020 14:22:28 +0000 (15:22 +0100)
src/soc/decoder/power_decoder2.py

index 6ab61d2b8cd4a7151ebf158018f0390566d51ed1..7166240f016c2f6b929c7a6560a723ace9fda2c3 100644 (file)
@@ -725,6 +725,8 @@ class PowerDecode2(Elaboratable):
         comb += do.fn_unit.eq(Function.TRAP)
         comb += do.trapaddr.eq(trapaddr >> 4) # cut bottom 4 bits
         comb += do.traptype.eq(traptype) # request type
+        comb += do.msr.eq(self.msr) # copy of MSR "state"
+        comb += do.cia.eq(self.cia) # copy of PC "state"
 
     def regspecmap_read(self, regfile, regname):
         """regspecmap_read: provides PowerDecode2 with an encoding relationship