summaryrefslogtreecommitdiff
path: root/src/mem
diff options
context:
space:
mode:
authorBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:13 -0800
committerBrad Beckmann <Brad.Beckmann@amd.com>2010-01-29 20:29:13 -0800
commit43e4f59e4f8a055aad856b6b0dd9df6d422c815d (patch)
tree7f2f69fcac61e6316c8456b90bf797727c21c3b8 /src/mem
parentcf08b232ffeb3cb9bfd10f999ae5562ce1528034 (diff)
downloadgem5-43e4f59e4f8a055aad856b6b0dd9df6d422c815d.tar.xz
ruby: Added message type check to OutPortDeclAST.py
Though OutPort's message type is not used to generate code, this fix checks that the programmer's intent is correct. Eventually, we may want to remove the message type from the OutPort declaration statement.
Diffstat (limited to 'src/mem')
-rw-r--r--src/mem/slicc/ast/OutPortDeclAST.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mem/slicc/ast/OutPortDeclAST.py b/src/mem/slicc/ast/OutPortDeclAST.py
index e6ef31928..a387f6d91 100644
--- a/src/mem/slicc/ast/OutPortDeclAST.py
+++ b/src/mem/slicc/ast/OutPortDeclAST.py
@@ -30,6 +30,7 @@ from m5.util import code_formatter
from slicc.ast.DeclAST import DeclAST
from slicc.ast.TypeAST import TypeAST
from slicc.symbols import Var
+from slicc.symbols import Type
class OutPortDeclAST(DeclAST):
def __init__(self, slicc, ident, msg_type, var_expr, pairs):
@@ -52,6 +53,10 @@ class OutPortDeclAST(DeclAST):
"attribute. Type '%s' does not have this attribute.",
(queue_type))
+ if not self.symtab.find(self.msg_type.ident, Type):
+ self.error("The message type '%s' does not exist.",
+ self.msg_type.ident)
+
var = Var(self.symtab, self.ident, self.location, self.queue_type.type,
str(code), self.pairs)
self.symtab.newSymbol(var)