Convert unnamed error to new PKGNODECL error.

This commit is contained in:
Wilson Snyder 2020-08-22 19:42:21 -04:00
parent 2d7d2c5992
commit decbf79f39
3 changed files with 9 additions and 9 deletions

View File

@ -51,7 +51,6 @@ public:
I_DEF_NETTYPE_WIRE, // `default_nettype is WIRE (false=NONE)
// Error codes:
E_DETECTARRAY, // Error: Unsupported: Can't detect changes on arrayed variable
E_PKGNODECL, // Error: Package/class needs to be predeclared
E_PORTSHORT, // Error: Output port is connected to a constant, electrical short
E_UNSUPPORTED, // Error: Unsupported (generally)
E_TASKNSVAR, // Error: Task I/O not simple
@ -99,6 +98,7 @@ public:
PINMISSING, // Cell pin not specified
PINNOCONNECT, // Cell pin not connected
PINCONNECTEMPTY,// Cell pin connected by name with empty reference
PKGNODECL, // Error: Package/class needs to be predeclared
PROCASSWIRE, // Procedural assignment on wire
REALCVT, // Real conversion
REDEFMACRO, // Redefining existing define macro
@ -146,7 +146,7 @@ public:
// Boolean
" I_CELLDEFINE", " I_COVERAGE", " I_TRACING", " I_LINT", " I_DEF_NETTYPE_WIRE",
// Errors
"DETECTARRAY", "PKGNODECL", "PORTSHORT", "UNSUPPORTED", "TASKNSVAR",
"DETECTARRAY", "PORTSHORT", "UNSUPPORTED", "TASKNSVAR",
// Warnings
" EC_FIRST_WARN",
"ALWCOMBORDER", "ASSIGNDLY", "ASSIGNIN",
@ -160,7 +160,7 @@ public:
"INCABSPATH", "INFINITELOOP", "INITIALDLY", "INSECURE",
"LITENDIAN", "MODDUP",
"MULTIDRIVEN", "MULTITOP",
"PINMISSING", "PINNOCONNECT", "PINCONNECTEMPTY", "PROCASSWIRE",
"PINMISSING", "PINNOCONNECT", "PINCONNECTEMPTY", "PKGNODECL", "PROCASSWIRE",
"REALCVT", "REDEFMACRO",
"SELRANGE", "SHORTREAL", "SPLITVAR", "STMTDLY", "SYMRSVDWORD", "SYNCASYNCNET",
"TICKCOUNT", "TIMESCALEMOD",
@ -183,7 +183,7 @@ public:
// Later -Werror- options may make more of these.
bool pretendError() const {
return (m_e == ASSIGNIN || m_e == BLKANDNBLK || m_e == BLKLOOPINIT || m_e == CONTASSREG
|| m_e == IMPURE || m_e == PROCASSWIRE //
|| m_e == IMPURE || m_e == PKGNODECL || m_e == PROCASSWIRE //
|| m_e == TIMESCALEMOD); // Says IEEE
}
// Warnings to mention manual

View File

@ -201,8 +201,8 @@ private:
UINFO(2, "Link Module: " << nodep << endl);
if (nodep->fileline()->filebasenameNoExt() != nodep->prettyName()
&& !v3Global.opt.isLibraryFile(nodep->fileline()->filename())
&& !VN_IS(nodep, NotFoundModule)
&& !nodep->recursiveClone() && !nodep->internal()) {
&& !VN_IS(nodep, NotFoundModule) && !nodep->recursiveClone()
&& !nodep->internal()) {
// We only complain once per file, otherwise library-like files
// have a huge mess of warnings
if (m_declfnWarned.find(nodep->fileline()->filename()) == m_declfnWarned.end()) {

View File

@ -531,9 +531,9 @@ void V3ParseImp::tokenPipelineSym() {
// is missing package, and this confuses people
static int warned = false;
if (!warned++) {
yylval.fl->v3warn(E_PKGNODECL, "Package/class '" + *yylval.strp
+ "' not found, and needs to be "
"predeclared (IEEE 1800-2017 26.3)");
yylval.fl->v3warn(PKGNODECL, "Package/class '" + *yylval.strp
+ "' not found, and needs to be "
"predeclared (IEEE 1800-2017 26.3)");
}
}
} else if (token == yaID__LEX) {