diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c index 35d1df6a60..99da3494a8 100644 --- a/openair1/SIMULATION/NR_PHY/dlsim.c +++ b/openair1/SIMULATION/NR_PHY/dlsim.c @@ -590,7 +590,7 @@ int main(int argc, char **argv) gNB->pbch_configured = 1; for (int i=0;i<4;i++) gNB->pbch_pdu[i]=i+1; - nr_schedule_uss_dlsch_phytest(0,frame,slot); + nr_schedule_uss_dlsch_phytest(0,frame,slot,&dlsch_config); Sched_INFO.module_id = 0; Sched_INFO.CC_id = 0; Sched_INFO.frame = frame; diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c index 0af0d54be3..ebd6f99555 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler.c @@ -300,7 +300,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, rnti_t rnti; NR_COMMON_channels_t *cc = RC.nrmac[module_idP]->common_channels; - nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config = NULL; + //nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config = NULL; start_meas(&RC.nrmac[module_idP]->eNB_scheduler); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN); @@ -333,7 +333,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frameP, slotP, *cfg)){ - nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP); + nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP, NULL); } rnti = UE_RNTI(module_idP, i); @@ -442,7 +442,7 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, nr_schedule_css_dlsch_phytest(module_idP, frameP, slotP);*/ if (slotP==1){ - nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP); + nr_schedule_uss_dlsch_phytest(module_idP, frameP, slotP, NULL); } /* diff --git a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c index 9d04885feb..41de40488f 100644 --- a/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c +++ b/openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_phytest.c @@ -178,7 +178,8 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req, nfapi_nr_config_request_t *cfg, nfapi_nr_coreset_t* coreset, nfapi_nr_search_space_t* search_space, - int16_t pdu_index){ + int16_t pdu_index, + nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config){ nfapi_nr_dl_config_request_pdu_t *dl_config_dci_pdu; nfapi_nr_dl_config_request_pdu_t *dl_config_dlsch_pdu; @@ -212,6 +213,14 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req, dlsch_pdu_rel15->ndi = 1; dlsch_pdu_rel15->redundancy_version = 0; + if (dlsch_config != NULL) { + dlsch_pdu_rel15->start_prb = dlsch_config->start_prb; + dlsch_pdu_rel15->n_prb = dlsch_config->n_prb; + dlsch_pdu_rel15->start_symbol = dlsch_config->start_symbol; + dlsch_pdu_rel15->nb_symbols = dlsch_config->nb_symbols; + dlsch_pdu_rel15->mcs_idx = dlsch_config->mcs_idx; + } + nr_configure_dci_from_pdcch_config(params_rel15, coreset, search_space, @@ -221,7 +230,7 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req, pdu_rel15->frequency_domain_assignment = get_RIV(dlsch_pdu_rel15->start_prb, dlsch_pdu_rel15->n_prb, cfg->rf_config.dl_carrier_bandwidth.value); pdu_rel15->time_domain_assignment = 3; // row index used here instead of SLIV; pdu_rel15->vrb_to_prb_mapping = 1; - pdu_rel15->mcs = 9; + pdu_rel15->mcs = dlsch_pdu_rel15->mcs_idx; pdu_rel15->tb_scaling = 1; pdu_rel15->ra_preamble_index = 25; @@ -293,7 +302,8 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req, void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, frame_t frameP, - sub_frame_t slotP) + sub_frame_t slotP, + nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config) { LOG_D(MAC, "In nr_schedule_uss_dlsch_phytest \n"); uint8_t CC_id; @@ -458,7 +468,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0][offset + sdu_length_total + j] = 0; } - TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id]); + TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id], dlsch_config); #if defined(ENABLE_MAC_PAYLOAD_DEBUG) LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, , TBS size: %d \n \n", frameP, slotP, TBS_bytes); @@ -482,7 +492,7 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, //When the --NOS1 option is not enabled, DLSCH transmissions with random data //occur every time that the current function is called (dlsch phytest mode) else{ - TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id]); + TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id], dlsch_config); // HOT FIX for all zero pdu problem // ------------------------------------------------------------------------------------------------ diff --git a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h index 01cee3901e..7d85951864 100644 --- a/openair2/LAYER2/NR_MAC_gNB/mac_proto.h +++ b/openair2/LAYER2/NR_MAC_gNB/mac_proto.h @@ -79,11 +79,13 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req, nfapi_nr_config_request_t *cfg, nfapi_nr_coreset_t* coreset, nfapi_nr_search_space_t* search_space, - int16_t pdu_index); + int16_t pdu_index, + nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config); void nr_schedule_uss_dlsch_phytest(module_id_t module_idP, frame_t frameP, - sub_frame_t slotP); + sub_frame_t slotP, + nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config); void nr_configure_css_dci_initial(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params, nr_scs_e scs_common,