From e7f2da517adbc9ba4ed1b33de102126260a0d587 Mon Sep 17 00:00:00 2001 From: Brad Beckmann Date: Fri, 20 Aug 2010 11:46:14 -0700 Subject: ruby: Stall and wait input messages instead of recycling This patch allows messages to be stalled in their input buffers and wait until a corresponding address changes state. In order to make this work, all in_ports must be ranked in order of dependence and those in_ports that may unblock an address, must wake up the stalled messages. Alot of this complexity is handled in slicc and the specification files simply annotate the in_ports. --HG-- rename : src/mem/slicc/ast/CheckAllocateStatementAST.py => src/mem/slicc/ast/StallAndWaitStatementAST.py rename : src/mem/slicc/ast/CheckAllocateStatementAST.py => src/mem/slicc/ast/WakeUpDependentsStatementAST.py --- src/mem/slicc/parser.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mem/slicc/parser.py') diff --git a/src/mem/slicc/parser.py b/src/mem/slicc/parser.py index 1505e1d0c..ce665465f 100644 --- a/src/mem/slicc/parser.py +++ b/src/mem/slicc/parser.py @@ -157,6 +157,8 @@ class SLICC(Grammar): 'external_type' : 'EXTERN_TYPE', 'enumeration' : 'ENUM', 'peek' : 'PEEK', + 'stall_and_wait' : 'STALL_AND_WAIT', + 'wake_up_dependents' : 'WAKE_UP_DEPENDENTS', 'enqueue' : 'ENQUEUE', 'copy_head' : 'COPY_HEAD', 'check_allocate' : 'CHECK_ALLOCATE', @@ -499,7 +501,8 @@ class SLICC(Grammar): def p_pair__assign(self, p): """pair : ident '=' STRING - | ident '=' ident""" + | ident '=' ident + | ident '=' NUMBER""" p[0] = ast.PairAST(self, p[1], p[3]) def p_pair__literal(self, p): @@ -547,6 +550,14 @@ class SLICC(Grammar): "statement : ENQUEUE '(' var ',' type pairs ')' statements" p[0] = ast.EnqueueStatementAST(self, p[3], p[5], p[6], p[8]) + def p_statement__stall_and_wait(self, p): + "statement : STALL_AND_WAIT '(' var ',' var ')' SEMI" + p[0] = ast.StallAndWaitStatementAST(self, p[3], p[5]) + + def p_statement__wake_up_dependents(self, p): + "statement : WAKE_UP_DEPENDENTS '(' var ')' SEMI" + p[0] = ast.WakeUpDependentsStatementAST(self, p[3]) + def p_statement__peek(self, p): "statement : PEEK '(' var ',' type pairs ')' statements" p[0] = ast.PeekStatementAST(self, p[3], p[5], p[6], p[8], "peek") -- cgit v1.2.3