add id_width to parameters
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 4 Mar 2019 23:38:19 +0000 (23:38 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 4 Mar 2019 23:38:19 +0000 (23:38 +0000)
src/add/nmigen_add_experiment.py

index 81e6d4ad609140041cd6f1ffc02b7fa56bb64f3e..43be521dc4e1c38c8c3c029101acd80d75272a9e 100644 (file)
@@ -905,10 +905,20 @@ class FPPutZ(FPState):
 
 class FPADD:
 
-    def __init__(self, width, single_cycle=False):
+    def __init__(self, width, id_wid=None, single_cycle=False):
+        """ IEEE754 FP Add
+
+            * width: bit-width of IEEE754.  supported: 16, 32, 64
+            * id_wid: an identifier that is sync-connected to the input
+            * single_cycle: True indicates each stage to complete in 1 clock
+        """
+        self.id_wid = id_wid
         self.width = width
         self.single_cycle = single_cycle
 
+        if self.id_wid:
+            self.in_mid = Signal(self.id_wid)
+            self.out_mid = Signal(self.id_wid)
         self.in_a  = FPOp(width)
         self.in_b  = FPOp(width)
         self.out_z = FPOp(width)