Commit f1230a28 authored by wangdong's avatar wangdong

10.22 debug commited

parent 8777b70f
...@@ -1033,7 +1033,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -1033,7 +1033,8 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
__FILE__, __FILE__,
__LINE__); __LINE__);
} }
/* This schedules UCI_SR in subframeP */ /* This schedules UCI_SR in subframeP */
schedule_SR(module_idP, frameP, subframeP); schedule_SR(module_idP, frameP, subframeP);
/* This schedules UCI_CSI in subframeP */ /* This schedules UCI_CSI in subframeP */
......
...@@ -509,7 +509,7 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in ...@@ -509,7 +509,7 @@ schedule_dlsch(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP, in
continue; continue;
break; break;
} }
} }
if (mbsfn_flag[CC_id] != 0) if (mbsfn_flag[CC_id] != 0)
continue; continue;
...@@ -570,6 +570,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -570,6 +570,7 @@ schedule_ue_spec(module_id_t module_idP,
// CALLING Pre_Processor for downlink scheduling // CALLING Pre_Processor for downlink scheduling
// (Returns estimation of RBs required by each UE and the allocation on sub-band) // (Returns estimation of RBs required by each UE and the allocation on sub-band)
// per SubFrame
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR, VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PREPROCESSOR,
VCD_FUNCTION_IN); VCD_FUNCTION_IN);
start_meas(&eNB->schedule_dlsch_preprocessor); start_meas(&eNB->schedule_dlsch_preprocessor);
...@@ -579,7 +580,7 @@ schedule_ue_spec(module_id_t module_idP, ...@@ -579,7 +580,7 @@ schedule_ue_spec(module_id_t module_idP,
VCD_FUNCTION_OUT); VCD_FUNCTION_OUT);
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
LOG_D(MAC, "doing schedule_ue_spec for CC_id %d UE %d\n", LOG_D(MAC, "[%d.%d]doing schedule_ue_spec for CC_id %d UE %d\n",frameP, subframeP,
CC_id, CC_id,
UE_id); UE_id);
UE_sched_ctrl_t *ue_sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; UE_sched_ctrl_t *ue_sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
......
...@@ -107,7 +107,7 @@ int rr_dl_run(module_id_t Mod_id, ...@@ -107,7 +107,7 @@ int rr_dl_run(module_id_t Mod_id,
int rbg = 0; int rbg = 0;
for (; !rbgalloc_mask[rbg]; rbg++) for (; !rbgalloc_mask[rbg]; rbg++)
; /* fast-forward to first allowed RBG */ ; /* fast-forward to first allowed RBG */
/* just start with the UE after the one we had last time. If it does not /* just start with the UE after the one we had last time. If it does not
* exist, this will start at the head */ * exist, this will start at the head */
int *start_ue = data; int *start_ue = data;
...@@ -194,6 +194,8 @@ skip_ue: ...@@ -194,6 +194,8 @@ skip_ue:
max_num_ue = min(max_num_ue, n_rbg_sched); max_num_ue = min(max_num_ue, n_rbg_sched);
int rb_required[MAX_MOBILES_PER_ENB]; // how much UEs request int rb_required[MAX_MOBILES_PER_ENB]; // how much UEs request
cur_UE = &UE_sched.head; cur_UE = &UE_sched.head;
LOG_I(MAC, "%d.%d debug: before compute [UE], \n",frame,subframe);
while (*cur_UE >= 0 && max_num_ue > 0) { while (*cur_UE >= 0 && max_num_ue > 0) {
const int UE_id = *cur_UE; const int UE_id = *cur_UE;
cur_UE = &UE_sched.next[UE_id]; // go to next cur_UE = &UE_sched.next[UE_id]; // go to next
...@@ -212,15 +214,18 @@ skip_ue: ...@@ -212,15 +214,18 @@ skip_ue:
rb_required[UE_id] = find_nb_rb_DL(mcs, B, n_rbg_sched * RBGsize, RBGsize); rb_required[UE_id] = find_nb_rb_DL(mcs, B, n_rbg_sched * RBGsize, RBGsize);
subframe_t.rnti[UE_id] = rnti; subframe_t.rnti[UE_id] = rnti;
subframe_t.ammount[UE_id] = rb_required[UE_id]; subframe_t.ammount[UE_id] = rb_required[UE_id];
LOG_I(MAC, "debug: compute for UE %d, \n", subframe_t.ammount[UE_id]);
max_num_ue--; max_num_ue--;
} }
*cur_UE = -1; // not all UEs might be allocated, mark end *cur_UE = -1; // not all UEs might be allocated, mark end
/* for one UE after the next: allocate resources */ /* for one UE after the next: allocate resources */
LOG_I(MAC, "%d.%d debug: before allocated [UE], \n",frame,subframe);
cur_UE = &UE_sched.head; cur_UE = &UE_sched.head;
while (*cur_UE >= 0) { while (*cur_UE >= 0) {
printf("debug: 222@openair2/LAYER2/MAC/pre_processor.c \n",*cur_UE);
const int UE_id = *cur_UE; const int UE_id = *cur_UE;
LOG_I(MAC, "%d.%d debug: allocate for [UE %d], \n",frame,subframe ,UE_id);
UE_sched_ctrl_t *ue_ctrl = &UE_info->UE_sched_ctrl[UE_id]; UE_sched_ctrl_t *ue_ctrl = &UE_info->UE_sched_ctrl[UE_id];
ue_ctrl->rballoc_sub_UE[CC_id][rbg] = 1;//该次轮询给 *** ue_ctrl->rballoc_sub_UE[CC_id][rbg] = 1;//该次轮询给 ***
rbgalloc_mask[rbg] = 0;//该RBG已分配 rbgalloc_mask[rbg] = 0;//该RBG已分配
...@@ -239,6 +244,7 @@ skip_ue: ...@@ -239,6 +244,7 @@ skip_ue:
break;//如果该次调度所有的rbg均被分配,则跳出资源分配 break;//如果该次调度所有的rbg均被分配,则跳出资源分配
for (rbg++; !rbgalloc_mask[rbg]; rbg++) /* fast-forward */ ; for (rbg++; !rbgalloc_mask[rbg]; rbg++) /* fast-forward */ ;
} }
LOG_I(MAC, "debug: end \n");
return n_rbg_sched; return n_rbg_sched;
//* 分配的结果:将结果都存储到了 ue_ctrl->rballoc_sub_UE[CC_id][rbg] 之中!!!,最后所有rbg都分配 //* 分配的结果:将结果都存储到了 ue_ctrl->rballoc_sub_UE[CC_id][rbg] 之中!!!,最后所有rbg都分配
...@@ -666,7 +672,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -666,7 +672,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i) for (int i = 0; i < MAX_MOBILES_PER_ENB; ++i)
UE_to_sched.next[i] = -1; UE_to_sched.next[i] = -1;
int *cur = &UE_to_sched.head; int *cur = &UE_to_sched.head;
//init UE_to_sched
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) { for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
UE_sched_ctrl_t *ue_sched_ctrl = &UE_info->UE_sched_ctrl[UE_id]; UE_sched_ctrl_t *ue_sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
const UE_TEMPLATE *ue_template = &UE_info->UE_template[CC_id][UE_id]; const UE_TEMPLATE *ue_template = &UE_info->UE_template[CC_id][UE_id];
...@@ -704,7 +710,6 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -704,7 +710,6 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
} }
*cur = -1; *cur = -1;
//debug : 查看无数据传送时调度如何取消? //debug : 查看无数据传送时调度如何取消?
printf("debug : 707@/root/oai/openairinterface5g/openair2/LAYER2/MAC/pre_processor.c");
if (UE_to_sched.head < 0) if (UE_to_sched.head < 0)
return; return;
...@@ -719,8 +724,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -719,8 +724,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
rbgalloc_mask[i] &= !vrb_map[RBGsize * i + j]; rbgalloc_mask[i] &= !vrb_map[RBGsize * i + j];
n_rbg_sched += rbgalloc_mask[i]; n_rbg_sched += rbgalloc_mask[i];
} }
printf("debug : 721@/root/oai/openairinterface5g/openair2/LAYER2/MAC/pre_processor.c"); //perSubframe if any UE connected
mac->pre_processor_dl.dl_algo.run(Mod_id, mac->pre_processor_dl.dl_algo.run(Mod_id,
CC_id, CC_id,
frameP, frameP,
...@@ -731,6 +735,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -731,6 +735,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
rbgalloc_mask, rbgalloc_mask,
mac->pre_processor_dl.dl_algo.data); mac->pre_processor_dl.dl_algo.data);
// the following block is meant for validation of the pre-processor to check // the following block is meant for validation of the pre-processor to check
// whether all UE allocations are non-overlapping and is not necessary for // whether all UE allocations are non-overlapping and is not necessary for
// scheduling functionality // scheduling functionality
...@@ -749,7 +754,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -749,7 +754,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
continue; continue;
LOG_I(MAC, LOG_I(MAC,
"%4d.%d UE%d %d RBs allocated, pre MCS %d\n", "debug %4d.%d UE%d %d RBs allocated, pre MCS %d\n",
frameP, frameP,
subframeP, subframeP,
UE_id, UE_id,
...@@ -763,8 +768,8 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -763,8 +768,8 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
continue; continue;
for (int j = 0; j < RBGsize; j++) { for (int j = 0; j < RBGsize; j++) {
if (vrb_map[RBGsize*i+j] != 0) { if (vrb_map[RBGsize*i+j] != 0) {
LOG_I(MAC, "%4d.%d DL scheduler allocation list: %s\n", frameP, subframeP, t); LOG_I(MAC, " %4d.%d DL scheduler allocation list: %s\n", frameP, subframeP, t);
LOG_E(MAC, "%4d.%d: UE %d allocated at locked RB %d/RBG %d\n", frameP, LOG_E(MAC, " %4d.%d: UE %d allocated at locked RB %d/RBG %d\n", frameP,
subframeP, UE_id, RBGsize * i + j, i); subframeP, UE_id, RBGsize * i + j, i);
} }
vrb_map[RBGsize*i+j] = 1; vrb_map[RBGsize*i+j] = 1;
...@@ -773,7 +778,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -773,7 +778,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
} }
} }
if (print) if (print)
LOG_I(MAC, "%4d.%d DL scheduler allocation list: %s\n", frameP, subframeP, t); LOG_I(MAC, " %4d.%d DL scheduler allocation list: %s\n", frameP, subframeP, t);
//#endif //#endif
} }
......
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