nr,sched: enable NR fixed mcs configuration via enb.conf

master
Francisco 3 years ago committed by Francisco Paisana
parent 919d949790
commit 04d48127bb

@ -186,6 +186,8 @@ enable = false
# init_dl_cqi: DL CQI value used before any CQI report is available to the eNB # init_dl_cqi: DL CQI value used before any CQI report is available to the eNB
# max_sib_coderate: Upper bound on SIB and RAR grants coderate # max_sib_coderate: Upper bound on SIB and RAR grants coderate
# pdcch_cqi_offset: CQI offset in derivation of PDCCH aggregation level # pdcch_cqi_offset: CQI offset in derivation of PDCCH aggregation level
# pdsch_mcs: Optional fixed NR PDSCH MCS (ignores reported CQIs if specified)
# pusch_mcs: Optional fixed NR PUSCH MCS (ignores reported CQIs if specified)
# #
##################################################################### #####################################################################
[scheduler] [scheduler]
@ -213,6 +215,8 @@ enable = false
#init_dl_cqi=5 #init_dl_cqi=5
#max_sib_coderate=0.3 #max_sib_coderate=0.3
#pdcch_cqi_offset=0 #pdcch_cqi_offset=0
#nr_pdsch_mcs=28
#nr_pusch_mcs=28
##################################################################### #####################################################################
# eMBMS configuration options # eMBMS configuration options

@ -138,6 +138,8 @@ public:
} }
return phy().harq_ack.dl_data_to_ul_ack[pdsch_slot.to_uint() % phy().harq_ack.nof_dl_data_to_ul_ack]; return phy().harq_ack.dl_data_to_ul_ack[pdsch_slot.to_uint() % phy().harq_ack.nof_dl_data_to_ul_ack];
} }
int fixed_pdsch_mcs() const { return bwp_cfg->sched_cfg.fixed_dl_mcs; }
int fixed_pusch_mcs() const { return bwp_cfg->sched_cfg.fixed_ul_mcs; }
private: private:
uint16_t rnti = SRSRAN_INVALID_RNTI; uint16_t rnti = SRSRAN_INVALID_RNTI;

@ -71,6 +71,8 @@ public:
bool pdsch_enabled = true; bool pdsch_enabled = true;
bool pusch_enabled = true; bool pusch_enabled = true;
bool auto_refill_buffer = false; bool auto_refill_buffer = false;
int fixed_dl_mcs = -1;
int fixed_ul_mcs = -1;
std::string logger_name = "MAC-NR"; std::string logger_name = "MAC-NR";
}; };
@ -80,9 +82,7 @@ public:
}; };
struct ue_cfg_t { struct ue_cfg_t {
uint32_t maxharq_tx = 4; uint32_t maxharq_tx = 4;
int fixed_dl_mcs = -1;
int fixed_ul_mcs = -1;
srsran::bounded_vector<ue_cc_cfg_t, SCHED_NR_MAX_CARRIERS> carriers; srsran::bounded_vector<ue_cc_cfg_t, SCHED_NR_MAX_CARRIERS> carriers;
std::array<mac_lc_ch_cfg_t, SCHED_NR_MAX_LCID> ue_bearers = {}; std::array<mac_lc_ch_cfg_t, SCHED_NR_MAX_LCID> ue_bearers = {};
srsran::phy_cfg_nr_t phy_cfg = {}; srsran::phy_cfg_nr_t phy_cfg = {};

@ -253,6 +253,8 @@ void parse_args(all_args_t* args, int argc, char* argv[])
// NR section // NR section
("scheduler.tb_len", bpo::value<int>(&args->stack.mac.nr_tb_size)->default_value(1520), "Default TB size") ("scheduler.tb_len", bpo::value<int>(&args->stack.mac.nr_tb_size)->default_value(1520), "Default TB size")
("scheduler.nr_pdsch_mcs", bpo::value<int>(&args->nr_stack.mac.sched_cfg.fixed_dl_mcs)->default_value(28), "Fixed NR DL MCS (-1 for dynamic)")
("scheduler.nr_pusch_mcs", bpo::value<int>(&args->nr_stack.mac.sched_cfg.fixed_ul_mcs)->default_value(28), "Fixed NR UL MCS (-1 for dynamic)")
// VNF params // VNF params
("vnf.type", bpo::value<string>(&args->phy.vnf_args.type)->default_value("gnb"), "VNF instance type [gnb,ue]") ("vnf.type", bpo::value<string>(&args->phy.vnf_args.type)->default_value("gnb"), "VNF instance type [gnb,ue]")

@ -11,9 +11,9 @@
*/ */
#include "srsenb/hdr/stack/mac/nr/mac_nr.h" #include "srsenb/hdr/stack/mac/nr/mac_nr.h"
#include "srsenb/test/mac/nr/sched_nr_cfg_generators.h"
#include "srsran/common/buffer_pool.h" #include "srsran/common/buffer_pool.h"
#include "srsran/common/log_helper.h" #include "srsran/common/log_helper.h"
#include "srsran/common/phy_cfg_nr_default.h"
#include "srsran/common/rwlock_guard.h" #include "srsran/common/rwlock_guard.h"
#include "srsran/common/standard_streams.h" #include "srsran/common/standard_streams.h"
#include "srsran/common/string_helpers.h" #include "srsran/common/string_helpers.h"
@ -144,8 +144,14 @@ uint16_t mac_nr::reserve_rnti(uint32_t enb_cc_idx)
} }
// Add new user to the scheduler so that it can RX/TX SRB0 // Add new user to the scheduler so that it can RX/TX SRB0
srsenb::sched_nr_interface::ue_cfg_t ue_cfg = srsenb::get_rach_ue_cfg(enb_cc_idx); srsenb::sched_nr_interface::ue_cfg_t uecfg = {};
sched.ue_cfg(rnti, ue_cfg); uecfg.carriers.resize(1);
uecfg.carriers[0].active = true;
uecfg.carriers[0].cc = 0;
uecfg.ue_bearers[0].direction = mac_lc_ch_cfg_t::BOTH;
uecfg.phy_cfg = srsran::phy_cfg_nr_default_t{srsran::phy_cfg_nr_default_t::reference_cfg_t{}};
uecfg.phy_cfg.csi = {}; // disable CSI until RA is complete
sched.ue_cfg(rnti, uecfg);
return rnti; return rnti;
} }

@ -232,8 +232,8 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, const prb_grant& dl_gr
// Allocate HARQ // Allocate HARQ
if (ue.h_dl->empty()) { if (ue.h_dl->empty()) {
srsran_assert(ue.cfg->ue_cfg()->fixed_dl_mcs >= 0, "Dynamic MCS not yet supported"); int mcs = ue.cfg->fixed_pdsch_mcs();
int mcs = ue.cfg->ue_cfg()->fixed_dl_mcs; srsran_assert(mcs >= 0, "Dynamic MCS not yet supported");
int tbs = 100; int tbs = 100;
bool ret = ue.h_dl->new_tx(ue.pdsch_slot, ue.uci_slot, dl_grant, mcs, tbs, 4); bool ret = ue.h_dl->new_tx(ue.pdsch_slot, ue.uci_slot, dl_grant, mcs, tbs, 4);
srsran_assert(ret, "Failed to allocate DL HARQ"); srsran_assert(ret, "Failed to allocate DL HARQ");
@ -244,7 +244,7 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, const prb_grant& dl_gr
// Allocation Successful // Allocation Successful
int mcs = ue.cfg->ue_cfg()->fixed_dl_mcs; int mcs = ue.h_dl->mcs();
const static float max_R = 0.93; const static float max_R = 0.93;
do { do {
// Generate PDCCH // Generate PDCCH
@ -320,8 +320,8 @@ alloc_result bwp_slot_allocator::alloc_pusch(slot_ue& ue, const prb_grant& ul_pr
} }
if (ue.h_ul->empty()) { if (ue.h_ul->empty()) {
srsran_assert(ue.cfg->ue_cfg()->fixed_ul_mcs >= 0, "Dynamic MCS not yet supported"); int mcs = ue.cfg->fixed_pusch_mcs();
int mcs = ue.cfg->ue_cfg()->fixed_ul_mcs; srsran_assert(mcs >= 0, "Dynamic MCS not yet supported");
int tbs = 100; int tbs = 100;
bool success = ue.h_ul->new_tx(ue.pusch_slot, ue.pusch_slot, ul_prbs, mcs, tbs, ue.cfg->ue_cfg()->maxharq_tx); bool success = ue.h_ul->new_tx(ue.pusch_slot, ue.pusch_slot, ul_prbs, mcs, tbs, ue.cfg->ue_cfg()->maxharq_tx);
srsran_assert(success, "Failed to allocate UL HARQ"); srsran_assert(success, "Failed to allocate UL HARQ");

@ -94,10 +94,6 @@ inline sched_nr_interface::ue_cfg_t get_rach_ue_cfg(uint32_t cc)
uecfg.phy_cfg = srsran::phy_cfg_nr_default_t{srsran::phy_cfg_nr_default_t::reference_cfg_t{}}; uecfg.phy_cfg = srsran::phy_cfg_nr_default_t{srsran::phy_cfg_nr_default_t::reference_cfg_t{}};
uecfg.phy_cfg.csi = {}; uecfg.phy_cfg.csi = {};
// Note: dynamic MCS not yet supported
uecfg.fixed_dl_mcs = 28;
uecfg.fixed_ul_mcs = 28;
return uecfg; return uecfg;
} }
@ -114,10 +110,6 @@ inline sched_nr_interface::ue_cfg_t get_default_ue_cfg(
uecfg.phy_cfg = phy_cfg; uecfg.phy_cfg = phy_cfg;
uecfg.ue_bearers[0].direction = mac_lc_ch_cfg_t::BOTH; uecfg.ue_bearers[0].direction = mac_lc_ch_cfg_t::BOTH;
// Note: dynamic MCS not yet supported
uecfg.fixed_dl_mcs = 28;
uecfg.fixed_ul_mcs = 28;
return uecfg; return uecfg;
} }

@ -89,8 +89,6 @@ void sched_nr_cfg_serialized_test()
sched_nr_sim_base sched_tester(cfg, cells_cfg, "Serialized Test"); sched_nr_sim_base sched_tester(cfg, cells_cfg, "Serialized Test");
sched_nr_interface::ue_cfg_t uecfg = get_default_ue_cfg(nof_sectors); sched_nr_interface::ue_cfg_t uecfg = get_default_ue_cfg(nof_sectors);
uecfg.fixed_dl_mcs = 15;
uecfg.fixed_ul_mcs = 15;
sched_tester.add_user(0x46, uecfg, slot_point{0, 0}, 0); sched_tester.add_user(0x46, uecfg, slot_point{0, 0}, 0);
std::vector<long> count_per_cc(nof_sectors, 0); std::vector<long> count_per_cc(nof_sectors, 0);
@ -140,8 +138,6 @@ void sched_nr_cfg_parallel_cc_test()
sched_nr_sim_base sched_tester(cfg, cells_cfg, "Parallel CC Test"); sched_nr_sim_base sched_tester(cfg, cells_cfg, "Parallel CC Test");
sched_nr_interface::ue_cfg_t uecfg = get_default_ue_cfg(cells_cfg.size()); sched_nr_interface::ue_cfg_t uecfg = get_default_ue_cfg(cells_cfg.size());
uecfg.fixed_dl_mcs = 15;
uecfg.fixed_ul_mcs = 15;
sched_tester.add_user(0x46, uecfg, slot_point{0, 0}, 0); sched_tester.add_user(0x46, uecfg, slot_point{0, 0}, 0);
std::array<std::atomic<long>, SRSRAN_MAX_CARRIERS> nano_count{}; std::array<std::atomic<long>, SRSRAN_MAX_CARRIERS> nano_count{};

@ -366,6 +366,8 @@ public:
srsenb::mac_nr_args_t mac_args{}; srsenb::mac_nr_args_t mac_args{};
mac_args.sched_cfg.pdsch_enabled = args.pdsch.slots != "" and args.pdsch.slots != "none"; mac_args.sched_cfg.pdsch_enabled = args.pdsch.slots != "" and args.pdsch.slots != "none";
mac_args.sched_cfg.pusch_enabled = args.pusch.slots != "" and args.pusch.slots != "none"; mac_args.sched_cfg.pusch_enabled = args.pusch.slots != "" and args.pusch.slots != "none";
mac_args.sched_cfg.fixed_dl_mcs = args.pdsch.mcs;
mac_args.sched_cfg.fixed_ul_mcs = args.pusch.mcs;
mac->init(mac_args, nullptr, nullptr, &rlc_obj, &rrc_obj); mac->init(mac_args, nullptr, nullptr, &rlc_obj, &rrc_obj);
std::vector<srsenb::sched_nr_interface::cell_cfg_t> cells_cfg = srsenb::get_default_cells_cfg(1, phy_cfg); std::vector<srsenb::sched_nr_interface::cell_cfg_t> cells_cfg = srsenb::get_default_cells_cfg(1, phy_cfg);
mac->cell_cfg(cells_cfg); mac->cell_cfg(cells_cfg);
@ -375,8 +377,6 @@ public:
mac->reserve_rnti(0); mac->reserve_rnti(0);
srsenb::sched_nr_interface::ue_cfg_t ue_cfg = srsenb::get_default_ue_cfg(1, phy_cfg); srsenb::sched_nr_interface::ue_cfg_t ue_cfg = srsenb::get_default_ue_cfg(1, phy_cfg);
ue_cfg.fixed_dl_mcs = args.pdsch.mcs;
ue_cfg.fixed_ul_mcs = args.pusch.mcs;
ue_cfg.ue_bearers[4].direction = srsenb::mac_lc_ch_cfg_t::BOTH; ue_cfg.ue_bearers[4].direction = srsenb::mac_lc_ch_cfg_t::BOTH;
mac->ue_cfg(args.rnti, ue_cfg); mac->ue_cfg(args.rnti, ue_cfg);
} }
@ -698,11 +698,6 @@ public:
if (not use_dummy_mac) { if (not use_dummy_mac) {
mac->rach_detected(rach_info); mac->rach_detected(rach_info);
task_sched.run_pending_tasks(); task_sched.run_pending_tasks();
srsenb::sched_nr_interface::ue_cfg_t ue_cfg = srsenb::get_default_ue_cfg(1, phy_cfg);
ue_cfg.fixed_dl_mcs = ue_cfg.fixed_dl_mcs;
ue_cfg.fixed_ul_mcs = ue_cfg.fixed_ul_mcs;
mac->ue_cfg(rnti, ue_cfg);
} }
std::unique_lock<std::mutex> lock(metrics_mutex); std::unique_lock<std::mutex> lock(metrics_mutex);

Loading…
Cancel
Save