summaryrefslogtreecommitdiff
path: root/src/mem/slicc/parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/slicc/parser.py')
-rw-r--r--src/mem/slicc/parser.py24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py
index dbf939a9e..d0d26afe8 100644
--- a/src/mem/slicc/parser.py
+++ b/src/mem/slicc/parser.py
@@ -557,8 +557,12 @@ class SLICC(Grammar):
p[0] = ast.AssignStatementAST(self, p[1], p[3])
def p_statement__enqueue(self, p):
- "statement : ENQUEUE '(' var ',' type pairs ')' statements"
- p[0] = ast.EnqueueStatementAST(self, p[3], p[5], p[6], p[8])
+ "statement : ENQUEUE '(' var ',' type ')' statements"
+ p[0] = ast.EnqueueStatementAST(self, p[3], p[5], None, p[7])
+
+ def p_statement__enqueue_latency(self, p):
+ "statement : ENQUEUE '(' var ',' type ',' expr ')' statements"
+ p[0] = ast.EnqueueStatementAST(self, p[3], p[5], p[7], p[9])
def p_statement__stall_and_wait(self, p):
"statement : STALL_AND_WAIT '(' var ',' var ')' SEMI"
@@ -576,14 +580,6 @@ class SLICC(Grammar):
"statement : CHECK_STOP_SLOTS '(' var ',' STRING ',' STRING ')' SEMI"
p[0] = ast.CheckStopStatementAST(self, p[3], p[5], p[7])
- def p_statement__static_cast(self, p):
- "aexpr : STATIC_CAST '(' type ',' expr ')'"
- p[0] = ast.StaticCastAST(self, p[3], "ref", p[5])
-
- def p_statement__static_cast_ptr(self, p):
- "aexpr : STATIC_CAST '(' type ',' STRING ',' expr ')'"
- p[0] = ast.StaticCastAST(self, p[3], p[5], p[7])
-
def p_statement__return(self, p):
"statement : RETURN expr SEMI"
p[0] = ast.ReturnStatementAST(self, p[2])
@@ -605,6 +601,14 @@ class SLICC(Grammar):
p[0] = ast.IfStatementAST(self, p[3], p[5],
ast.StatementListAST(self, p[7]))
+ def p_expr__static_cast(self, p):
+ "aexpr : STATIC_CAST '(' type ',' expr ')'"
+ p[0] = ast.StaticCastAST(self, p[3], "ref", p[5])
+
+ def p_expr__static_cast_ptr(self, p):
+ "aexpr : STATIC_CAST '(' type ',' STRING ',' expr ')'"
+ p[0] = ast.StaticCastAST(self, p[3], p[5], p[7])
+
def p_expr__var(self, p):
"aexpr : var"
p[0] = p[1]