using new DFS-based PDCCH allocator as a default

This commit is contained in:
Francisco 2021-03-18 22:25:35 +00:00 committed by Francisco Paisana
parent 8347cabe4f
commit 6bec92fbc9
4 changed files with 57 additions and 51 deletions

View File

@ -106,11 +106,11 @@ public:
bool find_ul_alloc(uint32_t L, prb_interval* alloc) const; bool find_ul_alloc(uint32_t L, prb_interval* alloc) const;
// getters // getters
const rbgmask_t& get_dl_mask() const { return dl_mask; } const rbgmask_t& get_dl_mask() const { return dl_mask; }
const prbmask_t& get_ul_mask() const { return ul_mask; } const prbmask_t& get_ul_mask() const { return ul_mask; }
uint32_t get_cfi() const { return pdcch_alloc.get_cfi(); } uint32_t get_cfi() const { return pdcch_alloc.get_cfi(); }
const sf_cch_allocator& get_pdcch_grid() const { return pdcch_alloc; } const sf_cch_allocator2& get_pdcch_grid() const { return pdcch_alloc; }
uint32_t get_pucch_width() const { return pucch_nrb; } uint32_t get_pucch_width() const { return pucch_nrb; }
private: private:
alloc_result alloc_dl(uint32_t aggr_lvl, alloc_result alloc_dl(uint32_t aggr_lvl,
@ -127,7 +127,7 @@ private:
prbmask_t pucch_mask; prbmask_t pucch_mask;
// derived // derived
sf_cch_allocator pdcch_alloc = {}; sf_cch_allocator2 pdcch_alloc = {};
// internal state // internal state
tti_point tti_rx; tti_point tti_rx;
@ -219,12 +219,12 @@ public:
const sched_cell_params_t* get_cc_cfg() const { return cc_cfg; } const sched_cell_params_t* get_cc_cfg() const { return cc_cfg; }
private: private:
void set_dl_data_sched_result(const sf_cch_allocator::alloc_result_t& dci_result, void set_dl_data_sched_result(const sf_cch_allocator2::alloc_result_t& dci_result,
sched_interface::dl_sched_res_t* dl_result, sched_interface::dl_sched_res_t* dl_result,
sched_ue_list& ue_list); sched_ue_list& ue_list);
void set_ul_sched_result(const sf_cch_allocator::alloc_result_t& dci_result, void set_ul_sched_result(const sf_cch_allocator2::alloc_result_t& dci_result,
sched_interface::ul_sched_res_t* ul_result, sched_interface::ul_sched_res_t* ul_result,
sched_ue_list& ue_list); sched_ue_list& ue_list);
// consts // consts
const sched_cell_params_t* cc_cfg = nullptr; const sched_cell_params_t* cc_cfg = nullptr;

View File

@ -645,9 +645,9 @@ alloc_result sf_sched::alloc_phich(sched_ue* user)
return alloc_result::no_rnti_opportunity; return alloc_result::no_rnti_opportunity;
} }
void sf_sched::set_dl_data_sched_result(const sf_cch_allocator::alloc_result_t& dci_result, void sf_sched::set_dl_data_sched_result(const sf_cch_allocator2::alloc_result_t& dci_result,
sched_interface::dl_sched_res_t* dl_result, sched_interface::dl_sched_res_t* dl_result,
sched_ue_list& ue_list) sched_ue_list& ue_list)
{ {
for (const auto& data_alloc : data_allocs) { for (const auto& data_alloc : data_allocs) {
dl_result->data.emplace_back(); dl_result->data.emplace_back();
@ -788,9 +788,9 @@ uci_pusch_t is_uci_included(const sf_sched* sf_sched,
} }
} }
void sf_sched::set_ul_sched_result(const sf_cch_allocator::alloc_result_t& dci_result, void sf_sched::set_ul_sched_result(const sf_cch_allocator2::alloc_result_t& dci_result,
sched_interface::ul_sched_res_t* ul_result, sched_interface::ul_sched_res_t* ul_result,
sched_ue_list& ue_list) sched_ue_list& ue_list)
{ {
/* Set UL data DCI locs and format */ /* Set UL data DCI locs and format */
for (const auto& ul_alloc : ul_data_allocs) { for (const auto& ul_alloc : ul_data_allocs) {
@ -902,7 +902,7 @@ void sf_sched::generate_sched_results(sched_ue_list& ue_db)
} }
/* Pick one of the possible DCI masks */ /* Pick one of the possible DCI masks */
sf_cch_allocator::alloc_result_t dci_result; sf_cch_allocator2::alloc_result_t dci_result;
// tti_alloc.get_pdcch_grid().result_to_string(); // tti_alloc.get_pdcch_grid().result_to_string();
tti_alloc.get_pdcch_grid().get_allocs(&dci_result, &cc_result->pdcch_mask); tti_alloc.get_pdcch_grid().get_allocs(&dci_result, &cc_result->pdcch_mask);

View File

@ -78,6 +78,11 @@ bool sf_cch_allocator2::alloc_dci(alloc_type_t alloc_type, uint32_t aggr_idx, sc
if (success) { if (success) {
// DCI record allocation successful // DCI record allocation successful
dci_record_list.push_back(record); dci_record_list.push_back(record);
if (is_dl_ctrl_alloc(alloc_type)) {
// Dynamic CFI not yet supported for DL control allocations, as coderate can be exceeded
current_max_cfix = current_cfix;
}
return true; return true;
} }
if (temp_dci_dfs.empty()) { if (temp_dci_dfs.empty()) {
@ -91,30 +96,6 @@ bool sf_cch_allocator2::alloc_dci(alloc_type_t alloc_type, uint32_t aggr_idx, sc
return false; return false;
} }
// bool sf_cch_allocator2::get_next_dfs()
//{
// if (last_dci_dfs.empty()) {
// // If we reach root, increase CFI
// if (current_cfix < cc_cfg->sched_cfg->max_nof_ctrl_symbols - 1) {
// current_cfix++;
// return true;
// }
// return false;
// }
//
// uint32_t dfs_level = last_dci_dfs.size() - 1;
// uint32_t start_child_idx = last_dci_dfs.back().dci_pos_idx + 1;
// last_dci_dfs.pop_back();
// while (not alloc_dfs_node(dci_record_list[dfs_level], start_child_idx)) {
// start_child_idx = 0;
// // If failed to allocate record, go one level lower in DFS
// if (not get_next_dfs()) {
// // If no more options in DFS, return false
// return false;
// }
// }
//}
bool sf_cch_allocator2::get_next_dfs() bool sf_cch_allocator2::get_next_dfs()
{ {
do { do {
@ -122,7 +103,7 @@ bool sf_cch_allocator2::get_next_dfs()
if (last_dci_dfs.empty()) { if (last_dci_dfs.empty()) {
// If we reach root, increase CFI // If we reach root, increase CFI
current_cfix++; current_cfix++;
if (current_cfix > cc_cfg->sched_cfg->max_nof_ctrl_symbols - 1) { if (current_cfix > current_max_cfix) {
return false; return false;
} }
} else { } else {
@ -236,7 +217,32 @@ void sf_cch_allocator2::get_allocs(alloc_result_t* vec, pdcch_mask_t* tot_mask,
std::string sf_cch_allocator2::result_to_string(bool verbose) const std::string sf_cch_allocator2::result_to_string(bool verbose) const
{ {
return ""; fmt::basic_memory_buffer<char, 1024> strbuf;
if (dci_record_list.empty()) {
fmt::format_to(strbuf, "SCHED: PDCCH allocations cfi={}, nof_cce={}, No allocations.\n", get_cfi(), nof_cces());
} else {
fmt::format_to(strbuf,
"SCHED: PDCCH allocations cfi={}, nof_cce={}, nof_allocs={}, total PDCCH mask=0x{:x}",
get_cfi(),
nof_cces(),
nof_allocs(),
last_dci_dfs.back().total_mask);
alloc_result_t vec;
get_allocs(&vec);
if (verbose) {
fmt::format_to(strbuf, ", allocations:\n");
for (const auto& dci_alloc : vec) {
fmt::format_to(strbuf,
" > rnti=0x{:0x}: 0x{:x} / 0x{:x}\n",
dci_alloc->rnti,
dci_alloc->current_mask,
dci_alloc->total_mask);
}
} else {
fmt::format_to(strbuf, ".\n");
}
}
return fmt::to_string(strbuf);
} }
///////////////////////// /////////////////////////

View File

@ -219,7 +219,7 @@ run_data expected_run_result(run_params params)
int tbs = srslte_ra_tbs_from_idx(tbs_idx, params.nof_prbs); int tbs = srslte_ra_tbs_from_idx(tbs_idx, params.nof_prbs);
ret.avg_dl_throughput = static_cast<float>(tbs) * 1e3F; // bps ret.avg_dl_throughput = static_cast<float>(tbs) * 1e3F; // bps
tbs_idx = srslte_ra_tbs_idx_from_mcs(28, false, true); tbs_idx = srslte_ra_tbs_idx_from_mcs(24, false, true);
uint32_t nof_pusch_prbs = params.nof_prbs - (params.nof_prbs == 6 ? 2 : 4); uint32_t nof_pusch_prbs = params.nof_prbs - (params.nof_prbs == 6 ? 2 : 4);
tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_pusch_prbs); tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_pusch_prbs);
ret.avg_ul_throughput = static_cast<float>(tbs) * 1e3F; // bps ret.avg_ul_throughput = static_cast<float>(tbs) * 1e3F; // bps
@ -229,16 +229,16 @@ run_data expected_run_result(run_params params)
switch (params.nof_prbs) { switch (params.nof_prbs) {
case 6: case 6:
ret.avg_dl_mcs = 25; ret.avg_dl_mcs = 25;
ret.avg_dl_throughput *= 0.7; ret.avg_dl_throughput *= 0.68;
ret.avg_ul_throughput *= 0.25; ret.avg_ul_throughput *= 0.75;
break; break;
case 15: case 15:
ret.avg_dl_throughput *= 0.95; ret.avg_dl_throughput *= 0.95;
ret.avg_ul_throughput *= 0.5; ret.avg_ul_throughput *= 0.7;
break; break;
default: default:
ret.avg_dl_throughput *= 0.97; ret.avg_dl_throughput *= 0.97;
ret.avg_ul_throughput *= 0.5; ret.avg_ul_throughput *= 0.85;
break; break;
} }
return ret; return ret;
@ -257,7 +257,7 @@ void print_benchmark_results(const std::vector<run_data>& run_results)
int tbs_idx = srslte_ra_tbs_idx_from_mcs(28, false, false); int tbs_idx = srslte_ra_tbs_idx_from_mcs(28, false, false);
int tbs = srslte_ra_tbs_from_idx(tbs_idx, r.params.nof_prbs); int tbs = srslte_ra_tbs_from_idx(tbs_idx, r.params.nof_prbs);
float dl_rate_overhead = 1.0F - r.avg_dl_throughput / (static_cast<float>(tbs) * 1e3F); float dl_rate_overhead = 1.0F - r.avg_dl_throughput / (static_cast<float>(tbs) * 1e3F);
tbs_idx = srslte_ra_tbs_idx_from_mcs(28, false, true); tbs_idx = srslte_ra_tbs_idx_from_mcs(24, false, true);
uint32_t nof_pusch_prbs = r.params.nof_prbs - (r.params.nof_prbs == 6 ? 2 : 4); uint32_t nof_pusch_prbs = r.params.nof_prbs - (r.params.nof_prbs == 6 ? 2 : 4);
tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_pusch_prbs); tbs = srslte_ra_tbs_from_idx(tbs_idx, nof_pusch_prbs);
float ul_rate_overhead = 1.0F - r.avg_ul_throughput / (static_cast<float>(tbs) * 1e3F); float ul_rate_overhead = 1.0F - r.avg_ul_throughput / (static_cast<float>(tbs) * 1e3F);