Agora  1.2.0
Agora project
MacThreadBaseStation Class Reference

The MAC thread that runs alongside the PHY processing at the Agora server or client. More...

#include <mac_thread_basestation.h>

Collaboration diagram for MacThreadBaseStation:

Public Member Functions

 MacThreadBaseStation (Config *const cfg, size_t core_offset, PtrCube< kFrameWnd, kMaxSymbols, kMaxUEs, int8_t > &decoded_buffer, Table< int8_t > *dl_bits_buffer, Table< int8_t > *dl_bits_buffer_status, moodycamel::ConcurrentQueue< EventData > *rx_queue, moodycamel::ConcurrentQueue< EventData > *tx_queue, const std::string &log_filename="")
 
 ~MacThreadBaseStation ()
 
void RunEventLoop ()
 

Static Public Attributes

static constexpr char kDefaultLogFilename [] = "data/mac_log_server"
 
static constexpr size_t kMaxPktsPerUE = 64
 
static constexpr size_t kSNRWindowSize = 100
 

Private Member Functions

void ProcessRxFromPhy ()
 
void ProcessCodeblocksFromPhy (EventData event)
 
void ProcessSnrReportFromPhy (EventData event)
 
void SendRanConfigUpdate (EventData event)
 
void SendControlInformation ()
 
void ProcessUdpPacketsFromApps ()
 
void ProcessUdpPacketsFromAppsBs (const char *payload)
 

Private Attributes

Config *const cfg_
 
const double freq_ghz_
 
const size_t tsc_delta_
 
const size_t core_offset_
 
FILE * log_file_
 
std::string log_filename_
 
std::unique_ptr< UDPCommudp_comm_
 
std::vector< std::byte > udp_pkt_buf_
 
size_t last_mac_pkt_rx_tsc_ = 0
 
size_t next_tx_frame_id_ = 0
 
size_t next_radio_id_ = 0
 
size_t scheduler_next_frame_id_ = 0
 
FastRand fast_rand_
 
struct {
   std::array< std::vector< std::byte >, kMaxUEs >   frame_data_
 
   std::array< size_t, kMaxUEs >   n_filled_in_frame_
 
   std::array< std::queue< float >, kMaxUEs >   snr_
 
   std::vector< std::vector< size_t > >   data_size_
 
server_
 
PtrCube< kFrameWnd, kMaxSymbols, kMaxUEs, int8_t > & decoded_buffer_
 
struct {
   std::array< size_t, kMaxUEs >   dl_bits_buffer_id_
 
   Table< int8_t > *   dl_bits_buffer_
 
   Table< int8_t > *   dl_bits_buffer_status_
 
client_
 
moodycamel::ConcurrentQueue< EventData > * rx_queue_
 
moodycamel::ConcurrentQueue< EventData > * tx_queue_
 
std::unique_ptr< DoCRCcrc_obj_
 

Detailed Description

The MAC thread that runs alongside the PHY processing at the Agora server or client.

This thread receives UDP data packets from remote apps and forwards them to Agora. It receives decoded symbols from Agora and forwards UDP data packets to applications.

Constructor & Destructor Documentation

◆ MacThreadBaseStation()

MacThreadBaseStation::MacThreadBaseStation ( Config *const  cfg,
size_t  core_offset,
PtrCube< kFrameWnd, kMaxSymbols, kMaxUEs, int8_t > &  decoded_buffer,
Table< int8_t > *  dl_bits_buffer,
Table< int8_t > *  dl_bits_buffer_status,
moodycamel::ConcurrentQueue< EventData > *  rx_queue,
moodycamel::ConcurrentQueue< EventData > *  tx_queue,
const std::string &  log_filename = "" 
)
Here is the call graph for this function:

◆ ~MacThreadBaseStation()

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

Member Function Documentation

◆ ProcessCodeblocksFromPhy()

void MacThreadBaseStation::ProcessCodeblocksFromPhy ( EventData  event)
private

Spot to be optimized #1

Spot to be optimized #2 – left shift data over to remove padding

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

◆ ProcessRxFromPhy()

void MacThreadBaseStation::ProcessRxFromPhy ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessSnrReportFromPhy()

void MacThreadBaseStation::ProcessSnrReportFromPhy ( EventData  event)
private
Here is the caller graph for this function:

◆ ProcessUdpPacketsFromApps()

void MacThreadBaseStation::ProcessUdpPacketsFromApps ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProcessUdpPacketsFromAppsBs()

void MacThreadBaseStation::ProcessUdpPacketsFromAppsBs ( const char *  payload)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunEventLoop()

void MacThreadBaseStation::RunEventLoop ( )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendControlInformation()

void MacThreadBaseStation::SendControlInformation ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SendRanConfigUpdate()

void MacThreadBaseStation::SendRanConfigUpdate ( EventData  event)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ cfg_

Config* const MacThreadBaseStation::cfg_
private

◆ client_

struct { ... } MacThreadBaseStation::client_

◆ core_offset_

const size_t MacThreadBaseStation::core_offset_
private

◆ crc_obj_

std::unique_ptr<DoCRC> MacThreadBaseStation::crc_obj_
private

◆ data_size_

std::vector<std::vector<size_t> > MacThreadBaseStation::data_size_

◆ decoded_buffer_

PtrCube<kFrameWnd, kMaxSymbols, kMaxUEs, int8_t>& MacThreadBaseStation::decoded_buffer_
private

◆ dl_bits_buffer_

Table<int8_t>* MacThreadBaseStation::dl_bits_buffer_

◆ dl_bits_buffer_id_

std::array<size_t, kMaxUEs> MacThreadBaseStation::dl_bits_buffer_id_

◆ dl_bits_buffer_status_

Table<int8_t>* MacThreadBaseStation::dl_bits_buffer_status_

◆ fast_rand_

FastRand MacThreadBaseStation::fast_rand_
private

◆ frame_data_

std::array<std::vector<std::byte>, kMaxUEs> MacThreadBaseStation::frame_data_

◆ freq_ghz_

const double MacThreadBaseStation::freq_ghz_
private

◆ kDefaultLogFilename

constexpr char MacThreadBaseStation::kDefaultLogFilename[] = "data/mac_log_server"
staticconstexpr

◆ kMaxPktsPerUE

constexpr size_t MacThreadBaseStation::kMaxPktsPerUE = 64
staticconstexpr

◆ kSNRWindowSize

constexpr size_t MacThreadBaseStation::kSNRWindowSize = 100
staticconstexpr

◆ last_mac_pkt_rx_tsc_

size_t MacThreadBaseStation::last_mac_pkt_rx_tsc_ = 0
private

◆ log_file_

FILE* MacThreadBaseStation::log_file_
private

◆ log_filename_

std::string MacThreadBaseStation::log_filename_
private

◆ n_filled_in_frame_

std::array<size_t, kMaxUEs> MacThreadBaseStation::n_filled_in_frame_

◆ next_radio_id_

size_t MacThreadBaseStation::next_radio_id_ = 0
private

◆ next_tx_frame_id_

size_t MacThreadBaseStation::next_tx_frame_id_ = 0
private

◆ rx_queue_

moodycamel::ConcurrentQueue<EventData>* MacThreadBaseStation::rx_queue_
private

◆ scheduler_next_frame_id_

size_t MacThreadBaseStation::scheduler_next_frame_id_ = 0
private

◆ server_

struct { ... } MacThreadBaseStation::server_

◆ snr_

std::array<std::queue<float>, kMaxUEs> MacThreadBaseStation::snr_

◆ tsc_delta_

const size_t MacThreadBaseStation::tsc_delta_
private

◆ tx_queue_

moodycamel::ConcurrentQueue<EventData>* MacThreadBaseStation::tx_queue_
private

◆ udp_comm_

std::unique_ptr<UDPComm> MacThreadBaseStation::udp_comm_
private

◆ udp_pkt_buf_

std::vector<std::byte> MacThreadBaseStation::udp_pkt_buf_
private

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