[dvsim] Update lint flow due to changes in synthesis
Signed-off-by: Michael Schaffner <msf@opentitan.org>
diff --git a/hw/lint/data/common_lint_cfg.hjson b/hw/lint/data/common_lint_cfg.hjson
index f6c573a..82dcbe0 100644
--- a/hw/lint/data/common_lint_cfg.hjson
+++ b/hw/lint/data/common_lint_cfg.hjson
@@ -2,10 +2,6 @@
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
{
- project: opentitan
- doc_server: docs.opentitan.org
- results_server: reports.opentitan.org
-
flow: lint
flow_makefile: "{proj_root}/hw/lint/data/lint.mk"
@@ -16,12 +12,19 @@
dut: "{name}"
build_dir: "{scratch_path}/{build_mode}"
- // we rely on fusesoc to run lint for us
+ // We rely on fusesoc to run lint for us
build_cmd: "fusesoc "
build_opts: ["--cores-root {proj_root}",
- "run --target=lint --tool={tool} --build-root={build_dir}",
+ "run --target={flow} --tool={tool} --build-root={build_dir}",
" {fusesoc_core} "]
+ build_log: "{build_dir}/{dut}_flow.log"
+
report_cmd: "{proj_root}/hw/lint/tools/{tool}/parse-lint-report.py "
report_opts: ["--repdir={build_dir}/lint-{tool} --outdir={build_dir}"]
tool_srcs: []
+
+ // these are not needed currently, but have to be defined
+ sv_flist_gen_cmd: ""
+ sv_flist_gen_opts: []
+ sv_flist_gen_dir: ""
}
diff --git a/hw/lint/data/lint.mk b/hw/lint/data/lint.mk
index 560df8e..a3628a0 100644
--- a/hw/lint/data/lint.mk
+++ b/hw/lint/data/lint.mk
@@ -19,7 +19,7 @@
compile: pre_compile
@echo "[make]: compile"
# we check the status in the parse script below
- -cd ${build_dir} && ${build_cmd} ${build_opts}
+ -cd ${build_dir} && ${build_cmd} ${build_opts} | tee ${build_log}
post_compile: compile
@echo "[make]: post_compile"
diff --git a/hw/lint/tools/ascentlint/parse-lint-report.py b/hw/lint/tools/ascentlint/parse-lint-report.py
index 78764a0..bca4b8b 100755
--- a/hw/lint/tools/ascentlint/parse-lint-report.py
+++ b/hw/lint/tools/ascentlint/parse-lint-report.py
@@ -21,12 +21,11 @@
(<error_severity>, <pattern_to_match_for>).
"""
for severity, pattern in patterns:
- results[severity] += re.findall(pattern,
- full_file,
- flags=re.MULTILINE)
+ results[severity] += re.findall(pattern, full_file, flags=re.MULTILINE)
return results
+
def get_results(resdir):
"""
Parse report and corresponding logfiles and extract error, warning
@@ -112,14 +111,16 @@
# return nonzero status if any warnings or errors are present
# lint infos do not count as failures
- exit_code = 0
nr_errors = len(results["errors"]) + len(results["lint_errors"])
nr_warnings = len(results["warnings"]) + len(results["lint_warnings"])
- print("Lint not successful, got %d warnings and %d errors." %
- (nr_warnings, nr_errors))
if nr_errors > 0 and nr_warnings > 0:
- exit_code = 1
- sys.exit(exit_code)
+ print("Lint not successful, got %d warnings and %d errors." %
+ (nr_warnings, nr_errors))
+ sys.exit(1)
+
+ print("Lint successful, got %d warnings and %d errors." %
+ (nr_warnings, nr_errors))
+ sys.exit(0)
if __name__ == "__main__":
diff --git a/util/dvsim/LintCfg.py b/util/dvsim/LintCfg.py
index da1f1cb..cdbec62 100644
--- a/util/dvsim/LintCfg.py
+++ b/util/dvsim/LintCfg.py
@@ -52,8 +52,7 @@
Gathers the aggregated results from all sub configs
'''
- # Generate results table for runs. Note that we build a simple md and
- # a marked up md version here in parallel.
+ # Generate results table for runs.
log.info("Create summary of lint results")
results_str = "## " + self.results_title + " (Summary)\n\n"
@@ -118,8 +117,6 @@
# '''
# Generate results table for runs.
- # Note that we build a simple md and a marked up md version
- # here in parallel.
results_str = "## " + self.results_title + "\n\n"
results_str += "### " + self.timestamp_long + "\n"
results_str += "### Lint Tool: " + self.tool.upper() + "\n\n"