Commit 29e058df authored by Hongzhi Wang's avatar Hongzhi Wang

ue pdsch config from fapi removing hardcoded values

parent 2da6fb8e
......@@ -235,10 +235,12 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t kc;
uint8_t Ilbrm = 0;
uint32_t Tbslbrm = 950984;
uint16_t nb_rb = 30; //to update
uint8_t nb_re_dmrs = 6;
uint16_t length_dmrs = 1;
uint16_t nb_rb = 30;
double Coderate = 0.0;
nfapi_nr_config_request_t *cfg = &phy_vars_ue->nrUE_config;
uint8_t dmrs_type = cfg->pdsch_config.dmrs_type.value;
uint8_t nb_re_dmrs = (dmrs_type==NFAPI_NR_DMRS_TYPE1)?6:4;
uint16_t length_dmrs = 1; //cfg->pdsch_config.dmrs_max_length.value;
uint32_t i,j;
......
......@@ -632,6 +632,7 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint8_t beamforming_mode)
......@@ -639,7 +640,7 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
uint32_t *rxF = (uint32_t*)&rxdataF_comp[0][((int32_t)symbol*nb_rb*12)];
uint32_t *llr32;
int i,len;
int i;
llr32 = (uint32_t*)dlsch_llr;
if (!llr32) {
......@@ -647,10 +648,6 @@ int nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
return(-1);
}
if (symbol ==2) //to update from config
len = nb_rb*6;
else
len = nb_rb*12;
/*
LOG_I(PHY,"dlsch_qpsk_llr: [symb %d / Length %d]: @LLR Buff %x, @LLR Buff(symb) %x \n",
symbol,
......@@ -677,6 +674,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
int16_t **llr32p,
......@@ -696,7 +694,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
#endif
int i,len;
int i;
unsigned char len_mod4=0;
......@@ -720,11 +718,6 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
ch_mag = (int16x8_t*)&dl_ch_mag[0][(symbol*nb_rb*12)];
#endif
if (symbol ==2) //to update from config
len = nb_rb*6;
else
len = nb_rb*12;
// update output pointer according to number of REs in this symbol (<<2 because 4 bits per RE)
if (first_symbol_flag == 1)
*llr32p = dlsch_llr + (len<<2);
......@@ -798,6 +791,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **dl_ch_mag,
int32_t **dl_ch_magb,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint32_t llr_offset,
......@@ -810,7 +804,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int16x8_t *rxF = (int16x8_t*)&rxdataF_comp[0][(symbol*nb_rb*12)];
int16x8_t *ch_mag,*ch_magb,xmm1,xmm2;
#endif
int i,len,len2;
int i,len2;
unsigned char len_mod4;
short *llr;
int16_t *llr2;
......@@ -835,11 +829,6 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
ch_magb = (int16x8_t*)&dl_ch_magb[0][(symbol*frame_parms->N_RB_DL*12)];
#endif
if (symbol ==2) //to update from config
len = nb_rb*6;
else
len = nb_rb*12;
// printf("nr_dlsch_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
/* LOG_I(PHY,"nr_dlsch_64qam_llr [symb %d / FirstSym %d / Length %d]: @LLR Buff %x \n",
......@@ -1131,6 +1120,7 @@ int nr_dlsch_qpsk_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int **rho_i,
short *dlsch_llr,
unsigned char symbol,
uint32_t len,
unsigned char first_symbol_flag,
unsigned short nb_rb,
uint16_t pbch_pss_sss_adjust,
......@@ -1141,8 +1131,6 @@ int nr_dlsch_qpsk_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int16_t *rxF_i=(int16_t*)&rxdataF_comp_i[0][(symbol*nb_rb*12)];
int16_t *rho=(int16_t*)&rho_i[0][(symbol*nb_rb*12)];
int16_t *llr16;
int len;
//uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
if (first_symbol_flag == 1) {
llr16 = (int16_t*)dlsch_llr;
......@@ -1152,11 +1140,6 @@ int nr_dlsch_qpsk_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
AssertFatal(llr16!=NULL,"nr_dlsch_qpsk_qpsk_llr: llr is null, symbol %d\n",symbol);
if (symbol ==2) //to update from config
len = nb_rb*6;
else
len = nb_rb*12;
// printf("nr_dlsch_qpsk_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
// printf("qpsk_qpsk: len %d, llr16 %p\n",len,llr16);
qpsk_qpsk((short *)rxF,
......@@ -2972,6 +2955,7 @@ int nr_dlsch_16qam_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rho_i,
int16_t *dlsch_llr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
......@@ -2984,8 +2968,6 @@ int nr_dlsch_16qam_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*nb_rb*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*nb_rb*12)];
int16_t *llr16;
int len;
//uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
// first symbol has different structure due to more pilots
if (first_symbol_flag == 1) {
......@@ -2997,11 +2979,6 @@ int nr_dlsch_16qam_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
AssertFatal(llr16!=NULL,"nr_dlsch_16qam_16qam_llr: llr is null, symbol %d\n",symbol);
if (symbol ==2) //to update from config
len = nb_rb*6;
else
len = nb_rb*12;
// printf("symbol %d: qam16_llr, len %d (llr16 %p)\n",symbol,len,llr16);
qam16_qam16((short *)rxF,
......@@ -8514,6 +8491,7 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rho_i,
int16_t *dlsch_llr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adjust,
......@@ -8521,15 +8499,13 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
uint32_t llr_offset)
{
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*frame_parms->N_RB_DL*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*frame_parms->N_RB_DL*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*frame_parms->N_RB_DL*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*frame_parms->N_RB_DL*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*frame_parms->N_RB_DL*12)];
int16_t *rxF = (int16_t*)&rxdataF_comp[0][(symbol*nb_rb*12)];
int16_t *rxF_i = (int16_t*)&rxdataF_comp_i[0][(symbol*nb_rb*12)];
int16_t *ch_mag = (int16_t*)&dl_ch_mag[0][(symbol*nb_rb*12)];
int16_t *ch_mag_i = (int16_t*)&dl_ch_mag_i[0][(symbol*nb_rb*12)];
int16_t *rho = (int16_t*)&rho_i[0][(symbol*nb_rb*12)];
int16_t *llr16;
int8_t *pllr_symbol; // pointer where llrs should filled for this ofdm symbol
int len;
uint8_t symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
//first symbol has different structure due to more pilots
/*if (first_symbol_flag == 1) {
......@@ -8543,19 +8519,6 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
AssertFatal(llr16!=NULL,"nr_dlsch_16qam_64qam_llr:llr is null, symbol %d\n",symbol);
if ((symbol_mod==0) || (symbol_mod==(4-frame_parms->Ncp))) {
// if symbol has pilots
if (frame_parms->nb_antenna_ports_eNB!=1)
// in 2 antenna ports we have 8 REs per symbol per RB
len = (nb_rb*8) - (2*pbch_pss_sss_adjust/3);
else
// for 1 antenna port we have 10 REs per symbol per RB
len = (nb_rb*10) - (5*pbch_pss_sss_adjust/6);
} else {
// symbol has no pilots
len = (nb_rb*12) - pbch_pss_sss_adjust;
}
pllr_symbol = (int8_t*)dlsch_llr;
pllr_symbol += llr_offset;
//printf("nr_dlsch_64qam_64qam_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust);
......
......@@ -113,6 +113,7 @@ int32_t nr_dlsch_qpsk_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rho_i,
int16_t *dlsch_llr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint16_t pbch_pss_sss_adj,
......@@ -268,6 +269,7 @@ int nr_dlsch_16qam_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int **rho_i,
short *dlsch_llr,
unsigned char symbol,
uint32_t len,
unsigned char first_symbol_flag,
unsigned short nb_rb,
uint16_t pbch_pss_sss_adjust,
......@@ -464,6 +466,7 @@ int nr_dlsch_64qam_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int **rho_i,
short *dlsch_llr,
unsigned char symbol,
uint32_t len,
unsigned char first_symbol_flag,
unsigned short nb_rb,
uint16_t pbch_pss_sss_adjust,
......@@ -486,6 +489,7 @@ int32_t nr_dlsch_qpsk_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
int16_t *dlsch_llr,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint8_t beamforming_mode);
......@@ -520,6 +524,7 @@ void nr_dlsch_16qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int16_t *dlsch_llr,
int32_t **dl_ch_mag,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
int16_t **llr32p,
......@@ -568,6 +573,7 @@ void nr_dlsch_64qam_llr(NR_DL_FRAME_PARMS *frame_parms,
int32_t **dl_ch_mag,
int32_t **dl_ch_magb,
uint8_t symbol,
uint32_t len,
uint8_t first_symbol_flag,
uint16_t nb_rb,
uint32_t llr_offset,
......@@ -722,8 +728,8 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
int **dl_ch_estimates_ext,
unsigned short pmi,
unsigned char *pmi_ext,
unsigned int *rb_alloc,
unsigned char symbol,
uint8_t pilots,
unsigned short start_rb,
unsigned short nb_pdsch_rb,
unsigned char nr_tti_rx,
......@@ -759,8 +765,8 @@ unsigned short nr_dlsch_extract_rbs_dual(int **rxdataF,
int **dl_ch_estimates_ext,
unsigned short pmi,
unsigned char *pmi_ext,
unsigned int *rb_alloc,
unsigned char symbol,
uint8_t pilots,
unsigned short start_rb,
unsigned short nb_rb_pdsch,
unsigned char nr_tti_rx,
......@@ -822,6 +828,7 @@ void nr_dlsch_channel_compensation(int32_t **rxdataF_ext,
int32_t **rho,
NR_DL_FRAME_PARMS *frame_parms,
uint8_t symbol,
uint8_t start_symbol,
uint8_t first_symbol_flag,
uint8_t mod_order,
uint16_t nb_rb,
......@@ -842,6 +849,7 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
int start_point);
void nr_dlsch_deinterleaving(uint8_t symbol,
uint8_t start_symbol,
uint16_t L,
uint16_t *llr,
uint16_t *llr_deint,
......@@ -974,11 +982,12 @@ void dlsch_channel_compensation_TM34(NR_DL_FRAME_PARMS *frame_parms,
@param pilots_flag Flag to indicate pilots in symbol
@param nb_rb Number of allocated RBs
*/
void nr_dlsch_channel_level(int32_t **dl_ch_estimates_ext,
void nr_dlsch_channel_level(int **dl_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms,
int32_t *avg,
uint8_t pilots_flag,
uint16_t nb_rb);
uint8_t symbol,
uint32_t len,
unsigned short nb_rb);
void dlsch_channel_level_TM34(int **dl_ch_estimates_ext,
......@@ -1007,7 +1016,8 @@ void dlsch_channel_level_TM7(int32_t **dl_bf_ch_estimates_ext,
void nr_dlsch_scale_channel(int32_t **dl_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms,
NR_UE_DLSCH_t **dlsch_ue,
uint8_t symbol_mod,
uint8_t symbol,
uint8_t start_symbol,
uint16_t nb_rb);
/** \brief This is the top-level entry point for DLSCH decoding in UE. It should be replicated on several
......
......@@ -916,6 +916,7 @@ typedef struct {
NR_UE_COMMON common_vars;
nr_ue_if_module_t *if_inst;
nfapi_nr_config_request_t nrUE_config;
nr_downlink_indication_t dl_indication;
nr_uplink_indication_t ul_indication;
......
......@@ -123,7 +123,10 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
dlsch0_harq->harq_ack.pucch_resource_indicator = dlsch_config_pdu->pucch_resource_id;
dlsch0_harq->harq_ack.slot_for_feedback_ack = dlsch_config_pdu->pdsch_to_harq_feedback_time_ind;
dlsch0_harq->Nl=1;
dlsch0_harq->status = ACTIVE;
LOG_D(MAC,">>>> \tdlsch0->g_pucch=%d\tdlsch0_harq.mcs=%d\n",dlsch0->g_pucch,dlsch0_harq->mcs);
}
}
}else{
......
......@@ -3784,9 +3784,10 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
NR_UE_PDSCH *pdsch_vars;
uint8_t is_cw0_active = 0;
uint8_t is_cw1_active = 0;
// to be updated by higher layer
uint8_t nb_re_dmrs = 6;
uint16_t length_dmrs = 1;
nfapi_nr_config_request_t *cfg = &ue->nrUE_config;
uint8_t dmrs_type = cfg->pdsch_config.dmrs_type.value;
uint8_t nb_re_dmrs = (dmrs_type==NFAPI_NR_DMRS_TYPE1)?6:4;
uint16_t length_dmrs = 1; //cfg->pdsch_config.dmrs_max_length.value;
uint16_t nb_symb_sch = 9;
if (dlsch0==NULL)
......@@ -3794,6 +3795,7 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
harq_pid = dlsch0->current_harq_pid;
is_cw0_active = dlsch0->harq_processes[harq_pid]->status;
nb_symb_sch = dlsch0->harq_processes[harq_pid]->nb_symbols;
if(dlsch1)
is_cw1_active = dlsch1->harq_processes[harq_pid]->status;
......@@ -3908,7 +3910,7 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
nb_symb_sch,
nr_tti_rx,
harq_pid,
pdsch==PDSCH?1:0,//proc->decoder_switch,
pdsch==PDSCH?1:0,
dlsch0->harq_processes[harq_pid]->TBS>256?1:0);
//printf("start cW0 dlsch decoding\n");
#endif
......@@ -4324,11 +4326,13 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
int l,l2;
int pilot1;
int frame_rx = proc->frame_rx;
int nr_tti_rx = proc->nr_tti_rx;
NR_UE_PDCCH *pdcch_vars = ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][0];
uint16_t nb_symb_sch = 9; // to be updated by higher layer
NR_UE_DLSCH_t **dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id];
uint8_t harq_pid = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->current_harq_pid;
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
uint16_t nb_symb_sch = dlsch0_harq->nb_symbols;
uint8_t nb_symb_pdcch = pdcch_vars->coreset[0].duration;
uint8_t dci_cnt = 0;
......
......@@ -1087,7 +1087,7 @@ int8_t nr_ue_process_dci_freq_dom_resource_assignment(
start_RB = riv%n_RB_DLBWP;
// if (l_RB - 1) > floor (n_RB_DLBWP/2) we need to recalculate them using the following lines
tmp_RIV = n_RB_DLBWP * (l_RB - 1) + start_RB;
if (tmp_RIV != riv) { // then (l_RB - 1) > floor (n_RB_DLBWP/2) and we need to recalculate l_RB and start_RB
if ((tmp_RIV != riv) || ((start_RB+l_RB)>n_RB_DLBWP)) { // then (l_RB - 1) > floor (n_RB_DLBWP/2) and we need to recalculate l_RB and start_RB
l_RB = n_RB_DLBWP - l_RB + 2;
start_RB = n_RB_DLBWP - start_RB - 1;
}
......
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