Update DV make script Use the same artifact search mechanism as opentitan -- only there is a list of binary files that is used to search for the .elf file (for DV symbol loading purposes). Change-Id: Ia97bb279bd1cd1c15467657efb9e300e339c1983
diff --git a/hw/dv/tools/dvsim/sim.mk b/hw/dv/tools/dvsim/sim.mk index 2c809cc..cbac3af 100644 --- a/hw/dv/tools/dvsim/sim.mk +++ b/hw/dv/tools/dvsim/sim.mk
@@ -126,32 +126,28 @@ fi; \ echo "Building with command: $${bazel_cmd} build $${bazel_opts} $${bazel_label}"; \ $${bazel_cmd} build $${bazel_opts} $${bazel_label}; \ - if [[ $${build_repo} == "matcha" ]]; then \ - find -L $$($${bazel_cmd} info output_path)/ \ - -type f -name "$${bazel_target}*" | grep -v 'runfiles' | \ - xargs -I % cp -f % $${run_dir}; \ - else \ - for dep in $$($${bazel_cmd} cquery \ - $${bazel_cquery} \ - --ui_event_filters=-info \ - --noshow_progress \ - --output=starlark); do \ - if [[ $$dep != //hw* ]] && [[ $$dep != //util* ]] && [[ $$dep != //sw/host* ]]; then \ - for artifact in $$($${bazel_cmd} cquery $${dep} \ - --ui_event_filters=-info \ - --noshow_progress \ - --output=starlark \ - --starlark:expr="\"\\n\".join([f.path for f in target.files.to_list()])"); do \ - cp -f $${artifact} $${run_dir}/$$(basename $${artifact}); \ - if [[ $$artifact == *.bin && \ + for dep in $$($${bazel_cmd} cquery \ + $${bazel_cquery} \ + --ui_event_filters=-info \ + --noshow_progress \ + --output=starlark); do \ + if [[ $$dep != //hw* ]] && [[ $$dep != //util* ]] && [[ $$dep != //sw/host* ]] && [[ $$dep != @lowrisc_opentitan//* ]]; then \ + for artifact in $$($${bazel_cmd} cquery $${dep} \ + --ui_event_filters=-info \ + --noshow_progress \ + --output=starlark \ + --starlark:expr="\"\\n\".join([f.path for f in target.files.to_list()])"); do \ + cp -f $${artifact} $${run_dir}/$$(basename $${artifact}); \ + for ext in ".bin" ".64.scr.vmem" ".64.vmem" ".32.vmem"; do \ + if [[ $${artifact} == *$${ext} && \ -f "$$(echo $${artifact} | cut -d. -f 1).elf" ]]; then \ cp -f "$$(echo $${artifact} | cut -d. -f 1).elf" \ - $${run_dir}/$$(basename -s .bin $${artifact}).elf; \ + $${run_dir}/$$(basename -s $${ext} $${artifact}).elf; \ fi; \ done; \ - fi; \ - done; \ - fi; \ + done; \ + fi; \ + done; \ fi; \ done; endif