All NetObj objects have lex_string base names.

This commit is contained in:
steve 2003-03-06 00:28:41 +00:00
parent 26546c1bd8
commit badad63ab4
23 changed files with 345 additions and 326 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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -118,8 +118,8 @@ void cprop_functor::lpm_add_sub(Design*des, NetAddSub*obj)
NetLogic*tmp; NetLogic*tmp;
if (obj->pin_Cout().is_linked()) { if (obj->pin_Cout().is_linked()) {
tmp = new NetLogic(obj->scope(), tmp = new NetLogic(obj->scope(),
des->local_symbol(obj->name()), 3, obj->scope()->local_symbol(),
NetLogic::AND); 3, NetLogic::AND);
connect(tmp->pin(0), obj->pin_Cout()); connect(tmp->pin(0), obj->pin_Cout());
connect(tmp->pin(1), obj->pin_DataA(0)); connect(tmp->pin(1), obj->pin_DataA(0));
connect(tmp->pin(2), obj->pin_DataB(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(); NetScope*scope = obj->scope();
for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) { for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) {
NetLogic*tmp = new NetLogic(obj->scope(), NetLogic*tmp = new NetLogic(obj->scope(),
scope->local_hsymbol(), scope->local_symbol(),
3, NetLogic::BUFIF1); 3, NetLogic::BUFIF1);
connect(obj->pin_Result(idx), tmp->pin(0)); 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(); NetScope*scope = obj->scope();
for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) { for (unsigned idx = 0 ; idx < obj->width() ; idx += 1) {
NetLogic*tmp = new NetLogic(obj->scope(), NetLogic*tmp = new NetLogic(obj->scope(),
scope->local_hsymbol(), scope->local_symbol(),
3, NetLogic::BUFIF0); 3, NetLogic::BUFIF0);
connect(obj->pin_Result(idx), tmp->pin(0)); connect(obj->pin_Result(idx), tmp->pin(0));
@ -996,6 +996,9 @@ void cprop(Design*des)
/* /*
* $Log: cprop.cc,v $ * $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 * Revision 1.42 2003/02/26 01:29:24 steve
* LPM objects store only their base names. * LPM objects store only their base names.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # 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 Allow for a repeat count other then 1 by repeating the
connect loop as many times as necessary. */ 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); NetNet::IMPLICIT_REG, pins);
pins = 0; pins = 0;
@ -149,6 +149,9 @@ NetNet* PEIdent::elaborate_anet(Design*des, NetScope*scope) const
/* /*
* $Log: elab_anet.cc,v $ * $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 * Revision 1.6 2003/01/27 05:09:17 steve
* Spelling fixes. * Spelling fixes.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -180,7 +180,6 @@ NetNet* PEBinary::elaborate_net_add_(Design*des, NetScope*scope,
NetNode*gate; NetNode*gate;
NetNode*gate_t; NetNode*gate_t;
string name = scope->local_symbol();
unsigned width = lsig->pin_count(); unsigned width = lsig->pin_count();
if (rsig->pin_count() > lsig->pin_count()) if (rsig->pin_count() > lsig->pin_count())
width = rsig->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); rsig = pad_to_width(des, rsig, width);
// Make the adder as wide as the widest operand // 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); NetNet::WIRE, owidth);
osig->local_flag(true); 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. // Connect the adder to the various parts.
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) 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()); 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()); lsig->pin_count());
osig->local_flag(true); osig->local_flag(true);
switch (op_) { switch (op_) {
case '^': // XOR case '^': // XOR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) { 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); 3, NetLogic::XOR);
connect(gate->pin(1), lsig->pin(idx)); connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->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 case 'X': // XNOR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) { 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); 3, NetLogic::XNOR);
connect(gate->pin(1), lsig->pin(idx)); connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->pin(idx)); connect(gate->pin(2), rsig->pin(idx));
@ -330,7 +329,7 @@ NetNet* PEBinary::elaborate_net_bit_(Design*des, NetScope*scope,
case '&': // AND case '&': // AND
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) { 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); 3, NetLogic::AND);
connect(gate->pin(1), lsig->pin(idx)); connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->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 (~&) case 'A': // NAND (~&)
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) { 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); 3, NetLogic::NAND);
connect(gate->pin(1), lsig->pin(idx)); connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->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 case '|': // Bitwise OR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) { 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); 3, NetLogic::OR);
connect(gate->pin(1), lsig->pin(idx)); connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->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 case 'O': // Bitwise NOR
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) { 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); 3, NetLogic::NOR);
connect(gate->pin(1), lsig->pin(idx)); connect(gate->pin(1), lsig->pin(idx));
connect(gate->pin(2), rsig->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; NetNet*zero = 0;
if (lsig->pin_count() != rsig->pin_count()) { 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); verinum::V0);
des->add_node(tmp); 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); zero->local_flag(true);
connect(tmp->pin(0), zero->pin(0)); 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); osig->local_flag(true);
NetNode*gate; NetNode*gate;
@ -477,13 +476,13 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
// The comparison generates gates to bitwise compare // The comparison generates gates to bitwise compare
// each pair, and AND all the comparison results. // each pair, and AND all the comparison results.
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
1+dwidth, 1+dwidth,
(op_ == 'E')? NetLogic::AND : NetLogic::NAND); (op_ == 'E')? NetLogic::AND : NetLogic::NAND);
connect(gate->pin(0), osig->pin(0)); connect(gate->pin(0), osig->pin(0));
for (unsigned idx = 0 ; idx < dwidth ; idx += 1) { for (unsigned idx = 0 ; idx < dwidth ; idx += 1) {
NetCaseCmp*cmp = new NetCaseCmp(scope, NetCaseCmp*cmp = new NetCaseCmp(scope,
scope->local_hsymbol()); scope->local_symbol());
if (idx < lsig->pin_count()) if (idx < lsig->pin_count())
connect(cmp->pin(1), lsig->pin(idx)); connect(cmp->pin(1), lsig->pin(idx));
@ -499,7 +498,7 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, NetScope*scope,
des->add_node(cmp); des->add_node(cmp);
// Attach a label to this intermediate wire // 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); NetNet::WIRE);
tmp->local_flag(true); tmp->local_flag(true);
connect(cmp->pin(0), tmp->pin(0)); 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 /* Handle the special case of single bit compare with a
single XNOR gate. This is easy and direct. */ single XNOR gate. This is easy and direct. */
if (dwidth == 1) { if (dwidth == 1) {
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XNOR); 3, NetLogic::XNOR);
connect(gate->pin(0), osig->pin(0)); connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->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 /* Handle the special case of single bit compare with a
single XOR gate. This is easy and direct. */ single XOR gate. This is easy and direct. */
if (dwidth == 1) { if (dwidth == 1) {
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XOR); 3, NetLogic::XOR);
connect(gate->pin(0), osig->pin(0)); connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->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 // will be no more then the l-value, so it is safe to connect
// all the result pins to the osig. // 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); NetNet::IMPLICIT, lwidth);
osig->local_flag(true); osig->local_flag(true);
@ -661,7 +660,7 @@ NetNet* PEBinary::elaborate_net_div_(Design*des, NetScope*scope,
// wire [7:0] r = a / b; // wire [7:0] r = a / b;
if (rwidth < osig->pin_count()) { if (rwidth < osig->pin_count()) {
NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0); verinum::V0);
des->add_node(tmp); des->add_node(tmp);
for (unsigned idx = rwidth ; idx < osig->pin_count() ; idx += 1) 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)); connect(mod->pin_DataB(idx), rsig->pin(idx));
if (lwidth == 0) lwidth = rwidth; if (lwidth == 0) lwidth = rwidth;
NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth); NetNet::IMPLICIT, lwidth);
osig->local_flag(true); 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 /* If the lvalue is larger then the result, then pad the
output with constant 0. */ output with constant 0. */
if (cnt < osig->pin_count()) { if (cnt < osig->pin_count()) {
NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0); verinum::V0);
des->add_node(tmp); des->add_node(tmp);
for (unsigned idx = cnt ; idx < osig->pin_count() ; idx += 1) 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; NetLogic*gate_t;
switch (op_) { switch (op_) {
case 'a': case 'a':
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::AND); 3, NetLogic::AND);
break; break;
case 'o': case 'o':
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::OR); 3, NetLogic::OR);
break; break;
default: 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... // The first OR gate returns 1 if the left value is true...
if (lsig->pin_count() > 1) { 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); 1+lsig->pin_count(), NetLogic::OR);
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1)
connect(gate_t->pin(idx+1), lsig->pin(idx)); 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 /* The reduced logical value is a new nexus, create a
temporary signal to represent it. */ temporary signal to represent it. */
NetNet*tmp = new NetNet(scope, scope->local_hsymbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1); NetNet::IMPLICIT, 1);
tmp->local_flag(true); tmp->local_flag(true);
connect(gate->pin(1), tmp->pin(0)); 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... // The second OR gate returns 1 if the right value is true...
if (rsig->pin_count() > 1) { 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); 1+rsig->pin_count(), NetLogic::OR);
for (unsigned idx = 0 ; idx < rsig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < rsig->pin_count() ; idx += 1)
connect(gate_t->pin(idx+1), rsig->pin(idx)); 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 /* The reduced logical value is a new nexus, create a
temporary signal to represent it. */ temporary signal to represent it. */
NetNet*tmp = new NetNet(scope, scope->local_hsymbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1); NetNet::IMPLICIT, 1);
tmp->local_flag(true); tmp->local_flag(true);
connect(gate->pin(2), tmp->pin(0)); 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. // 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); osig->local_flag(true);
connect(gate->pin(0), osig->pin(0)); connect(gate->pin(0), osig->pin(0));
des->add_node(gate); des->add_node(gate);
@ -839,8 +838,8 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, NetScope*scope,
res.set(idx, prod.get(idx)); res.set(idx, prod.get(idx));
} }
NetConst*odev = new NetConst(scope, scope->local_hsymbol(), res); NetConst*odev = new NetConst(scope, scope->local_symbol(), res);
NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth); NetNet::IMPLICIT, lwidth);
for (unsigned idx = 0 ; idx < lwidth ; idx += 1) for (unsigned idx = 0 ; idx < lwidth ; idx += 1)
connect(odev->pin(idx), osig->pin(idx)); 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)); connect(mult->pin_DataB(idx), rsig->pin(idx));
if (lwidth == 0) lwidth = rwidth; if (lwidth == 0) lwidth = rwidth;
NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth); NetNet::IMPLICIT, lwidth);
osig->local_flag(true); 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 /* If the lvalue is larger then the result, then pad the
output with constant 0. */ output with constant 0. */
if (cnt < osig->pin_count()) { if (cnt < osig->pin_count()) {
NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), NetConst*tmp = new NetConst(scope, scope->local_symbol(),
verinum::V0); verinum::V0);
des->add_node(tmp); des->add_node(tmp);
for (unsigned idx = cnt ; idx < osig->pin_count() ; idx += 1) 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. */ /* Very special case, constant 0 shift. */
if (dist == 0) return lsig; if (dist == 0) return lsig;
NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, lwidth); NetNet::WIRE, lwidth);
osig->local_flag(true); osig->local_flag(true);
NetConst*zero = new NetConst(scope, scope->local_hsymbol(), NetConst*zero = new NetConst(scope, scope->local_symbol(),
verinum::V0); verinum::V0);
des->add_node(zero); 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(), NetCLShift*gate = new NetCLShift(scope, scope->local_symbol(),
lwidth, rsig->pin_count()); lwidth, rsig->pin_count());
NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, lwidth); NetNet::WIRE, lwidth);
osig->local_flag(true); 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)); connect(lsig->pin(idx), gate->pin_Data(idx));
if (lsig->pin_count() < lwidth) { if (lsig->pin_count() < lwidth) {
NetConst*zero = new NetConst(scope, scope->local_hsymbol(), NetConst*zero = new NetConst(scope, scope->local_symbol(),
verinum::V0); verinum::V0);
NetNet*tmp = new NetNet(scope, scope->local_hsymbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1); NetNet::IMPLICIT, 1);
tmp->local_flag(true); tmp->local_flag(true);
des->add_node(zero); 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)); connect(rsig->pin(idx), gate->pin_Distance(idx));
if (op_ == 'r') { if (op_ == 'r') {
NetNet*tmp = new NetNet(scope, scope->local_hsymbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1); NetNet::IMPLICIT, 1);
tmp->local_flag(true); tmp->local_flag(true);
NetConst*dir = new NetConst(scope, scope->local_hsymbol(), NetConst*dir = new NetConst(scope, scope->local_symbol(),
verinum::V1); verinum::V1);
connect(dir->pin(0), gate->pin_Direction()); connect(dir->pin(0), gate->pin_Direction());
connect(tmp->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, NetUserFunc*net = new NetUserFunc(scope,
scope->local_hsymbol().c_str(), scope->local_symbol().c_str(),
dscope); dscope);
des->add_node(net); des->add_node(net);
/* Create an output signal and connect it to the output pins /* Create an output signal and connect it to the output pins
of the function net. */ of the function net. */
NetNet*osig = new NetNet(scope, scope->local_hsymbol(), NetNet*osig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, NetNet::WIRE,
def->port(0)->pin_count()); def->port(0)->pin_count());
osig->local_flag(true); 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 Allow for a repeat count other then 1 by repeating the
connect loop as many times as necessary. */ 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); NetNet::IMPLICIT, pins * repeat);
pins = 0; 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) for (unsigned idx = 0 ; idx < sel->pin_count() ; idx += 1)
connect(mux->pin_Sel(idx), sel->pin(idx)); 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); NetNet::IMPLICIT, 1);
connect(mux->pin_Result(0), out->pin(0)); 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); const NetEConst*pc = dynamic_cast<const NetEConst*>(pe);
assert(pc); assert(pc);
verinum pvalue = pc->value(); verinum pvalue = pc->value();
sig = new NetNet(scope, sig = new NetNet(scope, path_.peek_name(0),
scope->name()+"."+path_.peek_name(0),
NetNet::IMPLICIT, pc->expr_width()); NetNet::IMPLICIT, pc->expr_width());
NetConst*cp = new NetConst(scope, scope->local_hsymbol(), NetConst*cp = new NetConst(scope, scope->local_symbol(),
pvalue); pvalue);
des->add_node(cp); des->add_node(cp);
for (unsigned idx = 0; idx < sig->pin_count(); idx += 1) for (unsigned idx = 0; idx < sig->pin_count(); idx += 1)
@ -1284,7 +1282,7 @@ NetNet* PEIdent::elaborate_net(Design*des, NetScope*scope,
} else { } else {
sig = new NetNet(scope, scope->name()+"."+path_.peek_name(0), sig = new NetNet(scope, path_.peek_name(0),
NetNet::IMPLICIT, 1); NetNet::IMPLICIT, 1);
if (error_implicit) { if (error_implicit) {
@ -1415,19 +1413,14 @@ NetNet* PEIdent::elaborate_net_ram_(Design*des, NetScope*scope,
if (adr == 0) if (adr == 0)
return 0; return 0;
// Memory names are only the base names. Since NetObj names NetRamDq*ram = new NetRamDq(scope, scope->local_symbol(),
// 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),
mem, adr->pin_count()); mem, adr->pin_count());
des->add_node(ram); des->add_node(ram);
for (unsigned idx = 0 ; idx < adr->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < adr->pin_count() ; idx += 1)
connect(ram->pin_Address(idx), adr->pin(idx)); 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()); NetNet::IMPLICIT, ram->width());
osig->local_flag(true); 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 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(scope->name()), NetNet*osig = new NetNet(scope, scope->local_symbol(),
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) {
@ -1522,7 +1515,7 @@ NetNet* PEIdent::elaborate_lnet(Design*des, NetScope*scope,
if (implicit_net_ok && !error_implicit) { 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); NetNet::IMPLICIT, 1);
if (warn_implicit) { 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 number constant with the correct size and set as many bits
in that constant as make sense. Pad excess with zeros. */ in that constant as make sense. Pad excess with zeros. */
if (lwidth > 0) { if (lwidth > 0) {
NetNet*net = new NetNet(scope, scope->local_hsymbol(), NetNet*net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth); NetNet::IMPLICIT, lwidth);
net->local_flag(true); 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) for (idx = 0 ; idx < num.len() && idx < value_->len(); idx += 1)
num.set(idx, value_->get(idx)); num.set(idx, value_->get(idx));
NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), NetConst*tmp = new NetConst(scope, scope->local_symbol(),
num); num);
for (idx = 0 ; idx < net->pin_count() ; idx += 1) { for (idx = 0 ; idx < net->pin_count() ; idx += 1) {
tmp->pin(idx).drive0(drive0); 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 number. Generate a constant object of exactly the user
specified size. */ specified size. */
if (value_->has_len()) { if (value_->has_len()) {
NetNet*net = new NetNet(scope, scope->local_hsymbol(), NetNet*net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, value_->len()); NetNet::IMPLICIT, value_->len());
net->local_flag(true); net->local_flag(true);
NetConst*tmp = new NetConst(scope, scope->local_hsymbol(), NetConst*tmp = new NetConst(scope, scope->local_symbol(),
*value_); *value_);
for (unsigned idx = 0 ; idx < value_->len() ; idx += 1) for (unsigned idx = 0 ; idx < value_->len() ; idx += 1)
connect(net->pin(idx), tmp->pin(idx)); 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) for (unsigned idx = 0 ; idx < width ; idx += 1)
num.set(idx, value_->get(idx)); 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); NetNet::IMPLICIT, width);
net->local_flag(true); 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) for (unsigned idx = 0 ; idx < width ; idx += 1)
connect(net->pin(idx), tmp->pin(idx)); 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 number constant with the correct size and set as many bits
in that constant as make sense. Pad excess with zeros. */ in that constant as make sense. Pad excess with zeros. */
if (lwidth > 0) { if (lwidth > 0) {
net = new NetNet(scope, scope->local_hsymbol(), net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, lwidth); NetNet::IMPLICIT, lwidth);
} else { } else {
net = new NetNet(scope, scope->local_hsymbol(), net = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, strbits); NetNet::IMPLICIT, strbits);
} }
net->local_flag(true); 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); 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) { for (idx = 0 ; idx < net->pin_count() ; idx += 1) {
tmp->pin(idx).drive0(drive0); tmp->pin(idx).drive0(drive0);
tmp->pin(idx).drive1(drive1); 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 by connecting an OR gate to calculate the truth value of
the result. In the end, the result needs to be a single bit. */ the result. In the end, the result needs to be a single bit. */
if (expr_sig->pin_count() > 1) { 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, expr_sig->pin_count()+1,
NetLogic::OR); NetLogic::OR);
for (unsigned idx = 0; idx < expr_sig->pin_count(); idx += 1) for (unsigned idx = 0; idx < expr_sig->pin_count(); idx += 1)
connect(log->pin(idx+1), expr_sig->pin(idx)); 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); NetNet::IMPLICIT, 1);
tmp->local_flag(true); tmp->local_flag(true);
connect(tmp->pin(0), log->pin(0)); 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; 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); NetNet::WIRE, width);
sig->local_flag(true); sig->local_flag(true);
@ -1989,11 +1982,11 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
devices to carry the propagation delays. Otherwise, just devices to carry the propagation delays. Otherwise, just
connect the result to the output. */ connect the result to the output. */
if (rise || fall || decay) { if (rise || fall || decay) {
NetNet*tmp = new NetNet(scope, scope->local_hsymbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, dwidth); NetNet::WIRE, dwidth);
for (unsigned idx = 0 ; idx < dwidth ; idx += 1) { 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->rise_time(rise);
tmpz->fall_time(fall); tmpz->fall_time(fall);
tmpz->decay_time(decay); tmpz->decay_time(decay);
@ -2018,7 +2011,7 @@ NetNet* PETernary::elaborate_net(Design*des, NetScope*scope,
if (dwidth < width) { if (dwidth < width) {
verinum vpad (verinum::V0, width-dwidth); 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); des->add_node(pad);
for (unsigned idx = dwidth ; idx < width ; idx += 1) for (unsigned idx = dwidth ; idx < width ; idx += 1)
connect(sig->pin(idx), pad->pin(idx-dwidth)); connect(sig->pin(idx), pad->pin(idx-dwidth));
@ -2063,7 +2056,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
width = val->len(); width = val->len();
assert(width > 0); assert(width > 0);
sig = new NetNet(scope, scope->local_hsymbol(), sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, width); NetNet::WIRE, width);
sig->local_flag(true); sig->local_flag(true);
@ -2072,7 +2065,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
verinum tmp (v_not(*val)); verinum tmp (v_not(*val));
verinum one (1UL, width); verinum one (1UL, width);
tmp = tmp + one; 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) for (unsigned idx = 0 ; idx < width ; idx += 1)
connect(sig->pin(idx), con->pin(idx)); connect(sig->pin(idx), con->pin(idx));
@ -2089,11 +2082,11 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
switch (op_) { switch (op_) {
case '~': // Bitwise NOT 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()); sub_sig->pin_count());
sig->local_flag(true); sig->local_flag(true);
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) { 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); 2, NetLogic::NOT);
connect(gate->pin(1), sub_sig->pin(idx)); connect(gate->pin(1), sub_sig->pin(idx));
connect(gate->pin(0), 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 'N': // Reduction NOR
case '!': // Reduction NOT 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); 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); 1+sub_sig->pin_count(), NetLogic::NOR);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@ -2121,9 +2114,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case '&': // Reduction AND 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); 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); 1+sub_sig->pin_count(), NetLogic::AND);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@ -2136,9 +2129,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case '|': // Reduction OR 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); 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); 1+sub_sig->pin_count(), NetLogic::OR);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@ -2151,9 +2144,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case '^': // Reduction XOR 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); 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); 1+sub_sig->pin_count(), NetLogic::XOR);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@ -2166,9 +2159,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case 'A': // Reduction NAND (~&) 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); 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); 1+sub_sig->pin_count(), NetLogic::NAND);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) 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 (~^) 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); 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); 1+sub_sig->pin_count(), NetLogic::XNOR);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < sub_sig->pin_count() ; idx += 1)
@ -2197,7 +2190,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case '-': // Unary 2's complement. case '-': // Unary 2's complement.
sig = new NetNet(scope, scope->local_hsymbol(), sig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, owidth); NetNet::WIRE, owidth);
sig->local_flag(true); sig->local_flag(true);
@ -2210,7 +2203,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case 1: case 1:
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
2, NetLogic::BUF); 2, NetLogic::BUF);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
connect(gate->pin(1), sub_sig->pin(0)); connect(gate->pin(1), sub_sig->pin(0));
@ -2221,7 +2214,7 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
break; break;
case 2: case 2:
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
2, NetLogic::BUF); 2, NetLogic::BUF);
connect(gate->pin(0), sig->pin(0)); connect(gate->pin(0), sig->pin(0));
connect(gate->pin(1), sub_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->fall_time(fall);
gate->decay_time(decay); gate->decay_time(decay);
gate = new NetLogic(scope, scope->local_hsymbol(), gate = new NetLogic(scope, scope->local_symbol(),
3, NetLogic::XOR); 3, NetLogic::XOR);
connect(gate->pin(0), sig->pin(1)); connect(gate->pin(0), sig->pin(1));
connect(gate->pin(1), sub_sig->pin(0)); 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); verinum tmp_num (verinum::V0, sub->width(), true);
NetConst*tmp_con = new NetConst(scope, NetConst*tmp_con = new NetConst(scope,
scope->local_hsymbol(), scope->local_symbol(),
tmp_num); tmp_num);
des->add_node(tmp_con); 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, NetNet::WIRE,
sub_sig->pin_count()); sub_sig->pin_count());
tmp_sig->local_flag(true); tmp_sig->local_flag(true);
@ -2284,6 +2277,9 @@ NetNet* PEUnary::elaborate_net(Design*des, NetScope*scope,
/* /*
* $Log: elab_net.cc,v $ * $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 * Revision 1.107 2003/02/26 01:29:24 steve
* LPM objects store only their base names. * LPM objects store only their base names.
* *

View File

@ -17,11 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
# include "compiler.h"
# include <iostream> # 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 void PData::elaborate_scope(Design*des, NetScope*scope) const
{ {
assert(hname_.component_count() == 1); 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); tmp->set_line(*this);
scope->add_variable(tmp); scope->add_variable(tmp);
} }
@ -512,6 +513,9 @@ void PWhile::elaborate_scope(Design*des, NetScope*scope) const
/* /*
* $Log: elab_scope.cc,v $ * $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 * Revision 1.19 2003/01/27 05:09:17 steve
* Spelling fixes. * Spelling fixes.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -508,10 +508,7 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
} else { } else {
/* Make a hierarchical make for the signal. */ string name = hname_.peek_tail_name();
string name = scope->name();
name = name + "." + hname_.peek_tail_name();
NetNet*sig = new NetNet(scope, name, wtype, msb, lsb); NetNet*sig = new NetNet(scope, name, wtype, msb, lsb);
sig->set_line(*this); sig->set_line(*this);
sig->port_type(port_type_); sig->port_type(port_type_);
@ -525,6 +522,9 @@ void PWire::elaborate_sig(Design*des, NetScope*scope) const
/* /*
* $Log: elab_sig.cc,v $ * $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 * Revision 1.27 2003/01/30 16:23:07 steve
* Spelling fixes. * Spelling fixes.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -167,7 +167,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
if (cnt < lval->pin_count()) { if (cnt < lval->pin_count()) {
verinum tmpv (0UL, lval->pin_count()-cnt); verinum tmpv (0UL, lval->pin_count()-cnt);
NetConst*tmp = new NetConst(scope, NetConst*tmp = new NetConst(scope,
scope->local_hsymbol(), scope->local_symbol(),
tmpv); tmpv);
des->add_node(tmp); des->add_node(tmp);
for (idx = cnt ; idx < lval->pin_count() ; idx += 1) for (idx = cnt ; idx < lval->pin_count() ; idx += 1)
@ -180,7 +180,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
unsigned idx; unsigned idx;
for (idx = 0 ; idx < cnt ; idx += 1) { for (idx = 0 ; idx < cnt ; idx += 1) {
NetBUFZ*dev = new NetBUFZ(scope, NetBUFZ*dev = new NetBUFZ(scope,
scope->local_hsymbol()); scope->local_symbol());
connect(lval->pin(idx), dev->pin(0)); connect(lval->pin(idx), dev->pin(0));
connect(rid->pin(idx), dev->pin(1)); connect(rid->pin(idx), dev->pin(1));
dev->rise_time(rise_time); dev->rise_time(rise_time);
@ -193,7 +193,7 @@ void PGAssign::elaborate(Design*des, NetScope*scope) const
if (cnt < lval->pin_count()) { if (cnt < lval->pin_count()) {
NetConst*dev = new NetConst(scope, NetConst*dev = new NetConst(scope,
scope->local_hsymbol(), scope->local_symbol(),
verinum::V0); verinum::V0);
des->add_node(dev); des->add_node(dev);
@ -250,9 +250,7 @@ void PGBuiltin::elaborate(Design*des, NetScope*scope) const
string name = get_name(); string name = get_name();
if (name == "") if (name == "")
name = scope->local_hsymbol(); name = scope->local_symbol();
else
name = scope->name()+"."+name;
/* If the Verilog source has a range specification for the /* If the Verilog source has a range specification for the
gates, then I am expected to make more then one 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(); string my_name = get_name();
if (my_name == "") if (my_name == "")
my_name = scope->local_hsymbol(); my_name = scope->local_symbol();
else
my_name = scope->name()+"."+my_name;
/* When the parser notices delay expressions in front of a /* When the parser notices delay expressions in front of a
module or primitive, it interprets them as parameter 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. */ netlist. The compound statement is exactly equivalent. */
if (delay || event_) { if (delay || event_) {
string n = scope->local_hsymbol();
unsigned wid = lv->lwidth(); unsigned wid = lv->lwidth();
rv->set_width(wid); rv->set_width(wid);
@ -1020,13 +1015,14 @@ NetProc* PAssign::elaborate(Design*des, NetScope*scope) const
return 0; 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); tmp->set_line(*this);
NetESignal*sig = new NetESignal(tmp); NetESignal*sig = new NetESignal(tmp);
/* Generate an assignment of the l-value to the temporary... */ /* 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_*lvt = new NetAssign_(tmp);
NetAssign*a1 = new NetAssign(lvt, rv); 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()) if (rval->pin_count() < lval->pin_count())
rval = pad_to_width(des, rval, 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); dev->set_line(*this);
des->add_node(dev); des->add_node(dev);
@ -1813,7 +1809,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
we->add_event(ev); we->add_event(ev);
NetEvProbe*po = new NetEvProbe(scope, NetEvProbe*po = new NetEvProbe(scope,
scope->local_hsymbol(), scope->local_symbol(),
ev, NetEvProbe::POSEDGE, 1); ev, NetEvProbe::POSEDGE, 1);
connect(po->pin(0), ex->pin(0)); connect(po->pin(0), ex->pin(0));
@ -1893,7 +1889,7 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
return enet; return enet;
} }
NetEvProbe*pr = new NetEvProbe(scope, scope->local_hsymbol(), NetEvProbe*pr = new NetEvProbe(scope, scope->local_symbol(),
ev, NetEvProbe::ANYEDGE, ev, NetEvProbe::ANYEDGE,
nset->count()); nset->count());
for (unsigned idx = 0 ; idx < nset->count() ; idx += 1) for (unsigned idx = 0 ; idx < nset->count() ; idx += 1)
@ -1943,17 +1939,17 @@ NetProc* PEventStatement::elaborate_st(Design*des, NetScope*scope,
NetEvProbe*pr; NetEvProbe*pr;
switch (expr_[idx]->type()) { switch (expr_[idx]->type()) {
case PEEvent::POSEDGE: case PEEvent::POSEDGE:
pr = new NetEvProbe(scope, scope->local_hsymbol(), ev, pr = new NetEvProbe(scope, scope->local_symbol(), ev,
NetEvProbe::POSEDGE, pins); NetEvProbe::POSEDGE, pins);
break; break;
case PEEvent::NEGEDGE: case PEEvent::NEGEDGE:
pr = new NetEvProbe(scope, scope->local_hsymbol(), ev, pr = new NetEvProbe(scope, scope->local_symbol(), ev,
NetEvProbe::NEGEDGE, pins); NetEvProbe::NEGEDGE, pins);
break; break;
case PEEvent::ANYEDGE: case PEEvent::ANYEDGE:
pr = new NetEvProbe(scope, scope->local_hsymbol(), ev, pr = new NetEvProbe(scope, scope->local_symbol(), ev,
NetEvProbe::ANYEDGE, pins); NetEvProbe::ANYEDGE, pins);
break; break;
@ -2029,7 +2025,7 @@ NetProc* PForce::elaborate(Design*des, NetScope*scope) const
if (rval->pin_count() < lval->pin_count()) if (rval->pin_count() < lval->pin_count())
rval = pad_to_width(des, rval, 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); des->add_node(dev);
for (unsigned idx = 0 ; idx < dev->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < dev->pin_count() ; idx += 1)
@ -2502,6 +2498,9 @@ Design* elaborate(list<const char*>roots)
/* /*
* $Log: elaborate.cc,v $ * $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 * Revision 1.275 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put * Add the lex_strings string handler, and put
* scope names and system task/function names * scope names and system task/function names

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -48,7 +48,7 @@ NetNet* NetEBAdd::synthesize(Design*des)
assert(lsig->pin_count() == rsig->pin_count()); assert(lsig->pin_count() == rsig->pin_count());
unsigned width=lsig->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); NetNet*osig = new NetNet(lsig->scope(), path, NetNet::IMPLICIT, width);
osig->local_flag(true); osig->local_flag(true);
@ -100,12 +100,12 @@ NetNet* NetEBBits::synthesize(Design*des)
} }
assert(lsig->pin_count() == rsig->pin_count()); assert(lsig->pin_count() == rsig->pin_count());
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, NetNet*osig = new NetNet(scope, scope->local_symbol(),
lsig->pin_count()); NetNet::IMPLICIT, lsig->pin_count());
osig->local_flag(true); osig->local_flag(true);
for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) { for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) {
string oname = des->local_symbol(path); string oname = scope->local_hsymbol();
NetLogic*gate; NetLogic*gate;
/* If the rsig bit is constant, then look for special /* If the rsig bit is constant, then look for special
@ -175,21 +175,21 @@ NetNet* NetEBComp::synthesize(Design*des)
: right_->synthesize(des); : right_->synthesize(des);
NetScope*scope = lsig->scope(); NetScope*scope = lsig->scope();
assert(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); osig->local_flag(true);
NetLogic*gate; NetLogic*gate;
switch (op_) { switch (op_) {
case 'e': case 'e':
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); lsig->pin_count()+1, NetLogic::NOR);
break; break;
case 'n': case 'n':
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); lsig->pin_count()+1, NetLogic::OR);
break; break;
@ -198,11 +198,11 @@ NetNet* NetEBComp::synthesize(Design*des)
is very much like sig != 0. (0 > sig) shouldn't is very much like sig != 0. (0 > sig) shouldn't
happen. */ happen. */
if (rcon) { if (rcon) {
gate = new NetLogic(scope, des->local_symbol(path), gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::OR); lsig->pin_count()+1, NetLogic::OR);
} else { } else {
assert(0); assert(0);
gate = new NetLogic(scope, des->local_symbol(path), gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::NOR); lsig->pin_count()+1, NetLogic::NOR);
} }
break; break;
@ -210,11 +210,11 @@ NetNet* NetEBComp::synthesize(Design*des)
case '<': case '<':
/* 0 < sig is handled like sig > 0. */ /* 0 < sig is handled like sig > 0. */
if (! rcon) { if (! rcon) {
gate = new NetLogic(scope, des->local_symbol(path), gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::OR); lsig->pin_count()+1, NetLogic::OR);
} else { } else {
assert(0); assert(0);
gate = new NetLogic(scope, des->local_symbol(path), gate = new NetLogic(scope, scope->local_hsymbol(),
lsig->pin_count()+1, NetLogic::NOR); lsig->pin_count()+1, NetLogic::NOR);
} }
break; break;
@ -236,7 +236,6 @@ NetNet* NetEBComp::synthesize(Design*des)
NetScope*scope = lsig->scope(); NetScope*scope = lsig->scope();
assert(scope); assert(scope);
string path = des->local_symbol(scope->name());
unsigned width = lsig->pin_count(); unsigned width = lsig->pin_count();
if (rsig->pin_count() > 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); lsig = pad_to_width(des, lsig, width);
rsig = pad_to_width(des, rsig, 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); osig->local_flag(true);
/* Handle the special case of a single bit equality /* Handle the special case of a single bit equality
operation. Make an XNOR gate instead of a comparator. */ operation. Make an XNOR gate instead of a comparator. */
if ((width == 1) && ((op_ == 'e') || (op_ == 'E'))) { 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); 3, NetLogic::XNOR);
connect(gate->pin(0), osig->pin(0)); connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->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 operation. This is similar to single bit equality, but uses
an XOR instead of an XNOR gate. */ an XOR instead of an XNOR gate. */
if ((width == 1) && ((op_ == 'n') || (op_ == 'N'))) { 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); 3, NetLogic::XOR);
connect(gate->pin(0), osig->pin(0)); connect(gate->pin(0), osig->pin(0));
connect(gate->pin(1), lsig->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); des->add_node(dev);
for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1) for (unsigned idx = 0 ; idx < lsig->pin_count() ; idx += 1)
@ -337,9 +337,9 @@ NetNet* NetEBLogic::synthesize(Design*des)
NetScope*scope = lsig->scope(); NetScope*scope = lsig->scope();
assert(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); osig->local_flag(true);
@ -349,12 +349,11 @@ NetNet* NetEBLogic::synthesize(Design*des)
comparison with a single wide OR gate. So handle this comparison with a single wide OR gate. So handle this
magically. */ magically. */
string oname = des->local_symbol(path); string oname = scope->local_hsymbol();
NetLogic*olog;
olog = new NetLogic(scope, oname, NetLogic*olog = new NetLogic(scope, oname,
lsig->pin_count()+rsig->pin_count()+1, lsig->pin_count()+rsig->pin_count()+1,
NetLogic::OR); NetLogic::OR);
connect(osig->pin(0), olog->pin(0)); 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 /* Create the logic AND gate. This is a single bit
output, with inputs for each of the operands. */ output, with inputs for each of the operands. */
NetLogic*olog; NetLogic*olog;
string oname = des->local_symbol(path); string oname = scope->local_hsymbol();
olog = new NetLogic(scope, oname, 3, NetLogic::AND); olog = new NetLogic(scope, oname, 3, NetLogic::AND);
@ -411,7 +410,7 @@ NetNet* NetEConcat::synthesize(Design*des)
assert(scope); assert(scope);
/* Make a NetNet object to carry the output vector. */ /* 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()); NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, expr_width());
osig->local_flag(true); osig->local_flag(true);
@ -439,12 +438,12 @@ NetNet* NetEConst::synthesize(Design*des)
NetScope*scope = des->find_root_scope(); NetScope*scope = des->find_root_scope();
assert(scope); assert(scope);
string path = scope->name() + "." + scope->local_symbol(); string path = scope->local_symbol();
unsigned width=expr_width(); unsigned width=expr_width();
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, width); NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, width);
osig->local_flag(true); 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) for (unsigned idx = 0 ; idx < width; idx += 1)
connect(osig->pin(idx), con->pin(idx)); connect(osig->pin(idx), con->pin(idx));
@ -470,14 +469,13 @@ NetNet* NetEUBits::synthesize(Design*des)
NetScope*scope = isig->scope(); NetScope*scope = isig->scope();
assert(scope); assert(scope);
string path = des->local_symbol(scope->name());
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, NetNet*osig = new NetNet(scope, scope->local_symbol(),
isig->pin_count()); NetNet::IMPLICIT, isig->pin_count());
osig->local_flag(true); osig->local_flag(true);
for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) { for (unsigned idx = 0 ; idx < osig->pin_count() ; idx += 1) {
string oname = des->local_symbol(path); string oname = scope->local_hsymbol();
NetLogic*gate; NetLogic*gate;
switch (op()) { switch (op()) {
@ -503,12 +501,12 @@ NetNet* NetEUReduce::synthesize(Design*des)
NetScope*scope = isig->scope(); NetScope*scope = isig->scope();
assert(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); osig->local_flag(true);
string oname = des->local_symbol(path); string oname = scope->local_hsymbol();
NetLogic*gate; NetLogic*gate;
switch (op()) { switch (op()) {
@ -569,7 +567,7 @@ NetNet* NetETernary::synthesize(Design *des)
NetNet*tsig = true_val_->synthesize(des); NetNet*tsig = true_val_->synthesize(des);
NetNet*fsig = false_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(csig->pin_count() == 1);
assert(tsig->pin_count() == fsig->pin_count()); assert(tsig->pin_count() == fsig->pin_count());
@ -631,7 +629,7 @@ NetNet* NetESignal::synthesize(Design*des)
NetScope*scope = net_->scope(); NetScope*scope = net_->scope();
assert(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); NetNet*tmp = new NetNet(scope, name, NetNet::NetNet::WIRE, wid);
tmp->local_flag(true); tmp->local_flag(true);
@ -643,6 +641,9 @@ NetNet* NetESignal::synthesize(Design*des)
/* /*
* $Log: expr_synth.cc,v $ * $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 * Revision 1.40 2003/02/26 01:29:24 steve
* LPM objects store only their base names. * LPM objects store only their base names.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
#ifdef __cplusplus #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 * This method returns the type of logic gate that the cookie
* represents. * represents.
* *
* ivl_logic_name * ivl_logic_name (obsolete)
* This method returns the complete name of the logic gate. Every * This method returns the complete name of the logic gate. Every
* gate has a complete name (that includes the scope) even if the * gate has a complete name (that includes the scope) even if the
* Verilog source doesn't include one. The compiler will choose one * Verilog source doesn't include one. The compiler will choose one
@ -1144,6 +1144,9 @@ _END_DECL
/* /*
* $Log: ivl_target.h,v $ * $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 * Revision 1.112 2003/02/26 01:29:24 steve
* LPM objects store only their base names. * LPM objects store only their base names.
* *

View File

@ -17,12 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
# include "compiler.h" # include "compiler.h"
# include "netlist.h" # include "netlist.h"
/* /*
@ -242,7 +241,7 @@ const NetEvent* NetEvTrig::event() const
NetEvProbe::NetEvProbe(NetScope*s, const string&n, NetEvent*tgt, NetEvProbe::NetEvProbe(NetScope*s, const string&n, NetEvent*tgt,
edge_t t, unsigned p) 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) { for (unsigned idx = 0 ; idx < p ; idx += 1) {
pin(idx).set_dir(Link::INPUT); pin(idx).set_dir(Link::INPUT);
@ -444,6 +443,9 @@ NetProc* NetEvWait::statement()
/* /*
* $Log: net_event.cc,v $ * $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 * Revision 1.21 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put * Add the lex_strings string handler, and put
* scope names and system task/function names * scope names and system task/function names

View File

@ -17,10 +17,11 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
# include "compiler.h"
/* /*
* This file contains implementation of the NetForce, NetRelease, * This file contains implementation of the NetForce, NetRelease,
@ -45,7 +46,7 @@
* link ring to grow, and that is not quite correct either. Hmm... * link ring to grow, and that is not quite correct either. Hmm...
*/ */
NetCAssign::NetCAssign(NetScope*s, const string&n, NetNet*l) 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(); lval_->incr_eref();
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) { 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) 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(); lval_->incr_eref();
@ -136,6 +137,9 @@ const NetNet*NetRelease::lval() const
/* /*
* $Log: net_force.cc,v $ * $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 * Revision 1.10 2003/01/27 05:09:17 steve
* Spelling fixes. * Spelling fixes.
* *

View File

@ -17,11 +17,12 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
# include "netlist.h" # include "netlist.h"
# include "compiler.h"
# include "PExpr.h" # include "PExpr.h"
# include <iostream> # include <iostream>
@ -35,7 +36,8 @@ static unsigned count_def_pins(const NetFuncDef*def)
} }
NetUserFunc::NetUserFunc(NetScope*s, const char*n, NetScope*d) 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(); NetFuncDef*def = def_->func_def();
@ -145,6 +147,9 @@ bool PECallFunction::check_call_matches_definition_(Design*des, NetScope*dscope)
/* /*
* $Log: net_func.cc,v $ * $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 * Revision 1.3 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig. * conditional ident string using autoconfig.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -28,11 +28,13 @@
# include <cassert> # include <cassert>
# include "netlist.h" # include "netlist.h"
# include "compiler.h"
NetModulo::NetModulo(NetScope*s, const string&n, unsigned wr, NetModulo::NetModulo(NetScope*s, const string&n, unsigned wr,
unsigned wa, unsigned wb) 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; unsigned p = 0;
for (unsigned idx = 0 ; idx < width_r_ ; idx += 1, p += 1) { 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 $ * $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 * Revision 1.5 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig. * conditional ident string using autoconfig.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -311,10 +311,9 @@ NetNet* NetScope::find_signal(const string&key)
if (signals_ == 0) if (signals_ == 0)
return 0; return 0;
string fulname = name()+"."+key;
NetNet*cur = signals_; NetNet*cur = signals_;
do { do {
if (cur->name() == fulname) if (cur->name() == key)
return cur; return cur;
cur = cur->sig_prev_; cur = cur->sig_prev_;
} while (cur != signals_); } while (cur != signals_);
@ -449,6 +448,9 @@ string NetScope::local_hsymbol()
/* /*
* $Log: net_scope.cc,v $ * $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 * Revision 1.25 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put * Add the lex_strings string handler, and put
* scope names and system task/function names * scope names and system task/function names

View File

@ -18,15 +18,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
# include "compiler.h"
# include "netlist.h" # include "netlist.h"
NetUDP::NetUDP(NetScope*s, const string&n, unsigned pins, PUdp *u) 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_dir(Link::OUTPUT);
pin(0).set_name("O", 0); pin(0).set_name("O", 0);
@ -91,6 +92,9 @@ char NetUDP::get_initial() const
/* /*
* $Log: net_udp.cc,v $ * $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 * Revision 1.7 2002/08/12 01:34:59 steve
* conditional ident string using autoconfig. * conditional ident string using autoconfig.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -25,14 +25,13 @@
NetVariable::NetVariable(const char*name) NetVariable::NetVariable(const char*name)
{ {
name_ = strdup(name); name_ = name;
scope_ = 0; scope_ = 0;
snext_ = 0; snext_ = 0;
} }
NetVariable::~NetVariable() NetVariable::~NetVariable()
{ {
free(name_);
} }
const char*NetVariable::basename() const const char*NetVariable::basename() const
@ -71,6 +70,9 @@ const NetVariable* NetEVariable::variable() const
/* /*
* $Log: net_variable.cc,v $ * $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 * Revision 1.1 2003/01/28 16:23:27 steve
* Add missing net_variable.cc to CVS. * Add missing net_variable.cc to CVS.
* *

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -165,25 +165,9 @@ Link* find_next_output(Link*lnk)
return 0; 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) 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_]; pins_ = new Link[npins_];
for (unsigned idx = 0 ; idx < npins_ ; idx += 1) { for (unsigned idx = 0 ; idx < npins_ ; idx += 1) {
pins_[idx].node_ = this; pins_[idx].node_ = this;
@ -193,7 +177,6 @@ NetObj::NetObj(NetScope*s, const char*n, unsigned np)
NetObj::~NetObj() NetObj::~NetObj()
{ {
delete[]name_;
delete[]pins_; delete[]pins_;
} }
@ -219,11 +202,6 @@ const Link& NetObj::pin(unsigned idx) const
return pins_[idx]; 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) NetNode::NetNode(NetScope*s, const char*n, unsigned npins)
: NetObj(s, n, npins), node_next_(0), node_prev_(0), design_(0) : 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) 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), type_(t), port_type_(NOT_A_PORT), signed_(false), msb_(npins-1), lsb_(0),
local_flag_(false), eref_count_(0), lref_count_(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) 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), : NetObj(s, lex_strings.add(n.c_str()), ((ms>ls)?ms-ls:ls-ms) + 1),
sig_prev_(0), type_(t), sig_next_(0), sig_prev_(0), type_(t),
port_type_(NOT_A_PORT), signed_(false), msb_(ms), lsb_(ls), port_type_(NOT_A_PORT), signed_(false), msb_(ms), lsb_(ls),
local_flag_(false), eref_count_(0), lref_count_(0) 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) 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) for (unsigned idx = 0 ; idx < wid ; idx += 1)
connect(sig->pin(idx+off), pin(idx)); 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) 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_dir(Link::INPUT);
pin_Clock().set_name("Clock", 0); pin_Clock().set_name("Clock", 0);
@ -677,7 +655,7 @@ const verinum& NetFF::aset_value() const
* 8 -- Result[0] * 8 -- Result[0]
*/ */
NetAddSub::NetAddSub(NetScope*s, const string&n, unsigned w) 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(0).set_dir(Link::INPUT); pin(0).set_name("Add_Sub", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("Aclr", 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, NetCLShift::NetCLShift(NetScope*s, const string&n,
unsigned width, unsigned width_dist) 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(0).set_dir(Link::INPUT); pin(0).set_name("Direction", 0);
pin(1).set_dir(Link::OUTPUT); pin(1).set_name("Underflow", 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) 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(0).set_dir(Link::INPUT); pin(0).set_name("Aclr");
pin(1).set_dir(Link::INPUT); pin(1).set_name("Clock"); 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, NetDivide::NetDivide(NetScope*sc, const string&n, unsigned wr,
unsigned wa, unsigned wb) 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; unsigned p = 0;
for (unsigned idx = 0 ; idx < width_r_ ; idx += 1, p += 1) { 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, NetMult::NetMult(NetScope*sc, const string&n, unsigned wr,
unsigned wa, unsigned wb, unsigned ws) unsigned wa, unsigned wb, unsigned ws)
: NetNode(sc, n, 2+wr+wa+wb+ws), width_r_(wr), width_a_(wa), width_b_(wb), : NetNode(sc, lex_strings.add(n.c_str()), 2+wr+wa+wb+ws),
width_s_(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(0).set_dir(Link::INPUT); pin(0).set_name("Aclr", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("Clock", 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, NetMux::NetMux(NetScope*s, const string&n,
unsigned wi, unsigned si, unsigned sw) 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(0).set_dir(Link::INPUT); pin(0).set_name("Aclr", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("Clock", 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) 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(0).set_dir(Link::INPUT); pin(0).set_name("InClock", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("OutClock", 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) 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(0).set_dir(Link::OUTPUT);
pin(1).set_dir(Link::INPUT); pin(1).set_dir(Link::INPUT);
@ -1518,7 +1500,7 @@ NetBUFZ::~NetBUFZ()
NetCaseCmp::NetCaseCmp(NetScope*s, const string&n) 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(0).set_dir(Link::OUTPUT); pin(0).set_name("O",0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("I",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) 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_dir(Link::OUTPUT);
pin(0).set_name("O", 0); 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) 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()]; value_ = new verinum::V[pin_count()];
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) { 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) 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_dir(Link::OUTPUT);
pin(0).set_name("O", 0); pin(0).set_name("O", 0);
@ -2196,6 +2178,9 @@ const NetProc*NetTaskDef::proc() const
/* /*
* $Log: netlist.cc,v $ * $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 * Revision 1.206 2003/03/01 06:25:30 steve
* Add the lex_strings string handler, and put * Add the lex_strings string handler, and put
* scope names and system task/function names * scope names and system task/function names

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
/* /*
@ -86,7 +86,8 @@ class NetObj : public Attrib {
public: public:
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); explicit NetObj(NetScope*s, const char*n, unsigned npins);
virtual ~NetObj(); virtual ~NetObj();
@ -113,7 +114,7 @@ class NetObj : public Attrib {
private: private:
NetScope*scope_; NetScope*scope_;
char* name_; const char* name_;
Link*pins_; Link*pins_;
const unsigned npins_; const unsigned npins_;
unsigned delay1_; unsigned delay1_;
@ -321,7 +322,7 @@ class NexusSet {
class NetNode : public NetObj { class NetNode : public NetObj {
public: 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); explicit NetNode(NetScope*s, const char*n, unsigned npins);
virtual ~NetNode(); virtual ~NetNode();
@ -2103,6 +2104,8 @@ class NetVariable : public LineInfo {
friend class NetScope; friend class NetScope;
public: public:
// The name must be a permallocated string. This class makes
// no attempt to preserve it.
NetVariable(const char* name); NetVariable(const char* name);
~NetVariable(); ~NetVariable();
@ -2112,7 +2115,7 @@ class NetVariable : public LineInfo {
const NetScope* scope() const; const NetScope* scope() const;
private: private:
char* name_; const char* name_;
NetScope*scope_; NetScope*scope_;
NetVariable*snext_; NetVariable*snext_;
@ -3204,6 +3207,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/* /*
* $Log: netlist.h,v $ * $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 * Revision 1.278 2003/03/03 02:22:41 steve
* Scope names stored only as basename. * Scope names stored only as basename.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # 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); 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); NetNet::IMPLICIT, width);
val_s->local_flag(true); val_s->local_flag(true);
NetNet*res = new NetNet(scope, scope->local_hsymbol(), NetNet*res = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, width); NetNet::IMPLICIT, width);
res->local_flag(true); res->local_flag(true);
@ -90,6 +90,9 @@ NetExpr* elab_and_eval(Design*des, NetScope*scope, const PExpr*pe)
/* /*
* $Log: netmisc.cc,v $ * $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 * Revision 1.5 2003/02/26 01:29:24 steve
* LPM objects store only their base names. * LPM objects store only their base names.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -85,7 +85,7 @@ NetNet*pad_to_width(Design*des, NetNet*net, unsigned wid)
pad); pad);
des->add_node(con); des->add_node(con);
NetNet*tmp = new NetNet(scope, path + "." + scope->local_symbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, wid); NetNet::WIRE, wid);
tmp->local_flag(true); tmp->local_flag(true);
@ -99,6 +99,9 @@ NetNet*pad_to_width(Design*des, NetNet*net, unsigned wid)
/* /*
* $Log: pad_to_width.cc,v $ * $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 * Revision 1.13 2003/01/27 05:09:17 steve
* Spelling fixes. * Spelling fixes.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #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 #endif
# include "config.h" # include "config.h"
@ -208,7 +208,7 @@ bool NetCase::synth_async(Design*des, NetScope*scope,
verinum gval = ge->value(); verinum gval = ge->value();
unsigned sel_idx = guard2sel[gval.as_ulong()]; 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()); NetNet::WIRE, nex_map->pin_count());
sig->local_flag(true); sig->local_flag(true);
items_[item].statement->synth_async(des, scope, nex_map, sig); 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(if_ != 0);
assert(else_ != 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()); NetNet::WIRE, nex_map->pin_count());
asig->local_flag(true); asig->local_flag(true);
if_->synth_async(des, scope, nex_map, asig); if_->synth_async(des, scope, nex_map, asig);
NetNet*bsig = new NetNet(scope, scope->local_hsymbol(), NetNet*bsig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, nex_map->pin_count()); NetNet::WIRE, nex_map->pin_count());
bsig->local_flag(true); bsig->local_flag(true);
@ -458,7 +458,7 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
/* Synthesize the true clause to figure out what /* Synthesize the true clause to figure out what
kind of set/reset we have. */ kind of set/reset we have. */
NetNet*asig = new NetNet(scope, scope->local_hsymbol(), NetNet*asig = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE, nex_map->pin_count()); NetNet::WIRE, nex_map->pin_count());
asig->local_flag(true); asig->local_flag(true);
flag = if_->synth_async(des, scope, nex_map, asig) && flag; flag = if_->synth_async(des, scope, nex_map, asig) && flag;
@ -540,7 +540,7 @@ bool NetCondit::synth_sync(Design*des, NetScope*scope, NetFF*ff,
ff->pin_Enable().unlink(); ff->pin_Enable().unlink();
connect(ff->pin_Enable(), ce_and->pin(0)); connect(ff->pin_Enable(), ce_and->pin(0));
NetNet*tmp = new NetNet(scope, scope->local_hsymbol(), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::IMPLICIT, 1); NetNet::IMPLICIT, 1);
tmp->local_flag(true); tmp->local_flag(true);
connect(ff->pin_Enable(), tmp->pin(0)); connect(ff->pin_Enable(), tmp->pin(0));
@ -638,7 +638,7 @@ bool NetProcTop::synth_sync(Design*des)
/* The D inputs to the DFF device will receive the output from /* The D inputs to the DFF device will receive the output from
the statements of the process. */ the statements of the process. */
NetNet*nex_d = new NetNet(scope(), scope()->local_hsymbol().c_str(), NetNet*nex_d = new NetNet(scope(), scope()->local_symbol(),
NetNet::WIRE, nex_set.count()); NetNet::WIRE, nex_set.count());
nex_d->local_flag(true); nex_d->local_flag(true);
for (unsigned idx = 0 ; idx < nex_set.count() ; idx += 1) { for (unsigned idx = 0 ; idx < nex_set.count() ; idx += 1) {
@ -738,6 +738,9 @@ void synth2(Design*des)
/* /*
* $Log: synth2.cc,v $ * $Log: synth2.cc,v $
* Revision 1.23 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.22 2003/02/26 01:29:24 steve * Revision 1.22 2003/02/26 01:29:24 steve
* LPM objects store only their base names. * LPM objects store only their base names.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll-api.cc,v 1.92 2003/03/03 02:22:41 steve Exp $" #ident "$Id: t-dll-api.cc,v 1.93 2003/03/06 00:28:42 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -483,12 +483,14 @@ extern "C" ivl_attribute_t ivl_logic_attr_val(ivl_net_logic_t net,
extern "C" const char* ivl_logic_name(ivl_net_logic_t net) extern "C" const char* ivl_logic_name(ivl_net_logic_t net)
{ {
assert(net); assert(net);
cerr << "ANACHRONISM: Call to anachronistic ivl_logic_name." << endl;
return net->name_; return net->name_;
} }
extern "C" const char* ivl_logic_basename(ivl_net_logic_t net) extern "C" const char* ivl_logic_basename(ivl_net_logic_t net)
{ {
return basename(net->scope_, net->name_); assert(net);
return net->name_;
} }
extern "C" ivl_scope_t ivl_logic_scope(ivl_net_logic_t net) extern "C" ivl_scope_t ivl_logic_scope(ivl_net_logic_t net)
@ -1188,6 +1190,16 @@ extern "C" ivl_memory_t ivl_scope_mem(ivl_scope_t net, unsigned idx)
return net->mem_[idx]; return net->mem_[idx];
} }
static unsigned scope_name_len(ivl_scope_t net)
{
unsigned len = 0;
for (ivl_scope_t cur = net ; cur ; cur = cur->parent)
len += strlen(cur->name_) + 1;
return len;
}
static void push_scope_basename(ivl_scope_t net, char*buf) static void push_scope_basename(ivl_scope_t net, char*buf)
{ {
if (net->parent == 0) { if (net->parent == 0) {
@ -1210,9 +1222,7 @@ extern "C" const char* ivl_scope_name(ivl_scope_t net)
ivl_scope_t cur; ivl_scope_t cur;
unsigned needlen = 0; unsigned needlen = scope_name_len(net);
for (cur = net ; cur ; cur = cur->parent)
needlen += strlen(cur->name_) + 1;
if (name_size < needlen) { if (name_size < needlen) {
name_buffer = (char*)realloc(name_buffer, needlen); name_buffer = (char*)realloc(name_buffer, needlen);
@ -1305,12 +1315,27 @@ extern "C" ivl_attribute_t ivl_signal_attr_val(ivl_signal_t net, unsigned idx)
extern "C" const char* ivl_signal_basename(ivl_signal_t net) extern "C" const char* ivl_signal_basename(ivl_signal_t net)
{ {
return basename(net->scope_, net->name_); return net->name_;
} }
extern "C" const char* ivl_signal_name(ivl_signal_t net) extern "C" const char* ivl_signal_name(ivl_signal_t net)
{ {
return net->name_; static char*name_buffer = 0;
static unsigned name_size = 0;
unsigned needlen = scope_name_len(net->scope_);
needlen += strlen(net->name_) + 2;
if (name_size < needlen) {
name_buffer = (char*)realloc(name_buffer, needlen);
name_size = needlen;
}
push_scope_basename(net->scope_, name_buffer);
strcat(name_buffer, ".");
strcat(name_buffer, net->name_);
return name_buffer;
} }
extern "C" ivl_nexus_t ivl_signal_pin(ivl_signal_t net, unsigned idx) extern "C" ivl_nexus_t ivl_signal_pin(ivl_signal_t net, unsigned idx)
@ -1708,6 +1733,9 @@ extern "C" ivl_variable_type_t ivl_variable_type(ivl_variable_t net)
/* /*
* $Log: t-dll-api.cc,v $ * $Log: t-dll-api.cc,v $
* Revision 1.93 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.92 2003/03/03 02:22:41 steve * Revision 1.92 2003/03/03 02:22:41 steve
* Scope names stored only as basename. * Scope names stored only as basename.
* *

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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: t-dll.cc,v 1.105 2003/03/03 02:22:41 steve Exp $" #ident "$Id: t-dll.cc,v 1.106 2003/03/06 00:28:42 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -608,7 +608,7 @@ bool dll_target::bufz(const NetBUFZ*net)
obj->scope_ = scope; obj->scope_ = scope;
obj->name_ = strings_.add(net->name()); obj->name_ = net->name();
logic_attributes(obj, net); logic_attributes(obj, net);
obj->delay[0] = net->rise_time(); obj->delay[0] = net->rise_time();
@ -665,7 +665,7 @@ void dll_target::variable(const NetVariable*net)
ivl_scope_t scope = find_scope(des_, net->scope()); ivl_scope_t scope = find_scope(des_, net->scope());
obj->type = IVL_VT_REAL; obj->type = IVL_VT_REAL;
obj->name = strings_.add(net->basename()); obj->name = net->basename();
obj->scope = scope; obj->scope = scope;
scope_add_var(scope, obj); scope_add_var(scope, obj);
@ -794,7 +794,7 @@ void dll_target::logic(const NetLogic*net)
assert(scope); assert(scope);
obj->scope_= scope; obj->scope_= scope;
obj->name_ = strings_.add(net->name()); obj->name_ = net->name();
logic_attributes(obj, net); logic_attributes(obj, net);
@ -829,7 +829,7 @@ void dll_target::net_case_cmp(const NetCaseCmp*net)
ivl_scope_t scope = des_.roots_[0]; ivl_scope_t scope = des_.roots_[0];
obj->scope_= scope; obj->scope_= scope;
obj->name_ = strings_.add(net->name()); obj->name_ = net->name();
obj->delay[0] = net->rise_time(); obj->delay[0] = net->rise_time();
obj->delay[1] = net->fall_time(); obj->delay[1] = net->fall_time();
@ -858,7 +858,7 @@ bool dll_target::net_function(const NetUserFunc*net)
{ {
struct ivl_lpm_s*obj = new struct ivl_lpm_s; struct ivl_lpm_s*obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_UFUNC; obj->type = IVL_LPM_UFUNC;
obj->name = strings_.add(net->name()); obj->name = net->name();
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -961,7 +961,7 @@ void dll_target::udp(const NetUDP*net)
assert(scope); assert(scope);
obj->scope_= scope; obj->scope_= scope;
obj->name_ = strings_.add(net->name()); obj->name_ = net->name();
obj->delay[0] = net->rise_time(); obj->delay[0] = net->rise_time();
obj->delay[1] = net->fall_time(); obj->delay[1] = net->fall_time();
@ -991,7 +991,7 @@ void dll_target::lpm_add_sub(const NetAddSub*net)
obj->type = IVL_LPM_SUB; obj->type = IVL_LPM_SUB;
else else
obj->type = IVL_LPM_ADD; obj->type = IVL_LPM_ADD;
obj->name = strings_.add(net->name()); obj->name = net->name(); // NetAddSub names are permallocated.
assert(net->scope()); assert(net->scope());
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1060,7 +1060,7 @@ void dll_target::lpm_clshift(const NetCLShift*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_SHIFTL; obj->type = IVL_LPM_SHIFTL;
obj->name = strings_.add(net->name()); obj->name = net->name();
assert(net->scope()); assert(net->scope());
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1136,7 +1136,7 @@ void dll_target::lpm_clshift(const NetCLShift*net)
void dll_target::lpm_compare(const NetCompare*net) void dll_target::lpm_compare(const NetCompare*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->name = strings_.add(net->name()); obj->name = net->name(); // NetCompare names are permallocated
assert(net->scope()); assert(net->scope());
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1248,7 +1248,7 @@ void dll_target::lpm_divide(const NetDivide*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_DIVIDE; obj->type = IVL_LPM_DIVIDE;
obj->name = strings_.add(net->name()); obj->name = net->name();
assert(net->scope()); assert(net->scope());
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1306,7 +1306,7 @@ void dll_target::lpm_modulo(const NetModulo*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_MOD; obj->type = IVL_LPM_MOD;
obj->name = strings_.add(net->name()); obj->name = net->name();
assert(net->scope()); assert(net->scope());
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1373,7 +1373,7 @@ void dll_target::lpm_ff(const NetFF*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_FF; obj->type = IVL_LPM_FF;
obj->name = strings_.add(net->name()); obj->name = net->name();
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1464,7 +1464,7 @@ void dll_target::lpm_ram_dq(const NetRamDq*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_RAM; obj->type = IVL_LPM_RAM;
obj->name = strings_.add(net->name()); obj->name = net->name();
obj->u_.ff.mem = find_memory(des_, net->mem()); obj->u_.ff.mem = find_memory(des_, net->mem());
assert(obj->u_.ff.mem); assert(obj->u_.ff.mem);
obj->scope = find_scope(des_, net->mem()->scope()); obj->scope = find_scope(des_, net->mem()->scope());
@ -1578,7 +1578,7 @@ void dll_target::lpm_mult(const NetMult*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_MULT; obj->type = IVL_LPM_MULT;
obj->name = strings_.add(net->name()); obj->name = net->name();
assert(net->scope()); assert(net->scope());
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1640,7 +1640,7 @@ void dll_target::lpm_mux(const NetMux*net)
{ {
ivl_lpm_t obj = new struct ivl_lpm_s; ivl_lpm_t obj = new struct ivl_lpm_s;
obj->type = IVL_LPM_MUX; obj->type = IVL_LPM_MUX;
obj->name = strings_.add(net->name()); obj->name = net->name(); // The NetMux perallocates its name.
obj->scope = find_scope(des_, net->scope()); obj->scope = find_scope(des_, net->scope());
assert(obj->scope); assert(obj->scope);
@ -1863,7 +1863,7 @@ void dll_target::signal(const NetNet*net)
{ {
ivl_signal_t obj = new struct ivl_signal_s; ivl_signal_t obj = new struct ivl_signal_s;
obj->name_ = strings_.add(net->name()); obj->name_ = net->name();
/* Attach the signal to the ivl_scope_t object that contains /* Attach the signal to the ivl_scope_t object that contains
it. This involves growing the sigs_ array in the scope it. This involves growing the sigs_ array in the scope
@ -2023,6 +2023,9 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
/* /*
* $Log: t-dll.cc,v $ * $Log: t-dll.cc,v $
* Revision 1.106 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.105 2003/03/03 02:22:41 steve * Revision 1.105 2003/03/03 02:22:41 steve
* Scope names stored only as basename. * Scope names stored only as basename.
* *
@ -2102,53 +2105,5 @@ extern const struct target tgt_dll = { "dll", &dll_target_obj };
* *
* Divide signal reference counts between rval * Divide signal reference counts between rval
* and lval references. * and lval references.
*
* Revision 1.83 2002/05/24 04:36:23 steve
* Verilog 2001 attriubtes on nets/wires.
*
* Revision 1.82 2002/05/23 03:08:51 steve
* Add language support for Verilog-2001 attribute
* syntax. Hook this support into existing $attribute
* handling, and add number and void value types.
*
* Add to the ivl_target API new functions for access
* of complex attributes attached to gates.
*
* Revision 1.81 2002/04/22 03:15:25 steve
* Keep delays applied to BUFZ devices.
*
* Revision 1.80 2002/03/09 02:10:22 steve
* Add the NetUserFunc netlist node.
*
* Revision 1.79 2002/01/23 04:54:37 steve
* Load modules with RTLD_LAZY
*
* Revision 1.78 2002/01/19 19:02:08 steve
* Pass back target errors processing conditionals.
*
* Revision 1.77 2002/01/12 04:03:09 steve
* Make BUFZ device strengths available.
*
* Revision 1.76 2002/01/06 03:15:43 steve
* Constant values have drive strengths.
*
* Revision 1.75 2002/01/03 04:19:01 steve
* Add structural modulus support down to vvp.
*
* Revision 1.74 2001/12/18 05:34:02 steve
* Comments about MUX synthesis.
*
* Revision 1.73 2001/12/15 02:13:17 steve
* The IVL_SIT_WIRE type does not exist, it is a
* synonym for IVL_SIT_TRI.
*
* Revision 1.72 2001/12/14 02:05:13 steve
* Parse and handle drive strengths of gates to vvp.
*
* Revision 1.71 2001/12/06 03:11:00 steve
* Add ivl_logic_delay function to ivl_target.
*
* Revision 1.70 2001/11/14 03:28:49 steve
* DLL target support for force and release.
*/ */

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
*/ */
#ifdef HAVE_CVS_IDENT #ifdef HAVE_CVS_IDENT
#ident "$Id: xnfio.cc,v 1.25 2003/01/30 16:23:08 steve Exp $" #ident "$Id: xnfio.cc,v 1.26 2003/03/06 00:28:42 steve Exp $"
#endif #endif
# include "config.h" # include "config.h"
@ -145,7 +145,7 @@ static NetLogic* make_obuf(Design*des, NetNet*net)
// of the netlist, to create a ring without a signal. Detect // of the netlist, to create a ring without a signal. Detect
// this case and create a new signal. // this case and create a new signal.
if (count_signals(buf->pin(1)) == 0) { if (count_signals(buf->pin(1)) == 0) {
NetNet*tmp = new NetNet(scope, des->local_symbol(scope->name()), NetNet*tmp = new NetNet(scope, scope->local_symbol(),
NetNet::WIRE); NetNet::WIRE);
tmp->local_flag(true); tmp->local_flag(true);
connect(buf->pin(1), tmp->pin(0)); connect(buf->pin(1), tmp->pin(0));
@ -362,6 +362,9 @@ void xnfio(Design*des)
/* /*
* $Log: xnfio.cc,v $ * $Log: xnfio.cc,v $
* Revision 1.26 2003/03/06 00:28:42 steve
* All NetObj objects have lex_string base names.
*
* Revision 1.25 2003/01/30 16:23:08 steve * Revision 1.25 2003/01/30 16:23:08 steve
* Spelling fixes. * Spelling fixes.
* *