use sleep to delay UE to allow the convergence of the IIR filter on PRACH noise measurements at gNB side instead of counting frames
This commit is contained in:
@@ -465,6 +465,10 @@ int main(int argc, char **argv)
|
||||
get_channel_model_mode(uniqCfg);
|
||||
}
|
||||
|
||||
// Delay to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
|
||||
if (IS_SOFTMODEM_RFSIM && !get_softmodem_params()->phy_test)
|
||||
sleep(3);
|
||||
|
||||
if (!get_softmodem_params()->nsa && get_softmodem_params()->emulate_l1)
|
||||
start_oai_nrue_threads();
|
||||
|
||||
|
||||
@@ -538,7 +538,6 @@ typedef struct NR_UE_MAC_INST_s {
|
||||
NR_UE_L2_STATE_t state;
|
||||
int servCellIndex;
|
||||
long physCellId;
|
||||
int first_sync_frame;
|
||||
bool get_sib1;
|
||||
bool get_otherSI;
|
||||
NR_MIB_t *mib;
|
||||
|
||||
@@ -115,7 +115,6 @@ void nr_ue_send_synch_request(NR_UE_MAC_INST_t *mac, module_id_t module_id, int
|
||||
void nr_ue_reset_sync_state(NR_UE_MAC_INST_t *mac)
|
||||
{
|
||||
// reset synchornization status
|
||||
mac->first_sync_frame = -1;
|
||||
mac->state = UE_NOT_SYNC;
|
||||
mac->ra.ra_state = nrRA_UE_IDLE;
|
||||
}
|
||||
|
||||
@@ -830,21 +830,8 @@ static void setup_ra_response_window(RA_config_t *ra,
|
||||
bool init_RA(NR_UE_MAC_INST_t *mac, int frame)
|
||||
{
|
||||
RA_config_t *ra = &mac->ra;
|
||||
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
|
||||
LOG_D(NR_MAC,
|
||||
"ra->ra_state %d frame %d mac->first_sync_frame %d xxx %d",
|
||||
ra->ra_state,
|
||||
frame,
|
||||
mac->first_sync_frame,
|
||||
((MAX_FRAME_NUMBER + frame - mac->first_sync_frame) % MAX_FRAME_NUMBER) > 10);
|
||||
if ((mac->first_sync_frame > -1 || get_softmodem_params()->do_ra || get_softmodem_params()->nsa)
|
||||
&& ((MAX_FRAME_NUMBER + frame - mac->first_sync_frame) % MAX_FRAME_NUMBER) > 150) {
|
||||
ra->ra_state = nrRA_GENERATE_PREAMBLE;
|
||||
LOG_D(NR_MAC, "PRACH Condition met: ra state %d, frame %d, sync_frame %d\n", ra->ra_state, frame, mac->first_sync_frame);
|
||||
} else {
|
||||
LOG_D(NR_MAC, "PRACH Condition not met: ra state %d, frame %d, sync_frame %d\n", ra->ra_state, frame, mac->first_sync_frame);
|
||||
return false;
|
||||
}
|
||||
LOG_D(NR_MAC, "Initialization of RA\n");
|
||||
ra->ra_state = nrRA_GENERATE_PREAMBLE;
|
||||
|
||||
// TODO this piece of code is required to compute MSG3_size that is used by ra_preambles_config function
|
||||
// Not a good implementation, it needs improvements
|
||||
|
||||
@@ -238,9 +238,6 @@ void nr_ue_decode_mib(NR_UE_MAC_INST_t *mac, int cc_id)
|
||||
mac->ssb_subcarrier_offset = ssb_subcarrier_offset;
|
||||
mac->dmrs_TypeA_Position = mac->mib->dmrs_TypeA_Position;
|
||||
|
||||
if (mac->first_sync_frame == -1)
|
||||
mac->first_sync_frame = frame;
|
||||
|
||||
if (get_softmodem_params()->phy_test)
|
||||
mac->state = UE_CONNECTED;
|
||||
else if (mac->state == UE_NOT_SYNC) {
|
||||
|
||||
@@ -1335,11 +1335,9 @@ void nr_ue_ul_scheduler(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_info)
|
||||
RA_config_t *ra = &mac->ra;
|
||||
|
||||
if (mac->state == UE_PERFORMING_RA && ra->ra_state == nrRA_UE_IDLE) {
|
||||
bool res = init_RA(mac, frame_tx);
|
||||
if (res) {
|
||||
// perform the Random Access Resource selection procedure (see clause 5.1.2 and .2a)
|
||||
ra_resource_selection(mac);
|
||||
}
|
||||
init_RA(mac, frame_tx);
|
||||
// perform the Random Access Resource selection procedure (see clause 5.1.2 and .2a)
|
||||
ra_resource_selection(mac);
|
||||
}
|
||||
|
||||
if (mac->state == UE_PERFORMING_RA && ra->ra_state == nrRA_GENERATE_PREAMBLE)
|
||||
|
||||
@@ -106,7 +106,6 @@ TEST(test_init_ra, four_step_cbra)
|
||||
mac.frame_structure.frame_type = TDD;
|
||||
mac.frame_structure.numb_slots_frame = 20;
|
||||
mac.frequency_range = FR1;
|
||||
mac.first_sync_frame = 0;
|
||||
int frame = 151;
|
||||
|
||||
init_RA(&mac, frame);
|
||||
@@ -141,7 +140,6 @@ TEST(test_init_ra, four_step_cfra)
|
||||
mac.frame_structure.frame_type = TDD;
|
||||
mac.frame_structure.numb_slots_frame = 20;
|
||||
mac.frequency_range = FR1;
|
||||
mac.first_sync_frame = 0;
|
||||
int frame = 151;
|
||||
|
||||
NR_RACH_ConfigDedicated_t rach_ConfigDedicated = {0};
|
||||
|
||||
Reference in New Issue
Block a user