Commit 0bdb1b9f authored by Robert Schmidt's avatar Robert Schmidt

Implement term_nr_ue_signal(), remove abstraction_flag from init_nr_ue_signal()

term_nr_ue_signal() frees all memory, except for dfts lib load
parent a7183bc5
......@@ -166,7 +166,7 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
}
// initialize all signal buffers
init_nr_ue_signal(ue, nb_connected_gNB, abstraction_flag);
init_nr_ue_signal(ue, nb_connected_gNB);
// intialize transport
init_nr_ue_transport(ue, abstraction_flag);
......
This diff is collapsed.
......@@ -57,6 +57,7 @@ int l1_north_init_eNB(void);
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);
void phy_init_nr_top(PHY_VARS_NR_UE *ue);
void phy_term_nr_top(void);
/*!
......@@ -395,7 +396,8 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp,uint8_t i_ssb);
int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
void nr_init_frame_parms_ue_sa(NR_DL_FRAME_PARMS *frame_parms, uint64_t downlink_frequency, int32_t uplink_frequency_offset, uint8_t mu, uint16_t nr_band);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB);
void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB);
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
......
......@@ -439,33 +439,10 @@ void init_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue)
void free_context_pss_nr(void)
{
for (int i = 0; i < NUMBER_PSS_SEQUENCE; i++) {
if (primary_synchro_time_nr[i] != NULL) {
free(primary_synchro_time_nr[i]);
primary_synchro_time_nr[i] = NULL;
}
else {
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
if (primary_synchro_nr[i] != NULL) {
free(primary_synchro_nr[i]);
primary_synchro_nr[i] = NULL;
}
else {
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
if (pss_corr_ue[i] != NULL) {
free(pss_corr_ue[i]);
pss_corr_ue[i] = NULL;
}
else {
LOG_E(PHY,"Fatal memory deallocation problem \n");
assert(0);
}
free_and_zero(primary_synchro_nr[i]);
free_and_zero(primary_synchro_nr2[i]);
free_and_zero(primary_synchro_time_nr[i]);
free_and_zero(pss_corr_ue[i]);
}
}
......
......@@ -413,7 +413,7 @@ int main(int argc, char **argv)
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
//phy_init_nr_top(frame_parms);
if (init_nr_ue_signal(UE, 1, 0) != 0) {
if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation\n");
exit(-1);
}
......@@ -642,6 +642,8 @@ int main(int argc, char **argv)
phy_free_nr_gNB(gNB);
term_nr_ue_signal(UE, 1);
for (i = 0; i < 2; i++) {
free(s_re[i]);
free(s_im[i]);
......
......@@ -915,7 +915,7 @@ int main(int argc, char **argv)
UE->perfect_ce = 0;
if (init_nr_ue_signal(UE, 1, 0) != 0)
if (init_nr_ue_signal(UE, 1) != 0)
{
printf("Error at UE NR initialisation\n");
exit(-1);
......
......@@ -553,7 +553,7 @@ int main(int argc, char **argv)
if(eps!=0.0)
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
if (init_nr_ue_signal(UE, 1, 0) != 0) {
if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation\n");
exit(-1);
}
......
......@@ -671,7 +671,7 @@ int main(int argc, char **argv){
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
UE->nrUE_config.prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t));
if (init_nr_ue_signal(UE, 1, 0) != 0){
if (init_nr_ue_signal(UE, 1) != 0){
printf("Error at UE NR initialisation\n");
exit(-1);
}
......
......@@ -490,7 +490,7 @@ int main(int argc, char **argv)
if(eps!=0.0)
UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
if (init_nr_ue_signal(UE, 1, 0) != 0)
if (init_nr_ue_signal(UE, 1) != 0)
{
printf("Error at UE NR initialisation\n");
exit(-1);
......
......@@ -756,7 +756,7 @@ int main(int argc, char **argv)
memcpy(&UE->frame_parms, frame_parms, sizeof(NR_DL_FRAME_PARMS));
//phy_init_nr_top(frame_parms);
if (init_nr_ue_signal(UE, 1, 0) != 0) {
if (init_nr_ue_signal(UE, 1) != 0) {
printf("Error at UE NR initialisation\n");
exit(-1);
}
......
......@@ -71,7 +71,7 @@ static nfapi_config_request_t *config =&config_t;
/*************** FUNCTIONS ****************************************/
//void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB, uint8_t abstraction_flag);
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_eNB);
/*******************************************************************
*
......@@ -248,7 +248,7 @@ int init_test(unsigned char N_tx, unsigned char N_rx, unsigned char transmission
//phy_init_nr_top(frame_parms);
if (init_nr_ue_signal(PHY_vars_UE, 1, 0) != 0) {
if (init_nr_ue_signal(PHY_vars_UE, 1) != 0) {
LOG_E(PHY,"Error at UE NR initialisation : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
return (0);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment