Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

All NetObj objects have lex_string base names.

  • Loading branch information...
commit badad63ab462ce77291f2428d2c7aa4042e1a232 1 parent 26546c1
steve authored
View
13 cprop.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: cprop.cc,v 1.42 2003/02/26 01:29:24 steve Exp $"
+#ident "$Id: cprop.cc,v 1.43 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -118,8 +118,8 @@ void cprop_functor::lpm_add_sub(Design*des, NetAddSub*obj)
NetLogic*tmp;
if (obj->pin_Cout().is_linked()) {
tmp = new NetLogic(obj->scope(),
- des->local_symbol(obj->name()), 3,
- NetLogic::AND);
+ obj->scope()->local_symbol(),
+ 3, NetLogic::AND);
connect(tmp->pin(0), obj->pin_Cout());
connect(tmp->pin(1), obj->pin_DataA(0));
connect(tmp->pin(2), obj->pin_DataB(0));
@@ -837,7 +837,7 @@ void cprop_functor::lpm_mux(Design*des, NetMux*obj)
NetScope*scope = obj->scope();
for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) {
NetLogic*tmp = new NetLogic(obj->scope(),
- scope->local_hsymbol(),
+ scope->local_symbol(),
3, NetLogic::BUFIF1);
connect(obj->pin_Result(idx), tmp->pin(0));
@@ -870,7 +870,7 @@ void cprop_functor::lpm_mux(Design*des, NetMux*obj)
NetScope*scope = obj->scope();
for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) {
NetLogic*tmp = new NetLogic(obj->scope(),
- scope->local_hsymbol(),
+ scope->local_symbol(),
3, NetLogic::BUFIF0);
connect(obj->pin_Result(idx), tmp->pin(0));
@@ -996,6 +996,9 @@ void cprop(Design*des)
/*
* $Log: cprop.cc,v $
+ * Revision 1.43 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.42 2003/02/26 01:29:24 steve
* LPM objects store only their base names.
*
View
7 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.6 2003/01/27 05:09:17 steve Exp $"
+#ident "$Id: elab_anet.cc,v 1.7 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -86,7 +86,7 @@ NetNet* PEConcat::elaborate_anet(Design*des, NetScope*scope) const
Allow for a repeat count other then 1 by repeating the
connect loop as many times as necessary. */
- NetNet*osig = new NetNet(scope, des->local_symbol(scope->name()),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT_REG, pins);
pins = 0;
@@ -149,6 +149,9 @@ NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const
/*
* $Log: elab_anet.cc,v $
+ * Revision 1.7 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.6 2003/01/27 05:09:17 steve
* Spelling fixes.
*
View
186 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.107 2003/02/26 01:29:24 steve Exp $"
+#ident "$Id: elab_net.cc,v 1.108 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -180,7 +180,6 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
NetNode*gate;
NetNode*gate_t;
- string name = scope->local_symbol();
unsigned width = lsig->pin_count();
if (rsig->pin_count() > lsig->pin_count())
width = rsig->pin_count();
@@ -219,10 +218,10 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
rsig = pad_to_width(des, rsig, width);
// Make the adder as wide as the widest operand
- osig = new NetNet(scope, scope->local_hsymbol(),
+ osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, owidth);
osig->local_flag(true);
- NetAddSub*adder = new NetAddSub(scope, name, width);
+ NetAddSub*adder = new NetAddSub(scope, scope->local_symbol(), width);
// Connect the adder to the various parts.
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1)
@@ -295,14 +294,14 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
assert(lsig->pin_count() == rsig->pin_count());
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE,
+ NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE,
lsig->pin_count());
osig->local_flag(true);
switch (op_) {
case '^': // XOR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) {
- NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XOR);
connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx));
@@ -316,7 +315,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
case 'X': // XNOR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) {
- NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XNOR);
connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx));
@@ -330,7 +329,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
case '&': // AND
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) {
- NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::AND);
connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx));
@@ -344,7 +343,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
case 'A': // NAND (~&)
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) {
- NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::NAND);
connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx));
@@ -358,7 +357,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
case '|': // Bitwise OR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) {
- NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::OR);
connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx));
@@ -372,7 +371,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
case 'O': // Bitwise NOR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) {
- NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::NOR);
connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx));
@@ -424,15 +423,15 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
NetNet*zero = 0;
if (lsig->pin_count() != rsig->pin_count()) {
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0);
des->add_node(tmp);
- zero = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ zero = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
zero->local_flag(true);
connect(tmp->pin(0), zero->pin(0));
}
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
osig->local_flag(true);
NetNode*gate;
@@ -477,13 +476,13 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
// The comparison generates gates to bitwise compare
// each pair, and AND all the comparison results.
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+dwidth,
(op_ == 'E')? NetLogic::AND : NetLogic::NAND);
connect(gate->pin(0), osig->pin(0));
for (unsigned idx = 0 ; idx < dwidth ; idx += 1) {
NetCaseCmp*cmp = new NetCaseCmp(scope,
- scope->local_hsymbol());
+ scope->local_symbol());
if (idx < lsig->pin_count())
connect(cmp->pin(1), lsig->pin(idx));
@@ -499,7 +498,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
des->add_node(cmp);
// Attach a label to this intermediate wire
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE);
tmp->local_flag(true);
connect(cmp->pin(0), tmp->pin(0));
@@ -512,7 +511,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
/* Handle the special case of single bit compare with a
single XNOR gate. This is easy and direct. */
if (dwidth == 1) {
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XNOR);
connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->pin(0));
@@ -546,7 +545,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
/* Handle the special case of single bit compare with a
single XOR gate. This is easy and direct. */
if (dwidth == 1) {
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XOR);
connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->pin(0));
@@ -646,7 +645,7 @@ NetNet* PEBinary::elaborate_net_div_(Design*des, NetScope*scope,
// will be no more then the l-value, so it is safe to connect
// all the result pins to the osig.
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth);
osig->local_flag(true);
@@ -661,7 +660,7 @@ NetNet* PEBinary::elaborate_net_div_(Design*des, NetScope*scope,
// wire [7:0] r = a / b;
if (rwidth < osig->pin_count()) {
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0);
des->add_node(tmp);
for (unsigned idx = rwidth ; idx < osig->pin_count() ; idx += 1)
@@ -702,7 +701,7 @@ NetNet* PEBinary::elaborate_net_mod_(Design*des, NetScope*scope,
connect(mod->pin_DataB(idx), rsig->pin(idx));
if (lwidth == 0) lwidth = rwidth;
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth);
osig->local_flag(true);
@@ -715,7 +714,7 @@ NetNet* PEBinary::elaborate_net_mod_(Design*des, NetScope*scope,
/* If the lvalue is larger then the result, then pad the
output with constant 0. */
if (cnt < osig->pin_count()) {
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0);
des->add_node(tmp);
for (unsigned idx = cnt ; idx < osig->pin_count() ; idx += 1)
@@ -750,11 +749,11 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
NetLogic*gate_t;
switch (op_) {
case 'a':
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::AND);
break;
case 'o':
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::OR);
break;
default:
@@ -766,7 +765,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
// The first OR gate returns 1 if the left value is true...
if (lsig->pin_count() > 1) {
- gate_t = new NetLogic(scope, scope->local_hsymbol(),
+ gate_t = new NetLogic(scope, scope->local_symbol(),
1+lsig->pin_count(), NetLogic::OR);
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1)
connect(gate_t->pin(idx+1), lsig->pin(idx));
@@ -775,7 +774,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
/* The reduced logical value is a new nexus, create a
temporary signal to represent it. */
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1);
tmp->local_flag(true);
connect(gate->pin(1), tmp->pin(0));
@@ -788,7 +787,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
// The second OR gate returns 1 if the right value is true...
if (rsig->pin_count() > 1) {
- gate_t = new NetLogic(scope, scope->local_hsymbol(),
+ gate_t = new NetLogic(scope, scope->local_symbol(),
1+rsig->pin_count(), NetLogic::OR);
for (unsigned idx = 0 ; idx < rsig->pin_count() ; idx += 1)
connect(gate_t->pin(idx+1), rsig->pin(idx));
@@ -796,7 +795,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
/* The reduced logical value is a new nexus, create a
temporary signal to represent it. */
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1);
tmp->local_flag(true);
connect(gate->pin(2), tmp->pin(0));
@@ -808,7 +807,7 @@ NetNet* PEBinary::elaborate_net_log_(Design*des, NetScope*scope,
}
// The output is the AND/OR of the two logic values.
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
osig->local_flag(true);
connect(gate->pin(0), osig->pin(0));
des->add_node(gate);
@@ -839,8 +838,8 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, NetScope*scope,
res.set(idx, prod.get(idx));
}
- NetConst*odev = new NetConst(scope, scope->local_hsymbol(), res);
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetConst*odev = new NetConst(scope, scope->local_symbol(), res);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth);
for (unsigned idx = 0 ; idx < lwidth ; idx += 1)
connect(odev->pin(idx), osig->pin(idx));
@@ -871,7 +870,7 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, NetScope*scope,
connect(mult->pin_DataB(idx), rsig->pin(idx));
if (lwidth == 0) lwidth = rwidth;
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth);
osig->local_flag(true);
@@ -884,7 +883,7 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, NetScope*scope,
/* If the lvalue is larger then the result, then pad the
output with constant 0. */
if (cnt < osig->pin_count()) {
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0);
des->add_node(tmp);
for (unsigned idx = cnt ; idx < osig->pin_count() ; idx += 1)
@@ -919,11 +918,11 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, NetScope*scope,
/* Very special case, constant 0 shift. */
if (dist == 0) return lsig;
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, lwidth);
osig->local_flag(true);
- NetConst*zero = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*zero = new NetConst(scope, scope->local_symbol(),
verinum::V0);
des->add_node(zero);
@@ -964,7 +963,7 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, NetScope*scope,
NetCLShift*gate = new NetCLShift(scope, scope->local_symbol(),
lwidth, rsig->pin_count());
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, lwidth);
osig->local_flag(true);
@@ -977,9 +976,9 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, NetScope*scope,
connect(lsig->pin(idx), gate->pin_Data(idx));
if (lsig->pin_count() < lwidth) {
- NetConst*zero = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*zero = new NetConst(scope, scope->local_symbol(),
verinum::V0);
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1);
tmp->local_flag(true);
des->add_node(zero);
@@ -994,10 +993,10 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, NetScope*scope,
connect(rsig->pin(idx), gate->pin_Distance(idx));
if (op_ == 'r') {
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1);
tmp->local_flag(true);
- NetConst*dir = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*dir = new NetConst(scope, scope->local_symbol(),
verinum::V1);
connect(dir->pin(0), gate->pin_Direction());
connect(tmp->pin(0), gate->pin_Direction());
@@ -1069,13 +1068,13 @@ NetNet* PECallFunction::elaborate_net(Design*des, NetScope*scope, unsigned,
NetUserFunc*net = new NetUserFunc(scope,
- scope->local_hsymbol().c_str(),
+ scope->local_symbol().c_str(),
dscope);
des->add_node(net);
/* Create an output signal and connect it to the output pins
of the function net. */
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE,
def->port(0)->pin_count());
osig->local_flag(true);
@@ -1185,7 +1184,7 @@ NetNet* PEConcat::elaborate_net(Design*des, NetScope*scope,
Allow for a repeat count other then 1 by repeating the
connect loop as many times as necessary. */
- NetNet*osig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, pins * repeat);
pins = 0;
@@ -1241,7 +1240,7 @@ NetNet* PEIdent::elaborate_net_bitmux_(Design*des, NetScope*scope,
for (unsigned idx = 0 ; idx < sel->pin_count() ; idx += 1)
connect(mux->pin_Sel(idx), sel->pin(idx));
- NetNet*out = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*out = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1);
connect(mux->pin_Result(0), out->pin(0));
@@ -1273,10 +1272,9 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
const NetEConst*pc = dynamic_cast<const NetEConst*>(pe);
assert(pc);
verinum pvalue = pc->value();
- sig = new NetNet(scope,
- scope->name()+"."+path_.peek_name(0),
+ sig = new NetNet(scope, path_.peek_name(0),
NetNet::IMPLICIT, pc->expr_width());
- NetConst*cp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*cp = new NetConst(scope, scope->local_symbol(),
pvalue);
des->add_node(cp);
for (unsigned idx = 0; idx < sig->pin_count(); idx += 1)
@@ -1284,7 +1282,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
} else {
- sig = new NetNet(scope, scope->name()+"."+path_.peek_name(0),
+ sig = new NetNet(scope, path_.peek_name(0),
NetNet::IMPLICIT, 1);
if (error_implicit) {
@@ -1415,19 +1413,14 @@ NetNet* PEIdent::elaborate_net_ram_(Design*des, NetScope*scope,
if (adr == 0)
return 0;
- // Memory names are only the base names. Since NetObj names
- // are still fullnames, and we are deriving such names from
- // the memory name, make a fullname here.
- string hname = scope->name() + "." + mem->name();
-
- NetRamDq*ram = new NetRamDq(scope, des->local_symbol(hname),
+ NetRamDq*ram = new NetRamDq(scope, scope->local_symbol(),
mem, adr->pin_count());
des->add_node(ram);
for (unsigned idx = 0 ; idx < adr->pin_count() ; idx += 1)
connect(ram->pin_Address(idx), adr->pin(idx));
- NetNet*osig = new NetNet(scope, des->local_symbol(hname),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, ram->width());
osig->local_flag(true);
@@ -1488,7 +1481,7 @@ NetNet* PEConcat::elaborate_lnet(Design*des, NetScope*scope,
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(scope->name()),
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, pins);
pins = 0;
for (unsigned idx = nets.count() ; idx > 0 ; idx -= 1) {
@@ -1522,7 +1515,7 @@ NetNet* PEIdent::elaborate_lnet(Design*des, NetScope*scope,
if (implicit_net_ok && !error_implicit) {
- sig = new NetNet(scope, scope->name()+"."+path_.peek_name(0),
+ sig = new NetNet(scope, path_.peek_name(0),
NetNet::IMPLICIT, 1);
if (warn_implicit) {
@@ -1746,7 +1739,7 @@ NetNet* PENumber::elaborate_net(Design*des, NetScope*scope,
number constant with the correct size and set as many bits
in that constant as make sense. Pad excess with zeros. */
if (lwidth > 0) {
- NetNet*net = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth);
net->local_flag(true);
@@ -1768,7 +1761,7 @@ NetNet* PENumber::elaborate_net(Design*des, NetScope*scope,
for (idx = 0 ; idx < num.len() && idx < value_->len(); idx += 1)
num.set(idx, value_->get(idx));
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(),
num);
for (idx = 0 ; idx < net->pin_count() ; idx += 1) {
tmp->pin(idx).drive0(drive0);
@@ -1784,10 +1777,10 @@ NetNet* PENumber::elaborate_net(Design*des, NetScope*scope,
number. Generate a constant object of exactly the user
specified size. */
if (value_->has_len()) {
- NetNet*net = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, value_->len());
net->local_flag(true);
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(),
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(),
*value_);
for (unsigned idx = 0 ; idx < value_->len() ; idx += 1)
connect(net->pin(idx), tmp->pin(idx));
@@ -1821,10 +1814,10 @@ NetNet* PENumber::elaborate_net(Design*des, NetScope*scope,
for (unsigned idx = 0 ; idx < width ; idx += 1)
num.set(idx, value_->get(idx));
- NetNet*net = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, width);
net->local_flag(true);
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), num);
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(), num);
for (unsigned idx = 0 ; idx < width ; idx += 1)
connect(net->pin(idx), tmp->pin(idx));
@@ -1852,11 +1845,11 @@ NetNet* PEString::elaborate_net(Design*des, NetScope*scope,
number constant with the correct size and set as many bits
in that constant as make sense. Pad excess with zeros. */
if (lwidth > 0) {
- net = new NetNet(scope, scope->local_hsymbol(),
+ net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth);
} else {
- net = new NetNet(scope, scope->local_hsymbol(),
+ net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, strbits);
}
net->local_flag(true);
@@ -1871,7 +1864,7 @@ NetNet* PEString::elaborate_net(Design*des, NetScope*scope,
num.set(idx, (byte & mask)? verinum::V1 : verinum::V0);
}
- NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), num);
+ NetConst*tmp = new NetConst(scope, scope->local_symbol(), num);
for (idx = 0 ; idx < net->pin_count() ; idx += 1) {
tmp->pin(idx).drive0(drive0);
tmp->pin(idx).drive1(drive1);
@@ -1931,13 +1924,13 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
by connecting an OR gate to calculate the truth value of
the result. In the end, the result needs to be a single bit. */
if (expr_sig->pin_count() > 1) {
- NetLogic*log = new NetLogic(scope, scope->local_hsymbol(),
+ NetLogic*log = new NetLogic(scope, scope->local_symbol(),
expr_sig->pin_count()+1,
NetLogic::OR);
for (unsigned idx = 0; idx < expr_sig->pin_count(); idx += 1)
connect(log->pin(idx+1), expr_sig->pin(idx));
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1);
tmp->local_flag(true);
connect(tmp->pin(0), log->pin(0));
@@ -1958,7 +1951,7 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
unsigned dwidth = (iwidth > width)? width : iwidth;
- NetNet*sig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, width);
sig->local_flag(true);
@@ -1989,11 +1982,11 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
devices to carry the propagation delays. Otherwise, just
connect the result to the output. */
if (rise || fall || decay) {
- NetNet*tmp = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, dwidth);
for (unsigned idx = 0 ; idx < dwidth ; idx += 1) {
- NetBUFZ*tmpz = new NetBUFZ(scope, scope->local_hsymbol());
+ NetBUFZ*tmpz = new NetBUFZ(scope, scope->local_symbol());
tmpz->rise_time(rise);
tmpz->fall_time(fall);
tmpz->decay_time(decay);
@@ -2018,7 +2011,7 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
if (dwidth < width) {
verinum vpad (verinum::V0, width-dwidth);
- NetConst*pad = new NetConst(scope, scope->local_hsymbol(), vpad);
+ NetConst*pad = new NetConst(scope, scope->local_symbol(), vpad);
des->add_node(pad);
for (unsigned idx = dwidth ; idx < width ; idx += 1)
connect(sig->pin(idx), pad->pin(idx-dwidth));
@@ -2063,7 +2056,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
width = val->len();
assert(width > 0);
- sig = new NetNet(scope, scope->local_hsymbol(),
+ sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, width);
sig->local_flag(true);
@@ -2072,7 +2065,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
verinum tmp (v_not(*val));
verinum one (1UL, width);
tmp = tmp + one;
- NetConst*con = new NetConst(scope, scope->local_hsymbol(), tmp);
+ NetConst*con = new NetConst(scope, scope->local_symbol(), tmp);
for (unsigned idx = 0 ; idx < width ; idx += 1)
connect(sig->pin(idx), con->pin(idx));
@@ -2089,11 +2082,11 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
switch (op_) {
case '~': // Bitwise NOT
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE,
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE,
sub_sig->pin_count());
sig->local_flag(true);
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) {
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
2, NetLogic::NOT);
connect(gate->pin(1), sub_sig->pin(idx));
connect(gate->pin(0), sig->pin(idx));
@@ -2106,9 +2099,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
case 'N': // Reduction NOR
case '!': // Reduction NOT
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
sig->local_flag(true);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+sub_sig->pin_count(), NetLogic::NOR);
connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@@ -2121,9 +2114,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case '&': // Reduction AND
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
sig->local_flag(true);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+sub_sig->pin_count(), NetLogic::AND);
connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@@ -2136,9 +2129,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case '|': // Reduction OR
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
sig->local_flag(true);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+sub_sig->pin_count(), NetLogic::OR);
connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@@ -2151,9 +2144,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case '^': // Reduction XOR
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
sig->local_flag(true);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+sub_sig->pin_count(), NetLogic::XOR);
connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@@ -2166,9 +2159,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case 'A': // Reduction NAND (~&)
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
sig->local_flag(true);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+sub_sig->pin_count(), NetLogic::NAND);
connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@@ -2182,9 +2175,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
case 'X': // Reduction XNOR (~^)
- sig = new NetNet(scope, scope->local_hsymbol(), NetNet::WIRE);
+ sig = new NetNet(scope, scope->local_symbol(), NetNet::WIRE);
sig->local_flag(true);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
1+sub_sig->pin_count(), NetLogic::XNOR);
connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@@ -2197,7 +2190,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case '-': // Unary 2's complement.
- sig = new NetNet(scope, scope->local_hsymbol(),
+ sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, owidth);
sig->local_flag(true);
@@ -2210,7 +2203,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case 1:
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
2, NetLogic::BUF);
connect(gate->pin(0), sig->pin(0));
connect(gate->pin(1), sub_sig->pin(0));
@@ -2221,7 +2214,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break;
case 2:
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
2, NetLogic::BUF);
connect(gate->pin(0), sig->pin(0));
connect(gate->pin(1), sub_sig->pin(0));
@@ -2230,7 +2223,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
gate->fall_time(fall);
gate->decay_time(decay);
- gate = new NetLogic(scope, scope->local_hsymbol(),
+ gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XOR);
connect(gate->pin(0), sig->pin(1));
connect(gate->pin(1), sub_sig->pin(0));
@@ -2256,11 +2249,11 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
verinum tmp_num (verinum::V0, sub->width(), true);
NetConst*tmp_con = new NetConst(scope,
- scope->local_hsymbol(),
+ scope->local_symbol(),
tmp_num);
des->add_node(tmp_con);
- NetNet*tmp_sig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*tmp_sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE,
sub_sig->pin_count());
tmp_sig->local_flag(true);
@@ -2284,6 +2277,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
/*
* $Log: elab_net.cc,v $
+ * Revision 1.108 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.107 2003/02/26 01:29:24 steve
* LPM objects store only their base names.
*
View
12 elab_scope.cc
@@ -17,11 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: elab_scope.cc,v 1.19 2003/01/27 05:09:17 steve Exp $"
+#ident "$Id: elab_scope.cc,v 1.20 2003/03/06 00:28:41 steve Exp $"
#endif
-# include "config.h"
-
+# include "config.h"
+# include "compiler.h"
# include <iostream>
/*
@@ -352,7 +352,8 @@ void PGModule::elaborate_scope_mod_(Design*des, Module*mod, NetScope*sc) const
void PData::elaborate_scope(Design*des, NetScope*scope) const
{
assert(hname_.component_count() == 1);
- NetVariable*tmp = new NetVariable(hname_.peek_tail_name());
+ const char*basename = hname_.peek_tail_name();
+ NetVariable*tmp = new NetVariable(lex_strings.add(basename));
tmp->set_line(*this);
scope->add_variable(tmp);
}
@@ -512,6 +513,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
/*
* $Log: elab_scope.cc,v $
+ * Revision 1.20 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.19 2003/01/27 05:09:17 steve
* Spelling fixes.
*
View
10 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.27 2003/01/30 16:23:07 steve Exp $"
+#ident "$Id: elab_sig.cc,v 1.28 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -508,10 +508,7 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
} else {
- /* Make a hierarchical make for the signal. */
- string name = scope->name();
- name = name + "." + hname_.peek_tail_name();
-
+ string name = hname_.peek_tail_name();
NetNet*sig = new NetNet(scope, name, wtype, msb, lsb);
sig->set_line(*this);
sig->port_type(port_type_);
@@ -525,6 +522,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
/*
* $Log: elab_sig.cc,v $
+ * Revision 1.28 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.27 2003/01/30 16:23:07 steve
* Spelling fixes.
*
View
39 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.275 2003/03/01 06:25:30 steve Exp $"
+#ident "$Id: elaborate.cc,v 1.276 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -167,7 +167,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
if (cnt < lval->pin_count()) {
verinum tmpv (0UL, lval->pin_count()-cnt);
NetConst*tmp = new NetConst(scope,
- scope->local_hsymbol(),
+ scope->local_symbol(),
tmpv);
des->add_node(tmp);
for (idx = cnt ; idx < lval->pin_count() ; idx += 1)
@@ -180,7 +180,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
unsigned idx;
for (idx = 0 ; idx < cnt ; idx += 1) {
NetBUFZ*dev = new NetBUFZ(scope,
- scope->local_hsymbol());
+ scope->local_symbol());
connect(lval->pin(idx), dev->pin(0));
connect(rid->pin(idx), dev->pin(1));
dev->rise_time(rise_time);
@@ -193,7 +193,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
if (cnt < lval->pin_count()) {
NetConst*dev = new NetConst(scope,
- scope->local_hsymbol(),
+ scope->local_symbol(),
verinum::V0);
des->add_node(dev);
@@ -250,9 +250,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
string name = get_name();
if (name == "")
- name = scope->local_hsymbol();
- else
- name = scope->name()+"."+name;
+ name = scope->local_symbol();
/* If the Verilog source has a range specification for the
gates, then I am expected to make more then one
@@ -745,9 +743,7 @@ void PGModule::elaborate_udp_(Design*des, PUdp*udp, NetScope*scope) const
string my_name = get_name();
if (my_name == "")
- my_name = scope->local_hsymbol();
- else
- my_name = scope->name()+"."+my_name;
+ my_name = scope->local_symbol();
/* When the parser notices delay expressions in front of a
module or primitive, it interprets them as parameter
@@ -1006,7 +1002,6 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
netlist. The compound statement is exactly equivalent. */
if (delay || event_) {
- string n = scope->local_hsymbol();
unsigned wid = lv->lwidth();
rv->set_width(wid);
@@ -1020,13 +1015,14 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
return 0;
}
- NetNet*tmp = new NetNet(scope, n, NetNet::REG, wid);
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
+ NetNet::REG, wid);
tmp->set_line(*this);
NetESignal*sig = new NetESignal(tmp);
/* Generate an assignment of the l-value to the temporary... */
- n = scope->local_hsymbol();
+ string n = scope->local_hsymbol();
NetAssign_*lvt = new NetAssign_(tmp);
NetAssign*a1 = new NetAssign(lvt, rv);
@@ -1588,7 +1584,7 @@ NetCAssign* PCAssign::elaborate(Design*des, NetScope*scope) const
if (rval->pin_count() < lval->pin_count())
rval = pad_to_width(des, rval, lval->pin_count());
- NetCAssign* dev = new NetCAssign(scope, scope->local_hsymbol(), lval);
+ NetCAssign* dev = new NetCAssign(scope, scope->local_symbol(), lval);
dev->set_line(*this);
des->add_node(dev);
@@ -1813,7 +1809,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
we->add_event(ev);
NetEvProbe*po = new NetEvProbe(scope,
- scope->local_hsymbol(),
+ scope->local_symbol(),
ev, NetEvProbe::POSEDGE, 1);
connect(po->pin(0), ex->pin(0));
@@ -1893,7 +1889,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
return enet;
}
- NetEvProbe*pr = new NetEvProbe(scope, scope->local_hsymbol(),
+ NetEvProbe*pr = new NetEvProbe(scope, scope->local_symbol(),
ev, NetEvProbe::ANYEDGE,
nset->count());
for (unsigned idx = 0 ; idx < nset->count() ; idx += 1)
@@ -1943,17 +1939,17 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
NetEvProbe*pr;
switch (expr_[idx]->type()) {
case PEEvent::POSEDGE:
- pr = new NetEvProbe(scope, scope->local_hsymbol(), ev,
+ pr = new NetEvProbe(scope, scope->local_symbol(), ev,
NetEvProbe::POSEDGE, pins);
break;
case PEEvent::NEGEDGE:
- pr = new NetEvProbe(scope, scope->local_hsymbol(), ev,
+ pr = new NetEvProbe(scope, scope->local_symbol(), ev,
NetEvProbe::NEGEDGE, pins);
break;
case PEEvent::ANYEDGE:
- pr = new NetEvProbe(scope, scope->local_hsymbol(), ev,
+ pr = new NetEvProbe(scope, scope->local_symbol(), ev,
NetEvProbe::ANYEDGE, pins);
break;
@@ -2029,7 +2025,7 @@ NetProc* PForce::elaborate(Design*des, NetScope*scope) const
if (rval->pin_count() < lval->pin_count())
rval = pad_to_width(des, rval, lval->pin_count());
- NetForce* dev = new NetForce(scope, scope->local_hsymbol(), lval);
+ NetForce* dev = new NetForce(scope, scope->local_symbol(), lval);
des->add_node(dev);
for (unsigned idx = 0 ; idx < dev->pin_count() ; idx += 1)
@@ -2502,6 +2498,9 @@ Design* elaborate(list<const char*>roots)
/*
* $Log: elaborate.cc,v $
+ * Revision 1.276 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.275 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
View
77 expr_synth.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: expr_synth.cc,v 1.40 2003/02/26 01:29:24 steve Exp $"
+#ident "$Id: expr_synth.cc,v 1.41 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -48,7 +48,7 @@ NetNet* NetEBAdd::synthesize(Design*des)
assert(lsig->pin_count() == rsig->pin_count());
unsigned width=lsig->pin_count();
- string path = lsig->scope()->name()+"."+lsig->scope()->local_symbol();
+ string path = lsig->scope()->local_symbol();
NetNet*osig = new NetNet(lsig->scope(), path, NetNet::IMPLICIT, width);
osig->local_flag(true);
@@ -100,12 +100,12 @@ NetNet* NetEBBits::synthesize(Design*des)
}
assert(lsig->pin_count() == rsig->pin_count());
- NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT,
- lsig->pin_count());
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
+ NetNet::IMPLICIT, lsig->pin_count());
osig->local_flag(true);
for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) {
- string oname = des->local_symbol(path);
+ string oname = scope->local_hsymbol();
NetLogic*gate;
/* If the rsig bit is constant, then look for special
@@ -175,21 +175,21 @@ NetNet* NetEBComp::synthesize(Design*des)
: right_->synthesize(des);
NetScope*scope = lsig->scope();
assert(scope);
- string path = des->local_symbol(scope->name());
- NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, 1);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
+ NetNet::IMPLICIT, 1);
osig->local_flag(true);
NetLogic*gate;
switch (op_) {
case 'e':
case 'E':
- gate = new NetLogic(scope, des->local_symbol(path),
+ gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::NOR);
break;
case 'n':
case 'N':
- gate = new NetLogic(scope, des->local_symbol(path),
+ gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::OR);
break;
@@ -198,11 +198,11 @@ NetNet* NetEBComp::synthesize(Design*des)
is very much like sig != 0. (0 > sig) shouldn't
happen. */
if (rcon) {
- gate = new NetLogic(scope, des->local_symbol(path),
+ gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::OR);
} else {
assert(0);
- gate = new NetLogic(scope, des->local_symbol(path),
+ gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::NOR);
}
break;
@@ -210,11 +210,11 @@ NetNet* NetEBComp::synthesize(Design*des)
case '<':
/* 0 < sig is handled like sig > 0. */
if (! rcon) {
- gate = new NetLogic(scope, des->local_symbol(path),
+ gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::OR);
} else {
assert(0);
- gate = new NetLogic(scope, des->local_symbol(path),
+ gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::NOR);
}
break;
@@ -236,7 +236,6 @@ NetNet* NetEBComp::synthesize(Design*des)
NetScope*scope = lsig->scope();
assert(scope);
- string path = des->local_symbol(scope->name());
unsigned width = lsig->pin_count();
if (rsig->pin_count() > lsig->pin_count())
@@ -245,13 +244,14 @@ NetNet* NetEBComp::synthesize(Design*des)
lsig = pad_to_width(des, lsig, width);
rsig = pad_to_width(des, rsig, width);
- NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, 1);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
+ NetNet::IMPLICIT, 1);
osig->local_flag(true);
/* Handle the special case of a single bit equality
operation. Make an XNOR gate instead of a comparator. */
if ((width == 1) && ((op_ == 'e') || (op_ == 'E'))) {
- NetLogic*gate = new NetLogic(scope, des->local_symbol(path),
+ NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
3, NetLogic::XNOR);
connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->pin(0));
@@ -264,7 +264,7 @@ NetNet* NetEBComp::synthesize(Design*des)
operation. This is similar to single bit equality, but uses
an XOR instead of an XNOR gate. */
if ((width == 1) && ((op_ == 'n') || (op_ == 'N'))) {
- NetLogic*gate = new NetLogic(scope, des->local_symbol(path),
+ NetLogic*gate = new NetLogic(scope, scope->local_hsymbol(),
3, NetLogic::XOR);
connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->pin(0));
@@ -274,7 +274,7 @@ NetNet* NetEBComp::synthesize(Design*des)
}
- NetCompare*dev = new NetCompare(scope, des->local_symbol(path), width);
+ NetCompare*dev = new NetCompare(scope, scope->local_symbol(), width);
des->add_node(dev);
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1)
@@ -337,9 +337,9 @@ NetNet* NetEBLogic::synthesize(Design*des)
NetScope*scope = lsig->scope();
assert(scope);
- string path = des->local_symbol(scope->name());
- NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, 1);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
+ NetNet::IMPLICIT, 1);
osig->local_flag(true);
@@ -349,12 +349,11 @@ NetNet* NetEBLogic::synthesize(Design*des)
comparison with a single wide OR gate. So handle this
magically. */
- string oname = des->local_symbol(path);
- NetLogic*olog;
+ string oname = scope->local_hsymbol();
- olog = new NetLogic(scope, oname,
- lsig->pin_count()+rsig->pin_count()+1,
- NetLogic::OR);
+ NetLogic*olog = new NetLogic(scope, oname,
+ lsig->pin_count()+rsig->pin_count()+1,
+ NetLogic::OR);
connect(osig->pin(0), olog->pin(0));
@@ -374,7 +373,7 @@ NetNet* NetEBLogic::synthesize(Design*des)
/* Create the logic AND gate. This is a single bit
output, with inputs for each of the operands. */
NetLogic*olog;
- string oname = des->local_symbol(path);
+ string oname = scope->local_hsymbol();
olog = new NetLogic(scope, oname, 3, NetLogic::AND);
@@ -411,7 +410,7 @@ NetNet* NetEConcat::synthesize(Design*des)
assert(scope);
/* Make a NetNet object to carry the output vector. */
- string path = scope->name() + "." + scope->local_symbol();
+ string path = scope->local_symbol();
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, expr_width());
osig->local_flag(true);
@@ -439,12 +438,12 @@ NetNet* NetEConst::synthesize(Design*des)
NetScope*scope = des->find_root_scope();
assert(scope);
- string path = scope->name() + "." + scope->local_symbol();
+ string path = scope->local_symbol();
unsigned width=expr_width();
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, width);
osig->local_flag(true);
- NetConst*con = new NetConst(scope, des->local_symbol(path), value());
+ NetConst*con = new NetConst(scope, scope->local_symbol(), value());
for (unsigned idx = 0 ; idx < width; idx += 1)
connect(osig->pin(idx), con->pin(idx));
@@ -470,14 +469,13 @@ NetNet* NetEUBits::synthesize(Design*des)
NetScope*scope = isig->scope();
assert(scope);
- string path = des->local_symbol(scope->name());
- NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT,
- isig->pin_count());
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
+ NetNet::IMPLICIT, isig->pin_count());
osig->local_flag(true);
for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) {
- string oname = des->local_symbol(path);
+ string oname = scope->local_hsymbol();
NetLogic*gate;
switch (op()) {
@@ -503,12 +501,12 @@ NetNet* NetEUReduce::synthesize(Design*des)
NetScope*scope = isig->scope();
assert(scope);
- string path = des->local_symbol(scope->name());
- NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, 1);
+ NetNet*osig = new NetNet(scope, scope->local_symbol(),
+ NetNet::IMPLICIT, 1);
osig->local_flag(true);
- string oname = des->local_symbol(path);
+ string oname = scope->local_hsymbol();
NetLogic*gate;
switch (op()) {
@@ -569,7 +567,7 @@ NetNet* NetETernary::synthesize(Design *des)
NetNet*tsig = true_val_->synthesize(des);
NetNet*fsig = false_val_->synthesize(des);
- string path = csig->scope()->name()+"."+csig->scope()->local_symbol();
+ string path = csig->scope()->local_symbol();
assert(csig->pin_count() == 1);
assert(tsig->pin_count() == fsig->pin_count());
@@ -631,7 +629,7 @@ NetNet* NetESignal::synthesize(Design*des)
NetScope*scope = net_->scope();
assert(scope);
- string name = scope->name() + "." + scope->local_symbol();
+ string name = scope->local_symbol();
NetNet*tmp = new NetNet(scope, name, NetNet::NetNet::WIRE, wid);
tmp->local_flag(true);
@@ -643,6 +641,9 @@ NetNet* NetESignal::synthesize(Design*des)
/*
* $Log: expr_synth.cc,v $
+ * Revision 1.41 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.40 2003/02/26 01:29:24 steve
* LPM objects store only their base names.
*
View
7 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.112 2003/02/26 01:29:24 steve Exp $"
+#ident "$Id: ivl_target.h,v 1.113 2003/03/06 00:28:41 steve Exp $"
#endif
#ifdef __cplusplus
@@ -523,7 +523,7 @@ extern ivl_memory_t ivl_expr_memory(ivl_expr_t net);
* This method returns the type of logic gate that the cookie
* represents.
*
- * ivl_logic_name
+ * ivl_logic_name (obsolete)
* This method returns the complete name of the logic gate. Every
* gate has a complete name (that includes the scope) even if the
* Verilog source doesn't include one. The compiler will choose one
@@ -1144,6 +1144,9 @@ _END_DECL
/*
* $Log: ivl_target.h,v $
+ * Revision 1.113 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.112 2003/02/26 01:29:24 steve
* LPM objects store only their base names.
*
View
12 net_event.cc
@@ -17,12 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: net_event.cc,v 1.21 2003/03/01 06:25:30 steve Exp $"
+#ident "$Id: net_event.cc,v 1.22 2003/03/06 00:28:41 steve Exp $"
#endif
-# include "config.h"
-# include "compiler.h"
-
+# include "config.h"
+# include "compiler.h"
# include "netlist.h"
/*
@@ -242,7 +241,7 @@ const NetEvent* NetEvTrig::event() const
NetEvProbe::NetEvProbe(NetScope*s, const string&n, NetEvent*tgt,
edge_t t, unsigned p)
-: NetNode(s, n, p), event_(tgt), edge_(t)
+: NetNode(s, lex_strings.add(n.c_str()), p), event_(tgt), edge_(t)
{
for (unsigned idx = 0 ; idx < p ; idx += 1) {
pin(idx).set_dir(Link::INPUT);
@@ -444,6 +443,9 @@ NetProc* NetEvWait::statement()
/*
* $Log: net_event.cc,v $
+ * Revision 1.22 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.21 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
View
12 net_force.cc
@@ -17,10 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: net_force.cc,v 1.10 2003/01/27 05:09:17 steve Exp $"
+#ident "$Id: net_force.cc,v 1.11 2003/03/06 00:28:41 steve Exp $"
#endif
-# include "config.h"
+# include "config.h"
+# include "compiler.h"
/*
* This file contains implementation of the NetForce, NetRelease,
@@ -45,7 +46,7 @@
* link ring to grow, and that is not quite correct either. Hmm...
*/
NetCAssign::NetCAssign(NetScope*s, const string&n, NetNet*l)
-: NetNode(s, n, l->pin_count()), lval_(l)
+: NetNode(s, lex_strings.add(n.c_str()), l->pin_count()), lval_(l)
{
lval_->incr_eref();
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
@@ -87,7 +88,7 @@ const NetNet*NetDeassign::lval() const
}
NetForce::NetForce(NetScope*s, const string&n, NetNet*l)
-: NetNode(s, n, l->pin_count()), lval_(l)
+: NetNode(s, lex_strings.add(n.c_str()), l->pin_count()), lval_(l)
{
lval_->incr_eref();
@@ -136,6 +137,9 @@ const NetNet*NetRelease::lval() const
/*
* $Log: net_force.cc,v $
+ * Revision 1.11 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.10 2003/01/27 05:09:17 steve
* Spelling fixes.
*
View
9 net_func.cc
@@ -17,11 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: net_func.cc,v 1.3 2002/08/12 01:34:59 steve Exp $"
+#ident "$Id: net_func.cc,v 1.4 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
# include "netlist.h"
+# include "compiler.h"
# include "PExpr.h"
# include <iostream>
@@ -35,7 +36,8 @@ static unsigned count_def_pins(const NetFuncDef*def)
}
NetUserFunc::NetUserFunc(NetScope*s, const char*n, NetScope*d)
-: NetNode(s, n, count_def_pins(d->func_def())), def_(d)
+: NetNode(s, lex_strings.add(n), count_def_pins(d->func_def())),
+ def_(d)
{
NetFuncDef*def = def_->func_def();
@@ -145,6 +147,9 @@ bool PECallFunction::check_call_matches_definition_(Design*des, NetScope*dscope)
/*
* $Log: net_func.cc,v $
+ * Revision 1.4 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.3 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
View
9 net_modulo.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: net_modulo.cc,v 1.5 2002/08/12 01:34:59 steve Exp $"
+#ident "$Id: net_modulo.cc,v 1.6 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -28,11 +28,13 @@
# include <cassert>
# include "netlist.h"
+# include "compiler.h"
NetModulo::NetModulo(NetScope*s, const string&n, unsigned wr,
unsigned wa, unsigned wb)
-: NetNode(s, n, wr+wa+wb), width_r_(wr), width_a_(wa), width_b_(wb)
+: NetNode(s, lex_strings.add(n.c_str()), wr+wa+wb),
+ width_r_(wr), width_a_(wa), width_b_(wb)
{
unsigned p = 0;
for (unsigned idx = 0 ; idx < width_r_ ; idx += 1, p += 1) {
@@ -106,6 +108,9 @@ const Link& NetModulo::pin_DataB(unsigned idx) const
/*
* $Log: net_modulo.cc,v $
+ * Revision 1.6 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.5 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
View
8 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.25 2003/03/01 06:25:30 steve Exp $"
+#ident "$Id: net_scope.cc,v 1.26 2003/03/06 00:28:41 steve Exp $"
#endif
# include "config.h"
@@ -311,10 +311,9 @@ NetNet* NetScope::find_signal(const string&key)
if (signals_ == 0)
return 0;
- string fulname = name()+"."+key;
NetNet*cur = signals_;
do {
- if (cur->name() == fulname)
+ if (cur->name() == key)
return cur;
cur = cur->sig_prev_;
} while (cur != signals_);
@@ -449,6 +448,9 @@ string NetScope::local_hsymbol()
/*
* $Log: net_scope.cc,v $
+ * Revision 1.26 2003/03/06 00:28:41 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.25 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
View
10 net_udp.cc
@@ -18,15 +18,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: net_udp.cc,v 1.7 2002/08/12 01:34:59 steve Exp $"
+#ident "$Id: net_udp.cc,v 1.8 2003/03/06 00:28:42 steve Exp $"
#endif
-# include "config.h"
+# include "config.h"
+# include "compiler.h"
# include "netlist.h"
NetUDP::NetUDP(NetScope*s, const string&n, unsigned pins, PUdp *u)
- : NetNode(s, n, pins), udp(u)
+ : NetNode(s, lex_strings.add(n.c_str()), pins), udp(u)
{
pin(0).set_dir(Link::OUTPUT);
pin(0).set_name("O", 0);
@@ -91,6 +92,9 @@ char NetUDP::get_initial() const
/*
* $Log: net_udp.cc,v $
+ * Revision 1.8 2003/03/06 00:28:42 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.7 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig.
*
View
8 net_variable.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: net_variable.cc,v 1.1 2003/01/28 16:23:27 steve Exp $"
+#ident "$Id: net_variable.cc,v 1.2 2003/03/06 00:28:42 steve Exp $"
#endif
# include "config.h"
@@ -25,14 +25,13 @@
NetVariable::NetVariable(const char*name)
{
- name_ = strdup(name);
+ name_ = name;
scope_ = 0;
snext_ = 0;
}
NetVariable::~NetVariable()
{
- free(name_);
}
const char*NetVariable::basename() const
@@ -71,6 +70,9 @@ const NetVariable* NetEVariable::variable() const
/*
* $Log: net_variable.cc,v $
+ * 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
69 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.206 2003/03/01 06:25:30 steve Exp $"
+#ident "$Id: netlist.cc,v 1.207 2003/03/06 00:28:42 steve Exp $"
#endif
# include "config.h"
@@ -165,25 +165,9 @@ Link* find_next_output(Link*lnk)
return 0;
}
-NetObj::NetObj(NetScope*s, const string&n, unsigned np)
-: scope_(s), npins_(np), delay1_(0), delay2_(0), delay3_(0)
-{
- name_ = new char[n.length()+1];
- strcpy(name_, n.c_str());
-
- pins_ = new Link[npins_];
- for (unsigned idx = 0 ; idx < npins_ ; idx += 1) {
- pins_[idx].node_ = this;
- pins_[idx].pin_ = idx;
- }
-}
-
NetObj::NetObj(NetScope*s, const char*n, unsigned np)
-: scope_(s), npins_(np), delay1_(0), delay2_(0), delay3_(0)
+: scope_(s), name_(n), npins_(np), delay1_(0), delay2_(0), delay3_(0)
{
- name_ = new char[strlen(n)+1];
- strcpy(name_, n);
-
pins_ = new Link[npins_];
for (unsigned idx = 0 ; idx < npins_ ; idx += 1) {
pins_[idx].node_ = this;
@@ -193,7 +177,6 @@ NetObj::NetObj(NetScope*s, const char*n, unsigned np)
NetObj::~NetObj()
{
- delete[]name_;
delete[]pins_;
}
@@ -219,11 +202,6 @@ const Link& NetObj::pin(unsigned idx) const
return pins_[idx];
}
-NetNode::NetNode(NetScope*s, const string&n, unsigned npins)
-: NetObj(s, n, npins), node_next_(0), node_prev_(0), design_(0)
-{
-}
-
NetNode::NetNode(NetScope*s, const char*n, unsigned npins)
: NetObj(s, n, npins), node_next_(0), node_prev_(0), design_(0)
{
@@ -236,7 +214,7 @@ NetNode::~NetNode()
}
NetNet::NetNet(NetScope*s, const string&n, Type t, unsigned npins)
-: NetObj(s, n, npins), sig_next_(0), sig_prev_(0),
+: NetObj(s, lex_strings.add(n.c_str()), npins), sig_next_(0), sig_prev_(0),
type_(t), port_type_(NOT_A_PORT), signed_(false), msb_(npins-1), lsb_(0),
local_flag_(false), eref_count_(0), lref_count_(0)
{
@@ -275,8 +253,8 @@ NetNet::NetNet(NetScope*s, const string&n, Type t, unsigned npins)
}
NetNet::NetNet(NetScope*s, const string&n, Type t, long ms, long ls)
-: NetObj(s, n, ((ms>ls)?ms-ls:ls-ms) + 1), sig_next_(0),
- sig_prev_(0), type_(t),
+: NetObj(s, lex_strings.add(n.c_str()), ((ms>ls)?ms-ls:ls-ms) + 1),
+ sig_next_(0), sig_prev_(0), type_(t),
port_type_(NOT_A_PORT), signed_(false), msb_(ms), lsb_(ls),
local_flag_(false), eref_count_(0), lref_count_(0)
{
@@ -464,7 +442,7 @@ unsigned NetNet::get_refs() const
NetSubnet::NetSubnet(NetNet*sig, unsigned off, unsigned wid)
-: NetNet(sig->scope(), sig->scope()->local_hsymbol(), sig->type(), wid)
+: NetNet(sig->scope(), sig->scope()->local_symbol(), sig->type(), wid)
{
for (unsigned idx = 0 ; idx < wid ; idx += 1)
connect(sig->pin(idx+off), pin(idx));
@@ -529,7 +507,7 @@ const NetScope* NetProcTop::scope() const
*/
NetFF::NetFF(NetScope*s, const char*n, unsigned wid)
-: NetNode(s, n, 8 + 2*wid)
+: NetNode(s, lex_strings.add(n), 8 + 2*wid)
{
pin_Clock().set_dir(Link::INPUT);
pin_Clock().set_name("Clock", 0);
@@ -677,7 +655,7 @@ const verinum& NetFF::aset_value() const
* 8 -- Result[0]
*/
NetAddSub::NetAddSub(NetScope*s, const string&n, unsigned w)
-: NetNode(s, n, w*3+6)
+: NetNode(s, lex_strings.add(n.c_str()), w*3+6)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("Add_Sub", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("Aclr", 0);
@@ -767,7 +745,8 @@ const Link& NetAddSub::pin_Result(unsigned idx) const
*/
NetCLShift::NetCLShift(NetScope*s, const string&n,
unsigned width, unsigned width_dist)
-: NetNode(s, n, 3+2*width+width_dist), width_(width), width_dist_(width_dist)
+: NetNode(s, lex_strings.add(n.c_str()), 3+2*width+width_dist),
+ width_(width), width_dist_(width_dist)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("Direction", 0);
pin(1).set_dir(Link::OUTPUT); pin(1).set_name("Underflow", 0);
@@ -868,7 +847,7 @@ const Link& NetCLShift::pin_Distance(unsigned idx) const
}
NetCompare::NetCompare(NetScope*s, const string&n, unsigned wi)
-: NetNode(s, n, 8+2*wi), width_(wi)
+: NetNode(s, lex_strings.add(n.c_str()), 8+2*wi), width_(wi)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("Aclr");
pin(1).set_dir(Link::INPUT); pin(1).set_name("Clock");
@@ -997,7 +976,8 @@ const Link& NetCompare::pin_DataB(unsigned idx) const
NetDivide::NetDivide(NetScope*sc, const string&n, unsigned wr,
unsigned wa, unsigned wb)
-: NetNode(sc, n, wr+wa+wb), width_r_(wr), width_a_(wa), width_b_(wb)
+: NetNode(sc, lex_strings.add(n.c_str()), wr+wa+wb),
+ width_r_(wr), width_a_(wa), width_b_(wb)
{
unsigned p = 0;
for (unsigned idx = 0 ; idx < width_r_ ; idx += 1, p += 1) {
@@ -1071,8 +1051,8 @@ const Link& NetDivide::pin_DataB(unsigned idx) const
NetMult::NetMult(NetScope*sc, const string&n, unsigned wr,
unsigned wa, unsigned wb, unsigned ws)
-: NetNode(sc, n, 2+wr+wa+wb+ws), width_r_(wr), width_a_(wa), width_b_(wb),
- width_s_(ws)
+: NetNode(sc, lex_strings.add(n.c_str()), 2+wr+wa+wb+ws),
+ width_r_(wr), width_a_(wa), width_b_(wb), width_s_(ws)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("Aclr", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("Clock", 0);
@@ -1200,7 +1180,8 @@ const Link& NetMult::pin_Sum(unsigned idx) const
NetMux::NetMux(NetScope*s, const string&n,
unsigned wi, unsigned si, unsigned sw)
-: NetNode(s, n, 2+wi+sw+wi*si), width_(wi), size_(si), swidth_(sw)
+: NetNode(s, lex_strings.add(n.c_str()), 2+wi+sw+wi*si),
+ width_(wi), size_(si), swidth_(sw)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("Aclr", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("Clock", 0);
@@ -1300,7 +1281,8 @@ const Link& NetMux::pin_Data(unsigned w, unsigned s) const
NetRamDq::NetRamDq(NetScope*s, const string&n, NetMemory*mem, unsigned awid)
-: NetNode(s, n, 3+2*mem->width()+awid), mem_(mem), awidth_(awid)
+: NetNode(s, lex_strings.add(n.c_str()), 3+2*mem->width()+awid),
+ mem_(mem), awidth_(awid)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("InClock", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("OutClock", 0);
@@ -1504,7 +1486,7 @@ const Link& NetRamDq::pin_Q(unsigned idx) const
}
NetBUFZ::NetBUFZ(NetScope*s, const string&n)
-: NetNode(s, n, 2)
+: NetNode(s, lex_strings.add(n.c_str()), 2)
{
pin(0).set_dir(Link::OUTPUT);
pin(1).set_dir(Link::INPUT);
@@ -1518,7 +1500,7 @@ NetBUFZ::~NetBUFZ()
NetCaseCmp::NetCaseCmp(NetScope*s, const string&n)
-: NetNode(s, n, 3)
+: NetNode(s, lex_strings.add(n.c_str()), 3)
{
pin(0).set_dir(Link::OUTPUT); pin(0).set_name("O",0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("I",0);
@@ -1568,7 +1550,7 @@ NetProc* NetCondit::else_clause()
}
NetConst::NetConst(NetScope*s, const string&n, verinum::V v)
-: NetNode(s, n, 1)
+: NetNode(s, lex_strings.add(n.c_str()), 1)
{
pin(0).set_dir(Link::OUTPUT);
pin(0).set_name("O", 0);
@@ -1577,7 +1559,7 @@ NetConst::NetConst(NetScope*s, const string&n, verinum::V v)
}
NetConst::NetConst(NetScope*s, const string&n, const verinum&val)
-: NetNode(s, n, val.len())
+: NetNode(s, lex_strings.add(n.c_str()), val.len())
{
value_ = new verinum::V[pin_count()];
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
@@ -2147,7 +2129,7 @@ NetEUReduce::~NetEUReduce()
}
NetLogic::NetLogic(NetScope*s, const string&n, unsigned pins, TYPE t)
-: NetNode(s, n, pins), type_(t)
+: NetNode(s, lex_strings.add(n.c_str()), pins), type_(t)
{
pin(0).set_dir(Link::OUTPUT);
pin(0).set_name("O", 0);
@@ -2196,6 +2178,9 @@ const NetProc*NetTaskDef::proc() const
/*
* $Log: netlist.cc,v $
+ * Revision 1.207 2003/03/06 00:28:42 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.206 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put
* scope names and system task/function names
View
16 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.278 2003/03/03 02:22:41 steve Exp $"
+#ident "$Id: netlist.h,v 1.279 2003/03/06 00:28:42 steve Exp $"
#endif
/*
@@ -86,7 +86,8 @@ class NetObj : public Attrib {
public:
public:
- explicit NetObj(NetScope*s, const string&n, unsigned npins);
+ // The name of the object must be a a perallocated string. A
+ // lex_strings string, for example.
explicit NetObj(NetScope*s, const char*n, unsigned npins);
virtual ~NetObj();
@@ -113,7 +114,7 @@ class NetObj : public Attrib {
private:
NetScope*scope_;
- char* name_;
+ const char* name_;
Link*pins_;
const unsigned npins_;
unsigned delay1_;
@@ -321,7 +322,7 @@ class NexusSet {
class NetNode : public NetObj {
public:
- explicit NetNode(NetScope*s, const string&n, unsigned npins);
+ // The name paramter must be a permallocated string.
explicit NetNode(NetScope*s, const char*n, unsigned npins);
virtual ~NetNode();
@@ -2103,6 +2104,8 @@ class NetVariable : public LineInfo {
friend class NetScope;
public:
+ // The name must be a permallocated string. This class makes
+ // no attempt to preserve it.
NetVariable(const char* name);
~NetVariable();
@@ -2112,7 +2115,7 @@ class NetVariable : public LineInfo {
const NetScope* scope() const;
private:
- char* name_;
+ const char* name_;
NetScope*scope_;
NetVariable*snext_;
@@ -3204,6 +3207,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
+ * Revision 1.279 2003/03/06 00:28:42 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.278 2003/03/03 02:22:41 steve
* Scope names stored only as basename.
*
View
9 netmisc.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: netmisc.cc,v 1.5 2003/02/26 01:29:24 steve Exp $"
+#ident "$Id: netmisc.cc,v 1.6 2003/03/06 00:28:42 steve Exp $"
#endif
# include "config.h"
@@ -39,11 +39,11 @@ NetNet* add_to_net(Design*des, NetNet*sig, long val)
NetConst*val_c = new NetConst(scope, scope->local_hsymbol(), val_v);
- NetNet*val_s = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*val_s = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, width);
val_s->local_flag(true);
- NetNet*res = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*res = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, width);
res->local_flag(true);
@@ -90,6 +90,9 @@ NetExpr* elab_and_eval(Design*des, NetScope*scope, const PExpr*pe)
/*
* $Log: netmisc.cc,v $
+ * Revision 1.6 2003/03/06 00:28:42 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.5 2003/02/26 01:29:24 steve
* LPM objects store only their base names.
*
View
7 pad_to_width.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: pad_to_width.cc,v 1.13 2003/01/27 05:09:17 steve Exp $"
+#ident "$Id: pad_to_width.cc,v 1.14 2003/03/06 00:28:42 steve Exp $"
#endif
# include "config.h"
@@ -85,7 +85,7 @@ NetNet*pad_to_width(Design*des, NetNet*net, unsigned wid)
pad);
des->add_node(con);
- NetNet*tmp = new NetNet(scope, path + "." + scope->local_symbol(),
+ NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, wid);
tmp->local_flag(true);
@@ -99,6 +99,9 @@ NetNet*pad_to_width(Design*des, NetNet*net, unsigned wid)
/*
* $Log: pad_to_width.cc,v $
+ * Revision 1.14 2003/03/06 00:28:42 steve
+ * All NetObj objects have lex_string base names.
+ *
* Revision 1.13 2003/01/27 05:09:17 steve
* Spelling fixes.
*
View
17 synth2.cc
@@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#ifdef HAVE_CVS_IDENT
-#ident "$Id: synth2.cc,v 1.22 2003/02/26 01:29:24 steve Exp $"
+#ident "$Id: synth2.cc,v 1.23 2003/03/06 00:28:42 steve Exp $"
#endif
# include "config.h"
@@ -208,7 +208,7 @@ bool NetCase::synth_async(Design*des, NetScope*scope,
verinum gval = ge->value();
unsigned sel_idx = guard2sel[gval.as_ulong()];
- NetNet*sig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, nex_map->pin_count());
sig->local_flag(true);
items_[item].statement->synth_async(des, scope, nex_map, sig);
@@ -239,13 +239,13 @@ bool NetCondit::synth_async(Design*des, NetScope*scope,
assert(if_ != 0);
assert(else_ != 0);
- NetNet*asig = new NetNet(scope, scope->local_hsymbol(),
+ NetNet*asig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, nex_map->pin_count());
asig->local_flag(true);
if_->synth_async(des, scope, nex_map, asig);
- NetNet*bsig = new NetNet(scope, scope->local_hsymbol</