Skip to content

Commit b3cb26d

Browse files
rw1nklerQuantamHD
authored andcommitted
Make the cocotb_wrapper attribute of the cocotb_test rule public
Make cocotb_wrapper attribute public to allow for modyfying the script for other cocotb versions or different build setups. Internal-tag: [#46586] Signed-off-by: Robert Winkler <[email protected]>
1 parent b102c33 commit b3cb26d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cocotb/cocotb.bzl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _collect_verilog_files(ctx):
6161
]
6262
verilog_files = depset(
6363
[src for sub_tuple in verilog_srcs for src in sub_tuple] +
64-
ctx.files.verilog_sources
64+
ctx.files.verilog_sources,
6565
)
6666
return verilog_files.to_list()
6767

@@ -100,7 +100,7 @@ def _cocotb_test_impl(ctx):
100100

101101
command = (
102102
"PATH={}:$PATH ".format(path) +
103-
"python {}".format(ctx.executable._cocotb_wrapper.short_path) +
103+
"python {}".format(ctx.executable.cocotb_wrapper.short_path) +
104104
" --sim {}".format(ctx.attr.sim_name) +
105105
" --hdl_library {}".format(ctx.attr.hdl_library) +
106106
" --hdl_toplevel {}".format(ctx.attr.hdl_toplevel) +
@@ -128,12 +128,12 @@ def _cocotb_test_impl(ctx):
128128
transitive_files = depset(
129129
direct = [py_toolchain.interpreter],
130130
transitive = [dep[PyInfo].transitive_sources for dep in ctx.attr.deps] +
131-
[ctx.attr._cocotb_wrapper[PyInfo].transitive_sources] +
131+
[ctx.attr.cocotb_wrapper[PyInfo].transitive_sources] +
132132
[py_toolchain.files],
133133
)
134134

135135
runfiles = ctx.runfiles(
136-
files = ctx.files._cocotb_wrapper +
136+
files = ctx.files.cocotb_wrapper +
137137
verilog_files +
138138
vhdl_files +
139139
ctx.files.test_module,
@@ -249,7 +249,7 @@ _cocotb_test_attrs = {
249249
doc = "The list of python libraries to be linked in to the simulation target",
250250
providers = [PyInfo],
251251
),
252-
"_cocotb_wrapper": attr.label(
252+
"cocotb_wrapper": attr.label(
253253
cfg = "exec",
254254
executable = True,
255255
doc = "Cocotb wrapper script",

0 commit comments

Comments
 (0)