Skip to content

Commit

Permalink
elaborate_lnet uses scope instead of string path.
Browse files Browse the repository at this point in the history
  • Loading branch information
steve committed Nov 7, 2001
1 parent bf72f39 commit 6bfbcbd
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
7 changes: 5 additions & 2 deletions PExpr.cc
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PExpr.cc,v 1.25 2001/11/06 06:11:55 steve Exp $"
#ident "$Id: PExpr.cc,v 1.26 2001/11/07 04:26:46 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -58,7 +58,7 @@ NetNet* PExpr::elaborate_net(Design*des, const string&path, unsigned,
return 0;
}

NetNet* PExpr::elaborate_lnet(Design*des, const string&path) const
NetNet* PExpr::elaborate_lnet(Design*des, NetScope*) const
{
cerr << get_line() << ": error: expression not valid in assign l-value: "
<< *this << endl;
Expand Down Expand Up @@ -264,6 +264,9 @@ bool PEUnary::is_constant(Module*m) const

/*
* $Log: PExpr.cc,v $
* Revision 1.26 2001/11/07 04:26:46 steve
* elaborate_lnet uses scope instead of string path.
*
* Revision 1.25 2001/11/06 06:11:55 steve
* Support more real arithmetic in delay constants.
*
Expand Down
11 changes: 7 additions & 4 deletions PExpr.h
Expand Up @@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: PExpr.h,v 1.50 2001/11/07 04:01:59 steve Exp $"
#ident "$Id: PExpr.h,v 1.51 2001/11/07 04:26:46 steve Exp $"
#endif

# include <string>
Expand Down Expand Up @@ -77,7 +77,7 @@ class PExpr : public LineInfo {

// This method elaborates the expression as gates, but
// restricted for use as l-values of continuous assignments.
virtual NetNet* elaborate_lnet(Design*des, const string&path) const;
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope) const;

// Expressions that can be in the l-value of procedural
// assignments can be elaborated with this method.
Expand Down Expand Up @@ -123,7 +123,7 @@ class PEConcat : public PExpr {
// continuous assignments.
virtual NetNet* elaborate_anet(Design*des, NetScope*scope) const;

virtual NetNet* elaborate_lnet(Design*des, const string&path) const;
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope) const;
virtual NetNet* elaborate_net(Design*des, const string&path,
unsigned width,
unsigned long rise,
Expand Down Expand Up @@ -211,7 +211,7 @@ class PEIdent : public PExpr {
virtual NetNet* elaborate_anet(Design*des, NetScope*scope) const;

// Identifiers are allowed (with restrictions) is assign l-values.
virtual NetNet* elaborate_lnet(Design*des, const string&path) const;
virtual NetNet* elaborate_lnet(Design*des, NetScope*scope) const;

// Identifiers are also allowed as procedural assignment l-values.
virtual NetAssign_* elaborate_lval(Design*des, NetScope*scope) const;
Expand Down Expand Up @@ -449,6 +449,9 @@ class PECallFunction : public PExpr {

/*
* $Log: PExpr.h,v $
* Revision 1.51 2001/11/07 04:26:46 steve
* elaborate_lnet uses scope instead of string path.
*
* Revision 1.50 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
Expand Down
9 changes: 6 additions & 3 deletions elab_net.cc
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_net.cc,v 1.78 2001/11/07 04:01:59 steve Exp $"
#ident "$Id: elab_net.cc,v 1.79 2001/11/07 04:26:46 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -1237,10 +1237,10 @@ NetNet* PEIdent::elaborate_net_ram_(Design*des, const string&path,
* Identifiers in continuous assignment l-values are limited to wires
* and that ilk. Detect registers and memories here and report errors.
*/
NetNet* PEIdent::elaborate_lnet(Design*des, const string&path) const
NetNet* PEIdent::elaborate_lnet(Design*des, NetScope*scope) const
{
NetScope*scope = des->find_scope(path);
assert(scope);
string path = scope->name();

NetNet*sig = des->find_signal(scope, text_);
if (sig == 0) {
Expand Down Expand Up @@ -1899,6 +1899,9 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path,

/*
* $Log: elab_net.cc,v $
* Revision 1.79 2001/11/07 04:26:46 steve
* elaborate_lnet uses scope instead of string path.
*
* Revision 1.78 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
Expand Down
14 changes: 8 additions & 6 deletions elaborate.cc
Expand Up @@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elaborate.cc,v 1.230 2001/11/07 04:01:59 steve Exp $"
#ident "$Id: elaborate.cc,v 1.231 2001/11/07 04:26:46 steve Exp $"
#endif

# include "config.h"
Expand Down Expand Up @@ -84,7 +84,7 @@ void PGAssign::elaborate(Design*des, const string&path) const
assert(pin(1));

/* Elaborate the l-value. */
NetNet*lval = pin(0)->elaborate_lnet(des, path);
NetNet*lval = pin(0)->elaborate_lnet(des, scope);
if (lval == 0) {
des->errors += 1;
return;
Expand Down Expand Up @@ -771,9 +771,8 @@ void PGModule::elaborate_scope(Design*des, NetScope*sc) const
* The concatenation is also OK an an l-value. This method elaborates
* it as a structural l-value.
*/
NetNet* PEConcat::elaborate_lnet(Design*des, const string&path) const
NetNet* PEConcat::elaborate_lnet(Design*des, NetScope*scope) const
{
NetScope*scope = des->find_scope(path);
assert(scope);

svector<NetNet*>nets (parms_.count());
Expand All @@ -788,7 +787,7 @@ NetNet* PEConcat::elaborate_lnet(Design*des, const string&path) const

/* Elaborate the operands of the concatenation. */
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) {
nets[idx] = parms_[idx]->elaborate_lnet(des, path);
nets[idx] = parms_[idx]->elaborate_lnet(des, scope);
if (nets[idx] == 0)
errors += 1;
else
Expand All @@ -809,7 +808,7 @@ NetNet* PEConcat::elaborate_lnet(Design*des, const string&path) const
operands, and connect it up. Scan the operands of the
concat operator from least significant to most significant,
which is opposite from how they are given in the list. */
NetNet*osig = new NetNet(scope, des->local_symbol(path),
NetNet*osig = new NetNet(scope, des->local_symbol(scope->name()),
NetNet::IMPLICIT, pins);
pins = 0;
for (unsigned idx = nets.count() ; idx > 0 ; idx -= 1) {
Expand Down Expand Up @@ -2409,6 +2408,9 @@ Design* elaborate(list<const char*>roots)

/*
* $Log: elaborate.cc,v $
* Revision 1.231 2001/11/07 04:26:46 steve
* elaborate_lnet uses scope instead of string path.
*
* Revision 1.230 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path.
*
Expand Down

0 comments on commit 6bfbcbd

Please sign in to comment.