1998-11-04 00:28:49 +01:00
|
|
|
/*
|
2012-02-05 01:19:27 +01:00
|
|
|
* Copyright (c) 1998-2012 Stephen Williams <steve@icarus.com>
|
1998-11-04 00:28:49 +01:00
|
|
|
*
|
|
|
|
|
* This source code is free software; you can redistribute it
|
|
|
|
|
* and/or modify it in source code form under the terms of the GNU
|
|
|
|
|
* General Public License as published by the Free Software
|
|
|
|
|
* Foundation; either version 2 of the License, or (at your option)
|
|
|
|
|
* any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
2012-08-29 03:41:23 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
1998-11-04 00:28:49 +01:00
|
|
|
*/
|
|
|
|
|
|
2001-07-25 05:10:48 +02:00
|
|
|
# include "config.h"
|
|
|
|
|
|
|
|
|
|
# include <iostream>
|
|
|
|
|
|
2008-08-30 06:11:44 +02:00
|
|
|
# include "compiler.h"
|
1998-11-04 00:28:49 +01:00
|
|
|
# include "PExpr.h"
|
2010-01-12 21:11:01 +01:00
|
|
|
# include "PWire.h"
|
1999-05-16 07:08:42 +02:00
|
|
|
# include "Module.h"
|
2008-11-09 01:26:55 +01:00
|
|
|
# include "netmisc.h"
|
2010-10-26 04:36:44 +02:00
|
|
|
# include "util.h"
|
1998-11-11 01:01:51 +01:00
|
|
|
# include <typeinfo>
|
1998-11-04 00:28:49 +01:00
|
|
|
|
2000-04-12 06:23:57 +02:00
|
|
|
PExpr::PExpr()
|
|
|
|
|
{
|
2011-02-26 23:59:52 +01:00
|
|
|
expr_type_ = IVL_VT_NO_TYPE;
|
|
|
|
|
expr_width_ = 0;
|
|
|
|
|
min_width_ = 0;
|
|
|
|
|
signed_flag_ = false;
|
2000-04-12 06:23:57 +02:00
|
|
|
}
|
|
|
|
|
|
1998-11-04 00:28:49 +01:00
|
|
|
PExpr::~PExpr()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-01 22:37:06 +01:00
|
|
|
void PExpr::declare_implicit_nets(LexicalScope*, NetNet::Type)
|
2010-01-12 21:11:01 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PExpr::has_aa_term(Design*, NetScope*) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-11 01:01:51 +01:00
|
|
|
bool PExpr::is_the_same(const PExpr*that) const
|
|
|
|
|
{
|
|
|
|
|
return typeid(this) == typeid(that);
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-01 22:37:06 +01:00
|
|
|
NetNet* PExpr::elaborate_lnet(Design*, NetScope*) const
|
1999-09-15 06:17:52 +02:00
|
|
|
{
|
2010-11-01 22:37:06 +01:00
|
|
|
cerr << get_fileline() << ": error: "
|
|
|
|
|
<< "expression not valid in assign l-value: "
|
|
|
|
|
<< *this << endl;
|
1999-09-15 06:17:52 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2010-11-01 22:37:06 +01:00
|
|
|
NetNet* PExpr::elaborate_bi_net(Design*, NetScope*) const
|
2005-08-06 19:58:16 +02:00
|
|
|
{
|
2007-12-20 18:31:01 +01:00
|
|
|
cerr << get_fileline() << ": error: "
|
2010-11-01 22:37:06 +01:00
|
|
|
<< "expression not valid as argument to inout port: "
|
|
|
|
|
<< *this << endl;
|
2005-08-06 19:58:16 +02:00
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2011-03-13 14:29:42 +01:00
|
|
|
bool PExpr::is_collapsible_net(Design*, NetScope*) const
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2001-11-06 07:11:55 +01:00
|
|
|
PEBinary::PEBinary(char op, PExpr*l, PExpr*r)
|
|
|
|
|
: op_(op), left_(l), right_(r)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEBinary::~PEBinary()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-12 21:11:01 +01:00
|
|
|
void PEBinary::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
|
|
|
|
{
|
|
|
|
|
assert(left_ && right_);
|
|
|
|
|
left_->declare_implicit_nets(scope, type);
|
|
|
|
|
right_->declare_implicit_nets(scope, type);
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PEBinary::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
assert(left_ && right_);
|
|
|
|
|
return left_->has_aa_term(des, scope) || right_->has_aa_term(des, scope);
|
|
|
|
|
}
|
|
|
|
|
|
2011-09-19 04:21:46 +02:00
|
|
|
PECastSize::PECastSize(unsigned si, PExpr*b)
|
|
|
|
|
: size_(si), base_(b)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PECastSize::~PECastSize()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-30 06:44:49 +01:00
|
|
|
PEBComp::PEBComp(char op, PExpr*l, PExpr*r)
|
|
|
|
|
: PEBinary(op, l, r)
|
|
|
|
|
{
|
2011-02-26 23:59:52 +01:00
|
|
|
l_width_ = 0;
|
|
|
|
|
r_width_ = 0;
|
2006-10-30 06:44:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEBComp::~PEBComp()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2008-10-30 04:31:26 +01:00
|
|
|
PEBLogic::PEBLogic(char op, PExpr*l, PExpr*r)
|
|
|
|
|
: PEBinary(op, l, r)
|
|
|
|
|
{
|
|
|
|
|
assert(op == 'a' || op == 'o');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEBLogic::~PEBLogic()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-28 23:40:25 +01:00
|
|
|
PEBLeftWidth::PEBLeftWidth(char op, PExpr*l, PExpr*r)
|
2006-10-30 06:44:49 +01:00
|
|
|
: PEBinary(op, l, r)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-28 23:40:25 +01:00
|
|
|
PEBLeftWidth::~PEBLeftWidth()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEBPower::PEBPower(char op, PExpr*l, PExpr*r)
|
|
|
|
|
: PEBLeftWidth(op, l, r)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEBPower::~PEBPower()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEBShift::PEBShift(char op, PExpr*l, PExpr*r)
|
|
|
|
|
: PEBLeftWidth(op, l, r)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2006-10-30 06:44:49 +01:00
|
|
|
PEBShift::~PEBShift()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-27 23:22:19 +02:00
|
|
|
PECallFunction::PECallFunction(const pform_name_t&n, const vector<PExpr *> &parms)
|
2001-12-03 05:47:14 +01:00
|
|
|
: path_(n), parms_(parms)
|
1999-09-25 04:57:29 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-24 06:07:11 +02:00
|
|
|
static pform_name_t pn_from_ps(perm_string n)
|
|
|
|
|
{
|
|
|
|
|
name_component_t tmp_name (n);
|
|
|
|
|
pform_name_t tmp;
|
|
|
|
|
tmp.push_back(tmp_name);
|
|
|
|
|
return tmp;
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-27 23:22:19 +02:00
|
|
|
PECallFunction::PECallFunction(perm_string n, const vector<PExpr*>&parms)
|
2007-05-24 06:07:11 +02:00
|
|
|
: path_(pn_from_ps(n)), parms_(parms)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PECallFunction::PECallFunction(perm_string n)
|
|
|
|
|
: path_(pn_from_ps(n))
|
2000-05-04 05:37:58 +02:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2008-07-27 23:22:19 +02:00
|
|
|
// NOTE: Anachronism. Try to work all use of svector out.
|
2010-10-26 04:36:44 +02:00
|
|
|
PECallFunction::PECallFunction(const pform_name_t&n, const list<PExpr *> &parms)
|
|
|
|
|
: path_(n), parms_(parms.size())
|
2008-07-27 23:22:19 +02:00
|
|
|
{
|
2010-10-26 04:36:44 +02:00
|
|
|
int tmp_idx = 0;
|
|
|
|
|
assert(parms_.size() == parms.size());
|
|
|
|
|
for (list<PExpr*>::const_iterator idx = parms.begin()
|
|
|
|
|
; idx != parms.end() ; ++idx)
|
|
|
|
|
parms_[tmp_idx++] = *idx;
|
2008-07-27 23:22:19 +02:00
|
|
|
}
|
|
|
|
|
|
2010-10-26 04:36:44 +02:00
|
|
|
PECallFunction::PECallFunction(perm_string n, const list<PExpr*>&parms)
|
|
|
|
|
: path_(pn_from_ps(n)), parms_(parms.size())
|
2008-07-27 23:22:19 +02:00
|
|
|
{
|
2010-10-26 04:36:44 +02:00
|
|
|
int tmp_idx = 0;
|
|
|
|
|
assert(parms_.size() == parms.size());
|
|
|
|
|
for (list<PExpr*>::const_iterator idx = parms.begin()
|
|
|
|
|
; idx != parms.end() ; ++idx)
|
|
|
|
|
parms_[tmp_idx++] = *idx;
|
2008-07-27 23:22:19 +02:00
|
|
|
}
|
|
|
|
|
|
1999-09-25 04:57:29 +02:00
|
|
|
PECallFunction::~PECallFunction()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-12 21:11:01 +01:00
|
|
|
void PECallFunction::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
|
|
|
|
{
|
|
|
|
|
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
|
|
|
|
|
parms_[idx]->declare_implicit_nets(scope, type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PECallFunction::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
bool flag = false;
|
|
|
|
|
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
|
|
|
|
|
flag = parms_[idx]->has_aa_term(des, scope) || flag;
|
|
|
|
|
}
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
|
2010-10-26 04:36:44 +02:00
|
|
|
PEConcat::PEConcat(const list<PExpr*>&p, PExpr*r)
|
2011-03-04 01:23:44 +01:00
|
|
|
: parms_(p.size()), width_modes_(SIZED, p.size()), repeat_(r)
|
2000-04-12 06:23:57 +02:00
|
|
|
{
|
2010-10-26 04:36:44 +02:00
|
|
|
int tmp_idx = 0;
|
|
|
|
|
assert(parms_.size() == p.size());
|
|
|
|
|
for (list<PExpr*>::const_iterator idx = p.begin()
|
|
|
|
|
; idx != p.end() ; ++idx)
|
|
|
|
|
parms_[tmp_idx++] = *idx;
|
2011-02-26 23:59:52 +01:00
|
|
|
|
|
|
|
|
tested_scope_ = 0;
|
|
|
|
|
repeat_count_ = 1;
|
2000-04-12 06:23:57 +02:00
|
|
|
}
|
|
|
|
|
|
1999-06-10 06:03:52 +02:00
|
|
|
PEConcat::~PEConcat()
|
|
|
|
|
{
|
|
|
|
|
delete repeat_;
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-12 21:11:01 +01:00
|
|
|
void PEConcat::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
|
|
|
|
{
|
2010-10-26 04:36:44 +02:00
|
|
|
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
|
2010-01-12 21:11:01 +01:00
|
|
|
parms_[idx]->declare_implicit_nets(scope, type);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PEConcat::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
bool flag = false;
|
2010-10-26 04:36:44 +02:00
|
|
|
for (unsigned idx = 0 ; idx < parms_.size() ; idx += 1) {
|
2008-11-09 01:26:55 +01:00
|
|
|
flag = parms_[idx]->has_aa_term(des, scope) || flag;
|
|
|
|
|
}
|
|
|
|
|
if (repeat_)
|
|
|
|
|
flag = repeat_->has_aa_term(des, scope) || flag;
|
|
|
|
|
|
|
|
|
|
return flag;
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-12 06:23:57 +02:00
|
|
|
PEEvent::PEEvent(PEEvent::edge_t t, PExpr*e)
|
2000-04-01 21:31:57 +02:00
|
|
|
: type_(t), expr_(e)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEEvent::~PEEvent()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-12 06:23:57 +02:00
|
|
|
PEEvent::edge_t PEEvent::type() const
|
2000-04-01 21:31:57 +02:00
|
|
|
{
|
|
|
|
|
return type_;
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PEEvent::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
assert(expr_);
|
|
|
|
|
return expr_->has_aa_term(des, scope);
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-01 21:31:57 +02:00
|
|
|
PExpr* PEEvent::expr() const
|
|
|
|
|
{
|
|
|
|
|
return expr_;
|
|
|
|
|
}
|
|
|
|
|
|
2012-11-04 01:41:11 +01:00
|
|
|
PENull::PENull(void)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PENull::~PENull()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2000-12-10 23:01:35 +01:00
|
|
|
PEFNumber::PEFNumber(verireal*v)
|
|
|
|
|
: value_(v)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEFNumber::~PEFNumber()
|
|
|
|
|
{
|
|
|
|
|
delete value_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const verireal& PEFNumber::value() const
|
|
|
|
|
{
|
|
|
|
|
return *value_;
|
|
|
|
|
}
|
|
|
|
|
|
2007-05-24 06:07:11 +02:00
|
|
|
PEIdent::PEIdent(const pform_name_t&that)
|
2009-11-26 07:10:53 +01:00
|
|
|
: path_(that), no_implicit_sig_(false)
|
2000-04-01 21:31:57 +02:00
|
|
|
{
|
2000-04-12 06:23:57 +02:00
|
|
|
}
|
|
|
|
|
|
2009-11-26 07:10:53 +01:00
|
|
|
PEIdent::PEIdent(perm_string s, bool no_implicit_sig)
|
|
|
|
|
: no_implicit_sig_(no_implicit_sig)
|
2000-04-12 06:23:57 +02:00
|
|
|
{
|
2007-05-24 06:07:11 +02:00
|
|
|
path_.push_back(name_component_t(s));
|
2000-04-12 06:23:57 +02:00
|
|
|
}
|
|
|
|
|
|
2007-05-24 06:07:11 +02:00
|
|
|
PEIdent::~PEIdent()
|
2000-04-12 06:23:57 +02:00
|
|
|
{
|
2000-04-01 21:31:57 +02:00
|
|
|
}
|
|
|
|
|
|
2010-01-12 21:11:01 +01:00
|
|
|
void PEIdent::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
|
|
|
|
{
|
2009-11-26 07:10:53 +01:00
|
|
|
/* We create an implicit wire if:
|
|
|
|
|
- this is a simple identifier
|
|
|
|
|
- an identifier of that name has not already been declared in
|
|
|
|
|
any enclosing scope.
|
|
|
|
|
- this is not an implicit named port connection */
|
|
|
|
|
if (no_implicit_sig_)
|
|
|
|
|
return;
|
2010-01-12 21:11:01 +01:00
|
|
|
if ((path_.size() == 1) && (path_.front().index.size() == 0)) {
|
|
|
|
|
perm_string name = path_.front().name;
|
|
|
|
|
LexicalScope*ss = scope;
|
|
|
|
|
while (ss) {
|
|
|
|
|
if (ss->wires.find(name) != ss->wires.end())
|
|
|
|
|
return;
|
|
|
|
|
if (ss->localparams.find(name) != ss->localparams.end())
|
|
|
|
|
return;
|
|
|
|
|
if (ss->parameters.find(name) != ss->parameters.end())
|
|
|
|
|
return;
|
|
|
|
|
if (ss->genvars.find(name) != ss->genvars.end())
|
|
|
|
|
return;
|
|
|
|
|
if (ss->events.find(name) != ss->events.end())
|
|
|
|
|
return;
|
|
|
|
|
/* Strictly speaking, we should also check for name clashes
|
|
|
|
|
with tasks, functions, named blocks, module instances,
|
|
|
|
|
and generate blocks. However, this information is not
|
|
|
|
|
readily available. As these names would not be legal in
|
|
|
|
|
this context, we can declare implicit nets here and rely
|
|
|
|
|
on later checks for name clashes to report the error. */
|
|
|
|
|
|
|
|
|
|
ss = ss->parent_scope();
|
|
|
|
|
}
|
|
|
|
|
PWire*net = new PWire(name, type, NetNet::NOT_A_PORT, IVL_VT_LOGIC);
|
|
|
|
|
net->set_file(get_file());
|
|
|
|
|
net->set_lineno(get_lineno());
|
2012-02-05 01:19:27 +01:00
|
|
|
net->set_range_scalar(SR_NET);
|
2010-01-12 21:11:01 +01:00
|
|
|
scope->wires[name] = net;
|
|
|
|
|
if (warn_implicit) {
|
|
|
|
|
cerr << get_fileline() << ": warning: implicit "
|
|
|
|
|
"definition of wire '" << name << "'." << endl;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PEIdent::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
NetNet* net = 0;
|
|
|
|
|
const NetExpr*par = 0;
|
|
|
|
|
NetEvent* eve = 0;
|
|
|
|
|
|
|
|
|
|
const NetExpr*ex1, *ex2;
|
|
|
|
|
|
2012-08-26 04:28:02 +02:00
|
|
|
scope = symbol_search(this, des, scope, path_, net, par, eve, ex1, ex2);
|
2008-11-09 01:26:55 +01:00
|
|
|
|
|
|
|
|
if (scope)
|
|
|
|
|
return scope->is_auto();
|
|
|
|
|
else
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2012-07-14 03:41:41 +02:00
|
|
|
PENew::PENew(PExpr*size_expr)
|
|
|
|
|
: size_(size_expr)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PENew::~PENew()
|
|
|
|
|
{
|
|
|
|
|
delete size_;
|
|
|
|
|
}
|
|
|
|
|
|
2000-04-12 06:23:57 +02:00
|
|
|
PENumber::PENumber(verinum*vp)
|
|
|
|
|
: value_(vp)
|
|
|
|
|
{
|
|
|
|
|
assert(vp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PENumber::~PENumber()
|
|
|
|
|
{
|
|
|
|
|
delete value_;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const verinum& PENumber::value() const
|
|
|
|
|
{
|
|
|
|
|
return *value_;
|
|
|
|
|
}
|
|
|
|
|
|
1998-11-11 01:01:51 +01:00
|
|
|
bool PENumber::is_the_same(const PExpr*that) const
|
|
|
|
|
{
|
|
|
|
|
const PENumber*obj = dynamic_cast<const PENumber*>(that);
|
|
|
|
|
if (obj == 0)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return *value_ == *obj->value_;
|
|
|
|
|
}
|
|
|
|
|
|
2001-12-30 22:32:03 +01:00
|
|
|
PEString::PEString(char*s)
|
2000-04-12 06:23:57 +02:00
|
|
|
: text_(s)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEString::~PEString()
|
|
|
|
|
{
|
2001-12-30 22:32:03 +01:00
|
|
|
delete[]text_;
|
2000-04-12 06:23:57 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string PEString::value() const
|
|
|
|
|
{
|
|
|
|
|
return text_;
|
|
|
|
|
}
|
|
|
|
|
|
1999-07-17 21:50:59 +02:00
|
|
|
PETernary::PETernary(PExpr*e, PExpr*t, PExpr*f)
|
|
|
|
|
: expr_(e), tru_(t), fal_(f)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
1999-06-10 06:03:52 +02:00
|
|
|
PETernary::~PETernary()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2010-01-12 21:11:01 +01:00
|
|
|
void PETernary::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
|
|
|
|
{
|
|
|
|
|
assert(expr_ && tru_ && fal_);
|
|
|
|
|
expr_->declare_implicit_nets(scope, type);
|
|
|
|
|
tru_->declare_implicit_nets(scope, type);
|
|
|
|
|
fal_->declare_implicit_nets(scope, type);
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PETernary::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
assert(expr_ && tru_ && fal_);
|
|
|
|
|
return expr_->has_aa_term(des, scope)
|
|
|
|
|
|| tru_->has_aa_term(des, scope)
|
|
|
|
|
|| fal_->has_aa_term(des, scope);
|
|
|
|
|
}
|
|
|
|
|
|
2000-06-30 17:50:20 +02:00
|
|
|
PEUnary::PEUnary(char op, PExpr*ex)
|
|
|
|
|
: op_(op), expr_(ex)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEUnary::~PEUnary()
|
|
|
|
|
{
|
|
|
|
|
}
|
2008-11-09 01:26:55 +01:00
|
|
|
|
2010-01-12 21:11:01 +01:00
|
|
|
void PEUnary::declare_implicit_nets(LexicalScope*scope, NetNet::Type type)
|
|
|
|
|
{
|
|
|
|
|
assert(expr_);
|
|
|
|
|
expr_->declare_implicit_nets(scope, type);
|
|
|
|
|
}
|
|
|
|
|
|
2008-11-09 01:26:55 +01:00
|
|
|
bool PEUnary::has_aa_term(Design*des, NetScope*scope) const
|
|
|
|
|
{
|
|
|
|
|
assert(expr_);
|
|
|
|
|
return expr_->has_aa_term(des, scope);
|
|
|
|
|
}
|
2011-02-26 23:59:52 +01:00
|
|
|
|
|
|
|
|
PEVoid::PEVoid()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PEVoid::~PEVoid()
|
|
|
|
|
{
|
|
|
|
|
}
|