Commit 612c80bd authored by Robert Schmidt's avatar Robert Schmidt

Avoid copy from UL_tti_req_ahead into Ul_tti_req

parent 2e3b37b4
...@@ -96,7 +96,6 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, ...@@ -96,7 +96,6 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
const int num_slots = slots_per_frame[*scc->ssbSubcarrierSpacing]; const int num_slots = slots_per_frame[*scc->ssbSubcarrierSpacing];
nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0]; nfapi_nr_dl_tti_request_t *DL_req = &gNB->DL_req[0];
nfapi_nr_ul_tti_request_t *UL_tti_req = &gNB->UL_tti_req[0];
nfapi_nr_ul_tti_request_t *future_ul_tti_req = nfapi_nr_ul_tti_request_t *future_ul_tti_req =
&gNB->UL_tti_req_ahead[CC_idP][(slotP + num_slots - 1) % num_slots]; &gNB->UL_tti_req_ahead[CC_idP][(slotP + num_slots - 1) % num_slots];
nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0]; nfapi_nr_ul_dci_request_t *UL_dci_req = &gNB->UL_dci_req[0];
...@@ -116,13 +115,6 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, ...@@ -116,13 +115,6 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
UL_dci_req[CC_idP].Slot = slotP; UL_dci_req[CC_idP].Slot = slotP;
UL_dci_req[CC_idP].numPdus = 0; UL_dci_req[CC_idP].numPdus = 0;
UL_tti_req[CC_idP].SFN = frameP;
UL_tti_req[CC_idP].Slot = slotP;
UL_tti_req[CC_idP].n_pdus = 0;
UL_tti_req[CC_idP].n_ulsch = 0;
UL_tti_req[CC_idP].n_ulcch = 0;
UL_tti_req[CC_idP].n_group = 0;
/* advance last round's future UL_tti_req to be ahead of current frame/slot */ /* advance last round's future UL_tti_req to be ahead of current frame/slot */
future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024; future_ul_tti_req->SFN = (slotP == 0 ? frameP : frameP + 1) % 1024;
/* future_ul_tti_req->Slot is fixed! */ /* future_ul_tti_req->Slot is fixed! */
...@@ -131,6 +123,10 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB, ...@@ -131,6 +123,10 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
future_ul_tti_req->n_ulcch = 0; future_ul_tti_req->n_ulcch = 0;
future_ul_tti_req->n_group = 0; future_ul_tti_req->n_group = 0;
/* UL_tti_req is a simple pointer into the current UL_tti_req_ahead, i.e.,
* it walks over UL_tti_req_ahead in a circular fashion */
gNB->UL_tti_req = &gNB->UL_tti_req_ahead[CC_idP][slotP];
TX_req[CC_idP].Number_of_PDUs = 0; TX_req[CC_idP].Number_of_PDUs = 0;
} }
...@@ -297,37 +293,6 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram ...@@ -297,37 +293,6 @@ void schedule_nr_SRS(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
*/ */
void nr_schedule_pusch(int mod_id, frame_t frame, sub_frame_t slot) {
nfapi_nr_ul_tti_request_t *ul_tti_req = &RC.nrmac[mod_id]->UL_tti_req[0];
nfapi_nr_ul_tti_request_t *future_ul_tti_req =
&RC.nrmac[mod_id]->UL_tti_req_ahead[0][slot];
if (future_ul_tti_req->Slot == slot
&& future_ul_tti_req->SFN == frame
&& future_ul_tti_req->n_pdus > 0) {
LOG_D(MAC, "%4d.%2d copy %d PDUs from future_ul_tti_req\n", frame, slot, future_ul_tti_req->n_pdus);
/* the future_UL_tti_req_has data for the current frame/slot pair, copy
* everything into the "real" UL_tti_req */
ul_tti_req->SFN = future_ul_tti_req->SFN;
ul_tti_req->Slot = future_ul_tti_req->Slot;
ul_tti_req->n_pdus = future_ul_tti_req->n_pdus;
ul_tti_req->rach_present = future_ul_tti_req->rach_present;
ul_tti_req->n_ulsch = future_ul_tti_req->n_ulsch;
ul_tti_req->n_ulcch = future_ul_tti_req->n_ulcch;
ul_tti_req->n_group = future_ul_tti_req->n_group;
memcpy(ul_tti_req->pdus_list,
future_ul_tti_req->pdus_list,
ul_tti_req->n_pdus * sizeof(nfapi_nr_ul_tti_request_number_of_pdus_t));
memcpy(ul_tti_req->groups_list,
future_ul_tti_req->groups_list,
ul_tti_req->n_group * sizeof(nfapi_nr_ul_tti_request_number_of_groups_t));
future_ul_tti_req->n_pdus = 0;
future_ul_tti_req->n_ulsch = 0;
future_ul_tti_req->n_ulcch = 0;
future_ul_tti_req->n_group = 0;
}
}
bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) { bool is_xlsch_in_slot(uint64_t bitmap, sub_frame_t slot) {
return (bitmap >> slot) & 0x01; return (bitmap >> slot) & 0x01;
} }
...@@ -469,8 +434,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, ...@@ -469,8 +434,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
if (UE_info->active[UE_id]) if (UE_info->active[UE_id])
nr_schedule_pucch(module_idP, UE_id, nr_ulmix_slots, frame, slot); nr_schedule_pucch(module_idP, UE_id, nr_ulmix_slots, frame, slot);
nr_schedule_pusch(module_idP, frame, slot);
stop_meas(&RC.nrmac[module_idP]->eNB_scheduler); stop_meas(&RC.nrmac[module_idP]->eNB_scheduler);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_OUT);
......
...@@ -200,7 +200,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP ...@@ -200,7 +200,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
gNB_MAC_INST *gNB = RC.nrmac[module_idP]; gNB_MAC_INST *gNB = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = gNB->common_channels; NR_COMMON_channels_t *cc = gNB->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon; NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
nfapi_nr_ul_tti_request_t *UL_tti_req = &RC.nrmac[module_idP]->UL_tti_req[0]; nfapi_nr_ul_tti_request_t *UL_tti_req = RC.nrmac[module_idP]->UL_tti_req;
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[module_idP]->config[0]; nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[module_idP]->config[0];
if (is_nr_UL_slot(scc,slotP)) { if (is_nr_UL_slot(scc,slotP)) {
...@@ -247,8 +247,12 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP ...@@ -247,8 +247,12 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
} }
UL_tti_req->SFN = frameP; AssertFatal(UL_tti_req->SFN == frameP && UL_tti_req->Slot == slotP,
UL_tti_req->Slot = slotP; "%d.%d UL_tti_req frame.slot %d.%d does not match PRACH %d.%d\n",
frameP, slotP,
UL_tti_req->SFN,
UL_tti_req->Slot,
frameP, slotP);
for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion
for (int td_index=0; td_index<N_t_slot; td_index++) { for (int td_index=0; td_index<N_t_slot; td_index++) {
......
...@@ -193,8 +193,6 @@ void config_uldci(NR_BWP_Uplink_t *ubwp, ...@@ -193,8 +193,6 @@ void config_uldci(NR_BWP_Uplink_t *ubwp,
int time_domain_assignment, uint8_t tpc, int time_domain_assignment, uint8_t tpc,
int n_ubwp, int bwp_id); int n_ubwp, int bwp_id);
void nr_schedule_pusch(int Mod_idP, frame_t frameP, sub_frame_t slotP);
void nr_schedule_pucch(int Mod_idP, void nr_schedule_pucch(int Mod_idP,
int UE_id, int UE_id,
int nr_ulmix_slots, int nr_ulmix_slots,
......
...@@ -484,8 +484,9 @@ typedef struct gNB_MAC_INST_s { ...@@ -484,8 +484,9 @@ typedef struct gNB_MAC_INST_s {
nfapi_nr_config_request_scf_t config[NFAPI_CC_MAX]; nfapi_nr_config_request_scf_t config[NFAPI_CC_MAX];
/// NFAPI DL Config Request Structure /// NFAPI DL Config Request Structure
nfapi_nr_dl_tti_request_t DL_req[NFAPI_CC_MAX]; nfapi_nr_dl_tti_request_t DL_req[NFAPI_CC_MAX];
/// NFAPI UL TTI Request Structure (this is from the new SCF specs) /// NFAPI UL TTI Request Structure, simple pointer into structure
nfapi_nr_ul_tti_request_t UL_tti_req[NFAPI_CC_MAX]; /// UL_tti_req_ahead for current frame/slot
nfapi_nr_ul_tti_request_t *UL_tti_req;
/// NFAPI UL TTI Request Structure for future TTIs, dynamically allocated /// NFAPI UL TTI Request Structure for future TTIs, dynamically allocated
/// because length depends on number of slots /// because length depends on number of slots
nfapi_nr_ul_tti_request_t *UL_tti_req_ahead[NFAPI_CC_MAX]; nfapi_nr_ul_tti_request_t *UL_tti_req_ahead[NFAPI_CC_MAX];
......
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