mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Add ternary operator into branch coverage (#5880)
This commit is contained in:
+12
-7
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user