2 * Copyright (c) 1999-2008 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
25 NetEBComp
* NetEBComp::dup_expr() const
27 NetEBComp
*tmp
= new NetEBComp(op_
, left_
->dup_expr(),
34 NetEConst
* NetEConst::dup_expr() const
36 NetEConst
*tmp
= new NetEConst(value_
);
42 NetEConstParam
* NetEConstParam::dup_expr() const
44 NetEConstParam
*tmp
= new NetEConstParam(scope_
, name_
, value());
50 NetECRealParam
* NetECRealParam::dup_expr() const
52 NetECRealParam
*tmp
= new NetECRealParam(scope_
, name_
, value());
58 NetEEvent
* NetEEvent::dup_expr() const
64 NetEScope
* NetEScope::dup_expr() const
70 NetESelect
* NetESelect::dup_expr() const
72 NetESelect
*tmp
= new NetESelect(expr_
->dup_expr(),
73 base_
? base_
->dup_expr() : 0,
80 NetESFunc
* NetESFunc::dup_expr() const
82 NetESFunc
*tmp
= new NetESFunc(name_
, type_
, expr_width(), nparms());
85 tmp
->cast_signed(has_sign());
86 for (unsigned idx
= 0 ; idx
< nparms() ; idx
+= 1) {
87 assert(tmp
->parm(idx
));
88 tmp
->parm(idx
, tmp
->parm(idx
)->dup_expr());
95 NetESignal
* NetESignal::dup_expr() const
97 NetESignal
*tmp
= new NetESignal(net_
, word_
);
99 tmp
->expr_width(expr_width());
100 tmp
->set_line(*this);
104 NetETernary
* NetETernary::dup_expr() const
106 NetETernary
*tmp
= new NetETernary(cond_
->dup_expr(),
107 true_val_
->dup_expr(),
108 false_val_
->dup_expr());
110 tmp
->set_line(*this);
114 NetEUFunc
* NetEUFunc::dup_expr() const
117 svector
<NetExpr
*> tmp_parms (parms_
.count());
119 for (unsigned idx
= 0 ; idx
< tmp_parms
.count() ; idx
+= 1) {
121 tmp_parms
[idx
] = parms_
[idx
]->dup_expr();
124 tmp
= new NetEUFunc(scope_
, func_
, result_sig_
->dup_expr(), tmp_parms
);
127 tmp
->set_line(*this);
131 NetEUnary
* NetEUnary::dup_expr() const
133 NetEUnary
*tmp
= new NetEUnary(op_
, expr_
->dup_expr());
135 tmp
->set_line(*this);
139 NetEUReduce
* NetEUReduce::dup_expr() const
141 NetEUReduce
*tmp
= new NetEUReduce(op_
, expr_
->dup_expr());
143 tmp
->set_line(*this);