|
|
|
@ -11,8 +11,10 @@
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "srsenb/hdr/stack/mac/nr/sched_nr_helpers.h"
|
|
|
|
|
#include "srsenb/hdr/stack/mac/nr/sched_nr_grant_allocator.h"
|
|
|
|
|
#include "srsenb/hdr/stack/mac/nr/sched_nr_harq.h"
|
|
|
|
|
#include "srsenb/hdr/stack/mac/nr/sched_nr_ue.h"
|
|
|
|
|
#include "srsran/common/string_helpers.h"
|
|
|
|
|
|
|
|
|
|
namespace srsenb {
|
|
|
|
|
namespace sched_nr_impl {
|
|
|
|
@ -110,5 +112,73 @@ void fill_ul_dci_ue_fields(const slot_ue& ue,
|
|
|
|
|
fill_dci_common(ue, bwp_cfg, dci);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void log_sched_bwp_result(srslog::basic_logger& logger,
|
|
|
|
|
slot_point pdcch_slot,
|
|
|
|
|
const bwp_res_grid& res_grid,
|
|
|
|
|
const slot_ue_map_t& slot_ues)
|
|
|
|
|
{
|
|
|
|
|
const bwp_slot_grid& bwp_slot = res_grid[pdcch_slot];
|
|
|
|
|
for (const pdcch_dl_t& pdcch : bwp_slot.dl_pdcchs) {
|
|
|
|
|
fmt::memory_buffer fmtbuf;
|
|
|
|
|
if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) {
|
|
|
|
|
const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti];
|
|
|
|
|
fmt::format_to(
|
|
|
|
|
fmtbuf,
|
|
|
|
|
"SCHED: DL {}, cc={}, rnti=0x{:x}, pid={}, f={}, nrtx={}, dai={}, tbs={}, pdsch_slot={}, tti_ack={}",
|
|
|
|
|
ue.h_dl->nof_retx() == 0 ? "tx" : "retx",
|
|
|
|
|
res_grid.cfg->cc,
|
|
|
|
|
ue.rnti,
|
|
|
|
|
pdcch.dci.pid,
|
|
|
|
|
srsran_dci_format_nr_string(pdcch.dci.ctx.format),
|
|
|
|
|
ue.h_dl->nof_retx(),
|
|
|
|
|
pdcch.dci.dai,
|
|
|
|
|
ue.h_dl->tbs(),
|
|
|
|
|
ue.pdsch_slot,
|
|
|
|
|
ue.uci_slot);
|
|
|
|
|
} else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_ra) {
|
|
|
|
|
fmt::format_to(fmtbuf,
|
|
|
|
|
"SCHED: DL RAR, cc={}, ra-rnti=0x{:x}, pdsch_slot={}, msg3_slot={}",
|
|
|
|
|
res_grid.cfg->cc,
|
|
|
|
|
pdcch.dci.ctx.rnti,
|
|
|
|
|
pdcch_slot,
|
|
|
|
|
pdcch_slot + res_grid.cfg->pusch_ra_list[0].msg3_delay);
|
|
|
|
|
} else {
|
|
|
|
|
fmt::format_to(fmtbuf, "SCHED: unknown format");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("%s", srsran::to_c_str(fmtbuf));
|
|
|
|
|
}
|
|
|
|
|
for (const pdcch_ul_t& pdcch : bwp_slot.ul_pdcchs) {
|
|
|
|
|
fmt::memory_buffer fmtbuf;
|
|
|
|
|
if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) {
|
|
|
|
|
const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti];
|
|
|
|
|
fmt::format_to(fmtbuf,
|
|
|
|
|
"SCHED: UL {}, cc={}, rnti=0x{:x}, pid={}, f={}, nrtx={}, tbs={}, tti_pusch={}",
|
|
|
|
|
ue.h_dl->nof_retx() == 0 ? "tx" : "retx",
|
|
|
|
|
res_grid.cfg->cc,
|
|
|
|
|
ue.rnti,
|
|
|
|
|
pdcch.dci.pid,
|
|
|
|
|
srsran_dci_format_nr_string(pdcch.dci.ctx.format),
|
|
|
|
|
ue.h_dl->nof_retx(),
|
|
|
|
|
ue.h_ul->tbs(),
|
|
|
|
|
ue.pusch_slot);
|
|
|
|
|
} else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_tc) {
|
|
|
|
|
const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti];
|
|
|
|
|
fmt::format_to(fmtbuf,
|
|
|
|
|
"SCHED: UL Msg3, cc={}, tc-rnti=0x{:x}, pid={}, nrtx={}, f={}, tti_pusch={}",
|
|
|
|
|
res_grid.cfg->cc,
|
|
|
|
|
ue.rnti,
|
|
|
|
|
pdcch.dci.pid,
|
|
|
|
|
ue.h_dl->nof_retx(),
|
|
|
|
|
srsran_dci_format_nr_string(pdcch.dci.ctx.format),
|
|
|
|
|
ue.pusch_slot);
|
|
|
|
|
} else {
|
|
|
|
|
fmt::format_to(fmtbuf, "SCHED: unknown rnti format");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
logger.info("%s", srsran::to_c_str(fmtbuf));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace sched_nr_impl
|
|
|
|
|
} // namespace srsenb
|
|
|
|
|