Internals: Refactor V3Error, and handle UNDRIVEN/UNSUPPORTED/WIDTH consistently (#6874)

This commit is contained in:
Wilson Snyder
2025-12-30 07:08:25 -05:00
committed by GitHub
parent aa94219531
commit 2025b81614
12 changed files with 120 additions and 134 deletions
+5 -5
View File
@@ -166,9 +166,9 @@ void V3ErrorGuarded::v3errorEndGuts(const std::ostringstream& sstr, const string
if (m_errorSuppressed) {
// On debug, show only non default-off warning to prevent pages of warnings
if (m_message.code().defaultsOff()) return;
if (!debug() || debug() < 3 || (debug() < 9 && m_showedSuppressed[m_message.code()]))
if (!debug() || debug() < 3 || (debug() < 9 && m_showedSuppressed.test(m_message.code())))
return;
m_showedSuppressed[m_message.code()] = true;
m_showedSuppressed.set(m_message.code(), true);
}
string msg
= V3Error::warnContextBegin() + msgPrefix() + V3Error::warnContextEnd() + sstr.str();
@@ -223,8 +223,8 @@ void V3ErrorGuarded::v3errorEndGuts(const std::ostringstream& sstr, const string
const bool anError = isError(m_message.code(), m_errorSuppressed);
if (m_message.code()
!= V3ErrorCode::EC_FATALMANY // Not verbose on final too-many-errors error
&& !m_describedEachWarn[m_message.code()]) {
m_describedEachWarn[m_message.code()] = true;
&& !m_describedEachWarn.test(m_message.code())) {
m_describedEachWarn.set(m_message.code(), true);
if (m_message.code() >= V3ErrorCode::EC_FIRST_NAMED) {
text += warnMoreSpaces() + "... For " + (anError ? "error" : "warning")
+ " description see " + m_message.code().url() + '\n';
@@ -238,7 +238,7 @@ void V3ErrorGuarded::v3errorEndGuts(const std::ostringstream& sstr, const string
text += warnMoreSpaces() + "... See the manual at " + m_message.code().url()
+ " for more assistance.\n";
}
if (!m_pretendError[m_message.code()] && !m_message.code().hardError()) {
if (!m_pretendError.test(m_message.code()) && !m_message.code().hardError()) {
text += warnMoreSpaces() + "... Use \"/* verilator lint_off "
+ m_message.code().ascii()
+ " */\" and lint_on around source to disable this message.\n";