From ba417a89c1a654d24c628c7e276433c9f5d64e55 Mon Sep 17 00:00:00 2001 From: azidar Date: Wed, 9 Nov 2016 19:05:52 -0500 Subject: Bugfix: removed recursive removal in infer widths This will certainly lead to more uninferred width errors, but now widths that were previously incorrectly inferred are now correctly uninferred. An example is: reg r : UInt, clock with: (reset => (reset, UInt<2>(3))) node x = add(r, r) r <= x Here, r's width follows the following formula, which cannot be solved: rWidth >= max(max(rWidth, rWidth) + 1, 2) --- src/main/scala/firrtl/passes/InferWidths.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/main') diff --git a/src/main/scala/firrtl/passes/InferWidths.scala b/src/main/scala/firrtl/passes/InferWidths.scala index 67f2b90e..619bb25a 100644 --- a/src/main/scala/firrtl/passes/InferWidths.scala +++ b/src/main/scala/firrtl/passes/InferWidths.scala @@ -81,7 +81,7 @@ object InferWidths extends Pass { def remove_cycle(n: String)(w: Width): Width = { //;println-all-debug(["Removing cycle for " n " inside " w]) - w map remove_cycle(n) match { + w match { case wx: MaxWidth => MaxWidth(wx.args filter { case wxx: VarWidth => !(n equals wxx.name) case _ => true -- cgit v1.2.3