Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hwmv2: Native targets covert to HW model v2 #69034

Merged
merged 6 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 0 additions & 31 deletions boards/boards_legacy/posix/nrf_bsim/Kconfig.board

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ set_property(TARGET native_simulator APPEND PROPERTY RUNNER_LINK_LIBRARIES
target_compile_options(native_simulator INTERFACE
"-DNSI_PRIMARY_MCU_N=${CONFIG_NATIVE_SIMULATOR_PRIMARY_MCU_INDEX}")

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
)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config BOARD_NRF52_BSIM
bool
select SOC_SERIES_BSIM_NRF52X
select SOC_COMPATIBLE_NRF52833
select NRF_RTC_TIMER
select CLOCK_CONTROL
help
NRF52 simulation model
Will produce a console Linux process which can be executed natively.
It needs the BabbleSim simulator both in compile time and to execute

config BOARD_NRF5340BSIM_NRF5340_CPUNET
bool
select SOC_SERIES_BSIM_NRF53X
select SOC_COMPATIBLE_NRF5340_CPUNET
select NRF_RTC_TIMER
select CLOCK_CONTROL
help
Simulated NRF53 Network core
Will produce a console Linux process which can be executed natively.
It needs the BabbleSim simulator both in compile time and to execute

config BOARD_NRF5340BSIM_NRF5340_CPUAPP
bool
select SOC_SERIES_BSIM_NRF53X
select SOC_COMPATIBLE_NRF5340_CPUAPP
select NRF_RTC_TIMER
select CLOCK_CONTROL
help
Simulated NRF53 Application core
Will produce a console Linux process which can be executed natively.
It needs the BabbleSim simulator both in compile time and to execute


if SOC_SERIES_BSIM_NRFXX

# The following file is normally parsed only for the ARM architecture, which is
Expand All @@ -8,7 +43,7 @@ if SOC_SERIES_BSIM_NRFXX
# must be read also from here.
source "soc/nordic_nrf/common/Kconfig.peripherals"

source "boards/boards_legacy/$(ARCH)/common/extra_args/Kconfig"
source "boards/native/common/extra_args/Kconfig"

endif # SOC_SERIES_BSIM_NRFXX

Expand Down
5 changes: 5 additions & 0 deletions boards/native/nrf_bsim/Kconfig.nrf52_bsim
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config BOARD_NRF52_BSIM
select SOC_POSIX
5 changes: 5 additions & 0 deletions boards/native/nrf_bsim/Kconfig.nrf5340bsim_nrf5340_cpuapp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config BOARD_NRF5340BSIM_NRF5340_CPUAPP
select SOC_POSIX
5 changes: 5 additions & 0 deletions boards/native/nrf_bsim/Kconfig.nrf5340bsim_nrf5340_cpunet
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config BOARD_NRF5340BSIM_NRF5340_CPUNET
select SOC_POSIX
13 changes: 13 additions & 0 deletions boards/native/nrf_bsim/board.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
boards:
- name: nrf52_bsim
vendor: Zephyr
socs:
- name: native
- name: nrf5340bsim_nrf5340_cpuapp
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this ought to be a soc with a cpucluster if the intention is to have it appear similar to a nRF530 SoC.

Doing so would also remove some other comments which I would otherwise have regarding the Kconfig.

I did notice:

Note: the nrf5340 variants remain as their own
targets, instead of being variants of the base ones
to avoid breakage in this commit

what kind of breakage are you refering to, and are you planning to make more updates to the bsim boards with regards to variants ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same answer as above
(clarification w "variants" I meant "socs" or "cpu-clusters")

vendor: Zephyr
socs:
- name: native
- name: nrf5340bsim_nrf5340_cpunet
vendor: Zephyr
socs:
- name: native
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <mem.h>
#include <arm/nordic/nrf52833.dtsi>
/* We resuse the pinctrl definitions directly from the real board : */
#include <../boards/boards_legacy/arm/nrf52833dk_nrf52833/nrf52833dk_nrf52833-pinctrl.dtsi>
#include <../boards/nordic_nrf/nrf52833dk/nrf52833dk_nrf52833-pinctrl.dtsi>

/ {
model = "nrf52 bsim";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Copyright (c) 2024 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_POSIX=y
CONFIG_BOARD_NRF52_BSIM=y
CONFIG_CONSOLE=y
CONFIG_NO_OPTIMIZATIONS=y
CONFIG_LOG_BACKEND_UART=n
Original file line number Diff line number Diff line change
Expand Up @@ -115,4 +115,4 @@
/* We re-use the IPC shared buffer definition from the real HW. But note the start address of the
* buffer won't be used.
*/
#include <../boards/board_legacy/arm/nrf5340dk_nrf5340/nrf5340_shared_sram_planning_conf.dtsi>
#include <../boards/nordic_nrf/nrf5340dk/nrf5340_shared_sram_planning_conf.dtsi>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_POSIX=y
CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUAPP=y
CONFIG_CONSOLE=y
CONFIG_NO_OPTIMIZATIONS=y
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,4 @@
/* We re-use the IPC shared buffer definition from the real HW. But note the start address of the
* buffer won't be used.
*/
#include <../boards/boards_legacy/arm/nrf5340dk_nrf5340/nrf5340_shared_sram_planning_conf.dtsi>
#include <../boards/nordic_nrf/nrf5340dk/nrf5340_shared_sram_planning_conf.dtsi>
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
# SPDX-License-Identifier: Apache-2.0

CONFIG_SOC_POSIX=y
CONFIG_BOARD_NRF5340BSIM_NRF5340_CPUNET=y
CONFIG_CONSOLE=y
CONFIG_NO_OPTIMIZATIONS=y