sched,nr: implement methods to fill nzp csi-rs in scheduler

This commit is contained in:
Francisco Paisana 2021-09-28 11:57:45 +02:00
parent a8f58f503c
commit d927b779dc
6 changed files with 109 additions and 4 deletions

View File

@ -30,12 +30,16 @@ const static size_t MAX_GRANTS = sched_nr_interface::MAX_GRANTS;
using pdcch_dl_t = mac_interface_phy_nr::pdcch_dl_t;
using pdcch_ul_t = mac_interface_phy_nr::pdcch_ul_t;
using pdsch_t = mac_interface_phy_nr::pdsch_t;
using pusch_t = mac_interface_phy_nr::pusch_t;
using pucch_t = mac_interface_phy_nr::pucch_t;
using pdcch_dl_list_t = srsran::bounded_vector<pdcch_dl_t, MAX_GRANTS>;
using pdcch_ul_list_t = srsran::bounded_vector<pdcch_ul_t, MAX_GRANTS>;
using pucch_t = mac_interface_phy_nr::pucch_t;
using pucch_list_t = srsran::bounded_vector<pucch_t, MAX_GRANTS>;
using pusch_t = mac_interface_phy_nr::pusch_t;
using pusch_list_t = srsran::bounded_vector<pusch_t, MAX_GRANTS>;
using nzp_csi_rs_list = srsran::bounded_vector<srsran_csi_rs_nzp_resource_t, mac_interface_phy_nr::MAX_NZP_CSI_RS>;
using ssb_t = mac_interface_phy_nr::ssb_t;
using ssb_list = srsran::bounded_vector<ssb_t, mac_interface_phy_nr::MAX_SSB>;
using sched_cfg_t = sched_nr_interface::sched_cfg_t;
using cell_cfg_t = sched_nr_interface::cell_cfg_t;

View File

@ -23,6 +23,7 @@
namespace srsenb {
namespace sched_nr_impl {
// typedefs
using dl_sched_rar_info_t = sched_nr_interface::dl_sched_rar_info_t;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -30,7 +31,6 @@ using dl_sched_rar_info_t = sched_nr_interface::dl_sched_rar_info_t;
const static size_t MAX_CORESET_PER_BWP = 3;
using slot_coreset_list = std::array<srsran::optional<coreset_region>, MAX_CORESET_PER_BWP>;
using pdsch_t = mac_interface_phy_nr::pdsch_t;
using pdsch_list_t = srsran::bounded_vector<pdsch_t, MAX_GRANTS>;
using sched_rar_list_t = sched_nr_interface::sched_rar_list_t;
using pucch_list_t = srsran::bounded_vector<pucch_t, MAX_GRANTS>;
@ -47,6 +47,8 @@ struct bwp_slot_grid {
bwp_rb_bitmap dl_prbs;
bwp_rb_bitmap ul_prbs;
ssb_list ssb;
nzp_csi_rs_list nzp_csi_rs;
pdcch_dl_list_t dl_pdcchs;
pdcch_ul_list_t ul_pdcchs;
pdsch_list_t pdschs;

View File

@ -0,0 +1,36 @@
/**
*
* \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.
*
*/
#ifndef SRSRAN_SCHED_NR_SIGNALLING_H
#define SRSRAN_SCHED_NR_SIGNALLING_H
#include "sched_nr_cfg.h"
#include "sched_nr_interface.h"
namespace srsenb {
namespace sched_nr_impl {
/// Schedule NZP-CSI-RS resources for given slot
void sched_nzp_csi_rs(srsran::const_span<srsran_csi_rs_nzp_set_t> nzp_csi_rs_sets,
const srsran_slot_cfg_t& slot_cfg,
nzp_csi_rs_list& csi_rs_list);
/// For a given BWP and slot, schedule SSB, NZP CSI RS and SIBs
void sched_dl_signalling(const bwp_params& bwp_params,
slot_point sl_pdcch,
ssb_list& ssb_list,
nzp_csi_rs_list& nzp_csi_rs);
} // namespace sched_nr_impl
} // namespace srsenb
#endif // SRSRAN_SCHED_NR_SIGNALLING_H

View File

@ -19,7 +19,8 @@ set(SOURCES mac_nr.cc
sched_nr_cell.cc
sched_nr_rb.cc
sched_nr_time_rr.cc
harq_softbuffer.cc)
harq_softbuffer.cc
sched_nr_signalling.cc)
add_library(srsgnb_mac STATIC ${SOURCES})
target_link_libraries(srsgnb_mac srsenb_mac_common)

View File

@ -0,0 +1,55 @@
/**
*
* \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.
*
*/
#include "srsenb/hdr/stack/mac/nr/sched_nr_signalling.h"
namespace srsenb {
namespace sched_nr_impl {
void sched_nzp_csi_rs(srsran::const_span<srsran_csi_rs_nzp_set_t> nzp_csi_rs_sets_cfg,
const srsran_slot_cfg_t& slot_cfg,
nzp_csi_rs_list& csi_rs_list)
{
for (const srsran_csi_rs_nzp_set_t& set : nzp_csi_rs_sets_cfg) {
// For each NZP-CSI-RS resource available in the set
for (uint32_t i = 0; i < set.count; ++i) {
// Select resource
const srsran_csi_rs_nzp_resource_t& nzp_csi_resource = set.data[i];
// Check if the resource is scheduled for this slot
if (srsran_csi_rs_send(&nzp_csi_resource.periodicity, &slot_cfg)) {
csi_rs_list.push_back(nzp_csi_resource);
}
}
}
}
void sched_dl_signalling(const bwp_params& bwp_params,
slot_point sl_pdcch,
ssb_list& ssb_list,
nzp_csi_rs_list& nzp_csi_rs)
{
srsran_slot_cfg_t cfg;
cfg.idx = sl_pdcch.to_uint();
// Schedule SSB
// TODO
// Schedule NZP-CSI-RS
sched_nzp_csi_rs(bwp_params.cfg.pdsch.nzp_csi_rs_sets, cfg, nzp_csi_rs);
// Schedule SIBs
// TODO
}
} // namespace sched_nr_impl
} // namespace srsenb

View File

@ -11,6 +11,7 @@
*/
#include "srsenb/hdr/stack/mac/nr/sched_nr_worker.h"
#include "srsenb/hdr/stack/mac/nr/sched_nr_signalling.h"
#include "srsran/common/string_helpers.h"
namespace srsenb {
@ -255,6 +256,12 @@ void sched_worker_manager::update_ue_db(slot_point slot_tx, bool locked_context)
void sched_worker_manager::run_slot(slot_point slot_tx, uint32_t cc, dl_sched_res_t& dl_res, ul_sched_t& ul_res)
{
// Fill DL signalling messages that do not depend on UEs state
serv_cell_manager& serv_cell = *cells[cc];
bwp_slot_grid& bwp_slot = serv_cell.bwps[0].grid[slot_tx];
sched_dl_signalling(*serv_cell.bwps[0].cfg, slot_tx, bwp_slot.ssb, bwp_slot.nzp_csi_rs);
// Synchronization point between CC workers, to avoid concurrency in UE state access
srsran::bounded_vector<std::condition_variable*, SRSRAN_MAX_CARRIERS> waiting_cvars;
{
std::unique_lock<std::mutex> lock(slot_mutex);