Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 150 lines (131 sloc) 4.133 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
6d94f2e Better organize the NetESFunc return type guesses.
steve authored
20 #ident "$Id: dup_expr.cc,v 1.12 2003/03/15 04:46:28 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
1222153 Keep parameter constants for the ivl_target API.
steve authored
28 NetEConst* NetEConst::dup_expr() const
29 {
30 NetEConst*tmp = new NetEConst(value_);
31 tmp->set_line(*this);
32 return tmp;
33 }
34
35 NetEConstParam* NetEConstParam::dup_expr() const
36 {
37 NetEConstParam*tmp = new NetEConstParam(scope_, name_, value());
38 tmp->set_line(*this);
39 return tmp;
40 }
41
4cfa3e4 Support the creation of scopes.
steve authored
42 NetEScope* NetEScope::dup_expr() const
43 {
44 assert(0);
45 return 0;
46 }
47
364ffc9 Add support for bit select of parameters.
steve authored
48 NetESelect* NetESelect::dup_expr() const
49 {
50 return new NetESelect(expr_->dup_expr(), base_->dup_expr(),
51 expr_width());
52 }
53
fbe475e Add infrastructure for system functions, move
steve authored
54 NetESFunc* NetESFunc::dup_expr() const
55 {
6d94f2e Better organize the NetESFunc return type guesses.
steve authored
56 NetESFunc*tmp = new NetESFunc(name_, type_, expr_width(), nparms());
cfed393 Port close cropping behavior from mcrgb
steve authored
57 assert(tmp);
58 for (unsigned idx = 0 ; idx < nparms() ; idx += 1) {
59 assert(tmp->parm(idx));
b28f258 Import MCD support from Stephen Tell, and add
steve authored
60 tmp->parm(idx, tmp->parm(idx)->dup_expr());
cfed393 Port close cropping behavior from mcrgb
steve authored
61 }
b28f258 Import MCD support from Stephen Tell, and add
steve authored
62
63 return tmp;
fbe475e Add infrastructure for system functions, move
steve authored
64 }
65
cfed393 Port close cropping behavior from mcrgb
steve authored
66 NetESignal* NetESignal::dup_expr() const
67 {
68 NetESignal*tmp = new NetESignal(net_, msi_, lsi_);
69 assert(tmp);
70 tmp->expr_width(expr_width());
71 return tmp;
72 }
73
74 NetETernary* NetETernary::dup_expr() const
75 {
76 NetETernary*tmp = new NetETernary(cond_->dup_expr(),
77 true_val_->dup_expr(),
78 false_val_->dup_expr());
79 return tmp;
80 }
81
588931f Add dup_expr for user defined function calls.
steve authored
82 NetEUFunc* NetEUFunc::dup_expr() const
83 {
84 NetEUFunc*tmp;
85 svector<NetExpr*> tmp_parms (parms_.count());
86
87 for (unsigned idx = 0 ; idx < tmp_parms.count() ; idx += 1) {
88 assert(parms_[idx]);
89 tmp_parms[idx] = parms_[idx]->dup_expr();
90 }
91
92 tmp = new NetEUFunc(func_, result_->dup_expr(), tmp_parms);
93
94 return tmp;
95 }
96
cfed393 Port close cropping behavior from mcrgb
steve authored
97 NetEUnary* NetEUnary::dup_expr() const
98 {
99 NetEUnary*tmp = new NetEUnary(op_, expr_->dup_expr());
100 assert(tmp);
101 return tmp;
102 }
103
46253ed Rework expression parsing and elaboration to
steve authored
104 NetEVariable* NetEVariable::dup_expr() const
105 {
106 NetEVariable*tmp = new NetEVariable(var_);
107 return tmp;
108 }
109
4cfa3e4 Support the creation of scopes.
steve authored
110 /*
111 * $Log: dup_expr.cc,v $
6d94f2e Better organize the NetESFunc return type guesses.
steve authored
112 * Revision 1.12 2003/03/15 04:46:28 steve
113 * Better organize the NetESFunc return type guesses.
114 *
1222153 Keep parameter constants for the ivl_target API.
steve authored
115 * Revision 1.11 2003/03/10 23:40:53 steve
116 * Keep parameter constants for the ivl_target API.
117 *
46253ed Rework expression parsing and elaboration to
steve authored
118 * Revision 1.10 2003/01/26 21:15:58 steve
119 * Rework expression parsing and elaboration to
120 * accommodate real/realtime values and expressions.
121 *
588931f Add dup_expr for user defined function calls.
steve authored
122 * Revision 1.9 2002/11/09 00:25:27 steve
123 * Add dup_expr for user defined function calls.
124 *
52bf4e6 conditional ident string using autoconfig.
steve authored
125 * Revision 1.8 2002/08/12 01:34:58 steve
126 * conditional ident string using autoconfig.
127 *
364ffc9 Add support for bit select of parameters.
steve authored
128 * Revision 1.7 2002/01/28 00:52:41 steve
129 * Add support for bit select of parameters.
130 * This leads to a NetESelect node and the
131 * vvp code generator to support that.
132 *
cfed393 Port close cropping behavior from mcrgb
steve authored
133 * Revision 1.6 2001/11/19 01:54:14 steve
134 * Port close cropping behavior from mcrgb
135 * Move window array reset to libmc.
136 *
b825f8d Create a config.h.in file to hold all the config
steve authored
137 * Revision 1.5 2001/07/25 03:10:48 steve
138 * Create a config.h.in file to hold all the config
139 * junk, and support gcc 3.0. (Stephan Boettcher)
140 *
b28f258 Import MCD support from Stephen Tell, and add
steve authored
141 * Revision 1.4 2000/05/07 18:20:07 steve
142 * Import MCD support from Stephen Tell, and add
143 * system function parameter support to the IVL core.
144 *
fbe475e Add infrastructure for system functions, move
steve authored
145 * Revision 1.3 2000/05/04 03:37:58 steve
146 * Add infrastructure for system functions, move
147 * $time to that structure and add $random.
4cfa3e4 Support the creation of scopes.
steve authored
148 */
149
Something went wrong with that request. Please try again.