Skip to content

Commit

Permalink
Assign automatic lifetime to ports
Browse files Browse the repository at this point in the history
Signed-off-by: Ryszard Rozak <[email protected]>
  • Loading branch information
RRozak committed Oct 30, 2023
1 parent fc7444e commit 523df77
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/V3LinkParse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,10 @@ class LinkParseVisitor final : public VNVisitor {
nodep->v3warn(STATICVAR, "Static variable with assignment declaration declared in a "
"loop converted to automatic");
}
if (nodep->lifetime().isNone() && nodep->varType() != VVarType::PORT) {
nodep->lifetime(m_lifetime);
if (nodep->varType() != VVarType::PORT) {
if (nodep->lifetime().isNone()) nodep->lifetime(m_lifetime);
} else {
nodep->lifetime(VLifetime::AUTOMATIC);
}

if (nodep->isGParam() && !nodep->isAnsi()) { // shadow some parameters into localparams
Expand Down

0 comments on commit 523df77

Please sign in to comment.