Commit 5b0efd5b authored by Cedric Roux's avatar Cedric Roux Committed by sed
Browse files

NR: fix time keeping in RLC for gNB

RLC has timers. We need to keep track of time. We chose to not use
realtime but 'processing time'. That is we send a tick to RLC for every
subframe when it is processed by the softmodem. Before this commit we
used to increase time in the function mac_rlc_status_ind which is called
for every subframe in the eNB, but not in the gNB (at least not in the
current gNB). So we need another way to keep track of time.

The function gNB_dlsch_ulsch_scheduler is called for every slot. It seems
to be the perfect candidate to send a tick to RLC for every subframe. We
take care of subcarrier spacing to send every subframe (one subframe is
always 1ms), not every slot (slot duration depends on subcarrier spacing).

It may not be the best solution. To be revised if needed.

Note: the UE has not been fixed. Some modification is needed for the UE
too, most probably.
parent 3a7ac982
...@@ -442,6 +442,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -442,6 +442,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
pdcp_run(&ctxt); pdcp_run(&ctxt);
//rrc_rx_tx(&ctxt, CC_id); //rrc_rx_tx(&ctxt, CC_id);
/* send tick to RLC every ms */
if ((slot & ((1 << *scc->ssbSubcarrierSpacing) - 1)) == 0) {
void nr_rlc_tick(int frame, int subframe);
nr_rlc_tick(frame, slot >> *scc->ssbSubcarrierSpacing);
}
dlsch_in_slot_bitmap = &RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[UE_id].dlsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains dlsch dlsch_in_slot_bitmap = &RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[UE_id].dlsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains dlsch
ulsch_in_slot_bitmap = &RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[UE_id].ulsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains ulsch ulsch_in_slot_bitmap = &RC.nrmac[module_idP]->UE_list.UE_sched_ctrl[UE_id].ulsch_in_slot_bitmap; // static bitmap signaling which slot in a tdd period contains ulsch
......
...@@ -158,14 +158,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ...@@ -158,14 +158,6 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
mac_rlc_status_resp_t ret; mac_rlc_status_resp_t ret;
nr_rlc_entity_t *rb; nr_rlc_entity_t *rb;
/* TODO: handle time a bit more properly */
if (nr_rlc_current_time_last_frame != frameP ||
nr_rlc_current_time_last_subframe != subframeP) {
nr_rlc_current_time++;
nr_rlc_current_time_last_frame = frameP;
nr_rlc_current_time_last_subframe = subframeP;
}
nr_rlc_manager_lock(nr_rlc_ue_manager); nr_rlc_manager_lock(nr_rlc_ue_manager);
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP); ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, rntiP);
...@@ -921,3 +913,10 @@ rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x) ...@@ -921,3 +913,10 @@ rlc_op_status_t rrc_rlc_remove_ue (const protocol_ctxt_t* const x)
return RLC_OP_STATUS_OK; return RLC_OP_STATUS_OK;
} }
void nr_rlc_tick(int frame, int subframe)
{
if (frame != nr_rlc_current_time_last_frame ||
subframe != nr_rlc_current_time_last_subframe)
nr_rlc_current_time++;
}
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