Skip to content

Commit e31a090

Browse files
nashifcarlescufi
authored andcommitted
cmake: add simics emu support
Add simics as a simulation platform allowing running platforms supported in simics to be run using west or twister. Originally authored by: Maureen Helm Signed-off-by: Anas Nashif <[email protected]>
1 parent a87eec5 commit e31a090

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

boards/common/simics.board.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
board_finalize_emu_args(simics)

cmake/emu/simics.cmake

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Copyright (c) 2023 Intel Corporation
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
find_program(
6+
SIMICS
7+
NAMES simics
8+
)
9+
10+
zephyr_get(SIMICS_SCRIPT_PATH SYSBUILD GLOBAL)
11+
if(SIMICS_SCRIPT_PATH)
12+
set(SIMICS_SCRIPT ${SIMICS_SCRIPT_PATH})
13+
else()
14+
set(SIMICS_SCRIPT ${BOARD_DIR}/support/${BOARD}.simics)
15+
endif()
16+
17+
get_property(SIMICS_ARGS GLOBAL PROPERTY "BOARD_EMU_ARGS_simics")
18+
19+
add_custom_target(run_simics
20+
COMMAND
21+
${SIMICS}
22+
-no-gui
23+
-no-win
24+
${SIMICS_SCRIPT}
25+
${SIMICS_ARGS}
26+
-e run
27+
WORKING_DIRECTORY ${APPLICATION_BINARY_DIR}
28+
DEPENDS ${logical_target_for_zephyr_elf}
29+
USES_TERMINAL
30+
)

0 commit comments

Comments
 (0)