Add ternary operator into branch coverage (#5880)

This commit is contained in:
Ryszard Rozak
2025-05-19 09:35:35 -04:00
committed by GitHub
parent ad08302e5f
commit bed0456eca
13 changed files with 1907 additions and 644 deletions
+12 -7
View File
@@ -144,6 +144,13 @@ public:
void checkPurity(AstNodeFTask* nodep) { checkPurity(nodep, getFTaskVertex(nodep)); }
private:
void convertAssignWToAlways() {
// Wire assigns must become always statements to deal with insertion
// of multiple statements. Perhaps someday make all wassigns into always's?
UINFO(5, " IM_WireRep " << m_assignwp << endl);
m_assignwp->convertToAlways();
VL_DO_CLEAR(pushDeletep(m_assignwp), m_assignwp = nullptr);
}
void checkPurity(AstNodeFTask* nodep, TaskBaseVertex* vxp) {
if (nodep->recursive()) return; // Impure, but no warning
if (!vxp->pure()) {
@@ -191,15 +198,13 @@ private:
m_assignwp = nodep;
VL_DO_DANGLING(iterateChildren(nodep), nodep); // May delete nodep.
}
void visit(AstExprStmt* nodep) override {
if (m_assignwp) convertAssignWToAlways();
iterateChildren(nodep);
}
void visit(AstNodeFTaskRef* nodep) override {
// Includes handling AstMethodCall, AstNew
if (m_assignwp) {
// Wire assigns must become always statements to deal with insertion
// of multiple statements. Perhaps someday make all wassigns into always's?
UINFO(5, " IM_WireRep " << m_assignwp << endl);
m_assignwp->convertToAlways();
VL_DO_CLEAR(pushDeletep(m_assignwp), m_assignwp = nullptr);
}
if (m_assignwp) convertAssignWToAlways();
// We make multiple edges if a task is called multiple times from another task.
UASSERT_OBJ(nodep->taskp(), nodep, "Unlinked task");
TaskFTaskVertex* const taskVtxp = getFTaskVertex(nodep->taskp());