diff --git a/src/V3Graph.h b/src/V3Graph.h index 4ac788646..841818c4a 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -145,12 +145,6 @@ public: /// Make acyclical (into a tree) by breaking a minimal subset of cutable edges. void acyclic(V3EdgeFuncP edgeFuncp); - /// Delete any nodes with only outputs - void deleteCutableOnlyEdges(); - - /// Any cutable edges become non-cutable - void makeEdgesNonCutable(V3EdgeFuncP edgeFuncp); - /// Remove any redundant edges, weights become MAX of any other weight void removeRedundantEdges(V3EdgeFuncP edgeFuncp); diff --git a/src/V3GraphAlg.cpp b/src/V3GraphAlg.cpp index e0046bd21..537d0fecf 100644 --- a/src/V3GraphAlg.cpp +++ b/src/V3GraphAlg.cpp @@ -26,45 +26,6 @@ #include #include -//###################################################################### -//###################################################################### -// Algorithms - delete - -void V3Graph::deleteCutableOnlyEdges() { - // Any vertices with only cutable edges will get deleted - - // Vertex::m_user begin: indicates can be deleted - // Pass 1, mark those. Don't delete now, as we don't want to rip out whole trees - for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) { - vertexp->user(true); - for (V3GraphEdge* edgep = vertexp->inBeginp(); edgep; edgep = edgep->inNextp()) { - if (!edgep->cutable()) { - vertexp->user(false); // Can't delete it - break; - } - } - for (V3GraphEdge* edgep = vertexp->outBeginp(); edgep; edgep = edgep->outNextp()) { - if (!edgep->cutable()) { - vertexp->user(false); // Can't delete it - break; - } - } - } - - // Pass 2, delete those marked - // Rather than doing a delete() we set the weight to 0 which disconnects the edge. - for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) { - if (vertexp->user()) { - // UINFO(7, "Disconnect " << vertexp->name() << endl); - for (V3GraphEdge* edgep = vertexp->outBeginp(); edgep; edgep = edgep->outNextp()) { - edgep->cut(); - } - } - } - - // Vertex::m_user end, now unused -} - //###################################################################### //###################################################################### // Algorithms - weakly connected components @@ -321,7 +282,7 @@ private: if (vertexp->user() == 1) { m_graphp->reportLoops(m_edgeFuncp, vertexp); m_graphp->loopsMessageCb(vertexp); - return; + return; // LCOV_EXCL_LINE // gcc gprof bug misses this return } if (vertexp->rank() >= currentRank) return; // Already processed it vertexp->user(1); @@ -449,21 +410,6 @@ void V3Graph::subtreeLoops(V3EdgeFuncP edgeFuncp, V3GraphVertex* vertexp, V3Grap GraphAlgSubtrees(this, loopGraphp, edgeFuncp, vertexp); } -//###################################################################### -//###################################################################### -// Algorithms - make non cutable - -void V3Graph::makeEdgesNonCutable(V3EdgeFuncP edgeFuncp) { - for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp = vertexp->verticesNextp()) { - // Only need one direction, we'll always see the other at some point... - for (V3GraphEdge* edgep = vertexp->inBeginp(); edgep; edgep = edgep->inNextp()) { - if (edgep->cutable() && edgep->weight() && (edgeFuncp)(edgep)) { - edgep->cutable(false); - } - } - } -} - //###################################################################### //###################################################################### // Algorithms - sorting diff --git a/test_regress/t/t_flag_stats.v b/test_regress/t/t_flag_stats.v index 319e410ff..1026d969b 100644 --- a/test_regress/t/t_flag_stats.v +++ b/test_regress/t/t_flag_stats.v @@ -4,10 +4,12 @@ // any use, without warranty, 2014 by Wilson Snyder. // SPDX-License-Identifier: CC0-1.0 -module t (b); +module t (b, b2); output reg [31:0] b; + output reg [31:0] b2; // Need 2 vars of same width to cover V3Stats initial begin - b = 22; + b = 11; + b2 = 22; $write("*-* All Finished *-*\n"); $finish; end diff --git a/test_regress/t/t_protect_ids_debug.pl b/test_regress/t/t_protect_ids_debug.pl new file mode 100755 index 000000000..d1da5019c --- /dev/null +++ b/test_regress/t/t_protect_ids_debug.pl @@ -0,0 +1,26 @@ +#!/usr/bin/env perl +if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; } +# DESCRIPTION: Verilator: Verilog Test driver/expect definition +# +# Copyright 2003 by Wilson Snyder. This program is free software; you +# can redistribute it and/or modify it under the terms of either the GNU +# Lesser General Public License Version 3 or the Perl Artistic License +# Version 2.0. +# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0 + +scenarios(vlt => 1); + +top_filename("t/t_protect_ids.v"); + +compile( + verilator_flags2 => ["--protect-ids", + "--protect-key SECRET_KEY", + "--trace", + "--debug-protect", + "--coverage", + "-Wno-INSECURE",], + verilator_make_gmake => 0, + ); + +ok(1); +1;