Skip to content

Commit 7525221

Browse files
saukacodebot
authored andcommitted
pusch test: fix compilation whith DPDK
1 parent 72a367e commit 7525221

File tree

3 files changed

+24
-20
lines changed

3 files changed

+24
-20
lines changed

lib/hal/dpdk/bbdev/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ set(SOURCES
1414
)
1515

1616
add_library(hal_bbdev STATIC ${SOURCES})
17+
target_compile_options(hal_bbdev PRIVATE ${DPDK_CFLAGS})
18+
target_link_libraries(hal_bbdev srslog ${DPDK_LIBRARIES})

tests/unittests/phy/upper/channel_processors/pusch/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ add_test(pusch_processor_unittest pusch_processor_unittest)
2929
if (USE_PHY_TESTVECTORS)
3030
add_executable(pusch_decoder_test pusch_decoder_vectortest.cpp)
3131
set(PUSCH_DECODER_LIBRARIES srsran_channel_processors srslog srsran_upper_phy_support)
32-
if (DPDK_FOUND)
33-
set_source_files_properties(pusch_decoder_vectortest.cpp PROPERTIES COMPILE_DEFINITIONS "DPDK_FOUND")
32+
33+
if (ENABLE_PUSCH_HWACC)
34+
set_source_files_properties(pusch_decoder_vectortest.cpp PROPERTIES COMPILE_DEFINITIONS "HWACC_PUSCH_ENABLED")
3435
list(APPEND PUSCH_DECODER_LIBRARIES hal_hwacc_pusch)
35-
endif (DPDK_FOUND)
36+
endif (ENABLE_PUSCH_HWACC)
37+
3638
target_link_libraries(pusch_decoder_test ${PUSCH_DECODER_LIBRARIES})
3739
add_test_vector(pusch_decoder_test pusch_decoder_test_data.tar.gz "-e0 -i2")
3840
add_test(pusch_decoder_early_stop_test pusch_decoder_test -e1 -i6)

tests/unittests/phy/upper/channel_processors/pusch/pusch_decoder_vectortest.cpp

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
#include "srsran/phy/upper/rx_softbuffer_pool.h"
2525
#include "srsran/phy/upper/unique_rx_softbuffer.h"
2626
#include "srsran/support/test_utils.h"
27-
#ifdef DPDK_FOUND
27+
#ifdef HWACC_PUSCH_ENABLED
2828
#include "srsran/hal/dpdk/bbdev/bbdev_acc.h"
2929
#include "srsran/hal/dpdk/bbdev/bbdev_acc_factory.h"
3030
#include "srsran/hal/dpdk/dpdk_eal_factory.h"
3131
#include "srsran/hal/phy/upper/channel_processors/pusch/ext_harq_buffer_context_repository_factory.h"
3232
#include "srsran/hal/phy/upper/channel_processors/pusch/hal_factories.h"
3333
#include "srsran/hal/phy/upper/channel_processors/pusch/hw_accelerator_pusch_dec_factory.h"
34-
#endif // DPDK_FOUND
34+
#endif // HWACC_PUSCH_ENABLED
3535
#include <getopt.h>
3636

3737
/// \cond
@@ -42,30 +42,30 @@ static unsigned nof_ldpc_iterations = 6;
4242

4343
static std::string decoder_type = "generic";
4444

45-
#ifdef DPDK_FOUND
45+
#ifdef HWACC_PUSCH_ENABLED
4646
static bool test_harq = true;
4747
static bool ext_softbuffer = true;
4848
static bool std_out_sink = true;
4949
static std::string hal_log_level = "error";
5050
static std::string eal_arguments = "";
51-
#endif // DPDK_FOUND
51+
#endif // HWACC_PUSCH_ENABLED
5252

5353
static void usage(const char* prog)
5454
{
5555
fmt::print("Usage: {} [-T X] [-e] [-i X] [-x] [-y] [-z error|warning|info|debug] [-h] [eal_args ...]\n", prog);
5656
fmt::print("\t-T PUSCH decoder type [generic,acc100][Default {}]\n", decoder_type);
5757
fmt::print("\t-e Use LDPC decoder early stop [Default {}]\n", use_early_stop);
5858
fmt::print("\t-i Number of LDPC iterations [Default {}]\n", nof_ldpc_iterations);
59-
#ifdef DPDK_FOUND
59+
#ifdef HWACC_PUSCH_ENABLED
6060
fmt::print("\t-x Use the host's memory for the soft-buffer [Default {}]\n", !ext_softbuffer);
6161
fmt::print("\t-y Force logging output written to a file [Default {}]\n", std_out_sink ? "std_out" : "file");
6262
fmt::print("\t-z Set logging level for the HAL [Default {}]\n", hal_log_level);
6363
fmt::print("\teal_args EAL arguments\n");
64-
#endif // DPDK_FOUND
64+
#endif // HWACC_PUSCH_ENABLED
6565
fmt::print("\t-h This help\n");
6666
}
6767

68-
#ifdef DPDK_FOUND
68+
#ifdef HWACC_PUSCH_ENABLED
6969
// Separates EAL and non-EAL arguments.
7070
// The function assumes that 'eal_arg' flags the start of the EAL arguments and that no more non-EAL arguments follow.
7171
static std::string capture_eal_args(int* argc, char*** argv)
@@ -96,7 +96,7 @@ static std::string capture_eal_args(int* argc, char*** argv)
9696

9797
return eal_argv;
9898
}
99-
#endif // DPDK_FOUND
99+
#endif // HWACC_PUSCH_ENABLED
100100

101101
static void parse_args(int argc, char** argv)
102102
{
@@ -112,7 +112,7 @@ static void parse_args(int argc, char** argv)
112112
case 'i':
113113
nof_ldpc_iterations = strtol(optarg, nullptr, 10);
114114
break;
115-
#ifdef DPDK_FOUND
115+
#ifdef HWACC_PUSCH_ENABLED
116116
case 'x':
117117
ext_softbuffer = false;
118118
break;
@@ -122,7 +122,7 @@ static void parse_args(int argc, char** argv)
122122
case 'z':
123123
hal_log_level = std::string(optarg);
124124
break;
125-
#endif // DPDK_FOUND
125+
#endif // HWACC_PUSCH_ENABLED
126126
case 'h':
127127
default:
128128
usage(argv[0]);
@@ -156,7 +156,7 @@ static std::shared_ptr<pusch_decoder_factory> create_generic_pusch_decoder_facto
156156

157157
static std::shared_ptr<hal::hw_accelerator_pusch_dec_factory> create_hw_accelerator_pusch_dec_factory()
158158
{
159-
#ifdef DPDK_FOUND
159+
#ifdef HWACC_PUSCH_ENABLED
160160
srslog::sink* log_sink =
161161
std_out_sink ? srslog::create_stdout_sink() : srslog::create_file_sink("pusch_decoder_vectortest.log");
162162
srslog::set_default_sink(*log_sink);
@@ -198,9 +198,9 @@ static std::shared_ptr<hal::hw_accelerator_pusch_dec_factory> create_hw_accelera
198198

199199
// ACC100 hardware-accelerator implementation.
200200
return create_hw_accelerator_pusch_dec_factory(hw_decoder_config);
201-
#else // DPDK_FOUND
201+
#else // HWACC_PUSCH_ENABLED
202202
return nullptr;
203-
#endif // DPDK_FOUND
203+
#endif // HWACC_PUSCH_ENABLED
204204
}
205205

206206
static std::shared_ptr<pusch_decoder_factory> create_acc100_pusch_decoder_factory()
@@ -245,10 +245,10 @@ static std::shared_ptr<pusch_decoder_factory> create_pusch_decoder_factory()
245245

246246
int main(int argc, char** argv)
247247
{
248-
#ifdef DPDK_FOUND
248+
#ifdef HWACC_PUSCH_ENABLED
249249
// Separate EAL and non-EAL arguments.
250250
eal_arguments = capture_eal_args(&argc, &argv);
251-
#endif // DPDK_FOUND
251+
#endif // HWACC_PUSCH_ENABLED
252252

253253
// Parse generic arguments.
254254
parse_args(argc, argv);
@@ -287,11 +287,11 @@ int main(int argc, char** argv)
287287
pool_config.max_nof_codeblocks = nof_codeblocks;
288288
pool_config.expire_timeout_slots = 10;
289289
pool_config.external_soft_bits = false;
290-
#ifdef DPDK_FOUND
290+
#ifdef HWACC_PUSCH_ENABLED
291291
if (decoder_type == "acc100") {
292292
pool_config.external_soft_bits = ext_softbuffer;
293293
}
294-
#endif // DPDK_FOUND
294+
#endif // HWACC_PUSCH_ENABLED
295295

296296
// Create Rx softbuffer pool.
297297
std::unique_ptr<rx_softbuffer_pool> pool = create_rx_softbuffer_pool(pool_config);

0 commit comments

Comments
 (0)