start putting state info into LoadStore1, slowly putting loadstore1.vhdl
[soc.git] / src / soc / fu / alu / input_stage.py
1 # This stage is intended to adjust the input data before sending it to
2 # the actual ALU. Things like handling inverting the input, xer_ca
3 # generation for subtraction, and handling of immediates should happen
4 # in the base class (CommonInputStage.elaborate).
5 from soc.fu.common_input_stage import CommonInputStage
6 from soc.fu.alu.pipe_data import ALUInputData
7
8
9 class ALUInputStage(CommonInputStage):
10 def __init__(self, pspec):
11 super().__init__(pspec, "input")
12
13 def ispec(self):
14 return ALUInputData(self.pspec)
15
16 def ospec(self):
17 return ALUInputData(self.pspec)
18
19 def elaborate(self, platform):
20 m = super().elaborate(platform) # covers A-invert, carry, and SO.
21 comb = m.d.comb
22 ctx = self.i.ctx
23
24 # operand b
25 comb += self.o.b.eq(self.i.b)
26
27 return m