mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Add Delay Mechanism for Initial MIB/SIB Transmission in gNB Scheduler
This commit introduces a delay mechanism for the first MIB/SIB transmission in the gNB scheduler to allow PRACH noise estimate to converge stabilize before first PRACH preamble reception. Key changes: - Added the `num_scheduled_prach_rx` variable to gNB_MAC_INST to keep track of total number scheduled of PRACH receptions. Using uint64_t type to avoid overflow. - Updated the `gNB_dlsch_ulsch_scheduler` function to conditionally schedule MIB/SIB transmissions if `num_scheduled_prach_rx` is at least 100. The value comes from OAIs implementation of PRACH noise estimate.
This commit is contained in:
@@ -93,5 +93,6 @@
|
||||
#define RETURNerror (-1)
|
||||
#define DEFAULT_NAS_PATH "PWD"
|
||||
#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE)
|
||||
#define NUM_PRACH_RX_FOR_NOISE_ESTIMATE 100
|
||||
|
||||
#endif /* __PLATFORM_CONSTANTS_H__ */
|
||||
|
||||
@@ -120,7 +120,8 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
*/
|
||||
|
||||
if (eNB->frame_parms.prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[0] == 1) {
|
||||
if ((eNB->prach_energy_counter == 100) && (max_preamble_energy[0] > eNB->measurements.prach_I0 + eNB->prach_DTX_threshold_emtc[0])) {
|
||||
if ((eNB->prach_energy_counter == NUM_PRACH_RX_FOR_NOISE_ESTIMATE)
|
||||
&& (max_preamble_energy[0] > eNB->measurements.prach_I0 + eNB->prach_DTX_threshold_emtc[0])) {
|
||||
eNB->UL_INFO.rach_ind_br.rach_indication_body.number_of_preambles++;
|
||||
eNB->preamble_list_br[ind].preamble_rel8.timing_advance = max_preamble_delay[ind]; //
|
||||
eNB->preamble_list_br[ind].preamble_rel8.preamble = max_preamble[ind];
|
||||
@@ -142,7 +143,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
}
|
||||
} */// ce_level
|
||||
} else {
|
||||
if ((eNB->prach_energy_counter == 100) &&
|
||||
if ((eNB->prach_energy_counter == NUM_PRACH_RX_FOR_NOISE_ESTIMATE) &&
|
||||
(max_preamble_energy[0] > eNB->measurements.prach_I0+eNB->prach_DTX_threshold)) {
|
||||
LOG_D(PHY,"[eNB %d/%d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
eNB->Mod_id,
|
||||
@@ -186,7 +187,8 @@ void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
|
||||
if (frame==0) LOG_D(PHY,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
|
||||
|
||||
if (eNB->prach_energy_counter < 100) eNB->prach_energy_counter++;
|
||||
if (eNB->prach_energy_counter < NUM_PRACH_RX_FOR_NOISE_ESTIMATE)
|
||||
eNB->prach_energy_counter++;
|
||||
}
|
||||
} // else br_flag
|
||||
|
||||
|
||||
@@ -145,7 +145,8 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_rac
|
||||
max_preamble_delay[0],
|
||||
gNB->prach_energy_counter);
|
||||
|
||||
if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0 + gNB->prach_thres)
|
||||
if ((gNB->prach_energy_counter == NUM_PRACH_RX_FOR_NOISE_ESTIMATE)
|
||||
&& (max_preamble_energy[0] > gNB->measurements.prach_I0 + gNB->prach_thres)
|
||||
&& (rach_ind->number_of_pdus < MAX_NUM_NR_RX_RACH_PDUS)) {
|
||||
LOG_A(NR_PHY,
|
||||
"[RAPROC] %d.%d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol "
|
||||
@@ -185,7 +186,8 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB, int frame, int slot, nfapi_nr_rac
|
||||
}
|
||||
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
if (gNB->prach_energy_counter < 100) gNB->prach_energy_counter++;
|
||||
if (gNB->prach_energy_counter < NUM_PRACH_RX_FOR_NOISE_ESTIMATE)
|
||||
gNB->prach_energy_counter++;
|
||||
} //if prach_id>0
|
||||
rach_ind->slot = prach_start_slot;
|
||||
} // for NUMBER_OF_NR_PRACH_OCCASION_MAX
|
||||
|
||||
@@ -212,14 +212,16 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP, frame_t frame, slot_t slo
|
||||
|
||||
nr_mac_update_timers(module_idP, frame, slot);
|
||||
|
||||
// This schedules MIB
|
||||
schedule_nr_mib(module_idP, frame, slot, &sched_info->DL_req);
|
||||
if (gNB->num_scheduled_prach_rx >= NUM_PRACH_RX_FOR_NOISE_ESTIMATE || get_softmodem_params()->phy_test) {
|
||||
// This schedules MIB
|
||||
schedule_nr_mib(module_idP, frame, slot, &sched_info->DL_req);
|
||||
|
||||
// This schedules SIB1
|
||||
// SIB19 will be scheduled if ntn_Config_r17 is initialized
|
||||
if (IS_SA_MODE(get_softmodem_params())) {
|
||||
schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
|
||||
schedule_nr_other_sib(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
|
||||
// This schedules SIB1
|
||||
// SIB19 will be scheduled if ntn_Config_r17 is initialized
|
||||
if (IS_SA_MODE(get_softmodem_params())) {
|
||||
schedule_nr_sib1(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
|
||||
schedule_nr_other_sib(module_idP, frame, slot, &sched_info->DL_req, &sched_info->TX_req);
|
||||
}
|
||||
}
|
||||
|
||||
// This schedule PRACH if we are not in phy_test mode
|
||||
|
||||
@@ -430,6 +430,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, slot_t slotP)
|
||||
}
|
||||
}
|
||||
if(td_index == 0) {
|
||||
gNB->num_scheduled_prach_rx++;
|
||||
AssertFatal(UL_tti_req->n_pdus < sizeof(UL_tti_req->pdus_list) / sizeof(UL_tti_req->pdus_list[0]),
|
||||
"Invalid UL_tti_req->n_pdus %d\n", UL_tti_req->n_pdus);
|
||||
|
||||
|
||||
@@ -275,6 +275,7 @@ void mac_top_init_gNB(ngran_node_t node_type,
|
||||
RC.nrmac[i]->common_channels[0].pre_ServingCellConfig = scd;
|
||||
|
||||
RC.nrmac[i]->first_MIB = true;
|
||||
RC.nrmac[i]->num_scheduled_prach_rx = 0;
|
||||
RC.nrmac[i]->common_channels[0].mib = get_new_MIB_NR(scc);
|
||||
|
||||
RC.nrmac[i]->cset0_bwp_start = 0;
|
||||
|
||||
@@ -936,7 +936,7 @@ typedef struct gNB_MAC_INST_s {
|
||||
pthread_mutex_t sched_lock;
|
||||
|
||||
mac_stats_t mac_stats;
|
||||
|
||||
uint64_t num_scheduled_prach_rx;
|
||||
} gNB_MAC_INST;
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_GNB_H__ */
|
||||
|
||||
Reference in New Issue
Block a user