Allow more variable removal in scoped DFG (#6260)

This commit is contained in:
Geza Lore 2025-08-05 11:18:33 +01:00 committed by GitHub
parent d2edab458e
commit 78c9e7773a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 6 deletions

View File

@ -87,10 +87,13 @@ public:
// Variable referenced outside the containing module/netlist.
bool hasExtRefs() const {
if (m_varp->isIO()) return true; // Ports
if (m_varp->isTrace()) return true; // Traced
if (m_varp->isForced()) return true; // Forced
if (hasXRefs()) return true; // Target of a hierarchical reference
// In scoped mode, we can ignrore some of these as they were made explicit by then
if (!m_varScopep) {
if (m_varp->isIO()) return true; // Ports
if (m_varp->isTrace()) return true; // Traced
if (m_varp->isForced()) return true; // Forced
if (hasXRefs()) return true; // Target of a hierarchical reference
}
if (m_varp->isPrimaryIO()) return true; // Top level ports
if (m_varp->isSigPublic()) return true; // Public
return false;

View File

@ -21,7 +21,7 @@ test.inline_checks()
test.file_grep_not(test.obj_dir + "/coverage.dat", "largeish")
if test.vlt_all:
test.file_grep(test.stats, r'Coverage, Toggle points joined\s+(\d+)', 13)
test.file_grep(test.stats, r'Coverage, Toggle points joined\s+(\d+)', 14)
test.run(cmd=[
os.environ["VERILATOR_ROOT"] + "/bin/verilator_coverage",

View File

@ -42,7 +42,7 @@ if test.vlt_all:
# We expect to combine sequent functions across multiple instances of
# l2, l3, l4, l5. If this number drops, please confirm this has not broken.
test.file_grep(test.stats, r'Optimizations, Combined CFuncs\s+(\d+)',
(91 if test.vltmt else 87))
(107 if test.vltmt else 114))
# Everything should use relative references
check_relative_refs("t", True)