Skip to content

Commit

Permalink
Run buildifier
Browse files Browse the repository at this point in the history
Signed-off-by: Maciej Dudek <[email protected]>
  • Loading branch information
mtdudek committed Oct 30, 2024
1 parent a3dec98 commit 1374786
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
1 change: 0 additions & 1 deletion dsim/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ package(
default_applicable_licenses = ["//:package_license"],
default_visibility = ["//visibility:private"],
)

13 changes: 6 additions & 7 deletions dsim/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ load("//verilog:defs.bzl", "VerilogInfo")
_RUNFILES = ["dat", "mem"]

def _dsim_run(ctx):

transitive_srcs = depset([], transitive = [ctx.attr.module[VerilogInfo].dag]).to_list()

all_srcs = [verilog_info_struct.srcs for verilog_info_struct in transitive_srcs]
all_hdrs = [verilog_info_struct.hdrs for verilog_info_struct in transitive_srcs]
all_data = [verilog_info_struct.data for verilog_info_struct in transitive_srcs]

all_files = [src for sub_tuple in (all_srcs + all_data) for src in sub_tuple]
all_hdrs = [hdr for sub_tuple in all_hdrs for hdr in sub_tuple]
all_hdrs = [hdr for sub_tuple in all_hdrs for hdr in sub_tuple]

# Filter out data files.
runfiles = []
Expand All @@ -47,7 +46,7 @@ def _dsim_run(ctx):
dsim_log = ctx.actions.declare_file("{}.log".format(ctx.label.name))

# Build DSim command
command = "source " + ctx.file.dsim_env.path + " && "
command = "source " + ctx.file.dsim_env.path + " && "
command += "dsim"
command += " -l " + dsim_log.path

Expand All @@ -60,9 +59,10 @@ def _dsim_run(ctx):
for verilog_file in verilog_files:
command += " " + verilog_file.path

inputs = [ctx.file.dsim_env] + verilog_files + all_hdrs
inputs = [ctx.file.dsim_env] + verilog_files + all_hdrs
outputs = [dsim_log] + ctx.outputs.outs
generated_files = [dsim_log]

# Coverage file
if ctx.attr.enable_code_coverage:
dsim_cov = ctx.actions.declare_file("{}.db".format(ctx.label.name))
Expand All @@ -73,8 +73,8 @@ def _dsim_run(ctx):
if ctx.attr.code_coverage_scope != "":
scope_file = ctx.actions.declare_file("{}.scope".format(ctx.label.name))
ctx.actions.write(
output=scope_file,
content="path {} +".format(ctx.attr.code_coverage_scope),
output = scope_file,
content = "path {} +".format(ctx.attr.code_coverage_scope),
)
command += " -code-cov-scope-specs {}".format(scope_file.path)
inputs.append(scope_file)
Expand Down Expand Up @@ -144,4 +144,3 @@ dsim_run = rule(
),
},
)

0 comments on commit 1374786

Please sign in to comment.