aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/ir-parser.stanza
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/stanza/ir-parser.stanza')
-rw-r--r--src/main/stanza/ir-parser.stanza5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/stanza/ir-parser.stanza b/src/main/stanza/ir-parser.stanza
index c622104c..76e7f6ca 100644
--- a/src/main/stanza/ir-parser.stanza
+++ b/src/main/stanza/ir-parser.stanza
@@ -281,7 +281,10 @@ defsyntax firrtl :
expterm = (?t:#inttype(?v:#int$)) :
match(t) :
- (t:UIntType) : UIntValue(BigIntLit(v as Int,32), width(t))
+ (t:UIntType) :
+ if (v as Int) < 0 :
+ FPE(form, "UIntValue cannot be negative.")
+ UIntValue(BigIntLit(v as Int,32), width(t))
(t:SIntType) : SIntValue(BigIntLit(v as Int,32), width(t))
expterm = (?op:#sym(?es:#exp ... ?ints:#int ... ?rest ...)) :