From 5f01cf6f93baec3b376a1477b09df33cced30d41 Mon Sep 17 00:00:00 2001 From: Robert Schmidt Date: Wed, 27 Nov 2024 16:49:04 +0100 Subject: [PATCH] Keep track of number of RUs in L1 Need to keep track of number of RUs, as the RU initialization increments the number of RUs. Therefore, subsequent initializations would fail if we don't decrement first. There is no better place (or I did not find it) to decrement the number of RUs than in nr_phy_free_RU(). For this reason, we also have to manually set the number of RUs in nr_prachsim to 1, otherwise the assert will trigger. --- openair1/PHY/INIT/nr_init_ru.c | 4 ++++ openair1/SIMULATION/NR_PHY/prachsim.c | 1 + 2 files changed, 5 insertions(+) diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c index bf447645d6..674c70cdc3 100644 --- a/openair1/PHY/INIT/nr_init_ru.c +++ b/openair1/PHY/INIT/nr_init_ru.c @@ -180,4 +180,8 @@ void nr_phy_free_RU(RU_t *ru) free_and_zero(ru->common.beam_id[i]); free_and_zero(ru->common.beam_id); } + + PHY_VARS_gNB *gNB0 = ru->gNB_list[0]; + gNB0->num_RU--; + DevAssert(gNB0->num_RU >= 0); } diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c index 08bf2e8fe6..de69fb6c16 100644 --- a/openair1/SIMULATION/NR_PHY/prachsim.c +++ b/openair1/SIMULATION/NR_PHY/prachsim.c @@ -467,6 +467,7 @@ int main(int argc, char **argv){ ru->nb_rx = n_rx; ru->num_gNB = 1; ru->gNB_list[0] = gNB; + gNB->num_RU = 1; gNB->gNB_config.carrier_config.num_tx_ant.value = 1; gNB->gNB_config.carrier_config.num_rx_ant.value = 1; if (mu == 0)