Remove NetVariable and ivl_variable_t structures.

This commit is contained in:
steve 2005-07-11 16:56:50 +00:00
parent 75ad90534b
commit b9799cf6ec
46 changed files with 325 additions and 970 deletions

View File

@ -16,7 +16,7 @@
# 59 Temple Place - Suite 330
# Boston, MA 02111-1307, USA
#
#ident "$Id: Makefile.in,v 1.170 2004/12/11 02:31:25 steve Exp $"
#ident "$Id: Makefile.in,v 1.171 2005/07/11 16:56:50 steve Exp $"
#
#
SHELL = /bin/sh
@ -114,11 +114,11 @@ eval_tree.o expr_synth.o functor.o lexor.o lexor_keyword.o link_const.o \
load_module.o netlist.o netmisc.o net_assign.o \
net_design.o net_event.o net_expr.o net_force.o net_func.o \
net_link.o net_modulo.o net_nex_input.o net_nex_output.o \
net_proc.o net_scope.o net_udp.o net_variable.o pad_to_width.o \
net_proc.o net_scope.o net_udp.o pad_to_width.o \
parse.o parse_misc.o pform.o pform_dump.o \
set_width.o symbol_search.o sync.o sys_funcs.o \
verinum.o verireal.o target.o targets.o \
Attrib.o HName.o LineInfo.o Module.o PData.o PDelays.o PEvent.o \
Attrib.o HName.o LineInfo.o Module.o PDelays.o PEvent.o \
PExpr.o PGate.o \
PTask.o PUdp.o PFunction.o PWire.o Statement.o StringHeap.o \
$(FF) $(TT)

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: Module.h,v 1.37 2004/06/13 04:56:53 steve Exp $"
#ident "$Id: Module.h,v 1.38 2005/07/11 16:56:50 steve Exp $"
#endif
# include <list>
@ -30,7 +30,6 @@
# include "named.h"
# include "LineInfo.h"
# include "netlist.h"
class PData;
class PEvent;
class PExpr;
class PEIdent;
@ -108,9 +107,6 @@ class Module : public LineInfo {
/* Keep a table of named events declared in the module. */
map<perm_string,PEvent*>events;
/* Keep a table of datum variables declared in the module. */
map<hname_t,PData*>datum;
map<perm_string,PExpr*> attributes;
/* These are the timescale for this module. The default is
@ -167,6 +163,9 @@ class Module : public LineInfo {
/*
* $Log: Module.h,v $
* Revision 1.38 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.37 2004/06/13 04:56:53 steve
* Add support for the default_nettype directive.
*

View File

@ -1,50 +0,0 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
*
* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PData.cc,v 1.2 2003/11/10 20:11:01 steve Exp $"
#endif
# include "config.h"
# include "PData.h"
PData::PData(const hname_t&h)
: hname_(h)
{
}
PData::~PData()
{
}
const hname_t&PData::name() const
{
return hname_;
}
/*
* $Log: PData.cc,v $
* Revision 1.2 2003/11/10 20:11:01 steve
* missing include of config.h
*
* Revision 1.1 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
*
*/

63
PData.h
View File

@ -1,63 +0,0 @@
#ifndef __PData_H
#define __PData_H
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
*
* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: PData.h,v 1.1 2003/01/26 21:15:58 steve Exp $"
#endif
# include "HName.h"
# include "netlist.h"
# include "LineInfo.h"
/*
* The PData object represents declaration of atomic datum such as
* real and realtime variables. These are variables that cannot be bit
* or part selected, but can be used in expressions.
*/
class PData : public LineInfo {
public:
PData(const hname_t&hname);
~PData();
// Return a hierarchical name.
const hname_t&name() const;
void elaborate_scope(Design*des, NetScope*scope) const;
map<string,PExpr*> attributes;
private:
hname_t hname_;
private:
PData(const PData&);
PData& operator= (const PData&);
};
/*
* $Log: PData.h,v $
* Revision 1.1 2003/01/26 21:15:58 steve
* Rework expression parsing and elaboration to
* accommodate real/realtime values and expressions.
*
*/
#endif

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: compiler.h,v 1.29 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: compiler.h,v 1.30 2005/07/11 16:56:50 steve Exp $"
#endif
# include <list>
@ -133,7 +133,7 @@ extern StringHeapLex lex_strings;
*/
struct sfunc_return_type {
const char* name;
NetExpr::TYPE type;
ivl_variable_type_t type;
unsigned wid;
int signed_flag;
};
@ -143,6 +143,9 @@ extern int load_sys_func_table(const char*path);
/*
* $Log: compiler.h,v $
* Revision 1.30 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.29 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: design_dump.cc,v 1.161 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: design_dump.cc,v 1.162 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -547,8 +547,6 @@ void NetAssign_::dump_lval(ostream&o) const
if (bmux_) o << *bmux_;
else o << "**oops**";
o << "]";
} else if (var_) {
o << "<real " << var_->basename() << ">";
} else {
o << "";
}
@ -751,10 +749,6 @@ void NetFuncDef::dump(ostream&o, unsigned ind) const
if (result_sig_)
o << setw(ind+2) << "" << "Return signal: "
<< result_sig_->name() << endl;
if (result_var_)
o << setw(ind+2) << "" << "Return variable: "
<< result_var_->basename() << endl;
if (statement_)
statement_->dump(o, ind+2);
else
@ -857,11 +851,6 @@ void NetScope::dump(ostream&o) const
}
}
for (NetVariable*cur = vars_ ; cur ; cur = cur->snext_) {
o << " real " << cur->basename() << " // "
<< cur->get_line() << endl;
}
/* Dump the events in this scope. */
for (NetEvent*cur = events_ ; cur ; cur = cur->snext_) {
o << " event " << cur->name() << "; nprobe="
@ -1147,11 +1136,6 @@ void NetEUnary::dump(ostream&o) const
o << ")";
}
void NetEVariable::dump(ostream&o) const
{
o << var_->basename();
}
void Design::dump(ostream&o) const
{
o << "DESIGN TIME PRECISION: 10e" << get_precision() << endl;
@ -1181,6 +1165,9 @@ void Design::dump(ostream&o) const
/*
* $Log: design_dump.cc,v $
* Revision 1.162 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.161 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: dup_expr.cc,v 1.19 2004/12/11 02:31:25 steve Exp $"
#ident "$Id: dup_expr.cc,v 1.20 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -111,11 +111,7 @@ NetEUFunc* NetEUFunc::dup_expr() const
tmp_parms[idx] = parms_[idx]->dup_expr();
}
tmp = 0;
if (result_sig_)
tmp = new NetEUFunc(func_, result_sig_->dup_expr(), tmp_parms);
if (result_var_)
tmp = new NetEUFunc(func_, result_var_->dup_expr(), tmp_parms);
assert(tmp);
return tmp;
@ -135,14 +131,11 @@ NetEUReduce* NetEUReduce::dup_expr() const
return tmp;
}
NetEVariable* NetEVariable::dup_expr() const
{
NetEVariable*tmp = new NetEVariable(var_);
return tmp;
}
/*
* $Log: dup_expr.cc,v $
* Revision 1.20 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.19 2004/12/11 02:31:25 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_anet.cc,v 1.10 2004/10/04 01:10:52 steve Exp $"
#ident "$Id: elab_anet.cc,v 1.11 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -109,11 +109,10 @@ NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const
NetNet* sig = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
symbol_search(des, scope, path_, sig, mem, var, par, eve);
symbol_search(des, scope, path_, sig, mem, par, eve);
if (mem != 0) {
@ -167,6 +166,9 @@ NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const
/*
* $Log: elab_anet.cc,v $
* Revision 1.11 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.10 2004/10/04 01:10:52 steve
* Clean up spurious trailing white space.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_expr.cc,v 1.93 2005/01/24 05:28:30 steve Exp $"
#ident "$Id: elab_expr.cc,v 1.94 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -264,7 +264,7 @@ NetExpr* PECallFunction::elaborate_sfunc_(Design*des, NetScope*scope) const
const struct sfunc_return_type*sfunc_info
= lookup_sys_func(path_.peek_name(0));
NetExpr::TYPE sfunc_type = sfunc_info->type;
ivl_variable_type_t sfunc_type = sfunc_info->type;
unsigned wid = sfunc_info->wid;
@ -390,13 +390,6 @@ NetExpr* PECallFunction::elaborate_expr(Design*des, NetScope*scope, bool) const
return func;
}
if (NetVariable*res = dscope->find_variable(dscope->basename())) {
NetEVariable*eres = new NetEVariable(res);
eres->set_line(*res);
NetEUFunc*func = new NetEUFunc(dscope, eres, parms);
return func;
}
cerr << get_line() << ": internal error: Unable to locate "
"function return value for " << path_
<< " in " << def->name() << "." << endl;
@ -490,12 +483,11 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
NetNet* net = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
NetScope*found_in = symbol_search(des, scope, path_,
net, mem, var, par, eve);
net, mem, par, eve);
// If the identifier name is a parameter name, then return
// a reference to the parameter expression.
@ -834,14 +826,6 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
return node;
}
// If the identifier names a variable of some sort, then this
// is a variable reference.
if (var != 0) {
NetEVariable*node = new NetEVariable(var);
node->set_line(*this);
return node;
}
// If the identifier is a named event.
// is a variable reference.
if (eve != 0) {
@ -1035,6 +1019,9 @@ NetExpr* PEUnary::elaborate_expr(Design*des, NetScope*scope, bool) const
/*
* $Log: elab_expr.cc,v $
* Revision 1.94 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.93 2005/01/24 05:28:30 steve
* Remove the NetEBitSel and combine all bit/part select
* behavior into the NetESelect node and IVL_EX_SELECT

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_lval.cc,v 1.31 2004/12/29 23:55:43 steve Exp $"
#ident "$Id: elab_lval.cc,v 1.32 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -150,11 +150,10 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
{
NetNet* reg = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
symbol_search(des, scope, path_, reg, mem, var, par, eve);
symbol_search(des, scope, path_, reg, mem, par, eve);
if (mem) {
if (is_force) {
@ -169,11 +168,6 @@ NetAssign_* PEIdent::elaborate_lval(Design*des,
return elaborate_mem_lval_(des, scope, mem);
}
if (var) {
NetAssign_*cur = new NetAssign_(var);
return cur;
}
if (reg == 0) {
cerr << get_line() << ": error: Could not find variable ``"
<< path_ << "'' in ``" << scope->name() <<
@ -366,6 +360,9 @@ NetAssign_* PENumber::elaborate_lval(Design*des, NetScope*, bool) const
/*
* $Log: elab_lval.cc,v $
* Revision 1.32 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.31 2004/12/29 23:55:43 steve
* Unify elaboration of l-values for all proceedural assignments,
* including assing, cassign and force.

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_net.cc,v 1.166 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: elab_net.cc,v 1.167 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -1511,11 +1511,10 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
NetNet* sig = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
symbol_search(des, scope, path_, sig, mem, var, par, eve);
symbol_search(des, scope, path_, sig, mem, par, eve);
/* If the identifier is a memory instead of a signal,
then handle it elsewhere. Create a RAM. */
@ -1552,13 +1551,6 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
connect(sig->pin(idx), cp->pin(idx));
}
if (var != 0) {
cerr << get_line() << ": sorry: " << path_
<< " is a real in a net/wire context." << endl;
des->errors += 1;
return 0;
}
/* Check for the error case that the name is not found, and it
is hierarchical. We can't just create a name in another
scope, it's just not allowed. */
@ -1585,6 +1577,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
NetNet::Type nettype = scope->default_nettype();
sig = new NetNet(scope, lex_strings.make(path_.peek_name(0)),
nettype, 1);
sig->data_type(IVL_VT_LOGIC);
if (error_implicit || (nettype == NetNet::NONE)) {
cerr << get_line() << ": error: "
@ -1906,11 +1899,10 @@ NetNet* PEIdent::elaborate_lnet(Design*des, NetScope*scope,
NetNet* sig = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
symbol_search(des, scope, path_, sig, mem, var, par, eve);
symbol_search(des, scope, path_, sig, mem, par, eve);
if (mem != 0) {
cerr << get_line() << ": error: memories (" << path_
@ -1935,6 +1927,8 @@ NetNet* PEIdent::elaborate_lnet(Design*des, NetScope*scope,
sig = new NetNet(scope, lex_strings.make(path_.peek_name(0)),
NetNet::IMPLICIT, 1);
/* Implicit nets are always scalar logic. */
sig->data_type(IVL_VT_LOGIC);
if (warn_implicit) {
cerr << get_line() << ": warning: implicit "
@ -2564,6 +2558,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
/*
* $Log: elab_net.cc,v $
* Revision 1.167 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.166 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_scope.cc,v 1.35 2004/09/10 00:15:17 steve Exp $"
#ident "$Id: elab_scope.cc,v 1.36 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -33,7 +33,6 @@
*/
# include "Module.h"
# include "PData.h"
# include "PEvent.h"
# include "PExpr.h"
# include "PGate.h"
@ -255,12 +254,6 @@ bool Module::elaborate_scope(Design*des, NetScope*scope) const
(*et).second->elaborate_scope(des, scope);
}
for (map<hname_t,PData*>::const_iterator cur = datum.begin()
; cur != datum.end() ; cur ++ ) {
(*cur).second->elaborate_scope(des, scope);
}
return des->errors == 0;
}
@ -448,34 +441,6 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
sc->instance_arrays[get_name()] = instances;
}
/*
* Elaborate the datum within the module. This variable may be
* within a subscope (i.e., a function or task) so use the components
* of the name to find the precise scope where this item goes.
*/
void PData::elaborate_scope(Design*des, NetScope*scope) const
{
NetScope*sub_scope = scope;
for (unsigned idx = 0 ; idx < (hname_.component_count()-1); idx += 1) {
sub_scope = sub_scope->child(hname_.peek_name(idx));
if (sub_scope == 0) {
cerr << get_line() << ": internal error: "
<< "Could not find sub-scope "
<< hname_.peek_name(idx) << " of "
<< hname_ << " in module " << scope->name()
<< endl;
des->errors += 1;
return;
}
}
const char*basename = hname_.peek_tail_name();
NetVariable*tmp = new NetVariable(lex_strings.make(basename));
tmp->set_line(*this);
sub_scope->add_variable(tmp);
}
/*
* The isn't really able to create new scopes, but it does create the
* event name in the current scope, so can be done during the
@ -635,6 +600,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
/*
* $Log: elab_scope.cc,v $
* Revision 1.36 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.35 2004/09/10 00:15:17 steve
* Missing stdio.h header for warnings.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elab_sig.cc,v 1.39 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: elab_sig.cc,v 1.40 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -261,7 +261,6 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
}
NetNet*ret_sig = 0;
NetVariable*ret_real = 0;
/* Create the signals/variables of the return value and write
them into the function scope. */
@ -302,6 +301,7 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
}
ret_sig->set_line(*this);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_LOGIC);
break;
case PTF_INTEGER:
@ -310,6 +310,7 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
ret_sig->set_signed(true);
ret_sig->set_isint(true);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_LOGIC);
break;
case PTF_TIME:
@ -318,13 +319,17 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
ret_sig->set_signed(false);
ret_sig->set_isint(false);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_LOGIC);
break;
case PTF_REAL:
case PTF_REALTIME:
ret_real = new NetVariable(fname);
ret_real->set_line(*this);
scope->add_variable(ret_real);
ret_sig = new NetNet(scope, fname, NetNet::REG, 1);
ret_sig->set_line(*this);
ret_sig->set_signed(true);
ret_sig->set_isint(false);
ret_sig->port_type(NetNet::POUTPUT);
ret_sig->data_type(IVL_VT_REAL);
break;
default:
@ -370,7 +375,6 @@ void PFunction::elaborate_sig(Design*des, NetScope*scope) const
NetFuncDef*def = 0;
if (ret_sig) def = new NetFuncDef(scope, ret_sig, ports);
if (ret_real) def = new NetFuncDef(scope, ret_real, ports);
assert(def);
scope->set_func_def(def);
@ -667,6 +671,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
/*
* $Log: elab_sig.cc,v $
* Revision 1.40 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.39 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: elaborate.cc,v 1.325 2005/06/17 05:06:47 steve Exp $"
#ident "$Id: elaborate.cc,v 1.326 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -1384,16 +1384,14 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
/* Based on the specific type of the l-value, do cleanup
processing on the r-value. */
if (lv->var()) {
} else if (rv->expr_type() == NetExpr::ET_REAL) {
if (rv->expr_type() == IVL_VT_REAL) {
// The r-value is a real. Casting will happen in the
// code generator, so leave it.
} else {
unsigned wid = count_lval_width(lv);
bool flag = rv->set_width(wid);
rv->set_width(wid);
rv = pad_to_width(rv, wid);
assert(rv->expr_width() >= wid);
}
@ -1431,7 +1429,7 @@ NetProc* PAssignNB::elaborate(Design*des, NetScope*scope) const
If in this case the l-val is a variable (i.e. real) then
the width to pad to will be 0, so this code is harmless. */
if (rv->expr_type() == NetExpr::ET_VECTOR) {
if (rv->expr_type() == IVL_VT_LOGIC) {
unsigned wid = count_lval_width(lv);
rv->set_width(wid);
rv = pad_to_width(rv, wid);
@ -2142,12 +2140,11 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
if (PEIdent*id = dynamic_cast<PEIdent*>(expr_[idx]->expr())) {
NetNet* sig = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
NetScope*found_in = symbol_search(des, scope, id->path(),
sig, mem, var, par, eve);
sig, mem, par, eve);
if (found_in && eve) {
wa->add_event(eve);
@ -2709,12 +2706,11 @@ NetProc* PTrigger::elaborate(Design*des, NetScope*scope) const
NetNet* sig = 0;
NetMemory* mem = 0;
NetVariable* var = 0;
const NetExpr*par = 0;
NetEvent* eve = 0;
NetScope*found_in = symbol_search(des, scope, event_,
sig, mem, var, par, eve);
sig, mem, par, eve);
if (found_in == 0) {
cerr << get_line() << ": error: event <" << event_ << ">"
@ -2976,6 +2972,9 @@ Design* elaborate(list<perm_string>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.326 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.325 2005/06/17 05:06:47 steve
* Debug messages.
*

13
emit.cc
View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: emit.cc,v 1.85 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: emit.cc,v 1.86 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -331,9 +331,6 @@ void NetScope::emit_scope(struct target_t*tgt) const
for (NetEvent*cur = events_ ; cur ; cur = cur->snext_)
tgt->event(cur);
for (NetVariable*cur = vars_ ; cur ; cur = cur->snext_)
tgt->variable(cur);
for (NetScope*cur = sub_ ; cur ; cur = cur->sib_)
cur->emit_scope(tgt);
@ -511,11 +508,6 @@ void NetEUnary::expr_scan(struct expr_scan_t*tgt) const
tgt->expr_unary(this);
}
void NetEVariable::expr_scan(struct expr_scan_t*tgt) const
{
tgt->expr_variable(this);
}
int emit(const Design*des, const char*type)
{
for (unsigned idx = 0 ; target_table[idx] ; idx += 1) {
@ -533,6 +525,9 @@ int emit(const Design*des, const char*type)
/*
* $Log: emit.cc,v $
* Revision 1.86 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.85 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_tree.cc,v 1.63 2005/06/17 05:05:53 steve Exp $"
#ident "$Id: eval_tree.cc,v 1.64 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -273,7 +273,7 @@ NetEConst* NetEBComp::eval_leeq_real_()
double lv, rv;
switch (left_->expr_type()) {
case ET_REAL:
case IVL_VT_REAL:
rtmp = dynamic_cast<NetECReal*> (left_);
if (rtmp == 0)
return 0;
@ -281,7 +281,7 @@ NetEConst* NetEBComp::eval_leeq_real_()
lv = rtmp->value().as_double();
break;
case ET_VECTOR:
case IVL_VT_LOGIC:
vtmp = dynamic_cast<NetEConst*> (left_);
if (vtmp == 0)
return 0;
@ -295,7 +295,7 @@ NetEConst* NetEBComp::eval_leeq_real_()
switch (right_->expr_type()) {
case ET_REAL:
case IVL_VT_REAL:
rtmp = dynamic_cast<NetECReal*> (right_);
if (rtmp == 0)
return 0;
@ -303,7 +303,7 @@ NetEConst* NetEBComp::eval_leeq_real_()
rv = rtmp->value().as_double();
break;
case ET_VECTOR:
case IVL_VT_LOGIC:
vtmp = dynamic_cast<NetEConst*> (right_);
if (vtmp == 0)
return 0;
@ -324,9 +324,9 @@ NetEConst* NetEBComp::eval_leeq_real_()
NetEConst* NetEBComp::eval_leeq_()
{
if (right_->expr_type() == ET_REAL)
if (right_->expr_type() == IVL_VT_REAL)
return eval_leeq_real_();
if (left_->expr_type() == ET_REAL)
if (left_->expr_type() == IVL_VT_REAL)
return eval_leeq_real_();
NetEConst*r = dynamic_cast<NetEConst*>(right_);
@ -381,8 +381,8 @@ NetEConst* NetEBComp::eval_leeq_()
NetEConst* NetEBComp::eval_gt_()
{
if ((left_->expr_type() == NetExpr::ET_REAL)
&& (right_->expr_type() == NetExpr::ET_REAL)) {
if ((left_->expr_type() == IVL_VT_REAL)
&& (right_->expr_type() == IVL_VT_REAL)) {
NetECReal*tmpl = dynamic_cast<NetECReal*>(left_);
if (tmpl == 0)
@ -420,7 +420,7 @@ NetEConst* NetEBComp::eval_gt_()
}
/* Compare with a real value. Do it as double precision. */
if (right_->expr_type() == NetExpr::ET_REAL) {
if (right_->expr_type() == IVL_VT_REAL) {
NetECReal*tmp = dynamic_cast<NetECReal*>(right_);
if (tmp == 0)
return 0;
@ -457,8 +457,8 @@ NetEConst* NetEBComp::eval_gt_()
NetEConst* NetEBComp::eval_gteq_()
{
if ((left_->expr_type() == NetExpr::ET_REAL)
&& (right_->expr_type() == NetExpr::ET_REAL)) {
if ((left_->expr_type() == IVL_VT_REAL)
&& (right_->expr_type() == IVL_VT_REAL)) {
NetECReal*tmpl = dynamic_cast<NetECReal*>(left_);
if (tmpl == 0)
@ -486,7 +486,7 @@ NetEConst* NetEBComp::eval_gteq_()
/* Detect the case where the left side is greater than the
largest value the right side can possibly have. */
if (right_->expr_type() == NetExpr::ET_VECTOR) {
if (right_->expr_type() == IVL_VT_LOGIC) {
assert(right_->expr_width() > 0);
verinum rv (verinum::V1, right_->expr_width());
if (lv >= rv) {
@ -496,7 +496,7 @@ NetEConst* NetEBComp::eval_gteq_()
}
/* Compare with a real value. Do it as double precision. */
if (right_->expr_type() == NetExpr::ET_REAL) {
if (right_->expr_type() == IVL_VT_REAL) {
NetECReal*tmp = dynamic_cast<NetECReal*>(right_);
if (tmp == 0)
return 0;
@ -706,7 +706,7 @@ NetExpr* NetEBDiv::eval_tree()
{
eval_sub_tree_();
if (expr_type() == NetExpr::ET_REAL) {
if (expr_type() == IVL_VT_REAL) {
NetECReal*lc = dynamic_cast<NetECReal*>(left_);
if (lc == 0) return 0;
@ -751,7 +751,7 @@ NetExpr* NetEBDiv::eval_tree()
} else {
assert(expr_type() == NetExpr::ET_VECTOR);
assert(expr_type() == IVL_VT_LOGIC);
NetEConst*lc = dynamic_cast<NetEConst*>(left_);
if (lc == 0) return 0;
NetEConst*rc = dynamic_cast<NetEConst*>(right_);
@ -844,14 +844,14 @@ NetExpr* NetEBMult::eval_tree_real_()
verireal rval;
switch (left_->expr_type()) {
case ET_REAL: {
case IVL_VT_REAL: {
NetECReal*lc = dynamic_cast<NetECReal*> (left_);
if (lc == 0) return 0;
lval = lc->value();
break;
}
case ET_VECTOR: {
case IVL_VT_LOGIC: {
NetEConst*lc = dynamic_cast<NetEConst*>(left_);
if (lc == 0) return 0;
verinum tmp = lc->value();
@ -864,14 +864,14 @@ NetExpr* NetEBMult::eval_tree_real_()
}
switch (right_->expr_type()) {
case ET_REAL: {
case IVL_VT_REAL: {
NetECReal*rc = dynamic_cast<NetECReal*> (right_);
if (rc == 0) return 0;
rval = rc->value();
break;
}
case ET_VECTOR: {
case IVL_VT_LOGIC: {
NetEConst*rc = dynamic_cast<NetEConst*>(right_);
if (rc == 0) return 0;
verinum tmp = rc->value();
@ -893,10 +893,10 @@ NetExpr* NetEBMult::eval_tree()
{
eval_sub_tree_();
if (expr_type() == ET_REAL)
if (expr_type() == IVL_VT_REAL)
return eval_tree_real_();
assert(expr_type() == ET_VECTOR);
assert(expr_type() == IVL_VT_LOGIC);
NetEConst*lc = dynamic_cast<NetEConst*>(left_);
if (lc == 0) return 0;
@ -1182,7 +1182,7 @@ NetExpr* NetEParam::eval_tree()
switch (res->expr_type()) {
case NetExpr::ET_VECTOR:
case IVL_VT_LOGIC:
{ NetEConst*tmp = dynamic_cast<NetEConst*>(res);
if (tmp == 0) {
cerr << get_line() << ": internal error: parameter "
@ -1199,7 +1199,7 @@ NetExpr* NetEParam::eval_tree()
return ptmp;
}
case NetExpr::ET_REAL:
case IVL_VT_REAL:
{ NetECReal*tmp = dynamic_cast<NetECReal*>(res);
if (tmp == 0) {
cerr << get_line() << ": internal error: parameter "
@ -1558,6 +1558,9 @@ NetEConst* NetEUReduce::eval_tree()
/*
* $Log: eval_tree.cc,v $
* Revision 1.64 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.63 2005/06/17 05:05:53 steve
* Watch out for signed constants in magnitude compare.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: ivl_target.h,v 1.157 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: ivl_target.h,v 1.158 2005/07/11 16:56:50 steve Exp $"
#endif
#ifdef __cplusplus
@ -152,7 +152,6 @@ typedef struct ivl_scope_s *ivl_scope_t;
typedef struct ivl_signal_s *ivl_signal_t;
typedef struct ivl_memory_s *ivl_memory_t;
typedef struct ivl_statement_s*ivl_statement_t;
typedef struct ivl_variable_s *ivl_variable_t;
/*
* These are types that are defined as enumerations. These have
@ -191,7 +190,6 @@ typedef enum ivl_expr_type_e {
IVL_EX_UFUNC = 12,
IVL_EX_ULONG = 13,
IVL_EX_UNARY = 14,
IVL_EX_VARIABLE = 15,
IVL_EX_REALNUM = 16
} ivl_expr_type_t;
@ -594,8 +592,6 @@ extern int ivl_expr_signed(ivl_expr_t net);
extern const char* ivl_expr_string(ivl_expr_t net);
/* IVL_EX_ULONG */
extern unsigned long ivl_expr_uvalue(ivl_expr_t net);
/* IVL_EX_VARIABLE */
extern ivl_variable_t ivl_expr_variable(ivl_expr_t net);
/* any expression */
extern unsigned ivl_expr_width(ivl_expr_t net);
@ -1063,12 +1059,6 @@ extern ivl_memory_t ivl_lpm_memory(ivl_lpm_t net);
* If the l-value is a variable, this method returns the signal
* object that is the target of the assign.
*
* ivl_lval_var
* If the l-value is a non-signal variable (i.e. a real) this
* method returns the ivl_variable_t object that represents it.
* If the lval is this sort of variable, then the part_off, idx and
* pin methods do not apply.
*
* ivl_lval_part_off
* The part select of the signal is based here. This is the
* canonical index of bit-0 of the part select.
@ -1102,13 +1092,9 @@ extern unsigned ivl_lval_width(ivl_lval_t net);
extern ivl_expr_t ivl_lval_mux(ivl_lval_t net);
extern ivl_expr_t ivl_lval_idx(ivl_lval_t net);
extern ivl_memory_t ivl_lval_mem(ivl_lval_t net);
extern ivl_variable_t ivl_lval_var(ivl_lval_t net);
extern unsigned ivl_lval_part_off(ivl_lval_t net);
extern ivl_signal_t ivl_lval_sig(ivl_lval_t net);
#if 0
extern unsigned ivl_lval_pins(ivl_lval_t net);
extern ivl_nexus_t ivl_lval_pin(ivl_lval_t net, unsigned idx);
#endif
/* NEXUS
* connections of signals and nodes is handled by single-bit
@ -1282,7 +1268,7 @@ extern ivl_expr_t ivl_parameter_expr(ivl_parameter_t net);
*
* ivl_scope_var
* ivl_scope_vars
* Scopes have 0 or more variable objects in them.
* REMOVED
*
* ivl_scope_log
* ivl_scope_logs
@ -1354,8 +1340,6 @@ extern unsigned ivl_scope_lpms(ivl_scope_t net);
extern ivl_lpm_t ivl_scope_lpm(ivl_scope_t, unsigned idx);
extern unsigned ivl_scope_mems(ivl_scope_t net);
extern ivl_memory_t ivl_scope_mem(ivl_scope_t net, unsigned idx);
extern unsigned ivl_scope_vars(ivl_scope_t net);
extern ivl_variable_t ivl_scope_var(ivl_scope_t net, unsigned idx);
extern const char* ivl_scope_name(ivl_scope_t net);
extern const char* ivl_scope_basename(ivl_scope_t net);
extern unsigned ivl_scope_params(ivl_scope_t net);
@ -1646,19 +1630,6 @@ extern ivl_expr_t ivl_stmt_rval(ivl_statement_t net);
IVL_ST_WAIT, IVL_ST_WHILE */
extern ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net);
/*
* These functions manipulate variable objects.
*
* ivl_variable_name
* Return the base name of the variable.
*
* ivl_variable_type
* Return the type of the variable. The ivl_variable_type_t is an
* enumeration that is defined earlier.
*/
extern const char* ivl_variable_name(ivl_variable_t net);
extern ivl_variable_type_t ivl_variable_type(ivl_variable_t net);
#if defined(__MINGW32__) || defined (__CYGWIN32__)
# define DLLEXPORT __declspec(dllexport)
@ -1691,6 +1662,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
* Revision 1.158 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.157 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_assign.cc,v 1.19 2004/12/11 02:31:26 steve Exp $"
#ident "$Id: net_assign.cc,v 1.20 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -39,7 +39,7 @@ unsigned count_lval_width(const NetAssign_*idx)
}
NetAssign_::NetAssign_(NetNet*s)
: sig_(s), mem_(0), var_(0), bmux_(0)
: sig_(s), mem_(0), bmux_(0)
{
loff_ = 0;
lwid_ = sig_->vector_width();
@ -48,21 +48,13 @@ NetAssign_::NetAssign_(NetNet*s)
}
NetAssign_::NetAssign_(NetMemory*s)
: sig_(0), mem_(s), var_(0), bmux_(0)
: sig_(0), mem_(s), bmux_(0)
{
loff_ = 0;
lwid_ = mem_->width();
more = 0;
}
NetAssign_::NetAssign_(NetVariable*s)
: sig_(0), mem_(0), var_(s), bmux_(0)
{
loff_ = 0;
lwid_ = 0;
more = 0;
}
NetAssign_::~NetAssign_()
{
if (sig_) {
@ -119,12 +111,6 @@ NetMemory* NetAssign_::mem() const
return mem_;
}
NetVariable* NetAssign_::var() const
{
return var_;
}
void NetAssign_::set_part(unsigned lo, unsigned lw)
{
loff_ = lo;
@ -297,6 +283,9 @@ NetRelease::~NetRelease()
/*
* $Log: net_assign.cc,v $
* Revision 1.20 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.19 2004/12/11 02:31:26 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_design.cc,v 1.45 2004/10/04 01:10:54 steve Exp $"
#ident "$Id: net_design.cc,v 1.46 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -390,7 +390,7 @@ void NetScope::evaluate_parameters(Design*des)
assert(expr);
switch (expr->expr_type()) {
case NetExpr::ET_REAL:
case IVL_VT_REAL:
if (! dynamic_cast<const NetECReal*>(expr)) {
cerr << (*cur).second.expr->get_line()
<< ": internal error: "
@ -401,7 +401,7 @@ void NetScope::evaluate_parameters(Design*des)
}
break;
case NetExpr::ET_VECTOR:
case IVL_VT_LOGIC:
if (! dynamic_cast<const NetEConst*>(expr)) {
// Try to evaluate the expression.
@ -618,6 +618,9 @@ void Design::delete_process(NetProcTop*top)
/*
* $Log: net_design.cc,v $
* Revision 1.46 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.45 2004/10/04 01:10:54 steve
* Clean up spurious trailing white space.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_expr.cc,v 1.23 2004/10/04 01:10:54 steve Exp $"
#ident "$Id: net_expr.cc,v 1.24 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -25,9 +25,12 @@
# include "compiler.h"
# include <iostream>
NetExpr::TYPE NetExpr::expr_type() const
/*
* the grand default data type is a logic vector.
*/
ivl_variable_type_t NetExpr::expr_type() const
{
return ET_VECTOR;
return IVL_VT_LOGIC;
}
/*
@ -96,15 +99,15 @@ NetEBAdd* NetEBAdd::dup_expr() const
return result;
}
NetExpr::TYPE NetEBAdd::expr_type() const
ivl_variable_type_t NetEBAdd::expr_type() const
{
if (left_->expr_type() == ET_REAL)
return ET_REAL;
if (left_->expr_type() == IVL_VT_REAL)
return IVL_VT_REAL;
if (right_->expr_type() == ET_REAL)
return ET_REAL;
if (right_->expr_type() == IVL_VT_REAL)
return IVL_VT_REAL;
return ET_VECTOR;
return IVL_VT_LOGIC;
}
/*
@ -183,15 +186,15 @@ NetEBDiv* NetEBDiv::dup_expr() const
return result;
}
NetExpr::TYPE NetEBDiv::expr_type() const
ivl_variable_type_t NetEBDiv::expr_type() const
{
if (left_->expr_type() == ET_REAL)
return ET_REAL;
if (left_->expr_type() == IVL_VT_REAL)
return IVL_VT_REAL;
if (right_->expr_type() == ET_REAL)
return ET_REAL;
if (right_->expr_type() == IVL_VT_REAL)
return IVL_VT_REAL;
return ET_VECTOR;
return IVL_VT_LOGIC;
}
NetEBMult::NetEBMult(char op, NetExpr*l, NetExpr*r)
@ -219,15 +222,15 @@ NetEBMult* NetEBMult::dup_expr() const
return result;
}
NetExpr::TYPE NetEBMult::expr_type() const
ivl_variable_type_t NetEBMult::expr_type() const
{
if (left_->expr_type() == ET_REAL)
return ET_REAL;
if (left_->expr_type() == IVL_VT_REAL)
return IVL_VT_REAL;
if (right_->expr_type() == ET_REAL)
return ET_REAL;
if (right_->expr_type() == IVL_VT_REAL)
return IVL_VT_REAL;
return ET_VECTOR;
return IVL_VT_LOGIC;
}
NetEBShift::NetEBShift(char op, NetExpr*l, NetExpr*r)
@ -372,9 +375,9 @@ NetECReal* NetECReal::dup_expr() const
return tmp;
}
NetExpr::TYPE NetECReal::expr_type() const
ivl_variable_type_t NetECReal::expr_type() const
{
return ET_REAL;
return IVL_VT_REAL;
}
NetECRealParam::NetECRealParam(NetScope*s, perm_string n, const verireal&v)
@ -458,7 +461,7 @@ bool NetESelect::set_width(unsigned w)
return false;
}
NetESFunc::NetESFunc(const char*n, NetExpr::TYPE t,
NetESFunc::NetESFunc(const char*n, ivl_variable_type_t t,
unsigned width, unsigned np)
: name_(0), type_(t)
{
@ -509,13 +512,16 @@ NetExpr* NetESFunc::parm(unsigned idx)
return parms_[idx];
}
NetExpr::TYPE NetESFunc::expr_type() const
ivl_variable_type_t NetESFunc::expr_type() const
{
return type_;
}
/*
* $Log: net_expr.cc,v $
* Revision 1.24 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.23 2004/10/04 01:10:54 steve
* Clean up spurious trailing white space.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_nex_input.cc,v 1.13 2005/01/24 05:28:30 steve Exp $"
#ident "$Id: net_nex_input.cc,v 1.14 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -168,11 +168,6 @@ NexusSet* NetEUnary::nex_input()
return expr_->nex_input();
}
NexusSet* NetEVariable::nex_input()
{
return new NexusSet;
}
NexusSet* NetAssign_::nex_input()
{
if (bmux_ == 0)
@ -389,6 +384,9 @@ NexusSet* NetWhile::nex_input()
/*
* $Log: net_nex_input.cc,v $
* Revision 1.14 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.13 2005/01/24 05:28:30 steve
* Remove the NetEBitSel and combine all bit/part select
* behavior into the NetESelect node and IVL_EX_SELECT

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_scope.cc,v 1.33 2004/10/04 01:10:54 steve Exp $"
#ident "$Id: net_scope.cc,v 1.34 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -41,7 +41,6 @@ NetScope::NetScope(NetScope*up, perm_string n, NetScope::TYPE t)
memories_ = 0;
signals_ = 0;
events_ = 0;
vars_ = 0;
lcounter_ = 0;
if (up) {
@ -283,15 +282,6 @@ NetEvent* NetScope::find_event(const char*name)
return 0;
}
NetVariable* NetScope::find_variable(const char*name)
{
for (NetVariable*cur = vars_; cur ; cur = cur->snext_)
if (strcmp(cur->basename(), name) == 0)
return cur;
return 0;
}
void NetScope::add_signal(NetNet*net)
{
if (signals_ == 0) {
@ -404,14 +394,6 @@ NetMemory* NetScope::find_memory(const string&key)
return 0;
}
void NetScope::add_variable(NetVariable*var)
{
assert(var->scope_ == 0);
var->scope_ = this;
var->snext_ = vars_;
vars_ = var;
}
/*
* This method locates a child scope by name. The name is the simple
* name of the child, no hierarchy is searched.
@ -467,6 +449,9 @@ string NetScope::local_hsymbol()
/*
* $Log: net_scope.cc,v $
* Revision 1.34 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.33 2004/10/04 01:10:54 steve
* Clean up spurious trailing white space.
*

View File

@ -1,82 +0,0 @@
/*
* Copyright (c) 2003 Stephen Williams (steve@icarus.com)
*
* 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
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: net_variable.cc,v 1.3 2004/02/19 07:06:57 steve Exp $"
#endif
# include "config.h"
# include "netlist.h"
NetVariable::NetVariable(perm_string name)
{
name_ = name;
scope_ = 0;
snext_ = 0;
}
NetVariable::~NetVariable()
{
}
perm_string NetVariable::basename() const
{
return name_;
}
NetScope* NetVariable::scope()
{
return scope_;
}
const NetScope* NetVariable::scope() const
{
return scope_;
}
NetEVariable::NetEVariable(NetVariable*v)
: var_(v)
{
}
NetEVariable::~NetEVariable()
{
}
NetExpr::TYPE NetEVariable::expr_type() const
{
return NetExpr::ET_REAL;
}
const NetVariable* NetEVariable::variable() const
{
return var_;
}
/*
* $Log: net_variable.cc,v $
* Revision 1.3 2004/02/19 07:06:57 steve
* LPM, logic and Variables have perm_string names.
*
* Revision 1.2 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.1 2003/01/28 16:23:27 steve
* Add missing net_variable.cc to CVS.
*
*/

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.cc,v 1.245 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: netlist.cc,v 1.246 2005/07/11 16:56:50 steve Exp $"
#endif
# include "config.h"
@ -1637,12 +1637,7 @@ unsigned NetConst::width() const
}
NetFuncDef::NetFuncDef(NetScope*s, NetNet*result, const svector<NetNet*>&po)
: scope_(s), statement_(0), result_sig_(result), result_var_(0), ports_(po)
{
}
NetFuncDef::NetFuncDef(NetScope*s, NetVariable*result, const svector<NetNet*>&po)
: scope_(s), statement_(0), result_sig_(0), result_var_(result), ports_(po)
: scope_(s), statement_(0), result_sig_(result), ports_(po)
{
}
@ -1688,11 +1683,6 @@ const NetNet* NetFuncDef::return_sig() const
return result_sig_;
}
const NetVariable* NetFuncDef::return_var() const
{
return result_var_;
}
NetSTask::NetSTask(const char*na, const svector<NetExpr*>&pa)
: name_(0), parms_(pa)
{
@ -1724,16 +1714,11 @@ const NetExpr* NetSTask::parm(unsigned idx) const
}
NetEUFunc::NetEUFunc(NetScope*def, NetESignal*res, svector<NetExpr*>&p)
: func_(def), result_sig_(res), result_var_(0), parms_(p)
: func_(def), result_sig_(res), parms_(p)
{
expr_width(result_sig_->expr_width());
}
NetEUFunc::NetEUFunc(NetScope*def, NetEVariable*res, svector<NetExpr*>&p)
: func_(def), result_sig_(0), result_var_(res), parms_(p)
{
}
NetEUFunc::~NetEUFunc()
{
for (unsigned idx = 0 ; idx < parms_.count() ; idx += 1)
@ -1750,11 +1735,6 @@ const NetESignal*NetEUFunc::result_sig() const
return result_sig_;
}
const NetEVariable*NetEUFunc::result_var() const
{
return result_var_;
}
unsigned NetEUFunc::parm_count() const
{
return parms_.count();
@ -1771,14 +1751,12 @@ const NetScope* NetEUFunc::func() const
return func_;
}
NetExpr::TYPE NetEUFunc::expr_type() const
ivl_variable_type_t NetEUFunc::expr_type() const
{
if (result_sig_)
return result_sig_->expr_type();
if (result_var_)
return result_var_->expr_type();
return ET_VOID;
return IVL_VT_VOID;
}
NetUTask::NetUTask(NetScope*def)
@ -2077,6 +2055,11 @@ unsigned NetESignal::msi() const
return net_->msb();
}
ivl_variable_type_t NetESignal::expr_type() const
{
return net_->data_type();
}
NetETernary::NetETernary(NetExpr*c, NetExpr*t, NetExpr*f)
: cond_(c), true_val_(t), false_val_(f)
{
@ -2233,6 +2216,9 @@ const NetProc*NetTaskDef::proc() const
/*
* $Log: netlist.cc,v $
* Revision 1.246 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.245 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

102
netlist.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netlist.h,v 1.345 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: netlist.h,v 1.346 2005/07/11 16:56:50 steve Exp $"
#endif
/*
@ -55,11 +55,9 @@ class NetProc;
class NetProcTop;
class NetRelease;
class NetScope;
class NetVariable;
class NetEvProbe;
class NetExpr;
class NetESignal;
class NetEVariable;
class NetFuncDef;
@ -1028,15 +1026,8 @@ class NetExpr : public LineInfo {
virtual void expr_scan(struct expr_scan_t*) const =0;
virtual void dump(ostream&) const;
// Expressions have type. The most common type is ET_VECTOR,
// which is a vector (possibly 1 bit) of 4-value bits. The
// ET_VOID is not generally used.
//
// ET_VOID - No value at all.
// ET_VECTOR - Vector of Verilog 4-value bits
// ET_REAL - real/realtime expression
enum TYPE { ET_VOID=0, ET_VECTOR, ET_REAL };
virtual TYPE expr_type() const;
// Expressions have type.
virtual ivl_variable_type_t expr_type() const;
// How wide am I?
unsigned expr_width() const { return width_; }
@ -1161,7 +1152,7 @@ class NetECReal : public NetExpr {
virtual bool has_width() const;
// The type of this expression is ET_REAL
TYPE expr_type() const;
ivl_variable_type_t expr_type() const;
virtual void expr_scan(struct expr_scan_t*) const;
virtual void dump(ostream&) const;
@ -1621,7 +1612,6 @@ class NetAssign_ {
public:
NetAssign_(NetNet*sig);
NetAssign_(NetMemory*mem);
NetAssign_(NetVariable*var);
~NetAssign_();
// If this expression exists, then only a single bit is to be
@ -1645,7 +1635,6 @@ class NetAssign_ {
NetNet* sig() const;
NetMemory*mem() const;
NetVariable*var() const;
// Mark that the synthesizer has worked with this l-value, so
// when it is released, the l-value signal should be turned
@ -1666,7 +1655,6 @@ class NetAssign_ {
private:
NetNet *sig_;
NetMemory*mem_;
NetVariable*var_;
NetExpr*bmux_;
bool turn_sig_to_wire_on_release_;
@ -2207,7 +2195,6 @@ class NetFuncDef {
public:
NetFuncDef(NetScope*, NetNet*result, const svector<NetNet*>&po);
NetFuncDef(NetScope*, NetVariable*result, const svector<NetNet*>&po);
~NetFuncDef();
void set_proc(NetProc*st);
@ -2220,7 +2207,6 @@ class NetFuncDef {
const NetNet*port(unsigned idx) const;
const NetNet*return_sig() const;
const NetVariable*return_var() const;
void dump(ostream&, unsigned ind) const;
@ -2228,7 +2214,6 @@ class NetFuncDef {
NetScope*scope_;
NetProc*statement_;
NetNet*result_sig_;
NetVariable*result_var_;
svector<NetNet*>ports_;
};
@ -2376,36 +2361,6 @@ class NetTaskDef {
NetTaskDef& operator= (const NetTaskDef&);
};
/*
* Variable object such as real and realtime are represented by
* instances of this class.
*/
class NetVariable : public LineInfo {
friend class NetScope;
public:
// The name must be a permallocated string. This class makes
// no attempt to preserve it.
NetVariable(perm_string name);
~NetVariable();
perm_string basename() const;
NetScope* scope();
const NetScope* scope() const;
private:
perm_string name_;
NetScope*scope_;
NetVariable*snext_;
private:
NetVariable(const NetVariable&);
NetVariable& operator= (const NetVariable&);
};
/*
* This node represents a function call in an expression. The object
* contains a pointer to the function definition, which is used to
@ -2415,13 +2370,11 @@ class NetEUFunc : public NetExpr {
public:
NetEUFunc(NetScope*, NetESignal*, svector<NetExpr*>&);
NetEUFunc(NetScope*, NetEVariable*, svector<NetExpr*>&);
~NetEUFunc();
const string name() const;
const NetESignal*result_sig() const;
const NetEVariable*result_var() const;
unsigned parm_count() const;
const NetExpr* parm(unsigned idx) const;
@ -2429,7 +2382,7 @@ class NetEUFunc : public NetExpr {
const NetScope* func() const;
virtual bool set_width(unsigned);
virtual TYPE expr_type() const;
virtual ivl_variable_type_t expr_type() const;
virtual void dump(ostream&) const;
virtual void expr_scan(struct expr_scan_t*) const;
@ -2439,7 +2392,6 @@ class NetEUFunc : public NetExpr {
private:
NetScope*func_;
NetESignal*result_sig_;
NetEVariable*result_var_;
svector<NetExpr*> parms_;
private: // not implemented
@ -2617,7 +2569,7 @@ class NetEBAdd : public NetEBinary {
NetEBAdd(char op, NetExpr*l, NetExpr*r);
~NetEBAdd();
virtual TYPE expr_type() const;
virtual ivl_variable_type_t expr_type() const;
virtual bool set_width(unsigned w);
virtual NetEBAdd* dup_expr() const;
@ -2636,7 +2588,7 @@ class NetEBDiv : public NetEBinary {
NetEBDiv(char op, NetExpr*l, NetExpr*r);
~NetEBDiv();
virtual TYPE expr_type() const;
virtual ivl_variable_type_t expr_type() const;
virtual bool set_width(unsigned w);
virtual NetEBDiv* dup_expr() const;
@ -2743,7 +2695,7 @@ class NetEBMult : public NetEBinary {
NetEBMult(char op, NetExpr*l, NetExpr*r);
~NetEBMult();
virtual TYPE expr_type() const;
virtual ivl_variable_type_t expr_type() const;
virtual bool set_width(unsigned w);
virtual NetEBMult* dup_expr() const;
@ -2825,28 +2777,6 @@ class NetEConcat : public NetExpr {
bool repeat_calculated_;
};
/*
* This node represents a reference to a variable.
*/
class NetEVariable : public NetExpr {
public:
NetEVariable(NetVariable*);
~NetEVariable();
const NetVariable* variable() const;
TYPE expr_type() const;
void expr_scan(struct expr_scan_t*) const;
void dump(ostream&) const;
NetEVariable*dup_expr() const;
NexusSet* nex_input();
private:
NetVariable*var_;
};
/*
* This class is a placeholder for a parameter expression. When
@ -2968,7 +2898,7 @@ class NetEScope : public NetExpr {
class NetESFunc : public NetExpr {
public:
NetESFunc(const char*name, NetExpr::TYPE t,
NetESFunc(const char*name, ivl_variable_type_t t,
unsigned width, unsigned nprms);
~NetESFunc();
@ -2979,7 +2909,7 @@ class NetESFunc : public NetExpr {
NetExpr* parm(unsigned idx);
const NetExpr* parm(unsigned idx) const;
virtual TYPE expr_type() const;
virtual ivl_variable_type_t expr_type() const;
virtual NexusSet* nex_input();
virtual bool set_width(unsigned);
virtual void dump(ostream&) const;
@ -2989,7 +2919,7 @@ class NetESFunc : public NetExpr {
private:
const char* name_;
TYPE type_;
ivl_variable_type_t type_;
unsigned nparms_;
NetExpr**parms_;
@ -3156,6 +3086,8 @@ class NetESignal : public NetExpr {
unsigned msi() const;
unsigned lsi() const;
virtual ivl_variable_type_t expr_type() const;
virtual void expr_scan(struct expr_scan_t*) const;
virtual void dump(ostream&) const;
@ -3203,10 +3135,6 @@ class NetScope : public Attrib {
void rem_event(NetEvent*);
NetEvent*find_event(const char*name);
void add_variable(NetVariable*);
void rem_variable(NetVariable*);
NetVariable*find_variable(const char*name);
/* These methods manage signals. The add_ and rem_signal
methods are used by the NetNet objects to make themselves
@ -3325,7 +3253,6 @@ class NetScope : public Attrib {
NetNet::Type default_nettype_;
NetEvent *events_;
NetVariable*vars_;
NetNet *signals_;
NetMemory*memories_;
@ -3505,6 +3432,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.346 2005/07/11 16:56:50 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.345 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: netmisc.h,v 1.22 2005/05/24 01:44:28 steve Exp $"
#ident "$Id: netmisc.h,v 1.23 2005/07/11 16:56:51 steve Exp $"
#endif
# include "netlist.h"
@ -37,7 +37,6 @@
extern NetScope* symbol_search(Design*des, NetScope*start, hname_t path,
NetNet*&net, /* net/reg */
NetMemory*&mem, /* memory */
NetVariable*&var, /* real/realtime */
const NetExpr*&par,/* parameter */
NetEvent*&eve /* named event */);
@ -101,6 +100,9 @@ extern NetExpr* elab_and_eval(Design*des, NetScope*scope, const PExpr*pe);
/*
* $Log: netmisc.h,v $
* Revision 1.23 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.22 2005/05/24 01:44:28 steve
* Do sign extension of structuran nets.
*

22
parse.y
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: parse.y,v 1.203 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: parse.y,v 1.204 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -344,12 +344,24 @@ block_item_decl
{ pform_set_reg_time($2);
}
| K_real list_of_identifiers ';'
{ pform_make_reals($2, @1.text, @1.first_line);
}
/* real declarations are fairly simple as there is no range of
signed flag in the declaration. Create the real as a NetNet::REG
with real value. Note that real and realtime are interchangable
in this context. */
| K_real list_of_identifiers ';'
{ pform_makewire(@1, 0, true, $2,
NetNet::REG,
NetNet::NOT_A_PORT,
IVL_VT_REAL,
0);
}
| K_realtime list_of_identifiers ';'
{ pform_make_reals($2, @1.text, @1.first_line);
{ pform_makewire(@1, 0, true, $2,
NetNet::REG,
NetNet::NOT_A_PORT,
IVL_VT_REAL,
0);
}
| K_parameter parameter_assign_decl ';'

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: pform.cc,v 1.132 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: pform.cc,v 1.133 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -26,7 +26,6 @@
# include "pform.h"
# include "parse_misc.h"
# include "parse_api.h"
# include "PData.h"
# include "PEvent.h"
# include "PUdp.h"
# include <list>
@ -762,26 +761,6 @@ void pform_make_events(list<perm_string>*names, const char*fn, unsigned ln)
delete names;
}
static void pform_make_datum(perm_string name, const char*fn, unsigned ln)
{
hname_t hname = hier_name(name);
PData*datum = new PData(hname);
datum->set_file(fn);
datum->set_lineno(ln);
pform_cur_module->datum[hname] = datum;
}
void pform_make_reals(list<perm_string>*names, const char*fn, unsigned ln)
{
list<perm_string>::iterator cur;
for (cur = names->begin() ; cur != names->end() ; cur++) {
perm_string txt = *cur;
pform_make_datum(txt, fn, ln);
}
delete names;
}
/*
* pform_makegates is called when a list of gates (with the same type)
* are ready to be instantiated. The function runs through the list of
@ -1617,6 +1596,9 @@ int pform_parse(const char*path, FILE*file)
/*
* $Log: pform.cc,v $
* Revision 1.133 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.132 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: pform_dump.cc,v 1.89 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: pform_dump.cc,v 1.90 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -29,7 +29,6 @@
* module in question.
*/
# include "pform.h"
# include "PData.h"
# include "PEvent.h"
# include <iostream>
# include <iomanip>
@ -809,13 +808,6 @@ void Module::dump(ostream&out) const
<< ev->get_line() << endl;
}
for (map<hname_t,PData*>::const_iterator cur = datum.begin()
; cur != datum.end() ; cur ++ ) {
PData*tmp = (*cur).second;
out << " real " << tmp->name() << "; // "
<< tmp->get_line() << endl;
}
// Iterate through and display all the wires.
for (map<hname_t,PWire*>::const_iterator wire = wires_.begin()
; wire != wires_.end()
@ -911,6 +903,9 @@ void PUdp::dump(ostream&out) const
/*
* $Log: pform_dump.cc,v $
* Revision 1.90 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.89 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: symbol_search.cc,v 1.1 2003/09/19 03:30:05 steve Exp $"
#ident "$Id: symbol_search.cc,v 1.2 2005/07/11 16:56:51 steve Exp $"
#endif
# include "netlist.h"
@ -30,7 +30,6 @@
NetScope*symbol_search(Design*des, NetScope*scope, hname_t path,
NetNet*&net,
NetMemory*&mem,
NetVariable*&var,
const NetExpr*&par,
NetEvent*&eve)
{
@ -42,7 +41,6 @@ NetScope*symbol_search(Design*des, NetScope*scope, hname_t path,
/* Initialize output argument to cleared. */
net = 0;
mem = 0;
var = 0;
par = 0;
eve = 0;
@ -62,11 +60,6 @@ NetScope*symbol_search(Design*des, NetScope*scope, hname_t path,
return scope;
}
if ( (var = scope->find_variable(key)) ) {
delete key;
return scope;
}
if ( (eve = scope->find_event(key)) ) {
delete key;
return scope;
@ -89,6 +82,9 @@ NetScope*symbol_search(Design*des, NetScope*scope, hname_t path,
/*
* $Log: symbol_search.cc,v $
* Revision 1.2 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.1 2003/09/19 03:30:05 steve
* Fix name search in elab_lval.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: sys_funcs.cc,v 1.6 2004/10/04 01:10:55 steve Exp $"
#ident "$Id: sys_funcs.cc,v 1.7 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -31,14 +31,14 @@
*/
static const struct sfunc_return_type sfunc_table[] = {
{ "$realtime", NetExpr::ET_REAL, 0, 0 },
{ "$bitstoreal", NetExpr::ET_REAL, 0, 0 },
{ "$itor", NetExpr::ET_REAL, 0, 0 },
{ "$realtobits", NetExpr::ET_VECTOR, 64, 0 },
{ "$time", NetExpr::ET_VECTOR, 64, 0 },
{ "$stime", NetExpr::ET_VECTOR, 32, 0 },
{ "$simtime", NetExpr::ET_VECTOR, 64, 0 },
{ 0, NetExpr::ET_VECTOR, 32, 0 }
{ "$realtime", IVL_VT_REAL, 0, 0 },
{ "$bitstoreal", IVL_VT_REAL, 0, 0 },
{ "$itor", IVL_VT_REAL, 0, 0 },
{ "$realtobits", IVL_VT_LOGIC, 64, 0 },
{ "$time", IVL_VT_LOGIC, 64, 0 },
{ "$stime", IVL_VT_LOGIC, 32, 0 },
{ "$simtime", IVL_VT_LOGIC, 64, 0 },
{ 0, IVL_VT_LOGIC, 32, 0 }
};
struct sfunc_return_type_cell : sfunc_return_type {
@ -124,7 +124,7 @@ int load_sys_func_table(const char*path)
if (strcmp(stype,"vpiSysFuncReal") == 0) {
cell = new struct sfunc_return_type_cell;
cell->name = lex_strings.add(name);
cell->type = NetExpr::ET_REAL;
cell->type = IVL_VT_REAL;
cell->wid = 0;
cell->signed_flag = true;
cell->next = sfunc_stack;
@ -135,7 +135,7 @@ int load_sys_func_table(const char*path)
if (strcmp(stype,"vpiSysFuncInt") == 0) {
cell = new struct sfunc_return_type_cell;
cell->name = lex_strings.add(name);
cell->type = NetExpr::ET_VECTOR;
cell->type = IVL_VT_LOGIC;
cell->wid = 32;
cell->signed_flag = true;
cell->next = sfunc_stack;
@ -176,7 +176,7 @@ int load_sys_func_table(const char*path)
cell = new struct sfunc_return_type_cell;
cell->name = lex_strings.add(name);
cell->type = NetExpr::ET_VECTOR;
cell->type = IVL_VT_LOGIC;
cell->wid = width;
cell->signed_flag = signed_flag;
cell->next = sfunc_stack;
@ -193,6 +193,9 @@ int load_sys_func_table(const char*path)
/*
* $Log: sys_funcs.cc,v $
* Revision 1.7 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.6 2004/10/04 01:10:55 steve
* Clean up spurious trailing white space.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.129 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: t-dll-api.cc,v 1.130 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -281,9 +281,6 @@ extern "C" const char* ivl_expr_name(ivl_expr_t net)
case IVL_EX_SIGNAL:
return net->u_.signal_.sig->name_;
case IVL_EX_VARIABLE:
return net->u_.variable_.var->name;
default:
assert(0);
}
@ -507,12 +504,6 @@ extern "C" ivl_memory_t ivl_expr_memory(ivl_expr_t net)
return net->u_.memory_.mem_;
}
extern "C" ivl_variable_t ivl_expr_variable(ivl_expr_t net)
{
assert(net->type_ == IVL_EX_VARIABLE);
return net->u_.variable_.var;
}
extern "C" const char* ivl_logic_attr(ivl_net_logic_t net, const char*key)
{
assert(net);
@ -1220,14 +1211,6 @@ extern "C" ivl_memory_t ivl_lval_mem(ivl_lval_t net)
return 0x0;
}
extern "C" ivl_variable_t ivl_lval_var(ivl_lval_t net)
{
assert(net);
if (net->type_ == IVL_LVAL_VAR)
return net->n.var;
return 0x0;
}
extern "C" unsigned ivl_lval_part_off(ivl_lval_t net)
{
assert(net);
@ -1452,19 +1435,6 @@ extern "C" ivl_event_t ivl_scope_event(ivl_scope_t net, unsigned idx)
return net->event_[idx];
}
extern "C" unsigned ivl_scope_vars(ivl_scope_t net)
{
assert(net);
return net->nvar_;
}
extern "C" ivl_variable_t ivl_scope_var(ivl_scope_t net, unsigned idx)
{
assert(net);
assert(idx < net->nvar_);
return net->var_[idx];
}
extern "C" unsigned ivl_scope_logs(ivl_scope_t net)
{
assert(net);
@ -1975,9 +1945,6 @@ extern "C" unsigned ivl_stmt_lwidth(ivl_statement_t net)
case IVL_LVAL_MEM:
sum += ivl_memory_width(ivl_lval_mem(cur));
break;
case IVL_LVAL_VAR:
sum += 0;
break;
default:
assert(0);
}
@ -2058,20 +2025,11 @@ extern "C" ivl_statement_t ivl_stmt_sub_stmt(ivl_statement_t net)
return 0;
}
extern "C" const char* ivl_variable_name(ivl_variable_t net)
{
assert(net);
return net->name;
}
extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net)
{
assert(net);
return net->type;
}
/*
* $Log: t-dll-api.cc,v $
* Revision 1.130 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.129 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-expr.cc,v 1.40 2005/01/24 05:28:31 steve Exp $"
#ident "$Id: t-dll-expr.cc,v 1.41 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -38,18 +38,7 @@
*/
static ivl_variable_type_t get_expr_type(const NetExpr*net)
{
switch (net->expr_type()) {
case NetExpr::ET_VOID:
return IVL_VT_VOID;
case NetExpr::ET_REAL:
return IVL_VT_REAL;
case NetExpr::ET_VECTOR:
return IVL_VT_VECTOR;
}
return IVL_VT_VOID;
return net->expr_type();
}
/*
@ -369,18 +358,7 @@ void dll_target::expr_sfunc(const NetESFunc*net)
assert(expr);
expr->type_ = IVL_EX_SFUNC;
switch (net->expr_type()) {
case NetExpr::ET_VECTOR:
expr->value_= IVL_VT_VECTOR;
break;
case NetExpr::ET_REAL:
expr->value_= IVL_VT_REAL;
break;
case NetExpr::ET_VOID:
assert(0);
expr->value_= IVL_VT_VECTOR;
break;
}
expr->value_= net->expr_type();
expr->width_= net->expr_width();
expr->signed_ = net->has_sign()? 1 : 0;
/* system function names are lex_strings strings. */
@ -438,7 +416,7 @@ void dll_target::expr_signal(const NetESignal*net)
assert(expr_);
expr_->type_ = IVL_EX_SIGNAL;
expr_->value_= IVL_VT_VECTOR;
expr_->value_= net->expr_type();
expr_->width_= net->expr_width();
expr_->signed_ = net->has_sign()? 1 : 0;
expr_->u_.signal_.sig = find_signal(des_, net->sig());
@ -493,20 +471,11 @@ void dll_target::expr_unary(const NetEUnary*net)
expr_->u_.unary_.sub_ = sub;
}
void dll_target::expr_variable(const NetEVariable*net)
{
assert(expr_ == 0);
expr_ = (ivl_expr_t)calloc(1, sizeof(struct ivl_expr_s));
expr_->type_ = IVL_EX_VARIABLE;
expr_->value_ = IVL_VT_REAL;
expr_->width_ = 0;
expr_->signed_= net->has_sign()? 1 : 0;
expr_->u_.variable_.var = find_variable(des_, net->variable());
}
/*
* $Log: t-dll-expr.cc,v $
* Revision 1.41 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.40 2005/01/24 05:28:31 steve
* Remove the NetEBitSel and combine all bit/part select
* behavior into the NetESelect node and IVL_EX_SELECT

View File

@ -18,7 +18,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-proc.cc,v 1.66 2004/12/11 02:31:28 steve Exp $"
#ident "$Id: t-dll-proc.cc,v 1.67 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -130,13 +130,6 @@ bool dll_target::func_def(const NetScope*net)
return true;
}
if (const NetVariable*ret_var = def->return_var()) {
cerr << ret_var->get_line() << ": internal error: "
<< "Function " << net->name() << " has an unsupported "
<< "return type." << endl;
return false;
}
cerr << "?:0" << ": internal error: "
<< "Function " << net->name() << " has a return type"
<< " that I do not understand." << endl;
@ -194,11 +187,7 @@ void dll_target::make_assign_lvals_(const NetAssignBase*net)
cur->idx = expr_;
expr_ = 0;
} else {
assert(asn->var());
cur->type_ = IVL_LVAL_VAR;
cur->idx = 0;
cur->n.var = find_variable(des_, asn->var());
assert(0);
}
}
}
@ -743,6 +732,9 @@ void dll_target::proc_while(const NetWhile*net)
/*
* $Log: t-dll-proc.cc,v $
* Revision 1.67 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.66 2004/12/11 02:31:28 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.152 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: t-dll.cc,v 1.153 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -242,22 +242,6 @@ ivl_signal_t dll_target::find_signal(ivl_design_s &des, const NetNet*net)
return 0;
}
ivl_variable_t dll_target::find_variable(ivl_design_s&des,
const NetVariable*net)
{
ivl_scope_t scope = find_scope(des, net->scope());
assert(scope);
const char*nname = net->basename();
for (unsigned idx = 0 ; idx < scope->nvar_ ; idx += 1) {
if (strcmp(scope->var_[idx]->name, nname) == 0)
return scope->var_[idx];
}
assert(0);
return 0;
}
/*
* This function locates an ivl_memory_t object that matches the
* NetMemory object. The search works by looking for the parent scope,
@ -441,14 +425,6 @@ static void scope_add_mem(ivl_scope_t scope, ivl_memory_t net)
scope->mem_[scope->nmem_-1] = net;
}
static void scope_add_var(ivl_scope_t scope, ivl_variable_t net)
{
scope->nvar_ += 1;
scope->var_ = (ivl_variable_t*)
realloc(scope->var_, scope->nvar_*sizeof(ivl_variable_t));
scope->var_[scope->nvar_-1] = net;
}
ivl_parameter_t dll_target::scope_find_param(ivl_scope_t scope,
const char*name)
{
@ -541,8 +517,6 @@ void dll_target::add_root(ivl_design_s &des_, const NetScope *s)
root_->lpm_ = 0;
root_->nmem_ = 0;
root_->mem_ = 0;
root_->nvar_ = 0;
root_->var_ = 0;
make_scope_parameters(root_, s);
root_->type_ = IVL_SCT_MODULE;
root_->tname_ = root_->name_;
@ -756,18 +730,6 @@ void dll_target::event(const NetEvent*net)
}
void dll_target::variable(const NetVariable*net)
{
struct ivl_variable_s *obj = new struct ivl_variable_s;
ivl_scope_t scope = find_scope(des_, net->scope());
obj->type = IVL_VT_REAL;
obj->name = net->basename();
obj->scope = scope;
scope_add_var(scope, obj);
}
void dll_target::logic(const NetLogic*net)
{
struct ivl_net_logic_s *obj = new struct ivl_net_logic_s;
@ -1962,8 +1924,6 @@ void dll_target::scope(const NetScope*net)
scope->lpm_ = 0;
scope->nmem_ = 0;
scope->mem_ = 0;
scope->nvar_ = 0;
scope->var_ = 0;
make_scope_parameters(scope, net);
scope->time_units = net->time_unit();
scope->nattr = net->attr_cnt();
@ -2143,6 +2103,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/*
* $Log: t-dll.cc,v $
* Revision 1.153 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.152 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

27
t-dll.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.h,v 1.127 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: t-dll.h,v 1.128 2005/07/11 16:56:51 steve Exp $"
#endif
# include "target.h"
@ -69,7 +69,6 @@ struct dll_target : public target_t, public expr_scan_t {
bool bufz(const NetBUFZ*);
void event(const NetEvent*);
void variable(const NetVariable*);
void logic(const NetLogic*);
bool ureduce(const NetUReduce*);
void net_case_cmp(const NetCaseCmp*);
@ -145,7 +144,6 @@ struct dll_target : public target_t, public expr_scan_t {
void expr_ufunc(const NetEUFunc*);
void expr_unary(const NetEUnary*);
void expr_signal(const NetESignal*);
void expr_variable(const NetEVariable*);
ivl_scope_t lookup_scope_(const NetScope*scope);
@ -158,7 +156,6 @@ struct dll_target : public target_t, public expr_scan_t {
static ivl_scope_t find_scope(ivl_design_s &des, const NetScope*cur);
static ivl_signal_t find_signal(ivl_design_s &des, const NetNet*net);
static ivl_memory_t find_memory(ivl_design_s &des, const NetMemory*net);
static ivl_variable_t find_variable(ivl_design_s &des, const NetVariable*net);
static ivl_parameter_t scope_find_param(ivl_scope_t scope,
const char*name);
@ -270,9 +267,6 @@ struct ivl_expr_s {
ivl_expr_t sub_;
} unary_;
struct {
ivl_variable_t var;
} variable_;
} u_;
};
@ -380,8 +374,7 @@ enum ivl_lval_type_t {
IVL_LVAL_REG = 0,
IVL_LVAL_MUX = 1,
IVL_LVAL_MEM = 2,
IVL_LVAL_NET = 3, /* Only force can have NET l-values */
IVL_LVAL_VAR = 4
IVL_LVAL_NET = 3 /* Only force can have NET l-values */
};
struct ivl_lval_s {
@ -392,7 +385,6 @@ struct ivl_lval_s {
union {
ivl_signal_t sig;
ivl_memory_t mem;
ivl_variable_t var;
} n;
};
@ -551,9 +543,6 @@ struct ivl_scope_s {
unsigned nmem_;
ivl_memory_t* mem_;
unsigned nvar_;
ivl_variable_t* var_;
unsigned nparam_;
ivl_parameter_t param_;
@ -679,17 +668,11 @@ struct ivl_statement_s {
} u_;
};
/*
* This holds the details about a variable object.
*/
struct ivl_variable_s {
ivl_variable_type_t type;
perm_string name;
ivl_scope_t scope;
};
/*
* $Log: t-dll.h,v $
* Revision 1.128 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.127 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: target.cc,v 1.76 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: target.cc,v 1.77 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -47,12 +47,6 @@ void target_t::memory(const NetMemory*)
"Unhandled memory." << endl;
}
void target_t::variable(const NetVariable*that)
{
cerr << that->get_line() << ": error: target (" << typeid(*this).name()
<< "): Unhandled variable <" << that->basename() << ">." << endl;
}
bool target_t::func_def(const NetScope*)
{
cerr << "target (" << typeid(*this).name() << "): "
@ -429,12 +423,6 @@ void expr_scan_t::expr_unary(const NetEUnary*)
"unhandled expr_unary." << endl;
}
void expr_scan_t::expr_variable(const NetEVariable*)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
"unhandled expr_variable." << endl;
}
void expr_scan_t::expr_binary(const NetEBinary*ex)
{
cerr << "expr_scan_t (" << typeid(*this).name() << "): "
@ -443,6 +431,9 @@ void expr_scan_t::expr_binary(const NetEBinary*ex)
/*
* $Log: target.cc,v $
* Revision 1.77 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.76 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: target.h,v 1.73 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: target.h,v 1.74 2005/07/11 16:56:51 steve Exp $"
#endif
# include "netlist.h"
@ -68,9 +68,6 @@ struct target_t {
/* Output a memory (called for each memory object) */
virtual void memory(const NetMemory*);
/* Output an event object. Called for each named event in the scope. */
virtual void variable(const NetVariable*);
/* Output a defined task. */
virtual void task_def(const NetScope*);
virtual bool func_def(const NetScope*);
@ -149,7 +146,6 @@ struct expr_scan_t {
virtual void expr_ternary(const NetETernary*);
virtual void expr_ufunc(const NetEUFunc*);
virtual void expr_unary(const NetEUnary*);
virtual void expr_variable(const NetEVariable*);
virtual void expr_binary(const NetEBinary*);
};
@ -174,6 +170,9 @@ extern const struct target *target_table[];
/*
* $Log: target.h,v $
* Revision 1.74 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.73 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: statement.c,v 1.6 2005/05/08 23:44:08 steve Exp $"
#ident "$Id: statement.c,v 1.7 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -27,7 +27,6 @@
static unsigned show_assign_lval(ivl_lval_t lval, unsigned ind)
{
ivl_memory_t mem;
ivl_variable_t var;
unsigned wid = 0;
if ( (mem = ivl_lval_mem(lval)) ) {
@ -48,10 +47,6 @@ static unsigned show_assign_lval(ivl_lval_t lval, unsigned ind)
stub_errors += 1;
}
} else if ( (var = ivl_lval_var(lval)) ) {
fprintf(out, "%*svariable %s\n", ind, "", ivl_variable_name(var));
} else {
ivl_signal_t sig = ivl_lval_sig(lval);

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: stub.c,v 1.129 2005/07/07 16:22:49 steve Exp $"
#ident "$Id: stub.c,v 1.130 2005/07/11 16:56:51 steve Exp $"
#endif
# include "config.h"
@ -216,8 +216,8 @@ void show_expression(ivl_expr_t net, unsigned ind)
break;
case IVL_EX_SIGNAL:
fprintf(out, "%*s<signal=%s, width=%u, %s>\n", ind, "",
ivl_expr_name(net), width, sign);
fprintf(out, "%*s<signal=%s, width=%u, %s type=%s>\n", ind, "",
ivl_expr_name(net), width, sign, vt);
break;
case IVL_EX_TERNARY:
@ -230,11 +230,6 @@ void show_expression(ivl_expr_t net, unsigned ind)
show_expression(ivl_expr_oper1(net), ind+4);
break;
case IVL_EX_VARIABLE:
fprintf(out, "%*s<variable %s, type=%s>\n",
ind, "", ivl_expr_name(net), vt);
break;
case IVL_EX_REALNUM:
{
int idx;
@ -972,26 +967,6 @@ static void show_parameter(ivl_parameter_t net)
show_expression(ivl_parameter_expr(net), 7);
}
static void show_variable(ivl_variable_t net)
{
const char*type = "?";
const char*name = ivl_variable_name(net);
switch (ivl_variable_type(net)) {
case IVL_VT_VOID:
type = "void";
break;
case IVL_VT_REAL:
type = "real";
break;
case IVL_VT_VECTOR:
type = "vector";
break;
}
fprintf(out, " variable %s %s;\n", type, name);
}
static void show_event(ivl_event_t net)
{
unsigned idx;
@ -1387,9 +1362,6 @@ static int show_scope(ivl_scope_t net, void*x)
for (idx = 0 ; idx < ivl_scope_params(net) ; idx += 1)
show_parameter(ivl_scope_param(net, idx));
for (idx = 0 ; idx < ivl_scope_vars(net) ; idx += 1)
show_variable(ivl_scope_var(net, idx));
for (idx = 0 ; idx < ivl_scope_sigs(net) ; idx += 1)
show_signal(ivl_scope_sig(net, idx));
@ -1487,6 +1459,9 @@ int target_design(ivl_design_t des)
/*
* $Log: stub.c,v $
* Revision 1.130 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.129 2005/07/07 16:22:49 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: draw_vpi.c,v 1.11 2005/06/18 15:55:21 steve Exp $"
#ident "$Id: draw_vpi.c,v 1.12 2005/07/11 16:56:51 steve Exp $"
#endif
# include "vvp_priv.h"
@ -79,7 +79,6 @@ static void draw_vpi_taskfunc_args(const char*call_string,
case IVL_EX_STRING:
case IVL_EX_EVENT:
case IVL_EX_SCOPE:
case IVL_EX_VARIABLE:
continue;
case IVL_EX_SFUNC:
@ -186,12 +185,6 @@ static void draw_vpi_taskfunc_args(const char*call_string,
vvp_signal_label(ivl_expr_signal(expr)));
continue;
case IVL_EX_VARIABLE: {
ivl_variable_t var = ivl_expr_variable(expr);
fprintf(vvp_out, ", W_%s", vvp_word_label(var));
continue;
}
case IVL_EX_STRING:
if (( par = ivl_expr_parameter(expr) )) {
fprintf(vvp_out, ", P_%p", par);
@ -299,6 +292,9 @@ int draw_vpi_rfunc_call(ivl_expr_t fnet)
/*
* $Log: draw_vpi.c,v $
* Revision 1.12 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.11 2005/06/18 15:55:21 steve
* Handle signed display of unsigned signals.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_expr.c,v 1.117 2005/03/12 23:45:33 steve Exp $"
#ident "$Id: eval_expr.c,v 1.118 2005/07/11 16:56:51 steve Exp $"
#endif
# include "vvp_priv.h"
@ -1989,18 +1989,6 @@ static struct vector_info draw_unary_expr(ivl_expr_t exp, unsigned wid)
return res;
}
static struct vector_info draw_variable_expr(ivl_expr_t exp, unsigned wid)
{
struct vector_info res;
ivl_variable_t var = ivl_expr_variable(exp);
fprintf(vvp_out, " ; XXXX Read variable %s\n",
ivl_variable_name(var));
res.base = 0;
res.wid = wid;
return res;
}
/*
* Sometimes we know ahead of time where we want the expression value
* to go. In that case, call this function. It will check to see if
@ -2101,10 +2089,6 @@ struct vector_info draw_eval_expr_wid(ivl_expr_t exp, unsigned wid,
case IVL_EX_UNARY:
res = draw_unary_expr(exp, wid);
break;
case IVL_EX_VARIABLE:
res = draw_variable_expr(exp, wid);
break;
}
return res;
@ -2117,6 +2101,9 @@ struct vector_info draw_eval_expr(ivl_expr_t exp, int stuff_ok_flag)
/*
* $Log: eval_expr.c,v $
* Revision 1.118 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.117 2005/03/12 23:45:33 steve
* Handle function/task port vectors.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: eval_real.c,v 1.12 2005/07/07 16:22:50 steve Exp $"
#ident "$Id: eval_real.c,v 1.13 2005/07/11 16:56:51 steve Exp $"
#endif
/*
@ -118,19 +118,6 @@ static int draw_number_real(ivl_expr_t exp)
return res;
}
/*
* Evaluate a real variable expression by loading the real variable
* into a real thread word.
*/
static int draw_variable_real(ivl_expr_t exp)
{
int res = allocate_word();
ivl_variable_t var = ivl_expr_variable(exp);
fprintf(vvp_out, " %%load/wr %d, W_%s;\n", res, vvp_word_label(var));
return res;
}
static int draw_realnum_real(ivl_expr_t exp)
{
int res = allocate_word();
@ -285,10 +272,6 @@ int draw_eval_real(ivl_expr_t exp)
res = draw_realnum_real(exp);
break;
case IVL_EX_VARIABLE:
res = draw_variable_real(exp);
break;
case IVL_EX_SFUNC:
res = draw_sfunc_real(exp);
break;
@ -325,6 +308,9 @@ int draw_eval_real(ivl_expr_t exp)
/*
* $Log: eval_real.c,v $
* Revision 1.13 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.12 2005/07/07 16:22:50 steve
* Generalize signals to carry types.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_priv.h,v 1.29 2004/12/11 02:31:28 steve Exp $"
#ident "$Id: vvp_priv.h,v 1.30 2005/07/11 16:56:51 steve Exp $"
#endif
# include "vvp_config.h"
@ -49,8 +49,6 @@ extern const char* vvp_signal_label(ivl_signal_t sig);
*/
extern const char* vvp_memory_label(ivl_memory_t mem);
extern const char* vvp_word_label(ivl_variable_t var);
/*
* This function draws a process (initial or always) into the output
* file. It normally returns 0, but returns !0 of there is some sort
@ -193,6 +191,9 @@ extern unsigned thread_count;
/*
* $Log: vvp_priv.h,v $
* Revision 1.30 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.29 2004/12/11 02:31:28 steve
* Rework of internals to carry vectors through nexus instead
* of single bits. Make the ivl, tgt-vvp and vvp initial changes

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_process.c,v 1.114 2005/07/07 16:22:50 steve Exp $"
#ident "$Id: vvp_process.c,v 1.115 2005/07/11 16:56:51 steve Exp $"
#endif
# include "vvp_priv.h"
@ -317,26 +317,6 @@ static int show_stmt_assign_vector(ivl_statement_t net)
* for /dev/null when typed ivl_signal_t takes over all the real
* variable support.
*/
static int show_stmt_assign_real(ivl_statement_t net)
{
int res;
ivl_lval_t lval;
ivl_variable_t var;
res = draw_eval_real(ivl_stmt_rval(net));
clr_word(res);
assert(ivl_stmt_lvals(net) == 1);
lval = ivl_stmt_lval(net, 0);
var = ivl_lval_var(lval);
assert(var != 0);
fprintf(vvp_out, " %%set/wr W_%s, %d;\n",
vvp_word_label(var), res);
return 0;
}
static int show_stmt_assign_sig_real(ivl_statement_t net)
{
int res;
@ -360,28 +340,11 @@ static int show_stmt_assign_sig_real(ivl_statement_t net)
static int show_stmt_assign(ivl_statement_t net)
{
ivl_lval_t lval;
ivl_variable_t var;
ivl_signal_t sig;
lval = ivl_stmt_lval(net, 0);
if ( (var = ivl_lval_var(lval)) != 0 ) {
switch (ivl_variable_type(var)) {
case IVL_VT_VOID:
assert(0);
return 1;
case IVL_VT_VECTOR:
/* Can't happen. */
assert(0);
return 1;
case IVL_VT_REAL:
return show_stmt_assign_real(net);
}
} else {
ivl_signal_t sig = ivl_lval_sig(lval);
sig = ivl_lval_sig(lval);
if (sig) switch (ivl_signal_data_type(sig)) {
case IVL_VT_REAL:
@ -393,7 +356,6 @@ static int show_stmt_assign(ivl_statement_t net)
} else {
return show_stmt_assign_vector(net);
}
}
return 0;
}
@ -408,10 +370,10 @@ static int show_stmt_assign(ivl_statement_t net)
* In this case we know (by Verilog syntax) that there is only exactly
* 1 l-value, the target identifier, so it should be relatively easy.
*/
static int show_stmt_assign_nb_var(ivl_statement_t net)
static int show_stmt_assign_nb_real(ivl_statement_t net)
{
ivl_lval_t lval;
ivl_variable_t var;
ivl_signal_t sig;
ivl_expr_t rval = ivl_stmt_rval(net);
ivl_expr_t del = ivl_stmt_delay_expr(net);
@ -434,11 +396,10 @@ static int show_stmt_assign_nb_var(ivl_statement_t net)
word = draw_eval_real(rval);
lval = ivl_stmt_lval(net, 0);
var = ivl_lval_var(lval);
assert(var != 0);
fprintf(vvp_out, " %%assign/wr W_%s, %lu, %u;\n",
vvp_word_label(var), delay, word);
sig = ivl_lval_sig(lval);
assert(sig);
fprintf(vvp_out, " %%assign/wr V_%s, %lu, %u;\n",
vvp_signal_label(sig), delay, word);
clr_word(word);
@ -451,13 +412,19 @@ static int show_stmt_assign_nb(ivl_statement_t net)
ivl_expr_t rval = ivl_stmt_rval(net);
ivl_expr_t del = ivl_stmt_delay_expr(net);
ivl_memory_t mem;
ivl_signal_t sig;
unsigned long delay = 0;
/* Catch the case we are assigning to a real/word
l-value. Handle that elsewhere. */
if (ivl_lval_var(ivl_stmt_lval(net, 0))) {
return show_stmt_assign_nb_var(net);
/* Detect special cases that are handled elsewhere. */
lval = ivl_stmt_lval(net,0);
if ((sig = ivl_lval_sig(lval))) {
switch (ivl_signal_data_type(sig)) {
case IVL_VT_REAL:
return show_stmt_assign_nb_real(net);
default:
break;
}
}
if (del && (ivl_expr_type(del) == IVL_EX_ULONG)) {
@ -1497,6 +1464,9 @@ int draw_func_definition(ivl_scope_t scope)
/*
* $Log: vvp_process.c,v $
* Revision 1.115 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.114 2005/07/07 16:22:50 steve
* Generalize signals to carry types.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
#ident "$Id: vvp_scope.c,v 1.130 2005/07/07 16:22:50 steve Exp $"
#ident "$Id: vvp_scope.c,v 1.131 2005/07/11 16:56:51 steve Exp $"
#endif
# include "vvp_priv.h"
@ -160,13 +160,6 @@ const char* vvp_signal_label(ivl_signal_t sig)
return buf;
}
const char* vvp_word_label(ivl_variable_t sig)
{
static char buf[32];
sprintf(buf, "$%p", sig);
return buf;
}
/*
* This makes a string suitable for use as a label for memories.
*/
@ -1958,15 +1951,6 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
}
/* Scan the scope for word variables. */
for (idx = 0 ; idx < ivl_scope_vars(net) ; idx += 1) {
ivl_variable_t var = ivl_scope_var(net, idx);
fprintf(vvp_out, "W_%s .var/real \"%s\", 0, 0;\n",
vvp_word_label(var),
ivl_variable_name(var));
}
/* Scan the signals (reg and net) and draw the appropriate
statements to make the signal function. */
@ -2010,6 +1994,9 @@ int draw_scope(ivl_scope_t net, ivl_scope_t parent)
/*
* $Log: vvp_scope.c,v $
* Revision 1.131 2005/07/11 16:56:51 steve
* Remove NetVariable and ivl_variable_t structures.
*
* Revision 1.130 2005/07/07 16:22:50 steve
* Generalize signals to carry types.
*