From 071c800afa93ea2d7413f021e7d699b2a66cfe61 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 20 Mar 2019 13:33:47 +0000 Subject: [PATCH] use ispec and ospec in FPNormaliseModSingle --- src/add/nmigen_add_experiment.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 -- 2.30.2