Skip to content

Commit 4295b9a

Browse files
Add config files to vc_static_lint rule
Signed-off-by: Robert Szczepanski <[email protected]>
1 parent 13c4ef8 commit 4295b9a

File tree

5 files changed

+24
-1
lines changed

5 files changed

+24
-1
lines changed

vc_static/default.tcl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ set_app_var enable_lint true
3232
set_app_var report_all_hdl_errors true
3333
configure_lint_setup -goal lint_rtl
3434

35+
# Include lint config files
36+
set config_list [split $config_files " "]
37+
foreach config $config_list {
38+
source $config
39+
}
40+
3541
# Include waiver file
3642
set waiver_list [split $waiver_files " "]
3743
foreach waiver $waiver_list {

vc_static/defs.bzl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def _vc_static_lint(ctx):
5959
"sources": [f.path for f in all_srcs],
6060
"top_module": ctx.attr.module_top,
6161
"waiver_files": [f.path for f in ctx.files.waiver_files],
62+
"config_files": [f.path for f in ctx.files.config_files],
6263
}
6364

6465
# Write the TCL script
@@ -87,7 +88,7 @@ def _vc_static_lint(ctx):
8788

8889
ctx.actions.run_shell(
8990
outputs = outputs,
90-
inputs = [ctx.file.vc_static_env, tcl_script] + ctx.files.waiver_files + all_hdrs + all_srcs,
91+
inputs = [ctx.file.vc_static_env, tcl_script] + ctx.files.waiver_files + ctx.files.config_files + all_hdrs + all_srcs,
9192
progress_message = "Running VC Static: {}".format(ctx.label.name),
9293
command = " ".join(vc_command),
9394
)
@@ -142,6 +143,10 @@ vc_static_lint = rule(
142143
doc = "Waiver files",
143144
allow_files = True,
144145
),
146+
"config_files": attr.label_list(
147+
doc = "Config files",
148+
allow_files = True,
149+
),
145150
},
146151
provides = [
147152
DefaultInfo,

vc_static/tests/BUILD

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ filegroup(
3434
],
3535
)
3636

37+
filegroup(
38+
name = "test_config",
39+
srcs = [
40+
"test_config.tcl",
41+
],
42+
)
43+
3744
vc_static_lint(
3845
name = "rtl_vc_static_lint",
3946
module = ":rtl",
@@ -42,4 +49,7 @@ vc_static_lint(
4249
waiver_files = [
4350
":test_waiver",
4451
],
52+
config_files = [
53+
":test_config",
54+
],
4555
)

vc_static/tests/rtl.sv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
module rtl (
1616
input logic a,
17+
input logic b,
1718
output logic out
1819
);
1920

vc_static/tests/test_config.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
configure_lint_tag -enable -tag "W240" -severity "info" -goal lint_rtl

0 commit comments

Comments
 (0)