Skip to content

Commit 64d2b71

Browse files
author
Ismael
committed
Merge remote-tracking branch 'origin/sched_test_improv' into dev
2 parents b6ff4eb + a713130 commit 64d2b71

File tree

8 files changed

+391
-222
lines changed

8 files changed

+391
-222
lines changed

lib/scheduler/logging/scheduler_result_logger.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,17 @@ void scheduler_result_logger::log_debug(const sched_result& result, std::chrono:
302302
srs.sequence_id);
303303
}
304304

305+
if (log_broadcast) {
306+
for (const prach_occasion_info& prach : result.ul.prachs) {
307+
fmt::format_to(fmtbuf,
308+
"\n- PRACH: pci={} format={} nof_occasions={} nof_preambles={}",
309+
prach.pci,
310+
to_string(prach.format),
311+
prach.nof_prach_occasions,
312+
prach.nof_preamble_indexes);
313+
}
314+
}
315+
305316
if (fmtbuf.size() > 0) {
306317
const unsigned nof_pdschs = result.dl.paging_grants.size() + result.dl.rar_grants.size() +
307318
result.dl.ue_grants.size() + result.dl.bc.sibs.size();

lib/scheduler/policy/scheduler_time_rr.cpp

Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,21 @@ static unsigned compute_max_nof_rbs_per_ue_per_slot(const slice_ue_repository&
141141
return (std::min(bwp_crb_limits.length(), slice_max_rbs) / nof_ues_to_be_scheduled_per_slot);
142142
}
143143

144-
static bool can_allocate_dl_newtx(const slice_ue& ue_ref, ue_cell_index_t cell_index, srslog::basic_logger& logger)
144+
static bool can_allocate_dl_newtx(const ue_resource_grid_view& res_grid,
145+
const ue_cell& ue_cc,
146+
slot_point pdsch_slot,
147+
srslog::basic_logger& logger)
145148
{
146-
const ue_cell& ue_cc = ue_ref.get_cell(cell_index);
149+
srsran_assert(ue_cc.is_active() and not ue_cc.is_in_fallback_mode(),
150+
"policy scheduler called for UE={} in fallback",
151+
ue_cc.ue_index);
152+
153+
if (res_grid.has_ue_dl_pdcch(ue_cc.cell_index, ue_cc.rnti()) or
154+
not ue_cc.is_pdcch_enabled(res_grid.get_pdcch_slot(ue_cc.cell_index)) or not ue_cc.is_pdsch_enabled(pdsch_slot)) {
155+
// UE is either already allocated for this slot (e.g. a reTx already took place) or it is not active.
156+
return false;
157+
}
158+
147159
if (not ue_cc.harqs.has_empty_dl_harqs()) {
148160
// No empty HARQs are available. Log this occurrence.
149161
if (ue_cc.harqs.find_pending_dl_retx().has_value()) {
@@ -166,9 +178,21 @@ static bool can_allocate_dl_newtx(const slice_ue& ue_ref, ue_cell_index_t cell_i
166178
return true;
167179
}
168180

169-
static bool can_allocate_ul_newtx(const slice_ue& ue_ref, ue_cell_index_t cell_index, srslog::basic_logger& logger)
181+
static bool can_allocate_ul_newtx(const slice_ue& ue_ref,
182+
const ue_cell& ue_cc,
183+
slot_point pdcch_slot,
184+
slot_point pusch_slot,
185+
srslog::basic_logger& logger)
170186
{
171-
const ue_cell& ue_cc = ue_ref.get_cell(cell_index);
187+
srsran_assert(ue_cc.is_active() and not ue_cc.is_in_fallback_mode(),
188+
"policy scheduler called for UE={} in fallback",
189+
ue_cc.ue_index);
190+
191+
if (not ue_cc.is_pdcch_enabled(pdcch_slot) or not ue_cc.is_ul_enabled(pusch_slot)) {
192+
// Either the PDCCH slot or PUSCH slots are not available.
193+
return false;
194+
}
195+
172196
if (not ue_cc.harqs.has_empty_ul_harqs()) {
173197
// No empty HARQs are available. Log this occurrence.
174198
if (ue_cc.harqs.find_pending_ul_retx().has_value()) {
@@ -287,18 +311,8 @@ static dl_alloc_result alloc_dl_ue_newtx(const slice_ue& u,
287311
// Prioritize PCell over SCells.
288312
for (unsigned i = 0; i != u.nof_cells(); ++i) {
289313
const ue_cell& ue_cc = u.get_cell(to_ue_cell_index(i));
290-
srsran_assert(ue_cc.is_active() and not ue_cc.is_in_fallback_mode(),
291-
"policy scheduler called for UE={} in fallback",
292-
ue_cc.ue_index);
293-
294-
if (res_grid.has_ue_dl_pdcch(ue_cc.cell_index, u.crnti()) or
295-
not ue_cc.is_pdcch_enabled(res_grid.get_pdcch_slot(ue_cc.cell_index)) or
296-
not ue_cc.is_pdsch_enabled(slice_candidate.get_slot_tx())) {
297-
// UE is either already allocated for this slot (e.g. a reTx already took place) or it is not active.
298-
return {alloc_status::skip_ue};
299-
}
300314

301-
if (can_allocate_dl_newtx(u, to_ue_cell_index(i), logger)) {
315+
if (can_allocate_dl_newtx(res_grid, ue_cc, slice_candidate.get_slot_tx(), logger)) {
302316
ue_pdsch_grant grant{&u, ue_cc.cell_index, INVALID_HARQ_ID, u.pending_dl_newtx_bytes(), max_pdsch_rbs};
303317
const dl_alloc_result result = pdsch_alloc.allocate_dl_grant(grant);
304318
// If the allocation failed due to invalid parameters, we continue iteration.
@@ -372,17 +386,9 @@ static ul_alloc_result alloc_ul_ue_newtx(const slice_ue& u,
372386
// Prioritize PCell over SCells.
373387
for (unsigned i = 0; i != u.nof_cells(); ++i) {
374388
const ue_cell& ue_cc = u.get_cell(to_ue_cell_index(i));
375-
srsran_assert(ue_cc.is_active() and not ue_cc.is_in_fallback_mode(),
376-
"policy scheduler called for UE={} in fallback",
377-
ue_cc.ue_index);
378-
379-
if (not ue_cc.is_pdcch_enabled(res_grid.get_pdcch_slot(ue_cc.cell_index)) or
380-
not ue_cc.is_ul_enabled(slice_candidate.get_slot_tx())) {
381-
// Either the PDCCH slot or PUSCH slots are not available.
382-
continue;
383-
}
384389

385-
if (can_allocate_ul_newtx(u, to_ue_cell_index(i), logger)) {
390+
if (can_allocate_ul_newtx(
391+
u, ue_cc, res_grid.get_pdcch_slot(ue_cc.cell_index), slice_candidate.get_slot_tx(), logger)) {
386392
ue_pusch_grant grant{&u, ue_cc.cell_index, INVALID_HARQ_ID, pending_newtx_bytes, max_grant_rbs};
387393
const ul_alloc_result result = pusch_alloc.allocate_ul_grant(grant);
388394
// If the allocation failed due to invalid parameters, we continue iteration.

lib/scheduler/policy/ue_allocator.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "../ue_context/ue.h"
1616
#include "../ue_scheduling/ue_repository.h"
1717
#include "../ue_scheduling/ue_scheduler.h"
18-
#include "srsran/ran/slot_point.h"
1918

2019
namespace srsran {
2120

lib/scheduler/ue_context/ue_cell.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ class ue_cell
147147

148148
const ue_link_adaptation_controller& link_adaptation_controller() const { return ue_mcs_calculator; }
149149

150-
ul_power_controller& get_ul_power_controller() { return ul_pwr_controller; }
150+
ul_power_controller& get_ul_power_controller() { return ul_pwr_controller; }
151+
const ul_power_controller& get_ul_power_controller() const { return ul_pwr_controller; }
151152

152153
/// \brief Returns an estimated DL rate in bytes per slot based on the given input parameters.
153154
double get_estimated_dl_rate(const pdsch_config_params& pdsch_cfg, sch_mcs_index mcs, unsigned nof_prbs) const;

0 commit comments

Comments
 (0)