Skip to content

Commit d4e2bc7

Browse files
committed
nrf52_bsim: Use HW models from new west module
Fetch HW models from a new west module. And, remove all pre-west glue which was used to: * Fetch them in CI * Validate their vesion * Modify the include path and link to them Signed-off-by: Alberto Escolar Piedras <[email protected]>
1 parent a4b134e commit d4e2bc7

File tree

4 files changed

+4
-77
lines changed

4 files changed

+4
-77
lines changed

boards/posix/nrf52_bsim/CMakeLists.txt

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -13,57 +13,11 @@ if (NOT DEFINED ENV{BSIM_OUT_PATH})
1313
https://babblesim.github.io/folder_structure_and_env.html")
1414
endif()
1515

16-
#Let's check that the HW models are the needed version or newer
17-
#That is, that the needed tag is somewhere in the past of its branch
18-
if(NOT DEFINED ENV{NO_NRF52_BSIM_VERSION_WARNING})
19-
if(GIT_FOUND) #boilerplate.cmake searches for git
20-
file(STRINGS "hw_models_version" NRF52_HW_MODELS_TAG) #desired version
21-
execute_process(COMMAND ${GIT_EXECUTABLE} merge-base --is-ancestor
22-
${NRF52_HW_MODELS_TAG} HEAD
23-
WORKING_DIRECTORY $ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/
24-
OUTPUT_VARIABLE NRF52_HW_MODELS_TAG_FOUND
25-
OUTPUT_STRIP_TRAILING_WHITESPACE
26-
ERROR_STRIP_TRAILING_WHITESPACE
27-
ERROR_VARIABLE stderr
28-
RESULT_VARIABLE return_code
29-
)
30-
if(return_code)
31-
message(WARNING "The NRF52 HW models are out of date\
32-
(${NRF52_HW_MODELS_TAG} needed at least); Please update them or expect\
33-
problems!\nReported error while trying to find the tag: \"${stderr}\"")
34-
35-
#let's print the latest actual tag for the available models:
36-
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags
37-
WORKING_DIRECTORY $ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/
38-
OUTPUT_VARIABLE NRF52_HW_MODELS_TAG_FOUND
39-
OUTPUT_STRIP_TRAILING_WHITESPACE
40-
ERROR_STRIP_TRAILING_WHITESPACE
41-
ERROR_VARIABLE stderr
42-
RESULT_VARIABLE return_code
43-
)
44-
message(STATUS "Found NRF52 models version ${NRF52_HW_MODELS_TAG_FOUND}")
45-
46-
message(FATAL_ERROR "To disable this check set the environment variable\
47-
NO_NRF52_BSIM_VERSION_WARNING")
48-
49-
elseif(CMAKE_VERBOSE_MAKEFILE)
50-
message(STATUS "nrf52_bsim: git merge-base --is-ancestor\
51-
${NRF52_HW_MODELS_TAG} HEAD,
52-
stdout: ${NRF52_HW_MODELS_TAG_FOUND}
53-
stderr: ${stderr}")
54-
endif()
55-
endif()
56-
endif()
57-
5816
zephyr_library()
5917
zephyr_library_compile_definitions(NO_POSIX_CHEATS)
6018

6119
zephyr_include_directories(
6220
fake
63-
$ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/src/
64-
$ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/src/nrfx/hal/
65-
$ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/src/nrfx/
66-
$ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/src/HW_models/
6721
)
6822

6923
#Due to the BLE controller assumption about enum size
@@ -85,8 +39,6 @@ zephyr_library_include_directories(
8539
fake
8640
$ENV{BSIM_COMPONENTS_PATH}/libUtilv1/src/
8741
$ENV{BSIM_COMPONENTS_PATH}/libPhyComv1/src/
88-
$ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/src/HW_models/
89-
$ENV{BSIM_COMPONENTS_PATH}/ext_NRF52_hw_models/src/nrfx_hal/
9042
$ENV{BSIM_COMPONENTS_PATH}/libRandv2/src/
9143
${ZEPHYR_BASE}/kernel/include
9244
${ZEPHYR_BASE}/arch/posix/include
@@ -101,7 +53,6 @@ zephyr_library_import(bsim_libUtilv1 ${libpath}/libUtilv1.32.a)
10153
zephyr_library_import(bsim_libPhyComv1 ${libpath}/libPhyComv1.32.a)
10254
zephyr_library_import(bsim_lib2G4PhyComv1 ${libpath}/lib2G4PhyComv1.32.a)
10355
zephyr_library_import(bsim_libRandv2 ${libpath}/libRandv2.32.a)
104-
zephyr_library_import(bsim_libNRF52_hw ${libpath}/libNRF52_hw_models.32.a)
10556

10657
# This is due to some tests using _Static_assert which is a 2011 feature, but
10758
# otherwise relying on compilers supporting it also when set to C99.

boards/posix/nrf52_bsim/hw_models_version

Lines changed: 0 additions & 1 deletion
This file was deleted.

scripts/ci/run_ci.sh

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,29 +115,6 @@ function on_complete() {
115115
fi
116116
}
117117

118-
119-
function build_btsim() {
120-
nrf_hw_models_version=`cat boards/posix/nrf52_bsim/hw_models_version`
121-
pushd .
122-
cd ${BSIM_COMPONENTS_PATH}
123-
if [ -d ext_NRF52_hw_models ]; then
124-
cd ext_NRF52_hw_models
125-
git describe --tags --abbrev=0 ${NRF52_HW_MODELS_TAG}\
126-
> /dev/null ||
127-
(
128-
echo "`pwd` seems to contain the nRF52 HW\
129-
models but they are out of date"
130-
exit 1
131-
)
132-
else
133-
git clone -b ${nrf_hw_models_version} \
134-
https://github.com/BabbleSim/ext_NRF52_hw_models.git
135-
fi
136-
cd ${BSIM_OUT_PATH}
137-
make everything -j 8 -s
138-
popd
139-
}
140-
141118
function run_bsim_bt_tests() {
142119
WORK_DIR=${ZEPHYR_BASE}/bsim_bt_out tests/bluetooth/bsim_bt/compile.sh
143120
RESULTS_FILE=${ZEPHYR_BASE}/${bsim_bt_test_results_file} \
@@ -250,10 +227,7 @@ if [ -n "$main_ci" ]; then
250227
$short_git_log
251228

252229
if [ -n "${BSIM_OUT_PATH}" -a -d "${BSIM_OUT_PATH}" ]; then
253-
echo "Build BT simulator tests"
254-
# Build BT Simulator
255-
build_btsim
256-
230+
echo "Build and run BT simulator tests"
257231
# Run BLE tests in simulator on the 1st CI instance:
258232
if [ "$matrix" = "1" ]; then
259233
run_bsim_bt_tests

west.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ manifest:
103103
- name: mipi-sys-t
104104
path: modules/debug/mipi-sys-t
105105
revision: baf51863f19f009b92e762115ba5572a5b996b92
106+
- name: nrf_hw_models
107+
path: modules/bsim_hw_models/nrf_hw_models
108+
revision: fec69703cb1ca06fcdab6d5fde01274f0fc5c759
106109

107110
self:
108111
path: zephyr

0 commit comments

Comments
 (0)