diff --git a/dsim/BUILD b/dsim/BUILD index 1e915f98..e9ed091d 100644 --- a/dsim/BUILD +++ b/dsim/BUILD @@ -16,4 +16,3 @@ package( default_applicable_licenses = ["//:package_license"], default_visibility = ["//visibility:private"], ) - diff --git a/dsim/defs.bzl b/dsim/defs.bzl index ca801de7..136909bc 100644 --- a/dsim/defs.bzl +++ b/dsim/defs.bzl @@ -17,7 +17,6 @@ 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] @@ -25,7 +24,7 @@ def _dsim_run(ctx): 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 = [] @@ -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 @@ -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)) @@ -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) @@ -144,4 +144,3 @@ dsim_run = rule( ), }, ) -