allow ALU / Logical ops to select RS as 1st operand
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 1 Jun 2020 12:36:14 +0000 (13:36 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 1 Jun 2020 12:36:14 +0000 (13:36 +0100)
src/soc/decoder/power_decoder2.py
src/soc/decoder/power_enums.py

index 81ab714390133691d7401240998e54be36a99e6b..d12566d0a59125ef1e2c19c68b276a3ae63e3714 100644 (file)
@@ -49,6 +49,11 @@ class DecodeA(Elaboratable):
                   (self.reg_out.data == Const(0, 5))):
             comb += self.immz_out.eq(1)
 
+        # some Logic/ALU ops have RS as the 3rd arg, but no "RA".
+        with m.If(self.sel_in == In1Sel.RS):
+            comb += self.reg_out.data.eq(self.dec.RS)
+            comb += self.reg_out.ok.eq(1)
+
         # decode SPR1 based on instruction type
         op = self.dec.op
         # BC or BCREG: potential implicit register (CTR)
index 05353d2fbe28347db240ef84554ee5f03d2ac043..cdf5c591859cbee6308bbf0d6b42d5eb274d4170 100644 (file)
@@ -171,6 +171,7 @@ class In1Sel(Enum):
     RA = 1
     RA_OR_ZERO = 2
     SPR = 3
+    RS = 4  # for some ALU/Logical operations
 
 
 @unique