diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c index 8afb1e6f1cf49d77231e424a65747134b8e3d826..b3601d145681fbbabd4c496786ef16b19685ada1 100644 --- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c @@ -266,10 +266,7 @@ int dlsch_encoding_2threads0(te_params *tep) { unsigned short m=dlsch->harq_processes[harq_pid]->mcs; - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN); - - - + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING_W, VCD_FUNCTION_IN); if (dlsch->harq_processes[harq_pid]->round == 0) { // this is a new packet @@ -333,7 +330,7 @@ int dlsch_encoding_2threads0(te_params *tep) { m); // r } - VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING_W, VCD_FUNCTION_OUT); return(0); } @@ -424,7 +421,8 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, pthread_mutex_unlock( &proc->mutex_te ); return(-1); } - + + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_OUT); ++proc->instance_cnt_te; proc->tep.eNB = eNB; @@ -440,6 +438,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, pthread_mutex_unlock( &proc->mutex_te ); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, VCD_FUNCTION_IN); for (r=dlsch->harq_processes[harq_pid]->C>>1; r<dlsch->harq_processes[harq_pid]->C; r++) { if (r<dlsch->harq_processes[harq_pid]->Cminus) @@ -500,7 +499,7 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB, // Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the // outputs for each code segment, see Section 5.1.5 p.20 - for (r=0; r<dlsch->harq_processes[harq_pid]->C; r++) { + for (r=0,r_offset=0; r<dlsch->harq_processes[harq_pid]->C; r++) { // get information for E for the segments that are handled by the worker thread if (r<(dlsch->harq_processes[harq_pid]->C>>1)) { diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c index de81897d5abfcb9f8254b7f68c354fdccca82fbd..8bdccd9adf04f85814931ca7b9b1c3acfa0d3e99 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c @@ -299,6 +299,12 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { E = Nl*Q_m * ((GpmodC==0?0:1) + (Gp/C)); r_offset += E; + + if (r==0) { + offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); + } else { + offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); + } } // go through second half of segments @@ -393,8 +399,7 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { &eNB->ulsch_tc_intl1_stats, &eNB->ulsch_tc_intl2_stats); - - // Reassembly of Transport block here + // Reassembly of Transport block here if (ret != (1+ulsch->max_turbo_iterations)) { if (r<ulsch_harq->Cminus) @@ -404,17 +409,11 @@ int ulsch_decoding_data_2thread0(td_params* tdp) { Kr_bytes = Kr>>3; - if (r==0) { - memcpy(ulsch_harq->b, - &ulsch_harq->c[0][(ulsch_harq->F>>3)], - Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0)); - offset = Kr_bytes - (ulsch_harq->F>>3) - ((ulsch_harq->C>1)?3:0); - } else { - memcpy(ulsch_harq->b+offset, - ulsch_harq->c[r], - Kr_bytes - ((ulsch_harq->C>1)?3:0)); - offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); - } + memcpy(ulsch_harq->b+offset, + ulsch_harq->c[r], + Kr_bytes - ((ulsch_harq->C>1)?3:0)); + offset += (Kr_bytes- ((ulsch_harq->C>1)?3:0)); + } else { break; @@ -621,7 +620,7 @@ int ulsch_decoding_data_2thread(PHY_VARS_eNB *eNB,int UE_id,int harq_pid,int llr &eNB->ulsch_tc_ext_stats, &eNB->ulsch_tc_intl1_stats, &eNB->ulsch_tc_intl2_stats); - + // Reassembly of Transport block here if (ret != (1+ulsch->max_turbo_iterations)) { diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 538f9e1126ea3a2c56aa03e7388fb2e62fe6e502..16872ec879fad3f6f3eeb77e10fb79eab11cf321 100755 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -713,12 +713,14 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin if (ue->mac_enabled==1){ // ask L2 for RACH transport if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) { + LOG_D(PHY,"Getting PRACH resources\n"); ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(ue->Mod_id, ue->CC_id, frame_tx, eNB_id, subframe_tx); LOG_D(PHY,"Got prach_resources for eNB %d address %d, RRCCommon %d\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon); + LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]); } } diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 9992e761505742354436eaea2d67ccf5f0e1adab..605ff93f1fee39f239230715e73c84fb645a78ef 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1005,6 +1005,46 @@ int get_nCCE_offset(int *CCE_table, } } +void dump_CCE_table(int *CCE_table,const int nCCE,const unsigned short rnti,const int subframe,int L) { + + int nb_candidates = 0,i; + unsigned int Yk; + + for (i=0;i<nCCE;i++) { + printf("%1d.",CCE_table[i]); + if ((i&7) == 0) + printf("\n"); + } + + Yk = (unsigned int)rnti; + + for (i=0; i<=subframe; i++) + Yk = (Yk*39827)%65537; + + Yk = Yk % (nCCE/L); + + + switch (L) { + case 1: + case 2: + nb_candidates = 6; + break; + + case 4: + case 8: + nb_candidates = 2; + break; + + default: + DevParam(L, nCCE, rnti); + break; + } + + + printf("rnti %x, Yk*L = %d, nCCE %d (nCCE/L %d),nb_cand*L %d\n",rnti,Yk*L,nCCE,nCCE/L,nb_candidates*L); + +} + // Allocate the CCEs int allocate_CCEs(int module_idP, int CC_idP, @@ -1056,12 +1096,14 @@ try_again: subframeP,dci_alloc->rnti); for (j=0;j<=i;j++){ LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", - i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, + j,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format, 1<<DCI_pdu->dci_alloc[j].L, nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); } + dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,dci_alloc->L); + goto failed; } DCI_pdu->num_pdcch_symbols++; diff --git a/openair2/RRC/LITE/L2_interface.c b/openair2/RRC/LITE/L2_interface.c index 50e00e6a834a43e2a9c4074b042fe2965d266b33..d45b69dcd8862eb9b61ecfd460ecd1dda2a6d01b 100644 --- a/openair2/RRC/LITE/L2_interface.c +++ b/openair2/RRC/LITE/L2_interface.c @@ -291,10 +291,10 @@ mac_rrc_data_req( #endif //Rel10 } else { //This is an UE -#ifdef DEBUG_RRC + LOG_D(RRC,"[UE %d] Frame %d Filling CCCH SRB_ID %d\n",Mod_idP,frameP,Srb_id); LOG_D(RRC,"[UE %d] Frame %d buffer_pP status %d,\n",Mod_idP,frameP, UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size); -#endif + if( (UE_rrc_inst[Mod_idP].Srb0[eNB_index].Tx_buffer.payload_size > 0) ) { diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.c b/openair2/UTIL/LOG/vcd_signal_dumper.c index 94e180773d9dbf826e6fac029729d28a5f04630c..b8b8123780941be1ae911aa416bf7be17470334a 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.c +++ b/openair2/UTIL/LOG/vcd_signal_dumper.c @@ -272,6 +272,7 @@ const char* eurecomFunctionsNames[] = { "phy_ue_ulsch_scrambling", "phy_eNB_dlsch_modulation", "phy_eNB_dlsch_encoding", + "phy_eNB_dlsch_encoding_w", "phy_eNB_dlsch_scrambling", /* MAC signals */ diff --git a/openair2/UTIL/LOG/vcd_signal_dumper.h b/openair2/UTIL/LOG/vcd_signal_dumper.h index 416ec6064e9549c5e986e0d7b02dd1dff1bbc9d8..6edd9c09d5f0463105038dd55b2f27d739524b3f 100644 --- a/openair2/UTIL/LOG/vcd_signal_dumper.h +++ b/openair2/UTIL/LOG/vcd_signal_dumper.h @@ -246,6 +246,7 @@ typedef enum { VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_SCRAMBLING, VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_MODULATION, VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING, + VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ENCODING_W, VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_SCRAMBLING, /* MAC signals */ diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf index cc19e207940a5055ad2def93ed0d2e6baae13d84..6d4652183e06df289b4c7f4f19e181de929095aa 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.100PRB.usrpb210.conf @@ -50,7 +50,7 @@ eNBs = pucch_nRB_CQI = 1; pucch_nCS_AN = 0; pucch_n1_AN = 32; - pdsch_referenceSignalPower = -32; + pdsch_referenceSignalPower = -29; pdsch_p_b = 0; pusch_n_SB = 1; pusch_enable64QAM = "DISABLE"; @@ -70,7 +70,7 @@ eNBs = pusch_p0_Nominal = -96; pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; + pucch_p0_Nominal = -100; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf index 03dcabefe2d76e8e80d90a2e60d771c018d0635d..b18055ed22c3919d082981cddf1950d283aaced7 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf @@ -70,7 +70,7 @@ eNBs = pusch_p0_Nominal = -96; pusch_alpha = "AL1"; - pucch_p0_Nominal = -103; + pucch_p0_Nominal = -100; msg3_delta_Preamble = 6; pucch_deltaF_Format1 = "deltaF2"; pucch_deltaF_Format1b = "deltaF3"; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index b8ce8dba574776b1608fea3a84f60787093a0f5d..d2be56a3a35815d717a605b1557e1ec75403e86f 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -237,7 +237,7 @@ static inline void thread_top_init(char *thread_name, } memset(&sparam, 0, sizeof(sparam)); - sparam.sched_priority = sched_get_priority_max(SCHED_FIFO)-1; + sparam.sched_priority = sched_get_priority_max(SCHED_FIFO); policy = SCHED_FIFO ; s = pthread_setschedparam(pthread_self(), policy, &sparam); @@ -1566,6 +1566,7 @@ int start_rf(PHY_VARS_eNB *eNB) { extern void eNB_fep_rru_if5(PHY_VARS_eNB *eNB); extern void eNB_fep_full(PHY_VARS_eNB *eNB); +extern void eNB_fep_full_2thread(PHY_VARS_eNB *eNB); extern void do_prach(PHY_VARS_eNB *eNB); void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *eth_params,int single_thread_flag) { @@ -1613,7 +1614,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst break; case NGFI_RRU_IF4p5: eNB->do_prach = do_prach; - eNB->fep = eNB_fep_full; + eNB->fep = (single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full; eNB->td = NULL; eNB->te = NULL; eNB->proc_uespec_rx = NULL; @@ -1642,9 +1643,9 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst break; case eNodeB_3GPP: eNB->do_prach = do_prach; - eNB->fep = eNB_fep_full; - eNB->td = ulsch_decoding_data_2thread; - eNB->te = dlsch_encoding_2threads; + eNB->fep = (single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full; + eNB->td = ulsch_decoding_data;//(single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data; + eNB->te = dlsch_encoding;//(single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding; eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX; eNB->proc_tx = proc_tx_full; eNB->tx_fh = NULL; @@ -1662,9 +1663,9 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst break; case eNodeB_3GPP_BBU: eNB->do_prach = do_prach; - eNB->fep = eNB_fep_full; - eNB->td = ulsch_decoding_data_2thread; - eNB->te = dlsch_encoding_2threads; + eNB->fep = (single_thread_flag==1) ? eNB_fep_full_2thread : eNB_fep_full; + eNB->td = (single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data; + eNB->te = (single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding; eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX; eNB->proc_tx = proc_tx_full; eNB->tx_fh = tx_fh_if5; @@ -1687,8 +1688,8 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst case NGFI_RCC_IF4p5: eNB->do_prach = do_prach; eNB->fep = NULL; - eNB->td = ulsch_decoding_data_2thread; - eNB->te = dlsch_encoding_2threads; + eNB->td = (single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data; + eNB->te = (single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding; eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX; eNB->proc_tx = proc_tx_high; eNB->tx_fh = tx_fh_if4p5; @@ -1710,8 +1711,9 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst case NGFI_RAU_IF4p5: eNB->do_prach = do_prach; eNB->fep = NULL; - eNB->td = ulsch_decoding_data_2thread; - eNB->te = dlsch_encoding_2threads; + + eNB->td = (single_thread_flag==1) ? ulsch_decoding_data_2thread : ulsch_decoding_data; + eNB->te = (single_thread_flag==1) ? dlsch_encoding_2threads : dlsch_encoding; eNB->proc_uespec_rx = phy_procedures_eNB_uespec_RX; eNB->proc_tx = proc_tx_high; eNB->tx_fh = tx_fh_if4p5;