Skip to content
Snippets Groups Projects
Commit a943222b authored by Robert Schmidt's avatar Robert Schmidt Committed by Kumar, Sunil Dr (Comp Sci & Elec Eng)
Browse files

Fix NVS slicing algo: write more compactly, todo retransmission first

parent ecbae3c6
No related branches found
No related tags found
No related merge requests found
...@@ -813,18 +813,18 @@ void nvs_dl(module_id_t mod_id, ...@@ -813,18 +813,18 @@ void nvs_dl(module_id_t mod_id,
memset(ue_sched_ctrl->rballoc_sub_UE[CC_id], 0, sizeof(ue_sched_ctrl->rballoc_sub_UE[CC_id])); memset(ue_sched_ctrl->rballoc_sub_UE[CC_id], 0, sizeof(ue_sched_ctrl->rballoc_sub_UE[CC_id]));
ue_sched_ctrl->pre_dci_dl_pdu_idx = -1; ue_sched_ctrl->pre_dci_dl_pdu_idx = -1;
const int idx = si->UE_assoc_slice[UE_id];
DevAssert(idx >= 0);
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];
const uint8_t round = UE_info->UE_sched_ctrl[UE_id].round[CC_id][harq_pid]; const uint8_t round = UE_info->UE_sched_ctrl[UE_id].round[CC_id][harq_pid];
/* if UE has data or retransmission, mark respective slice as active */ /* if UE has data or retransmission, mark respective slice as active */
if (UE_template->dl_buffer_total > 0 || round != 8) { const bool active = UE_template->dl_buffer_total > 0 || round != 8;
const int idx = si->UE_assoc_slice[UE_id]; ((_nvs_int_t *)si->s[idx]->int_data)->active |= active;
if (idx >= 0)
((_nvs_int_t *)si->s[idx]->int_data)->active = 1;
}
} }
const int N_RBG = to_rbg(RC.mac[mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth); const int N_RBG = to_rbg(RC.mac[mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
const int RBGsize = get_min_rb_unit(mod_id, CC_id); const int RBGsize = get_min_rb_unit(mod_id, CC_id);
const int N_RB_DL = to_prb(RC.mac[mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth);
uint8_t *vrb_map = RC.mac[mod_id]->common_channels[CC_id].vrb_map; uint8_t *vrb_map = RC.mac[mod_id]->common_channels[CC_id].vrb_map;
uint8_t rbgalloc_mask[N_RBG_MAX]; uint8_t rbgalloc_mask[N_RBG_MAX];
int n_rbg_sched = 0; int n_rbg_sched = 0;
...@@ -832,12 +832,13 @@ void nvs_dl(module_id_t mod_id, ...@@ -832,12 +832,13 @@ void nvs_dl(module_id_t mod_id,
// calculate mask: init to one + "AND" with vrb_map: // calculate mask: init to one + "AND" with vrb_map:
// if any RB in vrb_map is blocked (1), the current RBG will be 0 // if any RB in vrb_map is blocked (1), the current RBG will be 0
rbgalloc_mask[i] = 1; rbgalloc_mask[i] = 1;
for (int j = 0; j < RBGsize; j++) for (int j = 0; j < RBGsize && RBGsize * i + j < N_RB_DL; j++)
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];
} }
const int N_RB_DL = to_prb(RC.mac[mod_id]->common_channels[CC_id].mib->message.dl_Bandwidth); /* todo: schedule retransmission first */
float maxw = 0.0f; float maxw = 0.0f;
int maxidx = -1; int maxidx = -1;
for (int i = 0; i < si->num; ++i) { for (int i = 0; i < si->num; ++i) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment