InPortDeclAST.py (9298:9a087e046c58) InPortDeclAST.py (9820:2f9aecba2362)
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 95 unchanged lines hidden (view full) ---

104
105 # Check for Address2
106 type = symtab.find("Address", Type)
107 if type is None:
108 self.error("in_port decls require 'Address' type to be defined")
109
110 param_types.append(type)
111
1# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
2# Copyright (c) 2009 The Hewlett-Packard Development Company
3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions are
7# met: redistributions of source code must retain the above copyright
8# notice, this list of conditions and the following disclaimer;

--- 95 unchanged lines hidden (view full) ---

104
105 # Check for Address2
106 type = symtab.find("Address", Type)
107 if type is None:
108 self.error("in_port decls require 'Address' type to be defined")
109
110 param_types.append(type)
111
112 # Add the doubleTrigger method - this hack supports tiggering
113 # two simulateous events
114 #
115 # The key is that the second transistion cannot fail because
116 # the first event cannot be undone therefore you must do some
117 # checks before calling double trigger to ensure that won't
118 # happen
119 func = Func(self.symtab, "doubleTrigger", self.location, void_type,
120 param_types, [], "", pairs)
121 symtab.newSymbol(func)
122
123 # Add the continueProcessing method - this hack supports
124 # messages that don't trigger events
125 func = Func(self.symtab, "continueProcessing", self.location,
126 void_type, [], [], "", pairs)
127 symtab.newSymbol(func)
128
129 if self.statements is not None:
130 rcode = self.slicc.codeFormatter()
131 rcode.indent()
132 rcode.indent()
133 self.statements.generate(rcode, None)
134 in_port["c_code_in_port"] = str(rcode)
135
136 symtab.popFrame()
137
138 # Add port to state machine
139 machine.addInPort(in_port)
140
141 # Include max_rank to be used by StateMachine.py
142 in_port["max_port_rank"] = InPortDeclAST.max_port_rank
112 if self.statements is not None:
113 rcode = self.slicc.codeFormatter()
114 rcode.indent()
115 rcode.indent()
116 self.statements.generate(rcode, None)
117 in_port["c_code_in_port"] = str(rcode)
118
119 symtab.popFrame()
120
121 # Add port to state machine
122 machine.addInPort(in_port)
123
124 # Include max_rank to be used by StateMachine.py
125 in_port["max_port_rank"] = InPortDeclAST.max_port_rank