allow default decoder to be created with no col/row subset
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 21:11:26 +0000 (22:11 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 24 Jun 2021 21:11:26 +0000 (22:11 +0100)
src/openpower/decoder/power_decoder2.py

index 88421837cddc128507f42168763f552b1cc738d8..a7098303289b8369747ac34bfb1cf10f27bd3978 100644 (file)
@@ -767,7 +767,12 @@ class PowerDecodeSubset(Elaboratable):
         if opkls is None:
             opkls = Decode2ToOperand
         self.do = opkls(fn_name)
-        col_subset = self.get_col_subset(self.do)
+        if final:
+            col_subset = self.get_col_subset(self.do)
+            row_subset = self.rowsubsetfn
+        else:
+            col_subset = None
+            row_subset = None
 
         # "conditions" for Decoders, to enable some weird and wonderful
         # alternatives.  useful for PCR (Program Compatibility Register)
@@ -775,6 +780,7 @@ class PowerDecodeSubset(Elaboratable):
         conditions = {'SVP64BREV': self.use_svp64_ldst_dec,
                       '~SVP64BREV': ~self.use_svp64_ldst_dec
                      }
+
         # only needed for "main" PowerDecode2
         if not self.final:
             self.e = Decode2ToExecute1Type(name=self.fn_name, do=self.do,
@@ -783,7 +789,7 @@ class PowerDecodeSubset(Elaboratable):
         # create decoder if one not already given
         if dec is None:
             dec = create_pdecode(name=fn_name, col_subset=col_subset,
-                                      row_subset=self.rowsubsetfn,
+                                      row_subset=row_subset,
                                       conditions=conditions)
         self.dec = dec