Commit d34bef81 authored by Francesco Mani's avatar Francesco Mani

first commit to schedule reception of csi measrep

parent 6a801ab5
...@@ -470,8 +470,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -470,8 +470,9 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
// This schedule SR // This schedule SR
// TODO // TODO
// This schedule CSI // This schedule CSI measurement reporting
// TODO if(UE_list->fiveG_connected[UE_id] == true)
nr_csi_meas_reporting(module_idP, UE_id, frame, slot, slots_per_frame[*scc->ssbSubcarrierSpacing]);
// This schedule RA procedure if not in phy_test mode // This schedule RA procedure if not in phy_test mode
// Otherwise already consider 5G already connected // Otherwise already consider 5G already connected
...@@ -508,7 +509,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -508,7 +509,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (UE_list->fiveG_connected[UE_id] && (is_xlsch_in_slot(*dlsch_in_slot_bitmap,slot%num_slots_per_tdd))) { if (UE_list->fiveG_connected[UE_id] && (is_xlsch_in_slot(*dlsch_in_slot_bitmap,slot%num_slots_per_tdd))) {
ue_sched_ctl->current_harq_pid = slot % num_slots_per_tdd; ue_sched_ctl->current_harq_pid = slot % num_slots_per_tdd;
nr_update_pucch_scheduling(module_idP, UE_id, frame, slot, num_slots_per_tdd,&pucch_sched); nr_acknack_scheduling(module_idP, UE_id, frame, slot, num_slots_per_tdd,&pucch_sched);
nr_schedule_uss_dlsch_phytest(module_idP, frame, slot, &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched], NULL); nr_schedule_uss_dlsch_phytest(module_idP, frame, slot, &UE_list->UE_sched_ctrl[UE_id].sched_pucch[pucch_sched], NULL);
// resetting ta flag // resetting ta flag
gNB->ta_len = 0; gNB->ta_len = 0;
......
...@@ -1554,8 +1554,81 @@ void get_pdsch_to_harq_feedback(int Mod_idP, ...@@ -1554,8 +1554,81 @@ void get_pdsch_to_harq_feedback(int Mod_idP,
} }
} }
void nr_csi_meas_reporting(int Mod_idP,
int UE_id,
frame_t frame,
sub_frame_t slot,
int n_slots_frame) {
NR_UE_list_t *UE_list = &RC.nrmac[Mod_idP]->UE_list;
NR_sched_pucch *curr_pucch;
NR_CellGroupConfig_t *secondaryCellGroup = UE_list->secondaryCellGroup[UE_id];
NR_CSI_MeasConfig_t *csi_measconfig = secondaryCellGroup->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
AssertFatal(csi_measconfig->csi_ReportConfigToAddModList->list.count>0,"NO CSI report configuration available");
// TODO for now we assume only one csi report config available
NR_CSI_ReportConfig_t *csirep = csi_measconfig->csi_ReportConfigToAddModList->list.array[0];
AssertFatal(csirep->reportConfigType.choice.periodic!=NULL,"Only periodic CSI reporting is implemented currently");
int period, offset;
NR_CSI_ReportPeriodicityAndOffset_PR p_and_o = csirep->reportConfigType.choice.periodic->reportSlotConfig.present;
switch(p_and_o){
case NR_CSI_ReportPeriodicityAndOffset_PR_slots4:
period = 4;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots4;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots5:
period = 5;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots5;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots8:
period = 8;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots8;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots10:
period = 10;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots10;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots16:
period = 16;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots16;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots20:
period = 20;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots20;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots40:
period = 40;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots40;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots80:
period = 80;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots80;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots160:
period = 160;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots160;
break;
case NR_CSI_ReportPeriodicityAndOffset_PR_slots320:
period = 320;
offset = csirep->reportConfigType.choice.periodic->reportSlotConfig.choice.slots320;
break;
default:
AssertFatal(1==0,"No periodicity and offset resource found in CSI report");
}
// schedule csi measurement reception according to 5.2.1.4 in 38.214
if ( ((n_slots_frame*frame + slot - offset)%period) == 0) {
}
}
// function to update pucch scheduling parameters in UE list when a USS DL is scheduled // function to update pucch scheduling parameters in UE list when a USS DL is scheduled
void nr_update_pucch_scheduling(int Mod_idP, void nr_acknack_scheduling(int Mod_idP,
int UE_id, int UE_id,
frame_t frameP, frame_t frameP,
sub_frame_t slotP, sub_frame_t slotP,
...@@ -1579,6 +1652,8 @@ void nr_update_pucch_scheduling(int Mod_idP, ...@@ -1579,6 +1652,8 @@ void nr_update_pucch_scheduling(int Mod_idP,
// for each possible ul or mixed slot // for each possible ul or mixed slot
for (k=0; k<nr_ulmix_slots; k++) { for (k=0; k<nr_ulmix_slots; k++) {
curr_pucch = &UE_list->UE_sched_ctrl[UE_id].sched_pucch[k]; curr_pucch = &UE_list->UE_sched_ctrl[UE_id].sched_pucch[k];
//if it is possible to schedule acknack in current pucch (no exclusive csi pucch)
if ((curr_pucch->csi_bits == 0) || (curr_pucch->simultaneous_harqcsi==true)) {
// if there is free room in current pucch structure // if there is free room in current pucch structure
if (curr_pucch->dai_c<MAX_ACK_BITS) { if (curr_pucch->dai_c<MAX_ACK_BITS) {
curr_pucch->frame = frameP; curr_pucch->frame = frameP;
...@@ -1601,6 +1676,7 @@ void nr_update_pucch_scheduling(int Mod_idP, ...@@ -1601,6 +1676,7 @@ void nr_update_pucch_scheduling(int Mod_idP,
} }
} }
} }
}
AssertFatal(1==0,"No Uplink slot available in accordance to allowed timing indicator\n"); AssertFatal(1==0,"No Uplink slot available in accordance to allowed timing indicator\n");
} }
......
...@@ -168,7 +168,13 @@ void nr_schedule_pucch(int Mod_idP, ...@@ -168,7 +168,13 @@ void nr_schedule_pucch(int Mod_idP,
frame_t frameP, frame_t frameP,
sub_frame_t slotP); sub_frame_t slotP);
void nr_update_pucch_scheduling(int Mod_idP, void nr_csi_meas_reporting(int Mod_idP,
int UE_id,
frame_t frameP,
sub_frame_t slotP,
int n_slots_frame);
void nr_acknack_scheduling(int Mod_idP,
int UE_id, int UE_id,
frame_t frameP, frame_t frameP,
sub_frame_t slotP, sub_frame_t slotP,
......
...@@ -248,6 +248,9 @@ typedef struct UE_info { ...@@ -248,6 +248,9 @@ typedef struct UE_info {
typedef struct NR_sched_pucch { typedef struct NR_sched_pucch {
int frame; int frame;
int ul_slot; int ul_slot;
bool sr_flag;
int csi_bits;
bool simultaneous_harqcsi;
uint8_t dai_c; uint8_t dai_c;
uint8_t timing_indicator; uint8_t timing_indicator;
uint8_t resource_indicator; uint8_t resource_indicator;
......
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