cmake: combine nsim and mdb for emulation

* to avoid confusion, combine nsim and mdb related
cmake configurations.

* this also enable the lanuch of mdb in sanitycheck

Signed-off-by: Wayne Ren <wei.ren@synopsys.com>
This commit is contained in:
Wayne Ren 2020-07-07 18:14:13 +08:00 committed by Carles Cufí
parent 938642cf7f
commit 6f6fddf7e9
4 changed files with 24 additions and 28 deletions

View file

@ -1,10 +1,5 @@
# SPDX-License-Identifier: Apache-2.0
if(${CONFIG_SOC_NSIM_HS_SMP})
set(EMU_PLATFORM mdb)
else()
set(EMU_PLATFORM nsim)
endif()
if(NOT CONFIG_SOC_NSIM_HS_SMP)
board_set_flasher_ifnset(arc-nsim)

View file

@ -1,7 +1,7 @@
identifier: nsim_hs_smp
name: Multi-core HS nSIM simulator
type: mcu
simulation: mdb
simulation: nsim
arch: arc
toolchain:
- zephyr

View file

@ -1,22 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
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=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
)

View file

@ -1,5 +1,27 @@
# 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
@ -34,3 +56,4 @@ add_custom_target(debugserver
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
USES_TERMINAL
)
endif()