diff --git a/src/V3LinkDot.cpp b/src/V3LinkDot.cpp index 7f81ca8ae..1fd20b3dd 100644 --- a/src/V3LinkDot.cpp +++ b/src/V3LinkDot.cpp @@ -3315,15 +3315,23 @@ class LinkDotResolveVisitor final : public VNVisitor { VL_DO_DANGLING(pushDeletep(nodep->unlinkFrBack()), nodep); return; } else { - const string suggest + const std::string suggest = (nodep->param() ? m_statep->suggestSymFlat(m_pinSymp, nodep->name(), LinkNodeMatcherVarParam{}) : m_statep->suggestSymFlat(m_pinSymp, nodep->name(), LinkNodeMatcherVarIO{})); + const std::string decl + = ((m_cellp && m_cellp->modp()) + ? "\n"s + nodep->warnMore() + "... Location of instance's " + + m_cellp->modp()->verilogKwd() + " declaration\n" + + m_cellp->modp()->warnContextSecondary() + : ""); nodep->v3warn(PINNOTFOUND, ucfirst(whatp) << " not found: " << nodep->prettyNameQ() << '\n' - << (suggest.empty() ? "" : nodep->warnMore() + suggest)); + << (suggest.empty() ? "" : nodep->warnMore() + suggest) + << '\n' + << nodep->warnContextPrimary() << decl); return; } } diff --git a/test_regress/t/t_interface_generic_bad3.out b/test_regress/t/t_interface_generic_bad3.out index 1d6b83f9a..dd5629397 100644 --- a/test_regress/t/t_interface_generic_bad3.out +++ b/test_regress/t/t_interface_generic_bad3.out @@ -5,5 +5,8 @@ %Error-PINNOTFOUND: t/t_interface_generic_bad3.v:21:42: Pin not found: '__pinNumber2' 21 | GenericModule genericModule (inf_inst, inf_inst); | ^~~~~~~~ + : ... Location of instance's module declaration + 11 | module GenericModule (interface a); + | ^~~~~~~~~~~~~ ... For error description see https://verilator.org/warn/PINNOTFOUND?v=latest %Error: Exiting due to diff --git a/test_regress/t/t_lint_pindup_bad.out b/test_regress/t/t_lint_pindup_bad.out index ef1bb3d7f..976e5f7e3 100644 --- a/test_regress/t/t_lint_pindup_bad.out +++ b/test_regress/t/t_lint_pindup_bad.out @@ -17,11 +17,17 @@ : ... Suggested alternative: 'exists' 21 | .nexist(i2) | ^~~~~~ + : ... Location of instance's module declaration + 26 | module sub + | ^~~ ... For error description see https://verilator.org/warn/PINNOTFOUND?v=latest %Error-PINNOTFOUND: t/t_lint_pindup_bad.v:15:9: Parameter not found: 'NEXIST' : ... Suggested alternative: 'EXIST' 15 | #(.NEXIST(1), | ^~~~~~ + : ... Location of instance's module declaration + 26 | module sub + | ^~~ %Error: t/t_lint_pindup_bad.v:17:9: Duplicate parameter connection: 'P' 17 | .P(3)) | ^ diff --git a/test_regress/t/t_lint_pinnotfound_bad.out b/test_regress/t/t_lint_pinnotfound_bad.out index 6aded1ba0..3753eb3bf 100644 --- a/test_regress/t/t_lint_pinnotfound_bad.out +++ b/test_regress/t/t_lint_pinnotfound_bad.out @@ -1,8 +1,14 @@ %Error-PINNOTFOUND: t/t_lint_pinnotfound_bad.v:12:13: Pin not found: 'x' 12 | b b_inst1 (.x(1'b0)); | ^ + : ... Location of instance's module declaration + 18 | module b; + | ^ ... For error description see https://verilator.org/warn/PINNOTFOUND?v=latest %Error-PINNOTFOUND: t/t_lint_pinnotfound_bad.v:13:6: Parameter not found: 'PX' 13 | b #(.PX(1'b0)) b_inst2 (); | ^~ + : ... Location of instance's module declaration + 18 | module b; + | ^ %Error: Exiting due to diff --git a/test_regress/t/t_param_implicit_local_bad.out b/test_regress/t/t_param_implicit_local_bad.out index 159b4f135..947d67592 100644 --- a/test_regress/t/t_param_implicit_local_bad.out +++ b/test_regress/t/t_param_implicit_local_bad.out @@ -5,19 +5,37 @@ %Error-PINNOTFOUND: t/t_param_implicit_local_bad.v:17:21: Parameter not found: '__paramNumber3' 17 | mod1 # ( 3, 4, 5 ) i_mod1 (); | ^ + : ... Location of instance's module declaration + 26 | module mod1 # ( + | ^~~~ %Error-PINNOTFOUND: t/t_param_implicit_local_bad.v:19:15: Parameter not found: '__paramNumber1' 19 | mod3 # ( 7, 24, 25 ) i_mod3 (); | ^ + : ... Location of instance's module declaration + 38 | module mod3 #() (); + | ^~~~ %Error-PINNOTFOUND: t/t_param_implicit_local_bad.v:19:18: Parameter not found: '__paramNumber2' 19 | mod3 # ( 7, 24, 25 ) i_mod3 (); | ^~ + : ... Location of instance's module declaration + 38 | module mod3 #() (); + | ^~~~ %Error-PINNOTFOUND: t/t_param_implicit_local_bad.v:19:22: Parameter not found: '__paramNumber3' 19 | mod3 # ( 7, 24, 25 ) i_mod3 (); | ^~ + : ... Location of instance's module declaration + 38 | module mod3 #() (); + | ^~~~ %Error-PINNOTFOUND: t/t_param_implicit_local_bad.v:20:22: Parameter not found: '__paramNumber3' 20 | intf1 # ( 8, 15, 17 ) i_intf1 (); | ^~ + : ... Location of instance's interface declaration + 43 | interface intf1 # ( + | ^~~~~ %Error-PINNOTFOUND: t/t_param_implicit_local_bad.v:21:22: Parameter not found: '__paramNumber3' 21 | prgm1 # ( 9, 40, 41 ) i_prgm1 (); | ^~ + : ... Location of instance's program declaration + 50 | program prgm1 # ( + | ^~~~~ %Error: Exiting due to diff --git a/test_regress/t/t_udp_bad.out b/test_regress/t/t_udp_bad.out index e630d303f..6e235b3c5 100644 --- a/test_regress/t/t_udp_bad.out +++ b/test_regress/t/t_udp_bad.out @@ -13,6 +13,9 @@ %Error-PINNOTFOUND: t/t_udp_bad.v:10:13: Pin not found: '__pinNumber1' 10 | udp_x x (a, b); | ^ + : ... Location of instance's primitive declaration + 14 | primitive udp_x (a_bad, b, c_bad); + | ^~~~~ ... For error description see https://verilator.org/warn/PINNOTFOUND?v=latest %Error: t/t_udp_bad.v:17:11: Multiple outputs not allowed in udp modules 17 | output c_bad;