Commit dc12dfd7 authored by laurent's avatar laurent

reduce UE stack size, make a piece of code clear, reduced variables visibility

parent cbb257a5
......@@ -1584,7 +1584,6 @@ void NFAPI_NR_DMRS_TYPE2_average_prb(NR_DL_FRAME_PARMS *frame_parms,
c16multaddVectRealComplex(filt8_avlip6, &ch, dl_ch, 8);
#endif
}
int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc,
bool is_SI,
......@@ -1598,7 +1597,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned short nb_rb_pdsch,
uint32_t pdsch_est_size,
int32_t dl_ch_estimates[][pdsch_est_size],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP])
int rxdataFsize,
c16_t rxdataF[][rxdataFsize])
{
int gNB_id = proc->gNB_id;
int Ns = proc->nr_slot_rx;
......@@ -1732,10 +1732,11 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
* 3) Compensate signal with PTRS estimation for slot
*********************************************************************/
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
int nbRx,
c16_t ptrs_phase_per_slot[][14],
int32_t ptrs_re_per_slot[][14],
uint32_t rx_size,
int32_t rxdataF_comp[][rx_size],
uint32_t rx_size_symbol,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
NR_DL_FRAME_PARMS *frame_parms,
NR_DL_UE_HARQ_t *dlsch0_harq,
NR_DL_UE_HARQ_t *dlsch1_harq,
......@@ -1826,8 +1827,9 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
nr_ptrs_cpe_estimation(*K_ptrs,*ptrsReOffset,*dmrsConfigType,*nb_rb,
rnti,
nr_slot_rx,
symbol,frame_parms->ofdm_symbol_size,
(int16_t*)&rxdataF_comp[aarx][(symbol * nb_re_pdsch)],
symbol,
frame_parms->ofdm_symbol_size,
(int16_t *)(rxdataF_comp[0][aarx] + symbol * nb_re_pdsch),
ue->nr_gold_pdsch[gNB_id][nr_slot_rx][symbol][0],
(int16_t*)&phase_per_symbol[symbol],
&ptrs_re_symbol[symbol]);
......@@ -1848,9 +1850,7 @@ void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
}
#ifdef DEBUG_DL_PTRS
LOG_M("ptrsEst.m","est",ptrs_phase_per_slot[aarx],frame_parms->symbols_per_slot,1,1 );
LOG_M("rxdataF_bf_ptrs_comp.m","bf_ptrs_cmp",
&rxdataF_comp[aarx][(*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb) ],
(*nb_rb) * NR_NB_SC_PER_RB * (*nbSymb),1,1);
LOG_M("rxdataF_bf_ptrs_comp.m", "bf_ptrs_cmp", rxdataF_comp[0][aarx] + (*startSymbIndex) * NR_NB_SC_PER_RB * (*nb_rb), (*nb_rb) * NR_NB_SC_PER_RB * (*nbSymb), 1, 1);
#endif
/*------------------------------------------------------------------------------------------------------- */
/* 3) Compensated DMRS based estimated signal with PTRS estimation */
......
......@@ -91,7 +91,8 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
unsigned short nb_rb_pdsch,
uint32_t pdsch_est_size,
int32_t dl_ch_estimates[][pdsch_est_size],
c16_t rxdataF[][ue->frame_parms.samples_per_slot_wCP]);
int rxdataFsize,
c16_t rxdataF[][rxdataFsize]);
void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
PHY_VARS_NR_UE *ue,
......@@ -123,10 +124,11 @@ void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue,
uint8_t gNB_id);
void nr_pdsch_ptrs_processing(PHY_VARS_NR_UE *ue,
int nbRx,
c16_t ptrs_phase_per_slot[][14],
int32_t ptrs_re_per_slot[][14],
uint32_t rx_size,
int32_t rxdataF_comp[][rx_size],
uint32_t rx_size_symbol,
int32_t rxdataF_comp[][nbRx][rx_size_symbol * NR_SYMBOLS_PER_SLOT],
NR_DL_FRAME_PARMS *frame_parms,
NR_DL_UE_HARQ_t *dlsch0_harq,
NR_DL_UE_HARQ_t *dlsch1_harq,
......
......@@ -598,7 +598,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
pdsch_nb_rb,
pdsch_est_size,
pdsch_dl_ch_estimates,
rxdataF);
ue->frame_parms.samples_per_slot_wCP, rxdataF);
#if 0
///LOG_M: the channel estimation
int nr_frame_rx = proc->frame_rx;
......@@ -635,35 +635,9 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
first_symbol_with_data++;
}
c16_t ptrs_phase_per_slot[ue->frame_parms.nb_antennas_rx][NR_SYMBOLS_PER_SLOT];
memset(ptrs_phase_per_slot, 0, ue->frame_parms.nb_antennas_rx*NR_SYMBOLS_PER_SLOT*sizeof(c16_t));
int32_t ptrs_re_per_slot[ue->frame_parms.nb_antennas_rx][NR_SYMBOLS_PER_SLOT];
memset(ptrs_re_per_slot, 0, ue->frame_parms.nb_antennas_rx*NR_SYMBOLS_PER_SLOT*sizeof(c16_t));
uint32_t dl_valid_re[NR_SYMBOLS_PER_SLOT] = {0};
uint32_t llr_offset[NR_SYMBOLS_PER_SLOT] = {0};
const uint32_t rx_size = ((NR_SYMBOLS_PER_SLOT * dlsch[0].dlsch_config.number_rbs * NR_NB_SC_PER_RB + 15) >> 4) << 4;
__attribute__ ((aligned(32))) int32_t dl_ch_estimates_ext[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
memset(dl_ch_estimates_ext, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
__attribute__ ((aligned(32))) int32_t rxdataF_ext[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
memset(rxdataF_ext, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
__attribute__ ((aligned(32))) int32_t rxdataF_comp[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
memset(rxdataF_comp, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
__attribute__ ((aligned(32))) int32_t dl_ch_mag[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
memset(dl_ch_mag, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
__attribute__ ((aligned(32))) int32_t dl_ch_magb[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
memset(dl_ch_magb, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
__attribute__ ((aligned(32))) int32_t dl_ch_magr[ue->frame_parms.nb_antennas_rx*dlsch0->Nl][rx_size];
memset(dl_ch_magr, 0, ue->frame_parms.nb_antennas_rx*dlsch0->Nl*rx_size*sizeof(int32_t));
int32_t log2_maxh = 0;
start_meas(&ue->rx_pdsch_stats);
for (m = s0; m < (s1 + s0); m++) {
......@@ -679,28 +653,7 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
start_meas(&ue->dlsch_llr_stats_parallelization[slot]);
// process DLSCH received symbols in the slot
// symbol by symbol processing (if data/DMRS are multiplexed is checked inside the function)
if (nr_rx_pdsch(ue,
proc,
dlsch,
m,
first_symbol_flag,
harq_pid,
pdsch_est_size,
pdsch_dl_ch_estimates,
llr,
ptrs_phase_per_slot,
ptrs_re_per_slot,
dl_valid_re,
rx_size,
dl_ch_estimates_ext,
rxdataF_ext,
rxdataF_comp,
dl_ch_mag,
dl_ch_magb,
dl_ch_magr,
rxdataF,
llr_offset,
&log2_maxh) < 0)
if (nr_rx_pdsch(ue, proc, dlsch, m, first_symbol_flag, harq_pid, pdsch_est_size, pdsch_dl_ch_estimates, llr, dl_valid_re, rxdataF, llr_offset, &log2_maxh) < 0)
return -1;
stop_meas(&ue->dlsch_llr_stats_parallelization[slot]);
......@@ -711,17 +664,6 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue,
}
} // CRNTI active
stop_meas(&ue->rx_pdsch_stats);
UEscopeCopy(ue, pdschRxdataF_comp, rxdataF_comp, sizeof(struct complex16), ue->frame_parms.nb_antennas_rx*dlsch0->Nl, rx_size);
if (ue->phy_sim_pdsch_rxdataF_comp)
memcpy(ue->phy_sim_pdsch_rxdataF_comp, rxdataF_comp, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
if (ue->phy_sim_pdsch_rxdataF_ext)
memcpy(ue->phy_sim_pdsch_rxdataF_ext, rxdataF_ext, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
if (ue->phy_sim_pdsch_dl_ch_estimates_ext)
memcpy(ue->phy_sim_pdsch_dl_ch_estimates_ext, dl_ch_estimates_ext, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
if (ue->phy_sim_pdsch_dl_ch_estimates)
memcpy(ue->phy_sim_pdsch_dl_ch_estimates, dl_ch_estimates_ext, sizeof(int32_t)*rx_size*ue->frame_parms.nb_antennas_rx*dlsch0->Nl);
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment