From: Luke Kenneth Casson Leighton Date: Thu, 22 Aug 2019 01:08:39 +0000 (+0100) Subject: move groups test to top of loop X-Git-Tag: ls180-24jan2020~430 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8cf32169a3ce0290028d0887b8fbde5e5e07480e;p=ieee754fpu.git move groups test to top of loop --- diff --git a/src/ieee754/part_mul_add/multiply.py b/src/ieee754/part_mul_add/multiply.py index e2954e76..93b1e228 100644 --- a/src/ieee754/part_mul_add/multiply.py +++ b/src/ieee754/part_mul_add/multiply.py @@ -569,6 +569,9 @@ class AddReduce(Elaboratable): inputs = self.inputs ilen = len(inputs) while True: + groups = AddReduceSingle.full_adder_groups(len(inputs)) + if len(groups) == 0: + break next_level = AddReduceSingle(ilen, self.output_width, n_parts, next_levels, partition_points) mods.append(next_level) @@ -577,9 +580,6 @@ class AddReduce(Elaboratable): inputs = next_level.o.inputs ilen = len(inputs) part_ops = next_level.i.part_ops - next_groups = AddReduceSingle.full_adder_groups(len(inputs)) - if len(next_groups) == 0: - break next_level = FinalAdd(ilen, self.output_width, n_parts, next_levels, partition_points)