Fix `--skip-identical` skipping on some errors (#6066).

This commit is contained in:
Wilson Snyder 2025-06-06 17:18:02 -04:00
parent db03b95389
commit 54e637c72b
4 changed files with 12 additions and 2 deletions

View File

@ -54,6 +54,7 @@ Verilator 5.037 devel
* Fix type operator for interface signals (#6049) (#6050). [Todd Strader]
* Fix V3OrderParallel scoring contraction hang (#6052). [Bartłomiej Chmiel, Antmicro Ltd.]
* Fix virtual interface array typedef expressions (#6057).
* Fix `--skip-identical` skipping on some errors (#6066). [Todd Strader]
Verilator 5.036 2025-04-27

View File

@ -349,13 +349,14 @@ string V3Error::stripMetaText(const string& text, bool stripContext) VL_PURE {
}
void V3Error::abortIfWarnings() {
if (!isErrorOrWarn()) return;
const bool exwarn = warnFatal() && warnCount();
if (errorCount() && exwarn) {
v3fatalMany("Exiting due to " << std::dec << V3Error::s().errorCount() << " error(s), " //
<< V3Error::s().warnCount() << " warning(s)\n");
} else if (errorCount()) {
v3fatalMany("Exiting due to " << std::dec << V3Error::s().errorCount() << " error(s)\n");
} else if (exwarn) {
} else {
v3fatalMany("Exiting due to " << std::dec << V3Error::s().warnCount() << " warning(s)\n");
}
}

View File

@ -413,6 +413,9 @@ public:
void incWarnings() VL_REQUIRES(m_mutex) { ++m_warnCount; }
void incErrors() VL_REQUIRES(m_mutex) { ++m_errCount; }
int errorCount() VL_REQUIRES(m_mutex) { return m_errCount; }
bool isErrorOrWarn() VL_REQUIRES(m_mutex) {
return errorCount() || (warnFatal() && warnCount());
}
bool pretendError(int errorCode) VL_REQUIRES(m_mutex) { return m_pretendError[errorCode]; }
void pretendError(V3ErrorCode code, bool flag) VL_REQUIRES(m_mutex) {
if (code == V3ErrorCode::WIDTH) {
@ -528,6 +531,10 @@ public:
const V3RecursiveLockGuard guard{s().m_mutex};
return s().isError(code, supp);
}
static bool isErrorOrWarn() VL_MT_SAFE_EXCLUDES(s().m_mutex) {
const V3RecursiveLockGuard guard{s().m_mutex};
return s().isErrorOrWarn();
}
static void abortIfErrors() {
if (errorCount()) abortIfWarnings();
}

View File

@ -755,7 +755,8 @@ static void verilate(const string& argString) {
+ "__idmap.xml");
}
if (v3Global.opt.skipIdentical().isTrue() || v3Global.opt.makeDepend().isTrue()) {
if ((v3Global.opt.skipIdentical().isTrue() || v3Global.opt.makeDepend().isTrue())
&& !V3Error::isErrorOrWarn()) {
V3File::writeTimes(v3Global.opt.hierTopDataDir() + "/" + v3Global.opt.prefix()
+ "__verFiles.dat",
argString);