From: Luke Kenneth Casson Leighton Date: Sat, 23 Mar 2019 09:55:18 +0000 (+0000) Subject: add pass-through out_do_z to FPAlign X-Git-Tag: ls180-24jan2020~1519 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8b7ea500711ac80c17b23680c57843783efafdb9;p=ieee754fpu.git add pass-through out_do_z to FPAlign --- diff --git a/src/add/nmigen_add_experiment.py b/src/add/nmigen_add_experiment.py index 11c08d3d..87780a42 100644 --- a/src/add/nmigen_add_experiment.py +++ b/src/add/nmigen_add_experiment.py @@ -624,7 +624,7 @@ class FPAddAlignSingleMod: self.o = self.ospec() def ispec(self): - return FPNumBase2Ops(self.width, self.id_wid) + return FPSCData(self.width, self.id_wid) def ospec(self): return FPNumIn2Ops(self.width, self.id_wid) @@ -687,21 +687,24 @@ class FPAddAlignSingleMod: # only one shifter (muxed) #m.d.comb += t_out.shift_down_multi(tdiff, t_inp) # exponent of a greater than b: shift b down - with m.If(egz): - m.d.comb += [t_inp.eq(self.i.b), - tdiff.eq(ediff), - self.o.b.eq(t_out), - self.o.b.s.eq(self.i.b.s), # whoops forgot sign - ] - # exponent of b greater than a: shift a down - with m.Elif(elz): - m.d.comb += [t_inp.eq(self.i.a), - tdiff.eq(ediffr), - self.o.a.eq(t_out), - self.o.a.s.eq(self.i.a.s), # whoops forgot sign - ] + with m.If(~self.i.out_do_z): + with m.If(egz): + m.d.comb += [t_inp.eq(self.i.b), + tdiff.eq(ediff), + self.o.b.eq(t_out), + self.o.b.s.eq(self.i.b.s), # whoops forgot sign + ] + # exponent of b greater than a: shift a down + with m.Elif(elz): + m.d.comb += [t_inp.eq(self.i.a), + tdiff.eq(ediffr), + self.o.a.eq(t_out), + self.o.a.s.eq(self.i.a.s), # whoops forgot sign + ] m.d.comb += self.o.mid.eq(self.i.mid) + m.d.comb += self.o.z.eq(self.i.z) + m.d.comb += self.o.out_do_z.eq(self.i.out_do_z) return m