3 from nmutil
.iocontrol
import RecordObject
4 from nmigen
import Signal
5 from collections
import namedtuple
7 exc_types
= ['alignment',
8 'instr_fault', # this one is not an actual exception
9 # but information *about* the type of
10 # exception that must be generated
16 'happened', # must be last: may overlap with Data.ok
19 LDSTExceptionTuple
= namedtuple("LDSTExceptionTuple", exc_types
)
21 # https://bugs.libre-soc.org/show_bug.cgi?id=465
22 class LDSTException(RecordObject
):
23 _exc_types
= exc_types
24 def __init__(self
, name
=None):
25 RecordObject
.__init
__(self
, name
=name
)
26 for f
in self
._exc
_types
:
27 setattr(self
, f
, Signal(name
=f
))
28 self
.srr1
= Signal(64)
29 length
= len(exc_types
) + 64 # update this if adding anything else!