Skip to content

Commit 4278623

Browse files
committed
ci/slang: Fix pyslang api, add lint_top.sv to Bender.yml
1 parent b4e3c3e commit 4278623

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

.github/workflows/run_slang.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"""Run slang on a file list via pyslang's Driver API and emit a JSON diagnostic file."""
33

44
import sys
5-
import pyslang
5+
6+
from pyslang import CommandLineOptions, Driver
67

78

89
def main():
@@ -12,13 +13,23 @@ def main():
1213

1314
flist, output_json = sys.argv[1], sys.argv[2]
1415

15-
driver = pyslang.driver.Driver()
16-
driver.parseCommandLine(
17-
f"-f {flist}"
16+
driver = Driver()
17+
driver.addStandardArgs()
18+
19+
args = (
20+
f"{sys.argv[0]}"
21+
f" -f {flist}"
1822
f" --top axi_lint_top"
1923
f" --error-limit 0"
2024
f" --diag-json {output_json}"
2125
)
26+
if not driver.parseCommandLine(args, CommandLineOptions()):
27+
sys.exit(1)
28+
29+
if not driver.processOptions():
30+
sys.exit(1)
31+
32+
driver.parseAllSources()
2233
driver.runFullCompilation()
2334
# Exit 0 regardless of compile errors so the CI step continues
2435
# and reviewdog can annotate the diagnostics.

Bender.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,7 @@ sources:
138138
- test/tb_axi_to_axi_lite.sv
139139
- test/tb_axi_to_mem_banked.sv
140140
- test/tb_axi_xbar.sv
141+
142+
- target: lint
143+
files:
144+
- lint/lint_top.sv

0 commit comments

Comments
 (0)