|
|
@ -16,22 +16,22 @@
|
|
|
|
namespace srsenb {
|
|
|
|
namespace srsenb {
|
|
|
|
namespace sched_nr_impl {
|
|
|
|
namespace sched_nr_impl {
|
|
|
|
|
|
|
|
|
|
|
|
coreset_region::coreset_region(uint32_t bwp_id_,
|
|
|
|
coreset_region::coreset_region(const bwp_cfg_t& bwp_cfg_,
|
|
|
|
|
|
|
|
uint32_t coreset_id_,
|
|
|
|
uint32_t slot_idx_,
|
|
|
|
uint32_t slot_idx_,
|
|
|
|
uint32_t nof_td_symbols,
|
|
|
|
pdcch_dl_list_t& pdcch_dl_list_,
|
|
|
|
uint32_t nof_freq_resources,
|
|
|
|
pdcch_ul_list_t& pdcch_ul_list_) :
|
|
|
|
pdcch_dl_list_t& pdcch_list_) :
|
|
|
|
bwp_cfg(&bwp_cfg_),
|
|
|
|
bwp_id(bwp_id_),
|
|
|
|
coreset_cfg(&bwp_cfg_.coresets[coreset_id_ - 1].value()),
|
|
|
|
|
|
|
|
coreset_id(coreset_id_),
|
|
|
|
slot_idx(slot_idx_),
|
|
|
|
slot_idx(slot_idx_),
|
|
|
|
nof_symbols(nof_td_symbols),
|
|
|
|
pdcch_dl_list(pdcch_dl_list_),
|
|
|
|
nof_freq_res(nof_freq_resources),
|
|
|
|
pdcch_ul_list(pdcch_ul_list_)
|
|
|
|
pdcch_dl_list(pdcch_list_)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srsran_assert(nof_td_symbols <= SRSRAN_CORESET_DURATION_MAX,
|
|
|
|
const bool* res_active = &coreset_cfg->freq_resources[0];
|
|
|
|
|
|
|
|
nof_freq_res = std::count(res_active, res_active + SRSRAN_CORESET_FREQ_DOMAIN_RES_SIZE, true);
|
|
|
|
|
|
|
|
srsran_assert(get_td_symbols() <= SRSRAN_CORESET_DURATION_MAX,
|
|
|
|
"Possible number of time-domain OFDM symbols in CORESET must be within {1,2,3}");
|
|
|
|
"Possible number of time-domain OFDM symbols in CORESET must be within {1,2,3}");
|
|
|
|
srsran_assert(nof_freq_resources <= SRSRAN_CORESET_FREQ_DOMAIN_RES_SIZE,
|
|
|
|
|
|
|
|
"Provided number of CORESET freq domain resources=%d is too high",
|
|
|
|
|
|
|
|
nof_freq_resources);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void coreset_region::reset()
|
|
|
|
void coreset_region::reset()
|
|
|
@ -40,9 +40,10 @@ void coreset_region::reset()
|
|
|
|
saved_dfs_tree.clear();
|
|
|
|
saved_dfs_tree.clear();
|
|
|
|
dci_list.clear();
|
|
|
|
dci_list.clear();
|
|
|
|
pdcch_dl_list.clear();
|
|
|
|
pdcch_dl_list.clear();
|
|
|
|
|
|
|
|
pdcch_ul_list.clear();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool coreset_region::alloc_dci(pdcch_grant_type_t alloc_type, uint32_t aggr_idx, uint32_t coreset_id, slot_ue* user)
|
|
|
|
bool coreset_region::alloc_dci(pdcch_grant_type_t alloc_type, uint32_t aggr_idx, slot_ue* user)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
srsran_assert(aggr_idx <= 4, "Invalid DCI aggregation level=%d", 1U << aggr_idx);
|
|
|
|
srsran_assert(aggr_idx <= 4, "Invalid DCI aggregation level=%d", 1U << aggr_idx);
|
|
|
|
srsran_assert((user == nullptr) xor
|
|
|
|
srsran_assert((user == nullptr) xor
|
|
|
@ -54,9 +55,13 @@ bool coreset_region::alloc_dci(pdcch_grant_type_t alloc_type, uint32_t aggr_idx,
|
|
|
|
record.ue = user;
|
|
|
|
record.ue = user;
|
|
|
|
record.aggr_idx = aggr_idx;
|
|
|
|
record.aggr_idx = aggr_idx;
|
|
|
|
record.alloc_type = alloc_type;
|
|
|
|
record.alloc_type = alloc_type;
|
|
|
|
|
|
|
|
if (record.alloc_type == pdcch_grant_type_t::ul_data) {
|
|
|
|
|
|
|
|
record.idx = pdcch_ul_list.size();
|
|
|
|
|
|
|
|
pdcch_ul_list.emplace_back();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
record.idx = pdcch_dl_list.size();
|
|
|
|
record.idx = pdcch_dl_list.size();
|
|
|
|
record.coreset_id = coreset_id;
|
|
|
|
|
|
|
|
pdcch_dl_list.emplace_back();
|
|
|
|
pdcch_dl_list.emplace_back();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Try to allocate grant. If it fails, attempt the same grant, but using a different permutation of past grant DCI
|
|
|
|
// Try to allocate grant. If it fails, attempt the same grant, but using a different permutation of past grant DCI
|
|
|
|
// positions
|
|
|
|
// positions
|
|
|
@ -74,7 +79,11 @@ bool coreset_region::alloc_dci(pdcch_grant_type_t alloc_type, uint32_t aggr_idx,
|
|
|
|
|
|
|
|
|
|
|
|
// Revert steps to initial state, before dci record allocation was attempted
|
|
|
|
// Revert steps to initial state, before dci record allocation was attempted
|
|
|
|
dfs_tree = saved_dfs_tree;
|
|
|
|
dfs_tree = saved_dfs_tree;
|
|
|
|
|
|
|
|
if (record.alloc_type == pdcch_grant_type_t::ul_data) {
|
|
|
|
|
|
|
|
pdcch_ul_list.pop_back();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
pdcch_dl_list.pop_back();
|
|
|
|
pdcch_dl_list.pop_back();
|
|
|
|
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -84,9 +93,13 @@ void coreset_region::rem_last_dci()
|
|
|
|
|
|
|
|
|
|
|
|
// Remove DCI record
|
|
|
|
// Remove DCI record
|
|
|
|
dfs_tree.pop_back();
|
|
|
|
dfs_tree.pop_back();
|
|
|
|
dci_list.pop_back();
|
|
|
|
if (dci_list.back().alloc_type == pdcch_grant_type_t::ul_data) {
|
|
|
|
|
|
|
|
pdcch_ul_list.pop_back();
|
|
|
|
|
|
|
|
} else {
|
|
|
|
pdcch_dl_list.pop_back();
|
|
|
|
pdcch_dl_list.pop_back();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
dci_list.pop_back();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool coreset_region::get_next_dfs()
|
|
|
|
bool coreset_region::get_next_dfs()
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -141,8 +154,14 @@ bool coreset_region::alloc_dfs_node(const alloc_record& record, uint32_t start_d
|
|
|
|
// Allocation successful
|
|
|
|
// Allocation successful
|
|
|
|
node.total_mask |= node.current_mask;
|
|
|
|
node.total_mask |= node.current_mask;
|
|
|
|
alloc_dfs.push_back(node);
|
|
|
|
alloc_dfs.push_back(node);
|
|
|
|
|
|
|
|
// set new DCI position
|
|
|
|
|
|
|
|
if (record.alloc_type == pdcch_grant_type_t::ul_data) {
|
|
|
|
|
|
|
|
pdcch_ul_t& pdcch_ul = pdcch_ul_list[record.idx];
|
|
|
|
|
|
|
|
pdcch_ul.dci.ctx.location = node.dci_pos;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
pdcch_dl_t& pdcch_dl = pdcch_dl_list[record.idx];
|
|
|
|
pdcch_dl_t& pdcch_dl = pdcch_dl_list[record.idx];
|
|
|
|
pdcch_dl.dci.ctx.location = node.dci_pos;
|
|
|
|
pdcch_dl.dci.ctx.location = node.dci_pos;
|
|
|
|
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -154,8 +173,8 @@ srsran::span<const uint32_t> coreset_region::get_cce_loc_table(const alloc_recor
|
|
|
|
switch (record.alloc_type) {
|
|
|
|
switch (record.alloc_type) {
|
|
|
|
case pdcch_grant_type_t::dl_data:
|
|
|
|
case pdcch_grant_type_t::dl_data:
|
|
|
|
return record.ue->cfg->cc_params[record.ue->cc]
|
|
|
|
return record.ue->cfg->cc_params[record.ue->cc]
|
|
|
|
.bwps[bwp_id]
|
|
|
|
.bwps[bwp_cfg->bwp_id - 1]
|
|
|
|
.coresets[record.coreset_id]
|
|
|
|
.coresets[coreset_id - 1]
|
|
|
|
.cce_positions[slot_idx][record.aggr_idx];
|
|
|
|
.cce_positions[slot_idx][record.aggr_idx];
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|