mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 10:03:44 +02:00
Fix MODDUP with duplicate packages to take first package (#6222).
This commit is contained in:
+4
-8
@@ -628,20 +628,16 @@ class LinkCellsVisitor final : public VNVisitor {
|
||||
if (!(libFoundp->fileline()->warnIsOff(V3ErrorCode::MODDUP)
|
||||
|| nodep->fileline()->warnIsOff(V3ErrorCode::MODDUP)
|
||||
|| hierBlocks.find(nodep->name()) != hierBlocks.end())) {
|
||||
nodep->v3warn(MODDUP, "Duplicate declaration of module: "
|
||||
nodep->v3warn(MODDUP, "Duplicate declaration of "
|
||||
<< nodep->verilogKwd() << ": "
|
||||
<< nodep->prettyNameQ() << '\n'
|
||||
<< nodep->warnContextPrimary() << '\n'
|
||||
<< libFoundp->warnOther()
|
||||
<< "... Location of original declaration\n"
|
||||
<< libFoundp->warnContextSecondary());
|
||||
}
|
||||
if (VN_IS(nodep, Package)) {
|
||||
// Packages may be imported, we instead rename to be unique
|
||||
nodep->name(nodep->name() + "__Vdedup" + cvtToStr(m_dedupNum++));
|
||||
} else {
|
||||
nodep->unlinkFrBack();
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
}
|
||||
nodep->unlinkFrBack();
|
||||
VL_DO_DANGLING(pushDeletep(nodep), nodep);
|
||||
} else if (!libFoundp && globalFoundp && globalFoundp != nodep) {
|
||||
// ...__LIB__ stripped by prettyName
|
||||
const string newName = nodep->libname() + "__LIB__" + nodep->origName();
|
||||
|
||||
Reference in New Issue
Block a user