From 6fea780f698a10ec43d4f69b49fe36c176ecd69b Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 3 Jun 2020 12:29:02 +0100 Subject: [PATCH] move over to using power_regspec_map.py from PowerDecode2 rather than distributed maps in pipe_data.py --- src/soc/decoder/power_decoder2.py | 11 ++++++++++- src/soc/decoder/power_regspec_map.py | 11 +++++++---- src/soc/fu/compunits/test/test_compunit.py | 4 +++- src/soc/fu/regspec.py | 10 ++++++++-- 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/soc/decoder/power_decoder2.py b/src/soc/decoder/power_decoder2.py index 24d3e0c5..33e346ae 100644 --- a/src/soc/decoder/power_decoder2.py +++ b/src/soc/decoder/power_decoder2.py @@ -610,7 +610,16 @@ class PowerDecode2(Elaboratable): 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) + return regspec_decode(self.e, regfile, regname) + + def rdflags(self, cu): + rdl = [] + for idx in range(cu.n_src): + regfile, regname, _ = cu.get_in_spec(idx) + rdflag, read, write = self.regspecmap(regfile, regname) + rdl.append(rdflag) + print ("rdflags", rdl) + return Cat(*rdl) if __name__ == '__main__': diff --git a/src/soc/decoder/power_regspec_map.py b/src/soc/decoder/power_regspec_map.py index 6d9e1677..4e90b8db 100644 --- a/src/soc/decoder/power_regspec_map.py +++ b/src/soc/decoder/power_regspec_map.py @@ -70,11 +70,14 @@ def regspec_decode(e, regfile, name): CA = 1<