modify pre_scd thread and add phy_tx and rf_tx thread

This commit is contained in:
Xu Bo
2018-01-22 03:59:04 +00:00
parent d6dfd5f82f
commit 70da4b5902
15 changed files with 513 additions and 230 deletions
+16
View File
@@ -409,6 +409,10 @@ set_ul_DAI(int module_idP, int UE_idP, int CC_idP, int frameP,
}
#ifdef UE_EXPANSION
extern volatile int16_t phy_tx_txdataF_end;
extern int oai_exit;
#endif
// changes to pre-processor for eMTC
//------------------------------------------------------------------------------
@@ -546,6 +550,12 @@ schedule_ue_spec(module_id_t module_idP,
stop_meas(&eNB->schedule_dlsch_preprocessor);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,VCD_FUNCTION_OUT);
#ifdef UE_EXPANSION
struct timespec time_req, time_rem;
time_req.tv_sec = 0;
time_req.tv_nsec = 10000;
#endif
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d\n",CC_id);
@@ -1254,6 +1264,12 @@ schedule_ue_spec(module_id_t module_idP,
post_padding = TBS - sdu_length_total - header_len_dcch - header_len_dtch - ta_len; // 1 is for the postpadding header
}
#ifdef UE_EXPANSION
while((!oai_exit)&&(phy_tx_txdataF_end == 0)){
nanosleep(&time_req,&time_rem);
continue;
}
#endif
offset = generate_dlsch_header((unsigned char *) UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0], num_sdus, //num_sdus
sdu_lengths, //
-4
View File
@@ -113,10 +113,6 @@ extern uint8_t dlsch_ue_select_tbl_in_use;
extern uint8_t new_dlsch_ue_select_tbl_in_use;
extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX];
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
/// sorted downlink component carrier for the scheduler
extern int pre_scd_ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
/// number of downlink active component carrier
extern int pre_scd_numactiveCCs[NUMBER_OF_UE_MAX];
#endif
#endif //DEF_H
+21 -113
View File
@@ -548,20 +548,33 @@ void sort_UEs(module_id_t Mod_idP, int frameP, sub_frame_t subframeP)
}
#if defined(UE_EXPANSION) || defined(UE_EXPANSION_SIM2)
inline uint16_t search_rbs_required(uint16_t mcs, uint16_t TBS,uint16_t NB_RB, uint16_t step_size){
uint16_t nb_rb,i_TBS,tmp_TBS;
i_TBS=get_I_TBS(mcs);
for(nb_rb=step_size;nb_rb<NB_RB;nb_rb+=step_size){
tmp_TBS = TBStable[i_TBS][nb_rb-1]>>3;
if(TBS<tmp_TBS)return(nb_rb);
}
return NB_RB;
}
void pre_scd_nb_rbs_required( module_id_t module_idP,
frame_t frameP,
sub_frame_t subframeP,
int min_rb_unit[MAX_NUM_CCs],
uint16_t nb_rbs_required[MAX_NUM_CCs][NUMBER_OF_UE_MAX])
{
int CC_id,UE_id, lc_id,i, j, tmp, N_RB_DL;;
int CC_id=0,UE_id, lc_id, N_RB_DL;
UE_TEMPLATE UE_template;
eNB_UE_STATS *eNB_UE_stats, *eNB_UE_stats_i, *eNB_UE_stats_j;
eNB_UE_STATS *eNB_UE_stats;
rnti_t rnti;
mac_rlc_status_resp_t rlc_status;
uint16_t TBS = 0;
uint16_t step_size=2;
N_RB_DL = to_prb(RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth);
if(N_RB_DL==50) step_size=3;
if(N_RB_DL==100) step_size=4;
memset(nb_rbs_required, 0, sizeof(uint16_t)*MAX_NUM_CCs*NUMBER_OF_UE_MAX);
UE_list_t *UE_list = &RC.mac[module_idP]->UE_list;
for (UE_id = 0; UE_id <NUMBER_OF_UE_MAX; UE_id++) {
if (pre_scd_activeUE[UE_id] != TRUE)
@@ -571,132 +584,27 @@ void pre_scd_nb_rbs_required( module_id_t module_idP,
// clear logical channel interface variables
UE_template.dl_buffer_total = 0;
UE_template.dl_pdus_total = 0;
rnti = UE_RNTI(module_idP, UE_id);
for (lc_id = DCCH; lc_id <= DTCH; lc_id++) {
UE_template.dl_buffer_info[lc_id] = 0;
UE_template.dl_pdus_in_buffer[lc_id] = 0;
UE_template.dl_buffer_head_sdu_creation_time[lc_id] = 0;
UE_template.dl_buffer_head_sdu_remaining_size_to_send[lc_id] = 0;
rlc_status =
mac_rlc_status_ind(module_idP, rnti, module_idP, frameP, subframeP,
ENB_FLAG_YES, MBMS_FLAG_NO, lc_id, 0);
UE_template.dl_buffer_info[lc_id] = rlc_status.bytes_in_buffer; //storing the dlsch buffer for each logical channel
UE_template.dl_pdus_in_buffer[lc_id] = rlc_status.pdus_in_buffer;
UE_template.dl_buffer_head_sdu_creation_time[lc_id] = rlc_status.head_sdu_creation_time;
UE_template.dl_buffer_head_sdu_creation_time_max =
cmax(UE_template.dl_buffer_head_sdu_creation_time_max,
rlc_status.head_sdu_creation_time);
UE_template.dl_buffer_head_sdu_remaining_size_to_send[lc_id] =
rlc_status.head_sdu_remaining_size_to_send;
UE_template.dl_buffer_head_sdu_is_segmented[lc_id] = rlc_status.head_sdu_is_segmented;
UE_template.dl_buffer_total += UE_template.dl_buffer_info[lc_id]; //storing the total dlsch buffer
UE_template.dl_pdus_total += UE_template.dl_pdus_in_buffer[lc_id];
#ifdef DEBUG_eNB_SCHEDULER
/* note for dl_buffer_head_sdu_remaining_size_to_send[i] :
* 0 if head SDU has not been segmented (yet), else remaining size not already segmented and sent
*/
if (UE_template.dl_buffer_info[lc_id] > 0)
LOG_D(MAC,
"[eNB %d] Frame %d Subframe %d : RLC status for UE %d %x in LCID%d: total of %d pdus and size %d, head sdu queuing time %d, remaining size %d, is segmeneted %d \n",
module_idP, frameP, subframeP, UE_id, rnti,
lc_id, UE_template.dl_pdus_in_buffer[lc_id],
UE_template.dl_buffer_info[lc_id],
UE_template.dl_buffer_head_sdu_creation_time[lc_id],
UE_template.
dl_buffer_head_sdu_remaining_size_to_send[lc_id],
UE_template.dl_buffer_head_sdu_is_segmented[lc_id]);
#endif
UE_template.dl_buffer_total += rlc_status.bytes_in_buffer; //storing the total dlsch buffer
}
if (UE_template.dl_buffer_total > 0)
LOG_D(MAC,
"[eNB %d] Frame %d Subframe %d : RLC status for UE %d %x: total DL buffer size %d and total number of pdu %d \n",
module_idP, frameP, subframeP, UE_id,rnti,
UE_template.dl_buffer_total,
UE_template.dl_pdus_total);
// end of store dlsch buffer
// assgin rbs required
// Calculate the number of RBs required by each UE on the basis of logical channel's buffer
//update CQI information across component carriers
for (i = 0; i < pre_scd_numactiveCCs[UE_id]; i++) {
CC_id = pre_scd_ordered_CCids[i][UE_id];
eNB_UE_stats = &pre_scd_eNB_UE_stats[CC_id][UE_id];
eNB_UE_stats = &pre_scd_eNB_UE_stats[CC_id][UE_id];
eNB_UE_stats->dlsch_mcs1 = 28;
}
eNB_UE_stats->dlsch_mcs1 = cqi_to_mcs[UE_list->UE_sched_ctrl[UE_id].dl_cqi[CC_id]];
// provide the list of CCs sorted according to MCS
for (i = 0; i < pre_scd_numactiveCCs[UE_id]; i++) {
eNB_UE_stats_i =
&pre_scd_eNB_UE_stats[pre_scd_ordered_CCids[i][UE_id]][UE_id];
for (j = i + 1; j < pre_scd_numactiveCCs[UE_id]; j++) {
DevAssert(j < MAX_NUM_CCs);
eNB_UE_stats_j =
&pre_scd_eNB_UE_stats[pre_scd_ordered_CCids[j][UE_id]][UE_id];
if (eNB_UE_stats_j->dlsch_mcs1
> eNB_UE_stats_i->dlsch_mcs1) {
tmp = pre_scd_ordered_CCids[i][UE_id];
pre_scd_ordered_CCids[i][UE_id] =
pre_scd_ordered_CCids[j][UE_id];
pre_scd_ordered_CCids[j][UE_id] = tmp;
}
}
}
if (UE_template.dl_buffer_total > 0) {
LOG_D(MAC, "[preprocessor] assign RB for UE %d\n", UE_id);
for (i = 0; i < pre_scd_numactiveCCs[UE_id]; i++) {
CC_id = pre_scd_ordered_CCids[i][UE_id];
eNB_UE_stats = &pre_scd_eNB_UE_stats[CC_id][UE_id];
if (eNB_UE_stats->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 = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,
nb_rbs_required[CC_id][UE_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_template.dl_buffer_total,
nb_rbs_required[CC_id][UE_id],
eNB_UE_stats->dlsch_mcs1, TBS);
N_RB_DL =
to_prb(
RC.mac[module_idP]->common_channels[CC_id].mib->message.dl_Bandwidth);
/* calculating required number of RBs for each UE */
while (TBS
< UE_template.dl_buffer_total) {
nb_rbs_required[CC_id][UE_id] +=
min_rb_unit[CC_id];
if (nb_rbs_required[CC_id][UE_id] > N_RB_DL) {
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1, N_RB_DL);
nb_rbs_required[CC_id][UE_id] = N_RB_DL;
break;
}
TBS = get_TBS_DL(eNB_UE_stats->dlsch_mcs1,
nb_rbs_required[CC_id][UE_id]);
} // end of while
LOG_D(MAC,
"[eNB %d] Frame %d Subframe %d: UE %d on CC %d: RB unit %d, nb_required RB %d (TBS %d, mcs %d)\n",
module_idP, frameP, subframeP, UE_id, CC_id,
min_rb_unit[CC_id],
nb_rbs_required[CC_id][UE_id], TBS,
eNB_UE_stats->dlsch_mcs1);
}
nb_rbs_required[CC_id][UE_id] = search_rbs_required(eNB_UE_stats->dlsch_mcs1, UE_template.dl_buffer_total, N_RB_DL, step_size);
}
}
}
-4
View File
@@ -157,10 +157,6 @@ uint8_t dlsch_ue_select_tbl_in_use;
uint8_t new_dlsch_ue_select_tbl_in_use;
boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX];
eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
/// sorted downlink component carrier for the scheduler
int pre_scd_ordered_CCids[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
/// number of downlink active component carrier
int pre_scd_numactiveCCs[NUMBER_OF_UE_MAX];
#endif
#endif