-
Notifications
You must be signed in to change notification settings - Fork 48
Enforce N_PRB=2^x3^y5^z in SC-FDMA uplink scheduler #247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -687,7 +687,7 @@ void RCconfig_nr_prs(void) | |
| for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].numelt; l++) | ||
| { | ||
| prs_config->MutingPattern1[l] = PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN1_LIST].uptr[l]; | ||
| if (k == 0) // print only for 0th resource | ||
| if (k == 0) // print only for 0th resource | ||
| snprintf(str[5]+strlen(str[5]),sizeof(str[5])-strlen(str[5]),"%d, ",prs_config->MutingPattern1[l]); | ||
| } | ||
| for (int l = 0; l < PRS_ParamList.paramarray[j][PRS_MUTING_PATTERN2_LIST].numelt; l++) | ||
|
|
@@ -1731,6 +1731,16 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) | |
| else | ||
| ul_bler_options->harq_round_max = *gpd(params, np, MACRLC_UL_HARQ_ROUND_MAX)->u8ptr; | ||
| RC.nrmac[j]->min_grant_prb = *gpd(params, np, MACRLC_MIN_GRANT_PRB)->u16ptr; | ||
| long uses_sc_fdma = 0; | ||
| if (RC.nrmac[j]->common_channels[0].ServingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder != NULL) { | ||
| uses_sc_fdma = *RC.nrmac[j]->common_channels[0].ServingCellConfigCommon->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder; | ||
| } | ||
| int new_min = check_sc_fdma_rbsize(uses_sc_fdma, RC.nrmac[j]->min_grant_prb); | ||
| // NR_PUSCH_Config__transformPrecoder_enabled = 0 | NR_PUSCH_Config__transformPrecoder_disabled = 1, so !uses_sc_fdma should be used | ||
| if (!uses_sc_fdma && RC.nrmac[j]->min_grant_prb != new_min) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i know that you have that comment, but it's really confusing that one suggestion I have is to rename the variable and check
then it's clear and the 0/1 confusion is not visible |
||
| LOG_W(NR_MAC, "min_rb value is set as %d. In SC-FDMA, it should be under format 2^x*3^y*5^z and has been automatically decreased to %d.\n", RC.nrmac[j]->min_grant_prb, new_min); | ||
| RC.nrmac[j]->min_grant_prb = new_min; | ||
| } | ||
| RC.nrmac[j]->identity_pm = *gpd(params, np, MACRLC_IDENTITY_PM)->u8ptr; | ||
| // PRB Blacklist | ||
| uint16_t prbbl[MAX_BWP_SIZE] = {0}; | ||
|
|
@@ -1817,7 +1827,7 @@ void RCconfig_nr_macrlc(configmodule_interface_t *cfg) | |
|
|
||
| if (IS_SA_MODE(get_softmodem_params())) | ||
| nr_mac_configure_sib1(RC.nrmac[0], &info.plmn, info.nr_cellid, *info.tac); | ||
|
|
||
| // read F1 Setup information from config and generated MIB/SIB1 | ||
| // and store it at MAC for sending later | ||
| NR_BCCH_BCH_Message_t *mib = RC.nrmac[0]->common_channels[0].mib; | ||
|
|
@@ -2398,7 +2408,7 @@ gNB_RRC_INST *RCconfig_NRRRC() | |
| } | ||
|
|
||
| if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "local_mac") == 0) { | ||
|
|
||
| } else if (strcmp(*(GNBParamList.paramarray[i][GNB_TRANSPORT_S_PREFERENCE_IDX].strptr), "cudu") == 0) { | ||
| rrc->eth_params_s.my_addr = strdup(*(GNBParamList.paramarray[i][GNB_LOCAL_S_ADDRESS_IDX].strptr)); | ||
| rrc->eth_params_s.remote_addr = strdup(*(GNBParamList.paramarray[i][GNB_REMOTE_S_ADDRESS_IDX].strptr)); | ||
|
|
@@ -2408,10 +2418,10 @@ gNB_RRC_INST *RCconfig_NRRRC() | |
| rrc->eth_params_s.remote_portd = *(GNBParamList.paramarray[i][GNB_REMOTE_S_PORTD_IDX].uptr); | ||
| rrc->eth_params_s.transp_preference = ETH_UDP_MODE; | ||
| } else { // other midhaul | ||
| } | ||
| } | ||
|
|
||
| // search if in active list | ||
|
|
||
| nr_rrc_config_t nrrrc_config = {0}; | ||
| for (k=0; k <num_gnbs ; k++) { | ||
| if (strcmp(GNBSParams[GNB_ACTIVE_GNBS_IDX].strlistptr[k], *(GNBParamList.paramarray[i][GNB_GNB_NAME_IDX].strptr) )== 0) { | ||
|
|
@@ -2758,7 +2768,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up | |
| // generate gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE | ||
| msg_ack_p = itti_alloc_new_message (TASK_GNB_APP, 0, F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE); | ||
| F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).num_cells_failed_to_be_activated = 0; | ||
| F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0; | ||
| F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).have_criticality = 0; | ||
| F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_to_setup =0; | ||
| F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofTNLAssociations_failed = 0; | ||
| F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(msg_ack_p).noofDedicatedSIDeliveryNeededUEs = 0; | ||
|
|
@@ -2781,7 +2791,7 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up | |
| ngran_node_t get_node_type(void) | ||
| { | ||
| GET_PARAMS_LIST(GNBParamList, GNBParams, GNBPARAMS_DESC, GNB_CONFIG_STRING_GNB_LIST, NULL); | ||
| if (GNBParamList.numelt == 0) // We have no valid configuration, let's return a default | ||
| if (GNBParamList.numelt == 0) // We have no valid configuration, let's return a default | ||
| return ngran_gNB; | ||
|
|
||
| // MAC/RLC params | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,9 +14,42 @@ | |
| #include <openair2/UTIL/OPT/opt.h> | ||
| #include "LAYER2/nr_rlc/nr_rlc_oai_api.h" | ||
|
|
||
| static const uint16_t NR_TRANSFORM_PRECODE_RB_LUT[274] = { | ||
|
rorsc marked this conversation as resolved.
|
||
| 0, 1, 2, 3, 4, 5, 6, 6, 8, 9, 10, 10, 12, 12, 12, 15, | ||
| 16, 16, 18, 18, 20, 20, 20, 20, 24, 25, 25, 27, 27, 27, 30, 30, | ||
| 32, 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 40, 45, 45, 45, | ||
| 48, 48, 50, 50, 50, 50, 54, 54, 54, 54, 54, 54, 60, 60, 60, 60, | ||
| 64, 64, 64, 64, 64, 64, 64, 64, 72, 72, 72, 75, 75, 75, 75, 75, | ||
| 80, 81, 81, 81, 81, 81, 81, 81, 81, 81, 90, 90, 90, 90, 90, 90, | ||
| 96, 96, 96, 96, 100, 100, 100, 100, 100, 100, 100, 100, 108, 108, 108, 108, | ||
| 108, 108, 108, 108, 108, 108, 108, 108, 120, 120, 120, 120, 120, 125, 125, 125, | ||
| 128, 128, 128, 128, 128, 128, 128, 135, 135, 135, 135, 135, 135, 135, 135, 135, | ||
| 144, 144, 144, 144, 144, 144, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, | ||
| 160, 160, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, | ||
| 162, 162, 162, 162, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, 180, | ||
| 192, 192, 192, 192, 192, 192, 192, 192, 200, 200, 200, 200, 200, 200, 200, 200, | ||
| 200, 200, 200, 200, 200, 200, 200, 200, 216, 216, 216, 216, 216, 216, 216, 216, | ||
| 216, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, | ||
| 240, 240, 240, 243, 243, 243, 243, 243, 243, 243, 250, 250, 250, 250, 250, 250, | ||
| 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 270, 270, | ||
| 270, 270 | ||
| }; | ||
|
|
||
| //#define SRS_IND_DEBUG | ||
| #define MAX_NUM_DATA_IND 1024 | ||
|
|
||
|
|
||
| // With SC-FDMA the scheduler in uplink needs to schedule N_PRB=2^x3^y5^z | ||
|
rorsc marked this conversation as resolved.
|
||
| // Check 6.3.1.4 of 38.211 | ||
| int check_sc_fdma_rbsize(long transform_precoding, uint16_t rb) | ||
| { | ||
| if (transform_precoding == NR_PUSCH_Config__transformPrecoder_enabled) { | ||
| return rb < 274 ? NR_TRANSFORM_PRECODE_RB_LUT[rb] : NR_TRANSFORM_PRECODE_RB_LUT[273]; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure if it makes sense to check RB < 274 since the max BWP is 273 RBs. I would have rather put an assertion. But it's not a blocking point. |
||
| } | ||
| return rb; | ||
| } | ||
|
|
||
|
|
||
| /* \brief Get the number of UL TDAs that could be used in slot, reachable | ||
| * via specific k2. The output parameter first_idx is a pointer to the first | ||
| * suitable TDA, and the function returns the number of suitable TDAs, or 0. */ | ||
|
|
@@ -998,7 +1031,7 @@ static void _nr_rx_sdu(const module_id_t gnb_mod_idP, | |
| } | ||
| } | ||
| handle_nr_ul_harq(gNB_mac, UE, current_rnti, harq_pid, sduP == NULL); | ||
| } else { | ||
| } else { | ||
| nr_rx_ra_sdu(gnb_mod_idP, CC_idP, frameP, slotP, current_rnti, sduP, sdu_lenP, harq_pid, timing_advance, ul_cqi, rssi); | ||
| } | ||
| } | ||
|
|
@@ -1760,11 +1793,11 @@ static int apply_ul_retransmission(gNB_MAC_INST *nrmac, | |
| } else { | ||
| /* TDA changed vs original retx: recompute DMRS and TB size for new TDA */ | ||
| NR_pusch_dmrs_t dmrs_info = get_ul_dmrs_params(scc, current_BWP, tda_info, nrOfLayers); | ||
| new_sched.rbSize = cand->sched_pusch.rbSize; | ||
| new_sched.rbSize = check_sc_fdma_rbsize(current_BWP->transform_precoding, cand->sched_pusch.rbSize); | ||
| new_sched.rbStart = cand->sched_pusch.rbStart; | ||
| new_sched.tb_size = nr_compute_tbs(retInfo->Qm, | ||
| retInfo->R, | ||
| cand->sched_pusch.rbSize, | ||
| new_sched.rbSize, | ||
| tda_info->nrOfSymbols, | ||
| dmrs_info.N_PRB_DMRS * dmrs_info.num_dmrs_symb, | ||
| 0, | ||
|
|
@@ -1819,6 +1852,7 @@ static int apply_ul_new_transmission(gNB_MAC_INST *nrmac, | |
| * time_domain_allocation, tda_info already set by pipeline stages). | ||
| * Fill remaining dispatch fields: R, Qm, tb_size, dmrs_info, bwp_info. */ | ||
| NR_sched_pusch_t sched = cand->sched_pusch; | ||
| sched.rbSize = check_sc_fdma_rbsize(current_BWP->transform_precoding, sched.rbSize); | ||
| sched.frame = sched_frame; | ||
| sched.slot = sched_slot; | ||
| sched.ul_harq_pid = -1; | ||
|
|
@@ -2625,6 +2659,7 @@ bool nr_ul_check_phr(const nr_ul_sched_params_t *params, | |
| pot.dmrs_info = dmrs_info; | ||
| pot.nrOfLayers = cand->sched_pusch.nrOfLayers; | ||
| pot.rbSize = rbSize; | ||
| pot.rbSize = check_sc_fdma_rbsize(current_BWP->transform_precoding, pot.rbSize); | ||
| pot.mcs = mcs; | ||
|
|
||
| uint16_t R; | ||
|
|
@@ -2646,8 +2681,8 @@ bool nr_ul_check_phr(const nr_ul_sched_params_t *params, | |
| NR_sched_pusch_t p1 = pot; | ||
| int tp = tx_power; | ||
|
|
||
| while (cand->ph < tp && p1.rbSize > params->min_rb) { | ||
| p1.rbSize--; | ||
| while (cand->ph < tp && p1.rbSize > params->min_rb && check_sc_fdma_rbsize(current_BWP->transform_precoding, p1.rbSize-1) >= params->min_rb) { | ||
| p1.rbSize = check_sc_fdma_rbsize(current_BWP->transform_precoding, --p1.rbSize); | ||
| p1.tb_size = nr_compute_tbs(p1.Qm, p1.R, p1.rbSize, p1.tda_info.nrOfSymbols, n_dmrs, 0, 0, p1.nrOfLayers) >> 3; | ||
| tp = compute_ph_rb_factor(current_BWP->scs, p1.rbSize) + (hasDeltaMCS ? compute_ph_mcs_factor(&p1) : 0); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's exactly wrong.
check_sc_fdma_rbsize()usesNR_PUSCH_Config__transformPrecoder_enabledto check if SC-FDMA is enabled. that constant is0, so here, by default and if msg3_transformPrecoder is not set, will be set toenabledwhen it should be disabled.please fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IOW, initialize with
NR_PUSCH_Config__transformPrecoder_disabled