mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.1 KiB
C
88 lines
2.1 KiB
C
3 years ago
|
/**
|
||
|
*
|
||
|
* \section COPYRIGHT
|
||
|
*
|
||
|
* Copyright 2013-2021 Software Radio Systems Limited
|
||
|
*
|
||
|
* By using this file, you agree to the terms and conditions set
|
||
|
* forth in the LICENSE file which can be found at the top level of
|
||
|
* the distribution.
|
||
|
*
|
||
|
*/
|
||
|
|
||
3 years ago
|
#ifndef SRSRAN_SCHED_NR_CELL_H
|
||
|
#define SRSRAN_SCHED_NR_CELL_H
|
||
3 years ago
|
|
||
|
#include "sched_nr_cfg.h"
|
||
|
#include "sched_nr_rb_grid.h"
|
||
|
#include "srsran/adt/pool/cached_alloc.h"
|
||
|
|
||
|
namespace srsenb {
|
||
|
namespace sched_nr_impl {
|
||
|
|
||
|
using dl_sched_rar_info_t = sched_nr_interface::dl_sched_rar_info_t;
|
||
|
|
||
|
struct pending_rar_t {
|
||
|
uint16_t ra_rnti = 0;
|
||
|
tti_point prach_tti;
|
||
|
srsran::bounded_vector<dl_sched_rar_info_t, sched_interface::MAX_RAR_LIST> msg3_grant;
|
||
|
};
|
||
|
|
||
|
/// RAR/Msg3 scheduler
|
||
|
class ra_sched
|
||
|
{
|
||
|
public:
|
||
3 years ago
|
explicit ra_sched(const bwp_params& bwp_cfg_);
|
||
3 years ago
|
|
||
|
int dl_rach_info(const dl_sched_rar_info_t& rar_info);
|
||
|
void run_slot(bwp_slot_allocator& slot_grid);
|
||
|
size_t empty() const { return pending_rars.empty(); }
|
||
|
|
||
|
private:
|
||
|
alloc_result
|
||
|
allocate_pending_rar(bwp_slot_allocator& slot_grid, const pending_rar_t& rar, uint32_t& nof_grants_alloc);
|
||
|
|
||
3 years ago
|
const bwp_params* bwp_cfg = nullptr;
|
||
|
srslog::basic_logger& logger;
|
||
3 years ago
|
|
||
|
srsran::deque<pending_rar_t> pending_rars;
|
||
|
};
|
||
|
|
||
3 years ago
|
class bwp_ctxt
|
||
3 years ago
|
{
|
||
|
public:
|
||
3 years ago
|
explicit bwp_ctxt(const bwp_params& bwp_cfg);
|
||
3 years ago
|
|
||
3 years ago
|
const bwp_params* cfg;
|
||
3 years ago
|
|
||
|
// channel-specific schedulers
|
||
|
ra_sched ra;
|
||
|
|
||
3 years ago
|
// Stores pending allocations and PRB bitmaps
|
||
3 years ago
|
bwp_res_grid grid;
|
||
|
};
|
||
|
|
||
3 years ago
|
class serv_cell_manager
|
||
3 years ago
|
{
|
||
|
public:
|
||
3 years ago
|
using feedback_callback_t = srsran::move_callback<void(ue_carrier&)>;
|
||
|
|
||
|
explicit serv_cell_manager(const sched_cell_params& cell_cfg_);
|
||
|
|
||
|
void add_user(uint16_t rnti, ue_carrier* ue);
|
||
|
void rem_user(uint16_t rnti);
|
||
|
|
||
3 years ago
|
srsran::bounded_vector<bwp_ctxt, SCHED_NR_MAX_BWP_PER_CELL> bwps;
|
||
3 years ago
|
const sched_cell_params& cfg;
|
||
3 years ago
|
|
||
3 years ago
|
srsran::static_circular_map<uint16_t, ue_carrier*, SCHED_NR_MAX_USERS> ues;
|
||
3 years ago
|
|
||
3 years ago
|
private:
|
||
|
srslog::basic_logger& logger;
|
||
3 years ago
|
};
|
||
|
|
||
|
} // namespace sched_nr_impl
|
||
|
} // namespace srsenb
|
||
|
|
||
3 years ago
|
#endif // SRSRAN_SCHED_NR_CELL_H
|