Commit ed311464 authored by ChiehChun's avatar ChiehChun

Add sched_ul_bytes/static TBS & Update in rx_sdu/schedule_ulsch

parent ba13df74
...@@ -421,10 +421,21 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -421,10 +421,21 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if (sduP != NULL){ if (sduP != NULL){
LOG_D(MAC, "Received PDU at MAC gNB \n"); LOG_D(MAC, "Received PDU at MAC gNB \n");
UE_scheduling_control->sched_ul_bytes -= UE_info->mac_stats[UE_id].ulsch_current_bytes;
if (UE_scheduling_control->sched_ul_bytes < 0)
UE_scheduling_control->sched_ul_bytes = 0;
nr_process_mac_pdu(gnb_mod_idP, current_rnti, CC_idP, frameP, sduP, sdu_lenP); nr_process_mac_pdu(gnb_mod_idP, current_rnti, CC_idP, frameP, sduP, sdu_lenP);
} }
else { else {
NR_UE_ul_harq_t *cur_harq = &UE_scheduling_control->ul_harq_processes[harq_pid];
/* reduce sched_ul_bytes when cur_harq->round == 3 */
if (cur_harq->round == 3){
UE_scheduling_control->sched_ul_bytes -= UE_info->mac_stats[UE_id].ulsch_current_bytes;
if (UE_scheduling_control->sched_ul_bytes < 0)
UE_scheduling_control->sched_ul_bytes = 0;
}
} }
} else { } else {
if (!sduP) // check that CRC passed if (!sduP) // check that CRC passed
...@@ -766,6 +777,9 @@ void nr_schedule_ulsch(module_id_t module_id, ...@@ -766,6 +777,9 @@ void nr_schedule_ulsch(module_id_t module_id,
pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size; pusch_pdu->pusch_data.tb_size = sched_pusch->tb_size;
pusch_pdu->pusch_data.num_cb = 0; //CBG not supported pusch_pdu->pusch_data.num_cb = 0; //CBG not supported
UE_info->mac_stats[UE_id].ulsch_current_bytes = sched_pusch->tb_size;
sched_ctrl->sched_ul_bytes += sched_pusch->tb_size;
/* PUSCH PTRS */ /* PUSCH PTRS */
if (ps->NR_DMRS_UplinkConfig->phaseTrackingRS != NULL) { if (ps->NR_DMRS_UplinkConfig->phaseTrackingRS != NULL) {
// TODO to be fixed from RRC config // TODO to be fixed from RRC config
......
...@@ -404,6 +404,8 @@ typedef struct { ...@@ -404,6 +404,8 @@ typedef struct {
uint16_t rbSize; uint16_t rbSize;
uint16_t rbStart; uint16_t rbStart;
/// uplink bytes that are currently scheduled
int sched_ul_bytes;
/// estimation of the UL buffer size /// estimation of the UL buffer size
int estimated_ul_buffer; int estimated_ul_buffer;
...@@ -446,6 +448,7 @@ typedef struct { ...@@ -446,6 +448,7 @@ typedef struct {
int ulsch_errors; int ulsch_errors;
int ulsch_total_bytes_scheduled; int ulsch_total_bytes_scheduled;
int ulsch_total_bytes_rx; int ulsch_total_bytes_rx;
int ulsch_current_bytes;
} NR_mac_stats_t; } NR_mac_stats_t;
......
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