From f97b92abd048b1ba73ba3f5ec6d8bf23e1a2faec Mon Sep 17 00:00:00 2001 From: Francisco Paisana Date: Sun, 3 Oct 2021 10:58:18 +0100 Subject: [PATCH] sched,nr: fix nzp csi rs allocation in NR scheduler --- .gdbinit | 11 +++++------ srsenb/src/stack/mac/nr/sched_nr_grant_allocator.cc | 6 +++--- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/.gdbinit b/.gdbinit index 6e3a249dd..bb7d55da3 100644 --- a/.gdbinit +++ b/.gdbinit @@ -20,7 +20,7 @@ class BoundedVectorPrinter(object): self.value_type = self.val.type.template_argument(0) def children(self): - start = self.val['buffer'].cast(self.value_type.pointer()) + start = self.val['buffer']['_M_elems'].cast(self.value_type.pointer()) length = int(self.val['size_']) for idx in range(length): yield f'[{idx}]', start[idx] @@ -33,11 +33,10 @@ class BoundedVectorPrinter(object): def display_hint(self): return 'array' - @staticmethod - def make(val): - if str(val.type).startswith('srsran::bounded_vector<'): - return BoundedVectorPrinter(val) +def make_bounded_vector(val): + if 'bounded_vector<' in str(val.type): + return BoundedVectorPrinter(val) -gdb.pretty_printers.append(BoundedVectorPrinter.make) +gdb.pretty_printers.append(make_bounded_vector) end diff --git a/srsenb/src/stack/mac/nr/sched_nr_grant_allocator.cc b/srsenb/src/stack/mac/nr/sched_nr_grant_allocator.cc index b5988c9dd..0bffc4044 100644 --- a/srsenb/src/stack/mac/nr/sched_nr_grant_allocator.cc +++ b/srsenb/src/stack/mac/nr/sched_nr_grant_allocator.cc @@ -144,7 +144,7 @@ alloc_result bwp_slot_allocator::alloc_rar_and_msg3(uint16_t bwp_pdcch_slot.pdschs.emplace_back(); pdsch_t& pdsch = bwp_pdcch_slot.pdschs.back(); srsran_slot_cfg_t slot_cfg; - slot_cfg.idx = pdcch_slot.slot_idx(); + slot_cfg.idx = pdcch_slot.to_uint(); bool success = phy_cfg.get_pdsch_cfg(slot_cfg, pdcch.dci, pdsch.sch); srsran_assert(success, "Error converting DCI to grant"); pdsch.sch.grant.tb[0].softbuffer.tx = bwp_pdcch_slot.rar_softbuffer->get(); @@ -152,7 +152,7 @@ alloc_result bwp_slot_allocator::alloc_rar_and_msg3(uint16_t // Generate Msg3 grants in PUSCH uint32_t last_msg3 = msg3_rbs.start(); const int mcs = 0, max_harq_msg3_retx = 4; - slot_cfg.idx = msg3_slot.slot_idx(); + slot_cfg.idx = msg3_slot.to_uint(); bwp_pdcch_slot.rar.emplace_back(); sched_nr_interface::sched_rar_t& rar_out = bwp_pdcch_slot.rar.back(); for (const dl_sched_rar_info_t& grant : pending_rars) { @@ -252,7 +252,7 @@ alloc_result bwp_slot_allocator::alloc_pdsch(slot_ue& ue, const prb_grant& dl_gr bwp_pdsch_slot.pdschs.emplace_back(); pdsch_t& pdsch = bwp_pdsch_slot.pdschs.back(); srsran_slot_cfg_t slot_cfg; - slot_cfg.idx = ue.pdsch_slot.slot_idx(); + slot_cfg.idx = ue.pdsch_slot.to_uint(); bool ret = ue.cfg->phy().get_pdsch_cfg(slot_cfg, pdcch.dci, pdsch.sch); srsran_assert(ret, "Error converting DCI to grant"); pdsch.sch.grant.tb[0].softbuffer.tx = ue.h_dl->get_softbuffer().get();