2020-11-26 01:25:22 -08:00
|
|
|
/**
|
2017-06-02 03:46:06 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* \section COPYRIGHT
|
2017-06-02 03:46:06 -07:00
|
|
|
*
|
2021-03-19 03:45:56 -07:00
|
|
|
* Copyright 2013-2021 Software Radio Systems Limited
|
2017-06-02 03:46:06 -07:00
|
|
|
*
|
2020-11-26 01:25:22 -08:00
|
|
|
* By using this file, you agree to the terms and conditions set
|
|
|
|
* forth in the LICENSE file which can be found at the top level of
|
|
|
|
* the distribution.
|
2017-06-02 03:46:06 -07:00
|
|
|
*
|
|
|
|
*/
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#ifndef SRSENB_PHY_H
|
|
|
|
#define SRSENB_PHY_H
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2020-11-18 03:16:43 -08:00
|
|
|
#include "lte/sf_worker.h"
|
2021-01-28 03:17:18 -08:00
|
|
|
#include "phy_common.h"
|
2019-07-05 12:31:49 -07:00
|
|
|
#include "srsenb/hdr/phy/enb_phy_base.h"
|
2021-03-19 03:45:56 -07:00
|
|
|
#include "srsran/common/trace.h"
|
|
|
|
#include "srsran/interfaces/enb_metrics_interface.h"
|
|
|
|
#include "srsran/interfaces/radio_interfaces.h"
|
|
|
|
#include "srsran/radio/radio.h"
|
|
|
|
#include "srsran/srslog/srslog.h"
|
2019-01-17 03:42:01 -08:00
|
|
|
#include "txrx.h"
|
2017-06-01 03:25:57 -07:00
|
|
|
|
|
|
|
namespace srsenb {
|
2019-12-05 08:15:15 -08:00
|
|
|
|
2021-07-21 09:45:04 -07:00
|
|
|
class phy final : public enb_phy_base,
|
|
|
|
public phy_interface_stack_lte,
|
|
|
|
public phy_interface_stack_nr,
|
|
|
|
public srsran::phy_interface_radio
|
2017-06-01 03:25:57 -07:00
|
|
|
{
|
|
|
|
public:
|
2021-01-28 03:17:18 -08:00
|
|
|
phy(srslog::sink& log_sink);
|
2019-07-05 07:47:39 -07:00
|
|
|
~phy();
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2019-07-05 07:47:39 -07:00
|
|
|
int init(const phy_args_t& args,
|
|
|
|
const phy_cfg_t& cfg,
|
2021-03-19 03:45:56 -07:00
|
|
|
srsran::radio_interface_phy* radio_,
|
2019-07-05 07:47:39 -07:00
|
|
|
stack_interface_phy_lte* stack_);
|
2021-07-28 05:41:00 -07:00
|
|
|
int init(const phy_args_t& args,
|
|
|
|
const phy_cfg_t& cfg,
|
|
|
|
srsran::radio_interface_phy* radio_,
|
|
|
|
stack_interface_phy_lte* stack_lte_,
|
|
|
|
stack_interface_phy_nr& stack_nr_);
|
2020-02-23 09:05:55 -08:00
|
|
|
void stop() override;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
std::string get_type() override { return "lte"; };
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2017-06-01 03:25:57 -07:00
|
|
|
/* MAC->PHY interface */
|
2019-10-17 07:44:45 -07:00
|
|
|
void rem_rnti(uint16_t rnti) final;
|
|
|
|
void set_mch_period_stop(uint32_t stop) final;
|
2020-03-11 09:15:25 -07:00
|
|
|
void set_activation_deactivation_scell(uint16_t rnti,
|
2021-03-19 03:45:56 -07:00
|
|
|
const std::array<bool, SRSRAN_MAX_CARRIERS>& activation) override;
|
2019-04-23 01:53:11 -07:00
|
|
|
|
2018-05-15 08:01:51 -07:00
|
|
|
/*RRC-PHY interface*/
|
2021-03-19 03:45:56 -07:00
|
|
|
void configure_mbsfn(srsran::sib2_mbms_t* sib2, srsran::sib13_t* sib13, const srsran::mcch_msg_t& mcch) override;
|
2017-06-01 03:25:57 -07:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
void start_plot() override;
|
2020-06-10 08:17:51 -07:00
|
|
|
void set_config(uint16_t rnti, const phy_rrc_cfg_list_t& phy_cfg_list) override;
|
|
|
|
void complete_config(uint16_t rnti) override;
|
2019-01-17 03:42:01 -08:00
|
|
|
|
2020-11-19 05:40:40 -08:00
|
|
|
void get_metrics(std::vector<phy_metrics_t>& metrics) override;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-10-22 07:13:32 -07:00
|
|
|
void cmd_cell_gain(uint32_t cell_id, float gain_db) override;
|
2020-08-25 09:07:56 -07:00
|
|
|
|
2020-02-23 09:05:55 -08:00
|
|
|
void radio_overflow() override{};
|
|
|
|
void radio_failure() override{};
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
void srsran_phy_logger(phy_logger_level_t log_level, char* str);
|
2020-11-18 03:16:43 -08:00
|
|
|
|
2021-07-29 09:09:39 -07:00
|
|
|
int init_nr(const phy_args_t& args, const phy_cfg_t& cfg, stack_interface_phy_nr& stack);
|
2021-07-21 09:45:04 -07:00
|
|
|
int set_common_cfg(const common_cfg_t& common_cfg) override;
|
|
|
|
|
2017-06-01 03:25:57 -07:00
|
|
|
private:
|
2021-03-19 03:45:56 -07:00
|
|
|
srsran::phy_cfg_mbsfn_t mbsfn_config = {};
|
2021-01-28 03:17:18 -08:00
|
|
|
uint32_t nof_workers = 0;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-02-26 11:25:49 -08:00
|
|
|
const static int MAX_WORKERS = 4;
|
2019-12-16 07:04:22 -08:00
|
|
|
|
2020-07-01 08:30:34 -07:00
|
|
|
const static int PRACH_WORKER_THREAD_PRIO = 5;
|
2019-12-16 07:04:22 -08:00
|
|
|
const static int SF_RECV_THREAD_PRIO = 1;
|
|
|
|
const static int WORKERS_THREAD_PRIO = 2;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
srsran::radio_interface_phy* radio = nullptr;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2021-01-28 03:17:18 -08:00
|
|
|
srslog::sink& log_sink;
|
|
|
|
srslog::basic_logger& phy_log;
|
|
|
|
srslog::basic_logger& phy_lib_log;
|
2020-11-18 03:16:43 -08:00
|
|
|
|
2021-06-20 22:59:57 -07:00
|
|
|
lte::worker_pool lte_workers;
|
|
|
|
std::unique_ptr<nr::worker_pool> nr_workers;
|
|
|
|
phy_common workers_common;
|
|
|
|
prach_worker_pool prach;
|
|
|
|
txrx tx_rx;
|
2019-07-05 07:47:39 -07:00
|
|
|
|
|
|
|
bool initialized = false;
|
|
|
|
|
2021-03-19 03:45:56 -07:00
|
|
|
srsran_prach_cfg_t prach_cfg = {};
|
2019-07-05 07:47:39 -07:00
|
|
|
|
2020-03-02 08:51:00 -08:00
|
|
|
void parse_common_config(const phy_cfg_t& cfg);
|
2017-06-01 03:25:57 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace srsenb
|
|
|
|
|
2018-03-31 10:04:04 -07:00
|
|
|
#endif // SRSENB_PHY_H
|