InPortDeclAST.py (7839:9e556fb25900) InPortDeclAST.py (9298:9a087e046c58)
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;

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

86 if machine.EntryType != None:
87 param_types.append(machine.EntryType)
88 if machine.TBEType != None:
89 param_types.append(machine.TBEType)
90
91 # Add the trigger method - FIXME, this is a bit dirty
92 pairs = { "external" : "yes" }
93 func = Func(self.symtab, "trigger", self.location, void_type,
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;

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

86 if machine.EntryType != None:
87 param_types.append(machine.EntryType)
88 if machine.TBEType != None:
89 param_types.append(machine.TBEType)
90
91 # Add the trigger method - FIXME, this is a bit dirty
92 pairs = { "external" : "yes" }
93 func = Func(self.symtab, "trigger", self.location, void_type,
94 param_types, [], "", pairs, None)
94 param_types, [], "", pairs)
95 symtab.newSymbol(func)
96
97 param_types = []
98 # Check for Event2
99 type = symtab.find("Event", Type)
100 if type is None:
101 self.error("in_port decls require 'Event' enumeration")
102

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

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,
95 symtab.newSymbol(func)
96
97 param_types = []
98 # Check for Event2
99 type = symtab.find("Event", Type)
100 if type is None:
101 self.error("in_port decls require 'Event' enumeration")
102

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

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, None)
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,
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, None)
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
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