SRSUE: review metrics interfaces

master
Xavier Arteaga 4 years ago committed by Xavier Arteaga
parent 044da18db9
commit b5e879db47

@ -91,7 +91,7 @@ public:
void wait_initialize() final;
bool is_initiated();
void get_metrics(const std::string& rat, phy_metrics_t* m) final;
void get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) final;
void srsran_phy_logger(phy_logger_level_t log_level, char* str);
void enable_pregen_signals(bool enable) final;

@ -14,12 +14,12 @@
#define SRSUE_PHY_METRICS_H
#include "srsran/srsran.h"
#include <srsran/adt/circular_array.h>
#include <array>
namespace srsue {
struct info_metrics_t {
typedef srsran::circular_array<info_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
typedef std::array<info_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
uint32_t pci;
uint32_t dl_earfcn;
@ -31,7 +31,7 @@ struct info_metrics_t {
} while (false)
struct sync_metrics_t {
typedef srsran::circular_array<sync_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
typedef std::array<sync_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
float ta_us;
float distance_km;
@ -64,7 +64,7 @@ private:
};
struct ch_metrics_t {
typedef srsran::circular_array<ch_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
typedef std::array<ch_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
float n;
float sinr;
@ -106,7 +106,7 @@ private:
};
struct dl_metrics_t {
typedef srsran::circular_array<dl_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
typedef std::array<dl_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
float fec_iters;
float mcs;
@ -133,7 +133,7 @@ private:
};
struct ul_metrics_t {
typedef srsran::circular_array<ul_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
typedef std::array<ul_metrics_t, SRSRAN_MAX_CARRIERS> array_t;
float mcs;
float power;

@ -40,7 +40,7 @@ public:
virtual void wait_initialize() = 0;
virtual void start_plot() = 0;
virtual void get_metrics(const std::string& rat, phy_metrics_t* m) = 0;
virtual void get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) = 0;
};
} // namespace srsue

@ -38,7 +38,7 @@ public:
virtual void set_earfcn(std::vector<uint32_t> earfcns) = 0;
virtual void get_metrics(const std::string& rat, phy_metrics_t* m) = 0;
virtual void get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) = 0;
};
} // namespace srsue

@ -38,7 +38,7 @@ public:
virtual void wait_initialize() = 0;
virtual void start_plot() = 0;
virtual void get_metrics(const std::string& rat, phy_metrics_t* m) = 0;
virtual void get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) = 0;
};
} // namespace srsue

@ -38,7 +38,7 @@ public:
void stop() override;
void wait_initialize() override;
void get_metrics(const std::string& rat, phy_metrics_t* m) override;
void get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) override;
std::string get_type() override { return "vnf_nr"; };

@ -197,10 +197,10 @@ void metrics_csv::set_metrics(const ue_metrics_t& metrics, const uint32_t period
}
// Metrics for NR carrier
for (uint32_t r = 0; r < metrics.phy.nof_active_cc; r++) {
for (uint32_t r = 0; r < metrics.phy_nr.nof_active_cc; r++) {
set_metrics_helper(metrics.rf,
metrics.sys,
metrics.phy,
metrics.phy_nr,
metrics.stack.mac_nr,
metrics.stack.rrc,
metrics.phy.nof_active_cc + r, // NR carrier offset

@ -184,18 +184,13 @@ void phy::stop()
}
}
void phy::get_metrics(const std::string& rat, phy_metrics_t* m)
void phy::get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m)
{
// Get NR metrics
if (rat == "nr" and args.nof_nr_carriers > 0) {
nr_workers.get_metrics(*m);
return;
}
if (rat != "lte") {
// Zero structure by default
*m = {};
return;
}
// Get LTE metrics
if (rat == srsran::srsran_rat_t::lte && args.nof_lte_carriers > 0) {
uint32_t dl_earfcn = 0;
srsran_cell_t cell = {};
sfsync.get_current_cell(&cell, &dl_earfcn);
@ -212,6 +207,17 @@ void phy::get_metrics(const std::string& rat, phy_metrics_t* m)
common.get_ul_metrics(m->ul);
common.get_sync_metrics(m->sync);
m->nof_active_cc = args.nof_lte_carriers;
return;
}
// Get NR metrics
if (rat == srsran::srsran_rat_t::nr && args.nof_nr_carriers > 0) {
nr_workers.get_metrics(*m);
return;
}
// Add other RAT here
// ...
}
void phy::set_timeadv_rar(uint32_t tti, uint32_t ta_cmd)

@ -61,7 +61,7 @@ void vnf_phy_nr::start_plot() {}
void vnf_phy_nr::wait_initialize() {}
void vnf_phy_nr::get_metrics(const std::string& rat, phy_metrics_t* m) {}
void vnf_phy_nr::get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) {}
int vnf_phy_nr::tx_request(const tx_request_t& request)
{

@ -330,8 +330,8 @@ void ue::start_plot()
bool ue::get_metrics(ue_metrics_t* m)
{
bzero(m, sizeof(ue_metrics_t));
phy->get_metrics("lte", &m->phy);
phy->get_metrics("nr", &m->phy_nr);
phy->get_metrics(srsran::srsran_rat_t::lte, &m->phy);
phy->get_metrics(srsran::srsran_rat_t::nr, &m->phy_nr);
radio->get_metrics(&m->rf);
stack->get_metrics(&m->stack);
gw_inst->get_metrics(m->gw, m->stack.mac[0].nof_tti);

@ -48,7 +48,7 @@ public:
void stop() override;
void wait_initialize() override;
void start_plot() override;
void get_metrics(const std::string& rat, phy_metrics_t* m) override;
void get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) override;
std::string get_type() override;
// The interface for the SS

@ -50,7 +50,7 @@ void lte_ttcn3_phy::wait_initialize() {}
void lte_ttcn3_phy::start_plot() {}
void lte_ttcn3_phy::get_metrics(const std::string& rat, phy_metrics_t* m) {}
void lte_ttcn3_phy::get_metrics(const srsran::srsran_rat_t& rat, phy_metrics_t* m) {}
// The interface for the SS
void lte_ttcn3_phy::set_cell_map(const cell_list_t& cells_)

Loading…
Cancel
Save