elaborate_lnet uses scope instead of string path.

This commit is contained in:
steve 2001-11-07 04:26:46 +00:00
parent bf72f39fe9
commit 6bfbcbdcf7
4 changed files with 26 additions and 15 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -58,7 +58,7 @@ NetNet* PExpr::elaborate_net(Design*des, const string&path, unsigned,
return 0; 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: " cerr << get_line() << ": error: expression not valid in assign l-value: "
<< *this << endl; << *this << endl;
@ -264,6 +264,9 @@ bool PEUnary::is_constant(Module*m) const
/* /*
* $Log: PExpr.cc,v $ * $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 * Revision 1.25 2001/11/06 06:11:55 steve
* Support more real arithmetic in delay constants. * Support more real arithmetic in delay constants.
* *

11
PExpr.h
View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include <string> # include <string>
@ -77,7 +77,7 @@ class PExpr : public LineInfo {
// This method elaborates the expression as gates, but // This method elaborates the expression as gates, but
// restricted for use as l-values of continuous assignments. // 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 // Expressions that can be in the l-value of procedural
// assignments can be elaborated with this method. // assignments can be elaborated with this method.
@ -123,7 +123,7 @@ class PEConcat : public PExpr {
// continuous assignments. // continuous assignments.
virtual NetNet* elaborate_anet(Design*des, NetScope*scope) const; 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, virtual NetNet* elaborate_net(Design*des, const string&path,
unsigned width, unsigned width,
unsigned long rise, unsigned long rise,
@ -211,7 +211,7 @@ class PEIdent : public PExpr {
virtual NetNet* elaborate_anet(Design*des, NetScope*scope) const; virtual NetNet* elaborate_anet(Design*des, NetScope*scope) const;
// Identifiers are allowed (with restrictions) is assign l-values. // 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. // Identifiers are also allowed as procedural assignment l-values.
virtual NetAssign_* elaborate_lval(Design*des, NetScope*scope) const; virtual NetAssign_* elaborate_lval(Design*des, NetScope*scope) const;
@ -449,6 +449,9 @@ class PECallFunction : public PExpr {
/* /*
* $Log: PExpr.h,v $ * $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 * Revision 1.50 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path. * eval_const uses scope instead of a string path.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -1237,10 +1237,10 @@ NetNet* PEIdent::elaborate_net_ram_(Design*des, const string&path,
* Identifiers in continuous assignment l-values are limited to wires * Identifiers in continuous assignment l-values are limited to wires
* and that ilk. Detect registers and memories here and report errors. * 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); assert(scope);
string path = scope->name();
NetNet*sig = des->find_signal(scope, text_); NetNet*sig = des->find_signal(scope, text_);
if (sig == 0) { if (sig == 0) {
@ -1899,6 +1899,9 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path,
/* /*
* $Log: elab_net.cc,v $ * $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 * Revision 1.78 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path. * eval_const uses scope instead of a string path.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#if !defined(WINNT) && !defined(macintosh) #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 #endif
# include "config.h" # include "config.h"
@ -84,7 +84,7 @@ void PGAssign::elaborate(Design*des, const string&path) const
assert(pin(1)); assert(pin(1));
/* Elaborate the l-value. */ /* Elaborate the l-value. */
NetNet*lval = pin(0)->elaborate_lnet(des, path); NetNet*lval = pin(0)->elaborate_lnet(des, scope);
if (lval == 0) { if (lval == 0) {
des->errors += 1; des->errors += 1;
return; return;
@ -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 * The concatenation is also OK an an l-value. This method elaborates
* it as a structural l-value. * 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); assert(scope);
svector<NetNet*>nets (parms_.count()); svector<NetNet*>nets (parms_.count());
@ -788,7 +787,7 @@ NetNet* PEConcat::elaborate_lnet(Design*des, const string&path) const
/* Elaborate the operands of the concatenation. */ /* Elaborate the operands of the concatenation. */
for (unsigned idx = 0 ; idx < nets.count() ; idx += 1) { 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) if (nets[idx] == 0)
errors += 1; errors += 1;
else else
@ -809,7 +808,7 @@ NetNet* PEConcat::elaborate_lnet(Design*des, const string&path) const
operands, and connect it up. Scan the operands of the operands, and connect it up. Scan the operands of the
concat operator from least significant to most significant, concat operator from least significant to most significant,
which is opposite from how they are given in the list. */ 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); NetNet::IMPLICIT, pins);
pins = 0; pins = 0;
for (unsigned idx = nets.count() ; idx > 0 ; idx -= 1) { for (unsigned idx = nets.count() ; idx > 0 ; idx -= 1) {
@ -2409,6 +2408,9 @@ Design* elaborate(list<const char*>roots)
/* /*
* $Log: elaborate.cc,v $ * $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 * Revision 1.230 2001/11/07 04:01:59 steve
* eval_const uses scope instead of a string path. * eval_const uses scope instead of a string path.
* *