NetObj constructor finally requires a scope.

This commit is contained in:
steve 2001-10-28 01:14:53 +00:00
parent 21194c909a
commit 874bab10e4
11 changed files with 139 additions and 256 deletions

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: cprop.cc,v 1.29 2001/07/25 03:10:48 steve Exp $"
#ident "$Id: cprop.cc,v 1.30 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -153,6 +153,7 @@ void cprop_functor::lpm_compare(Design*des, NetCompare*obj)
void cprop_functor::lpm_compare_eq_(Design*des, NetCompare*obj)
{
NetScope*scope = obj->scope();
/* First, look for the case where constant bits on matching A
and B inputs are different. This this is so, the device can
@ -167,7 +168,7 @@ void cprop_functor::lpm_compare_eq_(Design*des, NetCompare*obj)
driven_value(obj->pin_DataB(idx)))
continue;
NetConst*zero = new NetConst(obj->name(), verinum::V0);
NetConst*zero = new NetConst(scope, obj->name(), verinum::V0);
connect(zero->pin(0), obj->pin_AEB());
delete obj;
des->add_node(zero);
@ -204,7 +205,7 @@ void cprop_functor::lpm_compare_eq_(Design*des, NetCompare*obj)
/* If we wound up disconnecting all the inputs, then remove
the device and replace it with a constant. */
if (top == 0) {
NetConst*one = new NetConst(obj->name(), verinum::V1);
NetConst*one = new NetConst(scope, obj->name(), verinum::V1);
connect(one->pin(0), obj->pin_AEB());
delete obj;
des->add_node(one);
@ -215,7 +216,7 @@ void cprop_functor::lpm_compare_eq_(Design*des, NetCompare*obj)
/* If there is only one bit left, then replace the comparator
with a simple XOR gate. */
if (top == 1) {
NetLogic*tmp = new NetLogic(obj->scope(), obj->name(), 3,
NetLogic*tmp = new NetLogic(scope, obj->name(), 3,
NetLogic::XOR);
connect(tmp->pin(0), obj->pin_AEB());
connect(tmp->pin(1), obj->pin_DataA(0));
@ -230,7 +231,7 @@ void cprop_functor::lpm_compare_eq_(Design*des, NetCompare*obj)
if (top == obj->width())
return;
NetCompare*tmp = new NetCompare(obj->scope(), obj->name(), top);
NetCompare*tmp = new NetCompare(scope, obj->name(), top);
connect(tmp->pin_AEB(), obj->pin_AEB());
for (unsigned idx = 0 ; idx < top ; idx += 1) {
connect(tmp->pin_DataA(idx), obj->pin_DataA(idx));
@ -295,6 +296,8 @@ void cprop_functor::lpm_ff(Design*des, NetFF*obj)
void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
{
NetScope*scope = obj->scope();
switch (obj->type()) {
case NetLogic::NAND:
@ -336,10 +339,10 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetConst*tmp;
switch (obj->type()) {
case NetLogic::AND:
tmp = new NetConst(obj->name(), verinum::V0);
tmp = new NetConst(scope, obj->name(), verinum::V0);
break;
case NetLogic::NAND:
tmp = new NetConst(obj->name(), verinum::V1);
tmp = new NetConst(scope, obj->name(), verinum::V1);
break;
default:
assert(0);
@ -361,10 +364,10 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetConst*tmp;
switch (obj->type()) {
case NetLogic::AND:
tmp = new NetConst(obj->name(), verinum::V1);
tmp = new NetConst(scope, obj->name(), verinum::V1);
break;
case NetLogic::NAND:
tmp = new NetConst(obj->name(), verinum::V0);
tmp = new NetConst(scope, obj->name(), verinum::V0);
break;
default:
assert(0);
@ -384,7 +387,7 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
gate with a Vx. */
if (xs == (top-1)) {
NetConst*tmp;
tmp = new NetConst(obj->name(), verinum::Vx);
tmp = new NetConst(scope, obj->name(), verinum::Vx);
des->add_node(tmp);
tmp->pin(0).drive0(obj->pin(0).drive0());
tmp->pin(0).drive1(obj->pin(0).drive1());
@ -401,12 +404,12 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetLogic*tmp;
switch (obj->type()) {
case NetLogic::AND:
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::BUF);
break;
case NetLogic::NAND:
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::NOT);
break;
@ -427,7 +430,7 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
new [N]OR gate that has the right number of
inputs, connected in the right place. */
if (top < obj->pin_count()) {
NetLogic*tmp = new NetLogic(obj->scope(),
NetLogic*tmp = new NetLogic(scope,
obj->name(), top,
obj->type());
des->add_node(tmp);
@ -482,10 +485,10 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetConst*tmp;
switch (obj->type()) {
case NetLogic::OR:
tmp = new NetConst(obj->name(), verinum::V1);
tmp = new NetConst(scope, obj->name(), verinum::V1);
break;
case NetLogic::NOR:
tmp = new NetConst(obj->name(), verinum::V0);
tmp = new NetConst(scope, obj->name(), verinum::V0);
break;
default:
assert(0);
@ -507,10 +510,10 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetConst*tmp;
switch (obj->type()) {
case NetLogic::OR:
tmp = new NetConst(obj->name(), verinum::V0);
tmp = new NetConst(scope, obj->name(), verinum::V0);
break;
case NetLogic::NOR:
tmp = new NetConst(obj->name(), verinum::V1);
tmp = new NetConst(scope, obj->name(), verinum::V1);
break;
default:
assert(0);
@ -532,12 +535,12 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetLogic*tmp;
switch (obj->type()) {
case NetLogic::OR:
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::BUF);
break;
case NetLogic::NOR:
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::NOT);
break;
@ -558,7 +561,7 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
new [N]OR gate that has the right number of
inputs, connected in the right place. */
if (top < obj->pin_count()) {
NetLogic*tmp = new NetLogic(obj->scope(),
NetLogic*tmp = new NetLogic(scope,
obj->name(), top,
obj->type());
des->add_node(tmp);
@ -653,7 +656,7 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
verinum::V out = obj->type()==NetLogic::XNOR
? verinum::V1
: verinum::V0;
NetConst*tmp = new NetConst(obj->name(), out);
NetConst*tmp = new NetConst(scope, obj->name(), out);
des->add_node(tmp);
tmp->pin(0).drive0(obj->pin(0).drive0());
@ -681,11 +684,11 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetLogic*tmp;
if (obj->type() == NetLogic::XOR)
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::NOT);
else
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::BUF);
@ -706,11 +709,11 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
NetLogic*tmp;
if (obj->type() == NetLogic::XOR)
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::BUF);
else
tmp = new NetLogic(obj->scope(),
tmp = new NetLogic(scope,
obj->name(), 2,
NetLogic::NOT);
@ -728,7 +731,7 @@ void cprop_functor::lpm_logic(Design*des, NetLogic*obj)
new XOR gate that has the right number of
inputs, connected in the right place. */
if (top < obj->pin_count()) {
NetLogic*tmp = new NetLogic(obj->scope(),
NetLogic*tmp = new NetLogic(scope,
obj->name(), top,
obj->type());
des->add_node(tmp);
@ -939,6 +942,9 @@ void cprop(Design*des)
/*
* $Log: cprop.cc,v $
* Revision 1.30 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.29 2001/07/25 03:10:48 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elab_net.cc,v 1.76 2001/10/16 02:19:26 steve Exp $"
#ident "$Id: elab_net.cc,v 1.77 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -385,7 +385,8 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, const string&path,
NetNet*zero = 0;
if (lsig->pin_count() != rsig->pin_count()) {
NetConst*tmp = new NetConst(des->local_symbol(path), verinum::V0);
NetConst*tmp = new NetConst(scope, des->local_symbol(path),
verinum::V0);
des->add_node(tmp);
zero = new NetNet(scope, des->local_symbol(path), NetNet::WIRE);
connect(tmp->pin(0), zero->pin(0));
@ -441,7 +442,8 @@ NetNet* PEBinary::elaborate_net_cmp_(Design*des, const string&path,
(op_ == 'E')? NetLogic::AND : NetLogic::NAND);
connect(gate->pin(0), osig->pin(0));
for (unsigned idx = 0 ; idx < dwidth ; idx += 1) {
NetCaseCmp*cmp = new NetCaseCmp(des->local_symbol(path));
NetCaseCmp*cmp = new NetCaseCmp(scope,
des->local_symbol(path));
if (idx < lsig->pin_count())
connect(cmp->pin(1), lsig->pin(idx));
@ -621,7 +623,8 @@ NetNet* PEBinary::elaborate_net_div_(Design*des, const string&path,
// wire [7:0] r = a / b;
if (rwidth < osig->pin_count()) {
NetConst*tmp = new NetConst(des->local_symbol(path), verinum::V0);
NetConst*tmp = new NetConst(scope, des->local_symbol(path),
verinum::V0);
des->add_node(tmp);
for (unsigned idx = rwidth ; idx < osig->pin_count() ; idx += 1)
connect(osig->pin(idx), tmp->pin(0));
@ -649,7 +652,7 @@ NetNet* PEBinary::elaborate_net_mod_(Design*des, const string&path,
unsigned rwidth = lsig->pin_count();
if (rsig->pin_count() > rwidth)
rwidth = rsig->pin_count();
NetModulo*mod = new NetModulo(des->local_symbol(path), rwidth,
NetModulo*mod = new NetModulo(scope, des->local_symbol(path), rwidth,
lsig->pin_count(),
rsig->pin_count());
des->add_node(mod);
@ -673,7 +676,8 @@ NetNet* PEBinary::elaborate_net_mod_(Design*des, const string&path,
/* If the lvalue is larger then the result, then pad the
output with constant 0. */
if (cnt < osig->pin_count()) {
NetConst*tmp = new NetConst(des->local_symbol(path), verinum::V0);
NetConst*tmp = new NetConst(scope, des->local_symbol(path),
verinum::V0);
des->add_node(tmp);
for (unsigned idx = cnt ; idx < osig->pin_count() ; idx += 1)
connect(osig->pin(idx), tmp->pin(0));
@ -810,7 +814,8 @@ NetNet* PEBinary::elaborate_net_mul_(Design*des, const string&path,
/* If the lvalue is larger then the result, then pad the
output with constant 0. */
if (cnt < osig->pin_count()) {
NetConst*tmp = new NetConst(des->local_symbol(path), verinum::V0);
NetConst*tmp = new NetConst(scope, des->local_symbol(path),
verinum::V0);
des->add_node(tmp);
for (unsigned idx = cnt ; idx < osig->pin_count() ; idx += 1)
connect(osig->pin(idx), tmp->pin(0));
@ -851,7 +856,8 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, const string&path,
NetNet::WIRE, lwidth);
osig->local_flag(true);
NetConst*zero = new NetConst(des->local_symbol(path), verinum::V0);
NetConst*zero = new NetConst(scope, des->local_symbol(path),
verinum::V0);
des->add_node(zero);
if (op_ == 'l') {
@ -904,7 +910,8 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, const string&path,
connect(lsig->pin(idx), gate->pin_Data(idx));
if (lsig->pin_count() < lwidth) {
NetConst*zero = new NetConst(des->local_symbol(path), verinum::V0);
NetConst*zero = new NetConst(scope, des->local_symbol(path),
verinum::V0);
NetTmp*tmp = new NetTmp(scope, des->local_symbol(path));
des->add_node(zero);
connect(zero->pin(0), tmp->pin(0));
@ -919,7 +926,8 @@ NetNet* PEBinary::elaborate_net_shift_(Design*des, const string&path,
if (op_ == 'r') {
NetTmp*tmp = new NetTmp(scope, des->local_symbol(path));
NetConst*dir = new NetConst(des->local_symbol(path), verinum::V1);
NetConst*dir = new NetConst(scope, des->local_symbol(path),
verinum::V1);
connect(dir->pin(0), gate->pin_Direction());
connect(tmp->pin(0), gate->pin_Direction());
des->add_node(dir);
@ -1063,7 +1071,8 @@ NetNet* PEIdent::elaborate_net(Design*des, const string&path,
verinum pvalue = pc->value();
sig = new NetNet(scope, path+"."+text_, NetNet::IMPLICIT,
pc->expr_width());
NetConst*cp = new NetConst(des->local_symbol(path), pvalue);
NetConst*cp = new NetConst(scope, des->local_symbol(path),
pvalue);
des->add_node(cp);
for (unsigned idx = 0; idx < sig->pin_count(); idx += 1)
connect(sig->pin(idx), cp->pin(idx));
@ -1207,7 +1216,7 @@ NetNet* PEIdent::elaborate_net_ram_(Design*des, const string&path,
return 0;
NetRamDq*ram = new NetRamDq(des->local_symbol(mem->name()),
NetRamDq*ram = new NetRamDq(scope, des->local_symbol(mem->name()),
mem, adr->pin_count());
des->add_node(ram);
@ -1480,7 +1489,8 @@ NetNet* PENumber::elaborate_net(Design*des, const string&path,
for (idx = 0 ; idx < num.len() && idx < value_->len(); idx += 1)
num.set(idx, value_->get(idx));
NetConst*tmp = new NetConst(des->local_symbol(path), num);
NetConst*tmp = new NetConst(scope, des->local_symbol(path),
num);
for (idx = 0 ; idx < net->pin_count() ; idx += 1) {
tmp->pin(idx).drive0(drive0);
tmp->pin(idx).drive1(drive1);
@ -1498,7 +1508,8 @@ NetNet* PENumber::elaborate_net(Design*des, const string&path,
NetNet*net = new NetNet(scope, des->local_symbol(path),
NetNet::IMPLICIT, value_->len());
net->local_flag(true);
NetConst*tmp = new NetConst(des->local_symbol(path), *value_);
NetConst*tmp = new NetConst(scope, des->local_symbol(path),
*value_);
for (unsigned idx = 0 ; idx < value_->len() ; idx += 1)
connect(net->pin(idx), tmp->pin(idx));
@ -1506,15 +1517,6 @@ NetNet* PENumber::elaborate_net(Design*des, const string&path,
return net;
}
#if 0
/* This warning is trying to catch the cases where an unsized
integer in a netlist causes the netlist to explode in width
even when it need not. This proved to be spurious and
caused lots of false alarms, so it is commented out. */
cerr << get_line() << ": warning: Number with indefinite size "
<< "in self-determined context." << endl;
#endif
/* None of the above tight constraints are present, so make a
plausible choice for the width. Try to reduce the width as
much as possible by eliminating high zeros of unsigned
@ -1543,7 +1545,7 @@ NetNet* PENumber::elaborate_net(Design*des, const string&path,
NetNet*net = new NetNet(scope, des->local_symbol(path),
NetNet::IMPLICIT, width);
net->local_flag(true);
NetConst*tmp = new NetConst(des->local_symbol(path), num);
NetConst*tmp = new NetConst(scope, des->local_symbol(path), num);
for (unsigned idx = 0 ; idx < width ; idx += 1)
connect(net->pin(idx), tmp->pin(idx));
@ -1663,7 +1665,7 @@ NetNet* PETernary::elaborate_net(Design*des, const string&path,
if (dwidth < width) {
verinum vpad (verinum::V0, width-dwidth);
NetConst*pad = new NetConst(des->local_symbol(path), vpad);
NetConst*pad = new NetConst(scope, des->local_symbol(path), vpad);
des->add_node(pad);
for (unsigned idx = dwidth ; idx < width ; idx += 1)
connect(sig->pin(idx), pad->pin(idx-dwidth));
@ -1711,7 +1713,7 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path,
sig->local_flag(true);
verinum tmp(v_not(*val) + verinum(1UL, width), width);
NetConst*con = new NetConst(des->local_symbol(path), tmp);
NetConst*con = new NetConst(scope, des->local_symbol(path), tmp);
for (unsigned idx = 0 ; idx < width ; idx += 1)
connect(sig->pin(idx), con->pin(idx));
@ -1897,6 +1899,9 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path,
/*
* $Log: elab_net.cc,v $
* Revision 1.77 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.76 2001/10/16 02:19:26 steve
* Support IVL_LPM_DIVIDE for structural divide.
*
@ -2024,143 +2029,5 @@ NetNet* PEUnary::elaborate_net(Design*des, const string&path,
* Module ports are really special PEIdent
* expressions, because a name can be used
* many places in the port list.
*
* Revision 1.36 2000/05/07 20:48:14 steve
* Properly elaborate repeat concatenations.
*
* Revision 1.35 2000/05/07 19:40:26 steve
* Fix connection of Direction of LMP_CLSHIFT
* to constant values. Remember to add a signal
* to the nexus and connect the receiver in vvm.
*
* Revision 1.34 2000/05/07 04:37:56 steve
* Carry strength values from Verilog source to the
* pform and netlist for gates.
*
* Change vvm constants to use the driver_t to drive
* a constant value. This works better if there are
* multiple drivers on a signal.
*
* Revision 1.33 2000/05/03 21:21:36 steve
* Allow ternary result to be padded to result width.
*
* Revision 1.32 2000/05/02 03:13:31 steve
* Move memories to the NetScope object.
*
* Revision 1.31 2000/05/02 00:58:11 steve
* Move signal tables to the NetScope class.
*
* Revision 1.30 2000/04/28 21:00:29 steve
* Over agressive signal elimination in constant probadation.
*
* Revision 1.29 2000/04/01 21:40:22 steve
* Add support for integer division.
*
* Revision 1.28 2000/03/27 04:38:15 steve
* Speling error.
*
* Revision 1.27 2000/03/20 17:54:10 steve
* Remove dangerous tmp signal delete.
*
* Revision 1.26 2000/03/17 21:50:25 steve
* Switch to control warnings.
*
* Revision 1.25 2000/03/16 19:03:03 steve
* Revise the VVM backend to use nexus objects so that
* drivers and resolution functions can be used, and
* the t-vvm module doesn't need to write a zillion
* output functions.
*
* Revision 1.24 2000/03/08 04:36:53 steve
* Redesign the implementation of scopes and parameters.
* I now generate the scopes and notice the parameters
* in a separate pass over the pform. Once the scopes
* are generated, I can process overrides and evalutate
* paremeters before elaboration begins.
*
* Revision 1.23 2000/02/23 02:56:54 steve
* Macintosh compilers do not support ident.
*
* Revision 1.22 2000/02/16 03:58:27 steve
* Fix up width matching in structural bitwise operators.
*
* Revision 1.21 2000/02/14 06:04:52 steve
* Unary reduction operators do not set their operand width
*
* Revision 1.20 2000/01/18 04:53:40 steve
* Support structural XNOR.
*
* Revision 1.19 2000/01/13 03:35:35 steve
* Multiplication all the way to simulation.
*
* Revision 1.18 2000/01/11 04:20:57 steve
* Elaborate net widths of constants to as small
* as is possible, obeying context constraints.
*
* Comparison operators can handle operands with
* different widths.
*
* Revision 1.17 2000/01/02 22:07:09 steve
* Add a signal to nexus of padding constant.
*
* Revision 1.16 2000/01/02 21:45:31 steve
* Add structural reduction NAND,
* Fix size coercion of structural shifts.
*
* Revision 1.15 2000/01/02 19:39:03 steve
* Structural reduction XNOR.
*
* Revision 1.14 1999/12/17 03:38:46 steve
* NetConst can now hold wide constants.
*
* Revision 1.13 1999/12/16 03:46:39 steve
* Structural logical or.
*
* Revision 1.12 1999/12/16 02:42:14 steve
* Simulate carry output on adders.
*
* Revision 1.11 1999/12/02 04:08:10 steve
* Elaborate net repeat concatenations.
*
* Revision 1.10 1999/11/30 04:33:41 steve
* Put implicitly defined signals in the scope.
*
* Revision 1.9 1999/11/27 19:07:57 steve
* Support the creation of scopes.
*
* Revision 1.8 1999/11/21 17:35:37 steve
* Memory name lookup handles scopes.
*
* Revision 1.7 1999/11/21 00:13:08 steve
* Support memories in continuous assignments.
*
* Revision 1.6 1999/11/14 23:43:45 steve
* Support combinatorial comparators.
*
* Revision 1.5 1999/11/14 20:24:28 steve
* Add support for the LPM_CLSHIFT device.
*
* Revision 1.4 1999/11/05 23:36:31 steve
* Forgot to return the mux for use after elaboration.
*
* Revision 1.3 1999/11/05 21:45:19 steve
* Fix NetConst being set to zero width, and clean
* up elaborate_set_cmp_ for NetEBinary.
*
* Revision 1.2 1999/11/04 03:53:26 steve
* Patch to synthesize unary ~ and the ternary operator.
* Thanks to Larry Doolittle <LRDoolittle@lbl.gov>.
*
* Add the LPM_MUX device, and integrate it with the
* ternary synthesis from Larry. Replace the lpm_mux
* generator in t-xnf.cc to use XNF EQU devices to
* put muxs into function units.
*
* Rewrite elaborate_net for the PETernary class to
* also use the LPM_MUX device.
*
* Revision 1.1 1999/10/31 20:08:24 steve
* Include subtraction in LPM_ADD_SUB device.
*
*/

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: elaborate.cc,v 1.226 2001/10/22 23:26:37 steve Exp $"
#ident "$Id: elaborate.cc,v 1.227 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -128,7 +128,8 @@ void PGAssign::elaborate(Design*des, const string&path) const
if (cnt < lval->pin_count()) {
verinum tmpv (0UL, lval->pin_count()-cnt);
NetConst*tmp = new NetConst(des->local_symbol(path),
NetConst*tmp = new NetConst(scope,
des->local_symbol(path),
tmpv);
des->add_node(tmp);
for (idx = cnt ; idx < lval->pin_count() ; idx += 1)
@ -151,7 +152,8 @@ void PGAssign::elaborate(Design*des, const string&path) const
}
if (cnt < lval->pin_count()) {
NetConst*dev = new NetConst(des->local_symbol(path),
NetConst*dev = new NetConst(scope,
des->local_symbol(path),
verinum::V0);
des->add_node(dev);
@ -1511,7 +1513,7 @@ NetCAssign* PCAssign::elaborate(Design*des, const string&path) const
if (rval->pin_count() < lval->pin_count())
rval = pad_to_width(des, rval, lval->pin_count());
NetCAssign* dev = new NetCAssign(des->local_symbol(path), lval);
NetCAssign* dev = new NetCAssign(scope, des->local_symbol(path), lval);
dev->set_line(*this);
des->add_node(dev);
@ -1762,7 +1764,8 @@ NetProc* PEventStatement::elaborate_st(Design*des, const string&path,
NetEvWait*we = new NetEvWait(0);
we->add_event(ev);
NetEvProbe*po = new NetEvProbe(path+"."+scope->local_symbol(),
NetEvProbe*po = new NetEvProbe(scope,
path+"."+scope->local_symbol(),
ev, NetEvProbe::POSEDGE, 1);
connect(po->pin(0), ex->pin(0));
@ -1856,17 +1859,17 @@ NetProc* PEventStatement::elaborate_st(Design*des, const string&path,
NetEvProbe*pr;
switch (expr_[idx]->type()) {
case PEEvent::POSEDGE:
pr = new NetEvProbe(des->local_symbol(path), ev,
pr = new NetEvProbe(scope, des->local_symbol(path), ev,
NetEvProbe::POSEDGE, pins);
break;
case PEEvent::NEGEDGE:
pr = new NetEvProbe(des->local_symbol(path), ev,
pr = new NetEvProbe(scope, des->local_symbol(path), ev,
NetEvProbe::NEGEDGE, pins);
break;
case PEEvent::ANYEDGE:
pr = new NetEvProbe(des->local_symbol(path), ev,
pr = new NetEvProbe(scope, des->local_symbol(path), ev,
NetEvProbe::ANYEDGE, pins);
break;
@ -1945,7 +1948,7 @@ NetProc* PForce::elaborate(Design*des, const string&path) const
if (rval->pin_count() < lval->pin_count())
rval = pad_to_width(des, rval, lval->pin_count());
NetForce* dev = new NetForce(des->local_symbol(path), lval);
NetForce* dev = new NetForce(scope, des->local_symbol(path), lval);
des->add_node(dev);
for (unsigned idx = 0 ; idx < dev->pin_count() ; idx += 1)
@ -2401,6 +2404,9 @@ Design* elaborate(list<const char*>roots)
/*
* $Log: elaborate.cc,v $
* Revision 1.227 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.226 2001/10/22 23:26:37 steve
* Better error message for mising root module.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: expr_synth.cc,v 1.27 2001/10/20 05:21:51 steve Exp $"
#ident "$Id: expr_synth.cc,v 1.28 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -396,7 +396,7 @@ NetNet* NetEConst::synthesize(Design*des)
NetNet*osig = new NetNet(scope, path, NetNet::IMPLICIT, width);
osig->local_flag(true);
NetConst*con = new NetConst(des->local_symbol(path), value());
NetConst*con = new NetConst(scope, des->local_symbol(path), value());
for (unsigned idx = 0 ; idx < width; idx += 1)
connect(osig->pin(idx), con->pin(idx));
@ -562,6 +562,9 @@ NetNet* NetESignal::synthesize(Design*des)
/*
* $Log: expr_synth.cc,v $
* Revision 1.28 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.27 2001/10/20 05:21:51 steve
* Scope/module names are char* instead of string.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: net_event.cc,v 1.15 2001/07/25 03:10:49 steve Exp $"
#ident "$Id: net_event.cc,v 1.16 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -283,9 +283,9 @@ const NetEvent* NetEvTrig::event() const
return event_;
}
NetEvProbe::NetEvProbe(const string&n, NetEvent*tgt,
NetEvProbe::NetEvProbe(NetScope*s, const string&n, NetEvent*tgt,
edge_t t, unsigned p)
: NetNode(n, p), event_(tgt), edge_(t)
: NetNode(s, n, p), event_(tgt), edge_(t)
{
for (unsigned idx = 0 ; idx < p ; idx += 1) {
pin(idx).set_dir(Link::INPUT);
@ -451,6 +451,9 @@ NetProc* NetEvWait::statement()
/*
* $Log: net_event.cc,v $
* Revision 1.16 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.15 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: net_force.cc,v 1.3 2001/07/25 03:10:49 steve Exp $"
#ident "$Id: net_force.cc,v 1.4 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -44,8 +44,8 @@
* output pins to connect to the netlist? But that would cause the
* link ring to grow, and that is not quite correct either. Hmm...
*/
NetCAssign::NetCAssign(const string&n, NetNet*l)
: NetNode(n, l->pin_count()), lval_(l)
NetCAssign::NetCAssign(NetScope*s, const string&n, NetNet*l)
: NetNode(s, n, l->pin_count()), lval_(l)
{
lval_->incr_eref();
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
@ -81,8 +81,8 @@ const NetNet*NetDeassign::lval() const
return lval_;
}
NetForce::NetForce(const string&n, NetNet*l)
: NetNode(n, l->pin_count()), lval_(l)
NetForce::NetForce(NetScope*s, const string&n, NetNet*l)
: NetNode(s, n, l->pin_count()), lval_(l)
{
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
pin(idx).set_dir(Link::INPUT);
@ -117,6 +117,9 @@ const NetNet*NetRelease::lval() const
/*
* $Log: net_force.cc,v $
* Revision 1.4 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.3 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: net_modulo.cc,v 1.2 2001/07/25 03:10:49 steve Exp $"
#ident "$Id: net_modulo.cc,v 1.3 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -30,9 +30,9 @@
# include "netlist.h"
NetModulo::NetModulo(const string&n, unsigned wr,
NetModulo::NetModulo(NetScope*s, const string&n, unsigned wr,
unsigned wa, unsigned wb)
: NetNode(n, wr+wa+wb), width_r_(wr), width_a_(wa), width_b_(wb)
: NetNode(s, n, wr+wa+wb), width_r_(wr), width_a_(wa), width_b_(wb)
{
unsigned p = 0;
for (unsigned idx = 0 ; idx < width_r_ ; idx += 1, p += 1) {

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: netlist.cc,v 1.173 2001/10/16 02:19:27 steve Exp $"
#ident "$Id: netlist.cc,v 1.174 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -163,19 +163,6 @@ Link* find_next_output(Link*lnk)
return 0;
}
NetObj::NetObj(const string&n, unsigned np)
: scope_(0), 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 string&n, unsigned np)
: scope_(s), npins_(np), delay1_(0), delay2_(0), delay3_(0)
{
@ -266,11 +253,6 @@ const Link& NetObj::pin(unsigned idx) const
return pins_[idx];
}
NetNode::NetNode(const string&n, unsigned npins)
: NetObj(n, npins), node_next_(0), node_prev_(0), design_(0)
{
}
NetNode::NetNode(NetScope*s, const string&n, unsigned npins)
: NetObj(s, n, npins), node_next_(0), node_prev_(0), design_(0)
{
@ -1277,8 +1259,8 @@ const Link& NetMux::pin_Data(unsigned w, unsigned s) const
}
NetRamDq::NetRamDq(const string&n, NetMemory*mem, unsigned awid)
: NetNode(n, 3+2*mem->width()+awid), mem_(mem), awidth_(awid)
NetRamDq::NetRamDq(NetScope*s, const string&n, NetMemory*mem, unsigned awid)
: NetNode(s, n, 3+2*mem->width()+awid), mem_(mem), awidth_(awid)
{
pin(0).set_dir(Link::INPUT); pin(0).set_name("InClock", 0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("OutClock", 0);
@ -1589,8 +1571,8 @@ void NetCase::set_case(unsigned idx, NetExpr*e, NetProc*p)
items_[idx].guard->set_width(expr_->expr_width());
}
NetCaseCmp::NetCaseCmp(const string&n)
: NetNode(n, 3)
NetCaseCmp::NetCaseCmp(NetScope*s, const string&n)
: NetNode(s, n, 3)
{
pin(0).set_dir(Link::OUTPUT); pin(0).set_name("O",0);
pin(1).set_dir(Link::INPUT); pin(1).set_name("I",0);
@ -1639,8 +1621,8 @@ NetProc* NetCondit::else_clause()
return else_;
}
NetConst::NetConst(const string&n, verinum::V v)
: NetNode(n, 1)
NetConst::NetConst(NetScope*s, const string&n, verinum::V v)
: NetNode(s, n, 1)
{
pin(0).set_dir(Link::OUTPUT);
pin(0).set_name("O", 0);
@ -1648,8 +1630,8 @@ NetConst::NetConst(const string&n, verinum::V v)
value_[0] = v;
}
NetConst::NetConst(const string&n, const verinum&val)
: NetNode(n, val.len())
NetConst::NetConst(NetScope*s, const string&n, const verinum&val)
: NetNode(s, n, val.len())
{
value_ = new verinum::V[pin_count()];
for (unsigned idx = 0 ; idx < pin_count() ; idx += 1) {
@ -2429,6 +2411,9 @@ const NetProc*NetTaskDef::proc() const
/*
* $Log: netlist.cc,v $
* Revision 1.174 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.173 2001/10/16 02:19:27 steve
* Support IVL_LPM_DIVIDE for structural divide.
*

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: netlist.h,v 1.218 2001/10/20 05:21:51 steve Exp $"
#ident "$Id: netlist.h,v 1.219 2001/10/28 01:14:53 steve Exp $"
#endif
/*
@ -80,7 +80,6 @@ class NetObj {
public:
public:
explicit NetObj(const string&n, unsigned npins);
explicit NetObj(NetScope*s, const string&n, unsigned npins);
explicit NetObj(NetScope*s, const char*n, unsigned npins);
virtual ~NetObj();
@ -284,7 +283,6 @@ class NetNode : public NetObj {
public:
explicit NetNode(NetScope*s, const string&n, unsigned npins);
explicit NetNode(NetScope*s, const char*n, unsigned npins);
explicit NetNode(const string&n, unsigned npins);
virtual ~NetNode();
@ -563,7 +561,8 @@ class NetDivide : public NetNode {
class NetModulo : public NetNode {
public:
NetModulo(const string&n, unsigned width, unsigned wa, unsigned wb);
NetModulo(NetScope*s, const string&n,
unsigned width, unsigned wa, unsigned wb);
~NetModulo();
unsigned width_r() const;
@ -776,7 +775,7 @@ class NetMux : public NetNode {
class NetRamDq : public NetNode {
public:
NetRamDq(const string&name, NetMemory*mem, unsigned awid);
NetRamDq(NetScope*s, const string&name, NetMemory*mem, unsigned awid);
~NetRamDq();
unsigned width() const;
@ -959,7 +958,7 @@ class NetBUFZ : public NetNode {
class NetCaseCmp : public NetNode {
public:
explicit NetCaseCmp(const string&n);
explicit NetCaseCmp(NetScope*s, const string&n);
~NetCaseCmp();
virtual void dump_node(ostream&, unsigned ind) const;
@ -977,8 +976,8 @@ class NetCaseCmp : public NetNode {
class NetConst : public NetNode {
public:
explicit NetConst(const string&n, verinum::V v);
explicit NetConst(const string&n, const verinum&val);
explicit NetConst(NetScope*s, const string&n, verinum::V v);
explicit NetConst(NetScope*s, const string&n, const verinum&val);
~NetConst();
verinum::V value(unsigned idx) const;
@ -1416,7 +1415,7 @@ class NetCase : public NetProc {
class NetCAssign : public NetProc, public NetNode {
public:
explicit NetCAssign(const string&n, NetNet*l);
explicit NetCAssign(NetScope*s, const string&n, NetNet*l);
~NetCAssign();
const Link& lval_pin(unsigned) const;
@ -1661,8 +1660,8 @@ class NetEvProbe : public NetNode {
public:
enum edge_t { ANYEDGE, POSEDGE, NEGEDGE };
explicit NetEvProbe(const string&n, NetEvent*tgt,
edge_t t, unsigned p);
explicit NetEvProbe(NetScope*s, const string&n,
NetEvent*tgt, edge_t t, unsigned p);
~NetEvProbe();
edge_t edge() const;
@ -1692,7 +1691,7 @@ class NetEvProbe : public NetNode {
class NetForce : public NetProc, public NetNode {
public:
explicit NetForce(const string&n, NetNet*l);
explicit NetForce(NetScope*s, const string&n, NetNet*l);
~NetForce();
const Link& lval_pin(unsigned) const;
@ -2850,6 +2849,9 @@ extern ostream& operator << (ostream&, NetNet::Type);
/*
* $Log: netlist.h,v $
* Revision 1.219 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.218 2001/10/20 05:21:51 steve
* Scope/module names are char* instead of string.
*

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: pad_to_width.cc,v 1.8 2001/07/25 03:10:49 steve Exp $"
#ident "$Id: pad_to_width.cc,v 1.9 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -57,7 +57,9 @@ NetNet*pad_to_width(Design*des, NetNet*net, unsigned wid)
return net;
verinum pad(verinum::V0, wid - net->pin_count());
NetConst*con = new NetConst(path + "." + scope->local_symbol(), pad);
NetConst*con = new NetConst(scope,
path + "." + scope->local_symbol(),
pad);
des->add_node(con);
NetNet*tmp = new NetNet(scope, path + "." + scope->local_symbol(),
@ -74,6 +76,9 @@ NetNet*pad_to_width(Design*des, NetNet*net, unsigned wid)
/*
* $Log: pad_to_width.cc,v $
* Revision 1.9 2001/10/28 01:14:53 steve
* NetObj constructor finally requires a scope.
*
* Revision 1.8 2001/07/25 03:10:49 steve
* Create a config.h.in file to hold all the config
* junk, and support gcc 3.0. (Stephan Boettcher)

View File

@ -19,7 +19,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
#if !defined(WINNT) && !defined(macintosh)
#ident "$Id: syn-rules.y,v 1.14 2001/08/25 23:50:03 steve Exp $"
#ident "$Id: syn-rules.y,v 1.15 2001/10/28 01:14:53 steve Exp $"
#endif
# include "config.h"
@ -178,14 +178,17 @@ static void make_RAM_CE(Design*des, NetProcTop*top, NetEvWait*wclk,
NetNet*adr = adr_e->synthesize(des);
assert(adr);
NetScope*scope = adr->scope();
assert(scope);
NetEvProbe*pclk = eclk->probe(0);
NetESignal*d = dynamic_cast<NetESignal*> (asn->rval());
NetNet*ce = cexp? cexp->synthesize(des) : 0;
assert(d);
NetRamDq*ram = new NetRamDq(des->local_symbol(mem->name()), mem,
adr->pin_count());
NetRamDq*ram = new NetRamDq(scope, des->local_symbol(mem->name()),
mem, adr->pin_count());
for (unsigned idx = 0 ; idx < adr->pin_count() ; idx += 1)
connect(adr->pin(idx), ram->pin_Address(idx));