Remove T1 decoding offload
This commit is contained in:
committed by
Raymond Knopp
parent
ee287d62f4
commit
e945b260f8
@@ -494,24 +494,6 @@ target_link_libraries(shlib_loader PRIVATE CONFIG_LIB)
|
||||
|
||||
##########################################################
|
||||
|
||||
# LDPC offload library
|
||||
##########################################################
|
||||
|
||||
add_boolean_option(ENABLE_LDPC_T1 OFF "Build support for LDPC Offload to T1 library" OFF)
|
||||
if (ENABLE_LDPC_T1)
|
||||
pkg_check_modules(LIBDPDK_T1 REQUIRED libdpdk=20.05.0)
|
||||
find_library(T1 NAMES rte_pmd_hpac_sdfec_pmd REQUIRED)
|
||||
if (NOT T1)
|
||||
message(FATAL_ERROR "Library rte_pmd_hpac_sdfec_pmd for T1 offload not found")
|
||||
endif()
|
||||
add_library(ldpc_t1 MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
|
||||
set_target_properties(ldpc_t1 PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
|
||||
target_compile_options(ldpc_t1 PRIVATE ${LIBDPDK_T1_CFLAGS})
|
||||
target_link_libraries(ldpc_t1 ${LIBDPDK_T1_LDFLAGS} ${T1})
|
||||
endif()
|
||||
|
||||
##########################################################
|
||||
|
||||
include_directories ("${OPENAIR_DIR}/radio/COMMON")
|
||||
|
||||
##############################################################
|
||||
@@ -2090,10 +2072,6 @@ endif()
|
||||
|
||||
add_dependencies(nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
|
||||
|
||||
if (ENABLE_LDPC_T1)
|
||||
add_dependencies(nr-softmodem ldpc_t1)
|
||||
endif()
|
||||
|
||||
# force the generation of ASN.1 so that we don't need to wait during the build
|
||||
target_link_libraries(nr-softmodem PRIVATE
|
||||
asn1_lte_rrc asn1_nr_rrc asn1_s1ap asn1_ngap asn1_m2ap asn1_m3ap asn1_x2ap asn1_f1ap asn1_lpp)
|
||||
@@ -2307,10 +2285,6 @@ add_executable(nr_ulsim
|
||||
${PHY_INTERFACE_DIR}/queue_t.c
|
||||
)
|
||||
|
||||
if (ENABLE_LDPC_T1)
|
||||
add_dependencies(nr_ulsim ldpc_t1)
|
||||
endif()
|
||||
|
||||
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
|
||||
m pthread ${T_LIB} ITTI dl shlib_loader
|
||||
|
||||
@@ -1,102 +0,0 @@
|
||||
<!--
|
||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The OpenAirInterface Software Alliance licenses this file to You under
|
||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.openairinterface.org/?page_id=698
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
contact@openairinterface.org
|
||||
-->
|
||||
|
||||
<testCaseList>
|
||||
<htmlTabRef>test-t1-offload</htmlTabRef>
|
||||
<htmlTabName>Test T1 Offload</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestCaseRequestedList>000111 000112 000121 000122 000131 000132 000211 000212 000221 000222 000231 000232</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="000111">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r106 -R106 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000112">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r106 -R106 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000121">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r106 -R106 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000122">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r106 -R106 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000131">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r106 -R106 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000132">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r106 -R106 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000211">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r273 -R273 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000212">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m5 -r273 -R273 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000221">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r273 -R273 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000222">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m15 -r273 -R273 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000231">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with CPU</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r273 -R273 -C10 -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000232">
|
||||
<class>Run_LDPCt1Test</class>
|
||||
<desc>Run nr_ulsim with T1 LDPC offload</desc>
|
||||
<physim_run_args>-n100 -s30 -m25 -r273 -R273 -o -P</physim_run_args>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -46,7 +46,7 @@ BUILD_DOXYGEN=0
|
||||
DISABLE_HARDWARE_DEPENDENCY="False"
|
||||
CMAKE_BUILD_TYPE="RelWithDebInfo"
|
||||
CMAKE_CMD="$CMAKE"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda ldpc_t1 websrv oai_iqplayer"
|
||||
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope nrqtscope ldpc_cuda websrv oai_iqplayer"
|
||||
TARGET_LIST=""
|
||||
|
||||
function print_help() {
|
||||
|
||||
@@ -593,7 +593,6 @@ void init_eNB_afterRU(void) {
|
||||
LOG_I(PHY,"RC.nb_nr_CC[inst:%d]:%p\n", inst, RC.gNB[inst]);
|
||||
|
||||
gNB = RC.gNB[inst];
|
||||
gNB->ldpc_offload_flag = ldpc_offload_flag;
|
||||
gNB->reorder_thread_disable = get_softmodem_params()->reorder_thread_disable;
|
||||
|
||||
phy_init_nr_gNB(gNB);
|
||||
|
||||
@@ -98,7 +98,6 @@
|
||||
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
|
||||
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
|
||||
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
|
||||
#define CONFIG_HLP_LDPC_OFFLOAD "enable LDPC offload\n"
|
||||
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
|
||||
#define CONFIG_HLP_TX_SUBDEV "set the arguments to select tx_subdev (same syntax as in UHD)\n"
|
||||
#define CONFIG_HLP_RX_SUBDEV "set the arguments to select rx_subdev (same syntax as in UHD)\n"
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
{"D" , CONFIG_HLP_DLBM_PHYTEST, 0, .u64ptr=&dlsch_slot_bitmap, .defintval=0, TYPE_UINT64, 0}, \
|
||||
{"U" , CONFIG_HLP_ULBM_PHYTEST, 0, .u64ptr=&ulsch_slot_bitmap, .defintval=0, TYPE_UINT64, 0}, \
|
||||
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, .iptr=&usrp_tx_thread, .defstrval=0, TYPE_INT, 0}, \
|
||||
{"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, 0, .iptr=&ldpc_offload_flag, .defstrval=0, TYPE_INT, 0}, \
|
||||
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, .strptr=&uecap_file, .defstrval="./uecap_ports1.xml", TYPE_STRING, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, .dblptr=&snr_dB, .defdblval=25, TYPE_DOUBLE, 0}, \
|
||||
}
|
||||
@@ -44,7 +43,6 @@ extern uint32_t target_ul_bw;
|
||||
extern uint64_t dlsch_slot_bitmap;
|
||||
extern uint64_t ulsch_slot_bitmap;
|
||||
extern char *uecap_file;
|
||||
extern int ldpc_offload_flag;
|
||||
|
||||
// In nr-gnb.c
|
||||
extern void init_gNB(int single_thread_flag,int wait_for_sync);
|
||||
|
||||
@@ -47,7 +47,6 @@ char *parallel_config=NULL;
|
||||
char *worker_config=NULL;
|
||||
int usrp_tx_thread = 0;
|
||||
char *nfapi_str=NULL;
|
||||
int ldpc_offload_flag=0;
|
||||
uint8_t nfapi_mode=0;
|
||||
|
||||
static mapping softmodem_funcs[] = MAPPING_SOFTMODEM_FUNCTIONS;
|
||||
|
||||
@@ -368,7 +368,6 @@ extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
extern int usrp_tx_thread;
|
||||
extern uint16_t sl_ahead;
|
||||
extern uint16_t sf_ahead;
|
||||
extern int ldpc_offload_flag;
|
||||
extern int oai_exit;
|
||||
|
||||
void tx_func(void *param);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,135 +0,0 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2017 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _MAIN_H_
|
||||
#define _MAIN_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/queue.h>
|
||||
|
||||
#include <rte_common.h>
|
||||
#include <rte_hexdump.h>
|
||||
#include <rte_log.h>
|
||||
|
||||
#define TEST_SUCCESS 0
|
||||
#define TEST_FAILED -1
|
||||
#define TEST_SKIPPED 1
|
||||
|
||||
#define MAX_BURST 512U
|
||||
#define DEFAULT_BURST 32U
|
||||
#define DEFAULT_OPS 64U
|
||||
#define DEFAULT_ITER 6U
|
||||
|
||||
enum op_data_type {
|
||||
DATA_INPUT = 0,
|
||||
DATA_SOFT_OUTPUT,
|
||||
DATA_HARD_OUTPUT,
|
||||
DATA_HARQ_INPUT,
|
||||
DATA_HARQ_OUTPUT,
|
||||
DATA_NUM_TYPES,
|
||||
};
|
||||
|
||||
#define TEST_ASSERT(cond, msg, ...) do { \
|
||||
if (!(cond)) { \
|
||||
printf("TestCase %s() line %d failed: " \
|
||||
msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
return TEST_FAILED; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Compare two buffers (length in bytes) */
|
||||
#define TEST_ASSERT_BUFFERS_ARE_EQUAL(a, b, len, msg, ...) do { \
|
||||
if (memcmp((a), (b), len)) { \
|
||||
printf("TestCase %s() line %d failed: " \
|
||||
msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
rte_memdump(stdout, "Buffer A", (a), len); \
|
||||
rte_memdump(stdout, "Buffer B", (b), len); \
|
||||
return TEST_FAILED; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define TEST_ASSERT_SUCCESS(val, msg, ...) do { \
|
||||
typeof(val) _val = (val); \
|
||||
if (!(_val == 0)) { \
|
||||
printf("TestCase %s() line %d failed (err %d): " \
|
||||
msg "\n", __func__, __LINE__, _val, \
|
||||
##__VA_ARGS__); \
|
||||
return TEST_FAILED; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define TEST_ASSERT_FAIL(val, msg, ...) \
|
||||
TEST_ASSERT_SUCCESS(!(val), msg, ##__VA_ARGS__)
|
||||
|
||||
#define TEST_ASSERT_NOT_NULL(val, msg, ...) do { \
|
||||
if ((val) == NULL) { \
|
||||
printf("TestCase %s() line %d failed (null): " \
|
||||
msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
|
||||
return TEST_FAILED; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
struct unit_test_case {
|
||||
int (*setup)(void);
|
||||
void (*teardown)(void);
|
||||
int (*testcase)(void);
|
||||
const char *name;
|
||||
};
|
||||
|
||||
#define TEST_CASE(testcase) {NULL, NULL, testcase, #testcase}
|
||||
|
||||
#define TEST_CASE_ST(setup, teardown, testcase) \
|
||||
{setup, teardown, testcase, #testcase}
|
||||
|
||||
#define TEST_CASES_END() {NULL, NULL, NULL, NULL}
|
||||
|
||||
struct unit_test_suite {
|
||||
const char *suite_name;
|
||||
int (*setup)(void);
|
||||
void (*teardown)(void);
|
||||
struct unit_test_case unit_test_cases[];
|
||||
};
|
||||
|
||||
int unit_test_suite_runner(struct unit_test_suite *suite);
|
||||
|
||||
typedef int (test_callback)(void);
|
||||
TAILQ_HEAD(test_commands_list, test_command);
|
||||
struct test_command {
|
||||
TAILQ_ENTRY(test_command) next;
|
||||
const char *command;
|
||||
test_callback *callback;
|
||||
};
|
||||
|
||||
void add_test_command(struct test_command *t);
|
||||
|
||||
/* Register a test function */
|
||||
#define REGISTER_TEST_COMMAND(name, testsuite) \
|
||||
static int test_func_##name(void) \
|
||||
{ \
|
||||
return unit_test_suite_runner(&testsuite); \
|
||||
} \
|
||||
static struct test_command test_struct_##name = { \
|
||||
.command = RTE_STR(name), \
|
||||
.callback = test_func_##name, \
|
||||
}; \
|
||||
RTE_INIT(test_register_##name) \
|
||||
{ \
|
||||
add_test_command(&test_struct_##name); \
|
||||
}
|
||||
|
||||
const char *get_vector_filename(void);
|
||||
|
||||
unsigned int get_num_ops(void);
|
||||
|
||||
unsigned int get_burst_sz(void);
|
||||
|
||||
unsigned int get_num_lcores(void);
|
||||
|
||||
double get_snr(void);
|
||||
|
||||
unsigned int get_iter_max(void);
|
||||
|
||||
bool get_init_device(void);
|
||||
|
||||
#endif
|
||||
@@ -91,20 +91,6 @@ typedef struct nrLDPC_dec_params {
|
||||
int crc_type;
|
||||
} t_nrLDPC_dec_params;
|
||||
|
||||
/**
|
||||
Structure containing LDPC decoder parameters.
|
||||
*/
|
||||
typedef struct nrLDPCoffload_params {
|
||||
uint8_t BG; /**< Base graph */
|
||||
uint16_t Z;
|
||||
uint16_t Kr;
|
||||
uint8_t rv;
|
||||
uint32_t E;
|
||||
uint16_t n_cb;
|
||||
uint16_t F; /**< Filler bits */
|
||||
uint8_t Qm; /**< Modulation */
|
||||
} t_nrLDPCoffload_params;
|
||||
|
||||
/**
|
||||
Structure containing LDPC decoder processing time statistics.
|
||||
*/
|
||||
|
||||
@@ -74,7 +74,6 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho
|
||||
*/
|
||||
|
||||
typedef int32_t (*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params *, int8_t *, int8_t *, t_nrLDPC_time_stats *, decode_abort_t *ab);
|
||||
typedef int32_t(*nrLDPC_decoffloadfunc_t)(t_nrLDPC_dec_params* , uint8_t, uint8_t, uint8_t , uint8_t, uint16_t, uint32_t, uint8_t, int8_t*, int8_t* ,uint8_t);
|
||||
typedef int32_t(*nrLDPC_dectopfunc_t)(void);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,20 +24,16 @@
|
||||
nrLDPC_decoderfunc_t nrLDPC_decoder;
|
||||
nrLDPC_encoderfunc_t nrLDPC_encoder;
|
||||
nrLDPC_initcallfunc_t nrLDPC_initcall;
|
||||
nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload;
|
||||
nrLDPC_dectopfunc_t top_testsuite;
|
||||
#else
|
||||
/* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */
|
||||
int load_nrLDPClib(char *version);
|
||||
int load_nrLDPClib_offload(void);
|
||||
int free_nrLDPClib_offload(void);
|
||||
int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t *nrLDPC_encoder_ptr); // for ldpctest
|
||||
/* ldpc coder/decoder functions, as loaded by load_nrLDPClib(). */
|
||||
extern nrLDPC_initcallfunc_t nrLDPC_initcall;
|
||||
|
||||
extern nrLDPC_decoderfunc_t nrLDPC_decoder;
|
||||
extern nrLDPC_encoderfunc_t nrLDPC_encoder;
|
||||
extern nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload;
|
||||
|
||||
extern nrLDPC_dectopfunc_t top_testsuite;
|
||||
|
||||
|
||||
@@ -68,56 +68,6 @@ int load_nrLDPClib(char *version) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int load_nrLDPClib_offload(void) {
|
||||
loader_shlibfunc_t shlib_decoffload_fdesc;
|
||||
|
||||
shlib_decoffload_fdesc.fname = "nrLDPC_decod_offload";
|
||||
int ret=load_module_shlib("ldpc_t1",&shlib_decoffload_fdesc,1,NULL);
|
||||
AssertFatal( (ret >= 0),"Error loading ldpc decoder offload");
|
||||
nrLDPC_decoder_offload = (nrLDPC_decoffloadfunc_t)shlib_decoffload_fdesc.fptr;
|
||||
|
||||
t_nrLDPC_dec_params decParams;
|
||||
t_nrLDPC_dec_params* p_decParams = &decParams;
|
||||
int8_t l[68*384];
|
||||
int8_t llrProcBuf[22*384];
|
||||
|
||||
p_decParams->Z = 384;
|
||||
p_decParams->BG = 1;
|
||||
|
||||
AssertFatal(nrLDPC_decoder_offload(p_decParams,0, 0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
25344,
|
||||
8,
|
||||
l,
|
||||
llrProcBuf, 0)>=0,
|
||||
"error loading LDPC decoder offload library\n");
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int free_nrLDPClib_offload(void) {
|
||||
t_nrLDPC_dec_params decParams;
|
||||
t_nrLDPC_dec_params* p_decParams = &decParams;
|
||||
int8_t l[68*384];
|
||||
int8_t llrProcBuf[22*384];
|
||||
|
||||
p_decParams->Z = 384;
|
||||
p_decParams->BG = 1;
|
||||
|
||||
nrLDPC_decoder_offload(p_decParams,0,0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
25344,
|
||||
8,
|
||||
l,
|
||||
llrProcBuf, 2);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) {
|
||||
loader_shlibfunc_t shlib_encoder_fdesc;
|
||||
|
||||
|
||||
@@ -530,9 +530,6 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
|
||||
load_nrLDPClib(NULL);
|
||||
|
||||
if (gNB->ldpc_offload_flag)
|
||||
load_nrLDPClib_offload();
|
||||
|
||||
gNB->max_nb_pdsch = MAX_MOBILES_PER_GNB;
|
||||
|
||||
init_codebook_gNB(gNB);
|
||||
|
||||
@@ -221,122 +221,6 @@ static void nr_processULSegment(void *arg)
|
||||
memcpy(ulsch_harq->c[r],llrProcBuf, Kr>>3);
|
||||
}
|
||||
|
||||
int decode_offload(PHY_VARS_gNB *phy_vars_gNB,
|
||||
uint8_t ULSCH_id,
|
||||
short *ulsch_llr,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
t_nrLDPC_dec_params *decParams,
|
||||
uint8_t harq_pid,
|
||||
uint32_t G)
|
||||
{
|
||||
NR_gNB_ULSCH_t *ulsch = &phy_vars_gNB->ulsch[ULSCH_id];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_process;
|
||||
int8_t llrProcBuf[22 * 384] __attribute__((aligned(32)));
|
||||
int16_t z_ol[68 * 384] __attribute__((aligned(32)));
|
||||
int8_t l_ol[68 * 384] __attribute__((aligned(32)));
|
||||
uint8_t Qm = pusch_pdu->qam_mod_order;
|
||||
uint8_t n_layers = pusch_pdu->nrOfLayers;
|
||||
const int Kr = harq_process->K;
|
||||
const int Kr_bytes = Kr >> 3;
|
||||
const int kc = decParams->BG == 2 ? 52 : 68;
|
||||
const uint32_t A = (harq_process->TBS) << 3;
|
||||
int decodeIterations = 2;
|
||||
int dtx_det = 0;
|
||||
int r_offset = 0, offset = 0;
|
||||
for (int r = 0; r < harq_process->C; r++) {
|
||||
int E = nr_get_E(G, harq_process->C, Qm, n_layers, r);
|
||||
memset(harq_process->c[r], 0, Kr_bytes);
|
||||
|
||||
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)) {
|
||||
memcpy(z_ol, ulsch_llr + r_offset, E * sizeof(short));
|
||||
simde__m128i *pv_ol128 = (simde__m128i *)&z_ol;
|
||||
simde__m128i *pl_ol128 = (simde__m128i *)&l_ol;
|
||||
for (int i = 0, j = 0; j < ((kc * harq_process->Z) >> 4) + 1; i += 2, j++) {
|
||||
pl_ol128[j] = simde_mm_packs_epi16(pv_ol128[i], pv_ol128[i + 1]);
|
||||
}
|
||||
|
||||
int ret = nrLDPC_decoder_offload(decParams,
|
||||
harq_pid,
|
||||
ULSCH_id,
|
||||
r,
|
||||
pusch_pdu->pusch_data.rv_index,
|
||||
harq_process->F,
|
||||
E,
|
||||
Qm,
|
||||
(int8_t *)&pl_ol128[0],
|
||||
llrProcBuf,
|
||||
1);
|
||||
if (ret < 0) {
|
||||
LOG_E(PHY, "ulsch_decoding.c: Problem in LDPC decoder offload\n");
|
||||
|
||||
decodeIterations = ulsch->max_ldpc_iterations + 1;
|
||||
return -1;
|
||||
}
|
||||
for (int m = 0; m < Kr >> 3; m++) {
|
||||
harq_process->c[r][m] = (uint8_t)llrProcBuf[m];
|
||||
}
|
||||
|
||||
if (check_crc((uint8_t *)llrProcBuf, lenWithCrc(harq_process->C, A), crcType(harq_process->C, A))) {
|
||||
PRINT_CRC_CHECK(LOG_I(PHY, "Segment %d CRC OK\n", r));
|
||||
decodeIterations = 2;
|
||||
} else {
|
||||
PRINT_CRC_CHECK(LOG_I(PHY, "segment %d CRC NOK\n", r));
|
||||
decodeIterations = ulsch->max_ldpc_iterations + 1;
|
||||
}
|
||||
|
||||
r_offset += E;
|
||||
} else {
|
||||
dtx_det = 0;
|
||||
decodeIterations = ulsch->max_ldpc_iterations + 1;
|
||||
}
|
||||
bool decodeSuccess = (decodeIterations <= 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));
|
||||
offset += (Kr_bytes - (harq_process->F >> 3) - ((harq_process->C > 1) ? 3 : 0));
|
||||
harq_process->processedSegments++;
|
||||
} else {
|
||||
LOG_D(PHY, "uplink segment error %d/%d\n", r, harq_process->C);
|
||||
LOG_D(PHY, "ULSCH %d in error\n", ULSCH_id);
|
||||
break; // don't even attempt to decode other segments
|
||||
}
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING, 0);
|
||||
|
||||
if (harq_process->processedSegments == harq_process->C) {
|
||||
LOG_D(PHY, "ULSCH: Setting ACK for slot %d TBS %d\n", ulsch->slot, harq_process->TBS);
|
||||
ulsch->active = false;
|
||||
harq_process->round = 0;
|
||||
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 0, 0);
|
||||
|
||||
} else {
|
||||
LOG_D(PHY,
|
||||
"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d)\n",
|
||||
phy_vars_gNB->Mod_id,
|
||||
ulsch->frame,
|
||||
ulsch->slot,
|
||||
harq_pid,
|
||||
ulsch->active,
|
||||
harq_process->round,
|
||||
harq_process->TBS);
|
||||
ulsch->handled = 1;
|
||||
decodeIterations = ulsch->max_ldpc_iterations + 1;
|
||||
LOG_D(PHY, "ULSCH %d in error\n", ULSCH_id);
|
||||
nr_fill_indication(phy_vars_gNB, ulsch->frame, ulsch->slot, ULSCH_id, harq_pid, 1, 0);
|
||||
}
|
||||
ulsch->last_iteration_cnt = decodeIterations;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
uint8_t ULSCH_id,
|
||||
short *ulsch_llr,
|
||||
@@ -447,9 +331,6 @@ int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
harq_process->harq_to_be_cleared = false;
|
||||
}
|
||||
|
||||
if (phy_vars_gNB->ldpc_offload_flag && mcs > 9)
|
||||
return decode_offload(phy_vars_gNB, ULSCH_id, ulsch_llr, pusch_pdu, &decParams, harq_pid, G);
|
||||
|
||||
uint32_t offset = 0, r_offset = 0;
|
||||
set_abort(&harq_process->abort_decode, false);
|
||||
for (int r = 0; r < harq_process->C; r++) {
|
||||
|
||||
@@ -642,8 +642,6 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// OFDM symbol offset divisor for UL
|
||||
uint32_t ofdm_offset_divisor;
|
||||
|
||||
int ldpc_offload_flag;
|
||||
|
||||
int reorder_thread_disable;
|
||||
|
||||
int max_ldpc_iterations;
|
||||
|
||||
@@ -186,7 +186,6 @@ int main(int argc, char *argv[])
|
||||
double effRate;
|
||||
double effTP;
|
||||
float eff_tp_check = 100;
|
||||
int ldpc_offload_flag = 0;
|
||||
uint8_t max_rounds = 4;
|
||||
int chest_type[2] = {0};
|
||||
int enable_ptrs = 0;
|
||||
@@ -330,10 +329,6 @@ int main(int argc, char *argv[])
|
||||
n_trials = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'o':
|
||||
ldpc_offload_flag = 1;
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
extended_prefix_flag = 1;
|
||||
break;
|
||||
@@ -493,7 +488,6 @@ int main(int argc, char *argv[])
|
||||
printf("-k 3/4 sampling\n");
|
||||
printf("-m MCS value\n");
|
||||
printf("-n Number of trials to simulate\n");
|
||||
printf("-o ldpc offload flag\n");
|
||||
printf("-p Use extended prefix mode\n");
|
||||
printf("-q MCS table\n");
|
||||
printf("-r Number of allocated resource blocks for PUSCH\n");
|
||||
@@ -629,7 +623,6 @@ int main(int argc, char *argv[])
|
||||
cfg->carrier_config.num_rx_ant.value = n_rx;
|
||||
|
||||
// nr_phy_config_request_sim(gNB,N_RB_DL,N_RB_DL,mu,0,0x01);
|
||||
gNB->ldpc_offload_flag = ldpc_offload_flag;
|
||||
gNB->chest_freq = chest_type[0];
|
||||
gNB->chest_time = chest_type[1];
|
||||
|
||||
@@ -1611,8 +1604,6 @@ int main(int argc, char *argv[])
|
||||
num_dmrs_cdm_grps_no_data);
|
||||
|
||||
free_MIB_NR(mib);
|
||||
if (gNB->ldpc_offload_flag)
|
||||
free_nrLDPClib_offload();
|
||||
|
||||
if (output_fd)
|
||||
fclose(output_fd);
|
||||
|
||||
Reference in New Issue
Block a user