srsLTE/srsue/hdr/phy/nr/sf_worker.h

67 lines
1.7 KiB
C
Raw Normal View History

/**
2020-11-18 03:43:44 -08:00
*
* \section COPYRIGHT
2020-11-18 03:43:44 -08:00
*
2021-03-19 03:45:56 -07:00
* Copyright 2013-2021 Software Radio Systems Limited
2020-11-18 03:43:44 -08:00
*
* 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.
2020-11-18 03:43:44 -08:00
*
*/
#ifndef SRSUE_NR_PHCH_WORKER_H
#define SRSUE_NR_PHCH_WORKER_H
#include "../phy_common.h"
#include "cc_worker.h"
2021-03-19 03:45:56 -07:00
#include "srsran/common/thread_pool.h"
2020-11-18 03:43:44 -08:00
namespace srsue {
namespace nr {
/**
* The sf_worker class handles the PHY processing, UL and DL procedures associated with 1 subframe.
* It contains multiple cc_worker objects, one for each component carrier which may be executed in
* one or multiple threads.
*
* A sf_worker object is executed by a thread within the thread_pool.
*/
2021-03-19 03:45:56 -07:00
class sf_worker final : public srsran::thread_pool::worker
2020-11-18 03:43:44 -08:00
{
public:
sf_worker(phy_common* phy, state* phy_state_, srslog::basic_logger& logger);
2020-11-18 03:43:44 -08:00
~sf_worker() = default;
2021-03-19 03:45:56 -07:00
bool set_carrier_unlocked(uint32_t cc_idx, const srsran_carrier_nr_t* carrier_);
2020-11-18 03:43:44 -08:00
/* Functions used by main PHY thread */
cf_t* get_buffer(uint32_t cc_idx, uint32_t antenna_idx);
uint32_t get_buffer_len();
void set_tti(uint32_t tti);
int read_pdsch_d(cf_t* pdsch_d);
void start_plot();
2020-11-18 03:43:44 -08:00
void set_prach(cf_t* prach_ptr, float prach_power);
2020-11-18 03:43:44 -08:00
private:
/* Inherited from thread_pool::worker. Function called every subframe to run the DL/UL processing */
void work_imp() override;
std::vector<std::unique_ptr<cc_worker> > cc_workers;
2021-02-01 10:26:10 -08:00
phy_common* phy = nullptr;
state* phy_state = nullptr;
2021-02-01 10:26:10 -08:00
srslog::basic_logger& logger;
uint32_t tti_rx = 0;
cf_t* prach_ptr = nullptr;
float prach_power = 0;
2020-11-18 03:43:44 -08:00
};
} // namespace nr
} // namespace srsue
#endif // SRSUE_NR_PHCH_WORKER_H