diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index b3d2272107c11b84aaf2307f134159b9da598213..5a8dd1ab90c3b5364291313da581b9680e0080cb 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -2667,7 +2667,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, dlsch1_harq->subframe = subframe; } -#ifdef DEBUG_DCI + //#ifdef DEBUG_DCI if (dlsch0) { printf("dlsch0 eNB: dlsch0 %p\n",dlsch0); @@ -2683,7 +2683,7 @@ int generate_eNB_dlsch_params_from_dci(int frame, printf("dlsch0 eNB: mimo_mode %d\n",dlsch0_harq->mimo_mode); } -#endif + //#endif // compute DL power control parameters computeRhoA_eNB(pdsch_config_dedicated, dlsch[0],dlsch0_harq->dl_power_off); @@ -5534,7 +5534,7 @@ int generate_ue_dlsch_params_from_dci(int frame, } -#ifdef DEBUG_DCI + //#ifdef DEBUG_DCI if (dlsch[0]) { printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); @@ -5548,7 +5548,7 @@ int generate_ue_dlsch_params_from_dci(int frame, printf("PDSCH dlsch0 UE: pwr_off %d\n",dlsch0_harq->dl_power_off); } -#endif + //#endif dlsch[0]->active=1; // compute DL power control parameters diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c index 2051562c1940ad7820e5dd6705cf89d34f99ea4c..f9f6002970ec433d7c962340c28a9954d379bcd3 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c @@ -671,6 +671,7 @@ int dlsch_qpsk_llr(LTE_DL_FRAME_PARMS *frame_parms, // printf("dlsch_qpsk_llr: symbol %d,nb_rb %d, len %d,pbch_pss_sss_adjust %d\n",symbol,nb_rb,len,pbch_pss_sss_adjust); + for (i=0; i<len; i++) { *llr32 = *rxF; // printf("llr %d : (%d,%d)\n",i,((int16_t*)llr32)[0],((int16_t*)llr32)[1]); diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index 4bc15a3e1fd0af45aac2a883cadd3fc3574cf6e9..60e09503d3d9e607b436190b1f0217940732d4a3 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -241,19 +241,18 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // Schedule ULSCH for FDD or subframeP 4 (TDD config 0,3,6) // Schedule Normal DLSCH + schedule_RA(module_idP,frameP,subframeP,2); if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD schedule_ulsch(module_idP,frameP,cooperation_flag,0,4);//,calibration_flag); - } else if ((mac_xface->lte_frame_parms->tdd_config == TDD) || //TDD (mac_xface->lte_frame_parms->tdd_config == 3) || (mac_xface->lte_frame_parms->tdd_config == 6)) { //schedule_ulsch(module_idP,frameP,cooperation_flag,subframeP,4);//,calibration_flag); } - schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); @@ -283,7 +282,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, schedule_ulsch(module_idP,frameP,cooperation_flag,1,5); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); - } break; @@ -320,11 +318,10 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, break; } } else { //FDD + schedule_ulsch(module_idP,frameP,cooperation_flag,3,7); schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); - - } break; @@ -348,6 +345,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, // no break here! case 5: + schedule_ue_spec(module_idP,frameP,subframeP,mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); break; @@ -357,11 +355,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, } } else { if (mac_xface->lte_frame_parms->frame_type == FDD) { //FDD + // schedule_RA(module_idP,frameP, subframeP, 0); schedule_ulsch(module_idP, frameP, cooperation_flag, 4, 8); schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); fill_DLSCH_dci(module_idP, frameP, subframeP, mbsfn_status); - } } @@ -380,7 +378,6 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, schedule_ulsch(module_idP,frameP,cooperation_flag,5,9); schedule_ue_spec(module_idP, frameP, subframeP, mbsfn_status); fill_DLSCH_dci(module_idP,frameP,subframeP,mbsfn_status); - } else if ((mac_xface->lte_frame_parms->tdd_config == 0) || // TDD Config 0 (mac_xface->lte_frame_parms->tdd_config == 6)) { // TDD Config 6 //schedule_ulsch(module_idP,cooperation_flag,subframeP); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c index a578761f3f9234c9d13c638fea3c1e8f51926948..524268665bf0cbfc5497b6c8723cdebe0d64198d 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c @@ -68,6 +68,7 @@ #include "SIMULATION/TOOLS/defs.h" // for taus + void schedule_RA(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP,unsigned char Msg3_subframe) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_bch.c b/openair2/LAYER2/MAC/eNB_scheduler_bch.c index f02aaf6d74c836c2217ff6b23ef035c84d14a582..b9a310c30c599a25472f511ce3962a795cbeb0c6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_bch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_bch.c @@ -328,7 +328,6 @@ schedule_SI( eNB->eNB_stats[CC_id].bcch_mcs=mcs; } else { - //LOG_D(MAC,"[eNB %d] Frame %d : BCCH not active \n",Mod_id,frame); } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index f84bd762b22cdad5a63cb8ff231110dac622822e..86f0f98d70b73fae621972f3e9c1d0fcab6dc1f8 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -471,7 +471,6 @@ schedule_ue_spec( for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { min_rb_unit[CC_id]=get_min_rb_unit(module_idP,CC_id); frame_parms[CC_id] = mac_xface->get_lte_frame_parms(module_idP,CC_id); - // get number of PRBs less those used by common channels total_nb_available_rb[CC_id] = frame_parms[CC_id]->N_RB_DL; for (i=0;i<frame_parms[CC_id]->N_RB_DL;i++) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index cb3887d45b937c6599eccf061482d9a3413c284a..fadef3fbc801f07ee06bae3288dbccdc527a28ec 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -906,11 +906,14 @@ int get_nCCE_offset(int *CCE_table, // check CCE(0 ... L-1) nb_candidates = (L==4) ? 4 : 2; nb_candidates = min(nb_candidates,nCCE/L); + // printf("Common DCI nb_candidates %d, L %d\n",nb_candidates,L); + for (m = nb_candidates-1 ; m >=0 ; m--) { search_space_free = 1; for (l=0; l<L; l++) { + // printf("CCE_table[%d] %d\n",(m*L)+l,CCE_table[(m*L)+l]); if (CCE_table[(m*L) + l] == 1) { search_space_free = 0; @@ -919,7 +922,9 @@ int get_nCCE_offset(int *CCE_table, } if (search_space_free == 1) { + // printf("returning %d\n",m*L); + for (l=0; l<L; l++) CCE_table[(m*L)+l]=1; return(m*L); @@ -955,6 +960,7 @@ int get_nCCE_offset(int *CCE_table, break; } + LOG_D(MAC,"rnti %x, Yk = %d, nCCE %d (nCCE/L %d),nb_cand %d\n",rnti,Yk,nCCE,nCCE/L,nb_candidates); for (m = 0 ; m < nb_candidates ; m++) { @@ -994,7 +1000,9 @@ int allocate_CCEs(int module_idP, int allocation_is_feasible = 1; DCI_ALLOC_t *dci_alloc; + LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); + init_CCE_table(module_idP,CC_idP); DCI_pdu->nCCE=0; @@ -1024,6 +1032,7 @@ int allocate_CCEs(int module_idP, (i<DCI_pdu->Num_common_dci) ? 1 : 0, dci_alloc->rnti, subframeP))>=0) {// the allocation is feasible, rnti rule passes + LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); if (test_onlyP == 0) { DCI_pdu->nCCE += (1<<dci_alloc->L); diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 10537b91cf0ba1a23721b3a52d94b754bdda7778..9afe098d77fe64df1abc7e66caffb3d762bb5ac4 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -53,6 +53,7 @@ for the message. @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe number on which to act + */ void schedule_RA(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,uint8_t Msg3_subframe); @@ -122,6 +123,7 @@ void fill_DLSCH_dci(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,i @param Mod_id Instance ID of eNB @param frame Frame index @param subframe Subframe on which to act + @param mbsfn_flag Indicates that MCH/MCCH is in this subframe */ void schedule_ue_spec(module_id_t module_idP,frame_t frameP,sub_frame_t subframe,int *mbsfn_flag); diff --git a/openair2/PHY_INTERFACE/defs.h b/openair2/PHY_INTERFACE/defs.h index 71f70cbcf7fed058bffba2c332ccfe7fa28fc853..7b0367f53791c0481d7af34aca2ce86c1b1e7ca4 100755 --- a/openair2/PHY_INTERFACE/defs.h +++ b/openair2/PHY_INTERFACE/defs.h @@ -238,7 +238,8 @@ typedef struct { int (*get_ue_active_harq_pid)(module_id_t Mod_id, uint8_t CC_id,rnti_t rnti, int frame, uint8_t subframe, uint8_t *harq_pid, uint8_t *round, uint8_t ul_flag); /// Function to retrieve number of CCE - uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols ,int subframe); + uint16_t (*get_nCCE_max)(module_id_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe); + int (*get_nCCE_offset)(unsigned char L, int nCCE, int common_dci, unsigned short rnti, unsigned char subframe);