Skip to content

Commit

Permalink
[ci] Copy ROM artifacts from correct targets
Browse files Browse the repository at this point in the history
The ELF and BIN outputs were not looked up from the correct targets.
Adjust the publishing script to retrieve files by starting from the
opentitan_rom_binary, crossing the transition through the graph, and
querying for all unique output files.

Signed-off-by: Alexander Williams <[email protected]>
  • Loading branch information
a-will committed Aug 4, 2023
1 parent f44e0db commit bcd139c
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,17 @@ jobs:
# copy the rom to a specific location
ROM_TARGET="${BIN_DIR}/sw/device/silicon_creator/rom"
mkdir -p "${ROM_TARGET}"
AUTHENTICITY=(fake real)
for authenticity in "${AUTHENTICITY[@]}"; do
ROM=$(ci/scripts/target-location.sh "//sw/device/silicon_creator/rom:rom_with_${authenticity}_keys_fpga_cw310_scr_vmem")
cp $ROM "${ROM_TARGET}/$(basename "${ROM}")"
ROM_DIR=$(dirname $ROM)
cp "${ROM_DIR}/rom_with_${authenticity}_keys_fpga_cw310.elf" "${ROM_TARGET}/"
cp "${ROM_DIR}/rom_with_${authenticity}_keys_fpga_cw310.bin" "${ROM_TARGET}/"
done
# To make the correct query to get the ELF output file, we have to start
# from a node that is built for our usual target platform (the host) and
# follow the edges in the graph across the configuration transition (to
# riscv32). The deps 2 levels down from the opentitan_rom_binary include
# all the important files.
ROM_REAL_TARGETS="deps(//sw/device/silicon_creator/rom:rom_with_real_keys_from_src_fpga_cw310, 2)"
ROM_FAKE_TARGETS="deps(//sw/device/silicon_creator/rom:rom_with_fake_keys_fpga_cw310, 2)"
QUERY_CMD_ARGS=(outquery-all --noinclude_aspects --noimplicit_deps)
ROM_REAL_FILES=($(./bazelisk.sh "${QUERY_CMD_ARGS[@]}" "${ROM_REAL_TARGETS}" | sort | uniq))
ROM_FAKE_FILES=($(./bazelisk.sh "${QUERY_CMD_ARGS[@]}" "${ROM_FAKE_TARGETS}" | sort | uniq))
cp -Lvt "${ROM_TARGET}" "${ROM_FAKE_FILES[@]}" "${ROM_REAL_FILES[@]}"
- template: ci/upload-artifacts-template.yml
parameters:
includePatterns:
Expand Down

0 comments on commit bcd139c

Please sign in to comment.