Fix --prof-exec using --lib-create

This commit is contained in:
Geza Lore
2025-11-25 10:08:03 +00:00
parent d2ce5e62e7
commit 7cfe9b5356
3 changed files with 65 additions and 2 deletions
+5 -1
View File
@@ -292,7 +292,11 @@ class AstCStmt final : public AstNodeStmt {
static AstCStmt* profExecSection(FileLine* flp, const std::string& section, bool push) {
// Compute the label
std::string label;
if (v3Global.opt.hierChild()) label += v3Global.opt.topModule() + ":";
if (v3Global.opt.hierChild()) {
label += v3Global.opt.topModule() + ":";
} else if (!v3Global.opt.libCreate().empty()) {
label += v3Global.opt.libCreate() + ":";
}
label += section;
// The profiler statement
std::string pStmt = "VL_EXEC_TRACE_ADD_RECORD(vlSymsp)";
+3 -1
View File
@@ -421,8 +421,10 @@ class EmitCModel final : public EmitCFunc {
puts(topModNameProtected + "__" + protect("_eval_settle") + "(&(vlSymsp->TOP));\n");
puts("}\n");
if (v3Global.opt.profExec() && !v3Global.opt.hierChild())
if (v3Global.opt.profExec() && !v3Global.opt.hierChild()
&& v3Global.opt.libCreate().empty()) {
puts("vlSymsp->__Vm_executionProfilerp->configure();\n");
}
puts("VL_DEBUG_IF(VL_DBG_MSGF(\"+ Eval\\n\"););\n");
puts(topModNameProtected + "__" + protect("_eval") + "(&(vlSymsp->TOP));\n");