diff --git a/srsgnb/src/stack/mac/mac_nr.cc b/srsgnb/src/stack/mac/mac_nr.cc index d3a60acff..220e16942 100644 --- a/srsgnb/src/stack/mac/mac_nr.cc +++ b/srsgnb/src/stack/mac/mac_nr.cc @@ -270,7 +270,7 @@ int mac_nr::cell_cfg(const std::vector& logger.error("Couldn't read SIB %d from RRC", sib.index); } - logger.info("Including SIB %d into SI scheduling", sib.index); + logger.info("Including SIB %d into SI scheduling", sib.index + 1); bcch_dlsch_payload.push_back(std::move(sib)); } } diff --git a/srsgnb/src/stack/mac/sched_nr_helpers.cc b/srsgnb/src/stack/mac/sched_nr_helpers.cc index d3707be10..184953753 100644 --- a/srsgnb/src/stack/mac/sched_nr_helpers.cc +++ b/srsgnb/src/stack/mac/sched_nr_helpers.cc @@ -138,7 +138,7 @@ void log_sched_bwp_result(srslog::basic_logger& logger, const slot_ue_map_t& slot_ues) { const bwp_slot_grid& bwp_slot = res_grid[pdcch_slot]; - size_t rar_count = 0; + size_t rar_count = 0, si_count = 0; for (const pdcch_dl_t& pdcch : bwp_slot.dl.phy.pdcch_dl) { fmt::memory_buffer fmtbuf; if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) { @@ -173,11 +173,26 @@ void log_sched_bwp_result(srslog::basic_logger& logger, pdcch_slot + res_grid.cfg->pusch_ra_list[0].msg3_delay, bwp_slot.dl.rar[rar_count].grants.size()); rar_count++; - } else { - fmt::format_to(fmtbuf, "SCHED: unknown format"); + } else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_si) { + if (logger.debug.enabled()) { + const pdsch_t& pdsch = bwp_slot.dl.phy.pdsch[std::distance(bwp_slot.dl.phy.pdcch_dl.data(), &pdcch)]; + srsran::const_span prbs{pdsch.sch.grant.prb_idx, pdsch.sch.grant.prb_idx + pdsch.sch.grant.nof_prb}; + uint32_t start_idx = std::distance(prbs.begin(), std::find(prbs.begin(), prbs.end(), true)); + uint32_t end_idx = std::distance(prbs.begin(), std::find(prbs.begin() + start_idx, prbs.end(), false)); + fmt::format_to(fmtbuf, + "SCHED: SI{}, cc={}, prbs={}, pdsch_slot={}", + pdcch.dci.sii == 0 ? "B" : " message", + res_grid.cfg->cc, + pdcch.dci.ctx.rnti, + srsran::interval{start_idx, end_idx}, + pdcch_slot); + si_count++; + } } - logger.info("%s", srsran::to_c_str(fmtbuf)); + if (fmtbuf.size() > 0) { + logger.info("%s", srsran::to_c_str(fmtbuf)); + } } for (const pdcch_ul_t& pdcch : bwp_slot.dl.phy.pdcch_ul) { fmt::memory_buffer fmtbuf; diff --git a/srsgnb/src/stack/mac/sched_nr_signalling.cc b/srsgnb/src/stack/mac/sched_nr_signalling.cc index 1b73f15df..2cc45a8bc 100644 --- a/srsgnb/src/stack/mac/sched_nr_signalling.cc +++ b/srsgnb/src/stack/mac/sched_nr_signalling.cc @@ -19,7 +19,7 @@ #define POS_IN_BURST_FOURTH_BIT_IDX 3 #define DEFAULT_SSB_PERIODICITY 5 -#define MAX_SIB_TX 4 +#define MAX_SIB_TX 8 namespace srsenb { namespace sched_nr_impl { @@ -135,7 +135,7 @@ si_sched::si_sched(const bwp_params_t& bwp_cfg_) : void si_sched::run_slot(bwp_slot_allocator& bwp_alloc) { - if (true) { + if (not bwp_alloc.cfg.cfg.pdcch.coreset_present[0]) { // CORESET#0 must be present, otherwise SIs are not allocated // TODO: provide proper config return; diff --git a/srsgnb/src/stack/rrc/rrc_nr.cc b/srsgnb/src/stack/rrc/rrc_nr.cc index e2069af70..2310ba8c2 100644 --- a/srsgnb/src/stack/rrc/rrc_nr.cc +++ b/srsgnb/src/stack/rrc/rrc_nr.cc @@ -340,7 +340,11 @@ int32_t rrc_nr::generate_sibs() // Log SIBs in JSON format fmt::memory_buffer strbuf; - fmt::format_to(strbuf, "SI message={} payload", msg_index); + if (msg_index == 0) { + fmt::format_to(strbuf, "SIB1 payload"); + } else { + fmt::format_to(strbuf, "SI message={} payload", msg_index + 1); + } log_rrc_message(fmt::to_string(strbuf), Tx, *cell_ctxt->sib_buffer.back(), msg[msg_index], ""); }