Skip to content

Commit 785e52a

Browse files
committed
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 721f66c commit 785e52a

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

@@ -130,7 +130,7 @@ def _cocotb_test_impl(ctx):
130130

131131
command = (
132132
"PATH={}:$PATH ".format(path) +
133-
"python {}".format(ctx.executable._cocotb_wrapper.short_path) +
133+
"python {}".format(ctx.executable.cocotb_wrapper.short_path) +
134134
" --sim {}".format(ctx.attr.sim_name) +
135135
" --hdl_library {}".format(ctx.attr.hdl_library) +
136136
" --hdl_toplevel {}".format(ctx.attr.hdl_toplevel) +
@@ -158,12 +158,12 @@ def _cocotb_test_impl(ctx):
158158
transitive_files = depset(
159159
direct = [py_toolchain.interpreter],
160160
transitive = [dep[PyInfo].transitive_sources for dep in ctx.attr.deps] +
161-
[ctx.attr._cocotb_wrapper[PyInfo].transitive_sources] +
161+
[ctx.attr.cocotb_wrapper[PyInfo].transitive_sources] +
162162
[py_toolchain.files],
163163
)
164164

165165
runfiles = ctx.runfiles(
166-
files = ctx.files._cocotb_wrapper +
166+
files = ctx.files.cocotb_wrapper +
167167
verilog_files +
168168
vhdl_files +
169169
ctx.files.test_module,
@@ -277,7 +277,7 @@ _cocotb_test_attrs = {
277277
doc = "The list of python libraries to be linked in to the simulation target",
278278
providers = [PyInfo],
279279
),
280-
"_cocotb_wrapper": attr.label(
280+
"cocotb_wrapper": attr.label(
281281
cfg = "exec",
282282
executable = True,
283283
doc = "Cocotb wrapper script",

0 commit comments

Comments
 (0)