mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-15 21:50:27 +00:00
Compare commits
1 Commits
pre-commit
...
ldpc_offlo
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13820c0af9 |
@@ -646,24 +646,26 @@ target_link_libraries(benetel_5g PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
# LDPC offload library
|
||||
##########################################################
|
||||
|
||||
# there is no generic way to test for T1 Offload, it simply comes with the
|
||||
# shared object
|
||||
if (EXISTS "/usr/local/lib64/librte_pmd_hpac_sdfec_pmd.so")
|
||||
set(T1_OFFLOAD_FOUND TRUE)
|
||||
else()
|
||||
set(T1_OFFLOAD_FOUND FALSE)
|
||||
endif()
|
||||
|
||||
if(T1_OFFLOAD_FOUND)
|
||||
message(STATUS "T1 Offload support detected")
|
||||
add_boolean_option(BUILD_T1_OFFLOAD False "Build support for LDPC Offload to T1 library")
|
||||
if(BUILD_T1_OFFLOAD)
|
||||
find_library(T1 NAME rte_pmd_hpac_sdfec_pmd REQUIRED)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/")
|
||||
pkg_search_module(LIBDPDK REQUIRED libdpdk=20.05.0)
|
||||
add_library(ldpc_offload MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
|
||||
set_target_properties(ldpc_offload PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
target_compile_options(ldpc_offload PRIVATE ${LIBDPDK_CFLAGS})
|
||||
target_link_libraries(ldpc_offload ${LIBDPDK_LDFLAGS} rte_pmd_hpac_sdfec_pmd "-Wl,-rpath /usr/local/lib64")
|
||||
else()
|
||||
message(STATUS "No T1 Offload support detected")
|
||||
pkg_search_module(LIBDPDK_T1 REQUIRED libdpdk=20.05.0)
|
||||
add_library(ldpc_offload_T1 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
|
||||
set_target_properties(ldpc_offload_T1 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
target_compile_options(ldpc_offload_T1 PRIVATE ${LIBDPDK_T1_CFLAGS})
|
||||
target_link_libraries(ldpc_offload_T1 ${LIBDPDK_T1_LDFLAGS} rte_pmd_hpac_sdfec_pmd "-Wl,-rpath /usr/local/lib64")
|
||||
endif ()
|
||||
|
||||
add_boolean_option(BUILD_T2_OFFLOAD True "Build support for LDPC Offload to T2 library")
|
||||
if(BUILD_T2_OFFLOAD)
|
||||
find_library(T2 NAME rte_baseband_accl_ldpc REQUIRED)
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/lib64/accelercomm/dpdklibs/pkgconfig/")
|
||||
pkg_search_module(LIBDPDK_T2 REQUIRED libdpdk=20.11.3)
|
||||
add_library(ldpc_offload_T2 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
|
||||
set_target_properties(ldpc_offload_T2 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
target_compile_options(ldpc_offload_T2 PRIVATE ${LIBDPDK_T2_CFLAGS})
|
||||
target_link_libraries(ldpc_offload_T2 ${LIBDPDK_T2_LDFLAGS} rte_baseband_accl_ldpc "-Wl,-rpath /usr/lib64/accelercomm/dpdklibs")
|
||||
endif ()
|
||||
|
||||
##########################################################
|
||||
@@ -2452,8 +2454,12 @@ target_link_libraries(nr-softmodem PRIVATE asn1_nr_rrc asn1_lte_rrc)
|
||||
|
||||
add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
|
||||
|
||||
if(T1_OFFLOAD_FOUND)
|
||||
add_dependencies( nr-softmodem ldpc_offload)
|
||||
if(BUILD_T1_OFFLOAD)
|
||||
add_dependencies( nr-softmodem ldpc_offload_T1)
|
||||
endif ()
|
||||
|
||||
if(BUILD_T2_OFFLOAD)
|
||||
add_dependencies( nr-softmodem ldpc_offload_T2)
|
||||
endif ()
|
||||
|
||||
# force the generation of ASN.1 so that we don't need to wait during the build
|
||||
@@ -2680,8 +2686,12 @@ add_executable(nr_ulsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
|
||||
if(T1_OFFLOAD_FOUND)
|
||||
add_dependencies( nr_ulsim ldpc_offload)
|
||||
if(BUILD_T1_OFFLOAD)
|
||||
add_dependencies( nr_ulsim ldpc_offload_T1)
|
||||
endif ()
|
||||
|
||||
if(BUILD_T2_OFFLOAD)
|
||||
add_dependencies( nr_ulsim ldpc_offload_T2)
|
||||
endif ()
|
||||
|
||||
target_link_libraries(nr_ulsim PRIVATE
|
||||
|
||||
@@ -412,14 +412,14 @@ add_dev(uint8_t dev_id, struct rte_bbdev_info *info)
|
||||
#ifdef RTE_LIBRTE_PMD_BBDEV_FPGA_5GNR_FEC
|
||||
if ((get_init_device() == true) &&
|
||||
(!strcmp(info->drv.driver_name, FPGA_5GNR_PF_DRIVER_NAME))) {
|
||||
struct fpga_5gnr_fec_conf conf;
|
||||
struct rte_fpga_5gnr_fec_conf conf;
|
||||
unsigned int i;
|
||||
|
||||
printf("Configure FPGA 5GNR FEC Driver %s with default values\n",
|
||||
info->drv.driver_name);
|
||||
|
||||
/* clear default configuration before initialization */
|
||||
memset(&conf, 0, sizeof(struct fpga_5gnr_fec_conf));
|
||||
memset(&conf, 0, sizeof(struct rte_fpga_5gnr_fec_conf));
|
||||
|
||||
/* Set PF mode :
|
||||
* true if PF is used for data plane
|
||||
@@ -447,7 +447,7 @@ add_dev(uint8_t dev_id, struct rte_bbdev_info *info)
|
||||
conf.flr_time_out = FLR_5G_TIMEOUT;
|
||||
|
||||
/* setup FPGA PF with configuration information */
|
||||
ret = fpga_5gnr_fec_configure(info->dev_name, &conf);
|
||||
ret = rte_fpga_5gnr_fec_configure(info->dev_name, &conf);
|
||||
TEST_ASSERT_SUCCESS(ret,
|
||||
"Failed to configure 5G FPGA PF for bbdev %s",
|
||||
info->dev_name);
|
||||
@@ -1260,7 +1260,7 @@ start_pmd_dec(struct active_device *ad,
|
||||
t_params[0].harq_pid = harq_pid;
|
||||
t_params[0].ulsch_id = ulsch_id;
|
||||
|
||||
RTE_LCORE_FOREACH_SLAVE(lcore_id) {
|
||||
RTE_LCORE_FOREACH_WORKER(lcore_id) {
|
||||
if (used_cores >= num_lcores)
|
||||
break;
|
||||
t_params[used_cores].dev_id = ad->dev_id;
|
||||
@@ -1421,22 +1421,16 @@ int32_t nrLDPC_decod_offload(t_nrLDPC_dec_params* p_decParams, uint8_t harq_pid,
|
||||
/*uint64_t start_time_init;
|
||||
uint64_t total_time_init=0;*/
|
||||
|
||||
/*
|
||||
int argc_re=2;
|
||||
char *argv_re[2];
|
||||
argv_re[0] = "/home/eurecom/hongzhi/dpdk-20.05orig/build/app/testbbdev";
|
||||
argv_re[1] = "--";
|
||||
*/
|
||||
|
||||
int argc_re=7;
|
||||
char *argv_re[7];
|
||||
argv_re[0] = "/home/eurecom/hongzhi/dpdk-20.05orig/build/app/testbbdev";
|
||||
argv_re[1] = "-l";
|
||||
argv_re[2] = "31";
|
||||
argv_re[3] = "-w";
|
||||
argv_re[4] = "81:00.0";
|
||||
argv_re[5] = "--file-prefix=b6";
|
||||
argv_re[6] = "--";
|
||||
int argc_re=8;
|
||||
char *argv_re[8];
|
||||
argv_re[0] = "/opt/accelercomm/ACL_BBDEV_latest/dpdk/build/app/testbbdev";
|
||||
argv_re[1] = "--vdev";
|
||||
argv_re[2] = "baseband_accl_ldpc_sw";
|
||||
argv_re[3] = "-l";
|
||||
argv_re[4] = "1-4";
|
||||
argv_re[5] = "-a";
|
||||
argv_re[6] = "21:00.0";
|
||||
argv_re[7] = "--";
|
||||
|
||||
test_params.num_ops=1;
|
||||
test_params.burst_sz=1;
|
||||
|
||||
@@ -75,7 +75,7 @@ int load_nrLDPClib_offload(void) {
|
||||
loader_shlibfunc_t shlib_decoffload_fdesc;
|
||||
|
||||
shlib_decoffload_fdesc.fname = "nrLDPC_decod_offload";
|
||||
int ret=load_module_shlib("ldpc_offload",&shlib_decoffload_fdesc,1,NULL);
|
||||
int ret=load_module_shlib("ldpc_offload_T2",&shlib_decoffload_fdesc,1,NULL);
|
||||
AssertFatal( (ret >= 0),"Error loading ldpc decoder offload");
|
||||
nrLDPC_decoder_offload = (nrLDPC_decoffloadfunc_t)shlib_decoffload_fdesc.fptr;
|
||||
|
||||
|
||||
@@ -490,9 +490,9 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
decParams.R = nr_get_R_ldpc_decoder(pusch_pdu->pusch_data.rv_index, E, decParams.BG, decParams.Z, &harq_process->llrLen, harq_process->round);
|
||||
|
||||
if ((dtx_det == 0) && (pusch_pdu->pusch_data.rv_index == 0)) {
|
||||
//if ((dtx_det == 0) && (pusch_pdu->pusch_data.rv_index == 0)) {
|
||||
// if (dtx_det==0){
|
||||
if (mcs > 9) {
|
||||
if (mcs > -1) {
|
||||
memcpy((&z_ol[0]), ulsch_llr + r_offset, E * sizeof(short));
|
||||
__m128i *pv_ol128 = (__m128i *)&z_ol;
|
||||
__m128i *pl_ol128 = (__m128i *)&l_ol;
|
||||
@@ -575,10 +575,10 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
printf("llrprocbuf [%d] = %x adr %p\n", k, llrProcBuf[k], llrProcBuf+k);
|
||||
}
|
||||
*/
|
||||
} else {
|
||||
dtx_det = 0;
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
}
|
||||
// } else {
|
||||
// dtx_det = 0;
|
||||
// no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
// }
|
||||
bool decodeSuccess = (no_iteration_ldpc <= ulsch->max_ldpc_iterations);
|
||||
if (decodeSuccess) {
|
||||
memcpy(harq_process->b + offset, harq_process->c[r], Kr_bytes - (harq_process->F >> 3) - ((harq_process->C > 1) ? 3 : 0));
|
||||
|
||||
Reference in New Issue
Block a user