Agora
1.2.0
Agora project
|
Go to the documentation of this file.
7 #ifndef TXRX_WORKER_CLIENT_HW_H_
8 #define TXRX_WORKER_CLIENT_HW_H_
21 size_t interface_offset,
Config*
const config,
22 size_t* rx_frame_start,
27 std::vector<RxPacket>& rx_memory,
28 std::byte*
const tx_memory, std::mutex& sync_mutex,
29 std::condition_variable& sync_cond,
30 std::atomic<bool>& can_proceed,
37 size_t DoTx(
const long long time0);
38 std::vector<Packet*>
DoRx(
size_t interface_id,
size_t& global_frame_id,
39 size_t& global_symbol_id,
long long& receive_time,
40 ssize_t& sample_offset);
42 ssize_t
SyncBeacon(
size_t local_interface,
size_t sample_window);
44 size_t sample_window,
float corr_scale = 1.f);
45 void AdjustRx(
size_t local_interface,
size_t discard_samples);
47 void TxUplinkSymbols(
size_t radio_id,
size_t frame_id,
long long time0);
48 void TxPilot(
size_t pilot_ant,
size_t frame_id,
long long time0);
53 bool DoResync(
const std::vector<Packet*>& check_pkts,
54 ssize_t& adjust_samples);
56 const std::vector<Packet*>& beacon_pkts,
57 ssize_t& adjust_samples);
80 #endif // TXRX_WORKER_CLIENT_HW_H_
std::vector< std::vector< std::complex< int16_t > > > frame_storage_
Definition: txrx_worker_client_hw.h:68
static constexpr bool kPrintClientBeaconSNR
Definition: txrx_worker_client_hw.cc:25
byte
Definition: core.h:388
Definition: concurrentqueue.h:630
void Running(bool value)
Definition: config.h:33
bool attempt_resync_
Definition: txrx_worker_client_hw.h:73
void PinToCoreWithOffset(ThreadType thread_type, size_t core_offset, size_t thread_id, bool allow_reuse, bool verbose)
Definition: utils.cc:157
ssize_t FindSyncBeacon(const std::complex< int16_t > *check_data, size_t sample_window, float corr_scale=1.f)
Definition: txrx_worker_client_hw.cc:472
size_t SampsPerSymbol() const
Definition: config.h:234
int RadioRx(size_t radio_id, std::vector< std::vector< std::complex< int16_t >>> &rx_data, size_t rx_size, Radio::RxFlags &out_flags, long long &rx_time_ns)
Definition: client_radio.cc:101
size_t GetPilotSymbol(size_t location) const
Definition: framestats.cc:122
static void ConvertShortToFloat(const short *in_buf, float *out_buf, size_t n_elems)
Produces outputs -1->+0.999.
Definition: datatype_conversion.h:41
size_t OfdmTxZeroPrefix() const
Definition: config.h:211
void DoTxRx() final
Definition: txrx_worker_client_hw.cc:81
static constexpr bool kDebugBeaconChannels
Definition: txrx_worker_client_hw.cc:19
void DiscardOld(size_t new_samples, long long sample_rx_start)
Definition: rx_status_tracker.h:53
size_t UeResyncPeriod() const
Definition: config.h:55
std::vector< TxRxWorkerRx::RxStatusTracker > rx_status_
Definition: txrx_worker_client_hw.h:78
bool ResyncOnBeacon(size_t frame_id, size_t frame_sync_period, const std::vector< Packet * > &beacon_pkts, ssize_t &adjust_samples)
Definition: txrx_worker_client_hw.cc:850
Definition: client_radio.h:15
std::vector< RxPacket * > rx_pkts_ptrs_
Definition: txrx_worker_client_hw.h:70
Radio::TxFlags GetTxFlags(size_t radio_id, size_t tx_symbol_id)
Definition: txrx_worker_client_hw.cc:708
bool Running() const
Definition: txrx_worker.h:42
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
std::vector< RxPacket > rx_frame_pkts_
Definition: txrx_worker_client_hw.h:69
const FrameStats & Frame() const
Definition: config.h:340
static constexpr size_t kSyncDetectChannel
Definition: txrx_worker_client_hw.cc:20
Packet * GetUlTxPacket(size_t frame, size_t symbol, size_t ant)
Definition: txrx_worker.cc:173
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
Definition: message.h:227
uint16_t ue_id_
Definition: message.h:37
void WaitSync()
Using a latch might be better but adds c++20 requirement.
Definition: txrx_worker.cc:64
size_t program_start_ticks_
Definition: txrx_worker_client_hw.h:65
static constexpr size_t kBeaconsToStart
Definition: txrx_worker_client_hw.cc:24
static gen_tag_t FrmSymUe(size_t frame_id, size_t symbol_id, size_t ue_id)
Definition: message.h:84
static constexpr size_t kReSyncRetryCount
Definition: txrx_worker_client_hw.cc:22
constexpr std::chrono::duration< Rep, Period > abs(std::chrono::duration< Rep, Period > d)
Definition: chrono.h:1488
static constexpr float kBeaconDetectWindow
Definition: txrx_worker_client_hw.cc:23
static constexpr bool kDebugPrintInTask
Definition: symbols.h:201
void WaitDetectBeacon(size_t local_interface)
Definition: txrx_worker_client_hw.cc:720
std::vector< EventData > GetPendingTxEvents(size_t max_events=0)
Definition: txrx_worker.cc:85
TxFlags
Definition: radio.h:20
size_t tag_
Definition: message.h:229
Definition: message.h:142
std::vector< Packet * > DoRx(size_t interface_id, size_t &global_frame_id, size_t &global_symbol_id, long long &receive_time, ssize_t &sample_offset)
Definition: txrx_worker_client_hw.cc:172
Self defined functions for message storage and passing.
for i
Definition: generate_data.m:107
Definition: rx_status_tracker.h:17
Definition: txrx_worker_client_hw.h:18
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
static size_t Rdtsc()
Return the TSC.
Definition: gettime.h:25
Communications Library: a) Generate pilot/preamble sequences b) OFDM modulation.
Definition: message.h:164
void TxUplinkSymbols(size_t radio_id, size_t frame_id, long long time0)
Definition: txrx_worker_client_hw.cc:523
Config * Configuration()
Definition: txrx_worker.h:46
std::vector< void * > GetRxPtrs() const
Definition: rx_status_tracker.h:125
~TxRxWorkerClientHw() final
bool DoResync(const std::vector< Packet * > &check_pkts, ssize_t &adjust_samples)
Definition: txrx_worker_client_hw.cc:803
Implementation of PacketTxRxRadio datapath functions for communicating with real iris / faros hardwar...
bool NotifyComplete(const EventData &complete_event)
Definition: txrx_worker.cc:75
RxFlags
Definition: radio.h:19
Definition: txrx_worker.h:18
static int FindBeaconAvx(const std::vector< std::complex< float >> &iq, const std::vector< std::complex< float >> &seq, float corr_scale=1.f)
Correlation and Peak detection of a beacon with Gold code (2 repetitions)
Definition: comms-lib-avx.cc:46
RxPacket & GetRxPacket()
Definition: txrx_worker.cc:104
size_t resync_retry_cnt_
Definition: txrx_worker_client_hw.h:75
const size_t channels_per_interface_
Definition: txrx_worker.h:58
int RadioTx(size_t radio_id, void **buffs, size_t num_samps, Radio::TxFlags flags, long long &tx_time)
Definition: client_radio.cc:96
static constexpr bool kDebugTxData
Definition: symbols.h:365
void AdjustRx(size_t local_interface, size_t discard_samples)
Definition: txrx_worker_client_hw.cc:374
void Update(size_t new_samples, long long sample_rx_start)
Definition: rx_status_tracker.h:81
Table< std::complex< int16_t > > & UlIqT()
Definition: config.h:390
size_t GetPilotSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:160
SymbolType GetSymbolType(size_t symbol_id) const
Return the symbol type of this symbol in this frame.
Definition: config.cc:1557
bool IsRxSymbol(size_t symbol_id)
Definition: txrx_worker_client_hw.cc:509
static constexpr bool kVerifyFirstSync
Definition: txrx_worker_client_hw.cc:21
size_t NumULSyms() const
Definition: framestats.cc:85
const size_t tid_
Definition: txrx_worker.h:54
size_t NumUeChannels() const
Definition: config.h:99
static constexpr ssize_t kMaxBeaconAdjust
Definition: txrx_worker_client_hw.cc:26
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
Definition: json.hpp:5213
#define AGORA_LOG_FRAME(...)
Definition: logger.h:72
long long EstablishTime0(size_t local_interface)
Definition: txrx_worker_client_hw.cc:762
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
end Generate data if GENERATE_DATA tx_data
Definition: generate_data.m:38
Implementation of RxStatusTracker helper class.
#define AGORA_LOG_WARN(...)
Definition: logger.h:53
ClientRadioConfig & radio_
Definition: txrx_worker_client_hw.h:64
const std::vector< int > & ClTxAdvance() const
Definition: config.h:333
size_t BeaconLen() const
Definition: config.h:103
TxRxWorkerClientHw()=delete
ssize_t SyncBeacon(size_t local_interface, size_t sample_window)
Definition: txrx_worker_client_hw.cc:408
void ResetRxStatus(size_t interface, bool reuse_memory)
Definition: txrx_worker_client_hw.cc:670
void InitRxStatus()
Definition: txrx_worker_client_hw.cc:652
bool UeHwFramer() const
Definition: config.h:54
size_t SamplesAvailable() const
Definition: rx_status_tracker.h:121
bool IsTxSymbolNext(size_t radio_id, size_t current_symbol)
Definition: txrx_worker_client_hw.cc:686
const size_t interface_offset_
Definition: txrx_worker.h:57
size_t resync_success_cnt_
Definition: txrx_worker_client_hw.h:74
const size_t num_interfaces_
Definition: txrx_worker.h:56
uint32_t frame_id_
Definition: message.h:32
bool CheckContinuity(long long sample_rx_start) const
Definition: rx_status_tracker.h:108
txrx worker thread definition. This is the parent / interface
noise_power
Definition: process_rx_frame.m:35
const size_t core_offset_
Definition: txrx_worker.h:55
Declaration file for the client radio config class.
size_t GetULSymbol(size_t location) const
Definition: framestats.cc:114
void TxPilot(size_t pilot_ant, size_t frame_id, long long time0)
Definition: txrx_worker_client_hw.cc:599
std::vector< std::vector< std::complex< int16_t > > > frame_zeros_
Definition: txrx_worker_client_hw.h:67
bool running_
Definition: txrx_worker.h:60
std::vector< std::complex< int16_t > > & PilotCi16()
Definition: config.h:377
#define TX_FRAME_DELTA
Definition: symbols.h:20
size_t NumTotalSyms() const
Definition: framestats.cc:93
size_t DoTx(const long long time0)
Definition: txrx_worker_client_hw.cc:303
void Reset(std::vector< RxPacket * > new_packets)
Definition: rx_status_tracker.h:32