sched,nr: fix RAR DCI values and extended RAR test

master
Francisco Paisana 3 years ago
parent 2b114cb7b9
commit 3d810bc88a

@ -49,7 +49,7 @@ bool fill_dci_rar(prb_interval interv, uint16_t ra_rnti, const bwp_params& bwp_c
{
dci.mcs = 5;
dci.ctx.format = srsran_dci_format_nr_1_0;
dci.ctx.ss_type = srsran_search_space_type_rar;
dci.ctx.ss_type = srsran_search_space_type_common_1;
dci.ctx.rnti_type = srsran_rnti_type_ra;
dci.ctx.rnti = ra_rnti;
dci.ctx.coreset_id = bwp_cfg.cfg.pdcch.ra_search_space.coreset_id;
@ -111,4 +111,4 @@ void fill_ul_dci_ue_fields(const slot_ue& ue,
}
} // namespace sched_nr_impl
} // namespace srsenb
} // namespace srsenb

@ -6,6 +6,8 @@
# the distribution.
#
add_library(sched_nr_test_suite sched_nr_common_test.cc sched_nr_ue_ded_test_suite.cc)
add_executable(sched_nr_test sched_nr_test.cc sched_nr_sim_ue.cc sched_nr_ue_ded_test_suite.cc)
target_link_libraries(sched_nr_test
srsgnb_mac
@ -23,4 +25,4 @@ target_link_libraries(sched_nr_prb_test
add_test(sched_nr_prb_test sched_nr_prb_test)
add_executable(sched_nr_rar_test sched_nr_rar_test.cc)
target_link_libraries(sched_nr_rar_test srsgnb_mac srsran_common)
target_link_libraries(sched_nr_rar_test srsgnb_mac sched_nr_test_suite srsran_common)

@ -0,0 +1,28 @@
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2021 Software Radio Systems Limited
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
*
*/
#include "sched_nr_common_test.h"
#include "srsran/support/srsran_test.h"
namespace srsenb {
void test_pdcch_consistency(srsran::const_span<sched_nr_impl::pdcch_dl_t> dl_pdcchs)
{
for (const auto& pdcch : dl_pdcchs) {
if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_ra) {
TESTASSERT_EQ(pdcch.dci.ctx.format, srsran_dci_format_nr_1_0);
TESTASSERT_EQ(pdcch.dci.ctx.ss_type, srsran_search_space_type_common_1);
}
}
}
} // namespace srsenb

@ -0,0 +1,25 @@
/**
*
* \section COPYRIGHT
*
* Copyright 2013-2021 Software Radio Systems Limited
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
*
*/
#ifndef SRSRAN_SCHED_NR_COMMON_TEST_H
#define SRSRAN_SCHED_NR_COMMON_TEST_H
#include "srsenb/hdr/stack/mac/nr/sched_nr_pdcch.h"
#include "srsran/adt/span.h"
namespace srsenb {
void test_pdcch_consistency(srsran::const_span<sched_nr_impl::pdcch_dl_t> dl_pdcch);
}
#endif // SRSRAN_SCHED_NR_COMMON_TEST_H

@ -11,6 +11,7 @@
*/
#include "sched_nr_cfg_generators.h"
#include "sched_nr_common_test.h"
#include "srsenb/hdr/stack/mac/nr/sched_nr_cell.h"
#include "srsran/common/test_common.h"
#include "srsran/support/srsran_test.h"
@ -53,8 +54,10 @@ void test_single_prach()
slot_ues.insert(rnti, u.try_reserve(pdcch_slot, 0));
alloc.new_slot(pdcch_slot);
rasched.run_slot(alloc, slot_ues);
const bwp_slot_grid* result = &alloc.res_grid()[alloc.get_pdcch_tti()];
test_pdcch_consistency(result->dl_pdcchs);
++pdcch_slot;
return &alloc.res_grid()[alloc.get_pdcch_tti()];
return result;
};
// Start Run
@ -64,6 +67,7 @@ void test_single_prach()
TESTASSERT(result->dl_pdcchs.empty());
}
// A PRACH arrives...
sched_nr_interface::dl_sched_rar_info_t rainfo{};
rainfo.preamble_idx = 10;
rainfo.temp_crnti = rnti;
@ -72,6 +76,7 @@ void test_single_prach()
TESTASSERT_SUCCESS(rasched.dl_rach_info(rainfo));
uint16_t ra_rnti = 1 + rainfo.ofdm_symbol_idx + 14 * rainfo.prach_slot.slot_idx() + 14 * 80 * rainfo.freq_idx;
// RAR is scheduled
while (true) {
result = run_slot();
if (result->is_dl()) {
@ -79,6 +84,7 @@ void test_single_prach()
const auto& pdcch = result->dl_pdcchs[0];
TESTASSERT_EQ(pdcch.dci.ctx.rnti, ra_rnti);
TESTASSERT_EQ(pdcch.dci.ctx.rnti_type, srsran_rnti_type_ra);
TESTASSERT(pdcch_slot < prach_slot + bwp_cfg.cell_cfg.bwps[0].rar_window_size);
break;
} else {
TESTASSERT(result->dl_pdcchs.empty());

Loading…
Cancel
Save