From: Luke Kenneth Casson Leighton Date: Fri, 3 Dec 2021 17:32:00 +0000 (+0000) Subject: add a namedtuple LDSTExceptionTuple which allows obtaining X-Git-Tag: sv_maxu_works-initial~669 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=958cb90a00a45a4ee756b3cab323eb64cb4baf72;p=openpower-isa.git add a namedtuple LDSTExceptionTuple which allows obtaining list of all the exception types in LDSTException --- diff --git a/src/openpower/exceptions.py b/src/openpower/exceptions.py index 9aa09522..d53271d5 100644 --- a/src/openpower/exceptions.py +++ b/src/openpower/exceptions.py @@ -2,12 +2,16 @@ """ from nmutil.iocontrol import RecordObject from nmigen import Signal +from collections import namedtuple + +exc_types = ['alignment', 'instr_fault', '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 = ['alignment', 'instr_fault', 'invalid', 'badtree', - 'perm_error', 'rc_error', 'segment_fault', - 'happened', ] # must be last: may overlap with Data.ok + _exc_types = exc_types def __init__(self, name=None): RecordObject.__init__(self, name=name) for f in self._exc_types: