From: Luke Kenneth Casson Leighton Date: Sat, 9 Mar 2019 10:46:54 +0000 (+0000) Subject: create specialcasesmod setup fn X-Git-Tag: ls180-24jan2020~1708 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ad26042b4e313d8f1273ff8bac9bac317440bffc;p=ieee754fpu.git create specialcasesmod setup fn --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index f710e12f..92c1b677 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -148,6 +148,14 @@ class FPAddSpecialCasesMod: self.out_z = FPNumOut(width, False) self.out_do_z = Signal(reset_less=True) + def setup(self, m, in_a, in_b, out_do_z): + """ links module to inputs and outputs + """ + m.submodules.specialcases = self + m.d.comb += self.in_a.copy(in_a) + m.d.comb += self.in_b.copy(in_b) + m.d.comb += out_do_z.eq(self.out_do_z) + def elaborate(self, platform): m = Module() @@ -264,11 +272,7 @@ class FPAddSpecialCases(FPState, FPID): def setup(self, m, in_a, in_b, in_mid): """ links module to inputs and outputs """ - m.submodules.specialcases = self.mod - m.d.comb += self.mod.in_a.copy(in_a) - m.d.comb += self.mod.in_b.copy(in_b) - #m.d.comb += self.out_z.v.eq(self.mod.out_z.v) - m.d.comb += self.out_do_z.eq(self.mod.out_do_z) + self.mod.setup(m, in_a, in_b, self.out_do_z) if self.in_mid is not None: m.d.comb += self.in_mid.eq(in_mid)