Agora
1.2.0
Agora project
|
Go to the documentation of this file.
5 #ifndef CHSIM_WORKER_STORAGE_H_
6 #define CHSIM_WORKER_STORAGE_H_
22 size_t samples_per_symbol,
size_t udp_packet_size)
25 const size_t ue_input_storage_size =
26 (ue_ant_count * samples_per_symbol *
sizeof(arma::cx_float));
27 const size_t ue_output_storage_size =
28 (bs_ant_count * samples_per_symbol *
sizeof(arma::cx_float));
33 reinterpret_cast<arma::cx_float*
>(ue_input_float_storage),
34 samples_per_symbol, ue_ant_count,
false,
true);
37 reinterpret_cast<intptr_t
>(ue_input_float_storage),
39 reinterpret_cast<intptr_t
>(ue_input_float_storage),
40 ue_input_storage_size);
43 reinterpret_cast<intptr_t
>(ue_input_float_storage),
44 reinterpret_cast<intptr_t
>(&
reinterpret_cast<std::byte*
>(
45 ue_input_float_storage)[ue_input_storage_size - 1]),
48 samples_per_symbol - 1, ue_ant_count - 1)),
52 "Ue Input storage not at correct location");
58 reinterpret_cast<arma::cx_float*
>(ue_output_float_storage),
59 samples_per_symbol, bs_ant_count,
false,
true);
61 "Ue Input storage not at correct location");
68 reinterpret_cast<arma::cx_float*
>(bs_input_float_storage),
69 samples_per_symbol, bs_ant_count,
false,
true);
71 "Bs Input storage not at correct location");
77 reinterpret_cast<arma::cx_float*
>(bs_output_float_storage),
78 samples_per_symbol, ue_ant_count,
false,
true);
80 "Bs Output storage not at correct location");
94 inline size_t Id()
const {
return tid_; }
119 size_t max_symbols,
size_t max_antennas,
120 size_t symbol_size_bytes)
132 inline void Copy(
size_t frame,
size_t symbol,
size_t ant,
const short* input,
136 auto* dest =
storage_.at(frame_idx).at(symbol_idx).at(ant).data();
138 "Adding data %zu:%zu, (Frame %zu:%zu, Symbol %zu:%zu, Ant %zu)\n",
140 frame_idx, symbol, symbol_idx, ant);
142 "Add data must fit inside of the storage element");
147 inline const std::byte*
Read(
size_t frame,
size_t symbol,
size_t ant)
const {
150 return storage_.at(frame_idx).at(symbol_idx).at(ant).data();
154 if (
type_ == ChSimRxType::kRxTypePilotUl) {
156 }
else if (
type_ == ChSimRxType::kRxTypeBeaconDl) {
168 std::vector<std::vector<std::vector<SimdAlignByteVector>>>
storage_;
174 size_t socket_offset,
size_t socket_number,
175 std::vector<std::unique_ptr<UDPComm>>* udp_comm,
187 inline size_t Id()
const {
return tid_; }
208 std::vector<std::unique_ptr<UDPComm>>*
const comm_;
213 #endif // CHSIM_WORKER_STORAGE_H_
size_t tid_
Definition: chsim_worker_storage.h:202
ChSimRxStorage(size_t tid, size_t core_id, size_t rx_packet_size, size_t socket_offset, size_t socket_number, std::vector< std::unique_ptr< UDPComm >> *udp_comm, ChSimRxBuffer *rx_output_storage, moodycamel::ConcurrentQueue< EventData > *response_queue)
Definition: chsim_worker_storage.h:173
ChSimRxBuffer *const rx_output_
Definition: chsim_worker_storage.h:209
byte
Definition: core.h:388
Declaration file for the UDPComm class. This class is used to send messages and receive messages from...
std::vector< std::vector< std::vector< SimdAlignByteVector > > > storage_
Definition: chsim_worker_storage.h:168
ChSimRxType
Definition: chsim_worker_storage.h:117
SimdAlignByteVector & TxBuffer()
Definition: chsim_worker_storage.h:97
~ChSimWorkerStorage()
Definition: chsim_worker_storage.h:83
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
Definition: signal_handler.h:14
Agora project version configuration file.
const size_t max_frame_
Definition: chsim_worker_storage.h:167
Definition: udp_comm.h:18
Declaration file for the channel simulator class.
size_t SocketOffset() const
Definition: chsim_worker_storage.h:190
std::unique_ptr< arma::cx_fmat > ue_output_matrix_
Definition: chsim_worker_storage.h:106
const Config *const cfg_
Definition: chsim_worker_storage.h:166
const std::string & GetAgoraProjectVersion()
Definition: version_config.h:10
#define AGORA_LOG_INIT()
Definition: logger.h:35
void * PaddedAlignedAlloc(Alignment_t alignment, size_t size)
Definition: memory_manage.cc:15
arma::cx_fmat * UeOutput()
Definition: chsim_worker_storage.h:96
arma::cx_fmat * BsInput()
Definition: chsim_worker_storage.h:99
#define TOSTRING(x)
Definition: symbols.h:14
size_t GetBeaconDlIdx(size_t symbol_id) const
Definition: config.h:434
moodycamel::ConcurrentQueue< EventData > & ResponseQueue()
Definition: chsim_worker_storage.h:197
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
size_t PacketLength() const
Definition: chsim_worker_storage.h:189
ChSimRxBuffer(ChSimRxType type, const Config *cfg, size_t max_frames, size_t max_symbols, size_t max_antennas, size_t symbol_size_bytes)
Definition: chsim_worker_storage.h:118
std::unique_ptr< arma::cx_fmat > ue_input_matrix_
Definition: chsim_worker_storage.h:105
void Copy(size_t frame, size_t symbol, size_t ant, const short *input, size_t data_size)
Definition: chsim_worker_storage.h:132
size_t GetPilotUlIdx(size_t symbol_id) const
Definition: config.h:449
size_t core_id_
Definition: chsim_worker_storage.h:203
size_t CoreId() const
Definition: chsim_worker_storage.h:188
Aligned types for SIMD compatibility.
Self defined functions for message storage and passing.
ChSimWorkerStorage(size_t tid, size_t ue_ant_count, size_t bs_ant_count, size_t samples_per_symbol, size_t udp_packet_size)
Definition: chsim_worker_storage.h:21
arma::cx_fmat * BsOutput()
Definition: chsim_worker_storage.h:100
Definition: chsim_worker_storage.h:115
size_t GetSymbolIdx(size_t symbol_id) const
Definition: chsim_worker_storage.h:153
size_t Id() const
Definition: chsim_worker_storage.h:187
size_t socket_offset_
Definition: chsim_worker_storage.h:205
int main(int argc, char *argv[])
Definition: chsim_main.cc:27
Definition: chsim_worker_storage.h:171
void TransferRxData(size_t frame, size_t symbol, size_t ant, const short *input, size_t data_size)
Definition: chsim_worker_storage.h:193
UDPComm * Socket(size_t id)
Definition: chsim_worker_storage.h:192
Definition: chsim_worker_storage.h:19
moodycamel::ConcurrentQueue< EventData > *const response_queue_
Definition: chsim_worker_storage.h:210
std::unique_ptr< arma::cx_fmat > bs_output_matrix_
Definition: chsim_worker_storage.h:110
size_t socket_number_
Definition: chsim_worker_storage.h:206
const ChSimRxType type_
Definition: chsim_worker_storage.h:165
arma::cx_fmat * UeInput()
Definition: chsim_worker_storage.h:95
std::vector< std::unique_ptr< UDPComm > > *const comm_
Definition: chsim_worker_storage.h:208
std::vector< std::byte, boost::alignment::aligned_allocator< std::byte, kSimdAlignment > > SimdAlignByteVector
Definition: simd_types.h:18
SimdAlignByteVector udp_tx_buffer_
Definition: chsim_worker_storage.h:112
data_size
Definition: inspect_agora_results.m:16
DEFINE_string(conf_file, TOSTRING(PROJECT_DIRECTORY) "/files/config/ci/tddconfig-sim-both.json", "Config filename")
@ kRxTypeBeaconDl
Definition: chsim_worker_storage.h:117
DEFINE_double(chan_snr, 20.0, "Signal-to-Noise Ratio")
@ kRxTypePilotUl
Definition: chsim_worker_storage.h:117
Definition: json.hpp:5213
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
#define AGORA_LOG_SHUTDOWN()
Definition: logger.h:36
void PrintCoreAssignmentSummary()
Definition: utils.cc:85
size_t tid_
Definition: chsim_worker_storage.h:103
DEFINE_uint64(bs_threads, 1, "Number of threads for handling reception of BS packets")
size_t rx_packet_size_
Definition: chsim_worker_storage.h:204
void SetupSignalHandlers()
Definition: signal_handler.cc:44
std::unique_ptr< arma::cx_fmat > bs_input_matrix_
Definition: chsim_worker_storage.h:109
Definition: signal_handler.h:8
const std::byte * Read(size_t frame, size_t symbol, size_t ant) const
Definition: chsim_worker_storage.h:147
size_t Id() const
Definition: chsim_worker_storage.h:94
type
Definition: core.h:1131
size_t SocketNumber() const
Definition: chsim_worker_storage.h:191