move rotator mode assignments as requested by lkcl
authorJacob Lifshay <programmerjake@gmail.com>
Tue, 7 Dec 2021 03:22:19 +0000 (19:22 -0800)
committerJacob Lifshay <programmerjake@gmail.com>
Tue, 7 Dec 2021 03:22:19 +0000 (19:22 -0800)
src/soc/fu/shift_rot/main_stage.py

index b8ec704199a800c6df652524612581e07d885bb2..3f059b94a3854fd0d13d7bbb9270c76cf6b287be 100644 (file)
@@ -71,12 +71,17 @@ class ShiftRotMainStage(PipeModBase):
 
         comb += o.ok.eq(1)  # defaults to enabled
 
+        # instruction rotate type
+        mode = Signal(4, reset_less=True)
+        comb += Cat(rotator.right_shift,
+                    rotator.clear_left,
+                    rotator.clear_right,
+                    rotator.sign_ext_rs).eq(mode)
+
         # outputs from the microwatt rotator module
         comb += [o.data.eq(rotator.result_o),
                  self.o.xer_ca.data.eq(Repl(rotator.carry_out_o, 2))]
 
-        # instruction rotate type
-        mode = Signal(4, reset_less=True)
         with m.Switch(op.insn_type):
             with m.Case(MicrOp.OP_SHL):
                 comb += mode.eq(0b0000)  # L-shift
@@ -99,11 +104,6 @@ class ShiftRotMainStage(PipeModBase):
             with m.Default():
                 comb += o.ok.eq(0)  # otherwise disable
 
-        comb += Cat(rotator.right_shift,
-                    rotator.clear_left,
-                    rotator.clear_right,
-                    rotator.sign_ext_rs).eq(mode)
-
         ###### sticky overflow and context, both pass-through #####
 
         comb += self.o.xer_so.data.eq(self.i.xer_so)