Commit 273965e9 authored by Hongzhi Wang's avatar Hongzhi Wang

adding temporarily bbdev testsuite in ldpc_decoder_offload to check t1 card connection

parent 12a0ca65
...@@ -1002,7 +1002,8 @@ include_directories ("/usr/local/include") ...@@ -1002,7 +1002,8 @@ include_directories ("/usr/local/include")
set(HWLIB_LDPC_OFFLOAD_SOURCE set(HWLIB_LDPC_OFFLOAD_SOURCE
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c
# ${OPENAIR_TARGETS}/ARCH/test-bbdev/test_bbdev.c ${OPENAIR_TARGETS}/ARCH/test-bbdev/test_bbdev.c
# ${OPENAIR_TARGETS}/ARCH/test-bbdev/main.c
${OPENAIR_TARGETS}/ARCH/test-bbdev/test_bbdev_perf.c ${OPENAIR_TARGETS}/ARCH/test-bbdev/test_bbdev_perf.c
${OPENAIR_TARGETS}/ARCH/test-bbdev/test_bbdev_vector.c ${OPENAIR_TARGETS}/ARCH/test-bbdev/test_bbdev_vector.c
) )
...@@ -1010,7 +1011,7 @@ add_library(ldpc_offload MODULE ${HWLIB_LDPC_OFFLOAD_SOURCE} ) ...@@ -1010,7 +1011,7 @@ add_library(ldpc_offload MODULE ${HWLIB_LDPC_OFFLOAD_SOURCE} )
set_target_properties(ldpc_offload PROPERTIES COMPILE_FLAGS "-include rte_config.h -march=native -I/usr/local/include") set_target_properties(ldpc_offload PROPERTIES COMPILE_FLAGS "-include rte_config.h -march=native -I/usr/local/include")
SET(T1_DPDK_LIBS "-Wl,-rpath,/home/wang/dpdk-20.05/build/include -L/usr/local/lib64 -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs -Wl,--whole-archive -L/usr/local/lib64 -lrte_common_cpt -lrte_common_dpaax -lrte_common_iavf -lrte_common_octeontx -lrte_common_octeontx2 -lrte_bus_dpaa -lrte_bus_fslmc -lrte_bus_ifpga -lrte_bus_pci -lrte_bus_vdev -lrte_bus_vmbus -lrte_mempool_bucket -lrte_mempool_dpaa -lrte_mempool_dpaa2 -lrte_mempool_octeontx -lrte_mempool_octeontx2 -lrte_mempool_ring -lrte_mempool_stack -lrte_pmd_af_packet -lrte_pmd_ark -lrte_pmd_atlantic -lrte_pmd_avp -lrte_pmd_axgbe -lrte_pmd_bond -lrte_pmd_bnx2x -lrte_pmd_bnxt -lrte_pmd_cxgbe -lrte_pmd_dpaa -lrte_pmd_dpaa2 -lrte_pmd_e1000 -lrte_pmd_ena -lrte_pmd_enetc -lrte_pmd_enic -lrte_pmd_failsafe -lrte_pmd_fm10k -lrte_pmd_i40e -lrte_pmd_hinic -lrte_pmd_hns3 -lrte_pmd_iavf -lrte_pmd_ice -lrte_pmd_igc -lrte_pmd_ixgbe -lrte_pmd_kni -lrte_pmd_liquidio -lrte_pmd_memif -lrte_pmd_netvsc -lrte_pmd_nfp -lrte_pmd_null -lrte_pmd_octeontx -lrte_pmd_octeontx2 -lrte_pmd_pcap -lrte_pmd_pfe -lrte_pmd_qede -lrte_pmd_ring -lrte_pmd_sfc -lrte_pmd_softnic -lrte_pmd_tap -lrte_pmd_thunderx -lrte_pmd_vdev_netvsc -lrte_pmd_vhost -lrte_pmd_virtio -lrte_pmd_vmxnet3 -lrte_rawdev_dpaa2_cmdif -lrte_rawdev_dpaa2_qdma -lrte_rawdev_ioat -lrte_rawdev_ntb -lrte_rawdev_octeontx2_dma -lrte_rawdev_octeontx2_ep -lrte_rawdev_skeleton -lrte_pmd_caam_jr -lrte_pmd_ccp -lrte_pmd_dpaa_sec -lrte_pmd_dpaa2_sec -lrte_pmd_nitrox -lrte_pmd_null_crypto -lrte_pmd_octeontx_crypto -lrte_pmd_octeontx2_crypto -lrte_pmd_openssl -lrte_pmd_crypto_scheduler -lrte_pmd_virtio_crypto -lrte_pmd_octeontx_compress -lrte_pmd_qat -lrte_pmd_zlib -lrte_pmd_ifc -lrte_pmd_dpaa_event -lrte_pmd_dpaa2_event -lrte_pmd_octeontx2_event -lrte_pmd_opdl_event -lrte_pmd_skeleton_event -lrte_pmd_sw_event -lrte_pmd_dsw_event -lrte_pmd_octeontx_event -lrte_pmd_bbdev_null -lrte_pmd_bbdev_turbo_sw -lrte_pmd_bbdev_fpga_lte_fec -lrte_pmd_bbdev_fpga_5gnr_fec -Wl,--no-whole-archive -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs -Wl,-Bdynamic -pthread -lm -ldl -lnuma -lpcap") SET(T1_DPDK_LIBS "-Wl,-rpath,/usr/local/include -L/usr/local/lib64 -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs -Wl,--whole-archive -L/usr/local/lib64 -lrte_common_cpt -lrte_common_dpaax -lrte_common_iavf -lrte_common_octeontx -lrte_common_octeontx2 -lrte_bus_dpaa -lrte_bus_fslmc -lrte_bus_ifpga -lrte_bus_pci -lrte_bus_vdev -lrte_bus_vmbus -lrte_mempool_bucket -lrte_mempool_dpaa -lrte_mempool_dpaa2 -lrte_mempool_octeontx -lrte_mempool_octeontx2 -lrte_mempool_ring -lrte_mempool_stack -lrte_pmd_af_packet -lrte_pmd_ark -lrte_pmd_atlantic -lrte_pmd_avp -lrte_pmd_axgbe -lrte_pmd_bond -lrte_pmd_bnx2x -lrte_pmd_bnxt -lrte_pmd_cxgbe -lrte_pmd_dpaa -lrte_pmd_dpaa2 -lrte_pmd_e1000 -lrte_pmd_ena -lrte_pmd_enetc -lrte_pmd_enic -lrte_pmd_failsafe -lrte_pmd_fm10k -lrte_pmd_i40e -lrte_pmd_hinic -lrte_pmd_hns3 -lrte_pmd_iavf -lrte_pmd_ice -lrte_pmd_igc -lrte_pmd_ixgbe -lrte_pmd_kni -lrte_pmd_liquidio -lrte_pmd_memif -lrte_pmd_netvsc -lrte_pmd_nfp -lrte_pmd_null -lrte_pmd_octeontx -lrte_pmd_octeontx2 -lrte_pmd_pcap -lrte_pmd_pfe -lrte_pmd_qede -lrte_pmd_ring -lrte_pmd_sfc -lrte_pmd_softnic -lrte_pmd_tap -lrte_pmd_thunderx -lrte_pmd_vdev_netvsc -lrte_pmd_vhost -lrte_pmd_virtio -lrte_pmd_vmxnet3 -lrte_rawdev_dpaa2_cmdif -lrte_rawdev_dpaa2_qdma -lrte_rawdev_ioat -lrte_rawdev_ntb -lrte_rawdev_octeontx2_dma -lrte_rawdev_octeontx2_ep -lrte_rawdev_skeleton -lrte_pmd_caam_jr -lrte_pmd_ccp -lrte_pmd_dpaa_sec -lrte_pmd_dpaa2_sec -lrte_pmd_nitrox -lrte_pmd_null_crypto -lrte_pmd_octeontx_crypto -lrte_pmd_octeontx2_crypto -lrte_pmd_openssl -lrte_pmd_crypto_scheduler -lrte_pmd_virtio_crypto -lrte_pmd_octeontx_compress -lrte_pmd_qat -lrte_pmd_zlib -lrte_pmd_ifc -lrte_pmd_dpaa_event -lrte_pmd_dpaa2_event -lrte_pmd_octeontx2_event -lrte_pmd_opdl_event -lrte_pmd_skeleton_event -lrte_pmd_sw_event -lrte_pmd_dsw_event -lrte_pmd_octeontx_event -lrte_pmd_bbdev_null -lrte_pmd_bbdev_turbo_sw -lrte_pmd_bbdev_fpga_lte_fec -lrte_pmd_bbdev_fpga_5gnr_fec -Wl,--no-whole-archive -lrte_node -lrte_graph -lrte_bpf -lrte_flow_classify -lrte_pipeline -lrte_table -lrte_port -lrte_fib -lrte_ipsec -lrte_vhost -lrte_stack -lrte_security -lrte_sched -lrte_reorder -lrte_rib -lrte_rawdev -lrte_pdump -lrte_power -lrte_member -lrte_lpm -lrte_latencystats -lrte_kni -lrte_jobstats -lrte_ip_frag -lrte_gso -lrte_gro -lrte_eventdev -lrte_efd -lrte_distributor -lrte_cryptodev -lrte_compressdev -lrte_cfgfile -lrte_bitratestats -lrte_bbdev -lrte_acl -lrte_timer -lrte_hash -lrte_metrics -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs -Wl,-Bdynamic -pthread -lm -ldl -lnuma -lpcap")
TARGET_LINK_LIBRARIES(ldpc_offload ${T1_DPDK_LIBS}) TARGET_LINK_LIBRARIES(ldpc_offload ${T1_DPDK_LIBS})
TARGET_LINK_LIBRARIES(ldpc_offload pthread dl rt m numa) TARGET_LINK_LIBRARIES(ldpc_offload pthread dl rt m numa)
...@@ -3243,7 +3244,7 @@ target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_ ...@@ -3243,7 +3244,7 @@ target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES}) target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${T_LIB}) target_link_libraries (nr-uesoftmodem ${T_LIB})
add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ) add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ldpc_offload)
###################################" ###################################"
# Addexecutables for tests # Addexecutables for tests
......
...@@ -56,5 +56,7 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho ...@@ -56,5 +56,7 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho
\param p_profiler LDPC profiler statistics \param p_profiler LDPC profiler statistics
*/ */
typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* ); typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* );
typedef int32_t(*nrLDPC_decoffloadfunc_t)(t_nrLDPC_dec_params* , uint8_t , uint8_t, uint32_t , int8_t*, int8_t* ); typedef int32_t(*nrLDPC_decoffloadfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* );
//typedef int32_t(*nrLDPC_decoffloadfunc_t)(t_nrLDPC_dec_params* , uint8_t , uint8_t, uint32_t , int8_t*, int8_t* );
typedef int32_t(*nrLDPC_dectopfunc_t)(void);
#endif #endif
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
nrLDPC_decoderfunc_t nrLDPC_decoder; nrLDPC_decoderfunc_t nrLDPC_decoder;
nrLDPC_encoderfunc_t nrLDPC_encoder; nrLDPC_encoderfunc_t nrLDPC_encoder;
nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload; nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload;
nrLDPC_dectopfunc_t top_testsuite;
#else #else
/* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */ /* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */
...@@ -34,6 +35,9 @@ extern int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_en ...@@ -34,6 +35,9 @@ extern int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_en
extern nrLDPC_decoderfunc_t nrLDPC_decoder; extern nrLDPC_decoderfunc_t nrLDPC_decoder;
extern nrLDPC_encoderfunc_t nrLDPC_encoder; extern nrLDPC_encoderfunc_t nrLDPC_encoder;
extern nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload; extern nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload;
extern nrLDPC_dectopfunc_t top_testsuite;
// inline functions: // inline functions:
#include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h" #include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h"
#endif #endif
...@@ -71,6 +71,17 @@ int load_nrLDPClib_offload(void) { ...@@ -71,6 +71,17 @@ int load_nrLDPClib_offload(void) {
return 0; return 0;
} }
/*int load_nrLDPClib_offload(void) {
loader_shlibfunc_t shlib_decoffload_fdesc;
shlib_decoffload_fdesc.fname = "top_testsuite";
int ret=load_module_shlib("ldpc_offload",&shlib_decoffload_fdesc,1,NULL);
AssertFatal( (ret >= 0),"Error loading ldpc decoder offload");
top_testsuite = (nrLDPC_dectopfunc_t)shlib_decoffload_fdesc.fptr;
return 0;
}
*/
int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) { int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) {
loader_shlibfunc_t shlib_encoder_fdesc; loader_shlibfunc_t shlib_encoder_fdesc;
......
...@@ -423,7 +423,7 @@ void nr_processULSegment(void* arg) { ...@@ -423,7 +423,7 @@ void nr_processULSegment(void* arg) {
////////////////////////////////// pl =====> llrProcBuf ////////////////////////////////// ////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
no_iteration_ldpc = nrLDPC_decoder(p_decoderParms, no_iteration_ldpc = nrLDPC_decoder_offload(p_decoderParms,
(int8_t*)&pl[0], (int8_t*)&pl[0],
llrProcBuf, llrProcBuf,
ulsch_harq->p_nrLDPC_procBuf[r], ulsch_harq->p_nrLDPC_procBuf[r],
......
...@@ -601,6 +601,7 @@ int main(int argc, char **argv) ...@@ -601,6 +601,7 @@ int main(int argc, char **argv)
get_softmodem_params()->do_ra = 0; get_softmodem_params()->do_ra = 0;
get_softmodem_params()->usim_test = 1; get_softmodem_params()->usim_test = 1;
load_nrLDPClib_offload();
if (snr1set == 0) if (snr1set == 0)
snr1 = snr0 + 10; snr1 = snr0 + 10;
......
...@@ -5050,9 +5050,9 @@ static struct unit_test_suite bbdev_interrupt_testsuite = { ...@@ -5050,9 +5050,9 @@ static struct unit_test_suite bbdev_interrupt_testsuite = {
} }
}; };
REGISTER_TEST_COMMAND(bler, bbdev_bler_testsuite); //REGISTER_TEST_COMMAND(bler, bbdev_bler_testsuite);
REGISTER_TEST_COMMAND(throughput, bbdev_throughput_testsuite); //REGISTER_TEST_COMMAND(throughput, bbdev_throughput_testsuite);
REGISTER_TEST_COMMAND(validation, bbdev_validation_testsuite); REGISTER_TEST_COMMAND(validation, bbdev_validation_testsuite);
REGISTER_TEST_COMMAND(latency, bbdev_latency_testsuite); //REGISTER_TEST_COMMAND(latency, bbdev_latency_testsuite);
REGISTER_TEST_COMMAND(offload, bbdev_offload_cost_testsuite); //REGISTER_TEST_COMMAND(offload, bbdev_offload_cost_testsuite);
REGISTER_TEST_COMMAND(interrupt, bbdev_interrupt_testsuite); //REGISTER_TEST_COMMAND(interrupt, bbdev_interrupt_testsuite);
...@@ -392,11 +392,11 @@ parse_data_entry(const char *key_token, char *token, ...@@ -392,11 +392,11 @@ parse_data_entry(const char *key_token, char *token,
printf("Unknown op type: %d!\n", type); printf("Unknown op type: %d!\n", type);
return -1; return -1;
} }
printf("parse data entry \n"); //printf("parse data entry \n");
op_data = vector->entries[type].segments; op_data = vector->entries[type].segments;
nb_ops = &vector->entries[type].nb_segments; nb_ops = &vector->entries[type].nb_segments;
printf("nb segments %d\n",*nb_ops); //printf("nb segments %d\n",*nb_ops);
if (*nb_ops >= RTE_BBDEV_TURBO_MAX_CODE_BLOCKS) { if (*nb_ops >= RTE_BBDEV_TURBO_MAX_CODE_BLOCKS) {
printf("Too many segments (code blocks defined): %u, max %d!\n", printf("Too many segments (code blocks defined): %u, max %d!\n",
...@@ -858,7 +858,7 @@ parse_ldpc_decoder_params(const char *key_token, char *token, ...@@ -858,7 +858,7 @@ parse_ldpc_decoder_params(const char *key_token, char *token,
static int static int
parse_entry(char *entry, struct test_bbdev_vector *vector) parse_entry(char *entry, struct test_bbdev_vector *vector)
{ {
printf("parse entry \n"); //printf("parse entry \n");
int ret = 0; int ret = 0;
char *token, *key_token; char *token, *key_token;
enum rte_bbdev_op_type op_type = RTE_BBDEV_OP_NONE; enum rte_bbdev_op_type op_type = RTE_BBDEV_OP_NONE;
...@@ -1366,7 +1366,7 @@ test_bbdev_vector_read(const char *filename, ...@@ -1366,7 +1366,7 @@ test_bbdev_vector_read(const char *filename,
FILE *fp = NULL; FILE *fp = NULL;
char *line = NULL; char *line = NULL;
char *entry = NULL; char *entry = NULL;
//sprintf(filename, "/home/wang/oai/openairinterface5g/targets/ARCH/test-bbdev/test_vectors/ldpc_dec_v8480.data");
fp = fopen(filename, "r"); fp = fopen(filename, "r");
if (fp == NULL) { if (fp == NULL) {
printf("File %s does not exist\n", filename); printf("File %s does not exist\n", filename);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment