Allow the formal engine to perform a same-cycle result in the ALU
[soc.git] / src / soc / fu / shift_rot / input_stage.py
1 # This stage is intended to adjust the input data before sending it to
2 # the acutal ALU. Things like handling inverting the input, carry_in
3 # generation for subtraction, and handling of immediates should happen
4 # here
5 from soc.fu.common_input_stage import CommonInputStage
6 from soc.fu.shift_rot.pipe_data import ShiftRotInputData
7
8
9 class ShiftRotInputStage(CommonInputStage):
10 def __init__(self, pspec):
11 super().__init__(pspec, "input")
12
13 def ispec(self):
14 return ShiftRotInputData(self.pspec)
15
16 def ospec(self):
17 return ShiftRotInputData(self.pspec)
18
19 def elaborate(self, platform):
20 m = super().elaborate(platform) # handles A, carry and sticky overflow
21 comb = m.d.comb
22
23 # operand rs
24 comb += self.o.rs.eq(self.i.rs)
25
26 return m