From 54106dc1a09996b61e95bb8d5972c25dac33acbb Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 6 Oct 2020 16:05:36 +0100 Subject: [PATCH] make LDSTException fields added from list of fieldnames --- src/soc/experiment/mem_types.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/soc/experiment/mem_types.py b/src/soc/experiment/mem_types.py index 2d730858..c0523483 100644 --- a/src/soc/experiment/mem_types.py +++ b/src/soc/experiment/mem_types.py @@ -8,16 +8,13 @@ from nmigen import Signal # 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',] def __init__(self, name=None): RecordObject.__init__(self, name=name) self.happened = Signal() - self.alignment = Signal() - self.instr_fault = Signal() - self.invalid = Signal() - self.badtree = Signal() - self.perm_error = Signal() - self.rc_error = Signal() - self.segment_fault = Signal() + for f in self._exc_types: + setattr(self, f, Signal()) class DCacheToLoadStore1Type(RecordObject): -- 2.30.2