Simplify UE SRS: no global memory required

Signed-off-by: Robert Schmidt <robert.schmidt@openairinterface.org>
This commit is contained in:
Robert Schmidt
2026-04-16 11:53:19 +02:00
parent 138e0f9547
commit 2213235fc1
5 changed files with 16 additions and 34 deletions
-4
View File
@@ -251,8 +251,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
ue->nr_csi_info->csi_rs_generated_signal[i] =
malloc16_clear(fp->samples_per_slot_wCP * sizeof(**ue->nr_csi_info->csi_rs_generated_signal));
}
ue->nr_srs_info = malloc16_clear(sizeof(nr_srs_info_t));
}
ue->init_averaging = 1;
@@ -301,8 +299,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue)
free_and_zero(ue->nr_csi_info->csi_rs_generated_signal);
free_and_zero(ue->nr_csi_info);
free_and_zero(ue->nr_srs_info);
free_and_zero(ue->prach_vars[gNB_id]);
}
@@ -148,11 +148,11 @@ void nr_tx_rotation_and_ofdm_mod(const uint8_t slot,
bool was_symbol_used[NR_SYMBOLS_PER_SLOT],
bool no_phase_pre_comp);
bool ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
c16_t **txdataF,
nr_phy_data_tx_t *phy_data,
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
void ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
c16_t **txdataF,
const fapi_nr_ul_config_srs_pdu *srs_config_pdu,
bool was_symbol_used[NR_SYMBOLS_PER_SLOT]);
void clean_UE_harq(PHY_VARS_NR_UE *UE);
-3
View File
@@ -402,9 +402,6 @@ typedef struct PHY_VARS_NR_UE_s {
nrLDPC_coding_interface_t nrLDPC_coding_interface;
uint8_t max_ldpc_iterations;
/// SRS variables
nr_srs_info_t *nr_srs_info;
/// CSI variables
nr_csi_info_t *nr_csi_info;
+10 -15
View File
@@ -243,7 +243,7 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx)
}
}
static void configure_srs_info(fapi_nr_ul_config_srs_pdu *srs_config_pdu, nr_srs_info_t *nr_srs_info)
static void configure_srs_info(const fapi_nr_ul_config_srs_pdu *srs_config_pdu, nr_srs_info_t *nr_srs_info)
{
nr_srs_info->B_SRS = srs_config_pdu->bandwidth_index;
nr_srs_info->C_SRS = srs_config_pdu->config_index;
@@ -272,25 +272,17 @@ static void configure_srs_info(fapi_nr_ul_config_srs_pdu *srs_config_pdu, nr_srs
* PARAMETERS : pointer to ue context
* pointer to rxtx context*
*
* RETURN : 0 if it is a valid slot for transmitting srs
* -1 if srs should not be transmitted
*
* DESCRIPTION : ue srs procedure
* send srs according to current configuration
*
*********************************************************************/
bool ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
void ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
c16_t **txdataF,
nr_phy_data_tx_t *phy_data,
const fapi_nr_ul_config_srs_pdu *srs_config_pdu,
bool was_symbol_used[NR_SYMBOLS_PER_SLOT])
{
if(phy_data->srs_vars.active == false) {
return false;
}
NR_DL_FRAME_PARMS *frame_parms = &(ue->frame_parms);
fapi_nr_ul_config_srs_pdu *srs_config_pdu = &phy_data->srs_vars.srs_config_pdu;
const uint8_t l0 = frame_parms->symbols_per_slot - 1 - srs_config_pdu->time_start_position;
// Num consecutive SRS symbols according to 38.211 6.4.1.4.1
int num_srs_symbols[] = {1, 2, 4, 8, 12};
@@ -326,18 +318,20 @@ bool ue_srs_procedures_nr(PHY_VARS_NR_UE *ue,
LOG_I(NR_PHY,"srs_config_pdu->t_offset = %u\n", srs_config_pdu->t_offset);
#endif
configure_srs_info(srs_config_pdu, ue->nr_srs_info);
nr_srs_info_t nr_srs_info = {0};
configure_srs_info(srs_config_pdu, &nr_srs_info);
uint16_t symbol_offset = l0 * frame_parms->ofdm_symbol_size;
bool generated = generate_srs_nr(frame_parms,
txdataF,
symbol_offset,
srs_config_pdu->bwp_start,
ue->nr_srs_info,
&nr_srs_info,
AMP,
proc->frame_tx,
proc->nr_slot_tx,
frame_parms->nb_antennas_tx);
return generated;
DevAssert(generated); // if we can't generate despite the SRS config, there
// is a problem
}
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_data_tx_t *phy_data, c16_t **txp)
@@ -365,7 +359,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, n
nr_ue_ulsch_procedures(ue, frame_tx, slot_tx, phy_data, (c16_t **)&txdataF, was_symbol_used);
ue_srs_procedures_nr(ue, proc, (c16_t **)&txdataF, phy_data, was_symbol_used);
if (phy_data->srs_vars.active)
ue_srs_procedures_nr(ue, proc, (c16_t **)&txdataF, &phy_data->srs_vars.srs_config_pdu, was_symbol_used);
pucch_procedures_ue_nr(ue, proc, phy_data, (c16_t **)&txdataF, was_symbol_used);
+1 -7
View File
@@ -467,11 +467,6 @@ int main(int argc, char *argv[])
.beamforming.num_prgs = srs_pdu.beamforming.num_prgs,
.beamforming.prg_size = srs_pdu.beamforming.prg_size};
nr_phy_data_tx_t phy_data = {0};
phy_data.srs_vars.active = true;
phy_data.srs_vars.srs_config_pdu = srs_config_pdu;
UE->nr_srs_info = malloc16_clear(sizeof(nr_srs_info_t));
//----------- UE TX SRS procedures ---------------------
UE_nr_rxtx_proc_t proc;
@@ -492,7 +487,7 @@ int main(int argc, char *argv[])
for (i = 0; i < n_tx; i++)
txd[i] = txdata[i] + slot_offset;
ue_srs_procedures_nr(UE, &proc, (c16_t **)txF, &phy_data, was_symbol_used);
ue_srs_procedures_nr(UE, &proc, (c16_t **)txF, &srs_config_pdu, was_symbol_used);
//------------ TX rotation and OFDM Modulation --------------------------
nr_tx_rotation_and_ofdm_mod(slot, fp, n_tx, txF, txd, link_type_ul, was_symbol_used, false);
@@ -666,7 +661,6 @@ int main(int argc, char *argv[])
phy_free_nr_gNB(gNB);
free_channel_desc_scm(UE2gNB);
free_and_zero(UE->nr_srs_info);
free(gNB->RU_list[0]);
free(UE);