From: Michael Nolan Date: Sun, 5 Apr 2020 23:28:12 +0000 (-0400) Subject: Auto insert instruction fields into the namespace X-Git-Tag: div_pipeline~1445 X-Git-Url: https://git.libre-soc.org/?p=soc.git;a=commitdiff_plain;h=5d496a6b50ec3b9e00586e777651c60a1921688d Auto insert instruction fields into the namespace --- diff --git a/src/soc/decoder/isa/caller.py b/src/soc/decoder/isa/caller.py index 2199d731..39d99d5e 100644 --- a/src/soc/decoder/isa/caller.py +++ b/src/soc/decoder/isa/caller.py @@ -129,15 +129,17 @@ class ISACaller: # from spec # then "yield" fields only from op_fields rather than hard-coded # list, here. - for name in ['SI', 'UI', 'D', 'BD']: - signal = getattr(self.decoder, name) - val = yield signal - self.namespace[name] = SelectableInt(val, bits=signal.width) + fields = self.decoder.sigforms[formname] + for name in fields._fields: + if name not in ["RA", "RB", "RT"]: + sig = getattr(fields, name) + val = yield sig + self.namespace[name] = SelectableInt(val, sig.width) def call(self, name): # TODO, asmregs is from the spec, e.g. add RT,RA,RB # see http://bugs.libre-riscv.org/show_bug.cgi?id=282 - fn, read_regs, uninit_regs, write_regs, op_fields, asmregs, form \ + fn, read_regs, uninit_regs, write_regs, op_fields, form, asmregs \ = self.instrs[name] yield from self.prep_namespace(form, op_fields)