zephyr/cmake/emu/nsim.cmake
Watson Zeng fad20c42c6 boards: arc: nsim: add a new board nsim_em7d_v22
Typically we have ARC core configurations where Fast IRQs (FIRQ) are
enabled together with multiple register files and those we have covered
by testing. But FIRQ & single register bank we only happen to have on
the older EMSK v2.2.it might be a good idea to add a similar
configuration to nSIM "boards" so that we keep it tested regularly.

nsim_em7d_v22 configuration is similar with em_staterkit_em7d_v22,
both configed with FIRQ & single register bank.

Signed-off-by: Watson Zeng <zhiwei@synopsys.com>
2020-09-03 21:47:51 +02:00

62 lines
1.5 KiB
CMake

# SPDX-License-Identifier: Apache-2.0
if(${CONFIG_SOC_NSIM_HS_SMP})
# mdb is required to run nsim multicore targets
find_program(
MDB
mdb
)
if(${CONFIG_SOC_NSIM_HS_SMP})
set(MDB_ARGS mdb_hs_smp.args)
endif()
add_custom_target(run
COMMAND
${MDB} -pset=1 -psetname=core0 -prop=ident=0x00000050 -cmpd=soc
@${BOARD_DIR}/support/${MDB_ARGS} ${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME} &&
${MDB} -pset=2 -psetname=core1 -prop=download=2 -prop=ident=0x00000150 -cmpd=soc
@${BOARD_DIR}/support/${MDB_ARGS} ${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME} &&
NSIM_MULTICORE=1 ${MDB} -multifiles=core0,core1 -cmpd=soc -run -cl
DEPENDS ${logical_target_for_zephyr_elf}
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
USES_TERMINAL
)
else()
find_program(
NSIM
nsimdrv
)
if(${CONFIG_SOC_NSIM_EM})
set(NSIM_PROPS nsim_em.props)
elseif(${CONFIG_SOC_NSIM_EM7D_V22})
set(NSIM_PROPS nsim_em7d_v22.props)
elseif(${CONFIG_SOC_NSIM_SEM})
set(NSIM_PROPS nsim_sem.props)
elseif(${CONFIG_SOC_NSIM_HS})
set(NSIM_PROPS nsim_hs.props)
endif()
add_custom_target(run
COMMAND
${NSIM}
-propsfile
${BOARD_DIR}/support/${NSIM_PROPS}
${APPLICATION_BINARY_DIR}/zephyr/${KERNEL_ELF_NAME}
DEPENDS ${logical_target_for_zephyr_elf}
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
USES_TERMINAL
)
add_custom_target(debugserver
COMMAND
${NSIM}
-propsfile
${BOARD_DIR}/support/${NSIM_PROPS}
-gdb -port=3333
DEPENDS ${logical_target_for_zephyr_elf}
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
USES_TERMINAL
)
endif()