Browse files

Remove NetVariable and ivl_variable_t structures.

  • Loading branch information...
1 parent 75ad905 commit b9799cf6ecdd221290fe0a4aeb874cf605d4e714 steve committed Jul 11, 2005
Showing with 324 additions and 969 deletions.
  1. +3 −3 Makefile.in
  2. +4 −5 Module.h
  3. +0 −50 PData.cc
  4. +0 −63 PData.h
  5. +5 −2 compiler.h
  6. +4 −17 design_dump.cc
  7. +5 −12 dup_expr.cc
  8. +5 −3 elab_anet.cc
  9. +6 −19 elab_expr.cc
  10. +5 −8 elab_lval.cc
  11. +9 −12 elab_net.cc
  12. +4 −36 elab_scope.cc
  13. +13 −6 elab_sig.cc
  14. +9 −10 elaborate.cc
  15. +4 −9 emit.cc
  16. +27 −24 eval_tree.cc
  17. +6 −32 ivl_target.h
  18. +6 −17 net_assign.cc
  19. +6 −3 net_design.cc
  20. +31 −25 net_expr.cc
  21. +4 −6 net_nex_input.cc
  22. +4 −19 net_scope.cc
  23. +0 −82 net_variable.cc
  24. +13 −27 netlist.cc
  25. +16 −86 netlist.h
  26. +4 −2 netmisc.h
  27. +16 −4 parse.y
  28. +4 −22 pform.cc
  29. +4 −9 pform_dump.cc
  30. +4 −8 symbol_search.cc
  31. +15 −12 sys_funcs.cc
  32. +4 −46 t-dll-api.cc
  33. +7 −38 t-dll-expr.cc
  34. +5 −13 t-dll-proc.cc
  35. +4 −41 t-dll.cc
  36. +5 −22 t-dll.h
  37. +4 −13 target.cc
  38. +4 −5 target.h
  39. +1 −6 tgt-stub/statement.c
  40. +6 −31 tgt-stub/stub.c
  41. +4 −8 tgt-vvp/draw_vpi.c
  42. +4 −17 tgt-vvp/eval_expr.c
  43. +4 −18 tgt-vvp/eval_real.c
  44. +4 −3 tgt-vvp/vvp_priv.h
  45. +28 −58 tgt-vvp/vvp_process.c
  46. +4 −17 tgt-vvp/vvp_scope.c
View
6 Makefile.in
@@ -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
9 Module.h
@@ -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
50 PData.cc
@@ -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.
- *
- */
-
View
63 PData.h
@@ -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
7 compiler.h
@@ -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
21 design_dump.cc
@@ -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
17 dup_expr.cc
@@ -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);
+ tmp = new NetEUFunc(func_, result_sig_->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
8 elab_anet.cc
@@ -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
25 elab_expr.cc
@@ -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
13 elab_lval.cc
@@ -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
21 elab_net.cc
@@ -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
40 elab_scope.cc
@@ -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;
}
@@ -449,34 +442,6 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
}
/*
- * 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
* elaborate_scope scan. Note that the name_ of the PEvent object has
@@ -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
19 elab_sig.cc
@@ -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
19 elaborate.cc
@@ -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.
*
View
13 emit.cc
@@ -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
51 eval_tree.cc
@@ -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,15 +273,15 @@ 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;
lv = rtmp->value().as_double();
break;
- case ET_VECTOR:
+ case IVL_VT_LOGIC:
vtmp = dynamic_cast<NetEConst*> (left_);
if (vtmp == 0)
return 0;
@@ -295,15 +295,15 @@ 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;
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
38 ivl_target.h
@@ -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
23 net_assign.cc
@@ -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
9 net_design.cc
@@ -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
56 net_expr.cc
@@ -17,17 +17,20 @@
* 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"
# include "netlist.h"
# 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
10 net_nex_input.cc
@@ -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
23 net_scope.cc
@@ -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
82 net_variable.cc
@@ -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
40 netlist.cc
@@ -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.
*
View
102 netlist.h
@@ -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,15 +2207,13 @@ class NetFuncDef {
const NetNet*port(unsigned idx) const;
const NetNet*return_sig() const;
- const NetVariable*return_var() const;
void dump(ostream&, unsigned ind) const;
private:
NetScope*scope_;
NetProc*statement_;
NetNet*result_sig_;
- NetVariable*result_var_;
svector<NetNet*>ports_;
};
@@ -2377,36 +2362,6 @@ class 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
* locate the value register and input expressions.
@@ -2415,21 +2370,19 @@ 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;
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