Merge branch 'NR_RRC_harq' of remote into NR_RRC_harq
This commit is contained in:
@@ -186,7 +186,7 @@ function variant__v3__phy_sim {
|
||||
BUILD_OPTIONS="--phy_simulators"
|
||||
VM_MEMORY=8192
|
||||
VM_DISK=20
|
||||
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510* 015111\" -q -np -b"
|
||||
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510* 015111 015112\" -q -np -b"
|
||||
}
|
||||
|
||||
function variant__v4__cppcheck {
|
||||
|
||||
@@ -1624,7 +1624,7 @@ add_library(PHY_MEX ${PHY_MEX_UE} ${CONFIG_LIB})
|
||||
#Layer 2 library
|
||||
#####################
|
||||
set(MAC_DIR ${OPENAIR2_DIR}/LAYER2/MAC)
|
||||
set(NR_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB)
|
||||
set(NR_GNB_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB)
|
||||
set(NR_UE_MAC_DIR ${OPENAIR2_DIR}/LAYER2/NR_MAC_UE)
|
||||
set(PHY_INTERFACE_DIR ${OPENAIR2_DIR}/PHY_INTERFACE)
|
||||
set(NR_PHY_INTERFACE_DIR ${OPENAIR2_DIR}/NR_PHY_INTERFACE)
|
||||
@@ -1775,14 +1775,15 @@ set (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_dlsch.c
|
||||
${NR_MAC_DIR}/gNB_scheduler_ulsch.c
|
||||
${NR_MAC_DIR}/gNB_scheduler_primitives.c
|
||||
${NR_MAC_DIR}/gNB_scheduler_phytest.c
|
||||
${NR_GNB_MAC_DIR}/main.c
|
||||
${NR_GNB_MAC_DIR}/config.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler_bch.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler_dlsch.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler_ulsch.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler_primitives.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler_phytest.c
|
||||
${NR_GNB_MAC_DIR}/gNB_scheduler_RA.c
|
||||
)
|
||||
|
||||
|
||||
@@ -1794,7 +1795,6 @@ set (MAC_SRC_UE
|
||||
${MAC_DIR}/l1_helpers.c
|
||||
${MAC_DIR}/rar_tools_ue.c
|
||||
${MAC_DIR}/config_ue.c
|
||||
|
||||
)
|
||||
|
||||
set (MAC_NR_SRC_UE
|
||||
@@ -1804,6 +1804,9 @@ set (MAC_NR_SRC_UE
|
||||
${NR_UE_MAC_DIR}/main_ue_nr.c
|
||||
${NR_UE_MAC_DIR}/nr_ue_procedures.c
|
||||
${NR_UE_MAC_DIR}/nr_ue_dci_configuration.c
|
||||
${NR_UE_MAC_DIR}/nr_l1_helpers.c
|
||||
${NR_UE_MAC_DIR}/nr_ra_procedures.c
|
||||
${NR_UE_MAC_DIR}/rar_tools_nrUE.c
|
||||
)
|
||||
|
||||
set (ENB_APP_SRC
|
||||
@@ -1867,7 +1870,7 @@ add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
|
||||
add_library( MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB/nr_compute_tbs_common.c)
|
||||
|
||||
include_directories("${OPENAIR2_DIR}/NR_UE_PHY_INTERFACE")
|
||||
include_directories("${OPENAIR2_DIR}/LAYER2/NR_MAC_UE")
|
||||
include_directories("${OPENAIR2_DIR}/LAYER2")
|
||||
include_directories("${OPENAIR1_DIR}/SCHED_NR_UE")
|
||||
#include_directories("${NFAPI_USER_DIR}"")
|
||||
|
||||
@@ -1895,6 +1898,19 @@ set (GTPV1U_SRC
|
||||
add_library(GTPV1U ${GTPV1U_SRC})
|
||||
add_dependencies(GTPV1U rrc_flag)
|
||||
|
||||
#NR case
|
||||
set (NR_GTPV1U_SRC
|
||||
${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
|
||||
${RRC_DIR}/rrc_eNB_GTPV1U.c
|
||||
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTunnelEndPoint.c
|
||||
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uTrxn.c
|
||||
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1uMsg.c
|
||||
${GTPV1U_DIR}/nw-gtpv1u/src/NwGtpv1u.c
|
||||
${GTPV1U_DIR}/gtpv1u_teid_pool.c
|
||||
)
|
||||
add_library(NR_GTPV1U ${NR_GTPV1U_SRC})
|
||||
add_dependencies(NR_GTPV1U rrc_flag)
|
||||
|
||||
set (MME_APP_SRC
|
||||
${OPENAIR3_DIR}/MME_APP/mme_app.c
|
||||
${OPENAIR3_DIR}/MME_APP/mme_config.c
|
||||
@@ -2605,6 +2621,7 @@ add_executable(nr-softmodem
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR3_DIR}/GTPV1-U/gtpv1u_gNB.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
@@ -2618,7 +2635,7 @@ 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_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA
|
||||
${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 MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
@@ -2662,9 +2679,9 @@ add_executable(nr-uesoftmodem
|
||||
target_link_libraries (nr-uesoftmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB NR_RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS L2_UE NR_L2_UE MAC_NR_COMMON S1AP_LIB S1AP_ENB
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -2821,7 +2838,7 @@ add_executable(nr_prachsim
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES})
|
||||
target_link_libraries(nr_prachsim
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB RRC_LIB NR_RRC_LIB L2_NR CONFIG_LIB -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
-Wl,--start-group UTIL SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB MAC_UE_NR SCHED_NR_UE_LIB RRC_LIB NR_RRC_LIB L2_NR CONFIG_LIB -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
|
||||
add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
|
||||
@@ -142,10 +142,14 @@ Obj.# Case# Test# Description
|
||||
(Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%))
|
||||
(TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)),
|
||||
(TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)),
|
||||
01 51 11 nr_ulsim Test cases. (Test1: MCS 9),
|
||||
(Test2: MCS 16),
|
||||
(Test3: MCS 28)
|
||||
|
||||
01 51 11 nr_ulsim Test cases. (Test1: MCS 9 106 PRBs),
|
||||
(Test2: MCS 16 50 PRBs),
|
||||
(Test3: MCS 28 50 PRBs),
|
||||
(Test4: MCS 9 217 PRBs),
|
||||
(Test5: MCS 9 273 PRBs)
|
||||
01 51 12 nr_prachsim Test cases.(Test1: 106 PRBs),
|
||||
(Test2: 217 PRBs),
|
||||
(Test3: 273 PRBs)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1104,9 +1104,8 @@
|
||||
-n100 -R217 -a80 -s5
|
||||
-n100 -R217 -a110 -s5 -b100
|
||||
-n100 -e27 -s30
|
||||
-n100 -e16 -s10
|
||||
</main_exec_args>
|
||||
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 </tags>
|
||||
-n100 -e16 -s10</main_exec_args>
|
||||
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10</tags>
|
||||
<search_expr_true>PDSCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
@@ -1245,17 +1244,37 @@
|
||||
<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/nr_ulsim.Rel15</main_exec>
|
||||
<main_exec_args>-n100 -m9 -r106 -s0
|
||||
<main_exec_args>-n100 -m9 -r106 -s5
|
||||
-n100 -m16 -s10
|
||||
-n100 -m28 -s20
|
||||
-n100 -m9 -R217 -r217 -s0
|
||||
-n100 -m9 -R273 -r273 -s0</main_exec_args>
|
||||
-n100 -m9 -R217 -r217 -s5
|
||||
-n100 -m9 -R273 -r273 -s5</main_exec_args>
|
||||
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5</tags>
|
||||
<search_expr_true>PUSCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
</testCase>
|
||||
|
||||
<testCase id="015112">
|
||||
<class>execution</class>
|
||||
<desc>nr_prachsim Test cases. (Test1: 106 PRBs),
|
||||
(Test2: 217 PRBs),
|
||||
(Test3: 273 PRBs)</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/nr_prachsim.Rel15</main_exec>
|
||||
<main_exec_args>-a -s -30 -n 100 -p 16 -R 106
|
||||
-a -s -30 -n 100 -p 16 -R 217
|
||||
-a -s -30 -n 100 -p 16 -R 273</main_exec_args>
|
||||
<tags>nr_prachsim.test1 nr_prachsim.test2 nr_prachsim.test3</tags>
|
||||
<search_expr_true>PRACH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
</testCase>
|
||||
|
||||
<testCase id="015500" >
|
||||
<class>lte-softmodem</class>
|
||||
<desc></desc>
|
||||
|
||||
@@ -52,6 +52,7 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB) {
|
||||
else return(N_RB-1-tmp2);
|
||||
}
|
||||
|
||||
/* TS 38.214 ch. 6.1.2.2.2 - Resource allocation type 1 for DL and UL */
|
||||
int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize) {
|
||||
AssertFatal(NPRB>0 && (NPRB + RBstart <= BWPsize),"Illegal NPRB/RBstart Configuration (%d,%d) for BWPsize %d\n",NPRB,RBstart,BWPsize);
|
||||
|
||||
@@ -62,14 +63,21 @@ int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize) {
|
||||
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart) {
|
||||
return(PRBalloc_to_locationandbandwidth0(NPRB,RBstart,275));
|
||||
}
|
||||
|
||||
/// Target code rate tables indexed by Imcs
|
||||
/* TS 38.214 table 5.1.3.1-1 - MCS index table 1 for PDSCH */
|
||||
uint16_t nr_target_code_rate_table1[29] = {120, 157, 193, 251, 308, 379, 449, 526, 602, 679, 340, 378, 434, 490, 553, \
|
||||
616, 658, 438, 466, 517, 567, 616, 666, 719, 772, 822, 873, 910, 948};
|
||||
// Imcs values 20 and 26 have been multiplied by 2 to avoid the floating point
|
||||
|
||||
/* TS 38.214 table 5.1.3.1-2 - MCS index table 2 for PDSCH */
|
||||
// Imcs values 20 and 26 have been multiplied by 2 to avoid the floating point
|
||||
uint16_t nr_target_code_rate_table2[28] = {120, 193, 308, 449, 602, 378, 434, 490, 553, 616, 658, 466, 517, 567, \
|
||||
616, 666, 719, 772, 822, 873, 1365, 711, 754, 797, 841, 885, 1833, 948};
|
||||
|
||||
/* TS 38.214 table 5.1.3.1-3 - MCS index table 3 for PDSCH */
|
||||
uint16_t nr_target_code_rate_table3[29] = {30, 40, 50, 64, 78, 99, 120, 157, 193, 251, 308, 379, 449, 526, 602, 340, \
|
||||
378, 434, 490, 553, 616, 438, 466, 517, 567, 616, 666, 719, 772};
|
||||
|
||||
uint16_t nr_tbs_table[93] = {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, \
|
||||
|
||||
@@ -237,6 +237,7 @@ typedef struct IttiMsgText_s {
|
||||
//#include <proto.h>
|
||||
|
||||
#include <openair3/GTPV1-U/gtpv1u_eNB_task.h>
|
||||
#include <openair3/GTPV1-U/gtpv1u_gNB_task.h>
|
||||
void *rrc_enb_process_itti_msg(void *);
|
||||
#include <openair3/SCTP/sctp_eNB_task.h>
|
||||
#include <openair3/S1AP/s1ap_eNB.h>
|
||||
|
||||
@@ -56,9 +56,48 @@ oai supports [number of deployment](FEATURE_SET.md) model, the following are tes
|
||||
1. [Monolithic eNodeB](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/HowToConnectCOTSUEwithOAIeNBNew) where the whole signal processing is performed in a single process
|
||||
2. if4p5 mode, where frequency domain samples are carried over ethernet, from the RRU which implement part of L1(FFT,IFFT,part of PRACH), to a RAU
|
||||
|
||||
# 5G NR
|
||||
|
||||
As of February 2020, all 5G NR development is part of the develop branch (the branch develop-nr is no longer maintained). This also means that all new development will be merged into there once it passes all the CI.
|
||||
|
||||
## NSA setup with COTS UE
|
||||
|
||||
This setup requires an EPC, an OAI eNB and gNB, and a COTS Phone. A dedicated page describe the setup can be found [here](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home/gNB-COTS-UE-testing).
|
||||
|
||||
### Launch gNB
|
||||
|
||||
```bash sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf```
|
||||
|
||||
### Launch eNB
|
||||
|
||||
```bash sudo ./lte-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.tm1.50PRB.usrpb210.conf
|
||||
|
||||
|
||||
|
||||
## phy-test setup with OAI UE
|
||||
|
||||
The OAI UE can also be used in front of a OAI gNB without the support of eNB or EPC. In this case both gNB and eNB need to be run with the --phy-test flag. At the gNB this flag does the following
|
||||
- it reads the RRC configuration from the configuration file
|
||||
- it encodes the RRCConfiguration and the RBconfig message and stores them in the binary files rbconfig.raw and reconfig.raw
|
||||
- the MAC uses a pre-configured allocation of PDSCH and PUSCH with randomly generated payload
|
||||
|
||||
At the UE the --phy-test flag will
|
||||
- read the binary files rbconfig.raw and reconfig.raw from the current directory (a different directory can be specified with the flag --rrc_config_path) and process them.
|
||||
|
||||
|
||||
### Launch gNB
|
||||
|
||||
```bash sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test```
|
||||
|
||||
### Launch UE in another window
|
||||
|
||||
```bash sudo ./nr-uesoftmodem --phy-test [--rrc_config_path ../../../ci-scripts/rrc-files]```
|
||||
|
||||
## noS1 setup with OAI UE
|
||||
|
||||
Instead of randomly generated payload, in the phy-test mode we can also inject/receive user-plane traffic over a TUN interface. This is the so-called noS1 mode.
|
||||
|
||||
This setup is described in the [rfsimulator page](../targets/ARCH/rfsimulator/README.md#5g-case). In theory this should also work with the real hardware target although this has yet to be tested.
|
||||
|
||||
|
||||
|
||||
|
||||
+12
-5
@@ -47,7 +47,7 @@
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
@@ -164,14 +164,14 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
if (gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus||
|
||||
gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs ||
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs ||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles ||
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus ||
|
||||
gNB->UL_INFO.cqi_ind.number_of_cqis
|
||||
) {
|
||||
LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d preambles:%05d:%d cqis:%d] RX:%04d%d TX:%04d%d \n",
|
||||
LOG_D(PHY, "UL_info[rx_ind:%05d:%d harqs:%05d:%d crcs:%05d:%d rach_pdus:%0d.%d:%d cqis:%d] RX:%04d%d TX:%04d%d \n",
|
||||
NFAPI_SFNSF2DEC(gNB->UL_INFO.rx_ind.sfn_sf), gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus,
|
||||
NFAPI_SFNSF2DEC(gNB->UL_INFO.harq_ind.sfn_sf), gNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs,
|
||||
NFAPI_SFNSF2DEC(gNB->UL_INFO.crc_ind.sfn_sf), gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs,
|
||||
NFAPI_SFNSF2DEC(gNB->UL_INFO.rach_ind.sfn_sf), gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles,
|
||||
gNB->UL_INFO.rach_ind.sfn, gNB->UL_INFO.rach_ind.slot,gNB->UL_INFO.rach_ind.number_of_pdus,
|
||||
gNB->UL_INFO.cqi_ind.number_of_cqis,
|
||||
frame_rx, slot_rx,
|
||||
frame_tx, slot_tx);
|
||||
@@ -204,6 +204,13 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
|
||||
// UE-specific RX processing for subframe n
|
||||
// TODO: check if this is correct for PARALLEL_RU_L1_TRX_SPLIT
|
||||
|
||||
// Do PRACH RU processing
|
||||
int prach_id=find_nr_prach(gNB,frame_rx,slot_rx,0,SEARCH_EXIST);
|
||||
if (prach_id>=0) {
|
||||
L1_nr_prach_procedures(gNB,frame_rx,slot_rx,&gNB->prach_vars.list[prach_id].pdu);
|
||||
gNB->prach_vars.list[prach_id].frame=-1;
|
||||
}
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
|
||||
}
|
||||
|
||||
|
||||
+85
-30
@@ -68,12 +68,13 @@
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
@@ -308,7 +309,7 @@ void fh_if5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
// southbound IF4p5 fronthaul
|
||||
void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp)
|
||||
{
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
|
||||
|
||||
LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.tti_tx);
|
||||
@@ -519,7 +520,7 @@ void fh_if5_north_asynch_in(RU_t *ru,int *frame,int *slot) {
|
||||
|
||||
void fh_if4p5_north_asynch_in(RU_t *ru,int *frame,int *slot) {
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
uint16_t packet_type;
|
||||
uint32_t symbol_number,symbol_mask,symbol_mask_full=0;
|
||||
@@ -716,7 +717,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
void *txp[ru->nb_tx];
|
||||
unsigned int txs;
|
||||
int i,txsymb;
|
||||
@@ -808,7 +809,7 @@ void *ru_thread_asynch_rxtx( void *param ) {
|
||||
static int ru_thread_asynch_rxtx_status;
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
int slot=0, frame=0;
|
||||
// wait for top-level synchronization and do one acquisition to get timestamp for setting frame/subframe
|
||||
wait_sync("ru_thread_asynch_rxtx");
|
||||
@@ -1053,10 +1054,10 @@ int wakeup_prach_ru(RU_t *ru) {
|
||||
void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
int i;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &ru->gNB_list[0]->gNB_config; //tmp index
|
||||
nfapi_nr_config_request_scf_t *config = &ru->config; //tmp index
|
||||
openair0_config_t *cfg = &ru->openair0_cfg;
|
||||
int mu = gNB_config->ssb_config.scs_common.value;
|
||||
int N_RB = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value;
|
||||
int mu = config->ssb_config.scs_common.value;
|
||||
int N_RB = config->carrier_config.dl_grid_size[config->ssb_config.scs_common.value].value;
|
||||
|
||||
if (mu == NR_MU_0) { //or if LTE
|
||||
if(N_RB == 100) {
|
||||
@@ -1141,7 +1142,7 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
AssertFatal(0 == 1,"Numerology %d not supported for the moment\n",mu);
|
||||
}
|
||||
|
||||
if (gNB_config->cell_config.frame_duplex_type.value==TDD)
|
||||
if (config->cell_config.frame_duplex_type.value==TDD)
|
||||
cfg->duplex_mode = duplex_mode_TDD;
|
||||
else //FDD
|
||||
cfg->duplex_mode = duplex_mode_FDD;
|
||||
@@ -1180,7 +1181,7 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
int card,ant;
|
||||
//uint16_t N_TA_offset = 0;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
//nfapi_nr_config_request_t *gNB_config = ru->gNB_list[0]->gNB_config; //tmp index
|
||||
nfapi_nr_config_request_scf_t *config = &ru->config;
|
||||
|
||||
if (ru) {
|
||||
frame_parms = ru->nr_frame_parms;
|
||||
@@ -1189,12 +1190,54 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
printf("ru pointer is NULL\n");
|
||||
return(-1);
|
||||
}
|
||||
int mu = config->ssb_config.scs_common.value;
|
||||
int N_RB = config->carrier_config.dl_grid_size[config->ssb_config.scs_common.value].value;
|
||||
|
||||
/* if (frame_parms->frame_type == TDD) {
|
||||
if (frame_parms->N_RB_DL == 100) ru->N_TA_offset = 624;
|
||||
else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2;
|
||||
else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4;
|
||||
} */
|
||||
|
||||
if (config->cell_config.frame_duplex_type.value == TDD) {
|
||||
int N_TA_offset = config->carrier_config.uplink_frequency.value < 6000000 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
|
||||
double factor=1;
|
||||
|
||||
switch (mu) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400,"scs_common 15kHz only for FR1\n");
|
||||
if (N_RB <= 25) factor = .25; // 7.68 Ms/s
|
||||
else if (N_RB <=50) factor = .5; // 15.36 Ms/s
|
||||
else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s
|
||||
else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s
|
||||
else AssertFatal(1==0,"Too many PRBS for mu=0\n");
|
||||
break;
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400,"scs_common 30kHz only for FR1\n");
|
||||
if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s
|
||||
break;
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431,"scs_common 120kHz only for FR2\n");
|
||||
break;
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s
|
||||
else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB);
|
||||
break;
|
||||
|
||||
if (N_RB == 100) ru->N_TA_offset = 624;
|
||||
else if (N_RB == 50) ru->N_TA_offset = 624/2;
|
||||
else if (N_RB == 25) ru->N_TA_offset = 624/4;
|
||||
}
|
||||
if (frame_parms->threequarter_fs == 1) factor = factor*.75;
|
||||
ru->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
LOG_I(PHY,"RU %d Setting N_TA_offset to %d samples (factor %f, UL Freq %d, N_RB %d)\n",ru->idx,ru->N_TA_offset,factor,
|
||||
config->carrier_config.uplink_frequency.value, N_RB);
|
||||
}
|
||||
else ru->N_TA_offset = 0;
|
||||
|
||||
|
||||
if (ru->openair0_cfg.mmapped_dma == 1) {
|
||||
// replace RX signal buffers with mmaped HW versions
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
@@ -1407,7 +1450,7 @@ void *ru_thread( void *param ) {
|
||||
int i = 0;
|
||||
int aa;
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
|
||||
// set default return value
|
||||
ru_thread_status = 0;
|
||||
@@ -1419,7 +1462,7 @@ void *ru_thread( void *param ) {
|
||||
|
||||
if(emulate_rf) {
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_init_frame_parms(&ru->gNB_list[0]->gNB_config, fp);
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
nr_phy_init_RU(ru);
|
||||
|
||||
@@ -1439,8 +1482,10 @@ void *ru_thread( void *param ) {
|
||||
AssertFatal(ret==0,"Cannot connect to remote radio\n");
|
||||
}
|
||||
|
||||
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
|
||||
|
||||
if (ru->if_south == LOCAL_RF) { // configure RF parameters only
|
||||
nr_init_frame_parms(&ru->gNB_list[0]->gNB_config, fp);
|
||||
nr_init_frame_parms(&ru->config, fp);
|
||||
nr_dump_frame_parms(fp);
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_phy_init_RU(ru);
|
||||
@@ -1541,6 +1586,17 @@ void *ru_thread( void *param ) {
|
||||
for (aa=0;aa<ru->nb_rx;aa++)
|
||||
memcpy((void*)RC.gNB[0]->common_vars.rxdataF[aa],
|
||||
(void*)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
|
||||
// Do PRACH RU processing
|
||||
int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST);
|
||||
if (prach_id>=0) {
|
||||
rx_nr_prach_ru(ru,
|
||||
ru->prach_list[prach_id].fmt,
|
||||
ru->prach_list[prach_id].numRA,
|
||||
ru->prach_list[prach_id].prachStartSymbol,
|
||||
proc->frame_rx,proc->tti_rx);
|
||||
free_nr_ru_prach_entry(ru,prach_id);
|
||||
}
|
||||
}
|
||||
|
||||
// At this point, all information for subframe has been received on FH interface
|
||||
@@ -1911,7 +1967,7 @@ void configure_ru(int idx,
|
||||
RU_t *ru = RC.ru[idx];
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RRU_capabilities_t *capabilities = (RRU_capabilities_t *)arg;
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
int ret;
|
||||
LOG_I(PHY, "Received capabilities from RRU %d\n",idx);
|
||||
|
||||
@@ -1934,15 +1990,15 @@ void configure_ru(int idx,
|
||||
//config->tdd_config_S[0] = ru->nr_frame_parms->tdd_config_S;
|
||||
config->att_tx[0] = ru->att_tx;
|
||||
config->att_rx[0] = ru->att_rx;
|
||||
config->N_RB_DL[0] = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value;
|
||||
config->N_RB_UL[0] = gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value;
|
||||
config->N_RB_DL[0] = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
config->N_RB_UL[0] = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
config->threequarter_fs[0] = ru->nr_frame_parms->threequarter_fs;
|
||||
/* if (ru->if_south==REMOTE_IF4p5) {
|
||||
config->prach_FreqOffset[0] = ru->nr_frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset;
|
||||
config->prach_ConfigIndex[0] = ru->nr_frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
LOG_I(PHY,"REMOTE_IF4p5: prach_FrequOffset %d, prach_ConfigIndex %d\n",
|
||||
config->prach_FreqOffset[0],config->prach_ConfigIndex[0]);*/
|
||||
nr_init_frame_parms(&ru->gNB_list[0]->gNB_config, ru->nr_frame_parms);
|
||||
nr_init_frame_parms(&ru->config, ru->nr_frame_parms);
|
||||
nr_phy_init_RU(ru);
|
||||
}
|
||||
|
||||
@@ -1950,23 +2006,23 @@ void configure_rru(int idx,
|
||||
void *arg) {
|
||||
RRU_config_t *config = (RRU_config_t *)arg;
|
||||
RU_t *ru = RC.ru[idx];
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &ru->gNB_list[0]->gNB_config;
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
ru->nr_frame_parms->nr_band = config->band_list[0];
|
||||
ru->nr_frame_parms->dl_CarrierFreq = config->tx_freq[0];
|
||||
ru->nr_frame_parms->ul_CarrierFreq = config->rx_freq[0];
|
||||
|
||||
if (ru->nr_frame_parms->dl_CarrierFreq == ru->nr_frame_parms->ul_CarrierFreq) {
|
||||
gNB_config->cell_config.frame_duplex_type.value = TDD;
|
||||
cfg->cell_config.frame_duplex_type.value = TDD;
|
||||
//ru->nr_frame_parms->tdd_config = config->tdd_config[0];
|
||||
//ru->nr_frame_parms->tdd_config_S = config->tdd_config_S[0];
|
||||
} else
|
||||
gNB_config->cell_config.frame_duplex_type.value = FDD;
|
||||
cfg->cell_config.frame_duplex_type.value = FDD;
|
||||
|
||||
ru->att_tx = config->att_tx[0];
|
||||
ru->att_rx = config->att_rx[0];
|
||||
int mu = gNB_config->ssb_config.scs_common.value;
|
||||
gNB_config->carrier_config.dl_grid_size[mu].value = config->N_RB_DL[0];
|
||||
gNB_config->carrier_config.dl_grid_size[mu].value = config->N_RB_UL[0];
|
||||
int mu = cfg->ssb_config.scs_common.value;
|
||||
cfg->carrier_config.dl_grid_size[mu].value = config->N_RB_DL[0];
|
||||
cfg->carrier_config.dl_grid_size[mu].value = config->N_RB_UL[0];
|
||||
ru->nr_frame_parms->threequarter_fs = config->threequarter_fs[0];
|
||||
|
||||
//ru->nr_frame_parms->pdsch_config_common.referenceSignalPower = ru->max_pdschReferenceSignalPower-config->att_tx[0];
|
||||
@@ -1981,7 +2037,7 @@ void configure_rru(int idx,
|
||||
}
|
||||
|
||||
fill_rf_config(ru,ru->rf_config_file);
|
||||
nr_init_frame_parms(&ru->gNB_list[0]->gNB_config, ru->nr_frame_parms);
|
||||
nr_init_frame_parms(&ru->config, ru->nr_frame_parms);
|
||||
nr_phy_init_RU(ru);
|
||||
}
|
||||
|
||||
@@ -2166,7 +2222,6 @@ void init_NR_RU(char *rf_config_file)
|
||||
PHY_VARS_gNB *gNB0= (PHY_VARS_gNB *)NULL;
|
||||
NR_DL_FRAME_PARMS *fp = (NR_DL_FRAME_PARMS *)NULL;
|
||||
int i;
|
||||
int CC_id;
|
||||
// create status mask
|
||||
RC.ru_mask = 0;
|
||||
pthread_mutex_init(&RC.ru_mutex,NULL);
|
||||
|
||||
@@ -57,6 +57,7 @@
|
||||
#define CONFIG_HLP_DLSHIFT "dynamic shift for LLR compuation for TM3/4 (default 0)\n"
|
||||
#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n"
|
||||
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
|
||||
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
|
||||
#define CONFIG_HLP_DMAMAP "sets flag for improved EXMIMO UE performance\n"
|
||||
#define CONFIG_HLP_EXCCLK "tells hardware to use a clock reference (0:internal(default), 1:external, 2:gpsdo)\n"
|
||||
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
|
||||
|
||||
+33
-25
@@ -176,6 +176,7 @@ extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
|
||||
extern void init_eNB_afterRU(void);
|
||||
extern void *udp_eNB_task(void *args_p);
|
||||
|
||||
int transmission_mode=1;
|
||||
int emulate_rf = 0;
|
||||
@@ -382,10 +383,10 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
|
||||
if (gnb_nb > 0) {
|
||||
/* Last task to create, others task must be ready before its start */
|
||||
if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
|
||||
/*if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
|
||||
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
|
||||
return -1;
|
||||
}
|
||||
}*/
|
||||
if(itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0){
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
return -1;
|
||||
@@ -400,35 +401,39 @@ int create_gNB_tasks(uint32_t gnb_nb) {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (EPC_MODE_ENABLED) {
|
||||
if (gnb_nb > 0) {
|
||||
if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
return -1;
|
||||
}
|
||||
if (EPC_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==0)) {
|
||||
if (gnb_nb > 0) {
|
||||
/*if (itti_create_task (TASK_SCTP, sctp_eNB_task, NULL) < 0) {
|
||||
LOG_E(SCTP, "Create task for SCTP failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (itti_create_task (TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
|
||||
LOG_E(S1AP, "Create task for S1AP failed\n");
|
||||
return -1;
|
||||
}
|
||||
if(!emulate_rf){
|
||||
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
|
||||
LOG_E(UDP_, "Create task for UDP failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (itti_create_task (TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
|
||||
LOG_E(S1AP, "Create task for S1AP failed\n");
|
||||
return -1;
|
||||
}*/
|
||||
|
||||
if (itti_create_task (TASK_GTPV1_U, >pv1u_eNB_task, NULL) < 0) {
|
||||
LOG_E(GTPU, "Create task for GTPV1U failed\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!emulate_rf){
|
||||
if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
|
||||
LOG_E(UDP_, "Create task for UDP failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (itti_create_task (TASK_GTPV1_U, >pv1u_gNB_task, NULL) < 0) {
|
||||
LOG_E(GTPU, "Create task for GTPV1U failed\n");
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
if (gnb_nb > 0) {
|
||||
if (itti_create_task (TASK_GNB_APP, gNB_app_task, NULL) < 0) {
|
||||
LOG_E(GNB_APP, "Create task for gNB APP failed\n");
|
||||
return -1;
|
||||
}
|
||||
LOG_I(NR_RRC,"Creating NR RRC gNB Task\n");
|
||||
|
||||
if (itti_create_task (TASK_RRC_GNB, rrc_gnb_task, NULL) < 0) {
|
||||
@@ -706,7 +711,6 @@ int stop_L1L2(module_id_t gnb_id) {
|
||||
*/
|
||||
int restart_L1L2(module_id_t gnb_id) {
|
||||
RU_t *ru = RC.ru[gnb_id];
|
||||
int cc_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
LOG_W(GNB_APP, "restarting nr-softmodem\n");
|
||||
/* block threads */
|
||||
@@ -822,6 +826,10 @@ int main( int argc, char **argv )
|
||||
}
|
||||
|
||||
openair0_cfg[0].threequarter_fs = threequarter_fs;
|
||||
EPC_MODE_ENABLED = !IS_SOFTMODEM_NOS1; //!get_softmodem_params()->phy_test;
|
||||
|
||||
if (get_softmodem_params()->do_ra)
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
|
||||
+41
-33
@@ -21,7 +21,7 @@
|
||||
#include "executables/thread-common.h"
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_UE/mac.h"
|
||||
#include "NR_MAC_UE/mac.h"
|
||||
//#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
|
||||
//#ifndef NO_RAT_NR
|
||||
@@ -142,15 +142,23 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
|
||||
uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
int nb_connected_gNB = 1, gNB_id;
|
||||
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
|
||||
ue->Mod_id = UE_id;
|
||||
ue->mac_enabled = 1;
|
||||
|
||||
// Setting UE mode to NOT_SYNCHED by default
|
||||
for (gNB_id = 0; gNB_id < nb_connected_gNB; gNB_id++){
|
||||
ue->UE_mode[gNB_id] = NOT_SYNCHED;
|
||||
ue->prach_resources[gNB_id] = (NR_PRACH_RESOURCES_t *)malloc16_clear(sizeof(NR_PRACH_RESOURCES_t));
|
||||
}
|
||||
|
||||
// initialize all signal buffers
|
||||
init_nr_ue_signal(ue,1,abstraction_flag);
|
||||
init_nr_ue_signal(ue, nb_connected_gNB, abstraction_flag);
|
||||
// intialize transport
|
||||
init_nr_ue_transport(ue,abstraction_flag);
|
||||
init_nr_ue_transport(ue, abstraction_flag);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -360,14 +368,17 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
uint32_t nb_rb, start_rb;
|
||||
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
|
||||
uint16_t n_rnti;
|
||||
module_id_t mod_id;
|
||||
|
||||
nr_dcireq_t dcireq;
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
|
||||
// program PUSCH. this should actually be done by the MAC upon reception of an UL DCI
|
||||
if (proc->nr_tti_tx == 8 || UE->frame_parms.frame_type == FDD){
|
||||
if (proc->nr_tti_tx == 8 || proc->nr_tti_tx == 19 || UE->frame_parms.frame_type == FDD){
|
||||
|
||||
dcireq.module_id = UE->Mod_id;
|
||||
mod_id = UE->Mod_id;
|
||||
|
||||
dcireq.module_id = mod_id;
|
||||
dcireq.gNB_index = 0;
|
||||
dcireq.cc_id = 0;
|
||||
dcireq.frame = proc->frame_rx;
|
||||
@@ -376,7 +387,7 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
scheduled_response.dl_config = NULL;
|
||||
scheduled_response.ul_config = &dcireq.ul_config_req;
|
||||
scheduled_response.tx_request = NULL;
|
||||
scheduled_response.module_id = UE->Mod_id;
|
||||
scheduled_response.module_id = mod_id;
|
||||
scheduled_response.CC_id = 0;
|
||||
scheduled_response.frame = proc->frame_rx;
|
||||
scheduled_response.slot = proc->nr_tti_rx;
|
||||
@@ -407,9 +418,9 @@ void processSlotTX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
|
||||
|
||||
nr_ue_scheduled_response(&scheduled_response);
|
||||
|
||||
|
||||
if (UE->mode != loop_through_memory) {
|
||||
uint8_t thread_id = PHY_vars_UE_g[UE->Mod_id][0]->current_thread_id[proc->nr_tti_tx];
|
||||
uint8_t thread_id = PHY_vars_UE_g[mod_id][0]->current_thread_id[proc->nr_tti_tx];
|
||||
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
|
||||
}
|
||||
}
|
||||
@@ -470,23 +481,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
pdcp_run(&ctxt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// no UL for now
|
||||
/*
|
||||
if (UE->mac_enabled==1) {
|
||||
// trigger L2 to run ue_scheduler thru IF module
|
||||
// [TODO] mapping right after NR initial sync
|
||||
if(UE->if_inst != NULL && UE->if_inst->ul_indication != NULL) {
|
||||
UE->ul_indication.module_id = 0;
|
||||
UE->ul_indication.gNB_index = 0;
|
||||
UE->ul_indication.cc_id = 0;
|
||||
UE->ul_indication.frame = proc->frame_rx;
|
||||
UE->ul_indication.slot = proc->nr_tti_rx;
|
||||
UE->if_inst->ul_indication(&UE->ul_indication);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -503,11 +497,15 @@ typedef struct processingData_s {
|
||||
} processingData_t;
|
||||
|
||||
void UE_processing(void *arg) {
|
||||
processingData_t *rxtxD=(processingData_t *) arg;
|
||||
processingData_t *rxtxD = (processingData_t *) arg;
|
||||
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
||||
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
||||
|
||||
uint8_t gNB_id = 0;
|
||||
uint8_t gNB_id = 0, CC_id = 0;
|
||||
module_id_t mod_id = 0;
|
||||
|
||||
nr_uplink_indication_t ul_indication;
|
||||
memset((void*)&ul_indication, 0, sizeof(ul_indication));
|
||||
|
||||
// params for UL time alignment procedure
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &UE->ul_time_alignment[gNB_id];
|
||||
@@ -534,6 +532,21 @@ void UE_processing(void *arg) {
|
||||
|
||||
processSlotRX(UE, proc);
|
||||
|
||||
if (UE->mac_enabled == 1) {
|
||||
// trigger L2 to run ue_scheduler thru IF module
|
||||
// [TODO] mapping right after NR initial sync
|
||||
if(UE->if_inst != NULL && UE->if_inst->ul_indication != NULL) {
|
||||
ul_indication.module_id = mod_id;
|
||||
ul_indication.gNB_index = gNB_id;
|
||||
ul_indication.cc_id = CC_id;
|
||||
ul_indication.frame_rx = proc->frame_rx;
|
||||
ul_indication.slot_rx = proc->nr_tti_rx;
|
||||
ul_indication.frame_tx = proc->frame_tx;
|
||||
ul_indication.slot_tx = proc->nr_tti_tx;
|
||||
UE->if_inst->ul_indication(&ul_indication);
|
||||
}
|
||||
}
|
||||
|
||||
processSlotTX(UE, proc);
|
||||
|
||||
}
|
||||
@@ -611,11 +624,6 @@ void syncInFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
|
||||
}
|
||||
|
||||
int computeSamplesShift(PHY_VARS_NR_UE *UE) {
|
||||
if (IS_SOFTMODEM_RFSIM) {
|
||||
LOG_E(PHY,"SET rx_offset %d \n",UE->rx_offset);
|
||||
//UE->rx_offset_diff=0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// compute TO compensation that should be applied for this frame
|
||||
if ( UE->rx_offset < UE->frame_parms.samples_per_frame/2 &&
|
||||
|
||||
@@ -72,8 +72,8 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "system.h"
|
||||
#include <openair2/RRC/NR_UE/rrc_proto.h>
|
||||
#include <openair2/LAYER2/NR_MAC_UE/mac_defs.h>
|
||||
#include <openair2/LAYER2/NR_MAC_UE/mac_proto.h>
|
||||
#include "NR_MAC_UE/mac_defs.h"
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include <openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h>
|
||||
#include <openair1/SCHED_NR_UE/fapi_nr_ue_l1.h>
|
||||
|
||||
@@ -716,6 +716,9 @@ int main( int argc, char **argv ) {
|
||||
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_NR_UE **));
|
||||
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_NR_UE *)*MAX_NUM_CCs);
|
||||
|
||||
if (get_softmodem_params()->do_ra)
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
|
||||
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
|
||||
@@ -742,11 +745,6 @@ int main( int argc, char **argv ) {
|
||||
|
||||
init_nr_ue_vars(UE[CC_id],frame_parms[CC_id],0,abstraction_flag);
|
||||
|
||||
if (get_softmodem_params()->phy_test==1)
|
||||
UE[CC_id]->mac_enabled = 0;
|
||||
else
|
||||
UE[CC_id]->mac_enabled = 1;
|
||||
|
||||
UE[CC_id]->mac_enabled = 1;
|
||||
UE[CC_id]->if_inst = nr_ue_if_module_init(0);
|
||||
UE[CC_id]->UE_scan = UE_scan;
|
||||
@@ -759,15 +757,49 @@ int main( int argc, char **argv ) {
|
||||
UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
|
||||
UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
|
||||
|
||||
if (frame_parms[CC_id]->frame_type==FDD) {
|
||||
if (UE[CC_id]->frame_parms.frame_type == FDD) {
|
||||
UE[CC_id]->N_TA_offset = 0;
|
||||
} else {
|
||||
if (frame_parms[CC_id]->N_RB_DL == 100)
|
||||
UE[CC_id]->N_TA_offset = 624;
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 50)
|
||||
UE[CC_id]->N_TA_offset = 624/2;
|
||||
else if (frame_parms[CC_id]->N_RB_DL == 25)
|
||||
UE[CC_id]->N_TA_offset = 624/4;
|
||||
int N_RB = UE[CC_id]->frame_parms.N_RB_DL;
|
||||
int N_TA_offset = UE[CC_id]->frame_parms.ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
double factor=1;
|
||||
switch (UE[CC_id]->frame_parms.numerology_index) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n");
|
||||
if (N_RB <= 25) factor = .25; // 7.68 Ms/s
|
||||
else if (N_RB <=50) factor = .5; // 15.36 Ms/s
|
||||
else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s
|
||||
else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s
|
||||
else AssertFatal(1==0,"Too many PRBS for mu=0\n");
|
||||
break;
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n");
|
||||
if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s
|
||||
break;
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n");
|
||||
break;
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s
|
||||
else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB);
|
||||
break;
|
||||
|
||||
if (N_RB == 100)
|
||||
UE[CC_id]->N_TA_offset = 624;
|
||||
else if (N_RB == 50)
|
||||
UE[CC_id]->N_TA_offset = 624/2;
|
||||
else if (N_RB == 25)
|
||||
UE[CC_id]->N_TA_offset = 624/4;
|
||||
}
|
||||
if (UE[CC_id]->frame_parms.threequarter_fs == 1) factor = factor*.75;
|
||||
UE[CC_id]->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d)\n", UE[CC_id]->Mod_id, UE[CC_id]->N_TA_offset, factor, UE[CC_id]->frame_parms.ul_CarrierFreq, N_RB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
#include <executables/softmodem-common.h>
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#include <openair2/LAYER2/NR_MAC_gNB/mac_proto.h>
|
||||
|
||||
/***************************************************************************************************************************************/
|
||||
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
|
||||
|
||||
@@ -50,6 +50,7 @@ extern "C"
|
||||
#define CONFIG_HLP_DUMPFRAME "dump UE received frame to rxsig_frame0.dat and exit\n"
|
||||
#define CONFIG_HLP_UELOOP "get softmodem (UE) to loop through memory instead of acquiring from HW\n"
|
||||
#define CONFIG_HLP_PHYTST "test UE phy layer, mac disabled\n"
|
||||
#define CONFIG_HLP_DORA "test gNB and UE with RA procedures\n"
|
||||
#define CONFIG_HLP_EXTS "tells hardware to use an external timing reference\n"
|
||||
#define CONFIG_HLP_DMRSSYNC "tells RU to insert DMRS in subframe 1 slot 0"
|
||||
#define CONFIG_HLP_CLK "tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)\n"
|
||||
@@ -89,6 +90,7 @@ extern "C"
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define RF_CONFIG_FILE softmodem_params.rf_config_file
|
||||
#define PHY_TEST softmodem_params.phy_test
|
||||
#define DO_RA softmodem_params.do_ra
|
||||
#define WAIT_FOR_SYNC softmodem_params.wait_for_sync
|
||||
#define SINGLE_THREAD_FLAG softmodem_params.single_thread_flag
|
||||
#define CHAIN_OFFSET softmodem_params.chain_offset
|
||||
@@ -104,6 +106,7 @@ extern "C"
|
||||
#define CMDLINE_PARAMS_DESC { \
|
||||
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, sizeof(RF_CONFIG_FILE)},\
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
|
||||
{"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, iptr:&DO_RA, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
|
||||
@@ -192,6 +195,7 @@ typedef struct {
|
||||
//THREAD_STRUCT thread_struct;
|
||||
char rf_config_file[1024];
|
||||
int phy_test;
|
||||
int do_ra;
|
||||
uint8_t usim_test;
|
||||
int emulate_rf;
|
||||
int wait_for_sync; //eNodeB only
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#define FAPI_NR_RX_PDU_TYPE_SIB 0x02
|
||||
#define FAPI_NR_RX_PDU_TYPE_DLSCH 0x03
|
||||
#define FAPI_NR_DCI_IND 0x04
|
||||
#define FAPI_NR_RX_PDU_TYPE_RAR 0x05
|
||||
|
||||
#define FAPI_NR_SIBS_MASK_SIB1 0x1
|
||||
|
||||
|
||||
@@ -156,22 +156,29 @@ typedef struct {
|
||||
fapi_nr_tx_request_body_t *tx_request_body;
|
||||
} fapi_nr_tx_request_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t preamble_index;
|
||||
uint8_t prach_configuration_index;
|
||||
uint16_t preamble_length;
|
||||
uint8_t power_ramping_step;
|
||||
uint16_t preamble_received_target_power;
|
||||
uint8_t msg1_fdm;
|
||||
uint8_t msg1_frequency_start;
|
||||
uint8_t zero_correlation_zone_config;
|
||||
uint8_t subcarrier_spacing;
|
||||
uint8_t restrictedset_config;
|
||||
uint16_t root_sequence_index;
|
||||
uint16_t rsrp_threshold_ssb;
|
||||
uint16_t rsrp_threshold_sul;
|
||||
uint16_t prach_freq_offset;
|
||||
} fapi_nr_ul_config_prach_pdu;
|
||||
/// This struct replaces:
|
||||
/// PRACH-ConfigInfo from 38.331 RRC spec
|
||||
/// PRACH-ConfigSIB or PRACH-Config
|
||||
typedef struct {
|
||||
/// PHY cell ID
|
||||
uint16_t phys_cell_id;
|
||||
/// Num PRACH occasions
|
||||
uint8_t num_prach_ocas;
|
||||
/// PRACH format
|
||||
uint8_t prach_format;
|
||||
/// Num RA
|
||||
uint8_t num_ra;
|
||||
uint8_t prach_start_symbol;
|
||||
/// 38.211 (NCS 38.211 6.3.3.1).
|
||||
uint16_t num_cs;
|
||||
/// Parameter: prach-rootSequenceIndex, see TS 38.211 (6.3.3.2).
|
||||
uint16_t root_seq_id;
|
||||
/// Parameter: High-speed-flag, see TS 38.211 (6.3.3.1). 1 corresponds to Restricted set and 0 to Unrestricted set.
|
||||
uint8_t restricted_set;
|
||||
/// see TS 38.211 (6.3.3.2).
|
||||
uint16_t freq_msg1;
|
||||
// nfapi_nr_ul_beamforming_t beamforming;
|
||||
} fapi_nr_ul_config_prach_pdu;
|
||||
|
||||
typedef struct {
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ typedef enum {
|
||||
NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION= 0X86,
|
||||
NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION= 0X87,
|
||||
NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION= 0X88,
|
||||
NFAPI_NR_PHY_MSG_TYPE_PACH_INDICATION= 0X89
|
||||
NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89
|
||||
//RESERVED 0X8a ~ 0xff
|
||||
} nfapi_nr_phy_msg_type_e;
|
||||
|
||||
@@ -623,22 +623,35 @@ typedef struct {
|
||||
|
||||
//table 3-37
|
||||
|
||||
#define DCI_PAYLOAD_BTYE_LEN 12 //? TS38.212 sec 7.3.1
|
||||
#define DCI_PAYLOAD_BYTE_LEN 8 // 12 ? TS38.212 sec 7.3.1
|
||||
#define MAX_DCI_CORESET 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint16_t rnti;//
|
||||
uint16_t scrambling_id;//
|
||||
uint16_t scrambling_rnti;/* */
|
||||
uint8_t cce_index;//
|
||||
uint8_t aggregation_level;//
|
||||
nfapi_nr_tx_precoding_and_beamforming_t* precoding_and_beamforming_list;
|
||||
//tx power info
|
||||
uint8_t beta_pdcch_1_0;/*PDCCH power value used for PDCCH Format 1_0 with CRC scrambled by SI-RNTI, PI-RNTI or RA-RNTI. This is ratio of
|
||||
SSB/PBCH EPRE to PDCCH and PDCCH DMRS EPRE [TS38.213, sec 4.1] Value :0->17 */
|
||||
uint8_t power_control_offset_ss;//PDCCH power value used for all other PDCCH Formats. This is ratio of SSB/PBCH block EPRE to PDCCH and PDCCH DMRS EPRE [TS38.214, sec 4.1] Values: 0: -3dB, 1: 0dB, 2: 3dB, 3: 6dB
|
||||
uint16_t payload_size_bits;//The total DCI length (in bits) including padding bits [TS38.212 sec 7.3.1] Range 0-> DCI_PAYLOAD_BTYE_LEN*8
|
||||
uint8_t payload[DCI_PAYLOAD_BTYE_LEN];//DCI payload, where the actual size is defined by PayloadSizeBits. The bit order is as following bit0-bit7 are mapped to first byte of MSB - LSB
|
||||
typedef struct {
|
||||
// The RNTI used for identifying the UE when receiving the PDU Value: 1 -> 65535.
|
||||
uint16_t RNTI[MAX_DCI_CORESET];
|
||||
// For a UE-specific search space it equals the higher-layer parameter PDCCH-DMRSScrambling-ID if configured,
|
||||
// otherwise it should be set to the phy cell ID. [TS38.211, sec 7.3.2.3] Value: 0->65535
|
||||
uint16_t ScramblingId[MAX_DCI_CORESET];
|
||||
// For a UE-specific search space where PDCCH-DMRSScrambling- ID is configured This param equals the CRNTI.
|
||||
// Otherwise, it should be set to 0. [TS38.211, sec 7.3.2.3] Value: 0 -> 65535
|
||||
uint16_t ScramblingRNTI[MAX_DCI_CORESET];
|
||||
// CCE start Index used to send the DCI Value: 0->135
|
||||
uint8_t CceIndex[MAX_DCI_CORESET];
|
||||
// Aggregation level used [TS38.211, sec 7.3.2.1] Value: 1,2,4,8,16
|
||||
uint8_t AggregationLevel[MAX_DCI_CORESET];
|
||||
// Precoding and Beamforming structure See Table 3-43
|
||||
nfapi_nr_tx_precoding_and_beamforming_t precodingAndBeamforming[MAX_DCI_CORESET];
|
||||
// PDCCH power value used for PDCCH Format 1_0 with CRC scrambled by SI-RNTI, PI-RNTI or RA-RNTI.
|
||||
// This is ratio of SSB/PBCH EPRE to PDCCH and PDCCH DMRS EPRE [TS38.213, sec 4.1]
|
||||
// Value :0->17 Report title: 5G FAPI: PHY API Specification Issue date: 29 June 2019 Version: 222.10.17 68 Field Type Description representing -8 to 8 dB in 1dB steps
|
||||
uint8_t beta_PDCCH_1_0[MAX_DCI_CORESET];
|
||||
// PDCCH power value used for all other PDCCH Formats.
|
||||
// This is ratio of SSB/PBCH block EPRE to PDCCH and PDCCH DMRS EPRE [TS38.214, sec 4.1] Values: 0: -3dB,1: 0dB,2: 3dB,3: 6dB
|
||||
uint8_t powerControlOffsetSS[MAX_DCI_CORESET];
|
||||
// The total DCI length (in bits) including padding bits [TS38.212 sec 7.3.1] Range 0->DCI_PAYLOAD_BYTE_LEN*8
|
||||
uint16_t PayloadSizeBits[MAX_DCI_CORESET];
|
||||
// DCI payload, where the actual size is defined by PayloadSizeBits. The bit order is as following bit0-bit7 are mapped to first byte of MSB - LSB
|
||||
uint8_t Payload[MAX_DCI_CORESET][DCI_PAYLOAD_BYTE_LEN];
|
||||
|
||||
} nfapi_nr_dl_dci_pdu_t;
|
||||
|
||||
@@ -653,9 +666,6 @@ typedef struct {
|
||||
uint16_t *beamIdx[275];
|
||||
} nr_beamforming_t;
|
||||
|
||||
#define MAX_DCI_CORESET 8
|
||||
#define DCI_PAYLOAD_BYTE_LEN 8
|
||||
|
||||
typedef struct {
|
||||
///Bandwidth part size [TS38.213 sec12]. Number of contiguous PRBs allocated to the BWP,Value: 1->275
|
||||
uint16_t BWPSize;
|
||||
@@ -685,26 +695,8 @@ typedef struct {
|
||||
uint8_t precoderGranularity;
|
||||
///Number of DCIs in this CORESET.Value: 0->MaxDciPerSlot
|
||||
uint16_t numDlDci;
|
||||
///The RNTI used for identifying the UE when receiving the PDU Value: 1 -> 65535.
|
||||
uint16_t RNTI[MAX_DCI_CORESET];
|
||||
///For a UE-specific search space it equals the higher-layer parameter PDCCH-DMRSScrambling-ID if configured, otherwise it should be set to the phy cell ID. [TS38.211, sec 7.3.2.3] Value: 0->65535
|
||||
uint16_t ScramblingId[MAX_DCI_CORESET];
|
||||
///For a UE-specific search space where PDCCH-DMRSScrambling- ID is configured This param equals the CRNTI. Otherwise, it should be set to 0. [TS38.211, sec 7.3.2.3] Value: 0 -> 65535
|
||||
uint16_t ScramblingRNTI[MAX_DCI_CORESET];
|
||||
///CCE start Index used to send the DCI Value: 0->135
|
||||
uint8_t CceIndex[MAX_DCI_CORESET];
|
||||
///Aggregation level used [TS38.211, sec 7.3.2.1] Value: 1,2,4,8,16
|
||||
uint8_t AggregationLevel[MAX_DCI_CORESET];
|
||||
///Precoding and Beamforming structure See Table 3-43
|
||||
nfapi_nr_tx_precoding_and_beamforming_t precodingAndBeamforming[MAX_DCI_CORESET];
|
||||
///PDCCH power value used for PDCCH Format 1_0 with CRC scrambled by SI-RNTI, PI-RNTI or RA-RNTI. This is ratio of SSB/PBCH EPRE to PDCCH and PDCCH DMRS EPRE [TS38.213, sec 4.1] Value :0->17 Report title: 5G FAPI: PHY API Specification Issue date: 29 June 2019 Version: 222.10.17 68 Field Type Description representing -8 to 8 dB in 1dB steps
|
||||
uint8_t beta_PDCCH_1_0[MAX_DCI_CORESET];
|
||||
///PDCCH power value used for all other PDCCH Formats. This is ratio of SSB/PBCH block EPRE to PDCCH and PDCCH DMRS EPRE [TS38.214, sec 4.1] Values: 0: -3dB,1: 0dB,2: 3dB,3: 6dB
|
||||
uint8_t powerControlOffsetSS[MAX_DCI_CORESET];
|
||||
///The total DCI length (in bits) including padding bits [TS38.212 sec 7.3.1] Range 0->DCI_PAYLOAD_BTYE_LEN*8
|
||||
uint16_t PayloadSizeBits[MAX_DCI_CORESET];
|
||||
///DCI payload, where the actual size is defined by PayloadSizeBits. The bit order is as following bit0-bit7 are mapped to first byte of MSB - LSB
|
||||
uint8_t Payload[MAX_DCI_CORESET][DCI_PAYLOAD_BYTE_LEN];
|
||||
///DL DCI PDU
|
||||
nfapi_nr_dl_dci_pdu_t dci_pdu;
|
||||
} nfapi_nr_dl_tti_pdcch_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
@@ -1037,10 +1029,12 @@ typedef struct
|
||||
{
|
||||
uint16_t phys_cell_id;
|
||||
uint8_t num_prach_ocas;
|
||||
// SCF PRACH PDU format field does not consider A1/B1 etc. possibilities
|
||||
// We added 9 = A1/B1 10 = A2/B2 11 A3/B3
|
||||
uint8_t prach_format;
|
||||
uint8_t num_ra;
|
||||
uint8_t prach_start_symbol;
|
||||
uint16_t num_cs;//
|
||||
uint16_t num_cs;
|
||||
nfapi_nr_ul_beamforming_t beamforming;
|
||||
|
||||
} nfapi_nr_prach_pdu_t;
|
||||
|
||||
@@ -463,6 +463,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint16_t nb_rb_oh,
|
||||
uint8_t tb_scaling,
|
||||
uint8_t Nl);
|
||||
|
||||
uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_pbch_defs.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto_common.h"
|
||||
/*#include "RadioResourceConfigCommonSIB.h"
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
#include "TDD-Config.h"
|
||||
@@ -39,7 +40,6 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "nfapi_nr_interface.h"
|
||||
|
||||
/*
|
||||
@@ -152,11 +152,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
nr_init_pdsch_dmrs(gNB, cfg->cell_config.phy_cell_id.value);
|
||||
|
||||
//PUSCH DMRS init
|
||||
gNB->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(2*sizeof(uint32_t ***));
|
||||
|
||||
uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs;
|
||||
|
||||
for(int nscid=0; nscid<2; nscid++) {
|
||||
@@ -231,6 +231,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
*/
|
||||
prach_vars->prach_ifft = (int32_t *)malloc16_clear(1024*2*sizeof(int32_t));
|
||||
|
||||
init_prach_list(gNB);
|
||||
|
||||
int N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
|
||||
printf("Before ULSCH init : %p\n",gNB->dlsch[0][0]->harq_processes[0]);
|
||||
@@ -404,7 +406,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||
fp->dl_CarrierFreq = 3500000000;//from_nrarfcn(gNB_config->nfapi_config.rf_bands.rf_band[0],gNB_config->nfapi_config.nrarfcn.value);
|
||||
fp->ul_CarrierFreq = 3500000000;//fp->dl_CarrierFreq - (get_uldl_offset(gNB_config->nfapi_config.rf_bands.rf_band[0])*100000);
|
||||
fp->nr_band = 78;
|
||||
fp->threequarter_fs= 0;
|
||||
// fp->threequarter_fs= 0;
|
||||
|
||||
gNB_config->carrier_config.dl_bandwidth.value = config_bandwidth(mu, N_RB_DL, fp->nr_band);
|
||||
|
||||
@@ -416,6 +418,7 @@ void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,
|
||||
|
||||
void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
uint8_t Mod_id = phy_config->Mod_id;
|
||||
uint8_t short_sequence, num_sequences, rootSequenceIndex, fd_occasion;
|
||||
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id]->frame_parms;
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &RC.gNB[Mod_id]->gNB_config;
|
||||
|
||||
@@ -479,6 +482,14 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
return;
|
||||
}
|
||||
|
||||
fd_occasion = 0;
|
||||
nfapi_nr_prach_config_t *prach_config = &gNB_config->prach_config;
|
||||
short_sequence = prach_config->prach_sequence_length.value;
|
||||
num_sequences = prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value;
|
||||
rootSequenceIndex = prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index.value;
|
||||
|
||||
compute_nr_prach_seq(short_sequence, num_sequences, rootSequenceIndex, RC.gNB[Mod_id]->X_u);
|
||||
|
||||
RC.gNB[Mod_id]->configured = 1;
|
||||
LOG_I(PHY,"gNB %d configured\n",Mod_id);
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "phy_init.h"
|
||||
#include "SCHED/sched_common.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
/*#include "RadioResourceConfigCommonSIB.h"
|
||||
#include "RadioResourceConfigDedicated.h"
|
||||
@@ -39,14 +40,19 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
int p;
|
||||
int re;
|
||||
|
||||
// For memory allocation of ru->prach_rxsigF
|
||||
int mu = fp->numerology_index;
|
||||
|
||||
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx);
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg;
|
||||
ru->nb_log_antennas=0;
|
||||
for (int n=0;n<RC.nb_nr_L1_inst;n++) {
|
||||
cfg = &RC.gNB[n]->gNB_config;
|
||||
cfg = &ru->config;
|
||||
if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas) ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
|
||||
}
|
||||
// copy configuration from gNB[0] in to RU, assume that all gNB instances sharing RU use the same configuration (at least the parts that are needed by the RU, numerology and PRACH)
|
||||
|
||||
AssertFatal(ru->nb_log_antennas > 0 && ru->nb_log_antennas < 13, "ru->nb_log_antennas %d ! \n",ru->nb_log_antennas);
|
||||
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
|
||||
// Time-domain signals
|
||||
@@ -107,7 +113,8 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
ru->prach_rxsigF = (int16_t**)malloc(ru->nb_rx * sizeof(int16_t*));
|
||||
|
||||
for (i=0; i<ru->nb_rx; i++) {
|
||||
ru->prach_rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*2*sizeof(int16_t) );
|
||||
// for preamble format 1 and 2, more memory should be allocated
|
||||
ru->prach_rxsigF[i] = (int16_t*)malloc16_clear( fp->ofdm_symbol_size*12*(1<<mu)*2*sizeof(int16_t) );
|
||||
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]);
|
||||
}
|
||||
|
||||
@@ -144,6 +151,8 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
|
||||
ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_subframe_wCP );
|
||||
|
||||
init_prach_ru_list(ru);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -77,19 +77,19 @@ void phy_config_sib2_ue(uint8_t Mod_id,int CC_id,
|
||||
|
||||
LOG_I(PHY,"[UE%d] Applying radioResourceConfigCommon from eNB%d\n",Mod_id,eNB_id);
|
||||
|
||||
fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
||||
ue->prach_vars[eNB_id]->prach_pdu.root_seq_id =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
||||
|
||||
fp->prach_config_common.prach_Config_enabled=1;
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
|
||||
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
|
||||
ue->prach_vars[eNB_id]->prach_Config_enabled=1;
|
||||
//ue->prach_vars[eNB_id]->prach_pdu.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex;
|
||||
ue->prach_vars[eNB_id]->prach_pdu.restricted_set =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.highSpeedFlag;
|
||||
ue->prach_vars[eNB_id]->prach_pdu.num_cs =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
||||
//ue->prach_vars[eNB_id]->prach_pdu.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset;
|
||||
|
||||
compute_prach_seq(fp->prach_config_common.rootSequenceIndex,
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,ue->X_u);
|
||||
//compute_prach_seq(fp->prach_config_common.rootSequenceIndex,
|
||||
// fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
// fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
// fp->prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
// fp->frame_type,ue->X_u);
|
||||
|
||||
|
||||
|
||||
@@ -226,12 +226,12 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_
|
||||
LOG_I(PHY,"[UE%d] Handover triggered: Applying radioResourceConfigCommon from eNB %d\n",
|
||||
Mod_id,eNB_id);
|
||||
|
||||
fp->prach_config_common.rootSequenceIndex =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
||||
fp->prach_config_common.prach_Config_enabled=1;
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
|
||||
fp->prach_config_common.prach_ConfigInfo.highSpeedFlag =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
|
||||
fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
|
||||
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
|
||||
ue->prach_vars[eNB_id]->prach_pdu.root_seq_id =radioResourceConfigCommon->prach_Config.rootSequenceIndex;
|
||||
ue->prach_vars[eNB_id]->prach_Config_enabled=1;
|
||||
//ue->prach_vars[eNB_id]->prach_pdu.prach_ConfigIndex =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex;
|
||||
ue->prach_vars[eNB_id]->prach_pdu.restricted_set =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->highSpeedFlag;
|
||||
ue->prach_vars[eNB_id]->prach_pdu.num_cs =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->zeroCorrelationZoneConfig;
|
||||
//ue->prach_vars[eNB_id]->prach_pdu.prach_FreqOffset =radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_FreqOffset;
|
||||
|
||||
// prach_fmt = get_prach_fmt(radioResourceConfigCommon->prach_Config.prach_ConfigInfo->prach_ConfigIndex,fp->frame_type);
|
||||
// N_ZC = (prach_fmt <4)?839:139;
|
||||
@@ -239,12 +239,12 @@ void phy_config_sib13_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,int mbsfn_Area_
|
||||
// prach_root_sequence_map4[fp->prach_config_common.rootSequenceIndex];
|
||||
|
||||
//compute_prach_seq(u,N_ZC, PHY_vars_UE_g[Mod_id]->X_u);
|
||||
compute_prach_seq(PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.rootSequenceIndex,
|
||||
PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
fp->frame_type,
|
||||
PHY_vars_UE_g[Mod_id][CC_id]->X_u);
|
||||
//compute_prach_seq(PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.rootSequenceIndex,
|
||||
// PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
// PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
// PHY_vars_UE_g[Mod_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
// fp->frame_type,
|
||||
// PHY_vars_UE_g[Mod_id][CC_id]->X_u);
|
||||
|
||||
|
||||
fp->pucch_config_common.deltaPUCCH_Shift = 1+radioResourceConfigCommon->pucch_ConfigCommon->deltaPUCCH_Shift;
|
||||
@@ -960,7 +960,9 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
// enable MIB/SIB decoding by default
|
||||
ue->decode_MIB = 1;
|
||||
ue->decode_SIB = 1;
|
||||
init_prach_tables(839);
|
||||
|
||||
init_nr_prach_tables(839);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,10 +211,10 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
|
||||
unsigned char symbol,
|
||||
unsigned char Ns,
|
||||
int sample_offset,
|
||||
int no_prefix)
|
||||
unsigned char symbol,
|
||||
unsigned char Ns,
|
||||
int sample_offset,
|
||||
int no_prefix)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
|
||||
NR_UE_COMMON *common_vars = &ue->common_vars;
|
||||
@@ -394,12 +394,13 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int sample_offset,
|
||||
int no_prefix)
|
||||
{
|
||||
uint32_t slot_offset;
|
||||
uint32_t rxdata_offset;
|
||||
int32_t slot_offset, rxdata_offset;
|
||||
|
||||
unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
|
||||
unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0);
|
||||
|
||||
int tmp_dft_in[8192] __attribute__ ((aligned (32)));
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
@@ -442,14 +443,26 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
slot_offset = frame_parms->get_samples_slot_timestamp(Ns,frame_parms,0);
|
||||
|
||||
|
||||
if(symbol == 0)
|
||||
rxdata_offset = slot_offset + nb_prefix_samples0 - SOFFSET;
|
||||
else
|
||||
rxdata_offset = slot_offset + nb_prefix_samples0 + (symbol * (frame_parms->ofdm_symbol_size + nb_prefix_samples)) - SOFFSET;
|
||||
|
||||
dft((int16_t *)&rxdata[rxdata_offset],
|
||||
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
if(sample_offset>rxdata_offset) {
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *) &rxdata[frame_parms->samples_per_frame-sample_offset+rxdata_offset],
|
||||
(sample_offset-rxdata_offset)*sizeof(int));
|
||||
|
||||
memcpy((void *)&tmp_dft_in[sample_offset-rxdata_offset],
|
||||
(void *) &rxdata[0],
|
||||
(frame_parms->ofdm_symbol_size-sample_offset+rxdata_offset)*sizeof(int));
|
||||
|
||||
dft((int16_t *)&tmp_dft_in,
|
||||
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
}
|
||||
else
|
||||
dft((int16_t *)&rxdata[rxdata_offset-sample_offset],
|
||||
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -116,7 +116,10 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
//------------------generate DMRS------------------//
|
||||
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, pusch_pdu->dmrs_config_type);
|
||||
if (pusch_pdu->transform_precoding) // if transform precoding is disabled
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, pusch_pdu->rb_start*NR_NB_SC_PER_RB, pusch_pdu->dmrs_config_type);
|
||||
else
|
||||
nr_pusch_dmrs_rx(gNB, Ns, gNB->nr_gold_pusch_dmrs[pusch_pdu->scid][Ns][symbol], &pilot[0], 1000, 0, nb_rb_pusch, 0, pusch_pdu->dmrs_config_type);
|
||||
|
||||
//------------------------------------------------//
|
||||
|
||||
@@ -275,70 +278,69 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
8);
|
||||
|
||||
|
||||
// check if PRB crosses DC and improve estimates around DC
|
||||
if ((bwp_start_subcarrier < gNB->frame_parms.ofdm_symbol_size) && (bwp_start_subcarrier+nb_rb_pusch*12 >= gNB->frame_parms.ofdm_symbol_size)) {
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
uint16_t idxDC = 2*(gNB->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
|
||||
uint16_t idxPil = idxDC/2;
|
||||
re_offset = k;
|
||||
pil = (int16_t *)&pilot[0];
|
||||
pil += (idxPil-2);
|
||||
ul_ch += (idxDC-4);
|
||||
ul_ch = memset(ul_ch, 0, sizeof(int16_t)*10);
|
||||
re_offset = (re_offset+idxDC/2-2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
// for proper allignment of SIMD vectors
|
||||
if((gNB->frame_parms.N_RB_UL&1)==0) {
|
||||
// check if PRB crosses DC and improve estimates around DC
|
||||
if ((bwp_start_subcarrier < gNB->frame_parms.ofdm_symbol_size) && (bwp_start_subcarrier+nb_rb_pusch*12 >= gNB->frame_parms.ofdm_symbol_size)) {
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
uint16_t idxDC = 2*(gNB->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
|
||||
uint16_t idxPil = idxDC/2;
|
||||
re_offset = k;
|
||||
pil = (int16_t *)&pilot[0];
|
||||
pil += (idxPil-2);
|
||||
ul_ch += (idxDC-4);
|
||||
ul_ch = memset(ul_ch, 0, sizeof(int16_t)*10);
|
||||
re_offset = (re_offset+idxDC/2-2) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(fdcl,
|
||||
ch,
|
||||
ul_ch-4,
|
||||
8);
|
||||
// for proper allignment of SIMD vectors
|
||||
if((gNB->frame_parms.N_RB_UL&1)==0) {
|
||||
|
||||
multadd_real_vector_complex_scalar(fdcl,
|
||||
ch,
|
||||
ul_ch-4,
|
||||
8);
|
||||
|
||||
pil += 4;
|
||||
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
pil += 4;
|
||||
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(fdcr,
|
||||
ch,
|
||||
ul_ch-4,
|
||||
8);
|
||||
} else {
|
||||
multadd_real_vector_complex_scalar(fdcr,
|
||||
ch,
|
||||
ul_ch-4,
|
||||
8);
|
||||
}
|
||||
else {
|
||||
multadd_real_vector_complex_scalar(fdclh,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
|
||||
multadd_real_vector_complex_scalar(fdclh,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
pil += 4;
|
||||
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
pil += 4;
|
||||
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
multadd_real_vector_complex_scalar(fdcrh,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
multadd_real_vector_complex_scalar(fdcrh,
|
||||
ch,
|
||||
ul_ch,
|
||||
8);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#ifdef DEBUG_PDSCH
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
for(uint16_t idxP=0; idxP<ceil((float)nb_rb_pusch*12/8); idxP++) {
|
||||
for(uint8_t idxI=0; idxI<16; idxI+=2) {
|
||||
printf("%d\t%d\t",ul_ch[idxP*16+idxI],ul_ch[idxP*16+idxI+1]);
|
||||
ul_ch = (int16_t *)&ul_ch_estimates[aarx][ch_offset];
|
||||
for(uint16_t idxP=0; idxP<ceil((float)nb_rb_pusch*12/8); idxP++) {
|
||||
for(uint8_t idxI=0; idxI<16; idxI+=2) {
|
||||
printf("%d\t%d\t",ul_ch[idxP*16+idxI],ul_ch[idxP*16+idxI+1]);
|
||||
}
|
||||
printf("%d\n",idxP);
|
||||
}
|
||||
printf("%d\n",idxP);
|
||||
}
|
||||
#endif
|
||||
|
||||
} else { //pusch_dmrs_type2 |p_r,p_l,d,d,d,d,p_r,p_l,d,d,d,d|
|
||||
}
|
||||
else { //pusch_dmrs_type2 |p_r,p_l,d,d,d,d,p_r,p_l,d,d,d,d|
|
||||
|
||||
// Treat first DMRS specially (left edge)
|
||||
|
||||
@@ -422,13 +424,12 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
ul_ch_128 = (__m128i *)&ul_ch_estimates[aarx][ch_offset];
|
||||
|
||||
ul_ch_128[0] = _mm_slli_epi16 (ul_ch_128[0], 2);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// Convert to time domain
|
||||
|
||||
switch (gNB->frame_parms.ofdm_symbol_size) {
|
||||
switch (gNB->frame_parms.ofdm_symbol_size) {
|
||||
case 128:
|
||||
idft128((int16_t*) &ul_ch_estimates[aarx][symbol_offset],
|
||||
(int16_t*) ul_ch_estimates_time[aarx],
|
||||
|
||||
@@ -111,6 +111,7 @@ int32_t get_l_prime(uint8_t duration_in_symbols, uint8_t mapping_type, pusch_dmr
|
||||
* n index starting 0,1,...
|
||||
* delta see Table 6.4.1.1.3
|
||||
* duration_in_symbols number of scheduled PUSCH ofdm symbols
|
||||
* start_symbol first symbol index in PUSCH allocation
|
||||
* dmrs_UplinkConfig DMRS uplink configuration
|
||||
* mapping_type PUSCH mapping type (A or B)
|
||||
* ofdm_symbol_size IFFT size
|
||||
@@ -140,6 +141,8 @@ uint8_t is_dmrs_symbol(uint8_t l,
|
||||
is_dmrs_freq = 0;
|
||||
is_dmrs_time = 0;
|
||||
|
||||
AssertFatal(l >= 0,"Check DMRS configuration (start_symbol) !\n");
|
||||
|
||||
|
||||
l0 = get_l0_ul(mapping_type, 2);
|
||||
l_prime_mask = get_l_prime(duration_in_symbols, mapping_type, additional_pos, pusch_maxLength);
|
||||
@@ -166,6 +169,7 @@ uint8_t is_dmrs_symbol(uint8_t l,
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (is_dmrs_time && is_dmrs_freq)
|
||||
return 1;
|
||||
else
|
||||
@@ -368,7 +372,7 @@ void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2
|
||||
*
|
||||
* NAME : get_l0_ul
|
||||
*
|
||||
* PARAMETERS : mapping_type : PUSCH mapping type
|
||||
* PARAMETERS : mapping_type : PUSCH mapping type
|
||||
* dmrs_typeA_position : higher layer parameter
|
||||
*
|
||||
* RETURN : demodulation reference signal for PUSCH
|
||||
|
||||
@@ -45,7 +45,7 @@ int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
|
||||
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1},{1,1},{1,-1},{1,1},{1,1}};
|
||||
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
|
||||
|
||||
|
||||
// complex conjugate of mod table
|
||||
short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,23170,-23170,-23170,-23170,23170};
|
||||
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
|
||||
|
||||
@@ -57,39 +57,40 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
||||
unsigned short p,
|
||||
unsigned char lp,
|
||||
unsigned short nb_pusch_rb,
|
||||
uint32_t re_offset,
|
||||
uint8_t dmrs_type)
|
||||
{
|
||||
int8_t w;
|
||||
int8_t w, nb_dmrs;
|
||||
short *mod_table;
|
||||
unsigned char idx=0;
|
||||
|
||||
typedef int array_of_w[2];
|
||||
array_of_w *wf;
|
||||
array_of_w *wt;
|
||||
|
||||
wf = (dmrs_type==pusch_dmrs_type1) ? wf1 : wf2;
|
||||
wt = (dmrs_type==pusch_dmrs_type1) ? wt1 : wt2;
|
||||
|
||||
if (dmrs_type > 2)
|
||||
LOG_E(PHY,"Bad PUSCH DMRS config type %d\n", dmrs_type);
|
||||
LOG_E(PHY,"PUSCH DMRS config type %d not valid\n", dmrs_type+1);
|
||||
|
||||
if ((p>=1000) && (p<((dmrs_type==pusch_dmrs_type1) ? 1008 : 1012))) {
|
||||
if (gNB->frame_parms.Ncp == NORMAL) {
|
||||
|
||||
for (int i=0; i<nb_pusch_rb*((dmrs_type==pusch_dmrs_type1) ? 6:4); i++) {
|
||||
nb_dmrs = ((dmrs_type==pusch_dmrs_type1) ? 6:4);
|
||||
for (int i=re_offset; i<re_offset+(nb_pusch_rb*nb_dmrs); i++) {
|
||||
|
||||
w = (wf[p-1000][i&1])*(wt[p-1000][lp]);
|
||||
mod_table = (w==1) ? nr_rx_mod_table : nr_rx_nmod_table;
|
||||
|
||||
idx = ((((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1)<<1) ^ (((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1);
|
||||
((int16_t*)output)[i<<1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
|
||||
((int16_t*)output)[(i<<1)+1] = mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||
((int16_t*)output)[i<<1] = mod_table[(NR_MOD_TABLE_QPSK_OFFSET + idx)<<1];
|
||||
((int16_t*)output)[(i<<1)+1] = mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1) + 1];
|
||||
#ifdef DEBUG_PUSCH
|
||||
printf("nr_pusch_dmrs_rx dmrs config type %d port %d nb_pusch_rb %d\n", dmrs_type, p, nb_pusch_rb);
|
||||
printf("wf[%d] = %d wt[%d]= %d\n", i&1, wf[p-1000][i&1], lp, wt[p-1000][lp]);
|
||||
printf("i %d idx %d pusch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pusch[(i<<1)>>5], (((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||
(((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1]);
|
||||
printf("nr_pusch_dmrs_rx dmrs config type %d port %d nb_pusch_rb %d\n", dmrs_type, p, nb_pusch_rb);
|
||||
printf("wf[%d] = %d wt[%d]= %d\n", i&1, wf[p-1000][i&1], lp, wt[p-1000][lp]);
|
||||
printf("i %d idx %d pusch gold %u b0-b1 %d-%d mod_dmrs %d %d\n", i, idx, nr_gold_pusch[(i<<1)>>5], (((nr_gold_pusch[(i<<1)>>5])>>((i<<1)&0x1f))&1),
|
||||
(((nr_gold_pusch[((i<<1)+1)>>5])>>(((i<<1)+1)&0x1f))&1), ((int16_t*)output)[i<<1], ((int16_t*)output)[(i<<1)+1]);
|
||||
#endif
|
||||
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"extended cp not supported for PUSCH DMRS yet\n");
|
||||
|
||||
@@ -88,6 +88,7 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1
|
||||
uint8_t n_scid=0; // again works only for 1_0
|
||||
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) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
|
||||
|
||||
@@ -48,5 +48,6 @@ int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
|
||||
unsigned short p,
|
||||
unsigned char lp,
|
||||
unsigned short nb_pusch_rb,
|
||||
uint32_t re_offset,
|
||||
uint8_t dmrs_type);
|
||||
#endif
|
||||
|
||||
@@ -137,6 +137,7 @@ void nr_pdcch_scrambling(uint32_t *in,
|
||||
uint32_t x1, x2, s=0;
|
||||
reset = 1;
|
||||
x2 = (n_RNTI<<16) + Nid;
|
||||
LOG_D(PHY,"PDCCH Scrambling x2 %x : n_RNTI %x\n",x2,n_RNTI);
|
||||
for (int i=0; i<size; i++) {
|
||||
if ((i&0x1f)==0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
@@ -154,7 +155,7 @@ void nr_pdcch_scrambling(uint32_t *in,
|
||||
|
||||
|
||||
uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu,
|
||||
nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu,
|
||||
uint32_t **gold_pdcch_dmrs,
|
||||
int32_t *txdataF,
|
||||
int16_t amp,
|
||||
@@ -206,8 +207,8 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
AssertFatal(pdcch_pdu_rel15->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED,
|
||||
"Interleaved CCE REG MAPPING not supported\n");
|
||||
uint32_t dmrs_length = (pdcch_pdu_rel15->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED)?
|
||||
(n_rb*6) : (pdcch_pdu_rel15->AggregationLevel[d]*36/cset_nsymb); //2(QPSK)*3(per RB)*6(REG per CCE)
|
||||
uint32_t encoded_length = pdcch_pdu_rel15->AggregationLevel[d]*108; //2(QPSK)*9(per RB)*6(REG per CCE)
|
||||
(n_rb*6) : (pdcch_pdu_rel15->dci_pdu.AggregationLevel[d]*36/cset_nsymb); //2(QPSK)*3(per RB)*6(REG per CCE)
|
||||
uint32_t encoded_length = pdcch_pdu_rel15->dci_pdu.AggregationLevel[d]*108; //2(QPSK)*9(per RB)*6(REG per CCE)
|
||||
LOG_D(PHY, "DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d)\n", dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType);
|
||||
dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset
|
||||
|
||||
@@ -228,18 +229,20 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
/// DCI payload processing
|
||||
// CRC attachment + Scrambling + Channel coding + Rate matching
|
||||
uint32_t encoder_output[NR_MAX_DCI_SIZE_DWORD];
|
||||
uint16_t n_RNTI = pdcch_pdu_rel15->RNTI[d];
|
||||
uint16_t Nid = pdcch_pdu_rel15->ScramblingId[d];
|
||||
|
||||
|
||||
uint16_t n_RNTI = pdcch_pdu_rel15->dci_pdu.RNTI[d];
|
||||
uint16_t Nid = pdcch_pdu_rel15->dci_pdu.ScramblingId[d];
|
||||
uint16_t scrambling_RNTI = pdcch_pdu_rel15->dci_pdu.ScramblingRNTI[d];
|
||||
|
||||
t_nrPolar_params *currentPtr = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE,
|
||||
pdcch_pdu_rel15->PayloadSizeBits[d],
|
||||
pdcch_pdu_rel15->AggregationLevel[d],
|
||||
pdcch_pdu_rel15->dci_pdu.PayloadSizeBits[d],
|
||||
pdcch_pdu_rel15->dci_pdu.AggregationLevel[d],
|
||||
0,NULL);
|
||||
polar_encoder_fast((uint64_t*)pdcch_pdu_rel15->Payload[d], encoder_output, n_RNTI,1,currentPtr);
|
||||
polar_encoder_fast((uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[d], encoder_output, n_RNTI,1,currentPtr);
|
||||
#ifdef DEBUG_CHANNEL_CODING
|
||||
printf("polar rnti %x,length %d, L %d\n",n_RNTI, pdcch_pdu_rel15->PayloadSizeBits[d],pdcch_pdu_rel15->AggregationLevel[d]);
|
||||
printf("polar rnti %x,length %d, L %d\n",n_RNTI, pdcch_pdu_rel15->dci_pdu.PayloadSizeBits[d],pdcch_pdu_rel15->dci_pdu.AggregationLevel[d]);
|
||||
printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n",
|
||||
((uint64_t*)pdcch_pdu_rel15->Payload[d])[0], ((uint64_t*)pdcch_pdu_rel15->Payload[d])[1]);
|
||||
((uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[d])[0], ((uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[d])[1]);
|
||||
printf("Encoded Payload (length:%d dwords):\n", encoded_length>>5);
|
||||
|
||||
for (int i=0; i<encoded_length>>5; i++)
|
||||
@@ -249,7 +252,7 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
#endif
|
||||
/// Scrambling
|
||||
uint32_t scrambled_output[NR_MAX_DCI_SIZE_DWORD]= {0};
|
||||
nr_pdcch_scrambling(encoder_output, encoded_length, Nid, n_RNTI, scrambled_output);
|
||||
nr_pdcch_scrambling(encoder_output, encoded_length, Nid, scrambling_RNTI, scrambled_output);
|
||||
#ifdef DEBUG_CHANNEL_CODING
|
||||
printf("scrambled output: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\t [4]->0x%08x\t [5]->0x%08x\t \
|
||||
[6]->0x%08x \t [7]->0x%08x \t [8]->0x%08x \t [9]->0x%08x\t [10]->0x%08x\t [11]->0x%08x\n",
|
||||
@@ -272,8 +275,8 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
cset_start_sc -= frame_parms.ofdm_symbol_size;
|
||||
|
||||
/*Reorder REG list for a freq first mapping*/
|
||||
uint8_t nb_regs = pdcch_pdu_rel15->AggregationLevel[d]*NR_NB_REG_PER_CCE;
|
||||
uint8_t reg_idx0 = pdcch_pdu_rel15->CceIndex[d]*NR_NB_REG_PER_CCE;
|
||||
uint8_t reg_idx0 = pdcch_pdu_rel15->dci_pdu.CceIndex[d]*NR_NB_REG_PER_CCE;
|
||||
uint8_t nb_regs = pdcch_pdu_rel15->dci_pdu.AggregationLevel[d]*NR_NB_REG_PER_CCE;
|
||||
|
||||
/*Mapping the encoded DCI along with the DMRS */
|
||||
for (int reg_idx=reg_idx0; reg_idx<(nb_regs+reg_idx0); reg_idx++) {
|
||||
@@ -295,8 +298,8 @@ uint8_t nr_generate_dci_top(nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu,
|
||||
for (int m=0; m<NR_NB_SC_PER_RB; m++) {
|
||||
if ( m == (k_prime<<2)+1) { // DMRS if not already mapped
|
||||
if (pdcch_pdu_rel15->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_NON_INTERLEAVED) {
|
||||
((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1] = (2*amp * mod_dmrs[l][dmrs_idx<<1]) >> 15;
|
||||
((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (2*amp * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
|
||||
((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1] = (amp * mod_dmrs[l][dmrs_idx<<1]) >> 15;
|
||||
((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1) + 1] = (amp * mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
|
||||
#ifdef DEBUG_PDCCH_DMRS
|
||||
printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
|
||||
((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
|
||||
|
||||
@@ -140,7 +140,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m) {
|
||||
int C;
|
||||
|
||||
for (int d=0;d<pdcch_pdu_rel15->numDlDci;d++) {
|
||||
int L = pdcch_pdu_rel15->AggregationLevel[d];
|
||||
int L = pdcch_pdu_rel15->dci_pdu.AggregationLevel[d];
|
||||
|
||||
if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_MIB_SIB1)
|
||||
AssertFatal(L>=4, "Invalid aggregation level for SIB1 configured PDCCH %d\n", L);
|
||||
@@ -151,10 +151,10 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m) {
|
||||
C = N_reg/(bsize*R);
|
||||
}
|
||||
|
||||
LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->CceIndex[d]);
|
||||
LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu.CceIndex[d]);
|
||||
for (uint8_t cce_idx=0; cce_idx<L; cce_idx++) {
|
||||
cce = &gNB->cce_list[d][cce_idx];
|
||||
cce->cce_idx = pdcch_pdu_rel15->CceIndex[d] + cce_idx;
|
||||
cce->cce_idx = pdcch_pdu_rel15->dci_pdu.CceIndex[d] + cce_idx;
|
||||
LOG_D(PHY, "cce_idx %d\n", cce->cce_idx);
|
||||
|
||||
if (pdcch_pdu_rel15->CceRegMappingType == NFAPI_NR_CCE_REG_MAPPING_INTERLEAVED) {
|
||||
@@ -210,12 +210,12 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
|
||||
for (int i=0;i<pdcch_pdu_rel15->numDlDci;i++) {
|
||||
|
||||
uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->Payload[i];
|
||||
uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[i];
|
||||
|
||||
|
||||
int dlsch_id = find_nr_dlsch(pdcch_pdu_rel15->RNTI[i],gNB,SEARCH_EXIST_OR_FREE);
|
||||
int dlsch_id = find_nr_dlsch(pdcch_pdu_rel15->dci_pdu.RNTI[i],gNB,SEARCH_EXIST_OR_FREE);
|
||||
if( (dlsch_id<0) || (dlsch_id>=NUMBER_OF_NR_DLSCH_MAX) ){
|
||||
LOG_E(PHY,"illegal dlsch_id found!!! rnti %04x dlsch_id %d\n",(unsigned int)pdcch_pdu_rel15->RNTI[i],dlsch_id);
|
||||
LOG_E(PHY,"illegal dlsch_id found!!! rnti %04x dlsch_id %d\n",(unsigned int)pdcch_pdu_rel15->dci_pdu.RNTI[i],dlsch_id);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -228,7 +228,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
|
||||
"illegal harq_pid %d\n",harq_pid);
|
||||
|
||||
dlsch->harq_mask |= (1<<harq_pid);
|
||||
dlsch->rnti = pdcch_pdu_rel15->RNTI[i];
|
||||
dlsch->rnti = pdcch_pdu_rel15->dci_pdu.RNTI[i];
|
||||
|
||||
nr_fill_cce_list(gNB,0);
|
||||
/*
|
||||
@@ -248,7 +248,7 @@ void nr_fill_ul_dci(PHY_VARS_gNB *gNB,
|
||||
|
||||
for (int i=0;i<pdcch_pdu_rel15->numDlDci;i++) {
|
||||
|
||||
uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->Payload[i];
|
||||
uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu.Payload[i];
|
||||
|
||||
// if there's no DL DCI then generate CCE list
|
||||
if (gNB->pdcch_pdu) nr_fill_cce_list(gNB,0);
|
||||
|
||||
@@ -133,13 +133,17 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
|
||||
int16_t **mod_symbs = (int16_t**)dlsch->mod_symbs;
|
||||
int16_t **tx_layers = (int16_t**)dlsch->txdataF;
|
||||
int8_t Wf[2], Wt[2], l0, l_prime[2], delta;
|
||||
|
||||
uint8_t nodata_dmrs = 1;
|
||||
uint8_t dmrs_Type = rel15->dmrsConfigType;
|
||||
int nb_re_dmrs = (dmrs_Type== NFAPI_NR_DMRS_TYPE1) ? 6:4;
|
||||
uint16_t n_dmrs = ((rel15->rbSize+rel15->rbStart)*nb_re_dmrs)<<1;
|
||||
int16_t mod_dmrs[n_dmrs<<1];
|
||||
|
||||
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs-xOverhead)*rel15->rbSize*rel15->NrOfCodewords;
|
||||
uint16_t nb_re;
|
||||
if (nodata_dmrs) // no data in dmrs symbol
|
||||
nb_re = ((12*rel15->NrOfSymbols)-12-xOverhead)*rel15->rbSize*rel15->NrOfCodewords;
|
||||
else
|
||||
nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs-xOverhead)*rel15->rbSize*rel15->NrOfCodewords;
|
||||
uint8_t Qm = rel15->qamModOrder[0];
|
||||
uint32_t encoded_length = nb_re*Qm;
|
||||
|
||||
@@ -297,15 +301,16 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
|
||||
if( (l != dmrs_symbol) || !nodata_dmrs) {
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (amp * tx_layers[ap][m<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
m, l, k, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
|
||||
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
m, l, k, ((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)]);
|
||||
#endif
|
||||
m++;
|
||||
m++;
|
||||
}
|
||||
}
|
||||
if (++k >= frame_parms->ofdm_symbol_size)
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
|
||||
@@ -90,7 +90,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
|
||||
|
||||
|
||||
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,uint16_t N_RB);
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
|
||||
|
||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
//#define DEBUG_DLSCH_FREE 1
|
||||
|
||||
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,uint16_t N_RB)
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB)
|
||||
{
|
||||
int i;
|
||||
int r;
|
||||
@@ -131,7 +131,7 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,uint16_t N_RB)
|
||||
}
|
||||
|
||||
free16(dlsch,sizeof(NR_gNB_DLSCH_t));
|
||||
dlsch = NULL;
|
||||
*dlschptr = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -336,7 +336,12 @@ int nr_dlsch_encoding(unsigned char *a,
|
||||
uint32_t E;
|
||||
uint8_t Ilbrm = 1;
|
||||
uint32_t Tbslbrm = 950984; //max tbs
|
||||
uint8_t nb_re_dmrs = rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1 ? 6:4;
|
||||
uint8_t nodata_dmrs = 1;
|
||||
uint8_t nb_re_dmrs;
|
||||
if (nodata_dmrs)
|
||||
nb_re_dmrs = 12;
|
||||
else
|
||||
nb_re_dmrs = rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1 ? 6:4;
|
||||
uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
|
||||
uint16_t R=rel15->targetCodeRate[0];
|
||||
float Coderate = 0.0;
|
||||
|
||||
@@ -274,25 +274,7 @@ int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
|
||||
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_NR_ULSCH_MAX; i++) {
|
||||
AssertFatal(gNB->ulsch[i]!=NULL,"gNB->ulsch[%d] is null\n",i);
|
||||
AssertFatal(gNB->ulsch[i][0]!=NULL,"gNB->ulsch[%d][0] is null\n",i);
|
||||
LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i][0]->harq_mask,gNB->ulsch[i][0]->rnti,first_free_index);
|
||||
if ((gNB->ulsch[i][0]->harq_mask >0) &&
|
||||
(gNB->ulsch[i][0]->rnti==rnti)) return i;
|
||||
else if ((gNB->ulsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
|
||||
}
|
||||
if (type == SEARCH_EXIST) return -1;
|
||||
if (first_free_index != -1)
|
||||
gNB->ulsch[first_free_index][0]->rnti = 0;
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
void nr_fill_dlsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
@@ -316,26 +298,3 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB,
|
||||
|
||||
}
|
||||
|
||||
void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pusch_pdu_t *ulsch_pdu) {
|
||||
|
||||
|
||||
int ulsch_id = find_nr_ulsch(ulsch_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal( (ulsch_id>=0) && (ulsch_id<NUMBER_OF_NR_ULSCH_MAX),
|
||||
"illegal or no ulsch_id found!!! rnti %04x ulsch_id %d\n",ulsch_pdu->rnti,ulsch_id);
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id][0];
|
||||
int harq_pid = ulsch_pdu->pusch_data.harq_process_id;
|
||||
ulsch->rnti = ulsch_pdu->rnti;
|
||||
//ulsch->rnti_type;
|
||||
ulsch->harq_mask |= 1<<harq_pid;
|
||||
ulsch->harq_process_id[slot] = harq_pid;
|
||||
|
||||
memcpy((void*)&ulsch->harq_processes[harq_pid]->ulsch_pdu, (void*)ulsch_pdu, sizeof(nfapi_nr_pusch_pdu_t));
|
||||
|
||||
LOG_D(PHY,"Initializing nFAPI for ULSCH, UE %d, harq_pid %d\n",ulsch_id,harq_pid);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -34,38 +34,133 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto_common.h"
|
||||
|
||||
extern uint16_t NCS_unrestricted_delta_f_RA_125[16];
|
||||
extern uint16_t NCS_restricted_TypeA_delta_f_RA_125[15];
|
||||
extern uint16_t NCS_restricted_TypeB_delta_f_RA_125[13];
|
||||
extern uint16_t NCS_unrestricted_delta_f_RA_5[16];
|
||||
extern uint16_t NCS_restricted_TypeA_delta_f_RA_5[16];
|
||||
extern uint16_t NCS_restricted_TypeB_delta_f_RA_5[14];
|
||||
extern uint16_t NCS_unrestricted_delta_f_RA_15[16];
|
||||
extern uint16_t prach_root_sequence_map_0_3[838];
|
||||
extern uint16_t prach_root_sequence_map_abc[138];
|
||||
extern int64_t table_6_3_3_2_2_prachConfig_Index [256][9];
|
||||
extern int64_t table_6_3_3_2_3_prachConfig_Index [256][9];
|
||||
extern int64_t table_6_3_3_2_4_prachConfig_Index [256][10];
|
||||
extern uint16_t nr_du[838];
|
||||
extern int16_t nr_ru[2*839];
|
||||
extern const char *prachfmt[9];
|
||||
|
||||
void init_prach_list(PHY_VARS_gNB *gNB) {
|
||||
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
for (int i=0; i<NUMBER_OF_NR_PRACH_MAX; i++) gNB->prach_vars.list[i].frame=-1;
|
||||
}
|
||||
|
||||
int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, int numRA, find_type_t type) {
|
||||
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_NR_PRACH_MAX; i++) {
|
||||
LOG_D(PHY,"searching for PRACH in %d.%d with numRA %d: prach_index %d=> %d.%d numRA %d\n", frame,slot,numRA,i,
|
||||
gNB->prach_vars.list[i].frame,gNB->prach_vars.list[i].slot,gNB->prach_vars.list[i].pdu.num_ra);
|
||||
if ((gNB->prach_vars.list[i].frame == frame) &&
|
||||
(gNB->prach_vars.list[i].slot == slot) &&
|
||||
(gNB->prach_vars.list[i].pdu.num_ra == numRA)) return i;
|
||||
else if ((gNB->prach_vars.list[i].frame == -1) && (first_free_index==-1)) first_free_index=i;
|
||||
}
|
||||
if (type == SEARCH_EXIST) return -1;
|
||||
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
void nr_fill_prach(PHY_VARS_gNB *gNB,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu) {
|
||||
|
||||
int prach_id = find_nr_prach(gNB,SFN,Slot,prach_pdu->num_ra,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal( (prach_id>=0) && (prach_id<NUMBER_OF_NR_PRACH_MAX),
|
||||
"illegal or no prach_id found!!! numRA %d prach_id %d\n",prach_pdu->num_ra,prach_id);
|
||||
|
||||
gNB->prach_vars.list[prach_id].frame=SFN;
|
||||
gNB->prach_vars.list[prach_id].slot=Slot;
|
||||
memcpy((void*)&gNB->prach_vars.list[prach_id].pdu,(void*)prach_pdu,sizeof(*prach_pdu));
|
||||
|
||||
}
|
||||
|
||||
void init_prach_ru_list(RU_t *ru) {
|
||||
|
||||
AssertFatal(ru!=NULL,"ruis null\n");
|
||||
for (int i=0; i<NUMBER_OF_NR_RU_PRACH_MAX; i++) ru->prach_list[i].frame=-1;
|
||||
pthread_mutex_init(&ru->prach_list_mutex,NULL);
|
||||
}
|
||||
|
||||
int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type) {
|
||||
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
|
||||
AssertFatal(ru!=NULL,"ru is null\n");
|
||||
pthread_mutex_lock(&ru->prach_list_mutex);
|
||||
for (i=0; i<NUMBER_OF_NR_RU_PRACH_MAX; i++) {
|
||||
LOG_D(PHY,"searching for PRACH in %d.%d : prach_index %d=> %d.%d\n", frame,slot,i,
|
||||
ru->prach_list[i].frame,ru->prach_list[i].slot);
|
||||
if ((ru->prach_list[i].frame == frame) &&
|
||||
(ru->prach_list[i].slot == slot)) {
|
||||
pthread_mutex_unlock(&ru->prach_list_mutex);
|
||||
return i;
|
||||
}
|
||||
else if ((ru->prach_list[i].frame == -1) && (first_free_index==-1)) first_free_index=i;
|
||||
}
|
||||
pthread_mutex_unlock(&ru->prach_list_mutex);
|
||||
if (type == SEARCH_EXIST) return -1;
|
||||
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
void nr_fill_prach_ru(RU_t *ru,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu) {
|
||||
|
||||
int prach_id = find_nr_prach_ru(ru,SFN,Slot,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal( (prach_id>=0) && (prach_id<NUMBER_OF_NR_PRACH_MAX),
|
||||
"illegal or no prach_id found!!! prach_id %d\n",prach_id);
|
||||
|
||||
pthread_mutex_lock(&ru->prach_list_mutex);
|
||||
ru->prach_list[prach_id].frame = SFN;
|
||||
ru->prach_list[prach_id].slot = Slot;
|
||||
ru->prach_list[prach_id].fmt = prach_pdu->prach_format;
|
||||
ru->prach_list[prach_id].numRA = prach_pdu->num_ra;
|
||||
ru->prach_list[prach_id].prachStartSymbol = prach_pdu->prach_start_symbol;
|
||||
pthread_mutex_unlock(&ru->prach_list_mutex);
|
||||
|
||||
}
|
||||
|
||||
void free_nr_ru_prach_entry(RU_t *ru,
|
||||
int prach_id) {
|
||||
|
||||
pthread_mutex_lock(&ru->prach_list_mutex);
|
||||
ru->prach_list[prach_id].frame=-1;
|
||||
pthread_mutex_unlock(&ru->prach_list_mutex);
|
||||
|
||||
}
|
||||
|
||||
|
||||
void rx_nr_prach_ru(RU_t *ru,
|
||||
int prachFormat,
|
||||
int numRA,
|
||||
int prachStartSymbol,
|
||||
int frame,
|
||||
int subframe) {
|
||||
int slot) {
|
||||
|
||||
AssertFatal(ru!=NULL,"ru is null\n");
|
||||
|
||||
int16_t **rxsigF=NULL;
|
||||
NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
|
||||
int16_t prach_ConfigIndex = fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
|
||||
int16_t *prach[ru->nb_rx];
|
||||
uint8_t prach_fmt = get_nr_prach_fmt(prach_ConfigIndex,fp->frame_type,fp->freq_range);
|
||||
int prach_sequence_length = ru->config.prach_config.prach_sequence_length.value;
|
||||
|
||||
int msg1_frequencystart = ru->config.prach_config.num_prach_fd_occasions_list[numRA].k1.value;
|
||||
|
||||
rxsigF = ru->prach_rxsigF;
|
||||
|
||||
AssertFatal(ru->if_south == LOCAL_RF,"we shouldn't call this if if_south != LOCAL_RF\n");
|
||||
for (int aa=0; aa<ru->nb_rx; aa++)
|
||||
prach[aa] = (int16_t*)&ru->common.rxdata[aa][(subframe*fp->samples_per_subframe)-ru->N_TA_offset];
|
||||
prach[aa] = (int16_t*)&ru->common.rxdata[aa][(slot*fp->get_samples_per_slot(slot,fp))-ru->N_TA_offset];
|
||||
|
||||
|
||||
|
||||
@@ -73,87 +168,97 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
int Ncp;
|
||||
int16_t *prach2;
|
||||
|
||||
|
||||
switch (prach_fmt) {
|
||||
case 0:
|
||||
Ncp = 3168;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Ncp = 21024;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Ncp = 4688;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Ncp = 3168;
|
||||
break;
|
||||
|
||||
case 0xa1:
|
||||
Ncp = 288/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xa2:
|
||||
Ncp = 576/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xa3:
|
||||
Ncp = 864/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xb1:
|
||||
Ncp = 216/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xb2:
|
||||
Ncp = 360/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xb3:
|
||||
Ncp = 504/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xb4:
|
||||
Ncp = 936/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xc0:
|
||||
Ncp = 1240/(1<<mu);
|
||||
break;
|
||||
|
||||
case 0xc2:
|
||||
Ncp = 2048/(1<<mu);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"unknown prach format %x\n",prach_fmt);
|
||||
break;
|
||||
if (prach_sequence_length == 0) {
|
||||
LOG_D(PHY,"PRACH (ru %d) in %d.%d, format %d, msg1_frequencyStart %d\n",
|
||||
ru->idx,frame,slot,prachFormat,msg1_frequencystart);
|
||||
AssertFatal(prachFormat<4,"Illegal prach format %d for length 839\n",prachFormat);
|
||||
switch (prachFormat) {
|
||||
case 0:
|
||||
Ncp = 3168;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
Ncp = 21024;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
Ncp = 4688;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
Ncp = 3168;
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_D(PHY,"PRACH (ru %d) in %d.%d, format %s, msg1_frequencyStart %d,startSymbol %d\n",
|
||||
ru->idx,frame,slot,prachfmt[prachFormat],msg1_frequencystart,prachStartSymbol);
|
||||
|
||||
switch (prachFormat) {
|
||||
case 0: //A1
|
||||
Ncp = 288/(1<<mu);
|
||||
break;
|
||||
|
||||
case 1: //A2
|
||||
Ncp = 576/(1<<mu);
|
||||
break;
|
||||
|
||||
case 2: //A3
|
||||
Ncp = 864/(1<<mu);
|
||||
break;
|
||||
|
||||
case 3: //B1
|
||||
Ncp = 216/(1<<mu);
|
||||
break;
|
||||
|
||||
case 4: //B2
|
||||
Ncp = 360/(1<<mu);
|
||||
break;
|
||||
|
||||
case 5: //B3
|
||||
Ncp = 504/(1<<mu);
|
||||
break;
|
||||
|
||||
case 6: //B4
|
||||
Ncp = 936/(1<<mu);
|
||||
break;
|
||||
|
||||
case 7: //C0
|
||||
Ncp = 1240/(1<<mu);
|
||||
break;
|
||||
|
||||
case 8: //C2
|
||||
Ncp = 2048/(1<<mu);
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0,"unknown prach format %x\n",prachFormat);
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Do forward transform
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, ru->nb_rx, Ncp);
|
||||
LOG_D(PHY,"rx_prach: Doing PRACH FFT for nb_rx:%d Ncp:%d\n",ru->nb_rx, Ncp);
|
||||
}
|
||||
AssertFatal(mu==1,"only 30 kHz SCS handled for now\n");
|
||||
|
||||
// Note: Assumes PUSCH SCS @ 30 kHz, take values for formats 0-2 and adjust for others below
|
||||
int kbar = 1;
|
||||
int K = 24;
|
||||
if (prach_fmt == 3) {
|
||||
if (prach_sequence_length == 0 && prachFormat == 3) {
|
||||
K=4;
|
||||
kbar=10;
|
||||
}
|
||||
else if (prach_fmt > 3) {
|
||||
else if (prach_sequence_length == 1) {
|
||||
// Note: Assumes that PRACH SCS is same as PUSCH SCS
|
||||
K=1;
|
||||
kbar=2;
|
||||
}
|
||||
int n_ra_prb = fp->prach_config_common.prach_ConfigInfo.msg1_frequencystart;
|
||||
int n_ra_prb = msg1_frequencystart;
|
||||
int k = (12*n_ra_prb) - 6*fp->N_RB_UL;
|
||||
|
||||
int N_ZC = (prach_fmt<4)?839:139;
|
||||
int N_ZC = (prach_sequence_length==0)?839:139;
|
||||
|
||||
if (k<0) k+=(fp->ofdm_symbol_size);
|
||||
|
||||
@@ -173,170 +278,226 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
if (fp->threequarter_fs==0) {
|
||||
//40 MHz @ 61.44 Ms/s
|
||||
//50 MHz @ 61.44 Ms/s
|
||||
prach2 = prach[aa] + (Ncp<<2);
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
|
||||
dft49152(prach2,rxsigF[aa],1);
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft49152(prach2+98304,rxsigF[aa]+98304,1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 2) {
|
||||
dft49152(prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft49152(prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
for (int i=0;i<4;i++) dft12288(prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1);
|
||||
reps=4;
|
||||
}
|
||||
if (prach_fmt >3) {
|
||||
dft2048(prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft2048(prach2+4096,rxsigF[aa]+4096,1);
|
||||
prach2 = prach[aa] + (Ncp<<2); // Ncp is for 30.72 Ms/s, so multiply by 2 for I/Q, and 2 to bring to 61.44 Ms/s
|
||||
if (prach_sequence_length == 0) {
|
||||
if (prachFormat == 0 || prachFormat == 1 || prachFormat == 2) {
|
||||
dftlen=49152;
|
||||
dft49152(prach2,rxsigF[aa],1);
|
||||
}
|
||||
if (prachFormat == 1 || prachFormat == 2) {
|
||||
dft49152(prach2+98304,rxsigF[aa]+98304,1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft2048(prach2+4096*2,rxsigF[aa]+4096*2,1);
|
||||
dft2048(prach2+4096*3,rxsigF[aa]+4096*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft2048(prach2+4096*4,rxsigF[aa]+4096*4,1);
|
||||
dft2048(prach2+4096*5,rxsigF[aa]+4096*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft2048(prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
reps+=6;
|
||||
if (prachFormat == 2) {
|
||||
dft49152(prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft49152(prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 3) {
|
||||
dftlen=12288;
|
||||
for (int i=0;i<4;i++) dft12288(prach2+(i*12288*2),rxsigF[aa]+(i*12288*2),1);
|
||||
reps=4;
|
||||
}
|
||||
}// 839 sequence
|
||||
else {
|
||||
if ((mu==0 &&
|
||||
(prachStartSymbol == 0 || prachStartSymbol == 7)) ||
|
||||
(mu==1 && prachStartSymbol == 0)) prach2+=64; // 32 samples @ 61.44 Ms/s in first symbol of each half subframe (15/30 kHz only)
|
||||
|
||||
if (mu==0) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==1) {
|
||||
dftlen=2048;
|
||||
dft2048(prach2,rxsigF[aa],1);
|
||||
if (prachFormat != 7) { // !=C0
|
||||
dft2048(prach2+4096,rxsigF[aa]+4096,1);
|
||||
reps++;
|
||||
}
|
||||
if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) {
|
||||
dft2048(prach2+4096*2,rxsigF[aa]+4096*2,1);
|
||||
dft2048(prach2+4096*3,rxsigF[aa]+4096*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) {
|
||||
dft2048(prach2+4096*4,rxsigF[aa]+4096*4,1);
|
||||
dft2048(prach2+4096*5,rxsigF[aa]+4096*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 6) {
|
||||
for (int i=6;i<12;i++) dft2048(prach2+(4096*i),rxsigF[aa]+(4096*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}
|
||||
else if (mu==2) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==3) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==4) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
}
|
||||
} else {
|
||||
} else { // threequarter sampling
|
||||
// 40 MHz @ 46.08 Ms/s
|
||||
prach2 = prach[aa] + (3*Ncp);
|
||||
AssertFatal(fp->N_RB_UL <= 107,"cannot do 108..136 PRBs with 3/4 sampling\n");
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft36864(prach2,rxsigF[aa],1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft36864(prach2+73728,rxsigF[aa]+73728,1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 2) {
|
||||
dft36864(prach2+(98304*2),rxsigF[aa]+(98304*2),1);
|
||||
dft36864(prach2+(98304*3),rxsigF[aa]+(98304*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
for (int i=0;i<4;i++) dft9216(prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1);
|
||||
reps=4;
|
||||
}
|
||||
if (prach_fmt >3) {
|
||||
dft1536(prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft1536(prach2+3072,rxsigF[aa]+3072,1);
|
||||
prach2 = prach[aa] + (3*Ncp); // 46.08 is 1.5 * 30.72, times 2 for I/Q
|
||||
if (prach_sequence_length == 0) {
|
||||
AssertFatal(fp->N_RB_UL <= 107,"cannot do 108..136 PRBs with 3/4 sampling\n");
|
||||
if (prachFormat == 0 || prachFormat == 1 || prachFormat == 2) {
|
||||
dftlen=36864;
|
||||
dft36864(prach2,rxsigF[aa],1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft1536(prach2+3072*2,rxsigF[aa]+3072*2,1);
|
||||
dft1536(prach2+3072*3,rxsigF[aa]+3072*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft1536(prach2+3072*4,rxsigF[aa]+3072*4,1);
|
||||
dft1536(prach2+3072*5,rxsigF[aa]+3072*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft1536(prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (prachFormat == 1 || prachFormat == 2) {
|
||||
dft36864(prach2+73728,rxsigF[aa]+73728,1);
|
||||
reps++;
|
||||
}
|
||||
if (prachFormat == 2) {
|
||||
dft36864(prach2+(73728*2),rxsigF[aa]+(73728*2),1);
|
||||
dft36864(prach2+(73728*3),rxsigF[aa]+(73728*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 3) {
|
||||
dftlen=9216;
|
||||
for (int i=0;i<4;i++) dft9216(prach2+(i*9216*2),rxsigF[aa]+(i*9216*2),1);
|
||||
reps=4;
|
||||
}
|
||||
} else {
|
||||
if ((mu==0 &&
|
||||
(prachStartSymbol == 0 || prachStartSymbol == 7)) ||
|
||||
(mu==1 && prachStartSymbol == 0)) prach2+=48; // 24 samples @ 46.08 Ms/s in first symbol of each half subframe (15/30 kHz only)
|
||||
if (mu==0) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==1) {
|
||||
dftlen=1536;
|
||||
dft1536(prach2,rxsigF[aa],1);
|
||||
if (prachFormat != 7) {
|
||||
dft1536(prach2+3072,rxsigF[aa]+3072,1);
|
||||
reps++;
|
||||
}
|
||||
|
||||
if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) {
|
||||
dft1536(prach2+3072*2,rxsigF[aa]+3072*2,1);
|
||||
dft1536(prach2+3072*3,rxsigF[aa]+3072*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) {
|
||||
dft1536(prach2+3072*4,rxsigF[aa]+3072*4,1);
|
||||
dft1536(prach2+3072*5,rxsigF[aa]+3072*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 6) {
|
||||
for (int i=6;i<12;i++) dft1536(prach2+(3072*i),rxsigF[aa]+(3072*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}// mu==1
|
||||
else if (mu==2) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==3) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==4) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
} // short format
|
||||
} // 3/4 sampling
|
||||
} // <=50 MHz BW
|
||||
else if (fp->N_RB_UL <= 273) {
|
||||
if (fp->threequarter_fs==0) {
|
||||
prach2 = prach[aa] + (Ncp<<3);
|
||||
dftlen=98304;
|
||||
//80,90,100 MHz @ 61.44 Ms/s
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2)
|
||||
dft98304(prach2,rxsigF[aa],1);
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft98304(prach2+196608,rxsigF[aa]+196608,1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft98304(prach2+196608,rxsigF[aa]+196608,1);
|
||||
dft98304(prach2+(196608*2),rxsigF[aa]+(196608*2),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
dft24576(prach2+(2*49152),rxsigF[aa]+(2*49152),1);
|
||||
reps=4;
|
||||
dftlen=24576;
|
||||
}
|
||||
if (prach_fmt >3) {
|
||||
dftlen=4096;
|
||||
dft4096(prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft4096(prach2+8192,rxsigF[aa]+8192,1);
|
||||
//80,90,100 MHz @ 122.88 Ms/s
|
||||
|
||||
if (prach_sequence_length == 0) {
|
||||
if (prachFormat == 0 || prachFormat == 1 || prachFormat == 2) {
|
||||
dftlen=98304;
|
||||
dft98304(prach2,rxsigF[aa],1);
|
||||
}
|
||||
if (prachFormat == 1 || prachFormat == 2) {
|
||||
dft98304(prach2+196608,rxsigF[aa]+196608,1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft4096(prach2+8192*2,rxsigF[aa]+8192*2,1);
|
||||
dft4096(prach2+8192*3,rxsigF[aa]+8192*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft4096(prach2+8192*4,rxsigF[aa]+8192*4,1);
|
||||
dft4096(prach2+8192*5,rxsigF[aa]+8192*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft4096(prach2+(8192*i),rxsigF[aa]+(8192*i),1);
|
||||
reps+=6;
|
||||
if (prachFormat == 2) {
|
||||
dft98304(prach2+196608*2,rxsigF[aa]+196608*2,1);
|
||||
dft98304(prach2+(196608*3),rxsigF[aa]+(196608*3),1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 3) {
|
||||
dftlen=24576;
|
||||
for (int i=0;i<4;i++) dft24576(prach2+(i*2*24576),rxsigF[aa]+(i*2*24576),1);
|
||||
reps=4;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ((mu==0 &&
|
||||
(prachStartSymbol == 0 || prachStartSymbol == 7)) ||
|
||||
(mu==1 && prachStartSymbol == 0)) prach2+=128; // 64 samples @ 122.88 Ms/s in first symbol of each half subframe (15/30 kHz only)
|
||||
|
||||
if (mu==0) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==1) {
|
||||
dftlen=4096;
|
||||
dft4096(prach2,rxsigF[aa],1);
|
||||
if (prachFormat != 7) { //!=C0
|
||||
dft4096(prach2+8192,rxsigF[aa]+8192,1);
|
||||
reps++;
|
||||
}
|
||||
|
||||
if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) {
|
||||
dft4096(prach2+8192*2,rxsigF[aa]+8192*2,1);
|
||||
dft4096(prach2+8192*3,rxsigF[aa]+8192*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) {
|
||||
dft4096(prach2+8192*4,rxsigF[aa]+8192*4,1);
|
||||
dft4096(prach2+8192*5,rxsigF[aa]+8192*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 6) {
|
||||
for (int i=6;i<12;i++) dft4096(prach2+(8192*i),rxsigF[aa]+(8192*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}
|
||||
else if (mu==2) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==3) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==4) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
}
|
||||
} else {
|
||||
AssertFatal(fp->N_RB_UL <= 217,"cannot do more than 217 PRBs with 3/4 sampling\n");
|
||||
prach2 = prach[aa] + (6*Ncp);
|
||||
// 80 MHz @ 46.08 Ms/s
|
||||
dftlen=73728;
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft73728(prach2,rxsigF[aa],1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 1 || prach_fmt == 2) {
|
||||
dft73728(prach2+(2*73728),rxsigF[aa]+(2*73728),1);
|
||||
reps++;
|
||||
}
|
||||
if (prach_fmt == 3) {
|
||||
dft73728(prach2+(4*73728),rxsigF[aa]+(4*73728),1);
|
||||
reps=4;
|
||||
dftlen=18432;
|
||||
}
|
||||
|
||||
if (prach_fmt >3) {
|
||||
dftlen=3072;
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
if (prach_fmt != 0xc0) {
|
||||
dft3072(prach2+6144,rxsigF[aa]+6144,1);
|
||||
// 80 MHz @ 92.16 Ms/s
|
||||
if (prach_sequence_length == 0) {
|
||||
if (prachFormat == 0 || prachFormat == 1 || prachFormat == 2) {
|
||||
dftlen=73728;
|
||||
dft73728(prach2,rxsigF[aa],1);
|
||||
reps++;
|
||||
}
|
||||
}
|
||||
if (prach_fmt == 0xa2 || prach_fmt == 0xa3 || prach_fmt == 0xb2 || prach_fmt == 0xb3 || prach_fmt == 0xb4 || prach_fmt == 0xc2) {
|
||||
dft3072(prach2+6144*2,rxsigF[aa]+6144*2,1);
|
||||
dft3072(prach2+6144*3,rxsigF[aa]+6144*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xa3 || prach_fmt == 0xb3 || prach_fmt == 0xc2) {
|
||||
dft3072(prach2+6144*4,rxsigF[aa]+6144*4,1);
|
||||
dft3072(prach2+6144*5,rxsigF[aa]+6144*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prach_fmt == 0xc2) {
|
||||
for (int i=6;i<11;i++) dft3072(prach2+(6144*i),rxsigF[aa]+(6144*i),1);
|
||||
reps+=6;
|
||||
if (prachFormat == 1 || prachFormat == 2) {
|
||||
dft73728(prach2+(2*73728),rxsigF[aa]+(2*73728),1);
|
||||
reps++;
|
||||
}
|
||||
if (prachFormat == 3) {
|
||||
dftlen=18432;
|
||||
for (int i=0;i<4;i++) dft18432(prach2+(i*2*18432),rxsigF[aa]+(i*2*18432),1);
|
||||
reps=4;
|
||||
}
|
||||
} else {
|
||||
if ((mu==0 &&
|
||||
(prachStartSymbol == 0 || prachStartSymbol == 7)) ||
|
||||
(mu==1 && prachStartSymbol == 0)) prach2+=96; // 64 samples @ 122.88 Ms/s in first symbol of each half subframe (15/30 kHz only)
|
||||
|
||||
if (mu==0) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==1) {
|
||||
dftlen=3072;
|
||||
dft3072(prach2,rxsigF[aa],1);
|
||||
if (prachFormat != 7) { //!=C0
|
||||
dft3072(prach2+6144,rxsigF[aa]+6144,1);
|
||||
reps++;
|
||||
}
|
||||
|
||||
if (prachFormat == 1 || prachFormat == 2 || prachFormat == 4 || prachFormat == 5 || prachFormat == 6 || prachFormat == 8) {
|
||||
dft3072(prach2+6144*2,rxsigF[aa]+6144*2,1);
|
||||
dft3072(prach2+6144*3,rxsigF[aa]+6144*3,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 2 || prachFormat == 5 || prachFormat == 6) {
|
||||
dft3072(prach2+6144*4,rxsigF[aa]+6144*4,1);
|
||||
dft3072(prach2+6144*5,rxsigF[aa]+6144*5,1);
|
||||
reps+=2;
|
||||
}
|
||||
if (prachFormat == 6) {
|
||||
for (int i=6;i<12;i++) dft3072(prach2+(6144*i),rxsigF[aa]+(6144*i),1);
|
||||
reps+=6;
|
||||
}
|
||||
}
|
||||
else if (mu==2) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==3) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
else if (mu==4) AssertFatal(1==0,"Shouldn't get here\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -350,7 +511,7 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
for (int j=0;j<N_ZC<<1;j++,k2++) {
|
||||
if (k2==(dftlen<<1)) k2=0;
|
||||
rxsigF_tmp[j] = rxsigF2[k2];
|
||||
for (int i=1;i<reps;i++) rxsigF_tmp[j] += rxsigF2[k2+(i*N_ZC<<1)];
|
||||
for (int i=1;i<reps;i++) rxsigF_tmp[j] += rxsigF2[k2+(i*dftlen<<1)];
|
||||
}
|
||||
memcpy((void*)rxsigF2,(void *)rxsigF_tmp,N_ZC<<2);
|
||||
|
||||
@@ -359,6 +520,7 @@ void rx_nr_prach_ru(RU_t *ru,
|
||||
}
|
||||
|
||||
void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu,
|
||||
int frame,
|
||||
int subframe,
|
||||
uint16_t *max_preamble,
|
||||
@@ -369,11 +531,11 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
|
||||
int i;
|
||||
|
||||
nfapi_nr_prach_config_t *cfg=&gNB->gNB_config.prach_config;
|
||||
NR_DL_FRAME_PARMS *fp;
|
||||
lte_frame_type_t frame_type;
|
||||
|
||||
uint16_t rootSequenceIndex;
|
||||
uint8_t prach_ConfigIndex;
|
||||
uint8_t Ncs_config;
|
||||
int numrootSequenceIndex;
|
||||
uint8_t restricted_set;
|
||||
uint8_t n_ra_prb;
|
||||
int16_t *prachF=NULL;
|
||||
@@ -403,63 +565,46 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
int16_t prach_ifft_tmp[2048*2] __attribute__((aligned(32)));
|
||||
int32_t *prach_ifft=(int32_t*)NULL;
|
||||
|
||||
nr_frequency_range_e freq_range;
|
||||
|
||||
AssertFatal(gNB!=NULL,"Can only be called from gNB\n");
|
||||
fp = &gNB->frame_parms;
|
||||
nb_rx = fp->nb_antennas_rx;
|
||||
|
||||
frame_type = fp->frame_type;
|
||||
freq_range = fp->freq_range;
|
||||
rootSequenceIndex = fp->prach_config_common.rootSequenceIndex;
|
||||
prach_ConfigIndex = fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
Ncs_config = fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
|
||||
restricted_set = fp->prach_config_common.prach_ConfigInfo.highSpeedFlag;
|
||||
|
||||
|
||||
uint8_t prach_fmt = get_nr_prach_fmt(prach_ConfigIndex,frame_type,freq_range);
|
||||
uint16_t N_ZC = (prach_fmt <4)?839:139;
|
||||
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
|
||||
fp = &gNB->frame_parms;
|
||||
|
||||
nb_rx = gNB->gNB_config.carrier_config.num_rx_ant.value;
|
||||
|
||||
rootSequenceIndex = cfg->num_prach_fd_occasions_list[0].prach_root_sequence_index.value;
|
||||
numrootSequenceIndex = cfg->num_prach_fd_occasions_list[0].num_root_sequences.value;
|
||||
NCS = prach_pdu->num_cs;//cfg->num_prach_fd_occasions_list[0].prach_zero_corr_conf.value;
|
||||
int prach_sequence_length = cfg->prach_sequence_length.value;
|
||||
|
||||
int msg1_frequencystart = cfg->num_prach_fd_occasions_list[0].k1.value;
|
||||
// int num_unused_root_sequences = cfg->num_prach_fd_occasions_list[0].num_unused_root_sequences.value;
|
||||
// cfg->num_prach_fd_occasions_list[0].unused_root_sequences_list
|
||||
|
||||
restricted_set = cfg->restricted_set_config.value;
|
||||
|
||||
AssertFatal(prach_sequence_length == 1, "no support yet for long prachSequenceLength\n");
|
||||
|
||||
|
||||
uint8_t prach_fmt = prach_pdu->prach_format;
|
||||
uint16_t N_ZC = (prach_sequence_length==0)?839:139;
|
||||
|
||||
LOG_D(PHY,"L1 PRACH RX: rooSequenceIndex %d, numRootSeqeuences %d, NCS %d, N_ZC %d \n", rootSequenceIndex,numrootSequenceIndex,NCS,N_ZC);
|
||||
|
||||
prach_ifft = gNB->prach_vars.prach_ifft;
|
||||
prachF = gNB->prach_vars.prachF;
|
||||
if (LOG_DEBUGFLAG(PRACH)){
|
||||
if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for subframe %d, msg1_frequencystart %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,fp->prach_config_common.prach_ConfigInfo.msg1_frequencystart,prach_ConfigIndex,rootSequenceIndex);
|
||||
if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for subframe %d, msg1_frequencystart %d, rootSequenceIndex %d\n", subframe,msg1_frequencystart,rootSequenceIndex);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
int restricted_Type = 0; //this is hardcoded ('0' for restricted_TypeA; and '1' for restricted_TypeB). FIXME
|
||||
if (prach_fmt<3){
|
||||
if (restricted_set == 0) {
|
||||
NCS = NCS_unrestricted_delta_f_RA_125[Ncs_config];
|
||||
} else {
|
||||
if (restricted_Type == 0) NCS = NCS_restricted_TypeA_delta_f_RA_125[Ncs_config]; // for TypeA, this is hardcoded. FIXME
|
||||
if (restricted_Type == 1) NCS = NCS_restricted_TypeB_delta_f_RA_125[Ncs_config]; // for TypeB, this is hardcoded. FIXME
|
||||
}
|
||||
}
|
||||
if (prach_fmt==3){
|
||||
if (restricted_set == 0) {
|
||||
NCS = NCS_unrestricted_delta_f_RA_5[Ncs_config];
|
||||
} else {
|
||||
if (restricted_Type == 0) NCS = NCS_restricted_TypeA_delta_f_RA_5[Ncs_config]; // for TypeA, this is hardcoded. FIXME
|
||||
if (restricted_Type == 1) NCS = NCS_restricted_TypeB_delta_f_RA_5[Ncs_config]; // for TypeB, this is hardcoded. FIXME
|
||||
}
|
||||
}
|
||||
if (prach_fmt>3){
|
||||
NCS = NCS_unrestricted_delta_f_RA_15[Ncs_config];
|
||||
}
|
||||
|
||||
AssertFatal(NCS!=99,"NCS has not been set\n");
|
||||
|
||||
if (gNB) start_meas(&gNB->rx_prach);
|
||||
start_meas(&gNB->rx_prach);
|
||||
|
||||
|
||||
prach_root_sequence_map = (prach_fmt<4) ? prach_root_sequence_map_0_3 : prach_root_sequence_map_abc;
|
||||
prach_root_sequence_map = (cfg->prach_sequence_length.value==0) ? prach_root_sequence_map_0_3 : prach_root_sequence_map_abc;
|
||||
|
||||
// PDP is oversampled, e.g. 1024 sample instead of 839
|
||||
// Adapt the NCS (zero-correlation zones) with oversampling factor e.g. 1024/839
|
||||
@@ -472,6 +617,9 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
|
||||
|
||||
*max_preamble_energy=0;
|
||||
*max_preamble_delay=0;
|
||||
*max_preamble=0;
|
||||
|
||||
for (preamble_index=0 ; preamble_index<64 ; preamble_index++) {
|
||||
|
||||
if (LOG_DEBUGFLAG(PRACH)){
|
||||
@@ -481,7 +629,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
if (restricted_set == 0) {
|
||||
// This is the relative offset in the root sequence table (5.7.2-4 from 36.211) for the given preamble index
|
||||
preamble_offset = ((NCS==0)? preamble_index : (preamble_index/(N_ZC/NCS)));
|
||||
|
||||
|
||||
if (preamble_offset != preamble_offset_old) {
|
||||
preamble_offset_old = preamble_offset;
|
||||
new_dft = 1;
|
||||
@@ -511,13 +659,6 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
// current root depending on rootSequenceIndex
|
||||
int index = (rootSequenceIndex + preamble_offset) % N_ZC;
|
||||
|
||||
if (prach_fmt<4) {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map0_3
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_0_3) / sizeof(prach_root_sequence_map_0_3[0]) );
|
||||
} else {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map4
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_abc) / sizeof(prach_root_sequence_map_abc[0]) );
|
||||
}
|
||||
u = prach_root_sequence_map[index];
|
||||
|
||||
uint16_t n_group_ra = 0;
|
||||
@@ -562,14 +703,21 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
// Compute DFT of RX signal (conjugate input, results in conjugate output) for each new rootSequenceIndex
|
||||
if (LOG_DEBUGFLAG(PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d, NCS %d, NCS_config %d, N_ZC/NCS %d: offset %d, preamble shift %d , en %d)\n",
|
||||
frame,subframe,preamble_index,NCS,Ncs_config,N_ZC/NCS,preamble_offset,preamble_shift,en);
|
||||
if (en>60) LOG_I(PHY,"frame %d, subframe %d : preamble index %d, NCS %d, N_ZC/NCS %d: offset %d, preamble shift %d , en %d)\n",
|
||||
frame,subframe,preamble_index,NCS,N_ZC/NCS,preamble_offset,preamble_shift,en);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"PRACH RX preamble_index %d, preamble_offset %d\n",preamble_index,preamble_offset);
|
||||
|
||||
|
||||
if (new_dft == 1) {
|
||||
new_dft = 0;
|
||||
|
||||
Xu=(int16_t*)gNB->X_u[preamble_offset-first_nonzero_root_idx];
|
||||
|
||||
LOG_D(PHY,"PRACH RX new dft preamble_offset-first_nonzero_root_idx %d\n",preamble_offset-first_nonzero_root_idx);
|
||||
|
||||
|
||||
memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t));
|
||||
|
||||
|
||||
@@ -593,13 +741,13 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
idft1024(prachF,prach_ifft_tmp,1);
|
||||
// compute energy and accumulate over receive antennas
|
||||
for (i=0;i<2048;i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
prach_ifft[i] += ((int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[i<<1] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
} else {
|
||||
idft256(prachF,prach_ifft_tmp,1);
|
||||
log2_ifft_size = 8;
|
||||
// compute energy and accumulate over receive antennas and repetitions for BR
|
||||
for (i=0;i<256;i++)
|
||||
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[(i<<1)] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
prach_ifft[i] += ((int32_t)prach_ifft_tmp[i<<1]*(int32_t)prach_ifft_tmp[(i<<1)] + (int32_t)prach_ifft_tmp[1+(i<<1)]*(int32_t)prach_ifft_tmp[1+(i<<1)])>>10;
|
||||
}
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
@@ -617,7 +765,6 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
for (i=0; i<NCS2; i++) {
|
||||
lev = (int32_t)prach_ifft[(preamble_shift2+i)];
|
||||
levdB = dB_fixed_times10(lev);
|
||||
|
||||
if (levdB>*max_preamble_energy) {
|
||||
*max_preamble_energy = levdB;
|
||||
*max_preamble_delay = i; // Note: This has to be normalized to the 30.72 Ms/s sampling rate
|
||||
@@ -626,6 +773,31 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
}// preamble_index
|
||||
|
||||
|
||||
// The conversion from *max_preamble_delay from TA value is done here.
|
||||
// It is normalized to the 30.72 Ms/s, considering the numerology, N_RB and the sampling rate
|
||||
// See table 6.3.3.1 -1 and -2 in 38211.
|
||||
|
||||
// Format 0, 1, 2: 24576 samples @ 30.72 Ms/s, 98304 samples @ 122.88 Ms/s
|
||||
// By solving:
|
||||
// max_preamble_delay * ( (24576*(fs/30.72M)) / 1024 ) / fs = TA * 16 * 64 / 2^mu * Tc
|
||||
|
||||
// Format 3: 6144 samples @ 30.72 Ms/s, 24576 samples @ 122.88 Ms/s
|
||||
// By solving:
|
||||
// max_preamble_delay * ( (6144*(fs/30.72M)) / 1024 ) / fs = TA * 16 * 64 / 2^mu * Tc
|
||||
|
||||
// Format >3: 2048/2^mu samples @ 30.72 Ms/s, 2048/2^mu * 4 samples @ 122.88 Ms/s
|
||||
// By solving:
|
||||
// max_preamble_delay * ( (2048/2^mu*(fs/30.72M)) / 256 ) / fs = TA * 16 * 64 / 2^mu * Tc
|
||||
uint16_t *TA = max_preamble_delay;
|
||||
int mu = fp->numerology_index;
|
||||
if (cfg->prach_sequence_length.value==0) {
|
||||
if (prach_fmt == 0 || prach_fmt == 1 || prach_fmt == 2) *TA = *TA*3*(1<<mu)/2;
|
||||
else if (prach_fmt == 3) *TA = *TA*3*(1<<mu)/8;
|
||||
}
|
||||
else *TA = *TA/2;
|
||||
|
||||
|
||||
if (LOG_DUMPFLAG(PRACH)) {
|
||||
int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
|
||||
if (en>60) {
|
||||
@@ -644,7 +816,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
|
||||
}
|
||||
} /* LOG_DUMPFLAG(PRACH) */
|
||||
if (gNB) stop_meas(&gNB->rx_prach);
|
||||
stop_meas(&gNB->rx_prach);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,18 +37,6 @@ 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] = {
|
||||
@@ -105,787 +93,3 @@ uint16_t prach_root_sequence_map_abc[138] = {
|
||||
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)
|
||||
};
|
||||
|
||||
@@ -37,12 +37,12 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto_common.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "T.h"
|
||||
|
||||
void init_nr_prach_tables(int N_ZC);
|
||||
|
||||
void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe) {
|
||||
|
||||
/*void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe) {
|
||||
|
||||
FILE *fd;
|
||||
|
||||
@@ -76,23 +76,13 @@ void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe) {
|
||||
fprintf(fd,"prach_config: n_ra_prboffset = %d\n",frame_parms->prach_config_common.prach_ConfigInfo.msg1_frequencystart);
|
||||
fclose(fd);
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
// This function computes the du
|
||||
void nr_fill_du(uint8_t prach_fmt)
|
||||
void nr_fill_du(uint16_t N_ZC,uint16_t *prach_root_sequence_map)
|
||||
{
|
||||
|
||||
uint16_t iu,u,p;
|
||||
uint16_t N_ZC;
|
||||
uint16_t *prach_root_sequence_map;
|
||||
|
||||
if (prach_fmt<4) {
|
||||
N_ZC = 839;
|
||||
prach_root_sequence_map = prach_root_sequence_map_0_3;
|
||||
} else {
|
||||
N_ZC = 139;
|
||||
prach_root_sequence_map = prach_root_sequence_map_abc;
|
||||
}
|
||||
|
||||
for (iu=0; iu<(N_ZC-1); iu++) {
|
||||
|
||||
@@ -107,210 +97,45 @@ void nr_fill_du(uint8_t prach_fmt)
|
||||
|
||||
}
|
||||
|
||||
int is_nr_prach_subframe(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t subframe) {
|
||||
|
||||
uint8_t prach_ConfigIndex = frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
|
||||
/*
|
||||
// For FR1 paired
|
||||
if (((frame%table_6_3_3_2_2_prachConfig_Index[prach_ConfigIndex][2]) == table_6_3_3_2_2_prachConfig_Index[prach_ConfigIndex][3]) &&
|
||||
((table_6_3_3_2_2_prachConfig_Index[prach_ConfigIndex][4]&(1<<subframe)) == 1)) {
|
||||
// using table 6.3.3.2-2: Random access configurations for FR1 and paired spectrum/supplementary uplink
|
||||
return(1);
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
// For FR1 unpaired
|
||||
if (((frame%table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][2]) == table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][3]) &&
|
||||
((table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][4]&(1<<subframe)) == 1)) {
|
||||
// using table 6.3.3.2-2: Random access configurations for FR1 and unpaired
|
||||
return(1);
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
/*
|
||||
// For FR2: FIXME
|
||||
if ((((frame%table_6_3_3_2_4_prachConfig_Index[prach_ConfigIndex][2]) == table_6_3_3_2_4_prachConfig_Index[prach_ConfigIndex][3]) ||
|
||||
((frame%table_6_3_3_2_4_prachConfig_Index[prach_ConfigIndex][2]) == table_6_3_3_2_4_prachConfig_Index[prach_ConfigIndex][4]))
|
||||
&&
|
||||
((table_6_3_3_2_4_prachConfig_Index[prach_ConfigIndex][5]&(1<<subframe)) == 1)) {
|
||||
// using table 6.3.3.2-2: Random access configurations for FR1 and unpaired
|
||||
return(1);
|
||||
} else {
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
int do_prach_rx(NR_DL_FRAME_PARMS *fp,int frame,int slot) {
|
||||
|
||||
int subframe = slot / fp->slots_per_subframe;
|
||||
// when were in the last slot of the subframe and this is a PRACH subframe ,return 1
|
||||
if (((slot%fp->slots_per_subframe) == fp->slots_per_subframe-1)&&
|
||||
(is_nr_prach_subframe(fp,frame,subframe))) return (1);
|
||||
else return(0);
|
||||
}
|
||||
|
||||
uint16_t get_nr_prach_fmt(int prach_ConfigIndex,lte_frame_type_t frame_type, nr_frequency_range_e fr)
|
||||
{
|
||||
|
||||
if (frame_type==FDD) return (table_6_3_3_2_2_prachConfig_Index[prach_ConfigIndex][0]); // if using table 6.3.3.2-2: Random access configurations for FR1 and paired spectrum/supplementary uplink
|
||||
else if (fr==nr_FR1) return (table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][0]); // if using table 6.3.3.2-3: Random access configurations for FR1 and unpaired spectrum
|
||||
else AssertFatal(1==0,"FR2 prach configuration not supported yet\n");
|
||||
// For FR2 not implemented. FIXME
|
||||
}
|
||||
|
||||
void compute_nr_prach_seq(uint16_t rootSequenceIndex,
|
||||
uint8_t prach_ConfigIndex,
|
||||
uint8_t zeroCorrelationZoneConfig,
|
||||
uint8_t highSpeedFlag,
|
||||
lte_frame_type_t frame_type,
|
||||
nr_frequency_range_e fr,
|
||||
uint32_t X_u[64][839])
|
||||
{
|
||||
void compute_nr_prach_seq(uint8_t short_sequence,
|
||||
uint8_t num_sequences,
|
||||
uint8_t rootSequenceIndex,
|
||||
uint32_t X_u[64][839]){
|
||||
|
||||
// Compute DFT of x_u => X_u[k] = x_u(inv(u)*k)^* X_u[k] = exp(j\pi u*inv(u)*k*(inv(u)*k+1)/N_ZC)
|
||||
unsigned int k,inv_u,i,NCS=0,num_preambles;
|
||||
unsigned int k,inv_u,i;
|
||||
int N_ZC;
|
||||
uint8_t prach_fmt = get_nr_prach_fmt(prach_ConfigIndex,frame_type,fr);
|
||||
|
||||
uint16_t *prach_root_sequence_map;
|
||||
uint16_t u, preamble_offset;
|
||||
uint16_t n_shift_ra,n_shift_ra_bar, d_start,numshift;
|
||||
uint8_t not_found;
|
||||
uint16_t u;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_UE_COMPUTE_PRACH, VCD_FUNCTION_IN);
|
||||
|
||||
#ifdef NR_PRACH_DEBUG
|
||||
LOG_I(PHY,"compute_prach_seq: NCS_config %d, prach_fmt %x\n",zeroCorrelationZoneConfig, prach_fmt);
|
||||
#endif
|
||||
LOG_D(PHY,"compute_prach_seq: prach short sequence %x, num_sequences %d, rootSequenceIndex %d\n", short_sequence, num_sequences, rootSequenceIndex);
|
||||
|
||||
|
||||
N_ZC = (prach_fmt < 4) ? 839 : 139;
|
||||
N_ZC = (short_sequence) ? 139 : 839;
|
||||
//init_prach_tables(N_ZC); //moved to phy_init_lte_ue/eNB, since it takes to long in real-time
|
||||
|
||||
init_nr_prach_tables(N_ZC);
|
||||
|
||||
if (prach_fmt < 4) {
|
||||
prach_root_sequence_map = prach_root_sequence_map_0_3;
|
||||
} else {
|
||||
if (short_sequence) {
|
||||
// FIXME cannot be reached
|
||||
prach_root_sequence_map = prach_root_sequence_map_abc;
|
||||
}
|
||||
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_I( PHY, "compute_prach_seq: done init prach_tables\n" );
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
int restricted_Type = 0; //this is hardcoded ('0' for restricted_TypeA; and '1' for restricted_TypeB). FIXME
|
||||
|
||||
if (highSpeedFlag== 0) {
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_I(PHY,"Low speed prach : NCS_config %d\n",zeroCorrelationZoneConfig);
|
||||
#endif
|
||||
|
||||
AssertFatal(zeroCorrelationZoneConfig<=15,
|
||||
"FATAL, Illegal Ncs_config for unrestricted format %"PRIu8"\n", zeroCorrelationZoneConfig );
|
||||
if (prach_fmt<3) NCS = NCS_unrestricted_delta_f_RA_125[zeroCorrelationZoneConfig];
|
||||
if (prach_fmt==3) NCS = NCS_unrestricted_delta_f_RA_5[zeroCorrelationZoneConfig];
|
||||
if (prach_fmt>3) NCS = NCS_unrestricted_delta_f_RA_15[zeroCorrelationZoneConfig];
|
||||
|
||||
num_preambles = (NCS==0) ? 64 : ((64*NCS)/N_ZC);
|
||||
|
||||
if (NCS>0) num_preambles++;
|
||||
|
||||
preamble_offset = 0;
|
||||
} else {
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_I( PHY, "high speed prach : NCS_config %"PRIu8"\n", zeroCorrelationZoneConfig );
|
||||
#endif
|
||||
|
||||
AssertFatal(zeroCorrelationZoneConfig<=14,
|
||||
"FATAL, Illegal Ncs_config for restricted format %"PRIu8"\n", zeroCorrelationZoneConfig );
|
||||
if (prach_fmt<3){
|
||||
if (restricted_Type == 0) NCS = NCS_restricted_TypeA_delta_f_RA_125[zeroCorrelationZoneConfig]; // for TypeA, this is hardcoded. FIXME
|
||||
if (restricted_Type == 1) NCS = NCS_restricted_TypeB_delta_f_RA_125[zeroCorrelationZoneConfig]; // for TypeB, this is hardcoded. FIXME
|
||||
}
|
||||
if (prach_fmt==3){
|
||||
if (restricted_Type == 0) NCS = NCS_restricted_TypeA_delta_f_RA_5[zeroCorrelationZoneConfig]; // for TypeA, this is hardcoded. FIXME
|
||||
if (restricted_Type == 1) NCS = NCS_restricted_TypeB_delta_f_RA_5[zeroCorrelationZoneConfig]; // for TypeB, this is hardcoded. FIXME
|
||||
}
|
||||
if (prach_fmt>3){
|
||||
|
||||
}
|
||||
|
||||
nr_fill_du(prach_fmt);
|
||||
|
||||
num_preambles = 64; // compute ZC sequence for 64 possible roots
|
||||
// find first non-zero shift root (stored in preamble_offset)
|
||||
not_found = 1;
|
||||
preamble_offset = 0;
|
||||
|
||||
while (not_found == 1) {
|
||||
// current root depending on rootSequenceIndex
|
||||
int index = (rootSequenceIndex + preamble_offset) % N_ZC;
|
||||
|
||||
if (prach_fmt<4) {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map0_3
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_0_3) / sizeof(prach_root_sequence_map_0_3[0]) );
|
||||
} else {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map4
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_abc) / sizeof(prach_root_sequence_map_abc[0]) );
|
||||
}
|
||||
|
||||
u = prach_root_sequence_map[index];
|
||||
|
||||
uint16_t n_group_ra = 0;
|
||||
|
||||
if ( (nr_du[u]<(N_ZC/3)) && (nr_du[u]>=NCS) ) {
|
||||
n_shift_ra = nr_du[u]/NCS;
|
||||
d_start = (nr_du[u]<<1) + (n_shift_ra * NCS);
|
||||
n_group_ra = N_ZC/d_start;
|
||||
n_shift_ra_bar = max(0,(N_ZC-(nr_du[u]<<1)-(n_group_ra*d_start))/N_ZC);
|
||||
} else if ( (nr_du[u]>=(N_ZC/3)) && (nr_du[u]<=((N_ZC - NCS)>>1)) ) {
|
||||
n_shift_ra = (N_ZC - (nr_du[u]<<1))/NCS;
|
||||
d_start = N_ZC - (nr_du[u]<<1) + (n_shift_ra * NCS);
|
||||
n_group_ra = nr_du[u]/d_start;
|
||||
n_shift_ra_bar = min(n_shift_ra,max(0,(nr_du[u]- (n_group_ra*d_start))/NCS));
|
||||
} else {
|
||||
n_shift_ra = 0;
|
||||
n_shift_ra_bar = 0;
|
||||
}
|
||||
|
||||
// This is the number of cyclic shifts for the current root u
|
||||
numshift = (n_shift_ra*n_group_ra) + n_shift_ra_bar;
|
||||
|
||||
// skip to next root and recompute parameters if numshift==0
|
||||
if (numshift>0)
|
||||
not_found = 0;
|
||||
else
|
||||
preamble_offset++;
|
||||
}
|
||||
prach_root_sequence_map = prach_root_sequence_map_0_3;
|
||||
}
|
||||
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_D( PHY, "compute_prach_seq: done init prach_tables\n" );
|
||||
|
||||
if (NCS>0)
|
||||
LOG_I( PHY, "Initializing %u preambles for PRACH (NCS_config %"PRIu8", NCS %u, N_ZC/NCS %u)\n",
|
||||
num_preambles, zeroCorrelationZoneConfig, NCS, N_ZC/NCS );
|
||||
for (i=0; i<num_sequences; i++) {
|
||||
int index = (rootSequenceIndex+i) % (N_ZC-1);
|
||||
|
||||
#endif
|
||||
|
||||
for (i=0; i<num_preambles; i++) {
|
||||
int index = (rootSequenceIndex+i+preamble_offset) % N_ZC;
|
||||
|
||||
if (prach_fmt<4) {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map0_3
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_0_3) / sizeof(prach_root_sequence_map_0_3[0]) );
|
||||
} else {
|
||||
if (short_sequence) {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map4
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_abc) / sizeof(prach_root_sequence_map_abc[0]) );
|
||||
} else {
|
||||
// prach_root_sequence_map points to prach_root_sequence_map0_3
|
||||
DevAssert( index < sizeof(prach_root_sequence_map_0_3) / sizeof(prach_root_sequence_map_0_3[0]) );
|
||||
}
|
||||
|
||||
u = prach_root_sequence_map[index];
|
||||
@@ -322,8 +147,8 @@ void compute_nr_prach_seq(uint16_t rootSequenceIndex,
|
||||
// for the unrestricted case X_u[0] is the first root indicated by the rootSequenceIndex
|
||||
|
||||
for (k=0; k<N_ZC; k++) {
|
||||
// 420 is the multiplicative inverse of 2 (required since ru is exp[j 2\pi n])
|
||||
X_u[i][k] = ((uint32_t*)nr_ru)[(((k*(1+(inv_u*k)))%N_ZC)*420)%N_ZC];
|
||||
// multiply by inverse of 2 (required since ru is exp[j 2\pi n])
|
||||
X_u[i][k] = ((uint32_t*)nr_ru)[(((k*(1+(inv_u*k)))%N_ZC)*nr_ZC_inv[2])%N_ZC];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,18 +111,6 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t abstraction_flag,
|
||||
uint16_t N_RB);
|
||||
|
||||
void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int subframe,
|
||||
uint16_t *max_preamble,
|
||||
uint16_t *max_preamble_energy,
|
||||
uint16_t *max_preamble_delay
|
||||
);
|
||||
|
||||
void rx_nr_prach_ru(RU_t *ru,
|
||||
int frame,
|
||||
int subframe);
|
||||
|
||||
void nr_decode_pucch1(int32_t **rxdataF,
|
||||
pucch_GroupHopping_t pucch_GroupHopping,
|
||||
uint32_t n_id, // hoppingID higher layer parameter
|
||||
@@ -143,5 +131,33 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t* uci_pdu,
|
||||
nfapi_nr_pucch_pdu_t* pucch_pdu);
|
||||
|
||||
void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu,
|
||||
int frame,
|
||||
int subframe,
|
||||
uint16_t *max_preamble,
|
||||
uint16_t *max_preamble_energy,
|
||||
uint16_t *max_preamble_delay
|
||||
);
|
||||
|
||||
void rx_nr_prach_ru(RU_t *ru,
|
||||
int prach_fmt,
|
||||
int numRA,
|
||||
int prachStartSymbol,
|
||||
int frame,
|
||||
int subframe);
|
||||
|
||||
void nr_fill_prach_ru(RU_t *ru,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu);
|
||||
|
||||
int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame,int slot, int numRA, find_type_t type);
|
||||
int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type);
|
||||
|
||||
void init_prach_list(PHY_VARS_gNB *gNB);
|
||||
void init_prach_ru_list(RU_t *ru);
|
||||
void free_nr_ru_prach_entry(RU_t *ru,
|
||||
int prach_id);
|
||||
|
||||
#endif /*__NR_TRANSPORT__H__*/
|
||||
|
||||
@@ -62,9 +62,9 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
@param start_rb The starting RB in the RB allocation (used for Resource Allocation Type 1 in NR)
|
||||
@param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR)
|
||||
@param frame_parms, Pointer to frame descriptor structure
|
||||
@param is_dmrs_symbol, flag to indicate wether this OFDM symbol contains DMRS symbols or not.
|
||||
|
||||
*/
|
||||
|
||||
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
unsigned char symbol,
|
||||
@@ -205,10 +205,17 @@ uint32_t nr_get_code_rate_ul(uint8_t Imcs, uint8_t table_idx);
|
||||
|
||||
uint32_t nr_get_code_rate_dl(uint8_t Imcs, uint8_t table_idx);
|
||||
|
||||
void nr_fill_prach(PHY_VARS_gNB *gNB,
|
||||
int SFN,
|
||||
int Slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu);
|
||||
|
||||
void rx_nr_prach(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu,
|
||||
int frame,
|
||||
int subframe,
|
||||
uint16_t *max_preamble,
|
||||
uint16_t *max_preamble_energy,
|
||||
uint16_t *max_preamble_delay
|
||||
);
|
||||
|
||||
|
||||
@@ -1648,8 +1648,6 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
|
||||
*/
|
||||
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
|
||||
|
||||
uint16_t get_nr_prach_fmt(int prach_ConfigIndex,lte_frame_type_t frame_type, nr_frequency_range_e fr);
|
||||
|
||||
/*!
|
||||
\brief Helper for MAC, returns frequency index of PRACH resource in TDD for a particular configuration index
|
||||
@param frame_parms Pointer to NR_DL_FRAME_PARMS structure
|
||||
@@ -1673,8 +1671,13 @@ void compute_prach_seq(uint16_t rootSequenceIndex,
|
||||
lte_frame_type_t frame_type,
|
||||
uint32_t X_u[64][839]);
|
||||
|
||||
void compute_nr_prach_seq(uint8_t short_sequence,
|
||||
uint8_t num_sequences,
|
||||
uint8_t rootSequenceIndex,
|
||||
uint32_t X_u[64][839]);
|
||||
|
||||
void init_prach_tables(int N_ZC);
|
||||
void init_nr_prach_tables(int N_ZC);
|
||||
|
||||
void init_unscrambling_lut(void);
|
||||
void init_scrambling_lut(void);
|
||||
|
||||
@@ -35,12 +35,59 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
|
||||
int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
|
||||
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_NR_ULSCH_MAX; i++) {
|
||||
AssertFatal(gNB->ulsch[i]!=NULL,"gNB->ulsch[%d] is null\n",i);
|
||||
AssertFatal(gNB->ulsch[i][0]!=NULL,"gNB->ulsch[%d][0] is null\n",i);
|
||||
LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i][0]->harq_mask,gNB->ulsch[i][0]->rnti,first_free_index);
|
||||
if ((gNB->ulsch[i][0]->harq_mask >0) &&
|
||||
(gNB->ulsch[i][0]->rnti==rnti)) return i;
|
||||
else if ((gNB->ulsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
|
||||
}
|
||||
if (type == SEARCH_EXIST) return -1;
|
||||
if (first_free_index != -1)
|
||||
gNB->ulsch[first_free_index][0]->rnti = 0;
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
int frame,
|
||||
int slot,
|
||||
nfapi_nr_pusch_pdu_t *ulsch_pdu) {
|
||||
|
||||
|
||||
int ulsch_id = find_nr_ulsch(ulsch_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
|
||||
AssertFatal( (ulsch_id>=0) && (ulsch_id<NUMBER_OF_NR_ULSCH_MAX),
|
||||
"illegal or no ulsch_id found!!! rnti %04x ulsch_id %d\n",ulsch_pdu->rnti,ulsch_id);
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id][0];
|
||||
int harq_pid = ulsch_pdu->pusch_data.harq_process_id;
|
||||
ulsch->rnti = ulsch_pdu->rnti;
|
||||
//ulsch->rnti_type;
|
||||
ulsch->harq_mask |= 1<<harq_pid;
|
||||
ulsch->harq_process_id[slot] = harq_pid;
|
||||
|
||||
ulsch->harq_processes[harq_pid]->frame=frame;
|
||||
ulsch->harq_processes[harq_pid]->slot=slot;
|
||||
ulsch->harq_processes[harq_pid]->handled= 0;
|
||||
ulsch->harq_processes[harq_pid]->status= NR_ACTIVE;
|
||||
memcpy((void*)&ulsch->harq_processes[harq_pid]->ulsch_pdu, (void*)ulsch_pdu, sizeof(nfapi_nr_pusch_pdu_t));
|
||||
|
||||
LOG_D(PHY,"Initializing nFAPI for ULSCH, UE %d, harq_pid %d\n",ulsch_id,harq_pid);
|
||||
|
||||
}
|
||||
|
||||
void nr_ulsch_unscrambling(int16_t* llr,
|
||||
uint32_t size,
|
||||
uint8_t q,
|
||||
uint32_t Nid,
|
||||
uint32_t n_RNTI)
|
||||
{
|
||||
uint32_t size,
|
||||
uint8_t q,
|
||||
uint32_t Nid,
|
||||
uint32_t n_RNTI) {
|
||||
|
||||
uint8_t reset;
|
||||
uint32_t x1, x2, s=0;
|
||||
|
||||
|
||||
@@ -219,13 +219,13 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
/// Nfapi ULSCH PDU
|
||||
//nfapi_nr_ul_config_ulsch_pdu ulsch_pdu;
|
||||
ulsch->harq_processes[i]->frame=0;
|
||||
ulsch->harq_processes[i]->subframe=0;
|
||||
ulsch->harq_processes[i]->slot=0;
|
||||
ulsch->harq_processes[i]->round=0;
|
||||
ulsch->harq_processes[i]->TPC=0;
|
||||
ulsch->harq_processes[i]->mimo_mode=0;
|
||||
ulsch->harq_processes[i]->dci_alloc=0;
|
||||
ulsch->harq_processes[i]->rar_alloc=0;
|
||||
ulsch->harq_processes[i]->status=0;
|
||||
ulsch->harq_processes[i]->status=NR_SCH_IDLE;
|
||||
ulsch->harq_processes[i]->subframe_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->subframe_cba_scheduling_flag=0;
|
||||
ulsch->harq_processes[i]->phich_active=0;
|
||||
@@ -421,7 +421,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
|
||||
if (!frame%100)
|
||||
printf("K %d C %d Z %d\n", harq_process->K, harq_process->C, harq_process->Z);
|
||||
printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z);
|
||||
#endif
|
||||
}
|
||||
p_decParams->Z = harq_process->Z;
|
||||
@@ -677,8 +677,8 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
|
||||
// LOG_D(PHY,"[gNB %d] ULSCH: Setting NACK for nr_tti_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
// phy_vars_gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->status,harq_process->round,ulsch->Mlimit,harq_process->TBS);
|
||||
// LOG_D(PHY,"[gNB %d] ULSCH: Setting NACK for nr_tti_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
// phy_vars_gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->status,harq_process->round,ulsch->Mlimit,harq_process->TBS);
|
||||
|
||||
harq_process->handled = 1;
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
@@ -700,6 +700,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
|
||||
// LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d (pid %d, round %d, TBS %d)\n",phy_vars_gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->round,harq_process->TBS);
|
||||
|
||||
|
||||
// Reassembly of Transport block here
|
||||
offset = 0;
|
||||
Kr = harq_process->K;
|
||||
|
||||
@@ -222,7 +222,6 @@ void nr_idft(uint32_t *z, uint32_t Msc_PUSCH)
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
NR_gNB_PUSCH *pusch_vars,
|
||||
unsigned char symbol,
|
||||
@@ -230,6 +229,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu,
|
||||
NR_DL_FRAME_PARMS *frame_parms)
|
||||
{
|
||||
|
||||
unsigned short start_re, re, nb_re_pusch;
|
||||
unsigned char aarx;
|
||||
uint8_t K_ptrs;
|
||||
@@ -259,8 +259,6 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
is_ptrs_symbol_flag = 0;
|
||||
num_ptrs_symbols = 0;
|
||||
|
||||
K_ptrs = (pusch_pdu->pusch_ptrs.ptrs_freq_density)?4:2;
|
||||
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
rxF = (int16_t *)&rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size];
|
||||
@@ -285,6 +283,8 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
is_dmrs_re = 0;
|
||||
|
||||
if ( ((pusch_pdu->pdu_bit_map)>>2)& 0x01 ) {
|
||||
|
||||
K_ptrs = (pusch_pdu->pusch_ptrs.ptrs_freq_density)?4:2;
|
||||
is_ptrs_symbol_flag = is_ptrs_symbol(symbol,
|
||||
(start_re + re)%frame_parms->ofdm_symbol_size,
|
||||
n_rnti,
|
||||
@@ -304,7 +304,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
}
|
||||
|
||||
#ifdef DEBUG_RB_EXT
|
||||
printf("re = %d, is_dmrs_symbol_flag = %d, symbol = %d\n", re, is_dmrs_symbol_flag, symbol);
|
||||
printf("re = %d, symbol = %d\n", re, symbol);
|
||||
#endif
|
||||
|
||||
if ( is_dmrs_re == 0 && is_ptrs_symbol_flag == 0) {
|
||||
@@ -315,8 +315,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
ul_ch0_ptrs_ext[ul_ch0_ptrs_ext_index] = ul_ch0_ptrs[ul_ch0_ptrs_index];
|
||||
|
||||
#ifdef DEBUG_RB_EXT
|
||||
printf("rxF_ext[%d] = %d\n", rxF_ext_index, rxF_ext[rxF_ext_index]);
|
||||
printf("rxF_ext[%d] = %d\n", rxF_ext_index+1, rxF_ext[rxF_ext_index+1]);
|
||||
printf("rxF_ext[%d] = (%d,%d)\n", rxF_ext_index>>1, rxF_ext[rxF_ext_index],rxF_ext[rxF_ext_index+1]);
|
||||
#endif
|
||||
|
||||
ul_ch0_ext_index++;
|
||||
@@ -372,7 +371,6 @@ void nr_ulsch_scale_channel(int **ul_ch_estimates_ext,
|
||||
nb_rb = (2*nb_rb)/3;
|
||||
}
|
||||
|
||||
|
||||
for (rb=0;rb<nb_rb;rb++) {
|
||||
|
||||
ul_ch128[0] = _mm_mulhi_epi16(ul_ch128[0], ch_amp128);
|
||||
@@ -446,7 +444,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
|
||||
symbol_mod = (symbol>=(7-frame_parms->Ncp)) ? symbol-(7-frame_parms->Ncp) : symbol;
|
||||
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_gNB; aatx++)
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_gNB; aatx++) {
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
//clear average level
|
||||
avg128U = vdupq_n_s32(0);
|
||||
@@ -489,8 +487,7 @@ void nr_ulsch_channel_level(int **ul_ch_estimates_ext,
|
||||
((int32_t*)&avg128U)[2] +
|
||||
((int32_t*)&avg128U)[3] ) / (nb_rb*nre);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -516,12 +513,12 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
ul_ch = (int16_t *)&ul_ch_estimates_ext[0][symbol*nb_rb*12];
|
||||
|
||||
printf("--------------------symbol = %d, mod_order = %d, output_shift = %d-----------------------\n", symbol, mod_order, output_shift);
|
||||
printf("----------------Before compansation------------------\n");
|
||||
printf("----------------Before compensation------------------\n");
|
||||
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx++){
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx+=2){
|
||||
|
||||
printf("rxF[%d] = %d\n", prnt_idx, rxF[prnt_idx]);
|
||||
printf("ul_ch[%d] = %d\n", prnt_idx, ul_ch[prnt_idx]);
|
||||
printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
|
||||
printf("ul_ch[%d] = (%d,%d)\n", prnt_idx>>1, ul_ch[prnt_idx],ul_ch[prnt_idx+1]);
|
||||
|
||||
}
|
||||
|
||||
@@ -709,7 +706,6 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
if (rho) {
|
||||
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
rho128 = (__m128i *)&rho[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
ul_ch128 = (__m128i *)&ul_ch_estimates_ext[aarx][symbol*frame_parms->N_RB_UL*12];
|
||||
@@ -791,7 +787,6 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
#elif defined(__arm__)
|
||||
|
||||
|
||||
unsigned short rb;
|
||||
unsigned char aatx,aarx,symbol_mod,is_dmrs_symbol=0;
|
||||
|
||||
@@ -993,9 +988,9 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
printf("----------------After compansation------------------\n");
|
||||
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx++){
|
||||
for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx+=2){
|
||||
|
||||
printf("rxF[%d] = %d\n", prnt_idx, rxF[prnt_idx]);
|
||||
printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
|
||||
|
||||
}
|
||||
|
||||
@@ -1008,9 +1003,9 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
|
||||
|
||||
printf("----------------After computation------------------\n");
|
||||
|
||||
for (print_idx=0;print_idx<12*nb_rb*2;print_idx++){
|
||||
for (print_idx=0;print_idx<12*nb_rb*2;print_idx+=2){
|
||||
|
||||
printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
|
||||
printf("ch_mag[%d] = (%d,%d)\n", print_idx>>1, ch_mag[print_idx],ch_mag[print_idx+1]);
|
||||
|
||||
}
|
||||
|
||||
@@ -1026,17 +1021,17 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
unsigned char harq_pid)
|
||||
{
|
||||
|
||||
uint8_t first_symbol_flag, aarx, aatx, dmrs_symbol_flag, ptrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
|
||||
uint8_t aarx, aatx, dmrs_symbol_flag, ptrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
|
||||
uint32_t nb_re_pusch, bwp_start_subcarrier;
|
||||
uint8_t L_ptrs = 0; // PTRS parameter
|
||||
int avgs;
|
||||
int avg[4];
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[UE_id][0]->harq_processes[harq_pid]->ulsch_pdu;
|
||||
uint8_t nodata_dmrs = 1; // FIXME to be properly configured from fapi
|
||||
|
||||
dmrs_symbol_flag = 0;
|
||||
ptrs_symbol_flag = 0;
|
||||
first_symbol_flag = 0;
|
||||
gNB->pusch_vars[UE_id]->ptrs_sc_per_ofdm_symbol = 0;
|
||||
|
||||
if(symbol == rel15_ul->start_symbol_index){
|
||||
@@ -1044,7 +1039,6 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
gNB->pusch_vars[UE_id]->dmrs_symbol = 0;
|
||||
gNB->pusch_vars[UE_id]->cl_done = 0;
|
||||
gNB->pusch_vars[UE_id]->ptrs_symbols = 0;
|
||||
first_symbol_flag = 1;
|
||||
|
||||
if ( ((rel15_ul->pdu_bit_map)>>2)& 0x01 ) { // if there is ptrs pdu
|
||||
L_ptrs = 1<<(rel15_ul->pusch_ptrs.ptrs_time_density);
|
||||
@@ -1064,7 +1058,12 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
dmrs_symbol_flag = ((rel15_ul->ul_dmrs_symb_pos)>>symbol)&0x01;
|
||||
|
||||
if (dmrs_symbol_flag == 1){
|
||||
nb_re_pusch = rel15_ul->rb_size * ((rel15_ul->dmrs_config_type==pusch_dmrs_type1)?6:8);
|
||||
if (((rel15_ul->ul_dmrs_symb_pos)>>((symbol+1)%frame_parms->symbols_per_slot))&0x01)
|
||||
AssertFatal(1==0,"Double DMRS configuration is not yet supported\n");
|
||||
if (nodata_dmrs)
|
||||
nb_re_pusch = 0;
|
||||
else
|
||||
nb_re_pusch = rel15_ul->rb_size * ((rel15_ul->dmrs_config_type==pusch_dmrs_type1)?6:8);
|
||||
gNB->pusch_vars[UE_id]->dmrs_symbol = symbol;
|
||||
} else {
|
||||
nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
|
||||
@@ -1106,70 +1105,75 @@ void nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//--------------------- RBs extraction ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
|
||||
gNB->pusch_vars[UE_id],
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul,
|
||||
frame_parms);
|
||||
if (nb_re_pusch > 0) {
|
||||
|
||||
nr_ulsch_scale_channel(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
gNB->ulsch[UE_id],
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul->rb_size,
|
||||
rel15_ul->dmrs_config_type);
|
||||
|
||||
|
||||
if (first_symbol_flag==1) {
|
||||
|
||||
nr_ulsch_channel_level(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
avg,
|
||||
symbol,
|
||||
nb_re_pusch,
|
||||
rel15_ul->rb_size);
|
||||
avgs = 0;
|
||||
|
||||
for (aatx=0;aatx<frame_parms->nb_antennas_tx;aatx++)
|
||||
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
|
||||
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
|
||||
|
||||
gNB->pusch_vars[UE_id]->log2_maxh = (log2_approx(avgs)/2)+1;
|
||||
|
||||
}
|
||||
|
||||
nr_ulsch_channel_compensation(gNB->pusch_vars[UE_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
gNB->pusch_vars[UE_id]->rxdataF_comp,
|
||||
(frame_parms->nb_antennas_tx>1) ? gNB->pusch_vars[UE_id]->rho : NULL,
|
||||
frame_parms,
|
||||
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
|
||||
gNB->pusch_vars[UE_id],
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul->qam_mod_order,
|
||||
rel15_ul->rb_size,
|
||||
gNB->pusch_vars[UE_id]->log2_maxh);
|
||||
rel15_ul,
|
||||
frame_parms);
|
||||
|
||||
nr_ulsch_scale_channel(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
gNB->ulsch[UE_id],
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul->rb_size,
|
||||
rel15_ul->dmrs_config_type);
|
||||
|
||||
|
||||
if (gNB->pusch_vars[UE_id]->cl_done==0) {
|
||||
|
||||
nr_ulsch_channel_level(gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
frame_parms,
|
||||
avg,
|
||||
symbol,
|
||||
nb_re_pusch,
|
||||
rel15_ul->rb_size);
|
||||
|
||||
avgs = 0;
|
||||
|
||||
for (aatx=0;aatx<frame_parms->nb_antennas_tx;aatx++)
|
||||
for (aarx=0;aarx<frame_parms->nb_antennas_rx;aarx++)
|
||||
avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
|
||||
|
||||
gNB->pusch_vars[UE_id]->log2_maxh = (log2_approx(avgs)/2)+1;
|
||||
gNB->pusch_vars[UE_id]->cl_done = 1;
|
||||
}
|
||||
|
||||
nr_ulsch_channel_compensation(gNB->pusch_vars[UE_id]->rxdataF_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_estimates_ext,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
gNB->pusch_vars[UE_id]->rxdataF_comp,
|
||||
(frame_parms->nb_antennas_tx>1) ? gNB->pusch_vars[UE_id]->rho : NULL,
|
||||
frame_parms,
|
||||
symbol,
|
||||
dmrs_symbol_flag,
|
||||
rel15_ul->qam_mod_order,
|
||||
rel15_ul->rb_size,
|
||||
gNB->pusch_vars[UE_id]->log2_maxh);
|
||||
|
||||
#ifdef NR_SC_FDMA
|
||||
nr_idft(&((uint32_t*)gNB->pusch_vars[UE_id]->rxdataF_ext[0])[symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB], nb_re_pusch);
|
||||
nr_idft(&((uint32_t*)gNB->pusch_vars[UE_id]->rxdataF_ext[0])[symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB], nb_re_pusch);
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------
|
||||
//-------------------- LLRs computation --------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
nr_ulsch_compute_llr(&gNB->pusch_vars[UE_id]->rxdataF_comp[0][symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB],
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
&gNB->pusch_vars[UE_id]->llr[gNB->pusch_vars[UE_id]->rxdataF_ext_offset * rel15_ul->qam_mod_order],
|
||||
rel15_ul->rb_size,
|
||||
nb_re_pusch,
|
||||
symbol,
|
||||
rel15_ul->qam_mod_order);
|
||||
nr_ulsch_compute_llr(&gNB->pusch_vars[UE_id]->rxdataF_comp[0][symbol * rel15_ul->rb_size * NR_NB_SC_PER_RB],
|
||||
gNB->pusch_vars[UE_id]->ul_ch_mag0,
|
||||
gNB->pusch_vars[UE_id]->ul_ch_magb0,
|
||||
&gNB->pusch_vars[UE_id]->llr[gNB->pusch_vars[UE_id]->rxdataF_ext_offset * rel15_ul->qam_mod_order],
|
||||
rel15_ul->rb_size,
|
||||
nb_re_pusch,
|
||||
symbol,
|
||||
rel15_ul->qam_mod_order);
|
||||
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset = gNB->pusch_vars[UE_id]->rxdataF_ext_offset + nb_re_pusch - gNB->pusch_vars[UE_id]->ptrs_sc_per_ofdm_symbol;
|
||||
}
|
||||
|
||||
gNB->pusch_vars[UE_id]->rxdataF_ext_offset = gNB->pusch_vars[UE_id]->rxdataF_ext_offset + nb_re_pusch;
|
||||
|
||||
}
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
|
||||
void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||
PHY_VARS_NR_UE *ue,
|
||||
module_id_t eNB_id,
|
||||
uint8_t subframe,
|
||||
module_id_t gNB_id,
|
||||
uint8_t subframe,
|
||||
unsigned char clear,
|
||||
short coef)
|
||||
{
|
||||
@@ -60,8 +60,8 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||
temp = 0;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_rx; aa++) {
|
||||
Re = ((int16_t*)ue->pbch_vars[eNB_id]->dl_ch_estimates_time[aa])[(i<<1)];
|
||||
Im = ((int16_t*)ue->pbch_vars[eNB_id]->dl_ch_estimates_time[aa])[1+(i<<1)];
|
||||
Re = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[(i<<1)];
|
||||
Im = ((int16_t*)ue->pbch_vars[gNB_id]->dl_ch_estimates_time[aa])[1+(i<<1)];
|
||||
temp += (Re*Re/2) + (Im*Im/2);
|
||||
}
|
||||
|
||||
@@ -111,11 +111,11 @@ void nr_adjust_synch_ue(NR_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
}
|
||||
|
||||
if ( ue->rx_offset < 0 )
|
||||
ue->rx_offset += frame_parms->samples_per_frame;
|
||||
if (ue->rx_offset < 0)
|
||||
ue->rx_offset += frame_parms->samples_per_frame;
|
||||
|
||||
if ( ue->rx_offset >= frame_parms->samples_per_frame )
|
||||
ue->rx_offset -= frame_parms->samples_per_frame;
|
||||
if (ue->rx_offset >= frame_parms->samples_per_frame)
|
||||
ue->rx_offset -= frame_parms->samples_per_frame;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ void phy_adjust_gain_nr(PHY_VARS_NR_UE *ue,
|
||||
uint32_t rx_power_fil_dB,
|
||||
uint8_t eNB_id);
|
||||
|
||||
int16_t get_nr_PL(PHY_VARS_NR_UE *ue,uint8_t gNB_index);
|
||||
int16_t get_nr_PL(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -55,8 +55,9 @@ void print_ints(char *s,int *x)
|
||||
}
|
||||
#endif
|
||||
|
||||
int16_t get_nr_PL(PHY_VARS_NR_UE *ue,uint8_t gNB_index)
|
||||
{
|
||||
int16_t get_nr_PL(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index){
|
||||
|
||||
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||
|
||||
/*
|
||||
if (ue->frame_parms.mode1_flag == 1)
|
||||
@@ -75,9 +76,6 @@ int16_t get_nr_PL(PHY_VARS_NR_UE *ue,uint8_t gNB_index)
|
||||
//(ue->frame_parms.pdsch_config_common.referenceSignalPower*10))/10));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void nr_ue_measurements(PHY_VARS_NR_UE *ue,
|
||||
unsigned int subframe_offset,
|
||||
unsigned char N0_symbol,
|
||||
|
||||
@@ -814,6 +814,8 @@ void nr_pdcch_unscrambling(uint16_t crnti, NR_DL_FRAME_PARMS *frame_parms, uint8
|
||||
|
||||
x2 = (((1<<16)*n_rnti)+n_id); //mod 2^31 is implicit //this is c_init in 38.211 v15.1.0 Section 7.3.2.3
|
||||
|
||||
LOG_D(PHY,"PDCCH Unscrambling x2 %x : n_RNTI %x\n",x2,n_rnti);
|
||||
|
||||
for (i = 0; i < length; i++) {
|
||||
if ((i & 0x1f) == 0) {
|
||||
s = lte_gold_generic(&x1, &x2, reset);
|
||||
|
||||
@@ -215,16 +215,16 @@ void nr_dlsch_unscrambling(int16_t* llr,
|
||||
}
|
||||
|
||||
uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
short *dlsch_llr,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
NR_UE_DLSCH_t *dlsch,
|
||||
NR_DL_UE_HARQ_t *harq_process,
|
||||
uint32_t frame,
|
||||
uint16_t nb_symb_sch,
|
||||
uint8_t nr_tti_rx,
|
||||
uint8_t harq_pid,
|
||||
uint8_t is_crnti,
|
||||
uint8_t llr8_flag)
|
||||
short *dlsch_llr,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
NR_UE_DLSCH_t *dlsch,
|
||||
NR_DL_UE_HARQ_t *harq_process,
|
||||
uint32_t frame,
|
||||
uint16_t nb_symb_sch,
|
||||
uint8_t nr_tti_rx,
|
||||
uint8_t harq_pid,
|
||||
uint8_t is_crnti,
|
||||
uint8_t llr8_flag)
|
||||
{
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -264,7 +264,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
uint8_t dmrs_Type = harq_process->dmrsConfigType;
|
||||
AssertFatal(dmrs_Type == 1 || dmrs_Type == 2,"Illegal dmrs_type %d\n",dmrs_Type);
|
||||
uint8_t nb_re_dmrs = (dmrs_Type==1)?6:4;
|
||||
uint8_t nb_re_dmrs = 12;//(dmrs_Type==1)?6:4;
|
||||
uint16_t dmrs_length = get_num_dmrs(harq_process->dlDmrsSymbPos);
|
||||
AssertFatal(dmrs_length == 1 || dmrs_length == 2,"Illegal dmrs_length %d\n",dmrs_length);
|
||||
|
||||
@@ -318,7 +318,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
uint16_t nb_rb_oh = 0; // it was not computed at UE side even before and set to 0 in nr_compute_tbs
|
||||
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*dmrs_length, nb_rb_oh, harq_process->Nl);
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*dmrs_length, nb_rb_oh, 0, harq_process->Nl);
|
||||
|
||||
A = harq_process->TBS;
|
||||
ret = dlsch->max_ldpc_iterations + 1;
|
||||
@@ -327,7 +327,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, dmrs_length, harq_process->Qm,harq_process->Nl);
|
||||
G = harq_process->G;
|
||||
|
||||
LOG_D(PHY,"DLSCH Decoding, harq_pid %d TBS %d G %d nb_re_dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, nb_re_dmrs,harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
||||
LOG_D(PHY,"DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,A/8,G, nb_re_dmrs,harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
|
||||
|
||||
if ((harq_process->R)<1024)
|
||||
Coderate = (float) (harq_process->R) /(float) 1024;
|
||||
@@ -802,8 +802,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
//nfapi_nr_config_request_t *cfg = &phy_vars_ue->nrUE_config;
|
||||
//uint8_t dmrs_type = cfg->pdsch_config.dmrs_type.value;
|
||||
|
||||
uint8_t nb_re_dmrs = (dmrs_type==1)?6:4;
|
||||
uint16_t length_dmrs = get_num_dmrs(harq_process->dlDmrsSymbPos);
|
||||
uint8_t nb_re_dmrs = 12;//(dmrs_type==1)?6:4;
|
||||
uint16_t length_dmrs = get_num_dmrs(dl_config_pdu->dlDmrsSymbPos);
|
||||
|
||||
uint32_t i,j;
|
||||
// int nbDlProcessing =0;
|
||||
@@ -855,7 +855,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
uint16_t nb_rb_oh = 0; // it was not computed at UE side even before and set to 0 in nr_compute_tbs
|
||||
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*length_dmrs, nb_rb_oh, harq_process->Nl);
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*length_dmrs, nb_rb_oh, 0, harq_process->Nl);
|
||||
|
||||
A = harq_process->TBS;
|
||||
|
||||
@@ -1432,7 +1432,7 @@ void nr_dlsch_decoding_process(void *arg)
|
||||
|
||||
uint16_t nb_rb_oh = 0; // it was not computed at UE side even before and set to 0 in nr_compute_tbs
|
||||
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*length_dmrs, nb_rb_oh, harq_process->Nl);
|
||||
harq_process->TBS = nr_compute_tbs(harq_process->Qm,harq_process->R,nb_rb,nb_symb_sch,nb_re_dmrs*length_dmrs, nb_rb_oh, 0, harq_process->Nl);
|
||||
|
||||
A = harq_process->TBS; //2072 for QPSK 1/3
|
||||
|
||||
@@ -1698,10 +1698,10 @@ void nr_dlsch_decoding_process(void *arg)
|
||||
}
|
||||
|
||||
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
|
||||
(int8_t*)&pl[0],
|
||||
llrProcBuf,
|
||||
p_nrLDPC_procBuf,
|
||||
p_procTime);
|
||||
(int8_t*)&pl[0],
|
||||
llrProcBuf,
|
||||
p_nrLDPC_procBuf,
|
||||
p_procTime);
|
||||
|
||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
|
||||
@@ -155,17 +155,18 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
uint16_t n_tx=1, n_rx=1;
|
||||
int32_t median[16];
|
||||
uint32_t len;
|
||||
|
||||
|
||||
|
||||
switch (type) {
|
||||
case SI_PDSCH:
|
||||
pdsch_vars = &ue->pdsch_vars_SI[eNB_id];
|
||||
pdsch_vars = ue->pdsch_vars_SI;
|
||||
dlsch = &ue->dlsch_SI[eNB_id];
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
beamforming_mode = 0;
|
||||
break;
|
||||
|
||||
case RA_PDSCH:
|
||||
pdsch_vars = &ue->pdsch_vars_ra[eNB_id];
|
||||
pdsch_vars = ue->pdsch_vars_ra;
|
||||
dlsch = &ue->dlsch_ra[eNB_id];
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
beamforming_mode = 0;
|
||||
@@ -174,17 +175,15 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
case PDSCH:
|
||||
pdsch_vars = ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]];
|
||||
dlsch = ue->dlsch[ue->current_thread_id[nr_tti_rx]][eNB_id];
|
||||
|
||||
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
|
||||
dlsch[0]->harq_processes[harq_pid]->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
|
||||
|
||||
//printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status);
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
|
||||
dlsch[0]->harq_processes[harq_pid]->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
|
||||
|
||||
//printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status);
|
||||
LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n",
|
||||
frame,nr_tti_rx,symbol,harq_pid,
|
||||
dlsch[0]->harq_processes[harq_pid]->status,
|
||||
dlsch[1]->harq_processes[harq_pid]->status);
|
||||
|
||||
frame,nr_tti_rx,symbol,harq_pid,
|
||||
dlsch[0]->harq_processes[harq_pid]->status,
|
||||
dlsch[1]->harq_processes[harq_pid]->status);
|
||||
|
||||
if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
|
||||
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE)){
|
||||
codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword;
|
||||
@@ -195,8 +194,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
printf("[DEMOD] I am assuming both TBs are active\n");
|
||||
#endif
|
||||
}
|
||||
else if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
|
||||
(dlsch[1]->harq_processes[harq_pid]->status != ACTIVE) ) {
|
||||
else if ((dlsch[0]->harq_processes[harq_pid]->status == ACTIVE) &&
|
||||
(dlsch[1]->harq_processes[harq_pid]->status != ACTIVE) ) {
|
||||
codeword_TB0 = dlsch[0]->harq_processes[harq_pid]->codeword;
|
||||
dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
|
||||
dlsch1_harq = NULL;
|
||||
@@ -205,8 +204,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
printf("[DEMOD] I am assuming only TB0 is active\n");
|
||||
#endif
|
||||
}
|
||||
else if ((dlsch[0]->harq_processes[harq_pid]->status != ACTIVE) &&
|
||||
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE) ){
|
||||
else if ((dlsch[0]->harq_processes[harq_pid]->status != ACTIVE) &&
|
||||
(dlsch[1]->harq_processes[harq_pid]->status == ACTIVE) ){
|
||||
codeword_TB1 = dlsch[1]->harq_processes[harq_pid]->codeword;
|
||||
dlsch0_harq = dlsch[1]->harq_processes[harq_pid];
|
||||
dlsch1_harq = NULL;
|
||||
@@ -221,17 +220,18 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
beamforming_mode = ue->transmission_mode[eNB_id]<7?0:ue->transmission_mode[eNB_id];
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
LOG_E(PHY,"[UE][FATAL] nr_tti_rx %d: Unknown PDSCH format %d\n",nr_tti_rx,type);
|
||||
AssertFatal(1==0,"[UE][FATAL] nr_tti_rx %d: Unknown PDSCH format %d\n",nr_tti_rx,type);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HARQ
|
||||
printf("[DEMOD] MIMO mode = %d\n", dlsch0_harq->mimo_mode);
|
||||
printf("[DEMOD] cw for TB0 = %d, cw for TB1 = %d\n", codeword_TB0, codeword_TB1);
|
||||
#endif
|
||||
|
||||
|
||||
start_rb = dlsch0_harq->start_rb;
|
||||
nb_rb_pdsch = dlsch0_harq->nb_rb;
|
||||
|
||||
@@ -363,7 +363,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
nr_tti_rx,
|
||||
ue->high_speed_flag,
|
||||
frame_parms);
|
||||
|
||||
|
||||
} /*else if(beamforming_mode>7) {
|
||||
LOG_W(PHY,"dlsch_demodulation: beamforming mode not supported yet.\n");
|
||||
}*/
|
||||
@@ -624,7 +624,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
write_output("rho2_mrc.m","rho2_0",&pdsch_vars[eNB_id]->dl_ch_rho2_ext[0][symbol*frame_parms->N_RB_DL*12],frame_parms->N_RB_DL*12,1,1);//should be almost 0
|
||||
} */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//printf("start compute LLR\n");
|
||||
if (dlsch0_harq->mimo_mode == NR_DUALSTREAM) {
|
||||
@@ -655,19 +655,19 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
// -> // compute @pointer where llrs should filled for this ofdm-symbol
|
||||
|
||||
if (first_symbol_flag==1) pdsch_vars[eNB_id]->llr_offset[symbol-1] = 0;
|
||||
llr_offset_symbol = pdsch_vars[eNB_id]->llr_offset[symbol-1];
|
||||
//pllr_symbol_cw0_deint = (int8_t*)pdsch_vars[eNB_id]->llr[0];
|
||||
//pllr_symbol_cw1_deint = (int8_t*)pdsch_vars[eNB_id]->llr[1];
|
||||
pllr_symbol_layer0 = pdsch_vars[eNB_id]->layer_llr[0];
|
||||
pllr_symbol_layer1 = pdsch_vars[eNB_id]->layer_llr[1];
|
||||
pllr_symbol_layer0 += llr_offset_symbol;
|
||||
pllr_symbol_layer1 += llr_offset_symbol;
|
||||
pllr_symbol_cw0 = pdsch_vars[eNB_id]->llr[0];
|
||||
pllr_symbol_cw1 = pdsch_vars[eNB_id]->llr[1];
|
||||
pllr_symbol_cw0 += llr_offset_symbol;
|
||||
pllr_symbol_cw1 += llr_offset_symbol;
|
||||
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol] = len*dlsch0_harq->Qm + llr_offset_symbol;
|
||||
llr_offset_symbol = pdsch_vars[eNB_id]->llr_offset[symbol-1];
|
||||
//pllr_symbol_cw0_deint = (int8_t*)pdsch_vars[eNB_id]->llr[0];
|
||||
//pllr_symbol_cw1_deint = (int8_t*)pdsch_vars[eNB_id]->llr[1];
|
||||
pllr_symbol_layer0 = pdsch_vars[eNB_id]->layer_llr[0];
|
||||
pllr_symbol_layer1 = pdsch_vars[eNB_id]->layer_llr[1];
|
||||
pllr_symbol_layer0 += llr_offset_symbol;
|
||||
pllr_symbol_layer1 += llr_offset_symbol;
|
||||
pllr_symbol_cw0 = pdsch_vars[eNB_id]->llr[0];
|
||||
pllr_symbol_cw1 = pdsch_vars[eNB_id]->llr[1];
|
||||
pllr_symbol_cw0 += llr_offset_symbol;
|
||||
pllr_symbol_cw1 += llr_offset_symbol;
|
||||
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol] = len*dlsch0_harq->Qm + llr_offset_symbol;
|
||||
|
||||
/*LOG_I(PHY,"compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
|
||||
symbol,
|
||||
@@ -689,13 +689,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
case 2 :
|
||||
if ((rx_type==rx_standard) || (codeword_TB1 == -1)) {
|
||||
nr_dlsch_qpsk_llr(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
pllr_symbol_cw0,
|
||||
symbol,
|
||||
len,
|
||||
first_symbol_flag,
|
||||
nb_rb,
|
||||
beamforming_mode);
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
pllr_symbol_cw0,
|
||||
symbol,
|
||||
len,
|
||||
first_symbol_flag,
|
||||
nb_rb,
|
||||
beamforming_mode);
|
||||
|
||||
} else if (codeword_TB0 == -1){
|
||||
|
||||
@@ -1003,7 +1003,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//nr_dlsch_deinterleaving(symbol,bundle_L,(int16_t*)pllr_symbol_cw0,(int16_t*)pllr_symbol_cw0_deint, nb_rb_pdsch);
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1756,9 +1756,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
uint8_t is_crnti,
|
||||
uint8_t llr8_flag);
|
||||
|
||||
|
||||
|
||||
int32_t generate_nr_prach( PHY_VARS_NR_UE *ue, uint8_t eNB_id, uint8_t subframe, uint16_t Nf );
|
||||
int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t subframe);
|
||||
|
||||
void *dlsch_thread(void *arg);
|
||||
/**@}*/
|
||||
|
||||
@@ -42,8 +42,6 @@
|
||||
#include "UTIL/LISTS/list.h"
|
||||
#endif
|
||||
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
//#include "../LTE_TRANSPORT/transport_common.h"
|
||||
|
||||
// structures below implement 36-211 and 36-212
|
||||
|
||||
@@ -292,6 +292,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
printf("%02x.",a[i]);
|
||||
printf("\n");
|
||||
*/
|
||||
|
||||
if (A > 3824) {
|
||||
// Add 24-bit crc (polynomial A) to payload
|
||||
crc = crc24a(harq_process->a,A)>>8;
|
||||
@@ -321,7 +322,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
memcpy(harq_process->b,harq_process->a,(A/8)+3); // using 3 bytes to mimic the case of 24 bit crc
|
||||
}
|
||||
|
||||
///////////
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -129,6 +129,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
number_dmrs_symbols = 0;
|
||||
uint8_t mapping_type = UE->pusch_config.pusch_TimeDomainResourceAllocation[0]->mappingType;
|
||||
|
||||
|
||||
for (cwd_index = 0;cwd_index < num_of_codewords; cwd_index++) {
|
||||
|
||||
ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_index];
|
||||
@@ -147,11 +148,13 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type,
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
|
||||
ulsch_ue->length_dmrs = number_dmrs_symbols; // pusch.MaxLenght is redundant here as number_dmrs_symbols
|
||||
// contains all dmrs symbols even for double symbol dmrs
|
||||
ulsch_ue->rnti = n_rnti;
|
||||
ulsch_ue->Nid_cell = Nid_cell;
|
||||
ulsch_ue->nb_re_dmrs = ((UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1)?6:4);
|
||||
ulsch_ue->nb_re_dmrs = 12; //FIXME temprary for no data in dmrs symbol
|
||||
//((UE->dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1)?6:4)*number_dmrs_symbols;
|
||||
|
||||
N_RE_prime = NR_NB_SC_PER_RB*harq_process_ul_ue->number_of_symbols - ulsch_ue->nb_re_dmrs*number_dmrs_symbols - N_PRB_oh;
|
||||
|
||||
@@ -166,8 +169,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
harq_process_ul_ue->number_of_symbols,
|
||||
ulsch_ue->nb_re_dmrs*ulsch_ue->length_dmrs,
|
||||
0,
|
||||
0,
|
||||
harq_process_ul_ue->Nl);
|
||||
|
||||
|
||||
uint8_t access_mode = SCHEDULED_ACCESS;
|
||||
|
||||
//-----------------------------------------------------//
|
||||
@@ -175,23 +180,14 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
if (harq_process_ul_ue != NULL){
|
||||
data_existing = 0;
|
||||
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
data_existing = nr_ue_get_sdu(UE->Mod_id, UE->CC_id, frame,
|
||||
slot, 0, ulsch_input_buffer, harq_process_ul_ue->TBS/8, &access_mode);
|
||||
//IP traffic to be transmitted
|
||||
if(data_existing){
|
||||
//harq_process_ul_ue->a = (unsigned char*)calloc(harq_process_ul_ue->TBS/8, sizeof(unsigned char));
|
||||
memcpy(harq_process_ul_ue->a, ulsch_input_buffer, harq_process_ul_ue->TBS/8);
|
||||
|
||||
#ifdef DEBUG_MAC_PDU
|
||||
LOG_I(PHY, "Printing MAC PDU to be encoded, TBS is: %d \n", harq_process_ul_ue->TBS/8);
|
||||
for (i = 0; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
printf("0x%02x",harq_process_ul_ue->a[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
}
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
data_existing = nr_ue_get_sdu(UE->Mod_id, UE->CC_id, frame,
|
||||
slot, 0, ulsch_input_buffer, harq_process_ul_ue->TBS/8, &access_mode);
|
||||
//IP traffic to be transmitted
|
||||
if(data_existing){
|
||||
//harq_process_ul_ue->a = (unsigned char*)calloc(harq_process_ul_ue->TBS/8, sizeof(unsigned char));
|
||||
memcpy(harq_process_ul_ue->a, ulsch_input_buffer, harq_process_ul_ue->TBS/8);
|
||||
}
|
||||
}
|
||||
//Random traffic to be transmitted if there is no IP traffic available for this Tx opportunity
|
||||
if (!IS_SOFTMODEM_NOS1 || !data_existing) {
|
||||
@@ -199,15 +195,24 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
//and block this traffic from being forwarded to the upper layers at the gNB
|
||||
uint16_t payload_offset = 5;
|
||||
LOG_D(PHY, "Random data to be tranmsitted: \n");
|
||||
//Give the header bytes some dummy value in order to block the random packet at the MAC layer of the receiver
|
||||
|
||||
//Give the header bytes a dummy value (a value not corresponding to any valid LCID based on 38.321, Table 6.2.1-2)
|
||||
//in order to block the random packet at the MAC layer of the receiver
|
||||
for (i = 0; i<payload_offset; i++)
|
||||
harq_process_ul_ue->a[i] = 0;
|
||||
harq_process_ul_ue->a[i] = 64;
|
||||
|
||||
for (i = payload_offset; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf(" input encoder a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
}
|
||||
}
|
||||
#ifdef DEBUG_MAC_PDU
|
||||
LOG_I(PHY, "Printing MAC PDU to be encoded, TBS is: %d \n", harq_process_ul_ue->TBS/8);
|
||||
for (i = 0; i < harq_process_ul_ue->TBS / 8; i++) {
|
||||
printf("%02x",harq_process_ul_ue->a[i]);
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
} else {
|
||||
LOG_E(PHY, "[phy_procedures_nrUE_TX] harq_process_ul_ue is NULL !!\n");
|
||||
return;
|
||||
@@ -268,6 +273,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
/////////////////////////DMRS Modulation/////////////////////////
|
||||
///////////
|
||||
ulsch_ue->nb_re_dmrs = ((UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1)?6:4)*number_dmrs_symbols; //FIXME temprary here for no data in dmrs symbol
|
||||
pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
|
||||
n_dmrs = (harq_process_ul_ue->nb_rb*ulsch_ue->nb_re_dmrs*ulsch_ue->length_dmrs);
|
||||
int16_t mod_dmrs[n_dmrs<<1];
|
||||
@@ -310,9 +316,9 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
tx_layers = (int16_t **)pusch_ue->txdataF_layers;
|
||||
|
||||
nr_ue_layer_mapping(UE->ulsch[thread_id][gNB_id],
|
||||
harq_process_ul_ue->Nl,
|
||||
available_bits/mod_order,
|
||||
tx_layers);
|
||||
harq_process_ul_ue->Nl,
|
||||
available_bits/mod_order,
|
||||
tx_layers);
|
||||
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -338,7 +344,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
harq_process_ul_ue->number_of_symbols,
|
||||
dmrs_type,
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
|
||||
if (is_dmrs == 1)
|
||||
nb_re_dmrs_per_rb = ulsch_ue->nb_re_dmrs;
|
||||
else
|
||||
@@ -383,7 +389,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
uint8_t l_ref;
|
||||
uint16_t m=0, n=0, dmrs_idx=0, ptrs_idx = 0;
|
||||
|
||||
for (l=start_symbol; l<start_symbol+harq_process_ul_ue->number_of_symbols; l++) {
|
||||
for (l=start_symbol; l<start_symbol+harq_process_ul_ue->number_of_symbols; l++) {
|
||||
|
||||
k = start_sc;
|
||||
n = 0;
|
||||
@@ -456,8 +462,18 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
} else {
|
||||
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) ulsch_ue->y)[m<<1];
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) ulsch_ue->y)[(m<<1) + 1];
|
||||
if (!is_dmrs_symbol((mapping_type)?l-start_symbol:l,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
harq_process_ul_ue->number_of_symbols,
|
||||
UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type,
|
||||
frame_parms->ofdm_symbol_size))
|
||||
{
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) ulsch_ue->y)[m<<1];
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) ulsch_ue->y)[(m<<1) + 1];
|
||||
|
||||
#ifdef DEBUG_PUSCH_MAPPING
|
||||
printf("m %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
@@ -465,7 +481,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1]);
|
||||
#endif
|
||||
|
||||
m++;
|
||||
m++;
|
||||
}
|
||||
}
|
||||
|
||||
if (++k >= frame_parms->ofdm_symbol_size)
|
||||
|
||||
@@ -6059,25 +6059,126 @@ void idft24576(int16_t *input, int16_t *output,int scale)
|
||||
}
|
||||
|
||||
int16_t twa36864[24576] __attribute__((aligned(32)));
|
||||
int16_t twb36884[24576] __attribute__((aligned(32)));
|
||||
int16_t twb36864[24576] __attribute__((aligned(32)));
|
||||
|
||||
// 12288 x 3
|
||||
void dft36864(int16_t *input, int16_t *output,int scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][12288] __attribute__((aligned(32)));
|
||||
uint32_t tmpo[3][12288] __attribute__((aligned(32)));
|
||||
simd_q15_t *y128p=(simd_q15_t*)output;
|
||||
simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15);
|
||||
|
||||
for (i=0,j=0; i<12288; i++) {
|
||||
tmp[0][i] = ((uint32_t *)input)[j++];
|
||||
tmp[1][i] = ((uint32_t *)input)[j++];
|
||||
tmp[2][i] = ((uint32_t *)input)[j++];
|
||||
}
|
||||
|
||||
dft12288((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
|
||||
dft12288((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
|
||||
dft12288((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
|
||||
|
||||
if (LOG_DUMPFLAG(DEBUG_DFT)) {
|
||||
LOG_M("dft36864out0.m","o0",tmpo[0],12288,1,1);
|
||||
LOG_M("dft36864out1.m","o1",tmpo[1],12288,1,1);
|
||||
LOG_M("dft36864out2.m","o2",tmpo[2],12288,1,1);
|
||||
}
|
||||
|
||||
for (i=0,i2=0; i<24576; i+=8,i2+=4) {
|
||||
bfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),(simd_q15_t*)(&tmpo[2][i2]),
|
||||
(simd_q15_t*)(output+i),(simd_q15_t*)(output+24576+i),(simd_q15_t*)(output+49152+i),
|
||||
(simd_q15_t*)(twa36864+i),(simd_q15_t*)(twb36864+i));
|
||||
}
|
||||
|
||||
if (scale==1) {
|
||||
for (i=0; i<576; i++) {
|
||||
y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p+=16;
|
||||
}
|
||||
}
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
if (LOG_DUMPFLAG(DEBUG_DFT)) {
|
||||
LOG_M("out.m","out",output,36864,1,1);
|
||||
}
|
||||
}
|
||||
|
||||
void idft36864(int16_t *input, int16_t *output,int scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
int i,i2,j;
|
||||
uint32_t tmp[3][12288] __attribute__((aligned(32)));
|
||||
uint32_t tmpo[3][12288] __attribute__((aligned(32)));
|
||||
simd_q15_t *y128p=(simd_q15_t*)output;
|
||||
simd_q15_t ONE_OVER_SQRT3_Q15_128 = set1_int16(ONE_OVER_SQRT3_Q15);
|
||||
|
||||
for (i=0,j=0; i<12288; i++) {
|
||||
tmp[0][i] = ((uint32_t *)input)[j++];
|
||||
tmp[1][i] = ((uint32_t *)input)[j++];
|
||||
tmp[2][i] = ((uint32_t *)input)[j++];
|
||||
}
|
||||
|
||||
idft12288((int16_t*)(tmp[0]),(int16_t*)(tmpo[0]),1);
|
||||
idft12288((int16_t*)(tmp[1]),(int16_t*)(tmpo[1]),1);
|
||||
idft12288((int16_t*)(tmp[2]),(int16_t*)(tmpo[2]),1);
|
||||
|
||||
for (i=0,i2=0; i<24576; i+=8,i2+=4) {
|
||||
ibfly3((simd_q15_t*)(&tmpo[0][i2]),(simd_q15_t*)(&tmpo[1][i2]),((simd_q15_t*)&tmpo[2][i2]),
|
||||
(simd_q15_t*)(output+i),(simd_q15_t*)(output+24576+i),(simd_q15_t*)(output+49152+i),
|
||||
(simd_q15_t*)(twa36864+i),(simd_q15_t*)(twb36864+i));
|
||||
}
|
||||
if (scale==1) {
|
||||
for (i=0; i<576; i++) {
|
||||
y128p[0] = mulhi_int16(y128p[0],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[1] = mulhi_int16(y128p[1],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[2] = mulhi_int16(y128p[2],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[3] = mulhi_int16(y128p[3],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[4] = mulhi_int16(y128p[4],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[5] = mulhi_int16(y128p[5],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[6] = mulhi_int16(y128p[6],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[7] = mulhi_int16(y128p[7],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[8] = mulhi_int16(y128p[8],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[9] = mulhi_int16(y128p[9],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[10] = mulhi_int16(y128p[10],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[11] = mulhi_int16(y128p[11],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[12] = mulhi_int16(y128p[12],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[13] = mulhi_int16(y128p[13],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[14] = mulhi_int16(y128p[14],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p[15] = mulhi_int16(y128p[15],ONE_OVER_SQRT3_Q15_128);
|
||||
y128p+=16;
|
||||
}
|
||||
}
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
}
|
||||
|
||||
int16_t twa49152[32768] __attribute__((aligned(32)));
|
||||
int16_t twb49152[32768] __attribute__((aligned(32)));
|
||||
|
||||
// 16384 x 3
|
||||
// TbD todo dft16384
|
||||
void dft49152(int16_t *input, int16_t *output,int scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
}
|
||||
|
||||
// TbD todo dft16384
|
||||
void idft49152(int16_t *input, int16_t *output,int scale) {
|
||||
|
||||
AssertFatal(1==0,"Need to do this ..\n");
|
||||
|
||||
@@ -157,9 +157,9 @@ void phy_scope_gNB(FD_phy_scope_gnb *form,
|
||||
{
|
||||
int i, arx; //int i,i2,arx,atx,ind,k;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &phy_vars_gnb->frame_parms;
|
||||
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
|
||||
//int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
|
||||
uint8_t nb_antennas_rx = frame_parms->nb_antennas_rx;
|
||||
uint8_t nb_antennas_tx = 1; // frame_parms->nb_antennas_tx; // in LTE Rel. 8 and 9 only a single transmit antenna is assumed at the UE
|
||||
//uint8_t nb_antennas_tx = 1; // frame_parms->nb_antennas_tx; // in LTE Rel. 8 and 9 only a single transmit antenna is assumed at the UE
|
||||
int16_t **rxsig_t, **rxsig_f;
|
||||
// int16_t **chest_t=NULL;
|
||||
// int16_t **chest_f=NULL;
|
||||
@@ -966,7 +966,7 @@ FD_stats_form * create_form_stats_form( void ) {
|
||||
}
|
||||
|
||||
void startScope(scopeParms_t * p) {
|
||||
FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||
//FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
|
||||
char title[255];
|
||||
fl_initialize (p->argc, p->argv, NULL, 0, 0);
|
||||
/*
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include <simple_executable.h>
|
||||
#include <common/utils/system.h>
|
||||
#include <openairinterface5g_limits.h>
|
||||
#include <openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h>
|
||||
#include "common/ran_context.h"
|
||||
#include <openair1/PHY/defs_gNB.h>
|
||||
#include <forms.h>
|
||||
|
||||
+17
-1
@@ -38,7 +38,7 @@
|
||||
#include "openairinterface5g_limits.h"
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
#include "defs_common.h"
|
||||
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
#define MAX_BANDS_PER_RRU 4
|
||||
#define MAX_RRU_CONFIG_SIZE 1024
|
||||
@@ -189,6 +189,16 @@ typedef struct RU_feptx_t_s{
|
||||
int index;
|
||||
}RU_feptx_t;
|
||||
|
||||
typedef struct {
|
||||
int frame;
|
||||
int slot;
|
||||
int fmt;
|
||||
int numRA;
|
||||
int prachStartSymbol;
|
||||
} RU_PRACH_list_t;
|
||||
|
||||
#define NUMBER_OF_NR_RU_PRACH_MAX 8
|
||||
|
||||
typedef struct RU_proc_t_s {
|
||||
/// Pointer to associated RU descriptor
|
||||
struct RU_t_s *ru;
|
||||
@@ -480,6 +490,8 @@ typedef struct RU_t_s {
|
||||
int att_tx;
|
||||
/// flag to indicate precoding operation in RU
|
||||
int do_precoding;
|
||||
/// FAPI confiuration
|
||||
nfapi_nr_config_request_scf_t config;
|
||||
/// Frame parameters
|
||||
struct LTE_DL_FRAME_PARMS *frame_parms;
|
||||
struct NR_DL_FRAME_PARMS *nr_frame_parms;
|
||||
@@ -580,6 +592,10 @@ typedef struct RU_t_s {
|
||||
int32_t *bw_list[NUMBER_OF_eNB_MAX+1];
|
||||
/// beamforming weight vectors
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15];
|
||||
/// prach commands
|
||||
RU_PRACH_list_t prach_list[NUMBER_OF_NR_RU_PRACH_MAX];
|
||||
/// mutex for prach_list access
|
||||
pthread_mutex_t prach_list_mutex;
|
||||
/// received frequency-domain signal for PRACH (IF4p5 RRU)
|
||||
int16_t **prach_rxsigF;
|
||||
/// received frequency-domain signal for PRACH BR (IF4p5 RRU)
|
||||
|
||||
+33
-4
@@ -43,6 +43,8 @@
|
||||
#include "PHY/CODING/nrLDPC_extern.h"
|
||||
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
|
||||
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
|
||||
#define MAX_NUM_RU_PER_gNB MAX_NUM_RU_PER_eNB
|
||||
#define MAX_PUCCH0_NID 8
|
||||
|
||||
@@ -52,6 +54,7 @@ typedef struct {
|
||||
int lut[MAX_PUCCH0_NID][160][14];
|
||||
} NR_gNB_PUCCH0_LUT_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
uint32_t pbch_a;
|
||||
uint32_t pbch_a_interleaved;
|
||||
@@ -155,6 +158,14 @@ typedef struct {
|
||||
int16_t sqrt_rho_b;
|
||||
} NR_gNB_DLSCH_t;
|
||||
|
||||
typedef struct {
|
||||
int frame;
|
||||
int slot;
|
||||
nfapi_nr_prach_pdu_t pdu;
|
||||
} gNB_PRACH_list_t;
|
||||
|
||||
#define NUMBER_OF_NR_PRACH_MAX 8
|
||||
|
||||
typedef struct {
|
||||
/// \brief ?.
|
||||
/// first index: ? [0..1023] (hard coded)
|
||||
@@ -165,6 +176,7 @@ typedef struct {
|
||||
int16_t **rxsigF;
|
||||
/// \brief local buffer to compute prach_ifft
|
||||
int32_t *prach_ifft;
|
||||
gNB_PRACH_list_t list[NUMBER_OF_NR_PRACH_MAX];
|
||||
} NR_gNB_PRACH;
|
||||
|
||||
typedef struct {
|
||||
@@ -172,8 +184,8 @@ typedef struct {
|
||||
nfapi_nr_pusch_pdu_t ulsch_pdu;
|
||||
/// Frame where current HARQ round was sent
|
||||
uint32_t frame;
|
||||
/// Subframe where current HARQ round was sent
|
||||
uint32_t subframe;
|
||||
/// Slot where current HARQ round was sent
|
||||
uint32_t slot;
|
||||
/// Index of current HARQ round for this DLSCH
|
||||
uint8_t round;
|
||||
/// Last TPC command
|
||||
@@ -605,6 +617,9 @@ typedef struct {
|
||||
int prach_I0;
|
||||
} PHY_MEASUREMENTS_gNB;
|
||||
|
||||
#define MAX_NUM_NR_RX_RACH_PDUS 4
|
||||
#define MAX_NUM_NR_RX_PRACH_PREAMBLES 4
|
||||
|
||||
/// Top-level PHY Data Structure for gNB
|
||||
typedef struct PHY_VARS_gNB_s {
|
||||
/// Module ID indicator for this instance
|
||||
@@ -630,8 +645,22 @@ typedef struct PHY_VARS_gNB_s {
|
||||
NR_UL_IND_t UL_INFO;
|
||||
pthread_mutex_t UL_INFO_mutex;
|
||||
|
||||
/// NFAPI PRACH information (to be removed)
|
||||
nfapi_preamble_pdu_t preamble_list[MAX_NUM_RX_PRACH_PREAMBLES];
|
||||
/// 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_nr_prach_indication_pdu_t prach_pdu_indication_list[MAX_NUM_NR_RX_RACH_PDUS];
|
||||
/// NFAPI PRACH information
|
||||
nfapi_nr_prach_indication_preamble_t preamble_list[MAX_NUM_NR_RX_PRACH_PREAMBLES];
|
||||
|
||||
//Sched_Rsp_t Sched_INFO;
|
||||
nfapi_nr_ul_tti_request_t UL_tti_req;
|
||||
|
||||
@@ -782,6 +782,8 @@ typedef struct {
|
||||
int16_t amp;
|
||||
int16_t *prachF;
|
||||
int16_t *prach;
|
||||
fapi_nr_ul_config_prach_pdu prach_pdu;
|
||||
uint8_t prach_Config_enabled;
|
||||
} NR_UE_PRACH;
|
||||
|
||||
// structure used for multiple SSB detection
|
||||
@@ -930,7 +932,7 @@ typedef struct {
|
||||
uint8_t pucch_sel[10];
|
||||
uint8_t pucch_payload[22];
|
||||
|
||||
UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
UE_MODE_t UE_mode[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
/// cell-specific reference symbols
|
||||
uint32_t lte_gold_table[7][20][2][14];
|
||||
|
||||
@@ -968,12 +970,13 @@ typedef struct {
|
||||
|
||||
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
unsigned char ulsch_Msg3_subframe[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
uint8_t Msg3_startSymbol[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
uint8_t Msg3_Length[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
|
||||
unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
unsigned char ulsch_Msg3_subframe[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
NR_PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
int turbo_iterations, turbo_cntl_iterations;
|
||||
/// \brief ?.
|
||||
/// - first index: eNB [0..NUMBER_OF_CONNECTED_eNB_MAX[ (hard coded)
|
||||
@@ -1008,8 +1011,6 @@ typedef struct {
|
||||
int dlsch_mtch_trials[MAX_MBSFN_AREA][NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
int current_dlsch_cqi[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
unsigned char first_run_timing_advance[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
uint8_t generate_prach;
|
||||
uint8_t generate_nr_prach;
|
||||
uint8_t prach_cnt;
|
||||
uint8_t prach_PreambleIndex;
|
||||
// uint8_t prach_timer;
|
||||
|
||||
@@ -198,30 +198,32 @@ typedef struct {
|
||||
nr_reg_t reg_list[NR_NB_REG_PER_CCE];
|
||||
} nr_cce_t;
|
||||
|
||||
|
||||
/// PRACH-ConfigInfo from 38.331 RRC spec
|
||||
typedef struct {
|
||||
/// Parameter: prach-ConfigurationIndex, see TS 38.211 (6.3.3.2).
|
||||
uint8_t prach_ConfigIndex;
|
||||
/// Parameter: High-speed-flag, see TS 38.211 (6.3.3.1). 1 corresponds to Restricted set and 0 to Unrestricted set.
|
||||
uint8_t highSpeedFlag;
|
||||
/// Restricted Set Config (type A=0 , type B=1) TS 38.211 (6.3.3.1)
|
||||
uint8_t restrictedSetConfig;
|
||||
/// 38.211 (NCS 38.211 6.3.3.1).
|
||||
uint8_t zeroCorrelationZoneConfig;
|
||||
/// see TS 38.211 (6.3.3.2).
|
||||
uint8_t msg1_frequencystart;
|
||||
} NR_PRACH_CONFIG_INFO;
|
||||
|
||||
/// PRACH-ConfigSIB or PRACH-Config
|
||||
typedef struct {
|
||||
/// Parameter: prach-rootSequenceIndex, see TS 38.211 (6.3.3.2).
|
||||
uint16_t rootSequenceIndex;
|
||||
/// prach_Config_enabled=1 means enabled.}
|
||||
uint8_t prach_Config_enabled;
|
||||
/// PRACH Configuration Information
|
||||
NR_PRACH_CONFIG_INFO prach_ConfigInfo;
|
||||
} NR_PRACH_CONFIG_COMMON;
|
||||
/// PRACH format retrieved from prach_ConfigIndex
|
||||
uint16_t prach_format;
|
||||
/// Preamble index for PRACH (0-63)
|
||||
uint8_t ra_PreambleIndex;
|
||||
/// RACH MaskIndex
|
||||
uint8_t ra_RACH_MaskIndex;
|
||||
/// Target received power at gNB. Baseline is range -202..-60 dBm. Depends on delta preamble, power ramping counter and step.
|
||||
int ra_PREAMBLE_RECEIVED_TARGET_POWER;
|
||||
/// PRACH index for TDD (0 ... 6) depending on TDD configuration and prachConfigIndex
|
||||
uint8_t ra_TDD_map_index;
|
||||
/// RA Preamble Power Ramping Step in dB
|
||||
uint32_t RA_PREAMBLE_POWER_RAMPING_STEP;
|
||||
///
|
||||
uint8_t RA_PREAMBLE_BACKOFF;
|
||||
///
|
||||
uint8_t RA_SCALING_FACTOR_BI;
|
||||
///
|
||||
uint8_t RA_PCMAX;
|
||||
/// Corresponding RA-RNTI for UL-grant
|
||||
uint16_t ra_RNTI;
|
||||
/// Pointer to Msg3 payload for UL-grant
|
||||
uint8_t *Msg3;
|
||||
/// Flag for the Msg1 generation
|
||||
uint8_t generate_nr_prach;
|
||||
} NR_PRACH_RESOURCES_t;
|
||||
|
||||
typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS;
|
||||
|
||||
@@ -313,8 +315,6 @@ 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_gNB;
|
||||
/// 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
|
||||
@@ -350,9 +350,10 @@ struct NR_DL_FRAME_PARMS {
|
||||
uint8_t ssb_index;
|
||||
/// PBCH polar encoder params
|
||||
t_nrPolar_params pbch_polar_params;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
#define KHz (1000UL)
|
||||
#define MHz (1000*KHz)
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
#include "fapi_nr_l1.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dci.h"
|
||||
|
||||
@@ -44,7 +45,7 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
AssertFatal(dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag== 1, "bchPayloadFlat %d != 1\n",
|
||||
dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayloadFlag);
|
||||
|
||||
LOG_I(PHY,"%d.%d : pbch_pdu: %x\n",frame,slot,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload);
|
||||
LOG_D(PHY,"%d.%d : pbch_pdu: %x\n",frame,slot,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload);
|
||||
memcpy((void*)&gNB->ssb_pdu,&dl_tti_pdu->ssb_pdu,sizeof(dl_tti_pdu->ssb_pdu));
|
||||
}
|
||||
|
||||
@@ -144,16 +145,16 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
|
||||
gNB = RC.gNB[Mod_id];
|
||||
|
||||
uint8_t number_dl_pdu = DL_req->dl_tti_request_body.nPDUs;
|
||||
// uint8_t number_ul_pdu = 0;
|
||||
uint8_t number_dl_pdu = (DL_req==NULL) ? 0 : DL_req->dl_tti_request_body.nPDUs;
|
||||
uint8_t number_ul_dci_pdu = (UL_dci_req==NULL) ? 0 : UL_dci_req->numPdus;
|
||||
uint8_t number_ul_tti_pdu = (UL_tti_req==NULL) ? 0 : UL_tti_req->n_pdus;
|
||||
|
||||
// if (UL_tti_req != NULL) number_ul_pdu = UL_tti_req->n_pdus;
|
||||
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d%d DL_req:SFN/SLO:%04d%d:dl_pdu:%d tx_req:SFN/SLOT:%04d%d:pdus:%d;\n",
|
||||
frame,slot,
|
||||
DL_req->SFN,DL_req->Slot,number_dl_pdu,
|
||||
TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs);
|
||||
if (DL_req != NULL && TX_req!=NULL)
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
|
||||
frame,slot,
|
||||
DL_req->SFN,DL_req->Slot,number_dl_pdu,
|
||||
TX_req->SFN,TX_req->Slot,TX_req->Number_of_PDUs,
|
||||
number_ul_dci_pdu,number_ul_tti_pdu);
|
||||
|
||||
int pdcch_received=0;
|
||||
gNB->num_pdsch_rnti=0;
|
||||
@@ -174,6 +175,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
|
||||
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
|
||||
AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n");
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
||||
handle_nfapi_nr_pdcch_pdu(gNB,
|
||||
frame, slot,
|
||||
&dl_tti_pdu->pdcch_pdu);
|
||||
@@ -184,6 +186,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
case NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE:
|
||||
|
||||
{
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *pdsch_pdu_rel15 = &dl_tti_pdu->pdsch_pdu.pdsch_pdu_rel15;
|
||||
uint16_t pduIndex = pdsch_pdu_rel15->pduIndex;
|
||||
AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n",
|
||||
@@ -194,13 +197,28 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
|
||||
}
|
||||
}
|
||||
|
||||
if (UL_tti_req!=NULL) memcpy(&gNB->UL_tti_req,UL_tti_req,sizeof(nfapi_nr_ul_tti_request_t));
|
||||
// if (UL_tti_req!=NULL) memcpy(&gNB->UL_tti_req,UL_tti_req,sizeof(nfapi_nr_ul_tti_request_t));
|
||||
|
||||
for (int i=0;i<number_ul_dci_pdu;i++) {
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB,
|
||||
frame, slot,
|
||||
&UL_dci_req->ul_dci_pdu_list[i]);
|
||||
handle_nfapi_nr_ul_dci_pdu(gNB, frame, slot, &UL_dci_req->ul_dci_pdu_list[i]);
|
||||
}
|
||||
|
||||
|
||||
for (int i = 0; i < number_ul_tti_pdu; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nr_fill_ulsch(gNB,UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
// handle_nfapi_nr_pucch_pdu(gNB,frame,slot,UL_tti_req->pdus_list[i].pucch_pdu);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PRACH_PDU_TYPE for %d.%d\n", frame, slot, UL_tti_req->SFN, UL_tti_req->Slot);
|
||||
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
|
||||
nr_fill_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
nr_fill_prach_ru(gNB->RU_list[0], UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "nfapi_nr_interface_scf.h"
|
||||
#include "fapi_nr_l1.h"
|
||||
#include "nfapi_pnf.h"
|
||||
@@ -47,17 +47,19 @@
|
||||
|
||||
#include "intertask_interface.h"
|
||||
|
||||
extern uint32_t nfapi_mode;
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
extern int oai_nfapi_nr_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
|
||||
|
||||
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int subframe) {
|
||||
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
nfapi_nr_prach_pdu_t *prach_pdu) {
|
||||
|
||||
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4];
|
||||
uint16_t i;
|
||||
|
||||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles=0;
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus=0;
|
||||
|
||||
RU_t *ru;
|
||||
int aa=0;
|
||||
@@ -75,16 +77,18 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int subframe) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
rx_nr_prach(gNB,
|
||||
prach_pdu,
|
||||
frame,
|
||||
subframe,
|
||||
slot,
|
||||
&max_preamble[0],
|
||||
&max_preamble_energy[0],
|
||||
&max_preamble_delay[0]
|
||||
);
|
||||
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, subframe %d : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,subframe,
|
||||
LOG_D(PHY,"[RAPROC] Frame %d, slot %d : Most likely preamble %d, energy %d dB delay %d (prach_energy counter %d)\n",
|
||||
frame,slot,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_delay[0],
|
||||
@@ -93,49 +97,42 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int subframe) {
|
||||
if ((gNB->prach_energy_counter == 100) &&
|
||||
(max_preamble_energy[0] > gNB->measurements.prach_I0+100)) {
|
||||
|
||||
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, subframe %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d\n",
|
||||
gNB->Mod_id,
|
||||
frame,
|
||||
subframe,
|
||||
slot,
|
||||
max_preamble[0],
|
||||
max_preamble_energy[0]/10,
|
||||
max_preamble_energy[0]%10,
|
||||
max_preamble_delay[0]);
|
||||
|
||||
T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(subframe),
|
||||
T(T_ENB_PHY_INITIATE_RA_PROCEDURE, T_INT(gNB->Mod_id), T_INT(frame), T_INT(slot),
|
||||
T_INT(max_preamble[0]), T_INT(max_preamble_energy[0]), T_INT(max_preamble_delay[0]));
|
||||
|
||||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 1;
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.preamble_list = &gNB->preamble_list[0];
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.tl.tag = NFAPI_RACH_INDICATION_BODY_TAG;
|
||||
gNB->UL_INFO.rach_ind.header.message_id = NFAPI_RACH_INDICATION;
|
||||
gNB->UL_INFO.rach_ind.sfn_sf = frame<<4 | subframe;
|
||||
gNB->UL_INFO.rach_ind.number_of_pdus = 1;
|
||||
gNB->UL_INFO.rach_ind.pdu_list = &gNB->prach_pdu_indication_list[0];
|
||||
gNB->UL_INFO.rach_ind.sfn = frame;
|
||||
gNB->UL_INFO.rach_ind.slot = slot;
|
||||
|
||||
gNB->preamble_list[0].preamble_rel8.tl.tag = NFAPI_PREAMBLE_REL8_TAG;
|
||||
gNB->preamble_list[0].preamble_rel8.timing_advance = max_preamble_delay[0];
|
||||
gNB->preamble_list[0].preamble_rel8.preamble = max_preamble[0];
|
||||
gNB->preamble_list[0].preamble_rel8.rnti = 1+subframe; // note: fid is implicitly 0 here
|
||||
gNB->preamble_list[0].instance_length = 0; //don't know exactly what this is
|
||||
|
||||
if (nfapi_mode == 1) { // If NFAPI PNF then we need to send the message to the VNF
|
||||
|
||||
LOG_D(PHY,"Filling NFAPI indication for NR RACH : SFN_SF:%d TA %d, Preamble %d, rnti %x\n",
|
||||
NFAPI_SFNSF2DEC(gNB->UL_INFO.rach_ind.sfn_sf),
|
||||
gNB->preamble_list[0].preamble_rel8.timing_advance,
|
||||
gNB->preamble_list[0].preamble_rel8.preamble,
|
||||
gNB->preamble_list[0].preamble_rel8.rnti);
|
||||
AssertFatal(1==0,"shouldn't be here yet..\n");
|
||||
//oai_nfapi_nr_rach_ind(&gNB->UL_INFO.rach_ind);
|
||||
|
||||
gNB->UL_INFO.rach_ind.rach_indication_body.number_of_preambles = 0;
|
||||
}
|
||||
} // max_preamble_energy > prach_I0 + 100
|
||||
else {
|
||||
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
if (gNB->prach_energy_counter < 100) gNB->prach_energy_counter++;
|
||||
}
|
||||
gNB->prach_pdu_indication_list[0].phy_cell_id = gNB->gNB_config.cell_config.phy_cell_id.value;
|
||||
gNB->prach_pdu_indication_list[0].symbol_index = prach_pdu->prach_start_symbol; // FIXME to be changed for multi-ssb (this is only the start symbol of first occasion)
|
||||
gNB->prach_pdu_indication_list[0].slot_index = slot;
|
||||
gNB->prach_pdu_indication_list[0].freq_index = prach_pdu->num_ra;
|
||||
gNB->prach_pdu_indication_list[0].avg_rssi = (max_preamble_energy[0]<631) ? (128+(max_preamble_energy[0]/5)) : 254;
|
||||
gNB->prach_pdu_indication_list[0].avg_snr = 0xff; // invalid for now
|
||||
|
||||
|
||||
gNB->prach_pdu_indication_list[0].num_preamble = 1;
|
||||
gNB->prach_pdu_indication_list[0].preamble_list = gNB->preamble_list;
|
||||
gNB->prach_pdu_indication_list[0].preamble_list[0].preamble_index = max_preamble[0];
|
||||
gNB->prach_pdu_indication_list[0].preamble_list[0].timing_advance = max_preamble_delay[0];
|
||||
gNB->prach_pdu_indication_list[0].preamble_list[0].preamble_pwr = 0xffffffff;
|
||||
}
|
||||
gNB->measurements.prach_I0 = ((gNB->measurements.prach_I0*900)>>10) + ((max_preamble_energy[0]*124)>>10);
|
||||
if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
|
||||
if (gNB->prach_energy_counter < 100) gNB->prach_energy_counter++;
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
|
||||
}
|
||||
|
||||
@@ -520,7 +520,7 @@ void nr_fep0(RU_t *ru, int first_half) {
|
||||
ru->common.rxdataF[aa],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
0,
|
||||
ru->N_TA_offset,
|
||||
0);
|
||||
}
|
||||
}
|
||||
@@ -642,6 +642,8 @@ void nr_fep_full(RU_t *ru, int slot) {
|
||||
// if ((fp->frame_type == TDD) &&
|
||||
// (subframe_select(fp,proc->tti_rx) != NR_UPLINK_SLOT)) return;
|
||||
|
||||
LOG_D(PHY,"In fep_full for slot = %d\n", proc->tti_rx);
|
||||
|
||||
start_meas(&ru->ofdm_demod_stats);
|
||||
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
|
||||
|
||||
@@ -655,7 +657,7 @@ void nr_fep_full(RU_t *ru, int slot) {
|
||||
ru->common.rxdataF[aa],
|
||||
l,
|
||||
proc->tti_rx,
|
||||
0,
|
||||
ru->N_TA_offset,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,9 +177,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
|
||||
}
|
||||
|
||||
LOG_D(PHY, "PDSCH generation started (%d)\n", gNB->num_pdsch_rnti);
|
||||
for (int i=0; i<gNB->num_pdsch_rnti; i++) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
|
||||
LOG_D(PHY, "PDSCH generation started (%d)\n", gNB->num_pdsch_rnti);
|
||||
nr_generate_pdsch(gNB->dlsch[i][0],
|
||||
gNB->nr_gold_pdsch_dmrs[slot],
|
||||
gNB->common_vars.txdataF,
|
||||
@@ -209,8 +209,6 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
|
||||
// VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
|
||||
|
||||
|
||||
if (do_prach_rx(fp,frame,slot)) L1_nr_prach_procedures(gNB,frame,slot/fp->slots_per_subframe);
|
||||
*/
|
||||
|
||||
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH_id, uint8_t harq_pid)
|
||||
@@ -218,7 +216,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->ulsch_pdu;
|
||||
|
||||
uint8_t ret;
|
||||
uint8_t ret, nodata_dmrs = 1;
|
||||
uint8_t l, number_dmrs_symbols = 0;
|
||||
uint32_t G;
|
||||
uint16_t start_symbol, number_symbols, nb_re_dmrs;
|
||||
@@ -227,9 +225,13 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
number_symbols = pusch_pdu->nr_of_symbols;
|
||||
|
||||
for (l = start_symbol; l < start_symbol + number_symbols; l++)
|
||||
number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01;
|
||||
number_dmrs_symbols += ((pusch_pdu->ul_dmrs_symb_pos)>>l)&0x01;
|
||||
|
||||
if (nodata_dmrs)
|
||||
nb_re_dmrs = 12*number_dmrs_symbols;
|
||||
else
|
||||
nb_re_dmrs = ((pusch_pdu->dmrs_config_type == pusch_dmrs_type1)?6:4);
|
||||
|
||||
nb_re_dmrs = ((pusch_pdu->dmrs_config_type == pusch_dmrs_type1)?6:4);
|
||||
|
||||
G = nr_get_G(pusch_pdu->rb_size,
|
||||
number_symbols,
|
||||
@@ -238,7 +240,6 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
pusch_pdu->qam_mod_order,
|
||||
pusch_pdu->nrOfLayers);
|
||||
|
||||
|
||||
//----------------------------------------------------------
|
||||
//------------------- ULSCH unscrambling -------------------
|
||||
//----------------------------------------------------------
|
||||
@@ -263,7 +264,6 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
harq_pid,
|
||||
G);
|
||||
|
||||
|
||||
if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations)
|
||||
LOG_I(PHY, "ULSCH %d in error\n",ULSCH_id);
|
||||
//gNB->ulsch[ULSCH_id+1][0]->harq_processes[harq_pid]->b
|
||||
@@ -379,6 +379,7 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
|
||||
for(symbol = 0; symbol < NR_SYMBOLS_PER_SLOT; symbol++) {
|
||||
// nr_slot_fep_ul(gNB, symbol, proc->slot_rx, 0, 0);
|
||||
|
||||
for (aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
|
||||
nr_slot_fep_ul(&gNB->frame_parms,
|
||||
gNB->common_vars.rxdata[aa],
|
||||
@@ -394,63 +395,36 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = &gNB->UL_tti_req;
|
||||
int num_pdus = UL_tti_req->n_pdus;
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
|
||||
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
for (int ULSCH_id=0;ULSCH_id<NUMBER_OF_NR_ULSCH_MAX;ULSCH_id++) {
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
|
||||
int harq_pid;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq;
|
||||
|
||||
nfapi_nr_uci_indication_t *uci_indication = &gNB->uci_indication;
|
||||
uci_indication->sfn = frame_rx;
|
||||
uci_indication->slot = slot_rx;
|
||||
uci_indication->num_ucis = 0;
|
||||
if ((ulsch) &&
|
||||
(ulsch->rnti > 0)) {
|
||||
// for for an active HARQ process
|
||||
for (harq_pid=0;harq_pid<NR_MAX_ULSCH_HARQ_PROCESSES;harq_pid++) {
|
||||
ulsch_harq = ulsch->harq_processes[harq_pid];
|
||||
AssertFatal(ulsch_harq!=NULL,"harq_pid %d is not allocated\n",harq_pid);
|
||||
if ((ulsch_harq->status == NR_ACTIVE) &&
|
||||
(ulsch_harq->frame == frame_rx) &&
|
||||
(ulsch_harq->slot == slot_rx) &&
|
||||
(ulsch_harq->handled == 0)){
|
||||
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d, num_pdus %d\n",frame_rx,slot_rx,num_pdus);
|
||||
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
|
||||
for (int i = 0; i < num_pdus; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE\n",frame_rx,slot_rx);
|
||||
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu;
|
||||
nr_fill_ulsch(gNB,frame_rx,slot_rx,pusch_pdu);
|
||||
|
||||
uint8_t ULSCH_id = find_nr_ulsch(pusch_pdu->rnti,gNB,SEARCH_EXIST);
|
||||
uint8_t harq_pid = pusch_pdu->pusch_data.harq_process_id;
|
||||
uint8_t symbol_start = pusch_pdu->start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + pusch_pdu->nr_of_symbols;
|
||||
|
||||
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
|
||||
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
|
||||
}
|
||||
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1);
|
||||
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1);
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid); // indicate SDU to MAC
|
||||
nr_fill_crc_indication(gNB, frame_rx, slot_rx, ULSCH_id, 0);
|
||||
break;
|
||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE\n",frame_rx,slot_rx);
|
||||
|
||||
nfapi_nr_pucch_pdu_t *pucch_pdu = &UL_tti_req->pdus_list[i].pucch_pdu;
|
||||
switch (pucch_pdu->format_type) {
|
||||
case 0:
|
||||
uci_indication->uci_list[uci_indication->num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE;
|
||||
uci_indication->uci_list[uci_indication->num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_0_1_t);
|
||||
nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu_format0 = &uci_indication->uci_list[uci_indication->num_ucis].pucch_pdu_format_0_1;
|
||||
|
||||
nr_decode_pucch0(gNB,
|
||||
slot_rx,
|
||||
uci_pdu_format0,
|
||||
pucch_pdu);
|
||||
|
||||
uci_indication->num_ucis += 1;
|
||||
break;
|
||||
case 1:
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"Only PUCCH format 0 and 1 are currently supported\n");
|
||||
uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
|
||||
uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
|
||||
for(uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
|
||||
nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
|
||||
}
|
||||
//LOG_M("rxdataF_comp.m","rxF_comp",gNB->pusch_vars[0]->rxdataF_comp[0],6900,1,1);
|
||||
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[0]->rxdataF_ext[0],6900,1,1);
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid); // indicate SDU to MAC
|
||||
nr_fill_crc_indication(gNB, frame_rx, slot_rx, ULSCH_id, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME
|
||||
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int frame_tx, int slot_tx, int do_meas);
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
|
||||
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_prach_pdu_t *prach_pdu);
|
||||
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot);
|
||||
void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
|
||||
void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx);
|
||||
|
||||
@@ -218,6 +218,15 @@ void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
*/
|
||||
void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/*! \brief UE PRACH procedures.
|
||||
@param
|
||||
@param
|
||||
@param
|
||||
*/
|
||||
void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t gNB_id, runmode_t mode);
|
||||
|
||||
int is_nr_prach_subframe(NR_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t subframe);
|
||||
|
||||
#if 0
|
||||
/*! \brief Compute ACK/NACK information for PUSCH/PUCCH for UE transmission in subframe n. This function implements table 10.1-1 of 36.213, p. 69.
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@@ -322,13 +331,14 @@ uint16_t nr_get_n1_pucch(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
uint8_t SR);
|
||||
|
||||
#endif
|
||||
|
||||
/*! \brief This function retrieves the PHY UE mode. It is used as a helper function for the UE MAC.
|
||||
@param Mod_id Local UE index on which to act
|
||||
@param CC_id Component Carrier Index
|
||||
@param eNB_index ID of eNB
|
||||
@param gNB_index ID of gNB
|
||||
@returns UE mode
|
||||
*/
|
||||
UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
UE_MODE_t get_nrUE_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t gNB_index);
|
||||
|
||||
/*! \brief This function implements the power control mechanism for PUCCH from 36.213.
|
||||
@param phy_vars_ue PHY variables
|
||||
|
||||
@@ -34,155 +34,174 @@
|
||||
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
#include "fapi_nr_ue_l1.h"
|
||||
//#include "PHY/phy_vars_nr_ue.h"
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
|
||||
extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
|
||||
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
|
||||
{
|
||||
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
if(scheduled_response != NULL){
|
||||
/// module id
|
||||
module_id_t module_id = scheduled_response->module_id;
|
||||
/// component carrier id
|
||||
uint8_t cc_id = scheduled_response->CC_id;
|
||||
|
||||
module_id_t module_id = scheduled_response->module_id;
|
||||
uint8_t cc_id = scheduled_response->CC_id, thread_id;
|
||||
uint32_t i;
|
||||
int slot = scheduled_response->slot;
|
||||
int slot = scheduled_response->slot;
|
||||
|
||||
// Note: we have to handle the thread IDs for this. To be revisited completely.
|
||||
uint8_t thread_id = PHY_vars_UE_g[module_id][cc_id]->current_thread_id[slot];
|
||||
thread_id = PHY_vars_UE_g[module_id][cc_id]->current_thread_id[slot];
|
||||
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
|
||||
NR_UE_DLSCH_t *dlsch0 = PHY_vars_UE_g[module_id][cc_id]->dlsch[thread_id][0][0];
|
||||
NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0];
|
||||
//NR_DL_FRAME_PARMS frame_parms = PHY_vars_UE_g[module_id][cc_id]->frame_parms;
|
||||
PRACH_RESOURCES_t *prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[0];
|
||||
|
||||
// PUCCH_ConfigCommon_nr_t *pucch_config_common = PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0];
|
||||
// PUCCH_Config_t *pucch_config_dedicated = PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0];
|
||||
|
||||
if(scheduled_response->dl_config != NULL){
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
|
||||
LOG_D(PHY,"Received %d DL pdus\n",dl_config->number_pdus);
|
||||
pdcch_vars->nb_search_space = 0;
|
||||
for(i=0; i<dl_config->number_pdus; ++i){
|
||||
if(dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DCI){
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15;
|
||||
memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config));
|
||||
pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1;
|
||||
LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space);
|
||||
}else{ //FAPI_NR_DL_CONFIG_TYPE_DLSCH
|
||||
// dlsch config pdu
|
||||
for (i = 0; i < dl_config->number_pdus; ++i){
|
||||
|
||||
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->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
|
||||
|
||||
//dlsch0->harq_processes[0]->mcs = &dlsch_config_pdu->mcs;
|
||||
|
||||
NR_DL_UE_HARQ_t *dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
|
||||
if (dl_config->dl_config_list[i].pdu_type == FAPI_NR_DL_CONFIG_TYPE_DCI) {
|
||||
|
||||
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
|
||||
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
|
||||
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->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
|
||||
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
|
||||
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;
|
||||
dlsch0_harq->Nl=1;
|
||||
dlsch0_harq->mcs_table=0;
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
LOG_D(MAC,">>>> \tdlsch0->g_pucch=%d\tdlsch0_harq.mcs=%d\n",dlsch0->g_pucch,dlsch0_harq->mcs);
|
||||
fapi_nr_dl_config_dci_dl_pdu_rel15_t *pdcch_config = &dl_config->dl_config_list[i].dci_config_pdu.dci_config_rel15;
|
||||
memcpy((void*)&pdcch_vars->pdcch_config[pdcch_vars->nb_search_space],(void*)pdcch_config,sizeof(*pdcch_config));
|
||||
pdcch_vars->nb_search_space = pdcch_vars->nb_search_space + 1;
|
||||
LOG_D(PHY,"Number of DCI SearchSpaces %d\n",pdcch_vars->nb_search_space);
|
||||
|
||||
}
|
||||
} else { //FAPI_NR_DL_CONFIG_TYPE_DLSCH
|
||||
|
||||
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;
|
||||
NR_DL_UE_HARQ_t *dlsch0_harq;
|
||||
|
||||
dlsch0->current_harq_pid = current_harq_pid;
|
||||
dlsch0->active = 1;
|
||||
dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
|
||||
//dlsch0->harq_processes[0]->mcs = &dlsch_config_pdu->mcs;
|
||||
dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
|
||||
if (dlsch0_harq != NULL){
|
||||
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
|
||||
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
|
||||
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->dlDmrsSymbPos = dlsch_config_pdu->dlDmrsSymbPos;
|
||||
dlsch0_harq->dmrsConfigType = dlsch_config_pdu->dmrsConfigType;
|
||||
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;
|
||||
dlsch0_harq->Nl=1;
|
||||
dlsch0_harq->mcs_table=0;
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
LOG_D(MAC, ">>>> \tdlsch0->g_pucch = %d\tdlsch0_harq.mcs = %d\n", dlsch0->g_pucch, dlsch0_harq->mcs);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
} else {
|
||||
pdcch_vars->nb_search_space = 0;
|
||||
}
|
||||
|
||||
if(scheduled_response->ul_config != NULL){
|
||||
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]->number_of_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->harq_processes[current_harq_pid]->Nl = pusch_config_pdu->n_layers;
|
||||
ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
|
||||
}
|
||||
if(ul_config->ul_config_list[i].pdu_type == FAPI_NR_UL_CONFIG_TYPE_PUCCH){
|
||||
// pucch config pdu
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_config_pdu = &ul_config->ul_config_list[i].pucch_config_pdu;
|
||||
uint8_t pucch_resource_id = 0; //FIXME!!!
|
||||
uint8_t format = 1; // FIXME!!!
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.initialCyclicShift = pucch_config_pdu->initialCyclicShift;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.nrofSymbols = pucch_config_pdu->nrofSymbols;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.startingSymbolIndex = pucch_config_pdu->startingSymbolIndex;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.nrofPRBs = pucch_config_pdu->nrofPRBs;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->startingPRB = pucch_config_pdu->startingPRB;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.timeDomainOCC = pucch_config_pdu->timeDomainOCC;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.occ_length = pucch_config_pdu->occ_length;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->format_parameters.occ_Index = pucch_config_pdu->occ_Index;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping = pucch_config_pdu->intraSlotFrequencyHopping;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].PUCCH_Resource[pucch_resource_id]->secondHopPRB = pucch_config_pdu->secondHopPRB; // Not sure this parameter is used
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].formatConfig[format-1]->additionalDMRS = pucch_config_pdu->additionalDMRS; // At this point we need to know which format is going to be used
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0].formatConfig[format-1]->pi2PBSK = pucch_config_pdu->pi2PBSK;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0].pucch_GroupHopping = pucch_config_pdu->pucch_GroupHopping;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0].hoppingId = pucch_config_pdu->hoppingId;
|
||||
PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0].p0_nominal = pucch_config_pdu->p0_nominal;
|
||||
/* pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.initialCyclicShift = pucch_config_pdu->initialCyclicShift;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.nrofSymbols = pucch_config_pdu->nrofSymbols;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.startingSymbolIndex = pucch_config_pdu->startingSymbolIndex;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.nrofPRBs = pucch_config_pdu->nrofPRBs;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->startingPRB = pucch_config_pdu->startingPRB;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.timeDomainOCC = pucch_config_pdu->timeDomainOCC;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.occ_length = pucch_config_pdu->occ_length;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.occ_Index = pucch_config_pdu->occ_Index;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping = pucch_config_pdu->intraSlotFrequencyHopping;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->secondHopPRB = pucch_config_pdu->secondHopPRB; // Not sure this parameter is used
|
||||
pucch_config_dedicated->formatConfig[format-1]->additionalDMRS = pucch_config_pdu->additionalDMRS; // At this point we need to know which format is going to be used
|
||||
pucch_config_dedicated->formatConfig[format-1]->pi2PBSK = pucch_config_pdu->pi2PBSK;
|
||||
pucch_config_common->pucch_GroupHopping = pucch_config_pdu->pucch_GroupHopping;
|
||||
pucch_config_common->hoppingId = pucch_config_pdu->hoppingId;
|
||||
pucch_config_common->p0_nominal = pucch_config_pdu->p0_nominal;*/
|
||||
}
|
||||
if(ul_config->ul_config_list[i].pdu_type == FAPI_NR_UL_CONFIG_TYPE_PRACH){
|
||||
// prach config pdu
|
||||
fapi_nr_ul_config_prach_pdu *prach_config_pdu = &ul_config->ul_config_list[i].prach_config_pdu;
|
||||
/*frame_parms.prach_config_common.rootSequenceIndex = prach_config_pdu->root_sequence_index;
|
||||
frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex = prach_config_pdu->prach_configuration_index;
|
||||
frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig = prach_config_pdu->zero_correlation_zone_config;
|
||||
frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag = prach_config_pdu->restrictedset_config;
|
||||
frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset = prach_config_pdu->prach_freq_offset;*/
|
||||
prach_resources->ra_PreambleIndex = prach_config_pdu->preamble_index;
|
||||
}
|
||||
|
||||
for (i = 0; i < ul_config->number_pdus; ++i){
|
||||
|
||||
uint8_t pdu_type = ul_config->ul_config_list[i].pdu_type, pucch_resource_id, current_harq_pid, format, gNB_id = 0;
|
||||
/* PRACH */
|
||||
NR_PRACH_RESOURCES_t *prach_resources;
|
||||
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
|
||||
/* PUSCH */
|
||||
fapi_nr_ul_config_pusch_pdu_rel15_t *pusch_config_pdu;
|
||||
/* PUCCH */
|
||||
fapi_nr_ul_config_pucch_pdu *pucch_config_pdu;
|
||||
PUCCH_ConfigCommon_nr_t *pucch_config_common_nr;
|
||||
PUCCH_Config_t *pucch_config_dedicated_nr;
|
||||
PUCCH_format_t *format_params;
|
||||
|
||||
switch (pdu_type){
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PUSCH):
|
||||
// pusch config pdu
|
||||
pusch_config_pdu = &ul_config->ul_config_list[i].ulsch_config_pdu.ulsch_pdu_rel15;
|
||||
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]->number_of_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->harq_processes[current_harq_pid]->Nl = pusch_config_pdu->n_layers;
|
||||
ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
|
||||
break;
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PUCCH):
|
||||
// pucch config pdu
|
||||
pucch_config_pdu = &ul_config->ul_config_list[i].pucch_config_pdu;
|
||||
pucch_resource_id = 0; //FIXME!!!
|
||||
format = 1; // FIXME!!!
|
||||
pucch_config_common_nr = &PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0];
|
||||
pucch_config_dedicated_nr = &PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0];
|
||||
format_params = &pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->format_parameters;
|
||||
|
||||
format_params->initialCyclicShift = pucch_config_pdu->initialCyclicShift;
|
||||
format_params->nrofSymbols = pucch_config_pdu->nrofSymbols;
|
||||
format_params->startingSymbolIndex = pucch_config_pdu->startingSymbolIndex;
|
||||
format_params->nrofPRBs = pucch_config_pdu->nrofPRBs;
|
||||
format_params->timeDomainOCC = pucch_config_pdu->timeDomainOCC;
|
||||
format_params->occ_length = pucch_config_pdu->occ_length;
|
||||
format_params->occ_Index = pucch_config_pdu->occ_Index;
|
||||
|
||||
pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->startingPRB = pucch_config_pdu->startingPRB;
|
||||
pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping = pucch_config_pdu->intraSlotFrequencyHopping;
|
||||
pucch_config_dedicated_nr->PUCCH_Resource[pucch_resource_id]->secondHopPRB = pucch_config_pdu->secondHopPRB; // Not sure this parameter is used
|
||||
pucch_config_dedicated_nr->formatConfig[format - 1]->additionalDMRS = pucch_config_pdu->additionalDMRS; // At this point we need to know which format is going to be used
|
||||
pucch_config_dedicated_nr->formatConfig[format - 1]->pi2PBSK = pucch_config_pdu->pi2PBSK;
|
||||
|
||||
pucch_config_common_nr->pucch_GroupHopping = pucch_config_pdu->pucch_GroupHopping;
|
||||
pucch_config_common_nr->hoppingId = pucch_config_pdu->hoppingId;
|
||||
pucch_config_common_nr->p0_nominal = pucch_config_pdu->p0_nominal;
|
||||
|
||||
/* pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.initialCyclicShift = pucch_config_pdu->initialCyclicShift;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.nrofSymbols = pucch_config_pdu->nrofSymbols;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.startingSymbolIndex = pucch_config_pdu->startingSymbolIndex;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.nrofPRBs = pucch_config_pdu->nrofPRBs;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->startingPRB = pucch_config_pdu->startingPRB;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.timeDomainOCC = pucch_config_pdu->timeDomainOCC;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.occ_length = pucch_config_pdu->occ_length;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->format_parameters.occ_Index = pucch_config_pdu->occ_Index;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->intraSlotFrequencyHopping = pucch_config_pdu->intraSlotFrequencyHopping;
|
||||
pucch_config_dedicated->PUCCH_Resource[pucch_resource_id]->secondHopPRB = pucch_config_pdu->secondHopPRB; // Not sure this parameter is used
|
||||
pucch_config_dedicated->formatConfig[format-1]->additionalDMRS = pucch_config_pdu->additionalDMRS; // At this point we need to know which format is going to be used
|
||||
pucch_config_dedicated->formatConfig[format-1]->pi2PBSK = pucch_config_pdu->pi2PBSK;
|
||||
pucch_config_common->pucch_GroupHopping = pucch_config_pdu->pucch_GroupHopping;
|
||||
pucch_config_common->hoppingId = pucch_config_pdu->hoppingId;
|
||||
pucch_config_common->p0_nominal = pucch_config_pdu->p0_nominal;*/
|
||||
break;
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PRACH):
|
||||
// prach config pdu
|
||||
prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[gNB_id];
|
||||
prach_config_pdu = &ul_config->ul_config_list[i].prach_config_pdu;
|
||||
memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_pdu), (void*)prach_config_pdu, sizeof(fapi_nr_ul_config_prach_pdu));
|
||||
PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_Config_enabled = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
||||
} else {
|
||||
}
|
||||
|
||||
if(scheduled_response->tx_request != NULL){
|
||||
|
||||
}else{
|
||||
|
||||
if (scheduled_response->tx_request != NULL){
|
||||
} else {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -193,10 +212,10 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
|
||||
int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){
|
||||
|
||||
fapi_nr_config_request_t *nrUE_config = &PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->nrUE_config;
|
||||
|
||||
|
||||
if(phy_config != NULL)
|
||||
memcpy(nrUE_config,&phy_config->config_req,sizeof(fapi_nr_config_request_t));
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -104,7 +104,7 @@ int16_t get_pucch_tx_power_ue(PHY_VARS_NR_UE *ue,
|
||||
|
||||
int P_O_PUCCH = P_O_NOMINAL_PUCCH + P_O_UE_PUCCH;
|
||||
|
||||
int16_t PL = get_nr_PL(ue, gNB_id); /* LTE function because NR path loss not yet implemented FFS TODO NR */
|
||||
int16_t PL = get_nr_PL(ue->Mod_id, ue->CC_id, gNB_id); /* LTE function because NR path loss not yet implemented FFS TODO NR */
|
||||
|
||||
int16_t delta_F_PUCCH = power_config->deltaF_PUCCH_f[pucch_format];
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include <openair1/SCHED/sched_common.h>
|
||||
#include <openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h>
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
#ifndef NO_RAT_NR
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ int main(int argc, char **argv)
|
||||
uint8_t is_crnti = 0, llr8_flag = 0;
|
||||
unsigned int TBS = 8424;
|
||||
unsigned int available_bits;
|
||||
uint8_t nb_re_dmrs = 6;
|
||||
uint8_t nb_re_dmrs = 12; // No data in dmrs symbol
|
||||
uint16_t length_dmrs = 1;
|
||||
unsigned char mod_order;
|
||||
uint16_t rate;
|
||||
@@ -442,7 +442,7 @@ int main(int argc, char **argv)
|
||||
mod_order = nr_get_Qm_dl(Imcs, mcs_table);
|
||||
rate = nr_get_code_rate_dl(Imcs, mcs_table);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order,rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, Nl);
|
||||
TBS = nr_compute_tbs(mod_order,rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl);
|
||||
printf("available bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
|
||||
//dlsch->harq_ids[subframe]= 0;
|
||||
rel15->rbSize = nb_rb;
|
||||
|
||||
@@ -28,11 +28,9 @@
|
||||
#include "common/ran_context.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_defs.h"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_extern.h"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_defs.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_extern.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
@@ -55,7 +53,7 @@
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
//#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
//#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "NR_asn_constant.h"
|
||||
#include "RRC/NR/MESSAGES/asn1_msg.h"
|
||||
#include "openair1/SIMULATION/RF/rf.h"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); }
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
//int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
//int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int32_t get_uldl_offset(int nr_bandP) { return(0); }
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return(NULL);}
|
||||
|
||||
@@ -0,0 +1,348 @@
|
||||
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); }
|
||||
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
|
||||
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
//int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) { return(0); }
|
||||
int32_t get_uldl_offset(int nr_bandP) { return(0); }
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id) {return(NULL);}
|
||||
int dummy_nr_ue_dl_indication(nr_downlink_indication_t *dl_info) { return(0); }
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(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 ra_procedures.c
|
||||
* \brief Routines for UE MAC-layer Random Access procedures (TS 38.321, Release 15)
|
||||
* \author R. Knopp, Navid Nikaein, Guido Casati
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr navid.nikaein@eurecom.fr, guido.casati@iis.fraunhofer.de
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"*/
|
||||
|
||||
/* Tools */
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
|
||||
/* RRC */
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
|
||||
/* PHY */
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
|
||||
|
||||
/* MAC */
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
|
||||
extern int64_t table_6_3_3_2_2_prachConfig_Index [256][9];
|
||||
extern int64_t table_6_3_3_2_3_prachConfig_Index [256][9];
|
||||
|
||||
//extern uint8_t nfapi_mode;
|
||||
|
||||
// WIP
|
||||
// This routine implements Section 5.1.2 (UE Random Access Resource Selection)
|
||||
// and Section 5.1.3 (Random Access Preamble Transmission) from 3GPP TS 38.321
|
||||
void nr_get_prach_resources(module_id_t mod_id,
|
||||
int CC_id,
|
||||
uint8_t gNB_id,
|
||||
uint8_t t_id,
|
||||
uint8_t first_Msg3,
|
||||
NR_PRACH_RESOURCES_t *prach_resources,
|
||||
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon;
|
||||
// NR_BeamFailureRecoveryConfig_t *beam_failure_recovery_config = &mac->RA_BeamFailureRecoveryConfig; // todo
|
||||
|
||||
int messagePowerOffsetGroupB, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3;
|
||||
uint8_t noGroupB = 0, s_id, f_id, ul_carrier_id, msg1_FDM, prach_ConfigIndex, SFN_nbr, Msg3_size;
|
||||
|
||||
// NR_RSRP_Range_t rsrp_ThresholdSSB; // todo
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//////////* UE Random Access Resource Selection *//////////
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// todo:
|
||||
// - switch initialisation cases
|
||||
// -- RA initiated by beam failure recovery operation (subclause 5.17 TS 38.321)
|
||||
// --- SSB selection, set prach_resources->ra_PreambleIndex
|
||||
// -- RA initiated by PDCCH: ra_preamble_index provided by PDCCH && ra_PreambleIndex != 0b000000
|
||||
// --- set PREAMBLE_INDEX to ra_preamble_index
|
||||
// --- select the SSB signalled by PDCCH
|
||||
// -- RA initiated for SI request:
|
||||
// --- SSB selection, set prach_resources->ra_PreambleIndex
|
||||
|
||||
// if (rach_ConfigDedicated) { // This is for network controlled Mobility
|
||||
// // operation for contention-free RA resources when:
|
||||
// // - available SSB with SS-RSRP above rsrp-ThresholdSSB: SSB selection
|
||||
// // - availalbe CSI-RS with CSI-RSRP above rsrp-ThresholdCSI-RS: CSI-RS selection
|
||||
// prach_resources->ra_PreambleIndex = rach_ConfigDedicated->ra_PreambleIndex;
|
||||
// return;
|
||||
// }
|
||||
|
||||
//////////* Contention-based RA preamble selection *//////////
|
||||
// todo:
|
||||
// - selection of SSB with SS-RSRP above rsrp-ThresholdSSB else select any SSB
|
||||
// - todo determine next available PRACH occasion
|
||||
|
||||
// rsrp_ThresholdSSB = *nr_rach_ConfigCommon->rsrp_ThresholdSSB;
|
||||
|
||||
AssertFatal(mac->nr_rach_ConfigCommon != NULL, "[UE %d] FATAL nr_rach_ConfigCommon is NULL !!!\n", mod_id);
|
||||
|
||||
nr_rach_ConfigCommon = mac->nr_rach_ConfigCommon;
|
||||
|
||||
Msg3_size = mac->RA_Msg3_size;
|
||||
numberOfRA_Preambles = *nr_rach_ConfigCommon->totalNumberOfRA_Preambles;
|
||||
|
||||
if (!nr_rach_ConfigCommon->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
} else {
|
||||
// RA preambles group B is configured
|
||||
// - Defining the number of RA preambles in RA Preamble Group A for each SSB */
|
||||
sizeOfRA_PreamblesGroupA = nr_rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA){
|
||||
/* - Threshold to determine the groups of RA preambles */
|
||||
case 0:
|
||||
messageSizeGroupA = 56;
|
||||
break;
|
||||
case 1:
|
||||
messageSizeGroupA = 144;
|
||||
break;
|
||||
case 2:
|
||||
messageSizeGroupA = 208;
|
||||
break;
|
||||
case 3:
|
||||
messageSizeGroupA = 256;
|
||||
break;
|
||||
case 4:
|
||||
messageSizeGroupA = 282;
|
||||
break;
|
||||
case 5:
|
||||
messageSizeGroupA = 480;
|
||||
break;
|
||||
case 6:
|
||||
messageSizeGroupA = 640;
|
||||
break;
|
||||
case 7:
|
||||
messageSizeGroupA = 800;
|
||||
break;
|
||||
case 8:
|
||||
messageSizeGroupA = 1000;
|
||||
break;
|
||||
case 9:
|
||||
messageSizeGroupA = 72;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown ra_Msg3SizeGroupA %lu\n", nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA);
|
||||
/* todo cases 10 -15*/
|
||||
}
|
||||
|
||||
/* Power offset for preamble selection in dB */
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB){
|
||||
case 0:
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
break;
|
||||
case 1:
|
||||
messagePowerOffsetGroupB = 0;
|
||||
break;
|
||||
case 2:
|
||||
messagePowerOffsetGroupB = 5;
|
||||
break;
|
||||
case 3:
|
||||
messagePowerOffsetGroupB = 8;
|
||||
break;
|
||||
case 4:
|
||||
messagePowerOffsetGroupB = 10;
|
||||
break;
|
||||
case 5:
|
||||
messagePowerOffsetGroupB = 12;
|
||||
break;
|
||||
case 6:
|
||||
messagePowerOffsetGroupB = 15;
|
||||
break;
|
||||
case 7:
|
||||
messagePowerOffsetGroupB = 18;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown messagePowerOffsetGroupB %lu\n", nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB);
|
||||
}
|
||||
|
||||
// todo Msg3-DeltaPreamble should be provided from higher layers, otherwise is 0
|
||||
mac->deltaPreamble_Msg3 = 0;
|
||||
deltaPreamble_Msg3 = mac->deltaPreamble_Msg3;
|
||||
}
|
||||
|
||||
PLThreshold = prach_resources->RA_PCMAX - nr_rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower - deltaPreamble_Msg3 - messagePowerOffsetGroupB;
|
||||
|
||||
/* Msg3 has not been transmitted yet */
|
||||
if (first_Msg3 == 1) {
|
||||
if (noGroupB == 1) {
|
||||
// use Group A preamble
|
||||
prach_resources->ra_PreambleIndex = (taus()) % numberOfRA_Preambles;
|
||||
mac->RA_usedGroupA = 1;
|
||||
} else if ((Msg3_size < messageSizeGroupA) && (get_nr_PL(mod_id, CC_id, gNB_id) > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
prach_resources->ra_PreambleIndex = (taus()) % sizeOfRA_PreamblesGroupA;
|
||||
mac->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
prach_resources->ra_PreambleIndex = sizeOfRA_PreamblesGroupA + (taus()) % (numberOfRA_Preambles - sizeOfRA_PreamblesGroupA);
|
||||
mac->RA_usedGroupA = 0;
|
||||
}
|
||||
} else { // Msg3 is being retransmitted
|
||||
if (mac->RA_usedGroupA == 1 && noGroupB == 1) {
|
||||
prach_resources->ra_PreambleIndex = (taus()) % numberOfRA_Preambles;
|
||||
} else if (mac->RA_usedGroupA == 1 && noGroupB == 0){
|
||||
prach_resources->ra_PreambleIndex = (taus()) % sizeOfRA_PreamblesGroupA;
|
||||
} else {
|
||||
prach_resources->ra_PreambleIndex = sizeOfRA_PreamblesGroupA + (taus()) % (numberOfRA_Preambles - sizeOfRA_PreamblesGroupA);
|
||||
}
|
||||
}
|
||||
|
||||
// todo determine next available PRACH occasion
|
||||
// - if RA initiated for SI request and ra_AssociationPeriodIndex and si-RequestPeriod are configured
|
||||
// - else if SSB is selected above
|
||||
// - else if CSI-RS is selected above
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//////////* Random Access Preamble Transmission (5.1.3 TS 38.321) *//////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// todo:
|
||||
// - condition on notification of suspending power ramping counter from lower layer (5.1.3 TS 38.321)
|
||||
// - check if SSB or CSI-RS have not changed since the selection in the last RA Preamble tranmission
|
||||
// - Extend RA_rnti computation (e.g. f_id selection, ul_carrier_id are hardcoded)
|
||||
|
||||
if (mac->RA_PREAMBLE_TRANSMISSION_COUNTER > 1)
|
||||
mac->RA_PREAMBLE_TRANSMISSION_COUNTER++;
|
||||
|
||||
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id);
|
||||
|
||||
// RA-RNTI computation (associated to PRACH occasion in which the RA Preamble is transmitted)
|
||||
// 1) this does not apply to contention-free RA Preamble for beam failure recovery request
|
||||
// 2) getting star_symb, SFN_nbr from table 6.3.3.2-3 (TDD and FR1 scenario)
|
||||
|
||||
switch (nr_rach_ConfigCommon->rach_ConfigGeneric.msg1_FDM){ // todo this is not used
|
||||
case 0:
|
||||
msg1_FDM = 1;
|
||||
break;
|
||||
case 1:
|
||||
msg1_FDM = 2;
|
||||
break;
|
||||
case 2:
|
||||
msg1_FDM = 4;
|
||||
break;
|
||||
case 3:
|
||||
msg1_FDM = 8;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown msg1_FDM %lu\n", nr_rach_ConfigCommon->rach_ConfigGeneric.msg1_FDM);
|
||||
}
|
||||
|
||||
prach_ConfigIndex = nr_rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex;
|
||||
|
||||
// ra_RNTI computation
|
||||
// - todo: this is for TDD FR1 only
|
||||
// - ul_carrier_id: UL carrier used for RA preamble transmission, hardcoded for NUL carrier
|
||||
// - f_id: index of the PRACH occasion in the frequency domain
|
||||
// - s_id is starting symbol of the PRACH occasion [0...14]
|
||||
// - t_id is the first slot of the PRACH occasion in a system frame [0...80]
|
||||
|
||||
ul_carrier_id = 0; // NUL
|
||||
f_id = nr_rach_ConfigCommon->rach_ConfigGeneric.msg1_FrequencyStart;
|
||||
SFN_nbr = table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][4];
|
||||
s_id = table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][5];
|
||||
|
||||
// Pick the first slot of the PRACH occasion in a system frame
|
||||
for (i = 0; i < 10; i++){
|
||||
if (((SFN_nbr & (1 << i)) >> i) == 1){
|
||||
t_id = 2*i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
prach_resources->ra_RNTI = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
|
||||
mac->ra_rnti = prach_resources->ra_RNTI;
|
||||
|
||||
LOG_D(MAC, "Computed ra_RNTI is %d", prach_resources->ra_RNTI);
|
||||
}
|
||||
|
||||
// TbD: RA_attempt_number not used
|
||||
void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id){
|
||||
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
mac->ra_state = WAIT_RAR;
|
||||
// Start contention resolution timer
|
||||
mac->RA_attempt_number++;
|
||||
}
|
||||
|
||||
void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id){
|
||||
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
|
||||
LOG_D(MAC,"[UE %d][RAPROC] Frame %d : Msg3_tx: Starting contention resolution timer\n", mod_id, frameP);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
// start contention resolution timer
|
||||
mac->RA_contention_resolution_cnt = 0;
|
||||
mac->RA_contention_resolution_timer_active = 1;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
///////* Random Access Preamble Initialization (5.1.1 TS 38.321) *///////
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/// Handling inizialization by PDCCH order, MAC entity or RRC (TS 38.300)
|
||||
/// Only one RA procedure is ongoing at any point in time in a MAC entity
|
||||
/// the RA procedure on a SCell shall only be initiated by PDCCH order
|
||||
|
||||
// WIP
|
||||
// todo TS 38.321:
|
||||
// - check if carrier to use is explicitly signalled then do (1) RA CARRIER SELECTION (SUL, NUL) (2) set PCMAX
|
||||
// - BWP operation (subclause 5.15 TS 38.321)
|
||||
// - handle initialization by beam failure recovery
|
||||
// - handle initialization by handover
|
||||
// - handle transmission on DCCH using PRACH (during handover, or sending SR for example)
|
||||
// - take into account MAC CEs in size_sdu (currently hardcoded size to 1 MAC subPDU and 1 padding subheader)
|
||||
// - fix rrc data req logic
|
||||
// - retrieve TBS
|
||||
// - add mac_rrc_nr_data_req_ue, etc ...
|
||||
// - add the backoff condition here if we have it from a previous RA reponse which failed (i.e. backoff indicator)
|
||||
|
||||
|
||||
@@ -55,6 +55,24 @@ signed char quantize(double D, double x, unsigned char B) {
|
||||
return ((char) qxd);
|
||||
}
|
||||
|
||||
|
||||
int8_t
|
||||
mac_rrc_data_req_ue(
|
||||
const module_id_t Mod_idP,
|
||||
const int CC_id,
|
||||
const frame_t frameP,
|
||||
const rb_id_t Srb_id,
|
||||
const uint8_t Nb_tb,
|
||||
uint8_t *const buffer_pP,
|
||||
const mac_enb_index_t eNB_indexP,
|
||||
const uint8_t mbsfn_sync_area
|
||||
) { return(0);}
|
||||
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);}
|
||||
//NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
|
||||
|
||||
void fill_scc(NR_ServingCellConfigCommon_t *scc,uint64_t *ssb_bitmap,int N_RB_DL,int N_RB_UL,int mu_dl,int mu_ul) {
|
||||
|
||||
*scc->physCellId=0; \
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <unistd.h>
|
||||
#include <pthread.h>
|
||||
|
||||
#include "common/config/config_userapi.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
@@ -35,115 +36,85 @@
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "SCHED_NR_UE/phy_frame_config_nr.h"
|
||||
#include "PHY/phy_vars_nr_ue.h"
|
||||
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
#include "PHY/NR_REFSIG/nr_mod_table.h"
|
||||
#include "PHY/MODULATION/modulation_eNB.h"
|
||||
#include "PHY/MODULATION/modulation_UE.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_proto_common.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "nr_unitary_defs.h"
|
||||
#include "OCG_vars.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#define NR_PRACH_DEBUG 1
|
||||
#define PRACH_WRITE_OUTPUT_DEBUG 1
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
RAN_CONTEXT_t RC;
|
||||
RU_t *ru;
|
||||
|
||||
double cpuf;
|
||||
|
||||
extern uint16_t prach_root_sequence_map0_3[838];
|
||||
|
||||
void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
uint16_t NB_UE_INST=1;
|
||||
volatile int oai_exit=0;
|
||||
|
||||
void exit_function(const char* file, const char* function, const int line,const char *s) {
|
||||
const char * msg= s==NULL ? "no comment": s;
|
||||
printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
|
||||
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) {
|
||||
AssertFatal(1==0,"Shouldn't be here ...\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sub_frame_t subframe, uint8_t eNB_index,
|
||||
uint8_t *ulsch_buffer, uint16_t buflen, uint8_t *access_mode) {return(0);}
|
||||
|
||||
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {return(0);}
|
||||
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
uint8_t nfapi_mode=0;
|
||||
NR_IF_Module_t *NR_IF_Module_init(int Mod_id){return(NULL);}
|
||||
int oai_nfapi_ul_config_req(nfapi_ul_config_request_t *ul_config_req) { return(0); }
|
||||
int sl_ahead = 0;
|
||||
|
||||
uint64_t get_softmodem_optmask(void) {
|
||||
return 0;
|
||||
}
|
||||
//void dump_nr_prach_config(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
softmodem_params_t *get_softmodem_params(void) {return 0;}
|
||||
|
||||
void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;}
|
||||
|
||||
boolean_t pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
mem_block_t *const sdu_buffer_pP) {return(false);}
|
||||
|
||||
void nr_ip_over_LTE_DRB_preconfiguration(void){}
|
||||
void pdcp_layer_init(void) {}
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) {return 0;}
|
||||
|
||||
int main(int argc, char **argv){
|
||||
|
||||
char c;
|
||||
|
||||
int i,aa,aarx;
|
||||
double sigma2, sigma2_dB=0,SNR,snr0=-2.0,snr1=0.0,ue_speed0=0.0,ue_speed1=0.0;
|
||||
uint8_t snr1set=0;
|
||||
uint8_t ue_speed1set=0;
|
||||
int **txdata;
|
||||
double **s_re,**s_im,**r_re,**r_im;
|
||||
double iqim=0.0;
|
||||
int trial; //, ntrials=1;
|
||||
uint8_t transmission_mode = 1,n_tx=1,n_rx=1;
|
||||
uint16_t Nid_cell=0;
|
||||
|
||||
uint8_t awgn_flag=0;
|
||||
uint8_t hs_flag=0;
|
||||
int n_frames=1;
|
||||
channel_desc_t *UE2gNB;
|
||||
uint32_t nsymb,tx_lev; //,tx_lev_dB;
|
||||
double sigma2, sigma2_dB = 0, SNR, snr0 = -2.0, snr1 = 0.0, ue_speed0 = 0.0, ue_speed1 = 0.0;
|
||||
double **s_re, **s_im, **r_re, **r_im, iqim = 0.0, delay_avg = 0, ue_speed = 0, fs, bw;
|
||||
int i, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1;
|
||||
int N_RB_UL = 106, delay = 0, NCS_config = 13, rootSequenceIndex = 1, threequarter_fs = 0, mu = 1, fd_occasion = 0, loglvl = OAILOG_INFO, numRA = 0, prachStartSymbol = 0;
|
||||
uint8_t snr1set = 0, ue_speed1set = 0, transmission_mode = 1, n_tx = 1, n_rx = 1, awgn_flag = 0, msg1_frequencystart = 0, num_prach_fd_occasions = 1, prach_format;
|
||||
uint8_t frame = 1, subframe = 19, config_index = 98, prach_sequence_length = 1, num_root_sequences = 16, restrictedSetConfig = 0, N_dur, N_t_slot, start_symbol;
|
||||
uint16_t Nid_cell = 0, preamble_tx = 0, preamble_delay, format, format0, format1;
|
||||
uint32_t tx_lev = 10000, prach_errors = 0, samp_count; //,tx_lev_dB;
|
||||
uint64_t SSB_positions = 0x01, absoluteFrequencyPointA = 640000;
|
||||
// int8_t interf1=-19,interf2=-19;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
SCM_t channel_model=Rayleigh1;
|
||||
|
||||
// uint8_t abstraction_flag=0,calibration_flag=0;
|
||||
// double prach_sinr;
|
||||
int N_RB_UL=273;
|
||||
uint32_t prach_errors=0;
|
||||
uint8_t subframe=9;
|
||||
uint16_t preamble_energy_list[64],preamble_tx=50,preamble_delay_list[64];
|
||||
uint16_t preamble_max,preamble_energy_max;
|
||||
PRACH_RESOURCES_t prach_resources;
|
||||
//uint8_t prach_fmt;
|
||||
//int N_ZC;
|
||||
int delay = 0;
|
||||
double delay_avg=0;
|
||||
double ue_speed = 0;
|
||||
int NCS_config = 13,rootSequenceIndex=0;
|
||||
int threequarter_fs = 0;
|
||||
int mu=1;
|
||||
uint64_t SSB_positions=0x01;
|
||||
// uint32_t nsymb;
|
||||
// uint16_t preamble_max, preamble_energy_max;
|
||||
|
||||
int loglvl=OAILOG_INFO;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
NR_PRACH_RESOURCES_t prach_resources;
|
||||
nfapi_nr_prach_config_t *prach_config;
|
||||
nfapi_nr_prach_pdu_t *prach_pdu;
|
||||
fapi_nr_prach_config_t *ue_prach_config;
|
||||
fapi_nr_ul_config_prach_pdu *ue_prach_pdu;
|
||||
|
||||
channel_desc_t *UE2gNB;
|
||||
SCM_t channel_model = Rayleigh1;
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
|
||||
|
||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) {
|
||||
exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
|
||||
}
|
||||
|
||||
randominit(0);
|
||||
|
||||
|
||||
while ((c = getopt (argc, argv, "hHaA:Cr:p:g:n:s:S:t:x:y:v:V:z:N:F:d:Z:L:R:E")) != -1) {
|
||||
switch (c) {
|
||||
case 'a':
|
||||
@@ -210,7 +181,7 @@ int main(int argc, char **argv)
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("Unsupported channel model!\n");
|
||||
printf("Unsupported channel model!\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -226,13 +197,13 @@ int main(int argc, char **argv)
|
||||
|
||||
case 's':
|
||||
snr0 = atof(optarg);
|
||||
msg("Setting SNR0 to %f\n",snr0);
|
||||
printf("Setting SNR0 to %f\n",snr0);
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
snr1 = atof(optarg);
|
||||
snr1set=1;
|
||||
msg("Setting SNR1 to %f\n",snr1);
|
||||
printf("Setting SNR1 to %f\n",snr1);
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
@@ -258,7 +229,7 @@ int main(int argc, char **argv)
|
||||
|
||||
case 'H':
|
||||
printf("High-Speed Flag enabled\n");
|
||||
hs_flag = 1;
|
||||
restrictedSetConfig = 1;
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
@@ -275,7 +246,7 @@ int main(int argc, char **argv)
|
||||
if ((transmission_mode!=1) &&
|
||||
(transmission_mode!=2) &&
|
||||
(transmission_mode!=6)) {
|
||||
msg("Unsupported transmission mode %d\n",transmission_mode);
|
||||
printf("Unsupported transmission mode %d\n",transmission_mode);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -285,7 +256,7 @@ int main(int argc, char **argv)
|
||||
n_tx=atoi(optarg);
|
||||
|
||||
if ((n_tx==0) || (n_tx>2)) {
|
||||
msg("Unsupported number of tx antennas %d\n",n_tx);
|
||||
printf("Unsupported number of tx antennas %d\n",n_tx);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -295,7 +266,7 @@ int main(int argc, char **argv)
|
||||
n_rx=atoi(optarg);
|
||||
|
||||
if ((n_rx==0) || (n_rx>2)) {
|
||||
msg("Unsupported number of rx antennas %d\n",n_rx);
|
||||
printf("Unsupported number of rx antennas %d\n",n_rx);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
@@ -339,20 +310,13 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
// Configure log
|
||||
logInit();
|
||||
|
||||
set_glog(loglvl);
|
||||
T_stdout = 1;
|
||||
|
||||
SET_LOG_DEBUG(PRACH);
|
||||
|
||||
if (snr1set==0) {
|
||||
if (n_frames==1)
|
||||
snr1 = snr0+.1;
|
||||
else
|
||||
snr1 = snr0+5.0;
|
||||
}
|
||||
|
||||
// Configure gNB and RU
|
||||
RC.gNB = (PHY_VARS_gNB**) malloc(2*sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
|
||||
memset(RC.gNB[0],0,sizeof(PHY_VARS_gNB));
|
||||
@@ -362,90 +326,200 @@ int main(int argc, char **argv)
|
||||
memset(RC.ru[0],0,sizeof(RU_t));
|
||||
RC.nb_RU = 1;
|
||||
|
||||
gNB = RC.gNB[0];
|
||||
ru = RC.ru[0];
|
||||
|
||||
|
||||
if (ue_speed1set==0) {
|
||||
if (n_frames==1)
|
||||
ue_speed1 = ue_speed0+10;
|
||||
else
|
||||
ue_speed1 = ue_speed0+50;
|
||||
}
|
||||
|
||||
printf("SNR0 %f, SNR1 %f\n",snr0,snr1);
|
||||
|
||||
frame_parms = &gNB->frame_parms;
|
||||
|
||||
|
||||
gNB = RC.gNB[0];
|
||||
ru = RC.ru[0];
|
||||
frame_parms = &gNB->frame_parms;
|
||||
prach_config = &gNB->gNB_config.prach_config;
|
||||
prach_pdu = &gNB->prach_vars.list[0].pdu;
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
|
||||
s_re = malloc(2*sizeof(double*));
|
||||
s_im = malloc(2*sizeof(double*));
|
||||
r_re = malloc(2*sizeof(double*));
|
||||
r_im = malloc(2*sizeof(double*));
|
||||
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
frame_parms->N_RB_DL = N_RB_UL;
|
||||
frame_parms->N_RB_UL = N_RB_UL;
|
||||
frame_parms->threequarter_fs = threequarter_fs;
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
frame_parms->N_RB_DL = N_RB_UL;
|
||||
frame_parms->N_RB_UL = N_RB_UL;
|
||||
frame_parms->threequarter_fs = threequarter_fs;
|
||||
frame_parms->frame_type = TDD;
|
||||
frame_parms->freq_range = nr_FR1;
|
||||
frame_parms->numerology_index = mu;
|
||||
|
||||
nr_phy_config_request_sim(gNB, N_RB_UL, N_RB_UL, mu, Nid_cell, SSB_positions);
|
||||
|
||||
nr_phy_config_request_sim(gNB,N_RB_UL,N_RB_UL,mu,Nid_cell,SSB_positions);
|
||||
//nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
|
||||
|
||||
frame_parms->frame_type = TDD;
|
||||
frame_parms->freq_range = nr_FR1;
|
||||
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d, Frame type %s, Frequency Range %s\n",
|
||||
NUMBER_OF_OFDM_CARRIERS,
|
||||
frame_parms->Ncp,
|
||||
frame_parms->samples_per_subframe,
|
||||
frame_parms->frame_type == FDD ? "FDD" : "TDD",
|
||||
frame_parms->freq_range == nr_FR1 ? "FR1" : "FR2");
|
||||
|
||||
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
|
||||
ru->nr_frame_parms = frame_parms;
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->nb_tx = n_tx;
|
||||
ru->nb_rx = n_rx;
|
||||
|
||||
printf("FFT Size %d, Extended Prefix %d, Samples per subframe %d,Frame type %s, Frequency Range %s\n",NUMBER_OF_OFDM_CARRIERS,
|
||||
frame_parms->Ncp,frame_parms->samples_per_subframe,frame_parms->frame_type == FDD ? "FDD" : "TDD", frame_parms->freq_range == nr_FR1 ? "FR1" : "FR2");
|
||||
gNB->gNB_config.carrier_config.num_tx_ant.value = 1;
|
||||
gNB->gNB_config.carrier_config.num_rx_ant.value = 1;
|
||||
gNB->gNB_config.tdd_table.tdd_period.value = 6;
|
||||
|
||||
ru->nr_frame_parms=frame_parms;
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->nb_tx = n_tx;
|
||||
ru->nb_rx = n_rx;
|
||||
gNB->gNB_config.prach_config.num_prach_fd_occasions.value = num_prach_fd_occasions;
|
||||
gNB->gNB_config.prach_config.num_prach_fd_occasions_list = (nfapi_nr_num_prach_fd_occasions_t *) malloc(num_prach_fd_occasions*sizeof(nfapi_nr_num_prach_fd_occasions_t));
|
||||
|
||||
gNB->proc.slot_rx = subframe;
|
||||
|
||||
get_nr_prach_info_from_index(config_index,
|
||||
(int)frame,
|
||||
(int)subframe,
|
||||
absoluteFrequencyPointA,
|
||||
mu,
|
||||
frame_parms->frame_type,
|
||||
&format,
|
||||
&start_symbol,
|
||||
&N_t_slot,
|
||||
&N_dur);
|
||||
|
||||
format0 = format&0xff; // first column of format from table
|
||||
format1 = (format>>8)&0xff; // second column of format from table
|
||||
|
||||
if (format1 != 0xff) {
|
||||
switch(format0) {
|
||||
case 0xa1:
|
||||
prach_format = 9;
|
||||
break;
|
||||
case 0xa2:
|
||||
prach_format = 10;
|
||||
break;
|
||||
case 0xa3:
|
||||
prach_format = 11;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0, "Only formats A1/B1 A2/B2 A3/B3 are valid for dual format");
|
||||
}
|
||||
} else {
|
||||
switch(format0) {
|
||||
case 0xa1:
|
||||
prach_format = 0;
|
||||
break;
|
||||
case 0xa2:
|
||||
prach_format = 1;
|
||||
break;
|
||||
case 0xa3:
|
||||
prach_format = 2;
|
||||
break;
|
||||
case 0xb1:
|
||||
prach_format = 3;
|
||||
break;
|
||||
case 0xb2:
|
||||
prach_format = 4;
|
||||
break;
|
||||
case 0xb3:
|
||||
prach_format = 5;
|
||||
break;
|
||||
case 0xb4:
|
||||
prach_format = 6;
|
||||
break;
|
||||
case 0xc0:
|
||||
prach_format = 7;
|
||||
break;
|
||||
case 0xc2:
|
||||
prach_format = 8;
|
||||
break;
|
||||
case 0:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
case 1:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
case 2:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
case 3:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid PRACH format");
|
||||
}
|
||||
}
|
||||
|
||||
prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index.value = rootSequenceIndex;
|
||||
prach_config->num_prach_fd_occasions_list[fd_occasion].k1.value = msg1_frequencystart;
|
||||
prach_config->restricted_set_config.value = restrictedSetConfig;
|
||||
prach_config->prach_sequence_length.value = prach_sequence_length;
|
||||
prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value = num_root_sequences;
|
||||
prach_pdu->num_cs = get_NCS(NCS_config, format0, restrictedSetConfig);
|
||||
prach_pdu->prach_format = prach_format;
|
||||
|
||||
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
|
||||
RC.nb_nr_L1_inst=1;
|
||||
phy_init_nr_gNB(gNB,0,0);
|
||||
nr_phy_init_RU(ru);
|
||||
set_tdd_config_nr(&gNB->gNB_config, 5000,
|
||||
7, 6,
|
||||
2, 4);
|
||||
gNB->common_vars.rxdata = ru->common.rxdata;
|
||||
set_tdd_config_nr(&gNB->gNB_config, mu, 7, 6, 2, 4);
|
||||
|
||||
//configure UE
|
||||
// Configure UE
|
||||
UE = malloc(sizeof(PHY_VARS_NR_UE));
|
||||
memset((void*)UE,0,sizeof(PHY_VARS_NR_UE));
|
||||
PHY_vars_UE_g = malloc(2*sizeof(PHY_VARS_NR_UE**));
|
||||
PHY_vars_UE_g[0] = malloc(2*sizeof(PHY_VARS_NR_UE*));
|
||||
PHY_vars_UE_g[0][0] = UE;
|
||||
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
|
||||
if (init_nr_ue_signal(UE, 1, 0) != 0)
|
||||
{
|
||||
UE->nrUE_config.prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t));
|
||||
|
||||
if (init_nr_ue_signal(UE, 1, 0) != 0){
|
||||
printf("Error at UE NR initialisation\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
txdata = UE->common_vars.txdata;
|
||||
printf("txdata %p\n",&txdata[0][subframe*frame_parms->samples_per_subframe]);
|
||||
ue_prach_pdu = &UE->prach_vars[0]->prach_pdu;
|
||||
ue_prach_config = &UE->nrUE_config.prach_config;
|
||||
UE->prach_resources[0] = &prach_resources;
|
||||
txdata = UE->common_vars.txdata;
|
||||
|
||||
double fs,bw;
|
||||
UE->prach_vars[0]->amp = AMP;
|
||||
ue_prach_pdu->root_seq_id = rootSequenceIndex;
|
||||
ue_prach_pdu->num_cs = get_NCS(NCS_config, format0, restrictedSetConfig);
|
||||
ue_prach_pdu->restricted_set = restrictedSetConfig;
|
||||
ue_prach_pdu->freq_msg1 = msg1_frequencystart;
|
||||
ue_prach_pdu->prach_format = prach_format;
|
||||
|
||||
ue_prach_config->prach_sub_c_spacing = mu;
|
||||
ue_prach_config->prach_sequence_length = prach_sequence_length;
|
||||
ue_prach_config->restricted_set_config = restrictedSetConfig;
|
||||
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences = num_root_sequences;
|
||||
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index = rootSequenceIndex;
|
||||
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].k1 = msg1_frequencystart;
|
||||
|
||||
if (preamble_tx == 99)
|
||||
preamble_tx = (uint16_t)(taus()&0x3f);
|
||||
|
||||
if (n_frames == 1)
|
||||
printf("raPreamble %d\n",preamble_tx);
|
||||
|
||||
UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
|
||||
|
||||
// Configure channel
|
||||
bw = N_RB_UL*(180e3)*(1 << frame_parms->numerology_index);
|
||||
AssertFatal(bw<=122.88e6,"Illegal channel bandwidth %f (mu %d,N_RB_UL %d)\n", bw, frame_parms->numerology_index, N_RB_UL);
|
||||
|
||||
if (bw <= 30.72e6)
|
||||
fs = 30.72e6;
|
||||
else if (bw <= 61.44e6)
|
||||
fs = 61.44e6;
|
||||
else if (bw <= 122.88e6)
|
||||
fs = 122.88e6;
|
||||
|
||||
bw = N_RB_UL*(180e3)*(1<<gNB->frame_parms.numerology_index);
|
||||
AssertFatal(bw<=122.88e6,"Illegal channel bandwidth %f (mu %d,N_RB_UL %d)\n",gNB->frame_parms.numerology_index,N_RB_UL);
|
||||
if (bw <= 30.72e6) fs = 30.72e6;
|
||||
else if (bw <= 61.44e6) fs = 61.44e6;
|
||||
else if (bw <= 122.88e6) fs = 122.88e6;
|
||||
LOG_I(PHY,"Running with bandwidth %f Hz, fs %f samp/s, FRAME_LENGTH_COMPLEX_SAMPLES %d\n",bw,fs,FRAME_LENGTH_COMPLEX_SAMPLES);
|
||||
|
||||
|
||||
UE2gNB = new_channel_desc_scm(UE->frame_parms.nb_antennas_tx,
|
||||
gNB->frame_parms.nb_antennas_rx,
|
||||
channel_model,
|
||||
fs,
|
||||
bw,
|
||||
fs,
|
||||
bw,
|
||||
0.0,
|
||||
delay,
|
||||
0);
|
||||
@@ -468,97 +542,82 @@ int main(int argc, char **argv)
|
||||
bzero(r_im[i],FRAME_LENGTH_COMPLEX_SAMPLES*sizeof(double));
|
||||
}
|
||||
|
||||
UE->frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=98;
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.restrictedSetConfig=0;
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.msg1_frequencystart=0;
|
||||
// compute PRACH sequence
|
||||
compute_nr_prach_seq(prach_config->prach_sequence_length.value,
|
||||
prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences.value,
|
||||
prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index.value,
|
||||
gNB->X_u);
|
||||
|
||||
|
||||
gNB->frame_parms.prach_config_common.rootSequenceIndex=rootSequenceIndex;
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex=98;
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=NCS_config;
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag=hs_flag;
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.restrictedSetConfig=0;
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.msg1_frequencystart=0;
|
||||
|
||||
gNB->proc.slot_rx = subframe<<1;
|
||||
|
||||
gNB->common_vars.rxdata = ru->common.rxdata;
|
||||
|
||||
|
||||
compute_nr_prach_seq(gNB->frame_parms.prach_config_common.rootSequenceIndex,
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
gNB->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
gNB->frame_parms.frame_type,
|
||||
gNB->frame_parms.freq_range,
|
||||
gNB->X_u);
|
||||
|
||||
compute_nr_prach_seq(UE->frame_parms.prach_config_common.rootSequenceIndex,
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,
|
||||
UE->frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,
|
||||
UE->frame_parms.frame_type,
|
||||
UE->frame_parms.freq_range,
|
||||
UE->X_u);
|
||||
|
||||
|
||||
|
||||
UE->prach_vars[0]->amp = AMP;
|
||||
|
||||
UE->prach_resources[0] = &prach_resources;
|
||||
|
||||
if (preamble_tx == 99)
|
||||
preamble_tx = (uint16_t)(taus()&0x3f);
|
||||
|
||||
if (n_frames == 1)
|
||||
printf("raPreamble %d\n",preamble_tx);
|
||||
|
||||
UE->prach_resources[0]->ra_PreambleIndex = preamble_tx;
|
||||
UE->prach_resources[0]->ra_TDD_map_index = 0;
|
||||
compute_nr_prach_seq(ue_prach_config->prach_sequence_length,
|
||||
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].num_root_sequences,
|
||||
ue_prach_config->num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index,
|
||||
UE->X_u);
|
||||
|
||||
/*tx_lev = generate_nr_prach(UE,
|
||||
0, //gNB_id,
|
||||
subframe,
|
||||
0); //Nf */ //commented for testing purpose
|
||||
subframe); */ //commented for testing purpose
|
||||
|
||||
UE_nr_rxtx_proc_t proc={0};
|
||||
nr_ue_prach_procedures(UE,&proc,0,0,0);
|
||||
|
||||
proc.frame_tx = frame;
|
||||
proc.nr_tti_tx = subframe;
|
||||
nr_ue_prach_procedures(UE,&proc,0,0);
|
||||
|
||||
/* tx_lev_dB not used later, no need to set */
|
||||
//tx_lev_dB = (unsigned int) dB_fixed(tx_lev);
|
||||
|
||||
LOG_M("txsig0.m","txs0", &txdata[0][subframe*frame_parms->samples_per_subframe],frame_parms->samples_per_subframe,1,1);
|
||||
//LOG_M("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
if (mu == 0)
|
||||
samp_count = frame_parms->samples_per_subframe;
|
||||
else
|
||||
samp_count = (subframe%(frame_parms->slots_per_subframe/2)) ? frame_parms->samples_per_slotN0 : frame_parms->samples_per_slot0;
|
||||
|
||||
prach_start = subframe*samp_count - UE->N_TA_offset;
|
||||
|
||||
#ifdef NR_PRACH_DEBUG
|
||||
LOG_M("txsig0.m", "txs0", &txdata[0][prach_start], samp_count, 1, 1);
|
||||
//LOG_M("txsig1.m","txs1", txdata[1],FRAME_LENGTH_COMPLEX_SAMPLES,1,1);
|
||||
#endif
|
||||
|
||||
// multipath channel
|
||||
dump_nr_prach_config(&gNB->frame_parms,subframe);
|
||||
// dump_nr_prach_config(&gNB->frame_parms,subframe);
|
||||
|
||||
for (i=0; i<2*frame_parms->samples_per_subframe; i++) {
|
||||
for (i = 0; i < samp_count<<1; i++) {
|
||||
for (aa=0; aa<1; aa++) {
|
||||
if (awgn_flag == 0) {
|
||||
s_re[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_subframe]))[(i<<1)]);
|
||||
s_im[aa][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_subframe]))[(i<<1)+1]);
|
||||
s_re[aa][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)]);
|
||||
s_im[aa][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)+1]);
|
||||
} else {
|
||||
for (aarx=0; aarx<gNB->frame_parms.nb_antennas_rx; aarx++) {
|
||||
if (aa==0) {
|
||||
r_re[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_subframe]))[(i<<1)]);
|
||||
r_im[aarx][i] = ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_subframe]))[(i<<1)+1]);
|
||||
r_re[aarx][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)]);
|
||||
r_im[aarx][i] = ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)+1]);
|
||||
} else {
|
||||
r_re[aarx][i] += ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_subframe]))[(i<<1)]);
|
||||
r_im[aarx][i] += ((double)(((short *)&txdata[aa][subframe*frame_parms->samples_per_subframe]))[(i<<1)+1]);
|
||||
r_re[aarx][i] += ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)]);
|
||||
r_im[aarx][i] += ((double)(((short *)&txdata[aa][prach_start]))[(i<<1)+1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (snr1set == 0) {
|
||||
if (n_frames == 1)
|
||||
snr1 = snr0 + .1;
|
||||
else
|
||||
snr1 = snr0 + 5.0;
|
||||
}
|
||||
|
||||
printf("SNR0 %f, SNR1 %f\n", snr0, snr1);
|
||||
|
||||
for (SNR=snr0; SNR<snr1; SNR+=.2) {
|
||||
if (ue_speed1set == 0) {
|
||||
if (n_frames == 1)
|
||||
ue_speed1 = ue_speed0 + 10;
|
||||
else
|
||||
ue_speed1 = ue_speed0 + 50;
|
||||
}
|
||||
|
||||
rx_prach_start = subframe*frame_parms->get_samples_per_slot(subframe,frame_parms);
|
||||
|
||||
for (SNR=snr0; SNR<snr1; SNR+=.1) {
|
||||
for (ue_speed=ue_speed0; ue_speed<ue_speed1; ue_speed+=10) {
|
||||
delay_avg = 0.0;
|
||||
// max Doppler shift
|
||||
@@ -568,6 +627,8 @@ int main(int argc, char **argv)
|
||||
|
||||
for (trial=0; trial<n_frames; trial++) {
|
||||
|
||||
uint16_t preamble_rx, preamble_energy, N_ZC;
|
||||
|
||||
sigma2_dB = 10*log10((double)tx_lev) - SNR;
|
||||
|
||||
if (n_frames==1)
|
||||
@@ -577,10 +638,8 @@ int main(int argc, char **argv)
|
||||
sigma2 = pow(10,sigma2_dB/10);
|
||||
// printf("Sigma2 %f (sigma2_dB %f)\n",sigma2,sigma2_dB);
|
||||
|
||||
|
||||
if (awgn_flag == 0) {
|
||||
multipath_tv_channel(UE2gNB,s_re,s_im,r_re,r_im,
|
||||
2*frame_parms->samples_per_subframe,0);
|
||||
multipath_tv_channel(UE2gNB, s_re, s_im, r_re, r_im, frame_parms->samples_per_tti<<1, 0);
|
||||
}
|
||||
|
||||
if (n_frames==1) {
|
||||
@@ -589,55 +648,51 @@ int main(int argc, char **argv)
|
||||
10*log10(tx_lev));
|
||||
}
|
||||
|
||||
for (i=0; i<frame_parms->samples_per_subframe; i++) {
|
||||
for (aa=0; aa<gNB->frame_parms.nb_antennas_rx; aa++) {
|
||||
|
||||
((short*) &gNB->common_vars.rxdata[aa][subframe*(frame_parms->samples_per_subframe)])[2*i] = (short) (.167*(r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
((short*) &gNB->common_vars.rxdata[aa][subframe*(frame_parms->samples_per_subframe)])[2*i+1] = (short) (.167*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
for (i = 0; i< frame_parms->get_samples_per_slot(subframe,frame_parms); i++) {
|
||||
for (aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
|
||||
((short*) &gNB->common_vars.rxdata[aa][rx_prach_start])[2*i] = (short) (.167*(r_re[aa][i] +sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
((short*) &gNB->common_vars.rxdata[aa][rx_prach_start])[2*i+1] = (short) (.167*(r_im[aa][i] + (iqim*r_re[aa][i]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0)));
|
||||
}
|
||||
}
|
||||
uint16_t preamble_rx;
|
||||
rx_nr_prach_ru(ru,
|
||||
0,
|
||||
subframe);
|
||||
gNB->prach_vars.rxsigF = ru->prach_rxsigF;
|
||||
|
||||
rx_nr_prach(gNB,
|
||||
0,
|
||||
subframe,
|
||||
&preamble_rx,
|
||||
preamble_energy_list,
|
||||
preamble_delay_list);
|
||||
|
||||
if (preamble_rx!=preamble_tx)
|
||||
rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, frame, subframe);
|
||||
|
||||
gNB->prach_vars.rxsigF = ru->prach_rxsigF;
|
||||
|
||||
rx_nr_prach(gNB, prach_pdu, frame, subframe, &preamble_rx, &preamble_energy, &preamble_delay);
|
||||
|
||||
printf(" preamble_energy %d preamble_rx %d preamble_tx %d \n", preamble_energy, preamble_rx, preamble_tx);
|
||||
|
||||
if (preamble_rx != preamble_tx)
|
||||
prach_errors++;
|
||||
else {
|
||||
delay_avg += (double)preamble_delay_list[preamble_tx];
|
||||
}
|
||||
else
|
||||
delay_avg += (double)preamble_delay;
|
||||
|
||||
N_ZC = (prach_sequence_length) ? 139 : 839;
|
||||
|
||||
if (n_frames==1) {
|
||||
printf("preamble %d (tx %d) : energy %d, delay %d\n",preamble_rx,preamble_tx,preamble_energy_list[0],preamble_delay_list[0]);
|
||||
|
||||
|
||||
LOG_M("prach0.m","prach0", &txdata[0][subframe*frame_parms->samples_per_subframe],frame_parms->samples_per_subframe,1,1);
|
||||
LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0],24576,1,1);
|
||||
LOG_M("rxsig0.m","rxs0",
|
||||
&gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe],
|
||||
frame_parms->samples_per_subframe,1,1);
|
||||
LOG_M("rxsigF0.m","rxsF0", gNB->prach_vars.rxsigF[0],839*4,1,1);
|
||||
LOG_M("prach_preamble.m","prachp",&gNB->X_u[0],839,1,1);
|
||||
printf("preamble %d (tx %d) : energy %d, delay %d\n",preamble_rx,preamble_tx,preamble_energy,preamble_delay);
|
||||
#ifdef NR_PRACH_DEBUG
|
||||
LOG_M("prach0.m","prach0", &txdata[0][prach_start], samp_count, 1, 1);
|
||||
LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1);
|
||||
LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][rx_prach_start], frame_parms->samples_per_subframe, 1, 1);
|
||||
//LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][rx_prach_start], frame_parms->samples_per_subframe, 1, 1);
|
||||
LOG_M("rxsigF0.m","rxsF0", gNB->prach_vars.rxsigF[0], N_ZC, 1, 1);
|
||||
LOG_M("prach_preamble.m","prachp", &gNB->X_u[0], N_ZC, 1, 1);
|
||||
LOG_M("ue_prach_preamble.m","prachp", &UE->X_u[0], N_ZC, 1, 1);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n",SNR,ue_speed,prach_errors,n_frames,delay_avg/(double)(n_frames-prach_errors));
|
||||
//printf("(%f,%f)\n",ue_speed,(double)prach_errors/(double)n_frames);
|
||||
printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n", SNR, ue_speed, prach_errors, n_frames, delay_avg/(double)(n_frames-prach_errors));
|
||||
if (prach_errors)
|
||||
break;
|
||||
} // UE Speed loop
|
||||
|
||||
//printf("SNR %f dB, UE Speed %f km/h: errors %d/%d (delay %f)\n",SNR,ue_speed,prach_errors,n_frames,delay_avg/(double)(n_frames-prach_errors));
|
||||
// printf("(%f,%f)\n",SNR,(double)prach_errors/(double)n_frames);
|
||||
if (!prach_errors) {
|
||||
printf("PRACH test OK\n");
|
||||
break;
|
||||
}
|
||||
} //SNR loop
|
||||
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
free(s_re[i]);
|
||||
free(s_im[i]);
|
||||
@@ -650,17 +705,5 @@ int main(int argc, char **argv)
|
||||
free(r_re);
|
||||
free(r_im);
|
||||
|
||||
|
||||
return(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
for (i=1;i<4;i++)
|
||||
memcpy((void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i*12*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*2],
|
||||
(void *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[0],
|
||||
12*OFDM_SYMBOL_SIZE_SAMPLES_NO_PREFIX*2);
|
||||
*/
|
||||
|
||||
|
||||
@@ -391,7 +391,7 @@ int main(int argc, char **argv)
|
||||
mod_order = nr_get_Qm_ul(Imcs, 0);
|
||||
code_rate = nr_get_code_rate_ul(Imcs, 0);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order,code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, Nl);
|
||||
TBS = nr_compute_tbs(mod_order,code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, Nl);
|
||||
|
||||
printf("\nAvailable bits %u TBS %u mod_order %d\n", available_bits, TBS, mod_order);
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "PHY/TOOLS/tools_defs.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
#include "SCHED_NR_UE/fapi_nr_ue_l1.h"
|
||||
@@ -53,9 +54,11 @@
|
||||
#include "openair1/SIMULATION/RF/rf.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
#include "openair2/RRC/NR/MESSAGES/asn1_msg.h"
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
|
||||
//#define DEBUG_ULSIM
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
@@ -350,7 +353,8 @@ int main(int argc, char **argv)
|
||||
T_stdout = 1;
|
||||
|
||||
get_softmodem_params()->phy_test = 1;
|
||||
|
||||
get_softmodem_params()->do_ra = 0;
|
||||
|
||||
if (snr1set == 0)
|
||||
snr1 = snr0 + 10;
|
||||
|
||||
@@ -479,7 +483,11 @@ int main(int argc, char **argv)
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch_gNB = gNB->ulsch[UE_id][0];
|
||||
//nfapi_nr_ul_config_ulsch_pdu *rel15_ul = &ulsch_gNB->harq_processes[harq_pid]->ulsch_pdu;
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = &gNB->UL_tti_req;
|
||||
nfapi_nr_ul_tti_request_t *UL_tti_req = malloc(sizeof(*UL_tti_req));
|
||||
NR_Sched_Rsp_t *Sched_INFO = malloc(sizeof(*Sched_INFO));
|
||||
memset((void*)Sched_INFO,0,sizeof(*Sched_INFO));
|
||||
Sched_INFO->UL_tti_req=UL_tti_req;
|
||||
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &UL_tti_req->pdus_list[0].pusch_pdu;
|
||||
|
||||
NR_UE_ULSCH_t **ulsch_ue = UE->ulsch[0][0];
|
||||
@@ -496,29 +504,20 @@ int main(int argc, char **argv)
|
||||
fapi_nr_ul_config_request_t ul_config;
|
||||
|
||||
unsigned int TBS;
|
||||
uint16_t number_dmrs_symbols = 0;
|
||||
uint16_t number_dmrs_symbols = 1;
|
||||
unsigned int available_bits;
|
||||
uint8_t nb_re_dmrs;
|
||||
uint8_t length_dmrs = UE->pusch_config.dmrs_UplinkConfig.pusch_maxLength;
|
||||
|
||||
uint8_t nb_re_dmrs=12; // no PUSCH REs
|
||||
uint8_t length_dmrs = 1;
|
||||
unsigned char mod_order;
|
||||
uint16_t code_rate;
|
||||
|
||||
for (i = start_symbol; i < nb_symb_sch; i++)
|
||||
number_dmrs_symbols += is_dmrs_symbol(i,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
nb_symb_sch,
|
||||
UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type,
|
||||
frame_parms->ofdm_symbol_size);
|
||||
|
||||
mod_order = nr_get_Qm_ul(Imcs, 0);
|
||||
nb_re_dmrs = ((UE->pusch_config.dmrs_UplinkConfig.pusch_dmrs_type == pusch_dmrs_type1) ? 6 : 4) * number_dmrs_symbols;
|
||||
|
||||
code_rate = nr_get_code_rate_ul(Imcs, 0);
|
||||
available_bits = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, mod_order, 1);
|
||||
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, precod_nbr_layers);
|
||||
TBS = nr_compute_tbs(mod_order, code_rate, nb_rb, nb_symb_sch, nb_re_dmrs*length_dmrs, 0, 0, precod_nbr_layers);
|
||||
|
||||
printf("\n");
|
||||
|
||||
@@ -578,6 +577,8 @@ int main(int argc, char **argv)
|
||||
pusch_pdu->pusch_data.tb_size = TBS>>3;
|
||||
pusch_pdu->pusch_data.num_cb = 0;
|
||||
|
||||
// prepare ULSCH/PUSCH reception
|
||||
nr_schedule_response(Sched_INFO);
|
||||
|
||||
// --------- setting parameters for UE --------
|
||||
|
||||
@@ -620,10 +621,10 @@ int main(int argc, char **argv)
|
||||
////////////////////////////////////////////////////
|
||||
tx_offset = frame_parms->get_samples_slot_timestamp(slot,frame_parms,0);
|
||||
|
||||
txlev = signal_energy_amp_shift(&UE->common_vars.txdata[0][tx_offset + 5*frame_parms->ofdm_symbol_size + 4*frame_parms->nb_prefix_samples + frame_parms->nb_prefix_samples0],
|
||||
txlev = signal_energy(&UE->common_vars.txdata[0][tx_offset + 5*frame_parms->ofdm_symbol_size + 4*frame_parms->nb_prefix_samples + frame_parms->nb_prefix_samples0],
|
||||
frame_parms->ofdm_symbol_size + frame_parms->nb_prefix_samples);
|
||||
|
||||
txlev_float = (double)txlev/(double)AMP; // output of signal_energy is fixed point representation
|
||||
txlev_float = (double)txlev; // output of signal_energy is fixed point representation
|
||||
|
||||
n_errors = 0;
|
||||
n_false_positive = 0;
|
||||
@@ -642,8 +643,8 @@ int main(int argc, char **argv)
|
||||
//----------------------------------------------------------
|
||||
for (i=0; i<frame_length_complex_samples; i++) {
|
||||
for (ap=0; ap<frame_parms->nb_antennas_rx; ap++) {
|
||||
((short*) gNB->common_vars.rxdata[ap])[(2*i) + (delay*2)] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)*(double)AMP); // convert to fixed point
|
||||
((short*) gNB->common_vars.rxdata[ap])[2*i+1 + (delay*2)] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)+1]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)*(double)AMP);
|
||||
((short*) gNB->common_vars.rxdata[ap])[(2*i) + (delay*2)] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0)); // convert to fixed point
|
||||
((short*) gNB->common_vars.rxdata[ap])[2*i+1 + (delay*2)] = (((int16_t *)UE->common_vars.txdata[ap])[(i<<1)+1]) + (int16_t)(sqrt(sigma/2)*gaussdouble(0.0,1.0));
|
||||
}
|
||||
}
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -27,18 +27,20 @@
|
||||
#include "SIMULATION/RF/rf.h"
|
||||
#include <complex.h>
|
||||
|
||||
void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length);
|
||||
void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length);
|
||||
double frand_a_b(double a, double b);
|
||||
void tv_conv(double complex **h, double complex *x, double complex *y, uint16_t nb_samples, uint8_t nb_taps, int delay);
|
||||
void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t nb_samples, uint8_t nb_taps, int delay);
|
||||
|
||||
void multipath_tv_channel(channel_desc_t *desc,
|
||||
double **tx_sig_re,
|
||||
double **tx_sig_im,
|
||||
double **rx_sig_re,
|
||||
double **rx_sig_im,
|
||||
uint16_t length,
|
||||
uint8_t keep_channel) {
|
||||
double complex **tx,**rx,* **H_t,*rx_temp; //, *tv_H_t;
|
||||
uint32_t length,
|
||||
uint8_t keep_channel)
|
||||
{
|
||||
|
||||
double complex **tx,**rx,***H_t,*rx_temp;//, *tv_H_t;
|
||||
double path_loss = pow(10,desc->path_loss_dB/20);
|
||||
int i,j,k,dd;
|
||||
dd = abs(desc->channel_offset);
|
||||
@@ -126,7 +128,8 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
}
|
||||
|
||||
//TODO: make phi_rad a parameter of this function
|
||||
void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length) {
|
||||
void tv_channel(channel_desc_t *desc,double complex ***H,uint32_t length){
|
||||
|
||||
int i,j,p,l,k;
|
||||
double *alpha,*phi_rad,pi=acos(-1),*w_Hz;
|
||||
alpha = (double *)calloc(desc->nb_paths,sizeof(double));
|
||||
@@ -193,7 +196,8 @@ void tv_channel(channel_desc_t *desc,double complex ***H,uint16_t length) {
|
||||
}
|
||||
|
||||
// time varying convolution
|
||||
void tv_conv(double complex **h, double complex *x, double complex *y, uint16_t nb_samples, uint8_t nb_taps, int dd) {
|
||||
void tv_conv(double complex **h, double complex *x, double complex *y, uint32_t nb_samples, uint8_t nb_taps, int dd){
|
||||
|
||||
int i,j;
|
||||
|
||||
for(i=0; i<((int)nb_samples-dd); i++) {
|
||||
|
||||
@@ -426,7 +426,7 @@ void multipath_tv_channel(channel_desc_t *desc,
|
||||
double **tx_sig_im,
|
||||
double **rx_sig_re,
|
||||
double **rx_sig_im,
|
||||
uint16_t length,
|
||||
uint32_t length,
|
||||
uint8_t keep_channel);
|
||||
|
||||
/**@} */
|
||||
|
||||
@@ -66,6 +66,7 @@ MESSAGE_DEF(S1AP_E_RAB_MODIFY_RESP , MESSAGE_PRIORITY_MED, s1ap_e_rab_m
|
||||
MESSAGE_DEF(S1AP_E_RAB_RELEASE_RESPONSE , MESSAGE_PRIORITY_MED, s1ap_e_rab_release_resp_t , s1ap_e_rab_release_resp)
|
||||
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_t , s1ap_path_switch_req)
|
||||
MESSAGE_DEF(S1AP_PATH_SWITCH_REQ_ACK , MESSAGE_PRIORITY_MED, s1ap_path_switch_req_ack_t , s1ap_path_switch_req_ack)
|
||||
MESSAGE_DEF(S1AP_E_RAB_MODIFICATION_IND , MESSAGE_PRIORITY_MED, s1ap_e_rab_modification_ind_t , s1ap_e_rab_modification_ind)
|
||||
|
||||
/* S1AP -> RRC messages */
|
||||
MESSAGE_DEF(S1AP_DOWNLINK_NAS , MESSAGE_PRIORITY_MED, s1ap_downlink_nas_t , s1ap_downlink_nas )
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#define S1AP_E_RAB_MODIFY_RESP(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modify_resp
|
||||
#define S1AP_PATH_SWITCH_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req
|
||||
#define S1AP_PATH_SWITCH_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.s1ap_path_switch_req_ack
|
||||
#define S1AP_E_RAB_MODIFICATION_IND(mSGpTR) (mSGpTR)->ittiMsg.s1ap_e_rab_modification_ind
|
||||
|
||||
#define S1AP_DOWNLINK_NAS(mSGpTR) (mSGpTR)->ittiMsg.s1ap_downlink_nas
|
||||
#define S1AP_INITIAL_CONTEXT_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.s1ap_initial_context_setup_req
|
||||
@@ -281,12 +282,26 @@ typedef struct e_rab_tobe_added_s {
|
||||
uint8_t drb_ID;
|
||||
|
||||
/* The transport layer address for the IP packets */
|
||||
transport_layer_addr_t eNB_addr;
|
||||
transport_layer_addr_t sgw_addr;
|
||||
|
||||
/* S-GW Tunnel endpoint identifier */
|
||||
uint32_t gtp_teid;
|
||||
} e_rab_tobe_added_t;
|
||||
|
||||
typedef struct e_rab_admitted_tobe_added_s {
|
||||
/* Unique e_rab_id for the UE. */
|
||||
uint8_t e_rab_id;
|
||||
|
||||
/* Unique drb_ID for the UE. */
|
||||
uint8_t drb_ID;
|
||||
|
||||
/* The transport layer address for the IP packets */
|
||||
transport_layer_addr_t gnb_addr;
|
||||
|
||||
/* S-GW Tunnel endpoint identifier */
|
||||
uint32_t gtp_teid;
|
||||
} e_rab_admitted_tobe_added_t;
|
||||
|
||||
|
||||
|
||||
typedef struct e_rab_tobeswitched_s {
|
||||
@@ -646,6 +661,27 @@ typedef struct s1ap_path_switch_req_ack_s {
|
||||
|
||||
} s1ap_path_switch_req_ack_t;
|
||||
|
||||
typedef struct s1ap_e_rab_modification_ind_s {
|
||||
|
||||
unsigned eNB_ue_s1ap_id:24;
|
||||
|
||||
/* MME UE id */
|
||||
uint32_t mme_ue_s1ap_id;
|
||||
|
||||
/* Number of e_rab setup-ed in the list */
|
||||
uint8_t nb_of_e_rabs_tobemodified;
|
||||
|
||||
uint8_t nb_of_e_rabs_nottobemodified;
|
||||
|
||||
/* list of e_rab setup-ed by RRC layers */
|
||||
e_rab_setup_t e_rabs_tobemodified[S1AP_MAX_E_RAB];
|
||||
|
||||
e_rab_setup_t e_rabs_nottobemodified[S1AP_MAX_E_RAB];
|
||||
|
||||
uint16_t ue_initial_id;
|
||||
|
||||
} s1ap_e_rab_modification_ind_t;
|
||||
|
||||
// S1AP --> RRC messages
|
||||
typedef struct s1ap_ue_release_command_s {
|
||||
|
||||
|
||||
@@ -363,7 +363,7 @@ typedef struct x2ap_ENDC_sgnb_addition_req_ACK_s {
|
||||
uint8_t nb_e_rabs_admitted_tobeadded;
|
||||
|
||||
/* list of e_rab to be added by RRC layers */
|
||||
e_rab_tobe_added_t e_rabs_admitted_tobeadded[S1AP_MAX_E_RAB];
|
||||
e_rab_admitted_tobe_added_t e_rabs_admitted_tobeadded[S1AP_MAX_E_RAB];
|
||||
|
||||
/* list of e_rab to be setup by RRC layers */
|
||||
e_rab_t e_rab_param[S1AP_MAX_E_RAB];
|
||||
|
||||
@@ -133,7 +133,8 @@
|
||||
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR "prach_RootSequenceIndex_PR"
|
||||
#define GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX "prach_RootSequenceIndex"
|
||||
#define GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING "msg1_SubcarrierSpacing"
|
||||
#define GNB_CONFIG_STRING_RESTRICTEDSETCONFIG "restrictedSetConfig"
|
||||
#define GNB_CONFIG_STRING_RESTRICTEDSETCONFIG "restrictedSetConfig"
|
||||
#define GNB_CONFIG_STRING_MSG3TRANSFPREC "msg3_transformPrecoder"
|
||||
#define GNB_CONFIG_STRING_PUSCHTIMEDOMAINALLOCATIONLIST "puschTimeDomainAllocationList"
|
||||
#define GNB_CONFIG_STRING_MSG3DELTAPREABMLE "msg3_DeltaPreamble"
|
||||
#define GNB_CONFIG_STRING_P0NOMINALWITHGRANT "p0_NominalWithGrant"
|
||||
@@ -246,7 +247,7 @@
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:-1,TYPE_INT64,0/*17*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_1,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->k0,defint64val:-1,TYPE_INT64,0/*18*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*19*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*20*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPK0_2,NULL,0,i64ptr:scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->k0,defint64val:-1,TYPE_INT64,0/*21*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPMAPPINGTYPE_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeA,TYPE_INT64,0/*22*/},\
|
||||
{GNB_CONFIG_STRING_INITIALDLBWPSTARTSYMBOLANDLENGTH_2,NULL,0,i64ptr:&scc->downlinkConfigCommon->initialDownlinkBWP->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[2]->startSymbolAndLength,defint64val:54,TYPE_INT64,0/*23*/},\
|
||||
@@ -311,11 +312,12 @@
|
||||
{GNB_CONFIG_STRING_RSRPTHRESHOLDSSB,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rsrp_ThresholdSSB,defint64val:19,TYPE_INT64,0/*82*/},\
|
||||
{GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEXPR,NULL,0,uptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present,defuintval:NR_RACH_ConfigCommon__prach_RootSequenceIndex_PR_l139,TYPE_UINT,0/*83*/},\
|
||||
{GNB_CONFIG_STRING_PRACHROOTSEQUENCEINDEX,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139,defint64val:0,TYPE_INT64,0/*84*/},\
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*86*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*87*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*88*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*89*/}, \
|
||||
{GNB_CONFIG_STRING_RESTRICTEDSETCONFIG,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig,defintval:NR_RACH_ConfigCommon__restrictedSetConfig_unrestrictedSet,TYPE_INT64,0/*85*/}, \
|
||||
{GNB_CONFIG_STRING_MSG3TRANSFPREC,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder,defintval:1,TYPE_INT64,0/*86*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_0,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->k2,defint64val:-1,TYPE_INT64,0/*87*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,/*88*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_0,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[0]->startSymbolAndLength,defint64val:55,TYPE_INT64,0/*89*/},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_1,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->k2,defint64val:-1,TYPE_INT64,0/*90*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_1,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[1]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_2,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[2]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
@@ -325,7 +327,7 @@
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_3,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[3]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_4,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*99*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*100*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_4,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[4]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_5,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_5,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[5]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
@@ -335,7 +337,7 @@
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_6,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[6]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_7,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*109*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_7,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[7]->startSymbolAndLength,defint64val:53,TYPE_INT64,0/*110*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_8,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_8,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[8]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
@@ -345,7 +347,7 @@
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_10,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_10,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[10]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*119*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_11,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->k2,defint64val:-1,TYPE_INT64,0/*120*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_11,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[11]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_12,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[12]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
@@ -355,7 +357,7 @@
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_13,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[13]->startSymbolAndLength,defint64val:53,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_14,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*129*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->mappingType,defint64val:NR_PDSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0 /*130*/}, \
|
||||
{GNB_CONFIG_STRING_INITIALULBWPSTARTSYMBOLANDLENGTH_14,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[14]->startSymbolAndLength,defint64val:55,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPK2_15,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->k2,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_INITIALULBWPMAPPINGTYPE_15,NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList->list.array[15]->mappingType,defint64val:NR_PUSCH_TimeDomainResourceAllocation__mappingType_typeB,TYPE_INT64,0},\
|
||||
@@ -365,7 +367,7 @@
|
||||
{GNB_CONFIG_STRING_PUCCHGROUPHOPPING, NULL,0,i64ptr:&scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->pucch_GroupHopping,defint64val:NR_PUCCH_ConfigCommon__pucch_GroupHopping_neither,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_HOPPINGID, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->hoppingId,defint64val:40,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_P0NOMINAL, NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->pucch_ConfigCommon->choice.setup->p0_nominal,defint64val:1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR,NULL,0,uptr:&scc->ssb_PositionsInBurst->present,defuintval:NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap,TYPE_UINT,0/*139*/}, \
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURSTPR,NULL,0,uptr:&scc->ssb_PositionsInBurst->present,defuintval:NR_ServingCellConfigCommon__ssb_PositionsInBurst_PR_mediumBitmap,TYPE_UINT,0/*140*/}, \
|
||||
{GNB_CONFIG_STRING_SSBPOSITIONSINBURST,NULL,0,u64ptr:&ssb_bitmap,defintval:0xff,TYPE_UINT64,0}, \
|
||||
{GNB_CONFIG_STRING_REFERENCESUBCARRIERSPACING,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->referenceSubcarrierSpacing,defint64val:NR_SubcarrierSpacing_kHz30,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_DLULTRANSMISSIONPERIODICITY,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern1.dl_UL_TransmissionPeriodicity,defint64val:NR_TDD_UL_DL_Pattern__dl_UL_TransmissionPeriodicity_ms0p5,TYPE_INT64,0},\
|
||||
@@ -379,7 +381,7 @@
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSLOTS2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSlots,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_NROFUPLINKSYMBOLS2,NULL,0,i64ptr:&scc->tdd_UL_DL_ConfigurationCommon->pattern2->nrofUplinkSymbols,defint64val:-1,TYPE_INT64,0},\
|
||||
{GNB_CONFIG_STRING_SSPBCHBLOCKPOWER,NULL,0,i64ptr:&scc->ss_PBCH_BlockPower,defint64val:20,TYPE_INT64,0}, \
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing,defintval:-1,TYPE_INT64,0/*86*/}}
|
||||
{GNB_CONFIG_STRING_MSG1SUBCARRIERSPACING,NULL,0,i64ptr:scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing,defintval:-1,TYPE_INT64,0}}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ static void configure_nr_rrc(uint32_t gnb_id)
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
|
||||
static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//, const Enb_properties_array_t *enb_properties)
|
||||
{
|
||||
uint32_t gnb_id;
|
||||
@@ -83,18 +83,18 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
|
||||
s1ap_register_enb_req_t *s1ap_register_gNB; //Type Temporarily reuse
|
||||
|
||||
// note: there is an implicit relationship between the data structure and the message name
|
||||
msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_ENB_REQ); //Message Temporarily reuse
|
||||
/*msg_p = itti_alloc_new_message (TASK_GNB_APP, S1AP_REGISTER_ENB_REQ); //Message Temporarily reuse
|
||||
|
||||
RCconfig_NR_S1(msg_p, gnb_id);
|
||||
RCconfig_NR_S1(msg_p, gnb_id);*/
|
||||
|
||||
if (gnb_id == 0) RCconfig_nr_gtpu();
|
||||
|
||||
s1ap_register_gNB = &S1AP_REGISTER_ENB_REQ(msg_p); //Message Temporarily reuse
|
||||
LOG_I(GNB_APP,"default drx %d\n",s1ap_register_gNB->default_drx);
|
||||
/*s1ap_register_gNB = &S1AP_REGISTER_ENB_REQ(msg_p); //Message Temporarily reuse
|
||||
LOG_I(GNB_APP,"default drx %d\n",s1ap_register_gNB->default_drx);*/
|
||||
|
||||
LOG_I(GNB_APP,"[gNB %d] gNB_app_register for instance %d\n", gnb_id, GNB_MODULE_ID_TO_INSTANCE(gnb_id));
|
||||
|
||||
itti_send_msg_to_task (TASK_S1AP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
//itti_send_msg_to_task (TASK_S1AP, GNB_MODULE_ID_TO_INSTANCE(gnb_id), msg_p);
|
||||
|
||||
register_gnb_pending++;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ static uint32_t gNB_app_register(uint32_t gnb_id_start, uint32_t gnb_id_end)//,
|
||||
|
||||
return register_gnb_pending;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end) {
|
||||
@@ -132,6 +132,7 @@ void *gNB_app_task(void *args_p)
|
||||
uint32_t gnb_id_start = 0;
|
||||
uint32_t gnb_id_end = gnb_id_start + gnb_nb;
|
||||
uint32_t x2_register_gnb_pending = 0;
|
||||
uint32_t register_gnb_pending=0;
|
||||
uint32_t gnb_id;
|
||||
MessageDef *msg_p = NULL;
|
||||
const char *msg_name = NULL;
|
||||
@@ -176,7 +177,7 @@ void *gNB_app_task(void *args_p)
|
||||
if (EPC_MODE_ENABLED) {
|
||||
/* Try to register each gNB */
|
||||
//registered_gnb = 0;
|
||||
//register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
|
||||
register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);//, gnb_properties_p);
|
||||
} else {
|
||||
/* Start L2L1 task */
|
||||
msg_p = itti_alloc_new_message(TASK_GNB_APP, INITIALIZE_MESSAGE);
|
||||
|
||||
@@ -54,7 +54,8 @@
|
||||
#include "common/config/config_userapi.h"
|
||||
//#include "RRC_config_tools.h"
|
||||
#include "gnb_paramdef.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
#include "NR_asn_constant.h"
|
||||
#include "executables/thread-common.h"
|
||||
#include "NR_SCS-SpecificCarrier.h"
|
||||
@@ -254,6 +255,10 @@ void fix_scc(NR_ServingCellConfigCommon_t *scc,uint64_t ssbmap) {
|
||||
scc->uplinkConfigCommon->frequencyInfoUL->absoluteFrequencyPointA = NULL;
|
||||
}
|
||||
|
||||
// default value for msg3 precoder is NULL (0 means enabled)
|
||||
if (*scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder!=0)
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg3_transformPrecoder = NULL;
|
||||
|
||||
// fix libconfig (asn1c uses long)
|
||||
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.preambleReceivedTargetPower-=((long)1<<32);
|
||||
*scc->uplinkConfigCommon->initialUplinkBWP->pusch_ConfigCommon->choice.setup->p0_NominalWithGrant-=((long)1<<32);
|
||||
@@ -714,10 +719,14 @@ int RCconfig_nr_gtpu(void ) {
|
||||
if (address) {
|
||||
MessageDef *message;
|
||||
AssertFatal((message = itti_alloc_new_message(TASK_GNB_APP, GTPV1U_ENB_S1_REQ))!=NULL,"");
|
||||
IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
|
||||
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up);
|
||||
GTPV1U_ENB_S1_REQ(message).enb_port_for_S1u_S12_S4_up = gnb_port_for_S1U;
|
||||
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
// IPV4_STR_ADDR_TO_INT_NWBO ( address, RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
|
||||
// LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,RC.gtpv1u_data_g->enb_ip_address_for_S1u_S12_S4_up);
|
||||
|
||||
|
||||
IPV4_STR_ADDR_TO_INT_NWBO ( address, GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up, "BAD IP ADDRESS FORMAT FOR eNB S1_U !\n" );
|
||||
LOG_I(GTPU,"Configuring GTPu address : %s -> %x\n",address,GTPV1U_ENB_S1_REQ(message).enb_ip_address_for_S1u_S12_S4_up);
|
||||
GTPV1U_ENB_S1_REQ(message).enb_port_for_S1u_S12_S4_up = gnb_port_for_S1U;
|
||||
itti_send_msg_to_task (TASK_GTPV1_U, 0, message); // data model is wrong: gtpu doesn't have enb_id (or module_id)
|
||||
} else
|
||||
LOG_E(GTPU,"invalid address for S1U\n");
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "nfapi/oai_integration/vendor_ext.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
@@ -41,6 +41,10 @@
|
||||
|
||||
#define NR_BCCH_BCH 5 // MIB
|
||||
|
||||
#define CCCH_PAYLOAD_SIZE_MAX 128
|
||||
|
||||
#define RAR_PAYLOAD_SIZE_MAX 128
|
||||
|
||||
// For both DL/UL-SCH
|
||||
// Except:
|
||||
// - UL/DL-SCH: fixed-size MAC CE(known by LCID)
|
||||
@@ -86,12 +90,88 @@ typedef struct {
|
||||
uint8_t R:2; // octet 1 [7:6]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED;
|
||||
|
||||
// BSR MAC CEs
|
||||
// TS 38.321 ch. 6.1.3.1
|
||||
// Short BSR for a specific logical channel group ID
|
||||
typedef struct {
|
||||
uint8_t Buffer_size:5; // octet 1 LSB
|
||||
uint8_t LcgID:3; // octet 1 MSB
|
||||
} __attribute__ ((__packed__)) NR_BSR_SHORT;
|
||||
|
||||
typedef NR_BSR_SHORT NR_BSR_SHORT_TRUNCATED;
|
||||
|
||||
// Long BSR for all logical channel group ID
|
||||
typedef struct {
|
||||
uint8_t Buffer_size7:8;
|
||||
uint8_t Buffer_size6:8;
|
||||
uint8_t Buffer_size5:8;
|
||||
uint8_t Buffer_size4:8;
|
||||
uint8_t Buffer_size3:8;
|
||||
uint8_t Buffer_size2:8;
|
||||
uint8_t Buffer_size1:8;
|
||||
uint8_t Buffer_size0:8;
|
||||
uint8_t LcgID0:1;
|
||||
uint8_t LcgID1:1;
|
||||
uint8_t LcgID2:1;
|
||||
uint8_t LcgID3:1;
|
||||
uint8_t LcgID4:1;
|
||||
uint8_t LcgID5:1;
|
||||
uint8_t LcgID6:1;
|
||||
uint8_t LcgID7:1;
|
||||
} __attribute__ ((__packed__)) NR_BSR_LONG;
|
||||
|
||||
typedef NR_BSR_LONG NR_BSR_LONG_TRUNCATED;
|
||||
|
||||
// 38.321 ch. 6.1.3.4
|
||||
typedef struct {
|
||||
uint8_t TA_COMMAND:6; // octet 1 [5:0]
|
||||
uint8_t TAGID:2; // octet 1 [7:6]
|
||||
} __attribute__ ((__packed__)) NR_MAC_CE_TA;
|
||||
|
||||
// single Entry PHR MAC CE
|
||||
// TS 38.321 ch. 6.1.3.8
|
||||
typedef struct {
|
||||
uint8_t PH:6;
|
||||
uint8_t R1:2;
|
||||
uint8_t PCMAX:6;
|
||||
uint8_t R2:6;
|
||||
} __attribute__ ((__packed__)) NR_SINGLE_ENTRY_PHR_MAC_CE;
|
||||
|
||||
//* RAR MAC subheader // TS 38.321 ch. 6.1.5, 6.2.2 *//
|
||||
// - E: The Extension field is a flag indicating if the MAC subPDU including this MAC subheader is the last MAC subPDU or not in the MAC PDU
|
||||
// - T: The Type field is a flag indicating whether the MAC subheader contains a Random Access Preamble ID or a Backoff Indicator (0, BI) (1, RAPID)
|
||||
// - R: Reserved bit, set to "0"
|
||||
// - BI: The Backoff Indicator field identifies the overload condition in the cell.
|
||||
// - RAPID: The Random Access Preamble IDentifier field identifies the transmitted Random Access Preamble
|
||||
|
||||
/*!\brief RAR MAC subheader with RAPID */
|
||||
typedef struct {
|
||||
uint8_t RAPID:6;
|
||||
uint8_t T:1;
|
||||
uint8_t E:1;
|
||||
} __attribute__ ((__packed__)) NR_RA_HEADER_RAPID;
|
||||
|
||||
/*!\brief RAR MAC subheader with Backoff Indicator */
|
||||
typedef struct {
|
||||
uint8_t BI:4;
|
||||
uint8_t R:2;
|
||||
uint8_t T:1;
|
||||
uint8_t E:1;
|
||||
} __attribute__ ((__packed__)) NR_RA_HEADER_BI;
|
||||
|
||||
// TS 38.321 ch. 6.2.3
|
||||
typedef struct {
|
||||
uint8_t TA1:7; // octet 1 [6:0]
|
||||
uint8_t R:1; // octet 1 [7]
|
||||
uint8_t UL_GRANT_1:3; // octet 2 [2:0]
|
||||
uint8_t TA2:5; // octet 2 [7:3]
|
||||
uint8_t UL_GRANT_2:8; // octet 3 [7:0]
|
||||
uint8_t UL_GRANT_3:8; // octet 4 [7:0]
|
||||
uint8_t UL_GRANT_4:8; // octet 5 [7:0]
|
||||
uint8_t TCRNTI_1:8; // octet 6 [7:0]
|
||||
uint8_t TCRNTI_2:8; // octet 7 [7:0]
|
||||
} __attribute__ ((__packed__)) NR_MAC_RAR;
|
||||
|
||||
// DCI pdu structures. Used by both gNB and UE.
|
||||
typedef struct {
|
||||
uint16_t val;
|
||||
@@ -100,59 +180,59 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
|
||||
uint8_t format_indicator; //1 bit
|
||||
uint8_t ra_preamble_index; //6 bits
|
||||
uint8_t ss_pbch_index; //6 bits
|
||||
uint8_t prach_mask_index; //4 bits
|
||||
uint8_t mcs; //5 bits
|
||||
uint8_t ndi; //1 bit
|
||||
uint8_t rv; //2 bits
|
||||
uint8_t harq_pid; //4 bits
|
||||
uint8_t tpc; //2 bits
|
||||
uint8_t short_messages_indicator; //2 bits
|
||||
uint8_t short_messages; //8 bits
|
||||
uint8_t tb_scaling; //2 bits
|
||||
uint8_t pucch_resource_indicator; //3 bits
|
||||
uint8_t dmrs_sequence_initialization; //1 bit
|
||||
uint8_t system_info_indicator; //1 bit
|
||||
uint8_t format_indicator; //1 bit
|
||||
uint8_t ra_preamble_index; //6 bits
|
||||
uint8_t ss_pbch_index; //6 bits
|
||||
uint8_t prach_mask_index; //4 bits
|
||||
uint8_t mcs; //5 bits
|
||||
uint8_t ndi; //1 bit
|
||||
uint8_t rv; //2 bits
|
||||
uint8_t harq_pid; //4 bits
|
||||
uint8_t tpc; //2 bits
|
||||
uint8_t short_messages_indicator; //2 bits
|
||||
uint8_t short_messages; //8 bits
|
||||
uint8_t tb_scaling; //2 bits
|
||||
uint8_t pucch_resource_indicator; //3 bits
|
||||
uint8_t dmrs_sequence_initialization; //1 bit
|
||||
uint8_t system_info_indicator; //1 bit
|
||||
|
||||
uint8_t slot_format_indicator_count;
|
||||
uint8_t *slot_format_indicators;
|
||||
uint8_t slot_format_indicator_count;
|
||||
uint8_t *slot_format_indicators;
|
||||
|
||||
uint8_t pre_emption_indication_count;
|
||||
uint16_t *pre_emption_indications; //14 bit each
|
||||
uint8_t pre_emption_indication_count;
|
||||
uint16_t *pre_emption_indications; //14 bit each
|
||||
|
||||
uint8_t block_number_count;
|
||||
uint8_t *block_numbers;
|
||||
uint8_t padding;
|
||||
uint8_t block_number_count;
|
||||
uint8_t *block_numbers;
|
||||
uint8_t padding;
|
||||
|
||||
dci_field_t mcs2; //variable
|
||||
dci_field_t ndi2; //variable
|
||||
dci_field_t rv2; //variable
|
||||
dci_field_t frequency_domain_assignment; //variable
|
||||
dci_field_t time_domain_assignment; //variable
|
||||
dci_field_t frequency_hopping_flag; //variable
|
||||
dci_field_t vrb_to_prb_mapping; //variable
|
||||
dci_field_t dai[2]; //variable
|
||||
dci_field_t pdsch_to_harq_feedback_timing_indicator; //variable
|
||||
dci_field_t carrier_indicator; //variable
|
||||
dci_field_t bwp_indicator; //variable
|
||||
dci_field_t prb_bundling_size_indicator; //variable
|
||||
dci_field_t rate_matching_indicator; //variable
|
||||
dci_field_t zp_csi_rs_trigger; //variable
|
||||
dci_field_t transmission_configuration_indication; //variable
|
||||
dci_field_t srs_request; //variable
|
||||
dci_field_t cbgti; //variable
|
||||
dci_field_t cbgfi; //variable
|
||||
dci_field_t srs_resource_indicator; //variable
|
||||
dci_field_t precoding_information; //variable
|
||||
dci_field_t csi_request; //variable
|
||||
dci_field_t ptrs_dmrs_association; //variable
|
||||
dci_field_t beta_offset_indicator; //variable
|
||||
dci_field_t cloded_loop_indicator; //variable
|
||||
dci_field_t ul_sul_indicator; //variable
|
||||
dci_field_t antenna_ports; //variable
|
||||
dci_field_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI: 16 bits
|
||||
dci_field_t mcs2; //variable
|
||||
dci_field_t ndi2; //variable
|
||||
dci_field_t rv2; //variable
|
||||
dci_field_t frequency_domain_assignment; //variable
|
||||
dci_field_t time_domain_assignment; //variable
|
||||
dci_field_t frequency_hopping_flag; //variable
|
||||
dci_field_t vrb_to_prb_mapping; //variable
|
||||
dci_field_t dai[2]; //variable
|
||||
dci_field_t pdsch_to_harq_feedback_timing_indicator; //variable
|
||||
dci_field_t carrier_indicator; //variable
|
||||
dci_field_t bwp_indicator; //variable
|
||||
dci_field_t prb_bundling_size_indicator; //variable
|
||||
dci_field_t rate_matching_indicator; //variable
|
||||
dci_field_t zp_csi_rs_trigger; //variable
|
||||
dci_field_t transmission_configuration_indication; //variable
|
||||
dci_field_t srs_request; //variable
|
||||
dci_field_t cbgti; //variable
|
||||
dci_field_t cbgfi; //variable
|
||||
dci_field_t srs_resource_indicator; //variable
|
||||
dci_field_t precoding_information; //variable
|
||||
dci_field_t csi_request; //variable
|
||||
dci_field_t ptrs_dmrs_association; //variable
|
||||
dci_field_t beta_offset_indicator; //variable
|
||||
dci_field_t cloded_loop_indicator; //variable
|
||||
dci_field_t ul_sul_indicator; //variable
|
||||
dci_field_t antenna_ports; //variable
|
||||
dci_field_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI: 16 bits
|
||||
|
||||
} dci_pdu_rel15_t;
|
||||
|
||||
@@ -182,8 +262,8 @@ dci_field_t reserved; //1_0/C-RNTI:10 bits, 1_0/P-RNTI: 6 bits, 1_0/SI-&RA-RNTI:
|
||||
#define UL_SCH_LCID_CCCH 0x00
|
||||
#define UL_SCH_LCID_SRB1 0x01
|
||||
#define UL_SCH_LCID_SRB2 0x02
|
||||
#define UL_SCH_LCID_DTCH 0x03
|
||||
#define UL_SCH_LCID_SRB3 0x04
|
||||
#define UL_SCH_LCID_SRB3 0x03
|
||||
#define UL_SCH_LCID_DTCH 0x04
|
||||
#define UL_SCH_LCID_CCCH_MSG3 0x21
|
||||
#define UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY 0x35
|
||||
#define UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT 0x36
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+35
-7
@@ -32,13 +32,8 @@
|
||||
#ifndef __LAYER2_NR_MAC_COMMON_H__
|
||||
#define __LAYER2_NR_MAC_COMMON_H__
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
#include "NR_PDSCH-Config.h"
|
||||
#include "NR_ServingCellConfigCommon.h"
|
||||
|
||||
typedef enum {
|
||||
NR_DL_DCI_FORMAT_1_0 = 0,
|
||||
@@ -67,4 +62,37 @@ typedef enum {
|
||||
NR_RNTI_TPC_SRS
|
||||
} nr_rnti_type_t;
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
|
||||
|
||||
void get_band(uint64_t downlink_frequency, uint16_t *current_band, int32_t *current_offset, lte_frame_type_t *current_type);
|
||||
|
||||
uint64_t from_nrarfcn(int nr_bandP, uint8_t scs_index, uint32_t dl_nrarfcn);
|
||||
|
||||
uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint8_t scs_index, uint32_t bw);
|
||||
|
||||
int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,int NrOfSymbols);
|
||||
|
||||
int is_nr_DL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
|
||||
int is_nr_UL_slot(NR_ServingCellConfigCommon_t *scc,slot_t slotP);
|
||||
|
||||
int get_nr_prach_info_from_index(uint8_t index,
|
||||
int frame,
|
||||
int slot,
|
||||
uint32_t pointa,
|
||||
uint8_t mu,
|
||||
uint8_t unpaired,
|
||||
uint16_t *format,
|
||||
uint8_t *start_symbol,
|
||||
uint8_t *N_t_slot,
|
||||
uint8_t *N_dur);
|
||||
|
||||
uint8_t compute_nr_root_seq(NR_RACH_ConfigCommon_t *rach_config,
|
||||
uint8_t nb_preambles,
|
||||
uint8_t unpaired);
|
||||
|
||||
int get_format0(uint8_t index, uint8_t unpaired);
|
||||
|
||||
uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
|
||||
|
||||
#endif
|
||||
@@ -19,12 +19,12 @@
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file extern.h
|
||||
/*! \file nr_mac_extern.h
|
||||
* \brief NR mac externs
|
||||
* \author G. Casati
|
||||
* \author Navid Nikaein, Raymond Knopp, Guido Casati
|
||||
* \date 2019
|
||||
* \version 1.0
|
||||
* \email guido.casati@iis.fraunhofer.de
|
||||
* \email navid.nikaein@eurecom.fr, guido.casati@iis.fraunhofer.de
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
@@ -32,10 +32,10 @@
|
||||
#ifndef __NR_MAC_EXTERN_H__
|
||||
#define __NR_MAC_EXTERN_H__
|
||||
|
||||
//#include "PHY/defs_common.h"
|
||||
#include "nr_mac.h"
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "nr_mac.h"
|
||||
|
||||
/*#include "PHY/defs_common.h"*/
|
||||
|
||||
/* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
|
||||
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
|
||||
@@ -43,8 +43,6 @@ extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
|
||||
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
|
||||
extern int cqi_to_mcs[16];
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
extern uint8_t rb_table[34];
|
||||
@@ -52,6 +50,9 @@ extern mac_rlc_am_muilist_t rlc_am_mui;
|
||||
extern SCHEDULER_MODES global_scheduler_mode;
|
||||
extern unsigned char NB_UE_INST;*/
|
||||
|
||||
|
||||
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
|
||||
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][MAX_MOBILES_PER_ENB]; // eNBxUE = 8x8
|
||||
extern unsigned char NB_INST;
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern unsigned char NB_RN_INST;
|
||||
@@ -60,8 +61,15 @@ extern unsigned short NODE_ID[1];
|
||||
/* Scheduler */
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern uint8_t nfapi_mode;
|
||||
extern mac_rlc_am_muilist_t rlc_am_mui;
|
||||
extern SCHEDULER_MODES global_scheduler_mode;
|
||||
|
||||
/*#if defined(PRE_SCD_THREAD)
|
||||
extern int cqi_to_mcs[16];
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
extern uint8_t rb_table[34];
|
||||
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
extern uint16_t pre_nb_rbs_required[2][MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
extern uint8_t dlsch_ue_select_tbl_in_use;
|
||||
extern uint8_t new_dlsch_ue_select_tbl_in_use;
|
||||
@@ -69,4 +77,5 @@ extern boolean_t pre_scd_activeUE[NUMBER_OF_UE_MAX];
|
||||
extern eNB_UE_STATS pre_scd_eNB_UE_stats[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
|
||||
#endif*/
|
||||
|
||||
|
||||
#endif //DEF_H
|
||||
|
||||
@@ -31,11 +31,9 @@
|
||||
*/
|
||||
|
||||
//#include "mac_defs.h"
|
||||
#include "mac_proto.h"
|
||||
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC-CellGroupConfig.h"
|
||||
|
||||
#include "../NR_MAC_gNB/nr_mac_common.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "SCHED_NR/phy_frame_config_nr.h"
|
||||
|
||||
int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg,
|
||||
@@ -151,8 +149,8 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
int i;
|
||||
|
||||
mac->phy_config.Mod_id = module_id;
|
||||
mac->phy_config.CC_id = cc_idP;
|
||||
mac->phy_config.Mod_id = module_id;
|
||||
mac->phy_config.CC_id = cc_idP;
|
||||
|
||||
// carrier config
|
||||
|
||||
@@ -203,12 +201,20 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
}
|
||||
}
|
||||
|
||||
lte_frame_type_t frame_type;
|
||||
uint16_t band;
|
||||
int32_t offset;
|
||||
|
||||
get_band((cfg->carrier_config.dl_frequency)*1000,
|
||||
&band,
|
||||
&offset,
|
||||
&frame_type);
|
||||
|
||||
|
||||
// cell config
|
||||
|
||||
cfg->cell_config.phy_cell_id = *scc->physCellId;
|
||||
cfg->cell_config.frame_duplex_type = 1;
|
||||
|
||||
cfg->cell_config.frame_duplex_type = frame_type;
|
||||
|
||||
// SSB config
|
||||
cfg->ssb_config.ss_pbch_power = scc->ss_PBCH_BlockPower;
|
||||
@@ -270,6 +276,53 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
|
||||
LOG_I(PHY,"TDD has been properly configurated\n");
|
||||
}
|
||||
|
||||
// PRACH configuration
|
||||
|
||||
uint8_t nb_preambles = 64;
|
||||
if(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles != NULL)
|
||||
nb_preambles = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->totalNumberOfRA_Preambles;
|
||||
|
||||
cfg->prach_config.prach_sequence_length = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present-1;
|
||||
|
||||
if (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing)
|
||||
cfg->prach_config.prach_sub_c_spacing = *scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
cfg->prach_config.prach_sub_c_spacing = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
cfg->prach_config.restricted_set_config = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->restrictedSetConfig;
|
||||
|
||||
switch (scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM) {
|
||||
case 0 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 1;
|
||||
break;
|
||||
case 1 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 2;
|
||||
break;
|
||||
case 2 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 4;
|
||||
break;
|
||||
case 3 :
|
||||
cfg->prach_config.num_prach_fd_occasions = 8;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1==0,"msg1 FDM identifier %ld undefined (0,1,2,3) \n", scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FDM);
|
||||
}
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list = (fapi_nr_num_prach_fd_occasions_t *) malloc(cfg->prach_config.num_prach_fd_occasions*sizeof(fapi_nr_num_prach_fd_occasions_t));
|
||||
for (i=0; i<cfg->prach_config.num_prach_fd_occasions; i++) {
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i;
|
||||
if (cfg->prach_config.prach_sequence_length)
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
|
||||
else
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].k1 = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup, nb_preambles, frame_type);
|
||||
//cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences = ???
|
||||
}
|
||||
|
||||
cfg->prach_config.ssb_per_rach = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->ssb_perRACH_OccasionAndCB_PreamblesPerSSB->present-1;
|
||||
|
||||
}
|
||||
|
||||
@@ -292,8 +345,7 @@ int nr_rrc_mac_config_req_ue(
|
||||
if(mibP != NULL){
|
||||
mac->mib = mibP; // update by every reception
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(cell_group_config != NULL ){
|
||||
mac->servCellIndex = *cell_group_config->spCellConfig->servCellIndex;
|
||||
if (cell_group_config->spCellConfig->reconfigurationWithSync) {
|
||||
@@ -301,6 +353,7 @@ int nr_rrc_mac_config_req_ue(
|
||||
config_common_ue(mac,module_id,cc_idP);
|
||||
mac->crnti = cell_group_config->spCellConfig->reconfigurationWithSync->newUE_Identity;
|
||||
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
|
||||
|
||||
}
|
||||
mac->scg = cell_group_config;
|
||||
|
||||
|
||||
@@ -37,6 +37,21 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "platform_types.h"
|
||||
|
||||
/* PHY */
|
||||
#include "PHY/defs_nr_common.h"
|
||||
|
||||
/* IF */
|
||||
#include "NR_IF_Module.h"
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
|
||||
/* MAC */
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "NR_MAC_COMMON/nr_mac_extern.h"
|
||||
|
||||
/* RRC */
|
||||
#include "NR_DRX-Config.h"
|
||||
#include "NR_SchedulingRequestConfig.h"
|
||||
#include "NR_BSR-Config.h"
|
||||
@@ -48,11 +63,7 @@
|
||||
#include "NR_PhysicalCellGroupConfig.h"
|
||||
#include "NR_CellGroupConfig.h"
|
||||
#include "NR_ServingCellConfig.h"
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
#include "NR_IF_Module.h"
|
||||
#include "../NR_MAC_gNB/nr_mac_common.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
|
||||
|
||||
#define NB_NR_UE_MAC_INST 1
|
||||
/*!\brief Maximum number of logical channl group IDs */
|
||||
@@ -61,6 +72,7 @@
|
||||
/*!\brief value for indicating BSR Timer is not running */
|
||||
#define NR_MAC_UE_BSR_TIMER_NOT_RUNNING (0xFFFF)
|
||||
|
||||
|
||||
typedef enum {
|
||||
SFN_C_MOD_2_EQ_0,
|
||||
SFN_C_MOD_2_EQ_1,
|
||||
@@ -133,10 +145,12 @@ typedef struct {
|
||||
#define MAX_NUM_BWP 2
|
||||
|
||||
typedef enum {
|
||||
RA_IDLE=0,
|
||||
WAIT_RAR=1,
|
||||
WAIT_CONTENTION_RESOLUTION=2
|
||||
RA_UE_IDLE = 0,
|
||||
WAIT_RAR = 1,
|
||||
WAIT_CONTENTION_RESOLUTION = 2,
|
||||
RA_SUCCEEDED = 3
|
||||
} RA_state_t;
|
||||
|
||||
/*!\brief Top level UE MAC structure */
|
||||
typedef struct {
|
||||
|
||||
@@ -144,13 +158,13 @@ typedef struct {
|
||||
NR_CellGroupConfig_t *scg;
|
||||
int servCellIndex;
|
||||
//// MAC config
|
||||
NR_DRX_Config_t *drx_Config;
|
||||
NR_DRX_Config_t *drx_Config;
|
||||
NR_SchedulingRequestConfig_t *schedulingRequestConfig;
|
||||
NR_BSR_Config_t *bsr_Config;
|
||||
NR_TAG_Config_t *tag_Config;
|
||||
NR_PHR_Config_t *phr_Config;
|
||||
NR_RNTI_Value_t *cs_RNTI;
|
||||
NR_MIB_t *mib;
|
||||
NR_BSR_Config_t *bsr_Config;
|
||||
NR_TAG_Config_t *tag_Config;
|
||||
NR_PHR_Config_t *phr_Config;
|
||||
NR_RNTI_Value_t *cs_RNTI;
|
||||
NR_MIB_t *mib;
|
||||
|
||||
NR_BWP_Downlink_t *DLbwp[MAX_NUM_BWP];
|
||||
NR_BWP_Uplink_t *ULbwp[MAX_NUM_BWP];
|
||||
@@ -163,14 +177,67 @@ typedef struct {
|
||||
SFN_C_TYPE type0_pdcch_ss_sfn_c;
|
||||
uint32_t type0_pdcch_ss_n_c;
|
||||
uint32_t type0_pdcch_consecutive_slots;
|
||||
int rnti_type;
|
||||
|
||||
/* PDUs */
|
||||
/// Outgoing CCCH pdu for PHY
|
||||
CCCH_PDU CCCH_pdu;
|
||||
ULSCH_PDU ulsch_pdu;
|
||||
|
||||
/* Random Access parameters */
|
||||
/// state of RA procedure
|
||||
RA_state_t ra_state;
|
||||
/// RA-rnti
|
||||
/// RA-rnti
|
||||
uint16_t ra_rnti;
|
||||
/// Temporary CRNTI
|
||||
/// Temporary CRNTI
|
||||
uint16_t t_crnti;
|
||||
/// CRNTI
|
||||
/// CRNTI
|
||||
uint16_t crnti;
|
||||
/// number of attempt for rach
|
||||
uint8_t RA_attempt_number;
|
||||
/// Random-access procedure flag
|
||||
uint8_t RA_active;
|
||||
/// Random-access window counter
|
||||
int8_t RA_window_cnt;
|
||||
/// Random-access Msg3 size in bytes
|
||||
uint8_t RA_Msg3_size;
|
||||
/// Random-access prachMaskIndex
|
||||
uint8_t RA_prachMaskIndex;
|
||||
/// Flag indicating Preamble set (A,B) used for first Msg3 transmission
|
||||
uint8_t RA_usedGroupA;
|
||||
/// BeamfailurerecoveryConfig
|
||||
NR_BeamFailureRecoveryConfig_t RA_BeamFailureRecoveryConfig;
|
||||
/// Preamble Tx Counter
|
||||
uint8_t RA_PREAMBLE_TRANSMISSION_COUNTER;
|
||||
/// Preamble Power Ramping Counter
|
||||
uint8_t RA_PREAMBLE_POWER_RAMPING_COUNTER;
|
||||
/// Random-access backoff counter
|
||||
int16_t RA_backoff_indicator;
|
||||
/// Random-access backoff counter
|
||||
int16_t RA_backoff_cnt;
|
||||
/// Random-access variable for window calculation (frame of last change in window counter)
|
||||
uint32_t RA_tx_frame;
|
||||
/// Random-access variable for window calculation (subframe of last change in window counter)
|
||||
uint8_t RA_tx_subframe;
|
||||
/// Random-access Group B maximum path-loss
|
||||
/// Random-access variable for backoff (frame of last change in backoff counter)
|
||||
uint32_t RA_backoff_frame;
|
||||
/// Random-access variable for backoff (subframe of last change in backoff counter)
|
||||
uint8_t RA_backoff_subframe;
|
||||
/// Random-access Group B maximum path-loss
|
||||
uint16_t RA_maxPL;
|
||||
/// Random-access Contention Resolution Timer active flag
|
||||
uint8_t RA_contention_resolution_timer_active;
|
||||
/// Random-access Contention Resolution Timer count value
|
||||
uint8_t RA_contention_resolution_cnt;
|
||||
/// Msg3 Delta Preamble
|
||||
int8_t deltaPreamble_Msg3;
|
||||
/// Received TPC command (in dB) from RAR
|
||||
int8_t Msg3_TPC;
|
||||
/// Flag to monitor if matching RAPID was received in RAR
|
||||
uint8_t RA_RAPID_found;
|
||||
/// Flag to monitor if BI was received in RAR
|
||||
uint8_t RA_BI_found;
|
||||
|
||||
//// FAPI-like interface message
|
||||
fapi_nr_tx_request_t tx_request;
|
||||
|
||||
@@ -124,8 +124,6 @@ uint32_t get_ssb_slot(uint32_t ssb_index);
|
||||
|
||||
uint32_t mr_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);
|
||||
|
||||
|
||||
|
||||
/* \brief Get payload (MAC PDU) from UE PHY
|
||||
@param module_idP Instance id of UE in machine
|
||||
@param CC_id Component Carrier index
|
||||
@@ -154,6 +152,20 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
|
||||
uint8_t gNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
|
||||
unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload,
|
||||
uint8_t *pdu,
|
||||
uint8_t num_sdus,
|
||||
uint16_t *sdu_lengths,
|
||||
uint8_t *sdu_lcids,
|
||||
uint8_t power_headroom,
|
||||
uint16_t crnti,
|
||||
uint16_t truncated_bsr,
|
||||
uint16_t short_bsr,
|
||||
uint16_t long_bsr,
|
||||
unsigned short post_padding,
|
||||
uint16_t buflen);
|
||||
|
||||
int8_t nr_ue_process_dlsch(module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, void *pduP, uint32_t pdu_len);
|
||||
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac,fapi_nr_dl_config_request_t *dl_config,int frame,int slot);
|
||||
@@ -170,5 +182,95 @@ int set_tdd_config_nr_ue(fapi_nr_config_request_t *cfg, int mu,
|
||||
int nrofDownlinkSlots, int nrofDownlinkSymbols,
|
||||
int nrofUplinkSlots, int nrofUplinkSymbols);
|
||||
|
||||
/** \brief Function for UE/PHY to compute PUSCH transmit power in power-control procedure.
|
||||
@param Mod_id Module id of UE
|
||||
@returns Po_NOMINAL_PUSCH (PREAMBLE_RECEIVED_TARGET_POWER+DELTA_PREAMBLE
|
||||
*/
|
||||
int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t module_idP, uint8_t CC_id);
|
||||
|
||||
/** \brief Function to compute DELTA_PREAMBLE from 38.321 subclause 7.3
|
||||
(for RA power ramping procedure and Msg3 PUSCH power control policy)
|
||||
@param Mod_id Module id of UE
|
||||
@returns DELTA_PREAMBLE
|
||||
*/
|
||||
int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_format);
|
||||
|
||||
/* Random Access */
|
||||
|
||||
/* \brief This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211 tables 6.3.3.2.x
|
||||
and fills the PRACH PDU per each FD occasion.
|
||||
@param module_idP Index of UE instance
|
||||
@param frameP Frame index
|
||||
@param slotP Slot index
|
||||
@returns void
|
||||
*/
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
|
||||
|
||||
/* \brief Function called by PHY to process the received RAR and check that the preamble matches what was sent by the gNB. It provides the timing advance and t-CRNTI.
|
||||
@param Mod_id Index of UE instance
|
||||
@param CC_id Index to a component carrier
|
||||
@param frame Frame index
|
||||
@param ra_rnti RA_RNTI value
|
||||
@param dlsch_buffer Pointer to dlsch_buffer containing RAR PDU
|
||||
@param t_crnti Pointer to PHY variable containing the T_CRNTI
|
||||
@param preamble_index Preamble Index used by PHY to transmit the PRACH. This should match the received RAR to trigger the rest of
|
||||
random-access procedure
|
||||
@param selected_rar_buffer the output buffer for storing the selected RAR header and RAR payload
|
||||
@returns timing advance or 0xffff if preamble doesn't match
|
||||
*/
|
||||
uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
int CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t * dlsch_buffer,
|
||||
rnti_t * t_crnti,
|
||||
uint8_t preamble_index,
|
||||
uint8_t * selected_rar_buffer);
|
||||
|
||||
void nr_process_rar(nr_downlink_indication_t *dl_info);
|
||||
|
||||
void ue_contention_resolution(module_id_t module_id, uint8_t gNB_index, int cc_id, frame_t tx_frame);
|
||||
|
||||
void nr_ra_failed(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index);
|
||||
|
||||
void nr_ra_succeeded(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_index);
|
||||
|
||||
/* \brief Function called by PHY to retrieve information to be transmitted using the RA procedure.
|
||||
If the UE is not in PUSCH mode for a particular eNB index, this is assumed to be an Msg3 and MAC
|
||||
attempts to retrieves the CCCH message from RRC. If the UE is in PUSCH mode for a particular eNB
|
||||
index and PUCCH format 0 (Scheduling Request) is not activated, the MAC may use this resource for
|
||||
andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4 from 36.321)
|
||||
@param mod_id Index of UE instance
|
||||
@param CC_id Component Carrier Index
|
||||
@param frame
|
||||
@param gNB_id gNB index
|
||||
@param nr_tti_tx slot for PRACH transmission
|
||||
@returns void */
|
||||
void nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
module_id_t mod_id,
|
||||
int CC_id,
|
||||
UE_MODE_t UE_mode,
|
||||
frame_t frame,
|
||||
uint8_t gNB_id,
|
||||
int nr_tti_tx);
|
||||
|
||||
/* \brief Function implementing the routine for the selection of Random Access resources (5.1.2 TS 38.321).
|
||||
@param module_idP Index of UE instance
|
||||
@param CC_id Component Carrier Index
|
||||
@param gNB_index gNB index
|
||||
@param t_id
|
||||
@param rach_ConfigDedicated
|
||||
@returns void */
|
||||
void nr_get_prach_resources(module_id_t mod_id,
|
||||
int CC_id,
|
||||
uint8_t gNB_id,
|
||||
uint8_t t_id,
|
||||
uint8_t first_Msg3,
|
||||
NR_PRACH_RESOURCES_t *prach_resources,
|
||||
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated);
|
||||
|
||||
void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id);
|
||||
|
||||
void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id);
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
* 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_l1_helper.c
|
||||
* \brief PHY helper functions for PRACH adapted to NR
|
||||
* \author Guido Casati
|
||||
* \date 2019
|
||||
* \version 2.0
|
||||
* \email guido.casati@iis.fraunhofer.de
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
#include "PHY/defs_nr_common.h"
|
||||
|
||||
#include "mac_defs.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
/* TS 38.321 subclause 7.3 - return DELTA_PREAMBLE values in dB */
|
||||
int8_t nr_get_DELTA_PREAMBLE(module_id_t mod_id, int CC_id, uint16_t prach_format){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_SubcarrierSpacing_t scs = *nr_rach_ConfigCommon->msg1_SubcarrierSpacing;
|
||||
int prach_sequence_length = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.present - 1;
|
||||
uint8_t prachConfigIndex, mu;
|
||||
|
||||
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
|
||||
|
||||
// SCS configuration from msg1_SubcarrierSpacing and table 4.2-1 in TS 38.211
|
||||
|
||||
switch (scs){
|
||||
case NR_SubcarrierSpacing_kHz15:
|
||||
mu = 0;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz30:
|
||||
mu = 1;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz60:
|
||||
mu = 2;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz120:
|
||||
mu = 3;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_kHz240:
|
||||
mu = 4;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_spare3:
|
||||
mu = 5;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_spare2:
|
||||
mu = 6;
|
||||
break;
|
||||
|
||||
case NR_SubcarrierSpacing_spare1:
|
||||
mu = 7;
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown msg1_SubcarrierSpacing %lu\n", scs);
|
||||
}
|
||||
|
||||
// Preamble formats given by prach_ConfigurationIndex and tables 6.3.3.2-2 and 6.3.3.2-2 in TS 38.211
|
||||
|
||||
prachConfigIndex = nr_rach_ConfigCommon->rach_ConfigGeneric.prach_ConfigurationIndex;
|
||||
|
||||
if (prach_sequence_length == 0) {
|
||||
switch (prach_format) {
|
||||
AssertFatal(prach_format < 4, "Illegal PRACH format %d for sequence length 839\n", prach_format);
|
||||
|
||||
// long preamble formats
|
||||
case 0:
|
||||
case 3:
|
||||
return 0;
|
||||
|
||||
case 1:
|
||||
return -3;
|
||||
|
||||
case 2:
|
||||
return -6;
|
||||
}
|
||||
} else {
|
||||
switch (prach_format) { // short preamble formats
|
||||
case 0:
|
||||
case 3:
|
||||
return 8 + 3*mu;
|
||||
|
||||
case 1:
|
||||
case 4:
|
||||
case 8:
|
||||
return 5 + 3*mu;
|
||||
|
||||
case 2:
|
||||
case 5:
|
||||
return 3 + 3*mu;
|
||||
|
||||
case 6:
|
||||
return 3*mu;
|
||||
|
||||
case 7:
|
||||
return 5 + 3*mu;
|
||||
|
||||
default:
|
||||
AssertFatal(1 == 0, "[UE %d] ue_procedures.c: FATAL, Illegal preambleFormat %d, prachConfigIndex %d\n", mod_id, prach_format, prachConfigIndex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* TS 38.321 subclause 5.1.3 - RA preamble transmission - ra_PREAMBLE_RECEIVED_TARGET_POWER configuration */
|
||||
int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t mod_id, uint8_t CC_id){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
int8_t receivedTargerPower, delta_preamble;
|
||||
long preambleReceivedTargetPower;
|
||||
|
||||
AssertFatal(nr_rach_ConfigCommon != NULL, "[UE %d] CCid %d FATAL nr_rach_ConfigCommon is NULL !!!\n", mod_id, CC_id);
|
||||
|
||||
preambleReceivedTargetPower = nr_rach_ConfigCommon->rach_ConfigGeneric.preambleReceivedTargetPower;
|
||||
delta_preamble = nr_get_DELTA_PREAMBLE(mod_id, CC_id, prach_resources->prach_format);
|
||||
|
||||
receivedTargerPower = preambleReceivedTargetPower + delta_preamble + (mac->RA_PREAMBLE_POWER_RAMPING_COUNTER - 1) * prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP;
|
||||
|
||||
return receivedTargerPower;
|
||||
}
|
||||
@@ -0,0 +1,613 @@
|
||||
/*
|
||||
* 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 ra_procedures.c
|
||||
* \brief Routines for UE MAC-layer Random Access procedures (TS 38.321, Release 15)
|
||||
* \author R. Knopp, Navid Nikaein, Guido Casati
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr navid.nikaein@eurecom.fr, guido.casati@iis.fraunhofer.de
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "mac.h"
|
||||
|
||||
/*
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "PHY_INTERFACE/phy_interface_extern.h"
|
||||
#include "SCHED_UE/sched_UE.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"*/
|
||||
|
||||
/* Tools */
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
|
||||
/* RRC */
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
|
||||
/* PHY */
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
|
||||
#include "PHY/defs_common.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
|
||||
|
||||
/* MAC */
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
|
||||
extern int64_t table_6_3_3_2_2_prachConfig_Index [256][9];
|
||||
extern int64_t table_6_3_3_2_3_prachConfig_Index [256][9];
|
||||
|
||||
//extern uint8_t nfapi_mode;
|
||||
|
||||
// WIP
|
||||
// This routine implements Section 5.1.2 (UE Random Access Resource Selection)
|
||||
// and Section 5.1.3 (Random Access Preamble Transmission) from 3GPP TS 38.321
|
||||
void nr_get_prach_resources(module_id_t mod_id,
|
||||
int CC_id,
|
||||
uint8_t gNB_id,
|
||||
uint8_t t_id,
|
||||
uint8_t first_Msg3,
|
||||
NR_PRACH_RESOURCES_t *prach_resources,
|
||||
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon;
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric;
|
||||
|
||||
// NR_BeamFailureRecoveryConfig_t *beam_failure_recovery_config = &mac->RA_BeamFailureRecoveryConfig; // todo
|
||||
|
||||
int messagePowerOffsetGroupB, messageSizeGroupA, PLThreshold, sizeOfRA_PreamblesGroupA, numberOfRA_Preambles, i, deltaPreamble_Msg3;
|
||||
uint8_t noGroupB = 0, s_id, f_id, ul_carrier_id, prach_ConfigIndex, SFN_nbr, Msg3_size;
|
||||
|
||||
// NR_RSRP_Range_t rsrp_ThresholdSSB; // todo
|
||||
|
||||
///////////////////////////////////////////////////////////
|
||||
//////////* UE Random Access Resource Selection *//////////
|
||||
///////////////////////////////////////////////////////////
|
||||
|
||||
// todo:
|
||||
// - switch initialisation cases
|
||||
// -- RA initiated by beam failure recovery operation (subclause 5.17 TS 38.321)
|
||||
// --- SSB selection, set prach_resources->ra_PreambleIndex
|
||||
// -- RA initiated by PDCCH: ra_preamble_index provided by PDCCH && ra_PreambleIndex != 0b000000
|
||||
// --- set PREAMBLE_INDEX to ra_preamble_index
|
||||
// --- select the SSB signalled by PDCCH
|
||||
// -- RA initiated for SI request:
|
||||
// --- SSB selection, set prach_resources->ra_PreambleIndex
|
||||
|
||||
// if (rach_ConfigDedicated) { // This is for network controlled Mobility
|
||||
// // operation for contention-free RA resources when:
|
||||
// // - available SSB with SS-RSRP above rsrp-ThresholdSSB: SSB selection
|
||||
// // - availalbe CSI-RS with CSI-RSRP above rsrp-ThresholdCSI-RS: CSI-RS selection
|
||||
// prach_resources->ra_PreambleIndex = rach_ConfigDedicated->ra_PreambleIndex;
|
||||
// }
|
||||
|
||||
//////////* Contention-based RA preamble selection *//////////
|
||||
// todo:
|
||||
// - selection of SSB with SS-RSRP above rsrp-ThresholdSSB else select any SSB
|
||||
// - todo determine next available PRACH occasion
|
||||
|
||||
// rsrp_ThresholdSSB = *nr_rach_ConfigCommon->rsrp_ThresholdSSB;
|
||||
|
||||
AssertFatal(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup != NULL, "[UE %d] FATAL nr_rach_ConfigCommon is NULL !!!\n", mod_id);
|
||||
|
||||
nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
rach_ConfigGeneric = &nr_rach_ConfigCommon->rach_ConfigGeneric;
|
||||
|
||||
Msg3_size = mac->RA_Msg3_size;
|
||||
|
||||
numberOfRA_Preambles = 64;
|
||||
if(nr_rach_ConfigCommon->totalNumberOfRA_Preambles != NULL)
|
||||
numberOfRA_Preambles = *(nr_rach_ConfigCommon->totalNumberOfRA_Preambles);
|
||||
|
||||
if (!nr_rach_ConfigCommon->groupBconfigured) {
|
||||
noGroupB = 1;
|
||||
} else {
|
||||
// RA preambles group B is configured
|
||||
// - Defining the number of RA preambles in RA Preamble Group A for each SSB */
|
||||
sizeOfRA_PreamblesGroupA = nr_rach_ConfigCommon->groupBconfigured->numberOfRA_PreamblesGroupA;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA){
|
||||
/* - Threshold to determine the groups of RA preambles */
|
||||
case 0:
|
||||
messageSizeGroupA = 56;
|
||||
break;
|
||||
case 1:
|
||||
messageSizeGroupA = 144;
|
||||
break;
|
||||
case 2:
|
||||
messageSizeGroupA = 208;
|
||||
break;
|
||||
case 3:
|
||||
messageSizeGroupA = 256;
|
||||
break;
|
||||
case 4:
|
||||
messageSizeGroupA = 282;
|
||||
break;
|
||||
case 5:
|
||||
messageSizeGroupA = 480;
|
||||
break;
|
||||
case 6:
|
||||
messageSizeGroupA = 640;
|
||||
break;
|
||||
case 7:
|
||||
messageSizeGroupA = 800;
|
||||
break;
|
||||
case 8:
|
||||
messageSizeGroupA = 1000;
|
||||
break;
|
||||
case 9:
|
||||
messageSizeGroupA = 72;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown ra_Msg3SizeGroupA %lu\n", nr_rach_ConfigCommon->groupBconfigured->ra_Msg3SizeGroupA);
|
||||
/* todo cases 10 -15*/
|
||||
}
|
||||
|
||||
/* Power offset for preamble selection in dB */
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
switch (nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB){
|
||||
case 0:
|
||||
messagePowerOffsetGroupB = -9999;
|
||||
break;
|
||||
case 1:
|
||||
messagePowerOffsetGroupB = 0;
|
||||
break;
|
||||
case 2:
|
||||
messagePowerOffsetGroupB = 5;
|
||||
break;
|
||||
case 3:
|
||||
messagePowerOffsetGroupB = 8;
|
||||
break;
|
||||
case 4:
|
||||
messagePowerOffsetGroupB = 10;
|
||||
break;
|
||||
case 5:
|
||||
messagePowerOffsetGroupB = 12;
|
||||
break;
|
||||
case 6:
|
||||
messagePowerOffsetGroupB = 15;
|
||||
break;
|
||||
case 7:
|
||||
messagePowerOffsetGroupB = 18;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0,"Unknown messagePowerOffsetGroupB %lu\n", nr_rach_ConfigCommon->groupBconfigured->messagePowerOffsetGroupB);
|
||||
}
|
||||
|
||||
// todo Msg3-DeltaPreamble should be provided from higher layers, otherwise is 0
|
||||
mac->deltaPreamble_Msg3 = 0;
|
||||
deltaPreamble_Msg3 = mac->deltaPreamble_Msg3;
|
||||
}
|
||||
|
||||
PLThreshold = prach_resources->RA_PCMAX - rach_ConfigGeneric->preambleReceivedTargetPower - deltaPreamble_Msg3 - messagePowerOffsetGroupB;
|
||||
|
||||
/* Msg3 has not been transmitted yet */
|
||||
if (first_Msg3 == 1) {
|
||||
if (noGroupB == 1) {
|
||||
// use Group A preamble
|
||||
prach_resources->ra_PreambleIndex = (taus()) % numberOfRA_Preambles;
|
||||
mac->RA_usedGroupA = 1;
|
||||
} else if ((Msg3_size < messageSizeGroupA) && (get_nr_PL(mod_id, CC_id, gNB_id) > PLThreshold)) {
|
||||
// Group B is configured and RA preamble Group A is used
|
||||
// - todo add condition on CCCH_sdu_size for initiation by CCCH
|
||||
prach_resources->ra_PreambleIndex = (taus()) % sizeOfRA_PreamblesGroupA;
|
||||
mac->RA_usedGroupA = 1;
|
||||
} else {
|
||||
// Group B preamble is configured and used
|
||||
// the first sizeOfRA_PreamblesGroupA RA preambles belong to RA Preambles Group A
|
||||
// the remaining belong to RA Preambles Group B
|
||||
prach_resources->ra_PreambleIndex = sizeOfRA_PreamblesGroupA + (taus()) % (numberOfRA_Preambles - sizeOfRA_PreamblesGroupA);
|
||||
mac->RA_usedGroupA = 0;
|
||||
}
|
||||
} else { // Msg3 is being retransmitted
|
||||
if (mac->RA_usedGroupA == 1 && noGroupB == 1) {
|
||||
prach_resources->ra_PreambleIndex = (taus()) % numberOfRA_Preambles;
|
||||
} else if (mac->RA_usedGroupA == 1 && noGroupB == 0){
|
||||
prach_resources->ra_PreambleIndex = (taus()) % sizeOfRA_PreamblesGroupA;
|
||||
} else {
|
||||
prach_resources->ra_PreambleIndex = sizeOfRA_PreamblesGroupA + (taus()) % (numberOfRA_Preambles - sizeOfRA_PreamblesGroupA);
|
||||
}
|
||||
}
|
||||
|
||||
// todo determine next available PRACH occasion
|
||||
// - if RA initiated for SI request and ra_AssociationPeriodIndex and si-RequestPeriod are configured
|
||||
// - else if SSB is selected above
|
||||
// - else if CSI-RS is selected above
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//////////* Random Access Preamble Transmission (5.1.3 TS 38.321) *//////////
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// todo:
|
||||
// - condition on notification of suspending power ramping counter from lower layer (5.1.3 TS 38.321)
|
||||
// - check if SSB or CSI-RS have not changed since the selection in the last RA Preamble tranmission
|
||||
// - Extend RA_rnti computation (e.g. f_id selection, ul_carrier_id are hardcoded)
|
||||
|
||||
if (mac->RA_PREAMBLE_TRANSMISSION_COUNTER > 1)
|
||||
mac->RA_PREAMBLE_POWER_RAMPING_COUNTER++;
|
||||
|
||||
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id);
|
||||
|
||||
// RA-RNTI computation (associated to PRACH occasion in which the RA Preamble is transmitted)
|
||||
// 1) this does not apply to contention-free RA Preamble for beam failure recovery request
|
||||
// 2) getting star_symb, SFN_nbr from table 6.3.3.2-3 (TDD and FR1 scenario)
|
||||
|
||||
prach_ConfigIndex = rach_ConfigGeneric->prach_ConfigurationIndex;
|
||||
|
||||
// ra_RNTI computation
|
||||
// - todo: this is for TDD FR1 only
|
||||
// - ul_carrier_id: UL carrier used for RA preamble transmission, hardcoded for NUL carrier
|
||||
// - f_id: index of the PRACH occasion in the frequency domain
|
||||
// - s_id is starting symbol of the PRACH occasion [0...14]
|
||||
// - t_id is the first slot of the PRACH occasion in a system frame [0...80]
|
||||
|
||||
ul_carrier_id = 0; // NUL
|
||||
f_id = rach_ConfigGeneric->msg1_FrequencyStart;
|
||||
SFN_nbr = table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][4];
|
||||
s_id = table_6_3_3_2_3_prachConfig_Index[prach_ConfigIndex][5];
|
||||
|
||||
// Pick the first slot of the PRACH occasion in a system frame
|
||||
for (i = 0; i < 10; i++){
|
||||
if (((SFN_nbr & (1 << i)) >> i) == 1){
|
||||
t_id = 2*i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
prach_resources->ra_RNTI = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
|
||||
mac->ra_rnti = prach_resources->ra_RNTI;
|
||||
|
||||
LOG_D(MAC, "Computed ra_RNTI is %d", prach_resources->ra_RNTI);
|
||||
}
|
||||
|
||||
// TbD: RA_attempt_number not used
|
||||
void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id){
|
||||
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
mac->ra_state = WAIT_RAR;
|
||||
// Start contention resolution timer
|
||||
mac->RA_attempt_number++;
|
||||
}
|
||||
|
||||
void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id){
|
||||
AssertFatal(CC_id == 0, "Transmission on secondary CCs is not supported yet\n");
|
||||
LOG_D(MAC,"[UE %d][RAPROC] Frame %d : Msg3_tx: Starting contention resolution timer\n", mod_id, frameP);
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
// start contention resolution timer
|
||||
mac->RA_contention_resolution_cnt = 0;
|
||||
mac->RA_contention_resolution_timer_active = 1;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
///////* Random Access Preamble Initialization (5.1.1 TS 38.321) *///////
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
/// Handling inizialization by PDCCH order, MAC entity or RRC (TS 38.300)
|
||||
/// Only one RA procedure is ongoing at any point in time in a MAC entity
|
||||
/// the RA procedure on a SCell shall only be initiated by PDCCH order
|
||||
|
||||
// WIP
|
||||
// todo TS 38.321:
|
||||
// - check if carrier to use is explicitly signalled then do (1) RA CARRIER SELECTION (SUL, NUL) (2) set PCMAX
|
||||
// - BWP operation (subclause 5.15 TS 38.321)
|
||||
// - handle initialization by beam failure recovery
|
||||
// - handle initialization by handover
|
||||
// - handle transmission on DCCH using PRACH (during handover, or sending SR for example)
|
||||
// - take into account MAC CEs in size_sdu (currently hardcoded size to 1 MAC subPDU and 1 padding subheader)
|
||||
// - fix rrc data req logic
|
||||
// - retrieve TBS
|
||||
// - add mac_rrc_nr_data_req_ue, etc ...
|
||||
// - add the backoff condition here if we have it from a previous RA reponse which failed (i.e. backoff indicator)
|
||||
|
||||
void nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
module_id_t mod_id,
|
||||
int CC_id,
|
||||
UE_MODE_t UE_mode,
|
||||
frame_t frame,
|
||||
uint8_t gNB_id,
|
||||
int nr_tti_tx){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
|
||||
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES];
|
||||
uint8_t lcid = UL_SCH_LCID_CCCH_MSG3, *payload, ra_ResponseWindow;
|
||||
uint8_t config_index, mu;
|
||||
int is_nr_prach_slot;
|
||||
uint16_t size_sdu = 0;
|
||||
unsigned short post_padding;
|
||||
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *setup = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
|
||||
NR_FrequencyInfoDL_t *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||
// int32_t frame_diff = 0;
|
||||
|
||||
uint8_t sdu_lcids[NB_RB_MAX] = {0};
|
||||
uint16_t sdu_lengths[NB_RB_MAX] = {0};
|
||||
int TBS_bytes = 848, header_length_total, num_sdus, offset, preambleTransMax, mac_ce_len;
|
||||
|
||||
AssertFatal(CC_id == 0,"Transmission on secondary CCs is not supported yet\n");
|
||||
|
||||
if (UE_mode == PRACH) {
|
||||
|
||||
LOG_D(MAC, "nr_ue_get_rach, RA_active value: %d", mac->RA_active);
|
||||
|
||||
config_index = rach_ConfigGeneric->prach_ConfigurationIndex;
|
||||
if (setup->msg1_SubcarrierSpacing)
|
||||
mu = *setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
mu = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
is_nr_prach_slot = get_nr_prach_info_from_index(config_index,
|
||||
(int)frame,
|
||||
(int)nr_tti_tx,
|
||||
frequencyInfoDL->absoluteFrequencyPointA,
|
||||
mu,
|
||||
cfg->cell_config.frame_duplex_type,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
if (is_nr_prach_slot)
|
||||
prach_resources->generate_nr_prach = 1;
|
||||
else
|
||||
prach_resources->generate_nr_prach = 0;
|
||||
|
||||
AssertFatal(setup != NULL, "[UE %d] FATAL nr_rach_ConfigCommon is NULL !!!\n", mod_id);
|
||||
|
||||
if (mac->RA_active == 0) {
|
||||
/* RA not active - checking if RRC is ready to initiate the RA procedure */
|
||||
|
||||
LOG_I(MAC, "RA not active. Starting RA preamble initialization.\n");
|
||||
|
||||
mac->RA_RAPID_found = 0;
|
||||
|
||||
/* Set RA_PREAMBLE_POWER_RAMPING_STEP */
|
||||
switch (rach_ConfigGeneric->powerRampingStep){ // in dB
|
||||
case 0:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 0;
|
||||
break;
|
||||
case 1:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 2;
|
||||
break;
|
||||
case 2:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 4;
|
||||
break;
|
||||
case 3:
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP = 6;
|
||||
break;
|
||||
}
|
||||
|
||||
prach_resources->RA_PREAMBLE_BACKOFF = 0;
|
||||
prach_resources->RA_SCALING_FACTOR_BI = 1;
|
||||
prach_resources->RA_PCMAX = 0; // currently hardcoded to 0
|
||||
|
||||
payload = (uint8_t*) &mac->CCCH_pdu.payload;
|
||||
|
||||
mac_ce_len = 0;
|
||||
num_sdus = 1;
|
||||
post_padding = 1;
|
||||
|
||||
if (0){
|
||||
// initialisation by RRC
|
||||
// CCCH PDU
|
||||
// size_sdu = (uint16_t) mac_rrc_data_req_ue(mod_id,
|
||||
// CC_id,
|
||||
// frame,
|
||||
// CCCH,
|
||||
// 1,
|
||||
// mac_sdus,
|
||||
// gNB_id,
|
||||
// 0);
|
||||
LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n", mod_id, frame, size_sdu);
|
||||
} else {
|
||||
// fill ulsch_buffer with random data
|
||||
for (int i = 0; i < TBS_bytes; i++){
|
||||
mac_sdus[i] = (unsigned char) (lrand48()&0xff);
|
||||
}
|
||||
//Sending SDUs with size 1
|
||||
//Initialize elements of sdu_lcids and sdu_lengths
|
||||
sdu_lcids[0] = lcid;
|
||||
sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len;
|
||||
header_length_total += 2 + (sdu_lengths[0] >= 128);
|
||||
size_sdu += sdu_lengths[0];
|
||||
}
|
||||
|
||||
mac->RA_tx_frame = frame;
|
||||
mac->RA_tx_subframe = nr_tti_tx;
|
||||
mac->RA_backoff_frame = frame;
|
||||
mac->RA_backoff_subframe = nr_tti_tx;
|
||||
|
||||
if (size_sdu > 0) {
|
||||
|
||||
LOG_I(MAC, "[UE %d] Frame %d: Initialisation Random Access Procedure\n", mod_id, frame);
|
||||
|
||||
mac->RA_PREAMBLE_TRANSMISSION_COUNTER = 1;
|
||||
mac->RA_PREAMBLE_POWER_RAMPING_COUNTER = 1;
|
||||
mac->RA_Msg3_size = size_sdu + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
|
||||
mac->RA_prachMaskIndex = 0;
|
||||
// todo: add the backoff condition here
|
||||
mac->RA_backoff_cnt = 0;
|
||||
mac->RA_active = 1;
|
||||
prach_resources->Msg3 = payload;
|
||||
|
||||
ra_ResponseWindow = rach_ConfigGeneric->ra_ResponseWindow;
|
||||
switch (ra_ResponseWindow) {
|
||||
case 0:
|
||||
mac->RA_window_cnt = 1;
|
||||
break;
|
||||
case 1:
|
||||
mac->RA_window_cnt = 2;
|
||||
break;
|
||||
case 2:
|
||||
mac->RA_window_cnt = 4;
|
||||
break;
|
||||
case 3:
|
||||
mac->RA_window_cnt = 8;
|
||||
break;
|
||||
case 4:
|
||||
mac->RA_window_cnt = 10;
|
||||
break;
|
||||
case 5:
|
||||
mac->RA_window_cnt = 20;
|
||||
break;
|
||||
case 6:
|
||||
mac->RA_window_cnt = 40;
|
||||
break;
|
||||
case 7:
|
||||
mac->RA_window_cnt = 80;
|
||||
break;
|
||||
}
|
||||
|
||||
// Fill in preamble and PRACH resources
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, 1, prach_resources, NULL);
|
||||
|
||||
offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer
|
||||
(uint8_t *) payload, // UL MAC pdu pointer
|
||||
num_sdus, // num sdus
|
||||
sdu_lengths, // sdu length
|
||||
sdu_lcids, // sdu lcid
|
||||
0, // power headroom
|
||||
0, // crnti
|
||||
0, // truncated bsr
|
||||
0, // short bsr
|
||||
0, // long_bsr
|
||||
post_padding,
|
||||
0);
|
||||
|
||||
// Padding: fill remainder with 0
|
||||
if (post_padding > 0){
|
||||
for (int j = 0; j < (TBS_bytes - offset); j++)
|
||||
payload[offset + j] = 0; // mac_pdu[offset + j] = 0;
|
||||
}
|
||||
}
|
||||
} else { // RACH is active
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
/////* Random Access Response reception (5.1.4 TS 38.321) */////
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Handling ra_responseWindow, RA_PREAMBLE_TRANSMISSION_COUNTER
|
||||
// and RA_backoff_cnt
|
||||
// todo:
|
||||
// - handle beam failure recovery request
|
||||
// - handle DL assignment on PDCCH for RA-RNTI
|
||||
// - handle backoff and raResponseWindow params
|
||||
// - disabled contention resolution as OAI NSA is contention-free based
|
||||
|
||||
LOG_D(MAC, "[MAC][UE %d][RAPROC] frame %d, subframe %d: RA Active, window cnt %d (RA_tx_frame %d, RA_tx_subframe %d)\n",
|
||||
mod_id, frame, nr_tti_tx, mac->RA_window_cnt, mac->RA_tx_frame, mac->RA_tx_subframe);
|
||||
|
||||
if (mac->RA_BI_found){
|
||||
prach_resources->RA_PREAMBLE_BACKOFF = prach_resources->RA_SCALING_FACTOR_BI * mac->RA_backoff_indicator;
|
||||
} else {
|
||||
prach_resources->RA_PREAMBLE_BACKOFF = 0;
|
||||
}
|
||||
|
||||
if (mac->RA_window_cnt > 0 && mac->RA_RAPID_found == 1) {
|
||||
// mac->ra_state = WAIT_CONTENTION_RESOLUTION;
|
||||
} else {
|
||||
LOG_I(MAC, "[MAC][UE %d][RAPROC] Frame %d: subframe %d: RAR reception not successful, (RA window count %d) \n",
|
||||
mod_id,
|
||||
frame,
|
||||
nr_tti_tx,
|
||||
mac->RA_window_cnt);
|
||||
|
||||
mac->RA_PREAMBLE_TRANSMISSION_COUNTER++;
|
||||
|
||||
preambleTransMax = -1;
|
||||
switch (rach_ConfigGeneric->preambleTransMax) {
|
||||
case 0:
|
||||
preambleTransMax = 3;
|
||||
break;
|
||||
case 1:
|
||||
preambleTransMax = 4;
|
||||
break;
|
||||
case 2:
|
||||
preambleTransMax = 5;
|
||||
break;
|
||||
case 3:
|
||||
preambleTransMax = 6;
|
||||
break;
|
||||
case 4:
|
||||
preambleTransMax = 7;
|
||||
break;
|
||||
case 5:
|
||||
preambleTransMax = 8;
|
||||
break;
|
||||
case 6:
|
||||
preambleTransMax = 10;
|
||||
break;
|
||||
case 7:
|
||||
preambleTransMax = 20;
|
||||
break;
|
||||
case 8:
|
||||
preambleTransMax = 50;
|
||||
break;
|
||||
case 9:
|
||||
preambleTransMax = 100;
|
||||
break;
|
||||
case 10:
|
||||
preambleTransMax = 200;
|
||||
break;
|
||||
}
|
||||
|
||||
if (mac->RA_PREAMBLE_TRANSMISSION_COUNTER == preambleTransMax + 1){
|
||||
LOG_D(MAC, "[UE %d] Frame %d: Maximum number of RACH attempts (%d)\n", mod_id, frame, preambleTransMax);
|
||||
mac->RA_backoff_cnt = rand() % (prach_resources->RA_PREAMBLE_BACKOFF + 1);
|
||||
mac->RA_PREAMBLE_TRANSMISSION_COUNTER = 1;
|
||||
prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP += prach_resources->RA_PREAMBLE_POWER_RAMPING_STEP << 1; // 2 dB increment
|
||||
prach_resources->ra_PREAMBLE_RECEIVED_TARGET_POWER = nr_get_Po_NOMINAL_PUSCH(prach_resources, mod_id, CC_id);
|
||||
}
|
||||
|
||||
// compute backoff parameters
|
||||
// if (mac->RA_backoff_cnt > 0){
|
||||
// frame_diff = (sframe_t) frame - mac->RA_backoff_frame;
|
||||
// if (frame_diff < 0) frame_diff = -frame_diff;
|
||||
// mac->RA_backoff_frame = frame;
|
||||
// mac->RA_backoff_subframe = nr_tti_tx;
|
||||
// }
|
||||
// compute RA window parameters
|
||||
// if (mac->RA_window_cnt > 0){
|
||||
// frame_diff = (frame_t) frame - mac->RA_tx_frame;
|
||||
// if (frame_diff < 0) frame_diff = -frame_diff;
|
||||
// mac->RA_window_cnt -= ((10 * frame_diff) + (nr_tti_tx - mac->RA_tx_subframe));
|
||||
// LOG_D(MAC, "[MAC][UE %d][RAPROC] Frame %d, subframe %d: RA Active, adjusted window cnt %d\n", mod_id, frame, nr_tti_tx, mac->RA_window_cnt);
|
||||
// }
|
||||
|
||||
mac->RA_tx_frame = frame;
|
||||
mac->RA_tx_subframe = nr_tti_tx;
|
||||
// Fill in preamble and PRACH resources
|
||||
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, 0, prach_resources, NULL);
|
||||
}
|
||||
}
|
||||
} else if (UE_mode == PUSCH) {
|
||||
LOG_D(MAC, "[UE %d] FATAL: Should not have checked for RACH in PUSCH yet ...", mod_id);
|
||||
AssertFatal(1 == 0, "");
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "assertions.h"
|
||||
#include "LAYER2/NR_MAC_UE/mac_extern.h"
|
||||
#include "mac_defs.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef NR_PDCCH_DCI_TOOLS_DEBUG
|
||||
@@ -123,7 +124,7 @@ void ue_dci_configuration(NR_UE_MAC_INST_t *mac,fapi_nr_dl_config_request_t *dl_
|
||||
if (mac->ra_state == WAIT_RAR) {
|
||||
// check for RAR
|
||||
rel15 = &dl_config->dl_config_list[dl_config->number_pdus].dci_config_pdu.dci_config_rel15;
|
||||
rel15->rnti = 2;//get_RA_RNTI(mac,frame,slot);
|
||||
rel15->rnti = 2;//get_RA_RNTI(mac,frame,slot); // WIP
|
||||
dl_config->number_pdus = dl_config->number_pdus + 1;
|
||||
}
|
||||
else if (mac->ra_state == WAIT_CONTENTION_RESOLUTION) {
|
||||
|
||||
@@ -31,28 +31,37 @@
|
||||
*/
|
||||
|
||||
|
||||
/* MAC related headers */
|
||||
#include "mac_proto.h"
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
|
||||
/* exe */
|
||||
#include "executables/nr-softmodem.h"
|
||||
|
||||
/* RRC*/
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
#include "NR_RACH-ConfigCommon.h"
|
||||
#include "NR_RACH-ConfigGeneric.h"
|
||||
#include "NR_FrequencyInfoDL.h"
|
||||
|
||||
/* MAC */
|
||||
#include "mac_defs.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#include "mac_extern.h"
|
||||
#include "NR_MAC_COMMON/nr_mac.h"
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC_UE/mac_extern.h"
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
|
||||
//#include "LAYER2/MAC/mac_vars.h" // TODO Note that mac_vars.h is not NR specific and this should be updated
|
||||
// also, the use of the same should be updated in nr-softmodem and nr-uesoftmodem
|
||||
|
||||
/* PHY UE related headers*/
|
||||
/* PHY UE */
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
|
||||
#include "RRC/NR_UE/rrc_proto.h"
|
||||
#include "assertions.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
|
||||
/*Openair Packet Tracer */
|
||||
#include "UTIL/OPT/opt.h"
|
||||
#include "OCG.h"
|
||||
#include "executables/softmodem-common.h"
|
||||
/* log utils */
|
||||
|
||||
/* utils */
|
||||
#include "assertions.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "SIMULATION/TOOLS/sim.h" // for taus
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
@@ -60,7 +69,6 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
//int mbms_rab_id = 2047;
|
||||
|
||||
//#define ENABLE_MAC_PAYLOAD_DEBUG 1
|
||||
#define DEBUG_EXTRACT_DCI 1
|
||||
@@ -732,6 +740,9 @@ NR_UE_L2_STATE_t nr_ue_scheduler(const module_id_t module_id,
|
||||
*/
|
||||
}
|
||||
|
||||
if (mac->RA_contention_resolution_timer_active == 1) {
|
||||
ue_contention_resolution(module_id, gNB_index, cc_id, tx_frame);
|
||||
}
|
||||
|
||||
mac->scheduled_response.dl_config = dl_config;
|
||||
|
||||
@@ -739,6 +750,187 @@ NR_UE_L2_STATE_t nr_ue_scheduler(const module_id_t module_id,
|
||||
return UE_CONNECTION_OK;
|
||||
}
|
||||
|
||||
// This function schedules the PRACH according to prach_ConfigurationIndex and TS 38.211, tables 6.3.3.2.x
|
||||
// It fills the PRACH PDU per each FD occasion.
|
||||
// PRACH formats 9, 10, 11 are corresponding to dual PRACH format configurations A1/B1, A2/B2, A3/B3.
|
||||
// - todo:
|
||||
// - Partial configuration is actually already stored in (fapi_nr_prach_config_t) &mac->phy_config.config_req->prach_config
|
||||
//// however we need rach_ConfigGeneric to retrieve the config_index
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP) {
|
||||
|
||||
uint8_t config_index, mu, N_dur, N_t_slot, start_symbol;
|
||||
uint16_t format, format0, format1, ncs;
|
||||
int msg1_FDM, is_nr_prach_slot, fdm;
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
|
||||
|
||||
fapi_nr_ul_config_request_t *ul_config = &mac->ul_config_request;
|
||||
fapi_nr_ul_config_prach_pdu *prach_config_pdu;
|
||||
fapi_nr_config_request_t *cfg = &mac->phy_config.config_req;
|
||||
fapi_nr_prach_config_t *prach_config = &cfg->prach_config;
|
||||
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *setup = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
NR_FrequencyInfoDL_t *frequencyInfoDL = scc->downlinkConfigCommon->frequencyInfoDL;
|
||||
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
|
||||
config_index = rach_ConfigGeneric->prach_ConfigurationIndex;
|
||||
|
||||
if (is_nr_UL_slot(scc, slotP)) {
|
||||
|
||||
if (setup->msg1_SubcarrierSpacing)
|
||||
mu = *setup->msg1_SubcarrierSpacing;
|
||||
else
|
||||
mu = frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing;
|
||||
|
||||
is_nr_prach_slot = get_nr_prach_info_from_index(config_index,
|
||||
(int)frameP,
|
||||
(int)slotP,
|
||||
frequencyInfoDL->absoluteFrequencyPointA,
|
||||
mu,
|
||||
cfg->cell_config.frame_duplex_type,
|
||||
&format,
|
||||
&start_symbol,
|
||||
&N_t_slot,
|
||||
&N_dur);
|
||||
if (is_nr_prach_slot) {
|
||||
|
||||
fdm = rach_ConfigGeneric->msg1_FDM;
|
||||
|
||||
switch (fdm){
|
||||
case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
msg1_FDM = 1 << fdm;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Unknown msg1_FDM from rach_ConfigGeneric %d\n", fdm);
|
||||
}
|
||||
|
||||
format0 = format & 0xff; // single PRACH format
|
||||
format1 = (format >> 8) & 0xff; // dual PRACH format
|
||||
|
||||
ul_config->sfn = frameP;
|
||||
ul_config->slot = slotP;
|
||||
|
||||
for (int n = 0; n < msg1_FDM; n++) { // one structure per frequency domain occasion
|
||||
|
||||
ul_config->ul_config_list[ul_config->number_pdus].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PRACH;
|
||||
prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
|
||||
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
|
||||
ul_config->number_pdus += 1;
|
||||
|
||||
ncs = get_NCS(rach_ConfigGeneric->zeroCorrelationZoneConfig, format0, setup->restrictedSetConfig);
|
||||
|
||||
// filling PRACH PDU for FAPI config request
|
||||
prach_config_pdu->phys_cell_id = *scc->physCellId;
|
||||
prach_config_pdu->num_prach_ocas = N_t_slot;
|
||||
prach_config_pdu->prach_start_symbol = start_symbol;
|
||||
prach_config_pdu->num_ra = n;
|
||||
prach_config_pdu->num_cs = ncs;
|
||||
prach_config_pdu->root_seq_id = prach_config->num_prach_fd_occasions_list[n].prach_root_sequence_index;
|
||||
prach_config_pdu->restricted_set = prach_config->restricted_set_config;
|
||||
prach_config_pdu->freq_msg1 = prach_config->num_prach_fd_occasions_list[n].k1;
|
||||
|
||||
if (format1 != 0xff) {
|
||||
switch(format0) { // dual PRACH format
|
||||
case 0xa1:
|
||||
prach_config_pdu->prach_format = 9;
|
||||
break;
|
||||
case 0xa2:
|
||||
prach_config_pdu->prach_format = 10;
|
||||
break;
|
||||
case 0xa3:
|
||||
prach_config_pdu->prach_format = 11;
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Only formats A1/B1 A2/B2 A3/B3 are valid for dual format");
|
||||
}
|
||||
} else {
|
||||
switch(format0) { // single PRACH format
|
||||
case 0xa1:
|
||||
prach_config_pdu->prach_format = 0;
|
||||
break;
|
||||
case 0xa2:
|
||||
prach_config_pdu->prach_format = 1;
|
||||
break;
|
||||
case 0xa3:
|
||||
prach_config_pdu->prach_format = 2;
|
||||
break;
|
||||
case 0xb1:
|
||||
prach_config_pdu->prach_format = 3;
|
||||
break;
|
||||
case 0xb2:
|
||||
prach_config_pdu->prach_format = 4;
|
||||
break;
|
||||
case 0xb3:
|
||||
prach_config_pdu->prach_format = 5;
|
||||
break;
|
||||
case 0xb4:
|
||||
prach_config_pdu->prach_format = 6;
|
||||
break;
|
||||
case 0xc0:
|
||||
prach_config_pdu->prach_format = 7;
|
||||
break;
|
||||
case 0xc2:
|
||||
prach_config_pdu->prach_format = 8;
|
||||
break;
|
||||
case 0:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
case 1:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
case 2:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
case 3:
|
||||
// long formats are handled @ PHY
|
||||
break;
|
||||
default:
|
||||
AssertFatal(1 == 0, "Invalid PRACH format");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mac->scheduled_response.ul_config = ul_config;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
/////////* Random Access Contention Resolution (5.1.35 TS 38.321) */////////
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Handling contention resolution timer
|
||||
// WIP todo:
|
||||
// - beam failure recovery
|
||||
// - RA completed
|
||||
|
||||
void ue_contention_resolution(module_id_t module_id, uint8_t gNB_index, int cc_id, frame_t tx_frame){
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
|
||||
NR_ServingCellConfigCommon_t *scc = mac->scc;
|
||||
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
|
||||
|
||||
if (mac->RA_contention_resolution_timer_active == 1) {
|
||||
if (nr_rach_ConfigCommon){
|
||||
LOG_I(MAC, "Frame %d: Contention resolution timer %d/%ld\n",
|
||||
tx_frame,
|
||||
mac->RA_contention_resolution_cnt,
|
||||
((1 + nr_rach_ConfigCommon->ra_ContentionResolutionTimer) << 3));
|
||||
mac->RA_contention_resolution_cnt++;
|
||||
|
||||
if (mac->RA_contention_resolution_cnt == ((1 + nr_rach_ConfigCommon->ra_ContentionResolutionTimer) << 3)) {
|
||||
mac->t_crnti = 0;
|
||||
mac->RA_active = 0;
|
||||
mac->RA_contention_resolution_timer_active = 0;
|
||||
// Signal PHY to quit RA procedure
|
||||
LOG_E(MAC, "[UE %u] [RAPROC] Contention resolution timer expired, RA failed, discarded TC-RNTI\n", module_id);
|
||||
nr_ra_failed(module_id, cc_id, gNB_index);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
uint16_t nr_dci_format_size (PHY_VARS_NR_UE *ue,
|
||||
uint8_t slot,
|
||||
@@ -1917,7 +2109,7 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
|
||||
dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits);
|
||||
|
||||
nr_extract_dci_info(mac,dci->dci_format,dci->payloadSize,dci->rnti,(uint64_t *)dci->payloadBits,def_dci_pdu_rel15);
|
||||
nr_ue_process_dci(module_id, cc_id, gNB_index, def_dci_pdu_rel15, dci->rnti, dci->dci_format);
|
||||
return (nr_ue_process_dci(module_id, cc_id, gNB_index, def_dci_pdu_rel15, dci->rnti, dci->dci_format));
|
||||
}
|
||||
|
||||
int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, dci_pdu_rel15_t *dci, uint16_t rnti, uint32_t dci_format){
|
||||
@@ -2682,7 +2874,6 @@ void nr_ue_send_sdu(module_id_t module_idP,
|
||||
LOG_D(MAC, "Handling PDU frame %d slot %d\n", frameP, slotP);
|
||||
|
||||
uint8_t * pduP = pdu;
|
||||
NR_UE_MAC_INST_t *UE_mac_inst = get_mac_inst(module_idP);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN);
|
||||
|
||||
@@ -2778,7 +2969,9 @@ void nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
LOG_D(MAC,"tb_scaling %d (2 bits)=> %d (0x%lx)\n",dci_pdu_rel15->tb_scaling,dci_size-pos,*dci_pdu);
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
mac->rnti_type = rnti_type;
|
||||
|
||||
case NR_RNTI_C:
|
||||
|
||||
// indicating a DL DCI format 1bit
|
||||
@@ -3163,6 +3356,7 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
|
||||
uint8_t *pdu_ptr = pduP, rx_lcid, done = 0;
|
||||
int pdu_len = mac_pdu_len;
|
||||
uint16_t mac_ce_len, mac_subheader_len, mac_sdu_len;
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(module_idP);
|
||||
|
||||
//NR_UE_MAC_INST_t *UE_mac_inst = get_mac_inst(module_idP);
|
||||
//uint8_t scs = UE_mac_inst->mib->subCarrierSpacingCommon;
|
||||
@@ -3323,8 +3517,34 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
|
||||
break;
|
||||
case DL_SCH_LCID_CON_RES_ID:
|
||||
// 38.321 Ch6.1.3.3
|
||||
// WIP todo: handle CCCH_pdu
|
||||
mac_ce_len = 6;
|
||||
|
||||
LOG_I(MAC, "[UE %d][RAPROC] Frame %d : received contention resolution msg: %x.%x.%x.%x.%x.%x, Terminating RA procedure\n", module_idP, frameP, pdu_ptr[0], pdu_ptr[1], pdu_ptr[2], pdu_ptr[3], pdu_ptr[4], pdu_ptr[5]);
|
||||
|
||||
if (mac->RA_active == 1) {
|
||||
LOG_I(MAC, "[UE %d][RAPROC] Frame %d : Clearing RA_active flag\n", module_idP, frameP);
|
||||
mac->RA_active = 0;
|
||||
// // check if RA procedure has finished completely (no contention)
|
||||
// tx_sdu = &mac->CCCH_pdu.payload[3];
|
||||
// //Note: 3 assumes sizeof(SCH_SUBHEADER_SHORT) + PADDING CE, which is when UL-Grant has TBS >= 9 (64 bits)
|
||||
// // (other possibility is 1 for TBS=7 (SCH_SUBHEADER_FIXED), or 2 for TBS=8 (SCH_SUBHEADER_FIXED+PADDING or // SCH_SUBHEADER_SHORT)
|
||||
// for (i = 0; i < 6; i++)
|
||||
// if (tx_sdu[i] != payload_ptr[i]) {
|
||||
// LOG_E(MAC, "[UE %d][RAPROC] Contention detected, RA failed\n", module_idP);
|
||||
// nr_ra_failed(module_idP, CC_id, eNB_index);
|
||||
// mac->RA_contention_resolution_timer_active = 0;
|
||||
// return;
|
||||
// }
|
||||
LOG_I(MAC, "[UE %d][RAPROC] Frame %d : Cleared contention resolution timer. Set C-RNTI to TC-RNTI\n",
|
||||
module_idP,
|
||||
frameP);
|
||||
mac->RA_contention_resolution_timer_active = 0;
|
||||
nr_ra_succeeded(module_idP, CC_id, gNB_index);
|
||||
mac->crnti = mac->t_crnti;
|
||||
mac->t_crnti = 0;
|
||||
mac->ra_state = RA_SUCCEEDED;
|
||||
}
|
||||
break;
|
||||
case DL_SCH_LCID_PADDING:
|
||||
done = 1;
|
||||
@@ -3390,71 +3610,180 @@ void nr_ue_process_mac_pdu(module_id_t module_idP,
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
////////////////////////////////////////////////////////
|
||||
/////* ULSCH MAC PDU generation (6.1.2 TS 38.321) */////
|
||||
////////////////////////////////////////////////////////
|
||||
|
||||
unsigned char nr_generate_ulsch_pdu(uint8_t *sdus_payload,
|
||||
uint8_t *pdu,
|
||||
uint8_t num_sdus,
|
||||
uint16_t *sdu_lengths,
|
||||
uint8_t *sdu_lcids,
|
||||
uint8_t power_headroom,
|
||||
uint16_t crnti,
|
||||
uint16_t truncated_bsr,
|
||||
uint16_t short_bsr,
|
||||
uint16_t long_bsr,
|
||||
unsigned short post_padding,
|
||||
uint16_t buflen) {
|
||||
|
||||
uint16_t
|
||||
nr_generate_ulsch_pdu(uint8_t *mac_pdu,
|
||||
uint8_t *sdus_payload,
|
||||
uint8_t num_sdus,
|
||||
uint16_t *sdu_lengths,
|
||||
uint8_t *sdu_lcids,
|
||||
uint16_t *crnti,
|
||||
uint16_t buflen) {
|
||||
NR_MAC_SUBHEADER_FIXED *mac_pdu_ptr = (NR_MAC_SUBHEADER_FIXED *) pdu;
|
||||
unsigned char last_size = 0, i, mac_header_control_elements[16], *ce_ptr, bsr = 0;
|
||||
int mac_ce_size, offset;
|
||||
|
||||
NR_MAC_SUBHEADER_FIXED *mac_pdu_ptr = (NR_MAC_SUBHEADER_FIXED *) mac_pdu;
|
||||
unsigned char * ulsch_buffer_ptr = sdus_payload;
|
||||
uint8_t last_size=0;
|
||||
uint16_t sdu_length_total=0;
|
||||
int i;
|
||||
int offset=0;
|
||||
LOG_D(MAC, "[UE] Generating ULSCH PDU : num_sdus %d\n", num_sdus);
|
||||
|
||||
// 2) Generation of ULSCH MAC SDU subheaders
|
||||
for (i = 0; i < num_sdus; i++) {
|
||||
LOG_D(MAC, "[gNB] Generate ULSCH header num sdu %d len sdu %d\n", num_sdus, sdu_lengths[i]);
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
|
||||
if (sdu_lengths[i] < 128) {
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->F = 0;
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->LCID = sdu_lcids[i];
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->L = (unsigned char) sdu_lengths[i];
|
||||
last_size = 2;
|
||||
} else {
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->F = 1;
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->LCID = sdu_lcids[i];
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->L1 = ((unsigned short) sdu_lengths[i] >> 8) & 0x7f;
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->L2 = (unsigned short) sdu_lengths[i] & 0xff;
|
||||
last_size = 3;
|
||||
}
|
||||
for (i = 0; i < num_sdus; i++)
|
||||
LOG_D(MAC, "[UE] MAC subPDU %d (lcid %d length %d bytes \n", i, sdu_lcids[i], sdu_lengths[i]);
|
||||
|
||||
mac_pdu_ptr += last_size;
|
||||
#endif
|
||||
|
||||
// 3) cycle through SDUs, compute each relevant and place dlsch_buffer in
|
||||
memcpy((void *) mac_pdu_ptr, (void *) ulsch_buffer_ptr, sdu_lengths[i]);
|
||||
ulsch_buffer_ptr+= sdu_lengths[i];
|
||||
sdu_length_total+= sdu_lengths[i];
|
||||
mac_pdu_ptr += sdu_lengths[i];
|
||||
}
|
||||
// Generating UL MAC subPDUs including MAC SDU and subheader
|
||||
|
||||
offset = ((unsigned char *) mac_pdu_ptr - mac_pdu);
|
||||
for (i = 0; i < num_sdus; i++) {
|
||||
LOG_D(MAC, "[UE] Generating UL MAC subPDUs for SDU with lenght %d ( num_sdus %d )\n", sdu_lengths[i], num_sdus);
|
||||
|
||||
// 4) Compute final offset for padding
|
||||
uint16_t padding_bytes = buflen - offset;
|
||||
LOG_D(MAC, "Number of padding bytes: %d \n", padding_bytes);
|
||||
if (padding_bytes > 0) {
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->LCID = UL_SCH_LCID_PADDING;
|
||||
mac_pdu_ptr++;
|
||||
if (sdu_lcids[i] != UL_SCH_LCID_CCCH){
|
||||
if (sdu_lengths[i] < 128) {
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->F = 0;
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->LCID = sdu_lcids[i];
|
||||
((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->L = (unsigned char) sdu_lengths[i];
|
||||
last_size = 2;
|
||||
} else {
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->F = 1;
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->LCID = sdu_lcids[i];
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->L1 = ((unsigned short) sdu_lengths[i] >> 8) & 0x7f;
|
||||
((NR_MAC_SUBHEADER_LONG *) mac_pdu_ptr)->L2 = (unsigned short) sdu_lengths[i] & 0xff;
|
||||
last_size = 3;
|
||||
}
|
||||
} else { // UL CCCH SDU
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = sdu_lcids[i];
|
||||
}
|
||||
|
||||
} else {
|
||||
// no MAC subPDU with padding
|
||||
}
|
||||
mac_pdu_ptr += last_size;
|
||||
|
||||
// cycle through SDUs, compute each relevant and place ulsch_buffer in
|
||||
memcpy((void *) mac_pdu_ptr, (void *) sdus_payload, sdu_lengths[i]);
|
||||
sdus_payload += sdu_lengths[i];
|
||||
mac_pdu_ptr += sdu_lengths[i];
|
||||
}
|
||||
|
||||
// Generating UL MAC subPDUs including MAC CEs (MAC CE and subheader)
|
||||
|
||||
ce_ptr = &mac_header_control_elements[0];
|
||||
|
||||
if (power_headroom) {
|
||||
// MAC CE fixed subheader
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = UL_SCH_LCID_SINGLE_ENTRY_PHR;
|
||||
mac_pdu_ptr++;
|
||||
|
||||
// PHR MAC CE (1 octet)
|
||||
((NR_SINGLE_ENTRY_PHR_MAC_CE *) ce_ptr)->PH = power_headroom;
|
||||
((NR_SINGLE_ENTRY_PHR_MAC_CE *) ce_ptr)->R1 = 0;
|
||||
((NR_SINGLE_ENTRY_PHR_MAC_CE *) ce_ptr)->PCMAX = 0; // todo
|
||||
((NR_SINGLE_ENTRY_PHR_MAC_CE *) ce_ptr)->R2 = 0;
|
||||
|
||||
mac_ce_size = sizeof(NR_SINGLE_ENTRY_PHR_MAC_CE);
|
||||
|
||||
// Copying bytes for PHR MAC CEs to the mac pdu pointer
|
||||
memcpy((void *) mac_pdu_ptr, (void *) ce_ptr, mac_ce_size);
|
||||
ce_ptr += mac_ce_size;
|
||||
mac_pdu_ptr += (unsigned char) mac_ce_size;
|
||||
}
|
||||
|
||||
if (crnti) {
|
||||
// MAC CE fixed subheader
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = CRNTI;
|
||||
mac_pdu_ptr++;
|
||||
|
||||
// C-RNTI MAC CE (2 octets)
|
||||
* (uint16_t *) ce_ptr = crnti;
|
||||
mac_ce_size = sizeof(uint16_t);
|
||||
|
||||
// Copying bytes for CRNTI MAC CE to the mac pdu pointer
|
||||
memcpy((void *) mac_pdu_ptr, (void *) ce_ptr, mac_ce_size);
|
||||
ce_ptr += mac_ce_size;
|
||||
mac_pdu_ptr += (unsigned char) mac_ce_size;
|
||||
}
|
||||
|
||||
if (truncated_bsr) {
|
||||
// MAC CE fixed subheader
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = UL_SCH_LCID_S_TRUNCATED_BSR;
|
||||
mac_pdu_ptr++;
|
||||
|
||||
// Short truncated BSR MAC CE (1 octet)
|
||||
((NR_BSR_SHORT_TRUNCATED *) ce_ptr)-> Buffer_size = truncated_bsr;
|
||||
((NR_BSR_SHORT_TRUNCATED *) ce_ptr)-> LcgID = 0; // todo
|
||||
mac_ce_size = sizeof(NR_BSR_SHORT_TRUNCATED);
|
||||
|
||||
bsr = 1 ;
|
||||
} else if (short_bsr) {
|
||||
// MAC CE fixed subheader
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = UL_SCH_LCID_S_BSR;
|
||||
mac_pdu_ptr++;
|
||||
|
||||
// Short truncated BSR MAC CE (1 octet)
|
||||
((NR_BSR_SHORT *) ce_ptr)->Buffer_size = short_bsr;
|
||||
((NR_BSR_SHORT *) ce_ptr)->LcgID = 0; // todo
|
||||
mac_ce_size = sizeof(NR_BSR_SHORT);
|
||||
|
||||
bsr = 1 ;
|
||||
} else if (long_bsr) {
|
||||
// MAC CE variable subheader
|
||||
// todo ch 6.1.3.1. TS 38.321
|
||||
// ((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->R = 0;
|
||||
// ((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->F = 0;
|
||||
// ((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->LCID = UL_SCH_LCID_L_BSR;
|
||||
// ((NR_MAC_SUBHEADER_SHORT *) mac_pdu_ptr)->L = 0;
|
||||
// last_size = 2;
|
||||
// mac_pdu_ptr += last_size;
|
||||
|
||||
// Short truncated BSR MAC CE (1 octet)
|
||||
// ((NR_BSR_LONG *) ce_ptr)->Buffer_size0 = short_bsr;
|
||||
// ((NR_BSR_LONG *) ce_ptr)->LCGID0 = 0;
|
||||
// mac_ce_size = sizeof(NR_BSR_LONG); // size is variable
|
||||
}
|
||||
|
||||
if (bsr){
|
||||
// Copying bytes for BSR MAC CE to the mac pdu pointer
|
||||
memcpy((void *) mac_pdu_ptr, (void *) ce_ptr, mac_ce_size);
|
||||
ce_ptr += mac_ce_size;
|
||||
mac_pdu_ptr += (unsigned char) mac_ce_size;
|
||||
}
|
||||
|
||||
// compute offset before adding padding (if necessary)
|
||||
offset = ((unsigned char *) mac_pdu_ptr - pdu);
|
||||
uint16_t padding_bytes = 0;
|
||||
|
||||
if(buflen > 0) // If the buflen is provided
|
||||
padding_bytes = buflen - offset;
|
||||
|
||||
// Compute final offset for padding
|
||||
if (post_padding > 0 || padding_bytes>0) {
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->LCID = UL_SCH_LCID_PADDING;
|
||||
mac_pdu_ptr++;
|
||||
} else {
|
||||
// no MAC subPDU with padding
|
||||
}
|
||||
|
||||
// compute final offset
|
||||
offset = ((unsigned char *) mac_pdu_ptr - pdu);
|
||||
|
||||
//printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr - mac_pdu));
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
|
||||
uint8_t
|
||||
nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sub_frame_t subframe, uint8_t eNB_index,
|
||||
@@ -3527,13 +3856,6 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
|
||||
|
||||
//Update total MAC Header size for RLC PDUs
|
||||
/*if(sdu_lengths[num_sdus]<128)
|
||||
total_rlc_pdu_header_len += 2;
|
||||
else
|
||||
total_rlc_pdu_header_len += 3;*/
|
||||
|
||||
total_rlc_pdu_header_len += MAX_RLC_SDU_SUBHEADER_SIZE; //rlc_pdu_header_len_last;
|
||||
|
||||
//Update number of SDU
|
||||
@@ -3558,13 +3880,18 @@ nr_ue_get_sdu(module_id_t module_idP, int CC_id, frame_t frameP,
|
||||
|
||||
// Generate ULSCH PDU
|
||||
if (num_sdus>0) {
|
||||
payload_offset = nr_generate_ulsch_pdu(ulsch_buffer, // mac header
|
||||
ulsch_sdus,
|
||||
payload_offset = nr_generate_ulsch_pdu(ulsch_sdus,
|
||||
ulsch_buffer, // mac header
|
||||
num_sdus, // num sdus
|
||||
sdu_lengths, // sdu length
|
||||
sdu_lcids, // sdu lcid
|
||||
NULL, // crnti
|
||||
buflen); // long_bsr
|
||||
0, // power_headroom
|
||||
0, // crnti
|
||||
0, // truncated_bsr
|
||||
0, // short_bsr
|
||||
0, // long_bsr
|
||||
0, // post_padding
|
||||
buflen); // TBS in bytes
|
||||
}
|
||||
else
|
||||
return 0;
|
||||
|
||||
@@ -0,0 +1,208 @@
|
||||
/*
|
||||
* 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 rar_tools_nrUE.c
|
||||
* \brief RA tools for NR UE
|
||||
* \author Guido Casati
|
||||
* \date 2019
|
||||
* \version 1.0
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
/* Sim */
|
||||
#include "SIMULATION/TOOLS/sim.h"
|
||||
|
||||
/* Utils */
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "OCG.h"
|
||||
#include "OCG_extern.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
|
||||
/* Common */
|
||||
#include "common/ran_context.h"
|
||||
|
||||
/* MAC */
|
||||
#include "NR_MAC_UE/mac.h"
|
||||
#include "NR_MAC_UE/mac_proto.h"
|
||||
#include "NR_MAC_COMMON/nr_mac_extern.h"
|
||||
|
||||
#define DEBUG_RAR
|
||||
|
||||
// table 7.2-1 TS 38.321
|
||||
uint16_t table_7_2_1[16] = {
|
||||
5, // row index 0
|
||||
10, // row index 1
|
||||
20, // row index 2
|
||||
30, // row index 3
|
||||
40, // row index 4
|
||||
60, // row index 5
|
||||
80, // row index 6
|
||||
120, // row index 7
|
||||
160, // row index 8
|
||||
240, // row index 9
|
||||
320, // row index 10
|
||||
480, // row index 11
|
||||
960, // row index 12
|
||||
1920, // row index 13
|
||||
};
|
||||
|
||||
/////////////////////////////////////
|
||||
// Random Access Response PDU //
|
||||
// TS 38.213 ch 8.2 //
|
||||
// TS 38.321 ch 6.2.3 //
|
||||
/////////////////////////////////////
|
||||
//| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |// bit-wise
|
||||
//| E | T | R A P I D |//
|
||||
//| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |//
|
||||
//| R | T A |//
|
||||
//| T A | UL grant |//
|
||||
//| UL grant |//
|
||||
//| UL grant |//
|
||||
//| UL grant |//
|
||||
//| T C - R N T I |//
|
||||
//| T C - R N T I |//
|
||||
/////////////////////////////////////
|
||||
// UL grant (27 bits) //
|
||||
/////////////////////////////////////
|
||||
//| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 |// bit-wise
|
||||
//|-------------------|FHF|F_alloc|//
|
||||
//| Freq allocation |//
|
||||
//| F_alloc |Time allocation|//
|
||||
//| MCS | TPC |CSI|//
|
||||
/////////////////////////////////////
|
||||
// WIP todo:
|
||||
// - apply UL grant freq alloc & time alloc as per 8.2 TS 38.213
|
||||
// - apply tpc command, csi req, mcs
|
||||
uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
int CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t * dlsch_buffer,
|
||||
rnti_t * t_crnti,
|
||||
uint8_t preamble_index,
|
||||
uint8_t * selected_rar_buffer){
|
||||
|
||||
NR_UE_MAC_INST_t *ue_mac = get_mac_inst(mod_id);
|
||||
NR_RA_HEADER_RAPID *rarh = (NR_RA_HEADER_RAPID *) dlsch_buffer; // RAR subheader pointer
|
||||
NR_MAC_RAR *rar = (NR_MAC_RAR *) (dlsch_buffer + 1); // RAR subPDU pointer
|
||||
uint8_t n_subPDUs = 0; // number of RAR payloads
|
||||
uint8_t n_subheaders = 0; // number of MAC RAR subheaders
|
||||
uint8_t best_rx_rapid = -1; // the closest RAPID receive from all RARs
|
||||
unsigned char freq_hopping, msg3_t_alloc, mcs, tpc_command, csi_req;
|
||||
uint16_t ta_command = 0, msg3_f_alloc, bwp_size;
|
||||
int f_alloc, mask;
|
||||
|
||||
AssertFatal(CC_id == 0, "RAR reception on secondary CCs is not supported yet\n");
|
||||
|
||||
while (1) {
|
||||
n_subheaders++;
|
||||
if (rarh->T == 1) {
|
||||
n_subPDUs++;
|
||||
LOG_D(MAC, "[UE %d][RAPROC] Got RAPID RAR subPDU\n", mod_id);
|
||||
} else {
|
||||
n_subPDUs++;
|
||||
ue_mac->RA_backoff_indicator = table_7_2_1[((NR_RA_HEADER_BI *)rarh)->BI];
|
||||
ue_mac->RA_BI_found = 1;
|
||||
LOG_D(MAC, "[UE %d][RAPROC] Got BI RAR subPDU %d\n", mod_id, ue_mac->RA_backoff_indicator);
|
||||
}
|
||||
if (rarh->RAPID == preamble_index) {
|
||||
LOG_D(PHY, "[UE %d][RAPROC] Found RAR with the intended RAPID %d\n", mod_id, rarh->RAPID);
|
||||
rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR));
|
||||
ue_mac->RA_RAPID_found = 1;
|
||||
break;
|
||||
}
|
||||
if (rarh->E == 0) {
|
||||
LOG_I(PHY, "No RAR found with the intended RAPID. \n");
|
||||
break;
|
||||
} else {
|
||||
rarh += sizeof(NR_MAC_RAR) + 1;
|
||||
}
|
||||
};
|
||||
|
||||
LOG_D(MAC, "number of RAR subheader %d; number of RAR pyloads %d\n", n_subheaders, n_subPDUs);
|
||||
|
||||
// LOG_I(MAC, "[UE %d][RAPROC] Frame %d Received RAR (%02x|%02x.%02x.%02x.%02x.%02x.%02x) for preamble %d/%d\n",
|
||||
// mod_id, frameP, *(uint8_t *) rarh, rar[0], rar[1], rar[2], rar[3], rar[4], rar[5], rarh->RAPID, preamble_index);
|
||||
|
||||
if (ue_mac->RA_RAPID_found) {
|
||||
// TC-RNTI
|
||||
*t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
|
||||
ue_mac->t_crnti = *t_crnti;
|
||||
ue_mac->rnti_type = NR_RNTI_TC;
|
||||
// TA command
|
||||
ta_command = rar->TA2 + (rar->TA1 << 5);
|
||||
// CSI
|
||||
csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01);
|
||||
// TPC
|
||||
tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07);
|
||||
switch (tpc_command){
|
||||
case 0:
|
||||
ue_mac->Msg3_TPC = -6;
|
||||
break;
|
||||
case 1:
|
||||
ue_mac->Msg3_TPC = -4;
|
||||
break;
|
||||
case 2:
|
||||
ue_mac->Msg3_TPC = -2;
|
||||
break;
|
||||
case 3:
|
||||
ue_mac->Msg3_TPC = 0;
|
||||
break;
|
||||
case 4:
|
||||
ue_mac->Msg3_TPC = 2;
|
||||
break;
|
||||
case 5:
|
||||
ue_mac->Msg3_TPC = 4;
|
||||
break;
|
||||
case 6:
|
||||
ue_mac->Msg3_TPC = 6;
|
||||
break;
|
||||
case 7:
|
||||
ue_mac->Msg3_TPC = 8;
|
||||
break;
|
||||
}
|
||||
//MCS
|
||||
mcs = (unsigned char) (rar->UL_GRANT_4 >> 4);
|
||||
// time and frequency alloc
|
||||
bwp_size = NRRIV2BW(ue_mac->ULbwp[0]->bwp_Common->genericParameters.locationAndBandwidth,275);
|
||||
msg3_t_alloc = (unsigned char) (rar->UL_GRANT_3 & 0x07);
|
||||
msg3_f_alloc = (uint16_t) ((rar->UL_GRANT_3 >> 4) | (rar->UL_GRANT_2 << 4) | ((rar->UL_GRANT_1 & 0x03) << 12));
|
||||
|
||||
if (bwp_size < 180)
|
||||
mask = (1 << ((int) ceil(log2((bwp_size*(bwp_size+1))>>1)))) - 1;
|
||||
else
|
||||
mask = (1 << (28 - (int)(ceil(log2((bwp_size*(bwp_size+1))>>1))))) - 1;
|
||||
|
||||
f_alloc = msg3_f_alloc & mask;
|
||||
|
||||
// frequency hopping flag
|
||||
freq_hopping = (unsigned char) (rar->UL_GRANT_1 >> 2);
|
||||
} else {
|
||||
ue_mac->t_crnti = 0;
|
||||
ta_command = (0xffff);
|
||||
}
|
||||
|
||||
// move the selected RAR to the front of the RA_PDSCH buffer
|
||||
memcpy((void *) (selected_rar_buffer + 0), (void *) rarh, 1);
|
||||
memcpy((void *) (selected_rar_buffer + 1), (void *) rar, sizeof(NR_MAC_RAR));
|
||||
|
||||
return ta_command;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user