Fix signed ocmpare of negative numbers.
[iverilog.git] / net_nex_output.cc
blobc1649ad7d1e55086e1fee39ebe2a5433933f715d
1 /*
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)
8 * any later version.
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
19 #ifdef HAVE_CVS_IDENT
20 #ident "$Id: net_nex_output.cc,v 1.14 2007/04/17 04:34:23 steve Exp $"
21 #endif
23 # include "config.h"
25 # include <iostream>
27 # include <cassert>
28 # include <typeinfo>
29 # include "netlist.h"
30 # include "netmisc.h"
32 void NetProc::nex_output(NexusSet&out)
34 cerr << get_line()
35 << ": internal error: NetProc::nex_output not implemented"
36 << endl;
37 cerr << get_line()
38 << ": : on object type " << typeid(*this).name()
39 << endl;
43 * Assignments have as output all the bits of the concatenated signals
44 * of the l-value.
46 void NetAssignBase::nex_output(NexusSet&out)
48 for (NetAssign_*cur = lval_ ; cur ; cur = cur->more) {
49 if (NetNet*lsig = cur->sig()) {
50 out.add(lsig->pin(0).nexus());
51 } else {
52 /* Quoting from netlist.h comments for class NetMemory:
53 * "This is not a node because memory objects can only be
54 * accessed by behavioral code."
56 cerr << get_line() << ": internal error: "
57 << "NetAssignBase::nex_output on unsupported lval ";
58 dump_lval(cerr);
59 cerr << endl;
64 void NetBlock::nex_output(NexusSet&out)
66 if (last_ == 0)
67 return;
69 NetProc*cur = last_;
70 do {
71 cur = cur->next_;
72 cur->nex_output(out);
73 } while (cur != last_);
76 void NetCase::nex_output(NexusSet&out)
78 for (unsigned idx = 0 ; idx < nitems_ ; idx += 1) {
80 // Empty statements clearly have no output.
81 if (items_[idx].statement == 0)
82 continue;
84 assert(items_[idx].statement);
85 items_[idx].statement->nex_output(out);
90 void NetCondit::nex_output(NexusSet&out)
92 if (if_ != 0)
93 if_->nex_output(out);
94 if (else_ != 0)
95 else_->nex_output(out);
98 void NetEvWait::nex_output(NexusSet&out)
100 assert(statement_);
101 statement_->nex_output(out);
104 void NetPDelay::nex_output(NexusSet&out)
106 if (statement_) statement_->nex_output(out);
110 * For the purposes of synthesis, system task calls have no output at
111 * all. This is OK because most system tasks are not synthesizeable in
112 * the first place.
114 void NetSTask::nex_output(NexusSet&out)
119 * Consider a task call to not have any outputs. This is not quite
120 * right, we should be listing as outputs all the output ports, but for
121 * the purposes that this method is used, this will do for now.
123 void NetUTask::nex_output(NexusSet&out)
127 void NetWhile::nex_output(NexusSet&out)
129 if (proc_ != 0)
130 proc_->nex_output(out);
134 * $Log: net_nex_output.cc,v $
135 * Revision 1.14 2007/04/17 04:34:23 steve
136 * Fix handling calls to tasks in combinational always block
138 * Revision 1.13 2007/04/05 01:53:52 steve
139 * Probe of case statement inputs can skip nul statements.
141 * Revision 1.12 2005/02/14 04:58:50 steve
142 * l-value input may be a vector.
144 * Revision 1.11 2004/09/16 03:17:33 steve
145 * net_output handles l-value concatenations.
147 * Revision 1.10 2004/08/28 16:23:05 steve
148 * Fix use of system tasks in AT_STAR statements.
150 * Revision 1.9 2004/06/30 15:32:18 steve
151 * nex_output for NetPDelay statements.
153 * Revision 1.8 2003/12/20 00:59:31 steve
154 * Synthesis debug messages.
156 * Revision 1.7 2003/10/26 04:51:39 steve
157 * Output of While is output of while substatement.
159 * Revision 1.6 2002/09/17 04:39:20 steve
160 * Account for part select in l-value.
162 * Revision 1.5 2002/08/12 01:34:59 steve
163 * conditional ident string using autoconfig.
165 * Revision 1.4 2002/07/29 00:00:28 steve
166 * Asynchronous synthesis of sequential blocks.
168 * Revision 1.3 2002/07/07 22:32:15 steve
169 * Asynchronous synthesis of case statements.
171 * Revision 1.2 2002/07/01 00:54:21 steve
172 * synth_asych of if/else requires redirecting the target
173 * if sub-statements. Use NetNet objects to manage the
174 * situation.
176 * Revision 1.1 2002/06/30 02:21:32 steve
177 * Add structure for asynchronous logic synthesis.