From 9c108611282d03821566773c2309fac0b3a3d925 Mon Sep 17 00:00:00 2001 From: ismagom Date: Wed, 22 Apr 2015 14:34:01 +0100 Subject: [PATCH] Separated params class into abstract params_db and phy_params classes --- srslte/include/srslte/ue_itf/dl_buffer.h | 6 +- srslte/include/srslte/ue_itf/params_db.h | 52 ++++++++++++++ srslte/include/srslte/ue_itf/phy.h | 6 +- .../srslte/ue_itf/{params.h => phy_params.h} | 23 +++--- srslte/include/srslte/ue_itf/prach.h | 6 +- srslte/include/srslte/ue_itf/ul_buffer.h | 6 +- srslte/lib/ue_itf/src/dl_buffer.cc | 6 +- srslte/lib/ue_itf/src/params_db.cc | 71 +++++++++++++++++++ srslte/lib/ue_itf/src/phy.cc | 18 ++--- .../ue_itf/src/{params.cc => phy_params.cc} | 14 ++-- srslte/lib/ue_itf/src/prach.cc | 16 ++--- srslte/lib/ue_itf/src/ul_buffer.cc | 48 ++++++------- srslte/lib/ue_itf/test/ue_itf_test_prach.cc | 32 ++++----- 13 files changed, 216 insertions(+), 88 deletions(-) create mode 100644 srslte/include/srslte/ue_itf/params_db.h rename srslte/include/srslte/ue_itf/{params.h => phy_params.h} (90%) create mode 100644 srslte/lib/ue_itf/src/params_db.cc rename srslte/lib/ue_itf/src/{params.cc => phy_params.cc} (84%) diff --git a/srslte/include/srslte/ue_itf/dl_buffer.h b/srslte/include/srslte/ue_itf/dl_buffer.h index ef95ab298..f4231fb96 100644 --- a/srslte/include/srslte/ue_itf/dl_buffer.h +++ b/srslte/include/srslte/ue_itf/dl_buffer.h @@ -28,7 +28,7 @@ #include "srslte/srslte.h" #include "srslte/ue_itf/queue.h" #include "srslte/ue_itf/sched_grant.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" #ifndef UEDLBUFFER_H #define UEDLBUFFER_H @@ -61,7 +61,7 @@ namespace ue { int buffer_id; - bool init_cell(srslte_cell_t cell, params *params_db); + bool init_cell(srslte_cell_t cell, phy_params *params_db); void free_cell(); bool recv_ue_sync(srslte_ue_sync_t *ue_sync, srslte_timestamp_t *rx_time); bool get_ul_grant(pdcch_ul_search_t mode, sched_grant *grant); @@ -69,7 +69,7 @@ namespace ue { bool decode_ack(srslte::ue::sched_grant pusch_grant); bool decode_data(sched_grant pdsch_grant, uint8_t *payload); // returns true or false for CRC OK/KO private: - params *params_db; + phy_params *params_db; srslte_cell_t cell; srslte_ue_dl_t ue_dl; srslte_phich_t phich; diff --git a/srslte/include/srslte/ue_itf/params_db.h b/srslte/include/srslte/ue_itf/params_db.h new file mode 100644 index 000000000..537604f9a --- /dev/null +++ b/srslte/include/srslte/ue_itf/params_db.h @@ -0,0 +1,52 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2014 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * A copy of the GNU Lesser General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include "srslte/srslte.h" + +#ifndef PARAMS_H +#define PARAMS_H + +namespace srslte { +namespace ue { + class SRSLTE_API params_db + { + public: + params_db(); + ~params_db(); + void init_db(uint32_t nof_params); + void free_db(); + void set_param(uint32_t param_idx, int64_t value); + int64_t get_param(uint32_t param_idx); + + private: + uint32_t nof_params; + int64_t *db; + }; +} +} + +#endif \ No newline at end of file diff --git a/srslte/include/srslte/ue_itf/phy.h b/srslte/include/srslte/ue_itf/phy.h index 32352b729..84fe4a32d 100644 --- a/srslte/include/srslte/ue_itf/phy.h +++ b/srslte/include/srslte/ue_itf/phy.h @@ -30,7 +30,7 @@ #include "srslte/ue_itf/dl_buffer.h" #include "srslte/ue_itf/ul_buffer.h" #include "srslte/ue_itf/prach.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" #include "srslte/ue_itf/sched_grant.h" #include "srslte/ue_itf/queue.h" #include "srslte/common/radio.h" @@ -93,7 +93,7 @@ public: bool status_is_idle(); bool status_is_rxtx(); - void set_param(params::param_t param, int64_t value); + void set_param(phy_params::phy_param_t param, int64_t value); uint32_t get_current_tti(); static uint32_t tti_to_SFN(uint32_t tti); @@ -123,7 +123,7 @@ private: queue *ul_buffer_queue; queue *dl_buffer_queue; prach prach_buffer; - params params_db; + phy_params params_db; pthread_t phy_thread; float time_adv_sec; diff --git a/srslte/include/srslte/ue_itf/params.h b/srslte/include/srslte/ue_itf/phy_params.h similarity index 90% rename from srslte/include/srslte/ue_itf/params.h rename to srslte/include/srslte/ue_itf/phy_params.h index 61fd02586..d9646f67e 100644 --- a/srslte/include/srslte/ue_itf/params.h +++ b/srslte/include/srslte/ue_itf/phy_params.h @@ -26,15 +26,23 @@ */ #include "srslte/srslte.h" +#include "srslte/ue_itf/params_db.h" + +#ifndef PHYPARAMS_H +#define PHYPARAMS_H -#ifndef UEH -#define UEH namespace srslte { namespace ue { - class SRSLTE_API params + + class SRSLTE_API phy_params : public params_db { public: + + phy_params(); + ~phy_params(); + + typedef enum { DL_FREQ = 0, @@ -77,15 +85,10 @@ namespace ue { PRACH_FREQ_OFFSET, NOF_PARAMS, - } param_t; - - void set_param(param_t param, int64_t value); - int64_t get_param(param_t param); + } phy_param_t; - private: - int64_t params_db[NOF_PARAMS]; }; } } -#endif \ No newline at end of file +#endif diff --git a/srslte/include/srslte/ue_itf/prach.h b/srslte/include/srslte/ue_itf/prach.h index b05055452..895de037b 100644 --- a/srslte/include/srslte/ue_itf/prach.h +++ b/srslte/include/srslte/ue_itf/prach.h @@ -28,7 +28,7 @@ #include "srslte/srslte.h" #include "srslte/common/radio.h" #include "srslte/ue_itf/queue.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" #ifndef UEPRACH_H #define UEPRACH_H @@ -38,7 +38,7 @@ namespace ue { class SRSLTE_API prach { public: - bool init_cell(srslte_cell_t cell, params *params_db); + bool init_cell(srslte_cell_t cell, phy_params *params_db); void free_cell(); bool prepare_to_send(uint32_t preamble_idx); bool is_ready_to_send(uint32_t current_tti); @@ -46,7 +46,7 @@ namespace ue { bool send(srslte::radio* radio_handler, float cfo, srslte_timestamp_t rx_time); private: static const uint32_t tx_advance_sf = 1; // Number of subframes to advance transmission - params *params_db = NULL; + phy_params *params_db = NULL; int preamble_idx; bool initiated = false; uint32_t len; diff --git a/srslte/include/srslte/ue_itf/ul_buffer.h b/srslte/include/srslte/ue_itf/ul_buffer.h index 74fdc6a2a..17d8c2672 100644 --- a/srslte/include/srslte/ue_itf/ul_buffer.h +++ b/srslte/include/srslte/ue_itf/ul_buffer.h @@ -29,7 +29,7 @@ #include "srslte/common/radio.h" #include "srslte/ue_itf/queue.h" #include "srslte/ue_itf/sched_grant.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" #ifndef UEULBUFFER_H #define UEULBUFFER_H @@ -44,7 +44,7 @@ namespace ue { class SRSLTE_API ul_buffer : public queue::element { public: - bool init_cell(srslte_cell_t cell, params *params_db); + bool init_cell(srslte_cell_t cell, phy_params *params_db); void free_cell(); void set_tti(uint32_t tti); void set_current_tx_nb(uint32_t current_tx_nb); @@ -59,7 +59,7 @@ namespace ue { static const uint32_t tx_advance_sf = 1; // Number of subframes to advance transmission private: - params *params_db; + phy_params *params_db; srslte_cell_t cell; srslte_ue_ul_t ue_ul; bool cell_initiated; diff --git a/srslte/lib/ue_itf/src/dl_buffer.cc b/srslte/lib/ue_itf/src/dl_buffer.cc index f3155a6e0..a57f2275b 100644 --- a/srslte/lib/ue_itf/src/dl_buffer.cc +++ b/srslte/lib/ue_itf/src/dl_buffer.cc @@ -33,13 +33,13 @@ #include "srslte/ue_itf/sched_grant.h" #include "srslte/ue_itf/dl_buffer.h" #include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" namespace srslte { namespace ue { -bool dl_buffer::init_cell(srslte_cell_t cell_, params *params_db_) +bool dl_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_) { params_db = params_db_; cell = cell_; @@ -103,7 +103,7 @@ bool dl_buffer::get_ul_grant(pdcch_ul_search_t mode, sched_grant *grant) } if (srslte_dci_msg_to_ra_ul(&dci_msg, cell.nof_prb, - params_db->get_param(params::PUSCH_HOPPING_OFFSET), + params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET), (srslte_ra_pusch_t*) grant->get_grant_ptr())) { return false; diff --git a/srslte/lib/ue_itf/src/params_db.cc b/srslte/lib/ue_itf/src/params_db.cc new file mode 100644 index 000000000..a0bb92326 --- /dev/null +++ b/srslte/lib/ue_itf/src/params_db.cc @@ -0,0 +1,71 @@ +/** + * + * \section COPYRIGHT + * + * Copyright 2013-2014 The srsLTE Developers. See the + * COPYRIGHT file at the top-level directory of this distribution. + * + * \section LICENSE + * + * This file is part of the srsLTE library. + * + * srsLTE is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * srsLTE is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * A copy of the GNU Lesser General Public License can be found in + * the LICENSE file in the top-level directory of this distribution + * and at http://www.gnu.org/licenses/. + * + */ + +#include +#include +#include +#include "srslte/srslte.h" + +#include "srslte/ue_itf/params_db.h" + +namespace srslte { + namespace ue { + + params_db::params_db() { + db = NULL; + } + + params_db::~params_db() + { + if (db) { + free(db); + } + } + + void params_db::init_db(uint32_t nof_params_) + { + nof_params = nof_params_; + db = (int64_t*) malloc(sizeof(int64_t)*nof_params); + } + + void params_db::set_param(uint32_t param_idx, int64_t value) + { + if (param_idx < nof_params) { + db[param_idx] = value; + } + } + + int64_t params_db::get_param(uint32_t param_idx) + { + if (param_idx < nof_params) { + return db[param_idx]; + } else { + return -1; + } + } + } +} diff --git a/srslte/lib/ue_itf/src/phy.cc b/srslte/lib/ue_itf/src/phy.cc index e0983f791..6c564dfb8 100644 --- a/srslte/lib/ue_itf/src/phy.cc +++ b/srslte/lib/ue_itf/src/phy.cc @@ -49,9 +49,9 @@ bool phy::init(srslte::radio* radio_handler_, srslte::ue::tti_sync* ttisync_) dl_buffer_queue = new queue(6, sizeof(dl_buffer)); // Set default params - params_db.set_param(params::CELLSEARCH_TIMEOUT_PSS_NFRAMES, 100); - params_db.set_param(params::CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD, 160); - params_db.set_param(params::CELLSEARCH_TIMEOUT_MIB_NFRAMES, 100); + params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_PSS_NFRAMES, 100); + params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD, 160); + params_db.set_param(phy_params::CELLSEARCH_TIMEOUT_MIB_NFRAMES, 100); pthread_attr_t attr; struct sched_param param; @@ -104,7 +104,7 @@ void phy::set_timeadv(uint32_t ta_cmd) { void phy::rar_ul_grant(uint32_t rba, uint32_t trunc_mcs, bool hopping_flag, sched_grant *grant) { - uint32_t n_ho = params_db.get_param(params::PUSCH_HOPPING_OFFSET); + uint32_t n_ho = params_db.get_param(phy_params::PUSCH_HOPPING_OFFSET); srslte_ra_pusch_t *ra_pusch = (srslte_ra_pusch_t*) grant->get_grant_ptr(); srslte_dci_rar_to_ra_ul(rba, trunc_mcs, hopping_flag, cell.nof_prb, ra_pusch); srslte_ra_ul_alloc(&ra_pusch->prb_alloc, ra_pusch, n_ho, cell.nof_prb); @@ -113,8 +113,8 @@ void phy::rar_ul_grant(uint32_t rba, uint32_t trunc_mcs, bool hopping_flag, sche } } -void phy::set_param(params::param_t param, int64_t value) { - params_db.set_param(param, value); +void phy::set_param(phy_params::phy_param_t param, int64_t value) { + params_db.set_param((uint32_t) param, value); } @@ -270,9 +270,9 @@ bool phy::decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell_ptr, uint8_t b return false; } - srslte_ue_cellsearch_set_nof_frames_to_scan(&cs, params_db.get_param(params::CELLSEARCH_TIMEOUT_PSS_NFRAMES)); + srslte_ue_cellsearch_set_nof_frames_to_scan(&cs, params_db.get_param(phy_params::CELLSEARCH_TIMEOUT_PSS_NFRAMES)); srslte_ue_cellsearch_set_threshold(&cs, (float) - params_db.get_param(params::CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD)/10); + params_db.get_param(phy_params::CELLSEARCH_TIMEOUT_PSS_CORRELATION_THRESHOLD)/10); radio_handler->set_rx_srate(1920000.0); radio_handler->start_rx(); @@ -315,7 +315,7 @@ bool phy::decode_mib_N_id_2(int force_N_id_2, srslte_cell_t *cell_ptr, uint8_t b uint32_t sfn, sfn_offset; radio_handler->start_rx(); - ret = srslte_ue_mib_sync_decode(&ue_mib_sync, params_db.get_param(params::CELLSEARCH_TIMEOUT_MIB_NFRAMES), + ret = srslte_ue_mib_sync_decode(&ue_mib_sync, params_db.get_param(phy_params::CELLSEARCH_TIMEOUT_MIB_NFRAMES), bch_payload, &cell_ptr->nof_ports, &sfn_offset); radio_handler->stop_rx(); srslte_ue_mib_sync_free(&ue_mib_sync); diff --git a/srslte/lib/ue_itf/src/params.cc b/srslte/lib/ue_itf/src/phy_params.cc similarity index 84% rename from srslte/lib/ue_itf/src/params.cc rename to srslte/lib/ue_itf/src/phy_params.cc index 6fb7cb663..d7ebd9088 100644 --- a/srslte/lib/ue_itf/src/params.cc +++ b/srslte/lib/ue_itf/src/phy_params.cc @@ -30,18 +30,20 @@ #include #include "srslte/srslte.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/params_db.h" +#include "srslte/ue_itf/phy_params.h" namespace srslte { namespace ue { - - void params::set_param(param_t param, int64_t value) + + phy_params::phy_params() { - params_db[param] = value; + init_db(NOF_PARAMS); } - int64_t params::get_param(param_t param) + + phy_params::~phy_params() { - return params_db[param]; } + } } diff --git a/srslte/lib/ue_itf/src/prach.cc b/srslte/lib/ue_itf/src/prach.cc index bd101ea1b..9af219e2c 100644 --- a/srslte/lib/ue_itf/src/prach.cc +++ b/srslte/lib/ue_itf/src/prach.cc @@ -33,7 +33,7 @@ #include "srslte/cuhd/cuhd.h" #include "srslte/ue_itf/prach.h" #include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" namespace srslte { namespace ue { @@ -55,16 +55,16 @@ void prach::free_cell() } } -bool prach::init_cell(srslte_cell_t cell_, params *params_db_) +bool prach::init_cell(srslte_cell_t cell_, phy_params *params_db_) { cell = cell_; params_db = params_db_; preamble_idx = -1; if (srslte_prach_init(&prach, srslte_symbol_sz(cell.nof_prb), - srslte_prach_get_preamble_format(params_db->get_param(params::PRACH_CONFIG_INDEX)), - params_db->get_param(params::PRACH_ROOT_SEQ_IDX), - params_db->get_param(params::PRACH_HIGH_SPEED_FLAG)?true:false, - params_db->get_param(params::PRACH_ZC_CONFIG))) { + srslte_prach_get_preamble_format(params_db->get_param(phy_params::PRACH_CONFIG_INDEX)), + params_db->get_param(phy_params::PRACH_ROOT_SEQ_IDX), + params_db->get_param(phy_params::PRACH_HIGH_SPEED_FLAG)?true:false, + params_db->get_param(phy_params::PRACH_ZC_CONFIG))) { return false; } @@ -74,7 +74,7 @@ bool prach::init_cell(srslte_cell_t cell_, params *params_db_) if(!buffer[i]) { return false; } - if(srslte_prach_gen(&prach, i, params_db->get_param(params::PRACH_FREQ_OFFSET), buffer[i])){ + if(srslte_prach_gen(&prach, i, params_db->get_param(phy_params::PRACH_FREQ_OFFSET), buffer[i])){ return false; } } @@ -103,7 +103,7 @@ bool prach::is_ready_to_send(uint32_t current_tti_) { uint32_t current_tti = (current_tti_ + tx_advance_sf)%10240; // Get SFN and sf_idx from the PRACH configuration index - uint32_t config_idx = (uint32_t) params_db->get_param(params::PRACH_CONFIG_INDEX); + uint32_t config_idx = (uint32_t) params_db->get_param(phy_params::PRACH_CONFIG_INDEX); srslte_prach_sfn_t prach_sfn = srslte_prach_get_sfn(config_idx); if (prach_sfn == SRSLTE_PRACH_SFN_EVEN && ((current_tti/10)%2)==0 || diff --git a/srslte/lib/ue_itf/src/ul_buffer.cc b/srslte/lib/ue_itf/src/ul_buffer.cc index 8de147651..da8ceac9e 100644 --- a/srslte/lib/ue_itf/src/ul_buffer.cc +++ b/srslte/lib/ue_itf/src/ul_buffer.cc @@ -33,12 +33,12 @@ #include "srslte/ue_itf/sched_grant.h" #include "srslte/ue_itf/ul_buffer.h" #include "srslte/ue_itf/phy.h" -#include "srslte/ue_itf/params.h" +#include "srslte/ue_itf/phy_params.h" namespace srslte { namespace ue { -bool ul_buffer::init_cell(srslte_cell_t cell_, params *params_db_) { +bool ul_buffer::init_cell(srslte_cell_t cell_, phy_params *params_db_) { cell = cell_; params_db = params_db_; current_tx_nb = 0; @@ -102,45 +102,45 @@ bool ul_buffer::generate_data(sched_grant pusch_grant, srslte_refsignal_dmrs_pusch_cfg_t dmrs_cfg; bzero(&dmrs_cfg, sizeof(srslte_refsignal_dmrs_pusch_cfg_t)); - dmrs_cfg.beta_pusch = (float) params_db->get_param(params::PUSCH_BETA)/10; - dmrs_cfg.group_hopping_en = params_db->get_param(params::PUSCH_RS_GROUP_HOPPING_EN); - dmrs_cfg.sequence_hopping_en = params_db->get_param(params::PUSCH_RS_SEQUENCE_HOPPING_EN); - dmrs_cfg.cyclic_shift = params_db->get_param(params::PUSCH_RS_CYCLIC_SHIFT); - dmrs_cfg.delta_ss = params_db->get_param(params::PUSCH_RS_GROUP_ASSIGNMENT); + dmrs_cfg.beta_pusch = (float) params_db->get_param(phy_params::PUSCH_BETA)/10; + dmrs_cfg.group_hopping_en = params_db->get_param(phy_params::PUSCH_RS_GROUP_HOPPING_EN); + dmrs_cfg.sequence_hopping_en = params_db->get_param(phy_params::PUSCH_RS_SEQUENCE_HOPPING_EN); + dmrs_cfg.cyclic_shift = params_db->get_param(phy_params::PUSCH_RS_CYCLIC_SHIFT); + dmrs_cfg.delta_ss = params_db->get_param(phy_params::PUSCH_RS_GROUP_ASSIGNMENT); srslte_pusch_hopping_cfg_t pusch_hopping; bzero(&pusch_hopping, sizeof(srslte_pusch_hopping_cfg_t)); - pusch_hopping.n_sb = params_db->get_param(params::PUSCH_HOPPING_N_SB); - pusch_hopping.hop_mode = params_db->get_param(params::PUSCH_HOPPING_INTRA_SF) ? + pusch_hopping.n_sb = params_db->get_param(phy_params::PUSCH_HOPPING_N_SB); + pusch_hopping.hop_mode = params_db->get_param(phy_params::PUSCH_HOPPING_INTRA_SF) ? pusch_hopping.SRSLTE_PUSCH_HOP_MODE_INTRA_SF : pusch_hopping.SRSLTE_PUSCH_HOP_MODE_INTER_SF; - pusch_hopping.hopping_offset = params_db->get_param(params::PUSCH_HOPPING_OFFSET); + pusch_hopping.hopping_offset = params_db->get_param(phy_params::PUSCH_HOPPING_OFFSET); pusch_hopping.current_tx_nb = pusch_grant.get_current_tx_nb(); srslte_pucch_cfg_t pucch_cfg; bzero(&pucch_cfg, sizeof(srslte_pucch_cfg_t)); - pucch_cfg.beta_pucch = (float) params_db->get_param(params::PUCCH_BETA)/10; - pucch_cfg.delta_pucch_shift = params_db->get_param(params::PUCCH_DELTA_SHIFT); + pucch_cfg.beta_pucch = (float) params_db->get_param(phy_params::PUCCH_BETA)/10; + pucch_cfg.delta_pucch_shift = params_db->get_param(phy_params::PUCCH_DELTA_SHIFT); pucch_cfg.group_hopping_en = dmrs_cfg.group_hopping_en; - pucch_cfg.N_cs = params_db->get_param(params::PUCCH_CYCLIC_SHIFT); - pucch_cfg.n_rb_2 = params_db->get_param(params::PUCCH_N_RB_2); + pucch_cfg.N_cs = params_db->get_param(phy_params::PUCCH_CYCLIC_SHIFT); + pucch_cfg.n_rb_2 = params_db->get_param(phy_params::PUCCH_N_RB_2); srslte_pucch_sched_t pucch_sched; bzero(&pucch_sched, sizeof(srslte_pucch_sched_t)); pucch_sched.n_cce = last_n_cce; - pucch_sched.n_pucch_1[0] = params_db->get_param(params::PUCCH_N_PUCCH_1_0); - pucch_sched.n_pucch_1[1] = params_db->get_param(params::PUCCH_N_PUCCH_1_1); - pucch_sched.n_pucch_1[2] = params_db->get_param(params::PUCCH_N_PUCCH_1_2); - pucch_sched.n_pucch_1[3] = params_db->get_param(params::PUCCH_N_PUCCH_1_3); - pucch_sched.N_pucch_1 = params_db->get_param(params::PUCCH_N_PUCCH_1); - pucch_sched.n_pucch_2 = params_db->get_param(params::PUCCH_N_PUCCH_2); - pucch_sched.n_pucch_sr = params_db->get_param(params::PUCCH_N_PUCCH_SR); + pucch_sched.n_pucch_1[0] = params_db->get_param(phy_params::PUCCH_N_PUCCH_1_0); + pucch_sched.n_pucch_1[1] = params_db->get_param(phy_params::PUCCH_N_PUCCH_1_1); + pucch_sched.n_pucch_1[2] = params_db->get_param(phy_params::PUCCH_N_PUCCH_1_2); + pucch_sched.n_pucch_1[3] = params_db->get_param(phy_params::PUCCH_N_PUCCH_1_3); + pucch_sched.N_pucch_1 = params_db->get_param(phy_params::PUCCH_N_PUCCH_1); + pucch_sched.n_pucch_2 = params_db->get_param(phy_params::PUCCH_N_PUCCH_2); + pucch_sched.n_pucch_sr = params_db->get_param(phy_params::PUCCH_N_PUCCH_SR); srslte_ue_ul_set_cfg(&ue_ul, &dmrs_cfg, &pusch_hopping, &pucch_cfg, &pucch_sched); - uci_data.I_offset_ack = params_db->get_param(params::UCI_I_OFFSET_ACK); - uci_data.I_offset_cqi = params_db->get_param(params::UCI_I_OFFSET_CQI); - uci_data.I_offset_ri = params_db->get_param(params::UCI_I_OFFSET_RI); + uci_data.I_offset_ack = params_db->get_param(phy_params::UCI_I_OFFSET_ACK); + uci_data.I_offset_cqi = params_db->get_param(phy_params::UCI_I_OFFSET_CQI); + uci_data.I_offset_ri = params_db->get_param(phy_params::UCI_I_OFFSET_RI); int n = 0; // Transmit on PUSCH if UL grant available, otherwise in PUCCH diff --git a/srslte/lib/ue_itf/test/ue_itf_test_prach.cc b/srslte/lib/ue_itf/test/ue_itf_test_prach.cc index 297a2e189..937bce218 100644 --- a/srslte/lib/ue_itf/test/ue_itf_test_prach.cc +++ b/srslte/lib/ue_itf/test/ue_itf_test_prach.cc @@ -204,23 +204,23 @@ uint32_t nof_rtx_connsetup = 0; uint32_t rv_value[4] = {0, 2, 3, 1}; void config_phy() { - phy.set_param(srslte::ue::params::PRACH_CONFIG_INDEX, 0); - phy.set_param(srslte::ue::params::PRACH_FREQ_OFFSET, 0); - phy.set_param(srslte::ue::params::PRACH_HIGH_SPEED_FLAG, 0); - phy.set_param(srslte::ue::params::PRACH_ROOT_SEQ_IDX, 0); - phy.set_param(srslte::ue::params::PRACH_ZC_CONFIG, 1); - - phy.set_param(srslte::ue::params::PUSCH_BETA, 10); - phy.set_param(srslte::ue::params::PUSCH_RS_GROUP_HOPPING_EN, 0); - phy.set_param(srslte::ue::params::PUSCH_RS_SEQUENCE_HOPPING_EN, 0); - phy.set_param(srslte::ue::params::PUSCH_RS_CYCLIC_SHIFT, 0); - phy.set_param(srslte::ue::params::PUSCH_HOPPING_OFFSET, 0); + phy.set_param(srslte::ue::phy_params::PRACH_CONFIG_INDEX, 0); + phy.set_param(srslte::ue::phy_params::PRACH_FREQ_OFFSET, 0); + phy.set_param(srslte::ue::phy_params::PRACH_HIGH_SPEED_FLAG, 0); + phy.set_param(srslte::ue::phy_params::PRACH_ROOT_SEQ_IDX, 0); + phy.set_param(srslte::ue::phy_params::PRACH_ZC_CONFIG, 1); + + phy.set_param(srslte::ue::phy_params::PUSCH_BETA, 10); + phy.set_param(srslte::ue::phy_params::PUSCH_RS_GROUP_HOPPING_EN, 0); + phy.set_param(srslte::ue::phy_params::PUSCH_RS_SEQUENCE_HOPPING_EN, 0); + phy.set_param(srslte::ue::phy_params::PUSCH_RS_CYCLIC_SHIFT, 0); + phy.set_param(srslte::ue::phy_params::PUSCH_HOPPING_OFFSET, 0); - phy.set_param(srslte::ue::params::PUCCH_BETA, 10); - phy.set_param(srslte::ue::params::PUCCH_DELTA_SHIFT, 1); - phy.set_param(srslte::ue::params::PUCCH_CYCLIC_SHIFT, 0); - phy.set_param(srslte::ue::params::PUCCH_N_PUCCH_1, 0); - phy.set_param(srslte::ue::params::PUCCH_N_RB_2, 2); + phy.set_param(srslte::ue::phy_params::PUCCH_BETA, 10); + phy.set_param(srslte::ue::phy_params::PUCCH_DELTA_SHIFT, 1); + phy.set_param(srslte::ue::phy_params::PUCCH_CYCLIC_SHIFT, 0); + phy.set_param(srslte::ue::phy_params::PUCCH_N_PUCCH_1, 0); + phy.set_param(srslte::ue::phy_params::PUCCH_N_RB_2, 2); }