Commit 70d7a668 authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Merge nr_csi_rs_info_t plus nr_csi_im_info_t into nr_csi_info_t

parent 3025627c
...@@ -596,20 +596,20 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -596,20 +596,20 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
// CSI RS init // CSI RS init
// ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32) // ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32)
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1; int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
gNB->nr_csi_rs_info = (nr_csi_rs_info_t *)malloc16_clear(sizeof(nr_csi_rs_info_t)); gNB->nr_csi_info = (nr_csi_info_t *)malloc16_clear(sizeof(nr_csi_info_t));
gNB->nr_csi_rs_info->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); gNB->nr_csi_info->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame * sizeof(uint32_t **));
AssertFatal(gNB->nr_csi_rs_info->nr_gold_csi_rs!=NULL, "NR init: csi reference signal malloc failed\n"); AssertFatal(gNB->nr_csi_info->nr_gold_csi_rs != NULL, "NR init: csi reference signal malloc failed\n");
for (int slot=0; slot<fp->slots_per_frame; slot++) { for (int slot=0; slot<fp->slots_per_frame; slot++) {
gNB->nr_csi_rs_info->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); gNB->nr_csi_info->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot * sizeof(uint32_t *));
AssertFatal(gNB->nr_csi_rs_info->nr_gold_csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot); AssertFatal(gNB->nr_csi_info->nr_gold_csi_rs[slot] != NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
for (int symb=0; symb<fp->symbols_per_slot; symb++) { for (int symb=0; symb<fp->symbols_per_slot; symb++) {
gNB->nr_csi_rs_info->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t)); gNB->nr_csi_info->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length * sizeof(uint32_t));
AssertFatal(gNB->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb); AssertFatal(gNB->nr_csi_info->nr_gold_csi_rs[slot][symb] != NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
} }
} }
gNB->nr_csi_rs_info->csi_gold_init = cfg->cell_config.phy_cell_id.value; gNB->nr_csi_info->csi_gold_init = cfg->cell_config.phy_cell_id.value;
nr_init_csi_rs(&gNB->frame_parms, gNB->nr_csi_rs_info->nr_gold_csi_rs, cfg->cell_config.phy_cell_id.value); nr_init_csi_rs(&gNB->frame_parms, gNB->nr_csi_info->nr_gold_csi_rs, cfg->cell_config.phy_cell_id.value);
for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) { for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) {
gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
...@@ -775,14 +775,14 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -775,14 +775,14 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
} }
free_and_zero(pusch_dmrs); free_and_zero(pusch_dmrs);
uint32_t ***nr_gold_csi_rs = gNB->nr_csi_rs_info->nr_gold_csi_rs; uint32_t ***nr_gold_csi_rs = gNB->nr_csi_info->nr_gold_csi_rs;
for (int slot = 0; slot < fp->slots_per_frame; slot++) { for (int slot = 0; slot < fp->slots_per_frame; slot++) {
for (int symb = 0; symb < fp->symbols_per_slot; symb++) for (int symb = 0; symb < fp->symbols_per_slot; symb++)
free_and_zero(nr_gold_csi_rs[slot][symb]); free_and_zero(nr_gold_csi_rs[slot][symb]);
free_and_zero(nr_gold_csi_rs[slot]); free_and_zero(nr_gold_csi_rs[slot]);
} }
free_and_zero(nr_gold_csi_rs); free_and_zero(nr_gold_csi_rs);
free_and_zero(gNB->nr_csi_rs_info); free_and_zero(gNB->nr_csi_info);
for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) { for (int id = 0; id < NUMBER_OF_NR_SRS_MAX; id++) {
for (int i = 0; i < Prx; i++) { for (int i = 0; i < Prx; i++) {
......
...@@ -347,24 +347,22 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -347,24 +347,22 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
// ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32) // ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32)
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1; int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
ue->nr_csi_rs_info = (nr_csi_rs_info_t *)malloc16_clear(sizeof(nr_csi_rs_info_t)); ue->nr_csi_info = (nr_csi_info_t *)malloc16_clear(sizeof(nr_csi_info_t));
ue->nr_csi_rs_info->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **)); ue->nr_csi_info->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame * sizeof(uint32_t **));
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs!=NULL, "NR init: csi reference signal malloc failed\n"); AssertFatal(ue->nr_csi_info->nr_gold_csi_rs != NULL, "NR init: csi reference signal malloc failed\n");
for (int slot=0; slot<fp->slots_per_frame; slot++) { for (int slot=0; slot<fp->slots_per_frame; slot++) {
ue->nr_csi_rs_info->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *)); ue->nr_csi_info->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot * sizeof(uint32_t *));
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot); AssertFatal(ue->nr_csi_info->nr_gold_csi_rs[slot] != NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
for (int symb=0; symb<fp->symbols_per_slot; symb++) { for (int symb=0; symb<fp->symbols_per_slot; symb++) {
ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t)); ue->nr_csi_info->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length * sizeof(uint32_t));
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb); AssertFatal(ue->nr_csi_info->nr_gold_csi_rs[slot][symb] != NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
} }
} }
ue->nr_csi_rs_info->csi_rs_generated_signal = (int32_t **)malloc16(NR_MAX_NB_PORTS * sizeof(int32_t *) ); ue->nr_csi_info->csi_rs_generated_signal = (int32_t **)malloc16(NR_MAX_NB_PORTS * sizeof(int32_t *) );
for (i=0; i<NR_MAX_NB_PORTS; i++) { for (i=0; i<NR_MAX_NB_PORTS; i++) {
ue->nr_csi_rs_info->csi_rs_generated_signal[i] = (int32_t *) malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t)); ue->nr_csi_info->csi_rs_generated_signal[i] = (int32_t *) malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t));
} }
ue->nr_csi_im_info = (nr_csi_im_info_t *)malloc16_clear(sizeof(nr_csi_im_info_t));
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t)); ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
...@@ -483,18 +481,16 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -483,18 +481,16 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
} }
for (int i=0; i<NR_MAX_NB_PORTS; i++) { for (int i=0; i<NR_MAX_NB_PORTS; i++) {
free_and_zero(ue->nr_csi_rs_info->csi_rs_generated_signal[i]); free_and_zero(ue->nr_csi_info->csi_rs_generated_signal[i]);
} }
for (int slot=0; slot<fp->slots_per_frame; slot++) { for (int slot=0; slot<fp->slots_per_frame; slot++) {
for (int symb=0; symb<fp->symbols_per_slot; symb++) { for (int symb=0; symb<fp->symbols_per_slot; symb++) {
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]); free_and_zero(ue->nr_csi_info->nr_gold_csi_rs[slot][symb]);
} }
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs[slot]); free_and_zero(ue->nr_csi_info->nr_gold_csi_rs[slot]);
} }
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs); free_and_zero(ue->nr_csi_info->nr_gold_csi_rs);
free_and_zero(ue->nr_csi_rs_info); free_and_zero(ue->nr_csi_info);
free_and_zero(ue->nr_csi_im_info);
for (int i = 0; i < fp->nb_antennas_rx; i++) { 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_received_signal[i]);
......
...@@ -46,7 +46,7 @@ void nr_init_csi_rs(const NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, uint32_t Ni ...@@ -46,7 +46,7 @@ void nr_init_csi_rs(const NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, uint32_t Ni
void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms, void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
int32_t **dataF, int32_t **dataF,
const int16_t amp, const int16_t amp,
nr_csi_rs_info_t *nr_csi_rs_info, nr_csi_info_t *nr_csi_info,
const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params, const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
const int slot, const int slot,
uint8_t *N_cdm_groups, uint8_t *N_cdm_groups,
...@@ -76,7 +76,7 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms, ...@@ -76,7 +76,7 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
#endif #endif
int dataF_offset = slot*frame_parms->samples_per_slot_wCP; int dataF_offset = slot*frame_parms->samples_per_slot_wCP;
uint32_t **nr_gold_csi_rs = nr_csi_rs_info->nr_gold_csi_rs[slot]; uint32_t **nr_gold_csi_rs = nr_csi_info->nr_gold_csi_rs[slot];
//*8(max allocation per RB)*2(QPSK)) //*8(max allocation per RB)*2(QPSK))
int csi_rs_length = frame_parms->N_RB_DL<<4; int csi_rs_length = frame_parms->N_RB_DL<<4;
int16_t mod_csi[frame_parms->symbols_per_slot][csi_rs_length>>1] __attribute__((aligned(16))); int16_t mod_csi[frame_parms->symbols_per_slot][csi_rs_length>>1] __attribute__((aligned(16)));
...@@ -89,14 +89,14 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms, ...@@ -89,14 +89,14 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
uint8_t fi = 0; uint8_t fi = 0;
double rho, alpha; double rho, alpha;
uint32_t beta = amp; uint32_t beta = amp;
nr_csi_rs_info->csi_rs_generated_signal_bits = log2_approx(amp); nr_csi_info->csi_rs_generated_signal_bits = log2_approx(amp);
AssertFatal(b!=0, "Invalid CSI frequency domain mapping: no bit selected in bitmap\n"); AssertFatal(b!=0, "Invalid CSI frequency domain mapping: no bit selected in bitmap\n");
// if the scrambling id is not the one previously used to initialize we need to re-initialize the rs // if the scrambling id is not the one previously used to initialize we need to re-initialize the rs
if (csi_params->scramb_id != nr_csi_rs_info->csi_gold_init) { if (csi_params->scramb_id != nr_csi_info->csi_gold_init) {
nr_csi_rs_info->csi_gold_init = csi_params->scramb_id; nr_csi_info->csi_gold_init = csi_params->scramb_id;
nr_init_csi_rs(frame_parms, nr_csi_rs_info->nr_gold_csi_rs, csi_params->scramb_id); nr_init_csi_rs(frame_parms, nr_csi_info->nr_gold_csi_rs, csi_params->scramb_id);
} }
switch (csi_params->row) { switch (csi_params->row) {
...@@ -656,11 +656,11 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms, ...@@ -656,11 +656,11 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
if (l_overline) memcpy(l_overline,loverline,16*sizeof(uint8_t)); if (l_overline) memcpy(l_overline,loverline,16*sizeof(uint8_t));
#ifdef NR_CSIRS_DEBUG #ifdef NR_CSIRS_DEBUG
if (N_ports) LOG_I(NR_PHY, "nr_csi_rs_info->N_ports = %d\n", *N_ports); if (N_ports) LOG_I(NR_PHY, "nr_csi_info->N_ports = %d\n", *N_ports);
if (N_cdm_groups) LOG_I(NR_PHY, "nr_csi_rs_info->N_cdm_groups = %d\n", *N_cdm_groups); if (N_cdm_groups) LOG_I(NR_PHY, "nr_csi_info->N_cdm_groups = %d\n", *N_cdm_groups);
if (CDM_group_size) LOG_I(NR_PHY, "nr_csi_rs_info->CDM_group_size = %d\n", *CDM_group_size); if (CDM_group_size) LOG_I(NR_PHY, "nr_csi_info->CDM_group_size = %d\n", *CDM_group_size);
if (k_prime) LOG_I(NR_PHY, "nr_csi_rs_info->kprime = %d\n", *k_prime); if (k_prime) LOG_I(NR_PHY, "nr_csi_info->kprime = %d\n", *k_prime);
if (l_prime) LOG_I(NR_PHY, "nr_csi_rs_info->lprime = %d\n", *l_prime); if (l_prime) LOG_I(NR_PHY, "nr_csi_info->lprime = %d\n", *l_prime);
if (N_cdm_groups) { if (N_cdm_groups) {
for(int ji=0; ji<*N_cdm_groups; ji++) { for(int ji=0; ji<*N_cdm_groups; ji++) {
LOG_I(NR_PHY, "(CDM group %d) j = %d, koverline = %d, loverline = %d\n", ji, j[ji], koverline[ji], loverline[ji]); LOG_I(NR_PHY, "(CDM group %d) j = %d, koverline = %d, loverline = %d\n", ji, j[ji], koverline[ji], loverline[ji]);
......
...@@ -340,7 +340,7 @@ uint8_t get_nr_prach_duration(uint8_t prach_format); ...@@ -340,7 +340,7 @@ uint8_t get_nr_prach_duration(uint8_t prach_format);
void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms, void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
int32_t **dataF, int32_t **dataF,
const int16_t amp, const int16_t amp,
nr_csi_rs_info_t *nr_csi_rs_info, nr_csi_info_t *nr_csi_info,
const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params, const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
const int slot, const int slot,
uint8_t *N_cdm_groups, uint8_t *N_cdm_groups,
......
...@@ -177,7 +177,7 @@ bool is_csi_rs_in_symbol(const fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_ ...@@ -177,7 +177,7 @@ bool is_csi_rs_in_symbol(const fapi_nr_dl_config_csirs_pdu_rel15_t csirs_config_
int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_rs_info_t *nr_csi_rs_info, const nr_csi_info_t *nr_csi_info,
const uint8_t N_cdm_groups, const uint8_t N_cdm_groups,
const uint8_t CDM_group_size, const uint8_t CDM_group_size,
const uint8_t k_prime, const uint8_t k_prime,
...@@ -219,7 +219,7 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ...@@ -219,7 +219,7 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
#ifdef NR_CSIRS_DEBUG #ifdef NR_CSIRS_DEBUG
int dataF_offset = proc->nr_slot_rx*ue->frame_parms.samples_per_slot_wCP; int dataF_offset = proc->nr_slot_rx*ue->frame_parms.samples_per_slot_wCP;
uint16_t port_tx = s+j_cdm[cdm_id]*CDM_group_size; uint16_t port_tx = s+j_cdm[cdm_id]*CDM_group_size;
c16_t *tx_csi_rs_signal = (c16_t*)&nr_csi_rs_info->csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset]; c16_t *tx_csi_rs_signal = (c16_t*)&nr_csi_info->csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset];
LOG_I(NR_PHY, "l,k (%2d,%4d) |\tport_tx %d (%4d,%4d)\tant_rx %d (%4d,%4d)\n", LOG_I(NR_PHY, "l,k (%2d,%4d) |\tport_tx %d (%4d,%4d)\tant_rx %d (%4d,%4d)\n",
symb, symb,
k, k,
...@@ -258,7 +258,7 @@ uint32_t calc_power_csirs(const uint16_t *x, const fapi_nr_dl_config_csirs_pdu_r ...@@ -258,7 +258,7 @@ uint32_t calc_power_csirs(const uint16_t *x, const fapi_nr_dl_config_csirs_pdu_r
int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_rs_info_t *nr_csi_rs_info, const nr_csi_info_t *nr_csi_info,
const int32_t **csi_rs_generated_signal, const int32_t **csi_rs_generated_signal,
const int32_t csi_rs_received_signal[][ue->frame_parms.samples_per_slot_wCP], const int32_t csi_rs_received_signal[][ue->frame_parms.samples_per_slot_wCP],
const uint8_t N_cdm_groups, const uint8_t N_cdm_groups,
...@@ -315,8 +315,8 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -315,8 +315,8 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
c16_t *rx_csi_rs_signal = (c16_t*)&csi_rs_received_signal[ant_rx][symbol_offset]; c16_t *rx_csi_rs_signal = (c16_t*)&csi_rs_received_signal[ant_rx][symbol_offset];
c16_t *csi_rs_ls_estimated_channel16 = (c16_t*)&csi_rs_ls_estimated_channel[ant_rx][port_tx][0]; c16_t *csi_rs_ls_estimated_channel16 = (c16_t*)&csi_rs_ls_estimated_channel[ant_rx][port_tx][0];
int16_t csi_rs_ls_estimated_channel_re = (int16_t)(((int32_t)tx_csi_rs_signal[k].r*rx_csi_rs_signal[k].r + (int32_t)tx_csi_rs_signal[k].i*rx_csi_rs_signal[k].i)>>nr_csi_rs_info->csi_rs_generated_signal_bits); int16_t csi_rs_ls_estimated_channel_re = (int16_t)(((int32_t)tx_csi_rs_signal[k].r*rx_csi_rs_signal[k].r + (int32_t)tx_csi_rs_signal[k].i*rx_csi_rs_signal[k].i)>>nr_csi_info->csi_rs_generated_signal_bits);
int16_t csi_rs_ls_estimated_channel_im = (int16_t)(((int32_t)tx_csi_rs_signal[k].r*rx_csi_rs_signal[k].i - (int32_t)tx_csi_rs_signal[k].i*rx_csi_rs_signal[k].r)>>nr_csi_rs_info->csi_rs_generated_signal_bits); int16_t csi_rs_ls_estimated_channel_im = (int16_t)(((int32_t)tx_csi_rs_signal[k].r*rx_csi_rs_signal[k].i - (int32_t)tx_csi_rs_signal[k].i*rx_csi_rs_signal[k].r)>>nr_csi_info->csi_rs_generated_signal_bits);
// This is not just the LS estimation for each (k,l), but also the sum of the different contributions // This is not just the LS estimation for each (k,l), but also the sum of the different contributions
// for the sake of optimizing the memory used. // for the sake of optimizing the memory used.
...@@ -436,7 +436,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -436,7 +436,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_rs_info_t *nr_csi_rs_info, const nr_csi_info_t *nr_csi_info,
const uint8_t N_ports, const uint8_t N_ports,
int32_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size], int32_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size],
const int16_t log2_maxh, const int16_t log2_maxh,
...@@ -568,7 +568,7 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, ...@@ -568,7 +568,7 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu, const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu,
const nr_csi_rs_info_t *nr_csi_rs_info, const nr_csi_info_t *nr_csi_info,
const uint8_t N_ports, const uint8_t N_ports,
const int32_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size], const int32_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size],
const uint32_t interference_plus_noise_power, const uint32_t interference_plus_noise_power,
...@@ -641,7 +641,7 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, ...@@ -641,7 +641,7 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
} }
} }
// We should perform >>nr_csi_rs_info->log2_re here for all terms, but since sum2_re and sum2_im can be high values, // We should perform >>nr_csi_info->log2_re here for all terms, but since sum2_re and sum2_im can be high values,
// we performed this above. // we performed this above.
for(int p = 0; p<4; p++) { for(int p = 0; p<4; p++) {
int32_t power_re = sum2_re[p] - (sum_re[p]>>log2_re)*(sum_re[p]>>log2_re); int32_t power_re = sum2_re[p] - (sum_re[p]>>log2_re)*(sum_re[p]>>log2_re);
...@@ -796,8 +796,8 @@ int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -796,8 +796,8 @@ int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
LOG_I(NR_PHY, "csiim_config_pdu->l_csiim = %i.%i.%i.%i\n", csiim_config_pdu->l_csiim[0], csiim_config_pdu->l_csiim[1], csiim_config_pdu->l_csiim[2], csiim_config_pdu->l_csiim[3]); LOG_I(NR_PHY, "csiim_config_pdu->l_csiim = %i.%i.%i.%i\n", csiim_config_pdu->l_csiim[0], csiim_config_pdu->l_csiim[1], csiim_config_pdu->l_csiim[2], csiim_config_pdu->l_csiim[3]);
#endif #endif
nr_csi_im_power_estimation(ue, proc, csiim_config_pdu, &ue->nr_csi_im_info->interference_plus_noise_power); nr_csi_im_power_estimation(ue, proc, csiim_config_pdu, &ue->nr_csi_info->interference_plus_noise_power);
ue->nr_csi_im_info->meas_computed = true; ue->nr_csi_info->csi_im_meas_computed = true;
return 0; return 0;
} }
...@@ -847,9 +847,9 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -847,9 +847,9 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
uint8_t i2[1]; uint8_t i2[1];
nr_generate_csi_rs(frame_parms, nr_generate_csi_rs(frame_parms,
ue->nr_csi_rs_info->csi_rs_generated_signal, ue->nr_csi_info->csi_rs_generated_signal,
AMP, AMP,
ue->nr_csi_rs_info, ue->nr_csi_info,
(nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *) csirs_config_pdu, (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *) csirs_config_pdu,
proc->nr_slot_rx, proc->nr_slot_rx,
&N_cdm_groups, &N_cdm_groups,
...@@ -867,7 +867,7 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -867,7 +867,7 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
nr_get_csi_rs_signal(ue, nr_get_csi_rs_signal(ue,
proc, proc,
csirs_config_pdu, csirs_config_pdu,
ue->nr_csi_rs_info, ue->nr_csi_info,
N_cdm_groups, N_cdm_groups,
CDM_group_size, CDM_group_size,
k_prime, k_prime,
...@@ -880,8 +880,8 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -880,8 +880,8 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
nr_csi_rs_channel_estimation(ue, nr_csi_rs_channel_estimation(ue,
proc, proc,
csirs_config_pdu, csirs_config_pdu,
ue->nr_csi_rs_info, ue->nr_csi_info,
(const int32_t **) ue->nr_csi_rs_info->csi_rs_generated_signal, (const int32_t **) ue->nr_csi_info->csi_rs_generated_signal,
csi_rs_received_signal, csi_rs_received_signal,
N_cdm_groups, N_cdm_groups,
CDM_group_size, CDM_group_size,
...@@ -899,7 +899,7 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -899,7 +899,7 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
nr_csi_rs_ri_estimation(ue, nr_csi_rs_ri_estimation(ue,
csirs_config_pdu, csirs_config_pdu,
ue->nr_csi_rs_info, ue->nr_csi_info,
N_ports, N_ports,
csi_rs_estimated_channel_freq, csi_rs_estimated_channel_freq,
log2_maxh, log2_maxh,
...@@ -907,10 +907,10 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -907,10 +907,10 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
nr_csi_rs_pmi_estimation(ue, nr_csi_rs_pmi_estimation(ue,
csirs_config_pdu, csirs_config_pdu,
ue->nr_csi_rs_info, ue->nr_csi_info,
N_ports, N_ports,
csi_rs_estimated_channel_freq, csi_rs_estimated_channel_freq,
ue->nr_csi_im_info->meas_computed ? ue->nr_csi_im_info->interference_plus_noise_power : noise_power, ue->nr_csi_info->csi_im_meas_computed ? ue->nr_csi_info->interference_plus_noise_power : noise_power,
rank_indicator, rank_indicator,
log2_re, log2_re,
i1, i1,
......
...@@ -362,7 +362,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -362,7 +362,7 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
nr_gold_pdsch(ue, i, ue->scramblingID_dlsch[i]); nr_gold_pdsch(ue, i, ue->scramblingID_dlsch[i]);
} }
nr_init_csi_rs(fp, ue->nr_csi_rs_info->nr_gold_csi_rs, fp->Nid_cell); nr_init_csi_rs(fp, ue->nr_csi_info->nr_gold_csi_rs, fp->Nid_cell);
// initialize the pusch dmrs // initialize the pusch dmrs
for (int i=0; i<NR_NB_NSCID; i++) { for (int i=0; i<NR_NB_NSCID; i++) {
......
...@@ -765,8 +765,8 @@ typedef struct PHY_VARS_gNB_s { ...@@ -765,8 +765,8 @@ typedef struct PHY_VARS_gNB_s {
/// SRS variables /// SRS variables
nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX]; nr_srs_info_t *nr_srs_info[NUMBER_OF_NR_SRS_MAX];
/// CSI-RS variables /// CSI variables
nr_csi_rs_info_t *nr_csi_rs_info; nr_csi_info_t *nr_csi_info;
uint8_t pbch_configured; uint8_t pbch_configured;
char gNB_generate_rar; char gNB_generate_rar;
......
...@@ -878,11 +878,8 @@ typedef struct { ...@@ -878,11 +878,8 @@ typedef struct {
/// SRS variables /// SRS variables
nr_srs_info_t *nr_srs_info; nr_srs_info_t *nr_srs_info;
/// CSI-RS variables /// CSI variables
nr_csi_rs_info_t *nr_csi_rs_info; nr_csi_info_t *nr_csi_info;
/// CSI-IM variables
nr_csi_im_info_t *nr_csi_im_info;
//#if defined(UPGRADE_RAT_NR) //#if defined(UPGRADE_RAT_NR)
#if 1 #if 1
......
...@@ -258,12 +258,9 @@ typedef struct { ...@@ -258,12 +258,9 @@ typedef struct {
uint32_t ***nr_gold_csi_rs; uint32_t ***nr_gold_csi_rs;
uint8_t csi_rs_generated_signal_bits; uint8_t csi_rs_generated_signal_bits;
int32_t **csi_rs_generated_signal; int32_t **csi_rs_generated_signal;
} nr_csi_rs_info_t; bool csi_im_meas_computed;
typedef struct {
bool meas_computed;
uint32_t interference_plus_noise_power; uint32_t interference_plus_noise_power;
} nr_csi_im_info_t; } nr_csi_info_t;
typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS; typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS;
......
...@@ -168,7 +168,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, ...@@ -168,7 +168,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
if (csirs->active == 1) { if (csirs->active == 1) {
LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot); LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot);
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params = &csirs->csirs_pdu.csi_rs_pdu_rel15; nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params = &csirs->csirs_pdu.csi_rs_pdu_rel15;
nr_generate_csi_rs(&gNB->frame_parms, gNB->common_vars.txdataF, AMP, gNB->nr_csi_rs_info, csi_params, slot, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL); nr_generate_csi_rs(&gNB->frame_parms, gNB->common_vars.txdataF, AMP, gNB->nr_csi_info, csi_params, slot, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
csirs->active = 0; csirs->active = 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