board: native_sim/posix: Convert to hwmv2

With new board.yml files and reorganizing their
Kconfig options.

Note: native_posix_64 & native_sim_64 remain as their own
targets, instead of being variants of the base ones
to avoid breakage in this commit, while not
having a massive commit.

Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
This commit is contained in:
Alberto Escolar Piedras
2024-02-14 18:27:23 +01:00
committed by Carles Cufi
parent 04cbad174e
commit 5821b9ec2e
83 changed files with 78 additions and 66 deletions

View File

@@ -1,24 +0,0 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_POSIX_32BIT
bool "Native POSIX for 32-bit host"
depends on SOC_POSIX
select BOARD_NATIVE_POSIX
help
Will produce a console Linux process which can be executed natively
as a 32-bit executable.
It provides some minimal needed models:
An interrupt controller, timer (system tick), and redirects kernel prints to
stdout.
config BOARD_NATIVE_POSIX_64BIT
bool "Native POSIX for 64-bit host"
depends on SOC_POSIX
select BOARD_NATIVE_POSIX
select 64BIT
help
Will produce a console Linux process which can be executed natively
as a 64-bit executable.
It provides some minimal needed models:
An interrupt controller, timer (system tick), and redirects kernel prints to
stdout.

View File

@@ -1,17 +0,0 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_SIM_32BIT
bool "Native simulation, 32-bit mode"
select BOARD_NATIVE_SIM
help
Will produce a console Linux process which can be executed natively
as a 32-bit executable.
config BOARD_NATIVE_SIM_64BIT
bool "Native simulation, 64-bit mode"
select BOARD_NATIVE_SIM
select 64BIT
help
Will produce a console Linux process which can be executed natively
as a 64-bit executable.

View File

@@ -5,7 +5,7 @@ set(zephyr_build_path ${APPLICATION_BINARY_DIR}/zephyr)
get_property(CCACHE GLOBAL PROPERTY RULE_LAUNCH_COMPILE)
target_link_options(native_simulator INTERFACE
"-T ${ZEPHYR_BASE}/boards/boards_legacy/posix/common/natsim_linker_script.ld")
"-T ${ZEPHYR_BASE}/boards/native/common/natsim_linker_script.ld")
set(nsi_config_content
${nsi_config_content}

View File

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

View File

Before

Width:  |  Height:  |  Size: 9.5 KiB

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

View File

@@ -25,7 +25,7 @@ zephyr_library_include_directories(
)
if(CONFIG_HAS_SDL)
add_subdirectory(${ZEPHYR_BASE}/boards/boards_legacy/${ARCH}/common/sdl/ ${CMAKE_CURRENT_BINARY_DIR}/sdl)
add_subdirectory(${ZEPHYR_BASE}/boards/native/common/sdl/ ${CMAKE_CURRENT_BINARY_DIR}/sdl)
endif()
zephyr_ld_options(

View File

@@ -5,6 +5,25 @@ config BOARD_NATIVE_POSIX
imply NATIVE_POSIX_TIMER
select POSIX_ARCH_CONSOLE
select NATIVE_APPLICATION
help
Native POSIX - 32 bit version
Will produce a console Linux process which can be executed natively
as a 32-bit executable.
It provides some minimal needed models:
An interrupt controller, timer (system tick), and redirects kernel prints to
stdout.
config BOARD_NATIVE_POSIX_64
bool
select BOARD_NATIVE_POSIX
select 64BIT
help
Native POSIX - 64 bit version
Will produce a console Linux process which can be executed natively
as a 64-bit executable.
It provides some minimal needed models:
An interrupt controller, timer (system tick), and redirects kernel prints to
stdout.
if BOARD_NATIVE_POSIX
@@ -22,6 +41,6 @@ config NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME
case the zephyr kernel and application cannot tell the difference unless they
interact with some other driver/device which runs at real time.
source "boards/boards_legacy/$(ARCH)/common/sdl/Kconfig"
source "boards/native/common/sdl/Kconfig"
endif # BOARD_NATIVE_POSIX

View File

@@ -11,10 +11,6 @@ config BUILD_OUTPUT_EXE
config OUTPUT_PRINT_MEMORY_USAGE
default n
config BOARD
default "native_posix_64" if BOARD_NATIVE_POSIX_64BIT
default "native_posix"
if NETWORKING
config NET_L2_ETHERNET

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_POSIX
select SOC_POSIX

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_POSIX_64
select SOC_POSIX

View File

@@ -0,0 +1,9 @@
boards:
- name: native_posix
vendor: Zephyr
socs:
- name: native
- name: native_posix_64
vendor: Zephyr
socs:
- name: native

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_POSIX=y
CONFIG_BOARD_NATIVE_POSIX_64BIT=y
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_POSIX=y
CONFIG_BOARD_NATIVE_POSIX_32BIT=y
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000

View File

@@ -24,10 +24,10 @@ zephyr_library_include_directories(
)
if(CONFIG_HAS_SDL)
add_subdirectory(${ZEPHYR_BASE}/boards/boards_legacy/${ARCH}/common/sdl/ ${CMAKE_CURRENT_BINARY_DIR}/sdl)
add_subdirectory(${ZEPHYR_BASE}/boards/native/common/sdl/ ${CMAKE_CURRENT_BINARY_DIR}/sdl)
endif()
add_subdirectory(${ZEPHYR_BASE}/boards/boards_legacy/${ARCH}/common/extra_args/
add_subdirectory(${ZEPHYR_BASE}/boards/native/common/extra_args/
${CMAKE_CURRENT_BINARY_DIR}/extra_args
)

View File

@@ -2,12 +2,24 @@
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_SIM
bool "Native simulator (Single Core)"
bool
select POSIX_ARCH_CONSOLE
select NATIVE_LIBRARY
select NATIVE_POSIX_TIMER
depends on SOC_POSIX
imply BOARD_NATIVE_POSIX if NATIVE_SIM_NATIVE_POSIX_COMPAT
help
Native simulator (Single Core)
Will produce a console Linux process which can be executed natively
as a 32-bit executable.
config BOARD_NATIVE_SIM_64
bool
select BOARD_NATIVE_SIM
select 64BIT
help
Native simulator (Single Core) - 64 bit version
Will produce a console Linux process which can be executed natively
as a 64-bit executable.
if BOARD_NATIVE_SIM
@@ -45,7 +57,7 @@ config NATIVE_POSIX_SLOWDOWN_TO_REAL_TIME
Transitional option which allows applications which targeted native_posix
to set the correct native_sim option (CONFIG_NATIVE_SIM_SLOWDOWN_TO_REAL_TIME)
source "boards/boards_legacy/$(ARCH)/common/sdl/Kconfig"
source "boards/boards_legacy/$(ARCH)/common/extra_args/Kconfig"
source "boards/native/common/sdl/Kconfig"
source "boards/native/common/extra_args/Kconfig"
endif # BOARD_NATIVE_SIM

View File

@@ -12,10 +12,6 @@ config BUILD_OUTPUT_EXE
config OUTPUT_PRINT_MEMORY_USAGE
default n
config BOARD
default "native_sim_64" if BOARD_NATIVE_SIM_64BIT
default "native_sim"
if NETWORKING
config NET_L2_ETHERNET

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_SIM
select SOC_POSIX

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
config BOARD_NATIVE_SIM_64
select SOC_POSIX

View File

@@ -0,0 +1,9 @@
boards:
- name: native_sim
vendor: Zephyr
socs:
- name: native
- name: native_sim_64
vendor: Zephyr
socs:
- name: native

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_POSIX=y
CONFIG_BOARD_NATIVE_SIM_64BIT=y
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000

View File

@@ -1,6 +1,4 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_SOC_POSIX=y
CONFIG_BOARD_NATIVE_SIM_32BIT=y
CONFIG_CONSOLE=y
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=1000000