removed enable

This commit is contained in:
em2machine 2025-12-24 13:48:15 +01:00
parent b4e73cd6d8
commit d2146f0e56
3 changed files with 16 additions and 29 deletions

View File

@ -315,7 +315,6 @@ class UndrivenVisitor final : public VNVisitorConst {
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
// METHODS
@ -437,7 +436,7 @@ class UndrivenVisitor final : public VNVisitorConst {
// If writeSummary is enabled, task/function definitions are treated as non-executed.
// Their effects are applied at call sites via writeSummary(), so don't let definition
// traversal create phantom "other writes" for MULTIDRIVEN.
if (m_enableWriteSummary && m_taskp && !m_alwaysp && !m_inContAssign && !m_inInitialStatic
if (m_taskp && !m_alwaysp && !m_inContAssign && !m_inInitialStatic
&& !m_inBBox && !m_taskp->dpiExport()) {
AstVar* const retVarp = VN_CAST(m_taskp->fvarp(), Var);
if (!retVarp || nodep->varp() != retVarp) return;
@ -455,12 +454,13 @@ class UndrivenVisitor final : public VNVisitorConst {
if (entryp->isDrivenWhole() && !m_inBBox && !VN_IS(nodep, VarXRef)
&& !VN_IS(nodep->dtypep()->skipRefp(), UnpackArrayDType)
&& nodep->fileline() != entryp->getNodeFileLinep() && !entryp->isUnderGen()
&& (entryp->getNodep() || (m_enableWriteSummary && entryp->callNodep()))) {
&& (entryp->getNodep() ||
entryp->callNodep())) {
const AstNode* const otherWritep
= entryp->getNodep()
? static_cast<const AstNode*>(entryp->getNodep())
: (m_enableWriteSummary ? entryp->callNodep() : nullptr);
= entryp->getNodep() ?
static_cast<const AstNode*>(entryp->getNodep()) :
entryp->callNodep();
if (m_alwaysCombp
&& (!entryp->isDrivenAlwaysCombWhole()
@ -557,7 +557,7 @@ class UndrivenVisitor final : public VNVisitorConst {
iterateChildrenConst(nodep);
if (!m_enableWriteSummary || !m_capturep) return;
if (!m_capturep) return;
// If writeSummary is enabled, task/function definitions are treated as non-executed.
// Do not apply writeSummary at calls inside a task definition, or they will look like
@ -612,10 +612,9 @@ class UndrivenVisitor final : public VNVisitorConst {
public:
// CONSTRUCTORS
explicit UndrivenVisitor(AstNetlist* nodep, V3UndrivenCapture* capturep,
bool enableWriteSummary)
explicit UndrivenVisitor(AstNetlist* nodep, V3UndrivenCapture* capturep)
: m_capturep{capturep}
, m_enableWriteSummary{enableWriteSummary} {
{
iterateConst(nodep);
}
@ -632,12 +631,9 @@ public:
void V3Undriven::undrivenAll(AstNetlist* nodep) {
UINFO(2, __FUNCTION__ << ":");
const bool enable = V3UndrivenCapture::enableWriteSummary;
if (enable) {
V3UndrivenCapture capture{nodep};
{ UndrivenVisitor{nodep, &capture, enable}; }
} else {
{ UndrivenVisitor{nodep, nullptr, enable}; }
}
V3UndrivenCapture capture{nodep};
UndrivenVisitor{nodep, &capture};
if (v3Global.opt.stats()) V3Stats::statsStage("undriven");
}

View File

@ -19,8 +19,6 @@
#include "V3Error.h"
#include "V3Global.h"
//#include <algorithm>
VL_DEFINE_DEBUG_FUNCTIONS;
namespace {
@ -94,8 +92,6 @@ private:
} // namespace
bool V3UndrivenCapture::enableWriteSummary = true;
V3UndrivenCapture::V3UndrivenCapture(AstNetlist* netlistp) {
gather(netlistp);
@ -188,8 +184,7 @@ void V3UndrivenCapture::noteDirectWrite(const AstNodeFTask* taskp, AstVar* varp)
AstVar* const retVarp = VN_CAST(taskp->fvarp(), Var);
if (retVarp && varp == retVarp) return;
//info.directWrites.push_back(varp);
// filter out duplicates.
// Filter out duplicates.
if (info.directWritesSet.insert(varp).second) {
info.directWrites.push_back(varp);
}
@ -197,11 +192,11 @@ void V3UndrivenCapture::noteDirectWrite(const AstNodeFTask* taskp, AstVar* varp)
void V3UndrivenCapture::noteCallEdge(const AstNodeFTask* callerp, const AstNodeFTask* calleep) {
FTaskInfo& callerInfo = m_info[callerp];
// prevents duplicate entries from being appended, if calleep already exists then insert will return false, and then is not inserted into the callees vector.
// Prevents duplicate entries from being appended, if calleep already exists then insert will return false, and then is not inserted into the callees vector.
if (callerInfo.calleesSet.insert(calleep).second) {
callerInfo.callees.push_back(calleep);
}
// ensure callee entry exists, if already exists then this is a no-op. unordered_map<> so cheap.
// Ensure callee entry exists, if already exists then this is a no-op. unordered_map<> so cheap.
(void)m_info[calleep];
}

View File

@ -64,10 +64,6 @@ public:
std::unordered_set<AstVar*> directWritesSet;
};
// Enable writeSummary computation. If disabled, then the existing V3Undriven behaviour is
// used.
static bool enableWriteSummary;
private:
// 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