Skip to content

Commit 6be21b3

Browse files
committed
[tool_requirements] Set Verilator and Ninja checks to as_needed
Previously, we were always checking the tool version of Verilator and Ninja in lint runs even when the tools were not used. While this is typically not a problem (these are standard tools every developer has to install locally), it can be an issue for Dvsim runs that are dispatched to cloud runners which only load the required tool image. E.g. Verilator lint runs were failing due to a missing Ninja installation. This change sets Verilator and Ninja to "as_needed", and modifies the checks in the common checker core such that only the version of the requested tool is being checked. Signed-off-by: Michael Schaffner <[email protected]>
1 parent 4f6b60a commit 6be21b3

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

check_tool_requirements.core

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,27 @@ filesets:
1212
- ./tool_requirements.py : { copyto: tool_requirements.py }
1313

1414
scripts:
15-
check_tool_requirements:
15+
check_tool_requirements_verible:
1616
cmd:
1717
- python3
1818
- util/check_tool_requirements.py
19+
- 'verible'
1920
# TODO: Use this syntax once https://github.com/olofk/fusesoc/issues/353 is
2021
# fixed. Remove the filesets from the default target, and also remove the
2122
# copyto.
2223
#filesets:
2324
# - files_check_tool_requirements
25+
check_tool_requirements_verilator:
26+
cmd:
27+
- python3
28+
- util/check_tool_requirements.py
29+
- 'verilator'
2430

2531
targets:
2632
default:
2733
filesets:
2834
- files_check_tool_requirements
2935
hooks:
3036
pre_build:
31-
- tool_verilator ? (check_tool_requirements)
32-
- tool_veriblelint ? (check_tool_requirements)
37+
- tool_verilator ? (check_tool_requirements_verilator)
38+
- tool_veriblelint ? (check_tool_requirements_verible)

tool_requirements.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,14 @@
1717
#
1818
__TOOL_REQUIREMENTS__ = {
1919
'edalize': '0.2.0',
20-
'ninja': '1.8.2',
21-
'verilator': '4.104',
22-
20+
'ninja': {
21+
'min_version': '1.8.2',
22+
'as_needed': True
23+
},
24+
'verilator': {
25+
'min_version': '4.104',
26+
'as_needed': True
27+
},
2328
'hugo_extended': {
2429
'min_version': '0.82.0',
2530
'as_needed': True

0 commit comments

Comments
 (0)