From 8cf32169a3ce0290028d0887b8fbde5e5e07480e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 22 Aug 2019 02:08:39 +0100 Subject: [PATCH] move groups test to top of loop --- src/ieee754/part_mul_add/multiply.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) -- 2.30.2