Commit 7d5e0bb0 authored by Xu Bo's avatar Xu Bo

Merge branch 'issue271_hundreds_of_ues' into ues_test

parents 1a653e08 1534a0e3
...@@ -838,10 +838,10 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -838,10 +838,10 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
if (uci->type == SR) { if (uci->type == SR) {
if (SR_payload == 1) { if (SR_payload == 1) {
fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR); fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
break; break;
} }
else { else {
break; break;
} }
} }
case HARQ: case HARQ:
......
...@@ -115,9 +115,9 @@ typedef struct RrcConfigurationReq_s { ...@@ -115,9 +115,9 @@ typedef struct RrcConfigurationReq_s {
long pucch_delta_shift[MAX_NUM_CCs]; long pucch_delta_shift[MAX_NUM_CCs];
long pucch_nRB_CQI[MAX_NUM_CCs]; long pucch_nRB_CQI[MAX_NUM_CCs];
long pucch_nCS_AN[MAX_NUM_CCs]; long pucch_nCS_AN[MAX_NUM_CCs];
#if !defined(Rel10) && !defined(Rel14) //#if !defined(Rel10) && !defined(Rel14)
long pucch_n1_AN[MAX_NUM_CCs]; long pucch_n1_AN[MAX_NUM_CCs];
#endif //#endif
long pdsch_referenceSignalPower[MAX_NUM_CCs]; long pdsch_referenceSignalPower[MAX_NUM_CCs];
long pdsch_p_b[MAX_NUM_CCs]; long pdsch_p_b[MAX_NUM_CCs];
long pusch_n_SB[MAX_NUM_CCs]; long pusch_n_SB[MAX_NUM_CCs];
......
...@@ -828,12 +828,21 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { ...@@ -828,12 +828,21 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
RC.config_file_name, i, prach_zero_correlation); RC.config_file_name, i, prach_zero_correlation);
RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[j] = prach_freq_offset; RRC_CONFIGURATION_REQ (msg_p).prach_freq_offset[j] = prach_freq_offset;
#ifndef UE_EXPANSION
if ((prach_freq_offset <0) || (prach_freq_offset > 94)) if ((prach_freq_offset <0) || (prach_freq_offset > 94))
AssertFatal (0, AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n", "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 0..94!\n",
RC.config_file_name, i, prach_freq_offset); RC.config_file_name, i, prach_freq_offset);
#else
if ((N_RB_DL == 25) && (prach_freq_offset != 2))
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 2(N_RB_DL %d)!\n",
RC.config_file_name, i, prach_freq_offset,N_RB_DL);
if (((N_RB_DL == 50) || (N_RB_DL == 100)) && (prach_freq_offset != 3))
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for prach_freq_offset choice: 3(N_RB_DL %d)!\n",
RC.config_file_name, i, prach_freq_offset,N_RB_DL);
#endif
RRC_CONFIGURATION_REQ (msg_p).pucch_delta_shift[j] = pucch_delta_shift-1; RRC_CONFIGURATION_REQ (msg_p).pucch_delta_shift[j] = pucch_delta_shift-1;
...@@ -856,7 +865,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { ...@@ -856,7 +865,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n", "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_nCS_AN choice: 0..7!\n",
RC.config_file_name, i, pucch_nCS_AN); RC.config_file_name, i, pucch_nCS_AN);
#if !defined(Rel10) && !defined(Rel14) //#if !defined(Rel10) && !defined(Rel14)
RRC_CONFIGURATION_REQ (msg_p).pucch_n1_AN[j] = pucch_n1_AN; RRC_CONFIGURATION_REQ (msg_p).pucch_n1_AN[j] = pucch_n1_AN;
if ((pucch_n1_AN <0) || (pucch_n1_AN > 2047)) if ((pucch_n1_AN <0) || (pucch_n1_AN > 2047))
...@@ -864,7 +873,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) { ...@@ -864,7 +873,7 @@ int RCconfig_RRC(MessageDef *msg_p, uint32_t i, eNB_RRC_INST *rrc) {
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n", "Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for pucch_n1_AN choice: 0..2047!\n",
RC.config_file_name, i, pucch_n1_AN); RC.config_file_name, i, pucch_n1_AN);
#endif //#endif
RRC_CONFIGURATION_REQ (msg_p).pdsch_referenceSignalPower[j] = pdsch_referenceSignalPower; RRC_CONFIGURATION_REQ (msg_p).pdsch_referenceSignalPower[j] = pdsch_referenceSignalPower;
if ((pdsch_referenceSignalPower <-60) || (pdsch_referenceSignalPower > 50)) if ((pdsch_referenceSignalPower <-60) || (pdsch_referenceSignalPower > 50))
......
...@@ -1046,7 +1046,11 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP, ...@@ -1046,7 +1046,11 @@ schedule_ulsch(module_id_t module_idP, frame_t frameP,
for (i=0; i<NB_RA_PROC_MAX; i++) { for (i=0; i<NB_RA_PROC_MAX; i++) {
if ((cc->ra[i].state == WAITMSG3) &&(cc->ra[i].Msg3_subframe == sched_subframe)) { if ((cc->ra[i].state == WAITMSG3) &&(cc->ra[i].Msg3_subframe == sched_subframe)) {
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_MSG3; ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_MSG3;
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1; if(frame_parms->N_RB_UL == 25){
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1;
}else{
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 2;
}
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].nb_rb = 1; ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].nb_rb = 1;
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].UE_id = -1; ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].UE_id = -1;
ulsch_ue_select[CC_id].ue_num++; ulsch_ue_select[CC_id].ue_num++;
...@@ -1610,19 +1614,31 @@ void schedule_ulsch_rnti(module_id_t module_idP, ...@@ -1610,19 +1614,31 @@ void schedule_ulsch_rnti(module_id_t module_idP,
// loop over all active UEs // loop over all active UEs
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
//leave out first RB for PUCCH
first_rb[CC_id] = 1;
ULSCH_first_end = 0; ULSCH_first_end = 0;
cc = &eNB->common_channels[CC_id]; cc = &eNB->common_channels[CC_id];
// This is the actual CC_id in the list
N_RB_UL = to_prb(cc->mib->message.dl_Bandwidth);
//leave out first RB for PUCCH
if(N_RB_UL == 25){
first_rb[CC_id] = 1;
}else{
first_rb[CC_id] = 2;
}
for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) { for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) {
// This is the actual CC_id in the list
N_RB_UL = to_prb(cc->ul_Bandwidth);
UE_id = ulsch_ue_select[CC_id].list[ulsch_ue_num].UE_id; UE_id = ulsch_ue_select[CC_id].list[ulsch_ue_num].UE_id;
/* be sure that there are some free RBs */ /* be sure that there are some free RBs */
if (first_rb[CC_id] >= N_RB_UL-1) { if(N_RB_UL == 25){
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", if (first_rb[CC_id] >= N_RB_UL-1) {
module_idP,frameP,subframeP,UE_id,rnti,CC_id); LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
break; module_idP,frameP,subframeP,UE_id,rnti,CC_id);
break;
}
}else{
if (first_rb[CC_id] >= N_RB_UL-2) {
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
module_idP,frameP,subframeP,UE_id,rnti,CC_id);
break;
}
} }
//MSG3 //MSG3
if (ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_MSG3) { if (ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_MSG3) {
......
...@@ -2620,7 +2620,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -2620,7 +2620,11 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
// MCS and RB assgin // MCS and RB assgin
for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) { for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) {
frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms); frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms);
first_rb[CC_id] = 1; if(frame_parms->N_RB_UL == 25){
first_rb[CC_id] = 1;
}else{
first_rb[CC_id] = 2;
}
ue_num_temp = ulsch_ue_select[CC_id].ue_num; ue_num_temp = ulsch_ue_select[CC_id].ue_num;
for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) { for ( ulsch_ue_num = 0; ulsch_ue_num < ulsch_ue_select[CC_id].ue_num; ulsch_ue_num++ ) {
...@@ -2639,13 +2643,23 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -2639,13 +2643,23 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} }
rnti = UE_RNTI(CC_id,UE_id); rnti = UE_RNTI(CC_id,UE_id);
if ( first_rb[CC_id] >= frame_parms->N_RB_UL-1 ) { if(frame_parms->N_RB_UL == 25){
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n", if ( first_rb[CC_id] >= frame_parms->N_RB_UL-1 ){
module_idP,frameP,subframeP,UE_id,rnti,CC_id); LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
break; module_idP,frameP,subframeP,UE_id,rnti,CC_id);
break;
}
// calculate the average rb ( remain UE)
total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id];
}else{
if ( first_rb[CC_id] >= frame_parms->N_RB_UL-2 ){
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
module_idP,frameP,subframeP,UE_id,rnti,CC_id);
break;
}
// calculate the average rb ( remain UE)
total_rbs = frame_parms->N_RB_UL-2-first_rb[CC_id];
} }
// calculate the average rb ( remain UE)
total_rbs = frame_parms->N_RB_UL-1-first_rb[CC_id];
average_rbs = (int)round((double)total_rbs/(double)ue_num_temp); average_rbs = (int)round((double)total_rbs/(double)ue_num_temp);
if ( average_rbs < 3 ) { if ( average_rbs < 3 ) {
ue_num_temp--; ue_num_temp--;
...@@ -2667,8 +2681,12 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -2667,8 +2681,12 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
} else { } else {
// assigne RBS(remain rbs) // assigne RBS(remain rbs)
ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb = first_rb[CC_id]; ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb = first_rb[CC_id];
first_rb[CC_id] = first_rb[CC_id] + total_rbs; rb_table_index = 2;
ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb = first_rb[CC_id]-ulsch_ue_select[CC_id].list[ulsch_ue_num].start_rb; while(rb_table[rb_table_index] <= total_rbs){
rb_table_index++;
}
ulsch_ue_select[CC_id].list[ulsch_ue_num].nb_rb = rb_table[rb_table_index-1];
first_rb[CC_id] = first_rb[CC_id] + rb_table[rb_table_index-1];
} }
} }
}else{ }else{
...@@ -2683,16 +2701,27 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP, ...@@ -2683,16 +2701,27 @@ void ulsch_scheduler_pre_processor(module_id_t module_idP,
rb_table_index = 2; rb_table_index = 2;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3;
tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0);
while ( (((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer)) && (mcs > 3) ) { while ( (((UE_template->phr_info - tx_power) < 0 ) || (tbs > UE_template->ul_total_buffer)) && (mcs > 3) ) {
mcs--; mcs--;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3;
tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0);
} }
while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-first_rb[CC_id])) &&
((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) { if(frame_parms->N_RB_UL == 25){
rb_table_index++; while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-1-first_rb[CC_id])) &&
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3; ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) {
tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0); rb_table_index++;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3;
tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0);
}
}else{
while ( (tbs < UE_template->ul_total_buffer) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-2-first_rb[CC_id])) &&
((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) {
rb_table_index++;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index])<<3;
tx_power= estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0);
}
} }
if ( rb_table[rb_table_index]<3 ) { if ( rb_table[rb_table_index]<3 ) {
rb_table_index=2; rb_table_index=2;
......
...@@ -71,7 +71,11 @@ fill_rar(const module_id_t module_idP, ...@@ -71,7 +71,11 @@ fill_rar(const module_id_t module_idP,
ra->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps ra->timing_offset /= 16; //T_A = N_TA/16, where N_TA should be on a 30.72Msps
rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4 rar[0] = (uint8_t) (ra->timing_offset >> (2 + 4)); // 7 MSBs of timing advance + divide by 4
rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4 rar[1] = (uint8_t) (ra->timing_offset << (4 - 2)) & 0xf0; // 4 LSBs of timing advance + divide by 4
ra->msg3_first_rb = 1; if(N_RB_UL == 25){
ra->msg3_first_rb = 1;
}else{
ra->msg3_first_rb = 2;
}
ra->msg3_nb_rb = 1; ra->msg3_nb_rb = 1;
uint16_t rballoc = mac_computeRIV(N_RB_UL, ra->msg3_first_rb, ra->msg3_nb_rb); // first PRB only for UL Grant uint16_t rballoc = mac_computeRIV(N_RB_UL, ra->msg3_first_rb, ra->msg3_nb_rb); // first PRB only for UL Grant
rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc rar[1] |= (rballoc >> 7) & 7; // Hopping = 0 (bit 3), 3 MSBs of rballoc
......
...@@ -659,10 +659,10 @@ uint8_t do_SIB23(uint8_t Mod_id, ...@@ -659,10 +659,10 @@ uint8_t do_SIB23(uint8_t Mod_id,
= configuration->pucch_nRB_CQI[CC_id]; = configuration->pucch_nRB_CQI[CC_id];
(*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nCS_AN (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.nCS_AN
= configuration->pucch_nCS_AN[CC_id]; = configuration->pucch_nCS_AN[CC_id];
#if !defined(Rel10) && !defined(Rel14) //#if !defined(Rel10) && !defined(Rel14)
(*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.n1PUCCH_AN (*sib2)->radioResourceConfigCommon.pucch_ConfigCommon.n1PUCCH_AN
= configuration->pucch_n1_AN[CC_id]; = configuration->pucch_n1_AN[CC_id];
#endif //#endif
// SRS Config // SRS Config
if (configuration->srs_enable[CC_id]==1) { if (configuration->srs_enable[CC_id]==1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment