Skip to content

Commit

Permalink
Separate source and run files
Browse files Browse the repository at this point in the history
Internal-tag: [#66738]
Signed-off-by: Maciej Kurc <[email protected]>
  • Loading branch information
mkurc-ant committed Nov 4, 2024
1 parent 0607e1d commit c602ce8
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions vcs/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,22 @@

load("//verilog:defs.bzl", "VerilogInfo")

_RUNFILES = ["dat", "mem"]

def _vcs_binary(ctx):
transitive_srcs = depset([], transitive = [ctx.attr.module[VerilogInfo].dag])
all_srcs = [verilog_info_struct.srcs for verilog_info_struct in transitive_srcs.to_list()]
all_data = [verilog_info_struct.data for verilog_info_struct in transitive_srcs.to_list()]
all_files = [src for sub_tuple in (all_srcs + all_data) for src in sub_tuple]

# TODO: Filter
# Filter out .dat files.
runfiles = []
verilog_files = []
for file in all_files:
verilog_files.append(file)
if file.extension in _RUNFILES:
runfiles.append(file)
else:
verilog_files.append(file)

vcs_log = ctx.actions.declare_file("{}.log".format(ctx.label.name))
vcs_out = ctx.actions.declare_file(ctx.label.name)
Expand Down Expand Up @@ -52,6 +58,7 @@ def _vcs_binary(ctx):
return [
DefaultInfo(
executable = vcs_out,
runfiles = ctx.runfiles(files = runfiles),
),
]

Expand Down

0 comments on commit c602ce8

Please sign in to comment.