aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/errors.stanza
diff options
context:
space:
mode:
authorazidar2015-08-26 15:07:12 -0700
committerazidar2015-08-26 15:07:53 -0700
commitb6bf5ee9b29a117c1fcb3b7ec19ce1ce07132ffd (patch)
treec65e8d722c77fbbaa42c4b3d98e3d0ba6cdb9fca /src/main/stanza/errors.stanza
parentcf1fe102a99efee192288061849165072c699c2e (diff)
Fixed bug where firrtl was incorrectly judging the width of a bigint. #36 #37.
Diffstat (limited to 'src/main/stanza/errors.stanza')
-rw-r--r--src/main/stanza/errors.stanza4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/stanza/errors.stanza b/src/main/stanza/errors.stanza
index fd3dfc2a..69073f9f 100644
--- a/src/main/stanza/errors.stanza
+++ b/src/main/stanza/errors.stanza
@@ -918,14 +918,14 @@ public defn check-width (c:Circuit) -> Circuit :
(e:UIntValue) :
match(width(e)) :
(w:LongWidth) :
- if max(to-long(1),to-long(num-bits(value(e)) - 1)) > width(w) :
+ if max(to-long(1),to-long(req-num-bits(value(e)) - 1)) > width(w) :
add(errors,WidthTooSmall(info,to-string(value(e))))
(w) : add(errors,UninferredWidth(info))
check-width-w(info,width(e))
(e:SIntValue) :
match(width(e)) :
(w:LongWidth) :
- if to-long(num-bits(value(e))) > width(w) :
+ if to-long(req-num-bits(value(e))) > width(w) :
add(errors,WidthTooSmall(info,to-string(value(e))))
(w) : add(errors,UninferredWidth(info))
check-width-w(info,width(e))