From: Luke Kenneth Casson Leighton Date: Wed, 20 Mar 2019 14:19:04 +0000 (+0000) Subject: use ospec/ispec in FPCorrectionsMod X-Git-Tag: ls180-24jan2020~1595 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a004dbdfcd19e812e2ee28904071682e9c30a4dc;p=ieee754fpu.git use ospec/ispec in FPCorrectionsMod --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 7b3f6c09..45687a08 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -1338,8 +1338,15 @@ class FPRound(FPState, FPID): class FPCorrectionsMod: def __init__(self, width): - self.in_z = FPNumOut(width, False) - self.out_z = FPNumOut(width, False) + self.width = width + self.in_z = self.ispec() + self.out_z = self.ospec() + + def ispec(self): + return FPNumOut(self.width, False) + + def ospec(self): + return FPNumOut(self.width, False) def setup(self, m, in_z): """ links module to inputs and outputs @@ -1363,7 +1370,7 @@ class FPCorrections(FPState, FPID): FPState.__init__(self, "corrections") FPID.__init__(self, id_wid) self.mod = FPCorrectionsMod(width) - self.out_z = FPNumBase(width) + self.out_z = self.mod.ospec() def setup(self, m, in_z, in_mid): """ links module to inputs and outputs