Skip to content
This repository
Newer
Older
100644 145 lines (128 sloc) 4.023 kb
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
1 /*
588931fc » steve
2002-11-09 Add dup_expr for user defined function calls.
2 * Copyright (c) 1999-2002 Stephen Williams (steve@icarus.com)
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
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 */
52bf4e61 » steve
2002-08-12 conditional ident string using autoconfig.
19 #ifdef HAVE_CVS_IDENT
1222153c » steve
2003-03-10 Keep parameter constants for the ivl_target API.
20 #ident "$Id: dup_expr.cc,v 1.11 2003/03/10 23:40:53 steve Exp $"
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
21 #endif
22
b825f8d2 » steve
2001-07-25 Create a config.h.in file to hold all the config
23 # include "config.h"
24
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
25 # include "netlist.h"
26 # include <cassert>
27
1222153c » steve
2003-03-10 Keep parameter constants for the ivl_target API.
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
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
42 NetEScope* NetEScope::dup_expr() const
43 {
44 assert(0);
45 return 0;
46 }
47
364ffc90 » steve
2002-01-28 Add support for bit select of parameters.
48 NetESelect* NetESelect::dup_expr() const
49 {
50 return new NetESelect(expr_->dup_expr(), base_->dup_expr(),
51 expr_width());
52 }
53
fbe475ef » steve
2000-05-04 Add infrastructure for system functions, move
54 NetESFunc* NetESFunc::dup_expr() const
55 {
b28f2584 » steve
2000-05-07 Import MCD support from Stephen Tell, and add
56 NetESFunc*tmp = new NetESFunc(name_, expr_width(), nparms());
cfed3933 » steve
2001-11-19 Port close cropping behavior from mcrgb
57 assert(tmp);
58 for (unsigned idx = 0 ; idx < nparms() ; idx += 1) {
59 assert(tmp->parm(idx));
b28f2584 » steve
2000-05-07 Import MCD support from Stephen Tell, and add
60 tmp->parm(idx, tmp->parm(idx)->dup_expr());
cfed3933 » steve
2001-11-19 Port close cropping behavior from mcrgb
61 }
b28f2584 » steve
2000-05-07 Import MCD support from Stephen Tell, and add
62
63 return tmp;
fbe475ef » steve
2000-05-04 Add infrastructure for system functions, move
64 }
65
cfed3933 » steve
2001-11-19 Port close cropping behavior from mcrgb
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
588931fc » steve
2002-11-09 Add dup_expr for user defined function calls.
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
cfed3933 » steve
2001-11-19 Port close cropping behavior from mcrgb
97 NetEUnary* NetEUnary::dup_expr() const
98 {
99 NetEUnary*tmp = new NetEUnary(op_, expr_->dup_expr());
100 assert(tmp);
101 return tmp;
102 }
103
46253ed8 » steve
2003-01-26 Rework expression parsing and elaboration to
104 NetEVariable* NetEVariable::dup_expr() const
105 {
106 NetEVariable*tmp = new NetEVariable(var_);
107 return tmp;
108 }
109
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
110 /*
111 * $Log: dup_expr.cc,v $
1222153c » steve
2003-03-10 Keep parameter constants for the ivl_target API.
112 * Revision 1.11 2003/03/10 23:40:53 steve
113 * Keep parameter constants for the ivl_target API.
114 *
46253ed8 » steve
2003-01-26 Rework expression parsing and elaboration to
115 * Revision 1.10 2003/01/26 21:15:58 steve
116 * Rework expression parsing and elaboration to
117 * accommodate real/realtime values and expressions.
118 *
588931fc » steve
2002-11-09 Add dup_expr for user defined function calls.
119 * Revision 1.9 2002/11/09 00:25:27 steve
120 * Add dup_expr for user defined function calls.
121 *
52bf4e61 » steve
2002-08-12 conditional ident string using autoconfig.
122 * Revision 1.8 2002/08/12 01:34:58 steve
123 * conditional ident string using autoconfig.
124 *
364ffc90 » steve
2002-01-28 Add support for bit select of parameters.
125 * Revision 1.7 2002/01/28 00:52:41 steve
126 * Add support for bit select of parameters.
127 * This leads to a NetESelect node and the
128 * vvp code generator to support that.
129 *
cfed3933 » steve
2001-11-19 Port close cropping behavior from mcrgb
130 * Revision 1.6 2001/11/19 01:54:14 steve
131 * Port close cropping behavior from mcrgb
132 * Move window array reset to libmc.
133 *
b825f8d2 » steve
2001-07-25 Create a config.h.in file to hold all the config
134 * Revision 1.5 2001/07/25 03:10:48 steve
135 * Create a config.h.in file to hold all the config
136 * junk, and support gcc 3.0. (Stephan Boettcher)
137 *
b28f2584 » steve
2000-05-07 Import MCD support from Stephen Tell, and add
138 * Revision 1.4 2000/05/07 18:20:07 steve
139 * Import MCD support from Stephen Tell, and add
140 * system function parameter support to the IVL core.
141 *
fbe475ef » steve
2000-05-04 Add infrastructure for system functions, move
142 * Revision 1.3 2000/05/04 03:37:58 steve
143 * Add infrastructure for system functions, move
144 * $time to that structure and add $random.
4cfa3e40 » steve
1999-11-27 Support the creation of scopes.
145 */
146
Something went wrong with that request. Please try again.