Merge branch 'develop-nr' into nr_pbchsim
This commit is contained in:
+101
-40
@@ -315,8 +315,8 @@ elseif (${RRC_ASN1_VERSION} STREQUAL "Rel14")
|
||||
make_version(RRC_VERSION 14 7 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-14.7.0.asn1)
|
||||
elseif (${RRC_ASN1_VERSION} STREQUAL "Rel15")
|
||||
make_version(RRC_VERSION 15 2 2)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/RRC-36331-f22.asn)
|
||||
make_version(RRC_VERSION 15 3 0)
|
||||
set (RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/LTE/MESSAGES/asn1c/ASN1_files/lte-rrc-15.3.0.asn1)
|
||||
endif (${RRC_ASN1_VERSION} STREQUAL "Rel8")
|
||||
add_definitions(-DRRC_VERSION=${RRC_VERSION})
|
||||
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
|
||||
@@ -355,8 +355,8 @@ add_custom_command (
|
||||
add_list2_option(NR_RRC_ASN1_VERSION "NR_Rel15" "ASN.1 version of NR_RRC interface")
|
||||
|
||||
if (${NR_RRC_ASN1_VERSION} STREQUAL "NR_Rel15")
|
||||
make_version(NR_RRC_VERSION 15 2 1)
|
||||
set (NR_RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1c/ASN1_files/nr-rrc-15.2.1.asn1)
|
||||
make_version(NR_RRC_VERSION 15 3 0)
|
||||
set (NR_RRC_GRAMMAR ${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1c/ASN1_files/nr-rrc-15.3.0.asn1)
|
||||
endif (${NR_RRC_ASN1_VERSION} STREQUAL "NR_Rel15")
|
||||
add_definitions(-DNR_RRC_VERSION=${NR_RRC_VERSION})
|
||||
set (NR_RRC_FULL_DIR ${asn1_generated_dir}/${NR_RRC_ASN1_VERSION})
|
||||
@@ -394,7 +394,7 @@ add_custom_command (OUTPUT ${NR_RRC_FULL_DIR}/NR_asn_constant.h
|
||||
# Same limitation as described in RRC: unknown generated file list
|
||||
# so we generate it at cmake time
|
||||
##############
|
||||
add_list1_option(S1AP_RELEASE R14 "S1AP ASN.1 grammar version" R8 R9 R10 R14 R15)
|
||||
add_list1_option(S1AP_RELEASE R15 "S1AP ASN.1 grammar version" R8 R9 R10 R14 R15)
|
||||
|
||||
set(S1AP_DIR ${OPENAIR3_DIR}/S1AP)
|
||||
if (${S1AP_RELEASE} STREQUAL "R8")
|
||||
@@ -416,11 +416,11 @@ elseif (${S1AP_RELEASE} STREQUAL "R13")
|
||||
make_version(S1AP_VERSION 13 6 0)
|
||||
set(S1AP_ASN_FILES "s1ap-13.6.0.asn1")
|
||||
elseif (${S1AP_RELEASE} STREQUAL "R14")
|
||||
make_version(S1AP_VERSION 14 5 0)
|
||||
set(S1AP_ASN_FILES "s1ap-14.5.0.asn1")
|
||||
make_version(S1AP_VERSION 14 7 0)
|
||||
set(S1AP_ASN_FILES "s1ap-14.7.0.asn1")
|
||||
else (${S1AP_RELEASE} STREQUAL "R15")
|
||||
make_version(S1AP_VERSION 15 1 0)
|
||||
set(S1AP_ASN_FILES "s1ap-15.1.0.asn1")
|
||||
make_version(S1AP_VERSION 15 3 0)
|
||||
set(S1AP_ASN_FILES "s1ap-15.3.0.asn1")
|
||||
endif(${S1AP_RELEASE} STREQUAL "R8")
|
||||
add_definitions(-DS1AP_VERSION=${S1AP_VERSION})
|
||||
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
|
||||
@@ -472,7 +472,7 @@ add_library(S1AP_ENB
|
||||
# Same limitation as described in RRC/S1AP: unknown generated file list
|
||||
# so we generate it at cmake time
|
||||
##############
|
||||
add_list1_option(X2AP_RELEASE R14 "X2AP ASN.1 grammar version" R8 R11 R12 R14 R15)
|
||||
add_list1_option(X2AP_RELEASE R15 "X2AP ASN.1 grammar version" R8 R11 R12 R14 R15)
|
||||
|
||||
set(X2AP_DIR ${OPENAIR2_DIR}/X2AP)
|
||||
if (${X2AP_RELEASE} STREQUAL "R8")
|
||||
@@ -488,8 +488,8 @@ elseif (${X2AP_RELEASE} STREQUAL "R14")
|
||||
make_version(X2AP_VERSION 14 6 0)
|
||||
set(X2AP_ASN_FILES x2ap-14.6.0.asn1)
|
||||
elseif (${X2AP_RELEASE} STREQUAL "R15")
|
||||
make_version(X2AP_VERSION 15 1 0)
|
||||
set(X2AP_ASN_FILES x2ap-15.1.0.asn1)
|
||||
make_version(X2AP_VERSION 15 3 0)
|
||||
set(X2AP_ASN_FILES x2ap-15.3.0.asn1)
|
||||
endif(${X2AP_RELEASE} STREQUAL "R8")
|
||||
add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
|
||||
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE})
|
||||
@@ -1119,24 +1119,19 @@ set(PHY_TURBOSRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_turbo_decoder.c
|
||||
)
|
||||
set(PHY_POLARSRC
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_init.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nr_polar_init.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_bitwise_operations.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_crc_byte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_bit_insertion.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_channel_interleaver_pattern.c
|
||||
# ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_crc.c
|
||||
# ${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/decoder_K56_N512_E864.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_crc.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_info_bit_pattern.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_interleaving_pattern.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_kernal_operation.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_kronecker_power_matrices.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_output_length.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_rate_match.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_procedures.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_sequence_pattern.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
|
||||
)
|
||||
set(PHY_TURBOIF
|
||||
${OPENAIR1_DIR}/PHY/CODING/coding_load.c
|
||||
@@ -1179,6 +1174,8 @@ set(PHY_SRC_COMMON
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_dl_mbsfn.c
|
||||
${OPENAIR1_DIR}/PHY/LTE_REFSIG/lte_ul_ref.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/lte_segmentation.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nr_segmentation.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/nr_compute_tbs.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/ccoding_byte_lte.c
|
||||
${OPENAIR1_DIR}/PHY/CODING/3gpplte_sse.c
|
||||
@@ -1294,6 +1291,8 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_pss.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_sss.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_pbch.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci_tools.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
@@ -1324,6 +1323,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_pbch.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_prach.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
|
||||
@@ -1458,7 +1458,7 @@ set(L2_SRC
|
||||
${RRC_DIR}/L2_interface_ue.c
|
||||
)
|
||||
|
||||
set(NR_L2_SRC
|
||||
set(L2_NR_SRC
|
||||
${NR_RRC_DIR}/rrc_gNB.c
|
||||
${NR_RRC_DIR}/nr_rrc_common.c
|
||||
${NR_RRC_DIR}/L2_nr_interface.c
|
||||
@@ -1514,6 +1514,12 @@ set(NR_L2_SRC_UE
|
||||
#${RRC_DIR}/rrc_UE.c
|
||||
)
|
||||
|
||||
set(L2_NR_SRC_UE
|
||||
${NR_UE_RRC_DIR}/L2_interface_ue.c
|
||||
${NR_UE_RRC_DIR}/main_ue.c
|
||||
${NR_UE_RRC_DIR}/rrc_UE.c
|
||||
)
|
||||
|
||||
set (MAC_SRC
|
||||
#${PHY_INTERFACE_DIR}/phy_stub_UE.c
|
||||
${PHY_INTERFACE_DIR}/IF_Module.c
|
||||
@@ -1536,15 +1542,16 @@ set (MAC_SRC
|
||||
${MAC_DIR}/pre_processor.c
|
||||
${MAC_DIR}/config.c
|
||||
${MAC_DIR}/config_ue.c
|
||||
)
|
||||
)
|
||||
|
||||
set (NR_MAC_SRC
|
||||
set (MAC_NR_SRC
|
||||
${NR_PHY_INTERFACE_DIR}/NR_IF_Module.c
|
||||
${NR_MAC_DIR}/main.c
|
||||
${NR_MAC_DIR}/config.c
|
||||
${NR_MAC_DIR}/gNB_scheduler.c
|
||||
${NR_MAC_DIR}/gNB_scheduler_bch.c
|
||||
${NR_MAC_DIR}/gNB_scheduler_primitives.c
|
||||
${NR_MAC_DIR}/gNB_scheduler_phytest.c
|
||||
)
|
||||
|
||||
|
||||
@@ -1582,11 +1589,12 @@ add_library(L2
|
||||
${L2_SRC}
|
||||
${MAC_SRC}
|
||||
${ENB_APP_SRC}
|
||||
)
|
||||
)
|
||||
# ${OPENAIR2_DIR}/RRC/L2_INTERFACE/openair_rrc_L2_interface.c)
|
||||
|
||||
add_library(NR_L2
|
||||
${NR_L2_SRC}
|
||||
${NR_MAC_SRC}
|
||||
add_library(L2_NR
|
||||
${L2_NR_SRC}
|
||||
${MAC_NR_SRC}
|
||||
${GNB_APP_SRC}
|
||||
)
|
||||
|
||||
@@ -2204,7 +2212,7 @@ add_executable(lte-softmodem
|
||||
|
||||
target_link_libraries (lte-softmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB PHY_COMMON PHY PHY_RU LFDS L2
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
@@ -2358,8 +2366,8 @@ add_executable(nr-softmodem
|
||||
target_link_libraries (nr-softmodem
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ATLAS_LIBRARIES}
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 NR_L2
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB}
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 L2_NR
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
@@ -2380,6 +2388,7 @@ add_executable(nr-softmodem-nos1
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-softmodem.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_nr_tasks.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
@@ -2399,7 +2408,7 @@ target_link_libraries (nr-softmodem-nos1
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${MIH_LIB}
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 NR_L2
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB L2 L2_NR
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
@@ -2608,16 +2617,68 @@ if (${T_TRACER})
|
||||
foreach(i
|
||||
#all "add_executable" definitions (except tests, rb_tool, updatefw)
|
||||
lte-softmodem lte-softmodem-nos1 lte-uesoftmodem lte-uesoftmodem-nos1
|
||||
nr-softmodem nr-softmodem-nos1 nr-uesoftmodem nr-uesoftmodem-nos1
|
||||
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
|
||||
pdcchsim pucchsim prachsim syncsim ulsim
|
||||
ldpctest polartest
|
||||
#all "add_library" definitions
|
||||
ITTI RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB
|
||||
oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif
|
||||
oai_eth_transpro
|
||||
FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA
|
||||
SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL CN_UTILS
|
||||
GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU OPENAIR0_LIB PHY_MEX
|
||||
coding)
|
||||
ITTI
|
||||
RRC_LIB
|
||||
NR_RRC_LIB
|
||||
S1AP_LIB
|
||||
S1AP_ENB
|
||||
X2AP_LIB
|
||||
params_libconfig
|
||||
oai_exmimodevif
|
||||
oai_usrpdevif
|
||||
oai_bladerfdevif
|
||||
oai_lmssdrdevif
|
||||
oai_eth_transpro
|
||||
oai_mobipass
|
||||
tcp_bridge
|
||||
tcp_bridge_oai
|
||||
coding
|
||||
FLPT_MSG
|
||||
ASYNC_IF
|
||||
FLEXRAN_AGENT
|
||||
HASHTABLE
|
||||
MSC
|
||||
UTIL
|
||||
SECU_OSA
|
||||
SECU_CN
|
||||
SCHED_LIB
|
||||
SCHED_NR_LIB
|
||||
SCHED_RU_LIB
|
||||
SCHED_UE_LIB
|
||||
SCHED_NR_UE_LIB
|
||||
NFAPI_COMMON_LIB
|
||||
NFAPI_LIB
|
||||
NFAPI_PNF_LIB
|
||||
NFAPI_VNF_LIB
|
||||
NFAPI_USER_LIB
|
||||
PHY_COMMON
|
||||
PHY
|
||||
PHY_UE
|
||||
PHY_NR
|
||||
PHY_NR_UE
|
||||
PHY_RU
|
||||
PHY_MEX
|
||||
L2
|
||||
L2_NR
|
||||
L2_UE
|
||||
NR_L2_UE
|
||||
NR_LTE_UE_REUSE_LIB
|
||||
CN_UTILS
|
||||
GTPV1U
|
||||
SCTP_CLIENT
|
||||
UDP
|
||||
LIB_NAS_UE
|
||||
NB_IoT
|
||||
LFDS
|
||||
LFDS7
|
||||
SIMU
|
||||
SIMU_ETH
|
||||
OPENAIR0_LIB)
|
||||
if (TARGET ${i})
|
||||
add_dependencies(${i} generate_T)
|
||||
endif()
|
||||
|
||||
@@ -1026,6 +1026,22 @@
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
</testCase>
|
||||
|
||||
<testCase id="015103">
|
||||
<class>execution</class>
|
||||
<desc>polartest test cases.</desc>
|
||||
<pre_compile_prog></pre_compile_prog>
|
||||
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
|
||||
<compile_prog_args> --phy_simulators -c </compile_prog_args>
|
||||
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
|
||||
<pre_exec_args></pre_exec_args>
|
||||
<main_exec> $OPENAIR_DIR/targets/bin/polartest.Rel15</main_exec>
|
||||
<main_exec_args>-q -s-10 -f0</main_exec_args>
|
||||
<tags>polartest.test1</tags>
|
||||
<search_expr_true>BLER= 0.000000</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
</testCase>
|
||||
|
||||
<testCase id="015110">
|
||||
<class>execution</class>
|
||||
|
||||
@@ -683,7 +683,7 @@ install_asn1c_from_source(){
|
||||
# better to use a given commit than a branch in case the branch
|
||||
# is updated and requires modifications in the source of OAI
|
||||
#git checkout velichkov_s1ap_plus_option_group
|
||||
git checkout 73d6b23dcec9ab36605b4af884143824392134c1
|
||||
git checkout d3aed06bb2bec7df1b5c6d0333f8c7dfc5993372
|
||||
autoreconf -iv
|
||||
./configure
|
||||
make -j`nproc`
|
||||
|
||||
@@ -1134,7 +1134,6 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req)
|
||||
|
||||
int retval = nfapi_vnf_p7_dl_config_req(p7_config, dl_config_req);
|
||||
|
||||
dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols = 1;
|
||||
dl_config_req->dl_config_request_body.number_dci = 0;
|
||||
dl_config_req->dl_config_request_body.number_pdu = 0;
|
||||
dl_config_req->dl_config_request_body.number_pdsch_rnti = 0;
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#define FAPI_NR_DL_CONFIG_TYPE_DCI 0x01
|
||||
#define FAPI_NR_DL_CONFIG_TYPE_DLSCH 0x02
|
||||
|
||||
|
||||
#define CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01
|
||||
#define CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02
|
||||
|
||||
@@ -55,4 +56,4 @@
|
||||
#define FAPI_NR_UL_CONFIG_TYPE_SRS 0x04
|
||||
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -37,8 +37,8 @@ typedef struct {
|
||||
uint8_t sul_ind_0_1 ; // 2 SUL_IND_0_1:
|
||||
uint8_t slot_format_ind ; // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213]
|
||||
uint8_t pre_emption_ind ; // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits
|
||||
uint8_t tpc_cmd_number ; // 5 TPC_CMD_NUMBER: The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits
|
||||
uint8_t block_number ; // 6 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3
|
||||
uint8_t block_number ; // 5 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3
|
||||
uint8_t close_loop_ind ; // 6 CLOSE_LOOP_IND:
|
||||
uint8_t bandwidth_part_ind ; // 7 BANDWIDTH_PART_IND:
|
||||
uint8_t short_message_ind ; // 8 SHORT_MESSAGE_IND:
|
||||
uint8_t short_messages ; // 9 SHORT_MESSAGES:
|
||||
@@ -81,7 +81,7 @@ typedef struct {
|
||||
uint8_t antenna_ports ; // 38 ANTENNA_PORTS:
|
||||
uint8_t tci ; // 39 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits
|
||||
uint8_t srs_request ; // 40 SRS_REQUEST:
|
||||
uint8_t tpc_cmd_number_format2_3 ; // 41 TPC_CMD_NUMBER_FORMAT2_3:
|
||||
uint8_t tpc_cmd ; // 41 TPC_CMD:
|
||||
uint8_t csi_request ; // 42 CSI_REQUEST:
|
||||
uint8_t cbgti ; // 43 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH
|
||||
uint8_t cbgfi ; // 44 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator
|
||||
@@ -237,15 +237,34 @@ typedef struct {
|
||||
typedef struct {
|
||||
|
||||
} fapi_nr_ul_config_pucch_pdu;
|
||||
|
||||
typedef enum {pusch_freq_hopping_disabled = 0 , pusch_freq_hopping_enabled = 1}pusch_freq_hopping_t;
|
||||
typedef struct{
|
||||
uint8_t aperiodicSRS_ResourceTrigger;
|
||||
} fapi_nr_ul_srs_config_t;
|
||||
typedef struct {
|
||||
uint8_t bandwidth_part_ind;
|
||||
uint16_t number_rbs;
|
||||
uint16_t start_rb;
|
||||
uint8_t frame_offset;
|
||||
uint16_t number_symbols;
|
||||
uint16_t start_symbol;
|
||||
pusch_freq_hopping_t pusch_freq_hopping;
|
||||
uint8_t mcs;
|
||||
uint8_t tpc_command;
|
||||
uint8_t ndi;
|
||||
uint8_t rv;
|
||||
uint8_t harq_process_nbr;
|
||||
int8_t accumulated_delta_PUSCH;
|
||||
int8_t absolute_delta_PUSCH;
|
||||
uint8_t n_layers;
|
||||
uint8_t tpmi;
|
||||
uint8_t n_dmrs_cdm_groups;
|
||||
uint8_t dmrs_ports[4];
|
||||
uint8_t n_front_load_symb;
|
||||
fapi_nr_ul_srs_config_t srs_config;
|
||||
uint8_t csi_reportTriggerSize;
|
||||
uint8_t maxCodeBlockGroupsPerTransportBlock;
|
||||
uint8_t ptrs_dmrs_association_port;
|
||||
uint8_t beta_offset_ind;
|
||||
} fapi_nr_ul_config_pusch_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -290,17 +309,43 @@ typedef struct {
|
||||
typedef struct {
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t dci_config_rel15;
|
||||
} fapi_nr_dl_config_dci_pdu;
|
||||
typedef struct{
|
||||
uint8_t aperiodicSRS_ResourceTrigger;
|
||||
} fapi_nr_dl_srs_config_t;
|
||||
|
||||
typedef enum{vrb_to_prb_mapping_non_interleaved = 0, vrb_to_prb_mapping_interleaved = 1} vrb_to_prb_mapping_t;
|
||||
//typedef fapi_nr_dci_pdu_rel15_t fapi_nr_dl_config_dlsch_pdu_rel15_t;
|
||||
typedef struct {
|
||||
uint8_t bandwidth_part_ind;
|
||||
uint16_t number_rbs;
|
||||
uint16_t start_rb;
|
||||
uint8_t frame_offset;
|
||||
uint16_t number_symbols;
|
||||
uint16_t start_symbol;
|
||||
uint8_t prb_bundling_size_ind;
|
||||
uint8_t rate_matching_ind;
|
||||
uint8_t zp_csi_rs_trigger;
|
||||
uint8_t mcs;
|
||||
uint8_t rv;
|
||||
uint8_t harq_pid;
|
||||
uint8_t ndi;
|
||||
// TODO: check the fields needed to L1 with NR_DL_UE_HARQ_t and NR_UE_DLSCH_t
|
||||
uint8_t rv;
|
||||
uint8_t tb2_mcs;
|
||||
uint8_t tb2_ndi;
|
||||
uint8_t tb2_rv;
|
||||
uint8_t harq_process_nbr;
|
||||
vrb_to_prb_mapping_t vrb_to_prb_mapping;
|
||||
uint8_t dai;
|
||||
double scaling_factor_S;
|
||||
int8_t accumulated_delta_PUCCH;
|
||||
uint8_t pucch_resource_id;
|
||||
uint8_t pdsch_to_harq_feedback_time_ind;
|
||||
uint8_t n_dmrs_cdm_groups;
|
||||
uint8_t dmrs_ports[10];
|
||||
uint8_t n_front_load_symb;
|
||||
uint8_t tci_state;
|
||||
fapi_nr_dl_srs_config_t srs_config;
|
||||
uint8_t cbgti;
|
||||
uint8_t codeBlockGroupFlushIndicator;
|
||||
// to be check the fields needed to L1 with NR_DL_UE_HARQ_t and NR_UE_DLSCH_t
|
||||
} fapi_nr_dl_config_dlsch_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -598,7 +643,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
uint8_t dmrs_type;
|
||||
uint8_t dmrs_addition_position;
|
||||
|
||||
uint8_t ptrs_uplink_config; // to indicate if PTRS Uplink is configured of not
|
||||
uint8_t ptrs_type; //cp-OFDM, dft-S-OFDM
|
||||
uint16_t ptrs_frequency_density[2];
|
||||
uint8_t ptrs_time_density[3];
|
||||
@@ -624,9 +669,15 @@ typedef struct {
|
||||
uint8_t delta_mcs;
|
||||
} fapi_nr_pusch_power_control_t;
|
||||
|
||||
typedef enum {tx_config_codebook = 1, tx_config_nonCodebook = 2} tx_config_t;
|
||||
typedef enum {transform_precoder_disabled = 0, transform_precoder_enabled = 1} transform_precoder_t;
|
||||
typedef enum {
|
||||
codebook_subset_fullyAndPartialAndNonCoherent = 1,
|
||||
codebook_subset_partialAndNonCoherent = 2,
|
||||
codebook_subset_nonCoherent = 3} codebook_subset_t;
|
||||
typedef struct {
|
||||
uint16_t data_scrambling_identity;
|
||||
uint8_t tx_config;
|
||||
tx_config_t tx_config;
|
||||
fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_a;
|
||||
fapi_nr_dmrs_uplink_config_t dmrs_ul_for_pusch_mapping_type_b;
|
||||
fapi_nr_pusch_power_control_t pusch_power_control;
|
||||
@@ -637,8 +688,8 @@ typedef struct {
|
||||
uint8_t pusch_aggregation_factor;
|
||||
uint8_t mcs_table;
|
||||
uint8_t mcs_table_transform_precoder;
|
||||
uint8_t transform_precoder;
|
||||
uint8_t codebook_subset;
|
||||
transform_precoder_t transform_precoder;
|
||||
codebook_subset_t codebook_subset;
|
||||
uint8_t max_rank;
|
||||
uint8_t rbg_size;
|
||||
|
||||
|
||||
@@ -11,6 +11,30 @@
|
||||
|
||||
#include "nfapi_interface.h"
|
||||
|
||||
|
||||
#define NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS 5
|
||||
|
||||
// Extension to the generic structures for single tlv values
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
int32_t value;
|
||||
} nfapi_int32_tlv_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint32_t value;
|
||||
} nfapi_uint32_tlv_t;
|
||||
|
||||
/*typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
int64_t value;
|
||||
} nfapi_int64_tlv_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint64_t value;
|
||||
} nfapi_uint64_tlv_t;*/
|
||||
|
||||
// nFAPI enums
|
||||
typedef enum {
|
||||
NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE = 0,
|
||||
@@ -159,6 +183,7 @@ typedef struct {
|
||||
nfapi_uint16_tlv_t ssb_periodicity;
|
||||
nfapi_uint16_tlv_t ss_pbch_block_power;
|
||||
nfapi_uint16_tlv_t n_ssb_crb;
|
||||
nfapi_uint16_tlv_t rmsi_pdcch_config;
|
||||
} nfapi_nr_sch_config_t;
|
||||
|
||||
#define NFAPI_NR_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x501E
|
||||
@@ -268,13 +293,10 @@ typedef enum {
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_0,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_1,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_2,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_3
|
||||
} nfapi_nr_dl_dci_format_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_UL_DCI_FORMAT_0_0 = 0,
|
||||
NFAPI_NR_UL_DCI_FORMAT_1_0,
|
||||
} nfapi_nr_ul_dci_format_e;
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_3,
|
||||
NFAPI_NR_UL_DCI_FORMAT_0_0,
|
||||
NFAPI_NR_UL_DCI_FORMAT_0_1
|
||||
} nfapi_nr_dci_format_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_RNTI_new = 0,
|
||||
@@ -290,73 +312,62 @@ typedef enum {
|
||||
NFAPI_NR_RNTI_TPC_PUSCH,
|
||||
NFAPI_NR_RNTI_TPC_PUCCH,
|
||||
NFAPI_NR_RNTI_TPC_SRS
|
||||
} nfapi_nr_rnti_type_e ;
|
||||
} nfapi_nr_rnti_type_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_USS_FORMAT_0_0_AND_1_0,
|
||||
NFAPI_NR_USS_FORMAT_0_1_AND_1_1,
|
||||
} nfapi_nr_uss_dci_formats_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_SEARCH_SPACE_TYPE_COMMON=0,
|
||||
NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
|
||||
} nfapi_nr_search_space_type_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1=0,
|
||||
NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE2,
|
||||
NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE3
|
||||
} nfapi_nr_ssb_and_cset_mux_pattern_type_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED=0,
|
||||
NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED
|
||||
} nfapi_nr_cce_reg_mapping_type_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_CSET_CONFIG_MIB_SIB1=0,
|
||||
NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG
|
||||
} nfapi_nr_coreset_config_type_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_CSET_SAME_AS_REG_BUNDLE=0,
|
||||
NFAPI_NR_CSET_ALL_CONTIGUOUS_RBS
|
||||
} nfapi_nr_coreset_precoder_granularity_type_e;
|
||||
|
||||
// P7 Sub Structures
|
||||
//formats 0_0 and 0_1
|
||||
|
||||
typedef struct {
|
||||
|
||||
nfapi_tl_t tl;
|
||||
|
||||
uint8_t cce_idx;
|
||||
uint8_t aggregation_level;
|
||||
uint16_t rnti;
|
||||
|
||||
uint8_t dci_format; //1 bit
|
||||
uint16_t frequency_domain_resource_assignment; //up to 9 bits
|
||||
uint8_t time_domain_resource_assignment; //0, 1, 2, 3 or 4 bits
|
||||
uint8_t format_indicator; //1 bit
|
||||
uint16_t frequency_domain_assignment; //up to 16 bits
|
||||
uint8_t time_domain_assignment; // 4 bits
|
||||
uint8_t frequency_hopping_flag; //1 bit
|
||||
uint8_t mcs; //5 bits
|
||||
uint8_t new_data_indicator; //1 bit
|
||||
uint8_t redundancy_version; //2 bits
|
||||
uint8_t harq_process; //4 bits
|
||||
uint8_t tpc; //2 bits
|
||||
uint16_t padding;
|
||||
uint8_t ul_sul_indicator; //0 or 1 bit
|
||||
|
||||
uint8_t carrier_indicator; //0 or 3 bits
|
||||
uint8_t bwp_indicator; //0, 1 or 2 bits
|
||||
uint8_t downlink_assignment_index1; //1 or 2 bits
|
||||
uint8_t downlink_assignment_index2; //0 or 2 bits
|
||||
uint8_t srs_resource_indicator;
|
||||
uint8_t precoding_information;
|
||||
uint8_t antenna_ports;
|
||||
uint8_t srs_request;
|
||||
uint8_t csi_request;
|
||||
uint8_t cbgti; //CBG Transmission Information: 0, 2, 4, 6 or 8 bits
|
||||
uint8_t ptrs_dmrs_association;
|
||||
uint8_t beta_offset_indicator; //0 or 2 bits
|
||||
uint8_t dmrs_sequence_initialization; //0 or 1 bit
|
||||
uint8_t ul_sch_indicator; //1 bit
|
||||
|
||||
} nfapi_nr_ul_config_dci_ul_pdu_rel15_t;
|
||||
//#define NFAPI_NR_UL_CONFIG_REQUEST_DCI_UL_PDU_REL15_TAG 0x????
|
||||
|
||||
//formats 1_0, 1_1, 2_0, 2_1, 2_2 and 2_3
|
||||
typedef struct {
|
||||
|
||||
nfapi_tl_t tl;
|
||||
|
||||
uint8_t cce_idx;
|
||||
uint8_t aggregation_level;
|
||||
uint16_t rnti;
|
||||
|
||||
uint8_t dci_format; //1 bit
|
||||
uint16_t frequency_domain_resource_assignment; //up to 9 bits
|
||||
|
||||
uint8_t ra_preamble_index; //6 bits
|
||||
uint8_t ul_sul_indicator; //1 bit
|
||||
uint8_t ss_pbch_index; //6 bits
|
||||
uint8_t prach_mask_index; //4 bits
|
||||
uint16_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI: 16 bits
|
||||
|
||||
uint8_t time_domain_resource_assignment; //0, 1, 2, 3 or 4 bits
|
||||
uint8_t vrb_to_prb_mapping; //0 or 1 bit
|
||||
uint8_t mcs; //5 bits
|
||||
uint8_t new_data_indicator; //1 bit
|
||||
uint8_t redundancy_version; //2 bits
|
||||
uint8_t harq_process; //4 bits
|
||||
uint8_t downlink_assignment_index; //0, 2 or 4 bits
|
||||
uint8_t ndi; //1 bit
|
||||
uint8_t rv; //2 bits
|
||||
uint8_t harq_pid; //4 bits
|
||||
uint8_t dai; //0, 2 or 4 bits
|
||||
uint8_t dai1; //1 or 2 bits
|
||||
uint8_t dai2; //0 or 2 bits
|
||||
uint8_t tpc; //2 bits
|
||||
uint8_t pucch_resource_indicator; //3 bits
|
||||
uint8_t pdsch_to_harq_feedback_timing_indicator; //0, 1, 2 or 3 bits
|
||||
@@ -370,13 +381,18 @@ uint8_t bwp_indicator; //0, 1 or 2 bits
|
||||
uint8_t prb_bundling_size_indicator; //0 or 1 bits
|
||||
uint8_t rate_matching_indicator; //0, 1 or 2 bits
|
||||
uint8_t zp_csi_rs_trigger; //0, 1 or 2 bits
|
||||
uint8_t antenna_ports; //4, 5 or 6 bits
|
||||
uint8_t transmission_configuration_indication; //0 or 3 bits
|
||||
uint8_t srs_request; //2 bits
|
||||
uint8_t cbgti; //CBG Transmission Information: 0, 2, 4, 6 or 8 bits
|
||||
uint8_t cbgfi; //CBG Flushing Out Information: 0 or 1 bit
|
||||
uint8_t dmrs_sequence_initialization; //0 or 1 bit
|
||||
|
||||
uint8_t srs_resource_indicator;
|
||||
uint8_t precoding_information;
|
||||
uint8_t csi_request;
|
||||
uint8_t ptrs_dmrs_association;
|
||||
uint8_t beta_offset_indicator; //0 or 2 bits
|
||||
|
||||
uint8_t slot_format_indicator_count;
|
||||
uint8_t *slot_format_indicators;
|
||||
|
||||
@@ -386,17 +402,75 @@ uint16_t *pre_emption_indications; //14 bit
|
||||
uint8_t block_number_count;
|
||||
uint8_t *block_numbers;
|
||||
|
||||
uint8_t ul_sul_indicator; //0 or 1 bit
|
||||
uint8_t antenna_ports;
|
||||
|
||||
uint16_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI: 16 bits
|
||||
uint16_t padding;
|
||||
|
||||
} nfapi_nr_dl_config_dci_dl_pdu_rel15_t;
|
||||
|
||||
//#define NFAPI_NR_DL_CONFIG_REQUEST_DCI_DL_PDU_REL15_TAG 0x????
|
||||
|
||||
typedef struct {
|
||||
nfapi_nr_dl_config_dci_dl_pdu_rel15_t dci_dl_pdu_rel15;
|
||||
} nfapi_nr_dl_config_dci_dl_pdu;
|
||||
typedef struct{
|
||||
nfapi_tl_t tl;
|
||||
uint8_t coreset_id;
|
||||
uint64_t frequency_domain_resources;
|
||||
uint8_t duration;
|
||||
uint8_t cce_reg_mapping_type;
|
||||
uint8_t reg_bundle_size;
|
||||
uint8_t interleaver_size;
|
||||
uint8_t shift_index;
|
||||
uint8_t precoder_granularity;
|
||||
uint8_t tci_state_id;
|
||||
uint8_t tci_present_in_dci;
|
||||
uint32_t dmrs_scrambling_id;
|
||||
} nfapi_nr_coreset_t;
|
||||
|
||||
typedef struct{
|
||||
nfapi_tl_t tl;
|
||||
uint8_t search_space_id;
|
||||
uint8_t coreset_id;
|
||||
uint8_t search_space_type;
|
||||
uint8_t duration;
|
||||
uint8_t css_formats_0_0_and_1_0;
|
||||
uint8_t css_format_2_0;
|
||||
uint8_t css_format_2_1;
|
||||
uint8_t css_format_2_2;
|
||||
uint8_t css_format_2_3;
|
||||
uint8_t uss_dci_formats;
|
||||
uint8_t srs_monitoring_periodicity;
|
||||
uint8_t slot_monitoring_periodicity;
|
||||
uint8_t slot_monitoring_offset;
|
||||
uint16_t monitoring_symbols_in_slot;
|
||||
uint16_t number_of_candidates[NFAPI_NR_MAX_NB_CCE_AGGREGATION_LEVELS];
|
||||
} nfapi_nr_search_space_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_nr_ul_config_dci_ul_pdu_rel15_t dci_ul_pdu_rel15;
|
||||
} nfapi_nr_ul_config_dci_ul_pdu;
|
||||
nfapi_tl_t tl;
|
||||
uint8_t rnti;
|
||||
uint8_t rnti_type;
|
||||
uint8_t dci_format;
|
||||
uint8_t config_type;
|
||||
uint8_t search_space_type;
|
||||
uint8_t aggregation_level;
|
||||
uint8_t n_rb;
|
||||
uint8_t n_symb;
|
||||
uint8_t rb_offset;
|
||||
uint8_t cr_mapping_type;
|
||||
uint8_t reg_bundle_size;
|
||||
uint8_t interleaver_size;
|
||||
uint8_t shift_index;
|
||||
uint8_t mux_pattern;
|
||||
uint8_t precoder_granularity;
|
||||
uint8_t first_slot;
|
||||
uint8_t first_symbol;
|
||||
uint8_t nb_ss_sets_per_slot;
|
||||
uint8_t nb_slots;
|
||||
uint8_t sfn_mod2;
|
||||
uint16_t scrambling_id;
|
||||
nfapi_bf_vector_t bf_vector;
|
||||
} nfapi_nr_dl_config_pdcch_parameters_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
@@ -411,13 +485,20 @@ typedef struct {
|
||||
} nfapi_nr_dl_config_bch_pdu;
|
||||
|
||||
typedef struct {
|
||||
|
||||
} nfapi_nr_dl_config_dlsch_pdu;
|
||||
nfapi_tl_t tl;
|
||||
nfapi_nr_search_space_t sib1searchSpace;
|
||||
nfapi_nr_coreset_t sib1ControlResourceSets;
|
||||
nfapi_nr_search_space_t sibssearchSpace;
|
||||
nfapi_nr_coreset_t sibsControlResourceSets;
|
||||
nfapi_nr_search_space_t ra_SearchSpace;
|
||||
nfapi_nr_coreset_t ra_ControlResourceSets;
|
||||
}nfapi_nr_dl_config_dlsch_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
nfapi_nr_SearchSpace_t pagingSearchSpace;
|
||||
} nfapi_nr_dl_config_pch_pdu;
|
||||
nfapi_nr_search_space_t pagingSearchSpace;
|
||||
nfapi_nr_coreset_t pagingControlResourceSets;
|
||||
}nfapi_nr_dl_config_pch_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -431,26 +512,31 @@ typedef struct {
|
||||
|
||||
} nfapi_nr_dl_config_ndlsch_pdu;
|
||||
|
||||
typedef struct {
|
||||
nfapi_nr_dl_config_dci_dl_pdu_rel15_t dci_dl_pdu_rel15;
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t pdcch_params_rel15;
|
||||
} nfapi_nr_dl_config_dci_dl_pdu;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint8_t pdu_type;
|
||||
uint8_t pdu_size;
|
||||
|
||||
union {
|
||||
nfapi_nr_dl_config_dci_dl_pdu dci_dl_pdu;
|
||||
nfapi_nr_ul_config_dci_ul_pdu dci_ul_pdu;
|
||||
nfapi_nr_dl_config_bch_pdu bch_pdu;
|
||||
nfapi_nr_dl_config_dlsch_pdu dlsch_pdu;
|
||||
nfapi_nr_dl_config_pch_pdu pch_pdu;
|
||||
nfapi_nr_dl_config_nbch_pdu nbch_pdu;
|
||||
nfapi_nr_dl_config_npdcch_pdu npdcch_pdu;
|
||||
nfapi_nr_dl_config_ndlsch_pdu ndlsch_pdu;
|
||||
nfapi_nr_dl_config_dci_dl_pdu dci_dl_pdu;
|
||||
nfapi_nr_dl_config_bch_pdu_rel15_t bch_pdu_rel15;
|
||||
nfapi_nr_dl_config_dlsch_pdu_rel15_t dlsch_pdu_rel15;
|
||||
nfapi_nr_dl_config_pch_pdu_rel15_t pch_pdu_rel15;
|
||||
//nfapi_nr_dl_config_nbch_pdu_rel15_t nbch_pdu_rel15;
|
||||
//nfapi_nr_dl_config_npdcch_pdu_rel15_t npdcch_pdu_rel15;
|
||||
//nfapi_nr_dl_config_ndlsch_pdu_rel15_t ndlsch_pdu_rel15;
|
||||
};
|
||||
} nfapi_nr_dl_config_request_pdu_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
uint8_t number_pdcch_ofdm_symbols;
|
||||
uint8_t number_dci;
|
||||
uint16_t number_pdu;
|
||||
uint8_t number_pdu;
|
||||
uint8_t number_pdsch_rnti;
|
||||
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu_list;
|
||||
} nfapi_nr_dl_config_request_body_t;
|
||||
|
||||
@@ -7,10 +7,13 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
|
||||
//#define DEBUG_DCI_POLAR_PARAMS
|
||||
//#define DEBUG_POLAR_TIMING
|
||||
//#define DEBUG_CRC
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
//Initiate timing. (Results depend on CPU Frequency. Therefore, might change due to performance variances during simulation.)
|
||||
@@ -18,39 +21,30 @@ int main(int argc, char *argv[]) {
|
||||
time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving;
|
||||
time_stats_t path_metric,sorting,update_LLR;
|
||||
opp_enabled=1;
|
||||
int decoder_int8=0;
|
||||
int decoder_int16=0;
|
||||
int generate_optim_code=0;
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
reset_meas(&timeEncoder);
|
||||
reset_meas(&timeDecoder);
|
||||
reset_meas(&polar_decoder_init);
|
||||
reset_meas(&polar_rate_matching);
|
||||
reset_meas(&decoding);
|
||||
reset_meas(&bit_extraction);
|
||||
reset_meas(&deinterleaving);
|
||||
reset_meas(&sorting);
|
||||
reset_meas(&path_metric);
|
||||
reset_meas(&update_LLR);
|
||||
randominit(0);
|
||||
crcTableInit();
|
||||
|
||||
randominit(1234);
|
||||
//Default simulation values (Aim for iterations = 1000000.)
|
||||
int itr, iterations = 1000, arguments, polarMessageType = 1; //0=DCI, 1=PBCH, 2=UCI
|
||||
int itr, iterations = 1000, arguments, polarMessageType = 0; //0=PBCH, 1=DCI, -1=UCI
|
||||
double SNRstart = -20.0, SNRstop = 0.0, SNRinc= 0.5; //dB
|
||||
|
||||
double SNR, SNR_lin;
|
||||
int16_t nBitError = 0; // -1 = Decoding failed (All list entries have failed the CRC checks).
|
||||
int8_t decoderState=0, blockErrorState=0; //0 = Success, -1 = Decoding failed, 1 = Block Error.
|
||||
uint16_t testLength, coderLength, blockErrorCumulative=0, bitErrorCumulative=0;
|
||||
uint16_t testLength = 0, coderLength = 0, blockErrorCumulative=0, bitErrorCumulative=0;
|
||||
double timeEncoderCumulative = 0, timeDecoderCumulative = 0;
|
||||
uint8_t aggregation_level = 8, decoderListSize = 8, pathMetricAppr = 0;
|
||||
|
||||
uint8_t decoderListSize = 8, pathMetricAppr = 0; //0 --> eq. (8a) and (11b), 1 --> eq. (9) and (12)
|
||||
int generate_optim_code=0;
|
||||
|
||||
while ((arguments = getopt (argc, argv, "s:d:f:m:i:l:a:h:qg")) != -1)
|
||||
while ((arguments = getopt (argc, argv, "s:d:f:m:i:l:a:hqg")) != -1)
|
||||
switch (arguments)
|
||||
{
|
||||
case 's':
|
||||
SNRstart = atof(optarg);
|
||||
printf("SNRstart = %f\n", SNRstart);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
@@ -78,7 +72,7 @@ int main(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
decoder_int8=1;
|
||||
decoder_int16=1;
|
||||
break;
|
||||
|
||||
case 'g':
|
||||
@@ -86,10 +80,11 @@ int main(int argc, char *argv[]) {
|
||||
iterations=1;
|
||||
SNRstart=-6.0;
|
||||
SNRstop =-6.0;
|
||||
decoder_int8=1;
|
||||
decoder_int16=1;
|
||||
break;
|
||||
|
||||
case 'h':
|
||||
printf("./polartest -s SNRstart -d SNRinc -f SNRstop -m [0=DCI|1=PBCH|2=UCI] -i iterations -l decoderListSize -a pathMetricAppr\n");
|
||||
printf("./polartest -s SNRstart -d SNRinc -f SNRstop -m [0=PBCH|1=DCI|2=UCI] -i iterations -l decoderListSize -a pathMetricAppr -q (use fixed point decoder)\n");
|
||||
exit(-1);
|
||||
|
||||
default:
|
||||
@@ -97,139 +92,323 @@ int main(int argc, char *argv[]) {
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (polarMessageType == 0) { //DCI
|
||||
//testLength = ;
|
||||
//coderLength = ;
|
||||
printf("polartest for DCI not supported yet\n");
|
||||
exit(-1);
|
||||
} else if (polarMessageType == 1) { //PBCH
|
||||
testLength = NR_POLAR_PBCH_PAYLOAD_BITS;
|
||||
coderLength = NR_POLAR_PBCH_E;
|
||||
printf("running polartest for PBCH\n");
|
||||
} else if (polarMessageType == 2) { //UCI
|
||||
testLength = NR_POLAR_PUCCH_PAYLOAD_BITS;
|
||||
coderLength = NR_POLAR_PUCCH_E;
|
||||
printf("running polartest for UCI");
|
||||
} else {
|
||||
printf("unsupported polarMessageType %d (0=DCI, 1=PBCH, 2=UCI)\n",polarMessageType);
|
||||
exit(-1);
|
||||
if (polarMessageType == 0) { //PBCH
|
||||
testLength = NR_POLAR_PBCH_PAYLOAD_BITS;
|
||||
coderLength = NR_POLAR_PBCH_E;
|
||||
aggregation_level = NR_POLAR_PBCH_AGGREGATION_LEVEL;
|
||||
} else if (polarMessageType == 1) { //DCI
|
||||
//testLength = nr_get_dci_size(params_rel15->dci_format, params_rel15->rnti_type, &fp->initial_bwp_dl, cfg);
|
||||
testLength = 20;
|
||||
coderLength = 108; //to be changed by aggregate level function.
|
||||
} else if (polarMessageType == -1) { //UCI
|
||||
//testLength = ;
|
||||
//coderLength = ;
|
||||
}
|
||||
|
||||
|
||||
//Logging
|
||||
time_t currentTime;
|
||||
time (¤tTime);
|
||||
char *folderName, fileName[512], currentTimeInfo[25];
|
||||
char fileName[512], currentTimeInfo[25];
|
||||
char folderName[] = ".";
|
||||
|
||||
/*
|
||||
folderName=getenv("HOME");
|
||||
strcat(folderName,"/Desktop/polartestResults");
|
||||
*/
|
||||
|
||||
#ifdef DEBUG_POLAR_TIMING
|
||||
sprintf(fileName,"%s/TIMING_ListSize_%d_pmAppr_%d_Payload_%d_Itr_%d",folderName,decoderListSize,pathMetricAppr,testLength,iterations);
|
||||
#else
|
||||
sprintf(fileName,"%s/_ListSize_%d_pmAppr_%d_Payload_%d_Itr_%d",folderName,decoderListSize,pathMetricAppr,testLength,iterations);
|
||||
#endif
|
||||
strftime(currentTimeInfo, 25, "_%Y-%m-%d-%H-%M-%S.csv", localtime(¤tTime));
|
||||
strcat(fileName,currentTimeInfo);
|
||||
|
||||
//Create "~/Desktop/polartestResults" folder if it doesn't already exist.
|
||||
/*
|
||||
struct stat folder = {0};
|
||||
if (stat(folderName, &folder) == -1) mkdir(folderName, S_IRWXU | S_IRWXG | S_IRWXO);
|
||||
|
||||
*/
|
||||
|
||||
FILE* logFile;
|
||||
logFile = fopen(fileName, "w");
|
||||
if (logFile==NULL) {
|
||||
fprintf(stderr,"[polartest.c] Problem creating file %s with fopen\n",fileName);
|
||||
exit(-1);
|
||||
}
|
||||
fprintf(logFile,",SNR,nBitError,blockErrorState,t_encoder[us],t_decoder[us]\n");
|
||||
|
||||
uint8_t *testInput = malloc(sizeof(uint8_t) * testLength); //generate randomly
|
||||
uint8_t *encoderOutput = malloc(sizeof(uint8_t) * coderLength);
|
||||
#ifdef DEBUG_POLAR_TIMING
|
||||
fprintf(logFile,",timeEncoderCRCByte[us],timeEncoderCRCBit[us],timeEncoderInterleaver[us],timeEncoderBitInsertion[us],timeEncoder1[us],timeEncoder2[us],timeEncoderRateMatching[us],timeEncoderByte2Bit[us]\n");
|
||||
#else
|
||||
fprintf(logFile,",SNR,nBitError,blockErrorState,t_encoder[us],t_decoder[us]\n");
|
||||
#endif
|
||||
|
||||
uint8_t testArrayLength = ceil(testLength / 32.0);
|
||||
uint8_t coderArrayLength = ceil(coderLength / 32.0);
|
||||
|
||||
uint32_t *testInput = malloc(sizeof(uint32_t) * testArrayLength); //generate randomly
|
||||
uint32_t *encoderOutput = malloc(sizeof(uint32_t) * coderArrayLength);
|
||||
uint32_t *estimatedOutput = malloc(sizeof(uint32_t) * testArrayLength); //decoder output
|
||||
memset(testInput,0,sizeof(uint32_t) * testArrayLength);
|
||||
memset(encoderOutput,0,sizeof(uint32_t) * coderArrayLength);
|
||||
memset(estimatedOutput,0,sizeof(uint32_t) * testArrayLength);
|
||||
|
||||
uint8_t *encoderOutputByte = malloc(sizeof(uint8_t) * coderLength);
|
||||
double *modulatedInput = malloc (sizeof(double) * coderLength); //channel input
|
||||
|
||||
double *channelOutput = malloc (sizeof(double) * coderLength); //add noise
|
||||
int16_t *channelOutput_int8 = malloc (sizeof(int16_t) * coderLength); //add noise
|
||||
uint8_t *estimatedOutput = malloc(sizeof(uint8_t) * testLength); //decoder output
|
||||
int16_t *channelOutput_int16;
|
||||
if (decoder_int16 == 1) channelOutput_int16 = (int16_t*)malloc (sizeof(int16_t) * coderLength);
|
||||
|
||||
t_nrPolar_paramsPtr nrPolar_params = NULL, currentPtr = NULL;
|
||||
nr_polar_init(&nrPolar_params, polarMessageType, testLength, aggregation_level);
|
||||
currentPtr = nr_polar_params(nrPolar_params, polarMessageType, testLength, aggregation_level);
|
||||
|
||||
t_nrPolar_params nrPolar_params;
|
||||
nr_polar_init(&nrPolar_params, polarMessageType);
|
||||
nr_polar_llrtableinit();
|
||||
#ifdef DEBUG_DCI_POLAR_PARAMS
|
||||
uint32_t dci_pdu[4];
|
||||
memset(dci_pdu,0,sizeof(uint32_t)*4);
|
||||
dci_pdu[0]=0x01189400;
|
||||
printf("dci_pdu: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
dci_pdu[0], dci_pdu[1], dci_pdu[2], dci_pdu[3]);
|
||||
uint32_t encoder_output[54];
|
||||
memset(encoder_output,0,sizeof(uint32_t)*54);
|
||||
uint16_t size=41;
|
||||
uint16_t rnti=3;
|
||||
aggregation_level=8;
|
||||
nr_polar_init(&nrPolar_params, 1, size, aggregation_level);
|
||||
t_nrPolar_paramsPtr currentPtrDCI=nr_polar_params(nrPolar_params, 1, size, aggregation_level);
|
||||
|
||||
if (generate_optim_code==1) nrPolar_params.decoder_kernel = NULL;
|
||||
polar_encoder_dci(dci_pdu, encoder_output, currentPtrDCI, rnti);
|
||||
for (int i=0;i<54;i++)
|
||||
printf("encoder_output: [%2d]->0x%08x \n",i, encoder_output[i]);
|
||||
|
||||
uint8_t *encoder_outputByte = malloc(sizeof(uint8_t) * currentPtrDCI->encoderLength);
|
||||
double *channel_output = malloc (sizeof(double) * currentPtrDCI->encoderLength);
|
||||
uint32_t dci_estimation[4];
|
||||
memset(dci_estimation,0,sizeof(uint32_t)*4);
|
||||
printf("dci_estimation: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
dci_estimation[0], dci_estimation[1], dci_estimation[2], dci_estimation[3]);
|
||||
nr_bit2byte_uint32_8_t(encoder_output, currentPtrDCI->encoderLength, encoder_outputByte);
|
||||
printf("[polartest] encoder_outputByte: ");
|
||||
for (int i = 0; i < currentPtrDCI->encoderLength; i++) printf("%d-", encoder_outputByte[i]);
|
||||
printf("\n");
|
||||
for(int i=0; i<currentPtrDCI->encoderLength; i++) {
|
||||
if (encoder_outputByte[i] == 0) {
|
||||
channel_output[i]=1/sqrt(2);
|
||||
}
|
||||
else {
|
||||
channel_output[i]=(-1)/sqrt(2);
|
||||
}
|
||||
}
|
||||
|
||||
decoderState = polar_decoder_dci(channel_output,
|
||||
dci_estimation,
|
||||
currentPtrDCI,
|
||||
NR_POLAR_DECODER_LISTSIZE,
|
||||
NR_POLAR_DECODER_PATH_METRIC_APPROXIMATION,
|
||||
rnti);
|
||||
printf("dci_estimation: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
dci_estimation[0], dci_estimation[1], dci_estimation[2], dci_estimation[3]);
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_CRC
|
||||
uint32_t crc;
|
||||
unsigned int poly24c = 0xb2b11700;
|
||||
uint32_t testInputCRC[4];
|
||||
testInputCRC[0]=0x00291880;
|
||||
//testInputCRC[0]=0x01189400;
|
||||
testInputCRC[1]=0x00000000;
|
||||
testInputCRC[2]=0x00000000;
|
||||
testInputCRC[3]=0x00000000;
|
||||
|
||||
uint32_t testInputcrc=0x01189400;
|
||||
uint32_t testInputcrc2=0x00291880;
|
||||
|
||||
uint8_t testInputCRC2[8];
|
||||
nr_crc_bit2bit_uint32_8_t(testInputCRC, 32, testInputCRC2);
|
||||
printf("testInputCRC2: [0]->%x \t [1]->%x \t [2]->%x \t [3]->%x\n"
|
||||
" [4]->%x \t [5]->%x \t [6]->%x \t [7]->%x\n",
|
||||
testInputCRC2[0], testInputCRC2[1], testInputCRC2[2], testInputCRC2[3],
|
||||
testInputCRC2[4], testInputCRC2[5], testInputCRC2[6], testInputCRC2[7]);
|
||||
unsigned int crc41 = crc24c(testInputCRC, 32);
|
||||
unsigned int crc65 = crc24c(testInputCRC, 56);
|
||||
printf("crc41: [0]->0x%08x\tcrc65: [0]->0x%08x\n",crc41, crc65);
|
||||
for (int i=0;i<32;i++) printf("crc41[%d]=%d\tcrc65[%d]=%d\n",i,(crc41>>i)&1,i,(crc65>>i)&1);
|
||||
|
||||
crc = crc24c(testInputCRC, testLength)>>8;
|
||||
for (int i=0;i<24;i++) printf("[i]=%d\n",(crc>>i)&1);
|
||||
printf("crc: [0]->0x%08x\n",crc);
|
||||
//crcbit(testInputCRC, sizeof(test) - 1, poly24c));
|
||||
|
||||
testInputCRC[testLength>>3] = ((uint8_t*)&crc)[2];
|
||||
testInputCRC[1+(testLength>>3)] = ((uint8_t*)&crc)[1];
|
||||
testInputCRC[2+(testLength>>3)] = ((uint8_t*)&crc)[0];
|
||||
printf("testInputCRC: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
testInputCRC[0], testInputCRC[1], testInputCRC[2], testInputCRC[3]);
|
||||
|
||||
|
||||
//uint32_t trial32 = 0xffffffff;
|
||||
uint32_t trial32 = 0xf10fffff;
|
||||
uint8_t a[4];
|
||||
//memcpy(a, &trial32, sizeof(trial32));
|
||||
*(uint32_t *)a = trial32;
|
||||
unsigned char trial[4];
|
||||
trial[0]=0xff; trial[1]=0xff; trial[2]=0x0f; trial[3]=0xf1;
|
||||
uint32_t trialcrc = crc24c(trial, 32);
|
||||
uint32_t trialcrc32 = crc24c((uint8_t *)&trial32, 32);
|
||||
//uint32_t trialcrc32 = crc24c(a, 32);
|
||||
printf("crcbit(trial = %x\n", crcbit(trial, 4, poly24c));
|
||||
printf("trialcrc = %x\n", trialcrc);
|
||||
printf("trialcrc32 = %x\n", trialcrc32);
|
||||
for (int i=0;i<32;i++) printf("trialcrc[%2d]=%d\ttrialcrc32[%2d]=%d\n",i,(trialcrc>>i)&1,i,(trialcrc32>>i)&1);
|
||||
|
||||
|
||||
//uint8_t nr_polar_A[32] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1};
|
||||
uint8_t nr_polar_A[32] = {1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,1};
|
||||
uint8_t nr_polar_crc[24];
|
||||
uint8_t **crc_generator_matrix = crc24c_generator_matrix(32);
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(nr_polar_A,
|
||||
crc_generator_matrix,
|
||||
nr_polar_crc,
|
||||
32,
|
||||
24);
|
||||
for (uint8_t i = 0; i < 24; i++){
|
||||
nr_polar_crc[i] = (nr_polar_crc[i] % 2);
|
||||
printf("nr_polar_crc[%d]=%d\n",i,nr_polar_crc[i]);
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_POLAR_TIMING
|
||||
for (SNR = SNRstart; SNR <= SNRstop; SNR += SNRinc) {
|
||||
SNR_lin = pow(10, SNR / 10);
|
||||
for (itr = 1; itr <= iterations; itr++) {
|
||||
for (int j=0; j<ceil(testLength / 32.0); j++) {
|
||||
for(int i=0; i<32; i++) {
|
||||
testInput[j] |= ( ((uint32_t) (rand()%2)) &1);
|
||||
testInput[j]<<=1;
|
||||
}
|
||||
}
|
||||
printf("testInput: [0]->0x%08x \n", testInput[0]);
|
||||
polar_encoder_timing(testInput, encoderOutput, currentPtr, cpu_freq_GHz, logFile);
|
||||
}
|
||||
}
|
||||
fclose(logFile);
|
||||
free(testInput);
|
||||
free(encoderOutput);
|
||||
free(modulatedInput);
|
||||
free(channelOutput);
|
||||
free(estimatedOutput);
|
||||
return (0);
|
||||
#endif
|
||||
|
||||
// We assume no a priori knowledge available about the payload.
|
||||
double aPrioriArray[nrPolar_params.payloadBits];
|
||||
for (int i=0; i<=nrPolar_params.payloadBits; i++) aPrioriArray[i] = NAN;
|
||||
|
||||
printf("SNRstart %f, SNRstop %f,, SNRinc %f\n",SNRstart,SNRstop,SNRinc);
|
||||
double aPrioriArray[currentPtr->payloadBits];
|
||||
for (int i=0; i<currentPtr->payloadBits; i++) aPrioriArray[i] = NAN;
|
||||
|
||||
for (SNR = SNRstart; SNR <= SNRstop; SNR += SNRinc) {
|
||||
printf("SNR %f\n",SNR);
|
||||
SNR_lin = pow(10, SNR/10);
|
||||
for (itr = 1; itr <= iterations; itr++) {
|
||||
|
||||
for(int i=0; i<testLength; i++)
|
||||
testInput[i]=(uint8_t) (rand() % 2);
|
||||
|
||||
start_meas(&timeEncoder);
|
||||
polar_encoder(testInput, encoderOutput, &nrPolar_params);
|
||||
stop_meas(&timeEncoder);
|
||||
|
||||
//BPSK modulation
|
||||
for(int i=0; i<coderLength; i++) {
|
||||
if (encoderOutput[i] == 0)
|
||||
modulatedInput[i]=1/sqrt(2);
|
||||
else
|
||||
modulatedInput[i]=(-1)/sqrt(2);
|
||||
|
||||
channelOutput[i] = modulatedInput[i] + (gaussdouble(0.0,1.0) * (1/sqrt(2*SNR_lin)));
|
||||
|
||||
if (decoder_int8==1) {
|
||||
if (channelOutput[i] > 15) channelOutput_int8[i] = 127;
|
||||
else if (channelOutput[i] < -16) channelOutput_int8[i] = -128;
|
||||
else channelOutput_int8[i] = (int16_t) (8*channelOutput[i]);
|
||||
for (int i = 0; i < testArrayLength; i++) {
|
||||
for (int j = 0; j < (sizeof(testInput[0])*8)-1; j++) {
|
||||
testInput[i] |= ( ((uint32_t) (rand()%2)) &1);
|
||||
testInput[i]<<=1;
|
||||
}
|
||||
testInput[i] |= ( ((uint32_t) (rand()%2)) &1);
|
||||
}
|
||||
}
|
||||
|
||||
/*printf("testInput: [0]->0x%08x\n", testInput[0]);
|
||||
for (int i=0; i<32; i++)
|
||||
printf("%d\n",(testInput[0]>>i)&1);*/
|
||||
|
||||
start_meas(&timeEncoder);
|
||||
polar_encoder(testInput, encoderOutput, currentPtr);
|
||||
stop_meas(&timeEncoder);
|
||||
|
||||
/*printf("encoderOutput: [0]->0x%08x\n", encoderOutput[0]);
|
||||
printf("encoderOutput: [1]->0x%08x\n", encoderOutput[1]);*/
|
||||
|
||||
//Bit-to-byte:
|
||||
nr_bit2byte_uint32_8_t(encoderOutput, coderLength, encoderOutputByte);
|
||||
|
||||
//BPSK modulation
|
||||
for(int i=0; i<coderLength; i++) {
|
||||
if (encoderOutputByte[i] == 0)
|
||||
modulatedInput[i]=1/sqrt(2);
|
||||
else
|
||||
modulatedInput[i]=(-1)/sqrt(2);
|
||||
|
||||
channelOutput[i] = modulatedInput[i] + (gaussdouble(0.0,1.0) * (1/sqrt(2*SNR_lin)));
|
||||
|
||||
|
||||
if (decoder_int16==1) {
|
||||
if (channelOutput[i] > 15) channelOutput_int16[i] = 127;
|
||||
else if (channelOutput[i] < -16) channelOutput_int16[i] = -128;
|
||||
else channelOutput_int16[i] = (int16_t) (8*channelOutput[i]);
|
||||
}
|
||||
|
||||
|
||||
start_meas(&timeDecoder);
|
||||
if (decoder_int8==0)
|
||||
decoderState = polar_decoder(channelOutput, estimatedOutput, &nrPolar_params,
|
||||
decoderListSize, aPrioriArray, pathMetricAppr,
|
||||
&polar_decoder_init,&polar_rate_matching,&decoding,
|
||||
&bit_extraction,&deinterleaving,&sorting,&path_metric,&update_LLR);
|
||||
else
|
||||
decoderState = polar_decoder_int8_new(channelOutput_int8, estimatedOutput, &nrPolar_params,
|
||||
decoderListSize, &polar_decoder_init,&polar_rate_matching,
|
||||
&decoding,&bit_extraction,&deinterleaving,
|
||||
&sorting,&path_metric,&update_LLR,
|
||||
generate_optim_code);
|
||||
stop_meas(&timeDecoder);
|
||||
|
||||
//calculate errors
|
||||
if (decoderState==-1) {
|
||||
blockErrorState=-1;
|
||||
nBitError=-1;
|
||||
} else {
|
||||
for(int i=0; i<testLength; i++){
|
||||
if (estimatedOutput[i]!=testInput[i]) nBitError++;
|
||||
}
|
||||
if (nBitError>0) blockErrorState=1;
|
||||
}
|
||||
|
||||
//Iteration times are in microseconds.
|
||||
timeEncoderCumulative+=(timeEncoder.diff_now/(cpu_freq_GHz*1000.0));
|
||||
timeDecoderCumulative+=(timeDecoder.diff_now/(cpu_freq_GHz*1000.0));
|
||||
fprintf(logFile,",%f,%d,%d,%f,%f\n", SNR, nBitError, blockErrorState,
|
||||
(timeEncoder.diff_now/(cpu_freq_GHz*1000.0)), (timeDecoder.diff_now/(cpu_freq_GHz*1000.0)));
|
||||
start_meas(&timeDecoder);
|
||||
/*decoderState = polar_decoder(channelOutput,
|
||||
estimatedOutput,
|
||||
currentPtr,
|
||||
NR_POLAR_DECODER_LISTSIZE,
|
||||
aPrioriArray,
|
||||
NR_POLAR_DECODER_PATH_METRIC_APPROXIMATION);*/
|
||||
if (decoder_int16==0)
|
||||
decoderState = polar_decoder_aPriori(channelOutput,
|
||||
estimatedOutput,
|
||||
currentPtr,
|
||||
NR_POLAR_DECODER_LISTSIZE,
|
||||
NR_POLAR_DECODER_PATH_METRIC_APPROXIMATION,
|
||||
aPrioriArray);
|
||||
else
|
||||
decoderState = polar_decoder_int16(channelOutput_int16,
|
||||
estimatedOutput,
|
||||
currentPtr);
|
||||
|
||||
if (nBitError<0) {
|
||||
blockErrorCumulative++;
|
||||
bitErrorCumulative+=testLength;
|
||||
} else {
|
||||
blockErrorCumulative+=blockErrorState;
|
||||
bitErrorCumulative+=nBitError;
|
||||
}
|
||||
|
||||
stop_meas(&timeDecoder);
|
||||
/*printf("testInput: [0]->0x%08x\n", testInput[0]);
|
||||
printf("estimatedOutput: [0]->0x%08x\n", estimatedOutput[0]);*/
|
||||
|
||||
decoderState=0;
|
||||
nBitError=0;
|
||||
blockErrorState=0;
|
||||
|
||||
//calculate errors
|
||||
if (decoderState==-1) {
|
||||
blockErrorState=-1;
|
||||
nBitError=-1;
|
||||
} else {
|
||||
for (int i = 0; i < testArrayLength; i++) {
|
||||
for (int j = 0; j < (sizeof(testInput[0])*8); j++) {
|
||||
if (((estimatedOutput[i]>>j) & 1) != ((testInput[i]>>j) & 1)) nBitError++;
|
||||
}
|
||||
}
|
||||
|
||||
if (nBitError>0) blockErrorState=1;
|
||||
}
|
||||
|
||||
//Iteration times are in microseconds.
|
||||
timeEncoderCumulative+=(timeEncoder.diff_now/(cpu_freq_GHz*1000.0));
|
||||
timeDecoderCumulative+=(timeDecoder.diff_now/(cpu_freq_GHz*1000.0));
|
||||
fprintf(logFile,",%f,%d,%d,%f,%f\n", SNR, nBitError, blockErrorState,
|
||||
(timeEncoder.diff_now/(cpu_freq_GHz*1000.0)), (timeDecoder.diff_now/(cpu_freq_GHz*1000.0)));
|
||||
|
||||
if (nBitError<0) {
|
||||
blockErrorCumulative++;
|
||||
bitErrorCumulative+=testLength;
|
||||
} else {
|
||||
blockErrorCumulative+=blockErrorState;
|
||||
bitErrorCumulative+=nBitError;
|
||||
}
|
||||
|
||||
decoderState=0;
|
||||
nBitError=0;
|
||||
blockErrorState=0;
|
||||
|
||||
}
|
||||
//Calculate error statistics for the SNR.
|
||||
@@ -237,15 +416,10 @@ int main(int argc, char *argv[]) {
|
||||
decoderListSize, pathMetricAppr, SNR, ((double)blockErrorCumulative/iterations),
|
||||
((double)bitErrorCumulative / (iterations*testLength)),
|
||||
(timeEncoderCumulative/iterations),timeDecoderCumulative/iterations);
|
||||
printf("decoding init %9.3fus\n",polar_decoder_init.diff/(cpu_freq_GHz*1000.0*polar_decoder_init.trials));
|
||||
|
||||
printf("decoding polar_rate_matching %9.3fus\n",polar_rate_matching.diff/(cpu_freq_GHz*1000.0*polar_rate_matching.trials));
|
||||
printf("decoding decoding %9.3fus\n",decoding.diff/(cpu_freq_GHz*1000.0*decoding.trials));
|
||||
printf("decoding bit_extraction %9.3fus\n",bit_extraction.diff/(cpu_freq_GHz*1000.0*bit_extraction.trials));
|
||||
printf("decoding deinterleaving %9.3fus\n",deinterleaving.diff/(cpu_freq_GHz*1000.0*deinterleaving.trials));
|
||||
printf("decoding path_metric %9.3fus\n",path_metric.diff/(cpu_freq_GHz*1000.0*decoding.trials));
|
||||
printf("decoding sorting %9.3fus\n",sorting.diff/(cpu_freq_GHz*1000.0*decoding.trials));
|
||||
printf("decoding updateLLR %9.3fus\n",update_LLR.diff/(cpu_freq_GHz*1000.0*decoding.trials));
|
||||
if (blockErrorCumulative==0 && bitErrorCumulative==0)
|
||||
break;
|
||||
|
||||
blockErrorCumulative = 0; bitErrorCumulative = 0;
|
||||
timeEncoderCumulative = 0; timeDecoderCumulative = 0;
|
||||
}
|
||||
@@ -254,11 +428,14 @@ int main(int argc, char *argv[]) {
|
||||
print_meas(&timeDecoder,"polar_decoder",NULL,NULL);
|
||||
|
||||
fclose(logFile);
|
||||
//Bit
|
||||
free(testInput);
|
||||
free(encoderOutput);
|
||||
free(estimatedOutput);
|
||||
//Byte
|
||||
free(encoderOutputByte);
|
||||
free(modulatedInput);
|
||||
free(channelOutput);
|
||||
free(estimatedOutput);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -355,8 +355,16 @@ based on 3GPP UMTS/LTE specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@param bitlen length of inputs in bits
|
||||
*/
|
||||
unsigned int crc24b (unsigned char * inptr, int bitlen);
|
||||
|
||||
uint32_t crc24b (uint8_t *inPtr, int32_t bitlen);
|
||||
|
||||
/*!\fn uint32_t crc24c(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 24-bit crc ('c' variant for transport-block segments)
|
||||
based on 3GPP Rel 15 specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@param bitlen length of inputs in bits
|
||||
*/
|
||||
uint32_t crc24c (uint8_t *inPtr, int32_t bitlen);
|
||||
|
||||
/*!\fn uint32_t crc16(uint8_t *inPtr, int32_t bitlen)
|
||||
\brief This computes a 16-bit crc based on 3GPP UMTS specifications.
|
||||
@param inPtr Pointer to input byte stream
|
||||
@@ -440,4 +448,20 @@ decoder_if_t phy_threegpplte_turbo_decoder;
|
||||
decoder_if_t phy_threegpplte_turbo_decoder8;
|
||||
decoder_if_t phy_threegpplte_turbo_decoder16;
|
||||
|
||||
int32_t nr_segmentation(unsigned char *input_buffer,
|
||||
unsigned char **output_buffers,
|
||||
unsigned int B,
|
||||
unsigned int *C,
|
||||
unsigned int *Kplus,
|
||||
unsigned int *Kminus,
|
||||
unsigned int *Zout,
|
||||
unsigned int *F);
|
||||
|
||||
uint32_t nr_compute_tbs(uint8_t mcs,
|
||||
uint16_t nb_rb,
|
||||
uint16_t nb_symb_sch,
|
||||
uint8_t nb_re_dmrs,
|
||||
uint16_t length_dmrs,
|
||||
uint8_t Nl);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -35,9 +35,12 @@
|
||||
|
||||
/*ref 36-212 v8.6.0 , pp 8-9 */
|
||||
/* the highest degree is set by default */
|
||||
unsigned int poly24a = 0x864cfb00; //1000 0110 0100 1100 1111 1011 D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
|
||||
unsigned int poly24b = 0x80006300; // 1000 0000 0000 0000 0110 0011 D^24 + D^23 + D^6 + D^5 + D + 1
|
||||
uint32_t poly24c = 0xB2B11700; //101100101011000100010111
|
||||
unsigned int poly24a = 0x864cfb00; // 1000 0110 0100 1100 1111 1011
|
||||
// D^24 + D^23 + D^18 + D^17 + D^14 + D^11 + D^10 + D^7 + D^6 + D^5 + D^4 + D^3 + D + 1
|
||||
unsigned int poly24b = 0x80006300; // 1000 0000 0000 0000 0110 0011
|
||||
// D^24 + D^23 + D^6 + D^5 + D + 1
|
||||
unsigned int poly24c = 0xb2b11700; // 1011 0010 1011 0001 0001 0111
|
||||
// D^24+D^23+D^21+D^20+D^17+D^15+D^13+D^12+D^8+D^4+D^2+D+1
|
||||
unsigned int poly16 = 0x10210000; // 0001 0000 0010 0001 D^16 + D^12 + D^5 + 1
|
||||
unsigned int poly12 = 0x80F00000; // 1000 0000 1111 D^12 + D^11 + D^3 + D^2 + D + 1
|
||||
unsigned int poly8 = 0x9B000000; // 1001 1011 D^8 + D^7 + D^4 + D^3 + D + 1
|
||||
@@ -52,10 +55,11 @@ For initialization && verification purposes,
|
||||
The first bit is in the MSB of each byte
|
||||
|
||||
*********************************************************/
|
||||
unsigned int
|
||||
crcbit (unsigned char * inputptr, int octetlen, unsigned int poly)
|
||||
unsigned int crcbit (unsigned char * inputptr,
|
||||
int octetlen,
|
||||
unsigned int poly)
|
||||
{
|
||||
unsigned int i, crc = 0, c;
|
||||
unsigned int i, crc = 0, c;
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
c = (*inputptr++) << 24;
|
||||
@@ -78,19 +82,21 @@ crcbit (unsigned char * inputptr, int octetlen, unsigned int poly)
|
||||
crc table initialization
|
||||
|
||||
*********************************************************/
|
||||
static unsigned int crc24aTable[256];
|
||||
static unsigned int crc24bTable[256];
|
||||
static unsigned int crc24aTable[256];
|
||||
static unsigned int crc24bTable[256];
|
||||
static unsigned int crc24cTable[256];
|
||||
static unsigned short crc16Table[256];
|
||||
static unsigned short crc12Table[256];
|
||||
static unsigned char crc8Table[256];
|
||||
|
||||
void crcTableInit (void)
|
||||
{
|
||||
unsigned char c = 0;
|
||||
unsigned char c = 0;
|
||||
|
||||
do {
|
||||
crc24aTable[c] = crcbit (&c, 1, poly24a);
|
||||
crc24bTable[c] = crcbit (&c, 1, poly24b);
|
||||
crc24cTable[c] = crcbit (&c, 1, poly24c);
|
||||
crc16Table[c] = (unsigned short) (crcbit (&c, 1, poly16) >> 16);
|
||||
crc12Table[c] = (unsigned short) (crcbit (&c, 1, poly12) >> 16);
|
||||
crc8Table[c] = (unsigned char) (crcbit (&c, 1, poly8) >> 24);
|
||||
@@ -114,8 +120,8 @@ Byte by byte implementations,
|
||||
assuming initial byte is 0 padded (in MSB) if necessary
|
||||
|
||||
*********************************************************/
|
||||
unsigned int
|
||||
crc24a (unsigned char * inptr, int bitlen)
|
||||
unsigned int crc24a (unsigned char * inptr,
|
||||
int bitlen)
|
||||
{
|
||||
|
||||
int octetlen, resbit;
|
||||
@@ -134,11 +140,11 @@ crc24a (unsigned char * inptr, int bitlen)
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int crc24b (unsigned char * inptr, int bitlen)
|
||||
unsigned int crc24b (unsigned char * inptr,
|
||||
int bitlen)
|
||||
{
|
||||
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
@@ -153,6 +159,27 @@ unsigned int crc24b (unsigned char * inptr, int bitlen)
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int crc24c (unsigned char * inptr,
|
||||
int bitlen)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen / 8; /* Change in octets */
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
/*#ifdef DEBUG_CRC24C
|
||||
printf("crc24c: in %x => crc %x (%x)\n",crc,*inptr,crc24cTable[(*inptr) ^ (crc >> 24)]);
|
||||
#endif*/
|
||||
crc = (crc << 8) ^ crc24cTable[(*inptr++) ^ (crc >> 24)];
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
crc = (crc << resbit) ^ crc24cTable[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
unsigned int
|
||||
crc16 (unsigned char * inptr, int bitlen)
|
||||
{
|
||||
@@ -228,48 +255,6 @@ unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table
|
||||
return crc;
|
||||
}
|
||||
|
||||
void nr_crc_computation(uint8_t* input, uint8_t* output, uint16_t payloadBits, uint16_t crcParityBits, uint32_t* crc256Table)
|
||||
{
|
||||
//Create payload in bit
|
||||
uint8_t* input2 = (uint8_t*)malloc(payloadBits); //divided by 8 (in bits)
|
||||
uint8_t mask = 128; // 10000000
|
||||
|
||||
for(uint8_t ind=0; ind<(payloadBits/8); ind++)
|
||||
{
|
||||
input2[ind]=0;
|
||||
for(uint8_t ind2=0; ind2<8; ind2++)
|
||||
{
|
||||
if(input[8*ind+ind2])
|
||||
{
|
||||
input2[ind] = input2[ind] | mask;
|
||||
}
|
||||
mask= mask >> 1;
|
||||
}
|
||||
mask=128;
|
||||
}
|
||||
|
||||
//crcTable256Init(poly);
|
||||
|
||||
unsigned int crcBits;
|
||||
crcBits = crcPayload(input2, payloadBits, crc256Table);
|
||||
|
||||
//create crc in byte
|
||||
unsigned int mask2=0x80000000; //100...
|
||||
|
||||
for(uint8_t ind=0; ind<crcParityBits; ind++)
|
||||
{
|
||||
if(crcBits & mask2)
|
||||
output[ind]=1;
|
||||
else
|
||||
output[ind]=0;
|
||||
|
||||
mask2 = mask2 >> 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_CRC
|
||||
|
||||
@@ -21,17 +21,38 @@
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
void nr_byte2bit(uint8_t *array, uint8_t arraySize, uint8_t *bitArray){//First 2 parameters are in bytes.
|
||||
|
||||
for (int i=0; i<arraySize; i++){
|
||||
bitArray[(7+(i*8))] = ( array[i]>>0 & 0x01);
|
||||
bitArray[(6+(i*8))] = ( array[i]>>1 & 0x01);
|
||||
bitArray[(5+(i*8))] = ( array[i]>>2 & 0x01);
|
||||
bitArray[(4+(i*8))] = ( array[i]>>3 & 0x01);
|
||||
bitArray[(3+(i*8))] = ( array[i]>>4 & 0x01);
|
||||
bitArray[(2+(i*8))] = ( array[i]>>5 & 0x01);
|
||||
bitArray[(1+(i*8))] = ( array[i]>>6 & 0x01);
|
||||
bitArray[ (i*8) ] = ( array[i]>>7 & 0x01);
|
||||
void nr_bit2byte_uint32_8_t(uint32_t *in, uint16_t arraySize, uint8_t *out) {
|
||||
uint8_t arrayInd = ceil(arraySize / 32.0);
|
||||
for (int i = 0; i < (arrayInd-1); i++) {
|
||||
for (int j = 0; j < 32; j++) {
|
||||
out[j+(i*32)] = (in[i] >> j) & 1;
|
||||
}
|
||||
}
|
||||
|
||||
for (int j = 0; j < arraySize - ((arrayInd-1) * 32); j++) out[j + ((arrayInd-1) * 32)] = (in[(arrayInd-1)] >> j) & 1;
|
||||
}
|
||||
|
||||
void nr_byte2bit_uint8_32_t(uint8_t *in, uint16_t arraySize, uint32_t *out) {
|
||||
uint8_t arrayInd = ceil(arraySize / 32.0);
|
||||
for (int i = 0; i < arrayInd; i++) {
|
||||
out[i]=0;
|
||||
for (int j = 31; j > 0; j--) {
|
||||
out[i]|=in[(i*32)+j];
|
||||
out[i]<<=1;
|
||||
}
|
||||
out[i]|=in[(i*32)];
|
||||
}
|
||||
}
|
||||
|
||||
void nr_crc_bit2bit_uint32_8_t(uint32_t *in, uint16_t arraySize, uint8_t *out) {
|
||||
out[0]=0xff;
|
||||
out[1]=0xff;
|
||||
out[2]=0xff;
|
||||
uint8_t arrayInd = ceil(arraySize / 32.0);
|
||||
for (int i = 0; i < arrayInd; i++) {
|
||||
out[3+i*4] = ((in[i] & (0x0000000f))<<4) | ((in[i] & (0x000000f0))>>4);
|
||||
out[4+i*4] = (((in[i] & (0x00000f00))<<4) | ((in[i] & (0x0000f000))>>4))>>8;
|
||||
out[5+i*4] = (((in[i] & (0x000f0000))<<4) | ((in[i] & (0x00f00000))>>4))>>16;
|
||||
out[6+i*4] = (((in[i] & (0x0f000000))<<4) | ((in[i] & (0xf0000000))>>4))>>24;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,132 +21,7 @@
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
/*
|
||||
// ----- New implementation ----
|
||||
uint32_t poly6 = 0x84000000; // 10000100000... -> D^6+D^5+1
|
||||
uint32_t poly11 = 0xc4200000; //11000100001000... -> D^11+D^10+D^9+D^5+1
|
||||
uint32_t poly16 = 0x10210000; //00100000010000100... - > D^16+D^12+D^5+1
|
||||
uint32_t poly24a = 0x864cfb00; //100001100100110011111011 -> D^24+D^23+D^18+D^17+D^14+D^11+D^10+D^7+D^6+D^5+D^4+D^3+D+1
|
||||
uint32_t poly24b = 0x80006300; //100000000000000001100011 -> D^24+D^23+D^6+D^5+D+1
|
||||
uint32_t poly24c = 0xB2B11700; //101100101011000100010111 -> D^24...
|
||||
|
||||
//static unsigned int crc256Table[256];
|
||||
|
||||
void nr_crc_computation(uint8_t* input, uint8_t* output, uint16_t payloadBits, uint16_t crcParityBits, uint32_t* crc256Table)
|
||||
{
|
||||
//Create payload in bit
|
||||
uint8_t* input2 = (uint8_t*)malloc(payloadBits); //divided by 8 (in bits)
|
||||
uint8_t mask = 128; // 10000000
|
||||
|
||||
for(uint8_t ind=0; ind<(payloadBits/8); ind++)
|
||||
{
|
||||
input2[ind]=0;
|
||||
for(uint8_t ind2=0; ind2<8; ind2++)
|
||||
{
|
||||
if(input[8*ind+ind2])
|
||||
{
|
||||
input2[ind] = input2[ind] | mask;
|
||||
}
|
||||
mask= mask >> 1;
|
||||
}
|
||||
mask=128;
|
||||
}
|
||||
|
||||
//crcTable256Init(poly);
|
||||
|
||||
unsigned int crcBits;
|
||||
crcBits = crcPayload(input2, payloadBits, crc256Table);
|
||||
|
||||
//create crc in byte
|
||||
unsigned int mask2=0x80000000; //100...
|
||||
output = (uint8_t*)malloc(sizeof(uint8_t)*crcParityBits);
|
||||
|
||||
for(uint8_t ind=0; ind<crcParityBits; ind++)
|
||||
{
|
||||
if(crcBits & mask2)
|
||||
output[ind]=1;
|
||||
else
|
||||
output[ind]=0;
|
||||
|
||||
mask2 = mask2 >> 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
unsigned int crcbit (unsigned char* inputptr, int octetlen, unsigned int poly)
|
||||
{
|
||||
unsigned int i, crc = 0, c;
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
c = (*inputptr++) << 24;
|
||||
|
||||
for (i = 8; i != 0; i--) {
|
||||
if ((1 << 31) & (c ^ crc))
|
||||
crc = (crc << 1) ^ poly;
|
||||
else
|
||||
crc <<= 1;
|
||||
|
||||
c <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
return crc;
|
||||
}
|
||||
|
||||
void crcTableInit (void)
|
||||
{
|
||||
unsigned char c = 0;
|
||||
|
||||
do {
|
||||
crc6Table[c] = crcbit(&c, 1, poly6);
|
||||
crc11Table[c]= crcbit(&c, 1, poly11);
|
||||
crc16Table[c] =crcbit(&c, 1, poly16);
|
||||
crc24aTable[c]=crcbit(&c, 1, poly24a);
|
||||
crc24bTable[c]=crcbit(&c, 1, poly24b);
|
||||
crc24cTable[c]=crcbit(&c, 1, poly24c);
|
||||
|
||||
} while (++c);
|
||||
}
|
||||
|
||||
void crcTable256Init (uint32_t poly, uint32_t* crc256Table)
|
||||
{
|
||||
unsigned char c = 0;
|
||||
// crc256Table = malloc(sizeof(uint32_t)*256);
|
||||
|
||||
do {
|
||||
crc256Table[c] = crcbit(&c, 1, poly);
|
||||
|
||||
// crc6Table[c] = crcbit(&c, 1, poly6);
|
||||
// crc11Table[c]= crcbit(&c, 1, poly11);
|
||||
// crc16Table[c] =crcbit(&c, 1, poly16);
|
||||
// crc24aTable[c]=crcbit(&c, 1, poly24a);
|
||||
// crc24bTable[c]=crcbit(&c, 1, poly24b);
|
||||
// crc24cTable[c]=crcbit(&c, 1, poly24c);
|
||||
|
||||
} while (++c);
|
||||
|
||||
//return crc256Table;
|
||||
}
|
||||
|
||||
unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table)
|
||||
{
|
||||
int octetlen, resbit;
|
||||
unsigned int crc = 0;
|
||||
octetlen = bitlen/8; // Change in bytes
|
||||
resbit = (bitlen % 8);
|
||||
|
||||
while (octetlen-- > 0)
|
||||
{
|
||||
crc = (crc << 8) ^ crc256Table[(*inptr++) ^ (crc >> 24)];
|
||||
}
|
||||
|
||||
if (resbit > 0)
|
||||
{
|
||||
crc = (crc << resbit) ^ crc256Table[((*inptr) >> (8 - resbit)) ^ (crc >> (32 - resbit))];
|
||||
}
|
||||
return crc;
|
||||
}
|
||||
*/
|
||||
// ----- Old implementation ----
|
||||
uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits){
|
||||
|
||||
|
||||
@@ -1,63 +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
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
void nr_polar_channel_interleaver_pattern(uint16_t *cip, uint8_t I_BIL, uint16_t E){
|
||||
|
||||
if (I_BIL == 1) {
|
||||
uint16_t T=0, k;
|
||||
while( ((T/2)*(T+1)) < E ) T++;
|
||||
|
||||
|
||||
int16_t **v = malloc(T * sizeof(*v));
|
||||
for (int i = 0; i <= T-1; i++) v[i] = malloc((T-i) * sizeof(*(v[i])));
|
||||
|
||||
k=0;
|
||||
for (int i = 0; i <= T-1; i++) {
|
||||
for (int j = 0; j <= (T-1)-i; j++) {
|
||||
if (k<E) {
|
||||
v[i][j] = k;
|
||||
} else {
|
||||
v[i][j] = (-1);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
k=0;
|
||||
for (int j = 0; j <= T-1; j++) {
|
||||
for (int i = 0; i <= (T-1)-j; i++) {
|
||||
if ( v[i][j] != (-1) ) {
|
||||
cip[k]=v[i][j];
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i <= T-1; i++) free(v[i]);
|
||||
free(v);
|
||||
|
||||
} else {
|
||||
for (int i=0; i<=E-1; i++) cip[i]=i;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,10 +33,14 @@
|
||||
#ifndef __NR_POLAR_DCI_DEFS__H__
|
||||
#define __NR_POLAR_DCI_DEFS__H__
|
||||
|
||||
#define NR_POLAR_DCI_MESSAGE_TYPE 1 //int8_t
|
||||
#define NR_POLAR_DCI_CRC_PARITY_BITS 24
|
||||
#define NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS 3
|
||||
|
||||
//Sec. 7.3.3: Channel Coding
|
||||
#define NR_POLAR_DCI_N_MAX 9 //uint8_t
|
||||
#define NR_POLAR_DCI_I_IL 1 //uint8_t
|
||||
//#define NR_POLAR_DCI_I_SEG 0 //uint8_t
|
||||
#define NR_POLAR_DCI_I_SEG 0 //uint8_t
|
||||
#define NR_POLAR_DCI_N_PC 0 //uint8_t
|
||||
#define NR_POLAR_DCI_N_PC_WM 0 //uint8_t
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -19,275 +19,179 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/impl_defs_top.h"
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_decoding_tools.c
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "PHY/impl_defs_top.h"
|
||||
|
||||
inline void computeLLR(double llr[1+nmax][Nmax], uint16_t row, uint16_t col,
|
||||
uint16_t offset, uint8_t approximation) __attribute__((always_inline));
|
||||
inline void computeLLR(double llr[1+nmax][Nmax], uint16_t row, uint16_t col,
|
||||
uint16_t offset, uint8_t approximation) {
|
||||
//#define DEBUG_NEW_IMPL
|
||||
|
||||
double a;
|
||||
double b;
|
||||
double absA,absB;
|
||||
|
||||
|
||||
a = llr[col + 1][row];
|
||||
b = llr[col+1][row + offset];
|
||||
|
||||
if (approximation) { //eq. (9)
|
||||
absA = fabs(a);
|
||||
absB = fabs(b);
|
||||
llr[col][row] = copysign(1.0, a) * copysign(1.0, b) * fmin(absA, absB);
|
||||
} else { //eq. (8a)
|
||||
llr[col][row] = log((exp(a + b) + 1) / (exp(a) + exp(b)));
|
||||
void updateLLR(double ***llr,
|
||||
uint8_t **llrU,
|
||||
uint8_t ***bit,
|
||||
uint8_t **bitU,
|
||||
uint8_t listSize,
|
||||
uint16_t row,
|
||||
uint16_t col,
|
||||
uint16_t xlen,
|
||||
uint8_t ylen,
|
||||
uint8_t approximation)
|
||||
{
|
||||
uint16_t offset = (xlen/(pow(2,(ylen-col-1))));
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
if (( (row) % (2*offset) ) >= offset ) {
|
||||
if(bitU[row-offset][col]==0) updateBit(bit, bitU, listSize, (row-offset), col, xlen, ylen);
|
||||
if(llrU[row-offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row-offset), (col+1), xlen, ylen, approximation);
|
||||
if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen, approximation);
|
||||
llr[row][col][i] = (pow((-1),bit[row-offset][col][i])*llr[row-offset][col+1][i]) + llr[row][col+1][i];
|
||||
} else {
|
||||
if(llrU[row][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, row, (col+1), xlen, ylen, approximation);
|
||||
if(llrU[row+offset][col+1]==0) updateLLR(llr, llrU, bit, bitU, listSize, (row+offset), (col+1), xlen, ylen, approximation);
|
||||
computeLLR(llr, row, col, i, offset, approximation);
|
||||
}
|
||||
}
|
||||
llrU[row][col]=1;
|
||||
|
||||
// printf("LLR (a %f, b %f): llr[%d][%d] %f\n",32*a,32*b,col,row,32*llr[col][row]);
|
||||
}
|
||||
|
||||
int16_t llrtab[256][256];
|
||||
void updateBit(uint8_t ***bit,
|
||||
uint8_t **bitU,
|
||||
uint8_t listSize,
|
||||
uint16_t row,
|
||||
uint16_t col,
|
||||
uint16_t xlen,
|
||||
uint8_t ylen)
|
||||
{
|
||||
|
||||
void nr_polar_llrtableinit() {
|
||||
int16_t absA,absB;
|
||||
int16_t minabs;
|
||||
uint16_t offset = ( xlen/(pow(2,(ylen-col))) );
|
||||
|
||||
for (int a=-128;a<128;a++) {
|
||||
for (int b=-128;b<128;b++) {
|
||||
absA=abs(a);
|
||||
absB=abs(b);
|
||||
minabs = absA<absB ? absA:absB;
|
||||
if ((a<0 && b<0) || (a>=0 && b>=0)) llrtab[a+128][b+128] = minabs;
|
||||
else llrtab[a+128][b+128] = -minabs;
|
||||
}
|
||||
}
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
if (( (row) % (2*offset) ) >= offset ) {
|
||||
if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen);
|
||||
bit[row][col][i] = bit[row][col-1][i];
|
||||
} else {
|
||||
if (bitU[row][col-1]==0) updateBit(bit, bitU, listSize, row, (col-1), xlen, ylen);
|
||||
if (bitU[row+offset][col-1]==0) updateBit(bit, bitU, listSize, (row+offset), (col-1), xlen, ylen);
|
||||
bit[row][col][i] = ( (bit[row][col-1][i]+bit[row+offset][col-1][i]) % 2);
|
||||
}
|
||||
}
|
||||
|
||||
bitU[row][col]=1;
|
||||
}
|
||||
|
||||
void updatePathMetric(double *pathMetric,
|
||||
double ***llr,
|
||||
uint8_t listSize,
|
||||
uint8_t bitValue,
|
||||
uint16_t row,
|
||||
uint8_t approximation)
|
||||
{
|
||||
if (approximation) { //eq. (12)
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
if ((2*bitValue) != ( 1 - copysign(1.0,llr[row][0][i]) )) pathMetric[i] += fabs(llr[row][0][i]);
|
||||
}
|
||||
} else { //eq. (11b)
|
||||
int8_t multiplier = (2*bitValue) - 1;
|
||||
for (uint8_t i=0; i<listSize; i++) pathMetric[i] += log ( 1 + exp(multiplier*llr[row][0][i]) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void updateLLR(decoder_list_t **dlist,uint8_t **llrU, uint8_t **bitU,
|
||||
uint8_t listSize, uint16_t row, uint16_t col, uint16_t xlen, uint8_t ylen, uint8_t approximation) {
|
||||
void updatePathMetric2(double *pathMetric,
|
||||
double ***llr,
|
||||
uint8_t listSize,
|
||||
uint16_t row,
|
||||
uint8_t appr)
|
||||
{
|
||||
double *tempPM = malloc(sizeof(double) * listSize);
|
||||
for (int i=0; i < listSize; i++) tempPM[i]=pathMetric[i];
|
||||
|
||||
uint16_t offset = (xlen/(1<<(ylen-col-1)));
|
||||
if (( (row) % (2*offset) ) >= offset ) {
|
||||
if (bitU[row-offset][col]==0) updateBit(dlist, bitU, listSize, (row-offset), col, xlen, ylen);
|
||||
if (llrU[row-offset][col+1]==0) updateLLR(dlist, llrU, bitU, listSize, (row-offset), (col+1), xlen, ylen, approximation);
|
||||
if (llrU[row][col+1]==0) updateLLR(dlist, llrU, bitU, listSize, row, (col+1), xlen, ylen, approximation);
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
dlist[i]->llr[col][row] = (pow((-1),dlist[i]->bit[col][row-offset])*dlist[i]->llr[col+1][row-offset]) + dlist[i]->llr[col+1][row];
|
||||
}
|
||||
} else {
|
||||
if (llrU[row][col+1]==0) updateLLR(dlist, llrU, bitU, listSize, row, (col+1), xlen, ylen, approximation);
|
||||
if (llrU[row+offset][col+1]==0) updateLLR(dlist, llrU, bitU, listSize, (row+offset), (col+1), xlen, ylen, approximation);
|
||||
for (int i=0;i<listSize;i++) computeLLR(dlist[i]->llr, row, col, offset, approximation);
|
||||
}
|
||||
|
||||
llrU[row][col]=1;
|
||||
}
|
||||
|
||||
void updateLLR_int8(decoder_list_int8_t **dlist,uint8_t **llrU, uint8_t **bitU,
|
||||
uint8_t listSize, uint16_t row, uint16_t col, uint16_t xlen, uint8_t ylen,
|
||||
int generate_optim_code,FILE *fd) {
|
||||
uint16_t offset = (xlen/(1<<(ylen-col-1)));
|
||||
if (( (row) % (2*offset) ) >= offset ) {
|
||||
if (bitU[row-offset][col]==0) updateBit_int8(dlist, bitU, listSize, (row-offset), col, xlen, ylen,generate_optim_code,fd);
|
||||
if (llrU[row-offset][col+1]==0) updateLLR_int8(dlist, llrU, bitU, listSize, (row-offset), (col+1), xlen, ylen,generate_optim_code,fd);
|
||||
if (llrU[row][col+1]==0) updateLLR_int8(dlist, llrU, bitU, listSize, row, (col+1), xlen, ylen,generate_optim_code,fd);
|
||||
uint8_t bitValue = 0;
|
||||
if (appr) { //eq. (12)
|
||||
for (uint8_t i = 0; i < listSize; i++) {
|
||||
if ((2 * bitValue) != (1 - copysign(1.0, llr[row][0][i]))) pathMetric[i] += fabs(llr[row][0][i]);
|
||||
}
|
||||
} else { //eq. (11b)
|
||||
int8_t multiplier = (2 * bitValue) - 1;
|
||||
for (uint8_t i = 0; i < listSize; i++) pathMetric[i] += log(1 + exp(multiplier * llr[row][0][i]));
|
||||
}
|
||||
|
||||
|
||||
if (generate_optim_code==1) fprintf(fd,"updateLLR_int8_A(sorted_dlist,%d,%d,%d,%d);\n",listSize,col,row,offset);
|
||||
bitValue = 1;
|
||||
if (appr) { //eq. (12)
|
||||
for (uint8_t i = listSize; i < 2*listSize; i++) {
|
||||
if ((2 * bitValue) != (1 - copysign(1.0, llr[row][0][(i-listSize)]))) pathMetric[i] = tempPM[(i-listSize)] + fabs(llr[row][0][(i-listSize)]);
|
||||
}
|
||||
} else { //eq. (11b)
|
||||
int8_t multiplier = (2 * bitValue) - 1;
|
||||
for (uint8_t i = listSize; i < 2*listSize; i++) pathMetric[i] = tempPM[(i-listSize)] + log(1 + exp(multiplier * llr[row][0][(i-listSize)]));
|
||||
}
|
||||
|
||||
updateLLR_int8_A(dlist,listSize,col,row,offset);
|
||||
|
||||
} else {
|
||||
if (llrU[row][col+1]==0) updateLLR_int8(dlist, llrU, bitU, listSize, row, (col+1), xlen, ylen,generate_optim_code,fd);
|
||||
if (llrU[row+offset][col+1]==0) updateLLR_int8(dlist, llrU, bitU, listSize, (row+offset), (col+1), xlen, ylen,generate_optim_code,fd);
|
||||
if (generate_optim_code==1) fprintf(fd,"computeLLR_int8(sorted_dlist,%d,%d,%d,%d);\n",listSize,row,col,offset);
|
||||
computeLLR_int8(dlist,listSize, row, col, offset);
|
||||
}
|
||||
|
||||
llrU[row][col]=1;
|
||||
}
|
||||
|
||||
void updateBit(decoder_list_t **dlist, uint8_t **bitU, uint8_t listSize, uint16_t row,
|
||||
uint16_t col, uint16_t xlen, uint8_t ylen) {
|
||||
uint16_t offset = ( xlen/(pow(2,(ylen-col))) );
|
||||
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
if (( (row) % (2*offset) ) >= offset ) {
|
||||
if (bitU[row][col-1]==0) updateBit(dlist, bitU, listSize, row, (col-1), xlen, ylen);
|
||||
dlist[i]->bit[col][row] = dlist[i]->bit[col-1][row];
|
||||
} else {
|
||||
if (bitU[row][col-1]==0) updateBit(dlist, bitU, listSize, row, (col-1), xlen, ylen);
|
||||
if (bitU[row+offset][col-1]==0) updateBit(dlist, bitU, listSize, (row+offset), (col-1), xlen, ylen);
|
||||
dlist[i]->bit[col][row] = ( (dlist[i]->bit[col-1][row]+dlist[i]->bit[col-1][row+offset]) % 2);
|
||||
}
|
||||
}
|
||||
|
||||
bitU[row][col]=1;
|
||||
}
|
||||
free(tempPM);
|
||||
|
||||
|
||||
|
||||
void updateBit_int8(decoder_list_int8_t **dlist, uint8_t **bitU,
|
||||
uint8_t listSize, uint16_t row,
|
||||
uint16_t col, uint16_t xlen, uint8_t ylen,
|
||||
int generate_optim_code,FILE *fd) {
|
||||
|
||||
uint16_t offset = ( xlen/(pow(2,(ylen-col))) );
|
||||
|
||||
if (( (row) % (2*offset) ) >= offset ) {
|
||||
|
||||
if (bitU[row][col-1]==0) updateBit_int8(dlist, bitU, listSize, row, (col-1), xlen, ylen,generate_optim_code,fd);
|
||||
// dlist[i]->bit[col][row] = dlist[i]->bit[col-1][row];
|
||||
|
||||
if (generate_optim_code==1) fprintf(fd,"updateBit_int8_A(sorted_dlist,%d,%d,%d);\n",listSize,col,row);
|
||||
|
||||
updateBit_int8_A(dlist,listSize,col,row);
|
||||
|
||||
} else {
|
||||
if (bitU[row][col-1]==0) updateBit_int8(dlist, bitU, listSize, row, (col-1), xlen, ylen,generate_optim_code,fd);
|
||||
if (bitU[row+offset][col-1]==0) updateBit_int8(dlist, bitU, listSize, (row+offset), (col-1), xlen, ylen,generate_optim_code,fd);
|
||||
// dlist[i]->bit[col][row] = dlist[i]->bit[col-1][row]^dlist[i]->bit[col-1][row+offset];
|
||||
// printf("updating dlist[%d]->bit[%d][%d] => %d\n",i,col,row,dlist[i]->bit[col][row]);
|
||||
|
||||
if (generate_optim_code==1) fprintf(fd,"updateBit_int8_B(sorted_dlist,%d,%d,%d,%d);\n",listSize,col,row,offset);
|
||||
|
||||
updateBit_int8_B(dlist,listSize,col,row,offset);
|
||||
}
|
||||
|
||||
|
||||
bitU[row][col]=1;
|
||||
}
|
||||
|
||||
void updatePathMetric(decoder_list_t **dlist,uint8_t listSize, uint8_t bitValue,
|
||||
uint16_t row, uint8_t approximation) {
|
||||
|
||||
if (approximation) { //eq. (12)
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
if ((2*bitValue) != ( 1 - copysign(1.0,dlist[i]->llr[0][row]) )) dlist[i]->pathMetric += fabs(dlist[i]->llr[0][row]);
|
||||
}
|
||||
} else { //eq. (11b)
|
||||
int8_t multiplier = (2*bitValue) - 1;
|
||||
for (uint8_t i=0; i<listSize; i++) {
|
||||
dlist[i]->pathMetric += log ( 1 + exp(multiplier*dlist[i]->llr[0][row]) ) ;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void updatePathMetric0_int8(decoder_list_int8_t **dlist,uint8_t listSize, uint16_t row,int generate_optim_code,FILE *fd) {
|
||||
|
||||
int16_t mask,absllr;
|
||||
updatePathMetric0_int8_A(dlist,listSize,row,mask,absllr);
|
||||
|
||||
if (generate_optim_code == 1) fprintf(fd,"updatePathMetric0_int8_A(sorted_dlist,%d,%d,mask,absllr);\n",listSize,row);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
mask = dlist[i]->llr[0][row]>>15;
|
||||
|
||||
if (mask != 0) {
|
||||
int16_t absllr = (dlist[i]->llr[0][row]+mask)^mask;
|
||||
dlist[i]->pathMetric += absllr;
|
||||
}*/
|
||||
void computeLLR(double ***llr,
|
||||
uint16_t row,
|
||||
uint16_t col,
|
||||
uint8_t i,
|
||||
uint16_t offset,
|
||||
uint8_t approximation)
|
||||
{
|
||||
double a = llr[row][col + 1][i];
|
||||
double absA = fabs(a);
|
||||
double b = llr[row + offset][col + 1][i];
|
||||
double absB = fabs(b);
|
||||
|
||||
if (approximation || isinf(absA) || isinf(absB)) { //eq. (9)
|
||||
llr[row][col][i] = copysign(1.0, a) * copysign(1.0, b) * fmin(absA, absB);
|
||||
} else { //eq. (8a)
|
||||
llr[row][col][i] = log((exp(a + b) + 1) / (exp(a) + exp(b)));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
void updatePathMetric2(decoder_list_t **dlist, uint8_t listSize, uint16_t row, uint8_t appr) {
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0;i<listSize;i++) dlist[i+listSize]->pathMetric = dlist[i]->pathMetric;
|
||||
decoder_list_t **dlist2 = &dlist[listSize];
|
||||
|
||||
if (appr) { //eq. (12)
|
||||
for (i = 0; i < listSize; i++) {
|
||||
// bitValue=0
|
||||
if (dlist[i]->llr[0][row]<0) dlist[i]->pathMetric -= dlist[i]->llr[0][row];
|
||||
// bitValue=1
|
||||
else dlist2[i]->pathMetric += dlist[i]->llr[0][row];
|
||||
}
|
||||
} else { //eq. (11b)
|
||||
for (i = 0; i < listSize; i++) {
|
||||
// bitValue=0
|
||||
dlist[i]->pathMetric += log(1 + exp(-dlist[i]->llr[0][row]));
|
||||
// bitValue=1
|
||||
dlist2[i]->pathMetric += log(1 + exp(dlist[i]->llr[0][row]));
|
||||
|
||||
}
|
||||
}
|
||||
void updateCrcChecksum(uint8_t **crcChecksum,
|
||||
uint8_t **crcGen,
|
||||
uint8_t listSize,
|
||||
uint32_t i2,
|
||||
uint8_t len)
|
||||
{
|
||||
for (uint8_t i = 0; i < listSize; i++) {
|
||||
for (uint8_t j = 0; j < len; j++) {
|
||||
crcChecksum[j][i] = ( (crcChecksum[j][i] + crcGen[i2][j]) % 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void updatePathMetric2_int8(decoder_list_int8_t **dlist, uint8_t listSize, uint16_t row,int generate_optim_code,FILE *fd) {
|
||||
|
||||
|
||||
|
||||
|
||||
if (generate_optim_code == 1) fprintf(fd,"updatePathMetric2_int8_A(sorted_dlist,%d,%d);\n",
|
||||
listSize,row);
|
||||
|
||||
updatePathMetric2_int8_A(dlist,listSize,row);
|
||||
// dlist[i+listSize]->pathMetric = dlist[i]->pathMetric;
|
||||
//if (dlist[i]->llr[0][row]<0) dlist[i]->pathMetric -= dlist[i]->llr[0][row];
|
||||
//else dlist[i+listSize]->pathMetric += dlist[i]->llr[0][row];
|
||||
|
||||
void updateCrcChecksum2(uint8_t **crcChecksum,
|
||||
uint8_t **crcGen,
|
||||
uint8_t listSize,
|
||||
uint32_t i2,
|
||||
uint8_t len)
|
||||
{
|
||||
for (uint8_t i = 0; i < listSize; i++) {
|
||||
for (uint8_t j = 0; j < len; j++) {
|
||||
crcChecksum[j][i+listSize] = ( (crcChecksum[j][i] + crcGen[i2][j]) % 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void updateCrcChecksum(decoder_list_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len) {
|
||||
for (uint8_t i = 0; i < listSize; i++) {
|
||||
for (uint8_t j = 0; j < len; j++) {
|
||||
dlist[i]->crcChecksum[j] = ( (dlist[i]->crcChecksum[j] + crcGen[i2][j]) % 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void updateCrcChecksum2(decoder_list_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len) {
|
||||
for (uint8_t i = 0; i < listSize; i++) {
|
||||
for (uint8_t j = 0; j < len; j++) {
|
||||
dlist[i+listSize]->crcChecksum[j] = ( (dlist[i]->crcChecksum[j] + crcGen[i2][j]) % 2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void updateCrcChecksum_int8(decoder_list_int8_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len,int generate_optim_code,FILE *fd) {
|
||||
|
||||
if (generate_optim_code == 1) fprintf(fd,"updateCrcChecksum_int8_A(sorted_dlist,%d,crcGen,%d,%d);\n",listSize,i2,len);
|
||||
|
||||
updateCrcChecksum_int8_A(dlist,listSize,crcGen,i2,len);
|
||||
// for (uint8_t j = 0; j < len; j++) {
|
||||
// dlist[i]->crcChecksum[j] = ( (dlist[i]->crcChecksum[j] + crcGen[i2][j]) % 2 );
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
void updateCrcChecksum2_int8(decoder_list_int8_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len,int generate_optim_code,FILE *fd) {
|
||||
|
||||
if (generate_optim_code == 1) fprintf(fd,"updateCrcChecksum2_int8_A(sorted_dlist,%d,polarParams->extended_crc_generator_matrix,%d,%d);\n",listSize,i2,len);
|
||||
|
||||
updateCrcChecksum2_int8_A(dlist,listSize,crcGen,i2,len);
|
||||
// for (uint8_t j = 0; j < len; j++) {
|
||||
// dlist[i+listSize]->crcChecksum[j] = ( (dlist[i]->crcChecksum[j] + crcGen[i2][j]) % 2 );
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
||||
decoder_node_t *new_decoder_node(int first_leaf_index,int level) {
|
||||
|
||||
@@ -342,6 +246,7 @@ if (all_frozen_below==0) new_node->left=add_nodes(level-1,first_leaf_index,pp);
|
||||
return(new_node);
|
||||
}
|
||||
|
||||
|
||||
void build_decoder_tree(t_nrPolar_params *pp) {
|
||||
|
||||
pp->tree.num_nodes=0;
|
||||
@@ -349,6 +254,18 @@ void build_decoder_tree(t_nrPolar_params *pp) {
|
||||
|
||||
}
|
||||
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
// translate 1-1 SIMD functions from SSE to NEON
|
||||
#define __m128i int16x8_t
|
||||
#define __m64 int8x8_t
|
||||
#define _mm_abs_epi16(a) vabsq_s16(a)
|
||||
#define _mm_min_epi16(a,b) vminq_s16(a,b)
|
||||
#define _mm_subs_epi16(a,b) vsubq_s16(a,b)
|
||||
#define _mm_abs_pi16(a) vabs_s16(a)
|
||||
#define _mm_min_pi16(a,b) vmin_s16(a,b)
|
||||
#define _mm_subs_pi16(a,b) vsub_s16(a,b)
|
||||
#endif
|
||||
|
||||
void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
int16_t *alpha_v=node->alpha;
|
||||
int16_t *alpha_l=node->left->alpha;
|
||||
@@ -362,23 +279,23 @@ void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
for (int i=0;i<node->Nv;i++) printf("i%d (frozen %d): alpha_v[i] = %d\n",i,1-pp->information_bit_pattern[node->first_leaf_index+i],alpha_v[i]);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
if (node->left->all_frozen == 0) {
|
||||
|
||||
#if defined(__AVX2__)
|
||||
int avx2mod = (node->Nv/2)&15;
|
||||
if (avx2mod == 0) {
|
||||
__m256i a256,b256,absa256,absb256,minabs256;
|
||||
int avx2len = node->Nv/2/16;
|
||||
|
||||
|
||||
// printf("avx2len %d\n",avx2len);
|
||||
for (int i=0;i<avx2len;i++) {
|
||||
a256 =((__m256i*)alpha_v)[i];
|
||||
b256 =((__m256i*)alpha_v)[i+avx2len];
|
||||
absa256 =_mm256_abs_epi16(a256);
|
||||
absb256 =_mm256_abs_epi16(b256);
|
||||
minabs256 =_mm256_min_epi16(absa256,absb256);
|
||||
((__m256i*)alpha_l)[i] =_mm256_sign_epi16(minabs256,_mm256_xor_si256(a256,b256));
|
||||
((__m256i*)alpha_l)[i] =_mm256_sign_epi16(minabs256,_mm256_sign_epi16(a256,b256));
|
||||
}
|
||||
}
|
||||
else if (avx2mod == 8) {
|
||||
@@ -388,7 +305,7 @@ void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
absa128 =_mm_abs_epi16(a128);
|
||||
absb128 =_mm_abs_epi16(b128);
|
||||
minabs128 =_mm_min_epi16(absa128,absb128);
|
||||
*((__m128i*)alpha_l) =_mm_sign_epi16(minabs128,_mm_xor_si128(a128,b128));
|
||||
*((__m128i*)alpha_l) =_mm_sign_epi16(minabs128,_mm_sign_epi16(a128,b128));
|
||||
}
|
||||
else if (avx2mod == 4) {
|
||||
__m64 a64,b64,absa64,absb64,minabs64;
|
||||
@@ -397,11 +314,56 @@ void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
absa64 =_mm_abs_pi16(a64);
|
||||
absb64 =_mm_abs_pi16(b64);
|
||||
minabs64 =_mm_min_pi16(absa64,absb64);
|
||||
*((__m64*)alpha_l) =_mm_sign_pi16(minabs64,_mm_xor_si64(a64,b64));
|
||||
*((__m64*)alpha_l) =_mm_sign_pi16(minabs64,_mm_sign_pi16(a64,b64));
|
||||
}
|
||||
else
|
||||
#else
|
||||
int sse4mod = (node->Nv/2)&7;
|
||||
int sse4len = node->Nv/2/8;
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
int16x8_t signatimesb,comp1,comp2,negminabs128;
|
||||
int16x8_t zero=vdupq_n_s16(0);
|
||||
#endif
|
||||
{
|
||||
|
||||
if (sse4mod == 0) {
|
||||
for (int i=0;i<sse4len;i++) {
|
||||
__m128i a128,b128,absa128,absb128,minabs128;
|
||||
int sse4len = node->Nv/2/8;
|
||||
|
||||
a128 =*((__m128i*)alpha_v);
|
||||
b128 =((__m128i*)alpha_v)[1];
|
||||
absa128 =_mm_abs_epi16(a128);
|
||||
absb128 =_mm_abs_epi16(b128);
|
||||
minabs128 =_mm_min_epi16(absa128,absb128);
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
// unfortunately no direct equivalent to _mm_sign_epi16
|
||||
signatimesb=vxorrq_s16(a128,b128);
|
||||
comp1=vcltq_s16(signatimesb,zero);
|
||||
comp2=vcgeq_s16(signatimesb,zero);
|
||||
negminabs128=vnegq_s16(minabs128);
|
||||
*((__m128i*)alpha_l) =vorrq_s16(vandq_s16(minabs128,comp0),vandq_s16(negminabs128,comp1));
|
||||
#else
|
||||
*((__m128i*)alpha_l) =_mm_sign_epi16(minabs128,_mm_sign_epi16(a128,b128));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (sse4mod == 4) {
|
||||
__m64 a64,b64,absa64,absb64,minabs64;
|
||||
a64 =*((__m64*)alpha_v);
|
||||
b64 =((__m64*)alpha_v)[1];
|
||||
absa64 =_mm_abs_pi16(a64);
|
||||
absb64 =_mm_abs_pi16(b64);
|
||||
minabs64 =_mm_min_pi16(absa64,absb64);
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
AssertFatal(1==0,"Need to do this still for ARM\n");
|
||||
#else
|
||||
*((__m64*)alpha_l) =_mm_sign_pi16(minabs64,_mm_sign_epi16(a64,b64));
|
||||
#endif
|
||||
}
|
||||
|
||||
else
|
||||
#endif
|
||||
{ // equvalent scalar code to above, activated only on non x86/ARM architectures
|
||||
for (int i=0;i<node->Nv/2;i++) {
|
||||
a=alpha_v[i];
|
||||
b=alpha_v[i+(node->Nv/2)];
|
||||
@@ -411,6 +373,7 @@ void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
absb=(b+maskb)^maskb;
|
||||
minabs = absa<absb ? absa : absb;
|
||||
alpha_l[i] = (maska^maskb)==0 ? minabs : -minabs;
|
||||
// printf("alphal[%d] %d (%d,%d)\n",i,alpha_l[i],a,b);
|
||||
}
|
||||
}
|
||||
if (node->Nv == 2) { // apply hard decision on left node
|
||||
@@ -418,7 +381,7 @@ void applyFtoleft(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
#ifdef DEBUG_NEW_IMPL
|
||||
printf("betal[0] %d (%p)\n",betal[0],&betal[0]);
|
||||
#endif
|
||||
pp->nr_polar_u[node->first_leaf_index] = (1+betal[0])>>1;
|
||||
pp->nr_polar_U[node->first_leaf_index] = (1+betal[0])>>1;
|
||||
#ifdef DEBUG_NEW_IMPL
|
||||
printf("Setting bit %d to %d (LLR %d)\n",node->first_leaf_index,(betal[0]+1)>>1,alpha_l[0]);
|
||||
#endif
|
||||
@@ -453,27 +416,53 @@ void applyGtoright(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
else if (avx2mod == 8) {
|
||||
((__m128i *)alpha_r)[0] = _mm_subs_epi16(((__m128i *)alpha_v)[1],_mm_sign_epi16(((__m128i *)alpha_v)[0],((__m128i *)betal)[0]));
|
||||
}
|
||||
else if (avx2mod == 4) {
|
||||
((__m64 *)alpha_r)[0] = _mm_subs_pi16(((__m64 *)alpha_v)[1],_mm_sign_pi16(((__m64 *)alpha_v)[0],((__m64 *)betal)[0]));
|
||||
}
|
||||
else
|
||||
#else
|
||||
int sse4mod = (node->Nv/2)&7;
|
||||
|
||||
if (sse4mod == 0) {
|
||||
int sse4len = node->Nv/2/8;
|
||||
|
||||
for (int i=0;i<sse4len;i++) {
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
((int16x8_t *)alpha_r)[0] = vsubq_s16(((int16x8_t *)alpha_v)[1],vmulq_epi16(((int16x8_t *)alpha_v)[0],((int16x8_t *)betal)[0]));
|
||||
#else
|
||||
((__m128i *)alpha_r)[0] = _mm_subs_epi16(((__m128i *)alpha_v)[1],_mm_sign_epi16(((__m128i *)alpha_v)[0],((__m128i *)betal)[0]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (sse4mod == 4) {
|
||||
#if defined(__arm__) || defined(__aarch64__)
|
||||
((int16x4_t *)alpha_r)[0] = vsub_s16(((int16x4_t *)alpha_v)[1],vmul_epi16(((int16x4_t *)alpha_v)[0],((int16x4_t *)betal)[0]));
|
||||
#else
|
||||
((__m64 *)alpha_r)[0] = _mm_subs_pi16(((__m64 *)alpha_v)[1],_mm_sign_pi16(((__64 *)alpha_v)[0],((__m64 *)betal)[0]));
|
||||
#endif
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
{// equvalent scalar code to above, activated only on non x86/ARM architectures
|
||||
for (int i=0;i<node->Nv/2;i++) {
|
||||
alpha_r[i] = alpha_v[i+(node->Nv/2)] - (betal[i]*alpha_v[i]);
|
||||
}
|
||||
}
|
||||
if (node->Nv == 2) { // apply hard decision on right node
|
||||
betar[0] = (alpha_r[0]>0) ? -1 : 1;
|
||||
pp->nr_polar_u[node->first_leaf_index+1] = (1+betar[0])>>1;
|
||||
pp->nr_polar_U[node->first_leaf_index+1] = (1+betar[0])>>1;
|
||||
#ifdef DEBUG_NEW_IMPL
|
||||
printf("Setting bit %d to %d (LLR %d frozen_mask %d)\n",node->first_leaf_index+1,(betar[0]+1)>>1,alpha_r[0],frozen_mask);
|
||||
printf("Setting bit %d to %d (LLR %d)\n",node->first_leaf_index+1,(betar[0]+1)>>1,alpha_r[0]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int16_t minus1[16] = {-1,-1,-1,-1,
|
||||
-1,-1,-1,-1,
|
||||
-1,-1,-1,-1,
|
||||
-1,-1,-1,-1};
|
||||
|
||||
int16_t all1[16] = {1,1,1,1,
|
||||
1,1,1,1,
|
||||
1,1,1,1,
|
||||
1,1,1,1};
|
||||
|
||||
void computeBeta(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
|
||||
@@ -486,27 +475,37 @@ void computeBeta(t_nrPolar_params *pp,decoder_node_t *node) {
|
||||
if (node->left->all_frozen==0) { // if left node is not aggregation of frozen bits
|
||||
#if defined(__AVX2__)
|
||||
int avx2mod = (node->Nv/2)&15;
|
||||
register __m256i allones=*((__m256i*)all1);
|
||||
if (avx2mod == 0) {
|
||||
int avx2len = node->Nv/2/16;
|
||||
|
||||
for (int i=0;i<avx2len;i++) {
|
||||
((__m256i*)betav)[i] = _mm256_sign_epi16(((__m256i*)betar)[i],
|
||||
((__m256i*)betal)[i]);
|
||||
((__m256i*)betav)[i] = _mm256_sign_epi16(((__m256i*)betav)[i],
|
||||
((__m256i*)minus1)[0]);
|
||||
((__m256i*)betav)[i] = _mm256_or_si256(_mm256_cmpeq_epi16(((__m256i*)betar)[i],
|
||||
((__m256i*)betal)[i]),allones);
|
||||
}
|
||||
}
|
||||
else if (avx2mod == 8) {
|
||||
((__m128i*)betav)[0] = _mm_sign_epi16(((__m128i*)betar)[0],
|
||||
((__m128i*)betal)[0]);
|
||||
((__m128i*)betav)[0] = _mm_sign_epi16(((__m128i*)betav)[0],
|
||||
((__m128i*)minus1)[0]);
|
||||
((__m128i*)betav)[0] = _mm_or_si128(_mm_cmpeq_epi16(((__m128i*)betar)[0],
|
||||
((__m128i*)betal)[0]),*((__m128i*)all1));
|
||||
}
|
||||
else if (avx2mod == 4) {
|
||||
((__m64*)betav)[0] = _mm_sign_pi16(((__m64*)betar)[0],
|
||||
((__m64*)betal)[0]);
|
||||
((__m64*)betav)[0] = _mm_sign_pi16(((__m64*)betav)[0],
|
||||
((__m64*)minus1)[0]);
|
||||
((__m64*)betav)[0] = _mm_or_si64(_mm_cmpeq_pi16(((__m64*)betar)[0],
|
||||
((__m64*)betal)[0]),*((__m64*)all1));
|
||||
}
|
||||
else
|
||||
#else
|
||||
int avx2mod = (node->Nv/2)&15;
|
||||
|
||||
if (ssr4mod == 0) {
|
||||
int ssr4len = node->Nv/2/8;
|
||||
register __m128i allones=*((__m128i*)all1);
|
||||
for (int i=0;i<sse4len;i++) {
|
||||
((__m256i*)betav)[i] = _mm_or_si128(_mm_cmpeq_epi16(((__m128i*)betar)[i],
|
||||
((__m128i*)betal)[i]),allones));
|
||||
}
|
||||
}
|
||||
else if (sse4mod == 4) {
|
||||
((__m64*)betav)[0] = _mm_or_si64(_mm_cmpeq_pi16(((__m64*)betar)[0],
|
||||
((__m64*)betal)[0]),*((__m64*)all1));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
|
||||
@@ -19,7 +19,16 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#define NR_POLAR_CRC_ERROR_CORRECTION_BITS 3
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_defs.h
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __NR_POLAR_DEFS__H__
|
||||
#define __NR_POLAR_DEFS__H__
|
||||
@@ -30,7 +39,20 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
//#include "SIMULATION/TOOLS/sim.h"
|
||||
|
||||
#define NR_POLAR_DECODER_LISTSIZE 8 //uint8_t
|
||||
#define NR_POLAR_DECODER_PATH_METRIC_APPROXIMATION 0 //uint8_t; 0 --> eq. (8a) and (11b), 1 --> eq. (9) and (12)
|
||||
|
||||
#define NR_POLAR_AGGREGATION_LEVEL_1_PRIME 149 //uint16_t
|
||||
#define NR_POLAR_AGGREGATION_LEVEL_2_PRIME 151 //uint16_t
|
||||
#define NR_POLAR_AGGREGATION_LEVEL_4_PRIME 157 //uint16_t
|
||||
#define NR_POLAR_AGGREGATION_LEVEL_8_PRIME 163 //uint16_t
|
||||
#define NR_POLAR_AGGREGATION_LEVEL_16_PRIME 167 //uint16_t
|
||||
|
||||
static const uint8_t nr_polar_subblock_interleaver_pattern[32] = { 0, 1, 2, 4, 3, 5, 6, 7, 8, 16, 9, 17, 10, 18, 11, 19, 12, 20, 13, 21, 14, 22, 15, 23, 24, 25, 26, 28, 27, 29, 30, 31 };
|
||||
|
||||
@@ -38,26 +60,6 @@ static const uint8_t nr_polar_subblock_interleaver_pattern[32] = { 0, 1, 2, 4, 3
|
||||
#define Nmax 1024
|
||||
#define nmax 10
|
||||
|
||||
typedef struct decoder_list_s {
|
||||
|
||||
uint8_t bit[1+nmax][Nmax];
|
||||
double llr[1+nmax][Nmax];
|
||||
uint8_t crcChecksum[24];
|
||||
double pathMetric;
|
||||
|
||||
} decoder_list_t;
|
||||
|
||||
typedef struct decoder_list_int8_s {
|
||||
|
||||
uint8_t bit[1+nmax][Nmax] __attribute__((aligned(32)));
|
||||
int16_t llr[1+nmax][Nmax]__attribute__((aligned(32)));
|
||||
uint8_t crcChecksum[24];
|
||||
int32_t pathMetric;
|
||||
|
||||
} decoder_list_int8_t;
|
||||
|
||||
|
||||
|
||||
typedef struct decoder_node_t_s {
|
||||
struct decoder_node_t_s *left;
|
||||
struct decoder_node_t_s *right;
|
||||
@@ -76,342 +78,294 @@ typedef struct decoder_tree_t_s {
|
||||
} decoder_tree_t;
|
||||
|
||||
struct nrPolar_params {
|
||||
uint8_t n_max;
|
||||
uint8_t i_il;
|
||||
uint8_t i_seg;
|
||||
uint8_t n_pc;
|
||||
uint8_t n_pc_wm;
|
||||
uint8_t i_bil;
|
||||
uint16_t payloadBits;
|
||||
uint16_t encoderLength;
|
||||
uint8_t crcParityBits;
|
||||
uint8_t crcCorrectionBits;
|
||||
uint16_t K;
|
||||
uint16_t N;
|
||||
uint8_t n;
|
||||
|
||||
uint16_t *interleaving_pattern;
|
||||
uint16_t *rate_matching_pattern;
|
||||
const uint16_t *Q_0_Nminus1;
|
||||
int16_t *Q_I_N;
|
||||
int16_t *Q_F_N;
|
||||
int16_t *Q_PC_N;
|
||||
uint8_t *information_bit_pattern;
|
||||
uint16_t *channel_interleaver_pattern;
|
||||
uint32_t crc_polynomial;
|
||||
|
||||
uint8_t **crc_generator_matrix; //G_P
|
||||
uint8_t **G_N;
|
||||
uint32_t* crc256Table;
|
||||
uint8_t **extended_crc_generator_matrix;
|
||||
//messageType: 0=PBCH, 1=DCI, -1=UCI
|
||||
int idx; //idx = (messageType * messageLength * aggregation_prime);
|
||||
struct nrPolar_params *nextPtr;
|
||||
|
||||
//polar_encoder vectors:
|
||||
uint8_t *nr_polar_crc;
|
||||
uint8_t *nr_polar_b;
|
||||
uint8_t *nr_polar_cPrime;
|
||||
uint8_t *nr_polar_u;
|
||||
uint8_t *nr_polar_d;
|
||||
|
||||
void (*decoder_kernel)(struct nrPolar_params *,decoder_list_int8_t **);
|
||||
decoder_tree_t tree;
|
||||
uint8_t n_max;
|
||||
uint8_t i_il;
|
||||
uint8_t i_seg;
|
||||
uint8_t n_pc;
|
||||
uint8_t n_pc_wm;
|
||||
uint8_t i_bil;
|
||||
uint16_t payloadBits;
|
||||
uint16_t encoderLength;
|
||||
uint8_t crcParityBits;
|
||||
uint8_t crcCorrectionBits;
|
||||
uint16_t K;
|
||||
uint16_t N;
|
||||
uint8_t n;
|
||||
uint32_t crcBit;
|
||||
|
||||
uint16_t *interleaving_pattern;
|
||||
uint16_t *rate_matching_pattern;
|
||||
const uint16_t *Q_0_Nminus1;
|
||||
int16_t *Q_I_N;
|
||||
int16_t *Q_F_N;
|
||||
int16_t *Q_PC_N;
|
||||
uint8_t *information_bit_pattern;
|
||||
uint16_t *channel_interleaver_pattern;
|
||||
uint32_t crc_polynomial;
|
||||
|
||||
uint8_t **crc_generator_matrix; //G_P
|
||||
uint8_t **G_N;
|
||||
uint32_t* crc256Table;
|
||||
uint8_t **extended_crc_generator_matrix;
|
||||
//lowercase: bits, Uppercase: Bits stored in bytes
|
||||
//polar_encoder vectors
|
||||
uint8_t *nr_polar_crc;
|
||||
uint8_t *nr_polar_aPrime;
|
||||
uint8_t *nr_polar_APrime;
|
||||
uint8_t *nr_polar_D;
|
||||
uint8_t *nr_polar_E;
|
||||
|
||||
//Polar Coding vectors
|
||||
uint8_t *nr_polar_A;
|
||||
uint8_t *nr_polar_CPrime;
|
||||
uint8_t *nr_polar_B;
|
||||
uint8_t *nr_polar_U;
|
||||
|
||||
decoder_tree_t tree;
|
||||
} __attribute__ ((__packed__));
|
||||
typedef struct nrPolar_params t_nrPolar_params;
|
||||
typedef t_nrPolar_params *t_nrPolar_paramsPtr;
|
||||
|
||||
void polar_encoder(uint32_t *input,
|
||||
uint32_t *output,
|
||||
t_nrPolar_paramsPtr polarParams);
|
||||
|
||||
void polar_encoder_dci(uint32_t *in,
|
||||
uint32_t *out,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
uint16_t n_RNTI);
|
||||
|
||||
void polar_encoder_timing(uint32_t *in,
|
||||
uint32_t *out,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
double cpuFreqGHz,
|
||||
FILE* logFile);
|
||||
|
||||
int8_t polar_decoder(double *input,
|
||||
uint8_t *output,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
uint8_t listSize,
|
||||
uint8_t pathMetricAppr);
|
||||
|
||||
void polar_encoder(uint8_t *input, uint8_t *output, t_nrPolar_params* polarParams);
|
||||
int8_t polar_decoder_aPriori(double *input,
|
||||
uint32_t *output,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
uint8_t listSize,
|
||||
uint8_t pathMetricAppr,
|
||||
double *aPrioriPayload);
|
||||
|
||||
void nr_polar_kernal_operation(uint8_t *u, uint8_t *d, uint16_t N);
|
||||
int8_t polar_decoder_aPriori_timing(double *input,
|
||||
uint32_t *output,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
uint8_t listSize,
|
||||
uint8_t pathMetricAppr,
|
||||
double *aPrioriPayload,
|
||||
double cpuFreqGHz,
|
||||
FILE* logFile);
|
||||
|
||||
int8_t polar_decoder_dci(double *input,
|
||||
uint32_t *out,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
uint8_t listSize,
|
||||
uint8_t pathMetricAppr,
|
||||
uint16_t n_RNTI);
|
||||
|
||||
void generic_polar_decoder(t_nrPolar_params *,decoder_node_t *);
|
||||
|
||||
int8_t polar_decoder(double *input, uint8_t *output, t_nrPolar_params *polarParams,
|
||||
uint8_t listSize, double *aPrioriPayload, uint8_t pathMetricAppr,
|
||||
time_stats_t *init,
|
||||
time_stats_t *polar_rate_matching,
|
||||
time_stats_t *decoding,
|
||||
time_stats_t *bit_extraction,
|
||||
time_stats_t *deinterleaving,
|
||||
time_stats_t *sorting,
|
||||
time_stats_t *path_metric,
|
||||
time_stats_t *update_LLR);
|
||||
void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
|
||||
int8_t messageType,
|
||||
uint16_t messageLength,
|
||||
uint8_t aggregation_level);
|
||||
|
||||
int8_t polar_decoder_int8(int16_t *input,
|
||||
uint8_t *output,
|
||||
t_nrPolar_params *polarParams,
|
||||
uint8_t listSize,
|
||||
time_stats_t *init,
|
||||
time_stats_t *polar_rate_matching,
|
||||
time_stats_t *decoding,
|
||||
time_stats_t *bit_extraction,
|
||||
time_stats_t *deinterleaving,
|
||||
time_stats_t *sorting,
|
||||
time_stats_t *path_metric,
|
||||
time_stats_t *update_LLR,
|
||||
int generate_optim_code);
|
||||
void nr_polar_print_polarParams(t_nrPolar_paramsPtr polarParams);
|
||||
|
||||
int8_t polar_decoder_int8_new(int16_t *input,
|
||||
uint8_t *output,
|
||||
t_nrPolar_params *polarParams,
|
||||
uint8_t listSize,
|
||||
time_stats_t *init,
|
||||
time_stats_t *polar_rate_matching,
|
||||
time_stats_t *decoding,
|
||||
time_stats_t *bit_extraction,
|
||||
time_stats_t *deinterleaving,
|
||||
time_stats_t *sorting,
|
||||
time_stats_t *path_metric,
|
||||
time_stats_t *update_LLR,
|
||||
int generate_optim_code);
|
||||
t_nrPolar_paramsPtr nr_polar_params (t_nrPolar_paramsPtr polarParams,
|
||||
int8_t messageType,
|
||||
uint16_t messageLength,
|
||||
uint8_t aggregation_level);
|
||||
|
||||
|
||||
void nr_polar_llrtableinit(void);
|
||||
|
||||
void nr_polar_init(t_nrPolar_params* polarParams, int messageType);
|
||||
uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level);
|
||||
|
||||
uint8_t** nr_polar_kronecker_power_matrices(uint8_t n);
|
||||
|
||||
const uint16_t* nr_polar_sequence_pattern(uint8_t n);
|
||||
|
||||
uint32_t nr_polar_output_length(uint16_t K, uint16_t E, uint8_t n_max);
|
||||
/*!@fn uint32_t nr_polar_output_length(uint16_t K, uint16_t E, uint8_t n_max)
|
||||
* @brief Computes...
|
||||
* @param K Number of bits to encode (=payloadBits+crcParityBits)
|
||||
* @param E
|
||||
* @param n_max */
|
||||
uint32_t nr_polar_output_length(uint16_t K,
|
||||
uint16_t E,
|
||||
uint8_t n_max);
|
||||
|
||||
void nr_polar_channel_interleaver_pattern(uint16_t *cip, uint8_t I_BIL,
|
||||
uint16_t E);
|
||||
void nr_polar_channel_interleaver_pattern(uint16_t *cip,
|
||||
uint8_t I_BIL,
|
||||
uint16_t E);
|
||||
|
||||
void nr_polar_rate_matching_pattern(uint16_t *rmp, uint16_t *J, const uint8_t *P_i_,
|
||||
uint16_t K, uint16_t N, uint16_t E);
|
||||
void nr_polar_rate_matching_pattern(uint16_t *rmp,
|
||||
uint16_t *J,
|
||||
const uint8_t *P_i_,
|
||||
uint16_t K,
|
||||
uint16_t N,
|
||||
uint16_t E);
|
||||
|
||||
void nr_polar_rate_matching(double *input, double *output, uint16_t *rmp,
|
||||
uint16_t K, uint16_t N, uint16_t E);
|
||||
void nr_polar_rate_matching(double *input,
|
||||
double *output,
|
||||
uint16_t *rmp,
|
||||
uint16_t K,
|
||||
uint16_t N,
|
||||
uint16_t E);
|
||||
|
||||
void nr_polar_rate_matching_int8(int16_t *input, int16_t *output, uint16_t *rmp,
|
||||
uint16_t K, uint16_t N, uint16_t E);
|
||||
void nr_polar_rate_matching_int16(int16_t *input, int16_t *output, uint16_t *rmp, uint16_t K, uint16_t N, uint16_t E);
|
||||
|
||||
void nr_polar_interleaving_pattern(uint16_t K, uint8_t I_IL, uint16_t *PI_k_);
|
||||
void nr_polar_interleaving_pattern(uint16_t K,
|
||||
uint8_t I_IL,
|
||||
uint16_t *PI_k_);
|
||||
|
||||
void nr_polar_info_bit_pattern(uint8_t *ibp, int16_t *Q_I_N, int16_t *Q_F_N,
|
||||
uint16_t *J, const uint16_t *Q_0_Nminus1, uint16_t K, uint16_t N, uint16_t E,
|
||||
uint8_t n_PC);
|
||||
void nr_polar_info_bit_pattern(uint8_t *ibp,
|
||||
int16_t *Q_I_N,
|
||||
int16_t *Q_F_N,
|
||||
uint16_t *J,
|
||||
const uint16_t *Q_0_Nminus1,
|
||||
uint16_t K,
|
||||
uint16_t N,
|
||||
uint16_t E,
|
||||
uint8_t n_PC);
|
||||
|
||||
void nr_polar_info_bit_extraction(uint8_t *input, uint8_t *output,
|
||||
uint8_t *pattern, uint16_t size);
|
||||
void nr_polar_info_bit_extraction(uint8_t *input,
|
||||
uint8_t *output,
|
||||
uint8_t *pattern,
|
||||
uint16_t size);
|
||||
|
||||
void nr_byte2bit(uint8_t *array, uint8_t arraySize, uint8_t *bitArray);
|
||||
void nr_bit2byte_uint32_8_t(uint32_t *in,
|
||||
uint16_t arraySize,
|
||||
uint8_t *out);
|
||||
|
||||
void nr_polar_bit_insertion(uint8_t *input, uint8_t *output, uint16_t N,
|
||||
uint16_t K, int16_t *Q_I_N, int16_t *Q_PC_N, uint8_t n_PC);
|
||||
void nr_byte2bit_uint8_32_t(uint8_t *in,
|
||||
uint16_t arraySize,
|
||||
uint32_t *out);
|
||||
|
||||
void nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(uint8_t *matrix1, uint8_t **matrix2,
|
||||
uint8_t *output, uint16_t row, uint16_t col);
|
||||
void nr_crc_bit2bit_uint32_8_t(uint32_t *in,
|
||||
uint16_t arraySize,
|
||||
uint8_t *out);
|
||||
|
||||
uint8_t ***nr_alloc_uint8_t_3D_array(uint16_t xlen, uint16_t ylen,
|
||||
uint16_t zlen);
|
||||
uint8_t **nr_alloc_uint8_t_2D_array(uint16_t xlen, uint16_t ylen);
|
||||
double **nr_alloc_double_2D_array(uint16_t xlen, uint16_t ylen);
|
||||
void nr_polar_bit_insertion(uint8_t *input,
|
||||
uint8_t *output,
|
||||
uint16_t N,
|
||||
uint16_t K,
|
||||
int16_t *Q_I_N,
|
||||
int16_t *Q_PC_N,
|
||||
uint8_t n_PC);
|
||||
|
||||
void nr_free_uint8_t_3D_array(uint8_t ***input, uint16_t xlen, uint16_t ylen);
|
||||
void nr_free_uint8_t_2D_array(uint8_t **input, uint16_t xlen);
|
||||
void nr_free_double_2D_array(double **input, uint16_t xlen);
|
||||
void nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(uint8_t *matrix1,
|
||||
uint8_t **matrix2,
|
||||
uint8_t *output,
|
||||
uint16_t row,
|
||||
uint16_t col);
|
||||
|
||||
void updateLLR(decoder_list_t **dlist,uint8_t **llrU, uint8_t **bitU,
|
||||
uint8_t listSize, uint16_t row, uint16_t col, uint16_t xlen, uint8_t ylen, uint8_t approximation);
|
||||
uint8_t ***nr_alloc_uint8_t_3D_array(uint16_t xlen,
|
||||
uint16_t ylen,
|
||||
uint16_t zlen);
|
||||
|
||||
void updateLLR_int8(decoder_list_int8_t **dlist,uint8_t **llrU, uint8_t **bitU,
|
||||
uint8_t listSize, uint16_t row, uint16_t col, uint16_t xlen, uint8_t ylen,int generate_optim_code,FILE *fd);
|
||||
uint8_t **nr_alloc_uint8_t_2D_array(uint16_t xlen,
|
||||
uint16_t ylen);
|
||||
|
||||
void updateBit(decoder_list_t **dlist, uint8_t **bitU, uint8_t listSize, uint16_t row,
|
||||
uint16_t col, uint16_t xlen, uint8_t ylen);
|
||||
double ***nr_alloc_double_3D_array(uint16_t xlen,
|
||||
uint16_t ylen,
|
||||
uint16_t zlen);
|
||||
|
||||
void updateBit_int8(decoder_list_int8_t **dlist, uint8_t **bitU, uint8_t listSize, uint16_t row,
|
||||
uint16_t col, uint16_t xlen, uint8_t ylen,int generate_optim_code,FILE *fd);
|
||||
void nr_free_uint8_t_3D_array(uint8_t ***input,
|
||||
uint16_t xlen,
|
||||
uint16_t ylen);
|
||||
|
||||
void updatePathMetric(decoder_list_t **dlist,uint8_t listSize, uint8_t bitValue,
|
||||
uint16_t row, uint8_t approximation);
|
||||
void nr_free_uint8_t_2D_array(uint8_t **input,
|
||||
uint16_t xlen);
|
||||
|
||||
void updatePathMetric0_int8(decoder_list_int8_t **dlist,uint8_t listSize, uint16_t row,int generate_optim_code,FILE *fd);
|
||||
void nr_free_double_3D_array(double ***input,
|
||||
uint16_t xlen,
|
||||
uint16_t ylen);
|
||||
|
||||
void updatePathMetric2(decoder_list_t **dlist, uint8_t listSize, uint16_t row, uint8_t appr);
|
||||
void updateLLR(double ***llr,
|
||||
uint8_t **llrU,
|
||||
uint8_t ***bit,
|
||||
uint8_t **bitU,
|
||||
uint8_t listSize,
|
||||
uint16_t row,
|
||||
uint16_t col,
|
||||
uint16_t xlen,
|
||||
uint8_t ylen,
|
||||
uint8_t approximation);
|
||||
|
||||
void updatePathMetric2_int8(decoder_list_int8_t **dlist, uint8_t listSize, uint16_t row,int generate_optim_code,FILE *fd);
|
||||
void updateBit(uint8_t ***bit,
|
||||
uint8_t **bitU,
|
||||
uint8_t listSize,
|
||||
uint16_t row,
|
||||
uint16_t col,
|
||||
uint16_t xlen,
|
||||
uint8_t ylen);
|
||||
|
||||
void updateCrcChecksum(decoder_list_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len);
|
||||
void updatePathMetric(double *pathMetric,
|
||||
double ***llr,
|
||||
uint8_t listSize,
|
||||
uint8_t bitValue,
|
||||
uint16_t row,
|
||||
uint8_t approximation);
|
||||
|
||||
void updateCrcChecksum_int8(decoder_list_int8_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len,int generate_optim_code,FILE *fd);
|
||||
void updatePathMetric2(double *pathMetric,
|
||||
double ***llr,
|
||||
uint8_t listSize,
|
||||
uint16_t row,
|
||||
uint8_t approximation);
|
||||
|
||||
void updateCrcChecksum2(decoder_list_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len);
|
||||
void computeLLR(double ***llr,
|
||||
uint16_t row,
|
||||
uint16_t col,
|
||||
uint8_t i,
|
||||
uint16_t offset,
|
||||
uint8_t approximation);
|
||||
|
||||
void updateCrcChecksum2_int8(decoder_list_int8_t **dlist, uint8_t **crcGen,
|
||||
uint8_t listSize, uint32_t i2, uint8_t len,int generate_optim_code,FILE *fd);
|
||||
void updateCrcChecksum(uint8_t **crcChecksum,
|
||||
uint8_t **crcGen,
|
||||
uint8_t listSize,
|
||||
uint32_t i2,
|
||||
uint8_t len);
|
||||
|
||||
void updateCrcChecksum2(uint8_t **crcChecksum,
|
||||
uint8_t **crcGen,
|
||||
uint8_t listSize,
|
||||
uint32_t i2,
|
||||
uint8_t len);
|
||||
|
||||
void nr_sort_asc_double_1D_array_ind(double *matrix, int *ind, int len);
|
||||
|
||||
void nr_sort_asc_int16_1D_array_ind(int32_t *matrix, int *ind, int len);
|
||||
void nr_sort_asc_double_1D_array_ind(double *matrix,
|
||||
uint8_t *ind,
|
||||
uint8_t len);
|
||||
|
||||
uint8_t **crc24c_generator_matrix(uint16_t payloadSizeBits);
|
||||
|
||||
uint8_t **crc11_generator_matrix(uint16_t payloadSizeBits);
|
||||
|
||||
uint8_t **crc6_generator_matrix(uint16_t payloadSizeBits);
|
||||
|
||||
void crcTable256Init (uint32_t poly, uint32_t* crc256Table);
|
||||
void nr_crc_computation(uint8_t* input, uint8_t* output, uint16_t payloadBits, uint16_t crcParityBits, uint32_t* crc256Table);
|
||||
unsigned int crcbit (unsigned char* inputptr, int octetlen, uint32_t poly);
|
||||
unsigned int crcPayload(unsigned char * inptr, int bitlen, uint32_t* crc256Table);
|
||||
|
||||
static inline void nr_polar_rate_matcher(uint8_t *input, unsigned char *output, uint16_t *pattern, uint16_t size) {
|
||||
//Also nr_polar_rate_matcher
|
||||
static inline void nr_polar_interleaver(uint8_t *input,
|
||||
uint8_t *output,
|
||||
uint16_t *pattern,
|
||||
uint16_t size)
|
||||
{
|
||||
for (int i=0; i<size; i++) output[i]=input[pattern[i]];
|
||||
}
|
||||
|
||||
static inline void nr_polar_interleaver(uint8_t *input, uint8_t *output, uint16_t *pattern, uint16_t size) {
|
||||
for (int i=0; i<size; i++) output[i]=input[pattern[i]];
|
||||
}
|
||||
|
||||
static inline void nr_polar_deinterleaver(uint8_t *input, uint8_t *output, uint16_t *pattern, uint16_t size) {
|
||||
static inline void nr_polar_deinterleaver(uint8_t *input,
|
||||
uint8_t *output,
|
||||
uint16_t *pattern,
|
||||
uint16_t size)
|
||||
{
|
||||
for (int i=0; i<size; i++) output[pattern[i]]=input[i];
|
||||
}
|
||||
|
||||
void polar_decoder_K56_N512_E864(t_nrPolar_params *polarParams,decoder_list_int8_t **sorted_list);
|
||||
|
||||
void build_decoder_tree(t_nrPolar_params *pp);
|
||||
|
||||
#define updateLLR_int8_A(dlist,listSize,col,row,offset) {for (int i=0;i<listSize;i++) {if (dlist[(i)]->bit[(col)][(row)-(offset)]==0) dlist[(i)]->llr[(col)][(row)] = dlist[(i)]->llr[(col)+1][(row)-(offset)] + dlist[(i)]->llr[(col)+1][(row)]; else dlist[(i)]->llr[(col)][(row)] = -dlist[(i)]->llr[(col)+1][(row)-(offset)] + dlist[(i)]->llr[(col)+1][(row)];if(dlist[(i)]->llr[col][row]>127 || dlist[i]->llr[col][row]<-128) printf("dlist[%d]->llr[%d][%d] = %d> 8bit\n",i,col,row,dlist[i]->llr[col][row]);}}
|
||||
|
||||
#define updateBit_int8_A(dlist,listSize,col,row) {for (int i=0;i<listSize;i++) {dlist[(i)]->bit[(col)][(row)] = dlist[(i)]->bit[(col)-1][(row)];}}
|
||||
#define updateBit_int8_B(dlist,listSize,col,row,offset) {for (int i=0;i<listSize;i++) {dlist[(i)]->bit[(col)][(row)] = dlist[(i)]->bit[(col)-1][(row)]^dlist[(i)]->bit[(col)-1][(row)+(offset)];}}
|
||||
|
||||
#define updatePathMetric0_int8_A(dlist,listSize,row,mask,absllr) {for (int i=0;i<listSize;i++) { mask=dlist[i]->llr[0][row]>>15;if(mask!=0){absllr=(dlist[i]->llr[0][row]+mask)^mask;dlist[i]->pathMetric+=absllr;}}}
|
||||
|
||||
#define updatePathMetric2_int8_A(dlist,listSize,row) {for (int i=0;i<listSize;i++) {{dlist[i+listSize]->pathMetric = dlist[i]->pathMetric;if (dlist[i]->llr[0][row]<0) dlist[i]->pathMetric-=dlist[i]->llr[0][row];else dlist[i+listSize]->pathMetric += dlist[i]->llr[0][row];}}}
|
||||
|
||||
#define updateCrcChecksum_int8_A(dlist,listSize,crcGen,i2,len) {for (int i=0;i<listSize;i++){for (uint8_t j = 0; j < len; j++) dlist[i]->crcChecksum[j] = (dlist[i]->crcChecksum[j]^crcGen[i2][j]);}}
|
||||
|
||||
#define updateCrcChecksum2_int8_A(dlist,listSize,crcGen,i2,len) {for (int i=0;i<listSize;i++){for (uint8_t j = 0; j < len; j++) dlist[i+listSize]->crcChecksum[j]=dlist[i]->crcChecksum[j]^crcGen[i2][j];}}
|
||||
|
||||
extern int16_t llrtab[256][256];
|
||||
|
||||
inline void computeLLR_int8(decoder_list_int8_t **dlist,int listSize, uint16_t row, uint16_t col,
|
||||
uint16_t offset) __attribute__((always_inline));
|
||||
inline void computeLLR_int8(decoder_list_int8_t **dlist,int listSize, uint16_t row, uint16_t col,
|
||||
uint16_t offset) {
|
||||
|
||||
int16_t a;
|
||||
int16_t b;
|
||||
|
||||
int16_t absA,absB;
|
||||
int16_t maska,maskb;
|
||||
int16_t minabs;
|
||||
// int16_t **llr=dlist[i]->llr;
|
||||
|
||||
|
||||
for (int i=0;i<listSize;i++) {
|
||||
a = dlist[i]->llr[col + 1][row];
|
||||
b = dlist[i]->llr[col+1][row + offset];
|
||||
|
||||
// printf("LLR: a %d, b %d\n",a,b);
|
||||
maska = a>>15;
|
||||
maskb = b>>15;
|
||||
absA = (a+maska)^maska;
|
||||
absB = (b+maskb)^maskb;
|
||||
// printf("LLR: absA %d, absB %d\n",absA,absB);
|
||||
minabs = absA<absB ? absA : absB;
|
||||
if ((maska^maskb) == 0)
|
||||
dlist[i]->llr[col][row] = minabs;
|
||||
else
|
||||
dlist[i]->llr[col][row] = -minabs;
|
||||
// printf("LLR (a %d, b %d): llr[%d][%d] %d\n",a,b,col,row,llr[col][row]);
|
||||
|
||||
//dlist[i]->llr[col][row] = llrtab[a+128][b+128];
|
||||
// printf("newLLR [%d,%d]: %d\n",col,row,dlist[i]->llr[col][row]);
|
||||
}
|
||||
}
|
||||
|
||||
#define decoder_int8_A(sorted_dlist,currentListSize,polarParams) {for (int i = 0; i < currentListSize; i++) { \
|
||||
for (int k = 0; k < (polarParams->n+1); k++) { \
|
||||
memcpy((void*)&sorted_dlist[i+currentListSize]->bit[k][0],\
|
||||
(void*)&sorted_dlist[i]->bit[k][0],\
|
||||
sizeof(uint8_t)*polarParams->N);\
|
||||
memcpy((void*)&sorted_dlist[i+currentListSize]->llr[k][0],\
|
||||
(void*)&sorted_dlist[i]->llr[k][0],\
|
||||
sizeof(int16_t)*polarParams->N);}}}
|
||||
|
||||
#define decoder_int8_B(sorted_dlist,currentBit,currentListSize) {for (int i = 0; i < currentListSize; i++) {sorted_dlist[i]->bit[0][currentBit]=0;sorted_dlist[i+currentListSize]->bit[0][currentBit]=1;}}
|
||||
|
||||
void inline decoder_int8_C(decoder_list_int8_t *sorted_dlist[],
|
||||
t_nrPolar_params *polarParams,
|
||||
int currentBit,
|
||||
int currentListSize,
|
||||
int listSize) {
|
||||
|
||||
int32_t pathMetric[2*listSize];
|
||||
decoder_list_int8_t *temp_dlist[2*listSize];
|
||||
|
||||
int listIndex[2*listSize];
|
||||
int listIndex2[2*listSize];
|
||||
|
||||
for (int i = 0; i < currentListSize; i++) {
|
||||
listIndex[i]=i;
|
||||
pathMetric[i] = sorted_dlist[i]->pathMetric;
|
||||
}
|
||||
nr_sort_asc_int16_1D_array_ind(pathMetric, listIndex, currentListSize);
|
||||
for (int i=0;i<currentListSize;i++) {
|
||||
listIndex2[listIndex[i]] = i;
|
||||
}
|
||||
|
||||
// copy the llr/bit arrays that are needed
|
||||
for (int i = 0; i < listSize; i++) {
|
||||
// printf("listIndex[%d] %d\n",i,listIndex[i]);
|
||||
if ((listIndex2[i+listSize]<listSize) && (listIndex2[i]<listSize)) { // both '0' and '1' path metrics are to be kept
|
||||
// do memcpy of LLR and Bit arrays
|
||||
|
||||
for (int k = 0; k < (polarParams->n+1); k++) {
|
||||
|
||||
memcpy((void*)&sorted_dlist[i+listSize]->bit[k][0],
|
||||
(void*)&sorted_dlist[i]->bit[k][0],
|
||||
sizeof(uint8_t)*polarParams->N);
|
||||
memcpy((void*)&sorted_dlist[i+listSize]->llr[k][0],
|
||||
(void*)&sorted_dlist[i]->llr[k][0],
|
||||
sizeof(int16_t)*polarParams->N);
|
||||
}
|
||||
sorted_dlist[i]->bit[0][currentBit]=0;
|
||||
sorted_dlist[i+listSize]->bit[0][currentBit]=1;
|
||||
}
|
||||
else if (listIndex2[i+listSize]<listSize) { // only '1' path metric is to be kept
|
||||
// just change the current bit from '0' to '1'
|
||||
|
||||
for (int k = 0; k < (polarParams->n+1); k++) {
|
||||
memcpy((void*)&sorted_dlist[i+listSize]->bit[k][0],
|
||||
(void*)&sorted_dlist[i]->bit[k][0],
|
||||
sizeof(uint8_t)*polarParams->N);
|
||||
memcpy((void*)&sorted_dlist[i+listSize]->llr[k][0],
|
||||
(void*)&sorted_dlist[i]->llr[k][0],
|
||||
sizeof(int16_t)*polarParams->N);
|
||||
}
|
||||
sorted_dlist[i+listSize]->bit[0][currentBit]=1;
|
||||
|
||||
/*
|
||||
decoder_list_t *tmp = sorted_dlist[i+listSize];
|
||||
sorted_dlist[i+listSize] = sorted_dlist[i];
|
||||
sorted_dlist[i+listSize]->pathMetric = tmp->pathMetric;
|
||||
sorted_dlist[i+listSize]->bit[0][currentBit]=1;
|
||||
memcpy((void*)&sorted_dlist[i+listSize]->crcChecksum[0],
|
||||
(void*)&tmp->crcChecksum[0],
|
||||
24*sizeof(uint8_t));*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
for (int i = 0; i < 2*listSize; i++) {
|
||||
temp_dlist[i] = sorted_dlist[i];
|
||||
}
|
||||
for (int i = 0; i < 2*listSize; i++) {
|
||||
// printf("i %d => %d\n",i,listIndex[i]);
|
||||
sorted_dlist[i] = temp_dlist[listIndex[i]];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -19,57 +19,298 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_encoder.c
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
void polar_encoder(
|
||||
uint8_t *input,
|
||||
uint8_t *output,
|
||||
t_nrPolar_params *polarParams)
|
||||
//#define DEBUG_POLAR_ENCODER
|
||||
//#define DEBUG_POLAR_ENCODER_DCI
|
||||
//#define DEBUG_POLAR_ENCODER_TIMING
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
//input [a_31 a_30 ... a_0]
|
||||
//output [f_31 f_30 ... f_0] [f_63 f_62 ... f_32] ...
|
||||
|
||||
void polar_encoder(uint32_t *in,
|
||||
uint32_t *out,
|
||||
t_nrPolar_paramsPtr polarParams)
|
||||
{
|
||||
if (polarParams->idx == 0){//PBCH
|
||||
nr_bit2byte_uint32_8_t(in, polarParams->payloadBits, polarParams->nr_polar_A);
|
||||
/*
|
||||
* Bytewise operations
|
||||
*/
|
||||
//Calculate CRC.
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_A,
|
||||
polarParams->crc_generator_matrix,
|
||||
polarParams->nr_polar_crc,
|
||||
polarParams->payloadBits,
|
||||
polarParams->crcParityBits);
|
||||
for (uint8_t i = 0; i < polarParams->crcParityBits; i++)
|
||||
polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2);
|
||||
|
||||
//Attach CRC to the Transport Block. (a to b)
|
||||
for (uint16_t i = 0; i < polarParams->payloadBits; i++)
|
||||
polarParams->nr_polar_B[i] = polarParams->nr_polar_A[i];
|
||||
for (uint16_t i = polarParams->payloadBits; i < polarParams->K; i++)
|
||||
polarParams->nr_polar_B[i]= polarParams->nr_polar_crc[i-(polarParams->payloadBits)];
|
||||
} else { //UCI
|
||||
|
||||
}
|
||||
|
||||
//Interleaving (c to c')
|
||||
nr_polar_interleaver(polarParams->nr_polar_B,
|
||||
polarParams->nr_polar_CPrime,
|
||||
polarParams->interleaving_pattern,
|
||||
polarParams->K);
|
||||
|
||||
//Bit insertion (c' to u)
|
||||
nr_polar_bit_insertion(polarParams->nr_polar_CPrime,
|
||||
polarParams->nr_polar_U,
|
||||
polarParams->N,
|
||||
polarParams->K,
|
||||
polarParams->Q_I_N,
|
||||
polarParams->Q_PC_N,
|
||||
polarParams->n_pc);
|
||||
|
||||
//Encoding (u to d)
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_U,
|
||||
polarParams->G_N,
|
||||
polarParams->nr_polar_D,
|
||||
polarParams->N,
|
||||
polarParams->N);
|
||||
for (uint16_t i = 0; i < polarParams->N; i++)
|
||||
polarParams->nr_polar_D[i] = (polarParams->nr_polar_D[i] % 2);
|
||||
|
||||
//Rate matching
|
||||
//Sub-block interleaving (d to y) and Bit selection (y to e)
|
||||
nr_polar_interleaver(polarParams->nr_polar_D,
|
||||
polarParams->nr_polar_E,
|
||||
polarParams->rate_matching_pattern,
|
||||
polarParams->encoderLength);
|
||||
|
||||
/*
|
||||
* Return bits.
|
||||
*/
|
||||
#ifdef DEBUG_POLAR_ENCODER
|
||||
for (int i=0; i< polarParams->encoderLength;i++) printf("f[%d]=%d\n", i, polarParams->nr_polar_E[i]);
|
||||
#endif
|
||||
|
||||
nr_byte2bit_uint8_32_t(polarParams->nr_polar_E, polarParams->encoderLength, out);
|
||||
}
|
||||
|
||||
void polar_encoder_dci(uint32_t *in,
|
||||
uint32_t *out,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
uint16_t n_RNTI)
|
||||
{
|
||||
#ifdef DEBUG_POLAR_ENCODER_DCI
|
||||
printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Bytewise operations
|
||||
*/
|
||||
|
||||
//(a to a')
|
||||
nr_bit2byte_uint32_8_t(in, polarParams->payloadBits, polarParams->nr_polar_A);
|
||||
for (int i=0; i<polarParams->crcParityBits; i++) polarParams->nr_polar_APrime[i]=1;
|
||||
for (int i=0; i<polarParams->payloadBits; i++) polarParams->nr_polar_APrime[i+(polarParams->crcParityBits)]=polarParams->nr_polar_A[i];
|
||||
#ifdef DEBUG_POLAR_ENCODER_DCI
|
||||
printf("[polar_encoder_dci] A: ");
|
||||
for (int i=0; i<polarParams->payloadBits; i++) printf("%d-", polarParams->nr_polar_A[i]);
|
||||
printf("\n");
|
||||
printf("[polar_encoder_dci] APrime: ");
|
||||
for (int i=0; i<polarParams->K; i++) printf("%d-", polarParams->nr_polar_APrime[i]);
|
||||
printf("\n");
|
||||
printf("[polar_encoder_dci] GP: ");
|
||||
for (int i=0; i<polarParams->crcParityBits; i++) printf("%d-", polarParams->crc_generator_matrix[0][i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
//Calculate CRC.
|
||||
// --- OLD ---
|
||||
//nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(input, polarParams->crc_generator_matrix,
|
||||
// polarParams->nr_polar_crc, polarParams->payloadBits, polarParams->crcParityBits);
|
||||
//for (uint8_t i = 0; i < polarParams->crcParityBits; i++) polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2);
|
||||
|
||||
// --- NEW ---
|
||||
nr_crc_computation(input, polarParams->nr_polar_crc, polarParams->payloadBits, polarParams->crcParityBits, polarParams->crc256Table);
|
||||
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_APrime,
|
||||
polarParams->crc_generator_matrix,
|
||||
polarParams->nr_polar_crc,
|
||||
polarParams->K,
|
||||
polarParams->crcParityBits);
|
||||
for (uint8_t i = 0; i < polarParams->crcParityBits; i++) polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2);
|
||||
#ifdef DEBUG_POLAR_ENCODER_DCI
|
||||
printf("[polar_encoder_dci] CRC: ");
|
||||
for (int i=0; i<polarParams->crcParityBits; i++) printf("%d-", polarParams->nr_polar_crc[i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
//Attach CRC to the Transport Block. (a to b)
|
||||
for (uint16_t i = 0; i < polarParams->payloadBits; i++) polarParams->nr_polar_b[i] = input[i];
|
||||
for (uint16_t i = 0; i < polarParams->payloadBits; i++)
|
||||
polarParams->nr_polar_B[i] = polarParams->nr_polar_A[i];
|
||||
for (uint16_t i = polarParams->payloadBits; i < polarParams->K; i++)
|
||||
polarParams->nr_polar_b[i]= polarParams->nr_polar_crc[i-(polarParams->payloadBits)];
|
||||
polarParams->nr_polar_B[i]= polarParams->nr_polar_crc[i-(polarParams->payloadBits)];
|
||||
//Scrambling (b to c)
|
||||
for (int i=0; i<16; i++) {
|
||||
polarParams->nr_polar_B[polarParams->payloadBits+8+i] =
|
||||
( polarParams->nr_polar_B[polarParams->payloadBits+8+i] + ((n_RNTI>>(15-i))&1) ) % 2;
|
||||
}
|
||||
|
||||
/* //(a to a')
|
||||
nr_crc_bit2bit_uint32_8_t(in, polarParams->payloadBits, polarParams->nr_polar_aPrime);
|
||||
//Parity bits computation (p)
|
||||
polarParams->crcBit = crc24c(polarParams->nr_polar_aPrime, (polarParams->payloadBits+polarParams->crcParityBits));
|
||||
#ifdef DEBUG_POLAR_ENCODER_DCI
|
||||
printf("[polar_encoder_dci] crc: 0x%08x\n", polarParams->crcBit);
|
||||
for (int i=0; i<32; i++)
|
||||
{
|
||||
printf("%d\n",((polarParams->crcBit)>>i)&1);
|
||||
}
|
||||
#endif
|
||||
//(a to b)
|
||||
//
|
||||
// Bytewise operations
|
||||
//
|
||||
uint8_t arrayInd = ceil(polarParams->payloadBits / 8.0);
|
||||
for (int i=0; i<arrayInd-1; i++){
|
||||
for (int j=0; j<8; j++) {
|
||||
polarParams->nr_polar_B[j+(i*8)] = ((polarParams->nr_polar_aPrime[3+i]>>(7-j)) & 1);
|
||||
}
|
||||
}
|
||||
for (int i=0; i<((polarParams->payloadBits)%8); i++) {
|
||||
polarParams->nr_polar_B[i+(arrayInd-1)*8] = ((polarParams->nr_polar_aPrime[3+(arrayInd-1)]>>(7-i)) & 1);
|
||||
}
|
||||
for (int i=0; i<8; i++) {
|
||||
polarParams->nr_polar_B[polarParams->payloadBits+i] = ((polarParams->crcBit)>>(31-i))&1;
|
||||
}
|
||||
//Scrambling (b to c)
|
||||
for (int i=0; i<16; i++) {
|
||||
polarParams->nr_polar_B[polarParams->payloadBits+8+i] =
|
||||
( (((polarParams->crcBit)>>(23-i))&1) + ((n_RNTI>>(15-i))&1) ) % 2;
|
||||
}*/
|
||||
#ifdef DEBUG_POLAR_ENCODER_DCI
|
||||
printf("[polar_encoder_dci] B: ");
|
||||
for (int i = 0; i < polarParams->K; i++) printf("%d-", polarParams->nr_polar_B[i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
//Interleaving (c to c')
|
||||
nr_polar_interleaver(polarParams->nr_polar_b, polarParams->nr_polar_cPrime, polarParams->interleaving_pattern, polarParams->K);
|
||||
nr_polar_interleaver(polarParams->nr_polar_B,
|
||||
polarParams->nr_polar_CPrime,
|
||||
polarParams->interleaving_pattern,
|
||||
polarParams->K);
|
||||
|
||||
//Bit insertion (c' to u)
|
||||
nr_polar_bit_insertion(polarParams->nr_polar_cPrime, polarParams->nr_polar_u, polarParams->N, polarParams->K,
|
||||
polarParams->Q_I_N, polarParams->Q_PC_N, polarParams->n_pc);
|
||||
nr_polar_bit_insertion(polarParams->nr_polar_CPrime,
|
||||
polarParams->nr_polar_U,
|
||||
polarParams->N,
|
||||
polarParams->K,
|
||||
polarParams->Q_I_N,
|
||||
polarParams->Q_PC_N,
|
||||
polarParams->n_pc);
|
||||
|
||||
//Encoding (u to d)
|
||||
// --- OLD ---
|
||||
//nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_u, polarParams->G_N, polarParams->nr_polar_d, polarParams->N, polarParams->N);
|
||||
//for (uint16_t i = 0; i < polarParams->N; i++) polarParams->nr_polar_d[i] = (polarParams->nr_polar_d[i] % 2);
|
||||
//printf("\nd old: ");
|
||||
//for (uint16_t i = 0; i < polarParams->N; i++)
|
||||
//printf("%i ", polarParams->nr_polar_d[i]);
|
||||
|
||||
// --- NEW ---
|
||||
nr_polar_kernal_operation(polarParams->nr_polar_u, polarParams->nr_polar_d, polarParams->N);
|
||||
//printf("\nd new: ");
|
||||
//for (uint16_t i = 0; i < polarParams->N; i++)
|
||||
// printf("%i ", polarParams->nr_polar_d[i]);
|
||||
//for (uint16_t i = 0; i < polarParams->N; i++) polarParams->nr_polar_d[i] = (polarParams->nr_polar_d[i] % 2);
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_U,
|
||||
polarParams->G_N,
|
||||
polarParams->nr_polar_D,
|
||||
polarParams->N,
|
||||
polarParams->N);
|
||||
for (uint16_t i = 0; i < polarParams->N; i++)
|
||||
polarParams->nr_polar_D[i] = (polarParams->nr_polar_D[i] % 2);
|
||||
|
||||
//Rate matching
|
||||
//Sub-block interleaving (d to y) and Bit selection (y to e)
|
||||
nr_polar_rate_matcher(polarParams->nr_polar_d, output, polarParams->rate_matching_pattern, polarParams->encoderLength);
|
||||
nr_polar_interleaver(polarParams->nr_polar_D,
|
||||
polarParams->nr_polar_E,
|
||||
polarParams->rate_matching_pattern,
|
||||
polarParams->encoderLength);
|
||||
|
||||
/*
|
||||
* Return bits.
|
||||
*/
|
||||
nr_byte2bit_uint8_32_t(polarParams->nr_polar_E, polarParams->encoderLength, out);
|
||||
#ifdef DEBUG_POLAR_ENCODER_DCI
|
||||
printf("[polar_encoder_dci] E: ");
|
||||
for (int i = 0; i < polarParams->encoderLength; i++) printf("%d-", polarParams->nr_polar_E[i]);
|
||||
uint8_t outputInd = ceil(polarParams->encoderLength / 32.0);
|
||||
printf("\n[polar_encoder_dci] out: ");
|
||||
for (int i = 0; i < outputInd; i++) {
|
||||
printf("[%d]->0x%08x\t", i, out[i]);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void polar_encoder_timing(uint32_t *in,
|
||||
uint32_t *out,
|
||||
t_nrPolar_paramsPtr polarParams,
|
||||
double cpuFreqGHz,
|
||||
FILE* logFile)
|
||||
{
|
||||
//Initiate timing.
|
||||
time_stats_t timeEncoderCRCByte, timeEncoderCRCBit, timeEncoderInterleaver, timeEncoderBitInsertion, timeEncoder1, timeEncoder2, timeEncoderRateMatching, timeEncoderByte2Bit;
|
||||
reset_meas(&timeEncoderCRCByte); reset_meas(&timeEncoderCRCBit); reset_meas(&timeEncoderInterleaver); reset_meas(&timeEncoderBitInsertion); reset_meas(&timeEncoder1); reset_meas(&timeEncoder2); reset_meas(&timeEncoderRateMatching); reset_meas(&timeEncoderByte2Bit);
|
||||
uint16_t n_RNTI=0x0000;
|
||||
|
||||
start_meas(&timeEncoderCRCByte);
|
||||
nr_crc_bit2bit_uint32_8_t(in, polarParams->payloadBits, polarParams->nr_polar_aPrime); //(a to a')
|
||||
polarParams->crcBit = crc24c(polarParams->nr_polar_aPrime, (polarParams->payloadBits+polarParams->crcParityBits)); //Parity bits computation (p)
|
||||
uint8_t arrayInd = ceil(polarParams->payloadBits / 8.0); //(a to b)
|
||||
for (int i=0; i<arrayInd-1; i++)
|
||||
for (int j=0; j<8; j++)
|
||||
polarParams->nr_polar_B[j+(i*8)] = ((polarParams->nr_polar_aPrime[3+i]>>(7-j)) & 1);
|
||||
for (int i=0; i<((polarParams->payloadBits)%8); i++) polarParams->nr_polar_B[i+(arrayInd-1)*8] = ((polarParams->nr_polar_aPrime[3+(arrayInd-1)]>>(7-i)) & 1);
|
||||
for (int i=0; i<8; i++) polarParams->nr_polar_B[polarParams->payloadBits+i] = ((polarParams->crcBit)>>(31-i))&1;
|
||||
for (int i=0; i<16; i++) polarParams->nr_polar_B[polarParams->payloadBits+8+i] = ( (((polarParams->crcBit)>>(23-i))&1) + ((n_RNTI>>(15-i))&1) ) % 2; //Scrambling (b to c)
|
||||
stop_meas(&timeEncoderCRCByte);
|
||||
|
||||
|
||||
start_meas(&timeEncoderCRCBit);
|
||||
nr_bit2byte_uint32_8_t(in, polarParams->payloadBits, polarParams->nr_polar_A);
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_A, polarParams->crc_generator_matrix, polarParams->nr_polar_crc, polarParams->payloadBits, polarParams->crcParityBits); //Calculate CRC.
|
||||
for (uint8_t i = 0; i < polarParams->crcParityBits; i++) polarParams->nr_polar_crc[i] = (polarParams->nr_polar_crc[i] % 2);
|
||||
for (uint16_t i = 0; i < polarParams->payloadBits; i++) polarParams->nr_polar_B[i] = polarParams->nr_polar_A[i]; //Attach CRC to the Transport Block. (a to b)
|
||||
for (uint16_t i = polarParams->payloadBits; i < polarParams->K; i++) polarParams->nr_polar_B[i]= polarParams->nr_polar_crc[i-(polarParams->payloadBits)];
|
||||
stop_meas(&timeEncoderCRCBit);
|
||||
|
||||
|
||||
start_meas(&timeEncoderInterleaver); //Interleaving (c to c')
|
||||
nr_polar_interleaver(polarParams->nr_polar_B, polarParams->nr_polar_CPrime, polarParams->interleaving_pattern, polarParams->K);
|
||||
stop_meas(&timeEncoderInterleaver);
|
||||
|
||||
|
||||
start_meas(&timeEncoderBitInsertion); //Bit insertion (c' to u)
|
||||
nr_polar_bit_insertion(polarParams->nr_polar_CPrime, polarParams->nr_polar_U, polarParams->N, polarParams->K, polarParams->Q_I_N, polarParams->Q_PC_N, polarParams->n_pc);
|
||||
stop_meas(&timeEncoderBitInsertion);
|
||||
|
||||
|
||||
start_meas(&timeEncoder1); //Encoding (u to d)
|
||||
nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(polarParams->nr_polar_U, polarParams->G_N, polarParams->nr_polar_D, polarParams->N, polarParams->N);
|
||||
stop_meas(&timeEncoder1);
|
||||
|
||||
|
||||
start_meas(&timeEncoder2);
|
||||
for (uint16_t i = 0; i < polarParams->N; i++) polarParams->nr_polar_D[i] = (polarParams->nr_polar_D[i] % 2);
|
||||
stop_meas(&timeEncoder2);
|
||||
|
||||
|
||||
start_meas(&timeEncoderRateMatching);//Rate matching //Sub-block interleaving (d to y) and Bit selection (y to e)
|
||||
nr_polar_interleaver(polarParams->nr_polar_D, polarParams->nr_polar_E, polarParams->rate_matching_pattern, polarParams->encoderLength);
|
||||
stop_meas(&timeEncoderRateMatching);
|
||||
|
||||
|
||||
start_meas(&timeEncoderByte2Bit); //Return bits.
|
||||
nr_byte2bit_uint8_32_t(polarParams->nr_polar_E, polarParams->encoderLength, out);
|
||||
stop_meas(&timeEncoderByte2Bit);
|
||||
|
||||
fprintf(logFile,",%f,%f,%f,%f,%f,%f,%f,%f\n",
|
||||
(timeEncoderCRCByte.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoderCRCBit.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoderInterleaver.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoderBitInsertion.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoder1.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoder2.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoderRateMatching.diff_now/(cpuFreqGHz*1000.0)),
|
||||
(timeEncoderByte2Bit.diff_now/(cpuFreqGHz*1000.0)));
|
||||
}
|
||||
|
||||
@@ -1,131 +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
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
void nr_polar_info_bit_pattern(uint8_t *ibp, int16_t *Q_I_N, int16_t *Q_F_N,
|
||||
uint16_t *J, const uint16_t *Q_0_Nminus1, uint16_t K, uint16_t N, uint16_t E,
|
||||
uint8_t n_PC) {
|
||||
|
||||
int16_t *Q_Ftmp_N = malloc(sizeof(int16_t) * (N + 1)); // Last element shows the final
|
||||
int16_t *Q_Itmp_N = malloc(sizeof(int16_t) * (N + 1)); // array index assigned a value.
|
||||
|
||||
for (int i = 0; i <= N; i++) {
|
||||
Q_Ftmp_N[i] = -1; // Empty array.
|
||||
Q_Itmp_N[i] = -1;
|
||||
}
|
||||
|
||||
uint8_t flag;
|
||||
uint16_t limit, ind;
|
||||
|
||||
if (E < N) {
|
||||
if ((K / (double) E) <= (7.0 / 16)) { //puncturing
|
||||
for (int n = 0; n <= N - E - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = J[n];
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
|
||||
if ((E / (double) N) >= (3.0 / 4)) {
|
||||
limit = ceil((double) (3 * N - 2 * E) / 4);
|
||||
for (int n = 0; n <= limit - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = n;
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
} else {
|
||||
limit = ceil((double) (9 * N - 4 * E) / 16);
|
||||
for (int n = 0; n <= limit - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = n;
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
}
|
||||
} else { //shortening
|
||||
for (int n = E; n <= N - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = J[n];
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Q_I,tmp_N = Q_0_N-1 \ Q_F,tmp_N
|
||||
for (int n = 0; n <= N - 1; n++) {
|
||||
flag = 1;
|
||||
for (int m = 0; m <= Q_Ftmp_N[N]; m++) {
|
||||
if (Q_0_Nminus1[n] == Q_Ftmp_N[m]) {
|
||||
flag = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
Q_Itmp_N[Q_Itmp_N[N] + 1] = Q_0_Nminus1[n];
|
||||
Q_Itmp_N[N]++;
|
||||
}
|
||||
}
|
||||
|
||||
//Q_I_N comprises (K+n_PC) most reliable bit indices in Q_I,tmp_N
|
||||
for (int n = 0; n <= (K + n_PC) - 1; n++) {
|
||||
ind = Q_Itmp_N[N] + n - ((K + n_PC) - 1);
|
||||
Q_I_N[n] = Q_Itmp_N[ind];
|
||||
}
|
||||
|
||||
//Q_F_N = Q_0_N-1 \ Q_I_N
|
||||
for (int n = 0; n <= N - 1; n++) {
|
||||
flag = 1;
|
||||
for (int m = 0; m <= (K + n_PC) - 1; m++) {
|
||||
if (Q_0_Nminus1[n] == Q_I_N[m]) {
|
||||
flag = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
Q_F_N[Q_F_N[N] + 1] = Q_0_Nminus1[n];
|
||||
Q_F_N[N]++;
|
||||
}
|
||||
}
|
||||
|
||||
//Information Bit Pattern
|
||||
for (int n = 0; n <= N - 1; n++) {
|
||||
ibp[n] = 0;
|
||||
|
||||
for (int m = 0; m <= (K + n_PC) - 1; m++) {
|
||||
if (n == Q_I_N[m]) {
|
||||
ibp[n] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(Q_Ftmp_N);
|
||||
free(Q_Itmp_N);
|
||||
}
|
||||
|
||||
void nr_polar_info_bit_extraction(uint8_t *input, uint8_t *output, uint8_t *pattern, uint16_t size) {
|
||||
uint16_t j = 0;
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (pattern[i] > 0) {
|
||||
output[j] = input[i];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,17 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_interleaving_pattern.c
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
void nr_polar_interleaving_pattern(uint16_t K, uint8_t I_IL, uint16_t *PI_k_){
|
||||
|
||||
@@ -19,6 +19,17 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_kronecker_power_matrices.c
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
uint8_t (*const(G_N_1[])) = {
|
||||
|
||||
@@ -19,6 +19,17 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_matrix_and_array.c
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
void nr_matrix_multiplication_uint8_t_1D_uint8_t_2D(uint8_t *matrix1, uint8_t **matrix2,
|
||||
@@ -66,6 +77,40 @@ uint8_t ***nr_alloc_uint8_t_3D_array(uint16_t xlen, uint16_t ylen, uint16_t zlen
|
||||
return output;
|
||||
}
|
||||
|
||||
double ***nr_alloc_double_3D_array(uint16_t xlen, uint16_t ylen, uint16_t zlen) {
|
||||
double ***output;
|
||||
int i, j;
|
||||
|
||||
if ((output = malloc(xlen * sizeof(*output))) == NULL) {
|
||||
perror("[nr_alloc_double_3D_array] Problem at 1D allocation");
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < xlen; i++)
|
||||
output[i] = NULL;
|
||||
|
||||
|
||||
for (i = 0; i < xlen; i++)
|
||||
if ((output[i] = malloc(ylen * sizeof *output[i])) == NULL) {
|
||||
perror("[nr_alloc_double_3D_array] Problem at 2D allocation");
|
||||
nr_free_double_3D_array(output, xlen, ylen);
|
||||
return NULL;
|
||||
}
|
||||
for (i = 0; i < xlen; i++)
|
||||
for (j = 0; j < ylen; j++)
|
||||
output[i][j] = NULL;
|
||||
|
||||
|
||||
for (i = 0; i < xlen; i++)
|
||||
for (j = 0; j < ylen; j++)
|
||||
if ((output[i][j] = malloc(zlen * sizeof *output[i][j])) == NULL) {
|
||||
perror("[nr_alloc_double_3D_array] Problem at 3D allocation");
|
||||
nr_free_double_3D_array(output, xlen, ylen);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
double **nr_alloc_double_2D_array(uint16_t xlen, uint16_t ylen) {
|
||||
double **output;
|
||||
int i, j;
|
||||
@@ -117,6 +162,18 @@ uint8_t **nr_alloc_uint8_t_2D_array(uint16_t xlen, uint16_t ylen) {
|
||||
return output;
|
||||
}
|
||||
|
||||
void nr_free_double_3D_array(double ***input, uint16_t xlen, uint16_t ylen) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < xlen; i++) {
|
||||
for (j = 0; j < ylen; j++) {
|
||||
free(input[i][j]);
|
||||
}
|
||||
free(input[i]);
|
||||
}
|
||||
free(input);
|
||||
}
|
||||
|
||||
void nr_free_uint8_t_3D_array(uint8_t ***input, uint16_t xlen, uint16_t ylen) {
|
||||
int i, j;
|
||||
|
||||
@@ -144,7 +201,7 @@ void nr_free_double_2D_array(double **input, uint16_t xlen) {
|
||||
}
|
||||
|
||||
// Modified Bubble Sort.
|
||||
void nr_sort_asc_double_1D_array_ind(double *matrix, int *ind, int len) {
|
||||
void nr_sort_asc_double_1D_array_ind(double *matrix, uint8_t *ind, uint8_t len) {
|
||||
int swaps;
|
||||
double temp;
|
||||
int tempInd;
|
||||
|
||||
@@ -1,46 +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
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
uint32_t nr_polar_output_length(uint16_t K, uint16_t E, uint8_t n_max){
|
||||
uint8_t n_1, n_2, n_min=5, n;
|
||||
uint32_t polar_code_output_length;
|
||||
double R_min=1.0/8;
|
||||
|
||||
if ( (E <= (9.0/8)*pow(2,ceil(log2(E))-1)) && (K/E < 9.0/16) ) {
|
||||
n_1 = ceil(log2(E))-1;
|
||||
} else {
|
||||
n_1 = ceil(log2(E));
|
||||
}
|
||||
|
||||
n_2 = ceil(log2(K/R_min));
|
||||
|
||||
n=n_max;
|
||||
if (n>n_1) n=n_1;
|
||||
if (n>n_2) n=n_2;
|
||||
if (n<n_min) n=n_min;
|
||||
|
||||
polar_code_output_length = (uint32_t) pow(2.0,n);
|
||||
|
||||
return polar_code_output_length;
|
||||
}
|
||||
@@ -19,21 +19,23 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h
|
||||
* \brief Defines the constant variables for polar coding of the PBCH from 38-212, V15.1.1 2018-04.
|
||||
* \author
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h
|
||||
* \brief Defines the constant variables for polar coding of the PBCH from 38-212, V15.1.1 2018-04.
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __NR_POLAR_PBCH_DEFS__H__
|
||||
#define __NR_POLAR_PBCH_DEFS__H__
|
||||
|
||||
#define NR_POLAR_PBCH_PAYLOAD_BITS 32 //uint16_t
|
||||
#define NR_POLAR_PBCH_AGGREGATION_LEVEL 0 //uint8_t
|
||||
#define NR_POLAR_PBCH_MESSAGE_TYPE 0 //int8_t
|
||||
#define NR_POLAR_PBCH_PAYLOAD_BITS 32 //uint16_t
|
||||
#define NR_POLAR_PBCH_CRC_PARITY_BITS 24
|
||||
#define NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS 3
|
||||
//Assumed 3 by 3GPP when NR_POLAR_PBCH_L>8 to meet false alarm rate requirements.
|
||||
@@ -49,9 +51,7 @@
|
||||
//Sec. 7.1.5: Rate Matching
|
||||
#define NR_POLAR_PBCH_I_BIL 0 //uint8_t
|
||||
#define NR_POLAR_PBCH_E 864 //uint16_t
|
||||
|
||||
//#define NR_POLAR_PBCH_L 5 //uint8_t
|
||||
#define NR_POLAR_PBCH_PATH_METRIC_APPROXIMATION 0 //uint8_t; 0 --> eq. (8a) and (11b), 1 --> eq. (9) and (12)
|
||||
#define NR_POLAR_PBCH_E_DWORD 27 // NR_POLAR_PBCH_E/32
|
||||
|
||||
/*
|
||||
* TEST CODE
|
||||
|
||||
@@ -0,0 +1,337 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*!\file PHY/CODING/nrPolar_tools/nr_polar_procedures.h
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
void nr_polar_bit_insertion(uint8_t *input,
|
||||
uint8_t *output,
|
||||
uint16_t N,
|
||||
uint16_t K,
|
||||
int16_t *Q_I_N,
|
||||
int16_t *Q_PC_N,
|
||||
uint8_t n_PC)
|
||||
{
|
||||
uint16_t k=0;
|
||||
uint8_t flag;
|
||||
|
||||
if (n_PC>0) {
|
||||
/*
|
||||
*
|
||||
*/
|
||||
} else {
|
||||
for (int n=0; n<=N-1; n++) {
|
||||
flag=0;
|
||||
for (int m=0; m<=(K+n_PC)-1; m++) {
|
||||
if ( n == Q_I_N[m]) {
|
||||
flag=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) { // n ϵ Q_I_N
|
||||
output[n]=input[k];
|
||||
k++;
|
||||
} else {
|
||||
output[n] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint32_t nr_polar_output_length(uint16_t K,
|
||||
uint16_t E,
|
||||
uint8_t n_max)
|
||||
{
|
||||
uint8_t n_1, n_2, n_min=5, n;
|
||||
double R_min=1.0/8;
|
||||
|
||||
if ( (E <= (9.0/8)*pow(2,ceil(log2(E))-1)) && (K/E < 9.0/16) ) {
|
||||
n_1 = ceil(log2(E))-1;
|
||||
} else {
|
||||
n_1 = ceil(log2(E));
|
||||
}
|
||||
|
||||
n_2 = ceil(log2(K/R_min));
|
||||
|
||||
n=n_max;
|
||||
if (n>n_1) n=n_1;
|
||||
if (n>n_2) n=n_2;
|
||||
if (n<n_min) n=n_min;
|
||||
|
||||
return ((uint32_t) pow(2.0,n)); //=polar_code_output_length
|
||||
}
|
||||
|
||||
|
||||
void nr_polar_channel_interleaver_pattern(uint16_t *cip,
|
||||
uint8_t I_BIL,
|
||||
uint16_t E)
|
||||
{
|
||||
if (I_BIL == 1) {
|
||||
uint16_t T=0, k;
|
||||
while( ((T/2)*(T+1)) < E ) T++;
|
||||
|
||||
int16_t **v = malloc(T * sizeof(*v));
|
||||
for (int i = 0; i <= T-1; i++) v[i] = malloc((T-i) * sizeof(*(v[i])));
|
||||
|
||||
k=0;
|
||||
for (int i = 0; i <= T-1; i++) {
|
||||
for (int j = 0; j <= (T-1)-i; j++) {
|
||||
if (k<E) {
|
||||
v[i][j] = k;
|
||||
} else {
|
||||
v[i][j] = (-1);
|
||||
}
|
||||
k++;
|
||||
}
|
||||
}
|
||||
|
||||
k=0;
|
||||
for (int j = 0; j <= T-1; j++) {
|
||||
for (int i = 0; i <= (T-1)-j; i++) {
|
||||
if ( v[i][j] != (-1) ) {
|
||||
cip[k]=v[i][j];
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i <= T-1; i++) free(v[i]);
|
||||
free(v);
|
||||
|
||||
} else {
|
||||
for (int i=0; i<=E-1; i++) cip[i]=i;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_polar_info_bit_pattern(uint8_t *ibp,
|
||||
int16_t *Q_I_N,
|
||||
int16_t *Q_F_N,
|
||||
uint16_t *J,
|
||||
const uint16_t *Q_0_Nminus1,
|
||||
uint16_t K,
|
||||
uint16_t N,
|
||||
uint16_t E,
|
||||
uint8_t n_PC)
|
||||
{
|
||||
int16_t *Q_Ftmp_N = malloc(sizeof(int16_t) * (N + 1)); // Last element shows the final
|
||||
int16_t *Q_Itmp_N = malloc(sizeof(int16_t) * (N + 1)); // array index assigned a value.
|
||||
|
||||
for (int i = 0; i <= N; i++) {
|
||||
Q_Ftmp_N[i] = -1; // Empty array.
|
||||
Q_Itmp_N[i] = -1;
|
||||
}
|
||||
|
||||
uint8_t flag;
|
||||
uint16_t limit, ind;
|
||||
|
||||
if (E < N) {
|
||||
if ((K / (double) E) <= (7.0 / 16)) { //puncturing
|
||||
for (int n = 0; n <= N - E - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = J[n];
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
|
||||
if ((E / (double) N) >= (3.0 / 4)) {
|
||||
limit = ceil((double) (3 * N - 2 * E) / 4);
|
||||
for (int n = 0; n <= limit - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = n;
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
} else {
|
||||
limit = ceil((double) (9 * N - 4 * E) / 16);
|
||||
for (int n = 0; n <= limit - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = n;
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
}
|
||||
} else { //shortening
|
||||
for (int n = E; n <= N - 1; n++) {
|
||||
ind = Q_Ftmp_N[N] + 1;
|
||||
Q_Ftmp_N[ind] = J[n];
|
||||
Q_Ftmp_N[N] = Q_Ftmp_N[N] + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Q_I,tmp_N = Q_0_N-1 \ Q_F,tmp_N
|
||||
for (int n = 0; n <= N - 1; n++) {
|
||||
flag = 1;
|
||||
for (int m = 0; m <= Q_Ftmp_N[N]; m++) {
|
||||
if (Q_0_Nminus1[n] == Q_Ftmp_N[m]) {
|
||||
flag = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
Q_Itmp_N[Q_Itmp_N[N] + 1] = Q_0_Nminus1[n];
|
||||
Q_Itmp_N[N]++;
|
||||
}
|
||||
}
|
||||
|
||||
//Q_I_N comprises (K+n_PC) most reliable bit indices in Q_I,tmp_N
|
||||
for (int n = 0; n <= (K + n_PC) - 1; n++) {
|
||||
ind = Q_Itmp_N[N] + n - ((K + n_PC) - 1);
|
||||
Q_I_N[n] = Q_Itmp_N[ind];
|
||||
}
|
||||
|
||||
//Q_F_N = Q_0_N-1 \ Q_I_N
|
||||
for (int n = 0; n <= N - 1; n++) {
|
||||
flag = 1;
|
||||
for (int m = 0; m <= (K + n_PC) - 1; m++) {
|
||||
if (Q_0_Nminus1[n] == Q_I_N[m]) {
|
||||
flag = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
Q_F_N[Q_F_N[N] + 1] = Q_0_Nminus1[n];
|
||||
Q_F_N[N]++;
|
||||
}
|
||||
}
|
||||
|
||||
//Information Bit Pattern
|
||||
for (int n = 0; n <= N - 1; n++) {
|
||||
ibp[n] = 0;
|
||||
|
||||
for (int m = 0; m <= (K + n_PC) - 1; m++) {
|
||||
if (n == Q_I_N[m]) {
|
||||
ibp[n] = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(Q_Ftmp_N);
|
||||
free(Q_Itmp_N);
|
||||
}
|
||||
|
||||
|
||||
void nr_polar_info_bit_extraction(uint8_t *input,
|
||||
uint8_t *output,
|
||||
uint8_t *pattern,
|
||||
uint16_t size)
|
||||
{
|
||||
uint16_t j = 0;
|
||||
for (int i = 0; i < size; i++) {
|
||||
if (pattern[i] > 0) {
|
||||
output[j] = input[i];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_polar_rate_matching_pattern(uint16_t *rmp, uint16_t *J, const uint8_t *P_i_, uint16_t K, uint16_t N, uint16_t E){
|
||||
|
||||
uint8_t i;
|
||||
uint16_t *d, *y, ind;
|
||||
d = (uint16_t *)malloc(sizeof(uint16_t) * N);
|
||||
y = (uint16_t *)malloc(sizeof(uint16_t) * N);
|
||||
|
||||
for (int m=0; m<=N-1; m++) d[m]=m;
|
||||
|
||||
for (int m=0; m<=N-1; m++){
|
||||
i=floor((32*m)/N);
|
||||
J[m] = (P_i_[i]*(N/32)) + (m%(N/32));
|
||||
y[m] = d[J[m]];
|
||||
}
|
||||
|
||||
if (E>=N) { //repetition
|
||||
for (int k=0; k<=E-1; k++) {
|
||||
ind = (k%N);
|
||||
rmp[k]=y[ind];
|
||||
}
|
||||
} else {
|
||||
if ( (K/(double)E) <= (7.0/16) ) { //puncturing
|
||||
for (int k=0; k<=E-1; k++) {
|
||||
rmp[k]=y[k+N-E];
|
||||
}
|
||||
} else { //shortening
|
||||
for (int k=0; k<=E-1; k++) {
|
||||
rmp[k]=y[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(d);
|
||||
free(y);
|
||||
}
|
||||
|
||||
|
||||
void nr_polar_rate_matching(double *input, double *output, uint16_t *rmp, uint16_t K, uint16_t N, uint16_t E){
|
||||
|
||||
if (E>=N) { //repetition
|
||||
for (int i=0; i<=N-1; i++) output[i]=0;
|
||||
for (int i=0; i<=E-1; i++){
|
||||
output[rmp[i]]+=input[i];
|
||||
}
|
||||
} else {
|
||||
if ( (K/(double)E) <= (7.0/16) ) { //puncturing
|
||||
for (int i=0; i<=N-1; i++) output[i]=0;
|
||||
} else { //shortening
|
||||
for (int i=0; i<=N-1; i++) output[i]=INFINITY;
|
||||
}
|
||||
|
||||
for (int i=0; i<=E-1; i++){
|
||||
output[rmp[i]]=input[i];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void nr_polar_rate_matching_int16(int16_t *input, int16_t *output, uint16_t *rmp, uint16_t K, uint16_t N, uint16_t E){
|
||||
|
||||
if (E>=N) { //repetition
|
||||
for (int i=0; i<=N-1; i++) output[i]=0;
|
||||
for (int i=0; i<=E-1; i++){
|
||||
output[rmp[i]]+=input[i];
|
||||
}
|
||||
} else {
|
||||
if ( (K/(double)E) <= (7.0/16) ) { //puncturing
|
||||
for (int i=0; i<=N-1; i++) output[i]=0;
|
||||
} else { //shortening
|
||||
for (int i=0; i<=N-1; i++) output[i]=INFINITY;
|
||||
}
|
||||
|
||||
for (int i=0; i<=E-1; i++){
|
||||
output[rmp[i]]=input[i];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -33,27 +33,7 @@
|
||||
#ifndef __NR_POLAR_UCI_DEFS__H__
|
||||
#define __NR_POLAR_UCI_DEFS__H__
|
||||
|
||||
#define NR_POLAR_PUCCH_PAYLOAD_BITS 32
|
||||
#define NR_POLAR_PUCCH_E 32
|
||||
|
||||
//Ref. 38-212, Section 6.3.1.2.1
|
||||
#define NR_POLAR_PUCCH_CRC_PARITY_BITS_SHORT 6
|
||||
#define NR_POLAR_PUCCH_CRC_PARITY_BITS_LONG 11
|
||||
|
||||
#define NR_POLAR_PUCCH_I_SEG_LONG 1
|
||||
#define NR_POLAR_PUCCH_I_SEG_SHORT 0
|
||||
|
||||
//Ref. 38-212, Section 6.3.1.3.1
|
||||
#define NR_POLAR_PUCCH_N_MAX 10
|
||||
#define NR_POLAR_PUCCH_I_IL 0
|
||||
#define NR_POLAR_PUCCH_N_PC_SHORT 3
|
||||
#define NR_POLAR_PUCCH_N_PC_LONG 0
|
||||
#define NR_POLAR_PUCCH_N_PC_WM_LONG 0
|
||||
#define NR_POLAR_PUCCH_N_PC_WM_SHORT 1
|
||||
|
||||
//Ref. 38-212, Section 6.3.1.4.1
|
||||
#define NR_POLAR_PUCCH_I_BIL 1
|
||||
|
||||
|
||||
#define NR_POLAR_UCI_MESSAGE_TYPE -1 //int8_t
|
||||
#define NR_POLAR_UCI_CRC_ERROR_CORRECTION_BITS 3
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* file: nr_compute_tbs.c
|
||||
purpose: Compute NR TBS
|
||||
author: Hongzhi WANG (TCL)
|
||||
*/
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
//#include "SCHED/extern.h"
|
||||
|
||||
#define INDEX_MAX_TBS_TABLE (93)
|
||||
//Table 5.1.3.1-1
|
||||
uint16_t Mcsindextable1[29][3] = {{2,120,0.2344},
|
||||
{2,157,0.3066},
|
||||
{2,193,0.3770},
|
||||
{2,251,0.4902},
|
||||
{2,308,0.6016},
|
||||
{2,379,0.7402},
|
||||
{2,449,0.8770},
|
||||
{2,526,1.0273},
|
||||
{2,602,1.1758},
|
||||
{2,679,1.3262},
|
||||
{4,340,1.3281},
|
||||
{4,378,1.4766},
|
||||
{4,434,1.6953},
|
||||
{4,490,1.9141},
|
||||
{4,553,2.1602},
|
||||
{4,616,2.4063},
|
||||
{4,658,2.5703},
|
||||
{6,438,2.5664},
|
||||
{6,466,2.7305},
|
||||
{6,517,3.0293},
|
||||
{6,567,3.3223},
|
||||
{6,616,3.6094},
|
||||
{6,666,3.9023},
|
||||
{6,719,4.2129},
|
||||
{6,772,4.5234},
|
||||
{6,822,4.8164},
|
||||
{6,873,5.1152},
|
||||
{6,910,5.3320},
|
||||
{6,948,5.5547}};
|
||||
//Table 5.1.2.2-2
|
||||
uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,208,224,240,256,272,288,304,320,336,352,368,384,408,432,456,480,504,528,552,576,608,640,672,704,736,768,808,848,888,928,984,1032,1064,1128,1160,1192,1224,1256,1288,1320,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,2024,2088,2152,2216,2280,2408,2472,2536,2600,2664,2728,2792,2856,2976,3104,3240,3368,3496,3624,3752,3824};
|
||||
|
||||
uint32_t nr_compute_tbs(uint8_t mcs,
|
||||
uint16_t nb_rb,
|
||||
uint16_t nb_symb_sch,
|
||||
uint8_t nb_re_dmrs,
|
||||
uint16_t length_dmrs,
|
||||
uint8_t Nl)
|
||||
{
|
||||
uint16_t nbp_re, nb_re, nb_dmrs_prb, nb_rb_oh, Ninfo,Np_info,n,Qm,R,C;
|
||||
uint32_t nr_tbs;
|
||||
|
||||
nb_rb_oh = 0; //set to 0 if not configured by higher layer
|
||||
Qm = Mcsindextable1[mcs][0];
|
||||
R = Mcsindextable1[mcs][1];
|
||||
nb_dmrs_prb = nb_re_dmrs*length_dmrs;
|
||||
|
||||
nbp_re = 12 * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
|
||||
// Intermediate number of information bits
|
||||
Ninfo = (nb_re * R * Qm * Nl)/1024;
|
||||
|
||||
//printf("Ninfo %d nbp_re %d nb_re %d Qm %d, R %d\n", Ninfo, nbp_re, nb_re, Qm, R);
|
||||
|
||||
if (Ninfo <=3824) {
|
||||
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, pow(n,2) * floor(Ninfo/pow(n,2)));
|
||||
|
||||
for (int i=0; i<INDEX_MAX_TBS_TABLE; i++) {
|
||||
if (Tbstable_nr[i] >= Np_info){
|
||||
nr_tbs = Tbstable_nr[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
n = floor(log2(Ninfo-24)) - 5;
|
||||
Np_info = max(3840, pow(n,2) * round((Ninfo - 24)/pow(n,2)));
|
||||
|
||||
if (R <= 1024/4) {
|
||||
C = ceil( (Np_info + 24)/3816 );
|
||||
nr_tbs = 8 * C * ceil( (Np_info + 24)/(8*C) ) - 24;
|
||||
}
|
||||
else {
|
||||
if (Np_info > 8424){
|
||||
C = ceil( (Np_info + 24)/8424 );
|
||||
nr_tbs = 8 * C * ceil( (Np_info + 24)/(8*C) ) - 24;
|
||||
}
|
||||
else
|
||||
nr_tbs = 8 * ceil( (Np_info + 24)/8 ) - 24;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return nr_tbs;
|
||||
}
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*!\file PHY/CODING/nr_polar_init.h
|
||||
* \brief
|
||||
* \author Turker Yilmaz
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company EURECOM
|
||||
* \email turker.yilmaz@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "nrPolar_tools/nr_polar_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||
|
||||
void nr_polar_init(t_nrPolar_paramsPtr *polarParams,
|
||||
int8_t messageType,
|
||||
uint16_t messageLength,
|
||||
uint8_t aggregation_level)
|
||||
{
|
||||
t_nrPolar_paramsPtr currentPtr = *polarParams;
|
||||
uint16_t aggregation_prime = nr_polar_aggregation_prime(aggregation_level);
|
||||
|
||||
//Parse the list. If the node is already created, return without initialization.
|
||||
while (currentPtr != NULL) {
|
||||
if (currentPtr->idx == (messageType * messageLength * aggregation_prime)) return;
|
||||
else currentPtr = currentPtr->nextPtr;
|
||||
}
|
||||
|
||||
//Else, initialize and add node to the end of the linked list.
|
||||
t_nrPolar_paramsPtr newPolarInitNode = malloc(sizeof(t_nrPolar_params));
|
||||
|
||||
if (newPolarInitNode != NULL) {
|
||||
|
||||
newPolarInitNode->idx = (messageType * messageLength * aggregation_prime);
|
||||
newPolarInitNode->nextPtr = NULL;
|
||||
|
||||
if (messageType == 0) { //PBCH
|
||||
newPolarInitNode->n_max = NR_POLAR_PBCH_N_MAX;
|
||||
newPolarInitNode->i_il = NR_POLAR_PBCH_I_IL;
|
||||
newPolarInitNode->i_seg = NR_POLAR_PBCH_I_SEG;
|
||||
newPolarInitNode->n_pc = NR_POLAR_PBCH_N_PC;
|
||||
newPolarInitNode->n_pc_wm = NR_POLAR_PBCH_N_PC_WM;
|
||||
newPolarInitNode->i_bil = NR_POLAR_PBCH_I_BIL;
|
||||
newPolarInitNode->crcParityBits = NR_POLAR_PBCH_CRC_PARITY_BITS;
|
||||
newPolarInitNode->payloadBits = NR_POLAR_PBCH_PAYLOAD_BITS;
|
||||
newPolarInitNode->encoderLength = NR_POLAR_PBCH_E;
|
||||
newPolarInitNode->crcCorrectionBits = NR_POLAR_PBCH_CRC_ERROR_CORRECTION_BITS;
|
||||
newPolarInitNode->crc_generator_matrix = crc24c_generator_matrix(newPolarInitNode->payloadBits);//G_P
|
||||
} else if (messageType == 1) { //DCI
|
||||
newPolarInitNode->n_max = NR_POLAR_DCI_N_MAX;
|
||||
newPolarInitNode->i_il = NR_POLAR_DCI_I_IL;
|
||||
newPolarInitNode->i_seg = NR_POLAR_DCI_I_SEG;
|
||||
newPolarInitNode->n_pc = NR_POLAR_DCI_N_PC;
|
||||
newPolarInitNode->n_pc_wm = NR_POLAR_DCI_N_PC_WM;
|
||||
newPolarInitNode->i_bil = NR_POLAR_DCI_I_BIL;
|
||||
newPolarInitNode->crcParityBits = NR_POLAR_DCI_CRC_PARITY_BITS;
|
||||
newPolarInitNode->payloadBits = messageLength;
|
||||
newPolarInitNode->encoderLength = aggregation_level*108;
|
||||
newPolarInitNode->crcCorrectionBits = NR_POLAR_DCI_CRC_ERROR_CORRECTION_BITS;
|
||||
newPolarInitNode->crc_generator_matrix=crc24c_generator_matrix(newPolarInitNode->payloadBits+newPolarInitNode->crcParityBits);//G_P
|
||||
} else if (messageType == -1) { //UCI
|
||||
|
||||
} else {
|
||||
AssertFatal(1 == 0, "[nr_polar_init] Incorrect Message Type(%d)", messageType);
|
||||
}
|
||||
|
||||
newPolarInitNode->K = newPolarInitNode->payloadBits + newPolarInitNode->crcParityBits; // Number of bits to encode.
|
||||
newPolarInitNode->N = nr_polar_output_length(newPolarInitNode->K, newPolarInitNode->encoderLength, newPolarInitNode->n_max);
|
||||
newPolarInitNode->n = log2(newPolarInitNode->N);
|
||||
newPolarInitNode->G_N = nr_polar_kronecker_power_matrices(newPolarInitNode->n);
|
||||
|
||||
//polar_encoder vectors:
|
||||
newPolarInitNode->nr_polar_crc = malloc(sizeof(uint8_t) * newPolarInitNode->crcParityBits);
|
||||
newPolarInitNode->nr_polar_aPrime = malloc(sizeof(uint8_t) * ((ceil((newPolarInitNode->payloadBits)/32.0)*4)+3));
|
||||
newPolarInitNode->nr_polar_APrime = malloc(sizeof(uint8_t) * newPolarInitNode->K);
|
||||
newPolarInitNode->nr_polar_D = malloc(sizeof(uint8_t) * newPolarInitNode->N);
|
||||
newPolarInitNode->nr_polar_E = malloc(sizeof(uint8_t) * newPolarInitNode->encoderLength);
|
||||
|
||||
//Polar Coding vectors
|
||||
newPolarInitNode->nr_polar_U = malloc(sizeof(uint8_t) * newPolarInitNode->N); //Decoder: nr_polar_uHat
|
||||
newPolarInitNode->nr_polar_CPrime = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_cHat
|
||||
newPolarInitNode->nr_polar_B = malloc(sizeof(uint8_t) * newPolarInitNode->K); //Decoder: nr_polar_bHat
|
||||
newPolarInitNode->nr_polar_A = malloc(sizeof(uint8_t) * newPolarInitNode->payloadBits); //Decoder: nr_polar_aHat
|
||||
|
||||
|
||||
|
||||
newPolarInitNode->Q_0_Nminus1 = nr_polar_sequence_pattern(newPolarInitNode->n);
|
||||
|
||||
newPolarInitNode->interleaving_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->K);
|
||||
nr_polar_interleaving_pattern(newPolarInitNode->K,
|
||||
newPolarInitNode->i_il,
|
||||
newPolarInitNode->interleaving_pattern);
|
||||
|
||||
newPolarInitNode->rate_matching_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength);
|
||||
uint16_t *J = malloc(sizeof(uint16_t) * newPolarInitNode->N);
|
||||
nr_polar_rate_matching_pattern(newPolarInitNode->rate_matching_pattern,
|
||||
J,
|
||||
nr_polar_subblock_interleaver_pattern,
|
||||
newPolarInitNode->K,
|
||||
newPolarInitNode->N,
|
||||
newPolarInitNode->encoderLength);
|
||||
|
||||
newPolarInitNode->information_bit_pattern = malloc(sizeof(uint8_t) * newPolarInitNode->N);
|
||||
newPolarInitNode->Q_I_N = malloc(sizeof(int16_t) * (newPolarInitNode->K + newPolarInitNode->n_pc));
|
||||
newPolarInitNode->Q_F_N = malloc( sizeof(int16_t) * (newPolarInitNode->N + 1)); // Last element shows the final array index assigned a value.
|
||||
newPolarInitNode->Q_PC_N = malloc( sizeof(int16_t) * (newPolarInitNode->n_pc));
|
||||
for (int i = 0; i <= newPolarInitNode->N; i++)
|
||||
newPolarInitNode->Q_F_N[i] = -1; // Empty array.
|
||||
nr_polar_info_bit_pattern(newPolarInitNode->information_bit_pattern,
|
||||
newPolarInitNode->Q_I_N,
|
||||
newPolarInitNode->Q_F_N,
|
||||
J,
|
||||
newPolarInitNode->Q_0_Nminus1,
|
||||
newPolarInitNode->K,
|
||||
newPolarInitNode->N,
|
||||
newPolarInitNode->encoderLength,
|
||||
newPolarInitNode->n_pc);
|
||||
|
||||
newPolarInitNode->channel_interleaver_pattern = malloc(sizeof(uint16_t) * newPolarInitNode->encoderLength);
|
||||
nr_polar_channel_interleaver_pattern(newPolarInitNode->channel_interleaver_pattern,
|
||||
newPolarInitNode->i_bil,
|
||||
newPolarInitNode->encoderLength);
|
||||
|
||||
free(J);
|
||||
|
||||
build_decoder_tree(newPolarInitNode);
|
||||
printf("decoder tree nodes %d\n",newPolarInitNode->tree.num_nodes);
|
||||
|
||||
} else {
|
||||
AssertFatal(1 == 0, "[nr_polar_init] New t_nrPolar_paramsPtr could not be created");
|
||||
}
|
||||
|
||||
currentPtr = *polarParams;
|
||||
//If polarParams is empty:
|
||||
if (currentPtr == NULL)
|
||||
{
|
||||
*polarParams = newPolarInitNode;
|
||||
return;
|
||||
}
|
||||
//Else, add node to the end of the linked list.
|
||||
while (currentPtr->nextPtr != NULL) {
|
||||
currentPtr = currentPtr->nextPtr;
|
||||
}
|
||||
currentPtr->nextPtr= newPolarInitNode;
|
||||
return;
|
||||
}
|
||||
|
||||
void nr_polar_print_polarParams(t_nrPolar_paramsPtr polarParams)
|
||||
{
|
||||
uint8_t i = 0;
|
||||
if (polarParams == NULL) {
|
||||
printf("polarParams is empty.\n");
|
||||
} else {
|
||||
while (polarParams != NULL){
|
||||
printf("polarParams[%d] = %d\n", i, polarParams->idx);
|
||||
polarParams = polarParams->nextPtr;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
t_nrPolar_paramsPtr nr_polar_params (t_nrPolar_paramsPtr polarParams,
|
||||
int8_t messageType,
|
||||
uint16_t messageLength,
|
||||
uint8_t aggregation_level)
|
||||
{
|
||||
t_nrPolar_paramsPtr currentPtr = NULL;
|
||||
|
||||
while (polarParams != NULL) {
|
||||
if (polarParams->idx ==
|
||||
(messageType * messageLength * (nr_polar_aggregation_prime(aggregation_level)) )) {
|
||||
currentPtr = polarParams;
|
||||
break;
|
||||
} else {
|
||||
polarParams = polarParams->nextPtr;
|
||||
}
|
||||
}
|
||||
return currentPtr;
|
||||
}
|
||||
|
||||
uint16_t nr_polar_aggregation_prime (uint8_t aggregation_level)
|
||||
{
|
||||
if (aggregation_level == 0) return 0;
|
||||
else if (aggregation_level == 1) return NR_POLAR_AGGREGATION_LEVEL_1_PRIME;
|
||||
else if (aggregation_level == 2) return NR_POLAR_AGGREGATION_LEVEL_2_PRIME;
|
||||
else if (aggregation_level == 4) return NR_POLAR_AGGREGATION_LEVEL_4_PRIME;
|
||||
else if (aggregation_level == 8) return NR_POLAR_AGGREGATION_LEVEL_8_PRIME;
|
||||
else return NR_POLAR_AGGREGATION_LEVEL_16_PRIME; //aggregation_level == 16
|
||||
}
|
||||
@@ -24,8 +24,8 @@
|
||||
author: Hongzhi WANG (TCL)
|
||||
date: 12.09.2017
|
||||
*/
|
||||
#include "PHY/defs.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
//#include "SCHED/extern.h"
|
||||
|
||||
//#define DEBUG_SEGMENTATION
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms)
|
||||
|
||||
init_dfts();
|
||||
|
||||
crcTableInit();
|
||||
|
||||
phy_generate_viterbi_tables_lte();
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@
|
||||
*/
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "RadioResourceConfigCommonSIB.h"
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
#include "PHY/NR_REFSIG/defs.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
|
||||
@@ -115,10 +115,32 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
);*/
|
||||
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
|
||||
|
||||
crcTableInit();
|
||||
|
||||
init_dfts();
|
||||
|
||||
// PBCH DMRS gold sequences generation
|
||||
nr_init_pbch_dmrs(gNB);
|
||||
// Polar encoder init for PBCH
|
||||
nr_polar_init(&fp->pbch_polar_params, 1);
|
||||
nr_polar_init(&gNB->nrPolar_params,
|
||||
NR_POLAR_PBCH_MESSAGE_TYPE,
|
||||
NR_POLAR_PBCH_PAYLOAD_BITS,
|
||||
NR_POLAR_PBCH_AGGREGATION_LEVEL);
|
||||
|
||||
//PDCCH DMRS init
|
||||
gNB->nr_gold_pdcch_dmrs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t**));
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
AssertFatal(pdcch_dmrs!=NULL, "NR init: pdcch_dmrs malloc failed\n");
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
pdcch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t*));
|
||||
AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot);
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++){
|
||||
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
|
||||
nr_init_pdcch_dmrs(gNB, cfg->sch_config.physical_cell_id.value);
|
||||
|
||||
/*
|
||||
lte_gold(fp,gNB->lte_gold_table,fp->Nid_cell);
|
||||
@@ -276,6 +298,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
LTE_eNB_PUSCH** const pusch_vars = gNB->pusch_vars;
|
||||
LTE_eNB_SRS* const srs_vars = gNB->srs_vars;
|
||||
LTE_eNB_PRACH* const prach_vars = &gNB->prach_vars;
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
|
||||
int i, UE_id;
|
||||
|
||||
@@ -288,6 +311,9 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(common_vars->txdataF);
|
||||
free_and_zero(common_vars->rxdataF);
|
||||
|
||||
// PDCCH DMRS sequences
|
||||
free_and_zero(pdcch_dmrs);
|
||||
|
||||
// Channel estimates for SRS
|
||||
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
|
||||
for (i=0; i<64; i++) {
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/NR_REFSIG/pss_nr.h"
|
||||
#include "openair1/PHY/NR_REFSIG/ul_ref_seq_nr.h"
|
||||
|
||||
//uint8_t dmrs1_tab_ue[8] = {0,2,3,4,6,8,9,10};
|
||||
|
||||
@@ -324,6 +327,7 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n_adj_cells,unsigned int *adj_cell_id)
|
||||
{
|
||||
|
||||
@@ -341,6 +345,7 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n
|
||||
memcpy((void*)phy_meas->adj_cell_id,(void *)adj_cell_id,n_adj_cells*sizeof(unsigned int));
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
|
||||
@@ -352,17 +357,17 @@ void phy_config_dedicated_scell_ue(uint8_t Mod_id,
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
void phy_config_harq_ue(module_id_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
uint16_t max_harq_tx )
|
||||
{
|
||||
|
||||
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||
PHY_VARS_NR_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||
phy_vars_ue->ulsch[eNB_id]->Mlimit = max_harq_tx;
|
||||
}
|
||||
|
||||
extern uint16_t beta_cqi[16];
|
||||
|
||||
/*
|
||||
void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated )
|
||||
{
|
||||
@@ -658,8 +663,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
|
||||
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
|
||||
|
||||
//phy_init_nr_top(&ue->frame_parms);
|
||||
//nr_init_frame_parms_ue(&ue->frame_parms);
|
||||
nr_init_frame_parms_ue(&ue->frame_parms);
|
||||
phy_init_nr_top(ue);
|
||||
|
||||
// many memory allocation sizes are hard coded
|
||||
AssertFatal( fp->nb_antennas_rx <= 2, "hard coded allocation for ue_common_vars->dl_ch_estimates[eNB_id]" );
|
||||
@@ -905,8 +910,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
void nr_lte_ue_transport(PHY_VARS_UE *ue,int abstraction_flag) {
|
||||
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag) {
|
||||
|
||||
int i,j,k;
|
||||
|
||||
@@ -927,17 +933,22 @@ void nr_lte_ue_transport(PHY_VARS_UE *ue,int abstraction_flag) {
|
||||
ue->transmission_mode[i] = ue->frame_parms.nb_antenna_ports_eNB==1 ? 1 : 2;
|
||||
}
|
||||
|
||||
ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
//ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
|
||||
ue->dlsch_MCH[0] = new_ue_dlsch(1,NUMBER_OF_HARQ_PID_MAX,NSOFT,MAX_TURBO_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL,0);
|
||||
|
||||
}*/
|
||||
|
||||
void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms)
|
||||
void phy_init_nr_top(PHY_VARS_NR_UE *ue)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
NR_UE_DLSCH_t *dlsch0 = ue->dlsch[0][0][0];
|
||||
dlsch0 =(NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t));
|
||||
|
||||
crcTableInit();
|
||||
|
||||
init_dfts();
|
||||
|
||||
ccodedot11_init();
|
||||
ccodedot11_init_inv();
|
||||
|
||||
@@ -960,7 +971,12 @@ void phy_init_nr_top(NR_DL_FRAME_PARMS *frame_parms)
|
||||
generate_ul_reference_signal_sequences(SHRT_MAX);
|
||||
|
||||
// Polar encoder init for PBCH
|
||||
nr_polar_init(&frame_parms->pbch_polar_params, 1);
|
||||
//nr_polar_init(&frame_parms->pbch_polar_params, 1);
|
||||
/*t_nrPolar_paramsPtr nrPolar_params = NULL, currentPtr = NULL;
|
||||
nr_polar_init(&ue->nrPolar_params,
|
||||
NR_POLAR_PBCH_MESSAGE_TYPE,
|
||||
NR_POLAR_PBCH_PAYLOAD_BITS,
|
||||
NR_POLAR_PBCH_AGGREGATION_LEVEL);*/
|
||||
|
||||
//lte_sync_time_init(frame_parms);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
|
||||
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, N_RB, Ncp);
|
||||
#endif
|
||||
|
||||
if (Ncp == EXTENDED)
|
||||
if (Ncp == NFAPI_CP_EXTENDED)
|
||||
AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu);
|
||||
|
||||
switch(mu) {
|
||||
@@ -139,7 +139,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
|
||||
AssertFatal(1==0,"Invalid numerology index %d", mu);
|
||||
}
|
||||
|
||||
|
||||
frame_parms->slots_per_frame = 10* frame_parms->slots_per_subframe;
|
||||
frame_parms->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
frame_parms->samples_per_subframe_wCP = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_slot * frame_parms->slots_per_subframe;
|
||||
frame_parms->samples_per_frame_wCP = 10 * frame_parms->samples_per_subframe_wCP;
|
||||
@@ -148,6 +148,14 @@ int nr_init_frame_parms(nfapi_nr_config_request_t* config,
|
||||
frame_parms->samples_per_frame = 10 * frame_parms->samples_per_subframe;
|
||||
frame_parms->freq_range = (frame_parms->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2;
|
||||
|
||||
// Initial bandwidth part configuration -- full carrier bandwidth
|
||||
frame_parms->initial_bwp_dl.bwp_id = 0;
|
||||
frame_parms->initial_bwp_dl.scs = frame_parms->subcarrier_spacing;
|
||||
frame_parms->initial_bwp_dl.location = 0;
|
||||
frame_parms->initial_bwp_dl.N_RB = N_RB;
|
||||
frame_parms->initial_bwp_dl.cyclic_prefix = Ncp;
|
||||
frame_parms->initial_bwp_dl.ofdm_symbol_size = frame_parms->ofdm_symbol_size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -276,6 +284,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms)
|
||||
frame_parms->samples_per_subframe = 30720 * frame_parms->ttis_per_subframe;
|
||||
//frame_parms->first_carrier_offset = 2048-600;
|
||||
|
||||
frame_parms->slots_per_frame = 10* frame_parms->slots_per_subframe;
|
||||
frame_parms->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
frame_parms->samples_per_subframe_wCP = frame_parms->ofdm_symbol_size * frame_parms->symbols_per_slot * frame_parms->slots_per_subframe;
|
||||
frame_parms->samples_per_frame_wCP = 10 * frame_parms->samples_per_subframe_wCP;
|
||||
@@ -298,4 +307,10 @@ void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms)
|
||||
LOG_I(PHY,"frame_parms->samples_per_frame_wCP=%d\n",frame_parms->samples_per_frame_wCP);
|
||||
LOG_I(PHY,"frame_parms->samples_per_subframe=%d\n",frame_parms->samples_per_subframe);
|
||||
LOG_I(PHY,"frame_parms->samples_per_frame=%d\n",frame_parms->samples_per_frame);
|
||||
LOG_I(PHY,"frame_parms->initial_bwp_dl.bwp_id=%d\n",frame_parms->initial_bwp_dl.bwp_id);
|
||||
LOG_I(PHY,"frame_parms->initial_bwp_dl.scs=%d\n",frame_parms->initial_bwp_dl.scs);
|
||||
LOG_I(PHY,"frame_parms->initial_bwp_dl.N_RB=%d\n",frame_parms->initial_bwp_dl.N_RB);
|
||||
LOG_I(PHY,"frame_parms->initial_bwp_dl.cyclic_prefix=%d\n",frame_parms->initial_bwp_dl.cyclic_prefix);
|
||||
LOG_I(PHY,"frame_parms->initial_bwp_dl.location=%d\n",frame_parms->initial_bwp_dl.location);
|
||||
LOG_I(PHY,"frame_parms->initial_bwp_dl.ofdm_symbol_size=%d\n",frame_parms->initial_bwp_dl.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ int l1_north_init_eNB(void);
|
||||
*/
|
||||
int phy_init_top(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
void phy_init_nr_top(PHY_VARS_NR_UE *ue);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Allocate and Initialize the PHY variables relevant to the LTE ue signal buffers.
|
||||
|
||||
@@ -224,7 +224,12 @@ void fill_pdcch_order(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_a
|
||||
proc->frame_tx, proc->subframe_tx, rel8->rnti);
|
||||
}
|
||||
|
||||
void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,DCI_ALLOC_t *dci_alloc,nfapi_dl_config_dci_dl_pdu *pdu)
|
||||
void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
|
||||
int frame,
|
||||
int subframe,
|
||||
eNB_rxtx_proc_t *proc,
|
||||
DCI_ALLOC_t *dci_alloc,
|
||||
nfapi_dl_config_dci_dl_pdu *pdu)
|
||||
{
|
||||
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
|
||||
uint8_t *dci_pdu = &dci_alloc->dci_pdu[0];
|
||||
|
||||
@@ -1,748 +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
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dlsch_decoding.c
|
||||
* \brief Top-level routines for decoding Turbo-coded (DLSCH) transport channels from 36-212, V8.6 2009-03
|
||||
* \author R. Knopp
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#include "defs.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/CODING/extern.h"
|
||||
#include "SCHED/extern.h"
|
||||
#include "SIMULATION/TOOLS/defs.h"
|
||||
//#define DEBUG_DLSCH_DECODING
|
||||
//#define UE_DEBUG_TRACE 1
|
||||
|
||||
|
||||
void free_ue_dlsch(LTE_UE_DLSCH_t *dlsch)
|
||||
{
|
||||
|
||||
int i,r;
|
||||
|
||||
if (dlsch) {
|
||||
for (i=0; i<dlsch->Mdlharq; i++) {
|
||||
if (dlsch->harq_processes[i]) {
|
||||
if (dlsch->harq_processes[i]->b) {
|
||||
free16(dlsch->harq_processes[i]->b,MAX_DLSCH_PAYLOAD_BYTES);
|
||||
dlsch->harq_processes[i]->b = NULL;
|
||||
}
|
||||
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++) {
|
||||
free16(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
|
||||
dlsch->harq_processes[i]->c[r] = NULL;
|
||||
}
|
||||
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS; r++)
|
||||
if (dlsch->harq_processes[i]->d[r]) {
|
||||
free16(dlsch->harq_processes[i]->d[r],((3*8*6144)+12+96)*sizeof(short));
|
||||
dlsch->harq_processes[i]->d[r] = NULL;
|
||||
}
|
||||
|
||||
free16(dlsch->harq_processes[i],sizeof(LTE_DL_UE_HARQ_t));
|
||||
dlsch->harq_processes[i] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free16(dlsch,sizeof(LTE_UE_DLSCH_t));
|
||||
dlsch = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t max_turbo_iterations,uint8_t N_RB_DL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_UE_DLSCH_t *dlsch;
|
||||
uint8_t exit_flag = 0,i,r;
|
||||
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
switch (N_RB_DL) {
|
||||
case 6:
|
||||
bw_scaling =16;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
bw_scaling =4;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
bw_scaling =2;
|
||||
break;
|
||||
|
||||
default:
|
||||
bw_scaling =1;
|
||||
break;
|
||||
}
|
||||
|
||||
dlsch = (LTE_UE_DLSCH_t *)malloc16(sizeof(LTE_UE_DLSCH_t));
|
||||
|
||||
if (dlsch) {
|
||||
memset(dlsch,0,sizeof(LTE_UE_DLSCH_t));
|
||||
dlsch->Kmimo = Kmimo;
|
||||
dlsch->Mdlharq = Mdlharq;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
dlsch->max_turbo_iterations = max_turbo_iterations;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
// printf("new_ue_dlsch: Harq process %d\n",i);
|
||||
dlsch->harq_processes[i] = (LTE_DL_UE_HARQ_t *)malloc16(sizeof(LTE_DL_UE_HARQ_t));
|
||||
|
||||
if (dlsch->harq_processes[i]) {
|
||||
memset(dlsch->harq_processes[i],0,sizeof(LTE_DL_UE_HARQ_t));
|
||||
dlsch->harq_processes[i]->first_tx=1;
|
||||
dlsch->harq_processes[i]->b = (uint8_t*)malloc16(MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
|
||||
if (dlsch->harq_processes[i]->b)
|
||||
memset(dlsch->harq_processes[i]->b,0,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
else
|
||||
exit_flag=3;
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
for (r=0; r<MAX_NUM_DLSCH_SEGMENTS/bw_scaling; r++) {
|
||||
dlsch->harq_processes[i]->c[r] = (uint8_t*)malloc16(((r==0)?8:0) + 3+ 768);
|
||||
|
||||
if (dlsch->harq_processes[i]->c[r])
|
||||
memset(dlsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+ 768);
|
||||
else
|
||||
exit_flag=2;
|
||||
|
||||
dlsch->harq_processes[i]->d[r] = (short*)malloc16(((3*8*6144)+12+96)*sizeof(short));
|
||||
|
||||
if (dlsch->harq_processes[i]->d[r])
|
||||
memset(dlsch->harq_processes[i]->d[r],0,((3*8*6144)+12+96)*sizeof(short));
|
||||
else
|
||||
exit_flag=2;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
exit_flag=1;
|
||||
}
|
||||
}
|
||||
|
||||
if (exit_flag==0)
|
||||
return(dlsch);
|
||||
}
|
||||
|
||||
printf("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(LTE_DL_UE_HARQ_t), exit_flag);
|
||||
free_ue_dlsch(dlsch);
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
short *dlsch_llr,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
LTE_UE_DLSCH_t *dlsch,
|
||||
LTE_DL_UE_HARQ_t *harq_process,
|
||||
uint32_t frame,
|
||||
uint8_t subframe,
|
||||
uint8_t harq_pid,
|
||||
uint8_t is_crnti,
|
||||
uint8_t llr8_flag)
|
||||
{
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats;
|
||||
time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats;
|
||||
time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats;
|
||||
#endif
|
||||
uint32_t A,E;
|
||||
uint32_t G;
|
||||
uint32_t ret,offset;
|
||||
uint16_t iind;
|
||||
// uint8_t dummy_channel_output[(3*8*block_length)+12];
|
||||
short dummy_w[MAX_NUM_DLSCH_SEGMENTS][3*(6144+64)];
|
||||
uint32_t r,r_offset=0,Kr,Kr_bytes,err_flag=0;
|
||||
uint8_t crc_type;
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
uint16_t i;
|
||||
#endif
|
||||
//#ifdef __AVX2__
|
||||
#if 0
|
||||
int Kr_last,skipped_last=0;
|
||||
uint8_t (*tc_2cw)(int16_t *y,
|
||||
int16_t *y2,
|
||||
uint8_t *,
|
||||
uint8_t *,
|
||||
uint16_t,
|
||||
uint16_t,
|
||||
uint16_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
uint8_t,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *,
|
||||
time_stats_t *);
|
||||
|
||||
#endif
|
||||
decoder_if_t tc;
|
||||
|
||||
|
||||
|
||||
|
||||
if (!dlsch_llr) {
|
||||
printf("dlsch_decoding.c: NULL dlsch_llr pointer\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (!harq_process) {
|
||||
printf("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (!frame_parms) {
|
||||
printf("dlsch_decoding.c: NULL frame_parms pointer\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (subframe>9) {
|
||||
printf("dlsch_decoding.c: Illegal subframe index %d\n",subframe);
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
if (dlsch->harq_ack[subframe].ack != 2) {
|
||||
LOG_D(PHY, "[UE %d] DLSCH @ SF%d : ACK bit is %d instead of DTX even before PDSCH is decoded!\n",
|
||||
phy_vars_ue->Mod_id, subframe, dlsch->harq_ack[subframe].ack);
|
||||
}
|
||||
|
||||
if (llr8_flag == 0) {
|
||||
//#ifdef __AVX2__
|
||||
#if 0
|
||||
tc_2cw = phy_threegpplte_turbo_decoder16avx2;
|
||||
#endif
|
||||
tc = decoder16;
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertFatal (harq_process->TBS >= 256 , "Mismatch flag nbRB=%d TBS=%d mcs=%d Qm=%d RIV=%d round=%d \n",
|
||||
harq_process->nb_rb, harq_process->TBS,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
|
||||
tc = decoder8;
|
||||
}
|
||||
|
||||
|
||||
// nb_rb = dlsch->nb_rb;
|
||||
|
||||
/*
|
||||
if (nb_rb > frame_parms->N_RB_DL) {
|
||||
printf("dlsch_decoding.c: Illegal nb_rb %d\n",nb_rb);
|
||||
return(max_turbo_iterations);
|
||||
}*/
|
||||
|
||||
/*harq_pid = dlsch->current_harq_pid[phy_vars_ue->current_thread_id[subframe]];
|
||||
if (harq_pid >= 8) {
|
||||
printf("dlsch_decoding.c: Illegal harq_pid %d\n",harq_pid);
|
||||
return(max_turbo_iterations);
|
||||
}
|
||||
*/
|
||||
|
||||
harq_process->trials[harq_process->round]++;
|
||||
|
||||
A = harq_process->TBS; //2072 for QPSK 1/3
|
||||
|
||||
ret = dlsch->max_turbo_iterations;
|
||||
|
||||
|
||||
G = harq_process->G;
|
||||
//get_G(frame_parms,nb_rb,dlsch->rb_alloc,mod_order,num_pdcch_symbols,phy_vars_ue->frame,subframe);
|
||||
|
||||
// printf("DLSCH Decoding, harq_pid %d Ndi %d\n",harq_pid,harq_process->Ndi);
|
||||
|
||||
if (harq_process->round == 0) {
|
||||
// This is a new packet, so compute quantities regarding segmentation
|
||||
harq_process->B = A+24;
|
||||
lte_segmentation(NULL,
|
||||
NULL,
|
||||
harq_process->B,
|
||||
&harq_process->C,
|
||||
&harq_process->Cplus,
|
||||
&harq_process->Cminus,
|
||||
&harq_process->Kplus,
|
||||
&harq_process->Kminus,
|
||||
&harq_process->F);
|
||||
// CLEAR LLR's HERE for first packet in process
|
||||
}
|
||||
|
||||
/*
|
||||
else {
|
||||
printf("dlsch_decoding.c: Ndi>0 not checked yet!!\n");
|
||||
return(max_turbo_iterations);
|
||||
}
|
||||
*/
|
||||
err_flag = 0;
|
||||
r_offset = 0;
|
||||
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
switch (frame_parms->N_RB_DL) {
|
||||
case 6:
|
||||
bw_scaling =16;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
bw_scaling =4;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
bw_scaling =2;
|
||||
break;
|
||||
|
||||
default:
|
||||
bw_scaling =1;
|
||||
break;
|
||||
}
|
||||
|
||||
if (harq_process->C > MAX_NUM_DLSCH_SEGMENTS/bw_scaling) {
|
||||
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,MAX_NUM_DLSCH_SEGMENTS/bw_scaling);
|
||||
return((1+dlsch->max_turbo_iterations));
|
||||
}
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("Segmentation: C %d, Cminus %d, Kminus %d, Kplus %d\n",harq_process->C,harq_process->Cminus,harq_process->Kminus,harq_process->Kplus);
|
||||
#endif
|
||||
|
||||
opp_enabled=1;
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
|
||||
// Get Turbo interleaver parameters
|
||||
if (r<harq_process->Cminus)
|
||||
Kr = harq_process->Kminus;
|
||||
else
|
||||
Kr = harq_process->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
printf("dlsch_decoding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
return(dlsch->max_turbo_iterations);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("f1 %d, f2 %d, F %d\n",f1f2mat_old[2*iind],f1f2mat_old[1+(2*iind)],(r==0) ? harq_process->F : 0);
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_rate_unmatching_stats);
|
||||
#endif
|
||||
memset(&dummy_w[r][0],0,3*(6144+64)*sizeof(short));
|
||||
harq_process->RTC[r] = generate_dummy_w(4+(Kr_bytes*8),
|
||||
(uint8_t*) &dummy_w[r][0],
|
||||
(r==0) ? harq_process->F : 0);
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
|
||||
harq_pid,r, G,
|
||||
Kr*3,
|
||||
harq_process->TBS,
|
||||
harq_process->Qm,
|
||||
harq_process->nb_rb,
|
||||
harq_process->Nl,
|
||||
harq_process->rvidx,
|
||||
harq_process->round);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf(" in decoding dlsch->harq_processes[harq_pid]->rvidx = %d\n", dlsch->harq_processes[harq_pid]->rvidx);
|
||||
#endif
|
||||
if (lte_rate_matching_turbo_rx(harq_process->RTC[r],
|
||||
G,
|
||||
harq_process->w[r],
|
||||
(uint8_t*)&dummy_w[r][0],
|
||||
dlsch_llr+r_offset,
|
||||
harq_process->C,
|
||||
dlsch->Nsoft,
|
||||
dlsch->Mdlharq,
|
||||
dlsch->Kmimo,
|
||||
harq_process->rvidx,
|
||||
(harq_process->round==0)?1:0,
|
||||
harq_process->Qm,
|
||||
harq_process->Nl,
|
||||
r,
|
||||
&E)==-1) {
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_rate_unmatching_stats);
|
||||
#endif
|
||||
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
|
||||
return(dlsch->max_turbo_iterations);
|
||||
} else
|
||||
{
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_rate_unmatching_stats);
|
||||
#endif
|
||||
}
|
||||
r_offset += E;
|
||||
|
||||
/*
|
||||
printf("Subblock deinterleaving, d %p w %p\n",
|
||||
harq_process->d[r],
|
||||
harq_process->w);
|
||||
*/
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_deinterleaving_stats);
|
||||
#endif
|
||||
sub_block_deinterleaving_turbo(4+Kr,
|
||||
&harq_process->d[r][96],
|
||||
|
||||
harq_process->w[r]);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_deinterleaving_stats);
|
||||
#endif
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
/*
|
||||
if (r==0) {
|
||||
write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
||||
write_output("decoder_in.m","dec",&harq_process->d[0][96],(3*8*Kr_bytes)+12,1,0);
|
||||
}
|
||||
|
||||
printf("decoder input(segment %d) :",r);
|
||||
int i; for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
printf("%d : %d\n",i,harq_process->d[r][96+i]);
|
||||
printf("\n");*/
|
||||
#endif
|
||||
|
||||
|
||||
// printf("Clearing c, %p\n",harq_process->c[r]);
|
||||
memset(harq_process->c[r],0,Kr_bytes);
|
||||
|
||||
// printf("done\n");
|
||||
if (harq_process->C == 1)
|
||||
crc_type = CRC24_A;
|
||||
else
|
||||
crc_type = CRC24_B;
|
||||
|
||||
/*
|
||||
printf("decoder input(segment %d)\n",r);
|
||||
for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
if ((harq_process->d[r][96+i]>7) ||
|
||||
(harq_process->d[r][96+i] < -8))
|
||||
printf("%d : %d\n",i,harq_process->d[r][96+i]);
|
||||
printf("\n");
|
||||
*/
|
||||
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
if (err_flag == 0) {
|
||||
/*
|
||||
LOG_I(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d crc_type %d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
|
||||
Kr,r,harq_process->C,harq_process->nb_rb,crc_type,A,harq_process->TBS,
|
||||
harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_turbo_iterations);
|
||||
*/
|
||||
if (llr8_flag) {
|
||||
AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
|
||||
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
|
||||
}
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
LOG_D(PHY,"AbsSubframe %d.%d Start turbo segment %d/%d \n",frame%1024,subframe,r,harq_process->C-1);
|
||||
ret = tc
|
||||
(&harq_process->d[r][96],
|
||||
NULL,
|
||||
harq_process->c[r],
|
||||
NULL,
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
if ((harq_process->C == 1) ||
|
||||
((r==harq_process->C-1) && (skipped_last==0))) { // last segment with odd number of segments
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
ret = tc
|
||||
(&harq_process->d[r][96],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
// printf("single decode, exit\n");
|
||||
// exit(-1);
|
||||
}
|
||||
else {
|
||||
// we can merge code segments
|
||||
if ((skipped_last == 0) && (r<harq_process->C-1)) {
|
||||
skipped_last = 1;
|
||||
Kr_last = Kr;
|
||||
}
|
||||
else {
|
||||
skipped_last=0;
|
||||
|
||||
if (Kr_last == Kr) { // decode 2 code segments with AVX2 version
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("single decoding segment %d (%p)\n",r-1,&harq_process->d[r-1][96]);
|
||||
#endif
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("double decoding segments %d,%d (%p,%p)\n",r-1,r,&harq_process->d[r-1][96],&harq_process->d[r][96]);
|
||||
#endif
|
||||
ret = tc_2cw
|
||||
(&harq_process->d[r-1][96],
|
||||
&harq_process->d[r][96],
|
||||
harq_process->c[r-1],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
/*
|
||||
ret = tc
|
||||
(&harq_process->d[r-1][96],
|
||||
harq_process->c[r-1],
|
||||
Kr_last,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
|
||||
exit(-1);*/
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
}
|
||||
else { // Kr_last != Kr
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
ret = tc
|
||||
(&harq_process->d[r-1][96],
|
||||
harq_process->c[r-1],
|
||||
Kr_last,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
|
||||
start_meas(dlsch_turbo_decoding_stats);
|
||||
#endif
|
||||
|
||||
ret = tc
|
||||
(&harq_process->d[r][96],
|
||||
harq_process->c[r],
|
||||
Kr,
|
||||
f1f2mat_old[iind*2],
|
||||
f1f2mat_old[(iind*2)+1],
|
||||
dlsch->max_turbo_iterations,
|
||||
crc_type,
|
||||
(r==0) ? harq_process->F : 0,
|
||||
&phy_vars_ue->dlsch_tc_init_stats,
|
||||
&phy_vars_ue->dlsch_tc_alpha_stats,
|
||||
&phy_vars_ue->dlsch_tc_beta_stats,
|
||||
&phy_vars_ue->dlsch_tc_gamma_stats,
|
||||
&phy_vars_ue->dlsch_tc_ext_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl1_stats,
|
||||
&phy_vars_ue->dlsch_tc_intl2_stats); //(is_crnti==0)?harq_pid:harq_pid+1);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
|
||||
stop_meas(dlsch_turbo_decoding_stats);
|
||||
|
||||
/*printf("Segmentation: C %d r %d, dlsch_rate_unmatching_stats %5.3f dlsch_deinterleaving_stats %5.3f dlsch_turbo_decoding_stats %5.3f \n",
|
||||
harq_process->C,
|
||||
r,
|
||||
dlsch_rate_unmatching_stats->p_time/(cpuf*1000.0),
|
||||
dlsch_deinterleaving_stats->p_time/(cpuf*1000.0),
|
||||
dlsch_turbo_decoding_stats->p_time/(cpuf*1000.0));*/
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if ((err_flag == 0) && (ret>=(1+dlsch->max_turbo_iterations))) {// a Code segment is in error so break;
|
||||
LOG_D(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,subframe,r,harq_process->C-1);
|
||||
err_flag = 1;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t frame_rx_prev = frame;
|
||||
int32_t subframe_rx_prev = subframe - 1;
|
||||
if (subframe_rx_prev < 0) {
|
||||
frame_rx_prev--;
|
||||
subframe_rx_prev += 10;
|
||||
}
|
||||
frame_rx_prev = frame_rx_prev%1024;
|
||||
|
||||
if (err_flag == 1) {
|
||||
#if UE_DEBUG_TRACE
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
#endif
|
||||
dlsch->harq_ack[subframe].ack = 0;
|
||||
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
||||
dlsch->harq_ack[subframe].send_harq_status = 1;
|
||||
harq_process->errors[harq_process->round]++;
|
||||
harq_process->round++;
|
||||
|
||||
|
||||
// printf("Rate: [UE %d] DLSCH: Setting NACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
|
||||
if (harq_process->round >= dlsch->Mdlharq) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
}
|
||||
if(is_crnti)
|
||||
{
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting NACK for subframe %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->status,harq_process->round,dlsch->Mdlharq,harq_process->TBS);
|
||||
}
|
||||
|
||||
return((1+dlsch->max_turbo_iterations));
|
||||
} else {
|
||||
#if UE_DEBUG_TRACE
|
||||
LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d mcs %d nb_rb %d\n",
|
||||
phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb);
|
||||
#endif
|
||||
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
dlsch->harq_ack[subframe].ack = 1;
|
||||
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
||||
dlsch->harq_ack[subframe].send_harq_status = 1;
|
||||
//LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
|
||||
// phy_vars_ue->Mod_id, frame, subframe, harq_pid, harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs);
|
||||
|
||||
if(is_crnti)
|
||||
{
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d, TBS %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round,harq_process->TBS);
|
||||
}
|
||||
//LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d (pid %d, round %d)\n",phy_vars_ue->Mod_id,subframe,harq_pid,harq_process->round);
|
||||
|
||||
}
|
||||
|
||||
// Reassembly of Transport block here
|
||||
offset = 0;
|
||||
|
||||
/*
|
||||
printf("harq_pid %d\n",harq_pid);
|
||||
printf("F %d, Fbytes %d\n",harq_process->F,harq_process->F>>3);
|
||||
printf("C %d\n",harq_process->C);
|
||||
*/
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
if (r<harq_process->Cminus)
|
||||
Kr = harq_process->Kminus;
|
||||
else
|
||||
Kr = harq_process->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// printf("Segment %d : Kr= %d bytes\n",r,Kr_bytes);
|
||||
if (r==0) {
|
||||
memcpy(harq_process->b,
|
||||
&harq_process->c[0][(harq_process->F>>3)],
|
||||
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);
|
||||
// printf("copied %d bytes to b sequence (harq_pid %d)\n",
|
||||
// Kr_bytes - (harq_process->F>>3),harq_pid);
|
||||
// printf("b[0] = %x,c[%d] = %x\n",
|
||||
// harq_process->b[0],
|
||||
// harq_process->F>>3,
|
||||
// harq_process->c[0][(harq_process->F>>3)]);
|
||||
} else {
|
||||
memcpy(harq_process->b+offset,
|
||||
harq_process->c[r],
|
||||
Kr_bytes- ((harq_process->C>1)?3:0));
|
||||
offset += (Kr_bytes - ((harq_process->C>1)?3:0));
|
||||
}
|
||||
}
|
||||
|
||||
dlsch->last_iteration_cnt = ret;
|
||||
|
||||
return(ret);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,173 +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
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/drs_modulation.c
|
||||
* \brief Top-level routines for generating the Demodulation Reference Signals from 36-211, V8.6 2009-03
|
||||
* \author R. Knopp, F. Kaltenberger, A. Bhamri
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,ankit.bhamri@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
//#define DEBUG_DRS
|
||||
|
||||
int generate_drs_pusch(PHY_VARS_UE *ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id,
|
||||
short amp,
|
||||
unsigned int subframe,
|
||||
unsigned int first_rb,
|
||||
unsigned int nb_rb,
|
||||
uint8_t ant)
|
||||
{
|
||||
|
||||
uint16_t k,l,Msc_RS,Msc_RS_idx,rb,drs_offset;
|
||||
uint16_t * Msc_idx_ptr;
|
||||
int subframe_offset,re_offset,symbol_offset;
|
||||
|
||||
//uint32_t phase_shift; // phase shift for cyclic delay in DM RS
|
||||
//uint8_t alpha_ind;
|
||||
|
||||
int16_t alpha_re[12] = {32767, 28377, 16383, 0,-16384, -28378,-32768,-28378,-16384, -1, 16383, 28377};
|
||||
int16_t alpha_im[12] = {0, 16383, 28377, 32767, 28377, 16383, 0,-16384,-28378,-32768,-28378,-16384};
|
||||
|
||||
uint8_t cyclic_shift,cyclic_shift0,cyclic_shift1;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int32_t *txdataF = ue->common_vars.txdataF[ant];
|
||||
uint32_t u,v,alpha_ind;
|
||||
uint32_t u0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[subframe<<1];
|
||||
uint32_t u1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.grouphop[1+(subframe<<1)];
|
||||
uint32_t v0=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[subframe<<1];
|
||||
uint32_t v1=frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.seqhop[1+(subframe<<1)];
|
||||
int32_t ref_re,ref_im;
|
||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,proc->frame_tx,subframe);
|
||||
|
||||
cyclic_shift0 = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]+
|
||||
((ue->ulsch[0]->cooperation_flag==2)?10:0)+
|
||||
ant*6) % 12;
|
||||
// printf("PUSCH.cyclicShift %d, n_DMRS2 %d, nPRS %d\n",frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift,ue->ulsch[eNB_id]->n_DMRS2,ue->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe<<1]);
|
||||
cyclic_shift1 = (frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->n_DMRS2 +
|
||||
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+1]+
|
||||
((ue->ulsch[0]->cooperation_flag==2)?10:0)+
|
||||
ant*6) % 12;
|
||||
|
||||
// cyclic_shift0 = 0;
|
||||
// cyclic_shift1 = 0;
|
||||
Msc_RS = 12*nb_rb;
|
||||
|
||||
Msc_idx_ptr = (uint16_t*) bsearch(&Msc_RS, dftsizes, 33, sizeof(uint16_t), compareints);
|
||||
|
||||
if (Msc_idx_ptr)
|
||||
Msc_RS_idx = Msc_idx_ptr - dftsizes;
|
||||
else {
|
||||
LOG_I(PHY,"generate_drs_pusch: index for Msc_RS=%d not found\n",Msc_RS);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (l = (3 - frame_parms->Ncp),u=u0,v=v0,cyclic_shift=cyclic_shift0;
|
||||
l<frame_parms->symbols_per_tti;
|
||||
l += (7 - frame_parms->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) {
|
||||
|
||||
drs_offset = 0;
|
||||
#ifdef DEBUG_DRS
|
||||
printf("drs_modulation: Msc_RS = %d, Msc_RS_idx = %d, u=%d,v=%d\n",Msc_RS, Msc_RS_idx,u,v);
|
||||
#endif
|
||||
|
||||
|
||||
re_offset = frame_parms->first_carrier_offset;
|
||||
subframe_offset = subframe*frame_parms->symbols_per_tti*frame_parms->ofdm_symbol_size;
|
||||
symbol_offset = subframe_offset + frame_parms->ofdm_symbol_size*l;
|
||||
|
||||
|
||||
#ifdef DEBUG_DRS
|
||||
printf("generate_drs_pusch: symbol_offset %d, subframe offset %d, cyclic shift %d\n",symbol_offset,subframe_offset,cyclic_shift);
|
||||
#endif
|
||||
alpha_ind = 0;
|
||||
|
||||
for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
|
||||
|
||||
if ((rb >= first_rb) && (rb<(first_rb+nb_rb))) {
|
||||
|
||||
#ifdef DEBUG_DRS
|
||||
printf("generate_drs_pusch: doing RB %d, re_offset=%d, drs_offset=%d,cyclic shift %d\n",rb,re_offset,drs_offset,cyclic_shift);
|
||||
#endif
|
||||
|
||||
for (k=0; k<12; k++) {
|
||||
ref_re = (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][drs_offset<<1];
|
||||
ref_im = (int32_t) ul_ref_sigs[u][v][Msc_RS_idx][(drs_offset<<1)+1];
|
||||
|
||||
((int16_t*) txdataF)[2*(symbol_offset + re_offset)] = (int16_t) (((ref_re*alpha_re[alpha_ind]) -
|
||||
(ref_im*alpha_im[alpha_ind]))>>15);
|
||||
((int16_t*) txdataF)[2*(symbol_offset + re_offset)+1] = (int16_t) (((ref_re*alpha_im[alpha_ind]) +
|
||||
(ref_im*alpha_re[alpha_ind]))>>15);
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)] = (short) ((((short*) txdataF)[2*(symbol_offset + re_offset)]*(int32_t)amp)>>15);
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)+1] = (short) ((((short*) txdataF)[2*(symbol_offset + re_offset)+1]*(int32_t)amp)>>15);
|
||||
|
||||
|
||||
alpha_ind = (alpha_ind + cyclic_shift);
|
||||
|
||||
if (alpha_ind > 11)
|
||||
alpha_ind-=12;
|
||||
|
||||
#ifdef DEBUG_DRS
|
||||
printf("symbol_offset %d, alpha_ind %d , re_offset %d : (%d,%d)\n",
|
||||
symbol_offset,
|
||||
alpha_ind,
|
||||
re_offset,
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)],
|
||||
((short*) txdataF)[2*(symbol_offset + re_offset)+1]);
|
||||
|
||||
#endif // DEBUG_DRS
|
||||
re_offset++;
|
||||
drs_offset++;
|
||||
|
||||
if (re_offset >= frame_parms->ofdm_symbol_size)
|
||||
re_offset = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
re_offset+=12; // go to next RB
|
||||
|
||||
// check if we crossed the symbol boundary and skip DC
|
||||
|
||||
if (re_offset >= frame_parms->ofdm_symbol_size) {
|
||||
if (frame_parms->N_RB_DL&1) // odd number of RBs
|
||||
re_offset=6;
|
||||
else // even number of RBs (doesn't straddle DC)
|
||||
re_offset=0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,933 +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
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/ulsch_coding.c
|
||||
* \brief Top-level routines for coding the ULSCH transport channel as described in 36.212 V8.6 2009-03
|
||||
* \author R. Knopp
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
#include "PHY/CODING/defs.h"
|
||||
#include "PHY/CODING/extern.h"
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/extern.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
//#define DEBUG_ULSCH_CODING
|
||||
//#define DEBUG_ULSCH_FREE 1
|
||||
|
||||
/*
|
||||
#define is_not_pilot(pilots,first_pilot,re) (pilots==0) || \
|
||||
((pilots==1)&&(first_pilot==1)&&(((re>2)&&(re<6))||((re>8)&&(re<12)))) || \
|
||||
((pilots==1)&&(first_pilot==0)&&(((re<3))||((re>5)&&(re<9)))) \
|
||||
*/
|
||||
#define is_not_pilot(pilots,first_pilot,re) (1)
|
||||
|
||||
|
||||
|
||||
|
||||
void free_ue_ulsch(LTE_UE_ULSCH_t *ulsch)
|
||||
{
|
||||
int i;
|
||||
int r;
|
||||
|
||||
if (ulsch) {
|
||||
#ifdef DEBUG_ULSCH_FREE
|
||||
printf("Freeing ulsch %p\n",ulsch);
|
||||
#endif
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
if (ulsch->harq_processes[i]) {
|
||||
if (ulsch->harq_processes[i]->b) {
|
||||
free16(ulsch->harq_processes[i]->b,MAX_ULSCH_PAYLOAD_BYTES);
|
||||
ulsch->harq_processes[i]->b = NULL;
|
||||
}
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
if (ulsch->harq_processes[i]->c[r]) {
|
||||
free16(ulsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+768);
|
||||
ulsch->harq_processes[i]->c[r] = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
free16(ulsch->harq_processes[i],sizeof(LTE_UL_UE_HARQ_t));
|
||||
ulsch->harq_processes[i] = NULL;
|
||||
}
|
||||
}
|
||||
free16(ulsch,sizeof(LTE_UE_ULSCH_t));
|
||||
ulsch = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
LTE_UE_ULSCH_t *new_ue_ulsch(unsigned char N_RB_UL, uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
LTE_UE_ULSCH_t *ulsch;
|
||||
unsigned char exit_flag = 0,i,j,r;
|
||||
unsigned char bw_scaling =1;
|
||||
|
||||
switch (N_RB_UL) {
|
||||
case 6:
|
||||
bw_scaling =16;
|
||||
break;
|
||||
|
||||
case 25:
|
||||
bw_scaling =4;
|
||||
break;
|
||||
|
||||
case 50:
|
||||
bw_scaling =2;
|
||||
break;
|
||||
|
||||
default:
|
||||
bw_scaling =1;
|
||||
break;
|
||||
}
|
||||
|
||||
ulsch = (LTE_UE_ULSCH_t *)malloc16(sizeof(LTE_UE_ULSCH_t));
|
||||
|
||||
if (ulsch) {
|
||||
memset(ulsch,0,sizeof(LTE_UE_ULSCH_t));
|
||||
|
||||
ulsch->Mlimit = 4;
|
||||
|
||||
for (i=0; i<8; i++) {
|
||||
|
||||
ulsch->harq_processes[i] = (LTE_UL_UE_HARQ_t *)malloc16(sizeof(LTE_UL_UE_HARQ_t));
|
||||
|
||||
// printf("ulsch->harq_processes[%d] %p\n",i,ulsch->harq_processes[i]);
|
||||
if (ulsch->harq_processes[i]) {
|
||||
memset(ulsch->harq_processes[i], 0, sizeof(LTE_UL_UE_HARQ_t));
|
||||
ulsch->harq_processes[i]->b = (unsigned char*)malloc16(MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
|
||||
if (ulsch->harq_processes[i]->b)
|
||||
memset(ulsch->harq_processes[i]->b,0,MAX_ULSCH_PAYLOAD_BYTES/bw_scaling);
|
||||
else {
|
||||
LOG_E(PHY,"Can't get b\n");
|
||||
exit_flag=1;
|
||||
}
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++) {
|
||||
ulsch->harq_processes[i]->c[r] = (unsigned char*)malloc16(((r==0)?8:0) + 3+768); // account for filler in first segment and CRCs for multiple segment case
|
||||
|
||||
if (ulsch->harq_processes[i]->c[r])
|
||||
memset(ulsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+768);
|
||||
else {
|
||||
LOG_E(PHY,"Can't get c\n");
|
||||
exit_flag=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ulsch->harq_processes[i]->subframe_scheduling_flag = 0;
|
||||
ulsch->harq_processes[i]->first_tx = 1;
|
||||
} else {
|
||||
LOG_E(PHY,"Can't get harq_p %d\n",i);
|
||||
exit_flag=3;
|
||||
}
|
||||
}
|
||||
|
||||
if ((abstraction_flag == 0) && (exit_flag==0)) {
|
||||
for (i=0; i<8; i++)
|
||||
for (j=0; j<96; j++)
|
||||
for (r=0; r<MAX_NUM_ULSCH_SEGMENTS; r++)
|
||||
ulsch->harq_processes[i]->d[r][j] = LTE_NULL;
|
||||
|
||||
return(ulsch);
|
||||
} else if (abstraction_flag==1)
|
||||
return(ulsch);
|
||||
}
|
||||
|
||||
LOG_E(PHY,"new_ue_ulsch exit flag, size of %d , %zu\n",exit_flag, sizeof(LTE_UE_ULSCH_t));
|
||||
free_ue_ulsch(ulsch);
|
||||
return(NULL);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
uint32_t ulsch_encoding(uint8_t *a,
|
||||
PHY_VARS_UE *ue,
|
||||
uint8_t harq_pid,
|
||||
uint8_t eNB_id,
|
||||
uint8_t subframe_rx,
|
||||
uint8_t tmode,
|
||||
uint8_t control_only_flag,
|
||||
uint8_t Nbundled)
|
||||
{
|
||||
|
||||
time_stats_t *seg_stats=&ue->ulsch_segmentation_stats;
|
||||
time_stats_t *rm_stats=&ue->ulsch_rate_matching_stats;
|
||||
time_stats_t *te_stats=&ue->ulsch_turbo_encoding_stats;
|
||||
time_stats_t *i_stats=&ue->ulsch_interleaving_stats;
|
||||
time_stats_t *m_stats=&ue->ulsch_multiplexing_stats;
|
||||
|
||||
// uint16_t offset;
|
||||
uint32_t crc=1;
|
||||
uint16_t iind;
|
||||
uint32_t A;
|
||||
uint8_t Q_m=0;
|
||||
uint32_t Kr=0,Kr_bytes,r,r_offset=0;
|
||||
uint8_t y[6*14*1200],*yptr;;
|
||||
uint8_t *columnset;
|
||||
uint32_t sumKr=0;
|
||||
uint32_t Qprime,L,G,Q_CQI=0,Q_RI=0,Q_ACK=0,H=0,Hprime=0,Hpp=0,Cmux=0,Rmux=0,Rmux_prime=0;
|
||||
uint32_t Qprime_ACK=0,Qprime_CQI=0,Qprime_RI=0,len_ACK=0,len_RI=0;
|
||||
// uint32_t E;
|
||||
uint8_t ack_parity;
|
||||
uint32_t i,q,j,iprime,j2;
|
||||
uint16_t o_RCC;
|
||||
uint8_t o_flip[8];
|
||||
uint32_t wACK_idx;
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
PHY_MEASUREMENTS *meas = &ue->measurements;
|
||||
LTE_UE_ULSCH_t *ulsch=ue->ulsch[eNB_id];
|
||||
LTE_UE_DLSCH_t **dlsch = ue->dlsch[0][eNB_id];
|
||||
uint16_t rnti = 0xffff;
|
||||
|
||||
if (!ulsch) {
|
||||
LOG_E(PHY,"Null ulsch ptr %p\n",ulsch);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (harq_pid >= 8) {
|
||||
LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->O_ACK > 2) {
|
||||
LOG_E(PHY,"Illegal O_ACK %d\n",ulsch->harq_processes[harq_pid]->O_ACK);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
if (ulsch->O_RI > 1) {
|
||||
LOG_E(PHY,"Illegal O_RI %d\n",ulsch->O_RI);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_IN);
|
||||
|
||||
// fill CQI/PMI information
|
||||
if (ulsch->O>0) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_IN);
|
||||
rnti = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti;
|
||||
fill_CQI(ulsch,meas,0,harq_pid,ue->frame_parms.N_RB_DL,rnti, tmode,ue->sinr_eff);
|
||||
|
||||
LOG_D(PHY,"ULSCH Encoding rnti %x \n", rnti);
|
||||
print_CQI(ulsch->o,ulsch->uci_format,0,ue->frame_parms.N_RB_DL);
|
||||
|
||||
// save PUSCH pmi for later (transmission modes 4,5,6)
|
||||
if (dlsch[0]) {
|
||||
//LOG_I(PHY,"XXX saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
|
||||
dlsch[0]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING_FILL_CQI, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
if (ulsch->O<=32) {
|
||||
o_flip[0] = ulsch->o[3];
|
||||
o_flip[1] = ulsch->o[2];
|
||||
o_flip[2] = ulsch->o[1];
|
||||
o_flip[3] = ulsch->o[0];
|
||||
} else {
|
||||
o_flip[0] = ulsch->o[7];
|
||||
o_flip[1] = ulsch->o[6];
|
||||
o_flip[2] = ulsch->o[5];
|
||||
o_flip[3] = ulsch->o[4];
|
||||
o_flip[4] = ulsch->o[3];
|
||||
o_flip[5] = ulsch->o[2];
|
||||
o_flip[6] = ulsch->o[1];
|
||||
o_flip[7] = ulsch->o[0];
|
||||
}
|
||||
|
||||
if (control_only_flag == 0) {
|
||||
A=ulsch->harq_processes[harq_pid]->TBS;
|
||||
Q_m = get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs);
|
||||
|
||||
ulsch->harq_processes[harq_pid]->control_only = 0;
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("[PHY][UE] ULSCH coding : A %d, Qm %d, mcs %d, harq_pid %d, round %d, RV %d\n",
|
||||
ulsch->harq_processes[harq_pid]->TBS,
|
||||
Q_m,
|
||||
ulsch->harq_processes[harq_pid]->mcs,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->harq_processes[harq_pid]->rvidx);
|
||||
|
||||
for (i=0; i<ulsch->harq_processes[harq_pid]->O_ACK; i++)
|
||||
printf("ulsch_coding: o_ACK[%d] %d\n",i,ulsch->o_ACK[i]);
|
||||
|
||||
for (i=0; i<ulsch->O_RI; i++)
|
||||
printf("ulsch_coding: o_RI[%d] %d\n",i,ulsch->o_RI[i]);
|
||||
|
||||
printf("ulsch_coding: O=%d\n",ulsch->O);
|
||||
|
||||
for (i=0; i<1+((8+ulsch->O)/8); i++) {
|
||||
// ulsch->o[i] = i;
|
||||
printf("ulsch_coding: O[%d] %d\n",i,ulsch->o[i]);
|
||||
}
|
||||
|
||||
if ((tmode != 4))
|
||||
print_CQI(ulsch->o,wideband_cqi_rank1_2A,0,ue->frame_parms.N_RB_DL);
|
||||
else
|
||||
print_CQI(ulsch->o,HLC_subband_cqi_rank1_2A,0,ue->frame_parms.N_RB_DL);
|
||||
|
||||
#endif
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->round == 0) { // this is a new packet
|
||||
|
||||
start_meas(seg_stats);
|
||||
// Add 24-bit crc (polynomial A) to payload
|
||||
crc = crc24a(a,
|
||||
A)>>8;
|
||||
|
||||
a[A>>3] = ((uint8_t*)&crc)[2];
|
||||
a[1+(A>>3)] = ((uint8_t*)&crc)[1];
|
||||
a[2+(A>>3)] = ((uint8_t*)&crc)[0];
|
||||
|
||||
ulsch->harq_processes[harq_pid]->B = A+24;
|
||||
ulsch->harq_processes[harq_pid]->b = a;
|
||||
lte_segmentation(ulsch->harq_processes[harq_pid]->b,
|
||||
ulsch->harq_processes[harq_pid]->c,
|
||||
ulsch->harq_processes[harq_pid]->B,
|
||||
&ulsch->harq_processes[harq_pid]->C,
|
||||
&ulsch->harq_processes[harq_pid]->Cplus,
|
||||
&ulsch->harq_processes[harq_pid]->Cminus,
|
||||
&ulsch->harq_processes[harq_pid]->Kplus,
|
||||
&ulsch->harq_processes[harq_pid]->Kminus,
|
||||
&ulsch->harq_processes[harq_pid]->F);
|
||||
|
||||
stop_meas(seg_stats);
|
||||
|
||||
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
||||
if (r<ulsch->harq_processes[harq_pid]->Cminus)
|
||||
Kr = ulsch->harq_processes[harq_pid]->Kminus;
|
||||
else
|
||||
Kr = ulsch->harq_processes[harq_pid]->Kplus;
|
||||
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
// get interleaver index for Turbo code (lookup in Table 5.1.3-3 36-212, V8.6 2009-03, p. 13-14)
|
||||
if (Kr_bytes<=64)
|
||||
iind = (Kr_bytes-5);
|
||||
else if (Kr_bytes <=128)
|
||||
iind = 59 + ((Kr_bytes-64)>>1);
|
||||
else if (Kr_bytes <= 256)
|
||||
iind = 91 + ((Kr_bytes-128)>>2);
|
||||
else if (Kr_bytes <= 768)
|
||||
iind = 123 + ((Kr_bytes-256)>>3);
|
||||
else {
|
||||
LOG_E(PHY,"ulsch_coding: Illegal codeword size %d!!!\n",Kr_bytes);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Generating Code Segment %d (%d bits)\n",r,Kr);
|
||||
// generate codewords
|
||||
|
||||
printf("bits_per_codeword (Kr)= %d\n",Kr);
|
||||
printf("N_RB = %d\n",ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
printf("Ncp %d\n",frame_parms->Ncp);
|
||||
printf("Qm %d\n",Q_m);
|
||||
#endif
|
||||
|
||||
// offset=0;
|
||||
|
||||
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Encoding ... iind %d f1 %d, f2 %d\n",iind,f1f2mat_old[iind*2],f1f2mat_old[(iind*2)+1]);
|
||||
#endif
|
||||
start_meas(te_stats);
|
||||
encoder(ulsch->harq_processes[harq_pid]->c[r],
|
||||
Kr>>3,
|
||||
&ulsch->harq_processes[harq_pid]->d[r][96],
|
||||
(r==0) ? ulsch->harq_processes[harq_pid]->F : 0,
|
||||
f1f2mat_old[iind*2], // f1 (see 36212-820, page 14)
|
||||
f1f2mat_old[(iind*2)+1] // f2 (see 36212-820, page 14)
|
||||
);
|
||||
stop_meas(te_stats);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
|
||||
if (r==0)
|
||||
write_output("enc_output0.m","enc0",&ulsch->harq_processes[harq_pid]->d[r][96],(3*8*Kr_bytes)+12,1,4);
|
||||
|
||||
#endif
|
||||
start_meas(i_stats);
|
||||
ulsch->harq_processes[harq_pid]->RTC[r] =
|
||||
sub_block_interleaving_turbo(4+(Kr_bytes*8),
|
||||
&ulsch->harq_processes[harq_pid]->d[r][96],
|
||||
ulsch->harq_processes[harq_pid]->w[r]);
|
||||
stop_meas(i_stats);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->C == 0) {
|
||||
LOG_E(PHY,"null segment\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
sumKr = 0;
|
||||
|
||||
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
||||
if (r<ulsch->harq_processes[harq_pid]->Cminus)
|
||||
Kr = ulsch->harq_processes[harq_pid]->Kminus;
|
||||
else
|
||||
Kr = ulsch->harq_processes[harq_pid]->Kplus;
|
||||
|
||||
sumKr += Kr;
|
||||
}
|
||||
} else { // This is a control-only PUSCH, set sumKr to O_CQI-MIN
|
||||
ulsch->harq_processes[harq_pid]->control_only = 1;
|
||||
sumKr = ulsch->O_CQI_MIN;
|
||||
}
|
||||
|
||||
ulsch->harq_processes[harq_pid]->sumKr = sumKr;
|
||||
// Compute Q_ri (p. 23 36-212)
|
||||
|
||||
Qprime = ulsch->O_RI*ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_ri_times8;
|
||||
|
||||
if (Qprime > 0) {
|
||||
if ((Qprime % (8*sumKr)) > 0)
|
||||
Qprime = 1+(Qprime/(8*sumKr));
|
||||
else
|
||||
Qprime = Qprime/(8*sumKr);
|
||||
|
||||
if (Qprime > 4*ulsch->harq_processes[harq_pid]->nb_rb * 12)
|
||||
Qprime = 4*ulsch->harq_processes[harq_pid]->nb_rb * 12;
|
||||
}
|
||||
|
||||
Q_RI = Q_m*Qprime;
|
||||
Qprime_RI = Qprime;
|
||||
|
||||
// Compute Q_ack (p. 23 36-212)
|
||||
Qprime = ulsch->harq_processes[harq_pid]->O_ACK*ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_harqack_times8;
|
||||
|
||||
if (Qprime > 0) {
|
||||
if ((Qprime % (8*sumKr)) > 0)
|
||||
Qprime = 1+(Qprime/(8*sumKr));
|
||||
else
|
||||
Qprime = Qprime/(8*sumKr);
|
||||
|
||||
if (Qprime > 4*ulsch->harq_processes[harq_pid]->nb_rb * 12)
|
||||
Qprime = 4*ulsch->harq_processes[harq_pid]->nb_rb * 12;
|
||||
}
|
||||
|
||||
Q_ACK = Qprime * Q_m;
|
||||
Qprime_ACK = Qprime;
|
||||
|
||||
LOG_D(PHY,"UE (%x/%d) O_ACK %d, Mcs_initial %d, Nsymb_initial %d, beta_offset_harqack*8 %d, sum Kr %d, Qprime_ACK %d, Q_ACK %d\n",
|
||||
rnti, harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK,
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial,
|
||||
ulsch->harq_processes[harq_pid]->Nsymb_initial,
|
||||
ulsch->beta_offset_harqack_times8,
|
||||
sumKr,
|
||||
Qprime_ACK,
|
||||
Q_ACK);
|
||||
|
||||
// Compute Q_cqi, assume O>11, p. 26 36-212
|
||||
if (control_only_flag == 0) {
|
||||
|
||||
if (ulsch->O < 12)
|
||||
L=0;
|
||||
else
|
||||
L=8;
|
||||
|
||||
if (ulsch->O > 0)
|
||||
Qprime = (ulsch->O + L) * ulsch->harq_processes[harq_pid]->Msc_initial*ulsch->harq_processes[harq_pid]->Nsymb_initial * ulsch->beta_offset_cqi_times8;
|
||||
else
|
||||
Qprime = 0;
|
||||
|
||||
if (Qprime > 0) {
|
||||
if ((Qprime % (8*sumKr)) > 0)
|
||||
Qprime = 1+(Qprime/(8*sumKr));
|
||||
else
|
||||
Qprime = Qprime/(8*sumKr);
|
||||
}
|
||||
|
||||
G = ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch);
|
||||
|
||||
if (Qprime > (G - ulsch->O_RI))
|
||||
Qprime = G - ulsch->O_RI;
|
||||
|
||||
Q_CQI = Q_m * Qprime;
|
||||
Qprime_CQI = Qprime;
|
||||
|
||||
|
||||
|
||||
G = G - Q_RI - Q_CQI;
|
||||
ulsch->harq_processes[harq_pid]->G = G;
|
||||
|
||||
/*
|
||||
LOG_I(PHY,"ULSCH Encoding G %d, Q_RI %d (O_RI%d, Msc_initial %d, Nsymb_initial%d, beta_offset_ri_times8 %d), Q_CQI %d, Q_ACK %d \n",G,Q_RI,ulsch->O_RI,ulsch->harq_processes[harq_pid]->Msc_initial,ulsch->harq_processes[harq_pid]->Nsymb_initial,ulsch->beta_offset_ri_times8,Q_CQI,Q_ACK);
|
||||
|
||||
LOG_I(PHY,"ULSCH Encoding (Nid_cell %d, rnti %x): harq_pid %d round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d\n",
|
||||
frame_parms->Nid_cell,ulsch->rnti,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->harq_processes[harq_pid]->rvidx,
|
||||
ulsch->harq_processes[harq_pid]->mcs,
|
||||
ulsch->O_RI,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK,
|
||||
G);
|
||||
*/
|
||||
|
||||
if ((int)G < 0) {
|
||||
LOG_E(PHY,"FATAL: ulsch_coding.c G < 0 (%d) : Q_RI %d, Q_CQI %d, O %d, betaCQI_times8 %d)\n",G,Q_RI,Q_CQI,ulsch->O,ulsch->beta_offset_cqi_times8);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
// Data and control multiplexing (5.2.2.7 36-212)
|
||||
|
||||
H = G + Q_CQI;
|
||||
Hprime = H/Q_m;
|
||||
|
||||
|
||||
|
||||
// Fill in the "e"-sequence from 36-212, V8.6 2009-03, p. 16-17 (for each "e") and concatenate the
|
||||
// outputs for each code segment, see Section 5.1.5 p.20
|
||||
|
||||
for (r=0; r<ulsch->harq_processes[harq_pid]->C; r++) {
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Rate Matching, Code segment %d (coded bits (G) %d,unpunctured/repeated bits per code segment %d,mod_order %d, nb_rb %d)...\n",
|
||||
r,
|
||||
G,
|
||||
Kr*3,
|
||||
Q_m,ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
#endif
|
||||
|
||||
start_meas(rm_stats);
|
||||
r_offset += lte_rate_matching_turbo(ulsch->harq_processes[harq_pid]->RTC[r],
|
||||
G,
|
||||
ulsch->harq_processes[harq_pid]->w[r],
|
||||
ulsch->e+r_offset,
|
||||
ulsch->harq_processes[harq_pid]->C, // C
|
||||
NSOFT, // Nsoft,
|
||||
0, // this means UL
|
||||
1,
|
||||
ulsch->harq_processes[harq_pid]->rvidx,
|
||||
get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs),
|
||||
1,
|
||||
r,
|
||||
ulsch->harq_processes[harq_pid]->nb_rb);
|
||||
//ulsch->harq_processes[harq_pid]->mcs); // r
|
||||
stop_meas(rm_stats);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
|
||||
if (r==ulsch->harq_processes[harq_pid]->C-1)
|
||||
write_output("enc_output.m","enc",ulsch->e,r_offset,1,4);
|
||||
|
||||
#endif
|
||||
}
|
||||
} else { //control-only PUSCH
|
||||
Q_CQI = (ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch)) - Q_RI;
|
||||
H = Q_CQI;
|
||||
Hprime = H/Q_m;
|
||||
}
|
||||
|
||||
|
||||
// Do CQI coding
|
||||
if ((ulsch->O>1) && (ulsch->O < 12)) {
|
||||
LOG_E(PHY,"short CQI sizes not supported yet\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
} else {
|
||||
// add 8-bit CRC
|
||||
crc = crc8(o_flip,
|
||||
ulsch->O)>>24;
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("crc(cqi) tx : %x\n",crc);
|
||||
#endif
|
||||
memset((void *)&ulsch->o_d[0],LTE_NULL,96);
|
||||
|
||||
ccodelte_encode(ulsch->O,
|
||||
1,
|
||||
o_flip,
|
||||
&ulsch->o_d[96],
|
||||
0);
|
||||
|
||||
|
||||
o_RCC = sub_block_interleaving_cc(8+ulsch->O,
|
||||
&ulsch->o_d[96],
|
||||
ulsch->o_w);
|
||||
|
||||
lte_rate_matching_cc(o_RCC,
|
||||
Q_CQI,
|
||||
ulsch->o_w,
|
||||
ulsch->q);
|
||||
|
||||
}
|
||||
|
||||
i=0;
|
||||
|
||||
// Do RI coding
|
||||
if (ulsch->O_RI == 1) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//ulsch->o_RI[0];
|
||||
len_RI=2;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//1;
|
||||
ulsch->q_RI[2] = PUSCH_x;//ulsch->o_RI[0];
|
||||
ulsch->q_RI[3] = PUSCH_x;//1;
|
||||
len_RI=4;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch->q_RI[0] = ulsch->o_RI[0];
|
||||
ulsch->q_RI[1] = PUSCH_y;//1;
|
||||
ulsch->q_RI[2] = PUSCH_x;//1;
|
||||
ulsch->q_RI[3] = PUSCH_x;//ulsch->o_RI[0];
|
||||
ulsch->q_RI[4] = PUSCH_x;//1;
|
||||
ulsch->q_RI[5] = PUSCH_x;//1;
|
||||
len_RI=6;
|
||||
break;
|
||||
}
|
||||
} else if (ulsch->O_RI>1) {
|
||||
LOG_E(PHY,"RI cannot be more than 1 bit yet\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// Do ACK coding, Section 5.2.2.6 36.213 (p.23-24 in v8.6)
|
||||
wACK_idx = (ulsch->bundling==0) ? 4 : ((Nbundled-1)&3);
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("ulsch_coding.c: Bundling %d, Nbundled %d, wACK_idx %d\n",
|
||||
ulsch->bundling,Nbundled,wACK_idx);
|
||||
#endif
|
||||
|
||||
// 1-bit ACK/NAK
|
||||
if (ulsch->harq_processes[harq_pid]->O_ACK == 1) {
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);//ulsch->o_ACK[0];
|
||||
len_ACK = 2;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
len_ACK = 4;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->bundling==0)? PUSCH_y : ((ulsch->o_ACK[0]+wACK[wACK_idx][1])&1);
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
ulsch->q_ACK[4] = PUSCH_x;
|
||||
ulsch->q_ACK[6] = PUSCH_x;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// two-bit ACK/NAK
|
||||
if (ulsch->harq_processes[harq_pid]->O_ACK == 2) {
|
||||
ack_parity = (ulsch->o_ACK[0]+ulsch->o_ACK[1])&1;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[3] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[4] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[5] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
len_ACK = 6;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;//1;
|
||||
ulsch->q_ACK[4] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[5] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[6] = PUSCH_x;
|
||||
ulsch->q_ACK[7] = PUSCH_x;//1;
|
||||
ulsch->q_ACK[8] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[9] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[10] = PUSCH_x;
|
||||
ulsch->q_ACK[11] = PUSCH_x;//1;
|
||||
len_ACK = 12;
|
||||
break;
|
||||
|
||||
case 6:
|
||||
ulsch->q_ACK[0] = (ulsch->o_ACK[0]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[1] = (ulsch->o_ACK[1]+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[2] = PUSCH_x;
|
||||
ulsch->q_ACK[3] = PUSCH_x;
|
||||
ulsch->q_ACK[4] = PUSCH_x;
|
||||
ulsch->q_ACK[5] = PUSCH_x;
|
||||
|
||||
ulsch->q_ACK[6] = (ack_parity+wACK[wACK_idx][0])&1;
|
||||
ulsch->q_ACK[7] = (ulsch->o_ACK[0]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[8] = PUSCH_x;
|
||||
ulsch->q_ACK[9] = PUSCH_x;
|
||||
ulsch->q_ACK[10] = PUSCH_x;
|
||||
ulsch->q_ACK[11] = PUSCH_x;
|
||||
|
||||
ulsch->q_ACK[12] = (ulsch->o_ACK[1]+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[13] = (ack_parity+wACK[wACK_idx][1])&1;
|
||||
ulsch->q_ACK[14] = PUSCH_x;
|
||||
ulsch->q_ACK[15] = PUSCH_x;
|
||||
ulsch->q_ACK[16] = PUSCH_x;
|
||||
ulsch->q_ACK[17] = PUSCH_x;
|
||||
len_ACK = 18;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ulsch->harq_processes[harq_pid]->O_ACK > 2) {
|
||||
LOG_E(PHY,"ACK cannot be more than 2 bits yet\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
// channel multiplexing/interleaving
|
||||
|
||||
start_meas(m_stats);
|
||||
Hpp = Hprime + Q_RI;
|
||||
|
||||
Cmux = ulsch->Nsymb_pusch;
|
||||
Rmux = Hpp*Q_m/Cmux;
|
||||
Rmux_prime = Rmux/Q_m;
|
||||
|
||||
Qprime_RI = Q_RI / Q_m;
|
||||
Qprime_ACK = Q_ACK / Q_m;
|
||||
Qprime_CQI = Q_CQI / Q_m;
|
||||
|
||||
// printf("Qprime_CQI = %d\n",Qprime_CQI);
|
||||
// RI BITS
|
||||
|
||||
memset(y,LTE_NULL,Q_m*Hpp);
|
||||
|
||||
if (frame_parms->Ncp == 0)
|
||||
columnset = cs_ri_normal;
|
||||
else
|
||||
columnset = cs_ri_extended;
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<Qprime_RI; i++) {
|
||||
r = Rmux_prime - 1 - (i>>2);
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
y[q+(Q_m*((r*Cmux) + columnset[j]))] = ulsch->q_RI[(q+(Q_m*i))%len_RI];
|
||||
// printf("ri[%d] %d => y[%d]\n",q+(Q_m*i)%len_RI,ulsch->q_RI[(q+(Q_m*i))%len_RI],q+(Q_m*((r*Cmux) + columnset[j])),y[q+(Q_m*((r*Cmux) + columnset[j]))]);
|
||||
}
|
||||
|
||||
j=(j+3)&3;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// CQI and Data bits
|
||||
j=0;
|
||||
/*
|
||||
for (i=0,iprime=-Qprime_CQI;i<Hprime;i++,iprime++) {
|
||||
|
||||
while (y[Q_m*j] != LTE_NULL) j++;
|
||||
|
||||
if (i<Qprime_CQI) {
|
||||
for (q=0;q<Q_m;q++) {
|
||||
y[q+(Q_m*j)] = ulsch->q[q+(Q_m*i)];
|
||||
//printf("cqi[%d] %d => y[%d]\n",q+(Q_m*i),ulsch->q[q+(Q_m*i)],q+(Q_m*j));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (q=0;q<Q_m;q++) {
|
||||
y[q+(Q_m*j)] = ulsch->e[q+(Q_m*iprime)];
|
||||
// printf("e[%d] %d => y[%d]\n",q+(Q_m*iprime),ulsch->e[q+(Q_m*iprime)],q+(Q_m*j));
|
||||
}
|
||||
}
|
||||
j++;
|
||||
}
|
||||
*/
|
||||
|
||||
for (i=0; i<Qprime_CQI; i++) {
|
||||
|
||||
while (y[Q_m*j] != LTE_NULL) j++;
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
y[q+(Q_m*j)] = ulsch->q[q+(Q_m*i)];
|
||||
// printf("cqi[%d] %d => y[%d] (j %d)\n",q+(Q_m*i),ulsch->q[q+(Q_m*i)],q+(Q_m*j),j);
|
||||
}
|
||||
|
||||
j++;
|
||||
}
|
||||
|
||||
j2 = j*Q_m;
|
||||
|
||||
switch (Q_m) {
|
||||
|
||||
case 2:
|
||||
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<1; iprime+=2) {
|
||||
while (y[j2] != LTE_NULL) j2+=2;
|
||||
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
j2+=2;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)<<2; iprime+=4) {
|
||||
while (y[j2] != LTE_NULL) j2+=4;
|
||||
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
y[2+j2] = ulsch->e[2+iprime];
|
||||
y[3+j2] = ulsch->e[3+iprime];
|
||||
j2+=4;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (iprime=0; iprime<(Hprime-Qprime_CQI)*6; iprime+=6) {
|
||||
while (y[j2] != LTE_NULL) j2+=6;
|
||||
|
||||
y[j2] = ulsch->e[iprime];
|
||||
y[1+j2] = ulsch->e[1+iprime];
|
||||
y[2+j2] = ulsch->e[2+iprime];
|
||||
y[3+j2] = ulsch->e[3+iprime];
|
||||
y[4+j2] = ulsch->e[4+iprime];
|
||||
y[5+j2] = ulsch->e[5+iprime];
|
||||
j2+=6;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
// HARQ-ACK Bits (Note these overwrite some bits)
|
||||
|
||||
if (frame_parms->Ncp == 0)
|
||||
columnset = cs_ack_normal;
|
||||
else
|
||||
columnset = cs_ack_extended;
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<Qprime_ACK; i++) {
|
||||
r = Rmux_prime - 1 - (i>>2);
|
||||
|
||||
for (q=0; q<Q_m; q++) {
|
||||
y[q+(Q_m*((r*Cmux) + columnset[j]))] = ulsch->q_ACK[(q+(Q_m*i))%len_ACK];
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("ulsch_coding.c: ACK %d => y[%d]=%d (i %d, r*Cmux %d, columnset %d)\n",q+(Q_m*i),
|
||||
q+(Q_m*((r*Cmux) + columnset[j])),ulsch->q_ACK[(q+(Q_m*i))%len_ACK],
|
||||
i,r*Cmux,columnset[j]);
|
||||
#endif
|
||||
}
|
||||
|
||||
j=(j+3)&3;
|
||||
|
||||
}
|
||||
|
||||
// write out buffer
|
||||
j=0;
|
||||
|
||||
switch (Q_m) {
|
||||
case 2:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr=&y[((r*Cmux)+i)<<1];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)<<2];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (i=0; i<Cmux; i++)
|
||||
for (r=0; r<Rmux_prime; r++) {
|
||||
yptr = &y[((r*Cmux)+i)*6];
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
ulsch->h[j++] = *yptr++;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
stop_meas(m_stats);
|
||||
|
||||
if (j!=(H+Q_RI)) {
|
||||
LOG_E(PHY,"Error in output buffer length (j %d, H+Q_RI %d)\n",j,H+Q_RI);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_ENCODING, VCD_FUNCTION_OUT);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -1,777 +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
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/ulsch_modulation.c
|
||||
* \brief Top-level routines for generating PUSCH physical channel from 36.211 V8.6 2009-03
|
||||
* \author R. Knopp, F. Kaltenberger, A. Bhamri
|
||||
* \date 2011
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr,ankit.bhamri@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "PHY/CODING/defs.h"
|
||||
#include "PHY/CODING/extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
#include "defs.h"
|
||||
#include "UTIL/LOG/vcd_signal_dumper.h"
|
||||
|
||||
|
||||
|
||||
//#define DEBUG_ULSCH_MODULATION
|
||||
|
||||
#ifndef OFDMA_ULSCH
|
||||
void dft_lte(int32_t *z,int32_t *d, int32_t Msc_PUSCH, uint8_t Nsymb)
|
||||
{
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i dft_in128[4][1200],dft_out128[4][1200];
|
||||
#elif defined(__arm__)
|
||||
int16x8_t dft_in128[4][1200],dft_out128[4][1200];
|
||||
#endif
|
||||
uint32_t *dft_in0=(uint32_t*)dft_in128[0],*dft_out0=(uint32_t*)dft_out128[0];
|
||||
uint32_t *dft_in1=(uint32_t*)dft_in128[1],*dft_out1=(uint32_t*)dft_out128[1];
|
||||
uint32_t *dft_in2=(uint32_t*)dft_in128[2],*dft_out2=(uint32_t*)dft_out128[2];
|
||||
// uint32_t *dft_in3=(uint32_t*)dft_in128[3],*dft_out3=(uint32_t*)dft_out128[3];
|
||||
|
||||
uint32_t *d0,*d1,*d2,*d3,*d4,*d5,*d6,*d7,*d8,*d9,*d10,*d11;
|
||||
|
||||
uint32_t *z0,*z1,*z2,*z3,*z4,*z5,*z6,*z7,*z8,*z9,*z10,*z11;
|
||||
uint32_t i,ip;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i norm128;
|
||||
#elif defined(__arm__)
|
||||
int16x8_t norm128;
|
||||
#endif
|
||||
// printf("Doing lte_dft for Msc_PUSCH %d\n",Msc_PUSCH);
|
||||
|
||||
d0 = (uint32_t *)d;
|
||||
d1 = d0+Msc_PUSCH;
|
||||
d2 = d1+Msc_PUSCH;
|
||||
d3 = d2+Msc_PUSCH;
|
||||
d4 = d3+Msc_PUSCH;
|
||||
d5 = d4+Msc_PUSCH;
|
||||
d6 = d5+Msc_PUSCH;
|
||||
d7 = d6+Msc_PUSCH;
|
||||
d8 = d7+Msc_PUSCH;
|
||||
d9 = d8+Msc_PUSCH;
|
||||
d10 = d9+Msc_PUSCH;
|
||||
d11 = d10+Msc_PUSCH;
|
||||
|
||||
// printf("symbol 0 (d0 %p, d %p)\n",d0,d);
|
||||
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
||||
dft_in0[ip] = d0[i];
|
||||
dft_in0[ip+1] = d1[i];
|
||||
dft_in0[ip+2] = d2[i];
|
||||
dft_in0[ip+3] = d3[i];
|
||||
dft_in1[ip] = d4[i];
|
||||
dft_in1[ip+1] = d5[i];
|
||||
dft_in1[ip+2] = d6[i];
|
||||
dft_in1[ip+3] = d7[i];
|
||||
dft_in2[ip] = d8[i];
|
||||
dft_in2[ip+1] = d9[i];
|
||||
dft_in2[ip+2] = d10[i];
|
||||
dft_in2[ip+3] = d11[i];
|
||||
// printf("dft%d %d: %d,%d,%d,%d\n",Msc_PUSCH,ip,d0[i],d1[i],d2[i],d3[i]);
|
||||
|
||||
// dft_in_re2[ip+1] = d9[i];
|
||||
// dft_in_re2[ip+2] = d10[i];
|
||||
}
|
||||
|
||||
// printf("\n");
|
||||
|
||||
switch (Msc_PUSCH) {
|
||||
case 12:
|
||||
dft12((int16_t *)dft_in0,(int16_t *)dft_out0);
|
||||
dft12((int16_t *)dft_in1,(int16_t *)dft_out1);
|
||||
dft12((int16_t *)dft_in2,(int16_t *)dft_out2);
|
||||
|
||||
/*
|
||||
dft12f(&((__m128i *)dft_in0)[0],&((__m128i *)dft_in0)[1],&((__m128i *)dft_in0)[2],&((__m128i *)dft_in0)[3],&((__m128i *)dft_in0)[4],&((__m128i *)dft_in0)[5],&((__m128i *)dft_in0)[6],&((__m128i *)dft_in0)[7],&((__m128i *)dft_in0)[8],&((__m128i *)dft_in0)[9],&((__m128i *)dft_in0)[10],&((__m128i *)dft_in0)[11],
|
||||
&((__m128i *)dft_out0)[0],&((__m128i *)dft_out0)[1],&((__m128i *)dft_out0)[2],&((__m128i *)dft_out0)[3],&((__m128i *)dft_out0)[4],&((__m128i *)dft_out0)[5],&((__m128i *)dft_out0)[6],&((__m128i *)dft_out0)[7],&((__m128i *)dft_out0)[8],&((__m128i *)dft_out0)[9],&((__m128i *)dft_out0)[10],&((__m128i *)dft_out0)[11]);
|
||||
|
||||
dft12f(&((__m128i *)dft_in1)[0],&((__m128i *)dft_in1)[1],&((__m128i *)dft_in1)[2],&((__m128i *)dft_in1)[3],&((__m128i *)dft_in1)[4],&((__m128i *)dft_in1)[5],&((__m128i *)dft_in1)[6],&((__m128i *)dft_in1)[7],&((__m128i *)dft_in1)[8],&((__m128i *)dft_in1)[9],&((__m128i *)dft_in1)[10],&((__m128i *)dft_in1)[11],
|
||||
&((__m128i *)dft_out1)[0],&((__m128i *)dft_out1)[1],&((__m128i *)dft_out1)[2],&((__m128i *)dft_out1)[3],&((__m128i *)dft_out1)[4],&((__m128i *)dft_out1)[5],&((__m128i *)dft_out1)[6],&((__m128i *)dft_out1)[7],&((__m128i *)dft_out1)[8],&((__m128i *)dft_out1)[9],&((__m128i *)dft_out1)[10],&((__m128i *)dft_out1)[11]);
|
||||
|
||||
dft12f(&((__m128i *)dft_in2)[0],&((__m128i *)dft_in2)[1],&((__m128i *)dft_in2)[2],&((__m128i *)dft_in2)[3],&((__m128i *)dft_in2)[4],&((__m128i *)dft_in2)[5],&((__m128i *)dft_in2)[6],&((__m128i *)dft_in2)[7],&((__m128i *)dft_in2)[8],&((__m128i *)dft_in2)[9],&((__m128i *)dft_in2)[10],&((__m128i *)dft_in2)[11],
|
||||
&((__m128i *)dft_out2)[0],&((__m128i *)dft_out2)[1],&((__m128i *)dft_out2)[2],&((__m128i *)dft_out2)[3],&((__m128i *)dft_out2)[4],&((__m128i *)dft_out2)[5],&((__m128i *)dft_out2)[6],&((__m128i *)dft_out2)[7],&((__m128i *)dft_out2)[8],&((__m128i *)dft_out2)[9],&((__m128i *)dft_out2)[10],&((__m128i *)dft_out2)[11]);
|
||||
*/
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
norm128 = _mm_set1_epi16(9459);
|
||||
#elif defined(__arm__)
|
||||
norm128 = vdupq_n_s16(9459);
|
||||
#endif
|
||||
for (i=0; i<12; i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
((__m128i*)dft_out0)[i] = _mm_slli_epi16(_mm_mulhi_epi16(((__m128i*)dft_out0)[i],norm128),1);
|
||||
((__m128i*)dft_out1)[i] = _mm_slli_epi16(_mm_mulhi_epi16(((__m128i*)dft_out1)[i],norm128),1);
|
||||
((__m128i*)dft_out2)[i] = _mm_slli_epi16(_mm_mulhi_epi16(((__m128i*)dft_out2)[i],norm128),1);
|
||||
#elif defined(__arm__)
|
||||
((int16x8_t*)dft_out0)[i] = vqdmulhq_s16(((int16x8_t*)dft_out0)[i],norm128);
|
||||
((int16x8_t*)dft_out1)[i] = vqdmulhq_s16(((int16x8_t*)dft_out1)[i],norm128);
|
||||
((int16x8_t*)dft_out2)[i] = vqdmulhq_s16(((int16x8_t*)dft_out2)[i],norm128);
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 24:
|
||||
dft24((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft24((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft24((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 36:
|
||||
dft36((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft36((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft36((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 48:
|
||||
dft48((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft48((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft48((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 60:
|
||||
dft60((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft60((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft60((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 72:
|
||||
dft72((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft72((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft72((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 96:
|
||||
dft96((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft96((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft96((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 108:
|
||||
dft108((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft108((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft108((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 120:
|
||||
dft120((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft120((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft120((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 144:
|
||||
dft144((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft144((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft144((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 180:
|
||||
dft180((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft180((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft180((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 192:
|
||||
dft192((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft192((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft192((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 216:
|
||||
dft216((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft216((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft216((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 240:
|
||||
dft240((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft240((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft240((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 288:
|
||||
dft288((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft288((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft288((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 300:
|
||||
dft300((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft300((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft300((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 324:
|
||||
dft324((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft324((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft324((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 360:
|
||||
dft360((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft360((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft360((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 384:
|
||||
dft384((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft384((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft384((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 432:
|
||||
dft432((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft432((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft432((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 480:
|
||||
dft480((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft480((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft480((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 540:
|
||||
dft540((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft540((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft540((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 576:
|
||||
dft576((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft576((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft576((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 600:
|
||||
dft600((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft600((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft600((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 648:
|
||||
dft648((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft648((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft648((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 720:
|
||||
dft720((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft720((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft720((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 864:
|
||||
dft864((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft864((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft864((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 900:
|
||||
dft900((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft900((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft900((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 960:
|
||||
dft960((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft960((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft960((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 972:
|
||||
dft972((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft972((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft972((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 1080:
|
||||
dft1080((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft1080((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft1080((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 1152:
|
||||
dft1152((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft1152((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft1152((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
|
||||
case 1200:
|
||||
dft1200((int16_t*)dft_in0,(int16_t*)dft_out0,1);
|
||||
dft1200((int16_t*)dft_in1,(int16_t*)dft_out1,1);
|
||||
dft1200((int16_t*)dft_in2,(int16_t*)dft_out2,1);
|
||||
break;
|
||||
}
|
||||
|
||||
z0 = (uint32_t *)z;
|
||||
z1 = z0+Msc_PUSCH;
|
||||
z2 = z1+Msc_PUSCH;
|
||||
z3 = z2+Msc_PUSCH;
|
||||
z4 = z3+Msc_PUSCH;
|
||||
z5 = z4+Msc_PUSCH;
|
||||
z6 = z5+Msc_PUSCH;
|
||||
z7 = z6+Msc_PUSCH;
|
||||
z8 = z7+Msc_PUSCH;
|
||||
z9 = z8+Msc_PUSCH;
|
||||
z10 = z9+Msc_PUSCH;
|
||||
z11 = z10+Msc_PUSCH;
|
||||
|
||||
// printf("symbol0 (dft)\n");
|
||||
for (i=0,ip=0; i<Msc_PUSCH; i++,ip+=4) {
|
||||
z0[i] = dft_out0[ip];
|
||||
// printf("%d,%d,",((short*)&z0[i])[0],((short*)&z0[i])[1]);
|
||||
z1[i] = dft_out0[ip+1];
|
||||
z2[i] = dft_out0[ip+2];
|
||||
z3[i] = dft_out0[ip+3];
|
||||
z4[i] = dft_out1[ip+0];
|
||||
z5[i] = dft_out1[ip+1];
|
||||
z6[i] = dft_out1[ip+2];
|
||||
z7[i] = dft_out1[ip+3];
|
||||
z8[i] = dft_out2[ip];
|
||||
z9[i] = dft_out2[ip+1];
|
||||
z10[i] = dft_out2[ip+2];
|
||||
z11[i] = dft_out2[ip+3];
|
||||
// printf("out dft%d %d: %d,%d,%d,%d,%d,%d,%d,%d\n",Msc_PUSCH,ip,z0[i],z1[i],z2[i],z3[i],z4[i],z5[i],z6[i],z7[i]);
|
||||
|
||||
}
|
||||
|
||||
// printf("\n");
|
||||
}
|
||||
|
||||
#endif
|
||||
void ulsch_modulation(int32_t **txdataF,
|
||||
short amp,
|
||||
uint32_t frame,
|
||||
uint32_t subframe,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
LTE_UE_ULSCH_t *ulsch)
|
||||
{
|
||||
|
||||
uint8_t qam64_table_offset_re = 0;
|
||||
uint8_t qam64_table_offset_im = 0;
|
||||
uint8_t qam16_table_offset_re = 0;
|
||||
uint8_t qam16_table_offset_im = 0;
|
||||
short gain_lin_QPSK;
|
||||
|
||||
DevAssert(frame_parms);
|
||||
|
||||
int re_offset,re_offset0,i,Msymb,j,k,nsymb,Msc_PUSCH,l;
|
||||
// uint8_t harq_pid = (rag_flag == 1) ? 0 : subframe2harq_pid_tdd(frame_parms->tdd_config,subframe);
|
||||
uint8_t harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
|
||||
uint8_t Q_m;
|
||||
int32_t *txptr;
|
||||
uint32_t symbol_offset;
|
||||
uint16_t first_rb;
|
||||
uint16_t nb_rb;
|
||||
int G;
|
||||
|
||||
uint32_t x1, x2, s=0;
|
||||
uint8_t c;
|
||||
|
||||
if (!ulsch) {
|
||||
printf("ulsch_modulation.c: Null ulsch\n");
|
||||
return;
|
||||
}
|
||||
|
||||
// x1 is set in lte_gold_generic
|
||||
x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
|
||||
|
||||
if (harq_pid>=8) {
|
||||
printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
|
||||
return;
|
||||
}
|
||||
|
||||
first_rb = ulsch->harq_processes[harq_pid]->first_rb;
|
||||
nb_rb = ulsch->harq_processes[harq_pid]->nb_rb;
|
||||
|
||||
if (nb_rb == 0) {
|
||||
printf("ulsch_modulation.c: Frame %d, Subframe %d Illegal nb_rb %d\n",frame,subframe,nb_rb);
|
||||
return;
|
||||
}
|
||||
|
||||
if (first_rb > frame_parms->N_RB_UL) {
|
||||
printf("ulsch_modulation.c: Frame %d, Subframe %d Illegal first_rb %d\n",frame,subframe,first_rb);
|
||||
return;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, VCD_FUNCTION_IN);
|
||||
|
||||
Q_m = get_Qm_ul(ulsch->harq_processes[harq_pid]->mcs);
|
||||
|
||||
G = (int)ulsch->harq_processes[harq_pid]->nb_rb * (12 * Q_m) * (ulsch->Nsymb_pusch);
|
||||
|
||||
|
||||
// Mapping
|
||||
nsymb = (frame_parms->Ncp==0) ? 14:12;
|
||||
Msc_PUSCH = ulsch->harq_processes[harq_pid]->nb_rb*12;
|
||||
|
||||
#ifdef DEBUG_ULSCH_MODULATION
|
||||
LOG_D(PHY,"ulsch_modulation.c: Doing modulation (rnti %x,x2 %x) for G=%d bits, harq_pid %d , nb_rb %d, Q_m %d, Nsymb_pusch %d (nsymb %d), subframe %d\n",
|
||||
ulsch->rnti,x2,G,harq_pid,ulsch->harq_processes[harq_pid]->nb_rb,Q_m, ulsch->Nsymb_pusch,nsymb,subframe);
|
||||
#endif
|
||||
|
||||
// scrambling (Note the placeholding bits are handled in ulsch_coding.c directly!)
|
||||
//printf("ulsch bits: ");
|
||||
s = lte_gold_generic(&x1, &x2, 1);
|
||||
k=0;
|
||||
|
||||
//printf("G %d\n",G);
|
||||
for (i=0; i<(1+(G>>5)); i++) {
|
||||
for (j=0; j<32; j++,k++) {
|
||||
c = (uint8_t)((s>>j)&1);
|
||||
|
||||
if (ulsch->h[k] == PUSCH_x) {
|
||||
// printf("i %d: PUSCH_x\n",i);
|
||||
ulsch->b_tilde[k] = 1;
|
||||
} else if (ulsch->h[k] == PUSCH_y) {
|
||||
// printf("i %d: PUSCH_y\n",i);
|
||||
ulsch->b_tilde[k] = ulsch->b_tilde[k-1];
|
||||
} else {
|
||||
ulsch->b_tilde[k] = (ulsch->h[k]+c)&1;
|
||||
// printf("i %d : %d (h %d c %d)\n", (i<<5)+j,ulsch->b_tilde[k],ulsch->h[k],c);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
s = lte_gold_generic(&x1, &x2, 0);
|
||||
}
|
||||
|
||||
//printf("\n");
|
||||
|
||||
|
||||
gain_lin_QPSK = (short)((amp*ONE_OVER_SQRT2_Q15)>>15);
|
||||
|
||||
|
||||
// Modulation
|
||||
|
||||
Msymb = G/Q_m;
|
||||
|
||||
if(ulsch->cooperation_flag == 2)
|
||||
// For Distributed Alamouti Scheme in Collabrative Communication
|
||||
{
|
||||
for (i=0,j=Q_m; i<Msymb; i+=2,j+=2*Q_m) {
|
||||
|
||||
switch (Q_m) {
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
//UE1, -x1*
|
||||
((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||
((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
// if (i<Msc_PUSCH)
|
||||
// printf("input %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
||||
|
||||
// UE1, x0*
|
||||
((int16_t*)&ulsch->d[i+1])[0] = (ulsch->b_tilde[j-2] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
((int16_t*)&ulsch->d[i+1])[1] = (ulsch->b_tilde[j-1] == 1)? (gain_lin_QPSK) : -gain_lin_QPSK;
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
||||
|
||||
//UE1,-x1*
|
||||
qam16_table_offset_re = 0;
|
||||
qam16_table_offset_im = 0;
|
||||
|
||||
if (ulsch->b_tilde[j] == 1)
|
||||
qam16_table_offset_re+=2;
|
||||
|
||||
if (ulsch->b_tilde[j+1] == 1)
|
||||
qam16_table_offset_im+=2;
|
||||
|
||||
|
||||
|
||||
if (ulsch->b_tilde[j+2] == 1)
|
||||
qam16_table_offset_re+=1;
|
||||
|
||||
if (ulsch->b_tilde[j+3] == 1)
|
||||
qam16_table_offset_im+=1;
|
||||
|
||||
|
||||
((int16_t*)&ulsch->d[i])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
|
||||
((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
|
||||
|
||||
//UE1,x0*
|
||||
qam16_table_offset_re = 0;
|
||||
qam16_table_offset_im = 0;
|
||||
|
||||
if (ulsch->b_tilde[j-4] == 1)
|
||||
qam16_table_offset_re+=2;
|
||||
|
||||
if (ulsch->b_tilde[j-3] == 1)
|
||||
qam16_table_offset_im+=2;
|
||||
|
||||
|
||||
if (ulsch->b_tilde[j-2] == 1)
|
||||
qam16_table_offset_re+=1;
|
||||
|
||||
if (ulsch->b_tilde[j-1] == 1)
|
||||
qam16_table_offset_im+=1;
|
||||
|
||||
|
||||
// ((int16_t*)&ulsch->d[i+1])[0]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
|
||||
// ((int16_t*)&ulsch->d[i+1])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
|
||||
((int16_t*)&ulsch->d[i+1])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
|
||||
((int16_t*)&ulsch->d[i+1])[1]=-(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case 6:
|
||||
|
||||
|
||||
|
||||
//UE1,-x1*FPGA_UE
|
||||
qam64_table_offset_re = 0;
|
||||
qam64_table_offset_im = 0;
|
||||
|
||||
if (ulsch->b_tilde[j] == 1)
|
||||
qam64_table_offset_re+=4;
|
||||
|
||||
if (ulsch->b_tilde[j+1] == 1)
|
||||
qam64_table_offset_im+=4;
|
||||
|
||||
if (ulsch->b_tilde[j+2] == 1)
|
||||
qam64_table_offset_re+=2;
|
||||
|
||||
|
||||
if (ulsch->b_tilde[j+3] == 1)
|
||||
qam64_table_offset_im+=2;
|
||||
|
||||
if (ulsch->b_tilde[j+4] == 1)
|
||||
qam64_table_offset_re+=1;
|
||||
|
||||
if (ulsch->b_tilde[j+5] == 1)
|
||||
qam64_table_offset_im+=1;
|
||||
|
||||
|
||||
((int16_t*)&ulsch->d[i])[0]=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
|
||||
((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
|
||||
|
||||
//UE1,x0*
|
||||
qam64_table_offset_re = 0;
|
||||
qam64_table_offset_im = 0;
|
||||
|
||||
if (ulsch->b_tilde[j-6] == 1)
|
||||
qam64_table_offset_re+=4;
|
||||
|
||||
if (ulsch->b_tilde[j-5] == 1)
|
||||
qam64_table_offset_im+=4;
|
||||
|
||||
if (ulsch->b_tilde[j-4] == 1)
|
||||
qam64_table_offset_re+=2;
|
||||
|
||||
|
||||
if (ulsch->b_tilde[j-3] == 1)
|
||||
qam64_table_offset_im+=2;
|
||||
|
||||
if (ulsch->b_tilde[j-2] == 1)
|
||||
qam64_table_offset_re+=1;
|
||||
|
||||
if (ulsch->b_tilde[j-1] == 1)
|
||||
qam64_table_offset_im+=1;
|
||||
|
||||
|
||||
((int16_t*)&ulsch->d[i+1])[0]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
|
||||
((int16_t*)&ulsch->d[i+1])[1]=-(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
|
||||
|
||||
break;
|
||||
|
||||
}//switch
|
||||
}//for
|
||||
}//cooperation_flag == 2
|
||||
else {
|
||||
for (i=0,j=0; i<Msymb; i++,j+=Q_m) {
|
||||
|
||||
switch (Q_m) {
|
||||
|
||||
case 2:
|
||||
// TODO: this has to be updated!!!
|
||||
|
||||
((int16_t*)&ulsch->d[i])[0] = (ulsch->b_tilde[j] == 1) ? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
((int16_t*)&ulsch->d[i])[1] = (ulsch->b_tilde[j+1] == 1)? (-gain_lin_QPSK) : gain_lin_QPSK;
|
||||
// if (i<Msc_PUSCH)
|
||||
// printf("input %d/%d Msc_PUSCH %d (%p): %d,%d\n", i,Msymb,Msc_PUSCH,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
||||
qam16_table_offset_re = 0;
|
||||
qam16_table_offset_im = 0;
|
||||
|
||||
if (ulsch->b_tilde[j] == 1)
|
||||
qam16_table_offset_re+=2;
|
||||
|
||||
if (ulsch->b_tilde[j+1] == 1)
|
||||
qam16_table_offset_im+=2;
|
||||
|
||||
if (ulsch->b_tilde[j+2] == 1)
|
||||
qam16_table_offset_re+=1;
|
||||
|
||||
if (ulsch->b_tilde[j+3] == 1)
|
||||
qam16_table_offset_im+=1;
|
||||
|
||||
|
||||
((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_re])>>15);
|
||||
((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam16_table[qam16_table_offset_im])>>15);
|
||||
// printf("input(16qam) %d (%p): %d,%d\n", i,&ulsch->d[i],((int16_t*)&ulsch->d[i])[0],((int16_t*)&ulsch->d[i])[1]);
|
||||
break;
|
||||
|
||||
case 6:
|
||||
|
||||
|
||||
qam64_table_offset_re = 0;
|
||||
qam64_table_offset_im = 0;
|
||||
|
||||
if (ulsch->b_tilde[j] == 1)
|
||||
qam64_table_offset_re+=4;
|
||||
|
||||
if (ulsch->b_tilde[j+1] == 1)
|
||||
qam64_table_offset_im+=4;
|
||||
|
||||
if (ulsch->b_tilde[j+2] == 1)
|
||||
qam64_table_offset_re+=2;
|
||||
|
||||
if (ulsch->b_tilde[j+3] == 1)
|
||||
qam64_table_offset_im+=2;
|
||||
|
||||
if (ulsch->b_tilde[j+4] == 1)
|
||||
qam64_table_offset_re+=1;
|
||||
|
||||
if (ulsch->b_tilde[j+5] == 1)
|
||||
qam64_table_offset_im+=1;
|
||||
|
||||
|
||||
((int16_t*)&ulsch->d[i])[0]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_re])>>15);
|
||||
((int16_t*)&ulsch->d[i])[1]=(int16_t)(((int32_t)amp*qam64_table[qam64_table_offset_im])>>15);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
}// normal symbols
|
||||
|
||||
|
||||
// Transform Precoding
|
||||
|
||||
#ifdef OFDMA_ULSCH
|
||||
|
||||
for (i=0; i<Msymb; i++) {
|
||||
ulsch->z[i] = ulsch->d[i];
|
||||
}
|
||||
|
||||
#else
|
||||
dft_lte(ulsch->z,ulsch->d,Msc_PUSCH,ulsch->Nsymb_pusch);
|
||||
#endif
|
||||
|
||||
DevAssert(txdataF);
|
||||
|
||||
#ifdef OFDMA_ULSCH
|
||||
re_offset0 = frame_parms->first_carrier_offset + (ulsch->harq_processes[harq_pid]->first_rb*12);
|
||||
|
||||
if (re_offset0>frame_parms->ofdm_symbol_size) {
|
||||
re_offset0 -= frame_parms->ofdm_symbol_size;
|
||||
// re_offset0++;
|
||||
}
|
||||
|
||||
// printf("re_offset0 %d\n",re_offset0);
|
||||
|
||||
|
||||
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
|
||||
re_offset = re_offset0;
|
||||
symbol_offset = (int)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
|
||||
#ifdef DEBUG_ULSCH_MODULATION
|
||||
printf("symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
|
||||
#endif
|
||||
txptr = &txdataF[0][symbol_offset];
|
||||
|
||||
if (((frame_parms->Ncp == 0) && ((l==3) || (l==10)))||
|
||||
((frame_parms->Ncp == 1) && ((l==2) || (l==8)))) {
|
||||
}
|
||||
// Skip reference symbols
|
||||
else {
|
||||
|
||||
// printf("copying %d REs\n",Msc_PUSCH);
|
||||
for (i=0; i<Msc_PUSCH; i++,j++) {
|
||||
#ifdef DEBUG_ULSCH_MODULATION
|
||||
printf("re_offset %d (%p): %d,%d\n", re_offset,&ulsch->z[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1]);
|
||||
#endif
|
||||
txptr[re_offset++] = ulsch->z[j];
|
||||
|
||||
if (re_offset==frame_parms->ofdm_symbol_size)
|
||||
re_offset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# else // OFDMA_ULSCH = 0
|
||||
re_offset0 = frame_parms->first_carrier_offset + (ulsch->harq_processes[harq_pid]->first_rb*12);
|
||||
|
||||
if (re_offset0>frame_parms->ofdm_symbol_size) {
|
||||
re_offset0 -= frame_parms->ofdm_symbol_size;
|
||||
// re_offset0++;
|
||||
}
|
||||
|
||||
// printf("re_offset0 %d\n",re_offset0);
|
||||
// printf("txdataF %p\n",&txdataF[0][0]);
|
||||
for (j=0,l=0; l<(nsymb-ulsch->srs_active); l++) {
|
||||
re_offset = re_offset0;
|
||||
symbol_offset = (uint32_t)frame_parms->ofdm_symbol_size*(l+(subframe*nsymb));
|
||||
#ifdef DEBUG_ULSCH_MODULATION
|
||||
printf("ulsch_mod (SC-FDMA) symbol %d (subframe %d): symbol_offset %d\n",l,subframe,symbol_offset);
|
||||
#endif
|
||||
txptr = &txdataF[0][symbol_offset];
|
||||
|
||||
if (((frame_parms->Ncp == 0) && ((l==3) || (l==10)))||
|
||||
((frame_parms->Ncp == 1) && ((l==2) || (l==8)))) {
|
||||
}
|
||||
// Skip reference symbols
|
||||
else {
|
||||
// printf("copying %d REs\n",Msc_PUSCH);
|
||||
for (i=0; i<Msc_PUSCH; i++,j++) {
|
||||
|
||||
#ifdef DEBUG_ULSCH_MODULATION
|
||||
printf("re_offset %d (%p): %d,%d => %p\n", re_offset,&ulsch->z[j],((int16_t*)&ulsch->z[j])[0],((int16_t*)&ulsch->z[j])[1],&txptr[re_offset]);
|
||||
#endif //DEBUG_ULSCH_MODULATION
|
||||
txptr[re_offset++] = ulsch->z[j];
|
||||
|
||||
if (re_offset==frame_parms->ofdm_symbol_size)
|
||||
re_offset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_ULSCH_MODULATION, VCD_FUNCTION_OUT);
|
||||
|
||||
}
|
||||
|
||||
@@ -115,7 +115,8 @@ int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
unsigned short nb_rb_pdsch)
|
||||
{
|
||||
int32_t qpsk[4],nqpsk[4],*qpsk_p, n;
|
||||
int w,mprime,ind,l,ind_dword,ind_qpsk_symb,kp,lp, config_type, k;
|
||||
//int w,mprime,ind,l,ind_dword,ind_qpsk_symb,kp,lp, config_type, k;
|
||||
int w,ind,ind_dword,ind_qpsk_symb,kp,lp, config_type, k=0;
|
||||
short pamp;
|
||||
|
||||
typedef int array_of_w[2];
|
||||
@@ -196,7 +197,7 @@ int nr_pdcch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
{
|
||||
|
||||
uint8_t idx=0;
|
||||
uint8_t pdcch_rb_offset =0;
|
||||
//uint8_t pdcch_rb_offset =0;
|
||||
//nr_gold_pdcch += ((int)floor(ue->frame_parms.ssb_start_subcarrier/12)+pdcch_rb_offset)*3/32;
|
||||
|
||||
if (p==2000) {
|
||||
|
||||
@@ -19,16 +19,16 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
#include "nr_refsig.h"
|
||||
|
||||
void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB)
|
||||
{
|
||||
|
||||
unsigned int n, x1, x2;
|
||||
unsigned int x1, x2;
|
||||
unsigned char Nid, i_ssb, i_ssb2;
|
||||
unsigned char Lmax, l, n_hf, N_hf;
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
uint8_t reset;
|
||||
|
||||
Nid = cfg->sch_config.physical_cell_id.value;
|
||||
|
||||
@@ -36,32 +36,42 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB)
|
||||
N_hf = (Lmax == 4)? 2:1;
|
||||
|
||||
for (n_hf = 0; n_hf < N_hf; n_hf++) {
|
||||
|
||||
for (l = 0; l < Lmax ; l++) {
|
||||
i_ssb = l & (Lmax-1);
|
||||
i_ssb2 = (i_ssb<<2) + n_hf;
|
||||
|
||||
x1 = 1 + (1<<31);
|
||||
reset = 1;
|
||||
x2 = (1<<11) * (i_ssb2 + 1) * ((Nid>>2) + 1) + (1<<6) * (i_ssb2 + 1) + (Nid&3);
|
||||
x2 = x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
|
||||
// skip first 50 double words (1600 bits)
|
||||
for (n = 1; n < 50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
}
|
||||
|
||||
for (n=0; n<NR_PBCH_DMRS_LENGTH_DWORD; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
gNB->nr_gold_pbch_dmrs[n_hf][l][n] = x1 ^ x2;
|
||||
for (uint8_t n=0; n<NR_PBCH_DMRS_LENGTH_DWORD; n++) {
|
||||
gNB->nr_gold_pbch_dmrs[n_hf][l][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
{
|
||||
|
||||
uint32_t x1, x2;
|
||||
uint8_t reset;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
|
||||
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
|
||||
reset = 1;
|
||||
x2 = ((1<<17) * (14*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1))&(((uint32_t)1<<31)-1);
|
||||
|
||||
for (uint32_t n=0; n<NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
pdcch_dmrs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,15 +21,22 @@
|
||||
|
||||
/* Definitions for LTE Reference signals */
|
||||
/* Author R. Knopp / EURECOM / OpenAirInterface.org */
|
||||
#ifndef __NR_REFSIG_DEFS__H__
|
||||
#define __NR_REFSIG_DEFS__H__
|
||||
#ifndef __NR_REFSIG__H__
|
||||
#define __NR_REFSIG__H__
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
|
||||
/*!\brief This function generates the NR Gold sequence (38-211, Sec 5.2.1) for the PBCH DMRS.
|
||||
@param PHY_VARS_gNB* gNB structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
|
||||
*/
|
||||
void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB);
|
||||
/*!\brief This function generates the NR Gold sequence (38-211, Sec 5.2.1) for the PDCCH DMRS.
|
||||
@param PHY_VARS_gNB* gNB structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
|
||||
@param Nid is used for the initialization of x2, Physical cell Id by default or upper layer configured pdcch_scrambling_ID
|
||||
*/
|
||||
void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_TRANSPORT/nr_dci.c
|
||||
* \brief Implements DCI encoding/decoding (38.212/38.213/38.214). Current NR compliance V15.1 2018-06.
|
||||
* \brief Implements DCI encoding/decoding and PDCCH TX/RX procedures (38.212/38.213/38.214). V15.2.0 2018-06.
|
||||
* \author Guy De Souza
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
@@ -32,25 +32,32 @@
|
||||
|
||||
#include "nr_dci.h"
|
||||
|
||||
uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
nr_rnti_type_e rnti,
|
||||
//#define DEBUG_PDCCH_DMRS
|
||||
//#define DEBUG_DCI
|
||||
//#define DEBUG_CHANNEL_CODING
|
||||
#define PDCCH_TEST_POLAR_TEMP_FIX
|
||||
|
||||
extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT];
|
||||
|
||||
uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
|
||||
nfapi_nr_rnti_type_e rnti_type,
|
||||
NR_BWP_PARMS* bwp,
|
||||
nfapi_nr_config_request_t* config)
|
||||
{
|
||||
uint8_t size = 0;
|
||||
uint16_t size = 0;
|
||||
uint16_t N_RB = bwp->N_RB;
|
||||
|
||||
switch(format) {
|
||||
|
||||
case nr_dci_format_0_0:
|
||||
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 --16
|
||||
size += 16;
|
||||
size += ceil( log2( (N_RB*(N_RB+1))>>2 ) ); // Freq domain assignment -- hopping scenario to be updated
|
||||
// Time domain assignment
|
||||
// UL/SUL indicator
|
||||
/*Only sizes for 0_0 and 1_0 are correct at the moment*/
|
||||
case NFAPI_NR_UL_DCI_FORMAT_0_0:
|
||||
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20
|
||||
size += 20;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment -- hopping scenario to be updated
|
||||
size += nr_get_dci_size(NFAPI_NR_DL_DCI_FORMAT_1_0, rnti_type, bwp, config) - size; // Padding to match 1_0 size
|
||||
// UL/SUL indicator assumed to be 0
|
||||
break;
|
||||
|
||||
case nr_dci_format_0_1:
|
||||
case NFAPI_NR_UL_DCI_FORMAT_0_1:
|
||||
/// fixed: Format identifier 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2, SRS request 2 --17
|
||||
size += 17;
|
||||
// Carrier indicator
|
||||
@@ -72,14 +79,14 @@ uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
// DMRS sequence init
|
||||
break;
|
||||
|
||||
case nr_dci_format_1_0:
|
||||
/// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 --24
|
||||
size += 24;
|
||||
size += ceil( log2( (N_RB*(N_RB+1))>>2 ) ); // Freq domain assignment
|
||||
// Time domain assignment
|
||||
case NFAPI_NR_DL_DCI_FORMAT_1_0:
|
||||
/// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 Time Domain assgnmt 4 -- 28
|
||||
size += 28;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment
|
||||
|
||||
break;
|
||||
|
||||
case nr_dci_format_1_1:
|
||||
case NFAPI_NR_DL_DCI_FORMAT_1_1:
|
||||
// Carrier indicator
|
||||
size += 1; // Format identifier
|
||||
// BWP Indicator
|
||||
@@ -106,16 +113,16 @@ uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_0:
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_0:
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_1:
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_1:
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_2:
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_2:
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_3:
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_3:
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -125,12 +132,193 @@ uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
return size;
|
||||
}
|
||||
|
||||
void nr_pdcch_scrambling(uint32_t *in,
|
||||
uint8_t size,
|
||||
uint32_t Nid,
|
||||
uint32_t n_RNTI,
|
||||
uint32_t* out) {
|
||||
|
||||
uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc,
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s=0;
|
||||
|
||||
reset = 1;
|
||||
x2 = (n_RNTI<<16) + Nid;
|
||||
|
||||
for (int i=0; i<size; i++) {
|
||||
if ((i&0x1f)==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
*out ^= (((*in)>>i)&1) ^ ((s>>i)&1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
|
||||
t_nrPolar_paramsPtr *nrPolar_params,
|
||||
uint32_t **gold_pdcch_dmrs,
|
||||
int32_t** txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
nfapi_nr_config_request_t* config)
|
||||
NR_DL_FRAME_PARMS frame_parms,
|
||||
nfapi_nr_config_request_t config)
|
||||
{
|
||||
|
||||
int16_t mod_dmrs[NR_MAX_CSET_DURATION][NR_MAX_PDCCH_DMRS_LENGTH>>1]; // 3 for the max coreset duration
|
||||
uint8_t idx=0;
|
||||
uint16_t a;
|
||||
int k,l,k_prime,dci_idx, dmrs_idx;
|
||||
nr_cce_t cce;
|
||||
nr_reg_t reg;
|
||||
nr_reg_t reg_mapping_list[NR_MAX_PDCCH_AGG_LEVEL*NR_NB_REG_PER_CCE];
|
||||
|
||||
/*First iteration: single DCI*/
|
||||
NR_gNB_DCI_ALLOC_t dci_alloc = pdcch_vars.dci_alloc[0];
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t pdcch_params = dci_alloc.pdcch_params;
|
||||
uint16_t dmrs_length = dci_alloc.L*36; //2(QPSK)*3(per RB)*6(REG per CCE)
|
||||
uint16_t encoded_length = dci_alloc.L*108; //2(QPSK)*9(per RB)*6(REG per CCE)
|
||||
|
||||
/*The coreset is initialised
|
||||
* in frequency: the first subcarrier is obtained by adding the first CRB overlapping the SSB and the rb_offset
|
||||
* in time: by its first slot and its first symbol*/
|
||||
uint16_t cset_start_sc = frame_parms.first_carrier_offset + ((int)floor(frame_parms.ssb_start_subcarrier/NR_NB_SC_PER_RB)+pdcch_params.rb_offset)*NR_NB_SC_PER_RB;
|
||||
uint8_t cset_start_symb = pdcch_params.first_slot*frame_parms.symbols_per_slot + pdcch_params.first_symbol;
|
||||
uint8_t cset_nsymb = pdcch_params.n_symb;
|
||||
dci_idx = 0;
|
||||
|
||||
/// DMRS QPSK modulation
|
||||
/*There is a need to shift from which index the pregenerated DMRS sequence is used
|
||||
* see 38211 r15.2.0 section 7.4.1.3.2: assumption is the reference point for k refers to the DMRS sequence*/
|
||||
if (pdcch_params.config_type == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG)
|
||||
gold_pdcch_dmrs += ((int)floor(frame_parms.ssb_start_subcarrier/NR_NB_SC_PER_RB)+pdcch_params.rb_offset)*3/32;
|
||||
|
||||
for (int symb=cset_start_symb; symb<cset_start_symb + pdcch_params.n_symb; symb++) {
|
||||
for (int i=0; i<dmrs_length>>1; i++) {
|
||||
idx = ((((gold_pdcch_dmrs[symb][(i<<1)>>5])>>((i<<1)&0x1f))&1)<<1) ^ (((gold_pdcch_dmrs[symb][((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1);
|
||||
mod_dmrs[symb][i<<1] = nr_mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
|
||||
mod_dmrs[symb][(i<<1)+1] = nr_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||
#ifdef DEBUG_PDCCH_DMRS
|
||||
printf("symb %d i %d idx %d gold seq %u b0-b1 %d-%d mod_dmrs %d %d\n", symb, i, idx, gold_pdcch_dmrs[symb][(i<<1)>>5],
|
||||
(((gold_pdcch_dmrs[symb][(i<<1)>>5])>>((i<<1)&0x1f))&1), (((gold_pdcch_dmrs[symb][((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1),
|
||||
mod_dmrs[symb][(i<<1)], mod_dmrs[symb][(i<<1)+1]);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// DCI payload processing
|
||||
// CRC attachment + Scrambling + Channel coding + Rate matching
|
||||
uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD];
|
||||
uint16_t n_RNTI = (pdcch_params.search_space_type == NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC)? ((pdcch_params.scrambling_id)?pdcch_params.rnti:0) : 0;
|
||||
uint16_t Nid = (pdcch_params.search_space_type == NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC)? pdcch_params.scrambling_id : config.sch_config.physical_cell_id.value;
|
||||
#ifdef PDCCH_TEST_POLAR_TEMP_FIX
|
||||
t_nrPolar_paramsPtr currentPtr = NULL;//, polarParams = NULL;
|
||||
nr_polar_init(¤tPtr, NR_POLAR_DCI_MESSAGE_TYPE, dci_alloc.size, dci_alloc.L);
|
||||
// t_nrPolar_paramsPtr currentPtr = nr_polar_params(*nrPolar_params, NR_POLAR_DCI_MESSAGE_TYPE, dci_alloc.size, dci_alloc.L);
|
||||
#else
|
||||
nr_polar_init(nrPolar_params, NR_POLAR_DCI_MESSAGE_TYPE, dci_alloc.size, dci_alloc.L);
|
||||
t_nrPolar_paramsPtr currentPtr = nr_polar_params(*nrPolar_params, NR_POLAR_DCI_MESSAGE_TYPE, dci_alloc.size, dci_alloc.L);
|
||||
#endif
|
||||
polar_encoder_dci(dci_alloc.dci_pdu, encoder_output, currentPtr, pdcch_params.rnti);
|
||||
|
||||
#ifdef DEBUG_CHANNEL_CODING
|
||||
printf("DCI PDU: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
dci_alloc.dci_pdu[0], dci_alloc.dci_pdu[1], dci_alloc.dci_pdu[2], dci_alloc.dci_pdu[3]);
|
||||
printf("Encoded Payload: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
encoder_output[0], encoder_output[1], encoder_output[2], encoder_output[3]);
|
||||
#endif
|
||||
|
||||
/// Scrambling
|
||||
uint32_t scrambled_output[NR_MAX_DCI_SIZE_DWORD];
|
||||
nr_pdcch_scrambling(encoder_output, encoded_length, Nid, n_RNTI, scrambled_output);
|
||||
|
||||
// QPSK modulation
|
||||
int16_t mod_dci[NR_MAX_DCI_SIZE>>1];
|
||||
for (int i=0; i<encoded_length>>1; i++) {
|
||||
idx = ((((scrambled_output[(i<<1)>>5])>>((i<<1)&0x1f))&1)<<1) ^ (((scrambled_output[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1);
|
||||
mod_dci[i<<1] = nr_mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
|
||||
mod_dci[(i<<1)+1] = nr_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||
#ifdef DEBUG_DCI
|
||||
printf("i %d idx %d b0-b1 %d-%d mod_dci %d %d\n", i, idx, (((encoder_output[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||
(((encoder_output[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), mod_dci[(i<<1)], mod_dci[(i<<1)+1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
/// Resource mapping
|
||||
a = (config.rf_config.tx_antenna_ports.value == 1) ? amp : (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
|
||||
for (int aa = 0; aa < config.rf_config.tx_antenna_ports.value; aa++)
|
||||
{
|
||||
if (cset_start_sc >= frame_parms.ofdm_symbol_size)
|
||||
cset_start_sc -= frame_parms.ofdm_symbol_size;
|
||||
|
||||
|
||||
/*Reorder REG list for a freq first mapping*/
|
||||
uint8_t symb_idx[NR_MAX_CSET_DURATION] = {0,0,0};
|
||||
uint8_t nb_regs = dci_alloc.L*NR_NB_REG_PER_CCE;
|
||||
uint8_t regs_per_symb = nb_regs/cset_nsymb;
|
||||
for (int cce_idx=0; cce_idx<dci_alloc.L; cce_idx++){
|
||||
cce = dci_alloc.cce_list[cce_idx];
|
||||
for (int reg_idx=0; reg_idx<NR_NB_REG_PER_CCE; reg_idx++) {
|
||||
reg = cce.reg_list[reg_idx];
|
||||
reg_mapping_list[reg.symb_idx*regs_per_symb + symb_idx[reg.symb_idx]++] = reg;
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_DCI
|
||||
printf("\n Ordered REG list:\n");
|
||||
for (int i=0; i<nb_regs; i++)
|
||||
printf("%d\t",reg_mapping_list[i].reg_idx );
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
if (pdcch_params.precoder_granularity == NFAPI_NR_CSET_ALL_CONTIGUOUS_RBS) {
|
||||
/*in this case the DMRS are mapped on all the coreset*/
|
||||
for (l=cset_start_symb; l<cset_start_symb+ cset_nsymb; l++) {
|
||||
dmrs_idx = 0;
|
||||
k = cset_start_sc + 1;
|
||||
while (dmrs_idx<3*pdcch_params.n_rb) {
|
||||
((int16_t*)txdataF[aa])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (a * mod_dmrs[l][dmrs_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
|
||||
k+=4;
|
||||
if (k >= frame_parms.ofdm_symbol_size)
|
||||
k -= frame_parms.ofdm_symbol_size;
|
||||
dmrs_idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*Now mapping the encoded DCI based on newly constructed REG list
|
||||
* and the DMRS for the precoder granularity same as REG bundle*/
|
||||
for (int reg_idx=0; reg_idx<nb_regs; reg_idx++) {
|
||||
reg = reg_mapping_list[reg_idx];
|
||||
k = cset_start_sc + reg.start_sc_idx;
|
||||
if (k >= frame_parms.ofdm_symbol_size)
|
||||
k -= frame_parms.ofdm_symbol_size;
|
||||
l = cset_start_symb + reg.symb_idx;
|
||||
dmrs_idx = (reg.reg_idx/cset_nsymb)*3;
|
||||
k_prime = 0;
|
||||
for (int m=0; m<NR_NB_SC_PER_RB; m++) {
|
||||
if ( m == (k_prime<<2)+1) { // DMRS if not already mapped
|
||||
if (pdcch_params.precoder_granularity == NFAPI_NR_CSET_SAME_AS_REG_BUNDLE) {
|
||||
((int16_t*)txdataF[aa])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (a * mod_dmrs[l][dmrs_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
|
||||
k_prime++;
|
||||
dmrs_idx++;
|
||||
}
|
||||
}
|
||||
else { // DCI payload
|
||||
((int16_t*)txdataF[aa])[(l*frame_parms.ofdm_symbol_size + k)<<1] = (a * mod_dci[dci_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[aa])[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (a * mod_dci[(dci_idx<<1) + 1]) >> 15;
|
||||
dci_idx++;
|
||||
}
|
||||
k++;
|
||||
if (k >= frame_parms.ofdm_symbol_size)
|
||||
k -= frame_parms.ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_DCI
|
||||
write_output("txdataF_dci.m", "txdataF_dci", txdataF[0], frame_parms.samples_per_frame_wCP>>1, 1, 1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -22,19 +22,38 @@
|
||||
#ifndef __PHY_NR_TRANSPORT_DCI__H
|
||||
#define __PHY_NR_TRANSPORT_DCI__H
|
||||
|
||||
#include "defs_gNB.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
|
||||
typedef unsigned __int128 uint128_t;
|
||||
|
||||
uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
nr_rnti_type_e rnti,
|
||||
NR_BWP_PARMS bwp,
|
||||
uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
|
||||
nfapi_nr_rnti_type_e rnti_type,
|
||||
NR_BWP_PARMS* bwp,
|
||||
nfapi_nr_config_request_t* config);
|
||||
|
||||
uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc,
|
||||
uint8_t nr_generate_dci_top(NR_gNB_PDCCH pdcch_vars,
|
||||
t_nrPolar_paramsPtr *nrPolar_params,
|
||||
uint32_t **gold_pdcch_dmrs,
|
||||
int32_t** txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
nfapi_nr_config_request_t* config)
|
||||
NR_DL_FRAME_PARMS frame_parms,
|
||||
nfapi_nr_config_request_t config);
|
||||
|
||||
void nr_pdcch_scrambling(uint32_t *in,
|
||||
uint8_t size,
|
||||
uint32_t Nid,
|
||||
uint32_t n_RNTI,
|
||||
uint32_t* out);
|
||||
|
||||
void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int subframe,
|
||||
gNB_rxtx_proc_t *proc,
|
||||
NR_gNB_DCI_ALLOC_t *dci_alloc,
|
||||
nfapi_nr_dl_config_request_pdu_t *pdu);
|
||||
|
||||
void nr_fill_cce_list(NR_gNB_DCI_ALLOC_t* dci_alloc, uint16_t n_shift, uint8_t m);
|
||||
|
||||
|
||||
#endif //__PHY_NR_TRANSPORT_DCI__H
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_TRANSPORT/nr_dci_tools.c
|
||||
* \brief
|
||||
* \author
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "nr_dci.h"
|
||||
|
||||
|
||||
void nr_fill_cce_list(NR_gNB_DCI_ALLOC_t* dci_alloc, uint16_t n_shift, uint8_t m) {
|
||||
|
||||
nr_cce_t* cce;
|
||||
nr_reg_t* reg;
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params = &dci_alloc->pdcch_params;
|
||||
|
||||
uint8_t L = dci_alloc->L;
|
||||
uint8_t bsize = pdcch_params->reg_bundle_size;
|
||||
uint8_t R = pdcch_params->interleaver_size;
|
||||
uint16_t N_reg = pdcch_params->n_rb * pdcch_params->n_symb;
|
||||
uint16_t Y, N_cce, M_s_max, n_CI=0, tmp, C;
|
||||
|
||||
if (pdcch_params->config_type == NFAPI_NR_CSET_CONFIG_MIB_SIB1)
|
||||
AssertFatal(L>=4, "Invalid aggregation level for SIB1 configured PDCCH %d\n", L);
|
||||
|
||||
N_cce = N_reg / NR_NB_REG_PER_CCE;
|
||||
/*Max number of candidates per aggregation level -- SIB1 configured search space only*/
|
||||
M_s_max = (L==4)?4:(L==8)?2:1;
|
||||
|
||||
if (pdcch_params->search_space_type == NFAPI_NR_SEARCH_SPACE_TYPE_COMMON)
|
||||
Y = 0;
|
||||
else { //NFAPI_NR_SEARCH_SPACE_TYPE_UE_SPECIFIC
|
||||
}
|
||||
|
||||
uint8_t cond = N_reg%(bsize*R);
|
||||
AssertFatal(cond==0, "CCE to REG interleaving: Invalid configuration leading to non integer C\n");
|
||||
C = N_reg/(bsize*R);
|
||||
|
||||
tmp = L * (( Y + (uint16_t)(floor((m*N_cce)/(L*M_s_max))) + n_CI ) % ((uint16_t)floor(N_cce/L)));
|
||||
|
||||
LOG_I(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d tmp %d\n", m, bsize, R, tmp);
|
||||
for (uint8_t cce_idx=0; cce_idx<L; cce_idx++) {
|
||||
cce = &dci_alloc->cce_list[cce_idx];
|
||||
cce->cce_idx = tmp + cce_idx;
|
||||
LOG_D(PHY, "cce_idx %d\n", cce->cce_idx);
|
||||
|
||||
if (pdcch_params->cr_mapping_type == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) {
|
||||
LOG_D(PHY, "Interleaved CCE to REG mapping\n");
|
||||
uint8_t j = cce->cce_idx, j_prime;
|
||||
uint8_t r,c,idx;
|
||||
|
||||
for (uint8_t bundle_idx=0; bundle_idx<NR_NB_REG_PER_CCE/bsize; bundle_idx++) {
|
||||
j_prime = 6*j/bsize + bundle_idx;
|
||||
r = j_prime%R;
|
||||
c = (j_prime-r)/R;
|
||||
idx = (r*C + c + n_shift)%(N_reg/bsize);
|
||||
LOG_D(PHY, "bundle idx = %d \n j = %d \t j_prime = %d \t r = %d \t c = %d\n", idx, j , j_prime, r, c);
|
||||
|
||||
for (uint8_t reg_idx=0; reg_idx<bsize; reg_idx++) {
|
||||
reg = &cce->reg_list[reg_idx];
|
||||
reg->reg_idx = bsize*idx + reg_idx;
|
||||
reg->start_sc_idx = (reg->reg_idx/pdcch_params->n_symb) * NR_NB_SC_PER_RB;
|
||||
reg->symb_idx = reg->reg_idx % pdcch_params->n_symb;
|
||||
LOG_D(PHY, "reg %d symbol %d start subcarrier %d\n", reg->reg_idx, reg->symb_idx, reg->start_sc_idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
else { // NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED
|
||||
LOG_D(PHY, "Non interleaved CCE to REG mapping\n");
|
||||
for (uint8_t reg_idx=0; reg_idx<NR_NB_REG_PER_CCE; reg_idx++) {
|
||||
reg = &cce->reg_list[reg_idx];
|
||||
reg->reg_idx = cce->cce_idx*NR_NB_REG_PER_CCE + reg_idx;
|
||||
reg->start_sc_idx = (reg->reg_idx/pdcch_params->n_symb) * NR_NB_SC_PER_RB;
|
||||
reg->symb_idx = reg->reg_idx % pdcch_params->n_symb;
|
||||
LOG_D(PHY, "reg %d symbol %d start subcarrier %d\n", reg->reg_idx, reg->symb_idx, reg->start_sc_idx);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void nr_fill_dci_and_dlsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int subframe,
|
||||
gNB_rxtx_proc_t *proc,
|
||||
NR_gNB_DCI_ALLOC_t *dci_alloc,
|
||||
nfapi_nr_dl_config_request_pdu_t *pdu)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
uint8_t n_shift;
|
||||
uint32_t *dci_pdu = dci_alloc->dci_pdu;
|
||||
memset((void*)dci_pdu,0,4*sizeof(uint32_t));
|
||||
nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &pdu->dci_dl_pdu.dci_dl_pdu_rel15;
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &pdu->dci_dl_pdu.pdcch_params_rel15;
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
|
||||
uint16_t N_RB = fp->initial_bwp_dl.N_RB;
|
||||
uint8_t fsize=0, pos=0, cand_idx=0;
|
||||
|
||||
/// Payload generation
|
||||
switch(params_rel15->dci_format) {
|
||||
|
||||
case NFAPI_NR_DL_DCI_FORMAT_1_0:
|
||||
switch(params_rel15->rnti_type) {
|
||||
case NFAPI_NR_RNTI_RA:
|
||||
// Freq domain assignment
|
||||
fsize = (int)ceil( log2( (N_RB*(N_RB+1))>>1 ) );
|
||||
for (int i=0; i<fsize; i++)
|
||||
*dci_pdu |= ((pdu_rel15->frequency_domain_assignment>>(fsize-i-1))&1)<<pos++;
|
||||
// Time domain assignment
|
||||
for (int i=0; i<4; i++)
|
||||
*dci_pdu |= ((pdu_rel15->time_domain_assignment>>(3-i))&1)<<pos++;
|
||||
// VRB to PRB mapping
|
||||
*dci_pdu |= (pdu_rel15->vrb_to_prb_mapping&1)<<pos++;
|
||||
// MCS
|
||||
for (int i=0; i<5; i++)
|
||||
*dci_pdu |= ((pdu_rel15->mcs>>(4-i))&1)<<pos++;
|
||||
// TB scaling
|
||||
for (int i=0; i<2; i++)
|
||||
*dci_pdu |= ((pdu_rel15->tb_scaling>>(1-i))&1)<<pos++;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case NFAPI_NR_UL_DCI_FORMAT_0_0:
|
||||
break;
|
||||
}
|
||||
|
||||
LOG_I(PHY, "DCI PDU: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n",
|
||||
dci_pdu[0], dci_pdu[1], dci_pdu[2], dci_pdu[3]);
|
||||
|
||||
/// rest of DCI alloc
|
||||
dci_alloc->L = 8;
|
||||
memcpy((void*)&dci_alloc->pdcch_params, (void*)params_rel15, sizeof(nfapi_nr_dl_config_pdcch_parameters_rel15_t));
|
||||
dci_alloc->size = nr_get_dci_size(dci_alloc->pdcch_params.dci_format,
|
||||
dci_alloc->pdcch_params.rnti_type,
|
||||
&fp->initial_bwp_dl,
|
||||
cfg);
|
||||
n_shift = (dci_alloc->pdcch_params.config_type == NFAPI_NR_CSET_CONFIG_MIB_SIB1)?
|
||||
cfg->sch_config.physical_cell_id.value : dci_alloc->pdcch_params.shift_index;
|
||||
nr_fill_cce_list(dci_alloc, n_shift, cand_idx);
|
||||
LOG_I(PHY, "DCI type %d payload (size %d) generated on candidate %d\n", dci_alloc->pdcch_params.dci_format, dci_alloc->size, cand_idx);
|
||||
|
||||
}
|
||||
@@ -137,28 +137,24 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
uint8_t nushift,
|
||||
uint16_t M,
|
||||
uint16_t length,
|
||||
uint8_t bitwise)
|
||||
uint8_t encoded)
|
||||
{
|
||||
uint8_t reset, offset;
|
||||
uint32_t x1, x2, s=0;
|
||||
uint8_t *pbch_e = pbch->pbch_e;
|
||||
uint32_t *pbch_a_prime = (uint32_t*)pbch->pbch_a_prime;
|
||||
uint32_t *pbch_a_interleaved = (uint32_t*)pbch->pbch_a_interleaved;
|
||||
uint32_t *pbch_e = pbch->pbch_e;
|
||||
uint32_t unscrambling_mask = 0x100006D;
|
||||
|
||||
reset = 1;
|
||||
// x1 is set in lte_gold_generic
|
||||
x2 = Nid;
|
||||
|
||||
// The Gold sequence is shifted by nushift* M, so we skip (nushift*M /32) double words
|
||||
for (int i=0; i<(uint16_t)ceil((nushift*M)/32); i++) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
for (int i=0; i<(uint16_t)ceil(((float)nushift*M)/32); i++) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
// Scrambling is now done with offset (nushift*M)%32
|
||||
offset = (nushift*M)&0x1f;
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("Scrambling params: nushift %d M %d length %d bitwise %d offset %d\n", nushift, M, length, bitwise, offset);
|
||||
printf("Scrambling params: nushift %d M %d length %d encoded %d offset %d\n", nushift, M, length, encoded, offset);
|
||||
#endif
|
||||
|
||||
for (int i=0; i<length; i++) {
|
||||
@@ -169,12 +165,11 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("s: %04x\t", s);
|
||||
#endif
|
||||
if (bitwise) {
|
||||
(*pbch_a_prime) ^= ((unscrambling_mask>>i)&1)? (((*pbch_a_interleaved)>>i)&1)<<i : ((((*pbch_a_interleaved)>>i)&1) ^ ((s>>((i+offset)&0x1f))&1))<<i;
|
||||
}
|
||||
if (!encoded)
|
||||
pbch->pbch_a_prime ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_interleaved>>i)&1)<<i : (((pbch->pbch_a_interleaved>>i)&1) ^ ((s>>((i+offset)&0x1f))&1))<<i;
|
||||
|
||||
else
|
||||
pbch_e[i] = (pbch_e[i]&1) ^ ((s>>((i+offset)&0x1f))&1);
|
||||
pbch_e[i>>5] ^= (((s>>((i+offset)&0x1f))&1)<<(i&0x1f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,6 +195,7 @@ uint8_t nr_pbch_payload_interleaver(uint8_t i) {
|
||||
// 29,31,16,23,18,17,8,30,10,6,24,7,0,5,3,2};
|
||||
|
||||
int nr_generate_pbch(NR_gNB_PBCH *pbch,
|
||||
t_nrPolar_paramsPtr polar_params,
|
||||
uint8_t *pbch_pdu,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
@@ -224,6 +220,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
|
||||
|
||||
LOG_I(PHY, "PBCH generation started\n");
|
||||
|
||||
memset((void*)pbch, 0, sizeof(NR_gNB_PBCH));
|
||||
///Payload generation
|
||||
// Fix byte endian
|
||||
if (!(sfn&7))
|
||||
@@ -258,59 +255,50 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
|
||||
in |= (uint32_t)(pbch->pbch_a[i]<<((3-i)<<3));
|
||||
|
||||
for (int i=0; i<32; i++) {
|
||||
out |= ((in>>i)&1)<<(nr_pbch_payload_interleaver(i));//nr_pbch_payload_interleaving_pattern[i]
|
||||
pbch->pbch_a_interleaved |= ((in>>i)&1)<<(nr_pbch_payload_interleaver(i));//nr_pbch_payload_interleaving_pattern[i]
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) %d\n", i, in, out, nr_pbch_payload_interleaver(i), (in>>i)&1);
|
||||
printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) %d\n", i, in, pbch->pbch_a_interleaved, nr_pbch_payload_interleaver(i), (in>>i)&1);
|
||||
#endif
|
||||
}
|
||||
|
||||
for (int i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS>>3; i++)
|
||||
pbch->pbch_a_interleaved[i] = (uint8_t)((out>>(i<<3))&0xff);
|
||||
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("Interleaving:\n");
|
||||
for (int i=0; i<4; i++)
|
||||
printf("pbch_a_interleaved[%d]: 0x%02x\n", i, pbch->pbch_a_interleaved[i]);
|
||||
printf("pbch_a_interleaved: 0x%08x\n", pbch->pbch_a_interleaved);
|
||||
#endif
|
||||
|
||||
// Scrambling
|
||||
M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3);
|
||||
nushift = (((sfn>>2)&1)<<1) ^ ((sfn>>1)&1);
|
||||
nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_PAYLOAD_BITS, 1);
|
||||
pbch->pbch_a_prime = 0;
|
||||
nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_PAYLOAD_BITS, 0);
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("Payload scrambling:\n");
|
||||
for (int i=0; i<4; i++)
|
||||
printf("pbch_a_prime[%d]: 0x%02x\n", i, pbch->pbch_a_prime[i]);
|
||||
printf("Payload scrambling: nushift %d M %d sfn3 %d sfn2 %d\n", nushift, M, (sfn>>2)&1, (sfn>>1)&1);
|
||||
printf("pbch_a_prime: 0x%08x\n", pbch->pbch_a_prime);
|
||||
#endif
|
||||
|
||||
//for (int m=0;m<32;m++){
|
||||
//pbch_a_b[m] = ((pbch->pbch_a_prime[m/8]>>(m&7))&01);
|
||||
//printf("pbch_a_b[%d] %d\n", m, pbch_a_b[m] );
|
||||
//}
|
||||
|
||||
/// CRC, coding and rate matching
|
||||
polar_encoder (pbch->pbch_a_prime, pbch->pbch_e, &frame_parms->pbch_polar_params);
|
||||
polar_encoder (&pbch->pbch_a_prime, pbch->pbch_e, polar_params);
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("Channel coding:\n");
|
||||
for (int i=0; i<NR_POLAR_PBCH_E>>3; i++)
|
||||
printf("pbch_e[%d]: 0x%02x\t", i, pbch->pbch_e[i]);
|
||||
for (int i=0; i<NR_POLAR_PBCH_E_DWORD; i++)
|
||||
printf("pbch_e[%d]: 0x%08x\t", i, pbch->pbch_e[i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
/// Scrambling
|
||||
M = NR_POLAR_PBCH_E;
|
||||
nushift = (Lmax==4)? ssb_index&3 : ssb_index&7;
|
||||
nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_E, 0);
|
||||
nr_pbch_scrambling(pbch, (uint32_t)config->sch_config.physical_cell_id.value, nushift, M, NR_POLAR_PBCH_E, 1);
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
printf("Scrambling:\n");
|
||||
for (int i=0; i<NR_POLAR_PBCH_E>>3; i++)
|
||||
printf("pbch_e[%d]: 0x%02x\t", i, pbch->pbch_e[i]);
|
||||
for (int i=0; i<NR_POLAR_PBCH_E_DWORD; i++)
|
||||
printf("pbch_e[%d]: 0x%08x\t", i, pbch->pbch_e[i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
/// QPSK modulation
|
||||
for (int i=0; i<NR_POLAR_PBCH_E>>1; i++){
|
||||
idx = ((pbch->pbch_e[i<<1]&1)<<1) ^ (pbch->pbch_e[(i<<1)+1]&1);
|
||||
idx = (((pbch->pbch_e[(i<<1)>>5]>>((i<<1)&0x1f))&1)<<1) ^ ((pbch->pbch_e[((i<<1)+1)>>5]>>(((i<<1)+1)&0x1f))&1);
|
||||
mod_pbch_e[i<<1] = nr_mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
|
||||
mod_pbch_e[(i<<1)+1] = nr_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1)+1];
|
||||
|
||||
|
||||
@@ -1,35 +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
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_TRANSPORT/nr_pdcch.c
|
||||
* \brief Implements PDCCH physical channel TX/RX procedures (38.211). Current NR compliance V15.1 2018-06.
|
||||
* \author Guy De Souza
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: desouza@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "nr_dci.h"
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
uint8_t nushift,
|
||||
uint16_t M,
|
||||
uint16_t length,
|
||||
uint8_t bitwise);
|
||||
uint8_t encoded);
|
||||
|
||||
/*!
|
||||
\fn int nr_generate_pbch
|
||||
@@ -84,6 +84,7 @@ void nr_pbch_scrambling(NR_gNB_PBCH *pbch,
|
||||
@returns 0 on success
|
||||
*/
|
||||
int nr_generate_pbch(NR_gNB_PBCH *pbch,
|
||||
t_nrPolar_paramsPtr polar_params,
|
||||
uint8_t *pbch_pdu,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
|
||||
@@ -326,10 +326,17 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
for (int m =0; m<12; m++)
|
||||
printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]);
|
||||
#endif
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
dl_ch+=24;
|
||||
k+=12;
|
||||
|
||||
|
||||
|
||||
for (pilot_cnt=3; pilot_cnt<(3*nb_rb_coreset); pilot_cnt+=3) {
|
||||
|
||||
|
||||
+921
-3485
File diff suppressed because it is too large
Load Diff
@@ -49,8 +49,8 @@ struct NR_DCI_INFO_EXTRACTED {
|
||||
uint8_t sul_ind_0_1 ; // 2 SUL_IND_0_1:
|
||||
uint8_t slot_format_ind ; // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213]
|
||||
uint8_t pre_emption_ind ; // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits
|
||||
uint8_t tpc_cmd_number ; // 5 TPC_CMD_NUMBER: The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits
|
||||
uint8_t block_number ; // 6 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3
|
||||
uint8_t block_number ; // 5 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3
|
||||
uint8_t close_loop_ind ; // 6 CLOSE_LOOP_IND:
|
||||
uint8_t bandwidth_part_ind ; // 7 BANDWIDTH_PART_IND:
|
||||
uint8_t short_message_ind ; // 8 SHORT_MESSAGE_IND:
|
||||
uint8_t short_messages ; // 9 SHORT_MESSAGES:
|
||||
@@ -93,7 +93,7 @@ struct NR_DCI_INFO_EXTRACTED {
|
||||
uint8_t antenna_ports ; // 38 ANTENNA_PORTS:
|
||||
uint8_t tci ; // 39 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits
|
||||
uint8_t srs_request ; // 40 SRS_REQUEST:
|
||||
uint8_t tpc_cmd_number_format2_3 ; // 41 TPC_CMD_NUMBER_FORMAT2_3:
|
||||
uint8_t tpc_cmd ; // 41 TPC_CMD:
|
||||
uint8_t csi_request ; // 42 CSI_REQUEST:
|
||||
uint8_t cbgti ; // 43 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH
|
||||
uint8_t cbgfi ; // 44 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -32,11 +32,11 @@
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "nr_transport_proto_ue.h"
|
||||
//#include "SCHED/defs.h"
|
||||
//#include "SCHED/extern.h"
|
||||
//#include "defs.h"
|
||||
//#include "extern.h"
|
||||
|
||||
|
||||
#include "common_lib.h"
|
||||
|
||||
@@ -45,20 +45,16 @@
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
static nfapi_nr_config_request_t config_t;
|
||||
static nfapi_nr_config_request_t* config =&config_t;
|
||||
//static nfapi_nr_config_request_t config_t;
|
||||
//static nfapi_nr_config_request_t* config =&config_t;
|
||||
int cnt=0;
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms_single(nfapi_nr_config_request_t *config, NR_DL_FRAME_PARMS *frame_parms);
|
||||
|
||||
//#define DEBUG_INITIAL_SYNCH
|
||||
|
||||
int nr_pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
{
|
||||
printf("nr pbch detec RB_DL %d\n", ue->frame_parms.N_RB_DL);
|
||||
uint8_t l,pbch_decoded,frame_mod4,pbch_tx_ant,dummy;
|
||||
NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
char phich_resource[6];
|
||||
int ret =-1;
|
||||
|
||||
#ifdef DEBUG_INITIAL_SYNCH
|
||||
@@ -98,23 +94,15 @@ int nr_pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
|
||||
frame_parms->nb_prefix_samples0 = nb_prefix_samples0;
|
||||
|
||||
pbch_decoded = 0;
|
||||
|
||||
printf("pbch_detection nid_cell %d\n",frame_parms->Nid_cell);
|
||||
|
||||
//for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
|
||||
ret = nr_rx_pbch(ue,
|
||||
&ue->proc.proc_rxtx[0],
|
||||
ue->pbch_vars[0],
|
||||
frame_parms,
|
||||
0,
|
||||
SISO,
|
||||
ue->high_speed_flag,
|
||||
frame_mod4);
|
||||
|
||||
pbch_decoded = 0; //to be updated
|
||||
// break;
|
||||
//}
|
||||
ue->high_speed_flag);
|
||||
|
||||
|
||||
if (ret==0) {
|
||||
@@ -156,18 +144,18 @@ char prefix_string[2][9] = {"NORMAL","EXTENDED"};
|
||||
int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
{
|
||||
|
||||
int32_t sync_pos, sync_pos2, k_ssb, N_ssb_crb, sync_pos_slot;
|
||||
int32_t sync_pos, sync_pos2, sync_pos_slot; // k_ssb, N_ssb_crb,
|
||||
int32_t metric_fdd_ncp=0;
|
||||
uint8_t phase_fdd_ncp;
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
int ret=-1;
|
||||
int aarx,rx_power=0;
|
||||
int rx_power=0; //aarx,
|
||||
//nfapi_nr_config_request_t* config;
|
||||
|
||||
/*offset parameters to be updated from higher layer */
|
||||
k_ssb =0;
|
||||
N_ssb_crb = 0;
|
||||
//k_ssb =0;
|
||||
//N_ssb_crb = 0;
|
||||
|
||||
/*#ifdef OAI_USRP
|
||||
__m128i *rxdata128;
|
||||
@@ -176,7 +164,6 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
// First try FDD normal prefix
|
||||
frame_parms->Ncp=NORMAL;
|
||||
frame_parms->frame_type=TDD;
|
||||
set_default_frame_parms_single(config,frame_parms);
|
||||
nr_init_frame_parms_ue(frame_parms);
|
||||
LOG_D(PHY,"nr_initial sync ue RB_DL %d\n", ue->frame_parms.N_RB_DL);
|
||||
/*
|
||||
@@ -235,16 +222,18 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
|
||||
rx_sss_nr(ue,&metric_fdd_ncp,&phase_fdd_ncp);
|
||||
|
||||
//set_default_frame_parms_single(config,&ue->frame_parms);
|
||||
nr_init_frame_parms_ue(config,&ue->frame_parms);
|
||||
nr_init_frame_parms_ue(&ue->frame_parms);
|
||||
|
||||
nr_gold_pbch(ue);
|
||||
ret = nr_pbch_detection(ue,mode);
|
||||
|
||||
nr_gold_pdcch(ue,0, 2);
|
||||
nr_slot_fep(ue,0, 0, ue->rx_offset, 1, 1, NR_PDCCH_EST);
|
||||
nr_slot_fep(ue,1, 0, ue->rx_offset, 1, 1, NR_PDCCH_EST);
|
||||
|
||||
int nb_prefix_samples0 = frame_parms->nb_prefix_samples0;
|
||||
frame_parms->nb_prefix_samples0 = 0;
|
||||
|
||||
nr_slot_fep(ue,0, 0, ue->rx_offset, 0, 1, NR_PDCCH_EST);
|
||||
nr_slot_fep(ue,1, 0, ue->rx_offset, 0, 1, NR_PDCCH_EST);
|
||||
frame_parms->nb_prefix_samples0 = nb_prefix_samples0;
|
||||
|
||||
LOG_I(PHY,"[UE %d] AUTOTEST Cell Sync : frame = %d, rx_offset %d, freq_offset %d \n",
|
||||
ue->Mod_id,
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "PHY/CODING/coding_extern.h"
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
//#include "SIMULATION/TOOLS/sim.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
#define DEBUG_PBCH 1
|
||||
//#define DEBUG_PBCH_ENCODING
|
||||
@@ -396,12 +396,9 @@ void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
|
||||
uint16_t length,
|
||||
uint8_t bitwise)
|
||||
{
|
||||
int i;
|
||||
uint8_t reset, offset;
|
||||
uint32_t x1, x2, s=0;
|
||||
int16_t *demod_pbch_e = pbch->llr;
|
||||
uint32_t *pbch_a_prime = (uint32_t*)pbch->pbch_a_prime;
|
||||
uint32_t *pbch_a_interleaved = (uint32_t*)pbch->pbch_a_interleaved;
|
||||
double *demod_pbch_e = pbch->demod_pbch_e;
|
||||
uint32_t unscrambling_mask = 0x100006D;
|
||||
|
||||
printf("unscramb nid_cell %d\n",Nid);
|
||||
@@ -411,7 +408,7 @@ void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
|
||||
x2 = Nid; //this is c_init
|
||||
|
||||
// The Gold sequence is shifted by nushift* M, so we skip (nushift*M /32) double words
|
||||
for (int i=0; i<(uint16_t)ceil((nushift*M)/32); i++) {
|
||||
for (int i=0; i<(uint16_t)ceil(((float)nushift*M)/32); i++) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
@@ -426,9 +423,11 @@ void nr_pbch_unscrambling(NR_UE_PBCH *pbch,
|
||||
#ifdef DEBUG_PBCH_ENCODING
|
||||
if (i<8)
|
||||
printf("s: %04x\t", s);
|
||||
printf("pbch_a_interleaved 0x%08x\n", pbch->pbch_a_interleaved);
|
||||
#endif
|
||||
if (bitwise) {
|
||||
(*pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? (((*pbch_a_prime)>>i)&1)<<i : ((((*pbch_a_prime)>>i)&1) ^ ((s>>((i+offset)&0x1f))&1))<<i;
|
||||
|
||||
(pbch->pbch_a_interleaved) ^= ((unscrambling_mask>>i)&1)? ((pbch->pbch_a_prime>>i)&1)<<i : (((pbch->pbch_a_prime>>i)&1) ^ ((s>>((i+offset)&0x1f))&1))<<i;
|
||||
}
|
||||
|
||||
else {
|
||||
@@ -512,8 +511,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4)
|
||||
uint32_t high_speed_flag)
|
||||
{
|
||||
|
||||
NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars;
|
||||
@@ -524,8 +522,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
int symbol,i;
|
||||
//uint8_t pbch_a[64];
|
||||
uint8_t *pbch_a = malloc(sizeof(uint8_t) * 32);
|
||||
uint8_t *pbch_a_prime;
|
||||
uint8_t *pbch_a_b = malloc(sizeof(uint8_t) *NR_POLAR_PBCH_PAYLOAD_BITS);
|
||||
uint32_t pbch_a_prime;
|
||||
int8_t *pbch_e_rx;
|
||||
uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output;
|
||||
uint8_t nushift;
|
||||
@@ -546,17 +543,10 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
|
||||
//printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell);
|
||||
|
||||
reset_meas(&polar_decoder_init);
|
||||
reset_meas(&polar_rate_matching);
|
||||
reset_meas(&decoding);
|
||||
reset_meas(&bit_extraction);
|
||||
reset_meas(&deinterleaving);
|
||||
reset_meas(&sorting);
|
||||
reset_meas(&path_metric);
|
||||
reset_meas(&update_LLR);
|
||||
|
||||
|
||||
int subframe_rx = proc->subframe_rx;
|
||||
|
||||
printf("ue->current_thread_id[subframe_rx] %d subframe_rx %d\n",ue->current_thread_id[subframe_rx], subframe_rx);
|
||||
|
||||
pbch_e_rx = &nr_ue_pbch_vars->llr[0];
|
||||
|
||||
@@ -635,15 +625,14 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
pbch_e_rx = nr_ue_pbch_vars->llr;
|
||||
//demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e;
|
||||
pbch_a = nr_ue_pbch_vars->pbch_a;
|
||||
pbch_a_prime = nr_ue_pbch_vars->pbch_a_prime;
|
||||
|
||||
//#ifdef DEBUG_PBCH
|
||||
#ifdef DEBUG_PBCH
|
||||
//pbch_e_rx = &nr_ue_pbch_vars->llr[0];
|
||||
|
||||
short *p = (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][5*20*12]);
|
||||
for (int cnt = 0; cnt < 8 ; cnt++)
|
||||
for (int cnt = 0; cnt < 32 ; cnt++)
|
||||
printf("pbch rx llr %d rxdata_comp %d addr %p\n",*(pbch_e_rx+cnt), p[cnt], &p[0]);
|
||||
//#endif
|
||||
#endif
|
||||
/*
|
||||
for (i=0; i<NR_POLAR_PBCH_E/2; i++){
|
||||
idx_demod = (sign(pbch_e_rx[i<<1])&1) ^ ((sign(pbch_e_rx[(i<<1)+1])&1)<<1);
|
||||
@@ -667,41 +656,39 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
for (i=0; i<16; i++){
|
||||
printf("unscrambling demod_pbch_e[%d] r = %2.3f i = %2.3f\n", i<<1 , demod_pbch_e[i<<1], demod_pbch_e[(i<<1)+1]);}
|
||||
//#endif
|
||||
*/
|
||||
*/
|
||||
// uint32_t pbch_out;
|
||||
//polar decoding de-rate matching
|
||||
decoderState = polar_decoder_int8_new(pbch_e_rx, pbch_a_b, &frame_parms->pbch_polar_params, decoderListSize, &polar_decoder_init,&polar_rate_matching, &decoding,&bit_extraction,&deinterleaving, &sorting,&path_metric,&update_LLR,0);
|
||||
t_nrPolar_paramsPtr nrPolar_params = NULL, currentPtr = NULL;
|
||||
nr_polar_init(&nrPolar_params,
|
||||
NR_POLAR_PBCH_MESSAGE_TYPE,
|
||||
NR_POLAR_PBCH_PAYLOAD_BITS,
|
||||
NR_POLAR_PBCH_AGGREGATION_LEVEL);
|
||||
currentPtr = nr_polar_params(nrPolar_params, NR_POLAR_PBCH_MESSAGE_TYPE, NR_POLAR_PBCH_PAYLOAD_BITS, NR_POLAR_PBCH_AGGREGATION_LEVEL);
|
||||
double aPrioriArray[currentPtr->payloadBits];
|
||||
for (int i=0; i<currentPtr->payloadBits; i++) aPrioriArray[i] = NAN;
|
||||
decoderState = polar_decoder_aPriori(demod_pbch_e,&nr_ue_pbch_vars->pbch_a_prime, currentPtr, decoderListSize, pathMetricAppr,aPrioriArray);
|
||||
printf("polar decoder state %d\n", decoderState);
|
||||
if(decoderState == -1)
|
||||
return(decoderState);
|
||||
|
||||
memset(&pbch_a_prime[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS>>3);
|
||||
for (i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS; i++)
|
||||
{
|
||||
pbch_a_prime[i/8] ^= (pbch_a_b[i]&1)<<(i&7);
|
||||
//printf("pbch_a_b[%d] = %u pbch_a_prime[i/8] 0x%02x \n", i,pbch_a_b[i],pbch_a_prime[i/8]);
|
||||
}
|
||||
|
||||
//#ifdef DEBUG_PBCH
|
||||
for (i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS>>3; i++)
|
||||
printf("pbch_a_prime[%d] = 0x%02x\n", i,pbch_a_prime[i]);
|
||||
//#endif
|
||||
|
||||
//printf("polar decoder output 0x%08x\n",nr_ue_pbch_vars->pbch_a_prime);
|
||||
|
||||
//payload un-scrambling
|
||||
memset(nr_ue_pbch_vars->pbch_a_interleaved, 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS>>3);
|
||||
memset(&nr_ue_pbch_vars->pbch_a_interleaved, 0, sizeof(uint32_t) );
|
||||
M = (Lmax == 64)? (NR_POLAR_PBCH_PAYLOAD_BITS - 6) : (NR_POLAR_PBCH_PAYLOAD_BITS - 3);
|
||||
nushift = ((pbch_a_prime[0]>>6)&1) ^ (((pbch_a_prime[3])&1)<<1);
|
||||
//printf("payload unscrambling nushift %d sfn3 %d sfn2 %d M %d\n",nushift, ((pbch_a_prime[0]>>6)&1),((pbch_a_prime[3])&1),M);
|
||||
nushift = ((nr_ue_pbch_vars->pbch_a_prime>>6)&1) ^ (((nr_ue_pbch_vars->pbch_a_prime>>24)&1)<<1);
|
||||
printf("payload unscrambling nushift %d sfn3 %d sfn2 %d M %d\n",nushift, ((nr_ue_pbch_vars->pbch_a_prime>>6)&1),((nr_ue_pbch_vars->pbch_a_prime>>24)&1),M);
|
||||
nr_pbch_unscrambling(nr_ue_pbch_vars,frame_parms->Nid_cell,nushift,M,NR_POLAR_PBCH_PAYLOAD_BITS,1);
|
||||
|
||||
//payload deinterleaving
|
||||
uint32_t in=0, out=0;
|
||||
for (int i=0; i<NR_POLAR_PBCH_PAYLOAD_BITS>>3; i++)
|
||||
in |= (uint32_t)(nr_ue_pbch_vars->pbch_a_interleaved[i]<<(i<<3));
|
||||
//uint32_t in=0;
|
||||
uint32_t out=0;
|
||||
|
||||
for (int i=0; i<32; i++) {
|
||||
out |= ((in>>i)&1)<<(pbch_deinterleaving_pattern[i]);
|
||||
out |= ((nr_ue_pbch_vars->pbch_a_interleaved>>i)&1)<<(pbch_deinterleaving_pattern[i]);
|
||||
#ifdef DEBUG_PBCH
|
||||
printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, in, out, pbch_deinterleaving_pattern[i], (in>>i)&1);
|
||||
printf("i %d in 0x%08x out 0x%08x ilv %d (in>>i)&1) 0x%08x\n", i, nr_ue_pbch_vars->pbch_a_interleaved, out, pbch_deinterleaving_pattern[i], (in>>i)&1);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -711,7 +698,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
// Fix byte endian
|
||||
for (i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS>>3); i++)
|
||||
decoded_output[(NR_POLAR_PBCH_PAYLOAD_BITS>>3)-i-1] = pbch_a[i];
|
||||
|
||||
|
||||
//#ifdef DEBUG_PBCH
|
||||
for (i=0; i<(NR_POLAR_PBCH_PAYLOAD_BITS>>3); i++){
|
||||
//printf("unscrambling pbch_a[%d] = %x \n", i,pbch_a[i]);
|
||||
@@ -733,8 +720,3 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,891 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/prach_common.c
|
||||
* \brief Common routines for UE/eNB PRACH physical channel V8.6 2009-03
|
||||
* \author Agustin Mico Pereperez
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
int16_t nr_ru[2*839]; // quantized roots of unity
|
||||
uint32_t nr_ZC_inv[839]; // multiplicative inverse for roots u
|
||||
uint16_t nr_du[838];
|
||||
|
||||
/*************************************
|
||||
* The following tables defined for NR
|
||||
**************************************/
|
||||
// Table 6.3.3.1-5 (38.211) NCS for preamble formats with delta_f_RA = 1.25 KHz
|
||||
uint16_t NCS_unrestricted_delta_f_RA_125[16] = {0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
|
||||
uint16_t NCS_restricted_TypeA_delta_f_RA_125[15] = {15,18,22,26,32,38,46,55,68,82,100,128,158,202,237}; // high-speed case set Type A
|
||||
uint16_t NCS_restricted_TypeB_delta_f_RA_125[13] = {15,18,22,26,32,38,46,55,68,82,100,118,137}; // high-speed case set Type B
|
||||
|
||||
// Table 6.3.3.1-6 (38.211) NCS for preamble formats with delta_f_RA = 5 KHz
|
||||
uint16_t NCS_unrestricted_delta_f_RA_5[16] = {0,13,26,33,38,41,49,55,64,76,93,119,139,209,279,419};
|
||||
uint16_t NCS_restricted_TypeA_delta_f_RA_5[16] = {36,57,72,81,89,94,103,112,121,132,137,152,173,195,216,237}; // high-speed case set Type A
|
||||
uint16_t NCS_restricted_TypeB_delta_f_RA_5[14] = {36,57,60,63,65,68,71,77,81,85,97,109,122,137}; // high-speed case set Type B
|
||||
|
||||
// Table 6.3.3.1-7 (38.211) NCS for preamble formats with delta_f_RA = 15 * 2mu KHz where mu = {0,1,2,3}
|
||||
uint16_t NCS_unrestricted_delta_f_RA_15[16] = {0,2,4,6,8,10,12,13,15,17,19,23,27,34,46,69};
|
||||
|
||||
//Table 6.3.3.1-3: Mapping from logical index i to sequence number u for preamble formats with L_RA = 839
|
||||
uint16_t prach_root_sequence_map_0_3[838] = {
|
||||
129, 710, 140, 699, 120, 719, 210, 629, 168, 671, 84 , 755, 105, 734, 93 , 746, 70 , 769, 60 , 779,
|
||||
2 , 837, 1 , 838, 56 , 783, 112, 727, 148, 691, 80 , 759, 42 , 797, 40 , 799, 35 , 804, 73 , 766,
|
||||
146, 693, 31 , 808, 28 , 811, 30 , 809, 27 , 812, 29 , 810, 24 , 815, 48 , 791, 68 , 771, 74 , 765,
|
||||
178, 661, 136, 703, 86 , 753, 78 , 761, 43 , 796, 39 , 800, 20 , 819, 21 , 818, 95 , 744, 202, 637,
|
||||
190, 649, 181, 658, 137, 702, 125, 714, 151, 688, 217, 622, 128, 711, 142, 697, 122, 717, 203, 636,
|
||||
118, 721, 110, 729, 89 , 750, 103, 736, 61 , 778, 55 , 784, 15 , 824, 14 , 825, 12 , 827, 23 , 816,
|
||||
34 , 805, 37 , 802, 46 , 793, 207, 632, 179, 660, 145, 694, 130, 709, 223, 616, 228, 611, 227, 612,
|
||||
132, 707, 133, 706, 143, 696, 135, 704, 161, 678, 201, 638, 173, 666, 106, 733, 83 , 756, 91 , 748,
|
||||
66 , 773, 53 , 786, 10 , 829, 9 , 830, 7 , 832, 8 , 831, 16 , 823, 47 , 792, 64 , 775, 57 , 782,
|
||||
104, 735, 101, 738, 108, 731, 208, 631, 184, 655, 197, 642, 191, 648, 121, 718, 141, 698, 149, 690,
|
||||
216, 623, 218, 621, 152, 687, 144, 695, 134, 705, 138, 701, 199, 640, 162, 677, 176, 663, 119, 720,
|
||||
158, 681, 164, 675, 174, 665, 171, 668, 170, 669, 87 , 752, 169, 670, 88 , 751, 107, 732, 81 , 758,
|
||||
82 , 757, 100, 739, 98 , 741, 71 , 768, 59 , 780, 65 , 774, 50 , 789, 49 , 790, 26 , 813, 17 , 822,
|
||||
13 , 826, 6 , 833, 5 , 834, 33 , 806, 51 , 788, 75 , 764, 99 , 740, 96 , 743, 97 , 742, 166, 673,
|
||||
172, 667, 175, 664, 187, 652, 163, 676, 185, 654, 200, 639, 114, 725, 189, 650, 115, 724, 194, 645,
|
||||
195, 644, 192, 647, 182, 657, 157, 682, 156, 683, 211, 628, 154, 685, 123, 716, 139, 700, 212, 627,
|
||||
153, 686, 213, 626, 215, 624, 150, 689, 225, 614, 224, 615, 221, 618, 220, 619, 127, 712, 147, 692,
|
||||
124, 715, 193, 646, 205, 634, 206, 633, 116, 723, 160, 679, 186, 653, 167, 672, 79 , 760, 85 , 754,
|
||||
77 , 762, 92 , 747, 58 , 781, 62 , 777, 69 , 770, 54 , 785, 36 , 803, 32 , 807, 25 , 814, 18 , 821,
|
||||
11 , 828, 4 , 835, 3 , 836, 19 , 820, 22 , 817, 41 , 798, 38 , 801, 44 , 795, 52 , 787, 45 , 794,
|
||||
63 , 776, 67 , 772, 72 , 767, 76 , 763, 94 , 745, 102, 737, 90 , 749, 109, 730, 165, 674, 111, 728,
|
||||
209, 630, 204, 635, 117, 722, 188, 651, 159, 680, 198, 641, 113, 726, 183, 656, 180, 659, 177, 662,
|
||||
196, 643, 155, 684, 214, 625, 126, 713, 131, 708, 219, 620, 222, 617, 226, 613, 230, 609, 232, 607,
|
||||
262, 577, 252, 587, 418, 421, 416, 423, 413, 426, 411, 428, 376, 463, 395, 444, 283, 556, 285, 554,
|
||||
379, 460, 390, 449, 363, 476, 384, 455, 388, 451, 386, 453, 361, 478, 387, 452, 360, 479, 310, 529,
|
||||
354, 485, 328, 511, 315, 524, 337, 502, 349, 490, 335, 504, 324, 515, 323, 516, 320, 519, 334, 505,
|
||||
359, 480, 295, 544, 385, 454, 292, 547, 291, 548, 381, 458, 399, 440, 380, 459, 397, 442, 369, 470,
|
||||
377, 462, 410, 429, 407, 432, 281, 558, 414, 425, 247, 592, 277, 562, 271, 568, 272, 567, 264, 575,
|
||||
259, 580, 237, 602, 239, 600, 244, 595, 243, 596, 275, 564, 278, 561, 250, 589, 246, 593, 417, 422,
|
||||
248, 591, 394, 445, 393, 446, 370, 469, 365, 474, 300, 539, 299, 540, 364, 475, 362, 477, 298, 541,
|
||||
312, 527, 313, 526, 314, 525, 353, 486, 352, 487, 343, 496, 327, 512, 350, 489, 326, 513, 319, 520,
|
||||
332, 507, 333, 506, 348, 491, 347, 492, 322, 517, 330, 509, 338, 501, 341, 498, 340, 499, 342, 497,
|
||||
301, 538, 366, 473, 401, 438, 371, 468, 408, 431, 375, 464, 249, 590, 269, 570, 238, 601, 234, 605,
|
||||
257, 582, 273, 566, 255, 584, 254, 585, 245, 594, 251, 588, 412, 427, 372, 467, 282, 557, 403, 436,
|
||||
396, 443, 392, 447, 391, 448, 382, 457, 389, 450, 294, 545, 297, 542, 311, 528, 344, 495, 345, 494,
|
||||
318, 521, 331, 508, 325, 514, 321, 518, 346, 493, 339, 500, 351, 488, 306, 533, 289, 550, 400, 439,
|
||||
378, 461, 374, 465, 415, 424, 270, 569, 241, 598, 231, 608, 260, 579, 268, 571, 276, 563, 409, 430,
|
||||
398, 441, 290, 549, 304, 535, 308, 531, 358, 481, 316, 523, 293, 546, 288, 551, 284, 555, 368, 471,
|
||||
253, 586, 256, 583, 263, 576, 242, 597, 274, 565, 402, 437, 383, 456, 357, 482, 329, 510, 317, 522,
|
||||
307, 532, 286, 553, 287, 552, 266, 573, 261, 578, 236, 603, 303, 536, 356, 483, 355, 484, 405, 434,
|
||||
404, 435, 406, 433, 235, 604, 267, 572, 302, 537, 309, 530, 265, 574, 233, 606, 367, 472, 296, 543,
|
||||
336, 503, 305, 534, 373, 466, 280, 559, 279, 560, 419, 420, 240, 599, 258, 581, 229, 610
|
||||
};
|
||||
// Table 6.3.3.1-4: Mapping from logical index i to sequence number u for preamble formats with L_RA = 139
|
||||
uint16_t prach_root_sequence_map_abc[138] = {
|
||||
1 , 138, 2 , 137, 3 , 136, 4 , 135, 5 , 134, 6 , 133, 7 , 132, 8 , 131, 9 , 130, 10, 129,
|
||||
11, 128, 12, 127, 13, 126, 14, 125, 15, 124, 16, 123, 17, 122, 18, 121, 19, 120, 20, 119,
|
||||
21, 118, 22, 117, 23, 116, 24, 115, 25, 114, 26, 113, 27, 112, 28, 111, 29, 110, 30, 109,
|
||||
31, 108, 32, 107, 33, 106, 34, 105, 35, 104, 36, 103, 37, 102, 38, 101, 39, 100, 40, 99 ,
|
||||
41, 98 , 42, 97 , 43, 96 , 44, 95 , 45, 94 , 46, 93 , 47, 92 , 48, 91 , 49, 90 , 50, 89 ,
|
||||
51, 88 , 52, 87 , 53, 86 , 54, 85 , 55, 84 , 56, 83 , 57, 82 , 58, 81 , 59, 80 , 60, 79 ,
|
||||
61, 78 , 62, 77 , 63, 76 , 64, 75 , 65, 74 , 66, 73 , 67, 72 , 68, 71 , 69, 70
|
||||
};
|
||||
|
||||
// Table 6.3.3.2-2: Random access configurations for FR1 and paired spectrum/supplementary uplink
|
||||
// the column 5, (SFN_nbr is a bitmap where we set bit to '1' in the position of the subframe where the RACH can be sent.
|
||||
// E.g. in row 4, and column 5 we have set value 512 ('1000000000') which means RACH can be sent at subframe 9.
|
||||
// E.g. in row 20 and column 5 we have set value 66 ('0001000010') which means RACH can be sent at subframe 1 or 6
|
||||
int64_t table_6_3_3_2_2_prachConfig_Index [256][9] = {
|
||||
//format, format, x, y, SFN_nbr, star_symb, slots_sfn, occ_slot, duration
|
||||
{0, -1, 16, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{0, -1, 16, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{0, -1, 16, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{0, -1, 16, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{0, -1, 8, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{0, -1, 8, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{0, -1, 8, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{0, -1, 8, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{0, -1, 4, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{0, -1, 4, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{0, -1, 4, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{0, -1, 4, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{0, -1, 2, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{0, -1, 2, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{0, -1, 2, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{0, -1, 2, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{0, -1, 1, 0, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{0, -1, 1, 0, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{0, -1, 1, 0, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{0, -1, 1, 0, 66, 0, -1, -1, 0}, // (subframe number) 1,6
|
||||
{0, -1, 1, 0, 132, 0, -1, -1, 0}, // (subframe number) 2,7
|
||||
{0, -1, 1, 0, 264, 0, -1, -1, 0}, // (subframe number) 3,8
|
||||
{0, -1, 1, 0, 146, 0, -1, -1, 0}, // (subframe number) 1,4,7
|
||||
{0, -1, 1, 0, 292, 0, -1, -1, 0}, // (subframe number) 2,5,8
|
||||
{0, -1, 1, 0, 584, 0, -1, -1, 0}, // (subframe number) 3, 6, 9
|
||||
{0, -1, 1, 0, 341, 0, -1, -1, 0}, // (subframe number) 0,2,4,6,8
|
||||
{0, -1, 1, 0, 682, 0, -1, -1, 0}, // (subframe number) 1,3,5,7,9
|
||||
{0, -1, 1, 0, 1023, 0, -1, -1, 0}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{1, -1, 16, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{1, -1, 16, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{1, -1, 16, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{1, -1, 16, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{1, -1, 8, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{1, -1, 8, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{1, -1, 8, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{1, -1, 8, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{1, -1, 4, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{1, -1, 4, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{1, -1, 4, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{1, -1, 4, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{1, -1, 2, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{1, -1, 2, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{1, -1, 2, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{1, -1, 2, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{1, -1, 1, 0, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{1, -1, 1, 0, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{1, -1, 1, 0, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{1, -1, 1, 0, 66, 0, -1, -1, 0}, // (subframe number) 1,6
|
||||
{1, -1, 1, 0, 132, 0, -1, -1, 0}, // (subframe number) 2,7
|
||||
{1, -1, 1, 0, 264, 0, -1, -1, 0}, // (subframe number) 3,8
|
||||
{1, -1, 1, 0, 146, 0, -1, -1, 0}, // (subframe number) 1,4,7
|
||||
{1, -1, 1, 0, 292, 0, -1, -1, 0}, // (subframe number) 2,5,8
|
||||
{1, -1, 1, 0, 584, 0, -1, -1, 0}, // (subframe number) 3,6,9
|
||||
{2, -1, 16, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{2, -1, 8, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{2, -1, 4, 0, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{2, -1, 2, 0, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{2, -1, 2, 0, 32, 0, -1, -1, 0}, // (subframe number) 5
|
||||
{2, -1, 1, 0, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{2, -1, 1, 0, 32, 0, -1, -1, 0}, // (subframe number) 5
|
||||
{3, -1, 16, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{3, -1, 16, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{3, -1, 16, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{3, -1, 16, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{3, -1, 8, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{3, -1, 8, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{3, -1, 8, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{3, -1, 4, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{3, -1, 4, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{3, -1, 4, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{3, -1, 4, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{3, -1, 2, 1, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{3, -1, 2, 1, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{3, -1, 2, 1, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{3, -1, 2, 1, 512, 0, -1, -1, 0}, // (subframe number) 9
|
||||
{3, -1, 1, 0, 2, 0, -1, -1, 0}, // (subframe number) 1
|
||||
{3, -1, 1, 0, 16, 0, -1, -1, 0}, // (subframe number) 4
|
||||
{3, -1, 1, 0, 128, 0, -1, -1, 0}, // (subframe number) 7
|
||||
{3, -1, 1, 0, 66, 0, -1, -1, 0}, // (subframe number) 1,6
|
||||
{3, -1, 1, 0, 132, 0, -1, -1, 0}, // (subframe number) 2,7
|
||||
{3, -1, 1, 0, 264, 0, -1, -1, 0}, // (subframe number) 3,8
|
||||
{3, -1, 1, 0, 146, 0, -1, -1, 0}, // (subframe number) 1,4,7
|
||||
{3, -1, 1, 0, 292, 0, -1, -1, 0}, // (subframe number) 2,5,8
|
||||
{3, -1, 1, 0, 584, 0, -1, -1, 0}, // (subframe number) 3, 6, 9
|
||||
{3, -1, 1, 0, 341, 0, -1, -1, 0}, // (subframe number) 0,2,4,6,8
|
||||
{3, -1, 1, 0, 682, 0, -1, -1, 0}, // (subframe number) 1,3,5,7,9
|
||||
{3, -1, 1, 0, 1023, 0, -1, -1, 0}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xa1, -1, 16, 0, 528, 0, 1, 6, 2}, // (subframe number) 4,9
|
||||
{0xa1, -1, 16, 1, 16, 0, 2, 6, 2}, // (subframe number) 4
|
||||
{0xa1, -1, 8, 0, 528, 0, 1, 6, 2}, // (subframe number) 4,9
|
||||
{0xa1, -1, 8, 1, 16, 0, 2, 6, 2}, // (subframe number) 4
|
||||
{0xa1, -1, 4, 0, 528, 0, 1, 6, 2}, // (subframe number) 4,9
|
||||
{0xa1, -1, 4, 1, 528, 0, 1, 6, 2}, // (subframe number) 4,9
|
||||
{0xa1, -1, 4, 0, 16, 0, 2, 6, 2}, // (subframe number) 4
|
||||
{0xa1, -1, 2, 0, 528, 0, 1, 6, 2}, // (subframe number) 4,9
|
||||
{0xa1, -1, 2, 0, 2, 0, 2, 6, 2}, // (subframe number) 1
|
||||
{0xa1, -1, 2, 0, 16, 0, 2, 6, 2}, // (subframe number) 4
|
||||
{0xa1, -1, 2, 0, 128, 0, 2, 6, 2}, // (subframe number) 7
|
||||
{0xa1, -1, 1, 0, 16, 0, 1, 6, 2}, // (subframe number) 4
|
||||
{0xa1, -1, 1, 0, 66, 0, 1, 6, 2}, // (subframe number) 1,6
|
||||
{0xa1, -1, 1, 0, 528, 0, 1, 6, 2}, // (subframe number) 4,9
|
||||
{0xa1, -1, 1, 0, 2, 0, 2, 6, 2}, // (subframe number) 1
|
||||
{0xa1, -1, 1, 0, 128, 0, 2, 6, 2}, // (subframe number) 7
|
||||
{0xa1, -1, 1, 0, 132, 0, 2, 6, 2}, // (subframe number) 2,7
|
||||
{0xa1, -1, 1, 0, 146, 0, 2, 6, 2}, // (subframe number) 1,4,7
|
||||
{0xa1, -1, 1, 0, 341, 0, 2, 6, 2}, // (subframe number) 0,2,4,6,8
|
||||
{0xa1, -1, 1, 0, 1023, 0, 2, 6, 2}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xa1, -1, 1, 0, 682, 0, 2, 6, 2}, // (subframe number) 1,3,5,7,9
|
||||
{0xa1, 0xb1, 2, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xa1, 0xb1, 2, 0, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xa1, 0xb1, 1, 0, 16, 0, 1, 7, 2}, // (subframe number) 4
|
||||
{0xa1, 0xb1, 1, 0, 66, 0, 1, 7, 2}, // (subframe number) 1,6
|
||||
{0xa1, 0xb1, 1, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xa1, 0xb1, 1, 0, 2, 0, 2, 7, 2}, // (subframe number) 1
|
||||
{0xa1, 0xb1, 1, 0, 128, 0, 2, 7, 2}, // (subframe number) 7
|
||||
{0xa1, 0xb1, 1, 0, 146, 0, 2, 7, 2}, // (subframe number) 1,4,7
|
||||
{0xa1, 0xb1, 1, 0, 341, 0, 2, 7, 2}, // (subframe number) 0,2,4,6,8
|
||||
{0xa2, -1, 16, 1, 580, 0, 1, 3, 4}, // (subframe number) 2,6,9
|
||||
{0xa2, -1, 16, 1, 16, 0, 2, 3, 4}, // (subframe number) 4
|
||||
{0xa2, -1, 8, 1, 580, 0, 1, 3, 4}, // (subframe number) 2,6,9
|
||||
{0xa2, -1, 8, 1, 16, 0, 2, 3, 4}, // (subframe number) 4
|
||||
{0xa2, -1, 4, 0, 580, 0, 1, 3, 4}, // (subframe number) 2,6,9
|
||||
{0xa2, -1, 4, 0, 16, 0, 2, 3, 4}, // (subframe number) 4
|
||||
{0xa2, -1, 2, 1, 580, 0, 1, 3, 4}, // (subframe number) 2,6,9
|
||||
{0xa2, -1, 2, 0, 2, 0, 2, 3, 4}, // (subframe number) 1
|
||||
{0xa2, -1, 2, 0, 16, 0, 2, 3, 4}, // (subframe number) 4
|
||||
{0xa2, -1, 2, 0, 128, 0, 2, 3, 4}, // (subframe number) 7
|
||||
{0xa2, -1, 1, 0, 16, 0, 1, 3, 4}, // (subframe number) 4
|
||||
{0xa2, -1, 1, 0, 66, 0, 1, 3, 4}, // (subframe number) 1,6
|
||||
{0xa2, -1, 1, 0, 528, 0, 1, 3, 4}, // (subframe number) 4,9
|
||||
{0xa2, -1, 1, 0, 2, 0, 2, 3, 4}, // (subframe number) 1
|
||||
{0xa2, -1, 1, 0, 128, 0, 2, 3, 4}, // (subframe number) 7
|
||||
{0xa2, -1, 1, 0, 132, 0, 2, 3, 4}, // (subframe number) 2,7
|
||||
{0xa2, -1, 1, 0, 146, 0, 2, 3, 4}, // (subframe number) 1,4,7
|
||||
{0xa2, -1, 1, 0, 341, 0, 2, 3, 4}, // (subframe number) 0,2,4,6,8
|
||||
{0xa2, -1, 1, 0, 1023, 0, 2, 3, 4}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xa2, -1, 1, 0, 682, 0, 2, 3, 4}, // (subframe number) 1,3,5,7,9
|
||||
{0xa2, 0xb2, 2, 1, 580, 0, 1, 3, 4}, // (subframe number) 2,6,9
|
||||
{0xa2, 0xb2, 2, 0, 16, 0, 2, 3, 4}, // (subframe number) 4
|
||||
{0xa2, 0xb2, 1, 0, 16, 0, 1, 3, 4}, // (subframe number) 4
|
||||
{0xa2, 0xb2, 1, 0, 66, 0, 1, 3, 4}, // (subframe number) 1,6
|
||||
{0xa2, 0xb2, 1, 0, 528, 0, 1, 3, 4}, // (subframe number) 4,9
|
||||
{0xa2, 0xb2, 1, 0, 2, 0, 2, 3, 4}, // (subframe number) 1
|
||||
{0xa2, 0xb2, 1, 0, 128, 0, 2, 3, 4}, // (subframe number) 7
|
||||
{0xa2, 0xb2, 1, 0, 146, 0, 2, 3, 4}, // (subframe number) 1,4,7
|
||||
{0xa2, 0xb2, 1, 0, 341, 0, 2, 3, 4}, // (subframe number) 0,2,4,6,8
|
||||
{0xa2, 0xb2, 1, 0, 1023, 0, 2, 3, 4}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xa3, -1, 16, 1, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xa3, -1, 16, 1, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xa3, -1, 8, 1, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xa3, -1, 8, 1, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xa3, -1, 4, 0, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xa3, -1, 4, 0, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xa3, -1, 2, 1, 580, 0, 2, 2, 6}, // (subframe number) 2,6,9
|
||||
{0xa3, -1, 2, 0, 2, 0, 2, 2, 6}, // (subframe number) 1
|
||||
{0xa3, -1, 2, 0, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xa3, -1, 2, 0, 128, 0, 2, 2, 6}, // (subframe number) 7
|
||||
{0xa3, -1, 1, 0, 16, 0, 1, 2, 6}, // (subframe number) 4
|
||||
{0xa3, -1, 1, 0, 66, 0, 1, 2, 6}, // (subframe number) 1,6
|
||||
{0xa3, -1, 1, 0, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xa3, -1, 1, 0, 2, 0, 2, 2, 6}, // (subframe number) 1
|
||||
{0xa3, -1, 1, 0, 128, 0, 2, 2, 6}, // (subframe number) 7
|
||||
{0xa3, -1, 1, 0, 132, 0, 2, 2, 6}, // (subframe number) 2,7
|
||||
{0xa3, -1, 1, 0, 146, 0, 2, 2, 6}, // (subframe number) 1,4,7
|
||||
{0xa3, -1, 1, 0, 341, 0, 2, 2, 6}, // (subframe number) 0,2,4,6,8
|
||||
{0xa3, -1, 1, 0, 1023, 0, 2, 2, 6}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xa3, -1, 1, 0, 682, 0, 2, 2, 6}, // (subframe number) 1,3,5,7,9
|
||||
{0xa3, 0xb3, 2, 1, 580, 0, 2, 2, 6}, // (subframe number) 2,6,9
|
||||
{0xa3, 0xb3, 2, 0, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xa3, 0xb3, 1, 0, 16, 0, 1, 2, 6}, // (subframe number) 4
|
||||
{0xa3, 0xb3, 1, 0, 66, 0, 1, 2, 6}, // (subframe number) 1,6
|
||||
{0xa3, 0xb3, 1, 0, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xa3, 0xb3, 1, 0, 2, 0, 2, 2, 6}, // (subframe number) 1
|
||||
{0xa3, 0xb3, 1, 0, 128, 0, 2, 2, 6}, // (subframe number) 7
|
||||
{0xa3, 0xb3, 1, 0, 146, 0, 2, 2, 6}, // (subframe number) 1,4,7
|
||||
{0xa3, 0xb3, 1, 0, 341, 0, 2, 2, 6}, // (subframe number) 0,2,4,6,8
|
||||
{0xa3, 0xb3, 1, 0, 1023, 0, 2, 2, 6}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xb1, -1, 16, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xb1, -1, 16, 1, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xb1, -1, 8, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xb1, -1, 8, 1, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xb1, -1, 4, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xb1, -1, 4, 1, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xb1, -1, 4, 0, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xb1, -1, 2, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xb1, -1, 2, 0, 2, 0, 2, 7, 2}, // (subframe number) 1
|
||||
{0xb1, -1, 2, 0, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xb1, -1, 2, 0, 128, 0, 2, 7, 2}, // (subframe number) 7
|
||||
{0xb1, -1, 1, 0, 16, 0, 1, 7, 2}, // (subframe number) 4
|
||||
{0xb1, -1, 1, 0, 66, 0, 1, 7, 2}, // (subframe number) 1,6
|
||||
{0xb1, -1, 1, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xb1, -1, 1, 0, 2, 0, 2, 7, 2}, // (subframe number) 1
|
||||
{0xb1, -1, 1, 0, 128, 0, 2, 7, 2}, // (subframe number) 7
|
||||
{0xb1, -1, 1, 0, 132, 0, 2, 7, 2}, // (subframe number) 2,7
|
||||
{0xb1, -1, 1, 0, 146, 0, 2, 7, 2}, // (subframe number) 1,4,7
|
||||
{0xb1, -1, 1, 0, 341, 0, 2, 7, 2}, // (subframe number) 0,2,4,6,8
|
||||
{0xb1, -1, 1, 0, 1023, 0, 2, 7, 2}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xb1, -1, 1, 0, 682, 0, 2, 7, 2}, // (subframe number) 1,3,5,7,9
|
||||
{0xb4, -1, 16, 0, 528, 0, 2, 1, 12}, // (subframe number) 4,9
|
||||
{0xb4, -1, 16, 1, 16, 0, 2, 1, 12}, // (subframe number) 4
|
||||
{0xb4, -1, 8, 0, 528, 0, 2, 1, 12}, // (subframe number) 4,9
|
||||
{0xb4, -1, 8, 1, 16, 0, 2, 1, 12}, // (subframe number) 4
|
||||
{0xb4, -1, 4, 0, 528, 0, 2, 1, 12}, // (subframe number) 4,9
|
||||
{0xb4, -1, 4, 0, 16, 0, 2, 1, 12}, // (subframe number) 4
|
||||
{0xb4, -1, 4, 1, 528, 0, 2, 1, 12}, // (subframe number) 4,9
|
||||
{0xb4, -1, 2, 0, 528, 0, 2, 1, 12}, // (subframe number) 4,9
|
||||
{0xb4, -1, 2, 0, 2, 0, 2, 1, 12}, // (subframe number) 1
|
||||
{0xb4, -1, 2, 0, 16, 0, 2, 1, 12}, // (subframe number) 4
|
||||
{0xb4, -1, 2, 0, 128, 0, 2, 1, 12}, // (subframe number) 7
|
||||
{0xb4, -1, 1, 0, 2, 0, 2, 1, 12}, // (subframe number) 1
|
||||
{0xb4, -1, 1, 0, 16, 0, 2, 1, 12}, // (subframe number) 4
|
||||
{0xb4, -1, 1, 0, 128, 0, 2, 1, 12}, // (subframe number) 7
|
||||
{0xb4, -1, 1, 0, 66, 0, 2, 1, 12}, // (subframe number) 1,6
|
||||
{0xb4, -1, 1, 0, 132, 0, 2, 1, 12}, // (subframe number) 2,7
|
||||
{0xb4, -1, 1, 0, 528, 0, 2, 1, 12}, // (subframe number) 4,9
|
||||
{0xb4, -1, 1, 0, 146, 0, 2, 1, 12}, // (subframe number) 1,4,7
|
||||
{0xb4, -1, 1, 0, 341, 0, 2, 1, 12}, // (subframe number) 0,2,4,6,8
|
||||
{0xb4, -1, 1, 0, 1023, 0, 2, 1, 12}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xb4, -1, 1, 0, 682, 0, 2, 1, 12}, // (subframe number) 1,3,5,7,9
|
||||
{0xc0, -1, 8, 1, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xc0, -1, 4, 1, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xc0, -1, 4, 0, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xc0, -1, 2, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xc0, -1, 2, 0, 2, 0, 2, 7, 2}, // (subframe number) 1
|
||||
{0xc0, -1, 2, 0, 16, 0, 2, 7, 2}, // (subframe number) 4
|
||||
{0xc0, -1, 2, 0, 128, 0, 2, 7, 2}, // (subframe number) 7
|
||||
{0xc0, -1, 1, 0, 16, 0, 1, 7, 2}, // (subframe number) 4
|
||||
{0xc0, -1, 1, 0, 66, 0, 1, 7, 2}, // (subframe number) 1,6
|
||||
{0xc0, -1, 1, 0, 528, 0, 1, 7, 2}, // (subframe number) 4,9
|
||||
{0xc0, -1, 1, 0, 2, 0, 2, 7, 2}, // (subframe number) 1
|
||||
{0xc0, -1, 1, 0, 128, 0, 2, 7, 2}, // (subframe number) 7
|
||||
{0xc0, -1, 1, 0, 132, 0, 2, 7, 2}, // (subframe number) 2,7
|
||||
{0xc0, -1, 1, 0, 146, 0, 2, 7, 2}, // (subframe number) 1,4,7
|
||||
{0xc0, -1, 1, 0, 341, 0, 2, 7, 2}, // (subframe number) 0,2,4,6,8
|
||||
{0xc0, -1, 1, 0, 1023, 0, 2, 7, 2}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xc0, -1, 1, 0, 682, 0, 2, 7, 2}, // (subframe number) 1,3,5,7,9
|
||||
{0xc2, -1, 16, 1, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xc2, -1, 16, 1, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xc2, -1, 8, 1, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xc2, -1, 8, 1, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xc2, -1, 4, 0, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xc2, -1, 4, 0, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xc2, -1, 2, 1, 580, 0, 2, 2, 6}, // (subframe number) 2,6,9
|
||||
{0xc2, -1, 2, 0, 2, 0, 2, 2, 6}, // (subframe number) 1
|
||||
{0xc2, -1, 2, 0, 16, 0, 2, 2, 6}, // (subframe number) 4
|
||||
{0xc2, -1, 2, 0, 128, 0, 2, 2, 6}, // (subframe number) 7
|
||||
{0xc2, -1, 1, 0, 16, 0, 1, 2, 6}, // (subframe number) 4
|
||||
{0xc2, -1, 1, 0, 66, 0, 1, 2, 6}, // (subframe number) 1,6
|
||||
{0xc2, -1, 1, 0, 528, 0, 1, 2, 6}, // (subframe number) 4,9
|
||||
{0xc2, -1, 1, 0, 2, 0, 2, 2, 6}, // (subframe number) 1
|
||||
{0xc2, -1, 1, 0, 128, 0, 2, 2, 6}, // (subframe number) 7
|
||||
{0xc2, -1, 1, 0, 132, 0, 2, 2, 6}, // (subframe number) 2,7
|
||||
{0xc2, -1, 1, 0, 146, 0, 2, 2, 6}, // (subframe number) 1,4,7
|
||||
{0xc2, -1, 1, 0, 341, 0, 2, 2, 6}, // (subframe number) 0,2,4,6,8
|
||||
{0xc2, -1, 1, 0, 1023, 0, 2, 2, 6}, // (subframe number) 0,1,2,3,4,5,6,7,8,9
|
||||
{0xc2, -1, 1, 0, 682, 0, 2, 2, 6} // (subframe number) 1,3,5,7,9
|
||||
};
|
||||
// Table 6.3.3.2-3: Random access configurations for FR1 and unpaired spectrum
|
||||
int64_t table_6_3_3_2_3_prachConfig_Index [256][9] = {
|
||||
//format, format, x, y, SFN_nbr, star_symb, slots_sfn, occ_slot, duration
|
||||
{0, -1, 16, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{0, -1, 8, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{0, -1, 4, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{0, -1, 2, 0, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{0, -1, 2, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{0, -1, 2, 0, 16, 0, -1, -1, 0}, // (subrame number 4)
|
||||
{0, -1, 2, 1, 16, 0, -1, -1, 0}, // (subrame number 4)
|
||||
{0, -1, 1, 0, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{0, -1, 1, 0, 256, 0, -1, -1, 0}, // (subrame number 8)
|
||||
{0, -1, 1, 0, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{0, -1, 1, 0, 64, 0, -1, -1, 0}, // (subrame number 6)
|
||||
{0, -1, 1, 0, 32, 0, -1, -1, 0}, // (subrame number 5)
|
||||
{0, -1, 1, 0, 16, 0, -1, -1, 0}, // (subrame number 4)
|
||||
{0, -1, 1, 0, 8, 0, -1, -1, 0}, // (subrame number 3)
|
||||
{0, -1, 1, 0, 4, 0, -1, -1, 0}, // (subrame number 2)
|
||||
{0, -1, 1, 0, 66, 0, -1, -1, 0}, // (subrame number 1,6)
|
||||
{0, -1, 1, 0, 66, 7, -1, -1, 0}, // (subrame number 1,6)
|
||||
{0, -1, 1, 0, 528, 0, -1, -1, 0}, // (subrame number 4,9)
|
||||
{0, -1, 1, 0, 264, 0, -1, -1, 0}, // (subrame number 3,8)
|
||||
{0, -1, 1, 0, 132, 0, -1, -1, 0}, // (subrame number 2,7)
|
||||
{0, -1, 1, 0, 768, 0, -1, -1, 0}, // (subrame number 8,9)
|
||||
{0, -1, 1, 0, 784, 0, -1, -1, 0}, // (subrame number 4,8,9)
|
||||
{0, -1, 1, 0, 536, 0, -1, -1, 0}, // (subrame number 3,4,9)
|
||||
{0, -1, 1, 0, 896, 0, -1, -1, 0}, // (subrame number 7,8,9)
|
||||
{0, -1, 1, 0, 792, 0, -1, -1, 0}, // (subrame number 3,4,8,9)
|
||||
{0, -1, 1, 0, 960, 0, -1, -1, 0}, // (subrame number 6,7,8,9)
|
||||
{0, -1, 1, 0, 594, 0, -1, -1, 0}, // (subrame number 1,4,6,9)
|
||||
{0, -1, 1, 0, 682, 0, -1, -1, 0}, // (subrame number 1,3,5,7,9)
|
||||
{1, -1, 16, 1, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{1, -1, 8, 1, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{1, -1, 4, 1, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{1, -1, 2, 0, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{1, -1, 2, 1, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{1, -1, 1, 0, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{2, -1, 16, 1, 64, 0, -1, -1, 0}, // (subrame number 6)
|
||||
{2, -1, 8, 1, 64, 0, -1, -1, 0}, // (subrame number 6)
|
||||
{2, -1, 4, 1, 64, 0, -1, -1, 0}, // (subrame number 6)
|
||||
{2, -1, 2, 0, 64, 7, -1, -1, 0}, // (subrame number 6)
|
||||
{2, -1, 2, 1, 64, 7, -1, -1, 0}, // (subrame number 6)
|
||||
{2, -1, 1, 0, 64, 7, -1, -1, 0}, // (subrame number 6)
|
||||
{3, -1, 16, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{3, -1, 8, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{3, -1, 4, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{3, -1, 2, 0, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{3, -1, 2, 1, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{3, -1, 2, 0, 16, 0, -1, -1, 0}, // (subrame number 4)
|
||||
{3, -1, 2, 1, 16, 0, -1, -1, 0}, // (subrame number 4)
|
||||
{3, -1, 1, 0, 512, 0, -1, -1, 0}, // (subrame number 9)
|
||||
{3, -1, 1, 0, 256, 0, -1, -1, 0}, // (subrame number 8)
|
||||
{3, -1, 1, 0, 128, 0, -1, -1, 0}, // (subrame number 7)
|
||||
{3, -1, 1, 0, 64, 0, -1, -1, 0}, // (subrame number 6)
|
||||
{3, -1, 1, 0, 32, 0, -1, -1, 0}, // (subrame number 5)
|
||||
{3, -1, 1, 0, 16, 0, -1, -1, 0}, // (subrame number 4)
|
||||
{3, -1, 1, 0, 8, 0, -1, -1, 0}, // (subrame number 3)
|
||||
{3, -1, 1, 0, 4, 0, -1, -1, 0}, // (subrame number 2)
|
||||
{3, -1, 1, 0, 66, 0, -1, -1, 0}, // (subrame number 1,6)
|
||||
{3, -1, 1, 0, 66, 7, -1, -1, 0}, // (subrame number 1,6)
|
||||
{3, -1, 1, 0, 528, 0, -1, -1, 0}, // (subrame number 4,9)
|
||||
{3, -1, 1, 0, 264, 0, -1, -1, 0}, // (subrame number 3,8)
|
||||
{3, -1, 1, 0, 132, 0, -1, -1, 0}, // (subrame number 2,7)
|
||||
{3, -1, 1, 0, 768, 0, -1, -1, 0}, // (subrame number 8,9)
|
||||
{3, -1, 1, 0, 784, 0, -1, -1, 0}, // (subrame number 4,8,9)
|
||||
{3, -1, 1, 0, 536, 0, -1, -1, 0}, // (subrame number 3,4,9)
|
||||
{3, -1, 1, 0, 896, 0, -1, -1, 0}, // (subrame number 7,8,9)
|
||||
{3, -1, 1, 0, 792, 0, -1, -1, 0}, // (subrame number 3,4,8,9)
|
||||
{3, -1, 1, 0, 594, 0, -1, -1, 0}, // (subrame number 1,4,6,9)
|
||||
{3, -1, 1, 0, 682, 0, -1, -1, 0}, // (subrame number 1,3,5,7,9)
|
||||
{0xa1, -1, 16, 1, 512, 0, 2, 6, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 8, 1, 512, 0, 2, 6, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 4, 1, 512, 0, 1, 6, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 2, 1, 512, 0, 1, 6, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 2, 1, 528, 7, 1, 3, 2}, // (subrame number 4,9)
|
||||
{0xa1, -1, 2, 1, 640, 7, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xa1, -1, 2, 1, 640, 0, 1, 6, 2}, // (subrame number 7,9)
|
||||
{0xa1, -1, 2, 1, 768, 0, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xa1, -1, 2, 1, 528, 0, 2, 6, 2}, // (subrame number 4,9)
|
||||
{0xa1, -1, 2, 1, 924, 0, 1, 6, 2}, // (subrame number 2,3,4,7,8,9)
|
||||
{0xa1, -1, 1, 0, 512, 0, 2, 6, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 1, 0, 512, 7, 1, 3, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 1, 0, 512, 0, 1, 6, 2}, // (subrame number 9)
|
||||
{0xa1, -1, 1, 0, 768, 0, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xa1, -1, 1, 0, 528, 0, 1, 6, 2}, // (subrame number 4,9)
|
||||
{0xa1, -1, 1, 0, 640, 7, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xa1, -1, 1, 0, 792, 0, 1, 6, 2}, // (subrame number 3,4,8,9)
|
||||
{0xa1, -1, 1, 0, 792, 0, 2, 6, 2}, // (subrame number 3,4,8,9)
|
||||
{0xa1, -1, 1, 0, 682, 0, 1, 6, 2}, // (subrame number 1,3,5,7,9)
|
||||
{0xa1, -1, 1, 0, 1023, 7, 1, 3, 2}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xa2, -1, 16, 1, 512, 0, 2, 3, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 8, 1, 512, 0, 2, 3, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 4, 1, 512, 0, 1, 3, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 2, 1, 640, 0, 1, 3, 4}, // (subrame number 7,9)
|
||||
{0xa2, -1, 2, 1, 768, 0, 2, 3, 4}, // (subrame number 8,9)
|
||||
{0xa2, -1, 2, 1, 640, 9, 1, 1, 4}, // (subrame number 7,9)
|
||||
{0xa2, -1, 2, 1, 528, 9, 1, 1, 4}, // (subrame number 4,9)
|
||||
{0xa2, -1, 2, 1, 528, 0, 2, 3, 4}, // (subrame number 4,9)
|
||||
{0xa2, -1, 16, 1, 924, 0, 1, 3, 4}, // (subrame number 2,3,4,7,8,9)
|
||||
{0xa2, -1, 1, 0, 4, 0, 1, 3, 4}, // (subrame number 2)
|
||||
{0xa2, -1, 1, 0, 128, 0, 1, 3, 4}, // (subrame number 7)
|
||||
{0xa2, -1, 2, 1, 512, 0, 1, 3, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 1, 0, 512, 0, 2, 3, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 1, 0, 512, 9, 1, 1, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 1, 0, 512, 0, 1, 3, 4}, // (subrame number 9)
|
||||
{0xa2, -1, 1, 0, 132, 0, 1, 3, 4}, // (subrame number 2,7)
|
||||
{0xa2, -1, 1, 0, 768, 0, 2, 3, 4}, // (subrame number 8,9)
|
||||
{0xa2, -1, 1, 0, 528, 0, 1, 3, 4}, // (subrame number 4,9)
|
||||
{0xa2, -1, 1, 0, 640, 9, 1, 1, 4}, // (subrame number 7,9)
|
||||
{0xa2, -1, 1, 0, 792, 0, 1, 3, 4}, // (subrame number 3,4,8,9)
|
||||
{0xa2, -1, 1, 0, 792, 0, 2, 3, 4}, // (subrame number 3,4,8,9)
|
||||
{0xa2, -1, 1, 0, 682, 0, 1, 3, 4}, // (subrame number 1,3,5,7,9)
|
||||
{0xa2, -1, 1, 0, 1023, 9, 1, 1, 4}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xa3, -1, 16, 1, 512, 0, 2, 2, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 8, 1, 512, 0, 2, 2, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 4, 1, 512, 0, 1, 2, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 2, 1, 528, 7, 1, 1, 6}, // (subrame number 4,9)
|
||||
{0xa3, -1, 2, 1, 640, 7, 1, 1, 6}, // (subrame number 7,9)
|
||||
{0xa3, -1, 2, 1, 640, 0, 1, 2, 6}, // (subrame number 7,9)
|
||||
{0xa3, -1, 2, 1, 528, 0, 2, 2, 6}, // (subrame number 4,9)
|
||||
{0xa3, -1, 2, 1, 768, 0, 2, 2, 6}, // (subrame number 8,9)
|
||||
{0xa3, -1, 2, 1, 924, 0, 1, 2, 6}, // (subrame number 2,3,4,7,8,9)
|
||||
{0xa3, -1, 1, 0, 4, 0, 1, 2, 6}, // (subrame number 2)
|
||||
{0xa3, -1, 1, 0, 128, 0, 1, 2, 6}, // (subrame number 7)
|
||||
{0xa3, -1, 2, 1, 512, 0, 1, 2, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 1, 0, 512, 0, 2, 2, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 1, 0, 512, 7, 1, 1, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 1, 0, 512, 0, 1, 2, 6}, // (subrame number 9)
|
||||
{0xa3, -1, 1, 0, 132, 0, 1, 2, 6}, // (subrame number 2,7)
|
||||
{0xa3, -1, 1, 0, 768, 0, 2, 2, 6}, // (subrame number 8,9)
|
||||
{0xa3, -1, 1, 0, 528, 0, 1, 2, 6}, // (subrame number 4,9)
|
||||
{0xa3, -1, 1, 0, 640, 7, 1, 1, 6}, // (subrame number 7,9)
|
||||
{0xa3, -1, 1, 0, 792, 0, 1, 2, 6}, // (subrame number 3,4,8,9)
|
||||
{0xa3, -1, 1, 0, 792, 0, 2, 2, 6}, // (subrame number 3,4,8,9)
|
||||
{0xa3, -1, 1, 0, 682, 0, 1, 2, 6}, // (subrame number 1,3,5,7,9)
|
||||
{0xa3, -1, 1, 0, 1023, 7, 1, 1, 6}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xb1, -1, 4, 1, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xb1, -1, 2, 1, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xb1, -1, 2, 1, 640, 2, 1, 6, 2}, // (subrame number 7,9)
|
||||
{0xb1, -1, 2, 1, 528, 8, 1, 3, 2}, // (subrame number 4,9)
|
||||
{0xb1, -1, 2, 1, 528, 2, 2, 6, 2}, // (subrame number 4,9)
|
||||
{0xb1, -1, 1, 0, 512, 2, 2, 6, 2}, // (subrame number 9)
|
||||
{0xb1, -1, 1, 0, 512, 8, 1, 3, 2}, // (subrame number 9)
|
||||
{0xb1, -1, 1, 0, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xb1, -1, 1, 0, 768, 2, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xb1, -1, 1, 0, 528, 2, 1, 6, 2}, // (subrame number 4,9)
|
||||
{0xb1, -1, 1, 0, 640, 8, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xb1, -1, 1, 0, 682, 2, 1, 6, 2}, // (subrame number 1,3,5,7,9)
|
||||
{0xb4, -1, 16, 1, 512, 0, 2, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 8, 1, 512, 0, 2, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 4, 1, 512, 2, 1, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 2, 1, 512, 0, 1, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 2, 1, 512, 2, 1, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 2, 1, 640, 2, 1, 1, 12}, // (subrame number 7,9)
|
||||
{0xb4, -1, 2, 1, 528, 2, 1, 1, 12}, // (subrame number 4,9)
|
||||
{0xb4, -1, 2, 1, 528, 0, 2, 1, 12}, // (subrame number 4,9)
|
||||
{0xb4, -1, 2, 1, 768, 0, 2, 1, 12}, // (subrame number 8,9)
|
||||
{0xb4, -1, 2, 1, 924, 0, 1, 1, 12}, // (subrame number 2,3,4,7,8,9)
|
||||
{0xb4, -1, 1, 0, 2, 0, 1, 1, 12}, // (subrame number 1)
|
||||
{0xb4, -1, 1, 0, 4, 0, 1, 1, 12}, // (subrame number 2)
|
||||
{0xb4, -1, 1, 0, 16, 0, 1, 1, 12}, // (subrame number 4)
|
||||
{0xb4, -1, 1, 0, 128, 0, 1, 1, 12}, // (subrame number 7)
|
||||
{0xb4, -1, 1, 0, 512, 0, 1, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 1, 0, 512, 2, 1, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 1, 0, 512, 0, 2, 1, 12}, // (subrame number 9)
|
||||
{0xb4, -1, 1, 0, 528, 2, 1, 1, 12}, // (subrame number 4,9)
|
||||
{0xb4, -1, 1, 0, 640, 2, 1, 1, 12}, // (subrame number 7,9)
|
||||
{0xb4, -1, 1, 0, 768, 0, 2, 1, 12}, // (subrame number 8,9)
|
||||
{0xb4, -1, 1, 0, 792, 2, 1, 1, 12}, // (subrame number 3,4,8,9)
|
||||
{0xb4, -1, 1, 0, 682, 2, 1, 1, 12}, // (subrame number 1,3,5,7,9)
|
||||
{0xb4, -1, 1, 0, 1023, 0, 2, 1, 12}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xb4, -1, 1, 0, 1023, 2, 1, 1, 12}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xc0, -1, 16, 1, 512, 2, 2, 6, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 8, 1, 512, 2, 2, 6, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 4, 1, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 2, 1, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 2, 1, 768, 2, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xc0, -1, 2, 1, 640, 2, 1, 6, 2}, // (subrame number 7,9)
|
||||
{0xc0, -1, 2, 1, 640, 8, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xc0, -1, 2, 1, 528, 8, 1, 3, 2}, // (subrame number 4,9)
|
||||
{0xc0, -1, 2, 1, 528, 2, 2, 6, 2}, // (subrame number 4,9)
|
||||
{0xc0, -1, 2, 1, 924, 2, 1, 6, 2}, // (subrame number 2,3,4,7,8,9)
|
||||
{0xc0, -1, 1, 0, 512, 2, 2, 6, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 1, 0, 512, 8, 1, 3, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 1, 0, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xc0, -1, 1, 0, 768, 2, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xc0, -1, 1, 0, 528, 2, 1, 6, 2}, // (subrame number 4,9)
|
||||
{0xc0, -1, 1, 0, 640, 8, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xc0, -1, 1, 0, 792, 2, 1, 6, 2}, // (subrame number 3,4,8,9)
|
||||
{0xc0, -1, 1, 0, 792, 2, 2, 6, 2}, // (subrame number 3,4,8,9)
|
||||
{0xc0, -1, 1, 0, 682, 2, 1, 6, 2}, // (subrame number 1,3,5,7,9)
|
||||
{0xc0, -1, 1, 0, 1023, 8, 1, 3, 2}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xc2, -1, 16, 1, 512, 2, 2, 2, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 8, 1, 512, 2, 2, 2, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 4, 1, 512, 2, 1, 2, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 2, 1, 512, 2, 1, 2, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 2, 1, 768, 2, 2, 2, 6}, // (subrame number 8,9)
|
||||
{0xc2, -1, 2, 1, 640, 2, 1, 2, 6}, // (subrame number 7,9)
|
||||
{0xc2, -1, 2, 1, 640, 8, 1, 1, 6}, // (subrame number 7,9)
|
||||
{0xc2, -1, 2, 1, 528, 8, 1, 1, 6}, // (subrame number 4,9)
|
||||
{0xc2, -1, 2, 1, 528, 2, 2, 2, 6}, // (subrame number 4,9)
|
||||
{0xc2, -1, 2, 1, 924, 2, 1, 2, 6}, // (subrame number 2,3,4,7,8,9)
|
||||
{0xc2, -1, 8, 1, 512, 8, 2, 1, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 4, 1, 512, 8, 1, 1, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 1, 0, 512, 2, 2, 2, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 1, 0, 512, 8, 1, 1, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 1, 0, 512, 2, 1, 2, 6}, // (subrame number 9)
|
||||
{0xc2, -1, 1, 0, 768, 2, 2, 2, 6}, // (subrame number 8,9)
|
||||
{0xc2, -1, 1, 0, 528, 2, 1, 2, 6}, // (subrame number 4,9)
|
||||
{0xc2, -1, 1, 0, 640, 8, 1, 1, 6}, // (subrame number 7,9)
|
||||
{0xc2, -1, 1, 0, 792, 2, 1, 2, 6}, // (subrame number 3,4,8,9)
|
||||
{0xc2, -1, 1, 0, 792, 2, 2, 2, 6}, // (subrame number 3,4,8,9)
|
||||
{0xc2, -1, 1, 0, 682, 2, 1, 2, 6}, // (subrame number 1,3,5,7,9)
|
||||
{0xc2, -1, 1, 0, 1023, 8, 1, 1, 6}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xa1, 0xb1, 2, 1, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xa1, 0xb1, 2, 1, 528, 8, 1, 3, 2}, // (subrame number 4,9)
|
||||
{0xa1, 0xb1, 2, 1, 640, 8, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xa1, 0xb1, 2, 1, 640, 2, 1, 6, 2}, // (subrame number 7,9)
|
||||
{0xa1, 0xb1, 2, 1, 528, 2, 2, 6, 2}, // (subrame number 4,9)
|
||||
{0xa1, 0xb1, 2, 1, 768, 2, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xa1, 0xb1, 1, 0, 512, 2, 2, 6, 2}, // (subrame number 9)
|
||||
{0xa1, 0xb1, 1, 0, 512, 8, 1, 3, 2}, // (subrame number 9)
|
||||
{0xa1, 0xb1, 1, 0, 512, 2, 1, 6, 2}, // (subrame number 9)
|
||||
{0xa1, 0xb1, 1, 0, 768, 2, 2, 6, 2}, // (subrame number 8,9)
|
||||
{0xa1, 0xb1, 1, 0, 528, 2, 1, 6, 2}, // (subrame number 4,9)
|
||||
{0xa1, 0xb1, 1, 0, 640, 8, 1, 3, 2}, // (subrame number 7,9)
|
||||
{0xa1, 0xb1, 1, 0, 792, 2, 2, 6, 2}, // (subrame number 3,4,8,9)
|
||||
{0xa1, 0xb1, 1, 0, 682, 2, 1, 6, 2}, // (subrame number 1,3,5,7,9)
|
||||
{0xa1, 0xb1, 1, 0, 1023, 8, 1, 3, 2}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xa2, 0xb2, 2, 1, 512, 0, 1, 3, 4}, // (subrame number 9)
|
||||
{0xa2, 0xb2, 2, 1, 528, 6, 1, 2, 4}, // (subrame number 4,9)
|
||||
{0xa2, 0xb2, 2, 1, 640, 6, 1, 2, 4}, // (subrame number 7,9)
|
||||
{0xa2, 0xb2, 2, 1, 528, 0, 2, 3, 4}, // (subrame number 4,9)
|
||||
{0xa2, 0xb2, 2, 1, 768, 0, 2, 3, 4}, // (subrame number 8,9)
|
||||
{0xa2, 0xb2, 1, 0, 512, 0, 2, 3, 4}, // (subrame number 9)
|
||||
{0xa2, 0xb2, 1, 0, 512, 6, 1, 2, 4}, // (subrame number 9)
|
||||
{0xa2, 0xb2, 1, 0, 512, 0, 1, 3, 4}, // (subrame number 9)
|
||||
{0xa2, 0xb2, 1, 0, 768, 0, 2, 3, 4}, // (subrame number 8,9)
|
||||
{0xa2, 0xb2, 1, 0, 528, 0, 1, 3, 4}, // (subrame number 4,9)
|
||||
{0xa2, 0xb2, 1, 0, 640, 6, 1, 2, 4}, // (subrame number 7,9)
|
||||
{0xa2, 0xb2, 1, 0, 792, 0, 1, 3, 4}, // (subrame number 3,4,8,9)
|
||||
{0xa2, 0xb2, 1, 0, 792, 0, 2, 3, 4}, // (subrame number 3,4,8,9)
|
||||
{0xa2, 0xb2, 1, 0, 682, 0, 1, 3, 4}, // (subrame number 1,3,5,7,9)
|
||||
{0xa2, 0xb2, 1, 0, 1023, 6, 1, 2, 4}, // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
{0xa3, 0xb3, 2, 1, 512, 0, 1, 2, 6}, // (subrame number 9)
|
||||
{0xa3, 0xb3, 2, 1, 528, 2, 1, 2, 6}, // (subrame number 4,9)
|
||||
{0xa3, 0xb3, 2, 1, 640, 0, 1, 2, 6}, // (subrame number 7,9)
|
||||
{0xa3, 0xb3, 2, 1, 640, 2, 1, 2, 6}, // (subrame number 7,9)
|
||||
{0xa3, 0xb3, 2, 1, 528, 0, 2, 2, 6}, // (subrame number 4,9)
|
||||
{0xa3, 0xb3, 2, 1, 768, 0, 2, 2, 6}, // (subrame number 8,9)
|
||||
{0xa3, 0xb3, 1, 0, 512, 0, 2, 2, 6}, // (subrame number 9)
|
||||
{0xa3, 0xb3, 1, 0, 512, 2, 1, 2, 6}, // (subrame number 9)
|
||||
{0xa3, 0xb3, 1, 0, 512, 0, 1, 2, 6}, // (subrame number 9)
|
||||
{0xa3, 0xb3, 1, 0, 768, 0, 2, 2, 6}, // (subrame number 8,9)
|
||||
{0xa3, 0xb3, 1, 0, 528, 0, 1, 2, 6}, // (subrame number 4,9)
|
||||
{0xa3, 0xb3, 1, 0, 640, 2, 1, 2, 6}, // (subrame number 7,9)
|
||||
{0xa3, 0xb3, 1, 0, 792, 0, 2, 2, 6}, // (subrame number 3,4,8,9)
|
||||
{0xa3, 0xb3, 1, 0, 682, 0, 1, 2, 6}, // (subrame number 1,3,5,7,9)
|
||||
{0xa3, 0xb3, 1, 0, 1023, 2, 1, 2, 6} // (subrame number 0,1,2,3,4,5,6,7,8,9)
|
||||
};
|
||||
// Table 6.3.3.2-4: Random access configurations for FR2 and unpaired spectrum
|
||||
int64_t table_6_3_3_2_4_prachConfig_Index [256][10] = {
|
||||
//format, format, x, y, y, SFN_nbr, star_symb, slots_sfn, occ_slot, duration
|
||||
{0xa1, -1, 16, 1, -1, 567489872400, 0, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 16, 1, -1, 586406201480, 0, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, -1, 8, 1, 2, 550293209600, 0, 2, 6, 2}, // (subframe number :9,19,29,39)
|
||||
{0xa1, -1, 8, 1, -1, 567489872400, 0, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 8, 1, -1, 586406201480, 0, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, -1, 4, 1, -1, 567489872400, 0, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 4, 1, -1, 567489872400, 0, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 4, 1, -1, 586406201480, 0, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, -1, 2, 1, -1, 551911719040, 0, 2, 6, 2}, // (subframe number :7,15,23,31,39)
|
||||
{0xa1, -1, 2, 1, -1, 567489872400, 0, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 2, 1, -1, 567489872400, 0, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 2, 1, -1, 586406201480, 0, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, -1, 1, 0, -1, 549756338176, 7, 1, 3, 2}, // (subframe number :19,39)
|
||||
{0xa1, -1, 1, 0, -1, 168, 0, 1, 6, 2}, // (subframe number :3,5,7)
|
||||
{0xa1, -1, 1, 0, -1, 567489331200, 7, 1, 3, 2}, // (subframe number :24,29,34,39)
|
||||
{0xa1, -1, 1, 0, -1, 550293209600, 7, 2, 3, 2}, // (subframe number :9,19,29,39)
|
||||
{0xa1, -1, 1, 0, -1, 687195422720, 0, 1, 6, 2}, // (subframe number :17,19,37,39)
|
||||
{0xa1, -1, 1, 0, -1, 550293209600, 0, 2, 6, 2}, // (subframe number :9,19,29,39)
|
||||
{0xa1, -1, 1, 0, -1, 567489872400, 0, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 1, 0, -1, 567489872400, 7, 1, 3, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, -1, 1, 0, -1, 10920, 7, 1, 3, 2}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xa1, -1, 1, 0, -1, 586405642240, 7, 1, 3, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xa1, -1, 1, 0, -1, 551911719040, 0, 1, 6, 2}, // (subframe number :7,15,23,31,39)
|
||||
{0xa1, -1, 1, 0, -1, 586405642240, 0, 1, 6, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xa1, -1, 1, 0, -1, 965830828032, 7, 2, 3, 2}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xa1, -1, 1, 0, -1, 586406201480, 7, 1, 3, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, -1, 1, 0, -1, 586406201480, 0, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, -1, 1, 0, -1, 733007751850, 0, 1, 6, 2}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xa1, -1, 1, 0, -1, 1099511627775, 7, 1, 3, 2}, // (subframe number :0,1,2,…,39)
|
||||
{0xa2, -1, 16, 1, -1, 567489872400, 0, 2, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 16, 1, -1, 586406201480, 0, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, -1, 8, 1, -1, 567489872400, 0, 2, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 8, 1, -1, 586406201480, 0, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, -1, 8, 1, 2, 550293209600, 0, 2, 3, 4}, // (subframe number :9,19,29,39)
|
||||
{0xa2, -1, 4, 1, -1, 567489872400, 0, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 4, 1, -1, 567489872400, 0, 2, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 4, 1, -1, 586406201480, 0, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, -1, 2, 1, -1, 551911719040, 0, 2, 3, 4}, // (subframe number :7,15,23,31,39)
|
||||
{0xa2, -1, 2, 1, -1, 567489872400, 0, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 2, 1, -1, 567489872400, 0, 2, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 2, 1, -1, 586406201480, 0, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, -1, 1, 0, -1, 549756338176, 5, 1, 2, 4}, // (subframe number :19,39)
|
||||
{0xa2, -1, 1, 0, -1, 168, 0, 1, 3, 4}, // (subframe number :3,5,7)
|
||||
{0xa2, -1, 1, 0, -1, 567489331200, 5, 1, 2, 4}, // (subframe number :24,29,34,39)
|
||||
{0xa2, -1, 1, 0, -1, 550293209600, 5, 2, 2, 4}, // (subframe number :9,19,29,39)
|
||||
{0xa2, -1, 1, 0, -1, 687195422720, 0, 1, 3, 4}, // (subframe number :17,19,37,39)
|
||||
{0xa2, -1, 1, 0, -1, 550293209600, 0, 2, 3, 4}, // (subframe number :9, 19, 29, 39)
|
||||
{0xa2, -1, 1, 0, -1, 551911719040, 0, 1, 3, 4}, // (subframe number :7,15,23,31,39)
|
||||
{0xa2, -1, 1, 0, -1, 586405642240, 5, 1, 2, 4}, // (subframe number :23,27,31,35,39)
|
||||
{0xa2, -1, 1, 0, -1, 586405642240, 0, 1, 3, 4}, // (subframe number :23,27,31,35,39)
|
||||
{0xa2, -1, 1, 0, -1, 10920, 5, 1, 2, 4}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xa2, -1, 1, 0, -1, 10920, 0, 1, 3, 4}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xa2, -1, 1, 0, -1, 567489872400, 5, 1, 2, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 1, 0, -1, 567489872400, 0, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, -1, 1, 0, -1, 965830828032, 5, 2, 2, 4}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xa2, -1, 1, 0, -1, 586406201480, 5, 1, 2, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, -1, 1, 0, -1, 586406201480, 0, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, -1, 1, 0, -1, 733007751850, 0, 1, 3, 4}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xa2, -1, 1, 0, -1, 1099511627775, 5, 1, 2, 4}, // (subframe number :0,1,2,…,39)
|
||||
{0xa3, -1, 16, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 16, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, -1, 8, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 8, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, -1, 8, 1, 2, 550293209600, 0, 2, 2, 6}, // (subframe number :9,19,29,39)
|
||||
{0xa3, -1, 4, 1, -1, 567489872400, 0, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 4, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 4, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, -1, 2, 1, -1, 567489872400, 0, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 2, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 2, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, -1, 1, 0, -1, 549756338176, 7, 1, 1, 6}, // (subframe number :19,39)
|
||||
{0xa3, -1, 1, 0, -1, 168, 0, 1, 2, 6}, // (subframe number :3,5,7)
|
||||
{0xa3, -1, 1, 0, -1, 10752, 2, 1, 2, 6}, // (subframe number :9,11,13)
|
||||
{0xa3, -1, 1, 0, -1, 567489331200, 7, 1, 1, 6}, // (subframe number :24,29,34,39)
|
||||
{0xa3, -1, 1, 0, -1, 550293209600, 7, 2, 1, 6}, // (subframe number :9,19,29,39)
|
||||
{0xa3, -1, 1, 0, -1, 687195422720, 0, 1, 2, 6}, // (subframe number :17,19,37,39)
|
||||
{0xa3, -1, 1, 0, -1, 550293209600, 0, 2, 2, 6}, // (subframe number :9,19,29,39)
|
||||
{0xa3, -1, 1, 0, -1, 551911719040, 0, 1, 2, 6}, // (subframe number :7,15,23,31,39)
|
||||
{0xa3, -1, 1, 0, -1, 586405642240, 7, 1, 1, 6}, // (subframe number :23,27,31,35,39)
|
||||
{0xa3, -1, 1, 0, -1, 586405642240, 0, 1, 2, 6}, // (subframe number :23,27,31,35,39)
|
||||
{0xa3, -1, 1, 0, -1, 10920, 0, 1, 2, 6}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xa3, -1, 1, 0, -1, 10920, 7, 1, 1, 6}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xa3, -1, 1, 0, -1, 567489872400, 0, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 1, 0, -1, 567489872400, 7, 1, 1, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, -1, 1, 0, -1, 965830828032, 7, 2, 1, 6}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xa3, -1, 1, 0, -1, 586406201480, 7, 1, 1, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, -1, 1, 0, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, -1, 1, 0, -1, 733007751850, 0, 1, 2, 6}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xa3, -1, 1, 0, -1, 1099511627775, 7, 1, 1, 6}, // (subframe number :0,1,2,…,39)
|
||||
{0xb1, -1, 16, 1, -1, 567489872400, 2, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb1, -1, 8, 1, -1, 567489872400, 2, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb1, -1, 8, 1, 2, 550293209600, 2, 2, 6, 2}, // (subframe number :9,19,29,39)
|
||||
{0xb1, -1, 4, 1, -1, 567489872400, 2, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb1, -1, 2, 1, -1, 567489872400, 2, 2, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb1, -1, 2, 1, -1, 586406201480, 2, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb1, -1, 1, 0, -1, 549756338176, 8, 1, 3, 2}, // (subframe number :19,39)
|
||||
{0xb1, -1, 1, 0, -1, 168, 2, 1, 6, 2}, // (subframe number :3,5,7)
|
||||
{0xb1, -1, 1, 0, -1, 567489331200, 8, 1, 3, 2}, // (subframe number :24,29,34,39)
|
||||
{0xb1, -1, 1, 0, -1, 550293209600, 8, 2, 3, 2}, // (subframe number :9,19,29,39)
|
||||
{0xb1, -1, 1, 0, -1, 687195422720, 2, 1, 6, 2}, // (subframe number :17,19,37,39)
|
||||
{0xb1, -1, 1, 0, -1, 550293209600, 2, 2, 6, 2}, // (subframe number :9,19,29,39)
|
||||
{0xb1, -1, 1, 0, -1, 551911719040, 2, 1, 6, 2}, // (subframe number :7,15,23,31,39)
|
||||
{0xb1, -1, 1, 0, -1, 586405642240, 8, 1, 3, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xb1, -1, 1, 0, -1, 586405642240, 2, 1, 6, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xb1, -1, 1, 0, -1, 10920, 8, 1, 3, 2}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xb1, -1, 1, 0, -1, 567489872400, 8, 1, 3, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb1, -1, 1, 0, -1, 567489872400, 2, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb1, -1, 1, 0, -1, 586406201480, 8, 1, 3, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb1, -1, 1, 0, -1, 965830828032, 8, 2, 3, 2}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xb1, -1, 1, 0, -1, 586406201480, 2, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb1, -1, 1, 0, -1, 733007751850, 2, 1, 6, 2}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xb1, -1, 1, 0, -1, 1099511627775, 8, 1, 3, 2}, // (subframe number :0,1,2,…,39)
|
||||
{0xb4, -1, 16, 1, 2, 567489872400, 0, 2, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 16, 1, 2, 586406201480, 0, 1, 1, 12}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb4, -1, 8, 1, 2, 567489872400, 0, 2, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 8, 1, 2, 586406201480, 0, 1, 1, 12}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb4, -1, 8, 1, 2, 550293209600, 0, 2, 1, 12}, // (subframe number :9,19,29,39)
|
||||
{0xb4, -1, 4, 1, -1, 567489872400, 0, 1, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 4, 1, -1, 567489872400, 0, 2, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 4, 1, 2, 586406201480, 0, 1, 1, 12}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb4, -1, 2, 1, -1, 551911719040, 2, 2, 1, 12}, // (subframe number :7,15,23,31,39)
|
||||
{0xb4, -1, 2, 1, -1, 567489872400, 0, 1, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 2, 1, -1, 567489872400, 0, 2, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 2, 1, -1, 586406201480, 0, 1, 1, 12}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb4, -1, 1, 0, -1, 549756338176, 2, 2, 1, 12}, // (subframe number :19, 39)
|
||||
{0xb4, -1, 1, 0, -1, 687195422720, 0, 1, 1, 12}, // (subframe number :17, 19, 37, 39)
|
||||
{0xb4, -1, 1, 0, -1, 567489331200, 2, 1, 1, 12}, // (subframe number :24,29,34,39)
|
||||
{0xb4, -1, 1, 0, -1, 550293209600, 2, 2, 1, 12}, // (subframe number :9,19,29,39)
|
||||
{0xb4, -1, 1, 0, -1, 550293209600, 0, 2, 1, 12}, // (subframe number :9,19,29,39)
|
||||
{0xb4, -1, 1, 0, -1, 551911719040, 0, 1, 1, 12}, // (subframe number :7,15,23,31,39)
|
||||
{0xb4, -1, 1, 0, -1, 551911719040, 0, 2, 1, 12}, // (subframe number :7,15,23,31,39)
|
||||
{0xb4, -1, 1, 0, -1, 586405642240, 0, 1, 1, 12}, // (subframe number :23,27,31,35,39)
|
||||
{0xb4, -1, 1, 0, -1, 586405642240, 2, 2, 1, 12}, // (subframe number :23,27,31,35,39)
|
||||
{0xb4, -1, 1, 0, -1, 698880, 0, 1, 1, 12}, // (subframe number :9,11,13,15,17,19)
|
||||
{0xb4, -1, 1, 0, -1, 10920, 2, 1, 1, 12}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xb4, -1, 1, 0, -1, 567489872400, 0, 1, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 1, 0, -1, 567489872400, 2, 2, 1, 12}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xb4, -1, 1, 0, -1, 965830828032, 2, 2, 1, 12}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xb4, -1, 1, 0, -1, 586406201480, 0, 1, 1, 12}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb4, -1, 1, 0, -1, 586406201480, 2, 1, 1, 12}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xb4, -1, 1, 0, -1, 44739240, 2, 1, 1, 12}, // (subframe number :3, 5, 7, …, 23,25)
|
||||
{0xb4, -1, 1, 0, -1, 44739240, 0, 2, 1, 12}, // (subframe number :3, 5, 7, …, 23,25)
|
||||
{0xb4, -1, 1, 0, -1, 733007751850, 0, 1, 1, 12}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xb4, -1, 1, 0, -1, 1099511627775, 2, 1, 1, 12}, // (subframe number :0, 1, 2,…, 39)
|
||||
{0xc0, -1, 16, 1, -1, 567489872400, 0, 2, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 16, 1, -1, 586406201480, 0, 1, 7, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc0, -1, 8, 1, -1, 567489872400, 0, 1, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 8, 1, -1, 586406201480, 0, 1, 7, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc0, -1, 8, 1, 2, 550293209600, 0, 2, 7, 2}, // (subframe number :9,19,29,39)
|
||||
{0xc0, -1, 4, 1, -1, 567489872400, 0, 1, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 4, 1, -1, 567489872400, 0, 2, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 4, 1, -1, 586406201480, 0, 1, 7, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc0, -1, 2, 1, -1, 551911719040, 0, 2, 7, 2}, // (subframe number :7,15,23,31,39)
|
||||
{0xc0, -1, 2, 1, -1, 567489872400, 0, 1, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 2, 1, -1, 567489872400, 0, 2, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 2, 1, -1, 586406201480, 0, 1, 7, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc0, -1, 1, 0, -1, 549756338176, 8, 1, 3, 2}, // (subframe number :19,39)
|
||||
{0xc0, -1, 1, 0, -1, 168, 0, 1, 7, 2}, // (subframe number :3,5,7)
|
||||
{0xc0, -1, 1, 0, -1, 567489331200, 8, 1, 3, 2}, // (subframe number :24,29,34,39)
|
||||
{0xc0, -1, 1, 0, -1, 550293209600, 8, 2, 3, 2}, // (subframe number :9,19,29,39)
|
||||
{0xc0, -1, 1, 0, -1, 687195422720, 0, 1, 7, 2}, // (subframe number :17,19,37,39)
|
||||
{0xc0, -1, 1, 0, -1, 550293209600, 0, 2, 7, 2}, // (subframe number :9,19,29,39)
|
||||
{0xc0, -1, 1, 0, -1, 586405642240, 8, 1, 3, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xc0, -1, 1, 0, -1, 551911719040, 0, 1, 7, 2}, // (subframe number :7,15,23,31,39)
|
||||
{0xc0, -1, 1, 0, -1, 586405642240, 0, 1, 7, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xc0, -1, 1, 0, -1, 10920, 8, 1, 3, 2}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xc0, -1, 1, 0, -1, 567489872400, 8, 1, 3, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 1, 0, -1, 567489872400, 0, 1, 7, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc0, -1, 1, 0, -1, 965830828032, 8, 2, 3, 2}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xc0, -1, 1, 0, -1, 586406201480, 8, 1, 3, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc0, -1, 1, 0, -1, 586406201480, 0, 1, 7, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc0, -1, 1, 0, -1, 733007751850, 0, 1, 7, 2}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xc0, -1, 1, 0, -1, 1099511627775, 8, 1, 3, 2}, // (subframe number :0,1,2,…,39)
|
||||
{0xc2, -1, 16, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 16, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc2, -1, 8, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 8, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc2, -1, 8, 1, 2, 550293209600, 0, 2, 2, 6}, // (subframe number :9,19,29,39)
|
||||
{0xc2, -1, 4, 1, -1, 567489872400, 0, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 4, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 4, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc2, -1, 2, 1, -1, 551911719040, 2, 2, 2, 6}, // (subframe number :7,15,23,31,39)
|
||||
{0xc2, -1, 2, 1, -1, 567489872400, 0, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 2, 1, -1, 567489872400, 0, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 2, 1, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc2, -1, 1, 0, -1, 549756338176, 2, 1, 2, 6}, // (subframe number :19,39)
|
||||
{0xc2, -1, 1, 0, -1, 168, 0, 1, 2, 6}, // (subframe number :3,5,7)
|
||||
{0xc2, -1, 1, 0, -1, 567489331200, 7, 1, 1, 6}, // (subframe number :24,29,34,39)
|
||||
{0xc2, -1, 1, 0, -1, 550293209600, 7, 2, 1, 6}, // (subframe number :9,19,29,39)
|
||||
{0xc2, -1, 1, 0, -1, 687195422720, 0, 1, 2, 6}, // (subframe number :17,19,37,39)
|
||||
{0xc2, -1, 1, 0, -1, 550293209600, 2, 2, 2, 6}, // (subframe number :9,19,29,39)
|
||||
{0xc2, -1, 1, 0, -1, 551911719040, 2, 1, 2, 6}, // (subframe number :7,15,23,31,39)
|
||||
{0xc2, -1, 1, 0, -1, 10920, 7, 1, 1, 6}, // (subframe number :3,5,7,9,11,13)
|
||||
{0xc2, -1, 1, 0, -1, 586405642240, 7, 2, 1, 6}, // (subframe number :23,27,31,35,39)
|
||||
{0xc2, -1, 1, 0, -1, 586405642240, 0, 1, 2, 6}, // (subframe number :23,27,31,35,39)
|
||||
{0xc2, -1, 1, 0, -1, 567489872400, 7, 2, 1, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 1, 0, -1, 567489872400, 2, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xc2, -1, 1, 0, -1, 965830828032, 7, 2, 1, 6}, // (subframe number :13,14,15, 29,30,31,37,38,39)
|
||||
{0xc2, -1, 1, 0, -1, 586406201480, 7, 1, 1, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc2, -1, 1, 0, -1, 586406201480, 0, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xc2, -1, 1, 0, -1, 733007751850, 0, 1, 2, 6}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xc2, -1, 1, 0, -1, 1099511627775, 7, 1, 1, 6}, // (subframe number :0,1,2,…,39)
|
||||
{0xa1, 0xb1, 16, 1, -1, 567489872400, 2, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, 0xb1, 16, 1, -1, 586406201480, 2, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, 0xb1, 8, 1, -1, 567489872400, 2, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, 0xb1, 8, 1, -1, 586406201480, 2, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, 0xb1, 4, 1, -1, 567489872400, 2, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, 0xb1, 4, 1, -1, 586406201480, 2, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, 0xb1, 2, 1, -1, 567489872400, 2, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 549756338176, 8, 1, 3, 2}, // (subframe number :19,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 550293209600, 8, 1, 3, 2}, // (subframe number :9,19,29,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 687195422720, 2, 1, 6, 2}, // (subframe number :17,19,37,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 550293209600, 2, 2, 6, 2}, // (subframe number :9,19,29,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 586405642240, 8, 1, 3, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 551911719040, 2, 1, 6, 2}, // (subframe number :7,15,23,31,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 586405642240, 2, 1, 6, 2}, // (subframe number :23,27,31,35,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 567489872400, 8, 1, 3, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 567489872400, 2, 1, 6, 2}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 586406201480, 2, 1, 6, 2}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa1, 0xb1, 1, 0, -1, 733007751850, 2, 1, 6, 2}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xa2, 0xb2, 16, 1, -1, 567489872400, 2, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, 0xb2, 16, 1, -1, 586406201480, 2, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, 0xb2, 8, 1, -1, 567489872400, 2, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, 0xb2, 8, 1, -1, 586406201480, 2, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, 0xb2, 4, 1, -1, 567489872400, 2, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, 0xb2, 4, 1, -1, 586406201480, 2, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, 0xb2, 2, 1, -1, 567489872400, 2, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 549756338176, 6, 1, 2, 4}, // (subframe number :19,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 550293209600, 6, 1, 2, 4}, // (subframe number :9,19,29,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 687195422720, 2, 1, 3, 4}, // (subframe number :17,19,37,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 550293209600, 2, 2, 3, 4}, // (subframe number :9,19,29,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 586405642240, 6, 1, 2, 4}, // (subframe number :23,27,31,35,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 551911719040, 2, 1, 3, 4}, // (subframe number :7,15,23,31,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 586405642240, 2, 1, 3, 4}, // (subframe number :23,27,31,35,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 567489872400, 6, 1, 2, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 567489872400, 2, 1, 3, 4}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 586406201480, 2, 1, 3, 4}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa2, 0xb2, 1, 0, -1, 733007751850, 2, 1, 3, 4}, // (subframe number :1,3,5,7,…,37,39)
|
||||
{0xa3, 0xb3, 16, 1, -1, 567489872400, 2, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, 0xb3, 16, 1, -1, 586406201480, 2, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, 0xb3, 8, 1, -1, 567489872400, 2, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, 0xb3, 8, 1, -1, 586406201480, 2, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, 0xb3, 4, 1, -1, 567489872400, 2, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, 0xb3, 4, 1, -1, 586406201480, 2, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, 0xb3, 2, 1, -1, 567489872400, 2, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 549756338176, 2, 1, 2, 6}, // (subframe number :19,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 550293209600, 2, 1, 2, 6}, // (subframe number :9,19,29,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 687195422720, 2, 1, 2, 6}, // (subframe number :17,19,37,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 550293209600, 2, 2, 2, 6}, // (subframe number :9,19,29,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 551911719040, 2, 1, 2, 6}, // (subframe number :7,15,23,31,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 586405642240, 2, 1, 2, 6}, // (subframe number :23,27,31,35,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 586405642240, 2, 2, 2, 6}, // (subframe number :23,27,31,35,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 567489872400, 2, 1, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 567489872400, 2, 2, 2, 6}, // (subframe number :4,9,14,19,24,29,34,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 586406201480, 2, 1, 2, 6}, // (subframe number :3,7,11,15,19,23,27,31,35,39)
|
||||
{0xa3, 0xb3, 1, 0, -1, 733007751850, 2, 1, 2, 6} // (subframe number :1,3,5,7,…,37,39)
|
||||
};
|
||||
@@ -1072,13 +1072,13 @@ int rx_sss(PHY_VARS_NR_UE *phy_vars_ue,int32_t *tot_metric,uint8_t *flip_max,uin
|
||||
/*! \brief receiver for the PBCH
|
||||
\returns number of tx antennas or -1 if error
|
||||
*/
|
||||
uint16_t rx_pbch(NR_UE_COMMON *lte_ue_common_vars,
|
||||
NR_UE_PBCH *lte_ue_pbch_vars,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4);
|
||||
int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
NR_UE_PBCH *nr_ue_pbch_vars,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag);
|
||||
|
||||
uint16_t rx_pbch_emul(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
uint8_t eNB_id,
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
#include <limits.h>
|
||||
#include "PHY/impl_defs_top.h"
|
||||
|
||||
|
||||
|
||||
//#include "PHY/defs_nr_UE.h"
|
||||
//#include "../LTE_TRANSPORT/dci.h"
|
||||
//#include "../LTE_TRANSPORT/mdci.h"
|
||||
@@ -155,6 +157,11 @@ typedef struct {
|
||||
// int calibration_flag;
|
||||
/// Number of soft channel bits
|
||||
uint32_t G;
|
||||
// number of symbols
|
||||
uint8_t nb_symbols;
|
||||
// first symbol in the slot
|
||||
uint8_t start_symbol;
|
||||
|
||||
// decode phich
|
||||
uint8_t decode_phich;
|
||||
} NR_UL_UE_HARQ_t;
|
||||
@@ -326,6 +333,8 @@ typedef struct {
|
||||
uint8_t rnti_type;
|
||||
/// Active flag for DLSCH demodulation
|
||||
uint8_t active;
|
||||
/// accumulated tx power adjustment for PUCCH
|
||||
int8_t g_pucch;
|
||||
/// Transmission mode
|
||||
uint8_t mode1_flag;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols without pilots
|
||||
@@ -347,7 +356,7 @@ typedef struct {
|
||||
//#if defined(UPGRADE_RAT_NR)
|
||||
#if 1
|
||||
/// Pointers to up to HARQ processes
|
||||
NR_DL_UE_HARQ_t *harq_processes[NR_MAX_DLSCH_HARQ_PROCESSES];
|
||||
NR_DL_UE_HARQ_t harq_processes[NR_MAX_DLSCH_HARQ_PROCESSES];
|
||||
// DL number of harq processes
|
||||
uint8_t number_harq_processes_for_pdsch;
|
||||
/* higher layer parameter for reception of two transport blocks TS 38.213 9.1.3.1 Type-2 HARQ-ACK codebook dtermination */
|
||||
@@ -365,8 +374,8 @@ typedef struct {
|
||||
uint8_t max_turbo_iterations;
|
||||
/// number of iterations used in last turbo decoding
|
||||
uint8_t last_iteration_cnt;
|
||||
/// accumulated tx power adjustment for PUCCH
|
||||
int8_t g_pucch;
|
||||
|
||||
|
||||
} NR_UE_DLSCH_t;
|
||||
|
||||
typedef enum {format0_0,
|
||||
|
||||
@@ -1,492 +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
|
||||
*/
|
||||
|
||||
#ifndef __INIT_DEFS_NR__H__
|
||||
#define __INIT_DEFS_NR__H__
|
||||
|
||||
/*
|
||||
#define _GNU_SOURCE
|
||||
#include <sched.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/mman.h>
|
||||
#include <linux/sched.h>
|
||||
#include <signal.h>
|
||||
#include <execinfo.h>
|
||||
#include <getopt.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <malloc.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "defs.h"
|
||||
#include "assertions.h"*/
|
||||
#include "impl_defs_nr.h"
|
||||
#include "defs_nr_common.h"
|
||||
|
||||
#define MAX_NUM_SUBCARRIER_SPACING 5
|
||||
|
||||
#define NR_SYMBOLS_PER_SLOT 14
|
||||
|
||||
#define NR_PSS_LENGTH 127
|
||||
#define NR_SSS_LENGTH 127
|
||||
|
||||
#define ONE_OVER_SQRT2_Q15 23170
|
||||
#define ONE_OVER_TWO_Q15 16384
|
||||
|
||||
#define MOD_TABLE_SIZE_SHORT 6
|
||||
#define MOD_TABLE_BPSK_OFFSET 1
|
||||
|
||||
/*
|
||||
typedef enum {
|
||||
NR_MU_0=0,
|
||||
NR_MU_1,
|
||||
NR_MU_2,
|
||||
NR_MU_3,
|
||||
NR_MU_4,
|
||||
} nr_numerology_index_e;
|
||||
|
||||
//NR types temporarily placed here
|
||||
typedef struct {
|
||||
uint32_t subcarrier_spacing;
|
||||
/// 3/4 sampling
|
||||
uint8_t threequarter_fs;
|
||||
/// Size of FFT
|
||||
uint16_t ofdm_symbol_size;
|
||||
/// Number of prefix samples in all but first symbol of slot
|
||||
uint16_t nb_prefix_samples;
|
||||
/// Number of prefix samples in first symbol of slot
|
||||
uint16_t nb_prefix_samples0;
|
||||
/// Carrier offset in FFT buffer for first RE in PRB0
|
||||
uint16_t first_carrier_offset;
|
||||
/// Number of OFDM/SC-FDMA symbols in one slot
|
||||
uint16_t symbols_per_slot;
|
||||
/// Number of slots per subframe
|
||||
uint16_t slots_per_subframe;
|
||||
/// Number of samples in a subframe
|
||||
uint32_t samples_per_subframe;
|
||||
/// Number of samples in a radio frame
|
||||
uint32_t samples_per_frame;
|
||||
/// Number of samples in a subframe without CP
|
||||
uint32_t samples_per_subframe_wCP;
|
||||
/// Number of samples in a radio frame without CP
|
||||
uint32_t samples_per_frame_wCP;
|
||||
|
||||
} NR_DL_FRAME_PARMS;
|
||||
*/
|
||||
|
||||
/// Top-level PHY Data Structure for gNB
|
||||
typedef struct PHY_VARS_gNB_s {
|
||||
/// Module ID indicator for this instance
|
||||
module_id_t Mod_id;
|
||||
uint8_t CC_id;
|
||||
uint8_t configured;
|
||||
gNB_proc_t proc;
|
||||
int single_thread_flag;
|
||||
int abstraction_flag;
|
||||
int num_RU;
|
||||
RU_t *RU_list[MAX_NUM_RU_PER_eNB];
|
||||
/// Ethernet parameters for northbound midhaul interface
|
||||
eth_params_t eth_params_n;
|
||||
/// Ethernet parameters for fronthaul interface
|
||||
eth_params_t eth_params;
|
||||
int rx_total_gain_dB;
|
||||
int (*td)(struct PHY_VARS_gNB_s *eNB,int UE_id,int harq_pid,int llr8_flag);
|
||||
int (*te)(struct PHY_VARS_gNB_s *,uint8_t *,uint8_t,LTE_eNB_DLSCH_t *,int,uint8_t,time_stats_t *,time_stats_t *,time_stats_t *);
|
||||
int (*start_if)(struct RU_t_s *ru,struct PHY_VARS_gNB_s *eNB);
|
||||
uint8_t local_flag;
|
||||
nfapi_nr_config_request_t gNB_config;
|
||||
NR_DL_FRAME_PARMS frame_parms;
|
||||
PHY_MEASUREMENTS_gNB measurements;
|
||||
NR_IF_Module_t *if_inst;
|
||||
NR_UL_IND_t UL_INFO;
|
||||
pthread_mutex_t UL_INFO_mutex;
|
||||
/// NFAPI RX ULSCH information
|
||||
nfapi_rx_indication_pdu_t rx_pdu_list[NFAPI_RX_IND_MAX_PDU];
|
||||
/// NFAPI RX ULSCH CRC information
|
||||
nfapi_crc_indication_pdu_t crc_pdu_list[NFAPI_CRC_IND_MAX_PDU];
|
||||
/// NFAPI HARQ information
|
||||
nfapi_harq_indication_pdu_t harq_pdu_list[NFAPI_HARQ_IND_MAX_PDU];
|
||||
/// NFAPI SR information
|
||||
nfapi_sr_indication_pdu_t sr_pdu_list[NFAPI_SR_IND_MAX_PDU];
|
||||
/// NFAPI CQI information
|
||||
nfapi_cqi_indication_pdu_t cqi_pdu_list[NFAPI_CQI_IND_MAX_PDU];
|
||||
/// NFAPI CQI information (raw component)
|
||||
nfapi_cqi_indication_raw_pdu_t cqi_raw_pdu_list[NFAPI_CQI_IND_MAX_PDU];
|
||||
/// NFAPI PRACH information
|
||||
nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES];
|
||||
|
||||
Sched_Rsp_t Sched_INFO;
|
||||
LTE_eNB_PDCCH pdcch_vars[2];
|
||||
LTE_eNB_PHICH phich_vars[2];
|
||||
|
||||
NR_gNB_COMMON common_vars;
|
||||
LTE_eNB_UCI uci_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_PBCH pbch;
|
||||
LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_PRACH prach_vars;
|
||||
LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
|
||||
LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
|
||||
LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p;
|
||||
LTE_eNB_DLSCH_t *dlsch_MCH;
|
||||
LTE_eNB_DLSCH_t *dlsch_PCH;
|
||||
LTE_eNB_UE_stats UE_stats[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_UE_stats *UE_stats_ptr[NUMBER_OF_UE_MAX];
|
||||
|
||||
uint8_t pbch_configured;
|
||||
uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE
|
||||
char gNB_generate_rar;
|
||||
|
||||
/// Indicator set to 0 after first SR
|
||||
uint8_t first_sr[NUMBER_OF_UE_MAX];
|
||||
|
||||
uint32_t max_peak_val;
|
||||
|
||||
/// \brief sinr for all subcarriers of the current link (used only for abstraction).
|
||||
/// first index: ? [0..N_RB_DL*12[
|
||||
double *sinr_dB;
|
||||
|
||||
/// N0 (used for abstraction)
|
||||
double N0;
|
||||
|
||||
unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX];
|
||||
unsigned char first_run_I0_measurements;
|
||||
|
||||
|
||||
unsigned char is_secondary_gNB; // primary by default
|
||||
unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system.
|
||||
unsigned char has_valid_precoder; /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from, and this B/F vector is created.
|
||||
unsigned char PgNB_id; /// id of Primary eNB
|
||||
|
||||
/// hold the precoder for NULL beam to the primary user
|
||||
int **dl_precoder_SgNB[3];
|
||||
char log2_maxp; /// holds the maximum channel/precoder coefficient
|
||||
|
||||
/// if ==0 enables phy only test mode
|
||||
int mac_enabled;
|
||||
/// counter to average prach energh over first 100 prach opportunities
|
||||
int prach_energy_counter;
|
||||
|
||||
// PDSCH Varaibles
|
||||
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
// PUSCH Varaibles
|
||||
PUSCH_CONFIG_DEDICATED pusch_config_dedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
// PUCCH variables
|
||||
PUCCH_CONFIG_DEDICATED pucch_config_dedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
// UL-POWER-Control
|
||||
UL_POWER_CONTROL_DEDICATED ul_power_control_dedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
// TPC
|
||||
TPC_PDCCH_CONFIG tpc_pdcch_config_pucch[NUMBER_OF_UE_MAX];
|
||||
TPC_PDCCH_CONFIG tpc_pdcch_config_pusch[NUMBER_OF_UE_MAX];
|
||||
|
||||
// CQI reporting
|
||||
CQI_REPORT_CONFIG cqi_report_config[NUMBER_OF_UE_MAX];
|
||||
|
||||
// SRS Variables
|
||||
SOUNDINGRS_UL_CONFIG_DEDICATED soundingrs_ul_config_dedicated[NUMBER_OF_UE_MAX];
|
||||
uint8_t ncs_cell[20][7];
|
||||
|
||||
// Scheduling Request Config
|
||||
SCHEDULING_REQUEST_CONFIG scheduling_request_config[NUMBER_OF_UE_MAX];
|
||||
|
||||
// Transmission mode per UE
|
||||
uint8_t transmission_mode[NUMBER_OF_UE_MAX];
|
||||
|
||||
/// cba_last successful reception for each group, used for collision detection
|
||||
uint8_t cba_last_reception[4];
|
||||
|
||||
// Pointers for active physicalConfigDedicated to be applied in current subframe
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
|
||||
uint32_t rb_mask_ul[4];
|
||||
|
||||
/// Information regarding TM5
|
||||
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
|
||||
|
||||
|
||||
/// target_ue_dl_mcs : only for debug purposes
|
||||
uint32_t target_ue_dl_mcs;
|
||||
/// target_ue_ul_mcs : only for debug purposes
|
||||
uint32_t target_ue_ul_mcs;
|
||||
/// target_ue_dl_rballoc : only for debug purposes
|
||||
uint32_t ue_dl_rb_alloc;
|
||||
/// target ul PRBs : only for debug
|
||||
uint32_t ue_ul_nb_rb;
|
||||
|
||||
///check for Total Transmissions
|
||||
uint32_t check_for_total_transmissions;
|
||||
|
||||
///check for MU-MIMO Transmissions
|
||||
uint32_t check_for_MUMIMO_transmissions;
|
||||
|
||||
///check for SU-MIMO Transmissions
|
||||
uint32_t check_for_SUMIMO_transmissions;
|
||||
|
||||
///check for FULL MU-MIMO Transmissions
|
||||
uint32_t FULL_MUMIMO_transmissions;
|
||||
|
||||
/// Counter for total bitrate, bits and throughput in downlink
|
||||
uint32_t total_dlsch_bitrate;
|
||||
uint32_t total_transmitted_bits;
|
||||
uint32_t total_system_throughput;
|
||||
|
||||
int hw_timing_advance;
|
||||
|
||||
time_stats_t phy_proc;
|
||||
time_stats_t phy_proc_tx;
|
||||
time_stats_t phy_proc_rx;
|
||||
time_stats_t rx_prach;
|
||||
|
||||
time_stats_t ofdm_mod_stats;
|
||||
time_stats_t dlsch_encoding_stats;
|
||||
time_stats_t dlsch_modulation_stats;
|
||||
time_stats_t dlsch_scrambling_stats;
|
||||
time_stats_t dlsch_rate_matching_stats;
|
||||
time_stats_t dlsch_turbo_encoding_stats;
|
||||
time_stats_t dlsch_interleaving_stats;
|
||||
|
||||
time_stats_t rx_dft_stats;
|
||||
time_stats_t ulsch_channel_estimation_stats;
|
||||
time_stats_t ulsch_freq_offset_estimation_stats;
|
||||
time_stats_t ulsch_decoding_stats;
|
||||
time_stats_t ulsch_demodulation_stats;
|
||||
time_stats_t ulsch_rate_unmatching_stats;
|
||||
time_stats_t ulsch_turbo_decoding_stats;
|
||||
time_stats_t ulsch_deinterleaving_stats;
|
||||
time_stats_t ulsch_demultiplexing_stats;
|
||||
time_stats_t ulsch_llr_stats;
|
||||
time_stats_t ulsch_tc_init_stats;
|
||||
time_stats_t ulsch_tc_alpha_stats;
|
||||
time_stats_t ulsch_tc_beta_stats;
|
||||
time_stats_t ulsch_tc_gamma_stats;
|
||||
time_stats_t ulsch_tc_ext_stats;
|
||||
time_stats_t ulsch_tc_intl1_stats;
|
||||
time_stats_t ulsch_tc_intl2_stats;
|
||||
|
||||
#ifdef LOCALIZATION
|
||||
/// time state for localization
|
||||
time_stats_t localization_stats;
|
||||
#endif
|
||||
|
||||
int32_t pucch1_stats_cnt[NUMBER_OF_UE_MAX][10];
|
||||
int32_t pucch1_stats[NUMBER_OF_UE_MAX][10*1024];
|
||||
int32_t pucch1_stats_thres[NUMBER_OF_UE_MAX][10*1024];
|
||||
int32_t pucch1ab_stats_cnt[NUMBER_OF_UE_MAX][10];
|
||||
int32_t pucch1ab_stats[NUMBER_OF_UE_MAX][2*10*1024];
|
||||
int32_t pusch_stats_rb[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_round[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_mcs[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
|
||||
} PHY_VARS_gNB;
|
||||
|
||||
/// Context data structure for RX/TX portion of subframe processing
|
||||
typedef struct {
|
||||
/// Component Carrier index
|
||||
uint8_t CC_id;
|
||||
/// timestamp transmitted to HW
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for transmission
|
||||
int subframe_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
/// \brief Instance count for RXn-TXnp4 processing thread.
|
||||
/// \internal This variable is protected by \ref mutex_rxtx.
|
||||
int instance_cnt_rxtx;
|
||||
/// pthread structure for RXn-TXnp4 processing thread
|
||||
pthread_t pthread_rxtx;
|
||||
/// pthread attributes for RXn-TXnp4 processing thread
|
||||
pthread_attr_t attr_rxtx;
|
||||
/// condition variable for tx processing thread
|
||||
pthread_cond_t cond_rxtx;
|
||||
/// mutex for RXn-TXnp4 processing thread
|
||||
pthread_mutex_t mutex_rxtx;
|
||||
/// scheduling parameters for RXn-TXnp4 thread
|
||||
struct sched_param sched_param_rxtx;
|
||||
} gNB_rxtx_proc_t;
|
||||
|
||||
|
||||
/// Context data structure for eNB subframe processing
|
||||
typedef struct gNB_proc_t_s {
|
||||
/// Component Carrier index
|
||||
uint8_t CC_id;
|
||||
/// thread index
|
||||
int thread_index;
|
||||
/// timestamp received from HW
|
||||
openair0_timestamp timestamp_rx;
|
||||
/// timestamp to send to "slave rru"
|
||||
openair0_timestamp timestamp_tx;
|
||||
/// subframe to act upon for reception
|
||||
int subframe_rx;
|
||||
/// subframe to act upon for PRACH
|
||||
int subframe_prach;
|
||||
/// frame to act upon for reception
|
||||
int frame_rx;
|
||||
/// frame to act upon for transmission
|
||||
int frame_tx;
|
||||
/// frame to act upon for PRACH
|
||||
int frame_prach;
|
||||
/// \internal This variable is protected by \ref mutex_td.
|
||||
int instance_cnt_td;
|
||||
/// \internal This variable is protected by \ref mutex_te.
|
||||
int instance_cnt_te;
|
||||
/// \internal This variable is protected by \ref mutex_prach.
|
||||
int instance_cnt_prach;
|
||||
|
||||
// instance count for over-the-air gNB synchronization
|
||||
int instance_cnt_synch;
|
||||
/// \internal This variable is protected by \ref mutex_asynch_rxtx.
|
||||
int instance_cnt_asynch_rxtx;
|
||||
/// pthread structure for eNB single processing thread
|
||||
pthread_t pthread_single;
|
||||
/// pthread structure for asychronous RX/TX processing thread
|
||||
pthread_t pthread_asynch_rxtx;
|
||||
/// flag to indicate first RX acquisition
|
||||
int first_rx;
|
||||
/// flag to indicate first TX transmission
|
||||
int first_tx;
|
||||
/// pthread attributes for parallel turbo-decoder thread
|
||||
pthread_attr_t attr_td;
|
||||
/// pthread attributes for parallel turbo-encoder thread
|
||||
pthread_attr_t attr_te;
|
||||
/// pthread attributes for single eNB processing thread
|
||||
pthread_attr_t attr_single;
|
||||
/// pthread attributes for prach processing thread
|
||||
pthread_attr_t attr_prach;
|
||||
/// pthread attributes for asynchronous RX thread
|
||||
pthread_attr_t attr_asynch_rxtx;
|
||||
/// scheduling parameters for parallel turbo-decoder thread
|
||||
struct sched_param sched_param_td;
|
||||
/// scheduling parameters for parallel turbo-encoder thread
|
||||
struct sched_param sched_param_te;
|
||||
/// scheduling parameters for single eNB thread
|
||||
struct sched_param sched_param_single;
|
||||
/// scheduling parameters for prach thread
|
||||
struct sched_param sched_param_prach;
|
||||
/// scheduling parameters for asynch_rxtx thread
|
||||
struct sched_param sched_param_asynch_rxtx;
|
||||
/// pthread structure for parallel turbo-decoder thread
|
||||
pthread_t pthread_td;
|
||||
/// pthread structure for parallel turbo-encoder thread
|
||||
pthread_t pthread_te;
|
||||
/// pthread structure for PRACH thread
|
||||
pthread_t pthread_prach;
|
||||
/// condition variable for parallel turbo-decoder thread
|
||||
pthread_cond_t cond_td;
|
||||
/// condition variable for parallel turbo-encoder thread
|
||||
pthread_cond_t cond_te;
|
||||
/// condition variable for PRACH processing thread;
|
||||
pthread_cond_t cond_prach;
|
||||
/// condition variable for asynch RX/TX thread
|
||||
pthread_cond_t cond_asynch_rxtx;
|
||||
/// mutex for parallel turbo-decoder thread
|
||||
pthread_mutex_t mutex_td;
|
||||
/// mutex for parallel turbo-encoder thread
|
||||
pthread_mutex_t mutex_te;
|
||||
/// mutex for PRACH thread
|
||||
pthread_mutex_t mutex_prach;
|
||||
/// mutex for asynch RX/TX thread
|
||||
pthread_mutex_t mutex_asynch_rxtx;
|
||||
/// mutex for RU access to eNB processing (PDSCH/PUSCH)
|
||||
pthread_mutex_t mutex_RU;
|
||||
/// mutex for RU access to eNB processing (PRACH)
|
||||
pthread_mutex_t mutex_RU_PRACH;
|
||||
/// mutex for RU access to eNB processing (PRACH BR)
|
||||
pthread_mutex_t mutex_RU_PRACH_br;
|
||||
/// mask for RUs serving eNB (PDSCH/PUSCH)
|
||||
int RU_mask;
|
||||
/// mask for RUs serving eNB (PRACH)
|
||||
int RU_mask_prach;
|
||||
/// parameters for turbo-decoding worker thread
|
||||
td_params tdp;
|
||||
/// parameters for turbo-encoding worker thread
|
||||
te_params tep;
|
||||
/// set of scheduling variables RXn-TXnp4 threads
|
||||
gNB_rxtx_proc_t proc_rxtx[2];
|
||||
} gNB_proc_t;
|
||||
|
||||
typedef struct {
|
||||
// common measurements
|
||||
//! estimated noise power (linear)
|
||||
unsigned int n0_power[MAX_NUM_RU_PER_eNB];
|
||||
//! estimated noise power (dB)
|
||||
unsigned short n0_power_dB[MAX_NUM_RU_PER_eNB];
|
||||
//! total estimated noise power (linear)
|
||||
unsigned int n0_power_tot;
|
||||
//! estimated avg noise power (dB)
|
||||
unsigned short n0_power_tot_dB;
|
||||
//! estimated avg noise power (dB)
|
||||
short n0_power_tot_dBm;
|
||||
//! estimated avg noise power per RB per RX ant (lin)
|
||||
unsigned short n0_subband_power[MAX_NUM_RU_PER_eNB][100];
|
||||
//! estimated avg noise power per RB per RX ant (dB)
|
||||
unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_eNB][100];
|
||||
//! estimated avg noise power per RB (dB)
|
||||
short n0_subband_power_tot_dB[100];
|
||||
//! estimated avg noise power per RB (dBm)
|
||||
short n0_subband_power_tot_dBm[100];
|
||||
// gNB measurements (per user)
|
||||
//! estimated received spatial signal power (linear)
|
||||
unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
|
||||
//! estimated received spatial signal power (dB)
|
||||
unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2];
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_UE_MAX];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_UE_MAX][2];
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation_dB[NUMBER_OF_UE_MAX][2];
|
||||
|
||||
/// Wideband CQI (= SINR)
|
||||
int wideband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
|
||||
/// Wideband CQI in dB (= SINR dB)
|
||||
int wideband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
|
||||
/// Wideband CQI (sum of all RX antennas, in dB)
|
||||
char wideband_cqi_tot[NUMBER_OF_UE_MAX];
|
||||
/// Subband CQI per RX antenna and RB (= SINR)
|
||||
int subband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
|
||||
/// Total Subband CQI and RB (= SINR)
|
||||
int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
|
||||
/// Subband CQI in dB and RB (= SINR dB)
|
||||
int subband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
|
||||
/// Total Subband CQI and RB
|
||||
int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
|
||||
/// PRACH background noise level
|
||||
int prach_I0;
|
||||
} PHY_MEASUREMENTS_gNB;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -35,7 +35,6 @@
|
||||
|
||||
|
||||
#define MAX_BANDS_PER_RRU 4
|
||||
#define MAX_NUM_RU_PER_gNB MAX_NUM_RU_PER_eNB
|
||||
|
||||
|
||||
#ifdef OCP_FRAMEWORK
|
||||
|
||||
@@ -576,7 +576,7 @@ typedef struct PHY_VARS_eNB_s {
|
||||
unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX];
|
||||
unsigned char first_run_I0_measurements;
|
||||
|
||||
|
||||
|
||||
unsigned char is_secondary_eNB; // primary by default
|
||||
unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system.
|
||||
unsigned char has_valid_precoder; /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from, and this B/F vector is created.
|
||||
@@ -710,6 +710,4 @@ typedef struct PHY_VARS_eNB_s {
|
||||
int32_t pusch_stats_bsr[NUMBER_OF_UE_MAX][10240];
|
||||
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
|
||||
} PHY_VARS_eNB;
|
||||
|
||||
|
||||
#endif /* __PHY_DEFS_ENB__H__ */
|
||||
#endif // __PHY_DEFS_eNB_H__
|
||||
|
||||
+34
-10
@@ -29,6 +29,7 @@
|
||||
\note
|
||||
\warning
|
||||
*/
|
||||
|
||||
#ifndef __PHY_DEFS_GNB__H__
|
||||
#define __PHY_DEFS_GNB__H__
|
||||
|
||||
@@ -37,13 +38,33 @@
|
||||
#include "CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
|
||||
#define MAX_NUM_RU_PER_gNB MAX_NUM_RU_PER_eNB
|
||||
|
||||
typedef struct {
|
||||
uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
|
||||
uint8_t pbch_a_interleaved[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
|
||||
uint8_t pbch_a_prime[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
|
||||
uint8_t pbch_e[NR_POLAR_PBCH_E];
|
||||
uint32_t pbch_a_interleaved;
|
||||
uint32_t pbch_a_prime;
|
||||
uint32_t pbch_e[NR_POLAR_PBCH_E_DWORD];
|
||||
} NR_gNB_PBCH;
|
||||
|
||||
typedef struct {
|
||||
/// Length of DCI payload in bits
|
||||
uint16_t size;
|
||||
/// Aggregation level
|
||||
uint8_t L;
|
||||
/// PDCCH parameters
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t pdcch_params;
|
||||
/// CCE list
|
||||
nr_cce_t cce_list[NR_MAX_PDCCH_AGG_LEVEL];
|
||||
/// DCI pdu
|
||||
uint32_t dci_pdu[4];
|
||||
} NR_gNB_DCI_ALLOC_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t num_dci;
|
||||
NR_gNB_DCI_ALLOC_t dci_alloc[256];
|
||||
} NR_gNB_PDCCH;
|
||||
|
||||
typedef struct {
|
||||
/// \brief Pointers (dynamic) to the received data in the time domain.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
@@ -263,14 +284,16 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// NFAPI PRACH information
|
||||
nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES];
|
||||
|
||||
Sched_Rsp_t Sched_INFO;
|
||||
LTE_eNB_PDCCH pdcch_vars[2];
|
||||
LTE_eNB_PHICH phich_vars[2];
|
||||
Sched_Rsp_t Sched_INFO;
|
||||
NR_gNB_PDCCH pdcch_vars;
|
||||
NR_gNB_PBCH pbch;
|
||||
t_nrPolar_paramsPtr nrPolar_params;
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t pdcch_type0_params;
|
||||
LTE_eNB_PHICH phich_vars[2];
|
||||
|
||||
NR_gNB_COMMON common_vars;
|
||||
LTE_eNB_UCI uci_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
|
||||
NR_gNB_PBCH pbch;
|
||||
LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
|
||||
LTE_eNB_PRACH prach_vars;
|
||||
LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
|
||||
@@ -292,6 +315,9 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// PBCH DMRS sequence
|
||||
uint32_t nr_gold_pbch_dmrs[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
|
||||
|
||||
/// PDCCH DMRS sequence
|
||||
uint32_t ***nr_gold_pdcch_dmrs;
|
||||
|
||||
/// Indicator set to 0 after first SR
|
||||
uint8_t first_sr[NUMBER_OF_UE_MAX];
|
||||
|
||||
@@ -307,7 +333,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
unsigned char first_run_timing_advance[NUMBER_OF_UE_MAX];
|
||||
unsigned char first_run_I0_measurements;
|
||||
|
||||
|
||||
|
||||
unsigned char is_secondary_gNB; // primary by default
|
||||
unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system.
|
||||
unsigned char has_valid_precoder; /// Flag to tell if secondary eNB has channel estimates to create NULL-beams from, and this B/F vector is created.
|
||||
@@ -440,6 +466,4 @@ typedef struct PHY_VARS_gNB_s {
|
||||
int32_t pusch_stats_BO[NUMBER_OF_UE_MAX][10240];
|
||||
} PHY_VARS_gNB;
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -603,8 +603,8 @@ typedef struct {
|
||||
#define SUL_IND_0_1 2
|
||||
#define SLOT_FORMAT_IND 3
|
||||
#define PRE_EMPTION_IND 4
|
||||
#define TPC_CMD_NUMBER 5
|
||||
#define BLOCK_NUMBER 6
|
||||
#define BLOCK_NUMBER 5
|
||||
#define CLOSE_LOOP_IND 6
|
||||
#define BANDWIDTH_PART_IND 7
|
||||
#define SHORT_MESSAGE_IND 8
|
||||
#define SHORT_MESSAGES 9
|
||||
@@ -639,7 +639,7 @@ typedef struct {
|
||||
#define ANTENNA_PORTS 38
|
||||
#define TCI 39
|
||||
#define SRS_REQUEST 40
|
||||
#define TPC_CMD_NUMBER_FORMAT2_3 41
|
||||
#define TPC_CMD 41
|
||||
#define CSI_REQUEST 42
|
||||
#define CBGTI 43
|
||||
#define CBGFI 44
|
||||
@@ -708,7 +708,7 @@ typedef struct {
|
||||
} NR_UE_CORESET_CCE_REG_MAPPING_t;
|
||||
|
||||
typedef enum {allContiguousRBs=0,sameAsREGbundle=1} NR_UE_CORESET_precoder_granularity_t;
|
||||
|
||||
typedef enum {tciPresentInDCI_enabled = 1} tciPresentInDCI_t;
|
||||
typedef struct {
|
||||
/*
|
||||
* define CORESET structure according to 38.331
|
||||
@@ -747,7 +747,7 @@ typedef struct {
|
||||
NR_UE_CORESET_CCE_REG_MAPPING_t cce_reg_mappingType;
|
||||
NR_UE_CORESET_precoder_granularity_t precoderGranularity;
|
||||
int tciStatesPDCCH;
|
||||
int tciPresentInDCI;
|
||||
tciPresentInDCI_t tciPresentInDCI;
|
||||
uint16_t pdcchDMRSScramblingID;
|
||||
uint16_t rb_offset;
|
||||
} NR_UE_PDCCH_CORESET;
|
||||
@@ -921,8 +921,8 @@ typedef struct {
|
||||
/// - second index: ? [0..287] (hard coded)
|
||||
int32_t **dl_ch_estimates_ext;
|
||||
uint8_t pbch_a[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
|
||||
uint8_t pbch_a_interleaved[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
|
||||
uint8_t pbch_a_prime[NR_POLAR_PBCH_PAYLOAD_BITS>>3];
|
||||
uint32_t pbch_a_interleaved;
|
||||
uint32_t pbch_a_prime;
|
||||
uint8_t pbch_e[NR_POLAR_PBCH_E];
|
||||
int16_t demod_pbch_e[NR_POLAR_PBCH_E];
|
||||
/// \brief Pointer to PBCH llrs.
|
||||
@@ -1061,6 +1061,7 @@ typedef struct {
|
||||
uint32_t dmrs_pbch_bitmap_nr[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE];
|
||||
|
||||
#endif
|
||||
t_nrPolar_paramsPtr nrPolar_params;
|
||||
|
||||
/// PBCH DMRS sequence
|
||||
uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
|
||||
@@ -1189,6 +1190,14 @@ typedef struct {
|
||||
PUCCH_Config_t pucch_config_dedicated_nr[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
PUSCH_Config_t pusch_config;
|
||||
SRS_NR srs;
|
||||
|
||||
crossCarrierSchedulingConfig_t crossCarrierSchedulingConfig;
|
||||
supplementaryUplink_t supplementaryUplink;
|
||||
dmrs_UplinkConfig_t dmrs_UplinkConfig;
|
||||
dmrs_DownlinkConfig_t dmrs_DownlinkConfig;
|
||||
csi_MeasConfig_t csi_MeasConfig;
|
||||
PUSCH_ServingCellConfig_t PUSCH_ServingCellConfig;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -43,6 +43,11 @@
|
||||
|
||||
#define MAX_NUM_SUBCARRIER_SPACING 5
|
||||
|
||||
#define NR_MAX_NB_RB 275
|
||||
|
||||
#define NR_NB_SC_PER_RB 12
|
||||
#define NR_NB_REG_PER_CCE 6
|
||||
|
||||
#define NR_SYMBOLS_PER_SLOT 14
|
||||
|
||||
#define ONE_OVER_SQRT2_Q15 23170
|
||||
@@ -56,10 +61,24 @@
|
||||
#define NR_SSS_LENGTH 127
|
||||
|
||||
#define NR_PBCH_DMRS_LENGTH 144 // in mod symbols
|
||||
#define NR_PBCH_DMRS_LENGTH_DWORD 10 // roundup(2(QPSK)*NR_PBCH_DMRS_LENGTH/32)
|
||||
#define NR_PBCH_DMRS_LENGTH_DWORD 10 // ceil(2(QPSK)*NR_PBCH_DMRS_LENGTH/32)
|
||||
|
||||
/*These max values are for the gold sequences which are generated at init for the
|
||||
* full carrier bandwidth*/
|
||||
#define NR_MAX_PDCCH_DMRS_INIT_LENGTH ((NR_MAX_NB_RB<<1)*3) // 3 symbols *2(QPSK)
|
||||
#define NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD 52 // ceil(NR_MAX_PDCCH_DMRS_LENGTH/32)
|
||||
/*used for the resource mapping*/
|
||||
#define NR_MAX_PDCCH_DMRS_LENGTH 576 // 16(L)*2(QPSK)*3(3 DMRS symbs per REG)*6(REG per CCE)
|
||||
|
||||
#define NR_MAX_DCI_PAYLOAD_SIZE 64
|
||||
#define NR_MAX_DCI_SIZE 1728 //16(L)*2(QPSK)*9(12 RE per REG - 3(DMRS))*6(REG per CCE)
|
||||
#define NR_MAX_DCI_SIZE_DWORD 54 // ceil(NR_MAX_DCI_SIZE/32)
|
||||
|
||||
#define NR_MAX_NUM_BWP 4
|
||||
|
||||
#define NR_MAX_PDCCH_AGG_LEVEL 16
|
||||
#define NR_MAX_CSET_DURATION 3
|
||||
|
||||
typedef enum {
|
||||
NR_MU_0=0,
|
||||
NR_MU_1,
|
||||
@@ -68,6 +87,13 @@ typedef enum {
|
||||
NR_MU_4,
|
||||
} nr_numerology_index_e;
|
||||
|
||||
typedef enum {
|
||||
kHz15=0,
|
||||
kHz30,
|
||||
kHz60,
|
||||
kHz120,
|
||||
kHz240
|
||||
} nr_scs_e;
|
||||
|
||||
typedef enum{
|
||||
nr_ssb_type_A = 0,
|
||||
@@ -83,16 +109,54 @@ typedef enum {
|
||||
} nr_frequency_range_e;
|
||||
|
||||
typedef struct NR_BWP_PARMS {
|
||||
/// Associated numerology index
|
||||
uint8_t numerology_index;
|
||||
/// Freq domain location
|
||||
/// BWP ID
|
||||
uint8_t bwp_id;
|
||||
/// Subcarrier spacing
|
||||
nr_scs_e scs;
|
||||
/// Freq domain location -- 1st CRB index
|
||||
uint8_t location;
|
||||
/// Bandwidth in PRB
|
||||
uint16_t N_RB;
|
||||
/// Size of FFT/IFFT
|
||||
uint16_t ofdm_symbol_size;
|
||||
/// Cyclic prefix
|
||||
uint8_t cyclic_prefix;
|
||||
} NR_BWP_PARMS;
|
||||
|
||||
typedef struct {
|
||||
uint8_t reg_idx;
|
||||
uint16_t start_sc_idx;
|
||||
uint8_t symb_idx;
|
||||
} nr_reg_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t cce_idx;
|
||||
nr_reg_t reg_list[NR_NB_REG_PER_CCE];
|
||||
} nr_cce_t;
|
||||
|
||||
|
||||
/// PRACH-ConfigInfo from 36.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: prach-ConfigurationIndex, see TS 36.211 (5.7.1). \vr{[0..63]}
|
||||
uint8_t prach_ConfigIndex;
|
||||
/// Parameter: High-speed-flag, see TS 36.211 (5.7.2). \vr{[0..1]} 1 corresponds to Restricted set and 0 to Unrestricted set.
|
||||
uint8_t highSpeedFlag;
|
||||
/// Parameter: \f$N_\text{CS}\f$, see TS 36.211 (5.7.2). \vr{[0..15]}\n Refer to table 5.7.2-2 for preamble format 0..3 and to table 5.7.2-3 for preamble format 4.
|
||||
uint8_t zeroCorrelationZoneConfig;
|
||||
/// Parameter: prach-FrequencyOffset, see TS 36.211 (5.7.1). \vr{[0..94]}\n For TDD the value range is dependent on the value of \ref prach_ConfigIndex.
|
||||
uint8_t prach_FreqOffset;
|
||||
} NR_PRACH_CONFIG_INFO;
|
||||
|
||||
/// PRACH-ConfigSIB or PRACH-Config
|
||||
typedef struct {
|
||||
/// Parameter: RACH_ROOT_SEQUENCE, see TS 36.211 (5.7.1). \vr{[0..837]}
|
||||
uint16_t rootSequenceIndex;
|
||||
/// prach_Config_enabled=1 means enabled. \vr{[0..1]}
|
||||
uint8_t prach_Config_enabled;
|
||||
/// PRACH Configuration Information
|
||||
NR_PRACH_CONFIG_INFO prach_ConfigInfo;
|
||||
} NR_PRACH_CONFIG_COMMON;
|
||||
|
||||
typedef struct NR_DL_FRAME_PARMS {
|
||||
/// frequency range
|
||||
nr_frequency_range_e freq_range;
|
||||
@@ -137,6 +201,8 @@ typedef struct NR_DL_FRAME_PARMS {
|
||||
uint16_t symbols_per_slot;
|
||||
/// Number of slots per subframe
|
||||
uint16_t slots_per_subframe;
|
||||
/// Number of slots per frame
|
||||
uint16_t slots_per_frame;
|
||||
/// Number of samples in a subframe
|
||||
uint32_t samples_per_subframe;
|
||||
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
||||
@@ -162,6 +228,8 @@ typedef struct NR_DL_FRAME_PARMS {
|
||||
uint8_t nb_antennas_rx;
|
||||
/// Number of common transmit antenna ports in eNodeB (1 or 2)
|
||||
uint8_t nb_antenna_ports_eNB;
|
||||
/// PRACH_CONFIG
|
||||
NR_PRACH_CONFIG_COMMON prach_config_common;
|
||||
/// Cyclic Prefix for DL (0=Normal CP, 1=Extended CP)
|
||||
lte_prefix_type_t Ncp;
|
||||
/// shift of pilot position in one RB
|
||||
@@ -188,8 +256,8 @@ typedef struct NR_DL_FRAME_PARMS {
|
||||
t_nrPolar_params pbch_polar_params;
|
||||
|
||||
//BWP params
|
||||
NR_BWP_PARMS initial_bwp_params_dl;
|
||||
NR_BWP_PARMS initial_bwp_params_ul;
|
||||
NR_BWP_PARMS initial_bwp_dl;
|
||||
NR_BWP_PARMS initial_bwp_ul;
|
||||
|
||||
} NR_DL_FRAME_PARMS;
|
||||
|
||||
|
||||
+267
-7
@@ -370,12 +370,104 @@ typedef struct {
|
||||
|
||||
/* FFS TODO_NR partial structure that should be complete */
|
||||
|
||||
typedef enum {
|
||||
semiStatic = 0,
|
||||
dynamic = 1
|
||||
} pdsch_HARQ_ACK_Codebook_t;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////################################
|
||||
#define MAX_NR_RATE_MATCH_PATTERNS 4
|
||||
#define MAX_NR_ZP_CSI_RS_RESOURCES 32
|
||||
|
||||
typedef enum{
|
||||
dl_resourceAllocationType0 = 1,
|
||||
dl_resourceAllocationType1 = 2,
|
||||
dl_dynamicSwitch = 3
|
||||
} dl_resourceAllocation_t;
|
||||
typedef enum{
|
||||
dl_rgb_config1 = 1,
|
||||
dl_rgb_config2 = 2
|
||||
} dl_rgb_Size_t;
|
||||
typedef enum {
|
||||
st_n4 = 1,
|
||||
st_wideband = 2
|
||||
} static_bundleSize_t;
|
||||
typedef enum {
|
||||
dy_1_n4 = 1,
|
||||
dy_1_wideband = 2,
|
||||
dy_1_n2_wideband = 3,
|
||||
dy_1_n4_wideband = 4
|
||||
} bundleSizeSet1_t;
|
||||
typedef enum {
|
||||
dy_2_n4 = 1,
|
||||
dy_2_wideband = 2,
|
||||
} bundleSizeSet2_t;
|
||||
typedef struct{
|
||||
bundleSizeSet1_t bundleSizeSet1;
|
||||
bundleSizeSet2_t bundleSizeSet2;
|
||||
} dynamic_bundleSize_t;
|
||||
typedef struct {
|
||||
static_bundleSize_t staticBundling;
|
||||
dynamic_bundleSize_t dynamicBundlig;
|
||||
} prb_bundleType_t;
|
||||
typedef enum {
|
||||
nb_code_n1 = 1,
|
||||
nb_code_n2 = 2
|
||||
} maxNrofCodeWordsScheduledByDCI_t;
|
||||
|
||||
typedef struct{
|
||||
// to be defined FIXME!!!
|
||||
}rateMatchPattern_t;
|
||||
typedef struct{
|
||||
// to be defined FIXME!!!
|
||||
}zp_CSI_RS_Resource_t;
|
||||
typedef struct {
|
||||
/*
|
||||
* resourceAllocation
|
||||
*/
|
||||
dl_resourceAllocation_t dl_resourceAllocation;
|
||||
/*
|
||||
* corresponds to I, where I the number of entries in the higher layer parameter pdsch-AllocationList
|
||||
*/
|
||||
uint8_t n_pdsh_alloc_list;
|
||||
/*
|
||||
* rateMatchPatternToAddModList
|
||||
*/
|
||||
rateMatchPattern_t rateMatchPatternToAddModList[MAX_NR_RATE_MATCH_PATTERNS];
|
||||
/*
|
||||
* rateMatchPatternToReleaseList
|
||||
*/
|
||||
uint8_t rateMatchPatternToReleaseList[MAX_NR_RATE_MATCH_PATTERNS];
|
||||
/*
|
||||
* n_rateMatchPatterns indicates the number of rateMatchPatterns defined currently
|
||||
*/
|
||||
uint8_t n_rateMatchPatterns;
|
||||
/*
|
||||
* zp-CSI-RS-ResourceToAddModList
|
||||
*/
|
||||
zp_CSI_RS_Resource_t zp_CSI_RS_Resource[MAX_NR_ZP_CSI_RS_RESOURCES];
|
||||
/*
|
||||
* zp-CSI-RS-ResourceToReleaseList
|
||||
*/
|
||||
uint8_t zp_CSI_RS_ResourceId[MAX_NR_ZP_CSI_RS_RESOURCES];
|
||||
/*
|
||||
* n_zp-CSI-RS-Resource
|
||||
*/
|
||||
uint8_t n_zp_CSI_RS_ResourceId;
|
||||
/*
|
||||
* rgb_Size
|
||||
*/
|
||||
dl_rgb_Size_t dl_rgbSize;
|
||||
/*
|
||||
* prb-BundlingType
|
||||
*/
|
||||
prb_bundleType_t prbBundleType;
|
||||
/*
|
||||
* pdsch-HARQ-ACK-Codebook: this is part of the IE PhysicalCellGroupConfig which is used to configure cell-group specific L1 parameters (TS 38.331)
|
||||
*/
|
||||
pdsch_HARQ_ACK_Codebook_t pdsch_HARQ_ACK_Codebook;
|
||||
////////////////////////////////////////////////////////////////////////////////################################
|
||||
|
||||
/*
|
||||
Maximum number of code words that a single DCI may schedule. This changes the number of MCS/RV/NDI bits in the DCI message from 1 to 2.
|
||||
*/
|
||||
@@ -413,8 +505,168 @@ typedef struct {
|
||||
mappingType_t mappingType;
|
||||
uint8_t startSymbolAndLength;
|
||||
} PUSCH_TimeDomainResourceAllocation_t;
|
||||
////////////////////////////////////////////////////////////////////////////////################################
|
||||
typedef struct { // The IE PTRS-UplinkConfig is used to configure uplink Phase-Tracking-Reference-Signals (PTRS)
|
||||
|
||||
} ptrs_UplinkConfig_t;
|
||||
typedef enum{
|
||||
maxCodeBlockGroupsPerTransportBlock_n2 = 2,
|
||||
maxCodeBlockGroupsPerTransportBlock_n4 = 4,
|
||||
maxCodeBlockGroupsPerTransportBlock_n6 = 6,
|
||||
maxCodeBlockGroupsPerTransportBlock_n8 = 8
|
||||
} maxCodeBlockGroupsPerTransportBlock_t;
|
||||
typedef struct{ // The IE PUSCH-ServingCellConfig is used to configure UE specific PUSCH parameters that are common across the UE's BWPs of one serving cell
|
||||
maxCodeBlockGroupsPerTransportBlock_t maxCodeBlockGroupsPerTransportBlock;
|
||||
} PUSCH_ServingCellConfig_t;
|
||||
typedef struct{ // CSI-MeasConfig IE is used to configure CSI-RS (reference signals)
|
||||
uint8_t reportTriggerSize;
|
||||
} csi_MeasConfig_t;
|
||||
typedef enum {
|
||||
pdsch_dmrs_type1 = 1,
|
||||
pdsch_dmrs_type2 = 2
|
||||
} pdsch_dmrs_type_t;
|
||||
typedef enum {
|
||||
pusch_dmrs_type1 = 1,
|
||||
pusch_dmrs_type2 = 2
|
||||
} pusch_dmrs_type_t;
|
||||
typedef enum {
|
||||
pdsch_dmrs_pos0 = 0,
|
||||
pdsch_dmrs_pos1 = 1,
|
||||
pdsch_dmrs_pos3 = 3,
|
||||
} pdsch_dmrs_AdditionalPosition_t;
|
||||
typedef enum {
|
||||
pusch_dmrs_pos0 = 0,
|
||||
pusch_dmrs_pos1 = 1,
|
||||
pusch_dmrs_pos3 = 3,
|
||||
} pusch_dmrs_AdditionalPosition_t;
|
||||
typedef enum {
|
||||
pdsch_len1 = 1,
|
||||
pdsch_len2 = 2
|
||||
} pdsch_maxLength_t;
|
||||
typedef enum {
|
||||
pusch_len1 = 1,
|
||||
pusch_len2 = 2
|
||||
} pusch_maxLength_t;
|
||||
typedef struct { // The IE DMRS-DownlinkConfig is used to configure downlink demodulation reference signals for PDSCH
|
||||
pdsch_dmrs_type_t pdsch_dmrs_type;
|
||||
pdsch_dmrs_AdditionalPosition_t pdsch_dmrs_AdditionalPosition;
|
||||
pdsch_maxLength_t pdsch_maxLength;
|
||||
uint16_t scramblingID0;
|
||||
uint16_t scramblingID1;
|
||||
} dmrs_DownlinkConfig_t;
|
||||
typedef struct { // The IE DMRS-UplinkConfig is used to configure uplink demodulation reference signals for PUSCH
|
||||
pusch_dmrs_type_t pusch_dmrs_type;
|
||||
pusch_dmrs_AdditionalPosition_t pusch_dmrs_AdditionalPosition;
|
||||
pusch_maxLength_t pusch_maxLength;
|
||||
uint16_t scramblingID0;
|
||||
uint16_t scramblingID1;
|
||||
} dmrs_UplinkConfig_t;
|
||||
typedef struct {
|
||||
/*
|
||||
* Serving cell ID of a PSCell. The PCell of the Master Cell Group uses ID = 0
|
||||
*/
|
||||
uint8_t servCellIndex;
|
||||
}servCellIndex_t;
|
||||
typedef struct{
|
||||
uint8_t cif_presence;
|
||||
}own_t;
|
||||
typedef struct{
|
||||
servCellIndex_t scheduling_cell_id;
|
||||
uint8_t cif_InSchedulingCell;
|
||||
}other_t;
|
||||
typedef struct{
|
||||
own_t own;
|
||||
other_t other;
|
||||
}schedulingCellInfo_t;
|
||||
typedef struct{
|
||||
schedulingCellInfo_t schedulingCellInfo;
|
||||
} crossCarrierSchedulingConfig_t;
|
||||
typedef struct{
|
||||
// this variable will be filled with '1' if SUL is supported and '0' if SUL is not supported
|
||||
uint8_t supplementaryUplink;
|
||||
}supplementaryUplink_t;
|
||||
|
||||
typedef enum {
|
||||
txConfig_codebook = 1,
|
||||
txConfig_nonCodebook = 2
|
||||
} txConfig_t;
|
||||
typedef enum {
|
||||
f_hop_mode1 = 1,
|
||||
f_hop_mode2 = 2
|
||||
} frequencyHopping_t;
|
||||
typedef enum{
|
||||
ul_resourceAllocationType0 = 1,
|
||||
ul_resourceAllocationType1 = 2,
|
||||
ul_dynamicSwitch = 3
|
||||
} ul_resourceAllocation_t;
|
||||
typedef enum{
|
||||
ul_rgb_config1 = 1,
|
||||
ul_rgb_config2 = 2
|
||||
} ul_rgb_Size_t;
|
||||
typedef enum {
|
||||
transformPrecoder_enabled = 1,
|
||||
transformPrecoder_disabled = 2
|
||||
} transformPrecoder_t;
|
||||
typedef enum {
|
||||
codebookSubset_fullyAndPartialAndNonCoherent = 1,
|
||||
codebookSubset_partialAndNonCoherent = 2,
|
||||
codebookSubset_nonCoherent = 3
|
||||
} codebookSubset_t;
|
||||
typedef enum{
|
||||
betaOffset_dynamic = 1,
|
||||
betaOffset_semiStatic = 2
|
||||
}betaOffset_type_t;
|
||||
typedef struct{
|
||||
|
||||
} betaOffset_t;
|
||||
typedef struct {
|
||||
betaOffset_type_t betaOffset_type;
|
||||
betaOffset_t betaOffset;
|
||||
} uci_onPusch_t;
|
||||
typedef struct {
|
||||
/*
|
||||
* txConfig
|
||||
*/
|
||||
txConfig_t txConfig;
|
||||
/*
|
||||
* frequencyHopping
|
||||
*/
|
||||
frequencyHopping_t frequencyHopping;
|
||||
/*
|
||||
* frequencyHoppingOffsetLists
|
||||
*/
|
||||
uint16_t frequencyHoppingOffsetLists[4];
|
||||
// n_frequencyHoppingOffsetLists contains the number of offsets listed. We can list up to 4 offsets
|
||||
uint8_t n_frequencyHoppingOffsetLists;
|
||||
/*
|
||||
* resourceAllocation
|
||||
*/
|
||||
ul_resourceAllocation_t ul_resourceAllocation;
|
||||
/*
|
||||
* rgb_Size
|
||||
*/
|
||||
ul_rgb_Size_t ul_rgbSize;
|
||||
/*
|
||||
* corresponds to I, where I the number of entries in the higher layer parameter pusch-AllocationList
|
||||
*/
|
||||
uint8_t n_push_alloc_list;
|
||||
/*
|
||||
* transformPrecoder
|
||||
*/
|
||||
transformPrecoder_t transformPrecoder;
|
||||
/*
|
||||
* codebookSubset
|
||||
*/
|
||||
codebookSubset_t codebookSubset;
|
||||
/*
|
||||
* maxRank
|
||||
*/
|
||||
uint8_t maxRank;
|
||||
/*
|
||||
* uci_onPusch
|
||||
*/
|
||||
uci_onPusch_t uci_onPusch;
|
||||
////////////////////////////////////////////////////////////////////////////////################################
|
||||
PUSCH_PowerControl_t pusch_PowerControl;
|
||||
PUSCH_TimeDomainResourceAllocation_t *pusch_TimeDomainResourceAllocation[MAX_NR_OF_UL_ALLOCATIONS];
|
||||
} PUSCH_Config_t;
|
||||
@@ -647,11 +899,6 @@ typedef struct {
|
||||
|
||||
typedef uint16_t RNTI_value_t;
|
||||
|
||||
typedef enum {
|
||||
semiStatic = 0,
|
||||
dynamic = 1
|
||||
} pdsch_HARQ_ACK_Codebook_t;
|
||||
|
||||
typedef struct {
|
||||
/*
|
||||
-- Enables spatial bundling of HARQ ACKs. It is configured per cell group (i.e. for all the cells within the cell group) for PUCCH
|
||||
@@ -748,6 +995,12 @@ typedef enum {
|
||||
n12_dl_harq = 12,
|
||||
n16_dl_harq = 16
|
||||
} nrofHARQ_ProcessesForPDSCH_t;
|
||||
typedef enum{
|
||||
maxCodeBlockGroupsPerTransportBlock_dl_n2 = 2,
|
||||
maxCodeBlockGroupsPerTransportBlock_dl_n4 = 4,
|
||||
maxCodeBlockGroupsPerTransportBlock_dl_n6 = 6,
|
||||
maxCodeBlockGroupsPerTransportBlock_dl_n8 = 8
|
||||
} maxCodeBlockGroupsPerTransportBlock_dl_t;
|
||||
|
||||
typedef struct {
|
||||
/*
|
||||
@@ -770,7 +1023,14 @@ typedef struct {
|
||||
-- If the field is absent, the UE sends the HARQ feedback on the PUCCH of the SpCell of this cell group.
|
||||
*/
|
||||
uint8_t pucch_Cell;
|
||||
|
||||
/*
|
||||
* maxCodeBlockGroupsPerTransportBlock_dl_t
|
||||
*/
|
||||
maxCodeBlockGroupsPerTransportBlock_dl_t maxCodeBlockGroupsPerTransportBlock_dl;
|
||||
/*
|
||||
* codeBlockGroupFlushIndicator (boolean)
|
||||
*/
|
||||
uint8_t codeBlockGroupFlushIndicator;
|
||||
} PDSCH_ServingCellConfig_t;
|
||||
|
||||
/***********************************************************************
|
||||
|
||||
@@ -42,8 +42,8 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB,
|
||||
uint8_t *sdu)
|
||||
{
|
||||
|
||||
AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel15.length == 3, "BCH PDU has length %d != 3\n",
|
||||
dl_config_pdu->bch_pdu.bch_pdu_rel15.length);
|
||||
AssertFatal(dl_config_pdu->bch_pdu_rel15.length == 3, "BCH PDU has length %d != 3\n",
|
||||
dl_config_pdu->bch_pdu_rel15.length);
|
||||
|
||||
LOG_I(PHY,"pbch_pdu[0]: %x,pbch_pdu[1]: %x,gNB->pbch_pdu[2]: %x\n",sdu[0],sdu[1],sdu[2]);
|
||||
gNB->pbch_pdu[0] = sdu[2];
|
||||
@@ -53,6 +53,24 @@ void handle_nr_nfapi_bch_pdu(PHY_VARS_gNB *gNB,
|
||||
// adjust transmit amplitude here based on NFAPI info
|
||||
}
|
||||
|
||||
|
||||
void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int subframe,
|
||||
gNB_rxtx_proc_t *proc,
|
||||
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu)
|
||||
{
|
||||
int idx = subframe&1;
|
||||
NR_gNB_PDCCH *pdcch_vars = &gNB->pdcch_vars;
|
||||
|
||||
LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populating pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",frame,subframe, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
|
||||
|
||||
// copy dci configuration into gNB structure
|
||||
nr_fill_dci_and_dlsch(gNB,frame,subframe,proc,&pdcch_vars->dci_alloc[pdcch_vars->num_dci],dl_config_pdu);
|
||||
|
||||
LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",proc->frame_tx,proc->subframe_tx, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
|
||||
}
|
||||
|
||||
|
||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
PHY_VARS_gNB *gNB;
|
||||
gNB_rxtx_proc_t *proc;
|
||||
@@ -90,9 +108,9 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
|
||||
switch (dl_config_pdu->pdu_type) {
|
||||
case NFAPI_NR_DL_CONFIG_BCH_PDU_TYPE:
|
||||
AssertFatal(dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index < TX_req->tx_request_body.number_of_pdus,
|
||||
AssertFatal(dl_config_pdu->bch_pdu_rel15.pdu_index < TX_req->tx_request_body.number_of_pdus,
|
||||
"bch_pdu_rel8.pdu_index>=TX_req->number_of_pdus (%d>%d)\n",
|
||||
dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index,
|
||||
dl_config_pdu->bch_pdu_rel15.pdu_index,
|
||||
TX_req->tx_request_body.number_of_pdus);
|
||||
gNB->pbch_configured=1;
|
||||
do_oai=1;
|
||||
@@ -100,7 +118,16 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
handle_nr_nfapi_bch_pdu(gNB,
|
||||
proc,
|
||||
dl_config_pdu,
|
||||
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index].segments[0].segment_data);
|
||||
TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->bch_pdu_rel15.pdu_index].segments[0].segment_data);
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE:
|
||||
handle_nfapi_nr_dci_dl_pdu(gNB,
|
||||
frame, subframe,
|
||||
proc,
|
||||
dl_config_pdu);
|
||||
gNB->pdcch_vars.num_dci++;
|
||||
do_oai=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,4 +38,8 @@
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "nfapi_nr_interface.h"
|
||||
|
||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO);
|
||||
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO);
|
||||
void handle_nfapi_nr_dci_dl_pdu(PHY_VARS_gNB *gNB,
|
||||
int frame, int subframe,
|
||||
gNB_rxtx_proc_t *proc,
|
||||
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu);
|
||||
|
||||
@@ -29,15 +29,152 @@
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
#include "sched_nr.h"
|
||||
|
||||
|
||||
/// LUT for the number of symbols in the coreset indexed by coreset index (4 MSB rmsi_pdcch_config)
|
||||
uint8_t nr_coreset_nsymb_pdcch_type_0_b40Mhz[16] = {2,2,2,2,2,3,3,3,3,3,1,1,1,2,2,2}; // below 40Mhz bw
|
||||
uint8_t nr_coreset_nsymb_pdcch_type_0_a40Mhz[10] = {2,2,3,3,1,1,2,2,3,3}; // above 40Mhz bw
|
||||
/// LUT for the number of RBs in the coreset indexed by coreset index
|
||||
uint8_t nr_coreset_rb_offset_pdcch_type_0_b40Mhz[16] = {0,1,2,3,4,0,1,2,3,4,12,14,16,12,14,16};
|
||||
uint8_t nr_coreset_rb_offset_pdcch_type_0_a40Mhz[10] = {0,4,0,4,0,28,0,28,0,28};
|
||||
/// LUT for monitoring occasions param O indexed by ss index (4 LSB rmsi_pdcch_config)
|
||||
uint8_t nr_ss_param_O_type_0_mux1_FR1[16] = {0,0,2,2,5,5,7,7,0,5,0,0,2,2,5,5};
|
||||
uint8_t nr_ss_param_O_type_0_mux1_FR2[14] = {0,0,2.5,2.5,5,5,0,2.5,5,7.5,7.5,7.5,0,5};
|
||||
/// LUT for number of SS sets per slot indexed by ss index
|
||||
uint8_t nr_ss_sets_per_slot_type_0_FR1[16] = {1,2,1,2,1,2,1,2,1,1,1,1,1,1,1,1};
|
||||
uint8_t nr_ss_sets_per_slot_type_0_FR2[14] = {1,2,1,2,1,2,2,2,2,1,2,2,1,1};
|
||||
/// LUT for monitoring occasions param M indexed by ss index
|
||||
uint8_t nr_ss_param_M_type_0_mux1_FR1[16] = {1,0.5,1,0.5,1,0.5,1,0.5,2,2,1,1,1,1,1,1};
|
||||
uint8_t nr_ss_param_M_type_0_mux1_FR2[14] = {1,0.5,1,0.5,1,0.5,0.5,0.5,0.5,1,0.5,0.5,2,2};
|
||||
/// LUT for SS first symbol index indexed by ss index
|
||||
uint8_t nr_ss_first_symb_idx_type_0_mux1_FR1[8] = {0,0,1,2,1,2,1,2};
|
||||
|
||||
|
||||
|
||||
nr_subframe_t nr_subframe_select(nfapi_nr_config_request_t *cfg,unsigned char subframe)
|
||||
{
|
||||
if (cfg->subframe_config.duplex_mode.value == FDD)
|
||||
return(SF_DL);
|
||||
else
|
||||
return SF_DL;
|
||||
}
|
||||
|
||||
|
||||
void nr_configure_css_dci_from_mib(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
|
||||
nr_scs_e scs_common,
|
||||
nr_scs_e pdcch_scs,
|
||||
nr_frequency_range_e freq_range,
|
||||
uint8_t rmsi_pdcch_config,
|
||||
uint8_t ssb_idx,
|
||||
uint16_t nb_slots_per_frame,
|
||||
uint16_t N_RB)
|
||||
{
|
||||
uint8_t O, M;
|
||||
uint8_t ss_idx = rmsi_pdcch_config&0xf;
|
||||
uint8_t cset_idx = (rmsi_pdcch_config>>4)&0xf;
|
||||
uint8_t mu;
|
||||
|
||||
/// Coreset params
|
||||
switch(scs_common) {
|
||||
|
||||
case kHz15:
|
||||
mu = 0;
|
||||
break;
|
||||
|
||||
case kHz30:
|
||||
mu = 1;
|
||||
|
||||
if (N_RB < 106) { // Minimum 40Mhz bandwidth not satisfied
|
||||
switch(pdcch_scs) {
|
||||
case kHz15:
|
||||
break;
|
||||
|
||||
case kHz30:
|
||||
pdcch_params->mux_pattern = NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1;
|
||||
pdcch_params->n_rb = (cset_idx < 10)? 24 : 48;
|
||||
pdcch_params->n_symb = nr_coreset_nsymb_pdcch_type_0_b40Mhz[cset_idx];
|
||||
pdcch_params->rb_offset = nr_coreset_rb_offset_pdcch_type_0_b40Mhz[cset_idx];
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
|
||||
}
|
||||
}
|
||||
|
||||
else {
|
||||
AssertFatal(ss_idx<10 ,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
|
||||
switch(pdcch_scs) {
|
||||
case kHz15:
|
||||
break;
|
||||
|
||||
case kHz30:
|
||||
pdcch_params->mux_pattern = NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1;
|
||||
pdcch_params->n_rb = (cset_idx < 4)? 24 : 48;
|
||||
pdcch_params->n_symb = nr_coreset_nsymb_pdcch_type_0_b40Mhz[cset_idx];
|
||||
pdcch_params->rb_offset = nr_coreset_rb_offset_pdcch_type_0_b40Mhz[cset_idx];
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid scs_common/pdcch_scs combination %d/%d \n", scs_common, pdcch_scs);
|
||||
}
|
||||
}
|
||||
|
||||
case kHz60:
|
||||
mu = 2;
|
||||
break;
|
||||
|
||||
case kHz120:
|
||||
mu = 3;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"Invalid common subcarrier spacing %d\n", scs_common);
|
||||
|
||||
}
|
||||
|
||||
/// Search space params
|
||||
switch(pdcch_params->mux_pattern) {
|
||||
|
||||
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE1:
|
||||
if (freq_range == nr_FR1) {
|
||||
O = nr_ss_param_O_type_0_mux1_FR1[ss_idx];
|
||||
pdcch_params->nb_ss_sets_per_slot = nr_ss_sets_per_slot_type_0_FR1[ss_idx];
|
||||
M = nr_ss_param_M_type_0_mux1_FR1[ss_idx];
|
||||
pdcch_params->first_symbol = (ss_idx < 8)? ( (ss_idx&1)? pdcch_params->n_symb : 0 ) : nr_ss_first_symb_idx_type_0_mux1_FR1[ss_idx - 8];
|
||||
}
|
||||
|
||||
else {
|
||||
AssertFatal(ss_idx<14 ,"Invalid search space index for multiplexing type 1 and FR2 %d\n", ss_idx);
|
||||
O = nr_ss_param_O_type_0_mux1_FR2[ss_idx];
|
||||
pdcch_params->nb_ss_sets_per_slot = nr_ss_sets_per_slot_type_0_FR2[ss_idx];
|
||||
M = nr_ss_param_M_type_0_mux1_FR2[ss_idx];
|
||||
pdcch_params->first_symbol = (ss_idx < 12)? ( (ss_idx&1)? 7 : 0 ) : 0;
|
||||
}
|
||||
pdcch_params->nb_slots = 2;
|
||||
pdcch_params->sfn_mod2 = ((uint8_t)(floor( (O*pow(2, mu) + floor(ssb_idx*M)) / nb_slots_per_frame )) & 1)? 1 : 0;
|
||||
pdcch_params->first_slot = (uint8_t)(O*pow(2, mu) + floor(ssb_idx*M)) % nb_slots_per_frame;
|
||||
|
||||
break;
|
||||
|
||||
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE2:
|
||||
break;
|
||||
|
||||
case NFAPI_NR_SSB_AND_CSET_MUX_PATTERN_TYPE3:
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid SSB and coreset multiplexing pattern %d\n", pdcch_params->mux_pattern);
|
||||
}
|
||||
pdcch_params->config_type = NFAPI_NR_CSET_CONFIG_MIB_SIB1;
|
||||
pdcch_params->cr_mapping_type = NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED;
|
||||
pdcch_params->precoder_granularity = NFAPI_NR_CSET_SAME_AS_REG_BUNDLE;
|
||||
pdcch_params->reg_bundle_size = 6;
|
||||
pdcch_params->interleaver_size = 2;
|
||||
}
|
||||
|
||||
void nr_configure_css_dci_from_pdcch_config(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
|
||||
nfapi_nr_coreset_t* coreset,
|
||||
nfapi_nr_search_space_t* search_space) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ extern uint8_t nfapi_mode;
|
||||
int return_ssb_type(nfapi_config_request_t *cfg)
|
||||
{
|
||||
int mu = cfg->subframe_config.numerology_index_mu.value;
|
||||
nr_numerology_index_e ssb_type;
|
||||
nr_ssb_type_e ssb_type;
|
||||
|
||||
switch(mu) {
|
||||
|
||||
@@ -140,23 +140,24 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int subframe) {
|
||||
nr_generate_pss(gNB->d_pss, txdataF, AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_sss(gNB->d_sss, txdataF, AMP_OVER_2, ssb_start_symbol, cfg, fp);
|
||||
|
||||
/*if ((frame_mod8) == 0){
|
||||
if (!(frame&7)){
|
||||
if (gNB->pbch_configured != 1)return;
|
||||
gNB->pbch_configured = 0;
|
||||
}*/
|
||||
}
|
||||
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF, AMP_OVER_2, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_pbch(&gNB->pbch, pbch_pdu, txdataF, AMP_OVER_2, ssb_start_symbol, n_hf, Lmax, ssb_index, frame, cfg, fp);
|
||||
nr_generate_pbch(&gNB->pbch, gNB->nrPolar_params, pbch_pdu, txdataF, AMP_OVER_2, ssb_start_symbol, n_hf, Lmax, ssb_index, frame, cfg, fp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
gNB_rxtx_proc_t *proc,
|
||||
int do_meas)
|
||||
gNB_rxtx_proc_t *proc,
|
||||
int do_meas)
|
||||
{
|
||||
int aa;
|
||||
int frame=proc->frame_tx;
|
||||
int subframe=proc->subframe_tx;
|
||||
uint8_t num_dci=0;
|
||||
|
||||
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
@@ -178,4 +179,20 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
//if (frame == 9)
|
||||
//write_output("txdataF.m","txdataF",gNB->common_vars.txdataF[aa],fp->samples_per_frame_wCP, 1, 1);
|
||||
}
|
||||
|
||||
num_dci = gNB->pdcch_vars.num_dci;
|
||||
if (num_dci) {
|
||||
LOG_I(PHY, "[gNB %d] Frame %d subframe %d \
|
||||
Calling nr_generate_dci_top (number of DCI %d)\n", gNB->Mod_id, frame, subframe, num_dci);
|
||||
|
||||
uint8_t slot_idx = gNB->pdcch_vars.dci_alloc[0].pdcch_params.first_slot;
|
||||
|
||||
if (nfapi_mode == 0 || nfapi_mode == 1)
|
||||
nr_generate_dci_top(gNB->pdcch_vars,
|
||||
gNB->nrPolar_params,
|
||||
gNB->nr_gold_pdcch_dmrs[slot_idx],
|
||||
gNB->common_vars.txdataF,
|
||||
AMP, *fp, *cfg);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||
|
||||
|
||||
lte_subframe_t nr_subframe_select (nfapi_nr_config_request_t *cfg, unsigned char subframe);
|
||||
@@ -42,4 +43,13 @@ void nr_feptx_ofdm(RU_t *ru);
|
||||
void nr_feptx_ofdm_2thread(RU_t *ru);
|
||||
void nr_feptx0(RU_t *ru,int slot);
|
||||
|
||||
void nr_configure_css_dci_from_mib(nfapi_nr_dl_config_pdcch_parameters_rel15_t* pdcch_params,
|
||||
nr_scs_e scs_common,
|
||||
nr_scs_e pdcch_scs,
|
||||
nr_frequency_range_e freq_range,
|
||||
uint8_t rmsi_pdcch_config,
|
||||
uint8_t ssb_idx,
|
||||
uint16_t nb_slots_per_frame,
|
||||
uint16_t N_RB);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -48,8 +48,9 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
uint32_t i;
|
||||
|
||||
if(scheduled_response != NULL){
|
||||
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[module_id][cc_id];
|
||||
NR_UE_PDCCH *pdcch_vars2 = ue->pdcch_vars[0][0];
|
||||
NR_UE_PDCCH *pdcch_vars2 = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[0][0];
|
||||
NR_UE_DLSCH_t *dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[0][0];
|
||||
NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[0];
|
||||
|
||||
if(scheduled_response->dl_config != NULL){
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
@@ -87,32 +88,62 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
//pdcch_vars2->coreset[i].tciStatesPDCCH;
|
||||
//pdcch_vars2->coreset[i].tciPresentInDCI;
|
||||
pdcch_vars2->coreset[i].pdcchDMRSScramblingID = dci_config->coreset.pdcch_dmrs_scrambling_id;
|
||||
|
||||
}else{ //FAPI_NR_DL_CONFIG_TYPE_DLSCH
|
||||
// dlsch config pdu
|
||||
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
NR_UE_DLSCH_t **dlsch = ue->dlsch[ue->current_thread_id[0]][0]; //nr_tti_rx
|
||||
NR_UE_DLSCH_t *dlsch0 = dlsch[0];
|
||||
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch[0]->harq_processes[dlsch_pdu->harq_pid];
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu = &dl_config->dl_config_list[i].dlsch_config_pdu.dlsch_config_rel15;
|
||||
uint8_t current_harq_pid = dlsch_config_pdu->harq_process_nbr;
|
||||
dlsch0->current_harq_pid = current_harq_pid;
|
||||
dlsch0->active = 1;
|
||||
|
||||
//dlsch0->harq_processes[0]->mcs = &dlsch_config_pdu->mcs;
|
||||
|
||||
NR_DL_UE_HARQ_t dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
|
||||
|
||||
//dlsch0->harq_processes[current_harq_pid]->nb_rb = dlsch_config_pdu->number_rbs;
|
||||
|
||||
dlsch0_harq.nb_rb = dlsch_config_pdu->number_rbs;
|
||||
dlsch0_harq.start_rb = dlsch_config_pdu->start_rb;
|
||||
dlsch0_harq.nb_symbols = dlsch_config_pdu->number_symbols;
|
||||
dlsch0_harq.start_symbol = dlsch_config_pdu->start_symbol;
|
||||
dlsch0_harq.mcs = dlsch_config_pdu->mcs;
|
||||
dlsch0_harq.DCINdi = dlsch_config_pdu->ndi;
|
||||
dlsch0_harq.rvidx = dlsch_config_pdu->rv;
|
||||
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
|
||||
dlsch0_harq.harq_ack.pucch_resource_indicator = dlsch_config_pdu->pucch_resource_id;
|
||||
dlsch0_harq.harq_ack.slot_for_feedback_ack = dlsch_config_pdu->pdsch_to_harq_feedback_time_ind;
|
||||
printf(">>>> \tdlsch0->g_pucch=%d\tdlsch0_harq.mcs=%d\n",dlsch0->g_pucch,dlsch0_harq.mcs);
|
||||
//for (int j = 0 ; j<1000; j++) printf("\nk = %d",j);
|
||||
|
||||
dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
|
||||
dlsch0_harq->start_rb = dlsch_pdu->start_rb;
|
||||
dlsch0_harq->nb_rb = dlsch_pdu->number_rbs;
|
||||
dlsch0_harq->nb_symbols = dlsch_pdu->number_symbols;
|
||||
dlsch0_harq->nb_symbols = dlsch_pdu->number_symbols;
|
||||
dlsch0_harq->start_symbol = dlsch_pdu->start_symbol;
|
||||
dlsch0->current_harq_pid = dlsch_pdu->harq_pid;
|
||||
dlsch0->active = 1;
|
||||
dlsch0_harq->mcs = dlsch_pdu->mcs;
|
||||
dlsch0_harq->DCINdi = dlsch_pdu->ndi;
|
||||
}
|
||||
#if 0
|
||||
dlsch0->harq_processes[current_harq_pid]->mcs = dlsch_config_pdu->mcs;
|
||||
dlsch0->g_pucch = dlsch_config_pdu->accumulated_delta_PUCCH;
|
||||
//pdlsch0->rnti = rnti;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}else{
|
||||
pdcch_vars2->nb_search_space = 0;
|
||||
}
|
||||
|
||||
if(scheduled_response->ul_config != NULL){
|
||||
|
||||
fapi_nr_ul_config_request_t *ul_config = scheduled_response->ul_config;
|
||||
for(i=0; i<ul_config->number_pdus; ++i){
|
||||
if(ul_config->ul_config_list[i].pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUSCH){
|
||||
// pusch config pdu
|
||||
fapi_nr_ul_config_pusch_pdu_rel15_t *pusch_config_pdu = &ul_config->ul_config_list[i].ulsch_config_pdu.ulsch_pdu_rel15;
|
||||
uint8_t current_harq_pid = pusch_config_pdu->harq_process_nbr;
|
||||
ulsch0->harq_processes[current_harq_pid]->nb_rb = pusch_config_pdu->number_rbs;
|
||||
ulsch0->harq_processes[current_harq_pid]->first_rb = pusch_config_pdu->start_rb;
|
||||
ulsch0->harq_processes[current_harq_pid]->nb_symbols = pusch_config_pdu->number_symbols;
|
||||
ulsch0->harq_processes[current_harq_pid]->start_symbol = pusch_config_pdu->start_symbol;
|
||||
ulsch0->harq_processes[current_harq_pid]->mcs = pusch_config_pdu->mcs;
|
||||
ulsch0->harq_processes[current_harq_pid]->DCINdi = pusch_config_pdu->ndi;
|
||||
ulsch0->harq_processes[current_harq_pid]->rvidx = pusch_config_pdu->rv;
|
||||
ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ void get_dci_info_for_harq(PHY_VARS_NR_UE *ue, NR_DCI_INFO_EXTRACTED_t *nr_dci_i
|
||||
|
||||
dlsch[0]->current_harq_pid = nr_dci_info_extracted->harq_process_number;
|
||||
|
||||
NR_DL_UE_HARQ_t *dl_harq = dlsch[0]->harq_processes[dlsch[0]->current_harq_pid];
|
||||
NR_DL_UE_HARQ_t *dl_harq = &dlsch[0]->harq_processes[dlsch[0]->current_harq_pid];
|
||||
|
||||
dl_harq->harq_ack.vDAI_DL = nr_dci_info_extracted->dai+1;
|
||||
dl_harq->harq_ack.pucch_resource_indicator = nr_dci_info_extracted->pucch_resource_ind;
|
||||
@@ -373,7 +373,7 @@ void config_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int
|
||||
{
|
||||
NR_UE_DLSCH_t *dlsch;
|
||||
|
||||
dlsch = (NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t));
|
||||
//dlsch = (NR_UE_DLSCH_t *)malloc16(sizeof(NR_UE_DLSCH_t));
|
||||
|
||||
if (dlsch != NULL) {
|
||||
|
||||
@@ -392,18 +392,18 @@ void config_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, int
|
||||
/* allocation of HARQ process context */
|
||||
for (int harq_pid = 0; harq_pid < number_harq_processes_for_pdsch; harq_pid++) {
|
||||
|
||||
dlsch->harq_processes[harq_pid] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t));
|
||||
//dlsch->harq_processes[harq_pid] = (NR_DL_UE_HARQ_t *)malloc16(sizeof(NR_DL_UE_HARQ_t));
|
||||
|
||||
if (dlsch->harq_processes[harq_pid] == NULL) {
|
||||
/*if (dlsch->harq_processes[harq_pid] == NULL) {
|
||||
LOG_E(PHY, "Fatal memory allocation problem at line %d in function %s of file %s \n", __LINE__ , __func__, __FILE__);
|
||||
assert(0);
|
||||
}
|
||||
}*/
|
||||
|
||||
memset(dlsch->harq_processes[harq_pid],0,sizeof(NR_DL_UE_HARQ_t));
|
||||
memset(&dlsch->harq_processes[harq_pid],0,sizeof(NR_DL_UE_HARQ_t));
|
||||
|
||||
NR_DL_UE_HARQ_t *dl_harq = dlsch->harq_processes[harq_pid];
|
||||
NR_DL_UE_HARQ_t dl_harq = dlsch->harq_processes[harq_pid];
|
||||
|
||||
init_downlink_harq_status(dl_harq);
|
||||
init_downlink_harq_status(&dl_harq);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -425,12 +425,12 @@ void release_downlink_harq_process(PHY_VARS_NR_UE *ue, int gNB_id, int TB_id, in
|
||||
{
|
||||
NR_UE_DLSCH_t *dlsch = ue->dlsch[execution_thread_number][gNB_id][TB_id];
|
||||
|
||||
for (int process_id = 0; process_id < dlsch->Mdlharq; process_id++) {
|
||||
/*for (int process_id = 0; process_id < dlsch->Mdlharq; process_id++) {
|
||||
|
||||
free16(dlsch->harq_processes[process_id],sizeof(NR_DL_UE_HARQ_t));
|
||||
|
||||
dlsch->harq_processes[process_id] = NULL;
|
||||
}
|
||||
}*/
|
||||
|
||||
free16(dlsch,sizeof(NR_UE_DLSCH_t));
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
#define DEBUG_PHY_PROC
|
||||
|
||||
#define NR_PDCCH_SCHED
|
||||
//#define NR_PDCCH_SCHED_DEBUG
|
||||
#define NR_PDCCH_SCHED_DEBUG
|
||||
//#define NR_PUCCH_SCHED
|
||||
//#define NR_PUCCH_SCHED_DEBUG
|
||||
|
||||
@@ -89,7 +89,51 @@ fifo_dump_emos_UE emos_dump_UE;
|
||||
|
||||
extern double cpuf;
|
||||
|
||||
int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
uint32_t frame,
|
||||
uint8_t nr_tti_rx,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t is_secondary_ue,
|
||||
int nb_coreset_active,
|
||||
uint16_t symbol_mon,
|
||||
NR_SEARCHSPACE_TYPE_t searchSpaceType);
|
||||
|
||||
uint8_t nr_dci_decoding_procedure(int s,
|
||||
int p,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
NR_DCI_ALLOC_t *dci_alloc,
|
||||
NR_SEARCHSPACE_TYPE_t searchSpacetype,
|
||||
int16_t eNB_id,
|
||||
uint8_t nr_tti_rx,
|
||||
uint8_t dci_fields_sizes_cnt[MAX_NR_DCI_DECODED_SLOT][NBR_NR_DCI_FIELDS][NBR_NR_FORMATS],
|
||||
uint16_t n_RB_ULBWP,
|
||||
uint16_t n_RB_DLBWP,
|
||||
crc_scrambled_t *crc_scrambled,
|
||||
format_found_t *format_found,
|
||||
uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES]);
|
||||
|
||||
int nr_generate_ue_ul_dlsch_params_from_dci(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_id,
|
||||
int frame,
|
||||
uint8_t nr_tti_rx,
|
||||
uint32_t dci_pdu[4],
|
||||
uint16_t rnti,
|
||||
uint8_t dci_length,
|
||||
NR_DCI_format_t dci_format,
|
||||
NR_UE_PDCCH *pdcch_vars,
|
||||
NR_UE_PDSCH *pdsch_vars,
|
||||
NR_UE_DLSCH_t **dlsch,
|
||||
NR_UE_ULSCH_t *ulsch,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
|
||||
uint8_t beamforming_mode,
|
||||
uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS],
|
||||
uint16_t n_RB_ULBWP,
|
||||
uint16_t n_RB_DLBWP,
|
||||
uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES],
|
||||
NR_DCI_INFO_EXTRACTED_t *nr_dci_info_extracted);
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
|
||||
extern uint32_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
@@ -1406,7 +1450,143 @@ endif*/
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,VCD_FUNCTION_OUT);
|
||||
|
||||
}
|
||||
#endif //0
|
||||
|
||||
void ue_nr_prach_procedures(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode) {
|
||||
|
||||
int frame_tx = proc->frame_tx;
|
||||
int nr_tti_tx = proc->nr_tti_tx;
|
||||
int prach_power;
|
||||
PRACH_RESOURCES_t prach_resources_local;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_IN);
|
||||
|
||||
ue->generate_prach=0;
|
||||
|
||||
if (ue->mac_enabled==0){
|
||||
ue->prach_resources[eNB_id] = &prach_resources_local;
|
||||
prach_resources_local.ra_RNTI = 0xbeef;
|
||||
prach_resources_local.ra_PreambleIndex = 0;
|
||||
}
|
||||
|
||||
if (ue->mac_enabled==1){
|
||||
// ask L2 for RACH transport
|
||||
if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
|
||||
LOG_D(PHY,"Getting PRACH resources\n");
|
||||
//ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(ue->Mod_id,
|
||||
// ue->CC_id,
|
||||
// frame_tx,
|
||||
// eNB_id,
|
||||
// nr_tti_tx);
|
||||
//LOG_D(PHY,"Got prach_resources for eNB %d address %p, RRCCommon %p\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
|
||||
LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]);
|
||||
}
|
||||
}
|
||||
|
||||
if (ue->prach_resources[eNB_id]!=NULL) {
|
||||
|
||||
ue->generate_prach=1;
|
||||
ue->prach_cnt=0;
|
||||
#ifdef SMBV
|
||||
ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;
|
||||
#endif
|
||||
#ifdef OAI_EMU
|
||||
ue->prach_PreambleIndex=ue->prach_resources[eNB_id]->ra_PreambleIndex;
|
||||
#endif
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
|
||||
LOG_I(PHY,"mode %d\n",mode);
|
||||
|
||||
if ((ue->mac_enabled==1) && (mode != calib_prach_tx)) {
|
||||
ue->tx_power_dBm[nr_tti_tx] = ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id);
|
||||
}
|
||||
else {
|
||||
ue->tx_power_dBm[nr_tti_tx] = ue->tx_power_max_dBm;
|
||||
ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;
|
||||
}
|
||||
|
||||
LOG_I(PHY,"[UE %d][RAPROC] Frame %d, nr_tti_rx %d : Generating PRACH, preamble %d,PL %d, P0_PRACH %d, TARGET_RECEIVED_POWER %d dBm, PRACH TDD Resource index %d, RA-RNTI %d\n",
|
||||
ue->Mod_id,
|
||||
frame_tx,
|
||||
nr_tti_tx,
|
||||
ue->prach_resources[eNB_id]->ra_PreambleIndex,
|
||||
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
|
||||
ue->tx_power_dBm[nr_tti_tx],
|
||||
ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER,
|
||||
ue->prach_resources[eNB_id]->ra_TDD_map_index,
|
||||
ue->prach_resources[eNB_id]->ra_RNTI);
|
||||
|
||||
ue->tx_total_RE[nr_tti_tx] = 96;
|
||||
|
||||
#if defined(EXMIMO) || defined(OAI_USRP) || defined(OAI_BLADERF) || defined(OAI_LMSSDR) || defined(OAI_ADRV9371_ZC706)
|
||||
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[nr_tti_tx],
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
6);
|
||||
#else
|
||||
ue->prach_vars[eNB_id]->amp = AMP;
|
||||
#endif
|
||||
if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0))
|
||||
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, nr_tti_rx %d : PRACH TX power %d dBm, amp %d\n",
|
||||
ue->Mod_id,
|
||||
proc->frame_rx,
|
||||
proc->nr_tti_tx,
|
||||
ue->tx_power_dBm[nr_tti_tx],
|
||||
ue->prach_vars[eNB_id]->amp);
|
||||
|
||||
|
||||
// start_meas(&ue->tx_prach);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_IN);
|
||||
|
||||
//prach_power = generate_prach(ue,eNB_id,nr_tti_tx,frame_tx);
|
||||
prach_power = generate_nr_prach(ue,eNB_id,nr_tti_tx,frame_tx);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GENERATE_PRACH, VCD_FUNCTION_OUT);
|
||||
// stop_meas(&ue->tx_prach);
|
||||
LOG_D(PHY,"[UE %d][RAPROC] PRACH PL %d dB, power %d dBm, digital power %d dB (amp %d)\n",
|
||||
ue->Mod_id,
|
||||
get_PL(ue->Mod_id,ue->CC_id,eNB_id),
|
||||
ue->tx_power_dBm[nr_tti_tx],
|
||||
dB_fixed(prach_power),
|
||||
ue->prach_vars[eNB_id]->amp);
|
||||
} else {
|
||||
//UE_transport_info[ue->Mod_id][ue->CC_id].cntl.prach_flag=1;
|
||||
//UE_transport_info[ue->Mod_id][ue->CC_id].cntl.prach_id=ue->prach_resources[eNB_id]->ra_PreambleIndex;
|
||||
}
|
||||
|
||||
if (ue->mac_enabled==1){
|
||||
//mac_xface->Msg1_transmitted(ue->Mod_id,
|
||||
// ue->CC_id,
|
||||
// frame_tx,
|
||||
// eNB_id);
|
||||
}
|
||||
|
||||
LOG_I(PHY,"[UE %d][RAPROC] Frame %d, nr_tti_rx %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n",
|
||||
ue->Mod_id,frame_tx,nr_tti_tx,eNB_id,
|
||||
ue->prach_resources[eNB_id]->ra_PreambleIndex,
|
||||
ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id),
|
||||
get_PL(ue->Mod_id,ue->CC_id,eNB_id));
|
||||
|
||||
}
|
||||
|
||||
|
||||
// if we're calibrating the PRACH kill the pointer to its resources so that the RA protocol doesn't continue
|
||||
if (mode == calib_prach_tx)
|
||||
ue->prach_resources[eNB_id]=NULL;
|
||||
|
||||
LOG_D(PHY,"[UE %d] frame %d nr_tti_rx %d : generate_prach %d, prach_cnt %d\n",
|
||||
ue->Mod_id,frame_tx,nr_tti_tx,ue->generate_prach,ue->prach_cnt);
|
||||
|
||||
ue->prach_cnt++;
|
||||
|
||||
if (ue->prach_cnt==3)
|
||||
ue->generate_prach=0;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_OUT);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void ue_prach_procedures(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode) {
|
||||
|
||||
int frame_tx = proc->frame_tx;
|
||||
@@ -2438,7 +2618,195 @@ void ue_pucch_procedures(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,VCD_FUNCTION_OUT);
|
||||
|
||||
}
|
||||
#endif //0
|
||||
|
||||
void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) {
|
||||
|
||||
|
||||
NR_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
//int32_t ulsch_start=0;
|
||||
int nr_tti_tx = proc->nr_tti_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
unsigned int aa;
|
||||
uint8_t isSubframeSRS;
|
||||
|
||||
uint8_t next1_thread_id = ue->current_thread_id[proc->nr_tti_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[proc->nr_tti_rx]+1);
|
||||
uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,VCD_FUNCTION_IN);
|
||||
|
||||
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, nr_tti_tx);
|
||||
#if T_TRACER
|
||||
T(T_UE_PHY_UL_TICK, T_INT(ue->Mod_id), T_INT(frame_tx%1024), T_INT(nr_tti_tx));
|
||||
#endif
|
||||
|
||||
ue->generate_ul_signal[eNB_id] = 0;
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->phy_proc_tx);
|
||||
#endif
|
||||
|
||||
#ifdef EMOS
|
||||
//phy_procedures_emos_UE_TX(next_slot);
|
||||
#endif
|
||||
|
||||
ue->tx_power_dBm[nr_tti_tx]=-127;
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
memset(&ue->common_vars.txdataF[aa][nr_tti_tx*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti],
|
||||
0,
|
||||
frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
if (ue->UE_mode[eNB_id] != PRACH) {
|
||||
// check cell srs nr_tti_rx and ue srs nr_tti_rx. This has an impact on pusch encoding
|
||||
//isSubframeSRS = nr_is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->nr_tti_tx);
|
||||
|
||||
//ue_compute_srs_occasion(ue,proc,eNB_id,isSubframeSRS);
|
||||
|
||||
//ue_ulsch_uespec_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
|
||||
}
|
||||
|
||||
if (ue->UE_mode[eNB_id] == PUSCH) {
|
||||
// check if we need to use PUCCH 1a/1b
|
||||
//ue_pucch_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
// check if we need to use SRS
|
||||
//ue_srs_procedures(ue,proc,eNB_id,abstraction_flag);
|
||||
} // UE_mode==PUSCH
|
||||
|
||||
|
||||
#ifdef CBA
|
||||
|
||||
if ((ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_cba_scheduling_flag >= 1) &&
|
||||
(ue->ulsch[eNB_id]->harq_processes[harq_pid]->status == CBA_ACTIVE)) {
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag=0; //-=1
|
||||
// ue->ulsch[eNB_id]->harq_processes[harq_pid]->status= IDLE;
|
||||
first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb;
|
||||
nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
||||
//cba_mcs=ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs;
|
||||
input_buffer_length = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS/8;
|
||||
access_mode=CBA_ACCESS;
|
||||
|
||||
LOG_D(PHY,"[UE %d] Frame %d, nr_tti_rx %d: CBA num dci %d\n",
|
||||
Mod_id,frame_tx,nr_tti_tx,
|
||||
ue->ulsch[eNB_id]->num_cba_dci[nr_tti_tx]);
|
||||
|
||||
/*mac_xface->ue_get_sdu(Mod_id,
|
||||
CC_id,
|
||||
frame_tx,
|
||||
proc->subframe_tx,
|
||||
nr_tti_tx%(ue->frame_parms.ttis_per_subframe),
|
||||
eNB_id,
|
||||
ulsch_input_buffer,
|
||||
input_buffer_length,
|
||||
&access_mode);*/
|
||||
|
||||
ue->ulsch[eNB_id]->num_cba_dci[nr_tti_tx]=0;
|
||||
|
||||
if (access_mode > UNKNOWN_ACCESS) {
|
||||
|
||||
if (abstraction_flag==0) {
|
||||
if (ulsch_encoding(ulsch_input_buffer,
|
||||
ue,
|
||||
harq_pid,
|
||||
eNB_id,
|
||||
proc->nr_tti_rx,
|
||||
ue->transmission_mode[eNB_id],0,
|
||||
0)!=0) { // Nbundled, to be updated!!!!
|
||||
LOG_E(PHY,"ulsch_coding.c: FATAL ERROR: returning\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PHY_ABSTRACTION
|
||||
else {
|
||||
ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,proc->nr_tti_rx,harq_pid,0);
|
||||
}
|
||||
|
||||
#endif
|
||||
} else {
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->status= IDLE;
|
||||
//reset_cba_uci(ue->ulsch[eNB_id]->o);
|
||||
LOG_N(PHY,"[UE %d] Frame %d, nr_tti_rx %d: CBA transmission cancelled or postponed\n",
|
||||
Mod_id, frame_tx,nr_tti_tx);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // end CBA
|
||||
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
//ulsch_common_procedures(ue,proc, (ue->generate_ul_signal[eNB_id] == 0));
|
||||
} // mode != PRACH
|
||||
|
||||
|
||||
if ((ue->UE_mode[eNB_id] == PRACH) &&
|
||||
(ue->frame_parms.prach_config_common.prach_Config_enabled==1)) {
|
||||
|
||||
// check if we have PRACH opportunity
|
||||
|
||||
if (is_nr_prach_subframe(&ue->frame_parms,frame_tx,nr_tti_tx)) {
|
||||
|
||||
ue_nr_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode);
|
||||
}
|
||||
} // mode is PRACH
|
||||
else {
|
||||
ue->generate_prach=0;
|
||||
}
|
||||
|
||||
// reset DL ACK/NACK status
|
||||
uint8_t N_bundled = 0;
|
||||
uint8_t current_pid = ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][eNB_id][0]->current_harq_pid;
|
||||
if (ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][eNB_id][0] != NULL)
|
||||
{
|
||||
/*
|
||||
nr_reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][eNB_id][0]->harq_processes[current_pid]->harq_ack,
|
||||
nr_tti_tx,
|
||||
proc->nr_tti_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
nr_reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[next1_thread_id][eNB_id][0]->harq_processes[current_pid]->harq_ack,
|
||||
nr_tti_tx,
|
||||
proc->nr_tti_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
nr_reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[next2_thread_id][eNB_id][0]->harq_processes[current_pid]->harq_ack,
|
||||
nr_tti_tx,
|
||||
proc->nr_tti_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
*/
|
||||
}
|
||||
|
||||
if (ue->dlsch_SI[eNB_id] != NULL)
|
||||
/*
|
||||
nr_reset_ack(&ue->frame_parms,
|
||||
ue->dlsch_SI[eNB_id]->harq_processes[current_pid]->harq_ack,
|
||||
nr_tti_tx,
|
||||
proc->nr_tti_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
*/
|
||||
|
||||
LOG_D(PHY,"****** end TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, nr_tti_tx);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->phy_proc_tx);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
void phy_procedures_UE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type) {
|
||||
|
||||
|
||||
@@ -2619,7 +2987,9 @@ void phy_procedures_UE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB
|
||||
stop_meas(&ue->phy_proc_tx);
|
||||
#endif
|
||||
}
|
||||
#endif //0
|
||||
|
||||
#if 0
|
||||
void phy_procedures_UE_S_TX(PHY_VARS_NR_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type)
|
||||
{
|
||||
int aa;//i,aa;
|
||||
@@ -3138,31 +3508,45 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
// table dci_fields_sizes_cnt[dci_cnt-1][i][j] will then be used in function nr_extract_dci_info
|
||||
uint8_t dci_fields_sizes_cnt[MAX_NR_DCI_DECODED_SLOT][NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0};
|
||||
|
||||
uint16_t tc_rnti = 1; // FIXME
|
||||
uint16_t int_rnti = 1; // FIXME
|
||||
uint16_t sfi_rnti = 1; // FIXME
|
||||
uint16_t tpc_pusch_rnti =1; // FIXME
|
||||
uint16_t tpc_pucch_rnti = 1; // FIXME
|
||||
uint16_t tpc_srs_rnti = 1; // FIXME
|
||||
int nb_searchspace_active=0;
|
||||
NR_UE_PDCCH **pdcch_vars = ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]];
|
||||
NR_UE_PDCCH *pdcch_vars2 = ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id];
|
||||
|
||||
uint16_t c_rnti=pdcch_vars[eNB_id]->crnti;
|
||||
uint16_t cs_rnti=1,new_rnti=1,tc_rnti=1;
|
||||
uint16_t p_rnti=P_RNTI;
|
||||
uint16_t si_rnti=SI_RNTI;
|
||||
uint16_t ra_rnti=3;
|
||||
uint16_t sp_csi_rnti=1,sfi_rnti=1,int_rnti=1,tpc_pusch_rnti=1,tpc_pucch_rnti=1,tpc_srs_rnti=1; //FIXME
|
||||
uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES] =
|
||||
{c_rnti,cs_rnti,new_rnti,tc_rnti,p_rnti,si_rnti,ra_rnti,sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti};
|
||||
|
||||
// s in TS 38.212 Subclause 10.1, for each active BWP the UE can deal with 10 different search spaces
|
||||
// Higher layers have updated the number of searchSpaces with are active in the current slot and this value is stored in variable nb_searchspace_total
|
||||
int nb_searchspace_total = pdcch_vars2->nb_search_space;
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> there is a bug in FAPI to calculate nb_searchspace_total=%d\n",nb_searchspace_total);
|
||||
#endif
|
||||
if (nb_searchspace_total>1) nb_searchspace_total=1; // to be removed when fixing bug in FAPI
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> there is a bug in FAPI to calculate nb_searchspace_total so we set it to 1...\n");
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> the number of searchSpaces active in the current slot(%d) is %d) \n",
|
||||
nr_tti_rx,nb_searchspace_total);
|
||||
#endif
|
||||
// p in TS 38.212 Subclause 10.1, for each active BWP the UE can deal with 3 different CORESETs (including coresetId 0 for common search space)
|
||||
int nb_coreset_total = NR_NBR_CORESET_ACT_BWP;
|
||||
unsigned int dci_cnt=0;
|
||||
//int nb_coreset_total = NR_NBR_CORESET_ACT_BWP;
|
||||
uint8_t dci_cnt=0;
|
||||
// this table contains 56 (NBR_NR_DCI_FIELDS) elements for each dci field and format described in TS 38.212. Each element represents the size in bits for each dci field
|
||||
uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0};
|
||||
//uint8_t dci_fields_sizes[NBR_NR_DCI_FIELDS][NBR_NR_FORMATS] = {0};
|
||||
// this is the UL bandwidth part. FIXME! To be defined where this value comes from
|
||||
uint16_t n_RB_ULBWP = 106;
|
||||
// this is the DL bandwidth part. FIXME! To be defined where this value comes from
|
||||
uint16_t n_RB_DLBWP = 106;
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> n_RB_ULBWP=%d n_RB_DLBWP=%d\n",
|
||||
n_RB_ULBWP,
|
||||
n_RB_DLBWP);
|
||||
#endif
|
||||
|
||||
// First we have to identify each searchSpace active at a time and do PDCCH monitoring corresponding to current searchSpace
|
||||
// Up to 10 searchSpaces can be configured to UE (s<=10)
|
||||
@@ -3186,7 +3570,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
* To be implemented LATER !!!
|
||||
*/
|
||||
//int _offset,_index,_M;
|
||||
int searchSpace_id = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceId;
|
||||
//int searchSpace_id = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceId;
|
||||
/*
|
||||
* The following code has been removed as it is handled by higher layers (fapi)
|
||||
if (searchSpace_id == 0){ // Implementing TS 38.213 subclause 13, UE procedure for monitoring Type0-PDCCH common search space
|
||||
@@ -3216,16 +3600,16 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
// the searchSpace indicates that we need to monitor PDCCH in current nr_tti_rx
|
||||
// get the parameters describing the current SEARCHSPACE
|
||||
// the CORESET id applicable to the current SearchSpace
|
||||
int searchSpace_coreset_id = pdcch_vars2->searchSpace[nb_searchspace_active].controlResourceSetId;
|
||||
//int searchSpace_coreset_id = pdcch_vars2->searchSpace[nb_searchspace_active].controlResourceSetId;
|
||||
// FIXME this variable is a bit string (14 bits) identifying every OFDM symbol in a slot.
|
||||
// at the moment we will not take into consideration this variable and we will consider that the OFDM symbol offset is always the first OFDM in a symbol
|
||||
uint16_t symbol_within_slot_mon = pdcch_vars2->searchSpace[nb_searchspace_active].monitoringSymbolWithinSlot;
|
||||
// get the remaining parameters describing the current SEARCHSPACE: // FIXME! To be defined where we get this information from
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L1 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel1;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L2 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel2;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L4 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel4;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L8 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel8;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L16 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel16;
|
||||
//NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L1 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel1;
|
||||
//NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L2 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel2;
|
||||
//NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L4 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel4;
|
||||
//NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L8 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel8;
|
||||
//NR_UE_SEARCHSPACE_nbrCAND_t num_cand_L16 = pdcch_vars2->searchSpace[nb_searchspace_active].nrofCandidates_aggrlevel16;
|
||||
// FIXME! A table of five enum elements
|
||||
// searchSpaceType indicates whether this is a common search space or a UE-specific search space
|
||||
//int searchSpaceType = pdcch_vars2->searchSpace[nb_searchspace_active].searchSpaceType.type;
|
||||
@@ -3295,8 +3679,8 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
ue->high_speed_flag,
|
||||
ue->is_secondary_ue);*/ //removed for nr_ue_pdcch_procedures
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_rx_pdcch(nb_coreset_active=%d, (symbol_within_slot_mon&0x3FFF)=%d, searchSpaceType=%d)\n",
|
||||
nb_coreset_active,(symbol_within_slot_mon&0x3FFF),
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_rx_pdcch with eNB_id=%d (nb_coreset_active=%d, (symbol_within_slot_mon&0x3FFF)=%d, searchSpaceType=%d)\n",
|
||||
eNB_id,nb_coreset_active,(symbol_within_slot_mon&0x3FFF),
|
||||
searchSpaceType);
|
||||
#endif
|
||||
nr_rx_pdcch(ue,
|
||||
@@ -3346,57 +3730,41 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
*/ //removed for nr_ue_pdcch_procedures
|
||||
crc_scrambled_t crc_scrambled;
|
||||
format_found_t format_found=255;
|
||||
|
||||
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
if (searchSpaceType == common) { // search all possible dci's for COMMON SEARCH SPACES according to the current SEARCHSPACE configuration
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure(searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n",
|
||||
searchSpaceType,
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure with eNB_id=%d (n_RB_ULBWP=%d, n_RB_DLBWP=%d, searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n",
|
||||
eNB_id,n_RB_ULBWP,n_RB_DLBWP,searchSpaceType,
|
||||
nb_searchspace_active,
|
||||
nb_coreset_active,
|
||||
dci_cnt);
|
||||
#endif
|
||||
dci_cnt += nr_dci_decoding_procedure(nb_searchspace_active,
|
||||
nb_coreset_active,
|
||||
ue,
|
||||
dci_alloc_rx[dci_cnt],
|
||||
searchSpaceType, // if we're in PUSCH don't listen to common search space,
|
||||
// later when we need paging or RA during connection, update this ...
|
||||
eNB_id,
|
||||
nr_tti_rx,
|
||||
dci_fields_sizes,dci_fields_sizes_cnt,
|
||||
n_RB_ULBWP,
|
||||
n_RB_DLBWP,
|
||||
&crc_scrambled,
|
||||
&format_found);
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt);
|
||||
#endif
|
||||
}
|
||||
if (searchSpaceType == ue_specific){// search all possible dci's for UE-SPECIFIC SEARCH SPACES according to the current SEARCHSPACE configuration
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure(searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n",
|
||||
searchSpaceType,
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_dci_decoding_procedure with eNB_id=%d (n_RB_ULBWP=%d, n_RB_DLBWP=%d, searchSpaceType=%d, nb_searchspace_active=%d, nb_coreset_active=%d) -> dci_cnt=%d\n",
|
||||
eNB_id,n_RB_ULBWP,n_RB_DLBWP,searchSpaceType,
|
||||
nb_searchspace_active,
|
||||
nb_coreset_active,
|
||||
dci_cnt);
|
||||
#endif
|
||||
dci_cnt += nr_dci_decoding_procedure(nb_searchspace_active,
|
||||
nb_coreset_active,
|
||||
ue,
|
||||
dci_alloc_rx[dci_cnt],
|
||||
searchSpaceType, // if we're in PUSCH don't listen to common search space,
|
||||
// later when we need paging or RA during connection, update this ...
|
||||
eNB_id,
|
||||
nr_tti_rx,
|
||||
dci_fields_sizes,dci_fields_sizes_cnt,
|
||||
n_RB_ULBWP,
|
||||
n_RB_DLBWP,
|
||||
&crc_scrambled,
|
||||
&format_found);
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
dci_cnt += nr_dci_decoding_procedure(nb_searchspace_active,
|
||||
nb_coreset_active,
|
||||
ue,
|
||||
&dci_alloc_rx[dci_cnt],
|
||||
searchSpaceType,
|
||||
eNB_id,
|
||||
nr_tti_rx,
|
||||
dci_fields_sizes_cnt,
|
||||
n_RB_ULBWP,
|
||||
n_RB_DLBWP,
|
||||
&crc_scrambled,
|
||||
&format_found,
|
||||
crc_scrambled_values);
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Ending function nr_dci_decoding_procedure() -> dci_cnt=%d\n",dci_cnt);
|
||||
#endif
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT);
|
||||
//LOG_D(PHY,"[UE %d][PUSCH] Frame %d nr_tti_rx %d PHICH RX\n",ue->Mod_id,frame_rx,nr_tti_rx);
|
||||
@@ -3483,14 +3851,6 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
/*
|
||||
* This is the NR part
|
||||
*/
|
||||
uint16_t c_rnti=pdcch_vars[eNB_id]->crnti;
|
||||
uint16_t cs_rnti,new_rnti,tc_rnti;
|
||||
uint16_t p_rnti=P_RNTI;
|
||||
uint16_t si_rnti=SI_RNTI;
|
||||
uint16_t ra_rnti=99;
|
||||
uint16_t sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti; //FIXME
|
||||
uint16_t crc_scrambled_values[TOTAL_NBR_SCRAMBLED_VALUES] =
|
||||
{c_rnti,cs_rnti,new_rnti,tc_rnti,p_rnti,si_rnti,ra_rnti,sp_csi_rnti,sfi_rnti,int_rnti,tpc_pusch_rnti,tpc_pucch_rnti,tpc_srs_rnti};
|
||||
|
||||
if ((dci_alloc_rx[i].format == format0_0))
|
||||
if ((dci_alloc_rx[i].format == format1_0) &&
|
||||
@@ -3513,7 +3873,16 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
if ((dci_alloc_rx[i].format == format1_1)){ // This format not implemented at a first time. FIXME
|
||||
}
|
||||
NR_DCI_INFO_EXTRACTED_t nr_dci_info_extracted;
|
||||
nr_generate_ue_ul_dlsch_params_from_dci(ue,
|
||||
NR_DCI_INFO_EXTRACTED_t *ptr_nr_dci_info_extracted = &nr_dci_info_extracted;
|
||||
#ifdef NR_PDCCH_SCHED_DEBUG
|
||||
printf("<-NR_PDCCH_PHY_PROCEDURES_LTE_UE (nr_ue_pdcch_procedures)-> Entering function nr_generate_ue_ul_dlsch_params_from_dci with eNB_id=%d dci_cnt=%d format=%d, rnti=%d\n",
|
||||
eNB_id,
|
||||
dci_cnt,
|
||||
dci_alloc_rx[i].format,
|
||||
dci_alloc_rx[i].rnti);
|
||||
#endif
|
||||
|
||||
nr_generate_ue_ul_dlsch_params_from_dci(ue,
|
||||
eNB_id,
|
||||
frame_rx,
|
||||
nr_tti_rx,
|
||||
@@ -3532,15 +3901,17 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
n_RB_ULBWP,
|
||||
n_RB_DLBWP,
|
||||
crc_scrambled_values,
|
||||
&nr_dci_info_extracted);
|
||||
ptr_nr_dci_info_extracted);//&nr_dci_info_extracted);
|
||||
|
||||
ue->dci_ind.dci_list[i].rnti = dci_alloc_rx[i].rnti;
|
||||
ue->dci_ind.dci_list[i].dci_format = dci_alloc_rx[i].format;
|
||||
memcpy(&ue->dci_ind.dci_list[i].dci, &nr_dci_info_extracted, sizeof(fapi_nr_dci_pdu_rel15_t) );
|
||||
|
||||
|
||||
//printf(">>> example mcs=%d\n",nr_dci_info_extracted.mcs);
|
||||
//printf(">>> calling MAC with dl_indication DCI_IND\n");
|
||||
// TODO: check where should we send up this message.
|
||||
//ue->if_inst->dl_indication(&ue->dl_indication);
|
||||
|
||||
ue->dl_indication.dci_ind=&ue->dci_ind;
|
||||
ue->if_inst->dl_indication(&ue->dl_indication);
|
||||
|
||||
/*
|
||||
* This is the LTE part to be removed
|
||||
@@ -3769,7 +4140,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"[UE %d][PUSCH] Frame %d nr_tti_rx %d: Found cba rnti %x, format 0, dci_cnt %d\n",
|
||||
ue->Mod_id,frame_rx,nr_tti_rx,dci_alloc_rx[i].rnti,i);
|
||||
/*
|
||||
|
||||
if (((frame_rx%100) == 0) || (frame_rx < 20))
|
||||
dump_dci(&ue->frame_parms, &dci_alloc_rx[i]);
|
||||
|
||||
@@ -4027,6 +4398,7 @@ void copy_harq_proc_struct(NR_DL_UE_HARQ_t *harq_processes_dest, NR_DL_UE_HARQ_t
|
||||
memcpy(harq_ack_dest, current_harq_ack, sizeof(nr_harq_status_t));
|
||||
}*/
|
||||
|
||||
#if 0
|
||||
void ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_id, PDSCH_t pdsch, NR_UE_DLSCH_t *dlsch0, NR_UE_DLSCH_t *dlsch1, int s0, int s1, int abstraction_flag) {
|
||||
|
||||
int nr_tti_rx = proc->nr_tti_rx;
|
||||
@@ -4046,11 +4418,11 @@ void ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_id
|
||||
|
||||
if ((pdsch==PDSCH) &&
|
||||
(ue->transmission_mode[eNB_id] == 5) &&
|
||||
(dlsch0->harq_processes[harq_pid]->dl_power_off==0) &&
|
||||
(dlsch0->harq_processes[harq_pid].dl_power_off==0) &&
|
||||
(ue->use_ia_receiver ==1)) {
|
||||
dual_stream_UE = 1;
|
||||
eNB_id_i = ue->n_connected_eNB;
|
||||
i_mod = dlsch0->harq_processes[harq_pid]->Qm;
|
||||
i_mod = dlsch0->harq_processes[harq_pid].Qm;
|
||||
|
||||
}
|
||||
else if((pdsch==PDSCH) && (ue->transmission_mode[eNB_id]==3))
|
||||
@@ -4115,6 +4487,8 @@ void ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_id
|
||||
} // CRNTI active
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void process_rar(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int eNB_id, runmode_t mode, int abstraction_flag) {
|
||||
|
||||
@@ -5446,17 +5820,18 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
|
||||
uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,
|
||||
relaying_type_t r_type) {
|
||||
|
||||
int l,l2;
|
||||
int pilot1;
|
||||
int pmch_flag=0;
|
||||
//int l,l2;
|
||||
//int pilot1;
|
||||
//int pmch_flag=0;
|
||||
int frame_rx = proc->frame_rx;
|
||||
int nr_tti_rx = proc->nr_tti_rx;
|
||||
proc->decoder_switch = 0;
|
||||
//int counter_decoder = 0;
|
||||
|
||||
uint8_t next1_thread_id = ue->current_thread_id[nr_tti_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[nr_tti_rx]+1);
|
||||
uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1);
|
||||
//uint8_t next1_thread_id = ue->current_thread_id[nr_tti_rx]== (RX_NB_TH-1) ? 0:(ue->current_thread_id[nr_tti_rx]+1);
|
||||
//uint8_t next2_thread_id = next1_thread_id== (RX_NB_TH-1) ? 0:(next1_thread_id+1);
|
||||
|
||||
#if 0
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
|
||||
|
||||
#if T_TRACER
|
||||
@@ -5468,9 +5843,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
|
||||
#endif
|
||||
|
||||
// start timers
|
||||
#ifdef UE_DEBUG_TRACE
|
||||
//#ifdef UE_DEBUG_TRACE
|
||||
LOG_I(PHY," ****** start RX-Chain for AbsSubframe %d.%d ****** \n", frame_rx%1024, nr_tti_rx);
|
||||
#endif
|
||||
//#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->phy_proc_rx[ue->current_thread_id[nr_tti_rx]]);
|
||||
@@ -5478,6 +5853,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
|
||||
#endif
|
||||
|
||||
pmch_flag = is_pmch_subframe(frame_rx,nr_tti_rx,&ue->frame_parms) ? 1 : 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if (do_pdcch_flag) {
|
||||
// deactivate reception until we scan pdcch
|
||||
@@ -5500,6 +5879,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
|
||||
ue->Mod_id,frame_rx, nr_tti_rx);
|
||||
#endif
|
||||
|
||||
|
||||
if (ue->frame_parms.Ncp == 0) { // normal prefix
|
||||
pilot1 = 4;
|
||||
} else { // extended prefix
|
||||
@@ -5530,6 +5910,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
|
||||
|
||||
LOG_D(PHY," ------ slot 0 Processing: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
LOG_D(PHY," ------ --> FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
#endif
|
||||
|
||||
//nr_gold_pdcch(ue,0, 2);
|
||||
/*
|
||||
@@ -5555,26 +5936,46 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eN
|
||||
}*/
|
||||
//ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
|
||||
|
||||
if (do_pdcch_flag) {
|
||||
//if (do_pdcch_flag) {
|
||||
// if ((l==pilot1) || ((pmch_flag==1)&(l==l2))) {
|
||||
// LOG_D(PHY,"[UE %d] Frame %d: Calling pdcch procedures (eNB %d)\n",ue->Mod_id,frame_rx,eNB_id);
|
||||
|
||||
//start_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
|
||||
|
||||
//printf(">>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures init, dlsch->active=%d\n",
|
||||
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
|
||||
if (nr_ue_pdcch_procedures(eNB_id,ue,proc,abstraction_flag) == -1) {
|
||||
LOG_E(PHY,"[UE %d] Frame %d, nr_tti_rx %d: Error in pdcch procedures\n",ue->Mod_id,frame_rx,nr_tti_rx);
|
||||
return(-1);
|
||||
}
|
||||
//for (int m=0;m<1000;m++) printf("%d",m);
|
||||
//printf("\n>>> at phy_procedures_nrUE_RX, nr_ue_pdcch_procedures end, dlsch->active=%d\n",
|
||||
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active);
|
||||
|
||||
// preparing for PDSCH procedures
|
||||
// if (ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0]->active == 1) {
|
||||
// ue_pdsch_procedures(ue,
|
||||
// proc,
|
||||
// eNB_id,
|
||||
// PDSCH,
|
||||
// ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id][0],
|
||||
// NULL,
|
||||
// ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
|
||||
// ue->frame_parms.symbols_per_tti>>1,
|
||||
// abstraction_flag);
|
||||
// }
|
||||
#if 0
|
||||
//stop_meas(&ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]]);
|
||||
//printf("nr_tti_rx %d n_pdcch_sym %d pdcch procedures %5.3f \n",
|
||||
// nr_tti_rx, ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols,
|
||||
// (ue->rx_pdcch_stats[ue->current_thread_id[nr_tti_rx]].p_time)/(cpuf*1000.0));
|
||||
LOG_D(PHY,"num_pdcch_symbols %d\n",ue->pdcch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->num_pdcch_symbols);
|
||||
// }
|
||||
}
|
||||
//}
|
||||
|
||||
// } // for l=1..l2
|
||||
|
||||
#if 0
|
||||
|
||||
ue_measurement_procedures(l-1,ue,proc,eNB_id,(nr_tti_rx<<1),abstraction_flag,mode);
|
||||
|
||||
LOG_D(PHY," ------ end FFT/ChannelEst/PDCCH slot 0: AbsSubframe %d.%d ------ \n", frame_rx%1024, nr_tti_rx);
|
||||
|
||||
@@ -48,6 +48,60 @@
|
||||
|
||||
#endif
|
||||
|
||||
int8_t nr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t eNB_id, uint16_t rnti, sub_frame_t subframe);
|
||||
uint8_t is_cqi_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t gNB_id);
|
||||
uint8_t is_ri_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t gNB_id);
|
||||
/*
|
||||
void nr_generate_pucch0(int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
int16_t amp,
|
||||
int nr_tti_tx,
|
||||
uint8_t mcs,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB);
|
||||
|
||||
void nr_generate_pucch1(int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_tti_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint16_t startingPRB,
|
||||
uint16_t startingPRB_intraSlotHopping,
|
||||
uint8_t timeDomainOCC,
|
||||
uint8_t nr_bit);
|
||||
|
||||
void nr_generate_pucch2(int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_tti_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit);
|
||||
|
||||
void nr_generate_pucch3_4(int32_t **txdataF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
pucch_format_nr_t fmt,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint64_t payload,
|
||||
int16_t amp,
|
||||
int nr_tti_tx,
|
||||
uint8_t nrofSymbols,
|
||||
uint8_t startingSymbolIndex,
|
||||
uint8_t nrofPRB,
|
||||
uint16_t startingPRB,
|
||||
uint8_t nr_bit,
|
||||
uint8_t occ_length_format4,
|
||||
uint8_t occ_index_format4);
|
||||
*/
|
||||
/**************** variables **************************************/
|
||||
|
||||
|
||||
@@ -139,7 +193,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
|
||||
if (dl_harq_pid < ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->number_harq_processes_for_pdsch) {
|
||||
/* pucch indicator can be reseted in function get_downlink_ack so it should be get now */
|
||||
pucch_resource_indicator = ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid]->harq_ack.pucch_resource_indicator;
|
||||
pucch_resource_indicator = ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid].harq_ack.pucch_resource_indicator;
|
||||
}
|
||||
|
||||
/* Part - I
|
||||
@@ -238,7 +292,7 @@ bool pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_
|
||||
int occ_length = 0;
|
||||
int occ_Index = 0;
|
||||
|
||||
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid]->harq_ack;
|
||||
NR_UE_HARQ_STATUS_t *harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][0]->harq_processes[dl_harq_pid].harq_ack;
|
||||
|
||||
if (select_pucch_resource(ue, gNB_id, N_UCI, pucch_resource_indicator, &initial_pucch_id, &pucch_resource_set,
|
||||
&pucch_resource_id, harq_status) == TRUE) {
|
||||
@@ -633,7 +687,7 @@ uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t
|
||||
|
||||
for (int dl_harq_pid = 0; dl_harq_pid < number_pid_dl; dl_harq_pid++) {
|
||||
|
||||
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid]->harq_ack;
|
||||
harq_status = &ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid].harq_ack;
|
||||
|
||||
/* check if current tx slot should transmit downlink acknowlegment */
|
||||
if (harq_status->slot_for_feedback_ack == proc->nr_tti_tx) {
|
||||
@@ -671,7 +725,7 @@ uint8_t get_downlink_ack(PHY_VARS_NR_UE *ue, uint8_t gNB_id, UE_nr_rxtx_proc_t
|
||||
}
|
||||
}
|
||||
if (do_reset == TRUE) {
|
||||
init_downlink_harq_status(ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid]);
|
||||
init_downlink_harq_status(&ue->dlsch[ue->current_thread_id[proc->nr_tti_rx]][gNB_id][code_word]->harq_processes[dl_harq_pid]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -609,14 +609,15 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
int32_t RateMatchPatternLTE_CRS_radioframeAllocationPeriod = 0;
|
||||
int32_t RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0;
|
||||
char* RateMatchPatternLTE_CRS_subframeAllocation_choice = NULL;
|
||||
/*
|
||||
int32_t srb1_timer_poll_retransmit = 0;
|
||||
|
||||
|
||||
/*int32_t srb1_timer_poll_retransmit = 0;
|
||||
int32_t srb1_timer_reordering = 0;
|
||||
int32_t srb1_timer_status_prohibit = 0;
|
||||
int32_t srb1_poll_pdu = 0;
|
||||
int32_t srb1_poll_byte = 0;
|
||||
int32_t srb1_max_retx_threshold = 0;
|
||||
*/
|
||||
int32_t srb1_max_retx_threshold = 0;*/
|
||||
|
||||
//int32_t my_int;
|
||||
|
||||
paramdef_t GNBSParams[] = GNBSPARAMS_DESC;
|
||||
@@ -624,16 +625,11 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
paramdef_t GNBParams[] = GNBPARAMS_DESC;
|
||||
paramlist_def_t GNBParamList = {GNB_CONFIG_STRING_GNB_LIST,NULL,0};
|
||||
////////// Physical parameters
|
||||
checkedparam_t config_check_CCparams[] = NRCCPARAMS_CHECK;
|
||||
//checkedparam_t config_check_CCparams[] = NRCCPARAMS_CHECK;
|
||||
paramdef_t CCsParams[] = NRCCPARAMS_DESC;
|
||||
paramlist_def_t CCsParamList = {GNB_CONFIG_STRING_COMPONENT_CARRIERS,NULL,0};
|
||||
|
||||
//paramdef_t SRB1Params[] = SRB1PARAMS_DESC;
|
||||
|
||||
/* map parameter checking array instances to parameter definition array instances */
|
||||
for (int I = 0; I < (sizeof(CCsParams) / sizeof(paramdef_t)); I++) {
|
||||
CCsParams[I].chkPptr = &(config_check_CCparams[I]);
|
||||
}
|
||||
//paramdef_t SRB1Params[] = SRB1PARAMS_DESC;
|
||||
|
||||
/* get global parameters, defined outside any section in the config file */
|
||||
|
||||
@@ -1984,9 +1980,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
}
|
||||
|
||||
if (strcmp(RateMatchPattern_mode , "dynamic") == 0){
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = NR_RateMatchPattern__dummy_dynamic;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = NR_RateMatchPattern__mode_dynamic;
|
||||
#endif
|
||||
}else if (strcmp(RateMatchPattern_mode , "semiStatic") == 0){
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = NR_RateMatchPattern__dummy_semiStatic;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPattern_mode[j] = NR_RateMatchPattern__mode_semiStatic;
|
||||
#endif
|
||||
}else {
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPattern_mode !\n",
|
||||
RC.config_file_name, i, RateMatchPattern_mode);
|
||||
@@ -2444,41 +2448,86 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
|
||||
switch(Common_dci_Format2_3_monitoringPeriodicity){
|
||||
case 1:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl1;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n1;
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl2;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n2;
|
||||
#endif
|
||||
break;
|
||||
case 4:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl4;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n4;
|
||||
#endif
|
||||
break;
|
||||
case 5:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl5;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n5;
|
||||
#endif
|
||||
break;
|
||||
case 8:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl8;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n8;
|
||||
#endif
|
||||
break;
|
||||
case 10:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl10;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n10;
|
||||
#endif
|
||||
break;
|
||||
case 16:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl16;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n16;
|
||||
#endif
|
||||
break;
|
||||
case 20:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy1_sl20;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_monitoringPeriodicity[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__monitoringPeriodicity_n20;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_3_dummy1 choice: 1,2,4,5,8,10,16,20 !\n",
|
||||
RC.config_file_name, i, Common_dci_Format2_3_monitoringPeriodicity);
|
||||
#else
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_3_monitoringPeriodicity choice: 1,2,4,5,8,10,16,20 !\n",
|
||||
RC.config_file_name, i, Common_dci_Format2_3_monitoringPeriodicity);
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
switch(Common_dci_Format2_3_nrofPDCCH_Candidates){
|
||||
case 1:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy2_n1;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__nrofPDCCH_Candidates_n1;
|
||||
#endif
|
||||
break;
|
||||
case 2:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__dummy2_n2;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).Common_dci_Format2_3_nrofPDCCH_Candidates[j] = NR_SearchSpace__searchSpaceType__common__dci_Format2_3__nrofPDCCH_Candidates_n2;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%d\" for Common_dci_Format2_3_nrofPDCCH_Candidates choice: 1,2 !\n",
|
||||
@@ -2602,9 +2651,17 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
}
|
||||
|
||||
if (strcmp(RateMatchPatternLTE_CRS_subframeAllocation_choice , "oneFrame") == 0){
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = NR_EUTRA_MBSFN_SubframeConfig__subframeAllocation1_PR_oneFrame;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = NR_EUTRA_MBSFN_SubframeConfig__subframeAllocation_PR_oneFrame;
|
||||
#endif
|
||||
}else if (strcmp(RateMatchPatternLTE_CRS_subframeAllocation_choice , "fourFrames") == 0){
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = NR_EUTRA_MBSFN_SubframeConfig__subframeAllocation1_PR_fourFrames;
|
||||
#else
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).RateMatchPatternLTE_CRS_subframeAllocation_choice[j] = NR_EUTRA_MBSFN_SubframeConfig__subframeAllocation_PR_fourFrames;
|
||||
#endif
|
||||
}else {
|
||||
AssertFatal (0,"Failed to parse gNB configuration file %s, gnb %d unknown value \"%s\" for RateMatchPatternLTE_CRS_subframeAllocation_choice !\n",
|
||||
RC.config_file_name, i, RateMatchPatternLTE_CRS_subframeAllocation_choice);
|
||||
|
||||
@@ -77,11 +77,6 @@
|
||||
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
|
||||
//solve implicit declaration
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
|
||||
|
||||
/** @defgroup _mac MAC
|
||||
* @ingroup _oai2
|
||||
* @{
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -232,7 +232,11 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
mib->message.choice.mib->subCarrierSpacingCommon,
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset,
|
||||
mib->message.choice.mib->dmrs_TypeA_Position,
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero * 16 + mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero,
|
||||
#else
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1,
|
||||
#endif
|
||||
mib->message.choice.mib->cellBarred,
|
||||
mib->message.choice.mib->intraFreqReselection
|
||||
);
|
||||
|
||||
@@ -82,7 +82,6 @@ void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
|
||||
if (nfapi_mode==0 || nfapi_mode == 1) { // monolithic or PNF
|
||||
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdcch_ofdm_symbols = 1;
|
||||
DL_req[CC_idP].dl_config_request_body.number_dci = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdu = 0;
|
||||
DL_req[CC_idP].dl_config_request_body.number_pdsch_rnti = 0;
|
||||
@@ -418,36 +417,11 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
if((subframeP == 0) && (frameP & 7) == 0){
|
||||
schedule_nr_mib(module_idP, frameP, subframeP);
|
||||
}
|
||||
/*
|
||||
if (phy_test == 0){
|
||||
// This schedules SI for legacy LTE and eMTC starting in subframeP
|
||||
schedule_SI(module_idP, frameP, subframeP);
|
||||
// This schedules Paging in subframeP
|
||||
schedule_PCH(module_idP,frameP,subframeP);
|
||||
// This schedules Random-Access for legacy LTE and eMTC starting in subframeP
|
||||
schedule_RA(module_idP, frameP, subframeP);
|
||||
// copy previously scheduled UL resources (ULSCH + HARQ)
|
||||
copy_nr_ulreq(module_idP, frameP, subframeP);
|
||||
// This schedules SRS in subframeP
|
||||
schedule_nr_SRS(module_idP, frameP, subframeP);
|
||||
// This schedules ULSCH in subframeP (dci0)
|
||||
schedule_ulsch(module_idP, frameP, subframeP);
|
||||
// This schedules UCI_SR in subframeP
|
||||
schedule_nr_SR(module_idP, frameP, subframeP);
|
||||
// This schedules UCI_CSI in subframeP
|
||||
schedule_nr_CSI(module_idP, frameP, subframeP);
|
||||
// This schedules DLSCH in subframeP
|
||||
schedule_dlsch(module_idP, frameP, subframeP, mbsfn_status);
|
||||
}
|
||||
else{
|
||||
schedule_ulsch_phy_test(module_idP,frameP,subframeP);
|
||||
schedule_ue_spec_phy_test(module_idP,frameP,subframeP,mbsfn_status);
|
||||
}
|
||||
*/
|
||||
|
||||
if (RC.flexran[module_idP]->enabled)
|
||||
flexran_agent_send_update_stats(module_idP);
|
||||
|
||||
// Phytest scheduling/ option not activated because of pending bug
|
||||
nr_schedule_css_dlsch_phytest(module_idP, frameP, subframeP);
|
||||
|
||||
|
||||
/*
|
||||
// Allocate CCEs for good after scheduling is done
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
|
||||
|
||||
+36
-26
@@ -19,34 +19,44 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
/*! \file gNB_scheduler_RA.c
|
||||
* \brief primitives used for random access
|
||||
* \author
|
||||
* \date
|
||||
* \email:
|
||||
* \version
|
||||
*/
|
||||
|
||||
void nr_polar_bit_insertion(uint8_t *input, uint8_t *output, uint16_t N, uint16_t K,
|
||||
int16_t *Q_I_N, int16_t *Q_PC_N, uint8_t n_PC){
|
||||
#include nr_mac_gNB.h
|
||||
|
||||
uint16_t k=0;
|
||||
uint8_t flag;
|
||||
void
|
||||
schedule_RA(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP)
|
||||
{
|
||||
|
||||
if (n_PC>0) {
|
||||
/*
|
||||
*
|
||||
*/
|
||||
} else {
|
||||
for (int n=0; n<=N-1; n++) {
|
||||
flag=0;
|
||||
for (int m=0; m<=(K+n_PC)-1; m++) {
|
||||
if ( n == Q_I_N[m]) {
|
||||
flag=1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (flag) { // n ϵ Q_I_N
|
||||
output[n]=input[k];
|
||||
k++;
|
||||
} else {
|
||||
output[n] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
eNB_MAC_INST *mac = RC.mac[module_idP];
|
||||
COMMON_channels_t *cc = mac->common_channels;
|
||||
RA_t *ra;
|
||||
uint8_t i;
|
||||
|
||||
start_meas(&mac->schedule_ra);
|
||||
|
||||
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
|
||||
|
||||
for (i = 0; i < NB_RA_PROC_MAX; i++) {
|
||||
|
||||
ra = (RA_t *) & cc[CC_id].ra[i];
|
||||
//LOG_D(MAC,"RA[state:%d]\n",ra->state);
|
||||
|
||||
if (ra->state == MSG2)
|
||||
generate_Msg2(module_idP, CC_id, frameP, subframeP, ra);
|
||||
else if (ra->state == MSG4)
|
||||
generate_Msg4(module_idP, CC_id, frameP, subframeP, ra);
|
||||
else if (ra->state == WAITMSG4ACK)
|
||||
check_Msg4_retransmission(module_idP, CC_id, frameP, subframeP, ra);
|
||||
|
||||
} // for i=0 .. N_RA_PROC-1
|
||||
} // CC_id
|
||||
|
||||
stop_meas(&mac->schedule_ra);
|
||||
}
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "assertions.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
@@ -97,10 +97,10 @@ void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subfram
|
||||
memset((void *) dl_config_pdu, 0,sizeof(nfapi_nr_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_NR_DL_CONFIG_BCH_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size =2 + sizeof(nfapi_nr_dl_config_bch_pdu_rel15_t);
|
||||
dl_config_pdu->bch_pdu.bch_pdu_rel15.tl.tag = NFAPI_NR_DL_CONFIG_REQUEST_BCH_PDU_REL15_TAG;
|
||||
dl_config_pdu->bch_pdu.bch_pdu_rel15.length = mib_sdu_length;
|
||||
dl_config_pdu->bch_pdu.bch_pdu_rel15.pdu_index = gNB->pdu_index[CC_id];
|
||||
dl_config_pdu->bch_pdu.bch_pdu_rel15.transmission_power = 6000;
|
||||
dl_config_pdu->bch_pdu_rel15.tl.tag = NFAPI_NR_DL_CONFIG_REQUEST_BCH_PDU_REL15_TAG;
|
||||
dl_config_pdu->bch_pdu_rel15.length = mib_sdu_length;
|
||||
dl_config_pdu->bch_pdu_rel15.pdu_index = gNB->pdu_index[CC_id];
|
||||
dl_config_pdu->bch_pdu_rel15.transmission_power = 6000;
|
||||
dl_req->tl.tag = NFAPI_DL_CONFIG_REQUEST_BODY_TAG;
|
||||
dl_req->number_pdu++;
|
||||
dl_config_request->header.message_id = NFAPI_DL_CONFIG_REQUEST;
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/*
|
||||
* 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.0 (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
|
||||
*/
|
||||
|
||||
/*! \file gNB_scheduler_phytest.c
|
||||
* \brief gNB scheduling procedures in phy_test mode
|
||||
* \author Guy De Souza
|
||||
* \date 07/2018
|
||||
* \email: desouza@eurecom.fr
|
||||
* \version 1.0
|
||||
* @ingroup _mac
|
||||
*/
|
||||
|
||||
#include "nr_mac_gNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
|
||||
/*Scheduling of DLSCH with associated DCI in common search space
|
||||
* current version has only a DCI for type 1 PDCCH for RA-RNTI*/
|
||||
void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP)
|
||||
{
|
||||
uint8_t CC_id;
|
||||
|
||||
gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
|
||||
//NR_COMMON_channels_t *cc = nr_mac->common_channels;
|
||||
nfapi_nr_dl_config_request_body_t *dl_req;
|
||||
nfapi_nr_dl_config_request_pdu_t *dl_config_pdu;
|
||||
nfapi_tx_request_pdu_t *TX_req;
|
||||
uint16_t sfn_sf = frameP << 4 | subframeP;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_I(MAC, "Scheduling common search space DCI type 1 for CC_id %d\n",CC_id);
|
||||
|
||||
PHY_VARS_gNB *gNB = RC.gNB[module_idP][CC_id];
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
|
||||
dl_req = &nr_mac->DL_req[CC_id].dl_config_request_body;
|
||||
dl_config_pdu = &dl_req->dl_config_pdu_list[dl_req->number_pdu];
|
||||
memset((void*)dl_config_pdu,0,sizeof(nfapi_nr_dl_config_request_pdu_t));
|
||||
dl_config_pdu->pdu_type = NFAPI_NR_DL_CONFIG_DCI_DL_PDU_TYPE;
|
||||
dl_config_pdu->pdu_size = (uint8_t)(2+sizeof(nfapi_nr_dl_config_dci_dl_pdu));
|
||||
|
||||
nfapi_nr_dl_config_dci_dl_pdu_rel15_t *pdu_rel15 = &dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel15;
|
||||
nfapi_nr_dl_config_pdcch_parameters_rel15_t *params_rel15 = &dl_config_pdu->dci_dl_pdu.pdcch_params_rel15;
|
||||
|
||||
nr_configure_css_dci_from_mib(&gNB->pdcch_type0_params,
|
||||
kHz30, kHz30, nr_FR1, 0, 0,
|
||||
fp->slots_per_frame,
|
||||
cfg->rf_config.dl_carrier_bandwidth.value);
|
||||
memcpy((void*)params_rel15, (void*)&gNB->pdcch_type0_params, sizeof(nfapi_nr_dl_config_pdcch_parameters_rel15_t));
|
||||
|
||||
pdu_rel15->frequency_domain_assignment = 5;
|
||||
pdu_rel15->time_domain_assignment = 2;
|
||||
pdu_rel15->vrb_to_prb_mapping = 0;
|
||||
pdu_rel15->mcs = 12;
|
||||
pdu_rel15->tb_scaling = 1;
|
||||
LOG_I(MAC, "[gNB scheduler phytest] DCI type 1 payload: freq_alloc %d, time_alloc %d, vrb to prb %d, mcs %d tb_scaling %d\n",
|
||||
pdu_rel15->frequency_domain_assignment,
|
||||
pdu_rel15->time_domain_assignment,
|
||||
pdu_rel15->vrb_to_prb_mapping,
|
||||
pdu_rel15->mcs,
|
||||
pdu_rel15->tb_scaling);
|
||||
|
||||
params_rel15->rnti = 0x03;
|
||||
params_rel15->rnti_type = NFAPI_NR_RNTI_RA;
|
||||
params_rel15->dci_format = NFAPI_NR_DL_DCI_FORMAT_1_0;
|
||||
//params_rel15->aggregation_level = 1;
|
||||
LOG_I(MAC, "DCI type 1 params: rmsi_pdcch_config %d, rnti %d, rnti_type %d, dci_format %d\n \
|
||||
coreset params: mux_pattern %d, n_rb %d, n_symb %d, rb_offset %d \n \
|
||||
ss params : nb_ss_sets_per_slot %d, first symb %d, nb_slots %d, sfn_mod2 %d, first slot %d\n",
|
||||
0,
|
||||
params_rel15->rnti,
|
||||
params_rel15->rnti_type,
|
||||
params_rel15->dci_format,
|
||||
params_rel15->mux_pattern,
|
||||
params_rel15->n_rb,
|
||||
params_rel15->n_symb,
|
||||
params_rel15->rb_offset,
|
||||
params_rel15->nb_ss_sets_per_slot,
|
||||
params_rel15->first_symbol,
|
||||
params_rel15->nb_slots,
|
||||
params_rel15->sfn_mod2,
|
||||
params_rel15->first_slot);
|
||||
dl_req->number_dci++;
|
||||
dl_req->number_pdu++;
|
||||
|
||||
TX_req = &nr_mac->TX_req[CC_id].tx_request_body.tx_pdu_list[nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
TX_req->pdu_length = 6;
|
||||
TX_req->pdu_index = nr_mac->pdu_index[CC_id]++;
|
||||
TX_req->num_segments = 1;
|
||||
TX_req->segments[0].segment_length = 8;
|
||||
//TX_req->segments[0].segment_data = (uint8_t*)pdu_rel15;
|
||||
nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
nr_mac->TX_req[CC_id].sfn_sf = sfn_sf;
|
||||
nr_mac->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
|
||||
nr_mac->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "assertions.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
@@ -31,8 +31,8 @@
|
||||
#ifndef __LAYER2_NR_MAC_PROTO_H__
|
||||
#define __LAYER2_NR_MAC_PROTO_H__
|
||||
|
||||
#include "mac.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "nr_mac_gNB.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
void mac_top_init_gNB(void);
|
||||
|
||||
@@ -59,4 +59,4 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP);
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
/*@}*/
|
||||
|
||||
#ifndef __LAYER2_NR_MAC_DEFS_H__
|
||||
#define __LAYER2_NR_MAC_DEFS_H__
|
||||
#ifndef __LAYER2_NR_MAC_GNB_H__
|
||||
#define __LAYER2_NR_MAC_GNB_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -53,13 +53,16 @@
|
||||
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
|
||||
#include "PHY/defs_common.h" // for PRACH_RESOURCES_t
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h" // temporary
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "common/ran_context.h"
|
||||
|
||||
/*! \brief eNB common channels */
|
||||
/*! \brief gNB common channels */
|
||||
typedef struct {
|
||||
int physCellId;
|
||||
int p_gNB;
|
||||
@@ -164,4 +167,4 @@ typedef struct gNB_MAC_INST_s {
|
||||
time_stats_t schedule_pch;
|
||||
} gNB_MAC_INST;
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_DEFS_H__ */
|
||||
#endif /*__LAYER2_NR_MAC_GNB_H__ */
|
||||
@@ -148,7 +148,8 @@ int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
|
||||
|
||||
if(dl_info->dci_ind != NULL){
|
||||
printf("[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
|
||||
for(i=0; dl_info->dci_ind->number_of_dcis; ++i){
|
||||
for(i=0; i<dl_info->dci_ind->number_of_dcis; ++i){
|
||||
//printf(">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis);
|
||||
fapi_nr_dci_pdu_rel15_t *dci = &dl_info->dci_ind->dci_list[i].dci;
|
||||
|
||||
ret_mask |= (handle_dci(
|
||||
@@ -199,7 +200,6 @@ int8_t nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
|
||||
break;
|
||||
}*/
|
||||
|
||||
|
||||
//(dl_info->dci_list+i)->rnti
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3869,7 +3869,11 @@ uint64_t arfcn_to_freq(long arfcn) {
|
||||
|
||||
// Dump contents
|
||||
if ((*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_systemInformation_r8 ||
|
||||
#if (RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
(*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_criticalExtensionsFuture_r15) {
|
||||
#else
|
||||
(*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_criticalExtensionsFuture) {
|
||||
#endif
|
||||
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
|
||||
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
|
||||
} else {
|
||||
|
||||
@@ -213,7 +213,7 @@ uint8_t get_adjacent_cell_mod_id_NR(uint16_t phyCellId)
|
||||
uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
uint32_t frame,
|
||||
uint32_t ssb_SubcarrierOffset,
|
||||
uint32_t pdcch_ConfigSIB1,
|
||||
uint32_t pdcch_ConfigSIB1,
|
||||
uint32_t subCarrierSpacingCommon,
|
||||
uint32_t dmrs_TypeA_Position)
|
||||
{
|
||||
@@ -234,15 +234,19 @@ uint8_t do_MIB_NR(rrc_gNB_carrier_data_t *carrier,
|
||||
mib->message.choice.mib->systemFrameNumber.bits_unused=2;
|
||||
|
||||
//38.331 spare BIT STRING (SIZE (1))
|
||||
uint16_t *spare= calloc(1, sizeof(uint16_t));
|
||||
uint16_t *spare= CALLOC(1, sizeof(uint16_t));
|
||||
if (spare == NULL) abort();
|
||||
mib->message.choice.mib->spare.buf = (uint8_t *)spare;
|
||||
mib->message.choice.mib->spare.size = 1;
|
||||
mib->message.choice.mib->spare.bits_unused = 7; // This makes a spare of 1 bits
|
||||
|
||||
mib->message.choice.mib->ssb_SubcarrierOffset = ssb_SubcarrierOffset;
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.controlResourceSetZero = (pdcch_ConfigSIB1 / 16);
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1.searchSpaceZero = (pdcch_ConfigSIB1 % 16);
|
||||
#else
|
||||
mib->message.choice.mib->pdcch_ConfigSIB1 = pdcch_ConfigSIB1;
|
||||
|
||||
#endif
|
||||
switch (subCarrierSpacingCommon) {
|
||||
case 15:
|
||||
mib->message.choice.mib->subCarrierSpacingCommon = NR_MIB__subCarrierSpacingCommon_scs15or60;
|
||||
@@ -353,7 +357,11 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->controlResourceSetZero = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceZero = CALLOC(1,sizeof(long));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonControlResourceSet = CALLOC(1,sizeof(struct NR_ControlResourceSet));
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpaceList));
|
||||
#else
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpace = CALLOC(1,sizeof(struct NR_PDCCH_ConfigCommon__commonSearchSpace));
|
||||
#endif
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1 = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->pagingSearchSpace = CALLOC(1,sizeof(NR_SearchSpaceId_t));
|
||||
@@ -377,8 +385,11 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB = CALLOC(1,sizeof(NR_RSRP_Range_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB_SUL = CALLOC(1,sizeof(NR_RSRP_Range_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing = CALLOC(1,sizeof(NR_SubcarrierSpacing_t));
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = CALLOC(1,sizeof(long));
|
||||
#else
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoding = CALLOC(1,sizeof(long));
|
||||
|
||||
#endif
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon = CALLOC(1,sizeof(NR_SetupRelease_PUSCH_ConfigCommon_t));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup = CALLOC(1,sizeof(struct NR_PUSCH_ConfigCommon));
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->groupHoppingEnabledTransformPrecoding = CALLOC(1,sizeof(long));
|
||||
@@ -574,20 +585,32 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16 = CALLOC(1,sizeof(long));
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3 = CALLOC(1,sizeof(struct NR_SearchSpace__searchSpaceType__common__dci_Format2_3));
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1 = CALLOC(1,sizeof(long));
|
||||
#else
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->monitoringPeriodicity = CALLOC(1,sizeof(long));
|
||||
#endif
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel1) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel2) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel4) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel8) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8[CC_id];
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_0->nrofCandidates_SFI.aggregationLevel16) = configuration->Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16[CC_id];
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy1) = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id];
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->dummy2 = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id];
|
||||
#else
|
||||
*(bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->monitoringPeriodicity) = configuration->Common_dci_Format2_3_monitoringPeriodicity[CC_id];
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->nrofPDCCH_Candidates = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id];
|
||||
|
||||
bwp_dl_searchspace->searchSpaceType->choice.common->dci_Format2_3->nrofPDCCH_Candidates = configuration->Common_dci_Format2_3_nrofPDCCH_Candidates[CC_id];
|
||||
#endif
|
||||
}else if (bwp_dl_searchspace->searchSpaceType->present == NR_SearchSpace__searchSpaceType_PR_ue_Specific){
|
||||
bwp_dl_searchspace->searchSpaceType->choice.ue_Specific->dci_Formats = configuration->ue_Specific__dci_Formats[CC_id];
|
||||
}
|
||||
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpaceList->list,&bwp_dl_searchspace);
|
||||
#else
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->commonSearchSpace->list,&bwp_dl_searchspace);
|
||||
#endif
|
||||
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceSIB1) = configuration->searchSpaceSIB1[CC_id];
|
||||
*((*servingcellconfigcommon)->downlinkConfigCommon->initialDownlinkBWP->pdcch_ConfigCommon->choice.setup->searchSpaceOtherSystemInformation) = configuration->searchSpaceOtherSystemInformation[CC_id];
|
||||
@@ -675,7 +698,11 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig = configuration->restrictedSetConfig[CC_id];
|
||||
|
||||
if(configuration->msg3_transformPrecoding[CC_id]){
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder) = NR_RACH_ConfigCommon__msg3_transformPrecoder_enabled;
|
||||
#else
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoding) = NR_RACH_ConfigCommon__msg3_transformPrecoding_enabled;
|
||||
#endif
|
||||
}
|
||||
|
||||
//Fill initialUplinkBWP -> BWP-UplinkCommon -> rach_ConfigCommon -> rach_ConfigGeneric//
|
||||
@@ -710,8 +737,11 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal) = configuration->p0_nominal[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_ResourceCommon) = configuration->pucch_ResourceCommon[CC_id];
|
||||
*((*servingcellconfigcommon)->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId) = configuration->hoppingId[CC_id];
|
||||
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->dummy = configuration->UL_timeAlignmentTimerCommon[CC_id];
|
||||
#else
|
||||
(*servingcellconfigcommon)->uplinkConfigCommon->timeAlignmentTimerCommon = configuration->UL_timeAlignmentTimerCommon[CC_id];
|
||||
#endif
|
||||
|
||||
(*servingcellconfigcommon)->n_TimingAdvanceOffset = CALLOC(1,sizeof(long));
|
||||
*((*servingcellconfigcommon)->n_TimingAdvanceOffset)=configuration->ServingCellConfigCommon_n_TimingAdvanceOffset[CC_id];
|
||||
@@ -820,7 +850,11 @@ void do_SERVINGCELLCONFIGCOMMON(uint8_t Mod_id,
|
||||
}
|
||||
|
||||
*(ratematchpattern->subcarrierSpacing) = configuration->RateMatchPattern_subcarrierSpacing[CC_id];
|
||||
ratematchpattern->mode = configuration->RateMatchPattern_mode[CC_id];
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
ratematchpattern->dummy = configuration->RateMatchPattern_mode[CC_id];
|
||||
#else
|
||||
ratematchpattern->mode = configuration->RateMatchPattern_mode[CC_id];
|
||||
#endif
|
||||
|
||||
ASN_SEQUENCE_ADD(&(*servingcellconfigcommon)->rateMatchPatternToAddModList->list,&ratematchpattern);
|
||||
|
||||
@@ -1049,7 +1083,11 @@ void do_MAC_CELLGROUP(uint8_t Mod_id,
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_ProhibitTimer = mac_cellgroup_config->phr_ProhibitTimer[CC_id];
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_Tx_PowerFactorChange = mac_cellgroup_config->phr_Tx_PowerFactorChange[CC_id];
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->multiplePHR = mac_cellgroup_config->multiplePHR[CC_id];
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->dummy = mac_cellgroup_config->phr_Type2SpCell[CC_id];
|
||||
#else
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_Type2SpCell = mac_cellgroup_config->phr_Type2SpCell[CC_id];
|
||||
#endif
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_Type2OtherCell = mac_cellgroup_config->phr_Type2OtherCell[CC_id];
|
||||
mac_CellGroupConfig->phr_Config->choice.setup->phr_ModeOtherCG = mac_cellgroup_config->phr_ModeOtherCG[CC_id];
|
||||
|
||||
@@ -1064,7 +1102,11 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id,
|
||||
|
||||
physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH = CALLOC(1,sizeof(long));
|
||||
physicalCellGroupConfig->harq_ACK_SpatialBundlingPUSCH = CALLOC(1,sizeof(long));
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
physicalCellGroupConfig->p_NR_FR1 = CALLOC(1,sizeof(NR_P_Max_t));
|
||||
#else
|
||||
physicalCellGroupConfig->p_NR = CALLOC(1,sizeof(NR_P_Max_t));
|
||||
#endif
|
||||
physicalCellGroupConfig->tpc_SRS_RNTI = CALLOC(1,sizeof(NR_RNTI_Value_t));
|
||||
physicalCellGroupConfig->tpc_PUCCH_RNTI = CALLOC(1,sizeof(NR_RNTI_Value_t));
|
||||
physicalCellGroupConfig->tpc_PUSCH_RNTI = CALLOC(1,sizeof(NR_RNTI_Value_t));
|
||||
@@ -1072,7 +1114,11 @@ void do_PHYSICALCELLGROUP(uint8_t Mod_id,
|
||||
|
||||
*(physicalCellGroupConfig->harq_ACK_SpatialBundlingPUCCH) = physicalcellgroup_config->harq_ACK_SpatialBundlingPUCCH[CC_id];
|
||||
*(physicalCellGroupConfig->harq_ACK_SpatialBundlingPUSCH) = physicalcellgroup_config->harq_ACK_SpatialBundlingPUSCH[CC_id];
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
*(physicalCellGroupConfig->p_NR_FR1) = physicalcellgroup_config->p_NR[CC_id];
|
||||
#else
|
||||
*(physicalCellGroupConfig->p_NR) = physicalcellgroup_config->p_NR[CC_id];
|
||||
#endif
|
||||
physicalCellGroupConfig->pdsch_HARQ_ACK_Codebook = physicalcellgroup_config->pdsch_HARQ_ACK_Codebook[CC_id];
|
||||
*(physicalCellGroupConfig->tpc_SRS_RNTI) = physicalcellgroup_config->tpc_SRS_RNTI[CC_id];
|
||||
*(physicalCellGroupConfig->tpc_PUCCH_RNTI) = physicalcellgroup_config->tpc_PUCCH_RNTI[CC_id];
|
||||
@@ -1119,4 +1165,4 @@ void do_SpCellConfig(uint8_t Mod_id,
|
||||
RC.nrrrc[Mod_id]->carrier[0].servingcellconfigcommon,
|
||||
sizeof(struct NR_ServingCellConfigCommon));
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file nr_rrc_defs.h
|
||||
/*! \file RRC/NR/nr_rrc_defs.h
|
||||
* \brief NR RRC struct definitions and function prototypes
|
||||
* \author Navid Nikaein, Raymond Knopp, WEI-TAI CHEN
|
||||
* \date 2010 - 2014, 2018
|
||||
|
||||
@@ -385,6 +385,16 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(
|
||||
break;
|
||||
|
||||
case NR_DL_DCCH_MessageType__c1_PR_NOTHING:
|
||||
#if (NR_RRC_VERSION >= MAKE_VERSION(15, 3, 0))
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcResume:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcRelease:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_rrcReestablishment:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_securityModeCommand:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_dlInformationTransfer:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_ueCapabilityEnquiry:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_counterCheck:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_mobilityFromNRCommand:
|
||||
#else
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare15:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare14:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare13:
|
||||
@@ -393,6 +403,7 @@ int8_t nr_rrc_ue_decode_NR_DL_DCCH_Message(
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare10:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare9:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare8:
|
||||
#endif
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare7:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare6:
|
||||
case NR_DL_DCCH_MessageType__c1_PR_spare5:
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -52,10 +52,11 @@ gNBs =
|
||||
DL_FreqBandIndicatorNR = 15;
|
||||
DL_absoluteFrequencyPointA = 15;
|
||||
DL_offsetToCarrier = 15;
|
||||
DL_SCS_SubcarrierSpacing = "kHz15";
|
||||
DL_SCS_SubcarrierSpacing = "kHz30";
|
||||
DL_SCS_SpecificCarrier_k0 = 0;
|
||||
DL_carrierBandwidth = 15;
|
||||
DL_locationAndBandwidth = 15;
|
||||
DL_BWP_SubcarrierSpacing = "kHz15";
|
||||
DL_BWP_SubcarrierSpacing = "kHz30";
|
||||
DL_BWP_prefix_type = "NORMAL";
|
||||
UL_FreqBandIndicatorNR = 15;
|
||||
UL_absoluteFrequencyPointA = 13;
|
||||
@@ -63,10 +64,11 @@ gNBs =
|
||||
UL_p_Max = -1;
|
||||
UL_frequencyShift7p5khz = "TRUE";
|
||||
UL_offsetToCarrier = 10;
|
||||
UL_SCS_SubcarrierSpacing = "kHz15";
|
||||
UL_SCS_SubcarrierSpacing = "kHz30";
|
||||
UL_SCS_SpecificCarrier_k0 = 0;
|
||||
UL_carrierBandwidth = 15;
|
||||
UL_locationAndBandwidth = 15;
|
||||
UL_BWP_SubcarrierSpacing = "kHz15";
|
||||
UL_BWP_SubcarrierSpacing = "kHz30";
|
||||
UL_BWP_prefix_type = "NORMAL";
|
||||
UL_timeAlignmentTimerCommon = "infinity";
|
||||
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
|
||||
@@ -101,7 +103,7 @@ gNBs =
|
||||
prach_RootSequenceIndex_choice = "l839";
|
||||
prach_RootSequenceIndex_l839 = 0;
|
||||
prach_RootSequenceIndex_l139 = 0;
|
||||
prach_msg1_SubcarrierSpacing = "kHz15";
|
||||
prach_msg1_SubcarrierSpacing = "kHz30";
|
||||
restrictedSetConfig = "unrestrictedSet";
|
||||
msg3_transformPrecoding = "ENABLE";
|
||||
prach_ConfigurationIndex = 10;
|
||||
@@ -130,7 +132,7 @@ gNBs =
|
||||
symbolsInResourceBlock = "oneSlot";
|
||||
periodicityAndPattern = 2;
|
||||
RateMatchPattern_controlResourceSet = 5;
|
||||
RateMatchPattern_subcarrierSpacing = "kHz15";
|
||||
RateMatchPattern_subcarrierSpacing = "kHz30";
|
||||
RateMatchPattern_mode = "dynamic";
|
||||
controlResourceSetZero = 0;
|
||||
searchSpaceZero = 0;
|
||||
|
||||
@@ -207,7 +207,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc, char *thread_nam
|
||||
// ****************************************
|
||||
// Common RX procedures subframe n
|
||||
|
||||
T(T_GNB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
|
||||
T(T_ENB_PHY_DL_TICK, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(proc->subframe_tx));
|
||||
|
||||
// if this is IF5 or 3GPP_eNB
|
||||
if (eNB && eNB->RU_list && eNB->RU_list[0] && eNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
|
||||
|
||||
@@ -1525,9 +1525,10 @@ volatile int16_t phy_tx_end;
|
||||
static void* ru_thread_tx( void* param ) {
|
||||
RU_t *ru = (RU_t*)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
char filename[256];
|
||||
|
||||
thread_top_init("ru_thread_tx",1,400000,500000,500000);
|
||||
|
||||
@@ -1560,7 +1561,20 @@ static void* ru_thread_tx( void* param ) {
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru);
|
||||
|
||||
if (ru->fh_north_out) ru->fh_north_out(ru);
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<ru->nb_tx; i++) {
|
||||
if(proc->frame_tx == 2) {
|
||||
sprintf(filename,"txdataF%d_frame%d_sf%d.m",i,proc->frame_tx,proc->subframe_tx);
|
||||
LOG_M(filename,"txdataF_frame",ru->common.txdataF_BF[i],fp->symbols_per_tti*fp->ofdm_symbol_size, 1, 1);
|
||||
}
|
||||
if(proc->frame_tx == 2 && proc->subframe_tx==0){
|
||||
sprintf(filename,"txdata%d_frame%d.m",i,proc->frame_tx);
|
||||
LOG_M(filename,"txdata_frame",ru->common.txdata[i],fp->samples_per_tti*10, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
release_thread(&proc->mutex_eNBs,&proc->instance_cnt_eNBs,"ru_thread_tx");
|
||||
|
||||
pthread_mutex_lock( &proc->mutex_eNBs );
|
||||
@@ -1588,7 +1602,7 @@ static void* ru_thread( void* param ) {
|
||||
int frame =1023;
|
||||
cpu_set_t cpuset;
|
||||
CPU_ZERO(&cpuset);
|
||||
|
||||
char filename[256];
|
||||
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
@@ -1794,6 +1808,19 @@ static void* ru_thread( void* param ) {
|
||||
|
||||
if (ru->fh_north_out) ru->fh_north_out(ru);
|
||||
}
|
||||
else {
|
||||
for (int i=0; i<ru->nb_tx; i++) {
|
||||
if(proc->frame_tx == 2) {
|
||||
sprintf(filename,"txdataF%d_frame%d_sf%d.m",i,proc->frame_tx,proc->subframe_tx);
|
||||
LOG_M(filename,"txdataF_frame",ru->common.txdataF_BF[i],fp->symbols_per_tti*fp->ofdm_symbol_size, 1, 1);
|
||||
}
|
||||
if(proc->frame_tx == 2 && proc->subframe_tx==0){
|
||||
sprintf(filename,"txdata%d_frame%d.m",i,proc->frame_tx);
|
||||
LOG_M(filename,"txdata_frame",ru->common.txdata[i],fp->samples_per_tti*10, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc->emulate_rf_busy = 0;
|
||||
}
|
||||
#else
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user