From 5c63bea388663b82eb1ea43464dfea055b10a79b Mon Sep 17 00:00:00 2001 From: azidar Date: Fri, 1 May 2015 13:48:06 -0700 Subject: Bug fix. ExpWidth was improperly evaluated during simplify (not subtracting one) --- src/main/stanza/passes.stanza | 2 +- test/passes/infer-widths/dsh.fir | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza index 429a1406..b1410fa4 100644 --- a/src/main/stanza/passes.stanza +++ b/src/main/stanza/passes.stanza @@ -1395,7 +1395,7 @@ defn solve-constraints (l:List) -> HashTable : (w1,w2) : w (w:ExpWidth) : match(arg1(w)) : - (w1:IntWidth) : IntWidth(pow(2,width(w1))) + (w1:IntWidth) : IntWidth(pow(2,width(w1)) - 1) (w1) : w (w) : w defn substitute (w:Width,h:HashTable) -> Width : diff --git a/test/passes/infer-widths/dsh.fir b/test/passes/infer-widths/dsh.fir index 1eb23115..2cbdfd34 100644 --- a/test/passes/infer-widths/dsh.fir +++ b/test/passes/infer-widths/dsh.fir @@ -1,4 +1,4 @@ -; RUN: firrtl -i %s -o %s.flo -x abcdefghijkl -p ctd | tee %s.out | FileCheck %s +; RUN: firrtl -i %s -o %s.flo -x abcdefghijkl -p cd | tee %s.out | FileCheck %s ;CHECK: Infer Widths -- cgit v1.2.3