Fix USERINFO etc to show message with no arguments
This commit is contained in:
parent
07de647cd7
commit
a159c41219
|
|
@ -3938,11 +3938,13 @@ private:
|
|||
userIterateChildren(nodep, WidthVP(SELF, BOTH).p());
|
||||
if (!m_paramsOnly) {
|
||||
V3Const::constifyParamsEdit(nodep->fmtp()); // fmtp may change
|
||||
string text = nodep->fmtp()->text();
|
||||
if (text.empty()) text = "Elaboration system task message (IEEE 1800-2017 20.11)";
|
||||
switch (nodep->displayType()) {
|
||||
case AstDisplayType::DT_INFO: nodep->v3warn(USERINFO, nodep->fmtp()->text()); break;
|
||||
case AstDisplayType::DT_ERROR: nodep->v3warn(USERERROR, nodep->fmtp()->text()); break;
|
||||
case AstDisplayType::DT_WARNING: nodep->v3warn(USERWARN, nodep->fmtp()->text()); break;
|
||||
case AstDisplayType::DT_FATAL: nodep->v3warn(USERFATAL, nodep->fmtp()->text()); break;
|
||||
case AstDisplayType::DT_INFO: nodep->v3warn(USERINFO, text); break;
|
||||
case AstDisplayType::DT_ERROR: nodep->v3warn(USERERROR, text); break;
|
||||
case AstDisplayType::DT_WARNING: nodep->v3warn(USERWARN, text); break;
|
||||
case AstDisplayType::DT_FATAL: nodep->v3warn(USERFATAL, text); break;
|
||||
default: UASSERT_OBJ(false, nodep, "Unexpected elaboration display type");
|
||||
}
|
||||
VL_DO_DANGLING(nodep->unlinkFrBack()->deleteTree(), nodep);
|
||||
|
|
|
|||
|
|
@ -1,34 +1,34 @@
|
|||
-Info: t/t_assert_comp_bad.v:10:7:
|
||||
-Info: t/t_assert_comp_bad.v:10:7: Elaboration system task message (IEEE 1800-2017 20.11)
|
||||
: ... In instance t
|
||||
10 | $info;
|
||||
| ^~~~~
|
||||
-Info: t/t_assert_comp_bad.v:11:7: User compile-time info
|
||||
-Info: t/t_assert_comp_bad.v:11:7: User elaboration-time info
|
||||
: ... In instance t
|
||||
11 | $info("User compile-time info");
|
||||
11 | $info("User elaboration-time info");
|
||||
| ^~~~~
|
||||
%Warning-USERWARN: t/t_assert_comp_bad.v:12:7:
|
||||
%Warning-USERWARN: t/t_assert_comp_bad.v:12:7: Elaboration system task message (IEEE 1800-2017 20.11)
|
||||
: ... In instance t
|
||||
12 | $warning;
|
||||
| ^~~~~~~~
|
||||
... Use "/* verilator lint_off USERWARN */" and lint_on around source to disable this message.
|
||||
%Warning-USERWARN: t/t_assert_comp_bad.v:13:7: User compile-time warning
|
||||
%Warning-USERWARN: t/t_assert_comp_bad.v:13:7: User elaboration-time warning
|
||||
: ... In instance t
|
||||
13 | $warning("User compile-time warning");
|
||||
13 | $warning("User elaboration-time warning");
|
||||
| ^~~~~~~~
|
||||
%Warning-USERWARN: t/t_assert_comp_bad.v:14:7: 1
|
||||
: ... In instance t
|
||||
14 | $warning(1);
|
||||
| ^~~~~~~~
|
||||
%Warning-USERERROR: t/t_assert_comp_bad.v:15:7:
|
||||
%Warning-USERERROR: t/t_assert_comp_bad.v:15:7: Elaboration system task message (IEEE 1800-2017 20.11)
|
||||
: ... In instance t
|
||||
15 | $error;
|
||||
| ^~~~~~
|
||||
%Warning-USERERROR: t/t_assert_comp_bad.v:16:7: User compile-time error
|
||||
%Warning-USERERROR: t/t_assert_comp_bad.v:16:7: User elaboration-time error
|
||||
: ... In instance t
|
||||
16 | $error("User compile-time error");
|
||||
16 | $error("User elaboration-time error");
|
||||
| ^~~~~~
|
||||
%Warning-USERFATAL: t/t_assert_comp_bad.v:17:7:
|
||||
%Warning-USERFATAL: t/t_assert_comp_bad.v:17:7: User elaboration-time fatal
|
||||
: ... In instance t
|
||||
17 | $fatal;
|
||||
17 | $fatal(0, "User elaboration-time fatal");
|
||||
| ^~~~~~
|
||||
%Error: Exiting due to
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@ module t (/*AUTOARG*/);
|
|||
|
||||
if (1) begin
|
||||
$info;
|
||||
$info("User compile-time info");
|
||||
$info("User elaboration-time info");
|
||||
$warning;
|
||||
$warning("User compile-time warning");
|
||||
$warning("User elaboration-time warning");
|
||||
$warning(1); // Check can convert arguments to format
|
||||
$error;
|
||||
$error("User compile-time error");
|
||||
$fatal;
|
||||
$error("User elaboration-time error");
|
||||
$fatal(0, "User elaboration-time fatal");
|
||||
end
|
||||
|
||||
endmodule
|
||||
|
|
|
|||
Loading…
Reference in New Issue