Commit da09d63a authored by Robert Schmidt's avatar Robert Schmidt

Default pre-processor: efficiently build UE list

parent 6fcc4f59
...@@ -647,12 +647,10 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -647,12 +647,10 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
store_dlsch_buffer(Mod_id, CC_id, frameP, subframeP); store_dlsch_buffer(Mod_id, CC_id, frameP, subframeP);
UE_list_t UE_to_sched; UE_list_t UE_to_sched;
UE_to_sched.head = -1;
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 first = 1;
int last_UE_id = -1;
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];
...@@ -685,15 +683,10 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -685,15 +683,10 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
} }
/* define UEs to schedule */ /* define UEs to schedule */
if (first) { *cur = UE_id;
first = 0; cur = &UE_to_sched.next[UE_id];
UE_to_sched.head = UE_id;
} else {
UE_to_sched.next[last_UE_id] = UE_id;
}
UE_to_sched.next[UE_id] = -1;
last_UE_id = UE_id;
} }
*cur = -1;
if (UE_to_sched.head < 0) if (UE_to_sched.head < 0)
return; return;
...@@ -1097,11 +1090,10 @@ void ulsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -1097,11 +1090,10 @@ void ulsch_scheduler_pre_processor(module_id_t Mod_id,
COMMON_channels_t *cc = &mac->common_channels[CC_id]; COMMON_channels_t *cc = &mac->common_channels[CC_id];
UE_list_t UE_to_sched; UE_list_t UE_to_sched;
UE_to_sched.head = -1;
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 last_UE_id = -1;
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_TEMPLATE *UE_template = &UE_info->UE_template[CC_id][UE_id]; UE_TEMPLATE *UE_template = &UE_info->UE_template[CC_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];
...@@ -1124,13 +1116,10 @@ void ulsch_scheduler_pre_processor(module_id_t Mod_id, ...@@ -1124,13 +1116,10 @@ void ulsch_scheduler_pre_processor(module_id_t Mod_id,
continue; continue;
/* define UEs to schedule */ /* define UEs to schedule */
if (UE_to_sched.head < 0) *cur = UE_id;
UE_to_sched.head = UE_id; cur = &UE_to_sched.next[UE_id];
else
UE_to_sched.next[last_UE_id] = UE_id;
UE_to_sched.next[UE_id] = -1;
last_UE_id = UE_id;
} }
*cur = -1;
if (UE_to_sched.head < 0) if (UE_to_sched.head < 0)
return; return;
......
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