1# Copyright (c) 2021 Henrik Brix Andersen <henrik@brixandersen.dk> 2# SPDX-License-Identifier: Apache-2.0 3 4if((CONFIG_BOARD_NEORV32) AND (CONFIG_BUILD_OUTPUT_BIN)) 5 # Generate NEORV32 image formats for initialising IMEM. 6 find_program(IMAGE_GEN image_gen) 7 8 if(NOT ${IMAGE_GEN} STREQUAL IMAGE_GEN-NOTFOUND) 9 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands 10 COMMAND ${IMAGE_GEN} 11 ARGS -app_bin 12 ${CONFIG_KERNEL_BIN_NAME}.bin 13 ${CONFIG_KERNEL_BIN_NAME}_exe.bin 14 ${PROJECT_BINARY_DIR} 15 WORKING_DIRECTORY ${PROJECT_BINARY_DIR} 16 ) 17 message(STATUS "neorv32 binary will be written to: ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}_exe.bin") 18 19 set_property(GLOBAL APPEND PROPERTY extra_post_build_commands 20 COMMAND ${IMAGE_GEN} 21 ARGS -app_img 22 ${CONFIG_KERNEL_BIN_NAME}.bin 23 ${CONFIG_KERNEL_BIN_NAME}.vhd 24 ${PROJECT_BINARY_DIR} 25 WORKING_DIRECTORY ${PROJECT_BINARY_DIR} 26 ) 27 message(STATUS "neorv32 VHDL will be written to: ${PROJECT_BINARY_DIR}/${CONFIG_KERNEL_BIN_NAME}.vhd") 28 else() 29 message(STATUS "The neorv32 image_gen utility was not found, neorv32 image files cannot be generated") 30 endif() 31endif() 32