Commit 834de1be authored by francescomani's avatar francescomani

procedures to skip dlsch REs when they overlap with CSI at UE

parent c808a7f3
...@@ -780,6 +780,17 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB, ...@@ -780,6 +780,17 @@ uint32_t get_ssb_offset_to_pointA(uint32_t absoluteFrequencySSB,
return ssb_offset_point_a; return ssb_offset_point_a;
} }
int compute_csi_unav_res(int start, int end, uint32_t *csi_REs)
{
int unav_csi_res = 0;
for (int i = start; i < end; i++) {
for (int j = 0; j < 12; j++) {
unav_csi_res += ((csi_REs[i] >> j) & 0x01);
}
}
return unav_csi_res;
}
int get_delay_idx(int delay, int max_delay_comp) int get_delay_idx(int delay, int max_delay_comp)
{ {
int delay_idx = max_delay_comp + delay; int delay_idx = max_delay_comp + delay;
......
...@@ -123,7 +123,7 @@ static inline int get_num_dmrs(uint16_t dmrs_mask ) { ...@@ -123,7 +123,7 @@ static inline int get_num_dmrs(uint16_t dmrs_mask ) {
} }
uint64_t reverse_bits(uint64_t in, int n_bits); uint64_t reverse_bits(uint64_t in, int n_bits);
int compute_csi_unav_res(int start, int end, uint32_t *csi_REs);
int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUplinkSymbols); int get_first_ul_slot(int nrofDownlinkSlots, int nrofDownlinkSymbols, int nrofUplinkSymbols);
int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs); int cce_to_reg_interleaving(const int R, int k, int n_shift, const int C, int L, const int N_regs);
int get_SLIV(uint8_t S, uint8_t L); int get_SLIV(uint8_t S, uint8_t L);
......
...@@ -194,8 +194,9 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ...@@ -194,8 +194,9 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
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],
uint32_t *rsrp, uint32_t *rsrp,
int *rsrp_dBm, int *rsrp_dBm,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) { c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t *csi_REs)
{
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
uint16_t meas_count = 0; uint16_t meas_count = 0;
uint32_t rsrp_sum = 0; uint32_t rsrp_sum = 0;
...@@ -215,12 +216,13 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue, ...@@ -215,12 +216,13 @@ int nr_get_csi_rs_signal(const PHY_VARS_NR_UE *ue,
// loop over frequency resource elements within a group // loop over frequency resource elements within a group
for (int kp = 0; kp <= k_prime; kp++) { for (int kp = 0; kp <= k_prime; kp++) {
uint16_t k = (frame_parms->first_carrier_offset + (rb*NR_NB_SC_PER_RB)+k_overline[cdm_id] + kp) % frame_parms->ofdm_symbol_size; uint16_t k = (frame_parms->first_carrier_offset + (rb * NR_NB_SC_PER_RB) + k_overline[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 <= l_prime; lp++) { for (int lp = 0; lp <= l_prime; lp++) {
uint16_t symb = lp + l_overline[cdm_id]; uint16_t symb = lp + l_overline[cdm_id];
uint64_t symbol_offset = symb*frame_parms->ofdm_symbol_size; csi_REs[symb] |= (1 << (k_overline[cdm_id] + kp));
uint64_t symbol_offset = symb * frame_parms->ofdm_symbol_size;
c16_t *rx_signal = &rxdataF[ant_rx][symbol_offset]; c16_t *rx_signal = &rxdataF[ant_rx][symbol_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];
rx_csi_rs_signal[k].r = rx_signal[k].r; rx_csi_rs_signal[k].r = rx_signal[k].r;
...@@ -730,12 +732,12 @@ int nr_csi_rs_cqi_estimation(const uint32_t precoded_sinr, ...@@ -730,12 +732,12 @@ int nr_csi_rs_cqi_estimation(const uint32_t precoded_sinr,
return 0; return 0;
} }
int nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue, void nr_csi_im_power_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_csiim_pdu_rel15_t *csiim_config_pdu, const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu,
uint32_t *interference_plus_noise_power, uint32_t *interference_plus_noise_power,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) { c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
{
const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; const NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
const uint16_t end_rb = csiim_config_pdu->start_rb + csiim_config_pdu->nr_of_rbs > csiim_config_pdu->bwp_size ? const uint16_t end_rb = csiim_config_pdu->start_rb + csiim_config_pdu->nr_of_rbs > csiim_config_pdu->bwp_size ?
...@@ -772,9 +774,9 @@ int nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue, ...@@ -772,9 +774,9 @@ int nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue,
for (int rb = csiim_config_pdu->start_rb; rb < end_rb; rb++) { for (int rb = csiim_config_pdu->start_rb; rb < end_rb; rb++) {
uint16_t sc0_offset = (frame_parms->first_carrier_offset + rb*NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size; uint16_t sc0_offset = (frame_parms->first_carrier_offset + rb * NR_NB_SC_PER_RB) % frame_parms->ofdm_symbol_size;
for (int sc_idx = 0; sc_idx<4; sc_idx++) { for (int sc_idx = 0; sc_idx < 4; sc_idx++) {
uint16_t sc = sc0_offset + csiim_config_pdu->k_csiim[sc_idx]; uint16_t sc = sc0_offset + csiim_config_pdu->k_csiim[sc_idx];
if (sc >= frame_parms->ofdm_symbol_size) { if (sc >= frame_parms->ofdm_symbol_size) {
...@@ -803,17 +805,16 @@ int nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue, ...@@ -803,17 +805,16 @@ int nr_csi_im_power_estimation(const PHY_VARS_NR_UE *ue,
#ifdef NR_CSIIM_DEBUG #ifdef NR_CSIIM_DEBUG
LOG_I(NR_PHY, "interference_plus_noise_power based on CSI-IM = %i\n", *interference_plus_noise_power); LOG_I(NR_PHY, "interference_plus_noise_power based on CSI-IM = %i\n", *interference_plus_noise_power);
#endif #endif
return 0;
} }
int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t *csi_REs)
{ {
int gNB_id = proc->gNB_id; int gNB_id = proc->gNB_id;
if(!ue->csiim_vars[gNB_id]->active) { if(!ue->csiim_vars[gNB_id]->active) {
return -1; LOG_E(NR_PHY, "Scheduling reception of CSI-IM that is not active\n");
} }
const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = (fapi_nr_dl_config_csiim_pdu_rel15_t*)&ue->csiim_vars[gNB_id]->csiim_config_pdu; const fapi_nr_dl_config_csiim_pdu_rel15_t *csiim_config_pdu = (fapi_nr_dl_config_csiim_pdu_rel15_t*)&ue->csiim_vars[gNB_id]->csiim_config_pdu;
...@@ -828,10 +829,13 @@ int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, ...@@ -828,10 +829,13 @@ int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue,
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
for (int i = 0; i < 4; i++) {
int symb = csiim_config_pdu->l_csiim[i];
int re = csiim_config_pdu->k_csiim[i];
csi_REs[symb] |= (1 << re);
}
nr_csi_im_power_estimation(ue, proc, csiim_config_pdu, &ue->nr_csi_info->interference_plus_noise_power, rxdataF); nr_csi_im_power_estimation(ue, proc, csiim_config_pdu, &ue->nr_csi_info->interference_plus_noise_power, rxdataF);
ue->nr_csi_info->csi_im_meas_computed = true; ue->nr_csi_info->csi_im_meas_computed = true;
return 0;
} }
static nfapi_nr_dl_tti_csi_rs_pdu_rel15_t convert_csirs_pdu(const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu) static nfapi_nr_dl_tti_csi_rs_pdu_rel15_t convert_csirs_pdu(const fapi_nr_dl_config_csirs_pdu_rel15_t *csirs_config_pdu)
...@@ -856,9 +860,9 @@ static nfapi_nr_dl_tti_csi_rs_pdu_rel15_t convert_csirs_pdu(const fapi_nr_dl_con ...@@ -856,9 +860,9 @@ static nfapi_nr_dl_tti_csi_rs_pdu_rel15_t convert_csirs_pdu(const fapi_nr_dl_con
void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t *csi_REs)
{ {
int gNB_id = proc->gNB_id; int gNB_id = proc->gNB_id;
if(!ue->csirs_vars[gNB_id]->active) { if(!ue->csirs_vars[gNB_id]->active) {
return; return;
...@@ -946,7 +950,8 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, ...@@ -946,7 +950,8 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
csi_rs_received_signal, csi_rs_received_signal,
&rsrp, &rsrp,
&rsrp_dBm, &rsrp_dBm,
rxdataF); rxdataF,
csi_REs);
// if we need to measure only RSRP no need to do channel estimation // if we need to measure only RSRP no need to do channel estimation
......
...@@ -154,7 +154,8 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz, ...@@ -154,7 +154,8 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz,
uint8_t Nl, uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos, uint16_t dlDmrsSymbPos,
int chest_time_type); int chest_time_type,
uint32_t csi_REs_symb);
static void nr_dlsch_channel_level_median(uint32_t rx_size_symbol, int32_t dl_ch_estimates_ext[][rx_size_symbol], int32_t *median, int n_tx, int n_rx, int length); static void nr_dlsch_channel_level_median(uint32_t rx_size_symbol, int32_t dl_ch_estimates_ext[][rx_size_symbol], int32_t *median, int n_tx, int n_rx, int length);
...@@ -249,7 +250,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -249,7 +250,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int nbRx, int nbRx,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT], int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT], c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT]) int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
uint32_t csi_REs_symb)
{ {
const int nl = dlsch[0].Nl; const int nl = dlsch[0].Nl;
const int matrixSz = ue->frame_parms.nb_antennas_rx * nl; const int matrixSz = ue->frame_parms.nb_antennas_rx * nl;
...@@ -388,7 +390,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -388,7 +390,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
nl, nl,
frame_parms, frame_parms,
dlsch[0].dlsch_config.dlDmrsSymbPos, dlsch[0].dlsch_config.dlDmrsSymbPos,
ue->chest_time); ue->chest_time,
csi_REs_symb);
if (meas_enabled) { if (meas_enabled) {
stop_meas(&meas); stop_meas(&meas);
LOG_D(PHY, LOG_D(PHY,
...@@ -1215,7 +1218,8 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz, ...@@ -1215,7 +1218,8 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz,
uint8_t Nl, uint8_t Nl,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
uint16_t dlDmrsSymbPos, uint16_t dlDmrsSymbPos,
int chest_time_type) int chest_time_type,
uint32_t csi_REs_symb)
{ {
if (config_type == NFAPI_NR_DMRS_TYPE1) { if (config_type == NFAPI_NR_DMRS_TYPE1) {
AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2, AssertFatal(n_dmrs_cdm_groups == 1 || n_dmrs_cdm_groups == 2,
...@@ -1242,7 +1246,7 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz, ...@@ -1242,7 +1246,7 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz,
int32_t *dl_ch0 = &dl_ch_estimates[(l * frame_parms->nb_antennas_rx) + aarx][validDmrsEst * frame_parms->ofdm_symbol_size]; int32_t *dl_ch0 = &dl_ch_estimates[(l * frame_parms->nb_antennas_rx) + aarx][validDmrsEst * frame_parms->ofdm_symbol_size];
int32_t *dl_ch0_ext = dl_ch_estimates_ext[(l * frame_parms->nb_antennas_rx) + aarx]; int32_t *dl_ch0_ext = dl_ch_estimates_ext[(l * frame_parms->nb_antennas_rx) + aarx];
if (pilots == 0) { //data symbol only if (pilots == 0 && csi_REs_symb == 0) { //data symbol only
if (l == 0) { if (l == 0) {
if (start_re + nb_rb_pdsch * NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { if (start_re + nb_rb_pdsch * NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) {
memcpy(rxF_ext, &rxF[start_re], nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); memcpy(rxF_ext, &rxF[start_re], nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t));
...@@ -1255,65 +1259,32 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz, ...@@ -1255,65 +1259,32 @@ static void nr_dlsch_extract_rbs(uint32_t rxdataF_sz,
} }
memcpy(dl_ch0_ext, dl_ch0, nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t)); memcpy(dl_ch0_ext, dl_ch0, nb_rb_pdsch * NR_NB_SC_PER_RB * sizeof(int32_t));
} }
else if (config_type == NFAPI_NR_DMRS_TYPE1){ else {
if (n_dmrs_cdm_groups == 1) { //data is multiplexed int j = 0;
if (l == 0) { int k = start_re;
unsigned short k = start_re; int max_cdm = (config_type == NFAPI_NR_DMRS_TYPE1) ? 2 : 3;
for (unsigned short j = 0; j < 6*nb_rb_pdsch; j += 3) { int shift = (config_type == NFAPI_NR_DMRS_TYPE1) ? 0 : 1;
rxF_ext[j] = rxF[k+1]; for (int rb = 0; rb < nb_rb_pdsch; rb++) {
rxF_ext[j+1] = rxF[k+3]; for (int re = 0; re < 12; re++) {
rxF_ext[j+2] = rxF[k+5]; if (((re >> shift) % max_cdm) < n_dmrs_cdm_groups) {
k += 6; // DMRS RE
if (k >= frame_parms->ofdm_symbol_size) AssertFatal(((csi_REs_symb >> re) & 0x01) == 0, "DMRS RE overlapping with CSI RE, it shouldn't happen\n");
k -= frame_parms->ofdm_symbol_size;
} }
} else {
for (unsigned short j = 0; j < 6*nb_rb_pdsch; j += 3) { // DATA RE
dl_ch0_ext[j] = dl_ch0[1]; if (((csi_REs_symb >> re) & 0x01) == 0) {
dl_ch0_ext[j+1] = dl_ch0[3]; // Process RE only if not overlapping with CSI
dl_ch0_ext[j+2] = dl_ch0[5]; if (l == 0)
dl_ch0 += 6; rxF_ext[j] = rxF[k];
} dl_ch0_ext[j] = dl_ch0[re];
} j++;
} }
else {//NFAPI_NR_DMRS_TYPE2
if (n_dmrs_cdm_groups == 1) { //data is multiplexed
if (l == 0) {
unsigned short k = start_re;
for (unsigned short j = 0; j < 8*nb_rb_pdsch; j += 4) {
rxF_ext[j] = rxF[k+2];
rxF_ext[j+1] = rxF[k+3];
rxF_ext[j+2] = rxF[k+4];
rxF_ext[j+3] = rxF[k+5];
k += 6;
if (k >= frame_parms->ofdm_symbol_size)
k -= frame_parms->ofdm_symbol_size;
} }
k++;
if (k >= frame_parms->ofdm_symbol_size)
k -= frame_parms->ofdm_symbol_size;
} }
for (unsigned short j = 0; j < 8*nb_rb_pdsch; j += 4) { dl_ch0 += 12;
dl_ch0_ext[j] = dl_ch0[2];
dl_ch0_ext[j+1] = dl_ch0[3];
dl_ch0_ext[j+2] = dl_ch0[4];
dl_ch0_ext[j+3] = dl_ch0[5];
dl_ch0 += 6;
}
}
else if (n_dmrs_cdm_groups == 2) { //data is multiplexed
if (l == 0) {
unsigned short k = start_re;
for (unsigned short j = 0; j < 4*nb_rb_pdsch; j += 2) {
rxF_ext[j] = rxF[k+4];
rxF_ext[j+1] = rxF[k+5];
k += 6;
if (k >= frame_parms->ofdm_symbol_size)
k -= frame_parms->ofdm_symbol_size;
}
}
for (unsigned short j = 0; j < 4*nb_rb_pdsch; j += 2) {
dl_ch0_ext[j] = dl_ch0[4];
dl_ch0_ext[j+1] = dl_ch0[5];
dl_ch0 += 6;
}
} }
} }
} }
......
...@@ -417,7 +417,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue, ...@@ -417,7 +417,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
int nbRx, int nbRx,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT], int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT], c16_t ptrs_phase_per_slot[][NR_SYMBOLS_PER_SLOT],
int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT]); int32_t ptrs_re_per_slot[][NR_SYMBOLS_PER_SLOT],
uint32_t csi_REs_symb);
int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot); int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, int frame, uint8_t slot);
......
...@@ -157,13 +157,15 @@ int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue, ...@@ -157,13 +157,15 @@ int nr_ue_pdcch_procedures(PHY_VARS_NR_UE *ue,
int n_ss, int n_ss,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
int nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue, void nr_ue_csi_im_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t *csi_REs);
void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]); c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t *csi_REs);
#endif #endif
/** @}*/ /** @}*/
...@@ -492,7 +492,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -492,7 +492,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc, const UE_nr_rxtx_proc_t *proc,
NR_UE_DLSCH_t dlsch[2], NR_UE_DLSCH_t dlsch[2],
int16_t *llr[2], int16_t *llr[2],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]) c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP],
uint32_t csi_REs[NR_SYMBOLS_PER_SLOT])
{ {
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
int nr_slot_rx = proc->nr_slot_rx; int nr_slot_rx = proc->nr_slot_rx;
...@@ -500,7 +501,7 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -500,7 +501,7 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
int first_symbol_flag=0; int first_symbol_flag=0;
// We handle only one CW now // We handle only one CW now
if (!(NR_MAX_NB_LAYERS>4)) { if (!(NR_MAX_NB_LAYERS > 4)) {
NR_UE_DLSCH_t *dlsch0 = &dlsch[0]; NR_UE_DLSCH_t *dlsch0 = &dlsch[0];
int harq_pid = dlsch0->dlsch_config.harq_process_nbr; int harq_pid = dlsch0->dlsch_config.harq_process_nbr;
NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][harq_pid]; NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][harq_pid];
...@@ -616,7 +617,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -616,7 +617,8 @@ static int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
ue->frame_parms.nb_antennas_rx, ue->frame_parms.nb_antennas_rx,
rxdataF_comp, rxdataF_comp,
ptrs_phase_per_slot, ptrs_phase_per_slot,
ptrs_re_per_slot) ptrs_re_per_slot,
csi_REs[m])
< 0) < 0)
return -1; return -1;
...@@ -646,7 +648,11 @@ static void send_dl_done_to_tx_thread(notifiedFIFO_t *nf, int rx_slot) ...@@ -646,7 +648,11 @@ static void send_dl_done_to_tx_thread(notifiedFIFO_t *nf, int rx_slot)
} }
} }
static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, NR_UE_DLSCH_t dlsch[2], int16_t *llr[2]) static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
const UE_nr_rxtx_proc_t *proc,
NR_UE_DLSCH_t dlsch[2],
int16_t* llr[2],
uint32_t csi_REs[NR_SYMBOLS_PER_SLOT])
{ {
if (dlsch[0].active == false) { if (dlsch[0].active == false) {
LOG_E(PHY, "DLSCH should be active when calling this function\n"); LOG_E(PHY, "DLSCH should be active when calling this function\n");
...@@ -673,10 +679,10 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t * ...@@ -673,10 +679,10 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
uint8_t nb_re_dmrs; uint8_t nb_re_dmrs;
if (dmrs_type==NFAPI_NR_DMRS_TYPE1) { if (dmrs_type==NFAPI_NR_DMRS_TYPE1) {
nb_re_dmrs = 6*dlsch[0].dlsch_config.n_dmrs_cdm_groups; nb_re_dmrs = 6 * dlsch[0].dlsch_config.n_dmrs_cdm_groups;
} }
else { else {
nb_re_dmrs = 4*dlsch[0].dlsch_config.n_dmrs_cdm_groups; nb_re_dmrs = 4 * dlsch[0].dlsch_config.n_dmrs_cdm_groups;
} }
LOG_D(PHY,"AbsSubframe %d.%d Start LDPC Decoder for CW0 [harq_pid %d] ? %d \n", frame_rx%1024, nr_slot_rx, harq_pid, is_cw0_active); LOG_D(PHY,"AbsSubframe %d.%d Start LDPC Decoder for CW0 [harq_pid %d] ? %d \n", frame_rx%1024, nr_slot_rx, harq_pid, is_cw0_active);
...@@ -780,6 +786,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t * ...@@ -780,6 +786,7 @@ static bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *
int ptrsSymbPerSlot = get_ptrs_symbols_in_slot(ptrsSymbPos, dlsch_config->start_symbol, dlsch_config->number_symbols); int ptrsSymbPerSlot = get_ptrs_symbols_in_slot(ptrsSymbPos, dlsch_config->start_symbol, dlsch_config->number_symbols);
unav_res = n_ptrs * ptrsSymbPerSlot; unav_res = n_ptrs * ptrsSymbPerSlot;
} }
unav_res += compute_csi_unav_res(dlsch_config->start_symbol, dlsch_config->start_symbol + dlsch_config->number_symbols, csi_REs);
dl_harq1->G = nr_get_G(dlsch_config->number_rbs, dl_harq1->G = nr_get_G(dlsch_config->number_rbs,
nb_symb_sch, nb_symb_sch,
nb_re_dmrs, nb_re_dmrs,
...@@ -1027,7 +1034,8 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1027,7 +1034,8 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
// do procedures for C-RNTI // do procedures for C-RNTI
int ret_pdsch = 0; int ret_pdsch = 0;
int slot_fep_bitmap[14] = {0}; int slot_fep_bitmap[NR_SYMBOLS_PER_SLOT] = {0};
uint32_t csi_REs[NR_SYMBOLS_PER_SLOT] = {0};
const uint32_t rxdataF_sz = ue->frame_parms.samples_per_slot_wCP; const uint32_t rxdataF_sz = ue->frame_parms.samples_per_slot_wCP;
__attribute__ ((aligned(32))) c16_t rxdataF[ue->frame_parms.nb_antennas_rx][rxdataF_sz]; __attribute__ ((aligned(32))) c16_t rxdataF[ue->frame_parms.nb_antennas_rx][rxdataF_sz];
...@@ -1040,7 +1048,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1040,7 +1048,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
slot_fep_bitmap[symb] = 1; slot_fep_bitmap[symb] = 1;
} }
} }
nr_ue_csi_im_procedures(ue, proc, rxdataF); nr_ue_csi_im_procedures(ue, proc, rxdataF, csi_REs);
ue->csiim_vars[gNB_id]->active = 0; ue->csiim_vars[gNB_id]->active = 0;
} }
...@@ -1054,7 +1062,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1054,7 +1062,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
} }
} }
} }
nr_ue_csi_rs_procedures(ue, proc, rxdataF); nr_ue_csi_rs_procedures(ue, proc, rxdataF, csi_REs);
ue->csirs_vars[gNB_id]->active = 0; ue->csirs_vars[gNB_id]->active = 0;
} }
...@@ -1069,7 +1077,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1069,7 +1077,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
for (int m = start_symb_sch; m < (nb_symb_sch + start_symb_sch) ; m++) { for (int m = start_symb_sch; m < (nb_symb_sch + start_symb_sch) ; m++) {
if (slot_fep_bitmap[m] == 0) { if (slot_fep_bitmap[m] == 0) {
nr_slot_fep(ue, proc, m, rxdataF); nr_slot_fep(ue, proc, m, rxdataF);
slot_fep_bitmap[m] = 2; slot_fep_bitmap[m] = 1;
} }
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDSCH, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP_PDSCH, VCD_FUNCTION_OUT);
...@@ -1094,6 +1102,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1094,6 +1102,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
int ptrsSymbPerSlot = get_ptrs_symbols_in_slot(ptrsSymbPos, dlsch_config->start_symbol, dlsch_config->number_symbols); int ptrsSymbPerSlot = get_ptrs_symbols_in_slot(ptrsSymbPos, dlsch_config->start_symbol, dlsch_config->number_symbols);
unav_res = n_ptrs * ptrsSymbPerSlot; unav_res = n_ptrs * ptrsSymbPerSlot;
} }
unav_res += compute_csi_unav_res(dlsch_config->start_symbol, dlsch_config->start_symbol + dlsch_config->number_symbols, csi_REs);
NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][dlsch_config->harq_process_nbr]; NR_DL_UE_HARQ_t *dlsch0_harq = &ue->dl_harq_processes[0][dlsch_config->harq_process_nbr];
dlsch0_harq->G = nr_get_G(dlsch_config->number_rbs, dlsch0_harq->G = nr_get_G(dlsch_config->number_rbs,
dlsch_config->number_symbols, dlsch_config->number_symbols,
...@@ -1109,11 +1118,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1109,11 +1118,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
llr[i] = (int16_t *)malloc16_clear(rx_llr_buf_sz * sizeof(int16_t)); llr[i] = (int16_t *)malloc16_clear(rx_llr_buf_sz * sizeof(int16_t));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_IN);
ret_pdsch = nr_ue_pdsch_procedures(ue, ret_pdsch = nr_ue_pdsch_procedures(ue, proc, dlsch, llr, rxdataF, csi_REs);
proc,
dlsch,
llr,
rxdataF);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_C, VCD_FUNCTION_OUT);
...@@ -1125,7 +1130,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_ ...@@ -1125,7 +1130,7 @@ void pdsch_processing(PHY_VARS_NR_UE *ue, const UE_nr_rxtx_proc_t *proc, nr_phy_
start_meas(&ue->dlsch_procedures_stat); start_meas(&ue->dlsch_procedures_stat);
if (ret_pdsch >= 0) if (ret_pdsch >= 0)
nr_ue_dlsch_procedures(ue, proc, dlsch, llr); nr_ue_dlsch_procedures(ue, proc, dlsch, llr, csi_REs);
else { else {
LOG_E(NR_PHY, "Demodulation impossible, internal error\n"); LOG_E(NR_PHY, "Demodulation impossible, internal error\n");
send_dl_done_to_tx_thread( send_dl_done_to_tx_thread(
......
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