From 500170b99c9960a38c7549c13109542cf80c02c1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Sat, 23 Mar 2019 10:36:53 +0000 Subject: [PATCH] pass through out_do_z into FPPack --- src/add/nmigen_add_experiment.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 15f39d80..6baa0a45 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -1485,22 +1485,16 @@ class FPPackMod: m = Module() m.submodules.pack_in_z = self.i.z m.d.comb += self.o.mid.eq(self.i.mid) - with m.If(self.i.z.is_overflowed): - m.d.comb += self.o.z.inf(self.i.z.s) + with m.If(~self.i.out_do_z): + with m.If(self.i.z.is_overflowed): + m.d.comb += self.o.z.inf(self.i.z.s) + with m.Else(): + m.d.comb += self.o.z.create(self.i.z.s, self.i.z.e, self.i.z.m) with m.Else(): - m.d.comb += self.o.z.create(self.i.z.s, self.i.z.e, self.i.z.m) + m.d.comb += self.o.z.eq(self.i.z) return m -class FPPackData: - def __init__(self, width, id_wid): - self.z = FPNumOut(width, False) - self.mid = Signal(id_wid, reset_less=True) - - def eq(self, i): - return [self.z.eq(i.z), self.mid.eq(i.mid)] - - class FPPack(FPState): def __init__(self, width, id_wid): -- 2.30.2