Backport Bazel 6 dvsim fix from OpenTitan

- Original change is here: https://github.com/lowRISC/opentitan/commit/ca516a6f33c746c3f11406a607956bc0771fbe6b

Change-Id: I1bdd94603c7aa87704fcc6f245d43b15076d83c8
diff --git a/hw/dv/tools/dvsim/sim.mk b/hw/dv/tools/dvsim/sim.mk
index 0325477..c888717 100644
--- a/hw/dv/tools/dvsim/sim.mk
+++ b/hw/dv/tools/dvsim/sim.mk
@@ -130,7 +130,10 @@
 				$${bazel_cquery} \
 				--ui_event_filters=-info \
 				--noshow_progress \
-				--output=starlark); do \
+				--output=starlark \
+				`# Bazel 6 cquery outputs repository targets in canonical format (@//blabla) whereas bazel 5 does not, ` \
+				`# so we use a custom starlark printer to remove in leading @ when needed.` \
+				--starlark:expr='str(target.label)[1:] if str(target.label).startswith("@//") else target.label'); do \
 				if [[ $$dep != //hw* ]] && [[ $$dep != //util* ]] && [[ $$dep != //sw/host* ]] && [[ $$dep != @lowrisc_opentitan//* ]]; then \
 					for artifact in $$($${bazel_cmd} cquery $${dep} \
 						--ui_event_filters=-info \