From ccc01fb4f3ed993261981b77e16243de7a90a15f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Mon, 8 Apr 2024 16:44:43 +0200 Subject: [PATCH] techmap: Note down iteration in Kogge-Stone --- techlibs/common/choices/kogge-stone.v | 1 + 1 file changed, 1 insertion(+) diff --git a/techlibs/common/choices/kogge-stone.v b/techlibs/common/choices/kogge-stone.v index 0e25fe86073..ad2e2b16954 100644 --- a/techlibs/common/choices/kogge-stone.v +++ b/techlibs/common/choices/kogge-stone.v @@ -42,6 +42,7 @@ module _80_lcu_kogge_stone (P, G, CI, CO); g[0] = g[0] | (p[0] & CI); for (i = 0; i < $clog2(WIDTH); i = i + 1) begin + // iterate in reverse so we don't confuse a result from this stage and the previous for (j = WIDTH - 1; j >= 2**i; j = j - 1) begin g[j] = g[j] | p[j] & g[j - 2**i]; p[j] = p[j] & p[j - 2**i];