mirror of
https://github.com/verilator/verilator.git
synced 2026-08-30 09:48:22 +02:00
Internals: Move CReset under Assign (#6978)
This commit is contained in:
+1
-35
@@ -46,13 +46,11 @@ class LifeState final {
|
||||
public:
|
||||
VDouble0 m_statAssnDel; // Statistic tracking
|
||||
VDouble0 m_statAssnCon; // Statistic tracking
|
||||
VDouble0 m_statCResetDel; // Statistic tracking
|
||||
|
||||
// CONSTRUCTORS
|
||||
LifeState() = default;
|
||||
~LifeState() {
|
||||
V3Stats::addStatSum("Optimizations, Lifetime assign deletions", m_statAssnDel);
|
||||
V3Stats::addStatSum("Optimizations, Lifetime creset deletions", m_statCResetDel);
|
||||
V3Stats::addStatSum("Optimizations, Lifetime constant prop", m_statAssnCon);
|
||||
}
|
||||
};
|
||||
@@ -87,12 +85,6 @@ public:
|
||||
m_everSet = true;
|
||||
if (VN_IS(nodep->rhsp(), Const)) m_constp = VN_AS(nodep->rhsp(), Const);
|
||||
}
|
||||
void resetStatement(AstCReset* nodep) { // New CReset(A) assignment
|
||||
UASSERT_OBJ(!m_isNew, nodep, "Uninitialized new entry");
|
||||
m_assignp = nodep;
|
||||
m_constp = nullptr;
|
||||
m_everSet = true;
|
||||
}
|
||||
void complexAssign() { // A[x]=... or some complicated assignment
|
||||
UASSERT(!m_isNew, "Uninitialized new entry");
|
||||
m_assignp = nullptr;
|
||||
@@ -148,26 +140,9 @@ public:
|
||||
UINFOTREE(7, oldassp, "", "REMOVE/SAMEBLK");
|
||||
entr.complexAssign();
|
||||
oldassp->unlinkFrBack();
|
||||
if (VN_IS(oldassp, CReset)) {
|
||||
++m_statep->m_statCResetDel;
|
||||
} else {
|
||||
++m_statep->m_statAssnDel;
|
||||
}
|
||||
++m_statep->m_statAssnDel;
|
||||
VL_DO_DANGLING(m_deleter.pushDeletep(oldassp), oldassp);
|
||||
}
|
||||
void resetStatement(AstVarScope* nodep, AstCReset* rstp) {
|
||||
// Do we have a old assignment we can nuke?
|
||||
UINFO(4, " CRESETof: " << nodep);
|
||||
UINFO(7, " new: " << rstp);
|
||||
LifeVarEntry& entr = m_map[nodep];
|
||||
if (entr.isNew()) {
|
||||
entr.init(true);
|
||||
} else {
|
||||
checkRemoveAssign(nodep, entr);
|
||||
}
|
||||
entr.resetStatement(rstp);
|
||||
// lifeDump();
|
||||
}
|
||||
void simpleAssign(AstVarScope* nodep, AstNodeAssign* assp) {
|
||||
// Do we have a old assignment we can nuke?
|
||||
UINFO(4, " ASSIGNof: " << nodep);
|
||||
@@ -333,15 +308,6 @@ class LifeVisitor final : public VNVisitor {
|
||||
iterateAndNextNull(nodep->lhsp());
|
||||
}
|
||||
}
|
||||
void visit(AstCReset* nodep) override {
|
||||
if (!m_noopt) {
|
||||
AstVarScope* const vscp = nodep->varrefp()->varScopep();
|
||||
UASSERT_OBJ(vscp, nodep, "Scope lost on variable");
|
||||
m_lifep->resetStatement(vscp, nodep);
|
||||
} else {
|
||||
iterateAndNextNull(nodep->varrefp());
|
||||
}
|
||||
}
|
||||
void visit(AstAssignDly* nodep) override {
|
||||
// V3Life doesn't understand time sense
|
||||
if (nodep->isTimingControl()) {
|
||||
|
||||
Reference in New Issue
Block a user