fix ca sched test

master
Francisco Paisana 4 years ago committed by Andre Puschmann
parent e8ac98d06f
commit 3407ac6741

@ -190,7 +190,7 @@ void ue_sim::update_ul_harqs(const sf_output_res_t& sf_out)
void ue_sim::update_conn_state(const sf_output_res_t& sf_out)
{
if (ctxt.msg4_tti_rx.is_valid()) {
if (ctxt.conres_rx) {
return;
}
@ -244,6 +244,12 @@ void ue_sim::update_conn_state(const sf_output_res_t& sf_out)
}
}
}
if (ctxt.msg4_tti_rx.is_valid()) {
if (to_tx_dl(ctxt.msg4_tti_rx) >= sf_out.tti_rx) {
ctxt.conres_rx = true;
}
}
}
void ue_db_sim::add_user(uint16_t rnti,

@ -44,6 +44,7 @@ struct ue_cc_ctxt_t {
std::array<ue_harq_ctxt_t, SRSLTE_FDD_NOF_HARQ> ul_harqs;
};
struct sim_ue_ctxt_t {
bool conres_rx = false;
uint16_t rnti;
uint32_t preamble_idx, msg3_riv;
srslte::tti_point prach_tti_rx, rar_tti_rx, msg3_tti_rx, msg4_tti_rx;

@ -121,11 +121,6 @@ int test_ul_sched_result(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t&
const auto& ue = *ue_pair.second;
uint16_t rnti = ue.rnti;
int ue_cc_idx = ue.enb_to_ue_cc_idx(cc);
const auto& h = ue.cc_list[ue_cc_idx].ul_harqs[pid];
// TEST: Check if CC is configured and active
CONDERROR(ue_cc_idx < 0 or not ue.ue_cfg.supported_cc_list[ue_cc_idx].active,
"PUSCH allocation for disabled or unavailable cc\n");
const phich_t* phich_ptr =
std::find_if(phich_begin, phich_end, [rnti](const phich_t& phich) { return phich.rnti == rnti; });
@ -134,8 +129,16 @@ int test_ul_sched_result(const sim_enb_ctxt_t& enb_ctxt, const sf_output_res_t&
std::find_if(pusch_begin, pusch_end, [rnti](const pusch_t& pusch) { return pusch.dci.rnti == rnti; });
pusch_ptr = pusch_ptr == pusch_end ? nullptr : pusch_ptr;
bool phich_ack = phich_ptr != nullptr and phich_ptr->phich == phich_t::ACK;
bool is_msg3 = h.first_tti_rx == ue.msg3_tti_rx and h.nof_txs == h.nof_retxs + 1;
// TEST: Check that idle CCs do not receive PUSCH grants or PHICH
if (ue_cc_idx < 0 or not ue.ue_cfg.supported_cc_list[ue_cc_idx].active) {
CONDERROR(phich_ptr != nullptr, "PHICH cannot be allocated in idle cells\n");
CONDERROR(pusch_ptr != nullptr, "PUSCH cannot be allocated in idle cells\n");
continue;
}
const auto& h = ue.cc_list[ue_cc_idx].ul_harqs[pid];
bool phich_ack = phich_ptr != nullptr and phich_ptr->phich == phich_t::ACK;
bool is_msg3 = h.first_tti_rx == ue.msg3_tti_rx and h.nof_txs == h.nof_retxs + 1;
bool last_retx = h.nof_retxs + 1 >= (is_msg3 ? sf_out.cc_params[0].cfg.maxharq_msg3tx : ue.ue_cfg.maxharq_tx);
bool h_inactive = (not h.active) or (phich_ack or last_retx);

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

@ -304,7 +304,7 @@ void user_state_sched_tester::rem_user(uint16_t rnti)
sim_users.rem_user(rnti);
}
int user_state_sched_tester::test_all(const sf_output_res_t& sf_out, uint32_t enb_cc_idx)
int user_state_sched_tester::test_all(const sf_output_res_t& sf_out)
{
// Perform UE-dedicated sched result tests
sim_enb_ctxt_t enb_ctxt;
@ -315,9 +315,11 @@ int user_state_sched_tester::test_all(const sf_output_res_t& sf_out, uint32_t en
// Update Simulated UEs state
sim_users.update(sf_out);
for (auto& u : users) {
TESTASSERT(u.second.test_sched_result(
enb_cc_idx, sf_out.dl_cc_result[enb_cc_idx], sf_out.ul_cc_result[enb_cc_idx]) == SRSLTE_SUCCESS);
for (uint32_t enb_cc_idx = 0; enb_cc_idx < enb_ctxt.cell_params->size(); ++enb_cc_idx) {
for (auto& u : users) {
TESTASSERT(u.second.test_sched_result(
enb_cc_idx, sf_out.dl_cc_result[enb_cc_idx], sf_out.ul_cc_result[enb_cc_idx]) == SRSLTE_SUCCESS);
}
}
return SRSLTE_SUCCESS;
@ -444,9 +446,8 @@ int common_sched_tester::process_results()
tti_info.dl_sched_result};
TESTASSERT(test_all_common(sf_out) == SRSLTE_SUCCESS);
for (uint32_t i = 0; i < sched_cell_params.size(); ++i) {
TESTASSERT(ue_tester->test_all(sf_out, i) == SRSLTE_SUCCESS);
}
TESTASSERT(ue_tester->test_all(sf_out) == SRSLTE_SUCCESS);
sched_stats->process_results(tti_info.tti_params, tti_info.dl_sched_result, tti_info.ul_sched_result);
return SRSLTE_SUCCESS;

@ -126,7 +126,7 @@ public:
int bearer_cfg(uint16_t rnti, uint32_t lcid, const srsenb::sched_interface::ue_bearer_cfg_t& bearer_cfg);
void rem_user(uint16_t rnti);
int test_all(const sf_output_res_t& sf_out, uint32_t enb_cc_idx);
int test_all(const sf_output_res_t& sf_out);
private:
const std::vector<srsenb::sched::cell_cfg_t>& cell_params;

@ -201,7 +201,7 @@ int sched_tester::process_results()
TESTASSERT(test_pdsch_collisions(sf_out, CARRIER_IDX, &cc_result->dl_mask) == SRSLTE_SUCCESS);
// UE dedicated tests
TESTASSERT(ue_tester->test_all(sf_out, CARRIER_IDX) == SRSLTE_SUCCESS);
TESTASSERT(ue_tester->test_all(sf_out) == SRSLTE_SUCCESS);
assert_no_empty_allocs();
test_harqs();
update_ue_stats();
@ -399,7 +399,7 @@ int main()
srsenb::set_randseed(seed);
printf("This is the chosen seed: %u\n", seed);
srslte::logmap::set_default_log_level(srslte::LOG_LEVEL_DEBUG);
srslte::logmap::set_default_log_level(srslte::LOG_LEVEL_INFO);
uint32_t N_runs = 1, nof_ttis = 10240 + 10;
for (uint32_t n = 0; n < N_runs; ++n) {

Loading…
Cancel
Save