mirror of https://github.com/PentHertz/srsLTE.git
reduce mcs for UL grants carrying UCI
This commit is contained in:
parent
c686e6cea1
commit
58c4bcf288
|
@ -60,6 +60,7 @@ public:
|
|||
uint32_t min_nof_ctrl_symbols = 1;
|
||||
uint32_t max_nof_ctrl_symbols = 3;
|
||||
int max_aggr_level = 3;
|
||||
int uci_mcs_dec = 3;
|
||||
};
|
||||
|
||||
struct cell_cfg_t {
|
||||
|
|
|
@ -208,7 +208,8 @@ public:
|
|||
ul_harq_proc::ul_alloc_t alloc,
|
||||
bool needs_pdcch,
|
||||
srslte_dci_location_t cce_range,
|
||||
int explicit_mcs = -1);
|
||||
int explicit_mcs = -1,
|
||||
bool carriers_uci = false);
|
||||
|
||||
srslte_dci_format_t get_dci_format();
|
||||
sched_dci_cce_t* get_locations(uint32_t enb_cc_idx, uint32_t current_cfi, uint32_t sf_idx);
|
||||
|
|
|
@ -136,6 +136,7 @@ void parse_args(all_args_t* args, int argc, char* argv[])
|
|||
("scheduler.max_aggr_level", bpo::value<int>(&args->stack.mac.sched.max_aggr_level)->default_value(-1), "Optional maximum aggregation level index (l=log2(L)) ")
|
||||
("scheduler.max_nof_ctrl_symbols", bpo::value<uint32_t>(&args->stack.mac.sched.max_nof_ctrl_symbols)->default_value(3), "Number of control symbols")
|
||||
("scheduler.min_nof_ctrl_symbols", bpo::value<uint32_t>(&args->stack.mac.sched.min_nof_ctrl_symbols)->default_value(1), "Minimum number of control symbols")
|
||||
("scheduler.mcs_uci_dec", bpo::value<int>(&args->stack.mac.sched.uci_mcs_dec)->default_value(3), "Decrement of MCS in case UL grant carries UCI.")
|
||||
|
||||
/* Downlink Channel emulator section */
|
||||
("channel.dl.enable", bpo::value<bool>(&args->phy.dl_channel_args.enable)->default_value(false), "Enable/Disable internal Downlink channel emulator")
|
||||
|
|
|
@ -1045,6 +1045,27 @@ void sf_sched::set_dl_data_sched_result(const pdcch_grid_t::alloc_result_t& dci_
|
|||
}
|
||||
}
|
||||
|
||||
//! Finds eNB CC Idex that currently holds UCI
|
||||
int get_enb_cc_idx_with_uci(const sf_sched_result& sf_result, const sched_ue* user)
|
||||
{
|
||||
uint32_t ue_cc_idx = sf_result.enb_cc_list.size();
|
||||
int sel_enb_cc_idx = -1;
|
||||
for (uint32_t enbccidx = 0; enbccidx < sf_result.enb_cc_list.size(); ++enbccidx) {
|
||||
for (uint32_t j = 0; j < sf_result.enb_cc_list[enbccidx].ul_sched_result.nof_dci_elems; ++j) {
|
||||
// Checks all the UL grants already allocated for the given rnti
|
||||
if (sf_result.enb_cc_list[enbccidx].ul_sched_result.pusch[j].dci.rnti == user->get_rnti()) {
|
||||
auto p = user->get_cell_index(enbccidx);
|
||||
// If the UE CC Idx is the lowest so far
|
||||
if (p.first and p.second < ue_cc_idx) {
|
||||
ue_cc_idx = p.second;
|
||||
sel_enb_cc_idx = enbccidx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sel_enb_cc_idx;
|
||||
}
|
||||
|
||||
void sf_sched::set_ul_sched_result(const pdcch_grid_t::alloc_result_t& dci_result,
|
||||
sched_interface::ul_sched_res_t* ul_result)
|
||||
{
|
||||
|
@ -1060,13 +1081,17 @@ void sf_sched::set_ul_sched_result(const pdcch_grid_t::alloc_result_t& dci_resul
|
|||
cce_range = dci_result[ul_alloc.dci_idx]->dci_pos;
|
||||
}
|
||||
|
||||
/* Set fixed mcs if specified */
|
||||
// Set fixed mcs if specified
|
||||
int fixed_mcs = (ul_alloc.type == ul_alloc_t::MSG3) ? ul_alloc.mcs : -1;
|
||||
|
||||
// If UCI is encoded in the current carrier
|
||||
uint32_t uci_enb_cc_idx = get_enb_cc_idx_with_uci(*cc_results, user);
|
||||
bool carries_uci = uci_enb_cc_idx == cc_cfg->enb_cc_idx;
|
||||
|
||||
/* Generate DCI Format1A */
|
||||
uint32_t pending_data_before = user->get_pending_ul_new_data(get_tti_tx_ul());
|
||||
int tbs = user->generate_format0(
|
||||
pusch, get_tti_tx_ul(), cell_index, ul_alloc.alloc, ul_alloc.needs_pdcch(), cce_range, fixed_mcs);
|
||||
pusch, get_tti_tx_ul(), cell_index, ul_alloc.alloc, ul_alloc.needs_pdcch(), cce_range, fixed_mcs, carries_uci);
|
||||
|
||||
ul_harq_proc* h = user->get_ul_harq(get_tti_tx_ul(), cell_index);
|
||||
if (tbs <= 0) {
|
||||
|
|
|
@ -669,7 +669,8 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data,
|
|||
ul_harq_proc::ul_alloc_t alloc,
|
||||
bool needs_pdcch,
|
||||
srslte_dci_location_t dci_pos,
|
||||
int explicit_mcs)
|
||||
int explicit_mcs,
|
||||
bool carries_uci)
|
||||
{
|
||||
ul_harq_proc* h = get_ul_harq(tti, cc_idx);
|
||||
srslte_dci_ul_t* dci = &data->dci;
|
||||
|
@ -698,6 +699,12 @@ int sched_ue::generate_format0(sched_interface::ul_sched_data_t* data,
|
|||
uint32_t N_srs = 0;
|
||||
uint32_t nof_re = (2 * (SRSLTE_CP_NSYMB(cell.cp) - 1) - N_srs) * alloc.L * SRSLTE_NRE;
|
||||
tbs = carriers[cc_idx].alloc_tbs_ul(alloc.L, nof_re, req_bytes, &mcs);
|
||||
|
||||
if (carries_uci) {
|
||||
// Reduce MCS to fit UCI
|
||||
mcs -= std::min(main_cc_params->sched_cfg->uci_mcs_dec, mcs);
|
||||
tbs = srslte_ra_tbs_from_idx(srslte_ra_tbs_idx_from_mcs(mcs, false, true), alloc.L) / 8;
|
||||
}
|
||||
}
|
||||
h->new_tx(tti, mcs, tbs, alloc, nof_retx);
|
||||
|
||||
|
|
Loading…
Reference in New Issue