remove FPPipeContext (moved to nmutil), name-substitute on import
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 15 Jul 2020 13:42:39 +0000 (14:42 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 15 Jul 2020 13:42:39 +0000 (14:42 +0100)
see https://bugs.libre-soc.org/show_bug.cgi?id=431

src/ieee754/fpcommon/getop.py

index 294d6e49884b1bba0e2eb99eeffb988da19a3d17..e19bb22eac69d04a883a58ec10bd83217a1c2017 100644 (file)
@@ -9,6 +9,7 @@ from math import log
 
 from ieee754.fpcommon.fpbase import FPOpIn, FPBase, FPNumBase
 from nmutil.singlepipe import PrevControl
+from nmutil.concurrentunit import PipeContext as FPPipeContext
 
 from nmutil import nmoperator
 
@@ -46,40 +47,6 @@ class FPNumBase2Ops:
         return [self.a, self.b, self.muxid]
 
 
-class FPPipeContext:
-
-    def __init__(self, pspec):
-        """ creates a pipeline context.  currently: operator (op) and muxid
-
-            opkls (within pspec) - the class to create that will be the
-                                   "operator". instance must have an "eq"
-                                   function.
-        """
-        self.id_wid = pspec.id_wid
-        self.op_wid = pspec.op_wid
-        self.muxid = Signal(self.id_wid, reset_less=True)   # RS multiplex ID
-        opkls = pspec.opkls
-        if opkls is None:
-            self.op = Signal(self.op_wid, reset_less=True)
-        else:
-            self.op = opkls(pspec)
-
-    def eq(self, i):
-        ret = [self.muxid.eq(i.muxid)]
-        ret.append(self.op.eq(i.op))
-        return ret
-
-    def __iter__(self):
-        yield self.muxid
-        yield self.op
-
-    def ports(self):
-        if hasattr(self.op, "ports"):
-            return [self.muxid] + self.op.ports()
-        else:
-            return list(self)
-
-
 class FPGet2OpMod(PrevControl):
     def __init__(self, width, id_wid, op_wid=None):
         PrevControl.__init__(self)