Skip to content

Commit

Permalink
fixup! Add a rule for stand-alone verilated binary
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 d19562b commit 89106bb
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions verilator/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def _copy_action(ctx, suffix, files, map_each):

return dir

def _verilate(ctx, vopts = [], copy_shared = True):
def _verilate(ctx, vopts = []):
verilator_toolchain = ctx.toolchains["@rules_hdl//verilator:toolchain_type"]

transitive_srcs = depset([], transitive = [ctx.attr.module[VerilogInfo].dag]).to_list()
Expand Down Expand Up @@ -244,11 +244,7 @@ def _verilate(ctx, vopts = [], copy_shared = True):
progress_message = "[Verilator] Compiling {}".format(ctx.label),
)

if copy_shared:
copy_input = depset([verilator_output] + verilator_toolchain.shared[DefaultInfo].files.to_list())
else:
copy_input = depset([verilator_output])

copy_input = depset([verilator_output], transitive = [verilator_toolchain.shared[DefaultInfo].files])

verilator_output_cpp = _copy_action(ctx, "_cpp", copy_input, _only_cpp)
verilator_output_hpp = _copy_action(ctx, "_h", copy_input, _only_hpp)
Expand Down Expand Up @@ -351,7 +347,6 @@ def _verilator_cc_binary(ctx):
verilator_output_cpp, verilator_output_hpp, runfiles = _verilate(
ctx,
vopts = ["--main"],
copy_shared = True,
)

# Do actual compile
Expand Down

0 comments on commit 89106bb

Please sign in to comment.