Skip to content

Commit

Permalink
Make reg initializations account for generated scope.
Browse files Browse the repository at this point in the history
During parse, reg initialization may be in generated scopes. Handle
that properly.
  • Loading branch information
steveicarus committed Jun 15, 2008
1 parent 30d42e2 commit 05f1541
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pform.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,7 @@ void pform_make_pgassign_list(svector<PExpr*>*alist,
void pform_make_reginit(const struct vlltype&li,
perm_string name, PExpr*expr)
{
PWire*cur = lexical_scope->wires_find(name);
PWire*cur = pform_get_wire_in_scope(name);
if (cur == 0) {
VLerror(li, "internal error: reginit to non-register?");
delete expr;
Expand All @@ -1250,7 +1250,10 @@ void pform_make_reginit(const struct vlltype&li,
PProcess*top = new PProcess(PProcess::PR_INITIAL, ass);
FILE_NAME(top, li);

lexical_scope->behaviors.push_back(top);
if (pform_cur_generate)
pform_cur_generate->add_behavior(top);
else
lexical_scope->behaviors.push_back(top);
}

/*
Expand Down

0 comments on commit 05f1541

Please sign in to comment.