Commit ff6d41b6 authored by Bilel's avatar Bilel
Browse files

[OAI-UE] Mimo feature

parent 5c375d3a
......@@ -51,10 +51,10 @@ int lte_dl_bf_channel_estimation(PHY_VARS_UE *phy_vars_ue,
int uespec_pilot[300];
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms;
LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch[eNB_id];
LTE_UE_DLSCH_t **dlsch_ue = phy_vars_ue->dlsch[(Ns>>1)&0x1][eNB_id];
LTE_DL_UE_HARQ_t *dlsch0_harq;
harq_pid = dlsch_ue[0]->current_harq_pid;
harq_pid = dlsch_ue[0]->current_harq_pid;
dlsch0_harq = dlsch_ue[0]->harq_processes[harq_pid];
if (((frame_parms->Ncp == NORMAL) && (symbol>=7)) ||
......
......@@ -2893,15 +2893,15 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
break;
case 2:
*CCEmap|=(0x03<<(CCEind&0x1f));
*CCEmap|=(1<<(CCEind&0x1f));
break;
case 4:
*CCEmap|=(0x0f<<(CCEind&0x1f));
*CCEmap|=(1<<(CCEind&0x1f));
break;
case 8:
*CCEmap|=(0xff<<(CCEind&0x1f));
*CCEmap|=(1<<(CCEind&0x1f));
break;
}
......@@ -3518,7 +3518,9 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
} else if (tmode == 3) {
LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1\n");
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3527,7 +3529,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
P_RNTI,
0,
format1A,
format1A,
......@@ -3542,14 +3544,18 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap1,
&CCEmap2);
LOG_D(PHY," format 2A_2A search CCEmap0 %x, format0_found %d, format_c_found %d \n", CCEmap0, format0_found, format_c_found);
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
LOG_D(PHY," format 2A_2A search dci_cnt %d, old_dci_cn t%d \n", dci_cnt, old_dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
// Now check UE_SPEC format 2 search spaces at aggregation 2
LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 2\n");
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3577,10 +3583,13 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
LOG_D(PHY," format 2A_2A search dci_cnt %d, old_dci_cn t%d \n", dci_cnt, old_dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 4 \n");
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3589,7 +3598,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
mi,
SI_RNTI,
ra_rnti,
P_RNTI,
P_RNTI,
2,
format1A,
format1A,
......@@ -3608,11 +3617,14 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
LOG_D(PHY," format 2A_2A search dci_cnt %d, old_dci_cn t%d \n", dci_cnt, old_dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
//#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 8 \n");
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3636,9 +3648,17 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap1,
&CCEmap2);
//#endif
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
LOG_D(PHY," format 2A_2A search dci_cnt %d, old_dci_cn t%d \n", dci_cnt, old_dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
} else if (tmode == 4) {
// Now check UE_SPEC format 2_2A search spaces at aggregation 1
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3670,6 +3690,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt);
// Now check UE_SPEC format 2 search spaces at aggregation 2
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3701,6 +3722,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt);
// Now check UE_SPEC format 2_2A search spaces at aggregation 4
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3733,6 +3755,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
//#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 2_2A search spaces at aggregation 8
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3762,6 +3785,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
#ifdef DEBUG_DCI_DECODING
LOG_I(PHY," MU-MIMO check UE_SPEC format 1E_2A_M10PRB\n");
#endif
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3794,6 +3818,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt);
// Now check UE_SPEC format 1E_2A_M10PRB search spaces aggregation 2
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3825,6 +3850,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt);
// Now check UE_SPEC format 1E_2A_M10PRB search spaces aggregation 4
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......@@ -3858,6 +3884,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
//#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 1E_2A_M10PRB search spaces at aggregation 8
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
......
......@@ -4769,10 +4769,12 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
uint8_t harq_pid = pdci_info_extarcted->harq_pid;
uint32_t rballoc = pdci_info_extarcted->rballoc;
uint8_t mcs1 = pdci_info_extarcted->mcs1;
uint8_t rv1 = pdci_info_extarcted->rv1;
uint8_t ndi1 = pdci_info_extarcted->ndi1;
uint8_t TPC = pdci_info_extarcted->TPC;
uint8_t rah = pdci_info_extarcted->rah;
#ifdef DEBUG_DCI
uint8_t rv1 = pdci_info_extarcted->rv1;
uint8_t ndi1 = pdci_info_extarcted->ndi1;
#endif
uint8_t NPRB = 0;
long long int RIV_max = 0;
......@@ -4983,13 +4985,18 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
uint8_t rv2 = pdci_info_extarcted->rv2;
uint8_t harq_pid = pdci_info_extarcted->harq_pid;
uint32_t rballoc = pdci_info_extarcted->rballoc;
#ifdef DEBUG_DCI
uint8_t ndi1 = pdci_info_extarcted->ndi1;
uint8_t ndi2 = pdci_info_extarcted->ndi2;
#endif
uint8_t NPRB = 0;
long long RIV_max = 0;
#ifdef DEBUG_DCI
LOG_I(PHY, "extarcted dci - dci_format %d \n", dci_format);
LOG_I(PHY, "extarcted dci - rnti %d \n", rnti);
LOG_I(PHY, "extarcted dci - rah %d \n", rah);
LOG_I(PHY, "extarcted dci - mcs1 %d \n", mcs1);
LOG_I(PHY, "extarcted dci - mcs2 %d \n", mcs2);
......@@ -5001,6 +5008,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
LOG_I(PHY, "extarcted dci - harq pif %d \n", harq_pid);
LOG_I(PHY, "extarcted dci - round0 %d \n", pdlsch0_harq->round);
LOG_I(PHY, "extarcted dci - round1 %d \n", pdlsch1_harq->round);
#endif
// I- check dci content minimum coherency
if(harq_pid >8)
......@@ -5043,6 +5051,21 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
}*/
if((pdlsch0_harq->round == 0) && (rv1 > 0))
{
// DCI false detection
LOG_I(PHY,"bad rv1\n");
return(0);
}
if((pdlsch1_harq->round == 0) && (rv2 > 0))
{
// DCI false detection
LOG_I(PHY,"bad rv2\n");
return(0);
}
switch (N_RB_DL) {
case 6:
if (rah == 0)
......@@ -5606,6 +5629,7 @@ 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,
uint16_t rnti,
uint8_t subframe,
LTE_DL_UE_HARQ_t *dlsch0_harq,
LTE_DL_UE_HARQ_t *dlsch1_harq,
......@@ -5663,15 +5687,17 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
dlsch1_harq->dl_power_off = 1;
pdlsch0->current_harq_pid = harq_pid;
pdlsch0->harq_ack[subframe].harq_id = harq_pid;
pdlsch0->harq_ack[subframe].harq_id = harq_pid;
pdlsch1->current_harq_pid = harq_pid;
pdlsch1->harq_ack[subframe].harq_id = harq_pid;
pdlsch1->harq_ack[subframe].harq_id = harq_pid;
// assume two CW are active
dlsch0_harq->status = ACTIVE;
dlsch1_harq->status = ACTIVE;
pdlsch0->active = 1;
pdlsch1->active = 1;
pdlsch0->rnti = rnti;
pdlsch1->rnti = rnti;
if (TB0_active && TB1_active && tbswap==1) {
......@@ -5690,12 +5716,8 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
if (TB1_active==0) {
dlsch1_harq->status = SCH_IDLE;
pdlsch1->active = 0;
#ifdef DEBUG_HARQ
printf("[DCI UE]: TB1 is deactivated, retransmit TB0 transmit in TM6\n");
#endif
}
#ifdef DEBUG_HARQ
printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status);
#endif
......@@ -5727,6 +5749,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
dlsch1_harq->rb_alloc_odd[3] = dlsch0_harq->rb_alloc_odd[3];
dlsch1_harq->nb_rb = dlsch0_harq->nb_rb;
//dlsch0_harq->Nl = 1;
//dlsch1_harq->Nl = 1;
}
} else if ((TB0_active == 0) && (TB1_active == 1)){
......@@ -5774,24 +5799,28 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
if ((ndi1!=dlsch0_harq->DCINdi) || (dlsch0_harq->first_tx==1)) {
dlsch0_harq->round = 0;
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW0 subframe %d (pid %d, round %d)\n",
// subframe,harq_pid,dlsch0_harq->round);
if ( dlsch0_harq->first_tx==1) {
LOG_D(PHY,"Format 2 DCI First TX0: Clearing flag\n");
dlsch0_harq->first_tx = 0;
}
}else{
if(dlsch0_harq->round == 0) {
#if 0
// 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;
#endif
}
}
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
if(dlsch0_harq->Nl == 2)
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][(dlsch0_harq->nb_rb<<1)-1];
//if(dlsch0_harq->Nl == 2)
//dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][(dlsch0_harq->nb_rb<<1)-1];
if (mcs1 <= 28)
dlsch0_harq->Qm = get_Qm(mcs1);
else if (mcs1<=31)
......@@ -5801,11 +5830,14 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
if (TB1_active) {
if ((ndi2!=dlsch1_harq->DCINdi) || (dlsch1_harq->first_tx==1)) {
dlsch1_harq->round = 0;
//LOG_I(PHY,"[UE] DLSCH: New Data Indicator CW1 subframe %d (pid %d, round %d)\n",
// subframe,harq_pid,dlsch0_harq->round);
if (dlsch1_harq->first_tx==1) {
LOG_D(PHY,"Format 2 DCI First TX1: Clearing flag\n");
dlsch1_harq->first_tx = 0;
}
}else{
#if 0
if(dlsch1_harq->round == 0) {
// skip pdsch decoding and report ack
dlsch1_harq->status = SCH_IDLE;
......@@ -5814,11 +5846,12 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
pdlsch1->harq_ack[subframe].harq_id = harq_pid;
pdlsch1->harq_ack[subframe].send_harq_status = 1;
}
#endif
}
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch1_harq->nb_rb-1];
if(dlsch0_harq->Nl == 2)
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][(dlsch0_harq->nb_rb<<1)-1];
//if(dlsch0_harq->Nl == 2)
//dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][(dlsch0_harq->nb_rb<<1)-1];
if (mcs2 <= 28)
dlsch1_harq->Qm = get_Qm(mcs2);
......@@ -6047,7 +6080,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
case format2:
{
// extract dci infomation
LOG_I(PHY,"[DCI-format2] extract dci infomation \n");
//LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame, subframe);
extract_dci2_info(frame_parms->N_RB_DL,
frame_type,
frame_parms->nb_antenna_ports_eNB,
......@@ -6069,7 +6102,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch0->harq_processes[harq_pid];
dlsch1_harq = dlsch1->harq_processes[harq_pid];
LOG_I(PHY,"[DCI-format2] check dci content \n");
//LOG_I(PHY,"[DCI-format2] check dci content \n");
status = check_dci_format2_2a_coherency(format2,
frame_parms->N_RB_DL,
&dci_info_extarcted,
......@@ -6083,10 +6116,11 @@ int generate_ue_dlsch_params_from_dci(int frame,
return(-1);
// dci is correct ==> update internal structure and prepare dl decoding
LOG_I(PHY,"[DCI-format2] update internal structure and prepare dl decoding \n");
//LOG_I(PHY,"[DCI-format2] update internal structure and prepare dl decoding \n");
prepare_dl_decoding_format2_2A(format2,
&dci_info_extarcted,
frame_parms,
rnti,
subframe,
dlsch0_harq,
dlsch1_harq,
......@@ -6099,7 +6133,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
case format2A:
{
// extract dci infomation
LOG_I(PHY,"[DCI-format2A] extract dci infomation \n");
//LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame%1024, subframe);
extract_dci2A_info(frame_parms->N_RB_DL,
frame_type,
frame_parms->nb_antenna_ports_eNB,
......@@ -6107,10 +6141,10 @@ int generate_ue_dlsch_params_from_dci(int frame,
&dci_info_extarcted);
// check dci content
LOG_I(PHY,"[DCI-format2A] check dci content \n");
LOG_I(PHY,"[DCI-format2A] tb_swap %d harq_pid %d\n", dci_info_extarcted.tb_swap, dci_info_extarcted.harq_pid);
dlsch[0]->active = 0;
dlsch[1]->active = 0;
//LOG_I(PHY,"[DCI-format2A] check dci content \n");
//LOG_I(PHY,"[DCI-format2A] tb_swap %d harq_pid %d\n", dci_info_extarcted.tb_swap, dci_info_extarcted.harq_pid);
//dlsch[0]->active = 0;
//dlsch[1]->active = 0;
if (dci_info_extarcted.tb_swap == 0) {
dlsch0 = dlsch[0];
......@@ -6122,7 +6156,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch0->harq_processes[dci_info_extarcted.harq_pid];
dlsch1_harq = dlsch1->harq_processes[dci_info_extarcted.harq_pid];
LOG_I(PHY,"[DCI-format2A] check dci content \n");
//LOG_I(PHY,"[DCI-format2A] check dci content \n");
status = check_dci_format2_2a_coherency(format2A,
frame_parms->N_RB_DL,
&dci_info_extarcted,
......@@ -6136,10 +6170,11 @@ int generate_ue_dlsch_params_from_dci(int frame,
return(-1);
// dci is correct ==> update internal structure and prepare dl decoding
LOG_I(PHY,"[DCI-format2A] update internal structure and prepare dl decoding \n");
//LOG_I(PHY,"[DCI-format2A] update internal structure and prepare dl decoding \n");
prepare_dl_decoding_format2_2A(format2A,
&dci_info_extarcted,
frame_parms,
rnti,
subframe,
dlsch0_harq,
dlsch1_harq,
......@@ -7142,7 +7177,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
uint8_t transmission_mode = ue->transmission_mode[eNB_id];
ANFBmode_t AckNackFBMode;
LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[0];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[subframe&0x1][0];
PHY_MEASUREMENTS *meas = &ue->measurements;
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
// uint32_t current_dlsch_cqi = ue->current_dlsch_cqi[eNB_id];
......@@ -7947,7 +7982,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
if (frame_parms->frame_type == FDD) {
int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
if (ue->dlsch[eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission
if (ue->dlsch[dl_subframe&0x1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission
ulsch->harq_processes[harq_pid]->O_ACK = 1;
} else {
ulsch->harq_processes[harq_pid]->O_ACK = 0;
......
......@@ -708,7 +708,7 @@ typedef struct {
int16_t sqrt_rho_a;
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
int16_t sqrt_rho_b;
/// Current HARQ process id
/// Current HARQ process id threadRx Odd and threadRx Even
uint8_t current_harq_pid;
/// Current subband antenna selection
uint32_t antenna_alloc;
......
......@@ -38,6 +38,7 @@
#include "SIMULATION/TOOLS/defs.h"
//#define DEBUG_DLSCH_DECODING
extern double cpuf;
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
{
......@@ -270,7 +271,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
return(max_turbo_iterations);
}*/
/*harq_pid = dlsch->current_harq_pid;
/*harq_pid = dlsch->current_harq_pid[subframe&0x1];
if (harq_pid >= 8) {
printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid);
return(max_turbo_iterations);
......@@ -341,6 +342,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
printf("Segmentation: C %d, Cminus %d, Kminus %d, Kplus %d\n",harq_process->C,harq_process->Cminus,harq_process->Kminus,harq_process->Kplus);
#endif
opp_enabled=1;
for (r=0; r<harq_process->C; r++) {
......@@ -376,7 +379,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
(r==0) ? harq_process->F : 0);
#ifdef DEBUG_DLSCH_DECODING
LOG_I(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,
Kr*3,
harq_process->TBS,
......@@ -459,6 +462,10 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
#if 1
if (err_flag == 0) {
LOG_D(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,
harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_turbo_iterations);
if (llr8_flag) {
AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
......@@ -605,6 +612,13 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
stop_meas(dlsch_turbo_decoding_stats);
printf("Segmentation: C %d r %d, dlsch_rate_unmatching_stats %5.3f dlsch_deinterleaving_stats %5.3f dlsch_turbo_decoding_stats %5.3f \n",
harq_process->C,
r,
dlsch_rate_unmatching_stats->p_time/(cpuf*1000.0),
dlsch_deinterleaving_stats->p_time/(cpuf*1000.0),
dlsch_turbo_decoding_stats->p_time/(cpuf*1000.0));
}
}
}
......@@ -636,25 +650,28 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
harq_process->round++;
if(is_crnti)
{
LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round,harq_process->TBS);
}
// printf("Rate: [UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
if (harq_process->round >= dlsch->Mdlharq) {
harq_process->status = SCH_IDLE;
harq_process->round = 0;
}
if(is_crnti)
{
LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->status,harq_process->round,dlsch->Mdlharq,harq_process->TBS);
}
return((1+dlsch->max_turbo_iterations));
} else {
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, round %d, subframe %d)\n",
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->round, subframe);
harq_process->status = SCH_IDLE;
harq_process->round = 0;
dlsch->harq_ack[subframe].ack = 1;
dlsch->harq_ack[subframe].harq_id = harq_pid;
dlsch->harq_ack[subframe].send_harq_status = 1;
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, pid status %d, round %d, subframe %d)\n",
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->status, harq_process->round, subframe);
if(is_crnti)
{
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round,harq_process->TBS);
......@@ -908,7 +925,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
break;
case PDSCH: // TB0
dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0];
harq_pid = dlsch_ue->current_harq_pid;
ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]);
DevAssert( ue_id != (uint32_t)-1 );
......@@ -954,7 +971,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
break;
case PDSCH1: { // TB1
dlsch_ue = phy_vars_ue->dlsch[eNB_id][1];
dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1];
harq_pid = dlsch_ue->current_harq_pid;
int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] );
DevAssert( UE_id != -1 );
......@@ -1008,7 +1025,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
break;
default:
dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0];
LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id);
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
......
......@@ -121,6 +121,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
switch (type) {
case SI_PDSCH:
pdsch_vars = &ue->pdsch_vars_SI[eNB_id];
......@@ -138,16 +139,18 @@ int rx_pdsch(PHY_VARS_UE *ue,
case PDSCH:
pdsch_vars = &ue->pdsch_vars[subframe&0x1][eNB_id];
dlsch = ue->dlsch[eNB_id];
dlsch = ue->dlsch[subframe&0x1][eNB_id];
LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n",
frame,subframe,symbol,harq_pid,
dlsch[0]->harq_processes[harq_pid]->status,
dlsch[1]->harq_processes[harq_pid]->status);
if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE)){
codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword;
codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
dlsch0_harq = dlsch[codeword_TB0]->harq_processes[harq_pid];
dlsch1_harq = dlsch[codeword_TB1]->harq_processes[harq_pid];
#ifdef DEBUG_HARQ
printf("I am assuming both CW active\n");
#endif
}
else if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
(dlsch[1]->harq_processes[harq_pid]->status != ACTIVE) ) {
......@@ -159,8 +162,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
else if ((dlsch[0]->harq_processes[harq_pid]->status != ACTIVE) &&
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE) ){
codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
dlsch0_harq = dlsch[1]->harq_processes[harq_pid];
dlsch1_harq = NULL;
dlsch0_harq = dlsch[1]->harq_processes[harq_pid];
dlsch1_harq = NULL;
codeword_TB0 = -1;
}