Fix internal error instead of missing prototype error (#7485). [Alex Solomatnikov]
Fixes #7485.
This commit is contained in:
parent
6aebcd2b1c
commit
8f18f0cf22
1
Changes
1
Changes
|
|
@ -17,6 +17,7 @@ Verilator 5.049 devel
|
||||||
* Fix inlining static initializer in V3Gate (#5381) (#7503). [Andrew Nolte] [Geza Lore, Testorrent USA, Inc.]
|
* Fix inlining static initializer in V3Gate (#5381) (#7503). [Andrew Nolte] [Geza Lore, Testorrent USA, Inc.]
|
||||||
* Fix generic interface port forwarded to a nested instance (#7454) (#7457). [Yilou Wang]
|
* Fix generic interface port forwarded to a nested instance (#7454) (#7457). [Yilou Wang]
|
||||||
* Fix internal error on multi-cycle SVA under default clocking (#7472) (#7506). [Yilou Wang]
|
* Fix internal error on multi-cycle SVA under default clocking (#7472) (#7506). [Yilou Wang]
|
||||||
|
* Fix internal error instead of missing prototype error (#7485). [Alex Solomatnikov]
|
||||||
* Fix mailbox#(packed_struct) type mismatch with parameterized class (#7494) (#7495). [Nikolai Kumar]
|
* Fix mailbox#(packed_struct) type mismatch with parameterized class (#7494) (#7495). [Nikolai Kumar]
|
||||||
* Fix std::randomize internal error on static member of different class (#7498) (#7499). [Alex Solomatnikov]
|
* Fix std::randomize internal error on static member of different class (#7498) (#7499). [Alex Solomatnikov]
|
||||||
* Fix virtual interface method call inlining and IMPURE suppression (#7505). [Nikolay Puzanov]
|
* Fix virtual interface method call inlining and IMPURE suppression (#7505). [Nikolay Puzanov]
|
||||||
|
|
|
||||||
|
|
@ -193,6 +193,7 @@ public:
|
||||||
void dumpSelf(const string& nameComment, bool force = false) {
|
void dumpSelf(const string& nameComment, bool force = false) {
|
||||||
if (debug() >= 6 || dumpLevel() >= 6 || force) {
|
if (debug() >= 6 || dumpLevel() >= 6 || force) {
|
||||||
const string filename = v3Global.debugFilename(nameComment) + ".txt";
|
const string filename = v3Global.debugFilename(nameComment) + ".txt";
|
||||||
|
UINFO(4, "Dumping " << filename);
|
||||||
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 file: " << filename);
|
if (logp->fail()) v3fatal("Can't write file: " << filename);
|
||||||
std::ostream& os = *logp;
|
std::ostream& os = *logp;
|
||||||
|
|
|
||||||
|
|
@ -207,9 +207,18 @@ public:
|
||||||
void importFromClass(VSymGraph* graphp, const VSymEnt* srcp) {
|
void importFromClass(VSymGraph* graphp, const VSymEnt* srcp) {
|
||||||
// Import tokens from source symbol table into this symbol table
|
// Import tokens from source symbol table into this symbol table
|
||||||
// Used for classes in early parsing only to handle "extends"
|
// Used for classes in early parsing only to handle "extends"
|
||||||
|
|
||||||
|
// If an "extern foo" exists, then we can't import "foo" from the base class.
|
||||||
|
// But ok for "extern foo" and "foo" to both come from base (so must check before insert)
|
||||||
|
std::unordered_set<std::string> haveExterns;
|
||||||
for (IdNameMap::const_iterator it = srcp->m_idNameMap.begin();
|
for (IdNameMap::const_iterator it = srcp->m_idNameMap.begin();
|
||||||
it != srcp->m_idNameMap.end(); ++it) {
|
it != srcp->m_idNameMap.end(); ++it) {
|
||||||
importOneSymbol(graphp, it->first, it->second, false);
|
if (m_idNameMap.count("extern " + it->first)) haveExterns.emplace(it->first);
|
||||||
|
}
|
||||||
|
for (IdNameMap::const_iterator it = srcp->m_idNameMap.begin();
|
||||||
|
it != srcp->m_idNameMap.end(); ++it) {
|
||||||
|
if (!haveExterns.count(it->first))
|
||||||
|
importOneSymbol(graphp, it->first, it->second, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void importFromPackage(VSymGraph* graphp, const VSymEnt* srcp, const string& id_or_star) {
|
void importFromPackage(VSymGraph* graphp, const VSymEnt* srcp, const string& id_or_star) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
%Error-PROTOTYPEMIS: t/t_class_extern_mis2_bad.v:15:21: Definition not found for extern prototype 'new'
|
||||||
|
15 | extern function new();
|
||||||
|
| ^~~
|
||||||
|
... For error description see https://verilator.org/warn/PROTOTYPEMIS?v=latest
|
||||||
|
%Error: Exiting due to
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||||
|
#
|
||||||
|
# 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-FileCopyrightText: 2026 Wilson Snyder
|
||||||
|
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||||
|
|
||||||
|
import vltest_bootstrap
|
||||||
|
|
||||||
|
test.scenarios('linter')
|
||||||
|
|
||||||
|
test.lint(fails=True, expect_filename=test.golden_filename)
|
||||||
|
|
||||||
|
test.passes()
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
// DESCRIPTION: Verilator: Verilog Test module
|
||||||
|
//
|
||||||
|
// This file ONLY is placed under the Creative Commons Public Domain.
|
||||||
|
// SPDX-FileCopyrightText: 2026 Wilson Snyder
|
||||||
|
// SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
|
package s_core_env_pkg;
|
||||||
|
virtual class x_scoreboard;
|
||||||
|
extern function void has_ext_ok();
|
||||||
|
endclass
|
||||||
|
function void x_scoreboard::has_ext_ok();
|
||||||
|
endfunction
|
||||||
|
|
||||||
|
class cls_misses_new_1 extends x_scoreboard;
|
||||||
|
extern function new(); // <--- BAD
|
||||||
|
endclass
|
||||||
|
|
||||||
|
endpackage
|
||||||
|
|
||||||
|
module t;
|
||||||
|
endmodule
|
||||||
Loading…
Reference in New Issue