Non functioning split static parameter into port and static var

Signed-off-by: Kamil Danecki <kdanecki@internships.antmicro.com>
This commit is contained in:
Kamil Danecki 2026-03-17 19:20:24 +01:00
parent add4ec6e80
commit 22cad93083
1 changed files with 5 additions and 1 deletions

View File

@ -300,10 +300,14 @@ class BeginVisitor final : public VNVisitor {
void visit(AstVar* nodep) override { void visit(AstVar* nodep) override {
// If static variable, move it outside a function. // If static variable, move it outside a function.
if (nodep->lifetime().isStatic() && m_ftaskp) { if (nodep->lifetime().isStatic() && m_ftaskp) {
UINFO(0, "TASK IS STATIC " << m_ftaskp->lifetime().isStatic());
const std::string newName const std::string newName
= m_ftaskp->name() + "__Vstatic__" + dot(m_unnamedScope, nodep->name()); = m_ftaskp->name() + "__Vstatic__" + dot(m_unnamedScope, nodep->name());
AstVar* newVarp = nodep->cloneTreePure(false);
nodep->replaceWith(newVarp);
// AstNode::addNext(nodep, newVarp);
nodep->name(newName); nodep->name(newName);
nodep->unlinkFrBack(); // nodep->unlinkFrBack();
m_ftaskp->addHereThisAsNext(nodep); m_ftaskp->addHereThisAsNext(nodep);
nodep->funcLocal(false); nodep->funcLocal(false);
} else if (m_unnamedScope != "") { } else if (m_unnamedScope != "") {