FuncCallExprAST.py (9499:b03b556a8fbb) FuncCallExprAST.py (9804:6a043adb1e8d)
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;

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

143
144 if (result == TransitionResult_ResourceStall) {
145 scheduleEvent(Cycles(1));
146
147 // Cannot do anything with this transition, go check next doable transition (mostly likely of next port)
148 }
149}
150''')
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;

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

143
144 if (result == TransitionResult_ResourceStall) {
145 scheduleEvent(Cycles(1));
146
147 // Cannot do anything with this transition, go check next doable transition (mostly likely of next port)
148 }
149}
150''')
151 elif self.proc_name == "doubleTrigger":
152 # NOTE: Use the doubleTrigger call with extreme caution
153 # the key to double trigger is the second event triggered
154 # cannot fail becuase the first event cannot be undone
155 assert len(cvec) == 4
156 code('''
157{
158 Address addr1 = ${{cvec[1]}};
159 TransitionResult result1 =
160 doTransition(${{cvec[0]}}, ${machine}_getState(addr1), addr1);
161
162 if (result1 == TransitionResult_Valid) {
163 //this second event cannont fail because the first event
164 // already took effect
165 Address addr2 = ${{cvec[3]}};
166 TransitionResult result2 = doTransition(${{cvec[2]}}, ${machine}_getState(addr2), addr2);
167
168 // ensure the event suceeded
169 assert(result2 == TransitionResult_Valid);
170
171 counter++;
172 continue; // Check the first port again
173 }
174
175 if (result1 == TransitionResult_ResourceStall) {
176 scheduleEvent(Cycles(1));
177 // Cannot do anything with this transition, go check next
178 // doable transition (mostly likely of next port)
179 }
180}
181''')
182 elif self.proc_name == "error":
183 code("$0", self.exprs[0].embedError(cvec[0]))
184 elif self.proc_name == "assert":
185 error = self.exprs[0].embedError('"assert failure"')
186 code('''
187#ifndef NDEBUG
188if (!(${{cvec[0]}})) {
189 $error

--- 38 unchanged lines hidden ---
151 elif self.proc_name == "error":
152 code("$0", self.exprs[0].embedError(cvec[0]))
153 elif self.proc_name == "assert":
154 error = self.exprs[0].embedError('"assert failure"')
155 code('''
156#ifndef NDEBUG
157if (!(${{cvec[0]}})) {
158 $error

--- 38 unchanged lines hidden ---