Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 191 lines (168 sloc) 5.148 kb
4cfa3e4 Support the creation of scopes.
steve authored
1 /*
588931f Add dup_expr for user defined function calls.
steve authored
2 * Copyright (c) 1999-2002 Stephen Williams (steve@icarus.com)
4cfa3e4 Support the creation of scopes.
steve authored
3 *
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.
9 *
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.
14 *
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
18 */
52bf4e6 conditional ident string using autoconfig.
steve authored
19 #ifdef HAVE_CVS_IDENT
7fd669f NetEUReduce has its own dup_expr method.
steve authored
20 #ident "$Id: dup_expr.cc,v 1.16 2003/10/31 02:47:11 steve Exp $"
4cfa3e4 Support the creation of scopes.
steve authored
21 #endif
22
b825f8d Create a config.h.in file to hold all the config
steve authored
23 # include "config.h"
24
4cfa3e4 Support the creation of scopes.
steve authored
25 # include "netlist.h"
26 # include <cassert>
27
c602d94 Comparison operators do have defined width.
steve authored
28 NetEBComp* NetEBComp::dup_expr() const
29 {
30 NetEBComp*result = new NetEBComp(op_, left_->dup_expr(),
31 right_->dup_expr());
32 return result;
33 }
34
1222153 Keep parameter constants for the ivl_target API.
steve authored
35 NetEConst* NetEConst::dup_expr() const
36 {
37 NetEConst*tmp = new NetEConst(value_);
38 tmp->set_line(*this);
39 return tmp;
40 }
41
42 NetEConstParam* NetEConstParam::dup_expr() const
43 {
44 NetEConstParam*tmp = new NetEConstParam(scope_, name_, value());
45 tmp->set_line(*this);
46 return tmp;
47 }
48
5903f07 Support parameters in real expressions and
steve authored
49 NetECRealParam* NetECRealParam::dup_expr() const
50 {
51 NetECRealParam*tmp = new NetECRealParam(scope_, name_, value());
52 tmp->set_line(*this);
53 return tmp;
54 }
55
f1cc9d8 Support event names as expressions elements.
steve authored
56 NetEEvent* NetEEvent::dup_expr() const
57 {
58 assert(0);
59 return 0;
60 }
61
4cfa3e4 Support the creation of scopes.
steve authored
62 NetEScope* NetEScope::dup_expr() const
63 {
64 assert(0);
65 return 0;
66 }
67
364ffc9 Add support for bit select of parameters.
steve authored
68 NetESelect* NetESelect::dup_expr() const
69 {
70 return new NetESelect(expr_->dup_expr(), base_->dup_expr(),
71 expr_width());
72 }
73
fbe475e Add infrastructure for system functions, move
steve authored
74 NetESFunc* NetESFunc::dup_expr() const
75 {
6d94f2e Better organize the NetESFunc return type guesses.
steve authored
76 NetESFunc*tmp = new NetESFunc(name_, type_, expr_width(), nparms());
cfed393 Port close cropping behavior from mcrgb
steve authored
77 assert(tmp);
78 for (unsigned idx = 0 ; idx < nparms() ; idx += 1) {
79 assert(tmp->parm(idx));
b28f258 Import MCD support from Stephen Tell, and add
steve authored
80 tmp->parm(idx, tmp->parm(idx)->dup_expr());
cfed393 Port close cropping behavior from mcrgb
steve authored
81 }
b28f258 Import MCD support from Stephen Tell, and add
steve authored
82
83 return tmp;
fbe475e Add infrastructure for system functions, move
steve authored
84 }
85
cfed393 Port close cropping behavior from mcrgb
steve authored
86 NetESignal* NetESignal::dup_expr() const
87 {
88 NetESignal*tmp = new NetESignal(net_, msi_, lsi_);
89 assert(tmp);
90 tmp->expr_width(expr_width());
91 return tmp;
92 }
93
94 NetETernary* NetETernary::dup_expr() const
95 {
96 NetETernary*tmp = new NetETernary(cond_->dup_expr(),
97 true_val_->dup_expr(),
98 false_val_->dup_expr());
99 return tmp;
100 }
101
588931f Add dup_expr for user defined function calls.
steve authored
102 NetEUFunc* NetEUFunc::dup_expr() const
103 {
104 NetEUFunc*tmp;
105 svector<NetExpr*> tmp_parms (parms_.count());
106
107 for (unsigned idx = 0 ; idx < tmp_parms.count() ; idx += 1) {
108 assert(parms_[idx]);
109 tmp_parms[idx] = parms_[idx]->dup_expr();
110 }
111
112 tmp = new NetEUFunc(func_, result_->dup_expr(), tmp_parms);
113
114 return tmp;
115 }
116
cfed393 Port close cropping behavior from mcrgb
steve authored
117 NetEUnary* NetEUnary::dup_expr() const
118 {
119 NetEUnary*tmp = new NetEUnary(op_, expr_->dup_expr());
120 assert(tmp);
121 return tmp;
122 }
123
7fd669f NetEUReduce has its own dup_expr method.
steve authored
124 NetEUReduce* NetEUReduce::dup_expr() const
125 {
126 NetEUReduce*tmp = new NetEUReduce(op_, expr_->dup_expr());
127 assert(tmp);
128 return tmp;
129 }
130
46253ed Rework expression parsing and elaboration to
steve authored
131 NetEVariable* NetEVariable::dup_expr() const
132 {
133 NetEVariable*tmp = new NetEVariable(var_);
134 return tmp;
135 }
136
4cfa3e4 Support the creation of scopes.
steve authored
137 /*
138 * $Log: dup_expr.cc,v $
7fd669f NetEUReduce has its own dup_expr method.
steve authored
139 * Revision 1.16 2003/10/31 02:47:11 steve
140 * NetEUReduce has its own dup_expr method.
141 *
5903f07 Support parameters in real expressions and
steve authored
142 * Revision 1.15 2003/05/30 02:55:32 steve
143 * Support parameters in real expressions and
144 * as real expressions, and fix multiply and
145 * divide with real results.
146 *
f1cc9d8 Support event names as expressions elements.
steve authored
147 * Revision 1.14 2003/04/22 04:48:29 steve
148 * Support event names as expressions elements.
149 *
c602d94 Comparison operators do have defined width.
steve authored
150 * Revision 1.13 2003/03/15 18:08:43 steve
151 * Comparison operators do have defined width.
152 *
6d94f2e Better organize the NetESFunc return type guesses.
steve authored
153 * Revision 1.12 2003/03/15 04:46:28 steve
154 * Better organize the NetESFunc return type guesses.
155 *
1222153 Keep parameter constants for the ivl_target API.
steve authored
156 * Revision 1.11 2003/03/10 23:40:53 steve
157 * Keep parameter constants for the ivl_target API.
158 *
46253ed Rework expression parsing and elaboration to
steve authored
159 * Revision 1.10 2003/01/26 21:15:58 steve
160 * Rework expression parsing and elaboration to
161 * accommodate real/realtime values and expressions.
162 *
588931f Add dup_expr for user defined function calls.
steve authored
163 * Revision 1.9 2002/11/09 00:25:27 steve
164 * Add dup_expr for user defined function calls.
165 *
52bf4e6 conditional ident string using autoconfig.
steve authored
166 * Revision 1.8 2002/08/12 01:34:58 steve
167 * conditional ident string using autoconfig.
168 *
364ffc9 Add support for bit select of parameters.
steve authored
169 * Revision 1.7 2002/01/28 00:52:41 steve
170 * Add support for bit select of parameters.
171 * This leads to a NetESelect node and the
172 * vvp code generator to support that.
173 *
cfed393 Port close cropping behavior from mcrgb
steve authored
174 * Revision 1.6 2001/11/19 01:54:14 steve
175 * Port close cropping behavior from mcrgb
176 * Move window array reset to libmc.
177 *
b825f8d Create a config.h.in file to hold all the config
steve authored
178 * Revision 1.5 2001/07/25 03:10:48 steve
179 * Create a config.h.in file to hold all the config
180 * junk, and support gcc 3.0. (Stephan Boettcher)
181 *
b28f258 Import MCD support from Stephen Tell, and add
steve authored
182 * Revision 1.4 2000/05/07 18:20:07 steve
183 * Import MCD support from Stephen Tell, and add
184 * system function parameter support to the IVL core.
185 *
fbe475e Add infrastructure for system functions, move
steve authored
186 * Revision 1.3 2000/05/04 03:37:58 steve
187 * Add infrastructure for system functions, move
188 * $time to that structure and add $random.
4cfa3e4 Support the creation of scopes.
steve authored
189 */
190
Something went wrong with that request. Please try again.