Net arrays that are addressed are not dangling

The nodangle functor tries to delete NetNet objects that are not used.
But NetNet objects that are addressed by a NetArrayDq should never be
dangling. So make sure the NetArrayDq marks the target NetNet correctly.
This commit is contained in:
Stephen Williams 2008-01-15 19:39:53 -08:00
parent e46f8220f3
commit 59ee700634
2 changed files with 4 additions and 0 deletions

View File

@ -1217,6 +1217,7 @@ void Design::dump(ostream&o) const
if (nodes_) {
NetNode*cur = nodes_->node_next_;
do {
assert(cur);
cur->dump_node(o, 0);
cur = cur->node_next_;
} while (cur != nodes_->node_next_);

View File

@ -1132,6 +1132,9 @@ NetArrayDq::NetArrayDq(NetScope*s, perm_string n, NetNet*mem, unsigned awid)
pin(0).set_name(perm_string::literal("Result"), 0);
pin(1).set_dir(Link::INPUT);
pin(1).set_name(perm_string::literal("Address"), 0);
// Increment the expression reference count for the target
// memory so that it is not deleted underneath me.
mem->incr_eref();
}
NetArrayDq::~NetArrayDq()