2 * Copyright (c) 2002 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 #ident "$Id: async.cc,v 1.7 2004/01/18 23:26:54 steve Exp $"
29 bool NetAssign::is_asynchronous()
34 bool NetCondit::is_asynchronous()
40 * NetEvWait statements come from statements of the form @(...) in the
41 * Verilog source. These event waits are considered asynchronous if
42 * all of the events in the list are ANYEDGE, and all the inputs to
43 * the statement are included in the sensitivity list. If any of the
44 * events are posedge or negedge, the statement is synchronous
45 * (i.e. an edge-triggered flip-flop) and if any of the inputs are
46 * unaccounted for in the sensitivity list then the statement is a
49 bool NetEvWait::is_asynchronous()
51 /* The "sense" set contains the set of Nexa that are in the
52 sensitivity list. We also require that the events are all
53 level sensitive, but the nex_async_ method takes care of
55 NexusSet
*sense
= new NexusSet
;
56 for (unsigned idx
= 0 ; idx
< nevents_
; idx
+= 1) {
57 NexusSet
*tmp
= event(idx
)->nex_async_();
67 NexusSet
*inputs
= statement_
->nex_input();
69 if (! sense
->contains(*inputs
)) {
78 /* If it passes all the other tests, then this statement is
83 bool NetProc::is_asynchronous()
88 bool NetProcTop::is_asynchronous()
90 if (type_
== NetProcTop::KINITIAL
)
93 return statement_
->is_asynchronous();
98 * Revision 1.7 2004/01/18 23:26:54 steve
99 * The is_combinational function really need not recurse.
101 * Revision 1.6 2003/12/20 00:33:39 steve
102 * More thorough check that NetEvWait is asynchronous.
104 * Revision 1.5 2003/09/04 20:28:05 steve
105 * Support time0 resolution of combinational threads.
107 * Revision 1.4 2002/08/18 22:07:16 steve
108 * Detect temporaries in sequential block synthesis.
110 * Revision 1.3 2002/08/12 01:34:58 steve
111 * conditional ident string using autoconfig.
113 * Revision 1.2 2002/07/04 00:24:16 steve
114 * initial statements are not asynchronous.
116 * Revision 1.1 2002/06/30 02:21:31 steve
117 * Add structure for asynchronous logic synthesis.