Commit 9df09a22 authored by Khodr Saaifan's avatar Khodr Saaifan Committed by Thomas Schlichter

Fix PUCCH and enable DCI format1 search in TM4

parent eb221756
......@@ -3727,7 +3727,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
}
// These are for CRNTI based on transmission mode
if ((tmode < 3) || (tmode == 7)) {
if ((tmode < 3) || (tmode == 7) || (tmode == 4)) {
// Now check UE_SPEC format 1 search spaces at aggregation 1
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
......@@ -3753,13 +3753,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap1,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 1 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff) ||
// to avoid dropping format 2 detection
/* if ((CCEmap0==0xffff) ||
(format_c_found==1))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
// Now check UE_SPEC format 1 search spaces at aggregation 2
old_dci_cnt=dci_cnt;
......@@ -3787,12 +3786,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 2 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff)||
// to avoid dropping format 2 detection
/*if ((CCEmap0==0xffff)||
(format_c_found==1))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
// Now check UE_SPEC format 1 search spaces at aggregation 4
old_dci_cnt=dci_cnt;
......@@ -3820,12 +3819,12 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 4 dci_cnt %d\n",dci_cnt);
if ((CCEmap0==0xffff)||
// to avoid dropping format 2 detection
/*if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
return(dci_cnt);*/
//#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 1 search spaces at aggregation 8
......@@ -3854,6 +3853,142 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
&CCEmap2);
//printf("[DCI search] Format 1 aggregation 8 dci_cnt %d\n",dci_cnt);
// to avoid dropping format 2 detection
/*if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);*/
/* Khodr Saaifan: Enable Format2 seaching in UE space along with Format 1 detaction
* : Work around to avoid droping format1 detection of RRC messages before TM4 config
* : aggregation 1,2,4, and 8
*/
// 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,
eNB_id,
ue->current_thread_id[subframe],
frame_parms,
mi,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
3,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
&CCEmap0,
&CCEmap1,
&CCEmap2);
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
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,
eNB_id,
ue->current_thread_id[subframe],
frame_parms,
mi,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
2,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
&CCEmap0,
&CCEmap1,
&CCEmap2);
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
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,
eNB_id,
ue->current_thread_id[subframe],
frame_parms,
mi,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
1,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
&CCEmap0,
&CCEmap1,
&CCEmap2);
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(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
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
eNB_id,
ue->current_thread_id[subframe],
frame_parms,
mi,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format2,
format2_size_bits,
format2_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
&CCEmap0,
&CCEmap1,
&CCEmap2);
//#endif
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
......@@ -3861,7 +3996,6 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
//#endif //ALL_AGGREGATION
} else if (tmode == 3) {
......
......@@ -5149,7 +5149,27 @@ if ((rv2!=1)&&(mcs2!=0))//deactivate TBS1
LOG_I(PHY,"bad tpmi %d\n", tpmi);
return(0);
}
/*SFN:
* Case 1:eNB receives ACK (due to channel) for erroneous decoded data
* Description: UE has a decoding error. Hence it increases round and send Nack to eNB
* if eNB receives ACK. So, it assumes a new Transmission and sends new TBS
* pdlsch0->harq_processes[harq_pid]
*/
int Nl;
if(pdlsch0_harq->round > 0)
{
if(tpmi==0) Nl=1;
else if(tpmi==7) Nl=2;
// compare old TBS to new TBS
if((mcs1<29) && (pdlsch0_harq->TBS != TBStable[get_I_TBS(mcs1)][Nl*NPRB-1]))
{
// this is an eNB issue due to wrong receiption of Ack/Nack
// retransmisison but old and new TBS are different !!!
// work around, consider it as a new transmission
LOG_E(PHY,"Format2 Retransmission but TBS are different: consider it as new transmission !!! \n");
pdlsch0_harq->round = 0;
}
}
return(1);
}
......@@ -5781,8 +5801,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
uint8_t ndi2 = pdci_info_extarcted->ndi2;
uint8_t Nl = 1;
uint8_t TB0_active = 1;
uint8_t TB1_active = 1;
uint8_t NPRB = 0;
uint8_t nb_rb_alloc = 0;
NPRB = conv_nprb(rah, rballoc, 25);
......@@ -5793,34 +5812,7 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
pdlsch0->rnti = rnti;
if ((rv1 == 1) && (mcs1 == 0)) {
TB0_active=0;
}
if ((rv2 == 1) && (mcs2 == 0)) {
TB1_active=0;
}
/*SFN:
* Case 1:eNB receives ACK (due to channel) for erroneous decoded data
* Description: UE has a decoding error. Hence it increases round and send Nack to eNB
* if eNB receives ACK. So, it assumes a new Transmission and sends new TBS
* pdlsch0->harq_processes[harq_pid]
*/
if(dlsch0_harq->round > 0)
{
if(tpmi==0) Nl=1;
else if(tpmi==7) Nl=2;
// compare old TBS to new TBS
if((mcs1<29) && (dlsch0_harq->TBS != TBStable[get_I_TBS(mcs1)][Nl*NPRB-1]))
{
// this is an eNB issue due to wrong receiption of Ack/Nack
// retransmisison but old and new TBS are different !!!
// work around, consider it as a new transmission
LOG_E(PHY,"Format2 Retransmission but TBS are different: consider it as new transmission !!! \n");
dlsch0_harq->round = 0;
}
}
// NDI has been toggled or this is the first transmission
if ((ndi1!=dlsch0_harq->DCINdi) || (dlsch0_harq->first_tx==1))
{
......
......@@ -479,15 +479,15 @@ void generate_pucch1x(int32_t **txdataF,
switch (fmt) {
case pucch_format1: //OOK 1-bit
zptr[n<<1] =(int16_t)(((int32_t)amp*ref_re));//amp is not fixed point
zptr[1+(n<<1)] =(int16_t)(((int32_t)amp*ref_im));
zptr[n<<1] =(int16_t)(((int32_t)amp*ref_re)>>15);//amp is a fixed point var
zptr[1+(n<<1)] =(int16_t)(((int32_t)amp*ref_im)>>15);
break;
case pucch_format1a: //BPSK 1-bit
d0 = (payload[0]&1)==0 ? amp : -amp;
zptr[n<<1] = (int16_t)(((int32_t)d0*ref_re));
zptr[1+(n<<1)] = (int16_t)(((int32_t)d0*ref_im));
zptr[n<<1] = (int16_t)(((int32_t)d0*ref_re)>>15);
zptr[1+(n<<1)] = (int16_t)(((int32_t)d0*ref_im)>>15);
// printf("d0 %d\n",d0);
break;
......@@ -520,8 +520,8 @@ void generate_pucch1x(int32_t **txdataF,
} // switch fmt
} else { // These are PUCCH reference symbols
zptr[n<<1] = (int16_t)(((int32_t)amp*ref_re));//amp is not fixed point
zptr[1+(n<<1)] =(int16_t)(((int32_t)amp*ref_im));
zptr[n<<1] = (int16_t)(((int32_t)amp*ref_re)>>15);//amp is a fixed point var
zptr[1+(n<<1)] =(int16_t)(((int32_t)amp*ref_im)>>15);
// printf("ref\n");
}
......@@ -538,7 +538,7 @@ void generate_pucch1x(int32_t **txdataF,
nprime=nprime1;
n_oc =n_oc1;
} // ns
zptr = (int16_t *)z;
rem = ((((deltaPUCCH_Shift*Ncs1_div_deltaPUCCH_Shift)>>3)&7)>0) ? 1 : 0;
m = (n1_pucch < thres) ? NRB2 : (((n1_pucch-thres)/(12*c/deltaPUCCH_Shift))+NRB2+((deltaPUCCH_Shift*Ncs1_div_deltaPUCCH_Shift)>>3)+rem);
......@@ -2103,7 +2103,7 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
stat_max = 0;
for (phase=0; phase<7; phase++) {
for (phase=0; phase<7; phase++) { zptr = (int16_t *)z;
stat=0;
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
......
......@@ -2245,10 +2245,12 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
1);
/*KhodrSaaifan: Fraunhofer iis
* Fix 0 amp bug which kill the Tx signal
/* KhodrSaaifan: Fraunhofer iis
* I see a problem in tx_amp, which should be solved later on
* To avoid a signal clipping of PUCCH at eNB, we use tx_amp=256
* */
if (tx_amp <= 0) tx_amp=2;
//LOG_I(PHY,"[UE %d] AbsSubframe %d.%d Po_PUCCH %d tx_amp %d\n",Mod_id,frame_tx%1024, subframe_tx,Po_PUCCH,tx_amp);
tx_amp=256;//
#else
tx_amp = AMP;
#endif
......@@ -5694,4 +5696,3 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u
} // slot
}
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