Allow elaborate_expr to handle implicit nets.

When the elaborate_expr code is used for expressions of continuous
assignments, it needs to be able to create implicit nets.
This commit is contained in:
Stephen Williams 2008-08-17 08:22:42 -07:00
parent a8ad505af7
commit 0de2dcb211
2 changed files with 20 additions and 0 deletions

View File

@ -1078,6 +1078,22 @@ NetExpr* PEIdent::elaborate_expr(Design*des, NetScope*scope,
}
}
if (error_implicit==false
&& sys_task_arg==false
&& path_.size()==1
&& scope->default_nettype() != NetNet::NONE) {
NetNet::Type nettype = scope->default_nettype();
net = new NetNet(scope, peek_tail_name(path_), nettype, 1);
net->data_type(IVL_VT_LOGIC);
net->set_line(*this);
if (warn_implicit) {
cerr << get_fileline() << ": warning: implicit "
"definition of wire " << scope_path(scope)
<< "." << peek_tail_name(path_) << "." << endl;
}
return elaborate_expr_net(des, scope, net, scope, sys_task_arg);
}
// At this point we've exhausted all the possibilities that
// are not scopes. If this is not a system task argument, then
// it cannot be a scope name, so give up.

View File

@ -3494,6 +3494,7 @@ static void elaborate_tasks(Design*des, NetScope*scope,
bool Module::elaborate(Design*des, NetScope*scope) const
{
bool result_flag = true;
error_implicit = true;
if (gn_specify_blocks_flag) {
// Elaborate specparams
@ -3558,6 +3559,7 @@ bool Module::elaborate(Design*des, NetScope*scope) const
// complex.
const list<PGate*>&gl = get_gates();
error_implicit = false;
for (list<PGate*>::const_iterator gt = gl.begin()
; gt != gl.end()
; gt ++ ) {
@ -3565,6 +3567,8 @@ bool Module::elaborate(Design*des, NetScope*scope) const
(*gt)->elaborate(des, scope);
}
error_implicit = true;
// Elaborate the behaviors, making processes out of them. This
// involves scanning the PProcess* list, creating a NetProcTop
// for each process.