From: Luke Kenneth Casson Leighton Date: Wed, 20 Mar 2019 13:33:47 +0000 (+0000) Subject: use ispec and ospec in FPNormaliseModSingle X-Git-Tag: ls180-24jan2020~1603 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=071c800afa93ea2d7413f021e7d699b2a66cfe61;p=ieee754fpu.git use ispec and ospec in FPNormaliseModSingle --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index bc5f6415..5d5a9933 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -928,8 +928,14 @@ class FPNormaliseModSingle: def __init__(self, width): self.width = width - self.in_z = FPNumBase(width, False) - self.out_z = FPNumBase(width, False) + self.in_z = self.ispec() + self.out_z = self.ospec() + + def ispec(self): + return FPNumBase(self.width, False) + + def ospec(self): + return FPNumBase(self.width, False) def setup(self, m, in_z, out_z, modname): """ links module to inputs and outputs @@ -963,7 +969,7 @@ class FPNormaliseModSingle: # initialise out from in (overridden below) m.d.comb += self.out_z.eq(in_z) m.d.comb += self.out_of.eq(in_of) - # normalisation increase/decrease conditions + # normalisation decrease condition decrease = Signal(reset_less=True) m.d.comb += decrease.eq(in_z.m_msbzero) # decrease exponent