add FPNorm1Data class
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 20 Mar 2019 14:12:31 +0000 (14:12 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 20 Mar 2019 14:12:31 +0000 (14:12 +0000)
src/add/nmigen_add_experiment.py

index 9711e13b6cdd76f0aeae6a9952fff62d5f1b3923..b1dfed172798bdf70feba68d8e2adf8adec74a37 100644 (file)
@@ -992,6 +992,16 @@ class FPNormaliseModSingle:
 
         return m
 
+class FPNorm1Data:
+
+    def __init__(self, width):
+
+        self.roundz = Signal(reset_less=True)
+        self.z = FPNumBase(width, False)
+
+    def eq(self, i):
+        return [self.z.eq(i.z), self.roundz.eq(i.roundz)]
+
 
 class FPNorm1ModSingle:
 
@@ -1004,7 +1014,7 @@ class FPNorm1ModSingle:
         return FPAddStage1Data(self.width)
 
     def ospec(self):
-        return FPAddStage1Data(self.width)
+        return FPAddStage1Data(self.width) # XXX TODO: FPNorm1Data
 
     def setup(self, m, in_z, in_of, out_z):
         """ links module to inputs and outputs