Skip to content

Commit

Permalink
fixup! Add support for Verilator stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
JanOlencki authored and mkurc-ant committed Nov 19, 2024
1 parent 89106bb commit 871b7f9
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions dependency_support/verilator/private/verilator_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -301,21 +301,18 @@ current_flex_lexer_header = rule(
def _verilator_root_impl(ctx):
dir = ctx.actions.declare_directory(ctx.label.name)

include_path = dir.path + "/include"
command = [
"mkdir -p",
include_path,
"\n",
"cp -L",
]
for f in ctx.files.include:
command.append(f.path)
command.append(include_path)
cp_args = ctx.actions.args()
cp_args.add("--append-destination", "include")
for file in ctx.files.include:
cp_args.add(file.path)
cp_args.add(dir.path)

ctx.actions.run_shell(
command = " ".join(command),
ctx.actions.run(
mnemonic = "VerilatorCopyTree",
arguments = [cp_args],
inputs = ctx.files.include,
outputs = [dir],
executable = ctx.executable._copy_tree,
)

return [DefaultInfo(
Expand All @@ -330,5 +327,11 @@ verilator_root = rule(
allow_files = True,
mandatory = True,
),
"_copy_tree": attr.label(
doc = "A tool for copying a tree of files",
cfg = "exec",
executable = True,
default = Label("//common:copy_tree"),
),
},
)

0 comments on commit 871b7f9

Please sign in to comment.