Commit b5eec87e authored by tct-labo4's avatar tct-labo4

Merge branch 'ue_slot0_slot1_parallelization_bis' into develop_integration_w30

parents 08b8b314 ed145f57
......@@ -4781,17 +4781,19 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
uint8_t NPRB = 0;
long long int RIV_max = 0;
#ifdef DEBUG_DCI
LOG_I(PHY,"[DCI-FORMAT-1-1A] AbsSubframe %d.%d dci_format %d\n", frame, subframe, dci_format);
LOG_I(PHY,"[DCI-FORMAT-1-1A] rnti %x\n", rnti);
LOG_I(PHY,"[DCI-FORMAT-1-1A] harq_pid %d\n", harq_pid);
LOG_I(PHY,"[DCI-FORMAT-1-1A] rah %d\n", rah);
LOG_I(PHY,"[DCI-FORMAT-1-1A] rballoc %x\n", rballoc);
LOG_I(PHY,"[DCI-FORMAT-1-1A] mcs1 %d\n", mcs1);
//LOG_I(PHY,"[DCI-FORMAT-1-1A] rv1 %d\n", rv1);
//LOG_I(PHY,"[DCI-FORMAT-1-1A] ndi1 %d\n", ndi1);
LOG_I(PHY,"[DCI-FORMAT-1-1A] TPC %d\n", TPC);
#ifdef DEBUG_DCI
LOG_I(PHY,"[DCI-FORMAT-1-1A] rv1 %d\n", rv1);
LOG_I(PHY,"[DCI-FORMAT-1-1A] ndi1 %d\n", ndi1);
#endif
LOG_I(PHY,"[DCI-FORMAT-1-1A] TPC %d\n", TPC);
// I- check dci content minimum coherency
if( ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) && harq_pid > 0)
......@@ -5131,10 +5133,70 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
return(1);
}
void compute_llr_offset(LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDCCH *pdcch_vars,
LTE_UE_PDSCH *pdsch_vars,
LTE_DL_UE_HARQ_t *dlsch0_harq,
uint8_t nb_rb_alloc,
uint8_t subframe)
{
uint32_t pbch_pss_sss_re;
uint32_t crs_re;
uint32_t granted_re;
uint32_t data_re;
uint32_t llr_offset;
uint8_t symbol;
uint8_t symbol_mod;
pdsch_vars->llr_offset[pdcch_vars->num_pdcch_symbols] = 0;
//LOG_I(PHY,"compute_llr_offset: nb RB %d - Qm %d \n", nb_rb_alloc, dlsch0_harq->Qm);
//dlsch0_harq->rb_alloc_even;
//dlsch0_harq->rb_alloc_odd;
for(symbol=pdcch_vars->num_pdcch_symbols; symbol<frame_parms->symbols_per_tti; symbol++)
{
symbol_mod = (symbol >= (7-frame_parms->Ncp))? (symbol-(7-frame_parms->Ncp)) : symbol;
if((symbol_mod == 0) || symbol_mod == (4-frame_parms->Ncp))
{
if (frame_parms->mode1_flag==0)
crs_re = 4;
else
crs_re = 2;
}
else
{
crs_re = 0;
}
granted_re = nb_rb_alloc * (12-crs_re);
pbch_pss_sss_re = adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,dlsch0_harq->Qm,subframe,symbol);
pbch_pss_sss_re = (double)pbch_pss_sss_re * ((double)(12-crs_re)/12);
data_re = granted_re - pbch_pss_sss_re;
llr_offset = data_re * dlsch0_harq->Qm * 2;
pdsch_vars->llr_length[symbol] = data_re;
if(symbol < (frame_parms->symbols_per_tti-1))
pdsch_vars->llr_offset[symbol+1] = pdsch_vars->llr_offset[symbol] + llr_offset;
//LOG_I(PHY,"Granted Re subframe %d / symbol %d => %d (%d RBs)\n", subframe, symbol_mod, granted_re,dlsch0_harq->nb_rb);
//LOG_I(PHY,"Pbch/PSS/SSS Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, pbch_pss_sss_re);
//LOG_I(PHY,"CRS Re Per PRB subframe %d / symbol %d => %d \n", subframe, symbol_mod, crs_re);
//LOG_I(PHY,"Data Re subframe %d / symbol %d => %d \n", subframe, symbol_mod, data_re);
//LOG_I(PHY,"Data Re subframe %d-symbol %d => llr length %d, llr offset %d \n", subframe, symbol,
// pdsch_vars->llr_length[symbol], pdsch_vars->llr_offset[symbol]);
}
}
void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
uint8_t N_RB_DL,
DCI_INFO_EXTRACTED_t *pdci_info_extarcted,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDCCH *pdcch_vars,
LTE_UE_PDSCH *pdsch_vars,
uint8_t subframe,
uint16_t rnti,
uint16_t tc_rnti,
......@@ -5156,12 +5218,27 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
uint8_t dai = pdci_info_extarcted->dai;
uint8_t NPRB = 0;
uint8_t nb_rb_alloc = 0;
if(dci_format == format1A)
{
if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti))
{
NPRB = (TPC&1) + 2;
switch (N_RB_DL) {
case 6:
nb_rb_alloc = RIV2nb_rb_LUT6[rballoc];//NPRB;
break;
case 25:
nb_rb_alloc = RIV2nb_rb_LUT25[rballoc];//NPRB;
break;
case 50:
nb_rb_alloc = RIV2nb_rb_LUT50[rballoc];//NPRB;
break;
case 100:
nb_rb_alloc = RIV2nb_rb_LUT100[rballoc];//NPRB;
break;
}
}
else
{
......@@ -5179,11 +5256,13 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
NPRB = RIV2nb_rb_LUT100[rballoc];//NPRB;
break;
}
nb_rb_alloc = NPRB;
}
}
else // format1
{
NPRB = conv_nprb(rah, rballoc, N_RB_DL);
nb_rb_alloc = NPRB;
}
pdlsch0->current_harq_pid = harq_pid;
......@@ -5221,14 +5300,14 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
if (pdlsch0_harq->status == SCH_IDLE)
//packet was actually decoded in previous transmission (ACK was missed by eNB)
//However, the round is not a good check as it might have been decoded in a retransmission prior to this one.
{
LOG_D(PHY,"skip pdsch decoding and report ack\n");
// skip pdsch decoding and report ack
{
LOG_D(PHY,"skip pdsch decoding and report ack\n");
// skip pdsch decoding and report ack
//pdlsch0_harq->status = SCH_IDLE;
pdlsch0->active = 0;
pdlsch0->harq_ack[subframe].ack = 1;
pdlsch0->harq_ack[subframe].harq_id = harq_pid;
pdlsch0->harq_ack[subframe].send_harq_status = 1;
pdlsch0->active = 0;
pdlsch0->harq_ack[subframe].ack = 1;
pdlsch0->harq_ack[subframe].harq_id = harq_pid;
pdlsch0->harq_ack[subframe].send_harq_status = 1;
//pdlsch0_harq->first_tx = 0;
}
......@@ -5236,7 +5315,7 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
{
// nothing special to do
}
}
}
}
pdlsch0_harq->DCINdi = ndi1;
......@@ -5346,7 +5425,6 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
pdlsch0_harq->rb_alloc_odd[2]= pdlsch0_harq->rb_alloc_even[2];
pdlsch0_harq->rb_alloc_odd[3]= pdlsch0_harq->rb_alloc_even[3];
}
if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti))
{
pdlsch0_harq->TBS = TBStable[mcs1][NPRB-1];
......@@ -5360,11 +5438,20 @@ void prepare_dl_decoding_format1_1A(DCI_format_t dci_format,
pdlsch0_harq->Qm = get_Qm(mcs1);
}
}
compute_llr_offset(frame_parms,
pdcch_vars,
pdsch_vars,
pdlsch0_harq,
nb_rb_alloc,
subframe);
}
void prepare_dl_decoding_format1C(uint8_t N_RB_DL,
DCI_INFO_EXTRACTED_t *pdci_info_extarcted,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDCCH *pdcch_vars,
LTE_UE_PDSCH *pdsch_vars,
uint32_t rnti,
uint32_t si_rnti,
uint32_t ra_rnti,
......@@ -5467,6 +5554,14 @@ void prepare_dl_decoding_format1C(uint8_t N_RB_DL,
AssertFatal(0,"Format 1C: Unknown N_RB_DL %d\n",frame_parms->N_RB_DL);
break;
}
compute_llr_offset(frame_parms,
pdcch_vars,
pdsch_vars,
pdlsch0_harq,
pdlsch0_harq->nb_rb,
subframe);
}
void compute_precoding_info_2cw(uint8_t tpmi, uint8_t tbswap, uint16_t pmi_alloc, LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_UE_HARQ_t *dlsch0_harq, LTE_DL_UE_HARQ_t *dlsch1_harq)
......@@ -5536,10 +5631,10 @@ switch (tpmi) {
dlsch_harq->pmi_alloc = pmi_alloc;//pmi_convert(frame_parms,dlsch0->pmi_alloc,1);
break;
}
#ifdef DEBUG_HARQ
#ifdef DEBUG_HARQ
printf ("[DCI UE] I am calling from the UE side pmi_alloc_new = %d with tpmi %d\n", dlsch_harq->pmi_alloc, tpmi);
#endif
}
#endif
}
void compute_precoding_info_format2A(uint8_t tpmi,
uint8_t nb_antenna_ports_eNB,
......@@ -5640,6 +5735,8 @@ void compute_precoding_info_format2A(uint8_t tpmi,
void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
DCI_INFO_EXTRACTED_t *pdci_info_extarcted,
LTE_DL_FRAME_PARMS *frame_parms,
LTE_UE_PDCCH *pdcch_vars,
LTE_UE_PDSCH *pdsch_vars,
uint16_t rnti,
uint8_t subframe,
LTE_DL_UE_HARQ_t *dlsch0_harq,
......@@ -5819,7 +5916,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
if (TB0_active) {
// printf("TB0 ndi1 =%d, dlsch0_harq->DCINdi =%d, dlsch0_harq->first_tx = %d\n", ndi1, dlsch0_harq->DCINdi, dlsch0_harq->first_tx);
if ((ndi1!=dlsch0_harq->DCINdi) || (dlsch0_harq->first_tx==1)) {
dlsch0_harq->round = 0;
dlsch0_harq->round = 0;
dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi1;
......@@ -5834,12 +5931,12 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
//NDI has not been toggled but rv was increased by eNB: retransmission
{
if(dlsch0_harq->status == SCH_IDLE) {
// skip pdsch decoding and report ack
// skip pdsch decoding and report ack
//dlsch0_harq->status = SCH_IDLE;
pdlsch0->active = 0;
pdlsch0->harq_ack[subframe].ack = 1;
pdlsch0->harq_ack[subframe].harq_id = harq_pid;
pdlsch0->harq_ack[subframe].send_harq_status = 1;
pdlsch0->active = 0;
pdlsch0->harq_ack[subframe].ack = 1;
pdlsch0->harq_ack[subframe].harq_id = harq_pid;
pdlsch0->harq_ack[subframe].send_harq_status = 1;
}*/
// if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest
......@@ -5882,13 +5979,13 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
//NDI has not been toggled but rv was increased by eNB: retransmission
{
if(dlsch1_harq->status == SCH_IDLE) {
// skip pdsch decoding and report ack
// skip pdsch decoding and report ack
//dlsch1_harq->status = SCH_IDLE;
pdlsch1->active = 0;
pdlsch1->harq_ack[subframe].ack = 1;
pdlsch1->harq_ack[subframe].harq_id = harq_pid;
pdlsch1->harq_ack[subframe].send_harq_status = 1;
}
pdlsch1->active = 0;
pdlsch1->harq_ack[subframe].ack = 1;
pdlsch1->harq_ack[subframe].harq_id = harq_pid;
pdlsch1->harq_ack[subframe].send_harq_status = 1;
}
}*/
// if Imcs in [29..31] TBS is assumed to be as determined from DCI transported in the latest
......@@ -5911,7 +6008,16 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
}
compute_llr_offset(frame_parms,
pdcch_vars,
pdsch_vars,
dlsch0_harq,
dlsch0_harq->nb_rb,
subframe);
/* #ifdef DEBUG_HARQ
printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status);
printf("[DCI UE]: TB0_active %d , TB1_active %d\n", TB0_active, TB1_active);
if (dlsch0 != NULL && dlsch1 != NULL)
printf("[DCI UE] dlsch0_harq status = %d, dlsch1_harq status = %d\n", dlsch0_harq->status, dlsch1_harq->status);
......@@ -5927,6 +6033,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
void *dci_pdu,
uint16_t rnti,
DCI_format_t dci_format,
LTE_UE_PDCCH *pdcch_vars,
LTE_UE_PDSCH *pdsch_vars,
LTE_UE_DLSCH_t **dlsch,
LTE_DL_FRAME_PARMS *frame_parms,
PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
......@@ -5938,10 +6046,10 @@ int generate_ue_dlsch_params_from_dci(int frame,
{
uint8_t harq_pid=0;
uint8_t frame_type=frame_parms->frame_type;
uint8_t tpmi=0;
LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL;
LTE_DL_UE_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
uint8_t frame_type=frame_parms->frame_type;
uint8_t tpmi=0;
LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL;
LTE_DL_UE_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
DCI_INFO_EXTRACTED_t dci_info_extarcted;
uint8_t status=0;
......@@ -6006,16 +6114,21 @@ int generate_ue_dlsch_params_from_dci(int frame,
&dci_info_extarcted,
dlsch0_harq);
if(status == 0)
{
printf("bad DCI 1A !!! \n");
return(-1);
}
// dci is correct ==> update internal structure and prepare dl decoding
#ifdef DEBUG_DCI
//#ifdef DEBUG_DCI
LOG_I(PHY,"[DCI-FORMAT-1A] AbsSubframe %d.%d prepare dl decoding \n", frame, subframe);
#endif
//#endif
prepare_dl_decoding_format1_1A(format1A,
frame_parms->N_RB_DL,
&dci_info_extarcted,
frame_parms,
pdcch_vars,
pdsch_vars,
subframe,
rnti,
tc_rnti,
......@@ -6066,6 +6179,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
prepare_dl_decoding_format1C(frame_parms->N_RB_DL,
&dci_info_extarcted,
frame_parms,
pdcch_vars,
pdsch_vars,
rnti,
si_rnti,
ra_rnti,
......@@ -6107,16 +6222,22 @@ int generate_ue_dlsch_params_from_dci(int frame,
&dci_info_extarcted,
dlsch0_harq);
if(status == 0)
return(-1);
{
printf("bad DCI 1 !!! \n");
return(-1);
}
// dci is correct ==> update internal structure and prepare dl decoding
#ifdef DEBUG_DCI
//#ifdef DEBUG_DCI
LOG_I(PHY,"[DCI-FORMAT-1] AbsSubframe %d.%d prepare dl decoding \n", frame, subframe);
#endif
//#endif
prepare_dl_decoding_format1_1A(format1,
frame_parms->N_RB_DL,
&dci_info_extarcted,
frame_parms,
pdcch_vars,
pdsch_vars,
subframe,
rnti,
tc_rnti,
......@@ -6130,7 +6251,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
case format2:
{
//extract dci infomation
// extract dci infomation
//LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame, subframe);
extract_dci2_info(frame_parms->N_RB_DL,
frame_type,
......@@ -6143,8 +6264,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch[0]->active = 1;
dlsch[1]->active = 1;
dlsch0 = dlsch[0];
dlsch1 = dlsch[1];
dlsch0 = dlsch[0];
dlsch1 = dlsch[1];
dlsch0_harq = dlsch0->harq_processes[dci_info_extarcted.harq_pid];
dlsch1_harq = dlsch1->harq_processes[dci_info_extarcted.harq_pid];
......@@ -6171,13 +6292,15 @@ int generate_ue_dlsch_params_from_dci(int frame,
prepare_dl_decoding_format2_2A(format2,
&dci_info_extarcted,
frame_parms,
pdcch_vars,
pdsch_vars,
rnti,
subframe,
dlsch0_harq,
dlsch1_harq,
dlsch0,
dlsch1);
}
}
break;
case format2A:
......@@ -6224,6 +6347,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
prepare_dl_decoding_format2_2A(format2A,
&dci_info_extarcted,
frame_parms,
pdcch_vars,
pdsch_vars,
rnti,
subframe,
dlsch0_harq,
......@@ -6231,7 +6356,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0,
dlsch1);
}
break;
break;
case format1E_2A_M10PRB:
if (!dlsch[0]) return -1;
......
......@@ -89,6 +89,7 @@ extern void print_shorts(char *s,int16_t *x);
int rx_pdsch(PHY_VARS_UE *ue,
UE_rxtx_proc_t *proc,
PDSCH_t type,
unsigned char eNB_id,
unsigned char eNB_id_i, //if this == ue->n_connected_eNB, we assume MU interference
......@@ -111,10 +112,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
int avg_0[2];
int avg_1[2];
uint8_t slot = 0;
unsigned char aatx,aarx;
unsigned short nb_rb = 0, round;
int avgs, rb;
int avgs = 0, rb;
LTE_DL_UE_HARQ_t *dlsch0_harq,*dlsch1_harq = 0;
uint8_t beamforming_mode;
......@@ -247,6 +250,11 @@ int rx_pdsch(PHY_VARS_UE *ue,
return(-1);
}
}
if(symbol > ue->frame_parms.symbols_per_tti>>1)
{
slot = 1;
}
#ifdef DEBUG_HARQ
printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc);
#endif
......@@ -256,6 +264,9 @@ int rx_pdsch(PHY_VARS_UE *ue,
LOG_I(PHY,"dlsch: using pmi %x (%p), rb_alloc %x\n",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),dlsch[0],dlsch0_harq->rb_alloc_even[0]);
#endif
#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#endif
nb_rb = dlsch_extract_rbs_dual(common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].rxdataF,
common_vars->common_vars_rx_data_per_thread[subframe%RX_NB_TH].dl_ch_estimates[eNB_id],
pdsch_vars[eNB_id]->rxdataF_ext,
......@@ -363,12 +374,20 @@ int rx_pdsch(PHY_VARS_UE *ue,
return(-1);
}
#ifdef DEBUG_PHY
LOG_D(PHY,"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)\n",nb_rb,pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,
symbol,ue->high_speed_flag,type,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d Flag %d type %d: Pilot/Data extraction %5.2f \n",frame,subframe,slot,symbol,
ue->high_speed_flag,type,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#endif
#endif
#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#endif
aatx = frame_parms->nb_antenna_ports_eNB;
aarx = frame_parms->nb_antennas_rx;
......@@ -391,6 +410,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
nb_rb);
}
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#endif
#endif
#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#endif
if (first_symbol_flag==1) {
if (beamforming_mode==0){
if (dlsch0_harq->mimo_mode<LARGE_CDD) {
......@@ -481,6 +512,16 @@ int rx_pdsch(PHY_VARS_UE *ue,
avg[0],avgs);
//LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
#endif
//wait until pdcch is decoded
proc->channel_level = 1;
}
uint32_t wait = 0;
while(proc->channel_level == 0)
{
usleep(1);
wait++;
}
#if T_TRACER
......@@ -491,6 +532,19 @@ int rx_pdsch(PHY_VARS_UE *ue,
}
#endif
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,subframe,slot,symbol,first_symbol_flag,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#endif
#endif
#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#endif
// Now channel compensation
if (dlsch0_harq->mimo_mode<LARGE_CDD) {
dlsch_channel_compensation(pdsch_vars[eNB_id]->rxdataF_ext,
......@@ -685,8 +739,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
measurements); // log2_maxh+I0_shift
}
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n",frame,subframe,slot,symbol,pdsch_vars[eNB_id]->log2_maxh,proc->channel_level,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#endif
#endif
// MRC
#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#endif
if (frame_parms->nb_antennas_rx > 1) {
if ((dlsch0_harq->mimo_mode == LARGE_CDD) ||
......@@ -754,31 +818,59 @@ int rx_pdsch(PHY_VARS_UE *ue,
//i_mod should have been passed as a parameter
}
#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %d.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,subframe,slot,symbol,ue->generic_stat_bis[subframe%RX_NB_TH][slot].p_time/(cpuf*1000.0));
#endif
#endif
#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[subframe%RX_NB_TH][slot]);
#endif
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
// compute LLRs
// -> // compute @pointer where llrs should filled for this ofdm-symbol
int8_t *pllr_symbol_cw0;
int8_t *pllr_symbol_cw1;
uint32_t llr_offset_symbol;
llr_offset_symbol = pdsch_vars[eNB_id]->llr_offset[symbol];
pllr_symbol_cw0 = (int8_t*)pdsch_vars[eNB_id]->llr[0];
pllr_symbol_cw1 = (int8_t*)pdsch_vars[eNB_id]->llr[1];
pllr_symbol_cw0 += llr_offset_symbol;
pllr_symbol_cw1 += llr_offset_symbol;
/*LOG_I(PHY,"compute LLRs [AbsSubframe %d.%d-%d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
proc->frame_rx, proc->subframe_rx,symbol,
nb_rb,dlsch0_harq->Qm,
pdsch_vars[eNB_id]->llr_length[symbol],
pdsch_vars[eNB_id]->llr_offset[symbol],
(int16_t*)pdsch_vars[eNB_id]->llr[0],
pllr_symbol);*/
switch (dlsch0_harq->Qm) {
case 2 :
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
(int16_t*)pllr_symbol_cw0,
symbol,
first_symbol_flag,
nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
} else if (codeword_TB0 == -1){
dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[1],
(int16_t*)pllr_symbol_cw1,
symbol,
first_symbol_flag,
nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream,
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
......@@ -945,22 +1037,22 @@ int rx_pdsch(PHY_VARS_UE *ue,
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
(int16_t*)pllr_symbol_cw0,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol),
pdsch_vars[eNB_id]->llr128,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
} else if (codeword_TB0 == -1){
dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[1],
(int16_t*)pllr_symbol_cw1,
pdsch_vars[eNB_id]->dl_ch_mag0,
pdsch_vars[eNB_id]->dl_ch_magb0,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream,
pdsch_vars[eNB_id]->llr_offset[symbol],
beamforming_mode);
}
else if (rx_type >= rx_IC_single_stream) {
......@@ -1017,10 +1109,10 @@ int rx_pdsch(PHY_VARS_UE *ue,
pdsch_vars[eNB_id]->dl_ch_mag0,
dl_ch_mag_ptr,//i
pdsch_vars[eNB_id]->dl_ch_rho2_ext,
pdsch_vars[eNB_id]->llr[0],
(int16_t*)pllr_symbol_cw0,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,6,subframe,symbol),
pdsch_vars[eNB_id]->llr128);
pdsch_vars[eNB_id]->llr_offset[symbol]);
if (rx_type==rx_IC_dual_stream) {
dlsch_64qam_64qam_llr(frame_parms,
rxdataF_comp_ptr,
......@@ -1028,10 +1120,10 @@ int rx_pdsch(PHY_VARS_UE *ue,
dl_ch_mag_ptr,
pdsch_vars[eNB_id]->dl_ch_mag0,//i
pdsch_vars[eNB_id]->dl_ch_rho_ext[harq_pid][round],
pdsch_vars[eNB_id]->llr[1],
(int16_t*)pllr_symbol_cw1,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch1_harq->rb_alloc_even,6,subframe,symbol),
pdsch_vars[eNB_id]->llr128_2ndstream);
pdsch_vars[eNB_id]->llr_offset[symbol]);
}
}
}
......@@ -1047,10 +1139,9 @@ int rx_pdsch(PHY_VARS_UE *ue,
if (rx_type==rx_standard) {
dlsch_qpsk_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,
pdsch_vars[eNB_id]->llr[0],
(int16_t*)pllr_symbol_cw0,
symbol,first_symbol_flag,nb_rb,
adjust_G2(frame_parms,dlsch0_harq->rb_alloc_even,2,subframe,symbol),
pdsch_vars[eNB_id]->llr128,
beamforming_mode);
}
break;
......@@ -1070,12 +1161,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
if (rx_type==rx_standard) {
dlsch_64qam_llr(frame_parms,
pdsch_vars[eNB_id]->rxdataF_comp0,