--- /dev/null
+"""exceptions
+"""
+from nmutil.iocontrol import RecordObject
+from nmigen import Signal
+
+# https://bugs.libre-soc.org/show_bug.cgi?id=465
+class LDSTException(RecordObject):
+ _exc_types = ['happened', 'alignment', 'instr_fault', 'invalid', 'badtree',
+ 'perm_error', 'rc_error', 'segment_fault',]
+ def __init__(self, name=None):
+ RecordObject.__init__(self, name=name)
+ for f in self._exc_types:
+ setattr(self, f, Signal())
+
--- /dev/null
+from nmutil.iocontrol import RecordObject
+from nmigen import Signal
+from soc.sv.svstate import SVSTATERec
+
+
+class CoreState(RecordObject):
+ """contains "Core State Information" which says exactly where things are
+
+ example: eint says to PowerDecoder that it should fire an exception
+ rather than let the current decoded instruction proceed. likewise
+ if dec goes negative. MSR contains LE/BE and Priv state. PC contains
+ the Program Counter, and SVSTATE is the Sub-Program-Counter.
+ """
+ def __init__(self, name):
+ super().__init__(name=name)
+ self.pc = Signal(64) # Program Counter (CIA, NIA)
+ self.msr = Signal(64) # Machine Status Register (MSR)
+ self.eint = Signal() # External Interrupt
+ self.dec = Signal(64) # DEC SPR (again, for interrupt generation)
+ self.svstate = SVSTATERec(name) # Simple-V SVSTATE