diff --git a/Changes b/Changes index 63c0327f3..d184e7bd1 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix block comment not separating identifiers, bug311. [Gene Sullivan] +**** Fix warnings to point to lowest net usage, not upper level ports. + * Verilator 3.810 2011/01/03 ** Add limited support for VPI access to public signals, see docs. diff --git a/src/V3Gate.cpp b/src/V3Gate.cpp index 05c43dbf1..0293e496e 100644 --- a/src/V3Gate.cpp +++ b/src/V3Gate.cpp @@ -719,6 +719,12 @@ private: // Prevent a infinite loop... substp->v3fatalSrc("Replacing node with itself; perhaps circular logic?"); } + // Which fileline() to use? + // If replacing with logic, an error/warning is likely to want to point to the logic + // IE what we're replacing with. + // However a VARREF should point to the original as it's otherwise confusing + // to throw warnings that point to a PIN rather than where the pin us used. + if (substp->castVarRef()) substp->fileline(nodep->fileline()); nodep->replaceWith(substp); nodep->deleteTree(); nodep=NULL; }