diff options
| author | azidar | 2015-06-02 10:41:27 -0700 |
|---|---|---|
| committer | azidar | 2015-06-02 10:41:27 -0700 |
| commit | f8f9de58dbba5e53193246a5fd2145dfe6537e10 (patch) | |
| tree | dedcbc9b1dc7709d6efbc2dce3c5f36303f2a990 /src/main/stanza/ir-parser.stanza | |
| parent | 8fc826a2770f46d63d8d7b1bccf14d2bf6e6b7cd (diff) | |
Added sequential/combinational memories. Started debugging verilog backend. Added Long support so UInt(LARGENUMBER) works
Diffstat (limited to 'src/main/stanza/ir-parser.stanza')
| -rw-r--r-- | src/main/stanza/ir-parser.stanza | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/stanza/ir-parser.stanza b/src/main/stanza/ir-parser.stanza index cbfe106e..588efeac 100644 --- a/src/main/stanza/ir-parser.stanza +++ b/src/main/stanza/ir-parser.stanza @@ -81,6 +81,10 @@ defsyntax firrtl : int = (?x) when unwrap-token(x) typeof Int : unwrap-token(x) + ;Parses next form if long literal + intorlong = (?x) when unwrap-token(x) typeof Int|Long : + unwrap-token(x) + ;Parses next form if symbol sym = (?x) when unwrap-token(x) typeof Symbol : unwrap-token(x) @@ -107,6 +111,10 @@ defsyntax firrtl : int$ = (?i:#int ?rest ...) when empty?(rest) : i int$ != () : FPE(form, "Expected a single integer literal here.") + ;Error if not a single long integer + long$ = (?i:#intorlong ?rest ...) when empty?(rest) : to-long(i) + long$ != () : FPE(form, "Expected a single long integer literal here.") + ;Error if not a single width width$ = (?w:#width ?rest ...) when empty?(rest) : w width$ != () : FPE(form, "Expected a single width specifier here.") @@ -227,7 +235,7 @@ defsyntax firrtl : expop = (. ?f:#id!) : (fn (x) : Subfield(x, f, UnknownType())) ;Prefix Operators - expterm = (?t:#inttype(?v:#int$)) : + expterm = (?t:#inttype(?v:#long$)) : match(t) : (t:UIntType) : UIntValue(v, width(t)) (t:SIntType) : SIntValue(v, width(t)) |
