From: Luke Kenneth Casson Leighton Date: Wed, 5 May 2021 12:52:36 +0000 (+0100) Subject: split PowerDecodeSubset do_copy into do_copy and do_get X-Git-Tag: 0.0.3~80 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d029cf101a497d5afece668b28de4000f4aa6ea;p=openpower-isa.git split PowerDecodeSubset do_copy into do_copy and do_get --- diff --git a/src/openpower/decoder/power_decoder2.py b/src/openpower/decoder/power_decoder2.py index 54c029e4..cb5d6719 100644 --- a/src/openpower/decoder/power_decoder2.py +++ b/src/openpower/decoder/power_decoder2.py @@ -780,13 +780,17 @@ class PowerDecodeSubset(Elaboratable): do = self.e_tmp.do return hasattr(do, field) and self.op_get(op_field) is not None - def do_copy(self, field, val, final=False): + def do_get(self, field, final=False): if final or self.final: do = self.do else: do = self.e_tmp.do - if hasattr(do, field) and val is not None: - return getattr(do, field).eq(val) + return getattr(do, field, None) + + def do_copy(self, field, val, final=False): + df = self.do_get(field, final) + if df is not None and val is not None: + return df.eq(val) return [] def op_get(self, op_field):