fix fcvt to work with new InputTest and pspec
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 5 Jul 2019 22:03:35 +0000 (23:03 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 5 Jul 2019 22:03:35 +0000 (23:03 +0100)
src/ieee754/fcvt/pipeline.py
src/ieee754/fpcommon/test/fpmux.py

index c5c9dea95f93a670550a650890f35866f31aae5a..7926be9aea6f888fca9cbed6d9ba8db92a797c9d 100644 (file)
@@ -197,7 +197,7 @@ class FPCVTMuxInOut(ReservationStations):
         self.in_pspec = {}
         self.in_pspec['id_wid'] = self.id_wid
         self.in_pspec['op_wid'] = self.op_wid
-        self.in_pspec['width'] = self.in_width
+        self.in_pspec['width'] = in_width
 
         self.out_pspec = {}
         self.out_pspec['id_wid'] = self.out_id_wid
index 5f066dfb826409c1834ae109aaeb2d1add23d665..5cbdf23d2ddc892130f3372806f30d30e70af4a5 100644 (file)
@@ -27,7 +27,7 @@ class InputTest:
                 if self.single_op:
                     (op1, ) = vals.pop(0)
                     res = self.fpop(self.fpkls(op1))
-                    self.di[muxid][i] = (op1, op2)
+                    self.di[muxid][i] = (op1, )
                 else:
                     (op1, op2, ) = vals.pop(0)
                     res = self.fpop(self.fpkls(op1), self.fpkls(op2))
@@ -36,11 +36,15 @@ class InputTest:
 
     def send(self, muxid):
         for i in range(self.tlen):
-            op1, op2 = self.di[muxid][i]
+            if self.single_op:
+                op1, = self.di[muxid][i]
+            else:
+                op1, op2 = self.di[muxid][i]
             rs = self.dut.p[muxid]
             yield rs.valid_i.eq(1)
             yield rs.data_i.a.eq(op1)
-            yield rs.data_i.b.eq(op2)
+            if not self.single_op:
+                yield rs.data_i.b.eq(op2)
             yield rs.data_i.muxid.eq(muxid)
             yield
             o_p_ready = yield rs.ready_o