Internals: Factor out --prof-exec section handling, add debug code

This commit is contained in:
Geza Lore
2025-11-25 10:08:03 +00:00
parent 9e37a09765
commit d2ce5e62e7
7 changed files with 51 additions and 33 deletions
+3 -6
View File
@@ -156,14 +156,11 @@ AstCFunc* V3Order::order(AstNetlist* netlistp, //
// Assemble the body
if (v3Global.opt.profExec()) {
const std::string name
= (v3Global.opt.hierChild() ? (v3Global.opt.topModule() + " ") : "") + "func " + tag;
funcp->addStmtsp(
new AstCStmt{flp, "VL_EXEC_TRACE_ADD_RECORD(vlSymsp).sectionPush(\"" + name + "\");"});
funcp->addStmtsp(AstCStmt::profExecSectionPush(flp, "func " + tag));
}
funcp->addStmtsp(stmtsp);
if (v3Global.opt.profExec()) {
funcp->addStmtsp(new AstCStmt{flp, "VL_EXEC_TRACE_ADD_RECORD(vlSymsp).sectionPop();"});
if (v3Global.opt.profExec()) { //
funcp->addStmtsp(AstCStmt::profExecSectionPop(flp, "func " + tag));
}
// Done