merge almost duplicated code for ru prach list and gNB prach list

(gNB is not the proper name, it is CU+DU, gNB is RU+CU+DU)
This commit is contained in:
Laurent THOMAS
2025-10-30 11:54:21 +01:00
committed by Robert Schmidt
parent 88cecd707b
commit 4dd340b6bb
11 changed files with 79 additions and 123 deletions
+5 -7
View File
@@ -151,9 +151,7 @@ int main(int argc, char **argv){
NR_DL_FRAME_PARMS *frame_parms;
nfapi_nr_prach_config_t *prach_config;
nfapi_nr_prach_pdu_t *prach_pdu;
fapi_nr_prach_config_t *ue_prach_config;
fapi_nr_ul_config_prach_pdu *ue_prach_pdu;
channel_desc_t *UE2gNB;
SCM_t channel_model = Rayleigh1;
@@ -417,7 +415,6 @@ int main(int argc, char **argv){
ru = RC.ru[0];
frame_parms = &gNB->frame_parms;
prach_config = &gNB->gNB_config.prach_config;
prach_pdu = &gNB->prach_vars.list[0].pdu;
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
s_re = malloc(2*sizeof(double*));
@@ -561,9 +558,6 @@ int main(int argc, char **argv){
prach_config->restricted_set_config.value = restrictedSetConfig;
prach_config->prach_sequence_length.value = prach_sequence_length;
prach_config->prach_sub_c_spacing.value = mu;
prach_pdu->num_cs = get_NCS(NCS_config, format0, restrictedSetConfig);
prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value = 1+(64/(N_ZC/prach_pdu->num_cs));
prach_pdu->prach_format = prach_format;
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
RC.nb_nr_L1_inst=1;
@@ -573,6 +567,10 @@ int main(int argc, char **argv){
phy_init_nr_gNB(gNB);
nr_phy_init_RU(ru);
nfapi_nr_prach_pdu_t *prach_pdu = &gNB->prach_vars.list.list[0].pdu;
prach_pdu->num_cs = get_NCS(NCS_config, format0, restrictedSetConfig);
prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value = 1+(64/(N_ZC/prach_pdu->num_cs));
prach_pdu->prach_format = prach_format;
// Configure UE
UE = malloc(sizeof(PHY_VARS_NR_UE));
@@ -588,7 +586,7 @@ int main(int argc, char **argv){
exit(-1);
}
ue_prach_pdu = &UE->prach_vars[0]->prach_pdu;
fapi_nr_ul_config_prach_pdu *ue_prach_pdu = &UE->prach_vars[0]->prach_pdu;
ue_prach_config = &UE->nrUE_config.prach_config;
txdata = UE->common_vars.txData;