mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 01:54:01 +02:00
Merge branch 'master' into develop-v5
This commit is contained in:
+16
-16
@@ -76,7 +76,7 @@ public:
|
||||
, m_osp{osp} {
|
||||
if (nodep) iterate(nodep);
|
||||
}
|
||||
virtual ~InstrCountVisitor() override = default;
|
||||
~InstrCountVisitor() override = default;
|
||||
|
||||
// METHODS
|
||||
uint32_t instrCount() const { return m_instrCount; }
|
||||
@@ -123,7 +123,7 @@ private:
|
||||
}
|
||||
|
||||
// VISITORS
|
||||
virtual void visit(AstNodeSel* nodep) override {
|
||||
void visit(AstNodeSel* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
// This covers both AstArraySel and AstWordSel
|
||||
//
|
||||
@@ -135,7 +135,7 @@ private:
|
||||
const VisitBase vb{this, nodep};
|
||||
iterateAndNextNull(nodep->bitp());
|
||||
}
|
||||
virtual void visit(AstSel* nodep) override {
|
||||
void visit(AstSel* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
// Similar to AstNodeSel above, a small select into a large vector
|
||||
// is not expensive. Count the cost of the AstSel itself (scales with
|
||||
@@ -145,13 +145,13 @@ private:
|
||||
iterateAndNextNull(nodep->lsbp());
|
||||
iterateAndNextNull(nodep->widthp());
|
||||
}
|
||||
virtual void visit(AstSliceSel* nodep) override { // LCOV_EXCL_LINE
|
||||
void visit(AstSliceSel* nodep) override { // LCOV_EXCL_LINE
|
||||
nodep->v3fatalSrc("AstSliceSel unhandled");
|
||||
}
|
||||
virtual void visit(AstMemberSel* nodep) override { // LCOV_EXCL_LINE
|
||||
void visit(AstMemberSel* nodep) override { // LCOV_EXCL_LINE
|
||||
nodep->v3fatalSrc("AstMemberSel unhandled");
|
||||
}
|
||||
virtual void visit(AstConcat* nodep) override {
|
||||
void visit(AstConcat* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
// Nop.
|
||||
//
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
// the widths of the operands (ignored here).
|
||||
markCost(nodep);
|
||||
}
|
||||
virtual void visit(AstNodeIf* nodep) override {
|
||||
void visit(AstNodeIf* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
const VisitBase vb{this, nodep};
|
||||
iterateAndNextNull(nodep->condp());
|
||||
@@ -199,7 +199,7 @@ private:
|
||||
if (nodep->ifsp()) nodep->ifsp()->user4(0); // Don't dump it
|
||||
}
|
||||
}
|
||||
virtual void visit(AstNodeCond* nodep) override {
|
||||
void visit(AstNodeCond* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
// Just like if/else above, the ternary operator only evaluates
|
||||
// one of the two expressions, so only count the max.
|
||||
@@ -226,13 +226,13 @@ private:
|
||||
if (nodep->expr2p()) nodep->expr2p()->user4(0); // Don't dump it
|
||||
}
|
||||
}
|
||||
virtual void visit(AstCAwait* nodep) override {
|
||||
void visit(AstCAwait* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
iterateChildren(nodep);
|
||||
// Anything past a co_await is irrelevant
|
||||
m_ignoreRemaining = true;
|
||||
}
|
||||
virtual void visit(AstFork* nodep) override {
|
||||
void visit(AstFork* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
const VisitBase vb{this, nodep};
|
||||
uint32_t totalCount = m_instrCount;
|
||||
@@ -245,7 +245,7 @@ private:
|
||||
m_instrCount = totalCount;
|
||||
m_ignoreRemaining = false;
|
||||
}
|
||||
virtual void visit(AstActive* nodep) override {
|
||||
void visit(AstActive* nodep) override {
|
||||
// You'd think that the OrderLogicVertex's would be disjoint trees
|
||||
// of stuff in the AST, but it isn't so: V3Order makes an
|
||||
// OrderLogicVertex for each ACTIVE, and then also makes an
|
||||
@@ -261,7 +261,7 @@ private:
|
||||
markCost(nodep);
|
||||
UASSERT_OBJ(nodep == m_startNodep, nodep, "Multiple actives, or not start node");
|
||||
}
|
||||
virtual void visit(AstNodeCCall* nodep) override {
|
||||
void visit(AstNodeCCall* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
const VisitBase vb{this, nodep};
|
||||
iterateChildren(nodep);
|
||||
@@ -269,7 +269,7 @@ private:
|
||||
iterate(nodep->funcp());
|
||||
UASSERT_OBJ(!m_tracingCall, nodep, "visit(AstCFunc) should have cleared m_tracingCall.");
|
||||
}
|
||||
virtual void visit(AstCFunc* nodep) override {
|
||||
void visit(AstCFunc* nodep) override {
|
||||
// Don't count a CFunc other than by tracing a call or counting it
|
||||
// from the root
|
||||
UASSERT_OBJ(m_tracingCall || nodep == m_startNodep, nodep,
|
||||
@@ -284,7 +284,7 @@ private:
|
||||
}
|
||||
m_ignoreRemaining = false;
|
||||
}
|
||||
virtual void visit(AstNode* nodep) override {
|
||||
void visit(AstNode* nodep) override {
|
||||
if (m_ignoreRemaining) return;
|
||||
const VisitBase vb{this, nodep};
|
||||
iterateChildren(nodep);
|
||||
@@ -312,12 +312,12 @@ public:
|
||||
UASSERT_OBJ(osp, nodep, "Don't call if not dumping");
|
||||
if (nodep) iterate(nodep);
|
||||
}
|
||||
virtual ~InstrCountDumpVisitor() override = default;
|
||||
~InstrCountDumpVisitor() override = default;
|
||||
|
||||
private:
|
||||
// METHODS
|
||||
string indent() const { return string(m_depth, ':') + " "; }
|
||||
virtual void visit(AstNode* nodep) override {
|
||||
void visit(AstNode* nodep) override {
|
||||
++m_depth;
|
||||
if (unsigned costPlus1 = nodep->user4()) {
|
||||
*m_osp << " " << indent() << "cost " << std::setw(6) << std::left << (costPlus1 - 1)
|
||||
|
||||
Reference in New Issue
Block a user