# output stage
from nmigen import (Module, Signal, Cat, Repl, Mux, Const)
from nmutil.pipemodbase import PipeModBase
-from soc.fu.alu.pipe_data import ALUOutputData
+from soc.fu.logical.pipe_data import LogicalOutputData
from soc.fu.shift_rot.pipe_data import ShiftRotInputData
from ieee754.part.partsig import PartitionedSignal
from soc.decoder.power_enums import InternalOp
return ShiftRotInputData(self.pspec)
def ospec(self):
- return ALUOutputData(self.pspec) # TODO: ALUIntermediateData
+ return LogicalOutputData(self.pspec)
def elaborate(self, platform):
m = Module()
###### sticky overflow and context, both pass-through #####
- comb += self.o.xer_so.data.eq(self.i.xer_so)
comb += self.o.ctx.eq(self.i.ctx)
return m
regspec = [('INT', 'a', '0:63'),
('INT', 'rs', '0:63'),
('INT', 'rb', '0:63'),
- ('XER', 'xer_so', '32'),
('XER', 'xer_ca', '34,45')]
def __init__(self, pspec):
super().__init__(pspec)
self.a = Signal(64, reset_less=True) # RA
self.rs = Signal(64, reset_less=True) # RS
self.rb = Signal(64, reset_less=True) # RB/immediate
- self.xer_so = Signal(reset_less=True) # XER bit 32: SO
self.xer_ca = Signal(2, reset_less=True) # XER bit 34/45: CA/CA32
def __iter__(self):
yield self.rs
yield self.rb
yield self.xer_ca
- yield self.xer_so
def eq(self, i):
lst = super().eq(i)
return lst + [self.rs.eq(i.rs), self.a.eq(i.a),
self.rb.eq(i.rb),
- self.xer_ca.eq(i.xer_ca),
- self.xer_so.eq(i.xer_so)]
+ self.xer_ca.eq(i.xer_ca) ]
# TODO: replace CompALUOpSubset with CompShiftRotOpSubset
from nmutil.pipemodbase import PipeModBaseChain
from soc.fu.shift_rot.input_stage import ShiftRotInputStage
from soc.fu.shift_rot.main_stage import ShiftRotMainStage
-from soc.fu.alu.output_stage import ALUOutputStage
+from soc.fu.logical.output_stage import LogicalOutputStage
class ShiftRotStages(PipeModBaseChain):
def get_chain(self):
inp = ShiftRotInputStage(self.pspec)
main = ShiftRotMainStage(self.pspec)
- out = ALUOutputStage(self.pspec)
+ out = LogicalOutputStage(self.pspec)
return [inp, main, out]
carry32 = 1 if sim.spr['XER'][XER_bits['CA32']] else 0
yield alu.p.data_i.xer_ca[0].eq(carry)
yield alu.p.data_i.xer_ca[1].eq(carry32)
- so = 1 if sim.spr['XER'][XER_bits['SO']] else 0
- yield alu.p.data_i.xer_so.eq(so)
# This test bench is a bit different than is usual. Initially when I