Export trap signal from PicoRV32.
authorSergiusz Bazanski <q3k@q3k.org>
Sun, 21 Jan 2018 21:46:01 +0000 (21:46 +0000)
committerSergiusz Bazanski <q3k@q3k.org>
Mon, 22 Jan 2018 18:50:26 +0000 (18:50 +0000)
This is useful for handling crashes from hardware.

litex/soc/cores/cpu/picorv32/core.py

index 3e9464366c734998387aab4e7d4010808b388dd0..6d20a9d04be6e10db538f4261ca005167767465f 100644 (file)
@@ -6,10 +6,11 @@ from litex.soc.interconnect import wishbone
 
 
 class PicoRV32(Module):
-    def __init__(self, platform, progaddr_reset):
+    def __init__(self, platform, progaddr_reset, variant):
         self.ibus = i = wishbone.Interface()
         self.dbus = d = wishbone.Interface()
         self.interrupt = Signal(32)
+        self.trap = Signal()
 
         # # #
 
@@ -51,7 +52,7 @@ class PicoRV32(Module):
             i_resetn=~ResetSignal(),
 
             # trap
-            o_trap=Signal(), # not used
+            o_trap=self.trap,
 
             # memory interface
             o_mem_valid=mem_valid,