from nmigen import Module, Signal, Cat
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.getop import FPADDBaseData
from ieee754.fpcommon.pack import FPPackData
from ieee754.fpcommon.fpbase import FPNumDecode, FPNumBaseRecord
-class FPClassMod(FPModBase):
+class FPClassMod(PipeModBase):
""" obtains floating point information (zero, nan, inf etc.)
"""
def __init__(self, in_pspec, out_pspec):
from nmigen import Module, Signal, Const
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.getop import FPADDBaseData
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.fpcommon.msbhigh import FPMSBHigh
from ieee754.fpcommon.fpbase import FPNumDecode, FPNumBaseRecord
-class FPCVTDownConvertMod(FPModBase):
+class FPCVTDownConvertMod(PipeModBase):
""" FP down-conversion (higher to lower bitwidth)
"""
def __init__(self, in_pspec, out_pspec):
from nmigen import Module, Signal, Cat
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.getop import FPADDBaseData
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.fpcommon.msbhigh import FPMSBHigh
from ieee754.fpcommon.fpbase import FPNumDecode, FPNumBaseRecord
-class FPCVTIntToFloatMod(FPModBase):
+class FPCVTIntToFloatMod(PipeModBase):
""" FP integer conversion: copes with 16/32/64 int to 16/32/64 fp.
self.ctx.i.op & 0x1 == 0x1 : SIGNED int
from nmigen import Module, Signal, Cat
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.getop import FPADDBaseData
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.fpcommon.fpbase import FPNumDecode, FPNumBaseRecord
-class FPCVTUpConvertMod(FPModBase):
+class FPCVTUpConvertMod(PipeModBase):
""" FP up-conversion (lower to higher bitwidth)
"""
def __init__(self, in_pspec, out_pspec):
from nmigen import Module, Signal, Cat
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBase, FPNumBaseRecord
from ieee754.fpcommon.denorm import FPSCData
self.tot.eq(i.tot), self.ctx.eq(i.ctx)]
-class FPAddStage0Mod(FPModBase):
+class FPAddStage0Mod(PipeModBase):
def __init__(self, pspec):
super().__init__(pspec, "add0")
from nmigen.cli import main, verilog
from math import log
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.fpadd.add0 import FPAddStage0Data
-class FPAddStage1Mod(FPModBase):
+class FPAddStage1Mod(PipeModBase):
""" Second stage of add: preparation for normalisation.
detects when tot sum is too big (tot[27] is kinda a carry bit)
"""
"""
-from nmutil.pipemodbase import FPModBaseChain
+from nmutil.pipemodbase import PipeModBaseChain
from ieee754.fpadd.align import FPAddAlignSingleMod
from ieee754.fpadd.add0 import FPAddStage0Mod
from ieee754.fpadd.add1 import FPAddStage1Mod
-class FPAddAlignSingleAdd(FPModBaseChain):
+class FPAddAlignSingleAdd(PipeModBaseChain):
def get_chain(self):
# chain AddAlignSingle, AddStage0 and AddStage1
from nmigen import Module, Signal
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBaseRecord
from ieee754.fpcommon.fpbase import MultiShiftRMerge
from ieee754.fpcommon.denorm import FPSCData
return m
-class FPAddAlignSingleMod(FPModBase):
+class FPAddAlignSingleMod(PipeModBase):
def __init__(self, pspec):
super().__init__(pspec, "align")
from nmigen.cli import main, verilog
from math import log
-from nmutil.pipemodbase import FPModBase, FPModBaseChain
+from nmutil.pipemodbase import PipeModBase, PipeModBaseChain
from ieee754.fpcommon.fpbase import FPNumDecode
from ieee754.fpcommon.fpbase import FPNumBaseRecord
from ieee754.fpcommon.denorm import (FPSCData, FPAddDeNormMod)
-class FPAddSpecialCasesMod(FPModBase):
+class FPAddSpecialCasesMod(PipeModBase):
""" special cases: NaNs, infs, zeros, denormalised
NOTE: some of these are unique to add. see "Special Operations"
https://steve.hollasch.net/cgindex/coding/ieeefloat.html
return m
-class FPAddSpecialCasesDeNorm(FPModBaseChain):
+class FPAddSpecialCasesDeNorm(PipeModBaseChain):
""" special cases chain
"""
from nmigen import Module
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBase
from ieee754.fpcommon.roundz import FPRoundData
-class FPCorrectionsMod(FPModBase):
+class FPCorrectionsMod(PipeModBase):
def __init__(self, pspec):
super().__init__(pspec, "corrections")
from nmigen.cli import main, verilog
from math import log
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBaseRecord
from ieee754.fpcommon.fpbase import FPNumBase
from ieee754.fpcommon.getop import FPPipeContext
return ret
-class FPAddDeNormMod(FPModBase):
+class FPAddDeNormMod(PipeModBase):
def __init__(self, pspec, m_extra):
self.m_extra = m_extra
"""
-from nmutil.pipemodbase import FPModBaseChain
+from nmutil.pipemodbase import PipeModBaseChain
from ieee754.fpcommon.postnormalise import FPNorm1ModSingle
from ieee754.fpcommon.roundz import FPRoundMod
from ieee754.fpcommon.corrections import FPCorrectionsMod
from ieee754.fpcommon.pack import FPPackMod
-class FPNormToPack(FPModBaseChain):
+class FPNormToPack(PipeModBaseChain):
def __init__(self, pspec, e_extra=False):
self.e_extra = e_extra
from nmigen import Module, Signal
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBaseRecord, FPNumBase
from ieee754.fpcommon.roundz import FPRoundData
from ieee754.fpcommon.getop import FPPipeContext
return list(self)
-class FPPackMod(FPModBase):
+class FPPackMod(PipeModBase):
def __init__(self, pspec):
super().__init__(pspec, "pack")
from nmigen.cli import main, verilog
from math import log
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import (Overflow, OverflowMod,
FPNumBase, FPNumBaseRecord)
from ieee754.fpcommon.fpbase import FPState
return ret
-class FPNorm1ModSingle(FPModBase):
+class FPNorm1ModSingle(PipeModBase):
def __init__(self, pspec, e_extra=False):
self.e_extra = e_extra
from nmigen import Module, Signal
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBase, FPNumBaseRecord
from ieee754.fpcommon.getop import FPPipeContext
from ieee754.fpcommon.postnormalise import FPNorm1Data
return ret
-class FPRoundMod(FPModBase):
+class FPRoundMod(PipeModBase):
def __init__(self, pspec):
super().__init__(pspec, "roundz")
from nmigen import Module, Signal, Cat, Elaboratable, Const, Mux
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBaseRecord
from ieee754.fpcommon.denorm import FPSCData
from ieee754.fpcommon.getop import FPPipeContext
from ieee754.div_rem_sqrt_rsqrt.core import DivPipeCoreOperation as DPCOp
-class FPDivStage0Mod(FPModBase):
+class FPDivStage0Mod(PipeModBase):
""" DIV/SQRT/RSQRT "preparation" module.
adjusts mantissa and exponent (sqrt/rsqrt exponent must be even),
from nmigen import Module, Signal, Cat
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.div_rem_sqrt_rsqrt.div_pipe import DivPipeOutputData
-class FPDivStage2Mod(FPModBase):
+class FPDivStage2Mod(PipeModBase):
""" Last stage of div: preparation for normalisation.
NOTE: this phase does NOT do ACTUAL DIV processing, it ONLY
"""
-from nmutil.pipemodbase import FPModBaseChain
+from nmutil.pipemodbase import PipeModBaseChain
from ieee754.div_rem_sqrt_rsqrt.div_pipe import (DivPipeInterstageData,
DivPipeSetupStage,
DivPipeCalculateStage,
from ieee754.fpdiv.div2 import FPDivStage2Mod
-class FPDivStagesSetup(FPModBaseChain):
+class FPDivStagesSetup(PipeModBaseChain):
def __init__(self, pspec, n_stages, stage_offs):
self.n_stages = n_stages # number of combinatorial stages
return divstages
-class FPDivStagesIntermediate(FPModBaseChain):
+class FPDivStagesIntermediate(PipeModBaseChain):
def __init__(self, pspec, n_stages, stage_offs):
self.n_stages = n_stages # number of combinatorial stages
return divstages
-class FPDivStagesFinal(FPModBaseChain):
+class FPDivStagesFinal(PipeModBaseChain):
def __init__(self, pspec, n_stages, stage_offs):
self.n_stages = n_stages # number of combinatorial stages
from nmigen.cli import main, verilog
from math import log
-from nmutil.pipemodbase import FPModBase, FPModBaseChain
+from nmutil.pipemodbase import PipeModBase, PipeModBaseChain
from ieee754.fpcommon.fpbase import FPNumDecode, FPNumBaseRecord
from ieee754.fpcommon.getop import FPADDBaseData
from ieee754.fpcommon.denorm import (FPSCData, FPAddDeNormMod)
from ieee754.div_rem_sqrt_rsqrt.core import DivPipeCoreOperation as DP
-class FPDIVSpecialCasesMod(FPModBase):
+class FPDIVSpecialCasesMod(PipeModBase):
""" special cases: NaNs, infs, zeros, denormalised
see "Special Operations"
https://steve.hollasch.net/cgindex/coding/ieeefloat.html
return m
-class FPDIVSpecialCasesDeNorm(FPModBaseChain):
+class FPDIVSpecialCasesDeNorm(PipeModBaseChain):
""" special cases: NaNs, infs, zeros, denormalised
"""
from nmigen.cli import main, verilog
from math import log
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBase
from ieee754.fpcommon.getop import FPPipeContext
from ieee754.fpcommon.msbhigh import FPMSBHigh
from ieee754.fpcommon.postcalc import FPAddStage1Data
-class FPAlignModSingle(FPModBase):
+class FPAlignModSingle(PipeModBase):
def __init__(self, pspec, e_extra=False):
self.e_extra = e_extra
from nmigen import Module, Signal, Cat, Elaboratable
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.fpbase import FPNumBaseRecord
from ieee754.fpcommon.denorm import FPSCData
from ieee754.fpcommon.getop import FPPipeContext
self.product.eq(i.product), self.ctx.eq(i.ctx)]
-class FPMulStage0Mod(FPModBase):
+class FPMulStage0Mod(PipeModBase):
def __init__(self, pspec):
super().__init__(pspec, "mul0")
from nmigen import Module, Signal, Elaboratable
from nmigen.cli import main, verilog
-from nmutil.pipemodbase import FPModBase
+from nmutil.pipemodbase import PipeModBase
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.fpmul.mul0 import FPMulStage0Data
-class FPMulStage1Mod(FPModBase):
+class FPMulStage1Mod(PipeModBase):
""" Second stage of mul: preparation for normalisation.
"""
from nmutil.singlepipe import StageChain
-from nmutil.pipemodbase import FPModBaseChain
+from nmutil.pipemodbase import PipeModBaseChain
from ieee754.fpcommon.denorm import FPSCData
from ieee754.fpcommon.postcalc import FPAddStage1Data
from ieee754.fpmul.mul0 import FPMulStage0Mod
from ieee754.fpmul.mul1 import FPMulStage1Mod
-class FPMulStages(FPModBaseChain):
+class FPMulStages(PipeModBaseChain):
def get_chain(self):
# chain MulStage0 and MulStage1
from ieee754.fpcommon.fpbase import FPNumDecode, FPNumBaseRecord
-from nmutil.pipemodbase import FPModBase, FPModBaseChain
+from nmutil.pipemodbase import PipeModBase, PipeModBaseChain
from ieee754.fpcommon.getop import FPADDBaseData
from ieee754.fpcommon.denorm import (FPSCData, FPAddDeNormMod)
from ieee754.fpmul.align import FPAlignModSingle
-class FPMulSpecialCasesMod(FPModBase):
+class FPMulSpecialCasesMod(PipeModBase):
""" special cases: NaNs, infs, zeros, denormalised
see "Special Operations"
https://steve.hollasch.net/cgindex/coding/ieeefloat.html
return m
-class FPMulSpecialCasesDeNorm(FPModBaseChain):
+class FPMulSpecialCasesDeNorm(PipeModBaseChain):
""" special cases: NaNs, infs, zeros, denormalised
"""
from nmutil.singlepipe import StageChain
-class FPModBase(Elaboratable):
- """FPModBase: common code between nearly every pipeline module
+class PipeModBase(Elaboratable):
+ """PipeModBase: common code between nearly every pipeline module
"""
def __init__(self, pspec, modname):
self.modname = modname # use this to give a name to this module
m.d.comb += self.i.eq(i)
-class FPModBaseChain(DynamicPipe):
- """FPModBaseChain: common code between stage-chained pipes
+class PipeModBaseChain(DynamicPipe):
+ """PipeModBaseChain: common code between stage-chained pipes
Links a set of combinatorial modules (get_chain) together
and uses pspec.pipekls to dynamically select the pipeline type