SRSENB: UE PHY dedicated takes a flat configuration structure

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent 86a62c3584
commit 40772eae19

@ -29,9 +29,9 @@
namespace srslte { namespace srslte {
typedef struct { typedef struct {
std::string phy_level; std::string phy_level = "none";
std::string phy_lib_level; std::string phy_lib_level = "none";
int phy_hex_limit; int phy_hex_limit = -1;
} phy_log_args_t; } phy_log_args_t;
// RF/radio args // RF/radio args

@ -127,7 +127,7 @@ public:
virtual void virtual void
configure_mbsfn(asn1::rrc::sib_type2_s* sib2, asn1::rrc::sib_type13_r9_s* sib13, asn1::rrc::mcch_msg_s mcch) = 0; configure_mbsfn(asn1::rrc::sib_type2_s* sib2, asn1::rrc::sib_type13_r9_s* sib13, asn1::rrc::mcch_msg_s mcch) = 0;
virtual void set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated) = 0; virtual void set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated) = 0;
}; };
class mac_interface_rrc class mac_interface_rrc

@ -473,11 +473,7 @@ typedef struct {
typedef struct { typedef struct {
std::string type = "lte"; std::string type = "lte";
srslte::phy_log_args_t log = { srslte::phy_log_args_t log;
.phy_level = "none",
.phy_lib_level = "none",
.phy_hex_limit = -1,
};
std::string dl_earfcn = "3400"; // comma-separated list of EARFCNs std::string dl_earfcn = "3400"; // comma-separated list of EARFCNs
std::vector<uint32_t> earfcn_list = {3400}; // vectorized version of dl_earfcn that gets populated during init std::vector<uint32_t> earfcn_list = {3400}; // vectorized version of dl_earfcn that gets populated during init

@ -53,7 +53,7 @@ public:
int read_pucch_d(cf_t* pusch_d); int read_pucch_d(cf_t* pusch_d);
void start_plot(); void start_plot();
void set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated); void set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated);
void work_ul(const srslte_ul_sf_cfg_t& ul_sf, stack_interface_phy_lte::ul_sched_t& ul_grants); void work_ul(const srslte_ul_sf_cfg_t& ul_sf, stack_interface_phy_lte::ul_sched_t& ul_grants);
void work_dl(const srslte_dl_sf_cfg_t& dl_sf_cfg, void work_dl(const srslte_dl_sf_cfg_t& dl_sf_cfg,
stack_interface_phy_lte::dl_sched_t& dl_grants, stack_interface_phy_lte::dl_sched_t& dl_grants,

@ -62,7 +62,7 @@ public:
static uint32_t tti_to_subf(uint32_t tti); static uint32_t tti_to_subf(uint32_t tti);
void start_plot(); void start_plot();
void set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated); void set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated);
void get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]); void get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]);

@ -45,14 +45,14 @@ struct phy_args_t {
std::string type; std::string type;
srslte::phy_log_args_t log; srslte::phy_log_args_t log;
float max_prach_offset_us; float max_prach_offset_us = 10;
int pusch_max_its; int pusch_max_its = 10;
bool pusch_8bit_decoder; bool pusch_8bit_decoder = false;
float tx_amplitude; float tx_amplitude = 1.0f;
int nof_phy_threads; int nof_phy_threads = 1;
std::string equalizer_mode; std::string equalizer_mode = "mmse";
float estimator_fil_w; float estimator_fil_w = 1.0f;
bool pregenerate_signals; bool pregenerate_signals = false;
srslte::channel::args_t dl_channel_args; srslte::channel::args_t dl_channel_args;
srslte::channel::args_t ul_channel_args; srslte::channel::args_t ul_channel_args;

@ -53,7 +53,7 @@ public:
int read_pucch_d(cf_t* pusch_d); int read_pucch_d(cf_t* pusch_d);
void start_plot(); void start_plot();
void set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated); void set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated);
uint32_t get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]); uint32_t get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS]);

@ -246,81 +246,13 @@ uint32_t cc_worker::get_nof_rnti()
return ue_db.size(); return ue_db.size();
} }
void cc_worker::set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated) void cc_worker::set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated)
{ {
std::lock_guard<std::mutex> lock(mutex); std::lock_guard<std::mutex> lock(mutex);
if (ue_db.count(rnti)) { if (ue_db.count(rnti)) {
ue_db[rnti]->ul_cfg = dedicated.ul_cfg;
if (dedicated->pusch_cfg_ded_present && dedicated->sched_request_cfg_present) { ue_db[rnti]->dl_cfg = dedicated.dl_cfg;
ue_db[rnti]->ul_cfg.pusch.uci_offset.I_offset_ack = dedicated->pusch_cfg_ded.beta_offset_ack_idx;
ue_db[rnti]->ul_cfg.pusch.uci_offset.I_offset_cqi = dedicated->pusch_cfg_ded.beta_offset_cqi_idx;
ue_db[rnti]->ul_cfg.pusch.uci_offset.I_offset_ri = dedicated->pusch_cfg_ded.beta_offset_ri_idx;
ue_db[rnti]->ul_cfg.pucch.n_pucch_2 = dedicated->cqi_report_cfg.cqi_report_periodic.setup().cqi_pucch_res_idx;
ue_db[rnti]->ul_cfg.pucch.n_pucch_sr = dedicated->sched_request_cfg.setup().sr_pucch_res_idx;
}
if (dedicated->sched_request_cfg_present) {
ue_db[rnti]->ul_cfg.pucch.I_sr = dedicated->sched_request_cfg.setup().sr_cfg_idx;
ue_db[rnti]->ul_cfg.pucch.sr_configured = true;
}
/* CQI Reporting */
if (dedicated->cqi_report_cfg.cqi_report_periodic_present and
dedicated->cqi_report_cfg.cqi_report_periodic.type() == setup_e::setup) {
ue_db[rnti]->dl_cfg.cqi_report.periodic_configured = true;
ue_db[rnti]->dl_cfg.cqi_report.pmi_idx = dedicated->cqi_report_cfg.cqi_report_periodic.setup().cqi_pmi_cfg_idx;
ue_db[rnti]->ul_cfg.pucch.simul_cqi_ack =
dedicated->cqi_report_cfg.cqi_report_periodic.setup().simul_ack_nack_and_cqi;
} else {
ue_db[rnti]->dl_cfg.cqi_report.pmi_idx = 0;
}
/* RI reporting */
if (dedicated->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx_present) {
ue_db[rnti]->dl_cfg.cqi_report.ri_idx = dedicated->cqi_report_cfg.cqi_report_periodic.setup().ri_cfg_idx;
ue_db[rnti]->dl_cfg.cqi_report.ri_idx_present = true;
} else {
ue_db[rnti]->dl_cfg.cqi_report.ri_idx_present = false;
}
if (dedicated->ant_info_present) {
/* If default antenna info then follow 3GPP 36.331 clause 9.2.4 Default physical channel configuration */
if (dedicated->ant_info.type() == phys_cfg_ded_s::ant_info_c_::types::default_value) {
if (enb_dl.cell.nof_ports == 1) {
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM1;
} else {
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM2;
}
ue_db[rnti]->dl_cfg.cqi_report.ri_idx = 0;
ue_db[rnti]->dl_cfg.cqi_report.ri_idx_present = false;
} else {
/* Physical channel reconfiguration according to 3GPP 36.331 clause 5.3.10.6 */
switch (dedicated->ant_info.explicit_value().tx_mode) {
case ant_info_ded_s::tx_mode_e_::tm1:
ue_db[rnti]->dl_cfg.cqi_report.ri_idx = 0;
ue_db[rnti]->dl_cfg.cqi_report.ri_idx_present = false;
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM1;
break;
case ant_info_ded_s::tx_mode_e_::tm2:
ue_db[rnti]->dl_cfg.cqi_report.ri_idx = 0;
ue_db[rnti]->dl_cfg.cqi_report.ri_idx_present = false;
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM2;
break;
case ant_info_ded_s::tx_mode_e_::tm3:
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM3;
break;
case ant_info_ded_s::tx_mode_e_::tm4:
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM4;
break;
default:
ue_db[rnti]->dl_cfg.tm = SRSLTE_TM1;
Error("TM mode %s not supported\n", dedicated->ant_info.explicit_value().tx_mode.to_string().c_str());
break;
}
}
}
} else { } else {
Error("Setting config dedicated: rnti=0x%x does not exist\n", rnti); Error("Setting config dedicated: rnti=0x%x does not exist\n", rnti);
} }
@ -720,7 +652,7 @@ int cc_worker::encode_pdsch(stack_interface_phy_lte::dl_sched_grant_t* grants, u
// Logging // Logging
char str[512]; char str[512];
srslte_pdsch_tx_info(&ue_db[rnti]->dl_cfg.pdsch, str, 512); srslte_pdsch_tx_info(&ue_db[rnti]->dl_cfg.pdsch, str, 512);
Info("PDSCH: %s, tti_tx_dl=%d\n", str, tti_tx_dl); Info("PDSCH: cc=%d, %s, tti_tx_dl=%d\n", cc_idx, str, tti_tx_dl);
} }
// Save metrics stats // Save metrics stats

@ -253,7 +253,7 @@ void phy::get_metrics(phy_metrics_t metrics[ENB_METRICS_MAX_USERS])
/***** RRC->PHY interface **********/ /***** RRC->PHY interface **********/
void phy::set_config_dedicated(uint16_t rnti, phys_cfg_ded_s* dedicated) void phy::set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated)
{ {
for (uint32_t i = 0; i < nof_workers; i++) { for (uint32_t i = 0; i < nof_workers; i++) {
workers[i].set_config_dedicated(rnti, dedicated); workers[i].set_config_dedicated(rnti, dedicated);

@ -156,7 +156,7 @@ uint32_t sf_worker::get_nof_rnti()
return cc_workers[0]->get_nof_rnti(); return cc_workers[0]->get_nof_rnti();
} }
void sf_worker::set_config_dedicated(uint16_t rnti, asn1::rrc::phys_cfg_ded_s* dedicated) void sf_worker::set_config_dedicated(uint16_t rnti, const srslte::phy_cfg_t& dedicated)
{ {
for (auto& w : cc_workers) { for (auto& w : cc_workers) {
w->set_config_dedicated(rnti, dedicated); w->set_config_dedicated(rnti, dedicated);

Loading…
Cancel
Save