1#!/usr/bin/env bash
2# Copyright (c) 2024 Nordic Semiconductor
3# SPDX-License-Identifier: Apache-2.0
4
5set -eu
6
7source ${ZEPHYR_BASE}/tests/bsim/sh_common.source
8
9test_name="$(guess_test_long_name)"
10
11simulation_id=${test_name}
12verbosity_level=2
13
14# Simulated test runtime (as seen by Zephyr and the PHY)
15# The test will be terminated much earlier if it passes
16SIM_LEN_US=$((10 * 1000 * 1000))
17
18tester_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD_TS}_${test_name}_tester_prj_conf"
19dut_exe="${BSIM_OUT_PATH}/bin/bs_${BOARD_TS}_${test_name}_dut_prj_conf"
20
21cd ${BSIM_OUT_PATH}/bin
22
23Execute ./bs_2G4_phy_v1 -v=${verbosity_level} -s=${simulation_id} -D=4 -sim_length=${SIM_LEN_US} $@
24
25Execute "${dut_exe}" -v=${verbosity_level} -s=${simulation_id} -d=0 -rs=420 -testid=dut
26
27Execute "${tester_exe}" -s=${simulation_id} -d=1 -rs=100 -testid=tester
28Execute "${tester_exe}" -s=${simulation_id} -d=2 -rs=200 -testid=tester
29Execute "${tester_exe}" -s=${simulation_id} -d=3 -rs=300 -testid=tester
30
31wait_for_background_jobs
32