diff --git a/src/V3Undriven.cpp b/src/V3Undriven.cpp index fa11e5911..4a54cd54a 100644 --- a/src/V3Undriven.cpp +++ b/src/V3Undriven.cpp @@ -52,7 +52,8 @@ class UndrivenVarEntry final { const FileLine* m_nodeFileLinep = nullptr; // File line of varref if driven, else nullptr bool m_underGen = false; // Under a generate - const AstNodeFTaskRef* m_callNodep = nullptr; // Call node if driven via writeSummary, else nullptr + const AstNodeFTaskRef* m_callNodep + = nullptr; // Call node if driven via writeSummary, else nullptr enum : uint8_t { FLAG_USED = 0, FLAG_DRIVEN = 1, FLAG_DRIVEN_ALWCOMB = 2, FLAGS_PER_BIT = 3 }; @@ -284,9 +285,7 @@ public: void drivenViaCall(const AstNodeFTaskRef* nodep) { drivenWhole(); - if (!m_callNodep) { - m_callNodep = nodep; - } + if (!m_callNodep) { m_callNodep = nodep; } } const AstNodeFTaskRef* callNodep() const { return m_callNodep; } }; @@ -315,8 +314,8 @@ class UndrivenVisitor final : public VNVisitorConst { const AstAlways* m_alwaysp = nullptr; // Current always of either type const AstAlways* m_alwaysCombp = nullptr; // Current always if combo, otherwise nullptr - V3UndrivenCapture* const m_capturep = nullptr; // Capture object. 'nullptr' if disabled. - const bool m_enableWriteSummary = false; // Enable writeSummary computation plumbing + V3UndrivenCapture* const m_capturep = nullptr; // Capture object. 'nullptr' if disabled. + const bool m_enableWriteSummary = false; // Enable writeSummary computation plumbing // METHODS diff --git a/src/V3UndrivenCapture.cpp b/src/V3UndrivenCapture.cpp index 6c23c20a7..ec6e23846 100644 --- a/src/V3UndrivenCapture.cpp +++ b/src/V3UndrivenCapture.cpp @@ -64,9 +64,9 @@ private: void visit(AstNodeVarRef* nodep) override { if (m_curTaskp && nodep->access().isWriteOrRW()) { ++g_stats.varWrites; - UINFO(9, "undriven capture direct write in " - << taskNameQ(m_curTaskp) << " var=" << nodep->varp()->prettyNameQ() - << " at " << nodep->fileline()); + UINFO(9, "undriven capture direct write in " << taskNameQ(m_curTaskp) + << " var=" << nodep->varp()->prettyNameQ() + << " at " << nodep->fileline()); m_cap.noteDirectWrite(m_curTaskp, nodep->varp()); } @@ -79,11 +79,11 @@ private: if (AstNodeFTask* const calleep = nodep->taskp()) { ++g_stats.callEdges; UINFO(9, "undriven capture call edge " << taskNameQ(m_curTaskp) << " -> " - << taskNameQ(calleep)); + << taskNameQ(calleep)); m_cap.noteCallEdge(m_curTaskp, calleep); } else { UINFO(9, "undriven capture unresolved call in " << taskNameQ(m_curTaskp) - << " name=" << nodep->name()); + << " name=" << nodep->name()); } } iterateChildrenConst(nodep); // still scan pins/args @@ -119,8 +119,8 @@ V3UndrivenCapture::V3UndrivenCapture(AstNetlist* netlistp) { for (const auto& kv : m_info) (void)computeWriteSummary(kv.first); UINFO(9, "undriven capture stats ftasks=" - << g_stats.ftasks << " varWrites=" << g_stats.varWrites - << " callEdges=" << g_stats.callEdges << " uniqueTasks=" << m_info.size()); + << g_stats.ftasks << " varWrites=" << g_stats.varWrites + << " callEdges=" << g_stats.callEdges << " uniqueTasks=" << m_info.size()); } void V3UndrivenCapture::gather(AstNetlist* netlistp) { @@ -145,13 +145,13 @@ const std::vector& V3UndrivenCapture::computeWriteSummary(const AstNode if (info.state == State::DONE) { UINFO(9, "undriven capture writeSummary cached size=" << info.writeSummary.size() - << " for " << taskNameQ(taskp)); + << " for " << taskNameQ(taskp)); return info.writeSummary; } if (info.state == State::VISITING) { UINFO(9, "undriven capture recursion detected at " - << taskNameQ(taskp) - << " returning directWrites size=" << info.directWrites.size()); + << taskNameQ(taskp) + << " returning directWrites size=" << info.directWrites.size()); // Cycle detected. return directWrites only to guarantee termination. if (info.writeSummary.empty()) info.writeSummary = info.directWrites; sortUniqueVars(info.writeSummary); @@ -173,8 +173,8 @@ const std::vector& V3UndrivenCapture::computeWriteSummary(const AstNode // Remove duplicates and sort because grabbing all of the callees can result in duplicates sortUniqueVars(info.writeSummary); - UINFO(9, "undriven capture writeSummary computed size=" << info.writeSummary.size() - << " for " << taskNameQ(taskp)); + UINFO(9, "undriven capture writeSummary computed size=" << info.writeSummary.size() << " for " + << taskNameQ(taskp)); // We are done, so set the m_info state correctly and return the vector of variables info.state = State::DONE; diff --git a/src/V3UndrivenCapture.h b/src/V3UndrivenCapture.h index 12bc4968c..3e0646c6b 100644 --- a/src/V3UndrivenCapture.h +++ b/src/V3UndrivenCapture.h @@ -19,9 +19,9 @@ // Capture task/function write summaries for multidriven checks. // Per-task/function capture info keyed by resolved AstNodeFTask* identity (FTask = function or // task). This is our 'graph' of tasks/functions. Each node has a list of direct callees and -// a list of variables written in the function body. There are methods to dedup after walking the tree. -// V3Undriven then uses the writeSummary for multidriven checks - i.e. it treats writes (side effects) -// inside subroutines as part of the caller's process. +// a list of variables written in the function body. There are methods to dedup after walking the +// tree. V3Undriven then uses the writeSummary for multidriven checks - i.e. it treats writes (side +// effects) inside subroutines as part of the caller's process. // //*************************************************************************