[dvsim] enable manufacturer tests to run in DV sim
This updates the interactions between dvsim and Bazel to enable running
manufacturer (closed-source) tests on the DV sim platform. Specifically,
a bazel cquery ... command is used to locate Bazel built SW images and
copy them into the simulation run_dir. This decouples the Bazel label
string for SW images from their (build) output directory.
Additionally, an example manufacturer test case is added to the
chip_sim_cfg.hjson file to demonstrate this capability.
This fixes #13430.
Signed-off-by: Timothy Trippel <ttrippel@google.com>
diff --git a/rules/opentitan.bzl b/rules/opentitan.bzl
index bc655e2..eef2e03 100644
--- a/rules/opentitan.bzl
+++ b/rules/opentitan.bzl
@@ -556,6 +556,7 @@
]
deps = kwargs.pop("deps", [])
targets = []
+ side_targets = []
native_binary_name = "{}.elf".format(name)
native.cc_binary(
@@ -568,28 +569,28 @@
)
preproc_name = "{}_{}".format(name, "preproc")
- targets.append(preproc_name)
+ side_targets.append(preproc_name)
rv_preprocess(
name = preproc_name,
target = native_binary_name,
)
asm_name = "{}_{}".format(name, "asm")
- targets.append(asm_name)
+ side_targets.append(asm_name)
rv_asm(
name = asm_name,
target = native_binary_name,
)
ll_name = "{}_{}".format(name, "ll")
- targets.append(ll_name)
+ side_targets.append(ll_name)
rv_llvm_ir(
name = ll_name,
target = native_binary_name,
)
map_name = "{}_{}".format(name, "map")
- targets.append(map_name)
+ side_targets.append(map_name)
rv_relink_with_linkmap(
name = map_name,
target = native_binary_name,
@@ -621,6 +622,12 @@
platform = platform,
)
+ # Create a filegroup with just the sides targets.
+ native.filegroup(
+ name = name + "_side_targets",
+ srcs = side_targets,
+ )
+
return targets
def opentitan_rom_binary(