diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml index 4addd20ebef32a6f3277c945279fb4faa2d6ec3b..c54c3e33220de5427c1007ea5f393efafca772b8 100644 --- a/cmake_targets/autotests/test_case_list.xml +++ b/cmake_targets/autotests/test_case_list.xml @@ -1053,16 +1053,24 @@ <testCase id="015104"> <class>execution</class> - <desc>nr_pbchsim Test cases. (Test1: PBCH-only), - (Test2: PBCH and synchronization)</desc> + <desc>nr_pbchsim Test cases. (Test1: PBCH-only, 106 PRB), + (Test2: PBCH and synchronization, 106PBR), + (Test3: PBCH-only, 217 PRB), + (Test4: PBCH and synchronization, 217 RPB), + (Test5: PBCH-only, 217 PRB), + (Test6: PBCH and synchronization, 217 PRB)</desc> <pre_compile_prog></pre_compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog_args> --phy_simulators -c </compile_prog_args> <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec_args></pre_exec_args> <main_exec> $OPENAIR_DIR/targets/bin/nr_pbchsim.Rel15</main_exec> - <main_exec_args>-s-11 -S-10 -n1000 - -s-11 -S-10 -n10 -I</main_exec_args> + <main_exec_args>-s-11 -S-10 -n1000 -R106 + -s-11 -S-10 -n10 -I -R106 + -s-11 -S-10 -n1000 -R217 -N10 + -s-11 -S-10 -n10 -I -R217 -N10 + -s-11 -S-10 -n1000 -R273 -N20 + -s-11 -S-10 -n10 -I -R273 -N20</main_exec_args> <tags>nr_pbchsim.test1 nr_pbchsim.test2</tags> <search_expr_true>PBCH test OK</search_expr_true> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c index aadce58b873f03c9b76136d7078d32a25367afd6..1866eac96d54e71d030d57fd899c9bab2943ecad 100644 --- a/openair1/PHY/INIT/nr_init.c +++ b/openair1/PHY/INIT/nr_init.c @@ -387,7 +387,7 @@ void install_schedule_handlers(IF_Module_t *if_inst) /// this function is a temporary addition for NR configuration -void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu) +void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell) { NR_DL_FRAME_PARMS *fp = &gNB->frame_parms; nfapi_nr_config_request_t *gNB_config = &gNB->gNB_config; @@ -403,6 +403,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu) gNB_config->sch_config.ssb_subcarrier_offset.value = 0; gNB_config->sch_config.n_ssb_crb.value = (N_RB_DL-20); gNB_config->sch_config.ssb_subcarrier_offset.value = 0; + gNB_config->sch_config.physical_cell_id.value=Nid_cell; gNB->mac_enabled = 1; diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c index 17f0d8a5d2b5cbfc5893c9a2a50c6c7fc3486b3d..b6b7eb8ced909db564fa6f1d8e5561b2a7a58606 100644 --- a/openair1/PHY/INIT/nr_init_ue.c +++ b/openair1/PHY/INIT/nr_init_ue.c @@ -656,6 +656,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int eNB_id; int th_id; int n_ssb_crb=(fp->N_RB_DL-20); + int k_ssb=0; abstraction_flag = 0; fp->nb_antennas_tx = 1; fp->nb_antennas_rx=1; @@ -664,7 +665,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx); //LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST); - nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,0); + nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,fp->N_RB_DL,n_ssb_crb,k_ssb); phy_init_nr_top(ue); // many memory allocation sizes are hard coded diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c index 381a0c0452fd232c473ffb049bf5f4f1dd05f7cb..f37883b38814344e4611f5ff243d2d03a256205f 100644 --- a/openair1/PHY/INIT/nr_parms.c +++ b/openair1/PHY/INIT/nr_parms.c @@ -195,10 +195,9 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, int n_ssb_crb, int ssb_subcarrier_offset) { - + /*n_ssb_crb and ssb_subcarrier_offset are given in 15kHz SCS*/ nr_init_frame_parms0(fp,mu,Ncp,N_RB_DL); - int start_rb = n_ssb_crb / (1<<mu); - fp->ssb_start_subcarrier = 12 * start_rb + ssb_subcarrier_offset; + fp->ssb_start_subcarrier = (12 * n_ssb_crb + ssb_subcarrier_offset)/(1<<mu); return 0; } diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h index 085fdd677b42291ea59fcfbe670e7eb18338cf02..2a7dcf88fdce516e7449d55193e3e4e6974b43e4 100644 --- a/openair1/PHY/INIT/phy_init.h +++ b/openair1/PHY/INIT/phy_init.h @@ -383,7 +383,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag); void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms); int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag); void nr_phy_config_request(NR_PHY_Config_t *gNB); -void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu); +void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell); void phy_free_nr_gNB(PHY_VARS_gNB *gNB); int l1_north_init_gNB(void); void init_nr_transport(PHY_VARS_gNB *gNB); diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c index 81c7cd46931fa5865e9e4b4c3a4779de917817fd..7cbb70242efb939ed510d23a4db715ece84bc647 100644 --- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c +++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c @@ -112,9 +112,8 @@ int nr_get_ssb_start_symbol(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *f void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_t *cfg, NR_DL_FRAME_PARMS *fp) { - int start_rb = cfg->sch_config.n_ssb_crb.value / (1<<cfg->subframe_config.numerology_index_mu.value); - fp->ssb_start_subcarrier = 12 * start_rb + cfg->sch_config.ssb_subcarrier_offset.value; - LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,start_rb,cfg->sch_config.ssb_subcarrier_offset.value); + fp->ssb_start_subcarrier = (12 * cfg->sch_config.n_ssb_crb.value + cfg->sch_config.ssb_subcarrier_offset.value)/(1<<cfg->subframe_config.numerology_index_mu.value); + LOG_D(PHY, "SSB first subcarrier %d (%d,%d)\n", fp->ssb_start_subcarrier,cfg->sch_config.n_ssb_crb.value,cfg->sch_config.ssb_subcarrier_offset.value); } void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c index d30d13d4907fb0a03bdfc9cfd3a59331c1a27dfb..1c2b2305d6934606d0433f08588d35ebec381fcf 100644 --- a/openair1/SIMULATION/NR_PHY/dlschsim.c +++ b/openair1/SIMULATION/NR_PHY/dlschsim.c @@ -381,7 +381,7 @@ int main(int argc, char **argv) { frame_parms->nb_antennas_rx = n_rx; frame_parms->N_RB_DL = N_RB_DL; crcTableInit(); - nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu); + nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell); phy_init_nr_gNB(gNB, 0, 0); //init_eNB_afterRU(); frame_length_complex_samples = frame_parms->samples_per_subframe; diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c index f05aa41e8c8f9c70c6c8a308e3d5576af64b2e39..f71cb7d147b156a6dfe3756151d1340e4fc067e3 100644 --- a/openair1/SIMULATION/NR_PHY/pbchsim.c +++ b/openair1/SIMULATION/NR_PHY/pbchsim.c @@ -357,7 +357,7 @@ int main(int argc, char **argv) frame_parms->N_RB_DL = N_RB_DL; frame_parms->N_RB_UL = N_RB_DL; - nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu); + nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell); phy_init_nr_gNB(gNB,0,0); double fs,bw; @@ -476,7 +476,7 @@ int main(int argc, char **argv) frame_length_complex_samples, input_fd) != frame_length_complex_samples) { printf("error reading from file\n"); - exit(-1); + //exit(-1); } }