Agora  1.2.0
Agora project
Sender Class Reference

#include <sender.h>

Collaboration diagram for Sender:

Public Member Functions

 Sender (Config *cfg, size_t socket_thread_num, size_t core_offset=30, size_t frame_duration=1000, size_t inter_frame_delay=0, size_t enable_slow_start=1, const std::string &server_mac_addr_str="ff:ff:ff:ff:ff:ff", bool create_thread_for_master=false)
 Create and optionally start a Sender that sends IQ packets to a server with MAC address [server_mac_addr_str]. More...
 
 ~Sender ()
 
void StartTx ()
 
void StartTxfromMain (double *in_frame_start, double *in_frame_end)
 

Static Public Attributes

static constexpr size_t kDequeueBulkSize = 4
 

Private Member Functions

void * MasterThread (int tid)
 
void * WorkerThread (int tid)
 
void InitIqFromFile (const std::string &filename)
 Read time-domain 32-bit floating-point IQ samples from [filename] and populate iq_data_short_ by converting to 16-bit fixed-point samples. More...
 
uint64_t GetTicksForFrame (size_t frame_id) const
 
size_t GetMaxSymbolId () const
 
void CreateWorkerThreads (size_t num_workers)
 
void DelayForSymbol (size_t tx_frame_count, uint64_t tick_start)
 
void DelayForFrame (size_t tx_frame_count, uint64_t tick_start)
 
void WriteStatsToFile (size_t tx_frame_count) const
 
size_t FindNextSymbol (size_t start_symbol)
 
void ScheduleSymbol (size_t frame, size_t symbol_id)
 
void RunFft (Packet *pkt, complex_float *fft_inout, DFTI_DESCRIPTOR_HANDLE mkl_handle) const
 

Private Attributes

Configcfg_
 
const double freq_ghz_
 
const double ticks_per_usec_
 
const size_t socket_thread_num_
 
const size_t enable_slow_start_
 
const size_t core_offset_
 
size_t frame_duration_
 
const size_t inter_frame_delay_
 
uint64_t ticks_all_
 
uint64_t ticks_wnd1_
 
uint64_t ticks_wnd2_
 
const uint64_t ticks_inter_frame_
 
moodycamel::ConcurrentQueue< size_t > send_queue_
 
moodycamel::ConcurrentQueue< size_t > completion_queue_
 
moodycamel::ProducerToken ** task_ptok_
 
Table< short > iq_data_short_
 
size_t * packet_count_per_symbol_ [kFrameWnd]
 
double * frame_start_
 
double * frame_end_
 
std::vector< std::thread > threads_
 

Constructor & Destructor Documentation

◆ Sender()

Sender::Sender ( Config cfg,
size_t  socket_thread_num,
size_t  core_offset = 30,
size_t  frame_duration = 1000,
size_t  inter_frame_delay = 0,
size_t  enable_slow_start = 1,
const std::string &  server_mac_addr_str = "ff:ff:ff:ff:ff:ff",
bool  create_thread_for_master = false 
)

Create and optionally start a Sender that sends IQ packets to a server with MAC address [server_mac_addr_str].

Parameters
configThe Agora config
socket_thread_numNumber of worker threads sending packets
core_offsetThe master thread runs on core [core_offset]. Worker thread i runs on core [core_offset + i]
frame_durationThe TTI slot duration
enable_slow_startIf 1, the sender initially sends frames in a duration larger than the TTI
server_mac_addr_strThe MAC address of the server's NIC
Here is the call graph for this function:

◆ ~Sender()

Sender::~Sender ( )
Here is the call graph for this function:

Member Function Documentation

◆ CreateWorkerThreads()

void Sender::CreateWorkerThreads ( size_t  num_workers)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DelayForFrame()

void Sender::DelayForFrame ( size_t  tx_frame_count,
uint64_t  tick_start 
)
private

◆ DelayForSymbol()

void Sender::DelayForSymbol ( size_t  tx_frame_count,
uint64_t  tick_start 
)
private

◆ FindNextSymbol()

size_t Sender::FindNextSymbol ( size_t  start_symbol)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMaxSymbolId()

size_t Sender::GetMaxSymbolId ( ) const
private

◆ GetTicksForFrame()

uint64_t Sender::GetTicksForFrame ( size_t  frame_id) const
private
Here is the caller graph for this function:

◆ InitIqFromFile()

void Sender::InitIqFromFile ( const std::string &  filename)
private

Read time-domain 32-bit floating-point IQ samples from [filename] and populate iq_data_short_ by converting to 16-bit fixed-point samples.

[filename] must contain data for one frame. For every symbol and antenna, the file must provide (CP_LEN + OFDM_CA_NUM) IQ samples.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MasterThread()

void * Sender::MasterThread ( int  tid)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunFft()

void Sender::RunFft ( Packet pkt,
complex_float fft_inout,
DFTI_DESCRIPTOR_HANDLE  mkl_handle 
) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScheduleSymbol()

void Sender::ScheduleSymbol ( size_t  frame,
size_t  symbol_id 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartTx()

void Sender::StartTx ( )
Here is the call graph for this function:

◆ StartTxfromMain()

void Sender::StartTxfromMain ( double *  in_frame_start,
double *  in_frame_end 
)
Here is the call graph for this function:

◆ WorkerThread()

void * Sender::WorkerThread ( int  tid)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteStatsToFile()

void Sender::WriteStatsToFile ( size_t  tx_frame_count) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cfg_

Config* Sender::cfg_
private

◆ completion_queue_

moodycamel::ConcurrentQueue<size_t> Sender::completion_queue_
private
Initial value:

◆ core_offset_

const size_t Sender::core_offset_
private

◆ enable_slow_start_

const size_t Sender::enable_slow_start_
private

◆ frame_duration_

size_t Sender::frame_duration_
private

◆ frame_end_

double* Sender::frame_end_
private

◆ frame_start_

double* Sender::frame_start_
private

◆ freq_ghz_

const double Sender::freq_ghz_
private

◆ inter_frame_delay_

const size_t Sender::inter_frame_delay_
private

◆ iq_data_short_

Table<short> Sender::iq_data_short_
private

◆ kDequeueBulkSize

constexpr size_t Sender::kDequeueBulkSize = 4
staticconstexpr

◆ packet_count_per_symbol_

size_t* Sender::packet_count_per_symbol_[kFrameWnd]
private

◆ send_queue_

moodycamel::ConcurrentQueue<size_t> Sender::send_queue_
private
Initial value:

◆ socket_thread_num_

const size_t Sender::socket_thread_num_
private

◆ task_ptok_

moodycamel::ProducerToken** Sender::task_ptok_
private

◆ threads_

std::vector<std::thread> Sender::threads_
private

◆ ticks_all_

uint64_t Sender::ticks_all_
private

◆ ticks_inter_frame_

const uint64_t Sender::ticks_inter_frame_
private

◆ ticks_per_usec_

const double Sender::ticks_per_usec_
private

◆ ticks_wnd1_

uint64_t Sender::ticks_wnd1_
private

◆ ticks_wnd2_

uint64_t Sender::ticks_wnd2_
private

The documentation for this class was generated from the following files:
moodycamel::ConcurrentQueue< size_t >