Commit 36a9139a authored by Roberto Louro Magueta's avatar Roberto Louro Magueta

Remove N_cdm_groups, CDM_group_size, kprime and lprime from nr_csi_rs_info_t

parent e39be391
...@@ -45,10 +45,15 @@ void nr_init_csi_rs(const NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, uint32_t Ni ...@@ -45,10 +45,15 @@ 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,
int16_t amp, const int16_t amp,
nr_csi_rs_info_t *nr_csi_rs_info, nr_csi_rs_info_t *nr_csi_rs_info,
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params, const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
int slot){ const int slot,
uint8_t *N_cdm_groups,
uint8_t *CDM_group_size,
uint8_t *k_prime,
uint8_t *l_prime,
uint8_t *N_ports) {
#ifdef NR_CSIRS_DEBUG #ifdef NR_CSIRS_DEBUG
LOG_I(NR_PHY, "csi_params->subcarrier_spacing = %i\n", csi_params->subcarrier_spacing); LOG_I(NR_PHY, "csi_params->subcarrier_spacing = %i\n", csi_params->subcarrier_spacing);
...@@ -638,23 +643,25 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms, ...@@ -638,23 +643,25 @@ void nr_generate_csi_rs(const NR_DL_FRAME_PARMS *frame_parms,
} }
} }
} }
nr_csi_rs_info->N_cdm_groups = size; if (N_cdm_groups) *N_cdm_groups = size;
nr_csi_rs_info->CDM_group_size = gs; if (CDM_group_size) *CDM_group_size = gs;
nr_csi_rs_info->kprime = kprime; if (k_prime) *k_prime = kprime;
nr_csi_rs_info->lprime = lprime; if (l_prime) *l_prime = lprime;
nr_csi_rs_info->N_ports = ports; if (N_ports) *N_ports = ports;
memcpy(nr_csi_rs_info->j,j,16*sizeof(uint8_t)); memcpy(nr_csi_rs_info->j,j,16*sizeof(uint8_t));
memcpy(nr_csi_rs_info->koverline,koverline,16*sizeof(uint8_t)); memcpy(nr_csi_rs_info->koverline,koverline,16*sizeof(uint8_t));
memcpy(nr_csi_rs_info->loverline,loverline,16*sizeof(uint8_t)); memcpy(nr_csi_rs_info->loverline,loverline,16*sizeof(uint8_t));
#ifdef NR_CSIRS_DEBUG #ifdef NR_CSIRS_DEBUG
LOG_I(NR_PHY, "nr_csi_rs_info->N_ports = %d\n", nr_csi_rs_info->N_ports); if (N_ports) LOG_I(NR_PHY, "nr_csi_rs_info->N_ports = %d\n", *N_ports);
LOG_I(NR_PHY, "nr_csi_rs_info->N_cdm_groups = %d\n", nr_csi_rs_info->N_cdm_groups); if (N_cdm_groups) LOG_I(NR_PHY, "nr_csi_rs_info->N_cdm_groups = %d\n", *N_cdm_groups);
LOG_I(NR_PHY, "nr_csi_rs_info->CDM_group_size = %d\n", nr_csi_rs_info->CDM_group_size); if (CDM_group_size) LOG_I(NR_PHY, "nr_csi_rs_info->CDM_group_size = %d\n", *CDM_group_size);
LOG_I(NR_PHY, "nr_csi_rs_info->kprime = %d\n", nr_csi_rs_info->kprime); if (k_prime) LOG_I(NR_PHY, "nr_csi_rs_info->kprime = %d\n", *k_prime);
LOG_I(NR_PHY, "nr_csi_rs_info->lprime = %d\n", nr_csi_rs_info->lprime); if (l_prime) LOG_I(NR_PHY, "nr_csi_rs_info->lprime = %d\n", *l_prime);
for(int ji=0; ji<nr_csi_rs_info->N_cdm_groups; ji++) { if (N_cdm_groups) {
LOG_I(NR_PHY, "(CDM group %d) j = %d, koverline = %d, loverline = %d\n", ji, nr_csi_rs_info->j[ji], nr_csi_rs_info->koverline[ji], nr_csi_rs_info->loverline[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, nr_csi_rs_info->j[ji], nr_csi_rs_info->koverline[ji], nr_csi_rs_info->loverline[ji]);
}
} }
#endif #endif
} }
...@@ -339,10 +339,15 @@ uint8_t get_nr_prach_duration(uint8_t prach_format); ...@@ -339,10 +339,15 @@ 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,
int16_t amp, const int16_t amp,
nr_csi_rs_info_t *nr_csi_rs_info, nr_csi_rs_info_t *nr_csi_rs_info,
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params, const nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *csi_params,
int slot); const int slot,
uint8_t *N_cdm_groups,
uint8_t *CDM_group_size,
uint8_t *k_prime,
uint8_t *l_prime,
uint8_t *N_ports);
void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id); void free_nr_prach_entry(PHY_VARS_gNB *gNB, int prach_id);
......
...@@ -178,6 +178,10 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ...@@ -178,6 +178,10 @@ 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_rs_info_t *nr_csi_rs_info,
const uint8_t N_cdm_groups,
const uint8_t CDM_group_size,
const uint8_t k_prime,
const uint8_t l_prime,
int32_t csi_rs_received_signal[][ue->frame_parms.samples_per_slot_wCP]) { int32_t csi_rs_received_signal[][ue->frame_parms.samples_per_slot_wCP]) {
int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF; int32_t **rxdataF = ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF;
...@@ -192,16 +196,16 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ...@@ -192,16 +196,16 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
continue; continue;
} }
for (int cdm_id = 0; cdm_id < nr_csi_rs_info->N_cdm_groups; cdm_id++) { for (int cdm_id = 0; cdm_id < N_cdm_groups; cdm_id++) {
for (int s = 0; s < nr_csi_rs_info->CDM_group_size; s++) { for (int s = 0; s < CDM_group_size; s++) {
// loop over frequency resource elements within a group // loop over frequency resource elements within a group
for (int kp = 0; kp <= nr_csi_rs_info->kprime; kp++) { for (int kp = 0; kp <= k_prime; kp++) {
uint16_t k = (frame_parms->first_carrier_offset + (rb*NR_NB_SC_PER_RB)+nr_csi_rs_info->koverline[cdm_id] + kp) % frame_parms->ofdm_symbol_size; uint16_t k = (frame_parms->first_carrier_offset + (rb*NR_NB_SC_PER_RB)+nr_csi_rs_info->koverline[cdm_id] + kp) % frame_parms->ofdm_symbol_size;
// loop over time resource elements within a group // loop over time resource elements within a group
for (int lp = 0; lp <= nr_csi_rs_info->lprime; lp++) { for (int lp = 0; lp <= l_prime; lp++) {
uint16_t symb = lp + nr_csi_rs_info->loverline[cdm_id]; uint16_t symb = lp + nr_csi_rs_info->loverline[cdm_id];
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size; uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size;
c16_t *rx_signal = (c16_t*)&rxdataF[ant_rx][symbol_offset]; c16_t *rx_signal = (c16_t*)&rxdataF[ant_rx][symbol_offset];
...@@ -211,7 +215,7 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ...@@ -211,7 +215,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+nr_csi_rs_info->j[cdm_id]*nr_csi_rs_info->CDM_group_size; uint16_t port_tx = s+nr_csi_rs_info->j[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_rs_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,
...@@ -254,8 +258,13 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -254,8 +258,13 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
const nr_csi_rs_info_t *nr_csi_rs_info, const nr_csi_rs_info_t *nr_csi_rs_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],
int32_t csi_rs_ls_estimated_channel[][ue->nr_csi_rs_info->N_ports][ue->frame_parms.ofdm_symbol_size], const uint8_t N_cdm_groups,
int32_t csi_rs_estimated_channel_freq[][ue->nr_csi_rs_info->N_ports][ue->frame_parms.ofdm_symbol_size], const uint8_t CDM_group_size,
const uint8_t k_prime,
const uint8_t l_prime,
const uint8_t N_ports,
int32_t csi_rs_ls_estimated_channel[][N_ports][ue->frame_parms.ofdm_symbol_size],
int32_t csi_rs_estimated_channel_freq[][N_ports][ue->frame_parms.ofdm_symbol_size],
int16_t *log2_re, int16_t *log2_re,
int16_t *log2_maxh, int16_t *log2_maxh,
uint32_t *noise_power) { uint32_t *noise_power) {
...@@ -270,7 +279,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -270,7 +279,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
/// LS channel estimation /// LS channel estimation
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
memset(csi_rs_ls_estimated_channel[ant_rx][port_tx], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t)); memset(csi_rs_ls_estimated_channel[ant_rx][port_tx], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t));
} }
...@@ -281,19 +290,19 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -281,19 +290,19 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
continue; continue;
} }
for (int cdm_id = 0; cdm_id < nr_csi_rs_info->N_cdm_groups; cdm_id++) { for (int cdm_id = 0; cdm_id < N_cdm_groups; cdm_id++) {
for (int s = 0; s < nr_csi_rs_info->CDM_group_size; s++) { for (int s = 0; s < CDM_group_size; s++) {
uint16_t port_tx = s+nr_csi_rs_info->j[cdm_id]*nr_csi_rs_info->CDM_group_size; uint16_t port_tx = s+nr_csi_rs_info->j[cdm_id]*CDM_group_size;
// loop over frequency resource elements within a group // loop over frequency resource elements within a group
for (int kp = 0; kp <= nr_csi_rs_info->kprime; kp++) { for (int kp = 0; kp <= k_prime; kp++) {
uint16_t kinit = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; uint16_t kinit = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
uint16_t k = kinit + nr_csi_rs_info->koverline[cdm_id] + kp; uint16_t k = kinit + nr_csi_rs_info->koverline[cdm_id] + kp;
// loop over time resource elements within a group // loop over time resource elements within a group
for (int lp = 0; lp <= nr_csi_rs_info->lprime; lp++) { for (int lp = 0; lp <= l_prime; lp++) {
uint16_t symb = lp + nr_csi_rs_info->loverline[cdm_id]; uint16_t symb = lp + nr_csi_rs_info->loverline[cdm_id];
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size; uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size;
c16_t *tx_csi_rs_signal = (c16_t*)&csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset]; c16_t *tx_csi_rs_signal = (c16_t*)&csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset];
...@@ -320,7 +329,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -320,7 +329,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
} }
for(int k = 0; k<frame_parms->ofdm_symbol_size; k++) { for(int k = 0; k<frame_parms->ofdm_symbol_size; k++) {
LOG_I(NR_PHY, "l,k (%2d,%4d) | ", symb, k); LOG_I(NR_PHY, "l,k (%2d,%4d) | ", symb, k);
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size; uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size;
c16_t *tx_csi_rs_signal = (c16_t*)&csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset]; c16_t *tx_csi_rs_signal = (c16_t*)&csi_rs_generated_signal[port_tx][symbol_offset+dataF_offset];
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];
...@@ -338,7 +347,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -338,7 +347,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
/// Channel interpolation /// Channel interpolation
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
memset(csi_rs_estimated_channel_freq[ant_rx][port_tx], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t)); memset(csi_rs_estimated_channel_freq[ant_rx][port_tx], 0, frame_parms->ofdm_symbol_size*sizeof(int32_t));
} }
...@@ -352,7 +361,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -352,7 +361,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
count++; count++;
uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
int16_t *csi_rs_ls_estimated_channel16 = (int16_t*)&csi_rs_ls_estimated_channel[ant_rx][port_tx][k]; int16_t *csi_rs_ls_estimated_channel16 = (int16_t*)&csi_rs_ls_estimated_channel[ant_rx][port_tx][k];
int16_t *csi_rs_estimated_channel16 = (int16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][k]; int16_t *csi_rs_estimated_channel16 = (int16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][k];
if( (k == 0) || (k == frame_parms->first_carrier_offset) ) { // Start of OFDM symbol case or first occupied subcarrier case if( (k == 0) || (k == frame_parms->first_carrier_offset) ) { // Start of OFDM symbol case or first occupied subcarrier case
...@@ -367,14 +376,14 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -367,14 +376,14 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
} }
/// Power noise estimation /// Power noise estimation
uint16_t noise_real[frame_parms->nb_antennas_rx][nr_csi_rs_info->N_ports][csirs_config_pdu->nr_of_rbs]; uint16_t noise_real[frame_parms->nb_antennas_rx][N_ports][csirs_config_pdu->nr_of_rbs];
uint16_t noise_imag[frame_parms->nb_antennas_rx][nr_csi_rs_info->N_ports][csirs_config_pdu->nr_of_rbs]; uint16_t noise_imag[frame_parms->nb_antennas_rx][N_ports][csirs_config_pdu->nr_of_rbs];
for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) { for (int rb = csirs_config_pdu->start_rb; rb < (csirs_config_pdu->start_rb+csirs_config_pdu->nr_of_rbs); rb++) {
if (csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) { if (csirs_config_pdu->freq_density <= 1 && csirs_config_pdu->freq_density != (rb % 2)) {
continue; continue;
} }
uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
c16_t *csi_rs_ls_estimated_channel16 = (c16_t*)&csi_rs_ls_estimated_channel[ant_rx][port_tx][k]; c16_t *csi_rs_ls_estimated_channel16 = (c16_t*)&csi_rs_ls_estimated_channel[ant_rx][port_tx][k];
c16_t *csi_rs_estimated_channel16 = (c16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][k]; c16_t *csi_rs_estimated_channel16 = (c16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][k];
noise_real[ant_rx][port_tx][rb-csirs_config_pdu->start_rb] = abs(csi_rs_ls_estimated_channel16->r-csi_rs_estimated_channel16->r); noise_real[ant_rx][port_tx][rb-csirs_config_pdu->start_rb] = abs(csi_rs_ls_estimated_channel16->r-csi_rs_estimated_channel16->r);
...@@ -382,7 +391,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -382,7 +391,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
maxh = cmax3(maxh, abs(csi_rs_estimated_channel16->r), abs(csi_rs_estimated_channel16->i)); maxh = cmax3(maxh, abs(csi_rs_estimated_channel16->r), abs(csi_rs_estimated_channel16->i));
} }
} }
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
*noise_power += (calc_power_csirs(noise_real[ant_rx][port_tx], csirs_config_pdu) + calc_power_csirs(noise_imag[ant_rx][port_tx],csirs_config_pdu)); *noise_power += (calc_power_csirs(noise_real[ant_rx][port_tx], csirs_config_pdu) + calc_power_csirs(noise_imag[ant_rx][port_tx],csirs_config_pdu));
} }
...@@ -392,7 +401,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -392,7 +401,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
(k - frame_parms->first_carrier_offset)/NR_NB_SC_PER_RB : (k - frame_parms->first_carrier_offset)/NR_NB_SC_PER_RB :
(k + frame_parms->ofdm_symbol_size - frame_parms->first_carrier_offset)/NR_NB_SC_PER_RB; (k + frame_parms->ofdm_symbol_size - frame_parms->first_carrier_offset)/NR_NB_SC_PER_RB;
LOG_I(NR_PHY, "(k = %4d) |\t", k); LOG_I(NR_PHY, "(k = %4d) |\t", k);
for(uint16_t port_tx = 0; port_tx<nr_csi_rs_info->N_ports; port_tx++) { for(uint16_t port_tx = 0; port_tx<N_ports; port_tx++) {
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];
c16_t *csi_rs_estimated_channel16 = (c16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][0]; c16_t *csi_rs_estimated_channel16 = (c16_t *)&csi_rs_estimated_channel_freq[ant_rx][port_tx][0];
printf("Channel port_tx %d --> ant_rx %d : ls (%4d,%4d), int (%4d,%4d), noise (%4d,%4d) | ", printf("Channel port_tx %d --> ant_rx %d : ls (%4d,%4d), int (%4d,%4d), noise (%4d,%4d) | ",
...@@ -408,7 +417,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -408,7 +417,7 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue,
} }
*noise_power /= (frame_parms->nb_antennas_rx*nr_csi_rs_info->N_ports); *noise_power /= (frame_parms->nb_antennas_rx*N_ports);
*log2_maxh = log2_approx(maxh-1); *log2_maxh = log2_approx(maxh-1);
*log2_re = log2_approx(count-1); *log2_re = log2_approx(count-1);
...@@ -422,7 +431,8 @@ int nr_csi_rs_channel_estimation(const PHY_VARS_NR_UE *ue, ...@@ -422,7 +431,8 @@ 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_rs_info_t *nr_csi_rs_info,
int32_t csi_rs_estimated_channel_freq[][ue->nr_csi_rs_info->N_ports][ue->frame_parms.ofdm_symbol_size], const uint8_t N_ports,
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,
uint8_t *rank_indicator) { uint8_t *rank_indicator) {
...@@ -431,11 +441,11 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, ...@@ -431,11 +441,11 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
int count = 0; int count = 0;
*rank_indicator = 0; *rank_indicator = 0;
if (ue->frame_parms.nb_antennas_rx == 1 || ue->nr_csi_rs_info->N_ports == 1) { if (ue->frame_parms.nb_antennas_rx == 1 || N_ports == 1) {
return 0; return 0;
} else if( !(ue->frame_parms.nb_antennas_rx == 2 && ue->nr_csi_rs_info->N_ports == 2) ) { } else if( !(ue->frame_parms.nb_antennas_rx == 2 && N_ports == 2) ) {
LOG_W(NR_PHY, "Rank indicator computation is not implemented for %i x %i system\n", LOG_W(NR_PHY, "Rank indicator computation is not implemented for %i x %i system\n",
ue->frame_parms.nb_antennas_rx, ue->nr_csi_rs_info->N_ports); ue->frame_parms.nb_antennas_rx, N_ports);
return -1; return -1;
} }
...@@ -444,9 +454,9 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, ...@@ -444,9 +454,9 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
* | conjch01 conjch11 | | ch10 ch11 | | conjch01*ch00+conjch11*ch10 conjch01*ch01+conjch11*ch11 | * | conjch01 conjch11 | | ch10 ch11 | | conjch01*ch00+conjch11*ch10 conjch01*ch01+conjch11*ch11 |
*/ */
int32_t csi_rs_estimated_conjch_ch[frame_parms->nb_antennas_rx][nr_csi_rs_info->N_ports][frame_parms->nb_antennas_rx][nr_csi_rs_info->N_ports][frame_parms->ofdm_symbol_size] __attribute__((aligned(32))); int32_t csi_rs_estimated_conjch_ch[frame_parms->nb_antennas_rx][N_ports][frame_parms->nb_antennas_rx][N_ports][frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
int32_t csi_rs_estimated_A_MF[nr_csi_rs_info->N_ports][nr_csi_rs_info->N_ports][frame_parms->ofdm_symbol_size] __attribute__((aligned(32))); int32_t csi_rs_estimated_A_MF[N_ports][N_ports][frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
int32_t csi_rs_estimated_A_MF_sq[nr_csi_rs_info->N_ports][nr_csi_rs_info->N_ports][frame_parms->ofdm_symbol_size] __attribute__((aligned(32))); int32_t csi_rs_estimated_A_MF_sq[N_ports][N_ports][frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
int32_t csi_rs_estimated_determ_fin[frame_parms->ofdm_symbol_size] __attribute__((aligned(32))); int32_t csi_rs_estimated_determ_fin[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
int32_t csi_rs_estimated_numer_fin[frame_parms->ofdm_symbol_size] __attribute__((aligned(32))); int32_t csi_rs_estimated_numer_fin[frame_parms->ofdm_symbol_size] __attribute__((aligned(32)));
...@@ -460,9 +470,9 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, ...@@ -460,9 +470,9 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; uint16_t k = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
for (int ant_rx_conjch = 0; ant_rx_conjch < frame_parms->nb_antennas_rx; ant_rx_conjch++) { for (int ant_rx_conjch = 0; ant_rx_conjch < frame_parms->nb_antennas_rx; ant_rx_conjch++) {
for(uint16_t port_tx_conjch = 0; port_tx_conjch < nr_csi_rs_info->N_ports; port_tx_conjch++) { for(uint16_t port_tx_conjch = 0; port_tx_conjch < N_ports; port_tx_conjch++) {
for (int ant_rx_ch = 0; ant_rx_ch < frame_parms->nb_antennas_rx; ant_rx_ch++) { for (int ant_rx_ch = 0; ant_rx_ch < frame_parms->nb_antennas_rx; ant_rx_ch++) {
for(uint16_t port_tx_ch = 0; port_tx_ch < nr_csi_rs_info->N_ports; port_tx_ch++) { for(uint16_t port_tx_ch = 0; port_tx_ch < N_ports; port_tx_ch++) {
// conjch x ch computation // conjch x ch computation
nr_conjch0_mult_ch1(&csi_rs_estimated_channel_freq[ant_rx_conjch][port_tx_conjch][k], nr_conjch0_mult_ch1(&csi_rs_estimated_channel_freq[ant_rx_conjch][port_tx_conjch][k],
...@@ -503,8 +513,8 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, ...@@ -503,8 +513,8 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue,
1); 1);
#ifdef NR_CSIRS_DEBUG #ifdef NR_CSIRS_DEBUG
for(uint16_t port_tx_conjch = 0; port_tx_conjch < nr_csi_rs_info->N_ports; port_tx_conjch++) { for(uint16_t port_tx_conjch = 0; port_tx_conjch < N_ports; port_tx_conjch++) {
for(uint16_t port_tx_ch = 0; port_tx_ch < nr_csi_rs_info->N_ports; port_tx_ch++) { for(uint16_t port_tx_ch = 0; port_tx_ch < N_ports; port_tx_ch++) {
c16_t *csi_rs_estimated_A_MF_k = (c16_t *) &csi_rs_estimated_A_MF[port_tx_conjch][port_tx_ch][k]; c16_t *csi_rs_estimated_A_MF_k = (c16_t *) &csi_rs_estimated_A_MF[port_tx_conjch][port_tx_ch][k];
LOG_I(NR_PHY, "(%i) csi_rs_estimated_A_MF[%i][%i] = (%i, %i)\n", LOG_I(NR_PHY, "(%i) csi_rs_estimated_A_MF[%i][%i] = (%i, %i)\n",
k, port_tx_conjch, port_tx_ch, csi_rs_estimated_A_MF_k->r, csi_rs_estimated_A_MF_k->i); k, port_tx_conjch, port_tx_ch, csi_rs_estimated_A_MF_k->r, csi_rs_estimated_A_MF_k->i);
...@@ -553,7 +563,8 @@ int nr_csi_rs_ri_estimation(const PHY_VARS_NR_UE *ue, ...@@ -553,7 +563,8 @@ 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_rs_info_t *nr_csi_rs_info,
const int32_t csi_rs_estimated_channel_freq[][ue->nr_csi_rs_info->N_ports][ue->frame_parms.ofdm_symbol_size], const uint8_t N_ports,
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,
const uint8_t rank_indicator, const uint8_t rank_indicator,
const int16_t log2_re, const int16_t log2_re,
...@@ -574,7 +585,7 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue, ...@@ -574,7 +585,7 @@ int nr_csi_rs_pmi_estimation(const PHY_VARS_NR_UE *ue,
// The first column is applicable if the UE is reporting a Rank = 1, whereas the second column is applicable if the // The first column is applicable if the UE is reporting a Rank = 1, whereas the second column is applicable if the
// UE is reporting a Rank = 2. // UE is reporting a Rank = 2.
if(nr_csi_rs_info->N_ports == 1 || interference_plus_noise_power == 0) { if(N_ports == 1 || interference_plus_noise_power == 0) {
return 0; return 0;
} }
...@@ -812,6 +823,11 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -812,6 +823,11 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
int32_t csi_rs_received_signal[frame_parms->nb_antennas_rx][frame_parms->samples_per_slot_wCP]; int32_t csi_rs_received_signal[frame_parms->nb_antennas_rx][frame_parms->samples_per_slot_wCP];
uint8_t N_cdm_groups = 0;
uint8_t CDM_group_size = 0;
uint8_t k_prime = 0;
uint8_t l_prime = 0;
uint8_t N_ports = 0;
int16_t log2_re = 0; int16_t log2_re = 0;
int16_t log2_maxh = 0; int16_t log2_maxh = 0;
uint32_t noise_power = 0; uint32_t noise_power = 0;
...@@ -826,15 +842,24 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -826,15 +842,24 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
AMP, AMP,
ue->nr_csi_rs_info, ue->nr_csi_rs_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,
&CDM_group_size,
&k_prime,
&l_prime,
&N_ports);
int32_t csi_rs_ls_estimated_channel[frame_parms->nb_antennas_rx][ue->nr_csi_rs_info->N_ports][frame_parms->ofdm_symbol_size]; int32_t csi_rs_ls_estimated_channel[frame_parms->nb_antennas_rx][N_ports][frame_parms->ofdm_symbol_size];
int32_t csi_rs_estimated_channel_freq[frame_parms->nb_antennas_rx][ue->nr_csi_rs_info->N_ports][frame_parms->ofdm_symbol_size]; int32_t csi_rs_estimated_channel_freq[frame_parms->nb_antennas_rx][N_ports][frame_parms->ofdm_symbol_size];
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_rs_info,
N_cdm_groups,
CDM_group_size,
k_prime,
l_prime,
csi_rs_received_signal); csi_rs_received_signal);
nr_csi_rs_channel_estimation(ue, nr_csi_rs_channel_estimation(ue,
...@@ -843,6 +868,11 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -843,6 +868,11 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
ue->nr_csi_rs_info, ue->nr_csi_rs_info,
(const int32_t **) ue->nr_csi_rs_info->csi_rs_generated_signal, (const int32_t **) ue->nr_csi_rs_info->csi_rs_generated_signal,
csi_rs_received_signal, csi_rs_received_signal,
N_cdm_groups,
CDM_group_size,
k_prime,
l_prime,
N_ports,
csi_rs_ls_estimated_channel, csi_rs_ls_estimated_channel,
csi_rs_estimated_channel_freq, csi_rs_estimated_channel_freq,
&log2_re, &log2_re,
...@@ -852,6 +882,7 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -852,6 +882,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_rs_info,
N_ports,
csi_rs_estimated_channel_freq, csi_rs_estimated_channel_freq,
log2_maxh, log2_maxh,
&rank_indicator); &rank_indicator);
...@@ -859,6 +890,7 @@ int nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -859,6 +890,7 @@ 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_rs_info,
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_im_info->meas_computed ? ue->nr_csi_im_info->interference_plus_noise_power : noise_power,
rank_indicator, rank_indicator,
......
...@@ -254,11 +254,6 @@ typedef struct { ...@@ -254,11 +254,6 @@ typedef struct {
} nr_srs_info_t; } nr_srs_info_t;
typedef struct { typedef struct {
uint8_t N_cdm_groups;
uint8_t CDM_group_size;
uint8_t kprime;
uint8_t lprime;
uint8_t N_ports;
uint8_t j[16]; uint8_t j[16];
uint8_t koverline[16]; uint8_t koverline[16];
uint8_t loverline[16]; uint8_t loverline[16];
......
...@@ -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); 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);
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