|
|
|
@@ -111,6 +111,49 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
for (int j = 0; j < NR_MAX_NB_LAYERS; j++) {
|
|
|
|
|
const int idx = j * fp->nb_antennas_rx + i;
|
|
|
|
|
for (int k = 0; k < NR_MAX_NB_LAYERS; k++)
|
|
|
|
|
free_and_zero(pdsch->rho[i][j*NR_MAX_NB_LAYERS+k]);
|
|
|
|
|
free_and_zero(pdsch->rxdataF_comp0[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_estimates[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_estimates_ext[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_bf_ch_estimates[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_bf_ch_estimates_ext[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_mag0[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_magb0[idx]);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_magr0[idx]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(pdsch->rxdataF_ext[i]);
|
|
|
|
|
free_and_zero(pdsch->rxdataF_uespec_pilots[i]);
|
|
|
|
|
free_and_zero(pdsch->ptrs_phase_per_slot[i]);
|
|
|
|
|
free_and_zero(pdsch->ptrs_re_per_slot[i]);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_ptrs_estimates_ext[i]);
|
|
|
|
|
free_and_zero(pdsch->rho[i]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(pdsch->pmi_ext);
|
|
|
|
|
free_and_zero(pdsch->llr[0]);
|
|
|
|
|
free_and_zero(pdsch->layer_llr[0]);
|
|
|
|
|
free_and_zero(pdsch->llr128);
|
|
|
|
|
free_and_zero(pdsch->rxdataF_ext);
|
|
|
|
|
free_and_zero(pdsch->rxdataF_uespec_pilots);
|
|
|
|
|
free_and_zero(pdsch->rxdataF_comp0);
|
|
|
|
|
free_and_zero(pdsch->rho);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_estimates);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_estimates_ext);
|
|
|
|
|
free_and_zero(pdsch->dl_bf_ch_estimates);
|
|
|
|
|
free_and_zero(pdsch->dl_bf_ch_estimates_ext);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_mag0);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_magb0);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_magr0);
|
|
|
|
|
free_and_zero(pdsch->ptrs_phase_per_slot);
|
|
|
|
|
free_and_zero(pdsch->ptrs_re_per_slot);
|
|
|
|
|
free_and_zero(pdsch->dl_ch_ptrs_estimates_ext);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
|
|
|
|
|
const NR_DL_FRAME_PARMS *const fp) {
|
|
|
|
|
AssertFatal( pusch, "pusch==0" );
|
|
|
|
@@ -120,9 +163,14 @@ void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
|
|
|
|
int nb_connected_gNB,
|
|
|
|
|
uint8_t abstraction_flag) {
|
|
|
|
|
void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < NR_MAX_NB_LAYERS; i++)
|
|
|
|
|
free_and_zero(pusch->txdataF_layers[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
|
|
|
|
{
|
|
|
|
|
// create shortcuts
|
|
|
|
|
NR_DL_FRAME_PARMS *const fp = &ue->frame_parms;
|
|
|
|
|
NR_UE_COMMON *const common_vars = &ue->common_vars;
|
|
|
|
@@ -136,8 +184,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
|
|
|
|
uint32_t ****pusch_dmrs;
|
|
|
|
|
uint16_t N_n_scid[2] = {0,1}; // [HOTFIX] This is a temporary implementation of scramblingID0 and scramblingID1 which are given by DMRS-UplinkConfig
|
|
|
|
|
int n_scid;
|
|
|
|
|
abstraction_flag = 0;
|
|
|
|
|
LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx);
|
|
|
|
|
LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx);
|
|
|
|
|
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_gNB_INST);
|
|
|
|
|
phy_init_nr_top(ue);
|
|
|
|
|
// many memory allocation sizes are hard coded
|
|
|
|
|
AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" );
|
|
|
|
@@ -230,29 +278,27 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
|
|
|
|
for (i=0; i<10; i++)
|
|
|
|
|
ue->tx_power_dBm[i]=-127;
|
|
|
|
|
|
|
|
|
|
if (abstraction_flag == 0) {
|
|
|
|
|
// init TX buffers
|
|
|
|
|
common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
|
|
|
|
|
common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
|
|
|
|
|
// init TX buffers
|
|
|
|
|
common_vars->txdata = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
|
|
|
|
|
common_vars->txdataF = (int32_t **)malloc16( fp->nb_antennas_tx*sizeof(int32_t *) );
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_tx; i++) {
|
|
|
|
|
common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) );
|
|
|
|
|
common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) );
|
|
|
|
|
}
|
|
|
|
|
for (i=0; i<fp->nb_antennas_tx; i++) {
|
|
|
|
|
common_vars->txdata[i] = (int32_t *)malloc16_clear( fp->samples_per_subframe*10*sizeof(int32_t) );
|
|
|
|
|
common_vars->txdataF[i] = (int32_t *)malloc16_clear( fp->samples_per_slot_wCP*sizeof(int32_t) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// init RX buffers
|
|
|
|
|
common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
// init RX buffers
|
|
|
|
|
common_vars->rxdata = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
common_vars->common_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
|
|
|
|
common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
common_vars->common_vars_rx_data_per_thread[th_id].rxdataF = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
|
|
|
|
common_vars->rxdata[i] = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) );
|
|
|
|
|
}
|
|
|
|
|
common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(fp->samples_per_slot_wCP) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -330,129 +376,121 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
|
|
|
|
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (abstraction_flag == 0) {
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
phy_init_nr_ue__PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
phy_init_nr_ue__PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12);
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts;
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++)
|
|
|
|
|
for (j=0; j<4; j++) {
|
|
|
|
|
const int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
const size_t num = 7*2*fp->N_RB_DL*12+4;
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12);
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts;
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++)
|
|
|
|
|
for (j=0; j<4; j++) {
|
|
|
|
|
const int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
const size_t num = 7*2*fp->N_RB_DL*12+4;
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
|
|
|
|
}
|
|
|
|
|
//const size_t num = 7*2*fp->N_RB_DL*12+4;
|
|
|
|
|
for (k=0; k<8; k++) { //harq_pid
|
|
|
|
|
for (l=0; l<8; l++) { //round
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//const size_t num = 7*2*fp->N_RB_DL*12+4;
|
|
|
|
|
for (k=0; k<8; k++) { //harq_pid
|
|
|
|
|
for (l=0; l<8; l++) { //round
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
}
|
|
|
|
|
for (int i=0; i<fp->nb_antennas_rx; i++)
|
|
|
|
|
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
|
|
|
|
|
const int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<fp->nb_antennas_rx; i++)
|
|
|
|
|
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
|
|
|
|
|
const int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
}
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
// Channel estimates
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4));
|
|
|
|
|
|
|
|
|
|
for (j=0; j<4; j++) {
|
|
|
|
|
int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
|
|
|
|
// size_t num = 7*2*fp->N_RB_DL*12;
|
|
|
|
|
size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PBCH
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
|
|
|
|
|
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
|
|
|
|
prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
|
|
|
|
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->llr = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->llr16 = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
// Channel estimates
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear(4*fp->nb_antennas_rx*sizeof(int32_t *));
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*(100*12*4));
|
|
|
|
|
|
|
|
|
|
for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
|
|
|
|
|
for (j=0; j<4; j++) {
|
|
|
|
|
int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
|
|
|
|
|
// size_t num = 7*2*fp->N_RB_DL*12;
|
|
|
|
|
size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// PBCH
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
|
|
|
|
pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
|
|
|
|
|
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
|
|
|
|
prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
|
|
|
|
|
|
|
|
|
for (i=0; i<fp->nb_antennas_rx; i++) {
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
|
|
|
|
|
|
|
|
|
for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
|
|
|
|
|
int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
|
|
|
|
|
pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id] = (NR_UE_PDSCH *)malloc16_clear(sizeof(NR_UE_PDSCH));
|
|
|
|
|
}
|
|
|
|
|
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++)
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH));
|
|
|
|
|
|
|
|
|
|
if (abstraction_flag == 0) {
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
//phy_init_lte_ue__PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
|
|
|
|
}
|
|
|
|
|
} else { //abstraction == 1
|
|
|
|
|
ue->sinr_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
|
|
|
|
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
|
|
|
|
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
|
|
|
@@ -473,6 +511,180 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
|
|
|
|
{
|
|
|
|
|
const NR_DL_FRAME_PARMS* fp = &ue->frame_parms;
|
|
|
|
|
phy_term_nr_top();
|
|
|
|
|
|
|
|
|
|
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
|
|
|
|
phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]);
|
|
|
|
|
free_and_zero(ue->pusch_vars[th_id][gNB_id]);
|
|
|
|
|
free_and_zero(ue->pucch_vars[th_id][gNB_id]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
|
|
|
|
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
|
|
|
|
|
for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
|
|
|
|
|
free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb][q]);
|
|
|
|
|
free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->nr_gold_pusch_dmrs[slot]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->nr_gold_pusch_dmrs);
|
|
|
|
|
|
|
|
|
|
NR_UE_COMMON* common_vars = &ue->common_vars;
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_tx; i++) {
|
|
|
|
|
free_and_zero(common_vars->txdata[i]);
|
|
|
|
|
free_and_zero(common_vars->txdataF[i]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free_and_zero(common_vars->txdata);
|
|
|
|
|
free_and_zero(common_vars->txdataF);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
free_and_zero(common_vars->rxdata[i]);
|
|
|
|
|
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++)
|
|
|
|
|
free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF[i]);
|
|
|
|
|
}
|
|
|
|
|
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
free_and_zero(common_vars->common_vars_rx_data_per_thread[th_id].rxdataF);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(common_vars->rxdata);
|
|
|
|
|
|
|
|
|
|
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
|
|
|
|
for (int symb = 0; symb < fp->symbols_per_slot; symb++)
|
|
|
|
|
free_and_zero(ue->nr_gold_pdcch[0][slot][symb]);
|
|
|
|
|
free_and_zero(ue->nr_gold_pdcch[0][slot]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->nr_gold_pdcch[0]);
|
|
|
|
|
|
|
|
|
|
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
|
|
|
|
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
|
|
|
|
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++)
|
|
|
|
|
free_and_zero(ue->nr_gold_pdsch[0][slot][symb][q]);
|
|
|
|
|
free_and_zero(ue->nr_gold_pdsch[0][slot][symb]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->nr_gold_pdsch[0][slot]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->nr_gold_pdsch[0]);
|
|
|
|
|
|
|
|
|
|
for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
|
|
|
|
|
|
|
|
|
// PDSCH
|
|
|
|
|
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
for (int k = 0; k < 8; k++) { //harq_pid
|
|
|
|
|
for (int l = 0; l < 8; l++) { //round
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++)
|
|
|
|
|
const int idx = j * fp->nb_antennas_rx + i;
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
for (int j = 0; j < 4; j++) {
|
|
|
|
|
const int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext);
|
|
|
|
|
|
|
|
|
|
phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp);
|
|
|
|
|
free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
for (int j = 0; j < 4; j++) {
|
|
|
|
|
int idx = j * fp->nb_antennas_rx + i;
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho[i]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->llr16);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates);
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time);
|
|
|
|
|
|
|
|
|
|
free_and_zero(ue->pdcch_vars[th_id][gNB_id]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_received_signal[i]);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq[i]);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]);
|
|
|
|
|
}
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_generated_signal);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->noise_power);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_received_signal);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_estimated_channel_freq);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time);
|
|
|
|
|
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted);
|
|
|
|
|
free_and_zero(ue->nr_srs_info);
|
|
|
|
|
|
|
|
|
|
free_and_zero(ue->srs_vars[gNB_id]);
|
|
|
|
|
|
|
|
|
|
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext[i]);
|
|
|
|
|
|
|
|
|
|
for (int j = 0; j < 4; j++) {
|
|
|
|
|
int idx = (j*fp->nb_antennas_rx)+i;
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp[idx]);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates[idx]);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time[idx]);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext[idx]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->llr);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]->decoded_output);
|
|
|
|
|
free_and_zero(ue->pbch_vars[gNB_id]);
|
|
|
|
|
|
|
|
|
|
free_and_zero(ue->prach_vars[gNB_id]->prachF);
|
|
|
|
|
free_and_zero(ue->prach_vars[gNB_id]->prach);
|
|
|
|
|
free_and_zero(ue->prach_vars[gNB_id]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
free_and_zero(ue->sinr_CQI_dB);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,
|
|
|
|
|
int abstraction_flag) {
|
|
|
|
|
for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
|
|
|
|
@@ -555,3 +767,9 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
|
|
|
|
|
//init_unscrambling_lut();
|
|
|
|
|
//set_taus_seed(1328);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void phy_term_nr_top(void)
|
|
|
|
|
{
|
|
|
|
|
free_ul_reference_signal_sequences();
|
|
|
|
|
free_context_synchro_nr();
|
|
|
|
|
}
|
|
|
|
|