add an operator class for signed/unsigned
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 19 Jul 2019 10:29:25 +0000 (11:29 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Fri, 19 Jul 2019 10:29:25 +0000 (11:29 +0100)
src/ieee754/fcvt/pipeline.py

index 5487aa6520811e17ff6927b9a9f3458bcf53ff10..c22f9fbf327f6f960e77803bd8180e421a8ae2d3 100644 (file)
@@ -28,6 +28,13 @@ from nmutil.singlepipe import SimpleHandshake, StageChain
 from ieee754.fpcommon.fpbase import FPState
 from ieee754.pipeline import PipelineSpec
 
+class SignedOp:
+    def __init__(self):
+        self.signed = Signal(reset_less=True)
+
+    def eq(self, i):
+        return [self.signed.eq(i)]
+
 
 class FPCVTIntToFloatMod(Elaboratable):
     """ FP integer conversion: copes with 16/32/64 int to 16/32/64 fp.