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
+6 -2
View File
@@ -661,7 +661,9 @@ TriggerKit TriggerKit::create(AstNetlist* netlistp, //
AstCFunc* const fp = kit.m_compp;
AstScope* const scopep = netlistp->topScopep()->scopep();
// Profiling push
if (v3Global.opt.profExec()) fp->addStmtsp(util::profExecSectionPush(flp, "trig " + name));
if (v3Global.opt.profExec()) {
fp->addStmtsp(AstCStmt::profExecSectionPush(flp, "trig " + name));
}
// Trigger computation
for (AstNodeStmt* const nodep : senResults.m_preUpdates) fp->addStmtsp(nodep);
fp->addStmtsp(trigStmtsp);
@@ -702,7 +704,9 @@ TriggerKit TriggerKit::create(AstNetlist* netlistp, //
// Add a call to the dumping function if debug is enabled
fp->addStmtsp(kit.newDumpCall(kit.m_vscp, name, true));
// Profiling pop
if (v3Global.opt.profExec()) fp->addStmtsp(util::profExecSectionPop(flp));
if (v3Global.opt.profExec()) {
fp->addStmtsp(AstCStmt::profExecSectionPop(flp, "trig " + name));
}
// Done with the trigger computation function, split as might be large
util::splitCheck(fp);
};