from ieee754.fpcommon.fpbase import FPNumBase, FPNumBaseRecord
from ieee754.fpcommon.fpbase import FPState
from ieee754.fpcommon.denorm import FPSCData
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPAddStage0Data:
self.out_do_z = Signal(reset_less=True)
self.oz = Signal(width, reset_less=True)
self.tot = Signal(self.z.m_width + 4, reset_less=True)
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
def eq(self, i):
from ieee754.fpcommon.fpbase import MultiShiftRMerge
from ieee754.fpcommon.fpbase import FPState
from ieee754.fpcommon.denorm import FPSCData
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPNumIn2Ops:
self.z = FPNumBaseRecord(width, False)
self.out_do_z = Signal(reset_less=True)
self.oz = Signal(width, reset_less=True)
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
def eq(self, i):
from ieee754.fpcommon.fpbase import FPNumIn, FPNumOut, FPNumBaseRecord
from ieee754.fpcommon.fpbase import FPState, FPNumBase
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPSCData:
self.z = FPNumBaseRecord(width, False) # denormed result
self.oz = Signal(width, reset_less=True) # "finished" (bypass) result
self.out_do_z = Signal(reset_less=True) # "bypass" enabled
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
def __iter__(self):
return [self.a, self.b, self.muxid]
-class FPBaseData:
+class FPPipeContext:
def __init__(self, width, pspec):
self.width = width
def __init__(self, width, pspec, n_ops=2):
self.width = width
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
ops = []
for i in range(n_ops):
name = chr(ord("a")+i)
from ieee754.fpcommon.fpbase import FPState
from .roundz import FPRoundData
from nmutil.singlepipe import Object
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPPackData(Object):
def __init__(self, width, pspec):
Object.__init__(self)
self.z = Signal(width, reset_less=True) # result
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
class FPPackMod(Elaboratable):
from nmigen import Signal
from ieee754.fpcommon.fpbase import Overflow, FPNumBaseRecord
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPAddStage1Data:
self.out_do_z = Signal(reset_less=True)
self.oz = Signal(width, reset_less=True)
self.of = Overflow()
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
def __iter__(self):
from ieee754.fpcommon.fpbase import Overflow, FPNumBase, FPNumBaseRecord
from ieee754.fpcommon.fpbase import MultiShiftRMerge
from ieee754.fpcommon.fpbase import FPState
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
from .postcalc import FPAddStage1Data
self.z = FPNumBaseRecord(width, False)
self.out_do_z = Signal(reset_less=True)
self.oz = Signal(width, reset_less=True)
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
def eq(self, i):
from ieee754.fpcommon.fpbase import FPNumBase, FPNumBaseRecord
from ieee754.fpcommon.fpbase import FPState
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
from .postnormalise import FPNorm1Data
def __init__(self, width, pspec):
self.z = FPNumBaseRecord(width, False)
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
# pipeline bypass [data comes from specialcases]
self.out_do_z = Signal(reset_less=True)
from ieee754.fpcommon.fpbase import (FPNumBaseRecord, Overflow)
from ieee754.fpcommon.fpbase import FPState
from ieee754.fpcommon.denorm import FPSCData
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPDivStage0Data:
self.oz = Signal(width, reset_less=True)
self.of = Overflow()
- self.ctx = FPBaseData(width, pspec) # context: muxid, operator etc.
+ self.ctx = FPPipeContext(width, pspec) # context: muxid, operator etc.
self.muxid = self.ctx.muxid # annoying. complicated.
# TODO: here is where Q and R would be put, and passed
from ieee754.fpcommon.fpbase import FPNumBaseRecord
from ieee754.fpcommon.fpbase import FPState
from ieee754.fpcommon.denorm import FPSCData
-from ieee754.fpcommon.getop import FPBaseData
+from ieee754.fpcommon.getop import FPPipeContext
class FPMulStage0Data:
self.oz = Signal(width, reset_less=True)
mw = (self.z.m_width)*2 - 1 + 3 # sticky/round/guard bits + (2*mant) - 1
self.product = Signal(mw, reset_less=True)
- self.ctx = FPBaseData(width, pspec)
+ self.ctx = FPPipeContext(width, pspec)
self.muxid = self.ctx.muxid
def eq(self, i):