Set lifetime to static
Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
parent
6873dc2f63
commit
add4ec6e80
|
|
@ -434,6 +434,7 @@ class DynScopeVisitor final : public VNVisitor {
|
||||||
void visit(AstVarRef* nodep) override {
|
void visit(AstVarRef* nodep) override {
|
||||||
ForkDynScopeFrame* const framep = frameOf(nodep->varp());
|
ForkDynScopeFrame* const framep = frameOf(nodep->varp());
|
||||||
if (!framep) return;
|
if (!framep) return;
|
||||||
|
UINFO(0, "IS AUTO " << nodep->varp()->lifetime());
|
||||||
if (needsDynScope(nodep)) {
|
if (needsDynScope(nodep)) {
|
||||||
bool isEvent = false;
|
bool isEvent = false;
|
||||||
if (AstBasicDType* const dtypep = VN_CAST(nodep->dtypep()->skipRefp(), BasicDType)) {
|
if (AstBasicDType* const dtypep = VN_CAST(nodep->dtypep()->skipRefp(), BasicDType)) {
|
||||||
|
|
@ -448,7 +449,7 @@ class DynScopeVisitor final : public VNVisitor {
|
||||||
"Writing to an "
|
"Writing to an "
|
||||||
<< nodep->varp()->verilogKwd()
|
<< nodep->varp()->verilogKwd()
|
||||||
<< " variable of a function after a timing control is not allowed");
|
<< " variable of a function after a timing control is not allowed");
|
||||||
} else {
|
} else if (nodep->varp()->lifetime().isAutomatic()) {
|
||||||
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Writing to a captured "
|
nodep->v3warn(E_UNSUPPORTED, "Unsupported: Writing to a captured "
|
||||||
<< nodep->varp()->verilogKwd()
|
<< nodep->varp()->verilogKwd()
|
||||||
<< " variable in a "
|
<< " variable in a "
|
||||||
|
|
|
||||||
|
|
@ -382,7 +382,12 @@ class LinkParseVisitor final : public VNVisitor {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_ftaskp) {
|
} else if (m_ftaskp) {
|
||||||
|
UINFO(0, "TASK LIFE " << m_ftaskp->lifetime());
|
||||||
|
if (m_ftaskp->lifetime().isStatic()) {
|
||||||
|
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
|
||||||
|
} else {
|
||||||
if (!nodep->lifetime().isAutomatic()) nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
|
if (!nodep->lifetime().isAutomatic()) nodep->lifetime(VLifetime::AUTOMATIC_IMPLICIT);
|
||||||
|
}
|
||||||
} else if (nodep->lifetime().isNone()) {
|
} else if (nodep->lifetime().isNone()) {
|
||||||
// lifetime shouldn't be unknown, set static if none
|
// lifetime shouldn't be unknown, set static if none
|
||||||
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
|
nodep->lifetime(VLifetime::STATIC_IMPLICIT);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue