Commit bd489822 authored by Bilel's avatar Bilel

pdcch dual buffer

parent cec9cb76
...@@ -614,8 +614,12 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility ...@@ -614,8 +614,12 @@ void phy_config_afterHO_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_id, Mobility
// RNTI // RNTI
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti = mobilityControlInfo->newUE_Identity.buf[0]|(mobilityControlInfo->newUE_Identity.buf[1]<<8);
LOG_I(PHY,"SET C-RNTI %x %x\n",PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[0][eNB_id]->crnti,
PHY_vars_UE_g[Mod_id][CC_id]->pdcch_vars[1][eNB_id]->crnti);
} }
if(ho_failed) { if(ho_failed) {
...@@ -835,7 +839,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -835,7 +839,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
if (physicalConfigDedicated->antennaInfo) { if (physicalConfigDedicated->antennaInfo) {
phy_vars_ue->transmission_mode[eNB_id] = 1+(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode); phy_vars_ue->transmission_mode[eNB_id] = 1+(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
LOG_D(PHY,"Transmission Mode %d\n",phy_vars_ue->transmission_mode[eNB_id]); LOG_I(PHY,"Transmission Mode %d\n",phy_vars_ue->transmission_mode[eNB_id]);
switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) { switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
case AntennaInfoDedicated__transmissionMode_tm1: case AntennaInfoDedicated__transmissionMode_tm1:
phy_vars_ue->transmission_mode[eNB_id] = 1; phy_vars_ue->transmission_mode[eNB_id] = 1;
...@@ -856,7 +860,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -856,7 +860,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
phy_vars_ue->transmission_mode[eNB_id] = 6; phy_vars_ue->transmission_mode[eNB_id] = 6;
break; break;
case AntennaInfoDedicated__transmissionMode_tm7: case AntennaInfoDedicated__transmissionMode_tm7:
lte_gold_ue_spec_port5(phy_vars_ue->lte_gold_uespec_port5_table, phy_vars_ue->frame_parms.Nid_cell, phy_vars_ue->pdcch_vars[eNB_id]->crnti); lte_gold_ue_spec_port5(phy_vars_ue->lte_gold_uespec_port5_table, phy_vars_ue->frame_parms.Nid_cell, phy_vars_ue->pdcch_vars[0][eNB_id]->crnti);
phy_vars_ue->transmission_mode[eNB_id] = 7; phy_vars_ue->transmission_mode[eNB_id] = 7;
break; break;
default: default:
...@@ -952,6 +956,14 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -952,6 +956,14 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
LOG_I(PHY,"Disabling SIB MIB decoding \n"); LOG_I(PHY,"Disabling SIB MIB decoding \n");
phy_vars_ue->decode_SIB = 0; phy_vars_ue->decode_SIB = 0;
phy_vars_ue->decode_MIB = 0; phy_vars_ue->decode_MIB = 0;
//phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
else
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
LOG_I(PHY,"C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti,
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
} }
...@@ -1075,7 +1087,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, ...@@ -1075,7 +1087,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra; LTE_UE_PDSCH** const pdsch_vars_ra = ue->pdsch_vars_ra;
LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH; LTE_UE_PDSCH** const pdsch_vars_mch = ue->pdsch_vars_MCH;
LTE_UE_PBCH** const pbch_vars = ue->pbch_vars; LTE_UE_PBCH** const pbch_vars = ue->pbch_vars;
LTE_UE_PDCCH** const pdcch_vars = ue->pdcch_vars; LTE_UE_PDCCH** const pdcch_vars_th0 = ue->pdcch_vars[0];
LTE_UE_PDCCH** const pdcch_vars_th1 = ue->pdcch_vars[1];
LTE_UE_PRACH** const prach_vars = ue->prach_vars; LTE_UE_PRACH** const prach_vars = ue->prach_vars;
int i,j,k,l; int i,j,k,l;
...@@ -1157,7 +1170,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, ...@@ -1157,7 +1170,8 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_SI[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_ra[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH)); pdsch_vars_mch[eNB_id] = (LTE_UE_PDSCH *)malloc16_clear(sizeof(LTE_UE_PDSCH));
pdcch_vars[eNB_id] = (LTE_UE_PDCCH *)malloc16_clear(sizeof(LTE_UE_PDCCH)); pdcch_vars_th0[eNB_id] = (LTE_UE_PDCCH *)malloc16_clear(sizeof(LTE_UE_PDCCH));
pdcch_vars_th1[eNB_id] = (LTE_UE_PDCCH *)malloc16_clear(sizeof(LTE_UE_PDCCH));
prach_vars[eNB_id] = (LTE_UE_PRACH *)malloc16_clear(sizeof(LTE_UE_PRACH)); prach_vars[eNB_id] = (LTE_UE_PRACH *)malloc16_clear(sizeof(LTE_UE_PRACH));
pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH)); pbch_vars[eNB_id] = (LTE_UE_PBCH *)malloc16_clear(sizeof(LTE_UE_PBCH));
...@@ -1233,29 +1247,46 @@ int phy_init_lte_ue(PHY_VARS_UE *ue, ...@@ -1233,29 +1247,46 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp ); phy_init_lte_ue__PDSCH( pdsch_vars_mch[eNB_id], fp );
// 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE // 100 PRBs * 12 REs/PRB * 4 PDCCH SYMBOLS * 2 LLRs/RE
pdcch_vars[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); pdcch_vars_th0[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); pdcch_vars_th0[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars[eNB_id]->wbar = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) ); pdcch_vars_th0[eNB_id]->wbar = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars[eNB_id]->e_rx = (int8_t*)malloc16_clear( 4*2*100*12 ); pdcch_vars_th0[eNB_id]->e_rx = (int8_t*)malloc16_clear( 4*2*100*12 );
pdcch_vars[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdcch_vars_th0[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdcch_vars_th0[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) ); pdcch_vars_th0[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pdcch_vars[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdcch_vars_th0[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) ); pdcch_vars_th0[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars_th1[eNB_id]->llr = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars_th1[eNB_id]->llr16 = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars_th1[eNB_id]->wbar = (uint16_t*)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
pdcch_vars_th1[eNB_id]->e_rx = (int8_t*)malloc16_clear( 4*2*100*12 );
pdcch_vars_th1[eNB_id]->rxdataF_comp = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars_th1[eNB_id]->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars_th1[eNB_id]->rho = (int32_t**)malloc16( fp->nb_antennas_rx*sizeof(int32_t*) );
pdcch_vars_th1[eNB_id]->rxdataF_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
pdcch_vars_th1[eNB_id]->dl_ch_estimates_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
for (i=0; i<fp->nb_antennas_rx; i++) { for (i=0; i<fp->nb_antennas_rx; i++) {
//ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) ); //ue_pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(fp->N_RB_DL*12*7*2) );
pdcch_vars[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) ); pdcch_vars_th0[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) );
pdcch_vars_th1[eNB_id]->rho[i] = (int32_t*)malloc16_clear( sizeof(int32_t)*(100*12*4) );
for (j=0; j<4; j++) { //fp->nb_antennas_tx; j++) for (j=0; j<4; j++) { //fp->nb_antennas_tx; j++)
int idx = (j<<1)+i; int idx = (j<<1)+i;
// size_t num = 7*2*fp->N_RB_DL*12; // size_t num = 7*2*fp->N_RB_DL*12;
size_t num = 4*100*12; // 4 symbols, 100 PRBs, 12 REs per PRB size_t num = 4*100*12; // 4 symbols, 100 PRBs, 12 REs per PRB
pdcch_vars[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdcch_vars_th0[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdcch_vars_th0[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdcch_vars_th0[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num ); pdcch_vars_th0[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars_th1[eNB_id]->rxdataF_comp[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars_th1[eNB_id]->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars_th1[eNB_id]->rxdataF_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
pdcch_vars_th1[eNB_id]->dl_ch_estimates_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
} }
} }
......
...@@ -1682,9 +1682,7 @@ void pdcch_alamouti(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -1682,9 +1682,7 @@ void pdcch_alamouti(LTE_DL_FRAME_PARMS *frame_parms,
int32_t avgP[4]; int32_t avgP[4];
int32_t rx_pdcch(LTE_UE_COMMON *common_vars, int32_t rx_pdcch(PHY_VARS_UE *ue,
LTE_UE_PDCCH **pdcch_vars,
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame, uint32_t frame,
uint8_t subframe, uint8_t subframe,
uint8_t eNB_id, uint8_t eNB_id,
...@@ -1693,6 +1691,10 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars, ...@@ -1693,6 +1691,10 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
uint8_t is_secondary_ue) uint8_t is_secondary_ue)
{ {
LTE_UE_COMMON *common_vars = &ue->common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe & 0x1];
uint8_t log2_maxh,aatx,aarx; uint8_t log2_maxh,aatx,aarx;
#ifdef MU_RECEIVER #ifdef MU_RECEIVER
uint8_t eNB_id_i=eNB_id+1;//add 1 to eNB_id to separate from wanted signal, chosen as the B/F'd pilots from the SeNB are shifted by 1 uint8_t eNB_id_i=eNB_id+1;//add 1 to eNB_id to separate from wanted signal, chosen as the B/F'd pilots from the SeNB are shifted by 1
...@@ -1701,7 +1703,7 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars, ...@@ -1701,7 +1703,7 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
uint8_t n_pdcch_symbols = 3; //pdcch_vars[eNB_id]->num_pdcch_symbols; uint8_t n_pdcch_symbols = 3; //pdcch_vars[eNB_id]->num_pdcch_symbols;
uint8_t mi = get_mi(frame_parms,subframe); uint8_t mi = get_mi(frame_parms,subframe);
// printf("In rx_pdcch, subframe %d, eNB_id %d\n",subframe,eNB_id); //printf("In rx_pdcch, subframe %d, eNB_id %d, pdcch_vars %d \n",subframe,eNB_id,pdcch_vars);
for (s=0; s<n_pdcch_symbols; s++) { for (s=0; s<n_pdcch_symbols; s++) {
if (is_secondary_ue == 1) { if (is_secondary_ue == 1) {
...@@ -1876,12 +1878,12 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars, ...@@ -1876,12 +1878,12 @@ int32_t rx_pdcch(LTE_UE_COMMON *common_vars,
pdcch_vars[eNB_id], pdcch_vars[eNB_id],
mimo_mode); mimo_mode);
if (n_pdcch_symbols>3) if (n_pdcch_symbols>3)
n_pdcch_symbols=1; n_pdcch_symbols=1;
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
printf("[PDCCH] subframe %d n_pdcch_symbols from PCFICH =%d\n",subframe,n_pdcch_symbols);
printf("demapping: subframe %d, mi %d, tdd_config %d\n",subframe,get_mi(frame_parms,subframe),frame_parms->tdd_config); printf("demapping: subframe %d, mi %d, tdd_config %d\n",subframe,get_mi(frame_parms,subframe),frame_parms->tdd_config);
#endif #endif
...@@ -2503,7 +2505,7 @@ void dci_decoding(uint8_t DCI_LENGTH, ...@@ -2503,7 +2505,7 @@ void dci_decoding(uint8_t DCI_LENGTH,
} }
static uint8_t dci_decoded_output[(MAX_DCI_SIZE_BITS+64)/8]; static uint8_t dci_decoded_output[2][(MAX_DCI_SIZE_BITS+64)/8];
uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi) uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint8_t mi)
{ {
...@@ -2795,21 +2797,23 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2795,21 +2797,23 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
if (do_common == 1) if (do_common == 1)
LOG_I(PHY,"[DCI search - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask); LOG_I(PHY,"[DCI search nPdcch %d - common] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",
pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask);
else else
LOG_I(PHY,"[DCI search - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask); LOG_I(PHY,"[DCI search nPdcch %d - ue spec] Attempting candidate %d Aggregation Level %d DCI length %d at CCE %d/%d (CCEmap %x,CCEmap_cand %x)\n",
pdcch_vars[eNB_id]->num_pdcch_symbols,m,L2,sizeof_bits,CCEind,nCCE,*CCEmap,CCEmap_mask);
#endif #endif
dci_decoding(sizeof_bits, dci_decoding(sizeof_bits,
L, L,
&pdcch_vars[eNB_id]->e_rx[CCEind*72], &pdcch_vars[eNB_id]->e_rx[CCEind*72],
dci_decoded_output); &dci_decoded_output[subframe&0x1][0]);
/* /*
for (i=0;i<3+(sizeof_bits>>3);i++) for (i=0;i<3+(sizeof_bits>>3);i++)
printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]); printf("dci_decoded_output[%d] => %x\n",i,dci_decoded_output[i]);
*/ */
crc = (crc16(dci_decoded_output,sizeof_bits)>>16) ^ extract_crc(dci_decoded_output,sizeof_bits); crc = (crc16(&dci_decoded_output[subframe&0x1][0],sizeof_bits)>>16) ^ extract_crc(&dci_decoded_output[subframe&0x1][0],sizeof_bits);
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
printf("crc =>%x\n",crc); printf("crc =>%x\n",crc);
#endif #endif
...@@ -2823,27 +2827,31 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2823,27 +2827,31 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
dci_alloc[*dci_cnt].L = L; dci_alloc[*dci_cnt].L = L;
dci_alloc[*dci_cnt].firstCCE = CCEind; dci_alloc[*dci_cnt].firstCCE = CCEind;
//printf("DCI FOUND !!! crc =>%x, sizeof_bits %d, sizeof_bytes %d \n",crc, sizeof_bits, sizeof_bytes);
if (sizeof_bytes<=4) { if (sizeof_bytes<=4) {
dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[0]; dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe&0x1][0];
dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[1]; dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe&0x1][1];
dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[2]; dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe&0x1][2];
dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[3]; dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe&0x1][3];
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
printf("DCI => %x,%x,%x,%x\n",dci_decoded_output[0],dci_decoded_output[1],dci_decoded_output[2],dci_decoded_output[3]); printf("DCI => %x,%x,%x,%x\n",dci_decoded_output[subframe&0x1][0],
dci_decoded_output[subframe&0x1][1],
dci_decoded_output[subframe&0x1][2],
dci_decoded_output[subframe&0x1][3]);
#endif #endif
} else { } else {
dci_alloc[*dci_cnt].dci_pdu[7] = dci_decoded_output[0]; dci_alloc[*dci_cnt].dci_pdu[7] = dci_decoded_output[subframe&0x1][0];
dci_alloc[*dci_cnt].dci_pdu[6] = dci_decoded_output[1]; dci_alloc[*dci_cnt].dci_pdu[6] = dci_decoded_output[subframe&0x1][1];
dci_alloc[*dci_cnt].dci_pdu[5] = dci_decoded_output[2]; dci_alloc[*dci_cnt].dci_pdu[5] = dci_decoded_output[subframe&0x1][2];
dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[3]; dci_alloc[*dci_cnt].dci_pdu[4] = dci_decoded_output[subframe&0x1][3];
dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[4]; dci_alloc[*dci_cnt].dci_pdu[3] = dci_decoded_output[subframe&0x1][4];
dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[5]; dci_alloc[*dci_cnt].dci_pdu[2] = dci_decoded_output[subframe&0x1][5];
dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[6]; dci_alloc[*dci_cnt].dci_pdu[1] = dci_decoded_output[subframe&0x1][6];
dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[7]; dci_alloc[*dci_cnt].dci_pdu[0] = dci_decoded_output[subframe&0x1][7];
#ifdef DEBUG_DCI_DECODING #ifdef DEBUG_DCI_DECODING
printf("DCI => %x,%x,%x,%x,%x,%x,%x,%x\n", printf("DCI => %x,%x,%x,%x,%x,%x,%x,%x\n",
dci_decoded_output[0],dci_decoded_output[1],dci_decoded_output[2],dci_decoded_output[3], dci_decoded_output[subframe&0x1][0],dci_decoded_output[subframe&0x1][1],dci_decoded_output[subframe&0x1][2],dci_decoded_output[subframe&0x1][3],
dci_decoded_output[4],dci_decoded_output[5],dci_decoded_output[6],dci_decoded_output[7]); dci_decoded_output[subframe&0x1][4],dci_decoded_output[subframe&0x1][5],dci_decoded_output[subframe&0x1][6],dci_decoded_output[subframe&0x1][7]);
#endif #endif
} }
...@@ -2860,7 +2868,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2860,7 +2868,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
*dci_cnt = *dci_cnt+1; *dci_cnt = *dci_cnt+1;
} else if (crc==pdcch_vars[eNB_id]->crnti) { } else if (crc==pdcch_vars[eNB_id]->crnti) {
if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[0]&0x80)==0)) {// check if pdu is format 0 or 1A if ((mode&UL_DCI)&&(format_c == format0)&&((dci_decoded_output[subframe&0x1][0]&0x80)==0)) {// check if pdu is format 0 or 1A
if (*format0_found == 0) { if (*format0_found == 0) {
dci_alloc[*dci_cnt].format = format0; dci_alloc[*dci_cnt].format = format0;
*format0_found = 1; *format0_found = 1;
...@@ -2882,7 +2890,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2882,7 +2890,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
} }
} }
LOG_D(PHY,"DCI decoding CRNTI [format: %d, nCCE[subframe: %d]: %d ], AggregationLevel %d \n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe],L2); LOG_I(PHY,"DCI decoding CRNTI [format: %d, nCCE[subframe: %d]: %d ], AggregationLevel %d \n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe],L2);
// memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes); // memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes);
...@@ -2928,7 +2936,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -2928,7 +2936,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
uint8_t dci_cnt=0,old_dci_cnt=0; uint8_t dci_cnt=0,old_dci_cnt=0;
uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0; uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0;
LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars; LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe & 0x1];
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
uint8_t mi = get_mi(&ue->frame_parms,subframe); uint8_t mi = get_mi(&ue->frame_parms,subframe);
uint16_t ra_rnti=99; uint16_t ra_rnti=99;
...@@ -3518,7 +3526,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3518,7 +3526,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
} else if (tmode == 3) { } else if (tmode == 3) {
LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1\n"); LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 1 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
// Now check UE_SPEC format 2A_2A search spaces at aggregation 1 // Now check UE_SPEC format 2A_2A search spaces at aggregation 1
old_dci_cnt=dci_cnt; old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode, dci_decoding_procedure0(pdcch_vars,0,mode,
...@@ -3554,7 +3562,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3554,7 +3562,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt); return(dci_cnt);
// Now check UE_SPEC format 2 search spaces at aggregation 2 // 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"); LOG_D(PHY," Now check UE_SPEC format 2A_2A search aggregation 2 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
old_dci_cnt=dci_cnt; old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode, dci_decoding_procedure0(pdcch_vars,0,mode,
subframe, subframe,
...@@ -3623,7 +3631,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3623,7 +3631,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
//#ifdef ALL_AGGREGATION //#ifdef ALL_AGGREGATION
// Now check UE_SPEC format 2_2A search spaces at aggregation 8 // 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"); LOG_D(PHY," Now check UE_SPEC format 2_2A search spaces at aggregation 8 dci length: %d[bits] %d[bytes]\n",format2A_size_bits,format2A_size_bytes);
old_dci_cnt=dci_cnt; old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode, dci_decoding_procedure0(pdcch_vars,0,mode,
subframe, subframe,
......
...@@ -1897,9 +1897,9 @@ struct DCI2A_10MHz_4A_TDD { ...@@ -1897,9 +1897,9 @@ struct DCI2A_10MHz_4A_TDD {
#define sizeof_DCI2A_10MHz_4A_TDD_t 41 #define sizeof_DCI2A_10MHz_4A_TDD_t 41
typedef struct DCI2A_10MHz_4A_TDD DCI2A_10MHz_4A_TDD_t; typedef struct DCI2A_10MHz_4A_TDD DCI2A_10MHz_4A_TDD_t;
/// DCI Format Type 2A (10 MHz, FDD, 2 Antenna Ports, 36 bits) /// DCI Format Type 2A (10 MHz, FDD, 2 Antenna Ports, 40 bits)
struct DCI2A_10MHz_2A_FDD { struct DCI2A_10MHz_2A_FDD {
uint64_t padding:28; uint64_t padding:24;
/// Redundancy version 2 /// Redundancy version 2
uint64_t rv2:2; uint64_t rv2:2;
/// New Data Indicator 2 /// New Data Indicator 2
...@@ -1923,7 +1923,7 @@ struct DCI2A_10MHz_2A_FDD { ...@@ -1923,7 +1923,7 @@ struct DCI2A_10MHz_2A_FDD {
/// Resource Allocation Header /// Resource Allocation Header
uint64_t rah:1; uint64_t rah:1;
} __attribute__ ((__packed__)); } __attribute__ ((__packed__));
#define sizeof_DCI2A_10MHz_2A_FDD_t 36 #define sizeof_DCI2A_10MHz_2A_FDD_t 41
typedef struct DCI2A_10MHz_2A_FDD DCI2A_10MHz_2A_FDD_t; typedef struct DCI2A_10MHz_2A_FDD DCI2A_10MHz_2A_FDD_t;
/// DCI Format Type 2A (10 MHz, FDD, 4 Antenna Ports, 38 bits) /// DCI Format Type 2A (10 MHz, FDD, 4 Antenna Ports, 38 bits)
......
...@@ -5720,9 +5720,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, ...@@ -5720,9 +5720,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
pdlsch1->active = 0; pdlsch1->active = 0;
} }
#ifdef DEBUG_HARQ //#ifdef DEBUG_HARQ
printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status);
#endif //#endif
// compute resource allocation // compute resource allocation
if (TB0_active == 1){ if (TB0_active == 1){
...@@ -5882,9 +5882,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format, ...@@ -5882,9 +5882,9 @@ void prepare_dl_decoding_format2_2A(DCI_format_t dci_format,
dlsch1_harq->Qm = (mcs2-28)<<1; dlsch1_harq->Qm = (mcs2-28)<<1;
} }
#ifdef DEBUG_HARQ //#ifdef DEBUG_HARQ
printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status); printf("[DCI UE]: dlsch0_harq status %d , dlsch1_harq status %d\n", dlsch0_harq->status, dlsch1_harq->status);
#endif //#endif
#ifdef DEBUG_HARQ #ifdef DEBUG_HARQ
if (dlsch0 != NULL && dlsch1 != NULL) if (dlsch0 != NULL && dlsch1 != NULL)
...@@ -6156,7 +6156,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -6156,7 +6156,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
case format2A: case format2A:
{ {
// extract dci infomation // extract dci infomation
//LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame%1024, subframe); LOG_I(PHY,"[DCI-format2] AbsSubframe %d.%d extract dci infomation \n", frame%1024, subframe);
extract_dci2A_info(frame_parms->N_RB_DL, extract_dci2A_info(frame_parms->N_RB_DL,
frame_type, frame_type,
frame_parms->nb_antenna_ports_eNB, frame_parms->nb_antenna_ports_eNB,
...@@ -6376,7 +6376,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -6376,7 +6376,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
} }
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) {
printf("dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe); printf("dci_format:%d Abssubframe: %d.%d \n",dci_format,frame%1024,subframe);
...@@ -6384,7 +6384,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -6384,7 +6384,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]);
printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid); printf("PDSCH dlsch0 UE: harq_pid %d\n",harq_pid);
printf("PDSCH dlsch0 UE: tpc %d\n",TPC); //printf("PDSCH dlsch0 UE: tpc %d\n",TPC);
printf("PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch); printf("PDSCH dlsch0 UE: g %d\n",dlsch[0]->g_pucch);
printf("PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round); printf("PDSCH dlsch0 UE: round %d\n",dlsch0_harq->round);
printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi); printf("PDSCH dlsch0 UE: DCINdi %d\n",dlsch0_harq->DCINdi);
...@@ -6393,8 +6393,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -6393,8 +6393,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs); printf("PDSCH dlsch0 UE: mcs %d\n",dlsch0_harq->mcs);
printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off);
} }
#endif
#endif
#if T_TRACER #if T_TRACER
if( (dlsch[0]->rnti != si_rnti) && (dlsch[0]->rnti != ra_rnti) && (dlsch[0]->rnti != p_rnti)) if( (dlsch[0]->rnti != si_rnti) && (dlsch[0]->rnti != ra_rnti) && (dlsch[0]->rnti != p_rnti))
...@@ -8077,7 +8076,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -8077,7 +8076,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
// ulsch->n_DMRS2 = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift; // ulsch->n_DMRS2 = ((DCI0_5MHz_TDD_1_6_t *)dci_pdu)->cshift;
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
printf("Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe); printf("Format 0 DCI : ulsch (ue): AbsSubframe %d.%d\n",proc->frame_rx%1024,subframe);
printf("Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb); printf("Format 0 DCI : ulsch (ue): NBRB %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
......
...@@ -927,7 +927,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -927,7 +927,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
case PDSCH: // TB0 case PDSCH: // TB0
dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0]; dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][0];
harq_pid = dlsch_ue->current_harq_pid; 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]); ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[subframe & 0x1][(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]);
DevAssert( ue_id != (uint32_t)-1 ); DevAssert( ue_id != (uint32_t)-1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0]; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0];
...@@ -973,7 +973,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -973,7 +973,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
case PDSCH1: { // TB1 case PDSCH1: { // TB1
dlsch_ue = phy_vars_ue->dlsch[subframe&0x1][eNB_id][1];