Commit a88d4e95 authored by Romain Beurdouche's avatar Romain Beurdouche

feat(ldpc-decoding-module-interface-rework): Use the success of the shared...

feat(ldpc-decoding-module-interface-rework): Use the success of the shared library loader to automatically detect slot decoding library, remove every options specific to slot decoding
parent 89a0da2d
...@@ -881,6 +881,7 @@ add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL) ...@@ -881,6 +881,7 @@ add_dependencies(ldpc_cl nrLDPC_decoder_kernels_CL)
set(PHY_NR_ULSCH_DECODING_DEMO_SRC set(PHY_NR_ULSCH_DECODING_DEMO_SRC
${OPENAIR1_DIR}/PHY/CODING/nr_ulsch_decoding_interface_demo.c ${OPENAIR1_DIR}/PHY/CODING/nr_ulsch_decoding_interface_demo.c
${PHY_LDPC_OPTIM8SEGMULTI_SRC}
) )
set(PHY_NR_CODINGIF set(PHY_NR_CODINGIF
...@@ -911,7 +912,8 @@ add_library(coding MODULE ${PHY_TURBOSRC} ) ...@@ -911,7 +912,8 @@ add_library(coding MODULE ${PHY_TURBOSRC} )
add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c) add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts_neon.c)
add_library(nr_ulsch_decoding_interface_demo MODULE ${PHY_NR_ULSCH_DECODING_DEMO_SRC}) add_library(ldpc_slot_demo MODULE ${PHY_NR_ULSCH_DECODING_DEMO_SRC})
target_link_libraries(ldpc_slot_demo PRIVATE ldpc_gen_HEADERS)
set(PHY_SRC_COMMON set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c ${OPENAIR1_DIR}/PHY/LTE_TRANSPORT/dci_tools_common.c
...@@ -2117,7 +2119,7 @@ if(E2_AGENT) ...@@ -2117,7 +2119,7 @@ if(E2_AGENT)
endif() endif()
add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc nr_ulsch_decoding_interface_demo) add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc ldpc_slot_demo)
if (ENABLE_LDPC_T2) if (ENABLE_LDPC_T2)
add_dependencies(nr-softmodem ldpc_t2) add_dependencies(nr-softmodem ldpc_t2)
...@@ -2354,7 +2356,7 @@ add_executable(nr_ulsim ...@@ -2354,7 +2356,7 @@ add_executable(nr_ulsim
if (ENABLE_LDPC_T2) if (ENABLE_LDPC_T2)
add_dependencies(nr_ulsim ldpc_t2) add_dependencies(nr_ulsim ldpc_t2)
endif() endif()
add_dependencies(nr_ulsim nr_ulsch_decoding_interface_demo) add_dependencies(nr_ulsim ldpc_slot_demo)
target_link_libraries(nr_ulsim PRIVATE target_link_libraries(nr_ulsim PRIVATE
-Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group -Wl,--start-group UTIL SIMU SIMU_ETH PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_UE_NR MAC_NR_COMMON nr_rrc CONFIG_LIB L2_NR HASHTABLE x2ap SECURITY ngap -lz -Wl,--end-group
...@@ -2421,7 +2423,7 @@ if (${T_TRACER}) ...@@ -2421,7 +2423,7 @@ if (${T_TRACER})
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_UE_NR ngap
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU SIMU_ETH OPENAIR0_LIB CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc_t2 ldpc_cl ldpc_cuda ldpc nr_ulsch_decoding_interface_demo dfts config_internals) ldpc_orig ldpc_optim ldpc_optim8seg ldpc_t2 ldpc_cl ldpc_cuda ldpc ldpc_slot_demo dfts config_internals)
if (TARGET ${i}) if (TARGET ${i})
add_dependencies(${i} generate_T) add_dependencies(${i} generate_T)
endif() endif()
......
...@@ -447,7 +447,6 @@ void init_eNB_afterRU(void) { ...@@ -447,7 +447,6 @@ void init_eNB_afterRU(void) {
gNB = RC.gNB[inst]; gNB = RC.gNB[inst];
gNB->ldpc_offload_flag = get_softmodem_params()->ldpc_offload_flag; gNB->ldpc_offload_flag = get_softmodem_params()->ldpc_offload_flag;
gNB->nr_ulsch_decoding_interface_flag = get_softmodem_params()->nr_ulsch_decoding_interface_flag;
phy_init_nr_gNB(gNB); phy_init_nr_gNB(gNB);
......
...@@ -109,7 +109,6 @@ extern "C" ...@@ -109,7 +109,6 @@ extern "C"
#define CONFIG_HLP_STATS_DISABLE "disable globally the stats generation and persistence" #define CONFIG_HLP_STATS_DISABLE "disable globally the stats generation and persistence"
#define CONFIG_HLP_NOITTI "Do not start itti threads, call queue processing in place, inside the caller thread" #define CONFIG_HLP_NOITTI "Do not start itti threads, call queue processing in place, inside the caller thread"
#define CONFIG_HLP_LDPC_OFFLOAD "Enable LDPC offload to AMD Xilinx T2 telco card\n" #define CONFIG_HLP_LDPC_OFFLOAD "Enable LDPC offload to AMD Xilinx T2 telco card\n"
#define CONFIG_HLP_ULSCH_DECODE "Enable slot decoding module\n"
#define CONFIG_HLP_SYNC_REF "UE acts a Sync Reference in Sidelink. 0-none 1-GNB 2-GNSS 4-localtiming\n" #define CONFIG_HLP_SYNC_REF "UE acts a Sync Reference in Sidelink. 0-none 1-GNB 2-GNSS 4-localtiming\n"
#define CONFIG_HLP_TADV \ #define CONFIG_HLP_TADV \
"Set RF board timing_advance to compensate fix delay inside the RF board between Rx and Tx timestamps (RF board internal " \ "Set RF board timing_advance to compensate fix delay inside the RF board between Rx and Tx timestamps (RF board internal " \
...@@ -147,7 +146,6 @@ extern "C" ...@@ -147,7 +146,6 @@ extern "C"
#define CONTINUOUS_TX softmodem_params.continuous_tx #define CONTINUOUS_TX softmodem_params.continuous_tx
#define SYNC_REF softmodem_params.sync_ref #define SYNC_REF softmodem_params.sync_ref
#define LDPC_OFFLOAD_FLAG softmodem_params.ldpc_offload_flag #define LDPC_OFFLOAD_FLAG softmodem_params.ldpc_offload_flag
#define ULSCH_DECODE_FLAG softmodem_params.nr_ulsch_decoding_interface_flag
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat"; #define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
...@@ -193,7 +191,6 @@ extern int usrp_tx_thread; ...@@ -193,7 +191,6 @@ extern int usrp_tx_thread;
{"disable-stats", CONFIG_HLP_STATS_DISABLE, PARAMFLAG_BOOL, .iptr=&stats_disabled, .defintval=0, TYPE_INT, 0}, \ {"disable-stats", CONFIG_HLP_STATS_DISABLE, PARAMFLAG_BOOL, .iptr=&stats_disabled, .defintval=0, TYPE_INT, 0}, \
{"no-itti-threads", CONFIG_HLP_NOITTI, PARAMFLAG_BOOL, .iptr=&softmodem_params.no_itti, .defintval=0, TYPE_INT, 0}, \ {"no-itti-threads", CONFIG_HLP_NOITTI, PARAMFLAG_BOOL, .iptr=&softmodem_params.no_itti, .defintval=0, TYPE_INT, 0}, \
{"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, PARAMFLAG_BOOL, .iptr=&LDPC_OFFLOAD_FLAG, .defstrval=0, TYPE_INT, 0}, \ {"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, PARAMFLAG_BOOL, .iptr=&LDPC_OFFLOAD_FLAG, .defstrval=0, TYPE_INT, 0}, \
{"ulsch-decode-enable", CONFIG_HLP_ULSCH_DECODE, PARAMFLAG_BOOL, .iptr=&ULSCH_DECODE_FLAG, .defintval=0, TYPE_INT, 0}, \
{"sync-ref", CONFIG_HLP_SYNC_REF, 0, .uptr=&SYNC_REF, .defintval=0, TYPE_UINT, 0}, \ {"sync-ref", CONFIG_HLP_SYNC_REF, 0, .uptr=&SYNC_REF, .defintval=0, TYPE_UINT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, .iptr=&softmodem_params.command_line_sample_advance,.defintval=0, TYPE_INT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, .iptr=&softmodem_params.command_line_sample_advance,.defintval=0, TYPE_INT, 0}, \
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, .iptr=&softmodem_params.threequarter_fs, .defintval=0, TYPE_INT, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, .iptr=&softmodem_params.threequarter_fs, .defintval=0, TYPE_INT, 0}, \
...@@ -247,7 +244,6 @@ extern int usrp_tx_thread; ...@@ -247,7 +244,6 @@ extern int usrp_tx_thread;
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \ { .s5 = { NULL } }, \
{ .s5 = { NULL } }, \
} }
// clang-format on // clang-format on
...@@ -357,7 +353,6 @@ typedef struct { ...@@ -357,7 +353,6 @@ typedef struct {
int continuous_tx; int continuous_tx;
uint32_t sync_ref; uint32_t sync_ref;
int no_itti; int no_itti;
int nr_ulsch_decoding_interface_flag;
int ldpc_offload_flag; int ldpc_offload_flag;
int threequarter_fs; int threequarter_fs;
} softmodem_params_t; } softmodem_params_t;
......
...@@ -207,48 +207,50 @@ The code loading the LDPC library is in [nr_ulsch_decoding_interface_load.c](fil ...@@ -207,48 +207,50 @@ The code loading the LDPC library is in [nr_ulsch_decoding_interface_load.c](fil
### Selecting the LDPC library at run time ### Selecting the LDPC library at run time
By default the function `int load_nr_ulsch_decoding_interface(void)` looks for `libnr_ulsch_decoding.so`, this default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below: By default the function `int load_nr_ulsch_decoding_interface(void)` looks for `libldpc.so`.\
If `libldpc.so` does not implement the LDPC slot decoder interface then the loader just fails which allows to fallback to the code segment decoding interface.\
This default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below:
#### Examples of ldpc shared lib selection when running nr softmodem's: #### Examples of ldpc shared lib selection when running nr softmodem's:
loading `libnr_ulsch_decoding_interface_demo.so` instead of `libnr_ulsch_decoding.so`: loading `libldpc_slot_demo.so` instead of `libldpc.so`:
``` ```
./nr-softmodem -O libconfig:gnb.band78.tm1.106PRB.usrpx300.conf:dbgl5 --loader.nr_ulsch_decoding.shlibversion _interface_demo ./nr-softmodem -O libconfig:gnb.band78.tm1.106PRB.usrpx300.conf:dbgl5 --loader.ldpc.shlibversion _slot_demo
....................... .......................
[CONFIG] loader.nr_ulsch_decoding.shlibversion set to default value "" [CONFIG] loader.ldpc.shlibversion set to default value ""
[LIBCONFIG] loader.nr_ulsch_decoding: 2/2 parameters successfully set, (1 to default value) [LIBCONFIG] loader.ldpc: 2/2 parameters successfully set, (1 to default value)
[CONFIG] shlibversion set to _interface_demo from command line [CONFIG] shlibversion set to _slot_demo from command line
[CONFIG] loader.nr_ulsch_decoding 1 options set from command line [CONFIG] loader.ldpc 1 options set from command line
shlib_path libnr_ulsch_decoding_interface_demo.so shlib_path libldpc_slot_demo.so
[LOADER] library libnr_ulsch_decoding_interface_demo.so successfully loaded [LOADER] library libldpc_slot_demo.so successfully loaded
........................ ........................
``` ```
loading `libnr_ulsch_decoding_interface_t2.so` instead of `libnr_ulsch_decoding.so`: loading `libldpc_slot_t2.so` instead of `libldpc.so`:
`make nr_ulsch_decoding_interface_t2` `make ldpc_slot_t2`
This command creates the `libnr_ulsch_decoding_interface_t2.so` shared library. This command creates the `libldpc_slot_t2.so` shared library.
``` ```
Building C object CMakeFiles/nr_ulsch_decoding_interface_t2.dir/openair1/PHY/CODING/nrLDPC_decoder/nr_ulsch_decoding_t2.c.o Building C object CMakeFiles/ldpc_slot_t2.dir/openair1/PHY/CODING/nrLDPC_decoder/nr_ulsch_decoding_t2.c.o
Linking C shared module libnr_ulsch_decoding_interface_t2.so Linking C shared module libldpc_slot_t2.so
``` ```
At runtime, to successfully use the T2 board, you need to install vendor specific drivers and tools. At runtime, to successfully use the T2 board, you need to install vendor specific drivers and tools.
`./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --sa --log_config.gtpu_log_level info --loader.nr_ulsch_decoding.shlibversion _interface_t2` `./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --sa --log_config.gtpu_log_level info --loader.ldpc.shlibversion _slot_t2`
``` ```
....................... .......................
[CONFIG] loader.nr_ulsch_decoding.shlibversion set to default value "" [CONFIG] loader.ldpc.shlibversion set to default value ""
[LIBCONFIG] loader.nr_ulsch_decoding: 2/2 parameters successfully set, (1 to default value) [LIBCONFIG] loader.ldpc: 2/2 parameters successfully set, (1 to default value)
[CONFIG] shlibversion set to _interface_t2 from command line [CONFIG] shlibversion set to _slot_t2 from command line
[CONFIG] loader.nr_ulsch_decoding 1 options set from command line [CONFIG] loader.ldpc 1 options set from command line
shlib_path libnr_ulsch_decoding_interface_t2.so shlib_path libldpc_slot_t2.so
[LOADER] library libnr_ulsch_decoding_interface_t2.so successfully loaded [LOADER] library libldpc_slot_t2.so successfully loaded
........................ ........................
``` ```
...@@ -257,10 +259,10 @@ shlib_path libnr_ulsch_decoding_interface_t2.so ...@@ -257,10 +259,10 @@ shlib_path libnr_ulsch_decoding_interface_t2.so
Slot decoding libraries cannot be used within ldpctest. Slot decoding libraries cannot be used within ldpctest.
### LDPC libraries ### LDPC libraries
Libraries implementing the slotwise LDPC decoding must be named `libnr_ulsch_decoding<_version>.so`, they must implement three functions: `nr_ulsch_decoding_init`, `nr_ulsch_decoding_shutdown` and `nr_ulsch_decoding_decoder`. The prototypes for these functions is defined in [nr_ulsch_decoding_interface.h](file://../nr_ulsch_decoding_interface.h). Libraries implementing the slotwise LDPC decoding must be named `libldpc<_version>.so`, in addition of the code segment decoding interface that is necessary for encoding, they must implement three functions: `nr_ulsch_decoding_init`, `nr_ulsch_decoding_shutdown` and `nr_ulsch_decoding_decoder`. The prototypes for these functions is defined in [nr_ulsch_decoding_interface.h](file://../nr_ulsch_decoding_interface.h).
`libnr_ulsch_decoding_interface_demo.so`has been tested with the `nr_ulsim` and `nr-softmodem` executables. `libldpc_slot_demo.so`has been tested with the `nr_ulsim` and `nr-softmodem` executables.
`libnr_ulsch_decoding_interface_t2.so`is under development. `libnr_slot_t2.so`is under development.
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home) [oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
...@@ -63,8 +63,14 @@ ...@@ -63,8 +63,14 @@
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_interface.h"
#include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h" #include "nfapi/open-nFAPI/nfapi/public_inc/nfapi_nr_interface.h"
// Global var to limit the rework of the dirty legacy code int32_t LDPCdecoder(t_nrLDPC_dec_params* p_decParams,
ldpc_interface_t ldpc_interface_demo; uint8_t harq_pid,
uint8_t ulsch_id,
uint8_t C,
int8_t* p_llr,
int8_t* p_out,
t_nrLDPC_time_stats* p_profiler,
decode_abort_t* ab);
static void nr_processULSegment_demo(void *arg) static void nr_processULSegment_demo(void *arg)
{ {
...@@ -163,7 +169,7 @@ static void nr_processULSegment_demo(void *arg) ...@@ -163,7 +169,7 @@ static void nr_processULSegment_demo(void *arg)
////////////////////////////////// pl =====> llrProcBuf ////////////////////////////////// ////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
rdata->decodeIterations = rdata->decodeIterations =
ldpc_interface_demo.LDPCdecoder(p_decoderParms, 0, 0, 0, l, llrProcBuf, p_procTime, &ulsch_harq->abort_decode); LDPCdecoder(p_decoderParms, 0, 0, 0, l, llrProcBuf, p_procTime, &ulsch_harq->abort_decode);
if (rdata->decodeIterations <= p_decoderParms->numMaxIter) if (rdata->decodeIterations <= p_decoderParms->numMaxIter)
memcpy(ulsch_harq->c[r],llrProcBuf, Kr>>3); memcpy(ulsch_harq->c[r],llrProcBuf, Kr>>3);
...@@ -320,16 +326,12 @@ int nr_ulsch_decoding_demo(PHY_VARS_gNB *phy_vars_gNB, ...@@ -320,16 +326,12 @@ int nr_ulsch_decoding_demo(PHY_VARS_gNB *phy_vars_gNB,
int32_t nr_ulsch_decoding_init(void){ int32_t nr_ulsch_decoding_init(void){
load_LDPClib(NULL, &ldpc_interface_demo);
return 0; return 0;
} }
int32_t nr_ulsch_decoding_shutdown(void){ int32_t nr_ulsch_decoding_shutdown(void){
free_LDPClib(&ldpc_interface_demo);
return 0; return 0;
} }
......
...@@ -47,7 +47,7 @@ char *arguments_phy_simulators[64]={"ldpctest",NULL}; ...@@ -47,7 +47,7 @@ char *arguments_phy_simulators[64]={"ldpctest",NULL};
int load_nr_ulsch_decoding_interface(char *version, nr_ulsch_decoding_interface_t *itf) int load_nr_ulsch_decoding_interface(char *version, nr_ulsch_decoding_interface_t *itf)
{ {
char *ptr = (char *)config_get_if(); char *ptr = (char *)config_get_if();
char libname[64] = "nr_ulsch_decoding"; char libname[64] = "ldpc";
if (ptr == NULL) { // phy simulators, config module possibly not loaded if (ptr == NULL) { // phy simulators, config module possibly not loaded
uniqCfg = load_configmodule(1, arguments_phy_simulators, CONFIG_ENABLECMDLINEONLY); uniqCfg = load_configmodule(1, arguments_phy_simulators, CONFIG_ENABLECMDLINEONLY);
...@@ -59,7 +59,10 @@ int load_nr_ulsch_decoding_interface(char *version, nr_ulsch_decoding_interface_ ...@@ -59,7 +59,10 @@ int load_nr_ulsch_decoding_interface(char *version, nr_ulsch_decoding_interface_
{.fname = "nr_ulsch_decoding_decoder"}}; {.fname = "nr_ulsch_decoding_decoder"}};
int ret; int ret;
ret = load_module_version_shlib(libname, version, shlib_fdesc, sizeofArray(shlib_fdesc), NULL); ret = load_module_version_shlib(libname, version, shlib_fdesc, sizeofArray(shlib_fdesc), NULL);
AssertFatal((ret >= 0), "Error loading NR ULSCH decoding module"); if(ret < 0){
LOG_D(PHY, "NR ULSCH decoding module unavailable");
return ret;
}
itf->nr_ulsch_decoding_init = (nr_ulsch_decoding_init_t *)shlib_fdesc[0].fptr; itf->nr_ulsch_decoding_init = (nr_ulsch_decoding_init_t *)shlib_fdesc[0].fptr;
itf->nr_ulsch_decoding_shutdown = (nr_ulsch_decoding_shutdown_t *)shlib_fdesc[1].fptr; itf->nr_ulsch_decoding_shutdown = (nr_ulsch_decoding_shutdown_t *)shlib_fdesc[1].fptr;
itf->nr_ulsch_decoding_decoder = (nr_ulsch_decoding_decoder_t *)shlib_fdesc[2].fptr; itf->nr_ulsch_decoding_decoder = (nr_ulsch_decoding_decoder_t *)shlib_fdesc[2].fptr;
......
...@@ -134,18 +134,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -134,18 +134,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
nr_init_fde(); // Init array for frequency equalization of transform precoding of PUSCH nr_init_fde(); // Init array for frequency equalization of transform precoding of PUSCH
pthread_mutex_init(&gNB->UL_INFO.crc_rx_mutex, NULL); gNB->nr_ulsch_decoding_interface_flag = 0;
int ret_loader = load_nr_ulsch_decoding_interface(NULL, &nr_ulsch_decoding_interface);
if (gNB->nr_ulsch_decoding_interface_flag){ if(ret_loader >= 0)
if(strncmp(gNB->nr_ulsch_decoding_interface_version,"",1)!=0){ gNB->nr_ulsch_decoding_interface_flag = 1;
load_nr_ulsch_decoding_interface(gNB->nr_ulsch_decoding_interface_version, &nr_ulsch_decoding_interface);
} else {
load_nr_ulsch_decoding_interface(NULL, &nr_ulsch_decoding_interface);
}
} // loading the LDPC library is still necessary for encoding
load_LDPClib(NULL, &ldpc_interface); load_LDPClib(NULL, &ldpc_interface);
pthread_mutex_init(&gNB->UL_INFO.crc_rx_mutex, NULL);
if (gNB->ldpc_offload_flag) if (gNB->ldpc_offload_flag)
load_LDPClib("_t2", &ldpc_interface_offload); load_LDPClib("_t2", &ldpc_interface_offload);
gNB->max_nb_pdsch = MAX_MOBILES_PER_GNB; gNB->max_nb_pdsch = MAX_MOBILES_PER_GNB;
......
...@@ -635,7 +635,6 @@ typedef struct PHY_VARS_gNB_s { ...@@ -635,7 +635,6 @@ typedef struct PHY_VARS_gNB_s {
/// NR ULSCH decoding related /// NR ULSCH decoding related
int nr_ulsch_decoding_interface_flag; // Flag enabling NR ULSCH decoding module int nr_ulsch_decoding_interface_flag; // Flag enabling NR ULSCH decoding module
char nr_ulsch_decoding_interface_version[64];
int max_ldpc_iterations; int max_ldpc_iterations;
/// indicate the channel estimation technique in time domain /// indicate the channel estimation technique in time domain
......
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "PHY/defs_nr_UE.h" #include "PHY/defs_nr_UE.h"
#include "PHY/phy_vars_nr_ue.h" #include "PHY/phy_vars_nr_ue.h"
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/CODING/nr_ulsch_decoding_interface.h"
#include "PHY/INIT/nr_phy_init.h" #include "PHY/INIT/nr_phy_init.h"
#include "PHY/MODULATION/modulation_UE.h" #include "PHY/MODULATION/modulation_UE.h"
#include "PHY/MODULATION/nr_modulation.h" #include "PHY/MODULATION/nr_modulation.h"
...@@ -187,8 +188,6 @@ int main(int argc, char *argv[]) ...@@ -187,8 +188,6 @@ int main(int argc, char *argv[])
double effTP; double effTP;
float eff_tp_check = 100; float eff_tp_check = 100;
int ldpc_offload_flag = 0; int ldpc_offload_flag = 0;
int nr_ulsch_decoding_interface_flag = 0;
char nr_ulsch_decoding_interface_version[64] = "_demo";
uint8_t max_rounds = 4; uint8_t max_rounds = 4;
int chest_type[2] = {0}; int chest_type[2] = {0};
int enable_ptrs = 0; int enable_ptrs = 0;
...@@ -225,7 +224,7 @@ int main(int argc, char *argv[]) ...@@ -225,7 +224,7 @@ int main(int argc, char *argv[])
/* initialize the sin-cos table */ /* initialize the sin-cos table */
InitSinLUT(); InitSinLUT();
while ((c = getopt(argc, argv, "--:a:b:c:d:ef:g:h:i:j:k:m:n:op:q:r:s:t:u:v:w:y:z:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:E:X:")) != -1) { while ((c = getopt(argc, argv, "--:a:b:c:d:ef:g:h:i:k:m:n:op:q:r:s:t:u:v:w:y:z:C:F:G:H:I:M:N:PR:S:T:U:L:ZW:E:X:")) != -1) {
/* ignore long options starting with '--' and their arguments that are handled by configmodule */ /* ignore long options starting with '--' and their arguments that are handled by configmodule */
/* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */ /* with this opstring getopt returns 1 for non-option arguments, refer to 'man 3 getopt' */
...@@ -320,10 +319,6 @@ int main(int argc, char *argv[]) ...@@ -320,10 +319,6 @@ int main(int argc, char *argv[])
i+=2; i+=2;
} while (optarg[i-1] == ','); } while (optarg[i-1] == ',');
break; break;
case 'j':
nr_ulsch_decoding_interface_flag = 1;
strncpy(nr_ulsch_decoding_interface_version,optarg,63);
case 'k': case 'k':
printf("Setting threequarter_fs_flag\n"); printf("Setting threequarter_fs_flag\n");
...@@ -502,7 +497,6 @@ int main(int argc, char *argv[]) ...@@ -502,7 +497,6 @@ int main(int argc, char *argv[])
printf("-g Channel model configuration. Arguments list: Number of arguments = 3, {Channel model: [A] TDLA30, [B] TDLB100, [C] TDLC300}, {Correlation: [l] Low, [m] Medium, [h] High}, {Maximum Doppler shift} e.g. -g A,l,10\n"); printf("-g Channel model configuration. Arguments list: Number of arguments = 3, {Channel model: [A] TDLA30, [B] TDLB100, [C] TDLC300}, {Correlation: [l] Low, [m] Medium, [h] High}, {Maximum Doppler shift} e.g. -g A,l,10\n");
printf("-h This message\n"); printf("-h This message\n");
printf("-i Change channel estimation technique. Arguments list: Number of arguments=2, Frequency domain {0:Linear interpolation, 1:PRB based averaging}, Time domain {0:Estimates of last DMRS symbol, 1:Average of DMRS symbols}. e.g. -i 1,0\n"); printf("-i Change channel estimation technique. Arguments list: Number of arguments=2, Frequency domain {0:Linear interpolation, 1:PRB based averaging}, Time domain {0:Estimates of last DMRS symbol, 1:Average of DMRS symbols}. e.g. -i 1,0\n");
printf("-j <library_suffix> enable slot decoding module, pass module name suffix as argument, e.g. module name should be \"libnr_ulsch_decoding<library_suffix>.so\"\n");
printf("-k 3/4 sampling\n"); printf("-k 3/4 sampling\n");
printf("-m MCS value\n"); printf("-m MCS value\n");
printf("-n Number of trials to simulate\n"); printf("-n Number of trials to simulate\n");
...@@ -656,8 +650,6 @@ int main(int argc, char *argv[]) ...@@ -656,8 +650,6 @@ int main(int argc, char *argv[])
// nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01); // nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01);
gNB->ldpc_offload_flag = ldpc_offload_flag; gNB->ldpc_offload_flag = ldpc_offload_flag;
gNB->nr_ulsch_decoding_interface_flag = nr_ulsch_decoding_interface_flag;
strncpy(gNB->nr_ulsch_decoding_interface_version,nr_ulsch_decoding_interface_version,64);
gNB->chest_freq = chest_type[0]; gNB->chest_freq = chest_type[0];
gNB->chest_time = chest_type[1]; gNB->chest_time = chest_type[1];
...@@ -1630,6 +1622,9 @@ int main(int argc, char *argv[]) ...@@ -1630,6 +1622,9 @@ int main(int argc, char *argv[])
if (gNB->ldpc_offload_flag) if (gNB->ldpc_offload_flag)
free_LDPClib(&ldpc_interface_offload); free_LDPClib(&ldpc_interface_offload);
if (gNB->nr_ulsch_decoding_interface_flag)
free_nr_ulsch_decoding_interface(&nr_ulsch_decoding_interface);
if (output_fd) if (output_fd)
fclose(output_fd); fclose(output_fd);
......
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