diff --git a/synthesis/build_defs.bzl b/synthesis/build_defs.bzl index 9166d7aa..f20b427e 100644 --- a/synthesis/build_defs.bzl +++ b/synthesis/build_defs.bzl @@ -15,7 +15,7 @@ """Rules for synthesizing (System)Verilog code.""" load("@rules_hdl//pdk:build_defs.bzl", "StandardCellInfo") -load("//verilog:defs.bzl", "VerilogInfo") +load("//verilog:defs.bzl", "VerilogInfo", "make_dag_entry", "make_verilog_info") # There are no rules to generate this provider, but it does provide the mechansim to build # rules based on surelog in the open source world. @@ -213,6 +213,16 @@ def _synthesize_design_impl(ctx): verilog_files = verilog_files, uhdm_files = uhdm_files, ), + make_verilog_info( + new_entries = [make_dag_entry( + label = ctx.label, + srcs = [output_file], + hdrs = [], + data = [], + deps = [], + tags = [], + )], + ), ] def _benchmark_synth(ctx, synth_log_file): diff --git a/verilog/defs.bzl b/verilog/defs.bzl index 0093003f..07b9d342 100644 --- a/verilog/defs.bzl +++ b/verilog/defs.bzl @@ -3,8 +3,12 @@ load( ":providers.bzl", _VerilogInfo = "VerilogInfo", + _make_dag_entry = "make_dag_entry", + _make_verilog_info = "make_verilog_info", _verilog_library = "verilog_library", ) VerilogInfo = _VerilogInfo verilog_library = _verilog_library +make_dag_entry = _make_dag_entry +make_verilog_info = _make_verilog_info diff --git a/verilog/providers.bzl b/verilog/providers.bzl index 91b288d1..d8dc0077 100644 --- a/verilog/providers.bzl +++ b/verilog/providers.bzl @@ -24,7 +24,7 @@ VerilogInfo = provider( }, ) -def make_dag_entry(srcs, hdrs, data, deps, label): +def make_dag_entry(srcs, hdrs, data, deps, label, tags): """Create a new DAG entry for use in VerilogInfo. As VerilogInfo should be created via 'merge_verilog_info' (rather than directly), @@ -42,6 +42,7 @@ def make_dag_entry(srcs, hdrs, data, deps, label): data: A list of File that are `data`. deps: A list of Label that are deps of this entry. label: A Label to use as the name for this entry. + tags: A list of str. (Ideally) just the entry tags for later filelist filtering. Returns: struct with all these fields properly stored. """ @@ -50,6 +51,7 @@ def make_dag_entry(srcs, hdrs, data, deps, label): hdrs = tuple(hdrs), data = tuple(data), deps = tuple(deps), + tags = tuple(tags), label = label, ) @@ -97,6 +99,7 @@ def _verilog_library_impl(ctx): hdrs = ctx.files.hdrs, deps = ctx.attr.deps, label = ctx.label, + tags = [], )], old_infos = [dep[VerilogInfo] for dep in ctx.attr.deps], )