Internals: Fix use of Expr as Stmt in V3Assert (#6280) (#6973)

This commit is contained in:
Geza Lore 2026-02-01 05:08:41 +00:00 committed by GitHub
parent bef709a235
commit 122ceb2258
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 11 deletions

View File

@ -872,21 +872,18 @@ class AssertVisitor final : public VNVisitor {
switch (nodep->ctlType()) { switch (nodep->ctlType()) {
case VAssertCtlType::ON: case VAssertCtlType::ON:
UINFO(9, "Generating assertctl for a module: " << m_modp); UINFO(9, "Generating assertctl for a module: " << m_modp);
nodep->replaceWith(new AstCExpr{ nodep->replaceWith(
fl, new AstCStmt{fl, "vlSymsp->_vm_contextp__->assertOnSet("s
"vlSymsp->_vm_contextp__->assertOnSet("s + std::to_string(nodep->ctlAssertTypes()) + std::to_string(nodep->ctlAssertTypes()) + ", "s
+ ", "s + std::to_string(nodep->ctlDirectiveTypes()) + ");\n"s, + std::to_string(nodep->ctlDirectiveTypes()) + ");\n"s});
1});
break; break;
case VAssertCtlType::OFF: case VAssertCtlType::OFF:
case VAssertCtlType::KILL: { case VAssertCtlType::KILL: {
UINFO(9, "Generating assertctl for a module: " << m_modp); UINFO(9, "Generating assertctl for a module: " << m_modp);
nodep->replaceWith(new AstCExpr{fl, nodep->replaceWith(
"vlSymsp->_vm_contextp__->assertOnClear("s new AstCStmt{fl, "vlSymsp->_vm_contextp__->assertOnClear("s
+ std::to_string(nodep->ctlAssertTypes()) + " ,"s + std::to_string(nodep->ctlAssertTypes()) + " ,"s
+ std::to_string(nodep->ctlDirectiveTypes()) + std::to_string(nodep->ctlDirectiveTypes()) + ");\n"s});
+ ");\n"s,
1});
break; break;
} }
case VAssertCtlType::LOCK: case VAssertCtlType::LOCK: