From acd9406d4d7ec8abb2edd6f52b5b0b7f1ee145e3 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 2 Jun 2020 19:20:52 +0100 Subject: [PATCH] add regspecmap function to PowerDecode2 --- src/soc/decoder/power_decoder2.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index 40071b34..a3d8d9b6 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -9,6 +9,7 @@ from nmigen.cli import rtlil from nmutil.iocontrol import RecordObject from nmutil.extend import exts +from soc.decoder.power_regspec_map import regspec_decode from soc.decoder.power_decoder import create_pdecode from soc.decoder.power_enums import (InternalOp, CryIn, Function, CRInSel, CROutSel, @@ -593,6 +594,13 @@ class PowerDecode2(Elaboratable): return m + def regspecmap(self, regfile, regname): + """regspecmap: provides PowerDecode2 with an encoding relationship + to Function Unit port regfiles (read-enable, read regnum, write regnum) + regfile and regname arguments are fields 1 and 2 from a given regspec. + """ + return regspec_decode(self, regfile, regname) + if __name__ == '__main__': pdecode = create_pdecode() -- 2.30.2