use ospec to make clone of out_z
[ieee754fpu.git] / src / add / nmigen_add_experiment.py
index 0b46b39ff7752db1f627558bbf314f06060a7edd..e9929d5ca5969f6c4ca955d2bb591b1b1c57ac43 100644 (file)
@@ -264,12 +264,15 @@ class FPAddSpecialCasesMod:
     def __init__(self, width):
         self.width = width
         self.i = self.ispec()
-        self.out_z = FPNumOut(width, False)
+        self.out_z = self.ospec()
         self.out_do_z = Signal(reset_less=True)
 
     def ispec(self):
         return FPNumBase2Ops(self.width)
 
+    def ospec(self):
+        return FPNumOut(self.width, False)
+
     def setup(self, m, in_a, in_b, out_do_z):
         """ links module to inputs and outputs
         """
@@ -388,7 +391,7 @@ class FPAddSpecialCases(FPState, FPID):
         FPState.__init__(self, "special_cases")
         FPID.__init__(self, id_wid)
         self.mod = FPAddSpecialCasesMod(width)
-        self.out_z = FPNumOut(width, False)
+        self.out_z = self.mod.ospec()
         self.out_do_z = Signal(reset_less=True)
 
     def setup(self, m, in_a, in_b, in_mid):