X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fopenpower%2Fexceptions.py;h=ad4f6b87a00910490648c1f0698a30bba93e5ebe;hb=bc051d8c85c4ba3140d06159d37b40fc6048d549;hp=a0fc9a7f8247ce66b454e98b18e007bd0263f6aa;hpb=e754cdbf7d35811f177612b4b43261b2e0310c2d;p=openpower-isa.git diff --git a/src/openpower/exceptions.py b/src/openpower/exceptions.py index a0fc9a7f..ad4f6b87 100644 --- a/src/openpower/exceptions.py +++ b/src/openpower/exceptions.py @@ -2,13 +2,28 @@ """ from nmutil.iocontrol import RecordObject from nmigen import Signal +from collections import namedtuple + +exc_types = ['alignment', + 'instr_fault', # this one is not an actual exception + # but information *about* the type of + # exception that must be generated + 'invalid', + 'badtree', + 'perm_error', + 'rc_error', + 'segment_fault', + 'happened', # must be last: may overlap with Data.ok + ] + +LDSTExceptionTuple = namedtuple("LDSTExceptionTuple", exc_types) # 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',] + _exc_types = exc_types def __init__(self, name=None): RecordObject.__init__(self, name=name) for f in self._exc_types: - setattr(self, f, Signal()) - + setattr(self, f, Signal(name=f)) + self.srr1 = Signal(64) + length = len(exc_types) + 64 # update this if adding anything else!