From ba3794a495001b945e0a6c6f5982706c20e561cc Mon Sep 17 00:00:00 2001 From: github action Date: Sat, 6 Dec 2025 14:12:22 +0000 Subject: [PATCH] Apply 'make format' --- src/V3LinkCells.cpp | 47 ++++++++++++++----------- test_regress/t/t_config_inst_missing.py | 4 ++- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/src/V3LinkCells.cpp b/src/V3LinkCells.cpp index e4378dc3b..8126da202 100644 --- a/src/V3LinkCells.cpp +++ b/src/V3LinkCells.cpp @@ -78,10 +78,14 @@ class CellEdge final : public V3GraphEdge { AstCell* const m_cellp; public: - CellEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cutable, AstCell* cellp) - : V3GraphEdge{graphp, fromp, top, weight, cutable}, m_cellp{cellp} {} + CellEdge(V3Graph* graphp, V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cutable, + AstCell* cellp) + : V3GraphEdge{graphp, fromp, top, weight, cutable} + , m_cellp{cellp} {} AstCell* cellp() const { return m_cellp; } - string name() const override VL_MT_STABLE { return cellp() ? cvtToHex(cellp()) + ' ' + cellp()->name() : ""; } + string name() const override VL_MT_STABLE { + return cellp() ? cvtToHex(cellp()) + ' ' + cellp()->name() : ""; + } }; void LinkCellsGraph::loopsMessageCb(V3GraphVertex* vertexp, V3EdgeFuncP edgeFuncp) { @@ -123,17 +127,19 @@ struct LinkCellsState final { class LinkConfigsVisitor final : public VNVisitor { // STATE LinkCellsState& m_state; // Context for linking cells - bool m_isTop = false; // Whether we're in the top-level config - bool m_isDefault = false; // Whether we're currently in a default clause - string m_cell; // Current cell being processed - string m_hierInst; // Current hierarchical instance being processed - AstDot* m_dotp = nullptr; // Current dot being processed + bool m_isTop = false; // Whether we're in the top-level config + bool m_isDefault = false; // Whether we're currently in a default clause + string m_cell; // Current cell being processed + string m_hierInst; // Current hierarchical instance being processed + AstDot* m_dotp = nullptr; // Current dot being processed // VISITORS void visit(AstConfig* nodep) override { VL_RESTORER(m_isTop); - const auto& fullName = std::pair{nodep->libname(), nodep->configname()}; - m_isTop = std::find(m_state.m_designs.begin(), m_state.m_designs.end(), fullName) != m_state.m_designs.end(); + const auto& fullName + = std::pair{nodep->libname(), nodep->configname()}; + m_isTop = std::find(m_state.m_designs.begin(), m_state.m_designs.end(), fullName) + != m_state.m_designs.end(); m_state.m_designs.erase( std::remove(m_state.m_designs.begin(), m_state.m_designs.end(), fullName), m_state.m_designs.end()); @@ -165,9 +171,7 @@ class LinkConfigsVisitor final : public VNVisitor { } } - void visit(AstDot* nodep) override { - iterateChildren(nodep); - } + void visit(AstDot* nodep) override { iterateChildren(nodep); } void visit(AstParseRef* nodep) override { if (m_isDefault) { @@ -189,8 +193,7 @@ class LinkConfigsVisitor final : public VNVisitor { } else if (m_dotp) { m_hierInst += m_hierInst.empty() ? nodep->name() : '.' + nodep->name(); } else if (!m_hierInst.empty()) { - m_state.m_uselistInst[m_hierInst].emplace_back( - nodep->libname(), nodep->cellname()); + m_state.m_uselistInst[m_hierInst].emplace_back(nodep->libname(), nodep->cellname()); } } @@ -244,8 +247,10 @@ class LinkCellsVisitor final : public VNVisitor { const V3GraphEdge* const edgep = new V3GraphEdge{&m_graph, fromp, top, weight, cuttable}; UINFO(9, " newEdge " << edgep << " " << fromp->name() << " -> " << top->name()); } - void cellEdge(V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cuttable, AstCell* cellp) { - const V3GraphEdge* const edgep = new CellEdge{&m_graph, fromp, top, weight, cuttable, cellp}; + void cellEdge(V3GraphVertex* fromp, V3GraphVertex* top, int weight, bool cuttable, + AstCell* cellp) { + const V3GraphEdge* const edgep + = new CellEdge{&m_graph, fromp, top, weight, cuttable, cellp}; UINFO(9, " cellEdge " << edgep << " " << fromp->name() << " -> " << top->name()); } void insertModInLib(const string& name, const string& libname, AstNodeModule* nodep) { @@ -390,7 +395,6 @@ class LinkCellsVisitor final : public VNVisitor { cellp->modp(modp); break; } - } } @@ -459,8 +463,11 @@ class LinkCellsVisitor final : public VNVisitor { nodep->inLibrary(true); // Interfaces can't be at top, unless asked } - auto const& fullName = std::pair(nodep->libname(), nodep->name()); - const bool topMatch = std::find(m_state.m_designs.begin(), m_state.m_designs.end(), fullName) != m_state.m_designs.end(); + auto const& fullName + = std::pair(nodep->libname(), nodep->name()); + const bool topMatch + = std::find(m_state.m_designs.begin(), m_state.m_designs.end(), fullName) + != m_state.m_designs.end(); if (topMatch) { m_topVertexp = vertex(nodep); UINFO(2, "Link --top-module: " << nodep); diff --git a/test_regress/t/t_config_inst_missing.py b/test_regress/t/t_config_inst_missing.py index 24025be5c..19cf62743 100755 --- a/test_regress/t/t_config_inst_missing.py +++ b/test_regress/t/t_config_inst_missing.py @@ -14,6 +14,8 @@ test.scenarios('simulator') test.lint(verilator_flags2=[ '--binary', '--top cfg1', '--work liba', 't/t_config_work__liba.v', '--work libb', 't/t_config_work__libb.v' - ], fails=test.vlt_all, expect_filename=test.golden_filename) +], + fails=test.vlt_all, + expect_filename=test.golden_filename) test.passes()