srsgnb,sched: mark as occupied the resources used by SSB before scheduling other PDSCH (eg SIB1). Prevents overlapping SIB1 PDSCH with SSB

master
Ismael Gomez 3 years ago committed by Andre Puschmann
parent ce731c851c
commit fef61554b2

@ -57,6 +57,8 @@ struct bwp_slot_grid {
explicit bwp_slot_grid(const bwp_params_t& bwp_params, uint32_t slot_idx_);
void reset();
void reserve_pdsch(const prb_grant& grant) { pdschs.reserve_prbs(grant); }
bool is_dl() const { return cfg->slots[slot_idx].is_dl; }
bool is_ul() const { return cfg->slots[slot_idx].is_ul; }
};

@ -46,6 +46,9 @@ public:
return dl_prbs.prbs();
}
/// Marks a range of PRBS as occupied, preventing further allocations
void reserve_prbs(const prb_grant& grant) { dl_prbs |= grant; }
/// Verifies if the input arguments are valid for an SI allocation and grant doesnt collide with other grants
alloc_result is_si_grant_valid(uint32_t ss_id, const prb_grant& grant) const;

@ -96,6 +96,17 @@ void sched_dl_signalling(bwp_slot_allocator& bwp_alloc)
// Schedule SSB
sched_ssb_basic(sl_pdcch, bwp_params.cell_cfg.ssb.periodicity_ms, bwp_params.cell_cfg.mib, sl_grid.dl.phy.ssb);
// Mark SSB region as occupied
if (!sl_grid.dl.phy.ssb.empty()) {
float ssb_offset_hz =
bwp_params.cell_cfg.carrier.ssb_center_freq_hz - bwp_params.cell_cfg.carrier.dl_center_frequency_hz;
int ssb_offset_rb = ceil(ssb_offset_hz / (15000.0f * 12));
int ssb_start_rb = bwp_params.cell_cfg.carrier.nof_prb / 2 + ssb_offset_rb - 10;
uint32_t ssb_len_rb = 20;
assert(ssb_start_rb >= 0 && ssb_start_rb + ssb_len_rb < bwp_params.cell_cfg.carrier.nof_prb);
sl_grid.reserve_pdsch(prb_grant({(uint32_t)ssb_start_rb, ssb_start_rb + ssb_len_rb}));
}
// Schedule NZP-CSI-RS
sched_nzp_csi_rs(bwp_params.cfg.pdsch.nzp_csi_rs_sets, cfg, sl_grid.dl.phy.nzp_csi_rs);
}
@ -150,12 +161,10 @@ void si_sched::run_slot(bwp_slot_allocator& bwp_alloc)
}
} else if (si.win_start + si.win_len_slots >= sl_pdcch) {
// If end of SI message window
if (si.n == 0) {
logger.error("SCHED: Could not allocate SIB1, len=%d. Cause: %s", si.len_bytes, to_string(si.result));
} else {
srsran_always_assert(
si.n == 0, "SCHED: Could not allocate SIB1, len=%d. Cause: %s", si.len_bytes, to_string(si.result));
logger.warning(
"SCHED: Could not allocate SI message idx=%d, len=%d. Cause: %s", si.n, si.len_bytes, to_string(si.result));
}
si.win_start.clear();
}
}

@ -74,9 +74,15 @@ dl_sched_res_t* cc_worker::run_slot(slot_point tx_sl, ue_map_t& ue_db)
// Log UEs state for slot
log_sched_slot_ues(logger, tx_sl, cfg.cc, slot_ues);
const uint32_t ss_id = 0;
slot_point sl_pdcch = bwp_alloc.get_pdcch_tti();
prb_bitmap prbs_before = bwp_alloc.res_grid()[sl_pdcch].pdschs.occupied_prbs(ss_id, srsran_dci_format_nr_1_0);
// Allocate cell DL signalling
sched_dl_signalling(bwp_alloc);
prb_bitmap prbs_after = bwp_alloc.res_grid()[sl_pdcch].pdschs.occupied_prbs(ss_id, srsran_dci_format_nr_1_0);
// Allocate pending SIBs
bwps[0].si.run_slot(bwp_alloc);

Loading…
Cancel
Save