NR PHY workers TTI synchronization between DL and UL work

This commit is contained in:
Xavier Arteaga 2021-04-07 17:11:43 +02:00 committed by Xavier Arteaga
parent 991c6e7016
commit db1a1c059c
5 changed files with 14 additions and 3 deletions

View File

@ -57,8 +57,8 @@ private:
srslog::basic_logger& logger;
uint32_t tti_rx = 0;
cf_t* prach_ptr = nullptr;
float prach_power = 0;
cf_t* prach_ptr = nullptr;
float prach_power = 0;
};
} // namespace nr

View File

@ -60,7 +60,9 @@ public:
/// Physical layer higher layer configuration, provided by higher layers through configuration messages
srsran::phy_cfg_nr_t cfg = {};
uint16_t ra_rnti = 0;
/// Semaphore for aligning UL work
srsran::tti_semaphore<void*> dl_ul_semaphore;
uint32_t rar_grant_tti = 0;
state()

View File

@ -99,6 +99,7 @@ void cc_worker::set_tti(uint32_t tti)
{
dl_slot_cfg.idx = tti;
ul_slot_cfg.idx = TTI_TX(tti);
logger.set_context(tti);
}
cf_t* cc_worker::get_rx_buffer(uint32_t antenna_idx)

View File

@ -87,6 +87,10 @@ void sf_worker::work_imp()
w->work_dl();
}
// Align workers, wait for previous workers to finish DL processing before starting UL processing
phy_state->dl_ul_semaphore.wait(this);
phy_state->dl_ul_semaphore.release();
// Check if PRACH is available
if (prach_ptr != nullptr) {
// PRACH is available, set buffer, transmit and return

View File

@ -60,6 +60,10 @@ bool worker_pool::init(const phy_args_nr_t& args, phy_common* common, stack_inte
void worker_pool::start_worker(sf_worker* w)
{
// Push worker pointer for internal worker TTI synchronization
phy_state.dl_ul_semaphore.push(w);
// Signal worker to start processing asynchronously
pool.start_worker(w);
}