diff --git a/srsenb/src/stack/mac/scheduler_ue.cc b/srsenb/src/stack/mac/scheduler_ue.cc index 96e6cd6eb..8d6950fa1 100644 --- a/srsenb/src/stack/mac/scheduler_ue.cc +++ b/srsenb/src/stack/mac/scheduler_ue.cc @@ -568,6 +568,7 @@ std::pair sched_ue::compute_mcs_and_tbs(uint32_t ue_cc_i tbs_bytes = carriers[ue_cc_idx].alloc_tbs_dl(nof_alloc_prbs, nof_re, req_bytes.second, &mcs); } else { // Fixed MCS + mcs = carriers[ue_cc_idx].fixed_mcs_dl; tbs_bytes = sched_utils::get_tbs_bytes( (uint32_t)carriers[ue_cc_idx].fixed_mcs_dl, nof_alloc_prbs, cfg.use_tbs_index_alt, false); } diff --git a/srsenb/test/mac/scheduler_test_common.cc b/srsenb/test/mac/scheduler_test_common.cc index fdfe0175f..d3c98139c 100644 --- a/srsenb/test/mac/scheduler_test_common.cc +++ b/srsenb/test/mac/scheduler_test_common.cc @@ -875,6 +875,7 @@ int common_sched_tester::sim_cfg(sim_sched_args args) sim_args0 = std::move(args); sched::cell_cfg(sim_args0.cell_cfg); // call parent cfg + sched::set_sched_cfg(&sim_args0.sched_args); ue_tester.reset(new user_state_sched_tester{sim_args0.cell_cfg}); output_tester.clear(); diff --git a/srsenb/test/mac/scheduler_test_rand.cc b/srsenb/test/mac/scheduler_test_rand.cc index f5dea2d04..c07a685ae 100644 --- a/srsenb/test/mac/scheduler_test_rand.cc +++ b/srsenb/test/mac/scheduler_test_rand.cc @@ -426,13 +426,14 @@ void test_scheduler_rand(sched_sim_events sim) sched_sim_events rand_sim_params(uint32_t nof_ttis) { - sched_sim_events sim_gen; - uint32_t max_conn_dur = 10000, min_conn_dur = 500; - float P_ul_sr = srsenb::randf() * 0.5, P_dl = srsenb::randf() * 0.5; - float P_prach = 0.99f; // 0.1f + randf()*0.3f; - float ul_sr_exps[] = {1, 4}; // log rand - float dl_data_exps[] = {1, 4}; // log rand - uint32_t max_nof_users = 5; + auto boolean_dist = []() { return std::uniform_int_distribution<>{0, 1}(srsenb::get_rand_gen()); }; + sched_sim_events sim_gen; + uint32_t max_conn_dur = 10000, min_conn_dur = 500; + float P_ul_sr = srsenb::randf() * 0.5, P_dl = srsenb::randf() * 0.5; + float P_prach = 0.99f; // 0.1f + randf()*0.3f; + float ul_sr_exps[] = {1, 4}; // log rand + float dl_data_exps[] = {1, 4}; // log rand + uint32_t max_nof_users = 5; std::uniform_int_distribution<> connection_dur_dist(min_conn_dur, max_conn_dur); std::uniform_int_distribution dist_prb_idx(0, 5); uint32_t prb_idx = dist_prb_idx(srsenb::get_rand_gen()); @@ -444,6 +445,10 @@ sched_sim_events rand_sim_params(uint32_t nof_ttis) sim_gen.sim_args.default_ue_sim_cfg.periodic_cqi = true; sim_gen.sim_args.start_tti = 0; sim_gen.sim_args.sim_log = log_global.get(); + sim_gen.sim_args.sched_args.pdsch_mcs = + boolean_dist() ? -1 : std::uniform_int_distribution<>{0, 24}(srsenb::get_rand_gen()); + sim_gen.sim_args.sched_args.pusch_mcs = + boolean_dist() ? -1 : std::uniform_int_distribution<>{0, 24}(srsenb::get_rand_gen()); generator.tti_events.resize(nof_ttis); diff --git a/srsenb/test/mac/scheduler_test_utils.h b/srsenb/test/mac/scheduler_test_utils.h index 0ecafa399..acb8fd7e1 100644 --- a/srsenb/test/mac/scheduler_test_utils.h +++ b/srsenb/test/mac/scheduler_test_utils.h @@ -109,6 +109,7 @@ struct sim_sched_args { std::vector cell_cfg; srslte::log* sim_log = nullptr; ue_ctxt_test_cfg default_ue_sim_cfg{}; + srsenb::sched_interface::sched_args_t sched_args = {}; }; // generate all events up front