store ra in intermediate, to avoid creation of decoding twice
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 11 Mar 2020 08:37:24 +0000 (08:37 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 11 Mar 2020 08:37:24 +0000 (08:37 +0000)
src/soc/decoder/power_decoder2.py

index 436005c6960e910613170b45691cc9715e2fc4f9..8af5793313787f2a80dd207530021166ebb48e7b 100644 (file)
@@ -32,10 +32,12 @@ class DecodeA(Elaboratable):
         comb = m.d.comb
 
         # select Register A field
+        ra = Signal(5, reset_less=True)
+        comb += ra.eq(self.dec.RA[0:-1])
         with m.If((self.sel_in == In1Sel.RA) |
                   ((self.sel_in == In1Sel.RA_OR_ZERO) &
-                   (self.dec.RA[0:-1] != Const(0, 5)))):
-            comb += self.reg_out.data.eq(self.dec.RA[0:-1])
+                   (ra != Const(0, 5)))):
+            comb += self.reg_out.data.eq(ra)
             comb += self.reg_out.ok.eq(1)
 
         # zero immediate requested