Agora  1.2.0
Agora project
ChannelSim Class Reference

Simualtor for many-antenna MU-MIMO channel to work with Agora BS and UE applications. It generates channel matrice(s) and applies it to incoming baseband samples from BS and sends them to the UE application. Similarly, applies the same channel (TDD) to uplink baseband samples from UE and sends them to BS. More...

#include <channel_sim.h>

Collaboration diagram for ChannelSim:

Public Member Functions

 ChannelSim (const Config *const config, size_t bs_thread_num, size_t user_thread_num, size_t worker_thread_num, size_t in_core_offset=30, std::string in_chan_type=std::string("RAYLEIGH"), double in_chan_snr=20)
 
 ~ChannelSim ()
 
void Run ()
 
void * UeRxLoop (size_t tid)
 
void * BsRxLoop (size_t tid)
 
void ScheduleTask (EventData do_task, moodycamel::ConcurrentQueue< EventData > *in_queue, moodycamel::ProducerToken const &ptok)
 
void * TaskThread (size_t tid)
 
void DoTxBs (ChSimWorkerStorage *local, size_t tag)
 
void DoTxUser (ChSimWorkerStorage *local, size_t tag)
 

Static Public Member Functions

static void * RxLoop (ChSimRxStorage *rx_storage)
 

Private Member Functions

void DoTx (size_t frame_id, size_t symbol_id, size_t max_ant, size_t ant_per_socket, const arma::cx_float *source_data, SimdAlignByteVector *udp_pkt_buf, std::vector< std::unique_ptr< UDPComm >> &udp_senders)
 Warning: Threads are sharing these sender sockets. More...
 
std::vector< std::pair< std::thread, std::unique_ptr< ChSimRxStorage > > > CreateRxThreads ()
 
size_t AddRxThreads (size_t desired_threads, size_t total_interfaces, std::vector< std::unique_ptr< UDPComm >> &comm, ChSimRxBuffer *rx_buffer, std::vector< std::pair< std::thread, std::unique_ptr< ChSimRxStorage >>> &rx_threads_out)
 

Private Attributes

std::vector< std::unique_ptr< UDPComm > > bs_comm_
 
std::vector< std::unique_ptr< UDPComm > > ue_comm_
 
const Config *const cfg_
 
std::unique_ptr< Channelchannel_
 
std::unique_ptr< ChSimRxBufferrx_buffer_bs_
 
std::unique_ptr< ChSimRxBufferrx_buffer_ue_
 
moodycamel::ConcurrentQueue< EventDatatask_queue_bs_
 
moodycamel::ConcurrentQueue< EventDatatask_queue_user_
 
moodycamel::ConcurrentQueue< EventDatamessage_queue_
 
std::array< std::unique_ptr< moodycamel::ProducerToken >, kMaxThreadstask_ptok_
 
std::vector< std::thread > task_threads_
 
size_t ul_data_plus_pilot_symbols_
 
size_t dl_data_plus_beacon_symbols_
 
size_t payload_length_
 
size_t bs_thread_num_
 
size_t user_thread_num_
 
size_t bs_socket_num_
 
size_t user_socket_num_
 
size_t worker_thread_num_
 
size_t core_offset_
 
std::string channel_type_
 
double channel_snr_
 
TimeFrameCounters ue_rx_
 
TimeFrameCounters ue_tx_
 
TimeFrameCounters bs_rx_
 
TimeFrameCounters bs_tx_
 

Detailed Description

Simualtor for many-antenna MU-MIMO channel to work with Agora BS and UE applications. It generates channel matrice(s) and applies it to incoming baseband samples from BS and sends them to the UE application. Similarly, applies the same channel (TDD) to uplink baseband samples from UE and sends them to BS.

Constructor & Destructor Documentation

◆ ChannelSim()

ChannelSim::ChannelSim ( const Config *const  config,
size_t  bs_thread_num,
size_t  user_thread_num,
size_t  worker_thread_num,
size_t  in_core_offset = 30,
std::string  in_chan_type = std::string("RAYLEIGH"),
double  in_chan_snr = 20 
)
Here is the call graph for this function:

◆ ~ChannelSim()

ChannelSim::~ChannelSim ( )

Member Function Documentation

◆ AddRxThreads()

size_t ChannelSim::AddRxThreads ( size_t  desired_threads,
size_t  total_interfaces,
std::vector< std::unique_ptr< UDPComm >> &  comm,
ChSimRxBuffer rx_buffer,
std::vector< std::pair< std::thread, std::unique_ptr< ChSimRxStorage >>> &  rx_threads_out 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ BsRxLoop()

void* ChannelSim::BsRxLoop ( size_t  tid)

◆ CreateRxThreads()

std::vector< std::pair< std::thread, std::unique_ptr< ChSimRxStorage > > > ChannelSim::CreateRxThreads ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTx()

void ChannelSim::DoTx ( size_t  frame_id,
size_t  symbol_id,
size_t  max_ant,
size_t  ant_per_socket,
const arma::cx_float *  source_data,
SimdAlignByteVector udp_pkt_buf,
std::vector< std::unique_ptr< UDPComm >> &  udp_senders 
)
private

Warning: Threads are sharing these sender sockets.

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

◆ DoTxBs()

void ChannelSim::DoTxBs ( ChSimWorkerStorage local,
size_t  tag 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTxUser()

void ChannelSim::DoTxUser ( ChSimWorkerStorage local,
size_t  tag 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Run()

void ChannelSim::Run ( )
Here is the call graph for this function:

◆ RxLoop()

void * ChannelSim::RxLoop ( ChSimRxStorage rx_storage)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScheduleTask()

void ChannelSim::ScheduleTask ( EventData  do_task,
moodycamel::ConcurrentQueue< EventData > *  in_queue,
moodycamel::ProducerToken const &  ptok 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TaskThread()

void * ChannelSim::TaskThread ( size_t  tid)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ UeRxLoop()

void* ChannelSim::UeRxLoop ( size_t  tid)

Member Data Documentation

◆ bs_comm_

std::vector<std::unique_ptr<UDPComm> > ChannelSim::bs_comm_
private

◆ bs_rx_

TimeFrameCounters ChannelSim::bs_rx_
private

◆ bs_socket_num_

size_t ChannelSim::bs_socket_num_
private

◆ bs_thread_num_

size_t ChannelSim::bs_thread_num_
private

◆ bs_tx_

TimeFrameCounters ChannelSim::bs_tx_
private

◆ cfg_

const Config* const ChannelSim::cfg_
private

◆ channel_

std::unique_ptr<Channel> ChannelSim::channel_
private

◆ channel_snr_

double ChannelSim::channel_snr_
private

◆ channel_type_

std::string ChannelSim::channel_type_
private

◆ core_offset_

size_t ChannelSim::core_offset_
private

◆ dl_data_plus_beacon_symbols_

size_t ChannelSim::dl_data_plus_beacon_symbols_
private

◆ message_queue_

moodycamel::ConcurrentQueue<EventData> ChannelSim::message_queue_
private

◆ payload_length_

size_t ChannelSim::payload_length_
private

◆ rx_buffer_bs_

std::unique_ptr<ChSimRxBuffer> ChannelSim::rx_buffer_bs_
private

◆ rx_buffer_ue_

std::unique_ptr<ChSimRxBuffer> ChannelSim::rx_buffer_ue_
private

◆ task_ptok_

std::array<std::unique_ptr<moodycamel::ProducerToken>, kMaxThreads> ChannelSim::task_ptok_
private

◆ task_queue_bs_

moodycamel::ConcurrentQueue<EventData> ChannelSim::task_queue_bs_
private

◆ task_queue_user_

moodycamel::ConcurrentQueue<EventData> ChannelSim::task_queue_user_
private

◆ task_threads_

std::vector<std::thread> ChannelSim::task_threads_
private

◆ ue_comm_

std::vector<std::unique_ptr<UDPComm> > ChannelSim::ue_comm_
private

◆ ue_rx_

TimeFrameCounters ChannelSim::ue_rx_
private

◆ ue_tx_

TimeFrameCounters ChannelSim::ue_tx_
private

◆ ul_data_plus_pilot_symbols_

size_t ChannelSim::ul_data_plus_pilot_symbols_
private

◆ user_socket_num_

size_t ChannelSim::user_socket_num_
private

◆ user_thread_num_

size_t ChannelSim::user_thread_num_
private

◆ worker_thread_num_

size_t ChannelSim::worker_thread_num_
private

The documentation for this class was generated from the following files: