added random cqi to sched tester

master
Francisco Paisana 5 years ago committed by Francisco Paisana
parent d40b4040b0
commit c75e31db03

@ -407,7 +407,7 @@ alloc_outcome_t sf_grid_t::alloc_dl_data(sched_ue* user, const rbgmask_t& user_m
uint32_t ue_cc_idx = user->get_cell_index(cc_cfg->enb_cc_idx).second; uint32_t ue_cc_idx = user->get_cell_index(cc_cfg->enb_cc_idx).second;
rbg_range_t r = user->get_required_dl_rbgs(ue_cc_idx); rbg_range_t r = user->get_required_dl_rbgs(ue_cc_idx);
if (r.rbg_min > user_mask.count()) { if (r.rbg_min > user_mask.count()) {
log_h->error("The number of RBGs allocated will force segmentation\n"); log_h->warning("The number of RBGs allocated to rnti=0x%x will force segmentation\n", user->get_rnti());
return alloc_outcome_t::NOF_RB_INVALID; return alloc_outcome_t::NOF_RB_INVALID;
} }

@ -132,16 +132,16 @@ int test_scell_activation(test_scell_activation_params params)
TESTASSERT(tester.ue_tester->user_exists(rnti1)); TESTASSERT(tester.ue_tester->user_exists(rnti1));
// Event (TTI=prach_tti+msg4_tot_delay): First Tx (Msg4). Goes in SRB0 and contains ConRes // Event (TTI=prach_tti+msg4_tot_delay): First Tx (Msg4). Goes in SRB0 and contains ConRes
while (not tester.ue_tester->get_user_state(rnti1)->msg3_tti.is_valid() or while (not tester.ue_tester->get_user_ctxt(rnti1)->msg3_tti.is_valid() or
tester.ue_tester->get_user_state(rnti1)->msg3_tti.to_uint() > generator.tti_counter) { tester.ue_tester->get_user_ctxt(rnti1)->msg3_tti.to_uint() > generator.tti_counter) {
generator.step_tti(); generator.step_tti();
tester.test_next_ttis(generator.tti_events); tester.test_next_ttis(generator.tti_events);
} }
generator.step_tti(); generator.step_tti();
generator.add_dl_data(rnti1, msg4_size); generator.add_dl_data(rnti1, msg4_size);
tester.test_next_ttis(generator.tti_events); tester.test_next_ttis(generator.tti_events);
while (not tester.ue_tester->get_user_state(rnti1)->msg4_tti.is_valid() or while (not tester.ue_tester->get_user_ctxt(rnti1)->msg4_tti.is_valid() or
tester.ue_tester->get_user_state(rnti1)->msg4_tti.to_uint() > generator.tti_counter) { tester.ue_tester->get_user_ctxt(rnti1)->msg4_tti.to_uint() > generator.tti_counter) {
generator.step_tti(); generator.step_tti();
tester.test_next_ttis(generator.tti_events); tester.test_next_ttis(generator.tti_events);
} }

@ -351,6 +351,14 @@ int ue_ctxt_test::new_tti(sched* sched_ptr, srslte::tti_point tti_rx)
current_tti_rx = tti_rx; current_tti_rx = tti_rx;
TESTASSERT(fwd_pending_acks(sched_ptr) == SRSLTE_SUCCESS); TESTASSERT(fwd_pending_acks(sched_ptr) == SRSLTE_SUCCESS);
if ((tti_rx.to_uint() % cqi_Npd) == cqi_Noffset) {
for (auto& cc : active_ccs) {
sched_ptr->dl_cqi_info(
tti_rx.to_uint(), rnti, cc.enb_cc_idx, std::uniform_int_distribution<uint32_t>{5, 24}(get_rand_gen()));
sched_ptr->ul_cqi_info(
tti_rx.to_uint(), rnti, cc.enb_cc_idx, std::uniform_int_distribution<uint32_t>{5, 24}(get_rand_gen()), 0);
}
}
return SRSLTE_SUCCESS; return SRSLTE_SUCCESS;
} }
@ -856,11 +864,7 @@ sched_result_stats::user_stats* sched_result_stats::get_user(uint16_t rnti)
const sched::ue_cfg_t* common_sched_tester::get_current_ue_cfg(uint16_t rnti) const const sched::ue_cfg_t* common_sched_tester::get_current_ue_cfg(uint16_t rnti) const
{ {
auto it = ue_db.find(rnti); return ue_tester->get_user_cfg(rnti);
if (it == ue_db.end()) {
return nullptr;
}
return &it->second.get_ue_cfg();
} }
int common_sched_tester::sim_cfg(sim_sched_args args) int common_sched_tester::sim_cfg(sim_sched_args args)
@ -967,7 +971,7 @@ int common_sched_tester::process_tti_events(const tti_ev& tti_ev)
bearer_ue_cfg(ue_ev.rnti, 0, ue_ev.bearer_cfg.get()); bearer_ue_cfg(ue_ev.rnti, 0, ue_ev.bearer_cfg.get());
} }
auto* user = ue_tester->get_user_state(ue_ev.rnti); auto* user = ue_tester->get_user_ctxt(ue_ev.rnti);
if (user != nullptr and not user->msg4_tti.is_valid() and user->msg3_tti.is_valid() and if (user != nullptr and not user->msg4_tti.is_valid() and user->msg3_tti.is_valid() and
user->msg3_tti.to_uint() <= tic.tti_rx()) { user->msg3_tti.to_uint() <= tic.tti_rx()) {

@ -171,10 +171,14 @@ public:
void new_tti(sched* sched_ptr, uint32_t tti_rx); void new_tti(sched* sched_ptr, uint32_t tti_rx);
bool user_exists(uint16_t rnti) const { return users.find(rnti) != users.end(); } bool user_exists(uint16_t rnti) const { return users.find(rnti) != users.end(); }
const ue_ctxt_test* get_user_state(uint16_t rnti) const const ue_ctxt_test* get_user_ctxt(uint16_t rnti) const
{ {
return users.count(rnti) > 0 ? &users.find(rnti)->second : nullptr; return users.count(rnti) > 0 ? &users.find(rnti)->second : nullptr;
} }
const sched::ue_cfg_t* get_user_cfg(uint16_t rnti) const
{
return users.count(rnti) > 0 ? &users.find(rnti)->second.user_cfg : nullptr;
}
/* Config users */ /* Config users */
int add_user(uint16_t rnti, uint32_t preamble_idx, const srsenb::sched_interface::ue_cfg_t& ue_cfg); int add_user(uint16_t rnti, uint32_t preamble_idx, const srsenb::sched_interface::ue_cfg_t& ue_cfg);

Loading…
Cancel
Save