Agora  1.2.0
Agora project
txrx_worker_client_sim.h
Go to the documentation of this file.
1 
6 #ifndef TXRX_WORKER_CLIENT_SIM_H_
7 #define TXRX_WORKER_CLIENT_SIM_H_
8 
9 #include <memory>
10 #include <vector>
11 
12 #include "message.h"
13 #include "txrx_worker.h"
14 #include "udp_comm.h"
15 
17  public:
18  TxRxWorkerClientSim(size_t core_offset, size_t tid, size_t interface_count,
19  size_t interface_offset, Config* const config,
20  size_t* rx_frame_start,
23  moodycamel::ProducerToken& tx_producer,
24  moodycamel::ProducerToken& notify_producer,
25  std::vector<RxPacket>& rx_memory,
26  std::byte* const tx_memory, std::mutex& sync_mutex,
27  std::condition_variable& sync_cond,
28  std::atomic<bool>& can_proceed);
29  TxRxWorkerClientSim() = delete;
30  ~TxRxWorkerClientSim() final;
31 
32  void DoTxRx() final;
33 
34  private:
35  size_t DequeueSend();
36  std::vector<Packet*> RecvEnqueue(size_t interface_id);
37 
38  //1 for each responsible interface (ie radio)
39  std::vector<std::unique_ptr<UDPComm>> udp_comm_;
40 
41  //Helper tx vectors
42  std::vector<uint8_t> tx_pkt_zeros_;
43  std::vector<uint8_t> tx_pkt_pilot_;
44 };
45 #endif // TXRX_WORKER_CLIENT_SIM_H_
FrameStats::NumPilotSyms
size_t NumPilotSyms() const
Definition: framestats.cc:91
fmt::v8::detail::byte
byte
Definition: core.h:388
udp_comm.h
Declaration file for the UDPComm class. This class is used to send messages and receive messages from...
moodycamel::ProducerToken
Definition: concurrentqueue.h:630
Packet::frame_id_
uint32_t frame_id_
Definition: message.h:168
PinToCoreWithOffset
void PinToCoreWithOffset(ThreadType thread_type, size_t core_offset, size_t thread_id, bool allow_reuse, bool verbose)
Definition: utils.cc:157
FrameStats::GetPilotSymbol
size_t GetPilotSymbol(size_t location) const
Definition: framestats.cc:122
TxRxWorker::rx_frame_start_
size_t *const rx_frame_start_
Definition: txrx_worker.h:59
ThreadType::kWorkerTXRX
@ kWorkerTXRX
EventType::kPacketPilotTX
@ kPacketPilotTX
TxRxWorkerClientSim::DoTxRx
void DoTxRx() final
Definition: txrx_worker_client_sim.cc:58
Packet::ant_id_
uint32_t ant_id_
Definition: message.h:171
EventType::kPacketTX
@ kPacketTX
TxRxWorkerClientSim::udp_comm_
std::vector< std::unique_ptr< UDPComm > > udp_comm_
Definition: txrx_worker_client_sim.h:39
TxRxWorker::Running
bool Running() const
Definition: txrx_worker.h:42
AGORA_LOG_ERROR
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
Config::Frame
const FrameStats & Frame() const
Definition: config.h:340
TxRxWorker::GetUlTxPacket
Packet * GetUlTxPacket(size_t frame, size_t symbol, size_t ant)
Definition: txrx_worker.cc:173
Config::UeServerPort
int UeServerPort() const
Definition: config.h:306
rx_tag_t
Definition: message.h:227
gen_tag_t::ue_id_
uint16_t ue_id_
Definition: message.h:37
TxRxWorker::WaitSync
void WaitSync()
Using a latch might be better but adds c++20 requirement.
Definition: txrx_worker.cc:64
TxRxWorker::ReturnRxPacket
void ReturnRxPacket(RxPacket &unused_packet)
Definition: txrx_worker.cc:129
gen_tag_t
Definition: message.h:22
kDebugPrintInTask
static constexpr bool kDebugPrintInTask
Definition: symbols.h:201
TxRxWorker::GetPendingTxEvents
std::vector< EventData > GetPendingTxEvents(size_t max_events=0)
Definition: txrx_worker.cc:85
EventData
Definition: message.h:142
TxRxWorkerClientSim::~TxRxWorkerClientSim
~TxRxWorkerClientSim() final
message.h
Self defined functions for message storage and passing.
Packet::kOffsetOfData
static constexpr size_t kOffsetOfData
Definition: message.h:166
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
GetTime::Rdtsc
static size_t Rdtsc()
Return the TSC.
Definition: gettime.h:25
kEnableSlowStart
static constexpr bool kEnableSlowStart
Definition: txrx_worker_client_sim.cc:15
Packet
Definition: message.h:164
TxRxWorker::Configuration
Config * Configuration()
Definition: txrx_worker.h:46
EventType::kPacketRX
@ kPacketRX
Packet::symbol_id_
uint32_t symbol_id_
Definition: message.h:169
TxRxWorkerClientSim::DequeueSend
size_t DequeueSend()
Definition: txrx_worker_client_sim.cc:130
kNumStatsFrames
static constexpr size_t kNumStatsFrames
Definition: symbols.h:300
TxRxWorker::NotifyComplete
bool NotifyComplete(const EventData &complete_event)
Definition: txrx_worker.cc:75
TxRxWorkerClientSim::tx_pkt_pilot_
std::vector< uint8_t > tx_pkt_pilot_
Definition: txrx_worker_client_sim.h:43
TxRxWorker
Definition: txrx_worker.h:18
kIsWorkerTimingEnabled
static constexpr bool kIsWorkerTimingEnabled
Definition: symbols.h:303
TxRxWorker::GetRxPacket
RxPacket & GetRxPacket()
Definition: txrx_worker.cc:104
RxPacket::RawPacket
Packet * RawPacket()
Definition: message.h:213
TxRxWorker::channels_per_interface_
const size_t channels_per_interface_
Definition: txrx_worker.h:58
moodycamel::ConcurrentQueue< EventData >
FrameStats::NumULSyms
size_t NumULSyms() const
Definition: framestats.cc:85
TxRxWorker::tid_
const size_t tid_
Definition: txrx_worker.h:54
txrx_worker_client_sim.h
txrx worker thread definition. This is the simulator declaration for the userequiptment code
Config
Definition: config.h:26
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
TxRxWorkerClientSim
Definition: txrx_worker_client_sim.h:16
TxRxWorkerClientSim::tx_pkt_zeros_
std::vector< uint8_t > tx_pkt_zeros_
Definition: txrx_worker_client_sim.h:42
TxRxWorkerClientSim::TxRxWorkerClientSim
TxRxWorkerClientSim()=delete
AGORA_LOG_FRAME
#define AGORA_LOG_FRAME(...)
Definition: logger.h:72
RtAssert
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
TxRxWorkerClientSim::RecvEnqueue
std::vector< Packet * > RecvEnqueue(size_t interface_id)
Definition: txrx_worker_client_sim.cc:92
RxPacket
Definition: message.h:186
Config::UeRruPort
int UeRruPort() const
Definition: config.h:307
TxRxWorker::interface_offset_
const size_t interface_offset_
Definition: txrx_worker.h:57
gettime.h
Config::PacketLength
size_t PacketLength() const
Definition: config.h:238
TxRxWorker::num_interfaces_
const size_t num_interfaces_
Definition: txrx_worker.h:56
gen_tag_t::frame_id_
uint32_t frame_id_
Definition: message.h:32
txrx_worker.h
txrx worker thread definition. This is the parent / interface
TxRxWorker::core_offset_
const size_t core_offset_
Definition: txrx_worker.h:55
Config::UeRruAddr
std::string UeRruAddr() const
Definition: config.h:301
FrameStats::GetULSymbol
size_t GetULSymbol(size_t location) const
Definition: framestats.cc:114
TxRxWorker::running_
bool running_
Definition: txrx_worker.h:60
Config::UeServerAddr
std::string UeServerAddr() const
Definition: config.h:298
Config::PilotCi16
std::vector< std::complex< int16_t > > & PilotCi16()
Definition: config.h:377
kSocketRxBufferSize
static constexpr size_t kSocketRxBufferSize
Definition: txrx_worker_client_sim.cc:16