add SVSTATE read to DMI interface
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Mar 2021 15:05:24 +0000 (15:05 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 7 Mar 2021 15:05:24 +0000 (15:05 +0000)
src/soc/debug/dmi.py

index 39ea799b4da63acddc2081818c2eb0e853327968..4d897699737672ee9b58ebd8e2f585eed4f52803 100644 (file)
@@ -25,6 +25,7 @@ class DBGCore:
     LOG_DATA     = 0b0111 # Log buffer data register
     CR           = 0b1000 # CR (read only)
     XER          = 0b1001 # XER (read only) - note this is a TEMPORARY hack
+    SVSTATE      = 0b1010 # SVSTATE register (read only for now)
 
 
 # CTRL register (direct actions, write 1 to act, read back 0)
@@ -177,6 +178,8 @@ class CoreDebug(Elaboratable):
                 comb += dmi.dout.eq(self.state.pc)
             with m.Case( DBGCore.MSR):
                 comb += dmi.dout.eq(self.state.msr)
+            with m.Case( DBGCore.SVSTATE):
+                comb += dmi.dout.eq(self.state.svstate)
             with m.Case( DBGCore.GSPR_DATA):
                 comb += dmi.dout.eq(d_gpr.data)
             with m.Case( DBGCore.LOG_ADDR):