aboutsummaryrefslogtreecommitdiff
path: root/src/main/antlr4/FIRRTL.g4
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/antlr4/FIRRTL.g4')
-rw-r--r--src/main/antlr4/FIRRTL.g430
1 files changed, 26 insertions, 4 deletions
diff --git a/src/main/antlr4/FIRRTL.g4 b/src/main/antlr4/FIRRTL.g4
index be15ab7c..518cb698 100644
--- a/src/main/antlr4/FIRRTL.g4
+++ b/src/main/antlr4/FIRRTL.g4
@@ -50,6 +50,7 @@ type
: 'UInt' ('<' intLit '>')?
| 'SInt' ('<' intLit '>')?
| 'Fixed' ('<' intLit '>')? ('<' '<' intLit '>' '>')?
+ | 'Interval' (lowerBound boundValue boundValue upperBound)? ('.' intLit)?
| 'Clock'
| 'AsyncReset'
| 'Reset'
@@ -187,6 +188,23 @@ intLit
| HexLit
;
+lowerBound
+ : '['
+ | '('
+ ;
+
+upperBound
+ : ']'
+ | ')'
+ ;
+
+boundValue
+ : '?'
+ | DoubleLit
+ | UnsignedInt
+ | SignedInt
+ ;
+
// Keywords that are also legal ids
keywordAsId
: 'circuit'
@@ -253,6 +271,8 @@ primop
| 'asAsyncReset('
| 'asSInt('
| 'asClock('
+ | 'asFixedPoint('
+ | 'asInterval('
| 'shl('
| 'shr('
| 'dshl('
@@ -270,10 +290,12 @@ primop
| 'bits('
| 'head('
| 'tail('
- | 'asFixedPoint('
- | 'bpshl('
- | 'bpshr('
- | 'bpset('
+ | 'incp('
+ | 'decp('
+ | 'setp('
+ | 'wrap('
+ | 'clip('
+ | 'squz('
;
/*------------------------------------------------------------------