Skip to content

Commit

Permalink
Add block name to coverage names
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Gorochowik <[email protected]>
  • Loading branch information
tgorochowik committed Jan 20, 2025
1 parent c05d552 commit 099408a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/V3Coverage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ class CoverageVisitor final : public VNVisitor {
// We'll do this, and make the if(...) coverinc later.

// Add signal to hold the old value
const string newvarname = "__Vtogcov__"s + nodep->shortName();
const string newvarname = "__Vtogcov__"s + m_beginHier + nodep->shortName();
FileLine* const fl_nowarn = new FileLine{nodep->fileline()};
fl_nowarn->modifyWarnOff(V3ErrorCode::UNUSEDSIGNAL, true);
AstVar* const chgVarp
Expand All @@ -302,7 +302,7 @@ class CoverageVisitor final : public VNVisitor {
void toggleVarBottom(const ToggleEnt& above, const AstVar* varp) {
AstCoverToggle* const newp = new AstCoverToggle{
varp->fileline(),
newCoverInc(varp->fileline(), "", "v_toggle", "toggle_" + varp->name() + above.m_comment + "=_", "", 0,
newCoverInc(varp->fileline(), "", "v_toggle", "toggle_" + m_beginHier + "_" + varp->name() + above.m_comment + "=_", "", 0,
""),
above.m_varRefp->cloneTree(true), above.m_chgRefp->cloneTree(true)};
m_modp->addStmtsp(newp);
Expand Down Expand Up @@ -573,7 +573,7 @@ class CoverageVisitor final : public VNVisitor {
VL_RESTORER(m_beginHier);
VL_RESTORER(m_inToggleOff);
if (nodep->name() != "") {
m_beginHier = m_beginHier + (m_beginHier != "" ? "." : "") + nodep->name();
m_beginHier = m_beginHier + (m_beginHier != "" ? "_dot_" : "") + nodep->name();
}
iterateChildren(nodep);
lineTrack(nodep);
Expand Down

0 comments on commit 099408a

Please sign in to comment.