Agora  1.2.0
Agora project
doencode.h
Go to the documentation of this file.
1 
7 #ifndef DOENCODE_H_
8 #define DOENCODE_H_
9 
10 #include <cstdint>
11 #include <memory>
12 
13 #include "config.h"
14 #include "doer.h"
15 #include "memory_manage.h"
16 #include "message.h"
17 #include "scrambler.h"
18 #include "stats.h"
19 
20 class DoEncode : public Doer {
21  public:
22  DoEncode(Config* in_config, int in_tid, Direction dir,
23  Table<int8_t>& in_raw_data_buffer, size_t in_buffer_rollover,
24  Table<int8_t>& in_mod_bits_buffer, Stats* in_stats_manager);
25  ~DoEncode() override;
26 
27  EventData Launch(size_t tag) override;
28 
29  private:
31 
32  // References to buffers allocated pre-construction
36 
37  // Intermediate buffer to hold LDPC encoding parity
38  int8_t* parity_buffer_;
39 
40  // Intermediate buffer to hold LDPC encoding output
42 
43  // Intermediate buffer to hold pre/post scrambled data
45 
47  std::unique_ptr<AgoraScrambler::Scrambler> scrambler_;
48 };
49 
50 #endif // DOENCODE_H_
encoder.h
Definitions for Agora's AVX2-based LDPC encoder.
DoEncode::raw_buffer_rollover_
size_t raw_buffer_rollover_
Definition: doencode.h:34
fmt::v8::detail::byte
byte
Definition: core.h:388
FrameStats::GetDLSymbolIdx
size_t GetDLSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:152
DoerType::kEncode
@ kEncode
kPrintRawMacData
static constexpr bool kPrintRawMacData
Definition: doencode.cc:15
fmt::v8::printf
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
DoEncode::~DoEncode
~DoEncode() override
Definition: doencode.cc:48
LdpcEncodeHelper
static void LdpcEncodeHelper(size_t base_graph, size_t zc, size_t nRows, int8_t *encoded_buffer, int8_t *parity_buffer, const int8_t *input_buffer)
Definition: utils_ldpc.h:195
Direction
Direction
Definition: symbols.h:39
Stats
Definition: stats.h:63
gen_tag_t::symbol_id_
uint16_t symbol_id_
Definition: message.h:33
DurationStat::task_duration_
std::array< size_t, kMaxStatBreakdown > task_duration_
Definition: stats.h:23
concurrent_queue_wrapper.h
Config::GetInfoBits
int8_t * GetInfoBits(Table< int8_t > &info_bits, Direction dir, size_t symbol_id, size_t ue_id, size_t cb_id) const
Get info bits for this symbol, user and code block ID.
Definition: config.h:514
DoEncode
Definition: doencode.h:20
Agora_memory::PaddedAlignedAlloc
void * PaddedAlignedAlloc(Alignment_t alignment, size_t size)
Definition: memory_manage.cc:15
LDPCconfig::NumRows
size_t NumRows() const
Definition: ldpc_config.h:52
DoEncode::encoded_buffer_temp_
int8_t * encoded_buffer_temp_
Definition: doencode.h:41
DoEncode::DoEncode
DoEncode(Config *in_config, int in_tid, Direction dir, Table< int8_t > &in_raw_data_buffer, size_t in_buffer_rollover, Table< int8_t > &in_mod_bits_buffer, Stats *in_stats_manager)
Definition: doencode.cc:17
FrameStats::GetULSymbolIdx
size_t GetULSymbolIdx(size_t symbol_number) const
Definition: framestats.cc:156
memory_manage.h
BitsToBytes
static size_t BitsToBytes(size_t n_bits)
Definition: utils_ldpc.h:124
Config::SubcarrierPerCodeBlock
size_t SubcarrierPerCodeBlock(Direction dir) const
Definition: config.h:292
Direction::kUplink
@ kUplink
Config::Frame
const FrameStats & Frame() const
Definition: config.h:340
GetTime::CyclesToUs
static double CyclesToUs(size_t cycles, double freq_ghz)
Definition: gettime.h:97
DoEncode::parity_buffer_
int8_t * parity_buffer_
Definition: doencode.h:38
LdpcEncodingEncodedBufSize
static size_t LdpcEncodingEncodedBufSize(size_t base_graph, size_t zc)
Definition: utils_ldpc.h:181
Doer
Definition: doer.h:17
Doer::tid_
int tid_
Definition: doer.h:65
Table< int8_t >
gen_tag_t
Definition: message.h:22
kDebugPrintInTask
static constexpr bool kDebugPrintInTask
Definition: symbols.h:201
stats.h
Declaration file for the Stats class. Includes definations for DurationStat and FrameSummery types.
EventData
Definition: message.h:142
DurationStat::task_count_
size_t task_count_
Definition: stats.h:24
kEnableMac
static constexpr bool kEnableMac
Definition: symbols.h:150
message.h
Self defined functions for message storage and passing.
FrameStats::ClientUlPilotSymbols
size_t ClientUlPilotSymbols() const
Definition: framestats.h:73
doencode.h
Declaration file for the Docoding class. Includes the DoEncode and DoDecode classes.
scrambler.h
Scramble Class and helper functions.
i
for i
Definition: generate_data.m:107
Config::MacPayloadMaxLength
size_t MacPayloadMaxLength(Direction dir) const
Definition: config.h:272
DoEncode::dir_
Direction dir_
Definition: doencode.h:30
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
DoEncode::raw_data_buffer_
Table< int8_t > & raw_data_buffer_
Definition: doencode.h:33
Agora_memory::Alignment_t::kAlign64
@ kAlign64
Config::NumBytesPerCb
size_t NumBytesPerCb(Direction dir) const
Definition: config.h:251
Direction::kDownlink
@ kDownlink
spdlog::details::make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: common.h:334
LDPCconfig
Definition: ldpc_config.h:14
Config::MacPacketLength
size_t MacPacketLength(Direction dir) const
Definition: config.h:268
kPrintEncodedData
static constexpr bool kPrintEncodedData
Definition: doencode.cc:14
DoEncode::duration_stat_
DurationStat * duration_stat_
Definition: doencode.h:46
DurationStat
Definition: stats.h:22
Config::LdpcConfig
const LDPCconfig & LdpcConfig(Direction dir) const
Definition: config.h:280
FrameStats::ClientDlPilotSymbols
size_t ClientDlPilotSymbols() const
Definition: framestats.h:76
Config::FreqGhz
double FreqGhz() const
Definition: config.h:56
Doer::cfg_
Config * cfg_
Definition: doer.h:64
DoEncode::mod_bits_buffer_
Table< int8_t > & mod_bits_buffer_
Definition: doencode.h:35
kDebugTxData
static constexpr bool kDebugTxData
Definition: symbols.h:365
DoEncode::scrambler_buffer_
int8_t * scrambler_buffer_
Definition: doencode.h:44
GetTime::WorkerRdtsc
static size_t WorkerRdtsc()
Definition: gettime.h:34
LDPCconfig::ExpansionFactor
uint16_t ExpansionFactor() const
Definition: ldpc_config.h:47
EventType::kEncode
@ kEncode
Config
Definition: config.h:26
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
doer.h
Declaration file for the Doer class. The is the base class for all agora doers.
std
Definition: json.hpp:5213
DoEncode::scrambler_
std::unique_ptr< AgoraScrambler::Scrambler > scrambler_
Definition: doencode.h:47
Config::NumPaddingBytesPerCb
size_t NumPaddingBytesPerCb(Direction dir) const
Definition: config.h:255
Config::ScrambleEnabled
bool ScrambleEnabled() const
Definition: config.h:296
AgoraScrambler
Definition: scrambler.cc:12
LDPCconfig::BaseGraph
uint16_t BaseGraph() const
Definition: ldpc_config.h:46
config.h
Declaration file for the configuration class which importants json configuration values into class va...
MacPacketPacked
Definition: message.h:274
Config::GetModBitsBuf
int8_t * GetModBitsBuf(Table< int8_t > &mod_bits_buffer, Direction dir, size_t frame_id, size_t symbol_id, size_t ue_id, size_t sc_id) const
Get encoded_buffer for this frame, symbol, user and code block ID.
Definition: config.h:531
gen_tag_t::frame_id_
uint32_t frame_id_
Definition: message.h:32
LdpcEncodingParityBufSize
static size_t LdpcEncodingParityBufSize(size_t base_graph, size_t zc)
Definition: utils_ldpc.h:174
Config::ModOrderBits
size_t ModOrderBits(Direction dir) const
Definition: config.h:247
LDPCconfig::NumBlocksInSymbol
void NumBlocksInSymbol(size_t num_blocks)
Definition: ldpc_config.h:41
LDPCconfig::NumCbCodewLen
uint32_t NumCbCodewLen() const
Definition: ldpc_config.h:51
DoEncode::Launch
EventData Launch(size_t tag) override
Definition: doencode.cc:54
AdaptBitsForMod
static void AdaptBitsForMod(const uint8_t *bit_seq_in, uint8_t *bytes_out, size_t len, size_t mod_type)
Fill-in the bytes of bytes_out with mod_type bits per byte, taken from the bit sequence bit_seq_in.
Definition: utils_ldpc.h:60
gen_tag_t::cb_id_
uint16_t cb_id_
Definition: message.h:36
Stats::GetDurationStat
DurationStat * GetDurationStat(DoerType doer_type, size_t thread_id)
Definition: stats.h:162
Config::GetMacBits
int8_t * GetMacBits(Table< int8_t > &info_bits, Direction dir, size_t frame_id, size_t symbol_id, size_t ue_id, size_t cb_id) const
Get mac bits for this frame, symbol, user and code block ID.
Definition: config.h:493