convert BranchALU to temporary conformant API
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 19 Apr 2020 10:32:41 +0000 (11:32 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Sun, 19 Apr 2020 10:32:41 +0000 (11:32 +0100)
src/soc/experiment/alu_hier.py
src/soc/experiment/score6600_multi.py

index 2e9a10dd4f5658372545640f2c93ba5b7de7431a..e3dfe3c6303f7a5d86a00c08fa2e9ed936d2001f 100644 (file)
@@ -273,9 +273,13 @@ class BranchALU(Elaboratable):
         self.n_valid_o = Signal()
         self.counter   = Signal(4)
         self.op  = Signal(2)
-        self.a   = Signal(width)
-        self.b   = Signal(width)
-        self.o   = Signal(width)
+        i = []
+        i.append(Signal(width, name="i1"))
+        i.append(Signal(width, name="i2"))
+        self.i = Array(i)
+        self.a, self.b = i[0], i[1]
+        self.out = Array([Signal(width)])
+        self.o = self.out[0]
         self.width = width
 
     def elaborate(self, platform):
index b24b2fa3f090f178cbd208cb8fabaddabf63ced9..53d27ee978524659ae370e4515f6ac3f9e3672d1 100644 (file)
@@ -142,7 +142,6 @@ class CompUnitsBase(Elaboratable):
             godie_l.append(alu.go_die_i)
             print (alu, "rel", alu.req_rel_o, alu.rd_rel_o)
             if isinstance(alu, LDSTCompUnit) or \
-               isinstance(alu, CompUnitBR) or \
                isinstance(alu, ComputationUnitNoDelay):
                 if isinstance(alu, CompUnitsBase):
                     ulen = alu.n_units
@@ -322,13 +321,14 @@ class CompUnitBR(CompUnitsBase):
         self.opwid = opwid
 
         # inputs
+        self.op = CompALUOpSubset("cua_i") # TODO - CompALUBranchSubset
         self.oper_i = Signal(opwid, reset_less=True)
         self.imm_i = Signal(rwid, reset_less=True)
 
         # Branch ALU and CU
         self.bgt = BranchALU(rwid)
         aluopwid = 3  # extra bit for immediate mode
-        self.br1 = ComputationUnitNoDelay(rwid, self.bgt)
+        self.br1 = MultiCompUnit(rwid, self.bgt)
         CompUnitsBase.__init__(self, rwid, [self.br1])
 
     def elaborate(self, platform):
@@ -337,6 +337,7 @@ class CompUnitBR(CompUnitsBase):
 
         # hand the same operation to all units
         for alu in self.units:
+            #comb += alu.oper_i.eq(self.op) # TODO
             comb += alu.oper_i.eq(self.oper_i)
             #comb += alu.imm_i.eq(self.imm_i)