sched,nr: function to log UEs buffer status before scheduling decision, fix const_iterator of circular_map

master
Francisco Paisana 3 years ago
parent 1eaca0d343
commit cbb709d4e3

@ -90,7 +90,12 @@ public:
{
public:
const_iterator() = default;
const_iterator(const static_circular_map<K, T, N>* map, size_t idx_) : ptr(map), idx(idx_) {}
const_iterator(const static_circular_map<K, T, N>* map, size_t idx_) : ptr(map), idx(idx_)
{
if (idx < ptr->capacity() and not ptr->present[idx]) {
++(*this);
}
}
const_iterator& operator++()
{

@ -43,6 +43,12 @@ void fill_ul_dci_ue_fields(const slot_ue& ue,
srsran_dci_location_t dci_pos,
srsran_dci_ul_nr_t& dci);
/// Log UE state for slot being scheduled
void log_sched_slot_ues(srslog::basic_logger& logger,
slot_point pdcch_slot,
uint32_t cc,
const slot_ue_map_t& slot_ues);
/// Log Scheduling Result for a given BWP and slot
void log_sched_bwp_result(srslog::basic_logger& logger,
slot_point pdcch_slot,

@ -139,6 +139,7 @@ uint16_t mac_nr::reserve_rnti(uint32_t enb_cc_idx)
// Add new user to the scheduler so that it can RX/TX SRB0
srsenb::sched_nr_interface::ue_cfg_t ue_cfg = srsenb::get_default_ue_cfg(1);
ue_cfg.ue_bearers[0].direction = mac_lc_ch_cfg_t::IDLE;
sched.ue_cfg(rnti, ue_cfg);
return rnti;

@ -112,6 +112,27 @@ void fill_ul_dci_ue_fields(const slot_ue& ue,
fill_dci_common(ue, bwp_cfg, dci);
}
void log_sched_slot_ues(srslog::basic_logger& logger, slot_point pdcch_slot, uint32_t cc, const slot_ue_map_t& slot_ues)
{
if (not logger.info.enabled() or slot_ues.empty()) {
return;
}
fmt::memory_buffer fmtbuf;
fmt::format_to(fmtbuf, "SCHED: UE candidates, pdcch_tti={}, cc={}: [", pdcch_slot, cc);
const char* use_comma = "";
for (const auto& ue_pair : slot_ues) {
auto& ue = ue_pair->second;
fmt::format_to(
fmtbuf, "{}{{rnti=0x{:x}, dl_bs={}, ul_bs={}}}", use_comma, ue.rnti, ue.dl_pending_bytes, ue.ul_pending_bytes);
use_comma = ", ";
}
logger.info("%s]", srsran::to_c_str(fmtbuf));
}
void log_sched_bwp_result(srslog::basic_logger& logger,
slot_point pdcch_slot,
const bwp_res_grid& res_grid,

@ -90,6 +90,9 @@ void slot_cc_worker::run(slot_point pdcch_slot, ue_map_t& ue_db)
// Create an BWP allocator object that will passed along to RA, SI, Data schedulers
bwp_alloc.new_slot(slot_rx + TX_ENB_DELAY, slot_ues);
// Log UEs state for slot
log_sched_slot_ues(logger, bwp_alloc.get_pdcch_tti(), cfg.cc, slot_ues);
// Allocate pending RARs
cell.bwps[0].ra.run_slot(bwp_alloc);

Loading…
Cancel
Save