sched,nr: fix softbuffer dimensioning for NR scheduler. Renamed sched_nr_rb_grid file

master
Francisco Paisana 3 years ago
parent 4795f57da0
commit eecfee365b

@ -18,6 +18,8 @@
extern "C" { extern "C" {
#include "srsran/phy/common/phy_common_nr.h" #include "srsran/phy/common/phy_common_nr.h"
#include "srsran/phy/fec/softbuffer.h" #include "srsran/phy/fec/softbuffer.h"
#include "srsran/phy/phch/sch_nr.h"
#include "srsran/phy/utils/vector.h"
} }
namespace srsenb { namespace srsenb {
@ -26,7 +28,11 @@ class tx_harq_softbuffer
{ {
public: public:
tx_harq_softbuffer() { bzero(&buffer, sizeof(buffer)); } tx_harq_softbuffer() { bzero(&buffer, sizeof(buffer)); }
explicit tx_harq_softbuffer(uint32_t nof_prb_) { srsran_softbuffer_tx_init(&buffer, nof_prb_); } explicit tx_harq_softbuffer(uint32_t nof_prb_)
{
// Note: for now we use same size regardless of nof_prb_
srsran_softbuffer_tx_init_guru(&buffer, SRSRAN_SCH_NR_MAX_NOF_CB_LDPC, SRSRAN_LDPC_MAX_LEN_ENCODED_CB);
}
tx_harq_softbuffer(const tx_harq_softbuffer&) = delete; tx_harq_softbuffer(const tx_harq_softbuffer&) = delete;
tx_harq_softbuffer(tx_harq_softbuffer&& other) noexcept tx_harq_softbuffer(tx_harq_softbuffer&& other) noexcept
{ {
@ -64,7 +70,11 @@ class rx_harq_softbuffer
{ {
public: public:
rx_harq_softbuffer() { bzero(&buffer, sizeof(buffer)); } rx_harq_softbuffer() { bzero(&buffer, sizeof(buffer)); }
explicit rx_harq_softbuffer(uint32_t nof_prb_) { srsran_softbuffer_rx_init(&buffer, nof_prb_); } explicit rx_harq_softbuffer(uint32_t nof_prb_)
{
// Note: for now we use same size regardless of nof_prb_
srsran_softbuffer_rx_init_guru(&buffer, SRSRAN_SCH_NR_MAX_NOF_CB_LDPC, SRSRAN_LDPC_MAX_LEN_ENCODED_CB);
}
rx_harq_softbuffer(const rx_harq_softbuffer&) = delete; rx_harq_softbuffer(const rx_harq_softbuffer&) = delete;
rx_harq_softbuffer(rx_harq_softbuffer&& other) noexcept rx_harq_softbuffer(rx_harq_softbuffer&& other) noexcept
{ {

@ -14,7 +14,7 @@
#define SRSRAN_SCHED_NR_CELL_H #define SRSRAN_SCHED_NR_CELL_H
#include "sched_nr_cfg.h" #include "sched_nr_cfg.h"
#include "sched_nr_rb_grid.h" #include "sched_nr_grant_allocator.h"
#include "srsran/adt/pool/cached_alloc.h" #include "srsran/adt/pool/cached_alloc.h"
namespace srsenb { namespace srsenb {

@ -10,8 +10,8 @@
* *
*/ */
#ifndef SRSRAN_SCHED_NR_RB_GRID_H #ifndef SRSRAN_SCHED_NR_GRANT_ALLOCATOR_H
#define SRSRAN_SCHED_NR_RB_GRID_H #define SRSRAN_SCHED_NR_GRANT_ALLOCATOR_H
#include "../sched_common.h" #include "../sched_common.h"
#include "lib/include/srsran/adt/circular_array.h" #include "lib/include/srsran/adt/circular_array.h"
@ -108,4 +108,4 @@ private:
} // namespace sched_nr_impl } // namespace sched_nr_impl
} // namespace srsenb } // namespace srsenb
#endif // SRSRAN_SCHED_NR_RB_GRID_H #endif // SRSRAN_SCHED_NR_GRANT_ALLOCATOR_H

@ -0,0 +1,8 @@
//
// Created by xico on 30/07/21.
//
#ifndef SRSRAN_SCHED_NR_TIME_RR_H
#define SRSRAN_SCHED_NR_TIME_RR_H
#endif //SRSRAN_SCHED_NR_TIME_RR_H

@ -15,7 +15,7 @@
#include "sched_nr_cell.h" #include "sched_nr_cell.h"
#include "sched_nr_cfg.h" #include "sched_nr_cfg.h"
#include "sched_nr_rb_grid.h" #include "sched_nr_grant_allocator.h"
#include "sched_nr_ue.h" #include "sched_nr_ue.h"
#include "srsran/adt/circular_array.h" #include "srsran/adt/circular_array.h"
#include "srsran/adt/optional.h" #include "srsran/adt/optional.h"
@ -71,7 +71,7 @@ private:
srsran::deque<feedback_t> pending_feedback, tmp_feedback_to_run; srsran::deque<feedback_t> pending_feedback, tmp_feedback_to_run;
srsran::deque<srsran::move_callback<void()> > pending_events, tmp_events_to_run; srsran::deque<srsran::move_callback<void()> > pending_events, tmp_events_to_run;
srsran::static_circular_map<uint16_t, slot_ue, SCHED_NR_MAX_USERS> slot_ues; slot_ue_map_t slot_ues;
}; };
class sched_worker_manager class sched_worker_manager

@ -11,7 +11,7 @@ set(SOURCES mac_nr.cc
sched_nr.cc sched_nr.cc
sched_nr_ue.cc sched_nr_ue.cc
sched_nr_worker.cc sched_nr_worker.cc
sched_nr_rb_grid.cc sched_nr_grant_allocator.cc
sched_nr_harq.cc sched_nr_harq.cc
sched_nr_pdcch.cc sched_nr_pdcch.cc
sched_nr_cfg.cc sched_nr_cfg.cc

@ -10,7 +10,7 @@
* *
*/ */
#include "srsenb/hdr/stack/mac/nr/sched_nr_rb_grid.h" #include "srsenb/hdr/stack/mac/nr/sched_nr_grant_allocator.h"
#include "srsenb/hdr/stack/mac/nr/sched_nr_cell.h" #include "srsenb/hdr/stack/mac/nr/sched_nr_cell.h"
#include "srsenb/hdr/stack/mac/nr/sched_nr_helpers.h" #include "srsenb/hdr/stack/mac/nr/sched_nr_helpers.h"
@ -289,6 +289,11 @@ alloc_result bwp_slot_allocator::alloc_pusch(slot_ue& ue, const prb_grant& ul_pr
bool success = ue.cfg->phy().get_pusch_cfg(slot_cfg, pdcch.dci, pusch.sch); bool success = ue.cfg->phy().get_pusch_cfg(slot_cfg, pdcch.dci, pusch.sch);
srsran_assert(success, "Error converting DCI to PUSCH grant"); srsran_assert(success, "Error converting DCI to PUSCH grant");
pusch.sch.grant.tb[0].softbuffer.rx = ue.h_ul->get_softbuffer().get(); pusch.sch.grant.tb[0].softbuffer.rx = ue.h_ul->get_softbuffer().get();
if (ue.h_ul->nof_retx() == 0) {
ue.h_ul->set_tbs(pusch.sch.grant.tb[0].tbs); // update HARQ with correct TBS
} else {
srsran_assert(pusch.sch.grant.tb[0].tbs == (int)ue.h_ul->tbs(), "The TBS did not remain constant in retx");
}
return alloc_result::success; return alloc_result::success;
} }

@ -0,0 +1,4 @@
//
// Created by xico on 30/07/21.
//

@ -155,14 +155,15 @@ void slot_cc_worker::log_result() const
if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) { if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) {
const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti]; const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti];
fmt::format_to(fmtbuf, fmt::format_to(fmtbuf,
"SCHED: DL {}, cc={}, rnti=0x{:x}, pid={}, nrtx={}, f={}, dai={}, tti_pdsch={}, tti_ack={}", "SCHED: DL {}, cc={}, rnti=0x{:x}, pid={}, f={}, nrtx={}, dai={}, tbs={}, tti_pdsch={}, tti_ack={}",
ue.h_dl->nof_retx() == 0 ? "tx" : "retx", ue.h_dl->nof_retx() == 0 ? "tx" : "retx",
cell.cfg.cc, cell.cfg.cc,
ue.rnti, ue.rnti,
pdcch.dci.pid, pdcch.dci.pid,
ue.h_dl->nof_retx(),
srsran_dci_format_nr_string(pdcch.dci.ctx.format), srsran_dci_format_nr_string(pdcch.dci.ctx.format),
ue.h_dl->nof_retx(),
pdcch.dci.dai, pdcch.dci.dai,
ue.h_dl->tbs(),
ue.pdsch_slot, ue.pdsch_slot,
ue.uci_slot); ue.uci_slot);
} else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_ra) { } else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_ra) {
@ -178,13 +179,14 @@ void slot_cc_worker::log_result() const
if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) { if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_c) {
const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti]; const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti];
fmt::format_to(fmtbuf, fmt::format_to(fmtbuf,
"SCHED: UL {}, cc={}, rnti=0x{:x}, pid={}, nrtx={}, f={}, tti_pusch={}", "SCHED: UL {}, cc={}, rnti=0x{:x}, pid={}, f={}, nrtx={}, tbs={}, tti_pusch={}",
ue.h_dl->nof_retx() == 0 ? "tx" : "retx", ue.h_dl->nof_retx() == 0 ? "tx" : "retx",
cell.cfg.cc, cell.cfg.cc,
ue.rnti, ue.rnti,
pdcch.dci.pid, pdcch.dci.pid,
ue.h_dl->nof_retx(),
srsran_dci_format_nr_string(pdcch.dci.ctx.format), srsran_dci_format_nr_string(pdcch.dci.ctx.format),
ue.h_dl->nof_retx(),
ue.h_ul->tbs(),
ue.pusch_slot); ue.pusch_slot);
} else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_tc) { } else if (pdcch.dci.ctx.rnti_type == srsran_rnti_type_tc) {
const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti]; const slot_ue& ue = slot_ues[pdcch.dci.ctx.rnti];

@ -11,7 +11,7 @@
*/ */
#include "sched_nr_ue_ded_test_suite.h" #include "sched_nr_ue_ded_test_suite.h"
#include "srsenb/hdr/stack/mac/nr/sched_nr_rb_grid.h" #include "srsenb/hdr/stack/mac/nr/sched_nr_grant_allocator.h"
#include "srsran/common/test_common.h" #include "srsran/common/test_common.h"
namespace srsenb { namespace srsenb {

Loading…
Cancel
Save