mirror of
https://github.com/verilator/verilator.git
synced 2025-01-19 12:54:02 +00:00
Fix toggle coverage dataDeclp error on multi-edge driven signals.
This commit is contained in:
parent
be471e9ccc
commit
a23cf1ceea
1
Changes
1
Changes
@ -46,6 +46,7 @@ Verilator 5.021 devel
|
|||||||
* Fix $fwrite of null (#4862). [Jose Tejada]
|
* Fix $fwrite of null (#4862). [Jose Tejada]
|
||||||
* Fix GCC tautological-compare warnings.
|
* Fix GCC tautological-compare warnings.
|
||||||
* Fix compile error on structs with queues (and ignore toggle coverage on queues).
|
* Fix compile error on structs with queues (and ignore toggle coverage on queues).
|
||||||
|
* Fix toggle coverage dataDeclp error on multi-edge driven signals.
|
||||||
|
|
||||||
|
|
||||||
Verilator 5.020 2024-01-01
|
Verilator 5.020 2024-01-01
|
||||||
|
@ -2653,7 +2653,7 @@ public:
|
|||||||
const char* broken() const override {
|
const char* broken() const override {
|
||||||
if (m_dataDeclp
|
if (m_dataDeclp
|
||||||
&& (m_dataDeclp == this || m_dataDeclp->m_dataDeclp)) { // Avoid O(n^2) accessing
|
&& (m_dataDeclp == this || m_dataDeclp->m_dataDeclp)) { // Avoid O(n^2) accessing
|
||||||
v3fatalSrc("dataDeclp should point to real data, not be a list");
|
v3fatalSrc("dataDeclp should point to real data, not be a list: " << cvtToHex(this));
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,8 @@ class CoverageJoinVisitor final : public VNVisitor {
|
|||||||
V3DupFinder dupFinder; // Duplicate code detection
|
V3DupFinder dupFinder; // Duplicate code detection
|
||||||
// Hash all of the original signals we toggle cover
|
// Hash all of the original signals we toggle cover
|
||||||
for (AstCoverToggle* nodep : m_toggleps) dupFinder.insert(nodep->origp());
|
for (AstCoverToggle* nodep : m_toggleps) dupFinder.insert(nodep->origp());
|
||||||
|
if (dumpLevel() || debug() >= 9)
|
||||||
|
dupFinder.dumpFile(v3Global.debugFilename("coveragejoin") + ".hash", false);
|
||||||
// Find if there are any duplicates
|
// Find if there are any duplicates
|
||||||
for (AstCoverToggle* nodep : m_toggleps) {
|
for (AstCoverToggle* nodep : m_toggleps) {
|
||||||
// nodep->backp() is null if we already detected it's a duplicate and unlinked earlier
|
// nodep->backp() is null if we already detected it's a duplicate and unlinked earlier
|
||||||
@ -85,7 +87,8 @@ class CoverageJoinVisitor final : public VNVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// VISITORS
|
// VISITORS
|
||||||
void visit(AstNetlist* nodep) override {
|
void visit(AstActive* nodep) override {
|
||||||
|
m_toggleps.clear();
|
||||||
// Find all Coverage's
|
// Find all Coverage's
|
||||||
iterateChildren(nodep);
|
iterateChildren(nodep);
|
||||||
// Simplify
|
// Simplify
|
||||||
|
@ -53,6 +53,7 @@ V3DupFinder::iterator V3DupFinder::findDuplicate(AstNode* nodep, V3DupFinderUser
|
|||||||
}
|
}
|
||||||
|
|
||||||
void V3DupFinder::dumpFile(const string& filename, bool tree) {
|
void V3DupFinder::dumpFile(const string& filename, bool tree) {
|
||||||
|
UINFO(2, "Dumping " << filename << endl);
|
||||||
const std::unique_ptr<std::ofstream> logp{V3File::new_ofstream(filename)};
|
const std::unique_ptr<std::ofstream> logp{V3File::new_ofstream(filename)};
|
||||||
if (logp->fail()) v3fatal("Can't write " << filename);
|
if (logp->fail()) v3fatal("Can't write " << filename);
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ inline_checks();
|
|||||||
|
|
||||||
file_grep_not("$Self->{obj_dir}/coverage.dat", "largeish");
|
file_grep_not("$Self->{obj_dir}/coverage.dat", "largeish");
|
||||||
|
|
||||||
file_grep($Self->{stats}, qr/Coverage, Toggle points joined\s+(\d+)/i, 25)
|
file_grep($Self->{stats}, qr/Coverage, Toggle points joined\s+(\d+)/i, 23)
|
||||||
if $Self->{vlt_all};
|
if $Self->{vlt_all};
|
||||||
|
|
||||||
run(cmd => ["../bin/verilator_coverage",
|
run(cmd => ["../bin/verilator_coverage",
|
||||||
|
24
test_regress/t/t_interface_array2_coverage.pl
Executable file
24
test_regress/t/t_interface_array2_coverage.pl
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/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(simulator => 1);
|
||||||
|
|
||||||
|
top_filename("t/t_interface_array2.v");
|
||||||
|
|
||||||
|
compile(
|
||||||
|
v_flags2 => ["--coverage"],
|
||||||
|
);
|
||||||
|
|
||||||
|
execute(
|
||||||
|
check_finished => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
ok(1);
|
||||||
|
1;
|
24
test_regress/t/t_interface_modport_coverage.pl
Executable file
24
test_regress/t/t_interface_modport_coverage.pl
Executable file
@ -0,0 +1,24 @@
|
|||||||
|
#!/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-2009 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(simulator => 1);
|
||||||
|
|
||||||
|
top_filename("t/t_interface_modport.v");
|
||||||
|
|
||||||
|
compile(
|
||||||
|
verilator_flags2 => ["-fno-inline --coverage"],
|
||||||
|
);
|
||||||
|
|
||||||
|
execute(
|
||||||
|
check_finished => 1,
|
||||||
|
);
|
||||||
|
|
||||||
|
ok(1);
|
||||||
|
1;
|
Loading…
Reference in New Issue
Block a user