diff --git a/lib/examples/pdsch_enodeb.c b/lib/examples/pdsch_enodeb.c index fd6b4ade9..a00408209 100644 --- a/lib/examples/pdsch_enodeb.c +++ b/lib/examples/pdsch_enodeb.c @@ -203,6 +203,9 @@ static void parse_args(int argc, char** argv) case 'Q': use_standard_lte_rate ^= true; break; + case 'E': + cell.cp = SRSRAN_CP_EXT; + break; default: usage(argv[0]); exit(-1); @@ -307,7 +310,7 @@ static void base_init() /* create ifft object */ for (i = 0; i < cell.nof_ports; i++) { - if (srsran_ofdm_tx_init(&ifft[i], SRSRAN_CP_NORM, sf_buffer[i], output_buffer[i], cell.nof_prb)) { + if (srsran_ofdm_tx_init(&ifft[i], cell.cp, sf_buffer[i], output_buffer[i], cell.nof_prb)) { ERROR("Error creating iFFT object"); exit(-1); } @@ -725,7 +728,7 @@ int main(int argc, char** argv) generate_mcch_table(mch_table, mbsfn_sf_mask); } N_id_2 = cell.id % 3; - sf_n_re = 2 * SRSRAN_CP_NORM_NSYMB * cell.nof_prb * SRSRAN_NRE; + sf_n_re = SRSRAN_SF_LEN_RE(cell.nof_prb, cell.cp); sf_n_samples = 2 * SRSRAN_SLOT_LEN(srsran_symbol_sz(cell.nof_prb)); cell.phich_length = SRSRAN_PHICH_NORM; @@ -841,8 +844,8 @@ int main(int argc, char** argv) srsran_vec_cf_zero(sf_symbols[0], sf_n_re); if (sf_idx == 0 || sf_idx == 5) { - srsran_pss_put_slot(pss_signal, sf_symbols[0], cell.nof_prb, SRSRAN_CP_NORM); - srsran_sss_put_slot(sf_idx ? sss_signal5 : sss_signal0, sf_symbols[0], cell.nof_prb, SRSRAN_CP_NORM); + srsran_pss_put_slot(pss_signal, sf_symbols[0], cell.nof_prb, cell.cp); + srsran_sss_put_slot(sf_idx ? sss_signal5 : sss_signal0, sf_symbols[0], cell.nof_prb, cell.cp); } /* Copy zeros, SSS, PSS into the rest of antenna ports */ diff --git a/lib/include/srsran/interfaces/ue_phy_interfaces.h b/lib/include/srsran/interfaces/ue_phy_interfaces.h index c86a850da..9425de364 100644 --- a/lib/include/srsran/interfaces/ue_phy_interfaces.h +++ b/lib/include/srsran/interfaces/ue_phy_interfaces.h @@ -84,6 +84,7 @@ struct phy_args_t { uint32_t intra_freq_meas_len_ms = 20; uint32_t intra_freq_meas_period_ms = 200; float force_ul_amplitude = 0.0f; + bool detect_cp = false; float in_sync_rsrp_dbm_th = -130.0f; float in_sync_snr_db_th = 1.0f; diff --git a/lib/include/srsran/phy/enb/enb_dl.h b/lib/include/srsran/phy/enb/enb_dl.h index 0acd6fc54..76c7a20c4 100644 --- a/lib/include/srsran/phy/enb/enb_dl.h +++ b/lib/include/srsran/phy/enb/enb_dl.h @@ -56,7 +56,7 @@ typedef struct SRSRAN_API { srsran_dl_sf_cfg_t dl_sf; cf_t* sf_symbols[SRSRAN_MAX_PORTS]; - + cf_t* out_buffer[SRSRAN_MAX_PORTS]; srsran_ofdm_t ifft[SRSRAN_MAX_PORTS]; srsran_ofdm_t ifft_mbsfn; diff --git a/lib/include/srsran/phy/enb/enb_ul.h b/lib/include/srsran/phy/enb/enb_ul.h index 86b823356..5010e0707 100644 --- a/lib/include/srsran/phy/enb/enb_ul.h +++ b/lib/include/srsran/phy/enb/enb_ul.h @@ -44,6 +44,7 @@ typedef struct SRSRAN_API { srsran_cell_t cell; cf_t* sf_symbols; + cf_t* in_buffer; srsran_chest_ul_res_t chest_res; srsran_ofdm_t fft; diff --git a/lib/include/srsran/phy/sync/refsignal_dl_sync.h b/lib/include/srsran/phy/sync/refsignal_dl_sync.h index 2dfd21df0..66a2cdf96 100644 --- a/lib/include/srsran/phy/sync/refsignal_dl_sync.h +++ b/lib/include/srsran/phy/sync/refsignal_dl_sync.h @@ -35,7 +35,7 @@ typedef struct { uint32_t peak_index; } srsran_refsignal_dl_sync_t; -SRSRAN_API int srsran_refsignal_dl_sync_init(srsran_refsignal_dl_sync_t* q); +SRSRAN_API int srsran_refsignal_dl_sync_init(srsran_refsignal_dl_sync_t* q, srsran_cp_t cp); SRSRAN_API int srsran_refsignal_dl_sync_set_cell(srsran_refsignal_dl_sync_t* q, srsran_cell_t cell); diff --git a/lib/include/srsran/phy/ue/ue_cell_search.h b/lib/include/srsran/phy/ue/ue_cell_search.h index 98da33300..00d5df751 100644 --- a/lib/include/srsran/phy/ue/ue_cell_search.h +++ b/lib/include/srsran/phy/ue/ue_cell_search.h @@ -90,5 +90,7 @@ SRSRAN_API int srsran_ue_cellsearch_scan(srsran_ue_cellsearch_t* q, SRSRAN_API int srsran_ue_cellsearch_set_nof_valid_frames(srsran_ue_cellsearch_t* q, uint32_t nof_frames); +SRSRAN_API void srsran_set_detect_cp(srsran_ue_cellsearch_t* q, bool enable); + #endif // SRSRAN_UE_CELL_SEARCH_H diff --git a/lib/include/srsran/phy/ue/ue_sync.h b/lib/include/srsran/phy/ue/ue_sync.h index c6a33e192..22a4e4e18 100644 --- a/lib/include/srsran/phy/ue/ue_sync.h +++ b/lib/include/srsran/phy/ue/ue_sync.h @@ -238,6 +238,8 @@ SRSRAN_API uint32_t srsran_ue_sync_get_sfidx(srsran_ue_sync_t* q); SRSRAN_API float srsran_ue_sync_get_cfo(srsran_ue_sync_t* q); +SRSRAN_API void srsran_ue_sync_cp_en(srsran_ue_sync_t* q, bool enabled); + SRSRAN_API float srsran_ue_sync_get_sfo(srsran_ue_sync_t* q); SRSRAN_API int srsran_ue_sync_get_last_sample_offset(srsran_ue_sync_t* q); diff --git a/lib/src/phy/enb/enb_dl.c b/lib/src/phy/enb/enb_dl.c index a6bb4160f..91eb8b0b2 100644 --- a/lib/src/phy/enb/enb_dl.c +++ b/lib/src/phy/enb/enb_dl.c @@ -41,21 +41,14 @@ int srsran_enb_dl_init(srsran_enb_dl_t* q, cf_t* out_buffer[SRSRAN_MAX_PORTS], u goto clean_exit; } } + for (int i = 0; i < SRSRAN_MAX_PORTS; i++) { + q->out_buffer[i] = out_buffer[i]; + } srsran_ofdm_cfg_t ofdm_cfg = {}; ofdm_cfg.nof_prb = max_prb; - ofdm_cfg.cp = SRSRAN_CP_NORM; + ofdm_cfg.cp = SRSRAN_CP_EXT; ofdm_cfg.normalize = false; - for (int i = 0; i < SRSRAN_MAX_PORTS; i++) { - ofdm_cfg.in_buffer = q->sf_symbols[i]; - ofdm_cfg.out_buffer = out_buffer[i]; - ofdm_cfg.sf_type = SRSRAN_SF_NORM; - if (srsran_ofdm_tx_init_cfg(&q->ifft[i], &ofdm_cfg)) { - ERROR("Error initiating FFT (%d)", i); - goto clean_exit; - } - } - ofdm_cfg.in_buffer = q->sf_symbols[0]; ofdm_cfg.out_buffer = out_buffer[0]; ofdm_cfg.sf_type = SRSRAN_SF_MBSFN; @@ -150,6 +143,19 @@ int srsran_enb_dl_set_cell(srsran_enb_dl_t* q, srsran_cell_t cell) srsran_regs_free(&q->regs); } q->cell = cell; + srsran_ofdm_cfg_t ofdm_cfg = {}; + ofdm_cfg.nof_prb = q->cell.nof_prb; + ofdm_cfg.cp = cell.cp; + ofdm_cfg.normalize = false; + for (int i = 0; i < SRSRAN_MAX_PORTS; i++) { + ofdm_cfg.in_buffer = q->sf_symbols[i]; + ofdm_cfg.out_buffer = q->out_buffer[i]; + ofdm_cfg.sf_type = SRSRAN_SF_NORM; + if (srsran_ofdm_tx_init_cfg(&q->ifft[i], &ofdm_cfg)) { + ERROR("Error initiating FFT (%d)", i); + return SRSRAN_ERROR; + } + } if (srsran_regs_init(&q->regs, q->cell)) { ERROR("Error resizing REGs"); return SRSRAN_ERROR; diff --git a/lib/src/phy/enb/enb_ul.c b/lib/src/phy/enb/enb_ul.c index 755dd6f93..c9e7b4bc1 100644 --- a/lib/src/phy/enb/enb_ul.c +++ b/lib/src/phy/enb/enb_ul.c @@ -37,19 +37,7 @@ int srsran_enb_ul_init(srsran_enb_ul_t* q, cf_t* in_buffer, uint32_t max_prb) perror("malloc"); goto clean_exit; } - - srsran_ofdm_cfg_t ofdm_cfg = {}; - ofdm_cfg.nof_prb = max_prb; - ofdm_cfg.in_buffer = in_buffer; - ofdm_cfg.out_buffer = q->sf_symbols; - ofdm_cfg.cp = SRSRAN_CP_NORM; - ofdm_cfg.freq_shift_f = -0.5f; - ofdm_cfg.normalize = false; - ofdm_cfg.rx_window_offset = 0.5f; - if (srsran_ofdm_rx_init_cfg(&q->fft, &ofdm_cfg)) { - ERROR("Error initiating FFT"); - goto clean_exit; - } + q->in_buffer = in_buffer; if (srsran_pucch_init_enb(&q->pucch)) { ERROR("Error creating PUCCH object"); @@ -108,6 +96,18 @@ int srsran_enb_ul_set_cell(srsran_enb_ul_t* q, if (cell.id != q->cell.id || q->cell.nof_prb == 0) { q->cell = cell; + srsran_ofdm_cfg_t ofdm_cfg = {}; + ofdm_cfg.nof_prb = q->cell.nof_prb; + ofdm_cfg.in_buffer = q->in_buffer; + ofdm_cfg.out_buffer = q->sf_symbols; + ofdm_cfg.cp = q->cell.cp; + ofdm_cfg.freq_shift_f = -0.5f; + ofdm_cfg.normalize = false; + ofdm_cfg.rx_window_offset = 0.5f; + if (srsran_ofdm_rx_init_cfg(&q->fft, &ofdm_cfg)) { + ERROR("Error initiating FFT"); + return SRSRAN_ERROR; + } if (srsran_ofdm_rx_set_prb(&q->fft, q->cell.cp, q->cell.nof_prb)) { ERROR("Error initiating FFT"); return SRSRAN_ERROR; diff --git a/lib/src/phy/sync/refsignal_dl_sync.c b/lib/src/phy/sync/refsignal_dl_sync.c index 1137e6b4e..14dfc9114 100644 --- a/lib/src/phy/sync/refsignal_dl_sync.c +++ b/lib/src/phy/sync/refsignal_dl_sync.c @@ -139,7 +139,7 @@ static inline void refsignal_dl_pss_sss_strength(srsran_refsignal_dl_sync_t* q, } } -int srsran_refsignal_dl_sync_init(srsran_refsignal_dl_sync_t* q) +int srsran_refsignal_dl_sync_init(srsran_refsignal_dl_sync_t* q, srsran_cp_t cp) { int ret = SRSRAN_ERROR_INVALID_INPUTS; @@ -177,12 +177,12 @@ int srsran_refsignal_dl_sync_init(srsran_refsignal_dl_sync_t* q) // Initiate OFDM modulator if (!ret) { - ret = srsran_ofdm_tx_init(&q->ifft, SRSRAN_CP_NORM, q->ifft_buffer_in, q->ifft_buffer_out, SRSRAN_MAX_PRB); + ret = srsran_ofdm_tx_init(&q->ifft, cp, q->ifft_buffer_in, q->ifft_buffer_out, SRSRAN_MAX_PRB); } // Set PRB if (!ret) { - ret = srsran_ofdm_tx_set_prb(&q->ifft, SRSRAN_CP_NORM, SRSRAN_MAX_PRB); + ret = srsran_ofdm_tx_set_prb(&q->ifft, cp, SRSRAN_MAX_PRB); } // Initiate FFT Convolution diff --git a/lib/src/phy/ue/ue_cell_search.c b/lib/src/phy/ue/ue_cell_search.c index 13ee51cf7..9f5d6cedc 100644 --- a/lib/src/phy/ue/ue_cell_search.c +++ b/lib/src/phy/ue/ue_cell_search.c @@ -179,6 +179,11 @@ int srsran_ue_cellsearch_set_nof_valid_frames(srsran_ue_cellsearch_t* q, uint32_ } } +void srsran_set_detect_cp(srsran_ue_cellsearch_t* q, bool enable) +{ + srsran_ue_sync_cp_en(&q->ue_sync, enable); +} + /* Decide the most likely cell based on the mode */ static void get_cell(srsran_ue_cellsearch_t* q, uint32_t nof_detected_frames, srsran_ue_cellsearch_result_t* found_cell) { diff --git a/lib/src/phy/ue/ue_sync.c b/lib/src/phy/ue/ue_sync.c index 7868881d7..82c5b00e1 100644 --- a/lib/src/phy/ue/ue_sync.c +++ b/lib/src/phy/ue/ue_sync.c @@ -330,7 +330,8 @@ int srsran_ue_sync_set_cell(srsran_ue_sync_t* q, srsran_cell_t cell) q->cell = cell; q->fft_size = srsran_symbol_sz(q->cell.nof_prb); q->sf_len = SRSRAN_SF_LEN(q->fft_size); - + srsran_sync_set_cp(&q->sfind, q->cell.cp); + srsran_sync_set_cp(&q->strack, q->cell.cp); if (cell.id == 1000) { /* If the cell is unkown, we search PSS/SSS in 5 ms */ q->nof_recv_sf = 5; @@ -499,6 +500,12 @@ float srsran_ue_sync_get_cfo(srsran_ue_sync_t* q) return 15000 * q->cfo_current_value; } +void srsran_ue_sync_cp_en(srsran_ue_sync_t* q, bool enabled) +{ + srsran_sync_cp_en(&q->strack, enabled); + srsran_sync_cp_en(&q->sfind, enabled); +} + void srsran_ue_sync_copy_cfo(srsran_ue_sync_t* q, srsran_ue_sync_t* src_obj) { // Copy find object internal CFO averages diff --git a/lib/test/phy/CMakeLists.txt b/lib/test/phy/CMakeLists.txt index b8471516b..92654be8a 100644 --- a/lib/test/phy/CMakeLists.txt +++ b/lib/test/phy/CMakeLists.txt @@ -18,33 +18,35 @@ target_link_libraries(phy_dl_test srsran_phy srsran_common srsran_phy ${SEC_LIBR set(ue_dl_min_mcs 0) set(ue_dl_max_mcs 28) set(ue_dl_step_mcs 7) - -foreach (cell_n_prb 6 15 25 50 75 100) - foreach (allow_256 0 1) - foreach (ue_dl_tm 1 2 3 4) - foreach (ue_dl_mcs RANGE ${ue_dl_min_mcs} ${ue_dl_max_mcs} ${ue_dl_step_mcs}) - set(phy_dl_test_args "") - - set(phy_dl_test_args ${phy_dl_test_args} -p ${cell_n_prb}) - set(phy_dl_test_args ${phy_dl_test_args} -t ${ue_dl_tm}) - if (${allow_256}) - if (${ue_dl_mcs} EQUAL 28) - if (${cell_n_prb} EQUAL 15) - set(ue_dl_mcs 26) - else (${cell_n_prb} EQUAL 15) - set(ue_dl_mcs 27) - endif (${cell_n_prb} EQUAL 15) - endif (${ue_dl_mcs} EQUAL 28) - - set(phy_dl_test_args ${phy_dl_test_args} -q) - endif (${allow_256}) - set(phy_dl_test_args ${phy_dl_test_args} -m ${ue_dl_mcs}) - string(REGEX REPLACE "\ " "" test_name_args ${phy_dl_test_args}) - add_lte_test(phy_dl_test${test_name_args} phy_dl_test ${phy_dl_test_args}) - endforeach (ue_dl_mcs) - endforeach (ue_dl_tm) - endforeach (allow_256 0 1) -endforeach (cell_n_prb) +foreach (cp 0 1) + foreach (cell_n_prb 6 15 25 50 75 100) + foreach (allow_256 0 1) + foreach (ue_dl_tm 1 2 3 4) + foreach (ue_dl_mcs RANGE ${ue_dl_min_mcs} ${ue_dl_max_mcs} ${ue_dl_step_mcs}) + set(phy_dl_test_args "") + if(NOT ((${cp} EQUAL 1) AND (ue_dl_mcs GREATER 26))) + set(phy_dl_test_args ${phy_dl_test_args} -p ${cell_n_prb}) + set(phy_dl_test_args ${phy_dl_test_args} -t ${ue_dl_tm}) + set(phy_dl_test_args ${phy_dl_test_args} -E ${cp}) + if (${allow_256}) + if (${ue_dl_mcs} EQUAL 28) + if (${cell_n_prb} EQUAL 15) + set(ue_dl_mcs 26) + else (${cell_n_prb} EQUAL 15) + set(ue_dl_mcs 27) + endif (${cell_n_prb} EQUAL 15) + endif (${ue_dl_mcs} EQUAL 28) + set(phy_dl_test_args ${phy_dl_test_args} -q) + endif (${allow_256}) + set(phy_dl_test_args ${phy_dl_test_args} -m ${ue_dl_mcs}) + string(REGEX REPLACE "\ " "" test_name_args ${phy_dl_test_args}) + add_lte_test(phy_dl_test${test_name_args} phy_dl_test ${phy_dl_test_args}) + endif(NOT ((${cp} EQUAL 1) AND (ue_dl_mcs GREATER 26))) + endforeach (ue_dl_mcs) + endforeach (ue_dl_tm) + endforeach (allow_256 0 1) + endforeach (cell_n_prb) +endforeach (cp) add_executable(pucch_ca_test pucch_ca_test.c) target_link_libraries(pucch_ca_test srsran_phy srsran_common srsran_phy ${SEC_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) diff --git a/lib/test/phy/phy_dl_test.c b/lib/test/phy/phy_dl_test.c index 3c8f7e6ee..81d2646d8 100644 --- a/lib/test/phy/phy_dl_test.c +++ b/lib/test/phy/phy_dl_test.c @@ -40,6 +40,7 @@ void usage(char* prog) { printf("Usage: %s [cfpndvs]\n", prog); printf("\t-c cell id [Default %d]\n", cell.id); + printf("\t-E extended Cyclic prefix [Default %d]\n", cell.cp); printf("\t-f cfi [Default %d]\n", cfi); printf("\t-p cell.nof_prb [Default %d]\n", cell.nof_prb); printf("\t-s number of subframes to simulate [Default %d]\n", nof_subframes); @@ -84,7 +85,7 @@ void parse_args(int argc, char** argv) nof_rx_ant = 2; } - while ((opt = getopt(argc, argv, "cfapndvqstm")) != -1) { + while ((opt = getopt(argc, argv, "cfapndvqstmE")) != -1) { switch (opt) { case 't': transmission_mode = (uint32_t)strtol(argv[optind], NULL, 10) - 1; @@ -111,6 +112,9 @@ void parse_args(int argc, char** argv) case 's': nof_subframes = (uint32_t)strtol(argv[optind], NULL, 10); break; + case 'E': + cell.cp = ((uint32_t)strtol(argv[optind], NULL, 10)) ? SRSRAN_CP_EXT : SRSRAN_CP_NORM; + break; case 'd': print_dci_table = true; break; diff --git a/srsenb/enb.conf.example b/srsenb/enb.conf.example index 54aa83ae7..937192caa 100644 --- a/srsenb/enb.conf.example +++ b/srsenb/enb.conf.example @@ -336,3 +336,4 @@ enable = false #eea_pref_list = EEA0, EEA2, EEA1 #eia_pref_list = EIA2, EIA1, EIA0 #gtpu_tunnel_timeout = 0 +#extended_cp = false diff --git a/srsenb/hdr/phy/phy_interfaces.h b/srsenb/hdr/phy/phy_interfaces.h index 026c9d403..b1e8d59cf 100644 --- a/srsenb/hdr/phy/phy_interfaces.h +++ b/srsenb/hdr/phy/phy_interfaces.h @@ -63,7 +63,7 @@ struct phy_args_t { bool pusch_meas_ta = true; bool pucch_meas_ta = true; uint32_t nof_prach_threads = 1; - + bool extended_cp = false; srsran::channel::args_t dl_channel_args; srsran::channel::args_t ul_channel_args; diff --git a/srsenb/src/enb_cfg_parser.cc b/srsenb/src/enb_cfg_parser.cc index 44ba97fb0..4aac6d7b6 100644 --- a/srsenb/src/enb_cfg_parser.cc +++ b/srsenb/src/enb_cfg_parser.cc @@ -825,7 +825,7 @@ namespace enb_conf_sections { int parse_cell_cfg(all_args_t* args_, srsran_cell_t* cell) { cell->frame_type = SRSRAN_FDD; - cell->cp = SRSRAN_CP_NORM; + cell->cp = args_->phy.extended_cp ? SRSRAN_CP_EXT : SRSRAN_CP_NORM; cell->nof_ports = args_->enb.nof_ports; cell->nof_prb = args_->enb.n_prb; // PCI not configured yet diff --git a/srsenb/src/main.cc b/srsenb/src/main.cc index dfee4780b..80ba7258d 100644 --- a/srsenb/src/main.cc +++ b/srsenb/src/main.cc @@ -221,6 +221,7 @@ void parse_args(all_args_t* args, int argc, char* argv[]) ("expert.max_mac_ul_kos", bpo::value(&args->general.max_mac_ul_kos)->default_value(100), "Maximum number of consecutive KOs in UL before triggering the UE's release") ("expert.gtpu_tunnel_timeout", bpo::value(&args->stack.gtpu_indirect_tunnel_timeout_msec)->default_value(0), "Maximum time that GTPU takes to release indirect forwarding tunnel since the last received GTPU PDU. (0 for infinity)") ("expert.rlf_release_timer_ms", bpo::value(&args->general.rlf_release_timer_ms)->default_value(4000), "Time taken by eNB to release UE context after it detects an RLF") + ("expert.extended_cp", bpo::value(&args->phy.extended_cp)->default_value(false), "Use extended cyclic prefix") // eMBMS section diff --git a/srsenb/test/phy/enb_phy_test.cc b/srsenb/test/phy/enb_phy_test.cc index 0ee4c226f..8b7862a60 100644 --- a/srsenb/test/phy/enb_phy_test.cc +++ b/srsenb/test/phy/enb_phy_test.cc @@ -1138,6 +1138,7 @@ public: uint32_t tm_u32 = 1; uint32_t period_pcell_rotate = 0; srsran_tm_t tm = SRSRAN_TM1; + bool extended_cp = false; args_t() { cell.nof_prb = 6; @@ -1214,6 +1215,7 @@ public: q.cell = args.cell; q.cell.id = i; q.cell_id = i; + q.cell.cp = args.extended_cp ? SRSRAN_CP_EXT : SRSRAN_CP_NORM; q.dl_freq_hz = 0.0f; ///< Frequencies are irrelevant in this test q.ul_freq_hz = 0.0f; q.root_seq_idx = 25 + i; ///< Different PRACH root sequences @@ -1416,6 +1418,7 @@ int parse_args(int argc, char** argv, phy_test_bench::args_t& args) ("ack_mode", bpo::value(&args.ack_mode), "HARQ ACK/NACK mode: normal, pucch3, cs") ("cell.nof_prb", bpo::value(&args.cell.nof_prb)->default_value(args.cell.nof_prb), "eNb Cell/Carrier bandwidth") ("cell.nof_ports", bpo::value(&args.cell.nof_ports)->default_value(args.cell.nof_ports), "eNb Cell/Carrier number of ports") + ("cell.cp", bpo::value(&args.extended_cp)->default_value(false), "use extended CP") ("tm", bpo::value(&args.tm_u32)->default_value(args.tm_u32), "Transmission mode") ("rotation", bpo::value(&args.period_pcell_rotate), "Serving cells rotation period in ms, set to zero to disable") ; diff --git a/srsue/hdr/phy/search.h b/srsue/hdr/phy/search.h index 26087acf2..77af489cd 100644 --- a/srsue/hdr/phy/search.h +++ b/srsue/hdr/phy/search.h @@ -41,6 +41,7 @@ public: float get_last_cfo(); void set_agc_enable(bool enable); ret_code run(srsran_cell_t* cell, std::array& bch_payload); + void set_cp_en(bool enable); private: search_callback* p = nullptr; diff --git a/srsue/src/main.cc b/srsue/src/main.cc index ab5e43cd7..4d61b1c8e 100644 --- a/srsue/src/main.cc +++ b/srsue/src/main.cc @@ -376,6 +376,10 @@ static int parse_args(all_args_t* args, int argc, char* argv[]) bpo::value(&args->phy.force_ul_amplitude)->default_value(0.0), "Forces the peak amplitude in the PUCCH, PUSCH and SRS (set 0.0 to 1.0, set to 0 or negative for disabling)") + ("phy.detect_cp", + bpo::value(&args->phy.detect_cp)->default_value(false), + "enable CP length detection") + ("phy.in_sync_rsrp_dbm_th", bpo::value(&args->phy.in_sync_rsrp_dbm_th)->default_value(-130.0f), "RSRP threshold (in dBm) above which the UE considers to be in-sync") diff --git a/srsue/src/phy/scell/intra_measure_lte.cc b/srsue/src/phy/scell/intra_measure_lte.cc index 5eb1574ee..a68af2991 100644 --- a/srsue/src/phy/scell/intra_measure_lte.cc +++ b/srsue/src/phy/scell/intra_measure_lte.cc @@ -34,7 +34,7 @@ void intra_measure_lte::init(uint32_t cc_idx, const args_t& args) init_generic(cc_idx, args); // Initialise Reference signal measurement - srsran_refsignal_dl_sync_init(&refsignal_dl_sync); + srsran_refsignal_dl_sync_init(&refsignal_dl_sync, SRSRAN_CP_NORM); // Start scell scell_rx.init(args.len_ms); diff --git a/srsue/src/phy/search.cc b/srsue/src/phy/search.cc index 6f36b49d2..ee35fcadd 100644 --- a/srsue/src/phy/search.cc +++ b/srsue/src/phy/search.cc @@ -67,6 +67,11 @@ void search::init(srsran::rf_buffer_t& buffer_, uint32_t nof_rx_channels, search force_N_id_2 = force_N_id_2_; } +void search::set_cp_en(bool enable) +{ + srsran_set_detect_cp(&cs, enable); +} + void search::reset() { srsran_ue_sync_reset(&ue_mib_sync.ue_sync); @@ -154,11 +159,12 @@ search::ret_code search::run(srsran_cell_t* cell_, std::arrayargs->detect_cp); if (worker_com->args->dl_channel_args.enable) { channel_emulator = @@ -82,7 +83,7 @@ void sync::init(srsran::radio_interface_phy* _radio, // Initialize cell searcher search_p.init(sf_buffer, nof_rf_channels, this, worker_com->args->force_N_id_2); - + search_p.set_cp_en(worker_com->args->detect_cp); // Initialize SFN synchronizer, it uses only pcell buffer sfn_p.init(&ue_sync, worker_com->args, sf_buffer, sf_buffer.size()); diff --git a/srsue/ue.conf.example b/srsue/ue.conf.example index 663b9581f..0b868aaf5 100644 --- a/srsue/ue.conf.example +++ b/srsue/ue.conf.example @@ -367,6 +367,7 @@ enable = false #pdsch_csi_enabled = true #pdsch_8bit_decoder = false #force_ul_amplitude = 0 +#detect_cp = false #in_sync_rsrp_dbm_th = -130.0 #in_sync_snr_db_th = 3.0