[lint] Rename tool warnings to flow warnings and reduce their severity
Currently, the flow warnings also contain fusesoc and sometimes topgen
warnings. These should be addressed in the long run, but are not as
critical as lint warnings and errors, and should hence not block PR CI.
Signed-off-by: Michael Schaffner <msf@opentitan.org>
diff --git a/hw/lint/tools/ascentlint/parse-lint-report.py b/hw/lint/tools/ascentlint/parse-lint-report.py
index b05884c..1c0080e 100755
--- a/hw/lint/tools/ascentlint/parse-lint-report.py
+++ b/hw/lint/tools/ascentlint/parse-lint-report.py
@@ -111,13 +111,14 @@
for_json=True,
use_decimal=True)
- # return nonzero status if any warnings or errors are present
- # lint infos do not count as failures
- n_errors = len(results["errors"]) + len(results["lint_errors"])
- n_warnings = len(results["warnings"]) + len(results["lint_warnings"])
- if n_errors > 0 or n_warnings > 0:
- log.info("Found %d lint errors and %d lint warnings", n_errors, n_warnings)
- sys.exit(1)
+ # Pass/fail status is determined in the LintCfg class.
+ log.info(("Found %d flow warnings, %d flow errors, %d lint infos,\n"
+ "%d lint warnings and %d lint errors."),
+ len(results["warnings"]),
+ len(results["errors"]),
+ len(results["lint_infos"]),
+ len(results["lint_warnings"]),
+ len(results["lint_errors"]))
log.info("Lint logfile parsed succesfully")
sys.exit(0)
diff --git a/hw/lint/tools/veriblelint/parse-lint-report.py b/hw/lint/tools/veriblelint/parse-lint-report.py
index b8fd393..fc9809b 100755
--- a/hw/lint/tools/veriblelint/parse-lint-report.py
+++ b/hw/lint/tools/veriblelint/parse-lint-report.py
@@ -113,13 +113,14 @@
for_json=True,
use_decimal=True)
- # return nonzero status if any warnings or errors are present
- # lint infos do not count as failures
- n_errors = len(results["errors"]) + len(results["lint_errors"])
- n_warnings = len(results["warnings"]) + len(results["lint_warnings"])
- if n_errors > 0 or n_warnings > 0:
- log.info("Found %d lint errors and %d lint warnings", n_errors, n_warnings)
- sys.exit(1)
+ # Pass/fail status is determined in the LintCfg class.
+ log.info(("Found %d flow warnings, %d flow errors, %d lint infos,\n"
+ "%d lint warnings and %d lint errors."),
+ len(results["warnings"]),
+ len(results["errors"]),
+ len(results["lint_infos"]),
+ len(results["lint_warnings"]),
+ len(results["lint_errors"]))
log.info("Lint logfile parsed succesfully")
sys.exit(0)
diff --git a/hw/lint/tools/verilator/parse-lint-report.py b/hw/lint/tools/verilator/parse-lint-report.py
index f656af1..c9711dc 100755
--- a/hw/lint/tools/verilator/parse-lint-report.py
+++ b/hw/lint/tools/verilator/parse-lint-report.py
@@ -115,13 +115,14 @@
for_json=True,
use_decimal=True)
- # return nonzero status if any warnings or errors are present
- # lint infos do not count as failures
- n_errors = len(results["errors"]) + len(results["lint_errors"])
- n_warnings = len(results["warnings"]) + len(results["lint_warnings"])
- if n_errors > 0 or n_warnings > 0:
- log.info("Found %d lint errors and %d lint warnings", n_errors, n_warnings)
- sys.exit(1)
+ # Pass/fail status is determined in the LintCfg class.
+ log.info(("Found %d flow warnings, %d flow errors, %d lint infos,\n"
+ "%d lint warnings and %d lint errors."),
+ len(results["warnings"]),
+ len(results["errors"]),
+ len(results["lint_infos"]),
+ len(results["lint_warnings"]),
+ len(results["lint_errors"]))
log.info("Lint logfile parsed succesfully")
sys.exit(0)
diff --git a/util/dvsim/LintCfg.py b/util/dvsim/LintCfg.py
index f1f460c..c40966d 100644
--- a/util/dvsim/LintCfg.py
+++ b/util/dvsim/LintCfg.py
@@ -54,7 +54,7 @@
results_str += "\n"
header = [
- "Name", "Tool Warnings", "Tool Errors", "Lint Warnings",
+ "Name", "Flow Warnings", "Flow Errors", "Lint Warnings",
"Lint Errors"
]
colalign = ("center", ) * len(header)
@@ -180,22 +180,25 @@
self.result_summary["lint_errors"] += self.result["lint_errors"]
# Append detailed messages if they exist
- hdr_key_pairs = [("Tool Warnings", "warnings"),
- ("Tool Errors", "errors"),
- ("Lint Warnings", "lint_warnings"),
- ("Lint Errors", "lint_errors")]
+ # Indicate whether message leads to failure or not.
+ hdr_key_pairs = [("Flow Warnings", "warnings", False),
+ ("Flow Errors", "errors", True),
+ ("Lint Warnings", "lint_warnings", True),
+ ("Lint Errors", "lint_errors", True)]
# Lint fails if any warning or error message has occurred
self.errors_seen = False
- for _, key in hdr_key_pairs:
+ errors_to_report = False
+ for _, key, fail in hdr_key_pairs:
if key in self.result:
if self.result.get(key):
- self.errors_seen = True
+ self.errors_seen = fail
+ errors_to_report = True
break
- if self.errors_seen:
+ if errors_to_report:
fail_msgs += "\n### Errors and Warnings for Build Mode `'" + mode.name + "'`\n"
- for hdr, key in hdr_key_pairs:
+ for hdr, key, _ in hdr_key_pairs:
msgs = self.result.get(key)
fail_msgs += print_msg_list("#### " + hdr, msgs, self.max_msg_count)