From 67b05c351cf81fd606f0866b9d43312d551a0ae1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 19 May 2020 18:55:25 +0100 Subject: [PATCH] minor whitespace, comment clz --- src/nmutil/clz.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/nmutil/clz.py b/src/nmutil/clz.py index 2c40988..cbf3397 100644 --- a/src/nmutil/clz.py +++ b/src/nmutil/clz.py @@ -1,6 +1,8 @@ from nmigen import Module, Signal, Elaboratable, Cat, Repl import math -""" TODO: replace this module with PriorityEncoder +""" This module is much more efficient than PriorityEncoder + although it is functionally identical. + see https://bugs.libre-soc.org/show_bug.cgi?id=326 """ class CLZ(Elaboratable): @@ -48,8 +50,7 @@ class CLZ(Elaboratable): left, lv = pairs[i+1] right, rv = pairs[i] width = right.width + 1 - new_pair = Signal(width, name="cnt_%d_%d" % - (iteration, i)) + new_pair = Signal(width, name="cnt_%d_%d" % (iteration, i)) if rv == lv: with m.If(left[-1] == 1): with m.If(right[-1] == 1): @@ -64,7 +65,6 @@ class CLZ(Elaboratable): with m.Else(): comb += new_pair.eq(left) - ret.append((new_pair, lv+rv)) return ret @@ -82,4 +82,3 @@ class CLZ(Elaboratable): return m - -- 2.30.2