nr,sched: simplify command line arg to enable real mac in nr_phy_test

master
Francisco 3 years ago committed by Francisco Paisana
parent 9efc3e05f3
commit 6617b9c558

@ -42,11 +42,6 @@ if (RF_FOUND AND ENABLE_SRSUE AND ENABLE_SRSENB)
foreach (NR_PHY_TEST_BW "10MHz" "20MHz") foreach (NR_PHY_TEST_BW "10MHz" "20MHz")
# For dummy and real scheduler # For dummy and real scheduler
foreach (NR_PHY_TEST_MAC_DUMMY "dummymac" "realmac") foreach (NR_PHY_TEST_MAC_DUMMY "dummymac" "realmac")
if(${NR_PHY_TEST_MAC_DUMMY} EQUAL "dummymac")
set(NR_PHY_TEST_MAC_DUMMY_FLAG true)
else()
set(NR_PHY_TEST_MAC_DUMMY_FLAG false)
endif()
# For each supported frame structure # For each supported frame structure
foreach (NR_PHY_TEST_DUPLEX "FDD" "6D+4U" "FR1.15-1") foreach (NR_PHY_TEST_DUPLEX "FDD" "6D+4U" "FR1.15-1")
set(NR_PHY_TEST_DURATION_MS 50) set(NR_PHY_TEST_DURATION_MS 50)
@ -61,7 +56,7 @@ if (RF_FOUND AND ENABLE_SRSUE AND ENABLE_SRSENB)
--gnb.stack.pdsch.length=52 # Full 10 MHz BW --gnb.stack.pdsch.length=52 # Full 10 MHz BW
--gnb.stack.pdsch.mcs=27 # Maximum MCS --gnb.stack.pdsch.mcs=27 # Maximum MCS
--gnb.stack.pusch.slots=none --gnb.stack.pusch.slots=none
--gnb.stack.use_dummy_sched=${NR_PHY_TEST_MAC_DUMMY_FLAG} # Use real/dummy NR MAC --gnb.stack.use_dummy_mac=${NR_PHY_TEST_MAC_DUMMY} # Use real/dummy NR MAC
${NR_PHY_TEST_COMMON_ARGS} ${NR_PHY_TEST_COMMON_ARGS}
) )
endforeach () endforeach ()
@ -75,7 +70,7 @@ if (RF_FOUND AND ENABLE_SRSUE AND ENABLE_SRSENB)
--gnb.stack.pusch.start=0 # Start at RB 0 --gnb.stack.pusch.start=0 # Start at RB 0
--gnb.stack.pusch.length=52 # Full 10 MHz BW --gnb.stack.pusch.length=52 # Full 10 MHz BW
--gnb.stack.pusch.mcs=28 # Maximum MCS --gnb.stack.pusch.mcs=28 # Maximum MCS
--gnb.stack.use_dummy_sched=${NR_PHY_TEST_MAC_DUMMY_FLAG} # Use real/dummy NR MAC --gnb.stack.use_dummy_mac=${NR_PHY_TEST_MAC_DUMMY} # Use real/dummy NR MAC
${NR_PHY_TEST_COMMON_ARGS} ${NR_PHY_TEST_COMMON_ARGS}
) )
@ -91,7 +86,7 @@ if (RF_FOUND AND ENABLE_SRSUE AND ENABLE_SRSENB)
--gnb.stack.pusch.start=0 # Start at RB 0 --gnb.stack.pusch.start=0 # Start at RB 0
--gnb.stack.pusch.length=52 # Full 10 MHz BW --gnb.stack.pusch.length=52 # Full 10 MHz BW
--gnb.stack.pusch.mcs=28 # Maximum MCS --gnb.stack.pusch.mcs=28 # Maximum MCS
--gnb.stack.use_dummy_sched=${NR_PHY_TEST_MAC_DUMMY_FLAG} # Use real/dummy NR MAC --gnb.stack.use_dummy_mac=${NR_PHY_TEST_MAC_DUMMY} # Use real/dummy NR MAC
${NR_PHY_TEST_COMMON_ARGS} ${NR_PHY_TEST_COMMON_ARGS}
) )
endforeach () endforeach ()

@ -61,13 +61,13 @@ public:
uint32_t cqi_count = 0; ///< CQI opportunity counter uint32_t cqi_count = 0; ///< CQI opportunity counter
uint32_t cqi_valid_count = 0; ///< Valid CQI counter uint32_t cqi_valid_count = 0; ///< Valid CQI counter
pucch_metrics_t pucch = {}; pucch_metrics_t pucch = {};
pucch_metrics_t pusch = {}; pucch_metrics_t pusch = {};
}; };
private: private:
srslog::basic_logger& logger = srslog::fetch_basic_logger("GNB STK"); srslog::basic_logger& logger = srslog::fetch_basic_logger("GNB STK");
bool use_dummy_sched = true; bool use_dummy_mac = true;
const uint16_t rnti = 0x1234; const uint16_t rnti = 0x1234;
struct { struct {
srsran::circular_array<srsran_dci_location_t, SRSRAN_NOF_SF_X_FRAME> dci_location = {}; srsran::circular_array<srsran_dci_location_t, SRSRAN_NOF_SF_X_FRAME> dci_location = {};
uint32_t mcs = 0; uint32_t mcs = 0;
@ -329,8 +329,8 @@ private:
public: public:
struct args_t { struct args_t {
srsran::phy_cfg_nr_t phy_cfg; ///< Physical layer configuration srsran::phy_cfg_nr_t phy_cfg; ///< Physical layer configuration
bool use_dummy_sched = true; ///< Use dummy or real NR scheduler std::string use_dummy_mac = "dummymac"; ///< Use dummy or real NR scheduler
bool wait_preamble = false; ///< Whether a UE is created automatically or the stack waits for a PRACH bool wait_preamble = false; ///< Whether a UE is created automatically or the stack waits for a PRACH
uint16_t rnti = 0x1234; ///< C-RNTI uint16_t rnti = 0x1234; ///< C-RNTI
uint32_t ss_id = 1; ///< Search Space identifier uint32_t ss_id = 1; ///< Search Space identifier
@ -350,7 +350,7 @@ public:
rnti(args.rnti), rnti(args.rnti),
phy_cfg(args.phy_cfg), phy_cfg(args.phy_cfg),
ss_id(args.ss_id), ss_id(args.ss_id),
use_dummy_sched(args.use_dummy_sched), use_dummy_mac(args.use_dummy_mac == "dummymac"),
sched_logger(srslog::fetch_basic_logger("MAC")) sched_logger(srslog::fetch_basic_logger("MAC"))
{ {
logger.set_level(srslog::str_to_basic_level(args.log_level)); logger.set_level(srslog::str_to_basic_level(args.log_level));
@ -369,7 +369,7 @@ public:
mac->cell_cfg(cells_cfg); mac->cell_cfg(cells_cfg);
// add UE to scheduler // add UE to scheduler
if (not use_dummy_sched and not args.wait_preamble) { if (not use_dummy_mac and not args.wait_preamble) {
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);
@ -461,7 +461,7 @@ public:
logger.set_context(slot_cfg.idx); logger.set_context(slot_cfg.idx);
sched_logger.set_context(slot_cfg.idx); sched_logger.set_context(slot_cfg.idx);
if (not use_dummy_sched) { if (not use_dummy_mac) {
if (autofill_pdsch_bsr) { if (autofill_pdsch_bsr) {
mac->rlc_buffer_state(rnti, 0, 10000, 0); mac->rlc_buffer_state(rnti, 0, 10000, 0);
} }
@ -539,7 +539,7 @@ public:
logger.set_context(slot_cfg.idx); logger.set_context(slot_cfg.idx);
sched_logger.set_context(slot_cfg.idx); sched_logger.set_context(slot_cfg.idx);
if (not use_dummy_sched) { if (not use_dummy_mac) {
int ret = mac->get_ul_sched(slot_cfg, ul_sched); int ret = mac->get_ul_sched(slot_cfg, ul_sched);
return ret; return ret;
@ -618,7 +618,7 @@ public:
int pucch_info(const srsran_slot_cfg_t& slot_cfg, const pucch_info_t& pucch_info) override int pucch_info(const srsran_slot_cfg_t& slot_cfg, const pucch_info_t& pucch_info) override
{ {
if (not use_dummy_sched) { if (not use_dummy_mac) {
mac->pucch_info(slot_cfg, pucch_info); mac->pucch_info(slot_cfg, pucch_info);
return SRSRAN_SUCCESS; return SRSRAN_SUCCESS;
} }
@ -655,7 +655,7 @@ public:
int pusch_info(const srsran_slot_cfg_t& slot_cfg, pusch_info_t& pusch_info) override int pusch_info(const srsran_slot_cfg_t& slot_cfg, pusch_info_t& pusch_info) override
{ {
if (not use_dummy_sched) { if (not use_dummy_mac) {
mac->pusch_info(slot_cfg, pusch_info); mac->pusch_info(slot_cfg, pusch_info);
} }
@ -693,7 +693,7 @@ public:
void rach_detected(const rach_info_t& rach_info) override void rach_detected(const rach_info_t& rach_info) override
{ {
if (not use_dummy_sched) { 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();

@ -68,7 +68,7 @@ test_bench::args_t::args_t(int argc, char** argv)
("gnb.stack.pusch.slots", bpo::value<std::string>(&gnb_stack.pusch.slots)->default_value(gnb_stack.pusch.slots), "Slots enabled for PUSCH") ("gnb.stack.pusch.slots", bpo::value<std::string>(&gnb_stack.pusch.slots)->default_value(gnb_stack.pusch.slots), "Slots enabled for PUSCH")
("gnb.stack.pusch.mcs", bpo::value<uint32_t>(&gnb_stack.pusch.mcs)->default_value(gnb_stack.pusch.mcs), "PUSCH scheduling modulation code scheme") ("gnb.stack.pusch.mcs", bpo::value<uint32_t>(&gnb_stack.pusch.mcs)->default_value(gnb_stack.pusch.mcs), "PUSCH scheduling modulation code scheme")
("gnb.stack.log.level", bpo::value<std::string>(&gnb_stack.log_level)->default_value(gnb_stack.log_level), "Stack log level") ("gnb.stack.log.level", bpo::value<std::string>(&gnb_stack.log_level)->default_value(gnb_stack.log_level), "Stack log level")
("gnb.stack.use_dummy_sched", bpo::value<bool>(&gnb_stack.use_dummy_sched)->default_value(true), "Use dummy or real NR scheduler") ("gnb.stack.use_dummy_mac", bpo::value<std::string>(&gnb_stack.use_dummy_mac)->default_value("dummymac"), "Use dummy or real NR scheduler (dummymac or realmac)")
; ;
options_gnb_phy.add_options() options_gnb_phy.add_options()

Loading…
Cancel
Save