From 97db12c9f23e17bcd1f73748b7b08a967b2f5d15 Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Sun, 15 Jan 2017 20:28:07 +0100 Subject: [PATCH 01/25] better setting of aggregation level as a function of cqi and bw --- openair2/LAYER2/MAC/defs.h | 4 ++ openair2/LAYER2/MAC/eNB_scheduler.c | 10 +-- openair2/LAYER2/MAC/eNB_scheduler_dlsch.c | 24 ++++--- .../LAYER2/MAC/eNB_scheduler_primitives.c | 70 +++++++++++++++++-- openair2/LAYER2/MAC/eNB_scheduler_ulsch.c | 9 ++- openair2/LAYER2/MAC/extern.h | 6 ++ .../MAC/flexran_agent_scheduler_dlsch_ue.c | 13 ++-- openair2/LAYER2/MAC/pre_processor.c | 3 +- openair2/LAYER2/MAC/proto.h | 6 +- openair2/LAYER2/MAC/vars.h | 30 ++++++++ 10 files changed, 145 insertions(+), 30 deletions(-) diff --git a/openair2/LAYER2/MAC/defs.h b/openair2/LAYER2/MAC/defs.h index 15c0f3fb0e..67742de4ac 100644 --- a/openair2/LAYER2/MAC/defs.h +++ b/openair2/LAYER2/MAC/defs.h @@ -132,6 +132,10 @@ #define MIN_CQI_VALUE 0 /*!\brief maximum value for channel quality indicator */ #define MAX_CQI_VALUE 15 +/*!\briefmaximum number of supported bandwidth (1.4, 5, 10, 20 MHz) */ +#define MAX_SUPPORTED_BW 4 +/*!\brief CQI values range from 1 to 15 (4 bits) */ +#define CQI_VALUE_RANGE 16 /*!\brief value for indicating BSR Timer is not running */ #define MAC_UE_BSR_TIMER_NOT_RUNNING (0xFFFF) diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c index c5dc8c88b0..47971debda 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler.c +++ b/openair2/LAYER2/MAC/eNB_scheduler.c @@ -104,6 +104,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, rnti_t rnti; void *DLSCH_dci=NULL; int size_bits=0,size_bytes=0; + + LTE_eNB_UE_stats *eNB_UE_stats = NULL; #if defined(FLEXRAN_AGENT_SB_IF) Protocol__FlexranMessage *msg; @@ -140,9 +142,9 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].ul_inactivity_timer++; eNB_mac_inst[module_idP].UE_list.UE_sched_ctrl[i].cqi_req_timer++; - + eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); - if (mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti)==NULL) { + if (eNB_UE_stats==NULL) { //mac_remove_ue(module_idP, i, frameP, subframeP); //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future #if defined(FLEXRAN_AGENT_SB_IF) @@ -237,8 +239,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, add_ue_spec_dci(DCI_pdu[CC_id], DLSCH_dci, rnti, - size_bytes, - process_ue_cqi (module_idP,i),//aggregation, + size_bytes, + get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format1A), size_bits, format1A, 0); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c index 573a3401b0..33b9aea979 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c @@ -461,7 +461,7 @@ schedule_ue_spec( VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); //weight = get_ue_weight(module_idP,UE_id); - aggregation = 1; // set to the maximum aggregation level + aggregation = 2; for (CC_id=0; CC_idmacphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); continue_flag=1; } - + + aggregation = get_aggregation(get_bw_index(module_idP,CC_id), + eNB_UE_stats->DL_cqi[0], + format1); + if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti) ) { @@ -628,9 +632,6 @@ schedule_ue_spec( } nb_available_rb -= nb_rb; - aggregation = process_ue_cqi(module_idP,UE_id); - - PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; PHY_vars_eNB_g[module_idP][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id]; @@ -1118,8 +1119,7 @@ schedule_ue_spec( T(T_ENB_MAC_UE_DL_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id), T_INT(rnti), T_INT(frameP), T_INT(subframeP), T_INT(harq_pid), T_BUFFER(UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], TBS)); - aggregation = process_ue_cqi(module_idP,UE_id); - UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; + UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid] = nb_rb; add_ue_dlsch_info(module_idP, CC_id, @@ -1517,7 +1517,8 @@ fill_DLSCH_dci( eNB_MAC_INST *eNB =&eNB_mac_inst[module_idP]; UE_list_t *UE_list = &eNB->UE_list; //RA_TEMPLATE *RA_template; - + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + start_meas(&eNB->fill_DLSCH_dci); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_FILL_DLSCH_DCI,VCD_FUNCTION_IN); @@ -1544,6 +1545,7 @@ fill_DLSCH_dci( nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid]; DLSCH_dci = (void *)UE_list->UE_template[CC_id][UE_id].DLSCH_DCI[harq_pid]; + eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); /// Synchronizing rballoc with rballoc_sub @@ -1643,7 +1645,7 @@ fill_DLSCH_dci( DLSCH_dci, rnti, size_bytes, - process_ue_cqi (module_idP,UE_id),//aggregation, + get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format1), size_bits, format1, 0); @@ -1736,8 +1738,8 @@ fill_DLSCH_dci( DLSCH_dci, rnti, size_bytes, - process_ue_cqi (module_idP,UE_id),//aggregation, - size_bits, + get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format2A), + size_bits, format2A, 0); diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index ffd9630648..28b4da7ff6 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -182,11 +182,41 @@ uint8_t find_active_UEs(module_id_t module_idP,int CC_id){ */ -// get aggregatiob form phy for a give UE -unsigned char process_ue_cqi (module_id_t module_idP, int ue_idP) +// get aggregation (L) form phy for a give UE +unsigned char get_aggregation (uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt) { - unsigned char aggregation=1; - // check the MCS and SNR and set the aggregation accordingly + unsigned char aggregation=3; + + switch (dci_fmt){ + + case format0: + aggregation = cqi2fmt0_agg[bw_index][cqi]; + break; + case format1: + case format1A: + case format1B: + case format1D: + aggregation = cqi2fmt1x_agg[bw_index][cqi]; + break; + case format2: + case format2A: + case format2B: + case format2C: + case format2D: + aggregation = cqi2fmt2x_agg[bw_index][cqi]; + break; + case format1C: + case format1E_2A_M10PRB: + case format3: + case format3A: + case format4: + default: + LOG_W(MAC,"unsupported DCI format %d\n",dci_fmt); + } + + LOG_D(MAC,"Aggregation level %d (cqi %d, bw_index %d, format %d)\n", + 1<get_lte_frame_parms(module_id,CC_id); + + switch (frame_parms->N_RB_DL) { + case 6: // 1.4 MHz + bw_index=0; + break; + + case 25: // 5HMz + bw_index=1; + break; + + case 50: // 10HMz + bw_index=2; + break; + + case 100: // 20HMz + bw_index=3; + break; + + default: + bw_index=1; + LOG_W(MAC,"[eNB %d] N_DL_RB %d unknown for CC_id %d, setting bw_index to 1\n", module_id, CC_id); + break; + } + + return bw_index; +} + int get_min_rb_unit(module_id_t module_id, uint8_t CC_id) { diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c index c37224fbfb..da202dd397 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c @@ -729,8 +729,7 @@ void schedule_ulsch_rnti(module_id_t module_idP, ulsch_scheduler_pre_processor(module_idP, frameP, subframeP, - first_rb, - aggregation); + first_rb); // LOG_I(MAC,"exiting ulsch preprocesor\n"); @@ -767,9 +766,14 @@ void schedule_ulsch_rnti(module_id_t module_idP, if (drop_ue==1) continue; + aggregation=get_aggregation(get_bw_index(module_idP,CC_id), + eNB_UE_stats->DL_cqi[0], + format0); if (CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)) { LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: not enough nCCE\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id); continue; // break; + } else{ + LOG_D(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: aggregation level %d\n", module_idP,frameP,subframeP,UE_id,rnti,CC_id, 1<ul_failure_timer); // reset the scheduling request UE_template->ul_SR = 0; - aggregation = process_ue_cqi(module_idP,UE_id); status = mac_eNB_get_rrc_status(module_idP,rnti); if (status < RRC_CONNECTED) cqi_req = 0; diff --git a/openair2/LAYER2/MAC/extern.h b/openair2/LAYER2/MAC/extern.h index aed8424561..1da6fe5a69 100644 --- a/openair2/LAYER2/MAC/extern.h +++ b/openair2/LAYER2/MAC/extern.h @@ -50,6 +50,12 @@ extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE]; extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE]; //extern uint32_t Extended_BSR_TABLE[63]; ----currently not used +extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; + +extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; + +extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]; + extern UE_MAC_INST *UE_mac_inst; extern eNB_MAC_INST *eNB_mac_inst; extern eNB_RRC_INST *eNB_rrc_inst; diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 8975465e77..5bdc675198 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -125,7 +125,7 @@ flexran_schedule_ue_spec_default(mid_t mod_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); //weight = get_ue_weight(module_idP,UE_id); - aggregation = 2; // set to the maximum aggregation level + aggregation = 2; for (CC_id=0; CC_idmacphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); continue; } - + + aggregation = get_aggregation(get_bw_index(mod_id,CC_id), + flexran_get_ue_wcqi(mod_id, UE_id), + format1); + if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated CCE_allocation_infeasible(mod_id, CC_id, 0, subframe, aggregation, rnti)) { LOG_D(MAC,"[eNB %d] Frame %d : no RB allocated for UE %d on CC_id %d: continue \n", @@ -290,7 +294,6 @@ flexran_schedule_ue_spec_default(mid_t mod_id, } nb_available_rb -= nb_rb; - aggregation = process_ue_cqi(mod_id, UE_id); PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].pre_nb_available_rbs = nb_rb; PHY_vars_eNB_g[mod_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off = ue_sched_ctl->dl_pow_off[CC_id]; @@ -489,7 +492,9 @@ flexran_schedule_ue_spec_default(mid_t mod_id, dci_tbs = TBS; mcs = mcs_tmp; - aggregation = process_ue_cqi(mod_id,UE_id); + aggregation = get_aggregation(get_bw_index(mod_id,CC_id), + flexran_get_ue_wcqi(mod_id, UE_id), + format1); dl_dci->has_aggr_level = 1; dl_dci->aggr_level = aggregation; diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index ed12d322c1..e75e9d617a 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -919,8 +919,7 @@ void dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id, void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, - uint16_t *first_rb, - uint8_t aggregation) + uint16_t *first_rb) { int16_t i; diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 5da2367cef..1f794c0275 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -320,7 +320,7 @@ rnti_t UE_RNTI (module_id_t module_idP, int UE_id); int UE_PCCID (module_id_t module_idP, int UE_id); uint8_t find_active_UEs (module_id_t module_idP); boolean_t is_UE_active (module_id_t module_idP, int UE_id); -uint8_t process_ue_cqi (module_id_t module_idP, int UE_id); +uint8_t get_aggregation (uint8_t bw_index, uint8_t cqi, uint8_t dci_fmt); int8_t find_active_UEs_with_traffic(module_id_t module_idP); @@ -531,7 +531,7 @@ int UE_PCCID(module_id_t mod_idP,int ue_idP); rnti_t UE_RNTI(module_id_t mod_idP, int ue_idP); -void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb, uint8_t aggregattion); +void ulsch_scheduler_pre_processor(module_id_t module_idP, int frameP, sub_frame_t subframeP, uint16_t *first_rb); void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframeP); void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP); void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb); @@ -696,6 +696,8 @@ uint32_t allocate_prbs_sub(int nb_rb, uint8_t *rballoc); void update_ul_dci(module_id_t module_idP,uint8_t CC_id,rnti_t rnti,uint8_t dai); +int get_bw_index(module_id_t module_id, uint8_t CC_id); + int get_min_rb_unit(module_id_t module_idP, uint8_t CC_id); /* \brief Generate header for DL-SCH. This function parses the desired control elements and sdus and generates the header as described diff --git a/openair2/LAYER2/MAC/vars.h b/openair2/LAYER2/MAC/vars.h index 236439c6e5..edd8548e64 100644 --- a/openair2/LAYER2/MAC/vars.h +++ b/openair2/LAYER2/MAC/vars.h @@ -55,6 +55,36 @@ const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {0,10,13,16,19,23,29,35,43,5 1067031,1312097,1613447,1984009,2439678,3000000, 6000000}; +//#define MAX_SIZE_OF_AGG3 576 +//#define MAX_SIZE_OF_AGG2 288 +//#define MAX_SIZE_OF_AGG1 144 +//#define MAX_SIZE_OF_AGG0 72 + +/* + * If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise + * this is also dependent to transmission mode, where an offset could be defined + */ +// the follwoing three tables are calibrated for TXMODE 1 and 2 +const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= { + {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits + //{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 + {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41 + {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43 + {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44 +}; +const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= { + {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits + {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43 + {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47 + {3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55 +}; +const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= { + {3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits + {3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55 + {3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59 + {3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64 +}; + //uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181}; MAC_xface *mac_xface; From fdbab0e856cd2b5d3289173bfc817f5a433695bd Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Mon, 16 Jan 2017 18:31:45 +0100 Subject: [PATCH 02/25] fix the aggregation format for dump_CCE_table --- openair2/LAYER2/MAC/eNB_scheduler_primitives.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c index 28b4da7ff6..92868c1b98 100644 --- a/openair2/LAYER2/MAC/eNB_scheduler_primitives.c +++ b/openair2/LAYER2/MAC/eNB_scheduler_primitives.c @@ -1157,7 +1157,7 @@ try_again: 1<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); + dump_CCE_table(CCE_table,nCCE_max,subframeP,dci_alloc->rnti,1<L); goto failed; } From d0476cb02b717ab0d34f89a248eef2c4b37c0441 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Tue, 24 Jan 2017 17:39:44 +0200 Subject: [PATCH 03/25] Fixed various bugs related to scheduling using agent --- openair2/ENB_APP/flexran_agent_common.c | 15 ++- .../MAC/flexran_agent_scheduler_dataplane.c | 67 ++++++------ .../MAC/flexran_agent_scheduler_dlsch_ue.c | 101 ++++++++++++------ 3 files changed, 112 insertions(+), 71 deletions(-) diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 22793f16b4..c7f5d894e2 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -553,7 +553,11 @@ int flexran_get_ue_phr (mid_t mod_id, mid_t ue_id) { } int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) { - return ((UE_list_t *)enb_ue[mod_id])->eNB_UE_stats[UE_PCCID(mod_id,ue_id)][ue_id].dl_cqi; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, 0, UE_RNTI(mod_id, ue_id)); + return eNB_UE_stats->DL_cqi[0]; + + // return ((UE_list_t *)enb_ue[mod_id])->eNB_UE_stats[UE_PCCID(mod_id,ue_id)][ue_id].dl_cqi; } int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) { @@ -680,8 +684,13 @@ int flexran_get_tpc(mid_t mod_id, mid_t ue_id) { return tpc; } -int flexran_get_harq(const mid_t mod_id, const uint8_t CC_id, const mid_t ue_id, const int frame, const uint8_t subframe, - unsigned char *id, unsigned char *round) { //flag_id_status = 0 then id, else status +int flexran_get_harq(const mid_t mod_id, + const uint8_t CC_id, + const mid_t ue_id, + const int frame, + const uint8_t subframe, + uint8_t *id, + uint8_t *round) { //flag_id_status = 0 then id, else status /*TODO: Add int TB in function parameters to get the status of the second TB. This can be done to by editing in * get_ue_active_harq_pid function in line 272 file: phy_procedures_lte_eNB.c to add * DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][1];*/ diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c index c9956bd9ce..6347106e56 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c @@ -99,8 +99,8 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, uint16_t nb_rb; uint16_t TBS,j,sdu_lengths[11],rnti,padding=0,post_padding=0; unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; - unsigned char round = 0; - unsigned char harq_pid = 0; + uint8_t round = 0; + uint8_t harq_pid = 0; // LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]; LTE_eNB_UE_stats *eNB_UE_stats = NULL; uint16_t sdu_length_total = 0; @@ -147,7 +147,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, if (dl_data->n_ce_bitmap > 0) { //Check if there is TA command and set the length appropriately - ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 1 : 0; + ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 2 : 0; } num_sdus = 0; @@ -157,12 +157,14 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, // Reset the measurement ue_sched_ctl->ta_timer = 20; eNB_UE_stats->timing_advance_update = 0; - header_len = ta_len; - last_sdu_header_len = ta_len; + // header_len = ta_len; + //last_sdu_header_len = ta_len; } n_lc = dl_data->n_rlc_pdu; // Go through each one of the channel commands and create SDUs + header_len = 0; + last_sdu_header_len = 0; for (i = 0; i < n_lc; i++) { lcid = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->logical_channel_id; rlc_size = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->size; @@ -200,14 +202,14 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, if (rlc_status.bytes_in_buffer > 0) { - sdu_lengths[i] += mac_rlc_data_req(mod_id, - rnti, - mod_id, - frame, - ENB_FLAG_YES, - MBMS_FLAG_NO, - lcid, - (char *)&dlsch_buffer[sdu_length_total]); + sdu_lengths[i] = mac_rlc_data_req(mod_id, + rnti, + mod_id, + frame, + ENB_FLAG_YES, + MBMS_FLAG_NO, + lcid, + (char *)&dlsch_buffer[sdu_length_total]); LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[i]); sdu_length_total += sdu_lengths[i]; @@ -216,7 +218,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] += 1; UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[i]; - if (sdu_lengths[i] <= 128) { + if (sdu_lengths[i] < 128) { header_len += 2; last_sdu_header_len = 2; } else { @@ -230,34 +232,31 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, } // SDU creation end - if (((sdu_length_total + header_len) > 0)) { - - // header_len_tmp = header_len; + if (((sdu_length_total + header_len + ta_len) > 0)) { + + header_len_tmp = header_len; // If we have only a single SDU, header length becomes 1 - if ((num_sdus + ta_len) == 1) { + if ((num_sdus) == 1) { //if (header_len == 2 || header_len == 3) { header_len = 1; } else { header_len = (header_len - last_sdu_header_len) + 1; } - // there is a payload - if (((sdu_length_total + header_len) > 0)) { - // If we need a 1 or 2 bit padding or no padding at all - if ((TBS - header_len - sdu_length_total - ta_len) <= 2 - || (TBS - header_len - sdu_length_total - ta_len) > TBS) { //protect from overflow - padding = (TBS - header_len - sdu_length_total - ta_len); - post_padding = 0; - } else { // The last sdu needs to have a length field, since we add padding - padding = 0; - header_len = header_len_tmp; - post_padding = TBS - sdu_length_total - header_len - ta_len - 1; // 1 is for the postpadding header - } + // If we need a 1 or 2 bit padding or no padding at all + if ((TBS - header_len - sdu_length_total - ta_len) <= 2 + || (TBS - header_len - sdu_length_total - ta_len) > TBS) { //protect from overflow + padding = (TBS - header_len - sdu_length_total - ta_len); + post_padding = 0; + } else { // The last sdu needs to have a length field, since we add padding + padding = 0; + header_len = header_len_tmp; + post_padding = TBS - sdu_length_total - header_len - ta_len; // 1 is for the postpadding header } ta_update = (ta_len > 0) ? ue_sched_ctl->ta_update : 0; - + // If there is nothing to schedule, just leave if ((sdu_length_total) <= 0) { return; @@ -319,6 +318,8 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, nb_rb += get_min_rb_unit(mod_id, CC_id); stats_tbs = mac_xface->get_TBS_DL(dl_dci->mcs[0], nb_rb); } + + // LOG_I(FLEXRAN_AGENT, "The MCS was %d\n", dl_dci->mcs[0]); UE_list->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb; UE_list->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb; @@ -345,8 +346,8 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, //UE_list->eNB_UE_stats[CC_id][UE_id].ncce_used_retx=nCCECC_id]; } - UE_list->UE_template[CC_id][UE_id].oldNDI[dl_dci->harq_process] = dl_dci->ndi[0]; - eNB_UE_stats->dlsch_mcs1 = dl_dci->mcs[0]; + // UE_list->UE_template[CC_id][UE_id].oldNDI[dl_dci->harq_process] = dl_dci->ndi[0]; + // eNB_UE_stats->dlsch_mcs1 = dl_dci->mcs[0]; //Fill the proper DCI of OAI flexran_fill_oai_dci(mod_id, CC_id, rnti, dl_dci); diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 3af246a5d5..722e016167 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -233,7 +233,7 @@ void _assign_rbs_required (module_id_t Mod_id, for (n=0; nnumactiveCCs[UE_id]; n++) { CC_id = UE_list->ordered_CCids[n][UE_id]; eNB_UE_stats[CC_id] = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti); - eNB_UE_stats[CC_id]->dlsch_mcs1=cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)]; + eNB_UE_stats[CC_id]->dlsch_mcs1 = cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)]; } // provide the list of CCs sorted according to MCS @@ -260,34 +260,34 @@ void _assign_rbs_required (module_id_t Mod_id, CC_id = UE_list->ordered_CCids[i][UE_id]; eNB_UE_stats[CC_id] = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,rnti); - if (eNB_UE_stats[CC_id]->dlsch_mcs1==0) { + if (cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)] == 0) {//eNB_UE_stats[CC_id]->dlsch_mcs1==0) { nb_rbs_required[CC_id][UE_id] = 4; // don't let the TBS get too small } else { nb_rbs_required[CC_id][UE_id] = min_rb_unit[CC_id]; } - TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]); + TBS = mac_xface->get_TBS_DL(cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)], nb_rbs_required[CC_id][UE_id]); nb_rbs_allowed_slice[CC_id][slice_id] = flexran_nb_rbs_allowed_slice(slice_percentage[slice_id], flexran_get_N_RB_DL(Mod_id, CC_id)); LOG_D(MAC,"[preprocessor] start RB assignement for UE %d CC_id %d dl buffer %d (RB unit %d, MCS %d, TBS %d) \n", UE_id, CC_id, UE_list->UE_template[pCCid][UE_id].dl_buffer_total, - nb_rbs_required[CC_id][UE_id],eNB_UE_stats[CC_id]->dlsch_mcs1,TBS); + nb_rbs_required[CC_id][UE_id], flexran_get_ue_wcqi(Mod_id, UE_id), TBS); /* calculating required number of RBs for each UE */ while (TBS < UE_list->UE_template[pCCid][UE_id].dl_buffer_total) { nb_rbs_required[CC_id][UE_id] += min_rb_unit[CC_id]; if (nb_rbs_required[CC_id][UE_id] > nb_rbs_allowed_slice[CC_id][slice_id]) { - TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1, nb_rbs_allowed_slice[CC_id][slice_id]); + TBS = mac_xface->get_TBS_DL(flexran_get_ue_wcqi(Mod_id, UE_id), nb_rbs_allowed_slice[CC_id][slice_id]); nb_rbs_required[CC_id][UE_id] = nb_rbs_allowed_slice[CC_id][slice_id]; break; } - TBS = mac_xface->get_TBS_DL(eNB_UE_stats[CC_id]->dlsch_mcs1,nb_rbs_required[CC_id][UE_id]); + TBS = mac_xface->get_TBS_DL(cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)], nb_rbs_required[CC_id][UE_id]); } // end of while LOG_D(MAC,"[eNB %d][SLICE %d] Frame %d: UE %d on CC %d: RB unit %d, nb_required RB %d (TBS %d, mcs %d)\n", - Mod_id, slice_id,frameP,UE_id, CC_id, min_rb_unit[CC_id], nb_rbs_required[CC_id][UE_id], TBS, eNB_UE_stats[CC_id]->dlsch_mcs1); + Mod_id, slice_id,frameP,UE_id, CC_id, min_rb_unit[CC_id], nb_rbs_required[CC_id][UE_id], TBS, cqi_to_mcs[flexran_get_ue_wcqi(Mod_id, UE_id)]); } } } @@ -543,10 +543,11 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id, int *mbsfn_flag) { - unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], harq_pid=0, total_ue_count; + unsigned char rballoc_sub[MAX_NUM_CCs][N_RBG_MAX], total_ue_count; unsigned char MIMO_mode_indicator[MAX_NUM_CCs][N_RBG_MAX]; int UE_id, i; - unsigned char round = 0; + uint8_t round = 0; + uint8_t harq_pid = 0; uint16_t ii,j; uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX]; uint16_t nb_rbs_allowed_slice[MAX_NUM_CCs][MAX_NUM_SLICES]; @@ -1027,11 +1028,11 @@ flexran_schedule_ue_spec_common(mid_t mod_id, int N_RBG[MAX_NUM_CCs]; unsigned char aggregation; mac_rlc_status_resp_t rlc_status; - unsigned char header_len = 0, ta_len = 0; + unsigned char header_len = 0, header_len_last = 0, ta_len = 0; uint16_t nb_rb, nb_rb_temp, total_nb_available_rb[MAX_NUM_CCs], nb_available_rb; uint16_t TBS, j, rnti; - unsigned char round = 0; - unsigned char harq_pid = 0; + uint8_t round = 0; + uint8_t harq_pid = 0; uint16_t sdu_length_total = 0; int mcs, mcs_tmp; uint16_t min_rb_unit[MAX_NUM_CCs]; @@ -1043,6 +1044,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, static int32_t tpc_accumulated=0; UE_sched_ctrl *ue_sched_ctl; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; Protocol__FlexDlData *dl_data[NUM_MAX_UE]; int num_ues_added = 0; int channels_added = 0; @@ -1068,7 +1070,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); //weight = get_ue_weight(module_idP,UE_id); - aggregation = 2; // set to the maximum aggregation level + aggregation = 1; // set to the maximum aggregation level for (CC_id=0; CC_idpre_nb_available_rbs[CC_id] == 0) || // no RBs allocated - CCE_allocation_infeasible(mod_id, CC_id, 0, subframe, aggregation, rnti)) { + if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) ) { + continue; + } + + if (CCE_allocation_infeasible(mod_id, CC_id, 0, subframe, aggregation, rnti)) { LOG_D(MAC,"[eNB %d] Frame %d : no RB allocated for UE %d on CC_id %d: continue \n", mod_id, frame, UE_id, CC_id); //if(mac_xface->get_transmission_mode(module_idP,rnti)==5) @@ -1160,6 +1165,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, flexran_get_harq(mod_id, CC_id, UE_id, frame, subframe, &harq_pid, &round); sdu_length_total=0; mcs = cqi_to_mcs[flexran_get_ue_wcqi(mod_id, UE_id)]; + // LOG_I(FLEXRAN_AGENT, "The MCS is %d\n", mcs); mcs = cmin(mcs,flexran_slice_maxmcs(slice_id)); #ifdef EXMIMO @@ -1192,9 +1198,10 @@ flexran_schedule_ue_spec_common(mid_t mod_id, dl_dci->harq_process = harq_pid; /* process retransmission */ - if (round > 0) { + LOG_D(FLEXRAN_AGENT, "There was a retransmission just now and the round was %d\n", round); + if (flexran_get_duplex_mode(mod_id, CC_id) == PROTOCOL__FLEX_DUPLEX_MODE__FLDM_TDD) { UE_list->UE_template[CC_id][UE_id].DAI++; update_ul_dci(mod_id, CC_id, rnti, UE_list->UE_template[CC_id][UE_id].DAI); @@ -1267,15 +1274,16 @@ flexran_schedule_ue_spec_common(mid_t mod_id, //TBS = mac_xface->get_TBS(eNB_UE_stats->DL_cqi[0]<<1,nb_available_rb); TBS = mac_xface->get_TBS_DL(mcs, nb_available_rb); dci_tbs = TBS; - + LOG_D(FLEXRAN_AGENT, "TBS is %d\n", TBS); + // check first for RLC data on DCCH // add the length for all the control elements (timing adv, drx, etc) : header + payload ta_len = (ue_sched_ctl->ta_update!=0) ? 2 : 0; dl_data[num_ues_added]->n_ce_bitmap = 2; - dl_data[num_ues_added]->ce_bitmap = (uint32_t *) malloc(sizeof(uint32_t) * 2); - + dl_data[num_ues_added]->ce_bitmap = (uint32_t *) calloc(2, sizeof(uint32_t)); + if (ta_len > 0) { ce_flags |= PROTOCOL__FLEX_CE_TYPE__FLPCET_TA; } @@ -1288,9 +1296,11 @@ flexran_schedule_ue_spec_common(mid_t mod_id, // TODO : Need to prioritize DRBs // Loop through the UE logical channels (DCCH, DCCH1, DTCH for now) + header_len = 0; + header_len_last = 0; + sdu_length_total = 0; for (j = 1; j < NB_RB_MAX; j++) { - header_len+=3; - + header_len += 3; // Need to see if we have space for data from this channel if (dci_tbs - ta_len - header_len - sdu_length_total > 0) { LOG_D(MAC, "[TEST]Requested %d bytes from RLC buffer on channel %d during first call\n", dci_tbs-ta_len-header_len); @@ -1302,15 +1312,19 @@ flexran_schedule_ue_spec_common(mid_t mod_id, ENB_FLAG_YES, MBMS_FLAG_NO, j, - (dci_tbs-ta_len-header_len)); // transport block set size + (dci_tbs - ta_len - header_len - sdu_length_total)); // transport block set size //If data are available in channel j if (rlc_status.bytes_in_buffer > 0) { LOG_D(MAC, "[TEST]Have %d bytes in DCCH buffer during first call\n", rlc_status.bytes_in_buffer); //Fill in as much as possible - data_to_request = cmin(dci_tbs-ta_len-header_len, rlc_status.bytes_in_buffer); + data_to_request = cmin(dci_tbs - ta_len - header_len - sdu_length_total, rlc_status.bytes_in_buffer); + LOG_D(FLEXRAN_AGENT, "Will request %d bytes from channel %d\n", data_to_request, j); if (data_to_request < 128) { //The header will be one byte less header_len--; + header_len_last = 2; + } else { + header_len_last = 3; } /* if (j == 1 || j == 2) { data_to_request+=0; @@ -1350,17 +1364,29 @@ flexran_schedule_ue_spec_common(mid_t mod_id, dl_data[num_ues_added]->rlc_pdu[i] = rlc_pdus[i]; } + if (header_len == 0) { + LOG_D(FLEXRAN_AGENT, "Header was empty\n"); + header_len_last = 0; + } + // there is a payload - if (( dl_data[num_ues_added]->n_rlc_pdu > 0)) { + if ((dl_data[num_ues_added]->n_rlc_pdu > 0)) { // Now compute number of required RBs for total sdu length // Assume RAH format 2 // adjust header lengths - - if (header_len == 2 || header_len == 3) { //Only one SDU, remove length field - header_len = 1; - } else { //Remove length field from the last SDU - header_len--; + LOG_D(FLEXRAN_AGENT, "We have %d bytes to transfer\n", sdu_length_total); + if (header_len != 0) { + LOG_D(FLEXRAN_AGENT, "Header length was %d ", header_len); + header_len_last--; + header_len -= header_len_last; + LOG_D(FLEXRAN_AGENT, "so we resized it to %d\n", header_len); } + + /* if (header_len == 2 || header_len == 3) { //Only one SDU, remove length field */ + /* header_len = 1; */ + /* } else { //Remove length field from the last SDU */ + /* header_len--; */ + /* } */ mcs_tmp = mcs; if (mcs_tmp == 0) { @@ -1434,7 +1460,8 @@ flexran_schedule_ue_spec_common(mid_t mod_id, dci_tbs = TBS; mcs = mcs_tmp; - + LOG_D(FLEXRAN_AGENT, "Final mcs was %d\n", mcs); + aggregation = process_ue_cqi(mod_id,UE_id); dl_dci->has_aggr_level = 1; dl_dci->aggr_level = aggregation; @@ -1450,8 +1477,11 @@ flexran_schedule_ue_spec_common(mid_t mod_id, // do PUCCH power control // this is the normalized RX power - normalized_rx_power = flexran_get_p0_pucch_dbm(mod_id,UE_id, CC_id); //eNB_UE_stats->Po_PUCCH_dBm; - target_rx_power = flexran_get_p0_nominal_pucch(mod_id, CC_id) + 10; //mac_xface->get_target_pucch_rx_power(mod_id, CC_id) + 10; + //normalized_rx_power = flexran_get_p0_pucch_dbm(mod_id,UE_id, CC_id); //eNB_UE_stats->Po_PUCCH_dBm; + // target_rx_power = flexran_get_p0_nominal_pucch(mod_id, CC_id) + 10; //mac_xface->get_target_pucch_rx_power(mod_id, CC_id) + 10; + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id,rnti); + normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm; + target_rx_power = mac_xface->get_target_pucch_rx_power(mod_id,CC_id) + 20; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out @@ -1459,9 +1489,10 @@ flexran_schedule_ue_spec_common(mid_t mod_id, if (((framex10psubframe+10)<=(frame*10+subframe)) || //normal case ((framex10psubframe>(frame*10+subframe)) && (((10240-framex10psubframe+frame*10+subframe)>=10)))) //frame wrap-around - if (flexran_get_p0_pucch_status(mod_id, UE_id, CC_id) == 1) { - flexran_update_p0_pucch(mod_id, UE_id, CC_id); - + if (eNB_UE_stats->Po_PUCCH_update == 1){//flexran_get_p0_pucch_status(mod_id, UE_id, CC_id) == 1) { + // flexran_update_p0_pucch(mod_id, UE_id, CC_id); + eNB_UE_stats->Po_PUCCH_update = 0; + UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frame; UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframe; if (normalized_rx_power>(target_rx_power+1)) { From 974e5beebce1036f6f52902d8c3d48f30fdad3a5 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Wed, 25 Jan 2017 20:02:38 +0200 Subject: [PATCH 04/25] Harmonized FlexRAN scheduler with MAC changes for support of multiple UEs --- openair2/LAYER2/MAC/flexran_agent_mac_proto.h | 13 -- .../MAC/flexran_agent_scheduler_dlsch_ue.c | 163 +++++------------- openair2/LAYER2/MAC/pre_processor.c | 2 +- openair2/LAYER2/MAC/proto.h | 1 + 4 files changed, 41 insertions(+), 138 deletions(-) diff --git a/openair2/LAYER2/MAC/flexran_agent_mac_proto.h b/openair2/LAYER2/MAC/flexran_agent_mac_proto.h index 6757500dc2..a3ff3b6a4a 100644 --- a/openair2/LAYER2/MAC/flexran_agent_mac_proto.h +++ b/openair2/LAYER2/MAC/flexran_agent_mac_proto.h @@ -131,19 +131,6 @@ void _assign_rbs_required (module_id_t Mod_id, uint16_t nb_rbs_allowed_slice[MAX_NUM_CCs][MAX_NUM_SLICES], int min_rb_unit[MAX_NUM_CCs]); -int _maxround(module_id_t Mod_id, - uint16_t rnti, - int frame, - sub_frame_t subframe, - uint8_t ul_flag ); - -int _maxcqi(module_id_t Mod_id, - int32_t UE_id); - -void _sort_UEs (module_id_t Mod_idP, - int frameP, - sub_frame_t subframeP); - void _dlsch_scheduler_pre_processor (module_id_t Mod_id, int slice_id, frame_t frameP, diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 722e016167..75821956cb 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -137,8 +137,9 @@ void _store_dlsch_buffer (module_id_t Mod_id, UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; UE_TEMPLATE *UE_template; - for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { - + for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + if (UE_list->active[UE_id] != TRUE) continue; + if (flexran_slice_member(UE_id, slice_id) == 0) continue; @@ -221,7 +222,8 @@ void _assign_rbs_required (module_id_t Mod_id, // UE_TEMPLATE *UE_template; // clear rb allocations across all CC_ids - for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + if (UE_list->active[UE_id] != TRUE) continue; if (flexran_slice_member(UE_id, slice_id) == 0) continue; @@ -229,6 +231,10 @@ void _assign_rbs_required (module_id_t Mod_id, pCCid = UE_PCCID(Mod_id,UE_id); rnti = UE_list->UE_template[pCCid][UE_id].rnti; + /* skip UE not present in PHY (for any of its active CCs) */ + if (!phy_stats_exist(Mod_id, rnti)) + continue; + //update CQI information across component carriers for (n=0; nnumactiveCCs[UE_id]; n++) { CC_id = UE_list->ordered_CCids[n][UE_id]; @@ -293,115 +299,6 @@ void _assign_rbs_required (module_id_t Mod_id, } } -// This function scans all CC_ids for a particular UE to find the maximum round index of its HARQ processes -int _maxround(module_id_t Mod_id,uint16_t rnti,int frame,sub_frame_t subframe,uint8_t ul_flag ) -{ - - uint8_t round,round_max=0,UE_id; - int CC_id; - UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; - - for (CC_id=0; CC_idUE_sched_ctrl[UE_id].round[CC_id]; - if (round > round_max) { - round_max = round; - } - } - - return round_max; -} - -// This function scans all CC_ids for a particular UE to find the maximum DL CQI -int _maxcqi(module_id_t Mod_id,int32_t UE_id) -{ - - LTE_eNB_UE_stats *eNB_UE_stats = NULL; - UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list; - int CC_id,n; - int CQI = 0; - - for (n=0; nnumactiveCCs[UE_id]; n++) { - CC_id = UE_list->ordered_CCids[n][UE_id]; - eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,CC_id,UE_RNTI(Mod_id,UE_id)); - - if (eNB_UE_stats==NULL) { - mac_xface->macphy_exit("maxcqi: could not get eNB_UE_stats\n"); - return 0; // not reached - } - - if (eNB_UE_stats->DL_cqi[0] > CQI) { - CQI = eNB_UE_stats->DL_cqi[0]; - } - } - - return(CQI); -} - - -// This fuction sorts the UE in order their dlsch buffer and CQI -void _sort_UEs (module_id_t Mod_idP, - int frameP, - sub_frame_t subframeP) -{ - - - int UE_id1,UE_id2; - int pCC_id1,pCC_id2; - int cqi1,cqi2,round1,round2; - int i=0,ii=0;//,j=0; - rnti_t rnti1,rnti2; - - UE_list_t *UE_list = &eNB_mac_inst[Mod_idP].UE_list; - - for (i=UE_list->head; i>=0; i=UE_list->next[i]) { - - for(ii=UE_list->next[i]; ii>=0; ii=UE_list->next[ii]) { - - UE_id1 = i; - rnti1 = UE_RNTI(Mod_idP,UE_id1); - if(rnti1 == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[UE_id1].ul_out_of_sync == 1) - continue; - pCC_id1 = UE_PCCID(Mod_idP,UE_id1); - cqi1 = _maxcqi(Mod_idP,UE_id1); // - round1 = _maxround(Mod_idP,rnti1,frameP,subframeP,0); - - UE_id2 = ii; - rnti2 = UE_RNTI(Mod_idP,UE_id2); - if(rnti2 == NOT_A_RNTI) - continue; - if (UE_list->UE_sched_ctrl[UE_id2].ul_out_of_sync == 1) - continue; - cqi2 = _maxcqi(Mod_idP,UE_id2); - round2 = _maxround(Mod_idP,rnti2,frameP,subframeP,0); //mac_xface->get_ue_active_harq_pid(Mod_id,rnti2,subframe,&harq_pid2,&round2,0); - pCC_id2 = UE_PCCID(Mod_idP,UE_id2); - - if(round2 > round1) { // Check first if one of the UEs has an active HARQ process which needs service and swap order - swap_UEs(UE_list,UE_id1,UE_id2,0); - } else if (round2 == round1) { - // RK->NN : I guess this is for fairness in the scheduling. This doesn't make sense unless all UEs have the same configuration of logical channels. This should be done on the sum of all information that has to be sent. And still it wouldn't ensure fairness. It should be based on throughput seen by each UE or maybe using the head_sdu_creation_time, i.e. swap UEs if one is waiting longer for service. - - // first check the buffer status for SRB1 and SRB2 - if ( (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[1] + UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_info[2]) < - (UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[1] + UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_info[2]) ) { - swap_UEs(UE_list,UE_id1,UE_id2,0); - } else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_head_sdu_creation_time_max < - UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_head_sdu_creation_time_max ) { - swap_UEs(UE_list,UE_id1,UE_id2,0); - } else if (UE_list->UE_template[pCC_id1][UE_id1].dl_buffer_total < - UE_list->UE_template[pCC_id2][UE_id2].dl_buffer_total ) { - swap_UEs(UE_list,UE_id1,UE_id2,0); - } else if (cqi1 < cqi2) { - swap_UEs(UE_list,UE_id1,UE_id2,0); - } - } - } - } -} - void _dlsch_scheduler_pre_processor_allocate (module_id_t Mod_id, int UE_id, uint8_t CC_id, @@ -575,7 +472,9 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id, min_rb_unit[CC_id]=get_min_rb_unit(Mod_id,CC_id); - for (i=UE_list->head; i>=0; i=UE_list->next[i]) { + for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + if (UE_list->active[i] != TRUE) continue; + UE_id = i; // Initialize scheduling information for all active UEs @@ -603,24 +502,24 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id, _assign_rbs_required (Mod_id,slice_id, frameP,subframeP,nb_rbs_required,nb_rbs_allowed_slice,min_rb_unit); // Sorts the user on the basis of dlsch logical channel buffer and CQI - _sort_UEs (Mod_id,frameP,subframeP); + sort_UEs (Mod_id,frameP,subframeP); total_ue_count = 0; // loop over all active UEs - for (i=UE_list->head; i>=0; i=UE_list->next[i]) { + for (i=UE_list->head; i>=0; i=UE_list->next[i]) { rnti = flexran_get_ue_crnti(Mod_id, i); if(rnti == NOT_A_RNTI) continue; if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) continue; + UE_id = i; if (flexran_slice_member(UE_id, slice_id) == 0) continue; - // if there is no available harq_process, skip the UE - if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0) + if (!phy_stats_exist(Mod_id, rnti)) continue; for (ii=0; ii < UE_num_active_CC(UE_list,UE_id); ii++) { @@ -629,6 +528,10 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id, ue_sched_ctl->max_allowed_rbs[CC_id]=nb_rbs_allowed_slice[CC_id][slice_id]; flexran_get_harq(Mod_id, CC_id, UE_id, frameP, subframeP, &harq_pid, &round); + // if there is no available harq_process, skip the UE + if (UE_list->UE_sched_ctrl[UE_id].harq_pid[CC_id]<0) + continue; + average_rbs_per_user[CC_id]=0; frame_parms[CC_id] = mac_xface->get_lte_frame_parms(Mod_id,CC_id); @@ -670,6 +573,15 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id, for(i=UE_list->head; i>=0; i=UE_list->next[i]) { rnti = UE_RNTI(Mod_id,i); + if(rnti == NOT_A_RNTI) + continue; + + if (UE_list->UE_sched_ctrl[i].ul_out_of_sync == 1) + continue; + + if (!phy_stats_exist(Mod_id, rnti)) + continue; + if (flexran_slice_member(i, slice_id) == 0) continue; @@ -734,9 +646,13 @@ void _dlsch_scheduler_pre_processor (module_id_t Mod_id, // LOG_D(MAC,"UE %d rnti 0x\n", UE_id, rnti ); if(rnti == NOT_A_RNTI) continue; + if (UE_list->UE_sched_ctrl[UE_id].ul_out_of_sync == 1) continue; + if (!phy_stats_exist(Mod_id, rnti)) + continue; + transmission_mode = mac_xface->get_transmission_mode(Mod_id,CC_id,rnti); //rrc_status = mac_eNB_get_rrc_status(Mod_id,rnti); /* 1st allocate for the retx */ @@ -1061,11 +977,15 @@ flexran_schedule_ue_spec_common(mid_t mod_id, uint32_t ndi; flexran_agent_mac_create_empty_dl_config(mod_id, dl_info); + +#if 0 if (UE_list->head==-1) { return; } +#endif + start_meas(&eNB->schedule_dlsch); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); @@ -1107,8 +1027,9 @@ flexran_schedule_ue_spec_common(mid_t mod_id, if (mbsfn_flag[CC_id]>0) continue; - + for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { + rnti = flexran_get_ue_crnti(mod_id, UE_id); ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; @@ -1121,12 +1042,6 @@ flexran_schedule_ue_spec_common(mid_t mod_id, continue; } - if (flexran_get_ue_crnti(mod_id, UE_id) == NOT_A_RNTI) { - LOG_D(MAC,"[eNB] Cannot find UE\n"); - // mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n"); - continue; - } - if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) ) { continue; } diff --git a/openair2/LAYER2/MAC/pre_processor.c b/openair2/LAYER2/MAC/pre_processor.c index e7bfb348ee..7430509ae6 100644 --- a/openair2/LAYER2/MAC/pre_processor.c +++ b/openair2/LAYER2/MAC/pre_processor.c @@ -68,7 +68,7 @@ /* this function checks that get_eNB_UE_stats returns * a non-NULL pointer for all CCs for a given UE */ -static int phy_stats_exist(module_id_t Mod_id, int rnti) +int phy_stats_exist(module_id_t Mod_id, int rnti) { int CC_id; for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) diff --git a/openair2/LAYER2/MAC/proto.h b/openair2/LAYER2/MAC/proto.h index 5da2367cef..6665079c34 100644 --- a/openair2/LAYER2/MAC/proto.h +++ b/openair2/LAYER2/MAC/proto.h @@ -536,6 +536,7 @@ void store_ulsch_buffer(module_id_t module_idP, int frameP, sub_frame_t subframe void sort_ue_ul (module_id_t module_idP,int frameP, sub_frame_t subframeP); void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subframeP,uint16_t *first_rb); void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_template); +int phy_stats_exist(module_id_t Mod_id, int rnti); /*! \fn UE_L2_state_t ue_scheduler(const module_id_t module_idP,const frame_t frameP, const sub_frame_t subframe, const lte_subframe_t direction,const uint8_t eNB_index) \brief UE scheduler where all the ue background tasks are done. This function performs the following: 1) Trigger PDCP every 5ms 2) Call RRC for link status return to PHY3) Perform SR/BSR procedures for scheduling feedback 4) Perform PHR procedures. From c84f68cefc34687ca86690b4c3adf86a29521633 Mon Sep 17 00:00:00 2001 From: Anta Huang Date: Thu, 26 Jan 2017 18:43:05 +0100 Subject: [PATCH 05/25] fix the issue with RAN sharing --- openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 75821956cb..c8f45c2934 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -104,8 +104,8 @@ float total_slice_percentage = 0; int slice_maxmcs[MAX_NUM_SLICES] = {28, 28, 28, 28}; int slice_maxmcs_current[MAX_NUM_SLICES] = {28, 28, 28, 28}; -int update_dl_scheduler[MAX_NUM_SLICES] = {1, 0, 0, 0}; -int update_dl_scheduler_current[MAX_NUM_SLICES] = {1, 0, 0, 0}; +int update_dl_scheduler[MAX_NUM_SLICES] = {1, 1, 1, 1}; +int update_dl_scheduler_current[MAX_NUM_SLICES] = {1, 1, 1, 1}; // name of available scheduler char *dl_scheduler_type[MAX_NUM_SLICES] = {"flexran_schedule_ue_spec_embb", @@ -976,8 +976,6 @@ flexran_schedule_ue_spec_common(mid_t mod_id, uint8_t ue_has_transmission = 0; uint32_t ndi; - flexran_agent_mac_create_empty_dl_config(mod_id, dl_info); - #if 0 if (UE_list->head==-1) { @@ -990,7 +988,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); //weight = get_ue_weight(module_idP,UE_id); - aggregation = 1; // set to the maximum aggregation level + aggregation = 2; // set to the maximum aggregation level for (CC_id=0; CC_id Date: Fri, 27 Jan 2017 10:49:04 +0100 Subject: [PATCH 06/25] revert the value of the aggregation --- openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index c8f45c2934..0a509d00e9 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -988,7 +988,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_SCHEDULE_DLSCH,VCD_FUNCTION_IN); //weight = get_ue_weight(module_idP,UE_id); - aggregation = 2; // set to the maximum aggregation level + aggregation = 1; // set to the maximum aggregation level for (CC_id=0; CC_id Date: Fri, 27 Jan 2017 19:19:17 +0200 Subject: [PATCH 07/25] Fixed bug that prohibited 2 UEs to be scheduled at the same time --- .../MAC/flexran_agent_scheduler_dataplane.c | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c index 6347106e56..4af45ffea3 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c @@ -97,7 +97,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, unsigned char header_len = 0, header_len_tmp = 0; unsigned char sdu_lcids[11],offset,num_sdus=0; uint16_t nb_rb; - uint16_t TBS,j,sdu_lengths[11],rnti,padding=0,post_padding=0; + uint16_t TBS, sdu_lengths[11],rnti,padding=0,post_padding=0; unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES]; uint8_t round = 0; uint8_t harq_pid = 0; @@ -112,17 +112,16 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, int last_sdu_header_len = 0; - int i; + int i, j; Protocol__FlexDlData *dl_data; Protocol__FlexDlDci *dl_dci; uint32_t rlc_size, n_lc, lcid; - // For each UE-related command for (i = 0; i < n_dl_ue_data; i++) { - + dl_data = dl_ue_data[i]; dl_dci = dl_data->dl_dci; @@ -165,9 +164,9 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, // Go through each one of the channel commands and create SDUs header_len = 0; last_sdu_header_len = 0; - for (i = 0; i < n_lc; i++) { - lcid = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->logical_channel_id; - rlc_size = dl_data->rlc_pdu[i]->rlc_pdu_tb[0]->size; + for (j = 0; j < n_lc; j++) { + lcid = dl_data->rlc_pdu[j]->rlc_pdu_tb[0]->logical_channel_id; + rlc_size = dl_data->rlc_pdu[j]->rlc_pdu_tb[0]->size; LOG_D(MAC,"[TEST] [eNB %d] Frame %d, LCID %d, CC_id %d, Requesting %d bytes from RLC (RRC message)\n", mod_id, frame, lcid, CC_id, rlc_size); if (rlc_size > 0) { @@ -196,13 +195,13 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, lcid, rlc_size); // transport block set size - sdu_lengths[i] = 0; + sdu_lengths[j] = 0; LOG_D(MAC, "[TEST] RLC can give %d bytes for LCID %d during second call\n", rlc_status.bytes_in_buffer, lcid); if (rlc_status.bytes_in_buffer > 0) { - sdu_lengths[i] = mac_rlc_data_req(mod_id, + sdu_lengths[j] = mac_rlc_data_req(mod_id, rnti, mod_id, frame, @@ -211,14 +210,14 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, lcid, (char *)&dlsch_buffer[sdu_length_total]); - LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[i]); - sdu_length_total += sdu_lengths[i]; - sdu_lcids[i] = lcid; + LOG_D(MAC,"[eNB %d][LCID %d] CC_id %d Got %d bytes from RLC\n",mod_id, lcid, CC_id, sdu_lengths[j]); + sdu_length_total += sdu_lengths[j]; + sdu_lcids[j] = lcid; UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid] += 1; - UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[i]; + UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[j]; - if (sdu_lengths[i] < 128) { + if (sdu_lengths[j] < 128) { header_len += 2; last_sdu_header_len = 2; } else { @@ -259,7 +258,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, // If there is nothing to schedule, just leave if ((sdu_length_total) <= 0) { - return; + continue; } offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], @@ -271,6 +270,8 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, NULL, // contention res id padding, post_padding); + + #ifdef DEBUG_eNB_SCHEDULER LOG_T(MAC,"[eNB %d] First 16 bytes of DLSCH : \n"); @@ -288,7 +289,7 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, // fill remainder of DLSCH with random data for (j=0; j<(TBS-sdu_length_total-offset); j++) { UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset+sdu_length_total+j] = (char)(taus()&0xff); - } + } //eNB_mac_inst[0].DLSCH_pdu[0][0].payload[0][offset+sdu_lengths[0]+j] = (char)(taus()&0xff); if (opt_enabled == 1) { From afb60b850024bb624d12b2bb504ebf7aa2bd4fb4 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sat, 28 Jan 2017 17:32:16 -0500 Subject: [PATCH 08/25] initial LMS7002M register configuration. modifications for lte-ue and rf_device to use LimeSDR. --- openair1/PHY/MODULATION/ofdm_mod.c | 10 +- targets/ARCH/COMMON/common_lib.h | 3 + targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz.ini | 1128 +++++++++++++++++ .../ARCH/LMSSDR/LimeSDR_above_1p8GHz_1v4.ini | 1128 +++++++++++++++++ targets/ARCH/LMSSDR/LimeSDR_below_1p8GHz.ini | 1128 +++++++++++++++++ .../ARCH/LMSSDR/LimeSDR_below_1p8GHz_1v4.ini | 1128 +++++++++++++++++ targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp | 58 +- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 5 +- targets/RT/USER/lte-ue.c | 23 +- 9 files changed, 4580 insertions(+), 31 deletions(-) create mode 100755 targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz.ini create mode 100755 targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz_1v4.ini create mode 100755 targets/ARCH/LMSSDR/LimeSDR_below_1p8GHz.ini create mode 100755 targets/ARCH/LMSSDR/LimeSDR_below_1p8GHz_1v4.ini diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index 8e09cea1ec..680dec12e8 100644 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -136,7 +136,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input #ifdef DEBUG_OFDM_MOD printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]); #endif - + /* #ifndef __AVX2__ // handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC) idft((int16_t *)&input[i*fftsize], @@ -149,7 +149,11 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input 1); #endif + */ + idft((int16_t *)&input[i*fftsize], + (int16_t *)temp, + 1); // Copy to frame buffer with Cyclic Extension // Note: will have to adjust for synchronization offset! @@ -160,12 +164,12 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input // msg("Doing cyclic prefix method\n"); - + /* #ifndef __AVX2__ if (fftsize==128) #else if (fftsize<=512) -#endif + #endif*/ { for (j=0; j 1) { + printf("[LMS] Reduce RX Gain 0 by %f dB\n",openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0]); + ret = -1; + rxg_ratio = 1; + } + LMS_SetNormalizedGain(lms_device, LMS_CH_TX, 0, openair0_cfg[0].tx_gain[0]/100.0); - + LMS_SetNormalizedGain(lms_device, LMS_CH_RX, 0, .8*rxg_ratio); + /* // RX gains, use low-level setting - double gv = openair0_cfg[0].rx_gain[0] - openair0_cfg[0].rx_gain_offset[0]; if (gv > 31) { printf("RX Gain 0 too high, reduce by %f dB\n",gv-31); - gv = 31; + gv = 31; + ret=-1; } if (gv < 0) { printf("RX Gain 0 too low, increase by %f dB\n",-gv); - gv = 0; + gv = 0; + ret=-1; } printf("[LMS] Setting 7002M G_PGA_RBB to %d\n", (int16_t)gv); LMS7002M lms7; lms7.SetConnection(lms7.GetConnection()); lms7.Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB),(int16_t)gv); + */ - - return(0); + return(ret); } /*! \brief Start LMSSDR @@ -163,7 +174,8 @@ int trx_lms_start(openair0_device *device){ lms_info_str_t list[16]={0}; int n= LMS_GetDeviceList(list); - + int ret; + if (n <= 0) { fprintf(stderr, "No LimeSDR board found: %s\n", n < 0?LMS_GetLastErrorMessage():""); return -1; @@ -212,9 +224,9 @@ int trx_lms_start(openair0_device *device){ } printf("Set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6); - printf("Override antenna settings to: RX1_H, TXA_2"); - LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1); - LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2); + // printf("Override antenna settings to: RX1_H, TXA_2"); + // LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1); + // LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2); @@ -245,7 +257,7 @@ int trx_lms_start(openair0_device *device){ tx_stream.dataFmt = lms_stream_t::LMS_FMT_I12; tx_stream.isTx = true; - trx_lms_set_gains(device, device->openair0_cfg); + if ((ret = trx_lms_set_gains(device, device->openair0_cfg))<0) return(-1); if (LMS_SetupStream(lms_device, &tx_stream)!=0) printf("TX stream setup failed %s\n",LMS_GetLastErrorMessage()); @@ -259,6 +271,7 @@ int trx_lms_start(openair0_device *device){ printf("Failed to start TX stream %s\n",LMS_GetLastErrorMessage()); if (LMS_StartStream(&tx_stream)!=0) printf("Failed to start Rx stream %s\n",LMS_GetLastErrorMessage()); + device->trx_started=1; return 0; } @@ -272,6 +285,7 @@ int trx_lms_stop(openair0_device *device) { LMS_DestroyStream(lms_device,&rx_stream); LMS_DestroyStream(lms_device,&tx_stream); LMS_Close(lms_device); + device->trx_started=0; } /*! \brief Set frequencies (TX/RX) @@ -292,14 +306,22 @@ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,in // 31 = 19 dB => 105 dB total gain @ 2.6 GHz /*! \brief calibration table for LMSSDR */ +// V1.2 board +rx_gain_calib_table_t calib_table_lmssdr_1v2[] = { + {3500000000.0,44.0}, // on L PAD + {2660000000.0,62.0}, // on L PAD + {2300000000.0,62.0}, // on L PAD + {1880000000.0,64.0}, // on L PAD + {816000000.0,79.0}, // on W PAD + {-1,0}}; +// V1.4 board rx_gain_calib_table_t calib_table_lmssdr[] = { - {3500000000.0,70.0}, - {2660000000.0,80.0}, - {2300000000.0,80.0}, - {1880000000.0,74.0}, // on W PAD - {816000000.0,76.0}, // on W PAD + {3500000000.0,97.0}, // on H PAD + {2660000000.0,110.0}, // on H PAD + {2300000000.0,106.0}, // on H PAD + {1880000000.0,106.0}, // on H PAD + {816000000.0,102.0}, // on W PAD {-1,0}}; - @@ -332,7 +354,7 @@ int trx_lms_reset_stats(openair0_device* device) { */ void trx_lms_end(openair0_device *device) { - + device->trx_started=0; } extern "C" { diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index 2a2e09f40c..dc1f40d422 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -137,6 +137,8 @@ static int trx_usrp_start(openair0_device *device) s->tx_count = 0; s->rx_timestamp = 0; + device->trx_started=1; + return 0; } /*! \brief Terminate operation of the USRP transceiver -- free all associated resources @@ -152,7 +154,7 @@ static void trx_usrp_end(openair0_device *device) s->tx_md.end_of_burst = true; s->tx_stream->send("", 0, s->tx_md); s->tx_md.end_of_burst = false; - + device->trx_started=0; } /*! \brief Called to send samples to the USRP RF target @@ -453,6 +455,7 @@ int trx_usrp_set_gains(openair0_device* device, * \param card refers to the hardware index to use */ int trx_usrp_stop(openair0_device* device) { + device->trx_started=0; return(0); } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 10883921e7..1321a417c8 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -368,14 +368,15 @@ static void *UE_thread_synch(void *arg) while (sync_var<0) pthread_cond_wait(&sync_cond, &sync_mutex); - pthread_mutex_unlock(&sync_mutex); - printf("Started device, unlocked sync_mutex (UE_sync_thread)\n"); if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { LOG_E(HW,"Could not start the device\n"); oai_exit=1; } + pthread_mutex_unlock(&sync_mutex); + printf("Started device, unlocked sync_mutex (UE_sync_thread)\n"); + while (oai_exit==0) { if (pthread_mutex_lock(&UE->proc.mutex_synch) != 0) { @@ -485,13 +486,14 @@ static void *UE_thread_synch(void *arg) UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); //UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]); - UE->rfdevice.trx_stop_func(&UE->rfdevice); - sleep(1); - init_frame_parms(&UE->frame_parms,1); - if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { - LOG_E(HW,"Could not start the device\n"); - oai_exit=1; - } + + //UE->rfdevice.trx_stop_func(&UE->rfdevice); + // sleep(1); + // init_frame_parms(&UE->frame_parms,1); + // if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { + // LOG_E(HW,"Could not start the device\n"); + // oai_exit=1; + // } } else { UE->is_synchronized = 1; @@ -939,6 +941,9 @@ void *UE_thread(void *arg) { itti_send_msg_to_task (TASK_NAS_UE, INSTANCE_DEFAULT, message_p); #endif + while (UE->rfdevice.trx_started==0) + usleep(500); + while (!oai_exit) { if (UE->is_synchronized == 0) { From 02148c7950791b95ab9420728938e86db46a30be Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 29 Jan 2017 16:15:08 -0500 Subject: [PATCH 09/25] refit for USRP (control of DSP cordic), no more trx_stop during synchronization --- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 43 ++++++++++++++++++-- targets/RT/USER/lte-ue.c | 2 +- 2 files changed, 41 insertions(+), 4 deletions(-) diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index dc1f40d422..dc91d84c45 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -88,6 +88,12 @@ typedef struct //! Sampling rate double sample_rate; + //! rx RF frequency + double rx_RFfreq; + + //! tx RF frequency + double tx_RFfreq; + //! time offset between transmiter timestamp and receiver timestamp; double tdiff; @@ -390,14 +396,45 @@ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, usrp_state_t *s = (usrp_state_t*)device->priv; pthread_t f_thread; - printf("Setting USRP TX Freq %f, RX Freq %f\n",openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0]); + double rx_off,tx_off; + + if (fabs(s->rx_RFfreq-openair0_cfg[0].rx_freq[0])<1e6) { + // induce use of digital tuning + rx_off = s->rx_RFfreq-openair0_cfg[0].rx_freq[0]; + } + else { // allow UHD to select the frequnecy + rx_off = 0; + s->rx_RFfreq = openair0_cfg[0].rx_freq[0]; + } + + if (fabs(s->tx_RFfreq-openair0_cfg[0].tx_freq[0])<1e6) { + // induce use of digital tuning + tx_off = s->tx_RFfreq-openair0_cfg[0].tx_freq[0]; + } + else { // allow UHD to select the frequnecy + tx_off = 0; + s->tx_RFfreq = openair0_cfg[0].tx_freq[0]; + } + + printf("Setting USRP TX Freq %f (%f), RX Freq %f (%f)\n",s->tx_RFfreq,tx_off,s->rx_RFfreq,rx_off); + + // spawn a thread to handle the frequency change to not block the calling thread if (dont_block == 1) pthread_create(&f_thread,NULL,freq_thread,(void*)device); else { - s->usrp->set_tx_freq(device->openair0_cfg[0].tx_freq[0]); - s->usrp->set_rx_freq(device->openair0_cfg[0].rx_freq[0]); + uhd::tune_request_t treq_rx(s->rx_RFfreq+rx_off); + treq_rx.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL; + treq_rx.rf_freq = s->rx_RFfreq; + s->usrp->set_rx_freq(treq_rx); + + + uhd::tune_request_t treq_tx(s->tx_RFfreq+tx_off); + treq_tx.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL; + treq_tx.rf_freq = s->tx_RFfreq; + s->usrp->set_tx_freq(treq_tx); + } return(0); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 1321a417c8..be91012595 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -489,7 +489,7 @@ static void *UE_thread_synch(void *arg) //UE->rfdevice.trx_stop_func(&UE->rfdevice); // sleep(1); - // init_frame_parms(&UE->frame_parms,1); + init_frame_parms(&UE->frame_parms,1); // if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { // LOG_E(HW,"Could not start the device\n"); // oai_exit=1; From f1d4f4b93ccc9a014f1738e9c0c8a460329adc59 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Mon, 30 Jan 2017 14:23:19 +0200 Subject: [PATCH 10/25] Changed behavior of API for PUCCH power reports --- openair2/ENB_APP/flexran_agent_common.c | 56 +++++++++---------- .../MAC/flexran_agent_scheduler_dlsch_ue.c | 14 ++--- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index c7f5d894e2..fee894641a 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -716,43 +716,43 @@ int flexran_get_harq(const mid_t mod_id, } int flexran_get_p0_pucch_dbm(mid_t mod_id, mid_t ue_id, int CC_id) { - LTE_eNB_UE_stats *eNB_UE_stats = NULL; - uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); - - eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); - - if (eNB_UE_stats == NULL) { - return -1; - } - - if(eNB_UE_stats->Po_PUCCH_update == 1) { - return eNB_UE_stats->Po_PUCCH_dBm; - } - else - return -1; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + + if (eNB_UE_stats == NULL) { + return -1; + } + + // if(eNB_UE_stats->Po_PUCCH_update == 1) { + return eNB_UE_stats->Po_PUCCH_dBm; + //} + //else + // return -1; } int flexran_get_p0_nominal_pucch(mid_t mod_id, int CC_id) { - int32_t pucch_rx_received = mac_xface->get_target_pucch_rx_power(mod_id, CC_id); - return pucch_rx_received; + int32_t pucch_rx_received = mac_xface->get_target_pucch_rx_power(mod_id, CC_id); + return pucch_rx_received; } int flexran_get_p0_pucch_status(mid_t mod_id, mid_t ue_id, int CC_id) { - LTE_eNB_UE_stats *eNB_UE_stats = NULL; - uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); - - eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); - return eNB_UE_stats->Po_PUCCH_update; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + return eNB_UE_stats->Po_PUCCH_update; } int flexran_update_p0_pucch(mid_t mod_id, mid_t ue_id, int CC_id) { - LTE_eNB_UE_stats *eNB_UE_stats = NULL; - uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); - - eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); - eNB_UE_stats->Po_PUCCH_update = 0; - - return 0; + LTE_eNB_UE_stats *eNB_UE_stats = NULL; + uint32_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + eNB_UE_stats->Po_PUCCH_update = 0; + + return 0; } diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 0a509d00e9..83e65cd4ec 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -1390,21 +1390,17 @@ flexran_schedule_ue_spec_common(mid_t mod_id, // do PUCCH power control // this is the normalized RX power - //normalized_rx_power = flexran_get_p0_pucch_dbm(mod_id,UE_id, CC_id); //eNB_UE_stats->Po_PUCCH_dBm; - // target_rx_power = flexran_get_p0_nominal_pucch(mod_id, CC_id) + 10; //mac_xface->get_target_pucch_rx_power(mod_id, CC_id) + 10; - eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id,rnti); - normalized_rx_power = eNB_UE_stats->Po_PUCCH_dBm; - target_rx_power = mac_xface->get_target_pucch_rx_power(mod_id,CC_id) + 20; - + normalized_rx_power = flexran_get_p0_pucch_dbm(mod_id,UE_id, CC_id); //eNB_UE_stats->Po_PUCCH_dBm; + target_rx_power = flexran_get_p0_nominal_pucch(mod_id, CC_id) + 20; //mac_xface->get_target_pucch_rx_power(mod_id, CC_id) + 20; // this assumes accumulated tpc // make sure that we are only sending a tpc update once a frame, otherwise the control loop will freak out int32_t framex10psubframe = UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame*10+UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe; if (((framex10psubframe+10)<=(frame*10+subframe)) || //normal case ((framex10psubframe>(frame*10+subframe)) && (((10240-framex10psubframe+frame*10+subframe)>=10)))) //frame wrap-around - if (eNB_UE_stats->Po_PUCCH_update == 1){//flexran_get_p0_pucch_status(mod_id, UE_id, CC_id) == 1) { - // flexran_update_p0_pucch(mod_id, UE_id, CC_id); - eNB_UE_stats->Po_PUCCH_update = 0; + if (flexran_get_p0_pucch_status(mod_id, UE_id, CC_id) == 1) { + flexran_update_p0_pucch(mod_id, UE_id, CC_id); + UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frame; UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframe; From 6d6e1c868798d4269943011b3e0b4a03f8f0c3be Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Tue, 31 Jan 2017 19:15:51 +0200 Subject: [PATCH 11/25] Stability improvements for remote real-time control --- .../CONTROL_MODULES/MAC/flexran_agent_mac.c | 21 +++++++++++-------- .../ENB_APP/MESSAGES/V2/stats_common.proto | 1 + openair2/ENB_APP/flexran_agent_common.c | 11 +++++----- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c index e353f5fde7..c8c937f3b0 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -657,6 +657,8 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, full_ul_report->pucch_dbm[j]->p0_pucch_dbm = flexran_get_p0_pucch_dbm(enb_id,i,j); full_ul_report->pucch_dbm[j]->has_p0_pucch_dbm = 1; } + full_ul_report->pucch_dbm[j]->has_p0_pucch_updated = 1; + full_ul_report->pucch_dbm[j]->p0_pucch_updated = flexran_get_p0_pucch_status(enb_id, i, j); } //Add full UL CQI report to the UE report @@ -943,15 +945,14 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle subframe = (sub_frame_t) flexran_get_current_subframe(mod_id); subframe = ((subframe + ahead_of_time) % 10); - - int full_frames_ahead = ((ahead_of_time / 10) % 10); - frame = frame + full_frames_ahead; - if (subframe < flexran_get_current_subframe(mod_id)) { - frame++; + frame = (frame + 1) % 1024; } + int additional_frames = ahead_of_time / 10; + frame = (frame + additional_frames) % 1024; + sf_trigger_msg->header = header; sf_trigger_msg->has_sfn_sf = 1; sf_trigger_msg->sfn_sf = flexran_get_future_sfn_sf(mod_id, 1); @@ -976,8 +977,8 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i); dl_info[i]->has_rnti = 1; /*Fill in the right id of this round's HARQ process for this UE*/ - unsigned char harq_id; - unsigned char harq_status; + uint8_t harq_id; + uint8_t harq_status; flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status); dl_info[i]->harq_process_id = harq_id; dl_info[i]->has_harq_process_id = 1; @@ -985,11 +986,13 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle dl_info[i]->n_harq_status = 2; dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status); for (j = 0; j < dl_info[i]->n_harq_status; j++) { + dl_info[i]->harq_status[j] = harq_status; // TODO: This should be different per TB - if(harq_status == 0) + if(harq_status == 0) { dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_ACK; - else if (harq_status > 0) + } else { dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_NACK; + } } /*Fill in the serving cell index for this UE */ dl_info[i]->serv_cell_index = UE_PCCID(mod_id,i); diff --git a/openair2/ENB_APP/MESSAGES/V2/stats_common.proto b/openair2/ENB_APP/MESSAGES/V2/stats_common.proto index 70f99618ac..080883ea97 100644 --- a/openair2/ENB_APP/MESSAGES/V2/stats_common.proto +++ b/openair2/ENB_APP/MESSAGES/V2/stats_common.proto @@ -166,6 +166,7 @@ message flex_ul_cqi_report { message flex_pucch_dbm { optional int32 p0_pucch_dbm = 1; optional uint32 serv_cell_index = 2; + optional uint32 p0_pucch_updated = 3; } // diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index fee894641a..8b74ee22fb 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -516,15 +516,14 @@ uint16_t flexran_get_future_sfn_sf (mid_t mod_id, int ahead_of_time) { subframe = (sub_frame_t) flexran_get_current_subframe(mod_id); subframe = ((subframe + ahead_of_time) % 10); - - int full_frames_ahead = ((ahead_of_time / 10) % 10); - frame = frame + full_frames_ahead; - if (subframe < flexran_get_current_subframe(mod_id)) { - frame++; + frame = (frame + 1) % 1024; } - + + int additional_frames = ahead_of_time / 10; + frame = (frame + additional_frames) % 1024; + frame_mask = ((1<<12) - 1); sf_mask = ((1<<4) - 1); sfn_sf = (subframe & sf_mask) | ((frame & frame_mask) << 4); From 90cb9d6cb89610f0d9c403b0d783c3129280905f Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Wed, 1 Feb 2017 23:17:54 -0800 Subject: [PATCH 12/25] adding RRU/Fronthaul functionality to oaisim --- cmake_targets/CMakeLists.txt | 3 +- cmake_targets/build_oai | 13 +- openair1/PHY/defs.h | 1 + .../ETHERNET/USERSPACE/LIB/ethernet_lib.c | 2 +- targets/RT/USER/lte-enb.c | 37 +++--- targets/RT/USER/lte-softmodem.c | 4 +- targets/RT/USER/lte-ue.c | 10 +- targets/SIMU/USER/oaisim.c | 26 +++- targets/SIMU/USER/oaisim_functions.c | 119 +++++++++++++++++- 9 files changed, 183 insertions(+), 32 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 94ff4b239a..2e2f64b5f6 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1883,6 +1883,7 @@ add_executable(oaisim ${OPENAIR_TARGETS}/SIMU/USER/oaisim_functions.c ${OPENAIR_TARGETS}/SIMU/USER/event_handler.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim.c + ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c @@ -1897,7 +1898,7 @@ add_executable(oaisim target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER) target_link_libraries (oaisim - -Wl,--start-group + -Wl,-ldl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} LIB_NAS_UE SIMU SIMU_ETH SECU_OSA ${ITTI_LIB} ${MIH_LIB} -Wl,--end-group ) diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai index 0a64c0a672..ceacea9f51 100755 --- a/cmake_targets/build_oai +++ b/cmake_targets/build_oai @@ -418,9 +418,9 @@ function main() { if [ "$oaisim" = "1" ] ; then #to be discussed - # there is no RF device and no transport protocol + # there is no RF device transport protocol HW="None" - TP="None" + TP="ETHERNET" if [ "$XFORMS" == "True" ] ; then PRINT_STATS="True" @@ -666,6 +666,15 @@ function main() { CMakeFiles/oai_nw_drv/oai_nw_drv.ko $dbin/oai_nw_drv.ko fi + if [ "$TP" == "ETHERNET" ] ; then + compilations \ + $oaisim_build_dir oai_eth_transpro \ + liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL + ln -s liboai_eth_transpro.so liboai_transpro.so + ln -s $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so + echo_info "liboai_transpro.so is linked with ETHERNET library" + fi + cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file diff --git a/openair1/PHY/defs.h b/openair1/PHY/defs.h index a679644b8b..3173c7b0ad 100644 --- a/openair1/PHY/defs.h +++ b/openair1/PHY/defs.h @@ -430,6 +430,7 @@ typedef struct PHY_VARS_eNB_s { eNB_proc_t proc; eNB_func_t node_function; eNB_timing_t node_timing; + eth_params_t *eth_params; int single_thread_flag; openair0_rf_map rf_map; int abstraction_flag; diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c index 6f93ba4853..26f2c61220 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c @@ -97,7 +97,7 @@ int trx_eth_start(openair0_device *device) { if(eth_set_dev_conf_udp(device)!=0) return -1; } else { if(eth_get_dev_conf_udp(device)!=0) return -1; - } + } } /* apply additional configuration */ if(ethernet_tune (device, SND_BUF_SIZE,2000000000)!=0) return -1; diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index 0605dff2ab..fd67ec1ee3 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -130,6 +130,8 @@ extern int sync_var; extern int transmission_mode; +extern int oaisim_flag; + //pthread_t main_eNB_thread; time_stats_t softmodem_stats_mt; // main thread @@ -1986,6 +1988,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB = PHY_vars_eNB_g[inst][CC_id]; eNB->node_function = node_function[CC_id]; eNB->node_timing = node_timing[CC_id]; + eNB->eth_params = eth_params+CC_id; eNB->abstraction_flag = 0; eNB->single_thread_flag = single_thread_flag; eNB->ts_offset = 0; @@ -2011,14 +2014,16 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->start_rf = start_rf; eNB->start_if = start_if; eNB->fh_asynch = fh_if5_asynch_DL; - ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]); - if (ret<0) { - printf("Exiting, cannot initialize rf device\n"); - exit(-1); - } + if (oaisim_flag == 0) { + ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]); + if (ret<0) { + printf("Exiting, cannot initialize rf device\n"); + exit(-1); + } + } eNB->rfdevice.host_type = RRH_HOST; eNB->ifdevice.host_type = RRH_HOST; - ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], (eth_params+CC_id)); + ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params); printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id); if (ret<0) { printf("Exiting, cannot initialize transport protocol\n"); @@ -2038,15 +2043,17 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->fh_asynch = fh_if4p5_asynch_DL; eNB->start_rf = start_rf; eNB->start_if = start_if; - ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]); - if (ret<0) { - printf("Exiting, cannot initialize rf device\n"); - exit(-1); - } + if (oaisim_flag == 0) { + ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]); + if (ret<0) { + printf("Exiting, cannot initialize rf device\n"); + exit(-1); + } + } eNB->rfdevice.host_type = RRH_HOST; eNB->ifdevice.host_type = RRH_HOST; printf("loading transport interface ...\n"); - ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], (eth_params+CC_id)); + ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params); printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id); if (ret<0) { printf("Exiting, cannot initialize transport protocol\n"); @@ -2103,7 +2110,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->ifdevice.host_type = BBU_HOST; - ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], (eth_params+CC_id)); + ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params); printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id); if (ret<0) { printf("Exiting, cannot initialize transport protocol\n"); @@ -2125,7 +2132,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->fh_asynch = (eNB->node_timing == synch_to_other) ? fh_if4p5_asynch_UL : NULL; eNB->rfdevice.host_type = BBU_HOST; eNB->ifdevice.host_type = BBU_HOST; - ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], (eth_params+CC_id)); + ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params); printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id); if (ret<0) { printf("Exiting, cannot initialize transport protocol\n"); @@ -2151,7 +2158,7 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->rfdevice.host_type = BBU_HOST; eNB->ifdevice.host_type = BBU_HOST; - ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], (eth_params+CC_id)); + ret = openair0_transport_load(&eNB->ifdevice, &openair0_cfg[CC_id], eNB->eth_params); printf("openair0_transport_init returns %d for CC_id %d\n",ret,CC_id); if (ret<0) { printf("Exiting, cannot initialize transport protocol\n"); diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index 6a2aa28d7a..fe1584309e 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -112,7 +112,7 @@ extern int netlink_init(void); // In lte-enb.c extern int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_cfg); -extern void init_eNB(eNB_func_t *, eNB_timing_t *,int,eth_params_t *,int,int); +extern void init_eNB(eNB_func_t *, eNB_timing_t *,int),eth_params_t *,int,int); extern void stop_eNB(int); extern void kill_eNB_proc(void); @@ -285,7 +285,7 @@ double cpuf; char uecap_xer[1024],uecap_xer_in=0; - +int oaisim_flag=0; /*---------------------BMC: timespec helpers -----------------------------*/ diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 10883921e7..03ee205ac6 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -110,6 +110,8 @@ extern int rx_input_level_dBm; extern uint8_t exit_missed_slots; extern uint64_t num_missed_slots; // counter for the number of missed slots +extern int oaisim_flag; + extern void exit_fun(const char* s); #define KHz (1000UL) @@ -180,9 +182,11 @@ void init_UE(int nb_inst) { sleep(1); UE = PHY_vars_UE_g[inst][0]; - ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]); - if (ret !=0){ - exit_fun("Error loading device library"); + if (oaisim_flag == 0) { + ret = openair0_device_load(&(UE->rfdevice), &openair0_cfg[0]); + if (ret !=0){ + exit_fun("Error loading device library"); + } } UE->rfdevice.host_type = BBU_HOST; // UE->rfdevice.type = NONE_DEV; diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 3a06a62780..46410c7548 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -1286,7 +1286,25 @@ main (int argc, char **argv) init_openair2 (); + init_openair0(); + init_ocm (); + +#if defined(ENABLE_ITTI) + // Handle signals until all tasks are terminated + + // Note: Cannot handle both RRU/RAU and eNB at the same time, if the first "eNB" is an RRU/RAU, no NAS + if (oai_emulation.info.node_function[0] < NGFI_RAU_IF4p5) { + if (create_tasks(oai_emulation.info.nb_enb_local, + oai_emulation.info.nb_ue_local) < 0) + exit(-1); // need a softer mode + } + else { + if (create_tasks(0, + oai_emulation.info.nb_ue_local) < 0) + exit(-1); // need a softer mode + } +#endif // wait for all threads to startup sleep(3); @@ -1327,12 +1345,8 @@ main (int argc, char **argv) #if defined(ENABLE_ITTI) - // Handle signals until all tasks are terminated - if (create_tasks(oai_emulation.info.nb_enb_local, oai_emulation.info.nb_ue_local) >= 0) { - itti_wait_tasks_end(); - } else { - exit(-1); // need a softer mode - } + itti_wait_tasks_end(); + #else diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 130a339390..50472db585 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -77,6 +77,9 @@ # include "s1ap_eNB.h" #endif +#include "../../ARCH/COMMON/common_lib.h" +#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" + #ifdef SMBV extern uint8_t config_smbv; extern char smbv_ip[16]; @@ -88,6 +91,8 @@ extern char smbv_ip[16]; #define K 2 // averaging coefficient #define TARGET_SF_TIME_NS 1000000 // 1ms = 1000000 ns +#define min(a,b) ((a)<(b)?(a):(b)) + int otg_times = 0; int if_times = 0; int for_times = 0; @@ -170,11 +175,14 @@ extern int xforms; extern uint32_t downlink_frequency[MAX_NUM_CCs][4]; extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4]; -void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst); +eth_params_t *eth_params; + +void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst,eth_params_t *,int,int); void stop_eNB(int nb_inst); const Enb_properties_array_t *enb_properties; +int oaisim_flag=1; void get_simulation_options(int argc, char *argv[]) { @@ -786,7 +794,33 @@ void get_simulation_options(int argc, char *argv[]) AssertFatal (oai_emulation.info.nb_enb_local <= enb_properties->number, "Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!", conf_config_file_name, oai_emulation.info.nb_enb_local, enb_properties->number); + + eth_params = (eth_params_t*)malloc(enb_properties->properties[0]->nb_rrh_gw * sizeof(eth_params_t)); + memset(eth_params, 0, enb_properties->properties[0]->nb_rrh_gw * sizeof(eth_params_t)); + for (int j=0; jproperties[0]->nb_rrh_gw; j++) { + + if (enb_properties->properties[0]->rrh_gw_config[j].active == 1 ) { + // local_remote_radio = BBU_REMOTE_RADIO_HEAD; + (eth_params+j)->local_if_name = enb_properties->properties[0]->rrh_gw_config[j].rrh_gw_if_name; + (eth_params+j)->my_addr = enb_properties->properties[0]->rrh_gw_config[j].local_address; + (eth_params+j)->my_port = enb_properties->properties[0]->rrh_gw_config[j].local_port; + (eth_params+j)->remote_addr = enb_properties->properties[0]->rrh_gw_config[j].remote_address; + (eth_params+j)->remote_port = enb_properties->properties[0]->rrh_gw_config[j].remote_port; + + if (enb_properties->properties[0]->rrh_gw_config[j].raw == 1) { + (eth_params+j)->transp_preference = ETH_RAW_MODE; + } else if (enb_properties->properties[0]->rrh_gw_config[j].rawif4p5 == 1) { + (eth_params+j)->transp_preference = ETH_RAW_IF4p5_MODE; + } else if (enb_properties->properties[0]->rrh_gw_config[j].udpif4p5 == 1) { + (eth_params+j)->transp_preference = ETH_UDP_IF4p5_MODE; + } else if (enb_properties->properties[0]->rrh_gw_config[j].rawif5_mobipass == 1) { + (eth_params+j)->transp_preference = ETH_RAW_IF5_MOBIPASS; + } else { + (eth_params+j)->transp_preference = ETH_UDP_MODE; + } + } + } /* Update some simulation parameters */ oai_emulation.info.frame_type[0] = enb_properties->properties[0]->frame_type[0]; oai_emulation.info.tdd_config[0] = enb_properties->properties[0]->tdd_config[0]; @@ -1126,6 +1160,85 @@ int UE_trx_write(openair0_device *device,openair0_timestamp timestamp, void **bu return(nsamps); } +void init_openair0(void); + +openair0_config_t openair0_cfg[MAX_CARDS]; + +void init_openair0() { + + int card; + int i; + + for (card=0; cardN_RB_DL == 100) { + if (frame_parms[0]->threequarter_fs) { + openair0_cfg[card].sample_rate=23.04e6; + openair0_cfg[card].samples_per_frame = 230400; + openair0_cfg[card].tx_bw = 10e6; + openair0_cfg[card].rx_bw = 10e6; + } + else { + openair0_cfg[card].sample_rate=30.72e6; + openair0_cfg[card].samples_per_frame = 307200; + openair0_cfg[card].tx_bw = 10e6; + openair0_cfg[card].rx_bw = 10e6; + } + } else if(frame_parms[0]->N_RB_DL == 50) { + openair0_cfg[card].sample_rate=15.36e6; + openair0_cfg[card].samples_per_frame = 153600; + openair0_cfg[card].tx_bw = 5e6; + openair0_cfg[card].rx_bw = 5e6; + } else if (frame_parms[0]->N_RB_DL == 25) { + openair0_cfg[card].sample_rate=7.68e6; + openair0_cfg[card].samples_per_frame = 76800; + openair0_cfg[card].tx_bw = 2.5e6; + openair0_cfg[card].rx_bw = 2.5e6; + } else if (frame_parms[0]->N_RB_DL == 6) { + openair0_cfg[card].sample_rate=1.92e6; + openair0_cfg[card].samples_per_frame = 19200; + openair0_cfg[card].tx_bw = 1.5e6; + openair0_cfg[card].rx_bw = 1.5e6; + } + + if (frame_parms[0]->frame_type==TDD) + openair0_cfg[card].duplex_mode = duplex_mode_TDD; + else //FDD + openair0_cfg[card].duplex_mode = duplex_mode_FDD; + + + openair0_cfg[card].remote_addr = (eth_params+card)->remote_addr; + openair0_cfg[card].remote_port = (eth_params+card)->remote_port; + openair0_cfg[card].my_addr = (eth_params+card)->my_addr; + openair0_cfg[card].my_port = (eth_params+card)->my_port; + + + printf("HW: Configuring card %d, nb_antennas_tx/rx %d/%d\n",card, + PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx, + PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx); + openair0_cfg[card].Mod_id = 0; + + + + openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL; + openair0_cfg[card].tx_num_channels=min(2,PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_tx); + openair0_cfg[card].rx_num_channels=min(2,PHY_vars_eNB_g[0][0]->frame_parms.nb_antennas_rx); + + for (i=0; i<4; i++) { + + openair0_cfg[card].rx_gain[i] = PHY_vars_eNB_g[0][0]->rx_total_gain_dB; + + printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n", + card,i, openair0_cfg[card].tx_gain[i], + openair0_cfg[card].rx_gain[i], + openair0_cfg[card].tx_freq[i], + openair0_cfg[card].rx_freq[i]); + } + } +} + void init_devices(void){ module_id_t UE_id, eNB_id; @@ -1270,7 +1383,7 @@ void init_openair1(void) init_devices (); - init_eNB(oai_emulation.info.node_function,oai_emulation.info.node_timing,NB_eNB_INST); + init_eNB(oai_emulation.info.node_function,oai_emulation.info.node_timing,NB_eNB_INST,eth_params,1,0); // init_ue_status(); for (UE_id=0; UE_id Date: Thu, 2 Feb 2017 17:51:58 +0200 Subject: [PATCH 13/25] Bug fixes for proper reporting of HARQs to the controller --- openair1/SCHED/phy_procedures_lte_eNb.c | 31 +++++---- .../CONTROL_MODULES/MAC/flexran_agent_mac.c | 64 +++++++++++++++---- openair2/ENB_APP/flexran_agent_extern.h | 4 ++ .../MAC/flexran_agent_scheduler_dataplane.c | 9 ++- 4 files changed, 77 insertions(+), 31 deletions(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index cad508c7c2..755bb5c868 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -92,6 +92,9 @@ extern uint16_t hundred_times_log10_NPRB[100]; unsigned int max_peak_val; int max_sync_pos; +int harq_pid_updated[NUMBER_OF_UE_MAX][8] = {{0}}; +int harq_pid_round[NUMBER_OF_UE_MAX][8] = {{0}}; + //DCI_ALLOC_t dci_alloc[8]; #ifdef EMOS @@ -1444,15 +1447,6 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, eNB->dlsch_ra->active = 0; } -#if defined(FLEXRAN_AGENT_SB_IF) -#ifndef DISABLE_SF_TRIGGER - //Send subframe trigger to the controller - if (mac_agent_registered[eNB->Mod_id]) { - agent_mac_xface[eNB->Mod_id]->flexran_agent_send_sf_trigger(eNB->Mod_id); - } -#endif -#endif - // Now scan UE specific DLSCH for (UE_id=0; UE_idsubframe_rx; int harq_pid = subframe2harq_pid( fp,frame,subframe); - if (fp->frame_type == FDD) { //FDD subframe_m4 = (subframe<4) ? subframe+6 : subframe-4; @@ -1681,6 +1674,7 @@ void process_HARQ_feedback(uint8_t UE_id, mp = m; dl_harq_pid[m] = dlsch->harq_ids[dl_subframe]; + harq_pid_updated[UE_id][dl_harq_pid[m]] = 1; if ((pucch_sel != 2)&&(pusch_flag == 0)) { // multiplexing if ((SR_payload == 1)&&(all_ACKed == 1)) @@ -1768,7 +1762,7 @@ void process_HARQ_feedback(uint8_t UE_id, eNB->dlsch[(uint8_t)UE_id][0]->harq_processes[dl_harq_pid[m]]->TBS; */ } - + // Do fine-grain rate-adaptation for DLSCH if (ue_stats->dlsch_NAK_round0 > dlsch->error_threshold) { if (ue_stats->dlsch_mcs_offset == 1) @@ -1781,7 +1775,7 @@ void process_HARQ_feedback(uint8_t UE_id, LOG_D(PHY,"[process_HARQ_feedback] Frame %d Setting round to %d for pid %d (subframe %d)\n",frame, dlsch_harq_proc->round,dl_harq_pid[m],subframe); #endif - + harq_pid_round[UE_id][dl_harq_pid[m]] = dlsch_harq_proc->round; // Clear NAK stats and adjust mcs offset // after measurement window timer expires if (ue_stats->dlsch_sliding_cnt == dlsch->ra_window_size) { @@ -1800,8 +1794,6 @@ void process_HARQ_feedback(uint8_t UE_id, ue_stats->dlsch_NAK_round0 = 0; ue_stats->dlsch_sliding_cnt = 0; } - - } } } @@ -3422,14 +3414,21 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const } #endif - - //} #ifdef EMOS phy_procedures_emos_eNB_RX(subframe,eNB); #endif +#if defined(FLEXRAN_AGENT_SB_IF) +#ifndef DISABLE_SF_TRIGGER + //Send subframe trigger to the controller + if (mac_agent_registered[eNB->Mod_id]) { + agent_mac_xface[eNB->Mod_id]->flexran_agent_send_sf_trigger(eNB->Mod_id); + } +#endif +#endif + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC+offset, 0 ); stop_meas(&eNB->phy_proc_rx); diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c index c8c937f3b0..364a42d35c 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -923,9 +923,13 @@ int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg) { int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg) { Protocol__FlexHeader *header; - int i,j; + int i, j, UE_id; + + int available_harq[NUMBER_OF_UE_MAX]; + const int xid = *((int *)params); + Protocol__FlexSfTrigger *sf_trigger_msg; sf_trigger_msg = malloc(sizeof(Protocol__FlexSfTrigger)); if (sf_trigger_msg == NULL) { @@ -939,7 +943,11 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle frame_t frame; sub_frame_t subframe; - int ahead_of_time = 1; + for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + available_harq[i] = -1; + } + + int ahead_of_time = 0; frame = (frame_t) flexran_get_current_system_frame_num(mod_id); subframe = (sub_frame_t) flexran_get_current_subframe(mod_id); @@ -957,10 +965,24 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle sf_trigger_msg->has_sfn_sf = 1; sf_trigger_msg->sfn_sf = flexran_get_future_sfn_sf(mod_id, 1); + sf_trigger_msg->n_dl_info = 0; + + for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + for (j = 0; j < 8; j++) { + if (harq_pid_updated[i][j] == 1) { + available_harq[i] = j; + sf_trigger_msg->n_dl_info++; + break; + } + } + } + + // LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10); + /*TODO: Fill in the number of dl HARQ related info, based on the number of currently *transmitting UEs */ - sf_trigger_msg->n_dl_info = flexran_get_num_ues(mod_id); + // sf_trigger_msg->n_dl_info = flexran_get_num_ues(mod_id); Protocol__FlexDlInfo **dl_info = NULL; @@ -968,8 +990,14 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle dl_info = malloc(sizeof(Protocol__FlexDlInfo *) * sf_trigger_msg->n_dl_info); if(dl_info == NULL) goto error; + i = -1; //Fill the status of the current HARQ process for each UE - for(i = 0; i < sf_trigger_msg->n_dl_info; i++) { + for(UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) { + if (available_harq[UE_id] < 0) { + continue; + } else { + i++; + } dl_info[i] = malloc(sizeof(Protocol__FlexDlInfo)); if(dl_info[i] == NULL) goto error; @@ -977,22 +1005,24 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i); dl_info[i]->has_rnti = 1; /*Fill in the right id of this round's HARQ process for this UE*/ - uint8_t harq_id; - uint8_t harq_status; - flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status); - dl_info[i]->harq_process_id = harq_id; + // uint8_t harq_id; + //uint8_t harq_status; + // flexran_get_harq(mod_id, UE_PCCID(mod_id,i), i, frame, subframe, &harq_id, &harq_status); + + + dl_info[i]->harq_process_id = available_harq[UE_id]; + harq_pid_updated[UE_id][available_harq[UE_id]] = 0; dl_info[i]->has_harq_process_id = 1; /* Fill in the status of the HARQ process (2 TBs)*/ dl_info[i]->n_harq_status = 2; dl_info[i]->harq_status = malloc(sizeof(uint32_t) * dl_info[i]->n_harq_status); for (j = 0; j < dl_info[i]->n_harq_status; j++) { - dl_info[i]->harq_status[j] = harq_status; + dl_info[i]->harq_status[j] = harq_pid_round[UE_id][available_harq[UE_id]]; // TODO: This should be different per TB - if(harq_status == 0) { - dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_ACK; - } else { - dl_info[i]->harq_status[j] = PROTOCOL__FLEX_HARQ_STATUS__FLHS_NACK; - } + } + // LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d and harq %d (round %d)\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10, dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]); + if(dl_info[i]->harq_status[0] > 0) { + // LOG_I(FLEXRAN_AGENT, "[Frame %d][Subframe %d]Need to make a retransmission for harq %d (round %d)\n", flexran_get_current_frame(mod_id), flexran_get_current_subframe(mod_id), dl_info[i]->harq_process_id, dl_info[i]->harq_status[0]); } /*Fill in the serving cell index for this UE */ dl_info[i]->serv_cell_index = UE_PCCID(mod_id,i); @@ -1237,12 +1267,18 @@ int flexran_agent_mac_handle_dl_mac_config(mid_t mod_id, const void *params, Pro } void flexran_agent_init_mac_agent(mid_t mod_id) { + int i, j; lfds700_misc_library_init_valid_on_current_logical_core(); lfds700_misc_prng_init(&ps[mod_id]); int num_elements = RINGBUFFER_SIZE + 1; //Allow RINGBUFFER_SIZE messages to be stored in the ringbuffer at any time dl_mac_config_array[mod_id] = malloc( sizeof(struct lfds700_ringbuffer_element) * num_elements); lfds700_ringbuffer_init_valid_on_current_logical_core( &ringbuffer_state[mod_id], dl_mac_config_array[mod_id], num_elements, &ps[mod_id], NULL ); + for (i = 0; i < NUMBER_OF_UE_MAX; i++) { + for (j = 0; j < 8; j++) { + harq_pid_updated[i][j] = 0; + } + } } /*********************************************** diff --git a/openair2/ENB_APP/flexran_agent_extern.h b/openair2/ENB_APP/flexran_agent_extern.h index 3a03239e6f..4a04d5d3a6 100644 --- a/openair2/ENB_APP/flexran_agent_extern.h +++ b/openair2/ENB_APP/flexran_agent_extern.h @@ -45,4 +45,8 @@ extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; /* Flag indicating whether the VSFs for the MAC control module have been registered */ extern unsigned int mac_agent_registered[NUM_MAX_ENB]; +/* Requried to know which UEs had a harq updated over some subframe */ +extern int harq_pid_updated[NUMBER_OF_UE_MAX][8]; +extern int harq_pid_round[NUMBER_OF_UE_MAX][8]; + #endif diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c index 4af45ffea3..433d8d25dd 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c @@ -53,6 +53,7 @@ #include "header.pb-c.h" #include "flexran.pb-c.h" +#include "flexran_agent_extern.h" #include "SIMULATION/TOOLS/defs.h" // for taus @@ -137,6 +138,9 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, round = dl_dci->rv[0]; harq_pid = dl_dci->harq_process; + //LOG_I(FLEXRAN_AGENT, "[Frame %d][Subframe %d] Scheduling harq %d\n", frame, subframe, harq_pid); + // LOG_I(FLEXRAN_AGENT, "[Frame %d][Subframe %d]Now scheduling harq_pid %d (round %d)\n", frame, subframe, harq_pid, round); + // If this is a new transmission if (round == 0) { // First we have to deal with the creation of the PDU based on the message instructions @@ -258,8 +262,12 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, // If there is nothing to schedule, just leave if ((sdu_length_total) <= 0) { + harq_pid_updated[UE_id][harq_pid] = 1; + harq_pid_round[UE_id][harq_pid] = 0; continue; } + + // LOG_I(FLEXRAN_AGENT, "[Frame %d][Subframe %d] TBS is %d and bytes are %d\n", frame, subframe, TBS, sdu_length_total); offset = generate_dlsch_header((unsigned char*)UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], num_sdus, //num_sdus @@ -338,7 +346,6 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, } } else { // No need to create anything apart of DCI in case of retransmission - /*TODO: Must add these */ // eNB_UE_stats->dlsch_trials[round]++; //UE_list->eNB_UE_stats[CC_id][UE_id].num_retransmission+=1; From 0e687fb765f14120c5fea897cdd88cd6126c8906 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Fri, 3 Feb 2017 19:39:47 +0200 Subject: [PATCH 14/25] Fixed bug related to the reporting of timing advance to the controller that severely dropped the performance of the remote scheduler --- .../CONTROL_MODULES/MAC/flexran_agent_mac.c | 8 +- openair2/ENB_APP/flexran_agent_common.c | 84 ++++++++++--------- openair2/ENB_APP/flexran_agent_common.h | 5 +- openair2/ENB_APP/flexran_agent_handler.c | 2 +- .../MAC/flexran_agent_scheduler_dataplane.c | 45 ++++++---- .../MAC/flexran_agent_scheduler_dlsch_ue.c | 3 +- 6 files changed, 82 insertions(+), 65 deletions(-) diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c index 364a42d35c..504e157b95 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -443,11 +443,11 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, if (rlc_reports[j] == NULL) goto error; protocol__flex_rlc_bsr__init(rlc_reports[j]); - rlc_reports[j]->lc_id = j+1; + rlc_reports[j]->lc_id = j + 1; rlc_reports[j]->has_lc_id = 1; - rlc_reports[j]->tx_queue_size = flexran_get_tx_queue_size(enb_id,i,j+1); + rlc_reports[j]->tx_queue_size = flexran_get_tx_queue_size(enb_id,i,j + 1); rlc_reports[j]->has_tx_queue_size = 1; - + //TODO:Set tx queue head of line delay in ms rlc_reports[j]->tx_queue_hol_delay = 100; rlc_reports[j]->has_tx_queue_hol_delay = 0; @@ -963,7 +963,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle sf_trigger_msg->header = header; sf_trigger_msg->has_sfn_sf = 1; - sf_trigger_msg->sfn_sf = flexran_get_future_sfn_sf(mod_id, 1); + sf_trigger_msg->sfn_sf = flexran_get_future_sfn_sf(mod_id, 3); sf_trigger_msg->n_dl_info = 0; diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 8b74ee22fb..e25d67e05a 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -562,57 +562,63 @@ int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) { int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) { rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); - mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO,channel_id,0); + mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0); return rlc_status.bytes_in_buffer; } -int flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) { +short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id) { UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list; UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; int rnti; rnti = flexran_get_ue_crnti(mod_id, ue_id); - if (ue_sched_ctl->ta_timer == 0) { - // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ... - LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); - ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY - switch (PHY_vars_eNB_g[mod_id][CC_id]->frame_parms.N_RB_DL) { - case 6: - ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update; - break; - - case 15: - ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/2; - break; - - case 25: - ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/4; - break; - - case 50: - ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/8; - break; - - case 75: - ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/12; - break; - - case 100: - ue_sched_ctl->ta_update = eNB_UE_stats->timing_advance_update/16; - break; + LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + //ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY + switch (PHY_vars_eNB_g[mod_id][CC_id]->frame_parms.N_RB_DL) { + case 6: + return eNB_UE_stats->timing_advance_update; + case 15: + return eNB_UE_stats->timing_advance_update/2; + case 25: + return eNB_UE_stats->timing_advance_update/4; + case 50: + return eNB_UE_stats->timing_advance_update/8; + case 75: + return eNB_UE_stats->timing_advance_update/12; + case 100: + if (PHY_vars_eNB_g[mod_id][CC_id]->frame_parms.threequarter_fs == 0) { + return eNB_UE_stats->timing_advance_update/16; + } else { + return eNB_UE_stats->timing_advance_update/12; } + default: + return 0; + } +} + +void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) { + + UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list; + UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; + + int rnti; + + rnti = flexran_get_ue_crnti(mod_id, ue_id); + if (ue_sched_ctl->ta_timer == 0) { + + // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ... + // LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id, CC_id, rnti); + //ue_sched_ctl->ta_timer = 20; // wait 20 subframes before taking TA measurement from PHY + ue_sched_ctl->ta_update = flexran_get_TA(mod_id, ue_id, CC_id); + // clear the update in case PHY does not have a new measurement after timer expiry - eNB_UE_stats->timing_advance_update = 0; - } - else { + // eNB_UE_stats->timing_advance_update = 0; + } else { ue_sched_ctl->ta_timer--; - ue_sched_ctl->ta_update = 0; // don't trigger a timing advance command + ue_sched_ctl->ta_update = 0; // don't trigger a timing advance command } - - return ue_sched_ctl->ta_update = 0; - } int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id,int CC_id) { @@ -627,8 +633,8 @@ int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id,int CC_id) { return 0; } - if (ue_sched_ctl->ta_update == 0) { - return 1; + if (flexran_get_TA(mod_id, ue_id, CC_id) != 0) { + return PROTOCOL__FLEX_CE_TYPE__FLPCET_TA; } else { return 0; } diff --git a/openair2/ENB_APP/flexran_agent_common.h b/openair2/ENB_APP/flexran_agent_common.h index a4ee53067c..a4093f9437 100644 --- a/openair2/ENB_APP/flexran_agent_common.h +++ b/openair2/ENB_APP/flexran_agent_common.h @@ -185,8 +185,11 @@ int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id); /* Get the transmission queue size for a UE with a channel_id logical channel id */ int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id); +/* Check the status of the timing advance for a UE */ +short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id); + /* Update the timing advance status (find out whether a timing advance command is required) */ -int flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id); +void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id); /* Return timing advance MAC control element for a designated cell and UE */ int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id, int CC_id); diff --git a/openair2/ENB_APP/flexran_agent_handler.c b/openair2/ENB_APP/flexran_agent_handler.c index 4326ab6be0..29a1c1000c 100644 --- a/openair2/ENB_APP/flexran_agent_handler.c +++ b/openair2/ENB_APP/flexran_agent_handler.c @@ -172,7 +172,7 @@ Protocol__FlexranMessage* flexran_agent_process_timeout(long timer_id, void* tim struct flexran_agent_timer_element_s *found = get_timer_entry(timer_id); if (found == NULL ) goto error; - LOG_I(FLEXRAN_AGENT, "Found the entry (%p): timer_id is 0x%lx 0x%lx\n", found, timer_id, found->timer_id); + LOG_D(FLEXRAN_AGENT, "Found the entry (%p): timer_id is 0x%lx 0x%lx\n", found, timer_id, found->timer_id); if (timer_args == NULL) LOG_W(FLEXRAN_AGENT,"null timer args\n"); diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c index 433d8d25dd..89a320f52b 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c @@ -152,27 +152,20 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, //Check if there is TA command and set the length appropriately ta_len = (dl_data->ce_bitmap[0] & PROTOCOL__FLEX_CE_TYPE__FLPCET_TA) ? 2 : 0; } - + num_sdus = 0; sdu_length_total = 0; - if (ta_len > 0) { - // Reset the measurement - ue_sched_ctl->ta_timer = 20; - eNB_UE_stats->timing_advance_update = 0; - // header_len = ta_len; - //last_sdu_header_len = ta_len; - } - n_lc = dl_data->n_rlc_pdu; // Go through each one of the channel commands and create SDUs header_len = 0; last_sdu_header_len = 0; for (j = 0; j < n_lc; j++) { + sdu_lengths[j] = 0; lcid = dl_data->rlc_pdu[j]->rlc_pdu_tb[0]->logical_channel_id; rlc_size = dl_data->rlc_pdu[j]->rlc_pdu_tb[0]->size; - LOG_D(MAC,"[TEST] [eNB %d] Frame %d, LCID %d, CC_id %d, Requesting %d bytes from RLC (RRC message)\n", - mod_id, frame, lcid, CC_id, rlc_size); + LOG_D(MAC,"[TEST] [eNB %d] [Frame %d] [Subframe %d], LCID %d, CC_id %d, Requesting %d bytes from RLC (RRC message)\n", + mod_id, frame, subframe, lcid, CC_id, rlc_size); if (rlc_size > 0) { rlc_status = mac_rlc_status_ind(mod_id, @@ -186,10 +179,14 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, if (rlc_status.bytes_in_buffer > 0) { - if (rlc_size <= 2) { - rlc_size = 3; + if (rlc_status.bytes_in_buffer < rlc_size) { + rlc_size = rlc_status.bytes_in_buffer; } + if (rlc_size <= 2) { + rlc_size = 3; + } + rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, @@ -199,8 +196,6 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, lcid, rlc_size); // transport block set size - sdu_lengths[j] = 0; - LOG_D(MAC, "[TEST] RLC can give %d bytes for LCID %d during second call\n", rlc_status.bytes_in_buffer, lcid); if (rlc_status.bytes_in_buffer > 0) { @@ -257,9 +252,16 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, header_len = header_len_tmp; post_padding = TBS - sdu_length_total - header_len - ta_len; // 1 is for the postpadding header } - - ta_update = (ta_len > 0) ? ue_sched_ctl->ta_update : 0; - + + if (ta_len > 0) { + // Reset the measurement + ta_update = flexran_get_TA(mod_id, UE_id, CC_id); + ue_sched_ctl->ta_timer = 20; + eNB_UE_stats->timing_advance_update = 0; + } else { + ta_update = 0; + } + // If there is nothing to schedule, just leave if ((sdu_length_total) <= 0) { harq_pid_updated[UE_id][harq_pid] = 1; @@ -280,6 +282,8 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, post_padding); + + #ifdef DEBUG_eNB_SCHEDULER LOG_T(MAC,"[eNB %d] First 16 bytes of DLSCH : \n"); @@ -343,6 +347,11 @@ void flexran_apply_ue_spec_scheduling_decisions(mid_t mod_id, //eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[eNB_UE_stats->DL_cqi[0]]; //eNB_UE_stats->dlsch_mcs1 = cmin(eNB_UE_stats->dlsch_mcs1, openair_daq_vars.target_ue_dl_mcs); + } else { + LOG_D(FLEXRAN_AGENT, "No need to schedule a dci after all. Just drop it\n"); + harq_pid_updated[UE_id][harq_pid] = 1; + harq_pid_round[UE_id][harq_pid] = 0; + continue; } } else { // No need to create anything apart of DCI in case of retransmission diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 83e65cd4ec..74abe0c641 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -1192,7 +1192,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, // check first for RLC data on DCCH // add the length for all the control elements (timing adv, drx, etc) : header + payload - ta_len = (ue_sched_ctl->ta_update!=0) ? 2 : 0; + ta_len = (ue_sched_ctl->ta_update != 0) ? 2 : 0; dl_data[num_ues_added]->n_ce_bitmap = 2; dl_data[num_ues_added]->ce_bitmap = (uint32_t *) calloc(2, sizeof(uint32_t)); @@ -1401,7 +1401,6 @@ flexran_schedule_ue_spec_common(mid_t mod_id, if (flexran_get_p0_pucch_status(mod_id, UE_id, CC_id) == 1) { flexran_update_p0_pucch(mod_id, UE_id, CC_id); - UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frame; UE_list->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframe; if (normalized_rx_power>(target_rx_power+1)) { From 8250ecd794672698784369c61aebca25d1bad017 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Sun, 5 Feb 2017 19:54:14 +0200 Subject: [PATCH 15/25] Added info required for stability and fairness of remote scheduler --- .../CONTROL_MODULES/MAC/flexran_agent_mac.c | 7 ++++--- openair2/ENB_APP/flexran_agent_common.c | 15 +++++++++++---- openair2/ENB_APP/flexran_agent_common.h | 3 +++ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c index 504e157b95..1a43f203df 100644 --- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c +++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c @@ -449,8 +449,8 @@ int flexran_agent_mac_stats_reply(mid_t mod_id, rlc_reports[j]->has_tx_queue_size = 1; //TODO:Set tx queue head of line delay in ms - rlc_reports[j]->tx_queue_hol_delay = 100; - rlc_reports[j]->has_tx_queue_hol_delay = 0; + rlc_reports[j]->tx_queue_hol_delay = flexran_get_hol_delay(enb_id, i, j+1); + rlc_reports[j]->has_tx_queue_hol_delay = 1; //TODO:Set retransmission queue size in bytes rlc_reports[j]->retransmission_queue_size = 10; rlc_reports[j]->has_retransmission_queue_size = 0; @@ -976,6 +976,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle } } } + // LOG_I(FLEXRAN_AGENT, "Sending subframe trigger for frame %d and subframe %d\n", flexran_get_current_frame(mod_id), (flexran_get_current_subframe(mod_id) + 1) % 10); @@ -1002,7 +1003,7 @@ int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__Fle if(dl_info[i] == NULL) goto error; protocol__flex_dl_info__init(dl_info[i]); - dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, i); + dl_info[i]->rnti = flexran_get_ue_crnti(mod_id, UE_id); dl_info[i]->has_rnti = 1; /*Fill in the right id of this round's HARQ process for this UE*/ // uint8_t harq_id; diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index e25d67e05a..74edb21734 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -560,10 +560,17 @@ int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id) { } int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) { - rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); - uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); - mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0); - return rlc_status.bytes_in_buffer; + rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); + mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id,rnti, mod_id,frame,ENB_FLAG_YES,MBMS_FLAG_NO, channel_id, 0); + return rlc_status.bytes_in_buffer; +} + +int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id) { + rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); + uint16_t frame = (uint16_t) flexran_get_current_frame(mod_id); + mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(mod_id, rnti, mod_id, frame, ENB_FLAG_YES, MBMS_FLAG_NO, channel_id, 0); + return rlc_status.head_sdu_creation_time; } short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id) { diff --git a/openair2/ENB_APP/flexran_agent_common.h b/openair2/ENB_APP/flexran_agent_common.h index a4093f9437..abe5a05b44 100644 --- a/openair2/ENB_APP/flexran_agent_common.h +++ b/openair2/ENB_APP/flexran_agent_common.h @@ -185,6 +185,9 @@ int flexran_get_ue_wcqi (mid_t mod_id, mid_t ue_id); /* Get the transmission queue size for a UE with a channel_id logical channel id */ int flexran_get_tx_queue_size(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id); +/* Get the head of line delay for a UE with a channel_id logical channel id */ +int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_id); + /* Check the status of the timing advance for a UE */ short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id); From 31dde6129c71357a5408000e06e5672df0878518 Mon Sep 17 00:00:00 2001 From: Xenofon Foukas Date: Sun, 5 Feb 2017 20:00:57 +0200 Subject: [PATCH 16/25] Fixed various FlexRAN-related compilation warnings --- openair2/ENB_APP/flexran_agent_common.c | 5 ----- openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c index 74edb21734..f2d00145a0 100644 --- a/openair2/ENB_APP/flexran_agent_common.c +++ b/openair2/ENB_APP/flexran_agent_common.c @@ -576,7 +576,6 @@ int flexran_get_hol_delay(mid_t mod_id, mid_t ue_id, logical_chan_id_t channel_i short flexran_get_TA(mid_t mod_id, mid_t ue_id, int CC_id) { UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list; - UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; int rnti; rnti = flexran_get_ue_crnti(mod_id, ue_id); @@ -610,9 +609,6 @@ void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) { UE_list_t *UE_list=&eNB_mac_inst[mod_id].UE_list; UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; - int rnti; - - rnti = flexran_get_ue_crnti(mod_id, ue_id); if (ue_sched_ctl->ta_timer == 0) { // WE SHOULD PROTECT the eNB_UE_stats with a mutex here ... @@ -631,7 +627,6 @@ void flexran_update_TA(mid_t mod_id, mid_t ue_id, int CC_id) { int flexran_get_MAC_CE_bitmap_TA(mid_t mod_id, mid_t ue_id,int CC_id) { UE_list_t *UE_list = &eNB_mac_inst[mod_id].UE_list; - UE_sched_ctrl *ue_sched_ctl = &UE_list->UE_sched_ctrl[ue_id]; rnti_t rnti = flexran_get_ue_crnti(mod_id,ue_id); LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti); diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c index 89a320f52b..9c8b23df07 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dataplane.c @@ -55,6 +55,8 @@ #include "flexran.pb-c.h" #include "flexran_agent_extern.h" +#include "flexran_agent_common.h" + #include "SIMULATION/TOOLS/defs.h" // for taus void flexran_apply_dl_scheduling_decisions(mid_t mod_id, From bb5ee76ad890bb003ae44a53145c7d8bce1950a1 Mon Sep 17 00:00:00 2001 From: Raymond Knopp Date: Sun, 5 Feb 2017 14:31:00 -0800 Subject: [PATCH 17/25] changes in oaisim to support RRU + fronthaul. minor bugs corrected in UE. --- cmake_targets/CMakeLists.txt | 1 + openair1/PHY/LTE_TRANSPORT/prach.c | 47 +++-- openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c | 2 +- openair1/SCHED/phy_procedures_lte_eNb.c | 6 +- openair1/SCHED/phy_procedures_lte_ue.c | 21 +- openair2/LAYER2/MAC/rar_tools.c | 2 +- openair2/RRC/LITE/rrc_UE.c | 3 +- ...band7.tm1.generic.oaisim.local_no_mme.conf | 2 +- .../CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf | 191 +++++++++++++++++ .../CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf | 191 +++++++++++++++++ .../rru.band7.tm1.if4p5.25PRB.oaisim.conf | 193 ++++++++++++++++++ .../rru.band7.tm1.if4p5.50PRB.oaisim.conf | 193 ++++++++++++++++++ targets/RT/USER/lte-enb.c | 10 +- targets/RT/USER/lte-softmodem.c | 2 +- targets/RT/USER/lte-ue.c | 38 ++-- targets/SIMU/USER/channel_sim.c | 2 +- targets/SIMU/USER/oaisim.c | 13 +- targets/SIMU/USER/oaisim_functions.c | 18 +- 18 files changed, 873 insertions(+), 62 deletions(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 2e2f64b5f6..bfd86cd183 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -1929,6 +1929,7 @@ add_executable(oaisim_nos1 ${OPENAIR_TARGETS}/SIMU/USER/oaisim_functions.c ${OPENAIR_TARGETS}/SIMU/USER/event_handler.c ${OPENAIR_TARGETS}/SIMU/USER/oaisim.c + ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR2_DIR}/RRC/NAS/nas_config.c ${OPENAIR2_DIR}/RRC/NAS/rb_config.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 489fdb0f71..c0dfcdfc9a 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -645,6 +645,12 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 #else //normal case (simulation) prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset; + LOG_D(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id, + prach_start, + ue->rx_offset, + ue->hw_timing_advance, + ue->N_TA_offset); + #endif @@ -1074,6 +1080,8 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1 #ifdef PRACH_DEBUG write_output("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1); write_output("prach_tx0.m","prachtx0",prach+(Ncp<<1),prach_len-Ncp,1,1); + write_output("txsig.m","txs",(int16_t*)(&ue->common_vars.txdata[0][0]),2*ue->frame_parms.samples_per_tti,1,1); + exit(-1); #endif return signal_energy( (int*)prach, 256 ); @@ -1125,7 +1133,8 @@ void rx_prach(PHY_VARS_eNB *eNB, int fft_size,log2_ifft_size; uint8_t nb_ant_rx = 1; //eNB->frame_parms.nb_antennas_rx; - // int en; + int en; + for (aa=0; aacommon_vars.rxdata[0][aa][subframe*eNB->frame_parms.samples_per_tti-eNB->N_TA_offset]; @@ -1327,9 +1336,16 @@ void rx_prach(PHY_VARS_eNB *eNB, /// **** send_IF4 of rxsigF to RCC **** /// send_IF4p5(eNB, eNB->proc.frame_prach, eNB->proc.subframe_prach, IF4p5_PRACH, k); - // en = dB_fixed(signal_energy(&rxsigF[0][k],840)); - // if (en>60) - // printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); + /* + en = dB_fixed(signal_energy(&rxsigF[0][k],840)); + printf("Sending PRACH, k %d,n_ra_prb %d, N_RB_UL %d, en %d\n",k,n_ra_prb,eNB->frame_parms.N_RB_UL,en); + if (en>60) { + printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); + write_output("prach_rx0.m","prach_rx0",(int16_t*)&rxsigF[0][k],839,1,1); + exit(-1); + } + */ + return; } else if (eNB->node_function == NGFI_RCC_IF4p5) { k = (12*n_ra_prb) - 6*eNB->frame_parms.N_RB_UL; @@ -1347,10 +1363,15 @@ void rx_prach(PHY_VARS_eNB *eNB, (&rxsigF[0][0]), 839*2*sizeof(int16_t)); - //en = dB_fixed(signal_energy(&rxsigF[0][k],840)); - // if (en>60) - //printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); - + /* + en = dB_fixed(signal_energy(&rxsigF[0][k],840)); + printf("Receiving PRACH, k %d,n_ra_prb %d, N_RB_UL %d, en %d\n",k,n_ra_prb,eNB->frame_parms.N_RB_UL,en); + if (en>60) { + printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); + write_output("prach_rx0.m","prach_rx0",(int16_t*)&rxsigF[0][k],839,1,1); + exit(-1); + } + */ } // in case of RCC and prach received rx_thread wakes up prach @@ -1523,7 +1544,7 @@ void rx_prach(PHY_VARS_eNB *eNB, #ifdef PRACH_DEBUG - // if (en>40) { + if (en>40) { k = (12*n_ra_prb) - 6*eNB->frame_parms.N_RB_UL; if (k<0) @@ -1537,7 +1558,7 @@ void rx_prach(PHY_VARS_eNB *eNB, write_output("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1); write_output("prach_ifft0.m","prach_t0",prach_ifft[0],1024,1,1); exit(-1); - // } + } #endif } // new dft @@ -1551,7 +1572,7 @@ void rx_prach(PHY_VARS_eNB *eNB, for (aa=0; aapreamble_energy_list[preamble_index] ) { @@ -1559,12 +1580,12 @@ void rx_prach(PHY_VARS_eNB *eNB, preamble_delay_list[preamble_index] = (i*fft_size)>>log2_ifft_size; } } - #ifdef PRACH_DEBUG LOG_D(PHY,"[RAPROC] Preamble %d => %d dB, %d (shift %d (%d), NCS2 %d(%d), Ncp %d)\n",preamble_index,preamble_energy_list[preamble_index],preamble_delay_list[preamble_index],preamble_shift2, preamble_shift, NCS2,NCS,Ncp); -#endif // exit(-1); +#endif + }// preamble_index stop_meas(&eNB->rx_prach); diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c index ee9bfc53cd..a4bcd802f5 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_modulation.c @@ -415,7 +415,7 @@ void ulsch_modulation(int32_t **txdataF, return; } - if (first_rb >25 ) { + if (first_rb > frame_parms->N_RB_UL) { printf("ulsch_modulation.c: Frame %d, Subframe %d Illegal first_rb %d\n",frame,subframe,first_rb); return; } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index cad508c7c2..a84156204e 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2017,7 +2017,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) { eNB->UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits eNB->UE_stats[(uint32_t)UE_id].sector = 0; - LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", + LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", eNB->Mod_id, eNB->CC_id, frame, @@ -2750,6 +2750,7 @@ void eNB_fep_full(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc_rxtx) { if (eNB->node_function == NGFI_RRU_IF4p5) { /// **** send_IF4 of rxdataF to RCC (no prach now) **** /// + LOG_D(PHY,"send_IF4p5 (PULFFT): frame %d, subframe %d\n",proc_rxtx->frame_rx,proc_rxtx->subframe_rx); send_IF4p5(eNB, proc_rxtx->frame_rx, proc_rxtx->subframe_rx, IF4p5_PULFFT, 0); } } @@ -3070,12 +3071,15 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,eNB->ulsch[i]->harq_processes[harq_pid]->round); if (eNB->ulsch[i]->Msg3_flag == 1) { + LOG_D(PHY,"[eNB %d/%d][RAPROC] frame %d, subframe %d, UE %d: Error receiving ULSCH (Msg3), round %d/%d\n", eNB->Mod_id, eNB->CC_id, frame,subframe, i, eNB->ulsch[i]->harq_processes[harq_pid]->round-1, fp->maxHARQ_Msg3Tx-1); + /*dump_ulsch(eNB,proc,i); + exit(-1);*/ LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d RNTI %x RX power (%d,%d) RSSI (%d,%d) N0 (%d,%d) dB ACK (%d,%d), decoding iter %d\n", eNB->Mod_id,harq_pid, diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 7d061f60bf..3c6a24b0be 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2189,11 +2189,12 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui subframe_tx, ue->ulsch[eNB_id]->o_ACK); - reset_ack(&ue->frame_parms, - ue->dlsch_SI[eNB_id]->harq_ack, - subframe_tx, - ue->ulsch[eNB_id]->o_ACK); - + if (ue->dlsch_SI[eNB_id]) + reset_ack(&ue->frame_parms, + ue->dlsch_SI[eNB_id]->harq_ack, + subframe_tx, + ue->ulsch[eNB_id]->o_ACK); + VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT); stop_meas(&ue->phy_proc_tx); @@ -2606,19 +2607,19 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin #endif } else { - /* + LOG_E(PHY,"[UE %d] frame %d, subframe %d, Error decoding PBCH!\n", ue->Mod_id,frame_rx, subframe_rx); - + /* LOG_I(PHY,"[UE %d] rx_offset %d\n",ue->Mod_id,ue->rx_offset); write_output("rxsig0.m","rxs0", ue->common_vars.rxdata[0],ue->frame_parms.samples_per_tti,1,1); - write_output("H00.m","h00",&(ue->common_vars.dl_ch_estimates[0][0][0]),((ue->frame_parms.Ncp==0)?7:6)*(ue->frame_parms.ofdm_symbol_size),1,1); - write_output("H10.m","h10",&(ue->common_vars.dl_ch_estimates[0][2][0]),((ue->frame_parms.Ncp==0)?7:6)*(ue->frame_parms.ofdm_symbol_size),1,1); + write_output("H00.m","h00",&(ue->common_vars.common_vars_rx_data_per_thread[0].dl_ch_estimates[0][0][0]),((ue->frame_parms.Ncp==0)?7:6)*(ue->frame_parms.ofdm_symbol_size),1,1); + write_output("H10.m","h10",&(ue->common_vars.common_vars_rx_data_per_thread[0].dl_ch_estimates[0][2][0]),((ue->frame_parms.Ncp==0)?7:6)*(ue->frame_parms.ofdm_symbol_size),1,1); - write_output("rxsigF0.m","rxsF0", ue->common_vars.rxdataF[0],8*ue->frame_parms.ofdm_symbol_size,1,1); + write_output("rxsigF0.m","rxsF0", ue->common_vars.common_vars_rx_data_per_thread[0].rxdataF[0],8*ue->frame_parms.ofdm_symbol_size,1,1); write_output("PBCH_rxF0_ext.m","pbch0_ext",ue->pbch_vars[0]->rxdataF_ext[0],12*4*6,1,1); write_output("PBCH_rxF0_comp.m","pbch0_comp",ue->pbch_vars[0]->rxdataF_comp[0],12*4*6,1,1); write_output("PBCH_rxF_llr.m","pbch_llr",ue->pbch_vars[0]->llr,(ue->frame_parms.Ncp==0) ? 1920 : 1728,1,4); diff --git a/openair2/LAYER2/MAC/rar_tools.c b/openair2/LAYER2/MAC/rar_tools.c index b453b5cca8..2de22c067a 100644 --- a/openair2/LAYER2/MAC/rar_tools.c +++ b/openair2/LAYER2/MAC/rar_tools.c @@ -97,7 +97,7 @@ unsigned short fill_rar( eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps rar[0] = (uint8_t)(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset>>(2+4)); // 7 MSBs of timing advance + divide by 4 rar[1] = (uint8_t)(eNB_mac_inst[module_idP].common_channels[CC_id].RA_template[ra_idx].timing_offset<<(4-2))&0xf0; // 4 LSBs of timing advance + divide by 4 - rballoc = mac_xface->computeRIV(N_RB_UL,1,1); // first PRB only for UL Grant + rballoc = mac_xface->computeRIV(N_RB_UL,26,1); // first PRB only for UL Grant rar[1] |= (rballoc>>7)&7; // Hopping = 0 (bit 3), 3 MSBs of rballoc rar[2] = ((uint8_t)(rballoc&0xff))<<1; // 7 LSBs of rballoc mcs = 10; diff --git a/openair2/RRC/LITE/rrc_UE.c b/openair2/RRC/LITE/rrc_UE.c index a6290f1f3c..17a0aeaa54 100644 --- a/openair2/RRC/LITE/rrc_UE.c +++ b/openair2/RRC/LITE/rrc_UE.c @@ -3131,7 +3131,8 @@ static void dump_sib2( SystemInformationBlockType2_t *sib2 ) sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_SubframeConfig ); LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission : %d\n", sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.ackNackSRS_SimultaneousTransmission ); - LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts : %ld\n", + if (sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts) + LOG_I( RRC, "radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts : %ld\n", /* TODO: check that it's okay to access [0] */ sib2->radioResourceConfigCommon.soundingRS_UL_ConfigCommon.choice.setup.srs_MaxUpPts[0] ); } diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf index a79cb2cae6..8db3e2304d 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.generic.oaisim.local_no_mme.conf @@ -34,7 +34,7 @@ eNBs = downlink_frequency = 2680000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; - N_RB_DL = 25; + N_RB_DL = 50; Nid_cell_mbsfn = 0; nb_antenna_ports = 1; nb_antennas_tx = 1; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf new file mode 100644 index 0000000000..5aad9973bb --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf @@ -0,0 +1,191 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RCC_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "lo"; + remote_address = "127.0.0.1"; + local_address = "127.0.0.2"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "udp_if4p5"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf new file mode 100644 index 0000000000..918e7825cc --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf @@ -0,0 +1,191 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RCC_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "lo"; + remote_address = "127.0.0.1"; + local_address = "127.0.0.2"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "udp_if4p5"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf new file mode 100644 index 0000000000..26ecfb64f2 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf @@ -0,0 +1,193 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RRU_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 120; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -95; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.11"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "lo"; + remote_address = "127.0.0.2"; + local_address = "127.0.0.1"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "udp_if4p5"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf new file mode 100644 index 0000000000..b6cd51ec96 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.50PRB.oaisim.conf @@ -0,0 +1,193 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RRU_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 50; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 120; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -95; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.11"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "lo"; + remote_address = "127.0.0.2"; + local_address = "127.0.0.1"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "udp_if4p5"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/RT/USER/lte-enb.c b/targets/RT/USER/lte-enb.c index fd67ec1ee3..d70352b410 100644 --- a/targets/RT/USER/lte-enb.c +++ b/targets/RT/USER/lte-enb.c @@ -2076,10 +2076,12 @@ void init_eNB(eNB_func_t node_function[], eNB_timing_t node_timing[],int nb_inst eNB->start_rf = start_rf; eNB->start_if = NULL; eNB->fh_asynch = NULL; - ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]); - if (ret<0) { - printf("Exiting, cannot initialize rf device\n"); - exit(-1); + if (oaisim_flag == 0) { + ret = openair0_device_load(&eNB->rfdevice, &openair0_cfg[CC_id]); + if (ret<0) { + printf("Exiting, cannot initialize rf device\n"); + exit(-1); + } } eNB->rfdevice.host_type = BBU_HOST; eNB->ifdevice.host_type = BBU_HOST; diff --git a/targets/RT/USER/lte-softmodem.c b/targets/RT/USER/lte-softmodem.c index fe1584309e..5342a1b665 100644 --- a/targets/RT/USER/lte-softmodem.c +++ b/targets/RT/USER/lte-softmodem.c @@ -112,7 +112,7 @@ extern int netlink_init(void); // In lte-enb.c extern int setup_eNB_buffers(PHY_VARS_eNB **phy_vars_eNB, openair0_config_t *openair0_cfg); -extern void init_eNB(eNB_func_t *, eNB_timing_t *,int),eth_params_t *,int,int); +extern void init_eNB(eNB_func_t *, eNB_timing_t *,int,eth_params_t *,int,int); extern void stop_eNB(int); extern void kill_eNB_proc(void); diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 8cca3f8961..b0e8a0f5dd 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -1169,7 +1169,7 @@ void *UE_thread(void *arg) { rxs = UE->rfdevice.trx_read_func(&UE->rfdevice, ×tamp1, - rxp, + rxp, UE->frame_parms.nb_prefix_samples0 - rx_off_diff, UE->frame_parms.nb_antennas_rx); @@ -1262,26 +1262,28 @@ void *UE_thread(void *arg) { } }// for sf=0..10 - uint8_t proc_select = 9&1; - UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[proc_select]; + uint8_t proc_select = 9&1; + UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[proc_select]; - if ((UE->rx_offset<(5*UE->frame_parms.samples_per_tti)) && - (UE->rx_offset > 0) && - (rx_correction_timer == 0)) { - rx_off_diff = -1 ; - LOG_D(PHY,"AbsSubframe %d.%d UE->rx_offset %d > %d, diff %d\n",proc->frame_rx,proc->subframe_rx,UE->rx_offset,0,rx_off_diff); - rx_correction_timer = 5; - } else if ((UE->rx_offset>(5*UE->frame_parms.samples_per_tti)) && - (UE->rx_offset < ((10*UE->frame_parms.samples_per_tti))) && - (rx_correction_timer == 0)) { // moving to the left so drop rx_off_diff samples - rx_off_diff = 1; - LOG_D(PHY,"AbsSubframe %d.%d UE->rx_offset %d < %d, diff %d\n",proc->frame_rx,proc->subframe_rx,UE->rx_offset,10*UE->frame_parms.samples_per_tti,rx_off_diff); + if (UE->no_timing_correction == 0) { + if ((UE->rx_offset<(5*UE->frame_parms.samples_per_tti)) && + (UE->rx_offset > 0) && + (rx_correction_timer == 0)) { + rx_off_diff = -1 ; + LOG_D(PHY,"AbsSubframe %d.%d UE->rx_offset %d > %d, diff %d\n",proc->frame_rx,proc->subframe_rx,UE->rx_offset,0,rx_off_diff); + rx_correction_timer = 5; + } else if ((UE->rx_offset>(5*UE->frame_parms.samples_per_tti)) && + (UE->rx_offset < ((10*UE->frame_parms.samples_per_tti))) && + (rx_correction_timer == 0)) { // moving to the left so drop rx_off_diff samples + rx_off_diff = 1; + LOG_D(PHY,"AbsSubframe %d.%d UE->rx_offset %d < %d, diff %d\n",proc->frame_rx,proc->subframe_rx,UE->rx_offset,10*UE->frame_parms.samples_per_tti,rx_off_diff); + + rx_correction_timer = 5; + } - rx_correction_timer = 5; + if (rx_correction_timer>0) + rx_correction_timer--; } - - if (rx_correction_timer>0) - rx_correction_timer--; } // start_rx_stream==1 } // UE->is_synchronized==1 diff --git a/targets/SIMU/USER/channel_sim.c b/targets/SIMU/USER/channel_sim.c index 514f876939..370e50d145 100644 --- a/targets/SIMU/USER/channel_sim.c +++ b/targets/SIMU/USER/channel_sim.c @@ -557,7 +557,7 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N #ifdef DEBUG_SIM rx_pwr2 = signal_energy(rxdata[0]+sf_offset,frame_parms->samples_per_tti)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL); - LOG_D(OCM,"[SIM][UL] eNB %d rx_pwr (ADC out) %f dB (%d) for subframe %d\n",eNB_id,10*log10((double)rx_pwr2),rx_pwr2,subframe); + LOG_D(OCM,"[SIM][UL] eNB %d rx_pwr (ADC out) %f dB (%d) for subframe %d (offset %d)\n",eNB_id,10*log10((double)rx_pwr2),rx_pwr2,subframe,sf_offset); #else UNUSED_VARIABLE(tx_pwr); UNUSED_VARIABLE(rx_pwr); diff --git a/targets/SIMU/USER/oaisim.c b/targets/SIMU/USER/oaisim.c index 78e1fdca98..71bfce44cb 100644 --- a/targets/SIMU/USER/oaisim.c +++ b/targets/SIMU/USER/oaisim.c @@ -574,7 +574,8 @@ l2l1_task (void *args_p) itti_mark_task_ready (TASK_L2L1); LOG_I(EMU, "TASK_L2L1 is READY\n"); - if (oai_emulation.info.nb_enb_local > 0) { + if ((oai_emulation.info.nb_enb_local > 0) && + (oai_emulation.info.node_function[0] < NGFI_RAU_IF4p5)) { /* Wait for the initialize message */ do { if (message_p != NULL) { @@ -706,6 +707,8 @@ l2l1_task (void *args_p) update_ocm (); for (sf = 0; sf < 10; sf++) { + LOG_D(EMU,"************************* Subframe %d\n",sf); + start_meas (&oaisim_stats_f); wait_for_slot_isr (); @@ -742,7 +745,7 @@ l2l1_task (void *args_p) (subframe_UE_mask_local == ((1<= 10) && (frame <= 11) && (abstraction_flag == 0) #ifdef PROC &&(Channel_Flag==0) @@ -1121,6 +1125,7 @@ l2l1_task (void *args_p) * 10, 1, 1); } + */ //#ifdef XFORMS if (xforms==1) { diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 50472db585..3c1611cd54 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -831,6 +831,7 @@ void get_simulation_options(int argc, char *argv[]) oai_emulation.info.node_timing[0] = enb_properties->properties[0]->cc_node_timing[0]; downlink_frequency[0][0] = enb_properties->properties[0]->downlink_frequency[0]; uplink_frequency_offset[0][0] = enb_properties->properties[0]->uplink_frequency_offset[0]; + oai_emulation.info.N_RB_DL[0] = enb_properties->properties[0]->N_RB_DL[0]; } free(conf_config_file_name); @@ -1042,7 +1043,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * *ptimestamp = last_eNB_rx_timestamp[eNB_id][CC_id]; - LOG_D(PHY,"eNB_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps, + LOG_D(EMU,"eNB_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps, (unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id], (unsigned long long)last_eNB_rx_timestamp[eNB_id][CC_id], (*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10); @@ -1051,7 +1052,7 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * while (sample_countframe_parms.samples_per_tti)%10; - LOG_D(PHY,"eNB_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n", + LOG_D(EMU,"eNB_trx_read generating UL subframe %d (Ts %llu, current TS %llu)\n", subframe,(unsigned long long)*ptimestamp, (unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id]); @@ -1107,12 +1108,12 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void ** while (sample_countproperties[0]->Nid_cell[CC_id], cooperation_flag, enb_properties->properties[0]->nb_antenna_ports[CC_id], abstraction_flag, @@ -1299,6 +1300,11 @@ void init_openair1(void) enb_properties->properties[0]->nb_antennas_tx[CC_id], nb_antennas_rx_ue, oai_emulation.info.eMBMS_active_state); + + // This is for IF4p5 RRU, gets done by RRC configuration of eNB + PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = enb_properties->properties[0]->prach_config_index[CC_id]; + PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = enb_properties->properties[0]->prach_freq_offset[CC_id]; + } for (eNB_id=0; eNB_id Date: Tue, 7 Feb 2017 16:01:27 -0800 Subject: [PATCH 18/25] protection in case of false DCI --- openair1/PHY/LTE_TRANSPORT/dci_tools.c | 6 +- openair1/SCHED/phy_mac_stub.c | 176 +++++++++++++++++++++---- openair1/SCHED/phy_procedures_lte_ue.c | 12 +- targets/SIMU/USER/oaisim_functions.c | 7 +- 4 files changed, 159 insertions(+), 42 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index b262dbccf9..72f276408f 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -3831,6 +3831,8 @@ int generate_ue_dlsch_params_from_dci(int frame, LTE_UE_DLSCH_t *dlsch0=NULL,*dlsch1=NULL; LTE_DL_UE_HARQ_t *dlsch0_harq,*dlsch1_harq; + if (!dlsch[0]) return -1; + #ifdef DEBUG_DCI LOG_D(PHY,"dci_tools.c: Filling ue dlsch params -> rnti %x, SFN/SF %d/%d, dci_format %s\n", rnti, @@ -7395,8 +7397,8 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *eNB, rb_alloc = rballoc; if (rb_alloc>RIV_max) { - LOG_E(PHY,"Format 0: rb_alloc > RIV_max\n"); - mac_xface->macphy_exit("Format 0: rb_alloc > RIV_max\n"); + LOG_E(PHY,"Format 0: rb_alloc (%d) > RIV_max (%d)\n",rb_alloc,RIV_max); + mac_xface->macphy_exit("Format 0: error"); return(-1); } diff --git a/openair1/SCHED/phy_mac_stub.c b/openair1/SCHED/phy_mac_stub.c index cb22461656..9a41ae09c5 100644 --- a/openair1/SCHED/phy_mac_stub.c +++ b/openair1/SCHED/phy_mac_stub.c @@ -455,6 +455,151 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) break; } + + + + + DCI_pdu->dci_alloc[1].L = 2; + DCI_pdu->dci_alloc[1].rnti = 0x1235; + DCI_pdu->dci_alloc[1].format = format0; + DCI_pdu->dci_alloc[1].ra_flag = 0; + + if (eNB->frame_parms.frame_type == FDD) { + switch (eNB->frame_parms.N_RB_DL) { + case 6: + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(6,1,4); + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_1_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + /* case 15: + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb); + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_3MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break;*/ + case 25: + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(25,1,20); + printf("rballoc %d\n",((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc); + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_5MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + case 50: + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(50,1,48); + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_10MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + /* case 75: + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb); + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_15MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break;*/ + case 100: + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(100,1,96); + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_20MHz_FDD_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + } + } + else { + switch (eNB->frame_parms.N_RB_DL==6) { + case 6: + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(6,1,5); + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_1_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + /* case 15: + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb); + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_3MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break;*/ + case 25: + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(25,2,20); + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_5MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + case 50: + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(50,1,48); + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_10MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + /* case 75: + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb); + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_15MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break;*/ + case 100: + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->type = 0; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->hopping = 0; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->rballoc = computeRIV(100,1,96); + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->mcs = eNB->target_ue_ul_mcs; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->ndi = proc->frame_tx&1; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->TPC = 0; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cshift = 0; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->dai = 0; + ((DCI0_20MHz_TDD_1_6_t*)&DCI_pdu->dci_alloc[1].dci_pdu[0])->cqi_req = 1; + break; + } + } } else if (transmission_mode==4) { DCI_pdu->Num_ue_spec_dci = 1; // user 1 @@ -543,32 +688,8 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t)); break; */ - /* - case 9: - DCI_pdu->Num_ue_spec_dci = 1; + - //user 1 - if (eNB->frame_parms.frame_type == FDD) - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_FDD_t ; - else - DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; - - DCI_pdu->dci_alloc[0].L = 2; - DCI_pdu->dci_alloc[0].rnti = 0x1235; - DCI_pdu->dci_alloc[0].format = format0; - DCI_pdu->dci_alloc[0].ra_flag = 0; - - UL_alloc_pdu.type = 0; - UL_alloc_pdu.hopping = 0; - UL_alloc_pdu.rballoc = computeRIV(25,2,eNB->ue_ul_nb_rb); - UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs; - UL_alloc_pdu.ndi = proc->frame_tx&1; - UL_alloc_pdu.TPC = 0; - UL_alloc_pdu.cshift = 0; - UL_alloc_pdu.dai = 0; - UL_alloc_pdu.cqi_req = 1; - memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t)); - */ // user 2 /* DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ; @@ -593,11 +714,8 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) UL_alloc_pdu.dai = 0; UL_alloc_pdu.cqi_req = 1; memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t)); - break; + */ - - /*default: - break;*/ } /* diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 3c6a24b0be..45322a46f8 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -2971,17 +2971,14 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint #endif } - } else if( (dci_alloc_rx[i].rnti == ue->ulsch[eNB_id]->cba_rnti[0]) && + } + /* else if( (dci_alloc_rx[i].rnti == ue->ulsch[eNB_id]->cba_rnti[0]) && (dci_alloc_rx[i].format == format0)) { // UE could belong to more than one CBA group // ue->Mod_id%ue->ulsch[eNB_id]->num_active_cba_groups] #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d: Found cba rnti %x, format 0, dci_cnt %d\n", ue->Mod_id,frame_rx,subframe_rx,dci_alloc_rx[i].rnti,i); - /* - if (((frame_rx%100) == 0) || (frame_rx < 20)) - dump_dci(&ue->frame_parms, &dci_alloc_rx[i]); - */ #endif ue->ulsch_no_allocation_counter[eNB_id] = 0; @@ -3005,9 +3002,8 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint LOG_D(PHY,"[UE %d] Generate UE ULSCH CBA_RNTI format 0 (subframe %d)\n",ue->Mod_id,subframe_rx); #endif ue->ulsch[eNB_id]->num_cba_dci[(subframe_rx+4)%10]++; - } - } - + } + */ else { #ifdef DEBUG_PHY_PROC LOG_D(PHY,"[UE %d] frame %d, subframe %d: received DCI %d with RNTI=%x (C-RNTI:%x, CBA_RNTI %x) and format %d!\n",ue->Mod_id,frame_rx,subframe_rx,i,dci_alloc_rx[i].rnti, diff --git a/targets/SIMU/USER/oaisim_functions.c b/targets/SIMU/USER/oaisim_functions.c index 3c1611cd54..884dccdda1 100644 --- a/targets/SIMU/USER/oaisim_functions.c +++ b/targets/SIMU/USER/oaisim_functions.c @@ -1400,9 +1400,10 @@ void init_openair1(void) PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB=100; // update UE_mode for each eNB_id not just 0 - if (abstraction_flag == 0) - PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = NOT_SYNCHED; - else { + if (abstraction_flag == 0) { + if (phy_test==0) PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = NOT_SYNCHED; + else PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PUSCH; + } else { // 0 is the index of the connected eNB PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PRACH; } From 6b81ddf6117eac9aca9076cec9d8b97ca27fa0cc Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Wed, 8 Feb 2017 14:41:07 +0100 Subject: [PATCH 19/25] fix the compilation issue with flexran --- .../MAC/flexran_agent_scheduler_dlsch_ue.c | 2 +- .../CONF/enb.band7.tm1.25PRB.usrpb210.conf | 174 ++++++++++++++++ .../rcc.band7.tm1.if4p5.100PRB.usrpb210.conf | 193 +++++++++++++++++ ...> rcc.band7.tm1.if4p5.25PRB.usrpb210.conf} | 0 ...> rcc.band7.tm1.if4p5.50PRB.usrpb210.conf} | 0 .../rcc.band7.tm1.if5.100PRB.usrpb210.conf | 195 ++++++++++++++++++ ... => rcc.band7.tm1.if5.25PRB.usrpb210.conf} | 0 ... => rcc.band7.tm1.if5.50PRB.usrpb210.conf} | 0 .../rru.band7.tm1.if5.100PRB.usrpb210.conf | 190 +++++++++++++++++ ... => rru.band7.tm1.if5.50PRB.usrpb210.conf} | 0 10 files changed, 753 insertions(+), 1 deletion(-) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf rename targets/PROJECTS/GENERIC-LTE-EPC/CONF/{rcc.band7.tm1.if4p5.25PRB.conf => rcc.band7.tm1.if4p5.25PRB.usrpb210.conf} (100%) rename targets/PROJECTS/GENERIC-LTE-EPC/CONF/{rcc.band7.tm1.if4p5.50PRB.conf => rcc.band7.tm1.if4p5.50PRB.usrpb210.conf} (100%) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf rename targets/PROJECTS/GENERIC-LTE-EPC/CONF/{rcc.band7.tm1.if5.25PRB.conf => rcc.band7.tm1.if5.25PRB.usrpb210.conf} (100%) rename targets/PROJECTS/GENERIC-LTE-EPC/CONF/{rcc.band7.tm1.if5.50PRB.conf => rcc.band7.tm1.if5.50PRB.usrpb210.conf} (100%) create mode 100644 targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf rename targets/PROJECTS/GENERIC-LTE-EPC/CONF/{rru.band7.tm1.50PRB.if5.usrpb210.conf => rru.band7.tm1.if5.50PRB.usrpb210.conf} (100%) diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index bc069179b9..9a1e7ea1f9 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -1133,7 +1133,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, continue; } - switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)){ + switch(mac_xface->get_transmission_mode(mod_idP,CC_id,rnti)){ case 1: case 2: case 7: diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf new file mode 100644 index 0000000000..c4c125a394 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.25PRB.usrpb210.conf @@ -0,0 +1,174 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 25; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 120; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -24; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -104; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + ue_TransmissionMode = 1; + } + ); + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf new file mode 100644 index 0000000000..cdaf13e01a --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.100PRB.usrpb210.conf @@ -0,0 +1,193 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RCC_IF4p5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2685000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -27; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -96; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -104; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "eth0"; + remote_address = "10.10.10.60"; + local_address = "10.10.10.215"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "udp_if4p5"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); + diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.usrpb210.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.conf rename to targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.usrpb210.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf rename to targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf new file mode 100644 index 0000000000..ee2b1cb021 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.100PRB.usrpb210.conf @@ -0,0 +1,195 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "93"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "eNodeB_3GPP_BBU"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antenna_ports = 1; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + ue_TransmissionMode = 1; + + + + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "127.0.0.3"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; + ENB_INTERFACE_NAME_FOR_S1U = "lo"; + ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.4/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "eth2"; + remote_address = "10.10.10.60"; + local_address = "10.10.10.215"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "udp"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.usrpb210.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.conf rename to targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.25PRB.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.usrpb210.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.conf rename to targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if5.50PRB.usrpb210.conf diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf new file mode 100644 index 0000000000..f6bbe9ff58 --- /dev/null +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.100PRB.usrpb210.conf @@ -0,0 +1,190 @@ +Active_eNBs = ( "eNB_Eurecom_LTEBox"); +# Asn1_verbosity, choice in: none, info, annoying +Asn1_verbosity = "none"; + +eNBs = +( + { + ////////// Identification parameters: + eNB_ID = 0xe00; + + cell_type = "CELL_MACRO_ENB"; + + eNB_name = "eNB_Eurecom_LTEBox"; + + // Tracking area code, 0x0000 and 0xfffe are reserved values + tracking_area_code = "1"; + + mobile_country_code = "208"; + + mobile_network_code = "92"; + + ////////// Physical parameters: + + component_carriers = ( + { + node_function = "NGFI_RRU_IF5"; + node_timing = "synch_to_ext_device"; + node_synch_ref = 0; + frame_type = "FDD"; + tdd_config = 3; + tdd_config_s = 0; + prefix_type = "NORMAL"; + eutra_band = 7; + downlink_frequency = 2660000000L; + uplink_frequency_offset = -120000000; + Nid_cell = 0; + N_RB_DL = 100; + Nid_cell_mbsfn = 0; + nb_antennas_tx = 1; + nb_antennas_rx = 1; + tx_gain = 90; + rx_gain = 125; + prach_root = 0; + prach_config_index = 0; + prach_high_speed = "DISABLE"; + prach_zero_correlation = 1; + prach_freq_offset = 2; + pucch_delta_shift = 1; + pucch_nRB_CQI = 1; + pucch_nCS_AN = 0; + pucch_n1_AN = 32; + pdsch_referenceSignalPower = -29; + pdsch_p_b = 0; + pusch_n_SB = 1; + pusch_enable64QAM = "DISABLE"; + pusch_hoppingMode = "interSubFrame"; + pusch_hoppingOffset = 0; + pusch_groupHoppingEnabled = "ENABLE"; + pusch_groupAssignment = 0; + pusch_sequenceHoppingEnabled = "DISABLE"; + pusch_nDMRS1 = 1; + phich_duration = "NORMAL"; + phich_resource = "ONESIXTH"; + srs_enable = "DISABLE"; + /* srs_BandwidthConfig =; + srs_SubframeConfig =; + srs_ackNackST =; + srs_MaxUpPts =;*/ + + pusch_p0_Nominal = -90; + pusch_alpha = "AL1"; + pucch_p0_Nominal = -96; + msg3_delta_Preamble = 6; + pucch_deltaF_Format1 = "deltaF2"; + pucch_deltaF_Format1b = "deltaF3"; + pucch_deltaF_Format2 = "deltaF0"; + pucch_deltaF_Format2a = "deltaF0"; + pucch_deltaF_Format2b = "deltaF0"; + + rach_numberOfRA_Preambles = 64; + rach_preamblesGroupAConfig = "DISABLE"; + /* + rach_sizeOfRA_PreamblesGroupA = ; + rach_messageSizeGroupA = ; + rach_messagePowerOffsetGroupB = ; + */ + rach_powerRampingStep = 4; + rach_preambleInitialReceivedTargetPower = -108; + rach_preambleTransMax = 10; + rach_raResponseWindowSize = 10; + rach_macContentionResolutionTimer = 48; + rach_maxHARQ_Msg3Tx = 4; + + pcch_default_PagingCycle = 128; + pcch_nB = "oneT"; + bcch_modificationPeriodCoeff = 2; + ue_TimersAndConstants_t300 = 1000; + ue_TimersAndConstants_t301 = 1000; + ue_TimersAndConstants_t310 = 1000; + ue_TimersAndConstants_t311 = 10000; + ue_TimersAndConstants_n310 = 20; + ue_TimersAndConstants_n311 = 1; + + } + ); + + + srb1_parameters : + { + # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500] + timer_poll_retransmit = 80; + + # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200] + timer_reordering = 35; + + # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500] + timer_status_prohibit = 0; + + # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)] + poll_pdu = 4; + + # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)] + poll_byte = 99999; + + # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32] + max_retx_threshold = 4; + } + + # ------- SCTP definitions + SCTP : + { + # Number of streams to use in input/output + SCTP_INSTREAMS = 2; + SCTP_OUTSTREAMS = 2; + }; + + + ////////// MME parameters: + mme_ip_address = ( { ipv4 = "192.168.12.11"; + ipv6 = "192:168:30::17"; + active = "yes"; + preference = "ipv4"; + } + ); + + NETWORK_INTERFACES : + { + + ENB_INTERFACE_NAME_FOR_S1_MME = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.215/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth3"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.215/24"; + ENB_PORT_FOR_S1U = 2152; # Spec 2152 + }; + + rrh_gw_config = ( + { + local_if_name = "eth0"; + remote_address = "90:e2:ba:c5:fc:04"; + local_address = "00:13:95:1f:a0:af"; + local_port = 50000; #for raw option local port must be the same to remote + remote_port = 50000; + rrh_gw_active = "yes"; + tr_preference = "raw_if5"; + rf_preference = "usrp_b200"; + iq_txshift = 4; + tx_sample_advance = 80; + tx_scheduling_advance = 9; + } + ); + + log_config : + { + global_log_level ="info"; + global_log_verbosity ="medium"; + hw_log_level ="info"; + hw_log_verbosity ="medium"; + phy_log_level ="info"; + phy_log_verbosity ="medium"; + mac_log_level ="info"; + mac_log_verbosity ="high"; + rlc_log_level ="info"; + rlc_log_verbosity ="medium"; + pdcp_log_level ="info"; + pdcp_log_verbosity ="medium"; + rrc_log_level ="info"; + rrc_log_verbosity ="medium"; + }; + } +); diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.50PRB.if5.usrpb210.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.50PRB.usrpb210.conf similarity index 100% rename from targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.50PRB.if5.usrpb210.conf rename to targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if5.50PRB.usrpb210.conf From 7e13688e803edeae563fd71d772cad48cf08b37a Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Wed, 8 Feb 2017 14:51:25 +0100 Subject: [PATCH 20/25] fix again the compilation issue with flexran --- openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c index 9a1e7ea1f9..9778f163c0 100644 --- a/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c +++ b/openair2/LAYER2/MAC/flexran_agent_scheduler_dlsch_ue.c @@ -1109,7 +1109,7 @@ flexran_schedule_ue_spec_common(mid_t mod_id, for (UE_id=UE_list->head; UE_id>=0; UE_id=UE_list->next[UE_id]) { rnti = flexran_get_ue_crnti(mod_id, UE_id); - eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP,CC_id,rnti); + eNB_UE_stats = mac_xface->get_eNB_UE_stats(mod_id,CC_id,rnti); ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id]; if (eNB_UE_stats==NULL) { @@ -1133,21 +1133,21 @@ flexran_schedule_ue_spec_common(mid_t mod_id, continue; } - switch(mac_xface->get_transmission_mode(mod_idP,CC_id,rnti)){ + switch(mac_xface->get_transmission_mode(mod_id,CC_id,rnti)){ case 1: case 2: case 7: - aggregation = get_aggregation(get_bw_index(module_idP,CC_id), + aggregation = get_aggregation(get_bw_index(mod_id,CC_id), eNB_UE_stats->DL_cqi[0], format1); break; case 3: - aggregation = get_aggregation(get_bw_index(module_idP,CC_id), + aggregation = get_aggregation(get_bw_index(mod_id,CC_id), eNB_UE_stats->DL_cqi[0], format2A); break; default: - LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(module_idP,CC_id,rnti)); + LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(mod_id,CC_id,rnti)); aggregation = 2; } From 80eaec1d5c529e8bad2e471c560a3dcdd8c6e586 Mon Sep 17 00:00:00 2001 From: Navid Nikaein Date: Thu, 9 Feb 2017 09:23:13 +0100 Subject: [PATCH 21/25] fix the protobuf installation under ubuntu 16.04 --- cmake_targets/tools/build_helper | 12 ++++++------ openair2/ENB_APP/enb_config.c | 5 +++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper index 448d54f334..f73078afc5 100755 --- a/cmake_targets/tools/build_helper +++ b/cmake_targets/tools/build_helper @@ -171,7 +171,7 @@ install_protobuf_from_source(){ echo "Downloading protobuf" rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1 wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz - tar -xzvf protobuf-2.6.1.tar.gz + tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner cd protobuf-2.6.1/ ./configure echo "Compiling protobuf" @@ -208,8 +208,8 @@ check_install_usrp_uhd_driver(){ #The new USRP repository $SUDO add-apt-repository ppa:ettusresearch/uhd -y $SUDO apt-get update - $SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev - $SUDO apt-get -y install libuhd-dev libuhd003 uhd-host + $SUDO apt-get -y --allow-unauthenticated install python python-tk libboost-all-dev libusb-1.0-0-dev + $SUDO apt-get -y --allow-unauthenticated install libuhd-dev libuhd003 uhd-host } install_usrp_uhd_driver() { @@ -224,9 +224,9 @@ check_install_bladerf_driver(){ $SUDO add-apt-repository -y ppa:bladerf/bladerf $SUDO apt-get update fi - $SUDO apt-get install -y bladerf libbladerf-dev - $SUDO apt-get install -y bladerf-firmware-fx3 - $SUDO apt-get install -y bladerf-fpga-hostedx40 + $SUDO apt-get install -y--allow-unauthenticated bladerf libbladerf-dev + $SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3 + $SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40 } flash_firmware_bladerf() { diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c index 1841d8e9a9..2a48aefbaf 100644 --- a/openair2/ENB_APP/enb_config.c +++ b/openair2/ENB_APP/enb_config.c @@ -2391,10 +2391,11 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1; } else if (strcmp(rf_preference, "bladerf") == 0) { enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1; - } else if (strcmp(rf_preference, "bladerf") == 0) { + } else if (strcmp(rf_preference, "lmsdr") == 0) { enb_properties.properties[enb_properties_index]->rrh_gw_config[j].lmssdr = 1; } else {//if (strcmp(preference, "no") == 0) - enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1; + + enb_properties.properties[enb_properties_index]->rrh_gw_config[j].exmimo = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_b200 = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].usrp_x300 = 1; enb_properties.properties[enb_properties_index]->rrh_gw_config[j].bladerf = 1; From 91e12a9724d764f317b2d2fcc6101553cb8b3bcb Mon Sep 17 00:00:00 2001 From: Younes Date: Fri, 10 Feb 2017 14:51:43 +0100 Subject: [PATCH 22/25] Fix if4p5 --- openair1/PHY/LTE_TRANSPORT/if4_tools.c | 24 ++++++++++------- openair1/PHY/LTE_TRANSPORT/prach.c | 14 +++++----- openair1/SCHED/phy_procedures_lte_eNb.c | 4 +++ targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c | 7 +++-- .../ETHERNET/USERSPACE/LIB/ethernet_lib.c | 11 ++++++++ targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h | 15 +++++++---- .../CONF/rcc.band7.tm1.if4p5.25PRB.conf | 26 +++++++++---------- .../CONF/rcc.band7.tm1.if4p5.50PRB.conf | 26 +++++++++---------- 8 files changed, 77 insertions(+), 50 deletions(-) diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c index 924eef11b9..be1bc6b08e 100755 --- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c @@ -108,8 +108,8 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type (packet_type == IF4p5_PULTICK)){ db_fulllength = 12*fp->N_RB_UL; db_halflength = (db_fulllength)>>1; - slotoffsetF = 1; - blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1; + slotoffsetF = 0; + blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; if (subframe_select(fp,subframe)==SF_S) { nsym=fp->ul_symbols_in_S_subframe; @@ -131,10 +131,12 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id); for (element_id=0; element_idframe_status &= ~(0x000f<<26); @@ -235,7 +237,7 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t 0) < 0) { perror("ETHERNET read"); } - + if (eth->flags == ETH_RAW_IF4p5_MODE) { packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES); data_block = (uint16_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES+sizeof_IF4p5_header_t); @@ -251,7 +253,6 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t *packet_type = packet_header->sub_type; - if (*packet_type == IF4p5_PDLFFT) { *symbol_number = ((packet_header->frame_status)>>26)&0x000f; @@ -273,10 +274,10 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t } else if (*packet_type == IF4p5_PULFFT) { *symbol_number = ((packet_header->frame_status)>>26)&0x000f; - if (eNB->CC_id==1) LOG_I(PHY,"UL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number); + if (eNB->CC_id==0) LOG_D(PHY,"UL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe,*symbol_number); - slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size) + 1; - blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength - 1; + slotoffsetF = (*symbol_number)*(fp->ofdm_symbol_size); + blockoffsetF = slotoffsetF + fp->ofdm_symbol_size - db_halflength; for (element_id=0; element_id>8) ]; + + //if (element_id==0) LOG_I(PHY,"recv_if4p5: symbol %d rxdata0 = (%u,%u)\n",*symbol_number,*i,*(i+1)); } - } else if (*packet_type == IF4p5_PRACH) { + } else if (*packet_type == IF4p5_PRACH) { + LOG_D(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe); if (eNB->CC_id==1) LOG_I(PHY,"PRACH_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,*frame,*subframe); // FIX: hard coded prach samples length diff --git a/openair1/PHY/LTE_TRANSPORT/prach.c b/openair1/PHY/LTE_TRANSPORT/prach.c index 489fdb0f71..ce4d4020d1 100644 --- a/openair1/PHY/LTE_TRANSPORT/prach.c +++ b/openair1/PHY/LTE_TRANSPORT/prach.c @@ -1125,7 +1125,7 @@ void rx_prach(PHY_VARS_eNB *eNB, int fft_size,log2_ifft_size; uint8_t nb_ant_rx = 1; //eNB->frame_parms.nb_antennas_rx; - // int en; + int en; for (aa=0; aacommon_vars.rxdata[0][aa][subframe*eNB->frame_parms.samples_per_tti-eNB->N_TA_offset]; @@ -1327,9 +1327,9 @@ void rx_prach(PHY_VARS_eNB *eNB, /// **** send_IF4 of rxsigF to RCC **** /// send_IF4p5(eNB, eNB->proc.frame_prach, eNB->proc.subframe_prach, IF4p5_PRACH, k); - // en = dB_fixed(signal_energy(&rxsigF[0][k],840)); - // if (en>60) - // printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); + en = dB_fixed(signal_energy(&rxsigF[0][k],840)); + if (en>60) + printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); return; } else if (eNB->node_function == NGFI_RCC_IF4p5) { k = (12*n_ra_prb) - 6*eNB->frame_parms.N_RB_UL; @@ -1347,9 +1347,9 @@ void rx_prach(PHY_VARS_eNB *eNB, (&rxsigF[0][0]), 839*2*sizeof(int16_t)); - //en = dB_fixed(signal_energy(&rxsigF[0][k],840)); - // if (en>60) - //printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en); + en = dB_fixed(signal_energy(&rxsigF[0][k],840)); + /*if (en>60) + printf("PRACH: Frame %d, Subframe %d => %d dB\n",eNB->proc.frame_rx,eNB->proc.subframe_rx,en);*/ } diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index cad508c7c2..a8a2be1781 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -3158,6 +3158,10 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const eNB->UE_stats[i].ulsch_errors[harq_pid]++; eNB->UE_stats[i].ulsch_consecutive_errors++; + /*if (eNB->ulsch[i]->harq_processes[harq_pid]->nb_rb > 20) { + dump_ulsch(eNB,proc,i); + exit(-1); + }*/ // indicate error to MAC if (eNB->mac_enabled == 1) mac_xface->rx_sdu(eNB->Mod_id, diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c index 898382cf6a..c151ab11ff 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c @@ -197,6 +197,7 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam int nblocks = nsamps; int bytes_sent = 0; + eth_state_t *eth = (eth_state_t*)device->priv; @@ -216,7 +217,6 @@ int trx_eth_write_udp_IF4p5(openair0_device *device, openair0_timestamp timestam } eth->tx_nsamps = nblocks; - bytes_sent = sendto(eth->sockfd, buff[0], packet_size, @@ -245,6 +245,8 @@ int trx_eth_write_udp(openair0_device *device, openair0_timestamp timestamp, voi //sendto_flag|=flags; eth->tx_nsamps=nsamps; + + for (i=0;iflags == ETH_RAW_IF5_MOBIPASS) { printf("Setting ETHERNET to RAW_IF5_MODE\n"); if (eth_socket_init_raw(device)!=0) return -1; @@ -98,6 +104,11 @@ int trx_eth_start(openair0_device *device) { } else { if(eth_get_dev_conf_udp(device)!=0) return -1; } + + /* adjust MTU wrt number of samples per packet */ + if(ethernet_tune (device,MTU_SIZE,UDP_IF4p5_PRACH_SIZE_BYTES)!=0) return -1; + + if(ethernet_tune (device,RCV_TIMEOUT,999999)!=0) return -1; } /* apply additional configuration */ if(ethernet_tune (device, SND_BUF_SIZE,2000000000)!=0) return -1; diff --git a/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h b/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h index 5fdb962b09..f4d6d6df1c 100644 --- a/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h +++ b/targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h @@ -47,6 +47,11 @@ #define ETH_RAW_IF5_MOBIPASS 4 #endif +// COMMOM HEADER LENGTHS + +#define UDP_HEADER_SIZE_BYTES 8 +#define IPV4_HEADER_SIZE_BYTES 60 // This is the maximum IPv4 header length + // Time domain RRH packet sizes #define MAC_HEADER_SIZE_BYTES (sizeof(struct ether_header)) #define MAX_PACKET_SEQ_NUM(spp,spf) (spf/spp) @@ -56,17 +61,17 @@ // Packet sizes for IF4p5 interface format #define DATA_BLOCK_SIZE_BYTES(scaled_nblocks) (sizeof(uint16_t)*scaled_nblocks) -#define PRACH_HARD_CODED_NUM_SAMPLES (839*2) +#define PRACH_HARD_CODED_NUM_SAMPLES (839*4) #define PRACH_BLOCK_SIZE_BYTES (sizeof(int16_t)*PRACH_HARD_CODED_NUM_SAMPLES) // FIX hard coded prach size #define RAW_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define RAW_IF4p5_PULFFT_SIZE_BYTES(nblocks) (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) #define RAW_IF4p5_PULTICK_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t) #define RAW_IF4p5_PRACH_SIZE_BYTES (MAC_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES) -#define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) -#define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) -#define UDP_IF4p5_PULTICK_SIZE_BYTES (sizeof_IF4p5_header_t) -#define UDP_IF4p5_PRACH_SIZE_BYTES (sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES) +#define UDP_IF4p5_PDLFFT_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) +#define UDP_IF4p5_PULFFT_SIZE_BYTES(nblocks) (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + DATA_BLOCK_SIZE_BYTES(nblocks)) +#define UDP_IF4p5_PULTICK_SIZE_BYTES (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t) +#define UDP_IF4p5_PRACH_SIZE_BYTES (UDP_HEADER_SIZE_BYTES + IPV4_HEADER_SIZE_BYTES + sizeof_IF4p5_header_t + PRACH_BLOCK_SIZE_BYTES) // Mobipass packet sizes #define RAW_IF5_MOBIPASS_BLOCK_SIZE_BYTES 1280 diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.conf index f9ebec3ab5..8572fc6917 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "93"; + mobile_network_code = "92"; ////////// Physical parameters: @@ -31,7 +31,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2660000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 25; @@ -50,7 +50,7 @@ eNBs = pucch_nRB_CQI = 1; pucch_nCS_AN = 0; pucch_n1_AN = 32; - pdsch_referenceSignalPower = -29; + pdsch_referenceSignalPower = -24; pdsch_p_b = 0; pusch_n_SB = 1; pusch_enable64QAM = "DISABLE"; @@ -86,7 +86,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; + rach_preambleInitialReceivedTargetPower = -104; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; @@ -137,7 +137,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -147,18 +147,18 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; rrh_gw_config = ( { - local_if_name = "eth0"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; + local_if_name = "em2"; + remote_address = "10.10.10.157"; + local_address = "10.10.10.19"; local_port = 50000; #for raw option local port must be the same to remote remote_port = 50000; rrh_gw_active = "yes"; @@ -177,7 +177,7 @@ eNBs = hw_log_level ="info"; hw_log_verbosity ="medium"; phy_log_level ="info"; - phy_log_verbosity ="medium"; + phy_log_verbosity ="info"; mac_log_level ="info"; mac_log_verbosity ="high"; rlc_log_level ="info"; diff --git a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf index 4ad5767ce9..43385eefb9 100644 --- a/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf +++ b/targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.conf @@ -17,7 +17,7 @@ eNBs = mobile_country_code = "208"; - mobile_network_code = "93"; + mobile_network_code = "92"; ////////// Physical parameters: @@ -31,7 +31,7 @@ eNBs = tdd_config_s = 0; prefix_type = "NORMAL"; eutra_band = 7; - downlink_frequency = 2685000000L; + downlink_frequency = 2660000000L; uplink_frequency_offset = -120000000; Nid_cell = 0; N_RB_DL = 50; @@ -50,7 +50,7 @@ eNBs = pucch_nRB_CQI = 1; pucch_nCS_AN = 0; pucch_n1_AN = 32; - pdsch_referenceSignalPower = -27; + pdsch_referenceSignalPower = -24; pdsch_p_b = 0; pusch_n_SB = 1; pusch_enable64QAM = "DISABLE"; @@ -86,7 +86,7 @@ eNBs = rach_messagePowerOffsetGroupB = ; */ rach_powerRampingStep = 4; - rach_preambleInitialReceivedTargetPower = -108; + rach_preambleInitialReceivedTargetPower = -104; rach_preambleTransMax = 10; rach_raResponseWindowSize = 10; rach_macContentionResolutionTimer = 48; @@ -138,7 +138,7 @@ eNBs = ////////// MME parameters: - mme_ip_address = ( { ipv4 = "127.0.0.3"; + mme_ip_address = ( { ipv4 = "192.168.12.26"; ipv6 = "192:168:30::17"; active = "yes"; preference = "ipv4"; @@ -148,18 +148,18 @@ eNBs = NETWORK_INTERFACES : { - ENB_INTERFACE_NAME_FOR_S1_MME = "lo"; - ENB_IPV4_ADDRESS_FOR_S1_MME = "127.0.0.2/24"; - ENB_INTERFACE_NAME_FOR_S1U = "lo"; - ENB_IPV4_ADDRESS_FOR_S1U = "127.0.0.5/24"; + ENB_INTERFACE_NAME_FOR_S1_MME = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.19/24"; + ENB_INTERFACE_NAME_FOR_S1U = "eth0"; + ENB_IPV4_ADDRESS_FOR_S1U = "192.168.12.19/24"; ENB_PORT_FOR_S1U = 2152; # Spec 2152 }; rrh_gw_config = ( { - local_if_name = "eth0"; - remote_address = "10.10.10.60"; - local_address = "10.10.10.215"; + local_if_name = "em2"; + remote_address = "10.10.10.157"; + local_address = "10.10.10.19"; local_port = 50000; #for raw option local port must be the same to remote remote_port = 50000; rrh_gw_active = "yes"; @@ -167,7 +167,7 @@ eNBs = rf_preference = "usrp_b200"; iq_txshift = 4; tx_sample_advance = 80; - tx_scheduling_advance = 9; + tx_scheduling_advance = 9; } ); From 9bf108c22775e2ebbdc9ea6bde2e69a047fb2348 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Fri, 10 Feb 2017 17:32:26 +0100 Subject: [PATCH 23/25] Revert "Merge remote-tracking branch 'origin/calib-LimeSDR' into develop_integration_w06" This reverts commit ce14050bb472247638d2bcd0e39c4c1042d7f00f, reversing changes made to 0ada1e9e32c4958d3f2d918529f96815895a6d50. --- openair1/PHY/MODULATION/ofdm_mod.c | 15 +- targets/ARCH/COMMON/common_lib.h | 3 - targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz.ini | 1128 ----------------- .../ARCH/LMSSDR/LimeSDR_above_1p8GHz_1v4.ini | 1128 ----------------- targets/ARCH/LMSSDR/LimeSDR_below_1p8GHz.ini | 1128 ----------------- .../ARCH/LMSSDR/LimeSDR_below_1p8GHz_1v4.ini | 1128 ----------------- targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp | 58 +- targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp | 48 +- targets/RT/USER/lte-ue.c | 21 +- 9 files changed, 32 insertions(+), 4625 deletions(-) delete mode 100755 targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz.ini delete mode 100755 targets/ARCH/LMSSDR/LimeSDR_above_1p8GHz_1v4.ini delete mode 100755 targets/ARCH/LMSSDR/LimeSDR_below_1p8GHz.ini delete mode 100755 targets/ARCH/LMSSDR/LimeSDR_below_1p8GHz_1v4.ini diff --git a/openair1/PHY/MODULATION/ofdm_mod.c b/openair1/PHY/MODULATION/ofdm_mod.c index cafccd998c..f6f0c1f618 100644 --- a/openair1/PHY/MODULATION/ofdm_mod.c +++ b/openair1/PHY/MODULATION/ofdm_mod.c @@ -137,13 +137,10 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input printf("[PHY] symbol %d/%d offset %d (%p,%p -> %p)\n",i,nb_symbols,i*fftsize+(i*nb_prefix_samples),input,&input[i*fftsize],&output[(i*fftsize) + ((i)*nb_prefix_samples)]); #endif -#if 0 #ifndef __AVX2__ // handle 128-bit alignment for 128-bit SIMD (SSE4,NEON,AltiVEC) idft((int16_t *)&input[i*fftsize], - /* TODO: we always use temp, TBC */ - //(fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)], - (int16_t *)temp, + (fftsize==128) ? (int16_t *)temp : (int16_t *)&output[(i*fftsize) + ((1+i)*nb_prefix_samples)], 1); #else // on AVX2 need 256-bit alignment @@ -152,11 +149,7 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input 1); #endif -#endif /* #if 0 */ - idft((int16_t *)&input[i*fftsize], - (int16_t *)temp, - 1); // Copy to frame buffer with Cyclic Extension // Note: will have to adjust for synchronization offset! @@ -167,14 +160,10 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input // msg("Doing cyclic prefix method\n"); -#if 0 - /* TODO: we always use temp, TBC */ + #ifndef __AVX2__ if (fftsize==128) -#else - if (fftsize<=512) #endif -#endif /* #if 0 */ { for (j=0; j 1) { - printf("[LMS] Reduce RX Gain 0 by %f dB\n",openair0_cfg[0].rx_gain[0]-openair0_cfg[0].rx_gain_offset[0]); - ret = -1; - rxg_ratio = 1; - } - LMS_SetNormalizedGain(lms_device, LMS_CH_TX, 0, openair0_cfg[0].tx_gain[0]/100.0); - LMS_SetNormalizedGain(lms_device, LMS_CH_RX, 0, .8*rxg_ratio); - /* + // RX gains, use low-level setting + double gv = openair0_cfg[0].rx_gain[0] - openair0_cfg[0].rx_gain_offset[0]; if (gv > 31) { printf("RX Gain 0 too high, reduce by %f dB\n",gv-31); - gv = 31; - ret=-1; + gv = 31; } if (gv < 0) { printf("RX Gain 0 too low, increase by %f dB\n",-gv); - gv = 0; - ret=-1; + gv = 0; } printf("[LMS] Setting 7002M G_PGA_RBB to %d\n", (int16_t)gv); LMS7002M lms7; lms7.SetConnection(lms7.GetConnection()); lms7.Modify_SPI_Reg_bits(LMS7param(G_PGA_RBB),(int16_t)gv); - */ - return(ret); + + return(0); } /*! \brief Start LMSSDR @@ -174,8 +163,7 @@ int trx_lms_start(openair0_device *device){ lms_info_str_t list[16]={0}; int n= LMS_GetDeviceList(list); - int ret; - + if (n <= 0) { fprintf(stderr, "No LimeSDR board found: %s\n", n < 0?LMS_GetLastErrorMessage():""); return -1; @@ -224,9 +212,9 @@ int trx_lms_start(openair0_device *device){ } printf("Set TX frequency %f MHz\n",device->openair0_cfg[0].tx_freq[0]/1e6); - // printf("Override antenna settings to: RX1_H, TXA_2"); - // LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1); - // LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2); + printf("Override antenna settings to: RX1_H, TXA_2"); + LMS_SetAntenna(lms_device, LMS_CH_RX, 0, 1); + LMS_SetAntenna(lms_device, LMS_CH_TX, 0, 2); @@ -257,7 +245,7 @@ int trx_lms_start(openair0_device *device){ tx_stream.dataFmt = lms_stream_t::LMS_FMT_I12; tx_stream.isTx = true; - if ((ret = trx_lms_set_gains(device, device->openair0_cfg))<0) return(-1); + trx_lms_set_gains(device, device->openair0_cfg); if (LMS_SetupStream(lms_device, &tx_stream)!=0) printf("TX stream setup failed %s\n",LMS_GetLastErrorMessage()); @@ -271,7 +259,6 @@ int trx_lms_start(openair0_device *device){ printf("Failed to start TX stream %s\n",LMS_GetLastErrorMessage()); if (LMS_StartStream(&tx_stream)!=0) printf("Failed to start Rx stream %s\n",LMS_GetLastErrorMessage()); - device->trx_started=1; return 0; } @@ -285,7 +272,6 @@ int trx_lms_stop(openair0_device *device) { LMS_DestroyStream(lms_device,&rx_stream); LMS_DestroyStream(lms_device,&tx_stream); LMS_Close(lms_device); - device->trx_started=0; } /*! \brief Set frequencies (TX/RX) @@ -306,27 +292,19 @@ int trx_lms_set_freq(openair0_device* device, openair0_config_t *openair0_cfg,in // 31 = 19 dB => 105 dB total gain @ 2.6 GHz /*! \brief calibration table for LMSSDR */ -// V1.2 board -rx_gain_calib_table_t calib_table_lmssdr_1v2[] = { - {3500000000.0,44.0}, // on L PAD - {2660000000.0,62.0}, // on L PAD - {2300000000.0,62.0}, // on L PAD - {1880000000.0,64.0}, // on L PAD - {816000000.0,79.0}, // on W PAD - {-1,0}}; -// V1.4 board rx_gain_calib_table_t calib_table_lmssdr[] = { - {3500000000.0,97.0}, // on H PAD - {2660000000.0,110.0}, // on H PAD - {2300000000.0,106.0}, // on H PAD - {1880000000.0,106.0}, // on H PAD - {816000000.0,102.0}, // on W PAD + {3500000000.0,70.0}, + {2660000000.0,80.0}, + {2300000000.0,80.0}, + {1880000000.0,74.0}, // on W PAD + {816000000.0,76.0}, // on W PAD {-1,0}}; + /*! \brief Get LMSSDR Statistics * \param device the hardware to use * \returns 0 in success @@ -354,7 +332,7 @@ int trx_lms_reset_stats(openair0_device* device) { */ void trx_lms_end(openair0_device *device) { - device->trx_started=0; + } extern "C" { diff --git a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp index dc91d84c45..2a2e09f40c 100644 --- a/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp +++ b/targets/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp @@ -88,12 +88,6 @@ typedef struct //! Sampling rate double sample_rate; - //! rx RF frequency - double rx_RFfreq; - - //! tx RF frequency - double tx_RFfreq; - //! time offset between transmiter timestamp and receiver timestamp; double tdiff; @@ -143,8 +137,6 @@ static int trx_usrp_start(openair0_device *device) s->tx_count = 0; s->rx_timestamp = 0; - device->trx_started=1; - return 0; } /*! \brief Terminate operation of the USRP transceiver -- free all associated resources @@ -160,7 +152,7 @@ static void trx_usrp_end(openair0_device *device) s->tx_md.end_of_burst = true; s->tx_stream->send("", 0, s->tx_md); s->tx_md.end_of_burst = false; - device->trx_started=0; + } /*! \brief Called to send samples to the USRP RF target @@ -396,45 +388,14 @@ int trx_usrp_set_freq(openair0_device* device, openair0_config_t *openair0_cfg, usrp_state_t *s = (usrp_state_t*)device->priv; pthread_t f_thread; - double rx_off,tx_off; + printf("Setting USRP TX Freq %f, RX Freq %f\n",openair0_cfg[0].tx_freq[0],openair0_cfg[0].rx_freq[0]); - - if (fabs(s->rx_RFfreq-openair0_cfg[0].rx_freq[0])<1e6) { - // induce use of digital tuning - rx_off = s->rx_RFfreq-openair0_cfg[0].rx_freq[0]; - } - else { // allow UHD to select the frequnecy - rx_off = 0; - s->rx_RFfreq = openair0_cfg[0].rx_freq[0]; - } - - if (fabs(s->tx_RFfreq-openair0_cfg[0].tx_freq[0])<1e6) { - // induce use of digital tuning - tx_off = s->tx_RFfreq-openair0_cfg[0].tx_freq[0]; - } - else { // allow UHD to select the frequnecy - tx_off = 0; - s->tx_RFfreq = openair0_cfg[0].tx_freq[0]; - } - - printf("Setting USRP TX Freq %f (%f), RX Freq %f (%f)\n",s->tx_RFfreq,tx_off,s->rx_RFfreq,rx_off); - - // spawn a thread to handle the frequency change to not block the calling thread if (dont_block == 1) pthread_create(&f_thread,NULL,freq_thread,(void*)device); else { - uhd::tune_request_t treq_rx(s->rx_RFfreq+rx_off); - treq_rx.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL; - treq_rx.rf_freq = s->rx_RFfreq; - s->usrp->set_rx_freq(treq_rx); - - - uhd::tune_request_t treq_tx(s->tx_RFfreq+tx_off); - treq_tx.rf_freq_policy = uhd::tune_request_t::POLICY_MANUAL; - treq_tx.rf_freq = s->tx_RFfreq; - s->usrp->set_tx_freq(treq_tx); - + s->usrp->set_tx_freq(device->openair0_cfg[0].tx_freq[0]); + s->usrp->set_rx_freq(device->openair0_cfg[0].rx_freq[0]); } return(0); @@ -492,7 +453,6 @@ int trx_usrp_set_gains(openair0_device* device, * \param card refers to the hardware index to use */ int trx_usrp_stop(openair0_device* device) { - device->trx_started=0; return(0); } diff --git a/targets/RT/USER/lte-ue.c b/targets/RT/USER/lte-ue.c index 8f3fe470e5..ed93f44aa9 100644 --- a/targets/RT/USER/lte-ue.c +++ b/targets/RT/USER/lte-ue.c @@ -372,15 +372,14 @@ static void *UE_thread_synch(void *arg) while (sync_var<0) pthread_cond_wait(&sync_cond, &sync_mutex); + pthread_mutex_unlock(&sync_mutex); + printf("Started device, unlocked sync_mutex (UE_sync_thread)\n"); if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { LOG_E(HW,"Could not start the device\n"); oai_exit=1; } - pthread_mutex_unlock(&sync_mutex); - printf("Started device, unlocked sync_mutex (UE_sync_thread)\n"); - while (oai_exit==0) { if (pthread_mutex_lock(&UE->proc.mutex_synch) != 0) { @@ -497,14 +496,13 @@ static void *UE_thread_synch(void *arg) UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0); //UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]); - - //UE->rfdevice.trx_stop_func(&UE->rfdevice); - // sleep(1); + UE->rfdevice.trx_stop_func(&UE->rfdevice); + sleep(1); init_frame_parms(&UE->frame_parms,1); - // if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { - // LOG_E(HW,"Could not start the device\n"); - // oai_exit=1; - // } + if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) { + LOG_E(HW,"Could not start the device\n"); + oai_exit=1; + } } else { UE->is_synchronized = 1; @@ -952,9 +950,6 @@ void *UE_thread(void *arg) { itti_send_msg_to_task (TASK_NAS_UE, INSTANCE_DEFAULT, message_p); #endif - while (UE->rfdevice.trx_started==0) - usleep(500); - while (!oai_exit) { if (UE->is_synchronized == 0) { From cd1bd0467c13f6703423972b6d32fe7be6af0202 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 13 Feb 2017 10:30:05 +0100 Subject: [PATCH 24/25] test setup v2: minor: print commands before execution --- cmake_targets/autotests/v2/actions/execution_compile.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake_targets/autotests/v2/actions/execution_compile.bash b/cmake_targets/autotests/v2/actions/execution_compile.bash index 6791e93b0d..530447ebcd 100644 --- a/cmake_targets/autotests/v2/actions/execution_compile.bash +++ b/cmake_targets/autotests/v2/actions/execution_compile.bash @@ -3,6 +3,9 @@ source oaienv cd cmake_targets rm -rf log mkdir -p log +echo $PRE_BUILD bash -c "$PRE_BUILD" +echo $BUILD_PROG $BUILD_ARGUMENTS $BUILD_PROG $BUILD_ARGUMENTS +echo $PRE_EXEC bash -c "$PRE_EXEC" From 7fd46420d92c0f66d3b76e44490e17dd91f214e9 Mon Sep 17 00:00:00 2001 From: Cedric Roux Date: Mon, 13 Feb 2017 11:16:38 +0100 Subject: [PATCH 25/25] minor: fix log (from LOG_D to LOG_I) --- openair1/SCHED/phy_procedures_lte_eNb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c index 865bf29466..5b49abbe21 100644 --- a/openair1/SCHED/phy_procedures_lte_eNb.c +++ b/openair1/SCHED/phy_procedures_lte_eNb.c @@ -2009,7 +2009,7 @@ void prach_procedures(PHY_VARS_eNB *eNB) { eNB->UE_stats[(uint32_t)UE_id].UE_timing_offset = preamble_delay_list[preamble_max]&0x1FFF; //limit to 13 (=11+2) bits eNB->UE_stats[(uint32_t)UE_id].sector = 0; - LOG_I(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", + LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure (UE_id %d) with preamble %d, energy %d.%d dB, delay %d\n", eNB->Mod_id, eNB->CC_id, frame,