summaryrefslogtreecommitdiff
path: root/src/mem/slicc/ast/InPortDeclAST.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mem/slicc/ast/InPortDeclAST.py')
-rw-r--r--src/mem/slicc/ast/InPortDeclAST.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mem/slicc/ast/InPortDeclAST.py b/src/mem/slicc/ast/InPortDeclAST.py
index 5aa27bae8..c6fadb9e7 100644
--- a/src/mem/slicc/ast/InPortDeclAST.py
+++ b/src/mem/slicc/ast/InPortDeclAST.py
@@ -51,6 +51,10 @@ class InPortDeclAST(DeclAST):
symtab = self.symtab
void_type = symtab.find("void", Type)
+ machine = symtab.state_machine
+ if machine is None:
+ self.error("InPort declaration not part of a machine.")
+
code = self.slicc.codeFormatter()
queue_type = self.var_expr.generate(code)
if not queue_type.isInPort:
@@ -79,6 +83,11 @@ class InPortDeclAST(DeclAST):
param_types.append(type)
+ if machine.EntryType != None:
+ param_types.append(machine.EntryType)
+ if machine.TBEType != None:
+ param_types.append(machine.TBEType)
+
# Add the trigger method - FIXME, this is a bit dirty
pairs = { "external" : "yes" }
func = Func(self.symtab, "trigger", self.location, void_type,
@@ -123,13 +132,10 @@ class InPortDeclAST(DeclAST):
rcode.indent()
self.statements.generate(rcode, None)
in_port["c_code_in_port"] = str(rcode)
+
symtab.popFrame()
# Add port to state machine
- machine = symtab.state_machine
- if machine is None:
- self.error("InPort declaration not part of a machine.")
-
machine.addInPort(in_port)
# Include max_rank to be used by StateMachine.py