[sw] Propagate tags through opentitan_binary

Bazel observes tags only for leaf targets when run with
--build_tag_filters so we need to explicitly propagate tags when emitting
rules. This allows specifying "all" with a subset of the targets based
on filters.

Change-Id: I5689f65d1b3bbfed58af961340ff64af9a704671
diff --git a/rules/opentitan.bzl b/rules/opentitan.bzl
index 7d96cfd..94f869a 100644
--- a/rules/opentitan.bzl
+++ b/rules/opentitan.bzl
@@ -588,6 +588,7 @@
         platform = OPENTITAN_PLATFORM,
         extract_sw_logs_db = False,
         testonly = True,
+        tags = [],
         **kwargs):
     """A helper macro for generating OpenTitan binary artifacts.
 
@@ -598,6 +599,7 @@
       @param name: The name of this rule.
       @param platform: The target platform for the artifacts.
       @param extract_sw_logs_db: Whether to emit a log database for DV testbench.
+      @param tags: List of tags to apply to each target.
       @param **kwargs: Arguments to forward to `cc_binary`.
     Emits rules:
       cc_binary             named: <name>.elf
@@ -633,6 +635,7 @@
         copts = copts,
         linkopts = linkopts,
         testonly = testonly,
+        tags = tags,
         **kwargs
     )
 
@@ -642,6 +645,7 @@
         name = preproc_name,
         target = native_binary_name,
         testonly = testonly,
+        tags = tags,
     )
 
     asm_name = "{}_{}".format(name, "asm")
@@ -650,6 +654,7 @@
         name = asm_name,
         target = native_binary_name,
         testonly = testonly,
+        tags = tags,
     )
 
     ll_name = "{}_{}".format(name, "ll")
@@ -658,6 +663,7 @@
         name = ll_name,
         target = native_binary_name,
         testonly = testonly,
+        tags = tags,
     )
 
     map_name = "{}_{}".format(name, "map")
@@ -666,6 +672,7 @@
         name = map_name,
         target = native_binary_name,
         testonly = testonly,
+        tags = tags,
     )
 
     bin_name = "{}_{}".format(name, "bin")
@@ -675,6 +682,7 @@
         srcs = [native_binary_name],
         platform = platform,
         testonly = testonly,
+        tags = tags,
     )
 
     dis_name = "{}_{}".format(name, "dis")
@@ -684,6 +692,7 @@
         srcs = [native_binary_name],
         platform = platform,
         testonly = testonly,
+        tags = tags,
     )
 
     # Generate log message database for DV sim testbench
@@ -695,6 +704,7 @@
             srcs = [native_binary_name],
             platform = platform,
             testonly = testonly,
+            tags = tags,
         )
 
     # Create a filegroup with just the sides targets.
@@ -702,6 +712,7 @@
         name = name + "_side_targets",
         srcs = side_targets,
         testonly = testonly,
+        tags = tags,
     )
 
     return targets