mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-13 04:30:28 +00:00
Compare commits
65 Commits
ldpc_decod
...
usrp_gpio_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e31943c5c | ||
|
|
34745d9b13 | ||
|
|
f1d2635c79 | ||
|
|
305dae31bf | ||
|
|
7bdff76ff3 | ||
|
|
7e738c2c39 | ||
|
|
030fc5a2f5 | ||
|
|
d34d269d70 | ||
|
|
361446fda5 | ||
|
|
98d2caf59f | ||
|
|
cfbe18c9ed | ||
|
|
a0cd44947e | ||
|
|
0b873bb620 | ||
|
|
c6855cb8d2 | ||
|
|
5ac8b6f34d | ||
|
|
0492f7eb7e | ||
|
|
825ae3c06d | ||
|
|
6ec89bec1f | ||
|
|
310efee7f2 | ||
|
|
f0b7debefc | ||
|
|
6b1cabae41 | ||
|
|
602d025e89 | ||
|
|
1928936883 | ||
|
|
f1740e2c9c | ||
|
|
11147c2e83 | ||
|
|
620038220c | ||
|
|
d5db8c1634 | ||
|
|
f3f58741d8 | ||
|
|
f997ebb8ca | ||
|
|
40bda9f8d0 | ||
|
|
b2ddd33577 | ||
|
|
aab575f66a | ||
|
|
82880f6199 | ||
|
|
2406662e74 | ||
|
|
63375fa139 | ||
|
|
56ecc5cfb2 | ||
|
|
e0c80a83b8 | ||
|
|
2a0cfcb747 | ||
|
|
6be2d8f081 | ||
|
|
1ef8aaee97 | ||
|
|
d252696b14 | ||
|
|
57421caae5 | ||
|
|
d88ab2f9c0 | ||
|
|
af4242c61f | ||
|
|
b2275c7b48 | ||
|
|
046920e6bb | ||
|
|
a9e07dce5f | ||
|
|
9ccb93a094 | ||
|
|
009bacc8af | ||
|
|
131ad5383d | ||
|
|
dd7a65ceba | ||
|
|
21fa809ce0 | ||
|
|
09d3c72144 | ||
|
|
8677d44ae9 | ||
|
|
dbc9472aaf | ||
|
|
a292f82fe2 | ||
|
|
054156c16c | ||
|
|
4fbf754de5 | ||
|
|
46adc28e08 | ||
|
|
794aac4137 | ||
|
|
c97cd87d47 | ||
|
|
1d3023a5f6 | ||
|
|
2d35c28633 | ||
|
|
4c0d814873 | ||
|
|
2070a3305f |
@@ -1641,6 +1641,8 @@ set (MAC_NR_SRC
|
||||
${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
|
||||
)
|
||||
@@ -1713,7 +1715,7 @@ add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag)
|
||||
|
||||
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
|
||||
|
||||
add_library( MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB/nr_mac_common.c )
|
||||
add_library( MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c )
|
||||
|
||||
include_directories("${OPENAIR2_DIR}/NR_UE_PHY_INTERFACE")
|
||||
include_directories("${OPENAIR2_DIR}/LAYER2/NR_MAC_UE")
|
||||
|
||||
@@ -1045,7 +1045,7 @@
|
||||
<main_exec> $OPENAIR_DIR/targets/bin/polartest.Rel15</main_exec>
|
||||
<main_exec_args>-q -s-10 -f0
|
||||
-q -s-10 -f0 -m1</main_exec_args>
|
||||
<tags>polartest.test1</tags>
|
||||
<tags>polartest.test1 polartest.test2</tags>
|
||||
<search_expr_true>BLER= 0.000000</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
@@ -1088,7 +1088,7 @@
|
||||
(Test7: 106 PRB 51 PDSCH-Offset),
|
||||
(Test8: 217 PRB 100 PDSCH-PRBs),
|
||||
(Test9: 217 PRB 80 PDSCH-Offset),
|
||||
(Test10: 217 PRB 100 PDSCH-PRBs 80 PDSCH-Offset),
|
||||
(Test10: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
|
||||
(Test11: 106 PRBs 50 PDSCH-PRBs MCS Index 28</desc>
|
||||
<pre_compile_prog></pre_compile_prog>
|
||||
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
|
||||
@@ -1105,10 +1105,9 @@
|
||||
-n100 -R106 -a51
|
||||
-n100 -R217 -b100
|
||||
-n100 -R217 -a80
|
||||
-n100 -R217 -a80 -b100
|
||||
-n100 -R217 -a110 -b100
|
||||
-n100 -e28</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 nr_dlsim.test11</tags>
|
||||
<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 nr_dlsim.test11</tags>
|
||||
<search_expr_true>PDSCH test OK</search_expr_true>
|
||||
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
|
||||
<nruns>3</nruns>
|
||||
|
||||
@@ -40,6 +40,7 @@ conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
|
||||
|
||||
MSC_GEN=0
|
||||
XFORMS="True"
|
||||
SKIP_SHARED_LIB_FLAG="False"
|
||||
UE_EXPANSION="False"
|
||||
UESIM_EXPANSION="False"
|
||||
PRINT_STATS="False"
|
||||
@@ -152,6 +153,8 @@ Options
|
||||
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES or \"all\"
|
||||
--usrp-recplay
|
||||
Build for I/Q record-playback modes
|
||||
-k | --skip-shared-libraries
|
||||
Skip build for shared libraries to reduce compilation time when building frequently for debugging purposes
|
||||
-h | --help
|
||||
Print this help
|
||||
|
||||
@@ -367,6 +370,10 @@ function main() {
|
||||
USRP_REC_PLAY="True"
|
||||
echo_info "Enabling USRP record playback mode"
|
||||
shift 1;;
|
||||
-k | --skip-shared-libraries)
|
||||
SKIP_SHARED_LIB_FLAG="True"
|
||||
echo_info "Skipping build of shared libraries, rfsimulator, basicsimulator and transport protocol libraries"
|
||||
shift;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -558,6 +565,7 @@ function main() {
|
||||
echo "set ( UE_DEBUG_TRACE $UE_DEBUG_TRACE )" >> $cmake_file
|
||||
echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file
|
||||
echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file
|
||||
echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
|
||||
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
|
||||
cd $DIR/$build_dir/build
|
||||
eval $CMAKE_CMD
|
||||
@@ -587,6 +595,9 @@ function main() {
|
||||
|
||||
# mandatory shared libraries common to UE and (e/g)NB
|
||||
|
||||
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
|
||||
echo_info "Building shared libraries common to UE and gNB"
|
||||
|
||||
compilations \
|
||||
$build_dir $config_libconfig_shlib \
|
||||
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
|
||||
@@ -595,14 +606,16 @@ function main() {
|
||||
$build_dir coding \
|
||||
libcoding.so $dbin/libcoding.so
|
||||
|
||||
compilations \
|
||||
$build_dir nasmesh \
|
||||
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
|
||||
compilations \
|
||||
$build_dir nasmesh \
|
||||
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
|
||||
|
||||
compilations \
|
||||
$build_dir rb_tool \
|
||||
rb_tool $dbin/rb_tool
|
||||
cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
|
||||
fi
|
||||
|
||||
compilations \
|
||||
$build_dir rb_tool \
|
||||
rb_tool $dbin/rb_tool
|
||||
cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
|
||||
fi
|
||||
|
||||
if [ "$UE" = 1 ] ; then
|
||||
@@ -848,28 +861,33 @@ function main() {
|
||||
echo_info "liboai_device.so is not linked to any device library"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
#build simulators devices
|
||||
echo_info "Compiling rfsimulator"
|
||||
compilations \
|
||||
$build_dir rfsimulator \
|
||||
librfsimulator.so $dbin/librfsimulator.so.$REL
|
||||
|
||||
echo_info "Compiling basicsimulator"
|
||||
compilations \
|
||||
$build_dir tcp_bridge_oai \
|
||||
libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL
|
||||
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
|
||||
echo_info "Compiling rfsimulator"
|
||||
compilations \
|
||||
$build_dir rfsimulator \
|
||||
librfsimulator.so $dbin/librfsimulator.so.$REL
|
||||
|
||||
echo_info "Compiling basicsimulator"
|
||||
compilations \
|
||||
$build_dir tcp_bridge_oai \
|
||||
libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL
|
||||
fi
|
||||
|
||||
#build transport protocol libraries (currently only ETHERNET is available)
|
||||
rm -f liboai_transpro.so
|
||||
rm -f $dbin/liboai_transpro.so
|
||||
compilations \
|
||||
$build_dir oai_eth_transpro \
|
||||
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
|
||||
ln -sf liboai_eth_transpro.so liboai_transpro.so
|
||||
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked to ETHERNET transport"
|
||||
fi
|
||||
if [ "$SKIP_SHARED_LIB_FLAG" = "False" ]; then
|
||||
echo_info "Building transport protocol libraries"
|
||||
rm -f liboai_transpro.so
|
||||
rm -f $dbin/liboai_transpro.so
|
||||
compilations \
|
||||
$build_dir oai_eth_transpro \
|
||||
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
|
||||
ln -sf liboai_eth_transpro.so liboai_transpro.so
|
||||
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
|
||||
echo_info "liboai_transpro.so is linked to ETHERNET transport"
|
||||
fi
|
||||
fi
|
||||
|
||||
###################
|
||||
# Doxygen Support #
|
||||
|
||||
@@ -247,7 +247,8 @@ const char* eurecomVariablesNames[] = {
|
||||
"slot_number_TX0_gNB",
|
||||
"slot_number_TX1_gNB",
|
||||
"slot_number_RX0_gNB",
|
||||
"slot_number_RX1_gNB"
|
||||
"slot_number_RX1_gNB",
|
||||
"ru_tx_ofdm_mask"
|
||||
};
|
||||
|
||||
const char* eurecomFunctionsNames[] = {
|
||||
@@ -328,6 +329,13 @@ const char* eurecomFunctionsNames[] = {
|
||||
"phy_procedures_ru_feptx_ofdm7",
|
||||
"phy_procedures_ru_feptx_ofdm8",
|
||||
"phy_procedures_ru_feptx_ofdm9",
|
||||
"phy_procedures_ru_feptx_ofdm10",
|
||||
"phy_procedures_ru_feptx_ofdm11",
|
||||
"phy_procedures_ru_feptx_ofdm12",
|
||||
"phy_procedures_ru_feptx_ofdm13",
|
||||
"phy_procedures_ru_feptx_ofdm14",
|
||||
"phy_procedures_ru_feptx_ofdm15",
|
||||
"phy_procedures_ru_feptx_ofdm16",
|
||||
"phy_procedures_ru_feptx_prec0",
|
||||
"phy_procedures_ru_feptx_prec1",
|
||||
"phy_procedures_ru_feptx_prec2",
|
||||
@@ -502,6 +510,7 @@ const char* eurecomFunctionsNames[] = {
|
||||
"pdcch_interleaving",
|
||||
"pdcch_tx",
|
||||
/*NR softmodem signal*/
|
||||
"wakeup_txfh",
|
||||
"gNB_thread_rxtx0",
|
||||
"gNB_thread_rxtx1"
|
||||
};
|
||||
|
||||
@@ -225,6 +225,7 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB,
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK,
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_VARIABLES_END
|
||||
@@ -309,6 +310,13 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM7,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM8,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM9,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM10,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM11,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM12,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM13,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM14,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM15,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM16,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC2,
|
||||
@@ -494,6 +502,7 @@ typedef enum {
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
|
||||
|
||||
/*NR softmodem signal*/
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0,
|
||||
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1,
|
||||
|
||||
|
||||
@@ -73,10 +73,10 @@ typedef struct {
|
||||
} T_cache_t;
|
||||
|
||||
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_FUNCTIONS (237)//(232)
|
||||
#define VCD_NUM_FUNCTIONS (245)
|
||||
|
||||
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_NUM_VARIABLES (185)
|
||||
#define VCD_NUM_VARIABLES (186)
|
||||
|
||||
/* first VCD function (to be kept up to date! see in T_messages.txt) */
|
||||
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
|
||||
|
||||
@@ -2050,6 +2050,11 @@ ID = VCD_VARIABLE_SLOT_NUMBER_RX1_GNB
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = slot_number_RX1_gNB
|
||||
ID = VCD_VARIABLE_RU_TX_OFDM_MASK
|
||||
DESC = VCD variable RU_TX_OFDM_MASK
|
||||
GROUP = ALL:VCD:ENB:VCD_VARIABLE
|
||||
FORMAT = ulong,value
|
||||
VCD_NAME = ru_tx_ofdm_mask
|
||||
|
||||
#functions
|
||||
|
||||
@@ -2418,6 +2423,41 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM9
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm9
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM10
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM10
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm10
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM11
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM11
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm11
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM12
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM12
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm12
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM13
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM13
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm13
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM14
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM14
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm14
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM15
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM15
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm15
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM16
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM16
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = phy_procedures_ru_feptx_ofdm16
|
||||
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC
|
||||
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
@@ -3230,6 +3270,11 @@ ID = VCD_FUNCTION_PDCCH_TX
|
||||
VCD_NAME = pdcch_tx
|
||||
|
||||
#function for gNB
|
||||
ID = VCD_FUNCTION_WAKEUP_TXFH
|
||||
DESC = VCD function WAKEUP_TXFH
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
FORMAT = int,value
|
||||
VCD_NAME = wakeup_txfh
|
||||
ID = VCD_FUNCTION_gNB_PROC_RXTX0
|
||||
DESC = VCD function gNB_PROC_RXTX0
|
||||
GROUP = ALL:VCD:ENB:VCD_FUNCTION
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/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"
|
||||
@@ -290,6 +290,8 @@ static void *gNB_L1_thread_tx(void *param) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,slot_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,frame_tx);
|
||||
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, 1 );
|
||||
pthread_mutex_lock( &L1_proc_tx->mutex );
|
||||
L1_proc_tx->instance_cnt = -1;
|
||||
|
||||
@@ -301,6 +303,7 @@ static void *gNB_L1_thread_tx(void *param) {
|
||||
pthread_mutex_unlock(&L1_proc_tx->mutex);
|
||||
|
||||
wakeup_txfh(gNB,L1_proc_tx,frame_tx,slot_tx,timestamp_tx);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, 0 );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 );
|
||||
}
|
||||
|
||||
@@ -420,10 +423,10 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
|
||||
|
||||
// note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,1);
|
||||
waitret=timedwait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh",1000000);
|
||||
waitret=wait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh");
|
||||
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,0);
|
||||
|
||||
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
|
||||
|
||||
if (waitret == ETIMEDOUT) {
|
||||
@@ -448,7 +451,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
|
||||
ru = gNB->RU_list[i];
|
||||
ru_proc = &ru->proc;
|
||||
|
||||
AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_gNBs))==0,"ERROR pthread_mutex_lock failed on mutex_gNBs L1_thread_tx with ret=%d\n",ret);
|
||||
//AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_gNBs))==0,"ERROR pthread_mutex_lock failed on mutex_gNBs L1_thread_tx with ret=%d\n",ret);
|
||||
|
||||
if (ru_proc->instance_cnt_gNBs == 0) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 1);
|
||||
@@ -456,7 +459,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
|
||||
AssertFatal((ret=pthread_mutex_lock(&gNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
|
||||
gNB->proc.RU_mask_tx = 0;
|
||||
AssertFatal((ret=pthread_mutex_unlock(&gNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
|
||||
AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_gNBs ))==0,"mutex_unlock return %d\n",ret);
|
||||
//AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_gNBs ))==0,"mutex_unlock return %d\n",ret);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 0);
|
||||
return(-1);
|
||||
@@ -522,6 +525,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
|
||||
RU_proc_t *ru_proc=&ru->proc;
|
||||
int ret;
|
||||
int i;
|
||||
struct timespec abstime;
|
||||
int time_ns = 50000;
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret);
|
||||
for (i=0;i<gNB->num_RU;i++) {
|
||||
@@ -542,14 +547,22 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret);
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &abstime);
|
||||
abstime.tv_nsec = abstime.tv_nsec + time_ns;
|
||||
|
||||
if (abstime.tv_nsec >= 1000*1000*1000) {
|
||||
abstime.tv_nsec -= 1000*1000*1000;
|
||||
abstime.tv_sec += 1;
|
||||
}
|
||||
|
||||
// wake up TX for subframe n+sl_ahead
|
||||
// lock the TX mutex and make sure the thread is ready
|
||||
AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex)) == 0,"mutex_lock returns %d\n", ret);
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/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"
|
||||
@@ -91,7 +91,8 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
/* these variables have to be defined before including ENB_APP/enb_paramdef.h and GNB_APP/gnb_paramdef.h */
|
||||
static int DEFBANDS[] = {7};
|
||||
static int DEFENBS[] = {0};
|
||||
|
||||
static int DEFBFW[] = {0x00007fff};
|
||||
|
||||
//static int DEFNRBANDS[] = {7};
|
||||
//static int DEFGNBS[] = {0};
|
||||
|
||||
@@ -677,9 +678,6 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_slot*fp->slots_per_frame))&1023;
|
||||
proc->tti_rx = (proc->timestamp_rx / fp->samples_per_slot)%fp->slots_per_frame;
|
||||
// synchronize first reception to frame 0 subframe 0
|
||||
proc->timestamp_tx = proc->timestamp_rx+(sl_ahead*fp->samples_per_slot);
|
||||
proc->tti_tx = (proc->tti_rx+sl_ahead)%fp->slots_per_frame;
|
||||
proc->frame_tx = (proc->tti_rx>(fp->slots_per_frame-1-sl_ahead)) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
|
||||
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
|
||||
ru->idx,
|
||||
0,
|
||||
@@ -764,18 +762,22 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
|
||||
|
||||
for (i=0; i<ru->nb_tx; i++)
|
||||
for (i=0; i<ru->nb_tx; i++){
|
||||
txp[i] = (void *)&ru->common.txdata[i][(slot*fp->samples_per_slot)-sf_extension];
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
|
||||
// prepare tx buffer pointers
|
||||
start_meas(&ru->tx_fhaul);
|
||||
txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
|
||||
timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
|
||||
txp,
|
||||
siglen+sf_extension,
|
||||
ru->nb_tx,
|
||||
flags);
|
||||
stop_meas(&ru->tx_fhaul);
|
||||
LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, subframe %d\n",ru->idx,
|
||||
(long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
@@ -784,6 +786,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* \brief The Asynchronous RX/TX FH thread of RAU/RCC/gNB/RRU.
|
||||
* This handles the RX FH for an asynchronous RRU/UE
|
||||
@@ -872,7 +875,7 @@ static void *ru_thread_prach( void *param ) {
|
||||
0,0
|
||||
);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 ); */
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 0 );*/
|
||||
if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
|
||||
}
|
||||
|
||||
@@ -1209,14 +1212,20 @@ static void *ru_stats_thread(void *param) {
|
||||
sleep(1);
|
||||
|
||||
if (opp_enabled == 1) {
|
||||
|
||||
if (ru->feprx) print_meas(&ru->ofdm_demod_stats,"feprx",NULL,NULL);
|
||||
|
||||
if (ru->feptx_ofdm) print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
|
||||
if (ru->feptx_ofdm){
|
||||
print_meas(&ru->precoding_stats,"feptx_prec",NULL,NULL);
|
||||
print_meas(&ru->txdataF_copy_stats,"txdataF_copy",NULL,NULL);
|
||||
print_meas(&ru->ofdm_mod_stats,"feptx_ofdm",NULL,NULL);
|
||||
print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL);
|
||||
}
|
||||
|
||||
if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
|
||||
|
||||
if (ru->fh_north_out) {
|
||||
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
|
||||
if (ru->fh_north_out) {
|
||||
print_meas(&ru->compression,"compression",NULL,NULL);
|
||||
print_meas(&ru->transport,"transport",NULL,NULL);
|
||||
}
|
||||
@@ -1273,7 +1282,7 @@ static void *ru_thread_tx( void *param ) {
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru,frame_tx,tti_tx);
|
||||
|
||||
// do OFDM if needed
|
||||
// do OFDM with/without TX front-end processing if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,frame_tx,tti_tx);
|
||||
|
||||
if(!emulate_rf) {
|
||||
@@ -1284,8 +1293,17 @@ static void *ru_thread_tx( void *param ) {
|
||||
} else {
|
||||
if(proc->frame_tx == print_frame) {
|
||||
for (i=0; i<ru->nb_tx; i++) {
|
||||
sprintf(filename,"tx%ddataF_frame%d_sl%d.m", i, print_frame, proc->tti_tx);
|
||||
LOG_M(filename,"txdataF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1);
|
||||
|
||||
if(proc->tti_tx == 0) {
|
||||
sprintf(filename,"gNBdataF_frame%d_sl%d.m", print_frame, proc->tti_tx);
|
||||
LOG_M(filename,"txdataF_frame",&ru->gNB_list[0]->common_vars.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
|
||||
|
||||
sprintf(filename,"tx%ddataF_frame%d_sl%d.m", i, print_frame, proc->tti_tx);
|
||||
LOG_M(filename,"txdataF_frame",&ru->common.txdataF[i][0],fp->samples_per_frame_wCP, 1, 1);
|
||||
|
||||
sprintf(filename,"tx%ddataF_BF_frame%d_sl%d.m", i, print_frame, proc->tti_tx);
|
||||
LOG_M(filename,"txdataF_BF_frame",&ru->common.txdataF_BF[i][0],fp->samples_per_subframe_wCP, 1, 1);
|
||||
}
|
||||
|
||||
if(proc->tti_tx == 9) {
|
||||
sprintf(filename,"tx%ddata_frame%d.m", i, print_frame);
|
||||
@@ -1338,14 +1356,14 @@ static void *ru_thread_tx( void *param ) {
|
||||
ret = pthread_mutex_lock(&L1_proc->mutex_RUs_tx);
|
||||
AssertFatal(ret == 0,"mutex_lock returns %d\n",ret);
|
||||
// the thread can now be woken up
|
||||
if (L1_proc->instance_cnt_RUs==-1) {
|
||||
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
|
||||
//if (L1_proc->instance_cnt_RUs == -1) {
|
||||
L1_proc->instance_cnt_RUs = 0;
|
||||
AssertFatal(pthread_cond_signal(&L1_proc->cond_RUs) == 0,
|
||||
"ERROR pthread_cond_signal for gNB_L1_thread\n");
|
||||
} //else AssertFatal(1==0,"gNB TX thread is not ready\n");
|
||||
L1_proc->instance_cnt_RUs = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
|
||||
//} //else AssertFatal(1==0,"gNB TX thread is not ready\n");
|
||||
ret = pthread_mutex_unlock(&L1_proc->mutex_RUs_tx);
|
||||
AssertFatal(ret == 0,"mutex_unlock returns %d\n",ret);
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,L1_proc->instance_cnt_RUs);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1507,7 +1525,7 @@ static void *ru_thread( void *param ) {
|
||||
// do TX front-end processing if needed (precoding and/or IDFTs)
|
||||
if (ru->feptx_prec) ru->feptx_prec(ru,proc->frame_tx,proc->tti_tx);
|
||||
|
||||
// do OFDM if needed
|
||||
// do OFDM with/without TX front-end processing if needed
|
||||
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx);
|
||||
|
||||
if(!emulate_rf) {
|
||||
@@ -1646,6 +1664,7 @@ int stop_rf(RU_t *ru) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void init_RU_proc(RU_t *ru) {
|
||||
int i=0;
|
||||
RU_proc_t *proc;
|
||||
@@ -1668,6 +1687,7 @@ void init_RU_proc(RU_t *ru) {
|
||||
proc->frame_offset = 0;
|
||||
proc->num_slaves = 0;
|
||||
proc->frame_tx_unwrap = 0;
|
||||
proc->feptx_mask = 0;
|
||||
|
||||
for (i=0; i<10; i++) proc->symbol_mask[i]=0;
|
||||
|
||||
@@ -2025,9 +2045,9 @@ void set_function_spec_param(RU_t *ru) {
|
||||
malloc_IF4p5_buffer(ru);
|
||||
} else if (ru->function == gNodeB_3GPP) {
|
||||
ru->do_prach = 0; // no prach processing in RU
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // this is fep with idft and precoding
|
||||
ru->feptx_prec = NULL; // this is fep with idft and precoding
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // RX DFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // this is fep with idft and precoding
|
||||
ru->feptx_prec = (get_thread_worker_conf() == WORKER_ENABLE) ? NULL : nr_feptx_prec; // this is fep with idft and precoding
|
||||
ru->fh_north_in = NULL; // no incoming fronthaul from north
|
||||
ru->fh_north_out = NULL; // no outgoing fronthaul to north
|
||||
ru->nr_start_if = NULL; // no if interface
|
||||
@@ -2055,8 +2075,8 @@ void set_function_spec_param(RU_t *ru) {
|
||||
|
||||
case REMOTE_IF5: // the remote unit is IF5 RRU
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // this is frequency-shift + DFTs
|
||||
ru->feptx_prec = feptx_prec; // need to do transmit Precoding + IDFTs
|
||||
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_fep_full_2thread : nr_fep_full; // this is frequency-shift + DFTs
|
||||
ru->feptx_prec = (get_thread_worker_conf() == WORKER_ENABLE) ? NULL : nr_feptx_prec; // need to do transmit Precoding + IDFTs
|
||||
ru->feptx_ofdm = (get_thread_worker_conf() == WORKER_ENABLE) ? nr_feptx_ofdm_2thread : nr_feptx_ofdm; // need to do transmit Precoding + IDFTs
|
||||
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
|
||||
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
|
||||
@@ -2080,7 +2100,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
case REMOTE_IF4p5:
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = NULL; // DFTs
|
||||
ru->feptx_prec = feptx_prec; // Precoding operation
|
||||
ru->feptx_prec = (get_thread_worker_conf() == WORKER_ENABLE) ? NULL : nr_feptx_prec; // Precoding operation
|
||||
ru->feptx_ofdm = NULL; // no OFDM mod
|
||||
ru->fh_south_in = fh_if4p5_south_in; // synchronous IF4p5 reception
|
||||
ru->fh_south_out = fh_if4p5_south_out; // synchronous IF4p5 transmission
|
||||
@@ -2334,6 +2354,14 @@ void RCconfig_RU(void)
|
||||
RC.ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr);
|
||||
RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
|
||||
RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
|
||||
RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
|
||||
for (i=0; i<RC.ru[j]->num_gNB; i++) {
|
||||
RC.ru[j]->bw_list[i] = (int32_t *)malloc16_clear((RC.ru[j]->nb_bfw)*sizeof(int32_t));
|
||||
for (int b=0; b<RC.ru[j]->nb_bfw; b++) RC.ru[j]->bw_list[i][b] = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].iptr[b];
|
||||
}
|
||||
}
|
||||
}// j=0..num_rus
|
||||
} else {
|
||||
RC.nb_RU = 0;
|
||||
|
||||
@@ -461,6 +461,15 @@ void UE_processing(void *arg) {
|
||||
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
|
||||
PHY_VARS_NR_UE *UE = rxtxD->UE;
|
||||
processSlotRX(UE, proc);
|
||||
uint8_t gNB_id = 0;
|
||||
|
||||
// params for UL time alignment procedure
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &UE->ul_time_alignment[gNB_id];
|
||||
uint8_t numerology = UE->frame_parms.numerology_index;
|
||||
uint16_t bwp_ul_NB_RB = UE->frame_parms.N_RB_UL;
|
||||
int slot_tx = proc->nr_tti_tx;
|
||||
int frame_tx = proc->frame_tx;
|
||||
|
||||
//printf(">>> mac ended\n");
|
||||
// Prepare the future Tx data
|
||||
/*
|
||||
@@ -473,6 +482,21 @@ void UE_processing(void *arg) {
|
||||
#endif
|
||||
*/
|
||||
|
||||
/* UL time alignment
|
||||
// If the current tx frame and slot match the TA configuration in ul_time_alignment
|
||||
// then timing advance is processed and set to be applied in the next UL transmission */
|
||||
if (UE->mac_enabled == 1) {
|
||||
|
||||
if (frame_tx == ul_time_alignment->ta_frame && slot_tx == ul_time_alignment->ta_slot){
|
||||
LOG_D(PHY,"Applying timing advance -- frame %d -- slot %d\n", frame_tx, slot_tx);
|
||||
|
||||
//if (nfapi_mode!=3){
|
||||
nr_process_timing_advance(UE->Mod_id, UE->CC_id, ul_time_alignment->ta_command, numerology, bwp_ul_NB_RB);
|
||||
ul_time_alignment->ta_frame = -1;
|
||||
ul_time_alignment->ta_slot = -1;
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD){
|
||||
|
||||
@@ -480,7 +504,7 @@ void UE_processing(void *arg) {
|
||||
|
||||
|
||||
if (UE->mode != loop_through_memory)
|
||||
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
|
||||
phy_procedures_nrUE_TX(UE,proc,gNB_id,thread_id);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -74,6 +74,10 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
}
|
||||
|
||||
|
||||
// allocate precoding input buffers (TX)
|
||||
ru->common.txdataF = (int32_t **)malloc16(15*sizeof(int32_t*));
|
||||
for(i=0; i< 15; ++i) ru->common.txdataF[i] = (int32_t*)malloc16_clear(fp->samples_per_frame_wCP*sizeof(int32_t)); // [hna] samples_per_frame without CP
|
||||
|
||||
// allocate IFFT input buffers (TX)
|
||||
ru->common.txdataF_BF = (int32_t **)malloc16(ru->nb_tx*sizeof(int32_t*));
|
||||
LOG_I(PHY,"[INIT] common.txdata_BF= %p (%lu bytes)\n",ru->common.txdataF_BF,
|
||||
@@ -105,37 +109,33 @@ int nr_phy_init_RU(RU_t *ru) {
|
||||
RC.nb_nr_L1_inst,NUMBER_OF_gNB_MAX);
|
||||
|
||||
LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst);
|
||||
|
||||
for (i=0; i<RC.nb_nr_L1_inst; i++) {
|
||||
for (p=0;p<15;p++) {
|
||||
if (p == 0|| p==5) {
|
||||
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
|
||||
for (j=0; j<ru->nb_tx; j++) {
|
||||
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
// antenna ports 0-3 are mapped on antennas 0-3
|
||||
// antenna port 4 is mapped on antenna 0
|
||||
// antenna ports 5-14 are mapped on all antennas
|
||||
if (((p<4) && (p==j)) || ((p==4) && (j==0))) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
{
|
||||
ru->beam_weights[i][p][j][re] = 0x00007fff;
|
||||
|
||||
//LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d][%d][%d] = %d\n", i,p,j,re,ru->beam_weights[i][p][j][re]);
|
||||
}
|
||||
}
|
||||
else if (p>4) {
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
{
|
||||
ru->beam_weights[i][p][j][re] = 0x00007fff/ru->nb_tx;
|
||||
//LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d][%d][%d] = %d\n", i,p,j,re,ru->beam_weights[i][p][j][re]);
|
||||
}
|
||||
}
|
||||
//LOG_D(PHY,"[INIT] lte_common_vars->beam_weights[%d][%d] = %p (%lu bytes)\n", i,j,ru->beam_weights[i][p][j], fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
} // for (j=0
|
||||
} // if (p<ru
|
||||
} // for p
|
||||
} //for i
|
||||
|
||||
int beam_count = 0;
|
||||
if (ru->nb_tx>1) {
|
||||
for (p=0;p<fp->Lmax;p++) {
|
||||
if ((fp->L_ssb >> p) & 0x01)
|
||||
beam_count++;
|
||||
}
|
||||
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
|
||||
|
||||
int l_ind = 0;
|
||||
for (i=0; i<RC.nb_nr_L1_inst; i++) {
|
||||
for (p=0;p<fp->Lmax;p++) {
|
||||
if ((fp->L_ssb >> p) & 0x01) {
|
||||
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
|
||||
for (j=0; j<ru->nb_tx; j++) {
|
||||
ru->beam_weights[i][p][j] = (int32_t *)malloc16_clear(fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
for (re=0; re<fp->ofdm_symbol_size; re++)
|
||||
ru->beam_weights[i][p][j][re] = ru->bw_list[i][l_ind];
|
||||
//printf("Beam Weight %08x for beam %d and tx %d\n",ru->bw_list[i][l_ind],p,j);
|
||||
l_ind++;
|
||||
} // for j
|
||||
} // for p
|
||||
}
|
||||
} //for i
|
||||
}
|
||||
} // !=IF5
|
||||
|
||||
ru->common.sync_corr = (uint32_t*)malloc16_clear( LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*sizeof(uint32_t)*fp->samples_per_subframe_wCP );
|
||||
|
||||
return(0);
|
||||
@@ -162,6 +162,10 @@ void nr_phy_free_RU(RU_t *ru)
|
||||
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata_7_5kHz[i]);
|
||||
free_and_zero(ru->common.rxdata_7_5kHz);
|
||||
|
||||
// free beamforming input buffers (TX)
|
||||
for (i = 0; i < 15; i++) free_and_zero(ru->common.txdataF[i]);
|
||||
free_and_zero(ru->common.txdataF);
|
||||
|
||||
// free IFFT input buffers (TX)
|
||||
for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdataF_BF[i]);
|
||||
free_and_zero(ru->common.txdataF_BF);
|
||||
@@ -179,10 +183,8 @@ void nr_phy_free_RU(RU_t *ru)
|
||||
|
||||
for (i = 0; i < RC.nb_nr_L1_inst; i++) {
|
||||
for (p = 0; p < 15; p++) {
|
||||
if (p == 0 || p == 5) {
|
||||
for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
|
||||
free_and_zero(ru->beam_weights[i][p]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -703,11 +703,21 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
ue->pusch_config.pusch_TimeDomainResourceAllocation[i]->mappingType = typeA;
|
||||
}
|
||||
|
||||
for (i=0;i<MAX_NR_OF_DL_ALLOCATIONS;i++){
|
||||
ue->PDSCH_Config.pdsch_TimeDomainResourceAllocation[i] = (NR_PDSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
|
||||
ue->PDSCH_Config.pdsch_TimeDomainResourceAllocation[i]->mappingType = typeA;
|
||||
}
|
||||
|
||||
//------------- config DMRS parameters--------------//
|
||||
ue->dmrs_UplinkConfig.pusch_dmrs_type = pusch_dmrs_type1;
|
||||
ue->dmrs_UplinkConfig.pusch_dmrs_AdditionalPosition = pusch_dmrs_pos0;
|
||||
ue->dmrs_UplinkConfig.pusch_maxLength = pusch_len1;
|
||||
//-------------------------------------------------//
|
||||
ue->dmrs_DownlinkConfig.pdsch_dmrs_type = pdsch_dmrs_type1;
|
||||
ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition = pdsch_dmrs_pos0;
|
||||
ue->dmrs_DownlinkConfig.pdsch_maxLength = pdsch_len1;
|
||||
//-------------------------------------------------//
|
||||
|
||||
ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
|
||||
pusch_dmrs = ue->nr_gold_pusch_dmrs;
|
||||
n_scid = 0; // This quantity is indicated by higher layer parameter dmrs-SeqInitialization
|
||||
|
||||
@@ -273,15 +273,18 @@ int nr_init_frame_parms0(NR_DL_FRAME_PARMS *fp,
|
||||
fp->freq_range = (fp->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2;
|
||||
|
||||
// definition of Lmax according to ts 38.213 section 4.1
|
||||
if (fp->dl_CarrierFreq < 6e9){
|
||||
if(fp->frame_type && (fp->ssb_type==2))
|
||||
fp->Lmax = (fp->dl_CarrierFreq < 2.4e9)? 4 : 8;
|
||||
else
|
||||
fp->Lmax = (fp->dl_CarrierFreq < 3e9)? 4 : 8;
|
||||
}
|
||||
else
|
||||
if (fp->dl_CarrierFreq < 6e9) {
|
||||
if(fp->frame_type && (fp->ssb_type==2))
|
||||
fp->Lmax = (fp->dl_CarrierFreq < 2.4e9)? 4 : 8;
|
||||
else
|
||||
fp->Lmax = (fp->dl_CarrierFreq < 3e9)? 4 : 8;
|
||||
} else {
|
||||
fp->Lmax = 64;
|
||||
}
|
||||
|
||||
fp->N_ssb = 0;
|
||||
for (int p=0; p<fp->Lmax; p++)
|
||||
fp->N_ssb += ((fp->L_ssb >> p) & 0x01);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "PHY/CODING/lte_interleaver_inline.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_eNB.h"
|
||||
#include "modulation_eNB.h"
|
||||
#include "nr_modulation.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
int beam_precoding(int32_t **txdataF,
|
||||
@@ -135,3 +136,33 @@ int beam_precoding_one_eNB(int32_t **txdataF,
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int nr_beam_precoding(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t ***beam_weights,
|
||||
int slot,
|
||||
int symbol,
|
||||
int aa,
|
||||
int nb_antenna_ports)
|
||||
{
|
||||
|
||||
|
||||
uint8_t p;
|
||||
|
||||
// clear txdata_BF[aa][re] for each call of ue_spec_beamforming
|
||||
memset(&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],0,sizeof(int32_t)*(frame_parms->ofdm_symbol_size));
|
||||
|
||||
for (p=0; p<nb_antenna_ports; p++) {
|
||||
if ((frame_parms->L_ssb >> p) & 0x01) {
|
||||
multadd_cpx_vector((int16_t*)&txdataF[p][symbol*frame_parms->ofdm_symbol_size],
|
||||
(int16_t*)beam_weights[p][aa],
|
||||
(int16_t*)&txdataF_BF[aa][symbol*frame_parms->ofdm_symbol_size],
|
||||
0,
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -93,4 +93,14 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
*/
|
||||
void nr_dft(int32_t *z,int32_t *d, uint32_t Msc_PUSCH);
|
||||
|
||||
int nr_beam_precoding(int32_t **txdataF,
|
||||
int32_t **txdataF_BF,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t ***beam_weights,
|
||||
int slot,
|
||||
int symbol,
|
||||
int aa,
|
||||
int nb_antenna_ports
|
||||
);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -86,6 +86,8 @@ void PHY_ofdm_mod(int *input, /// pointer to complex input
|
||||
)
|
||||
{
|
||||
|
||||
if(nb_symbols == 0) return;
|
||||
|
||||
short temp[4096*4] __attribute__((aligned(32)));
|
||||
unsigned short i,j;
|
||||
short k;
|
||||
|
||||
@@ -45,7 +45,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
int16_t *fl,*fm,*fr,*fml,*fmr,*fmm,*fdcl,*fdcr,*fdclh,*fdcrh;
|
||||
int ch_offset,symbol_offset, length_dmrs, UE_id = 0;
|
||||
unsigned short n_idDMRS[2] = {0,1}; //to update from pusch config
|
||||
int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(16)));
|
||||
int32_t temp_in_ifft_0[8192*2] __attribute__((aligned(32)));
|
||||
int32_t **ul_ch_estimates_time = gNB->pusch_vars[UE_id]->ul_ch_estimates_time;
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
@@ -267,7 +267,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
|
||||
|
||||
|
||||
// check if PRB crosses DC and improve estimates around DC
|
||||
if ((bwp_start_subcarrier >= gNB->frame_parms.ofdm_symbol_size/2) && (bwp_start_subcarrier+nb_rb_pusch*12 >= gNB->frame_parms.ofdm_symbol_size)) {
|
||||
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;
|
||||
|
||||
@@ -90,6 +90,7 @@ uint8_t nr_generate_pdsch(NR_gNB_DLSCH_t *dlsch,
|
||||
uint8_t Qm = rel15->modulation_order;
|
||||
uint32_t encoded_length = nb_symbols*Qm;
|
||||
|
||||
|
||||
/// CRC, coding, interleaving and rate matching
|
||||
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
|
||||
start_meas(dlsch_encoding_stats);
|
||||
@@ -206,7 +207,6 @@ for (int i=0; i<n_dmrs>>4; i++) {
|
||||
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_symbols %d)\n",
|
||||
start_sc, rel15->start_symbol, rel15->n_prb, rel15->nb_symbols);
|
||||
#endif
|
||||
|
||||
for (int ap=0; ap<rel15->nb_layers; ap++) {
|
||||
|
||||
// DMRS params for this ap
|
||||
@@ -221,6 +221,7 @@ ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime[0], l0, dmrs_symbol);
|
||||
#endif
|
||||
uint8_t k_prime=0;
|
||||
uint16_t m=0, n=0, dmrs_idx=0, k=0;
|
||||
int txdataF_offset = (slot%2)*frame_parms->samples_per_slot_wCP;
|
||||
if (dmrs_type == NFAPI_NR_DMRS_TYPE1) // another if condition to be included to check pdsch config type (reference of k)
|
||||
dmrs_idx = rel15->start_prb*6;
|
||||
else
|
||||
@@ -230,12 +231,12 @@ ap, Wt[0], Wt[1], Wf[0], Wf[1], delta, l_prime[0], l0, dmrs_symbol);
|
||||
k = start_sc;
|
||||
for (int i=0; i<rel15->n_prb*NR_NB_SC_PER_RB; i++) {
|
||||
if ((l == dmrs_symbol) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_type))%(frame_parms->ofdm_symbol_size)))) {
|
||||
((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime[0]]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
|
||||
dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1],
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
|
||||
dmrs_idx, l, k, k_prime, n, ((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
|
||||
dmrs_idx++;
|
||||
k_prime++;
|
||||
@@ -245,12 +246,12 @@ dmrs_idx, l, k, k_prime, n, ((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_
|
||||
|
||||
else {
|
||||
|
||||
((int16_t*)txdataF[ap])[(l*frame_parms->ofdm_symbol_size + k)<<1] = (amp * tx_layers[ap][m<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1] = (amp * tx_layers[ap][(m<<1) + 1]) >> 15;
|
||||
((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],
|
||||
((int16_t*)txdataF[ap])[((l*frame_parms->ofdm_symbol_size + k)<<1) + 1]);
|
||||
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++;
|
||||
}
|
||||
|
||||
@@ -874,7 +874,7 @@ int nr_pdsch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
//}
|
||||
|
||||
// check if PRB crosses DC and improve estimates around DC
|
||||
if ((bwp_start_subcarrier >= ue->frame_parms.ofdm_symbol_size/2) && (bwp_start_subcarrier+nb_rb_pdsch*12 >= ue->frame_parms.ofdm_symbol_size)) {
|
||||
if ((bwp_start_subcarrier < ue->frame_parms.ofdm_symbol_size) && (bwp_start_subcarrier+nb_rb_pdsch*12 >= ue->frame_parms.ofdm_symbol_size)) {
|
||||
dl_ch = (int16_t *)&dl_ch_estimates[aarx][ch_offset];
|
||||
uint16_t idxDC = 2*(ue->frame_parms.ofdm_symbol_size - bwp_start_subcarrier);
|
||||
uint16_t idxPil = idxDC/2;
|
||||
|
||||
@@ -614,7 +614,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
rx_ind.number_pdus = 1; //rx_ind.number_pdus++;
|
||||
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication);
|
||||
ue->if_inst->dl_indication(&dl_indication, NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -104,6 +104,10 @@ typedef struct {
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..]
|
||||
int32_t **txdataF_BF;
|
||||
/// \brief holds the transmit data before beamforming in the frequency domain.
|
||||
/// - first index: tx antenna [0..nb_antennas_tx[
|
||||
/// - second index: sample [0..]
|
||||
int32_t **txdataF;
|
||||
/// \brief holds the transmit data before beamforming for epdcch/mpdcch
|
||||
/// - first index : tx antenna [0..nb_epdcch_antenna_ports[
|
||||
/// - second index: sampl [0..]
|
||||
@@ -147,6 +151,44 @@ typedef struct {
|
||||
} RU_CALIBRATION;
|
||||
|
||||
|
||||
typedef struct RU_prec_t_s{
|
||||
/// \internal This variable is protected by \ref mutex_feptx_prec
|
||||
int instance_cnt_feptx_prec;
|
||||
/// pthread struct for RU TX FEP PREC worker thread
|
||||
pthread_t pthread_feptx_prec;
|
||||
/// pthread attributes for worker feptx prec thread
|
||||
pthread_attr_t attr_feptx_prec;
|
||||
/// condition varible for RU TX FEP PREC thread
|
||||
pthread_cond_t cond_feptx_prec;
|
||||
/// mutex for fep PREC TX worker thread
|
||||
pthread_mutex_t mutex_feptx_prec;
|
||||
int symbol;
|
||||
int p;//logical
|
||||
int aa;//physical MAX nb_tx
|
||||
struct RU_t_s *ru;
|
||||
int index;
|
||||
} RU_prec_t;
|
||||
|
||||
typedef struct RU_feptx_t_s{
|
||||
/// \internal This variable is protected by \ref mutex_feptx_prec
|
||||
int instance_cnt_feptx;
|
||||
/// pthread struct for RU TX FEP PREC worker thread
|
||||
pthread_t pthread_feptx;
|
||||
/// pthread attributes for worker feptx prec thread
|
||||
pthread_attr_t attr_feptx;
|
||||
/// condition varible for RU TX FEP PREC thread
|
||||
pthread_cond_t cond_feptx;
|
||||
/// mutex for fep PREC TX worker thread
|
||||
pthread_mutex_t mutex_feptx;
|
||||
struct RU_t_s *ru;
|
||||
int aa;//physical MAX nb_tx
|
||||
int half_slot;//first or second half of a slot
|
||||
int slot;//current slot
|
||||
int symbol;//current symbol
|
||||
int nb_antenna_ports;//number of logical port
|
||||
int index;
|
||||
}RU_feptx_t;
|
||||
|
||||
typedef struct RU_proc_t_s {
|
||||
/// Pointer to associated RU descriptor
|
||||
struct RU_t_s *ru;
|
||||
@@ -339,8 +381,14 @@ typedef struct RU_proc_t_s {
|
||||
int ru_rx_ready;
|
||||
int ru_tx_ready;
|
||||
int emulate_rf_busy;
|
||||
} RU_proc_t;
|
||||
|
||||
/// structure for precoding thread
|
||||
RU_prec_t prec[16];
|
||||
/// structure for feptx thread
|
||||
RU_feptx_t feptx[16];
|
||||
/// mask for checking process finished
|
||||
int feptx_mask;
|
||||
} RU_proc_t;
|
||||
|
||||
typedef enum {
|
||||
LOCAL_RF =0,
|
||||
@@ -495,10 +543,16 @@ typedef struct RU_t_s {
|
||||
void (*eNB_top)(struct PHY_VARS_eNB_s *eNB, int frame_rx, int subframe_rx, char *string, struct RU_t_s *ru);
|
||||
void (*gNB_top)(struct PHY_VARS_gNB_s *gNB, int frame_rx, int slot_rx, char *string, struct RU_t_s *ru);
|
||||
|
||||
/// Timing data copy statistics (TX)
|
||||
time_stats_t txdataF_copy_stats;
|
||||
/// Timing statistics (TX)
|
||||
time_stats_t precoding_stats;
|
||||
/// Timing statistics
|
||||
time_stats_t ofdm_demod_stats;
|
||||
/// Timing statistics (TX)
|
||||
time_stats_t ofdm_mod_stats;
|
||||
/// Timing statistics (TX)
|
||||
time_stats_t ofdm_total_stats;
|
||||
/// Timing wait statistics
|
||||
time_stats_t ofdm_demod_wait_stats;
|
||||
/// Timing wakeup statistics
|
||||
@@ -518,10 +572,12 @@ typedef struct RU_t_s {
|
||||
/// RX and TX buffers for precoder output
|
||||
RU_COMMON common;
|
||||
RU_CALIBRATION calibration;
|
||||
/// beamforming weight vectors per eNB
|
||||
/// beamforming weight list size
|
||||
int nb_bfw;
|
||||
/// beamforming weight list of values
|
||||
int32_t *bw_list[NUMBER_OF_eNB_MAX+1];
|
||||
/// beamforming weight vectors
|
||||
int32_t **beam_weights[NUMBER_OF_eNB_MAX+1][15];
|
||||
/// beamforming weight vectors per gNB
|
||||
int32_t **nrbeam_weights[NUMBER_OF_gNB_MAX+1][16];
|
||||
/// received frequency-domain signal for PRACH (IF4p5 RRU)
|
||||
int16_t **prach_rxsigF;
|
||||
/// received frequency-domain signal for PRACH BR (IF4p5 RRU)
|
||||
|
||||
@@ -871,6 +871,16 @@ typedef struct UE_NR_SCAN_INFO_s {
|
||||
int32_t freq_offset_Hz[3][10];
|
||||
} UE_NR_SCAN_INFO_t;
|
||||
|
||||
typedef struct NR_UL_TIME_ALIGNMENT {
|
||||
/// flag used by MAC to inform PHY about a TA to be applied
|
||||
unsigned char apply_ta;
|
||||
/// frame and slot when to apply the TA as stated in TS 38.213 setion 4.2
|
||||
int16_t ta_frame;
|
||||
char ta_slot;
|
||||
/// TA command and TAGID received from the gNB
|
||||
uint8_t ta_command;
|
||||
uint8_t tag_id;
|
||||
} NR_UL_TIME_ALIGNMENT_t;
|
||||
|
||||
#include "NR_IF_Module.h"
|
||||
|
||||
@@ -1066,9 +1076,14 @@ typedef struct {
|
||||
int rx_offset; /// Timing offset
|
||||
int rx_offset_diff; /// Timing adjustment for ofdm symbol0 on HW USRP
|
||||
int time_sync_cell;
|
||||
int timing_advance; ///timing advance signalled from eNB
|
||||
int hw_timing_advance;
|
||||
int N_TA_offset; ///timing offset used in TDD
|
||||
|
||||
/// Timing Advance updates variables
|
||||
/// Timing advance update computed from the TA command signalled from gNB
|
||||
int timing_advance;
|
||||
int hw_timing_advance;
|
||||
int N_TA_offset; ///timing offset used in TDD
|
||||
NR_UL_TIME_ALIGNMENT_t ul_time_alignment[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
/// Flag to tell if UE is secondary user (cognitive mode)
|
||||
unsigned char is_secondary_ue;
|
||||
/// Flag to tell if secondary eNB has channel estimates to create NULL-beams from.
|
||||
|
||||
@@ -319,6 +319,8 @@ typedef struct NR_DL_FRAME_PARMS {
|
||||
uint8_t Lmax;
|
||||
/// SS block pattern (max 64 ssb, each bit is on/off ssb)
|
||||
uint64_t L_ssb;
|
||||
/// Total number of SSB transmitted
|
||||
uint8_t N_ssb;
|
||||
/// PBCH polar encoder params
|
||||
t_nrPolar_params pbch_polar_params;
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "types.h"
|
||||
#include "NR_PDSCH-TimeDomainResourceAllocation.h"
|
||||
|
||||
#ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
|
||||
#define EXTERN
|
||||
@@ -377,8 +378,10 @@ typedef enum {
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////################################
|
||||
#define MAX_NR_RATE_MATCH_PATTERNS 4
|
||||
#define MAX_NR_ZP_CSI_RS_RESOURCES 32
|
||||
#define MAX_NR_RATE_MATCH_PATTERNS 4
|
||||
#define MAX_NR_ZP_CSI_RS_RESOURCES 32
|
||||
#define MAX_NR_OF_DL_ALLOCATIONS 16
|
||||
#define MAX_NR_OF_UL_ALLOCATIONS (16)
|
||||
|
||||
typedef enum{
|
||||
dl_resourceAllocationType0 = 1,
|
||||
@@ -473,6 +476,8 @@ typedef struct {
|
||||
*/
|
||||
maxNrofCodeWordsScheduledByDCI_t maxNrofCodeWordsScheduledByDCI;
|
||||
|
||||
NR_PDSCH_TimeDomainResourceAllocation_t *pdsch_TimeDomainResourceAllocation[MAX_NR_OF_DL_ALLOCATIONS];
|
||||
|
||||
} PDSCH_Config_t;
|
||||
|
||||
/***********************************************************************
|
||||
@@ -483,7 +488,6 @@ typedef struct {
|
||||
*
|
||||
************************************************************************/
|
||||
|
||||
#define MAX_NR_OF_UL_ALLOCATIONS (16)
|
||||
|
||||
typedef enum {
|
||||
enable_tpc_accumulation = 0, /* by default it is enable */
|
||||
|
||||
@@ -218,6 +218,8 @@ int is_srs_occasion_common(LTE_DL_FRAME_PARMS *frame_parms,int frame_tx,int subf
|
||||
void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
|
||||
|
||||
void release_rnti_of_phy(module_id_t mod_id);
|
||||
|
||||
void ru_fep_full_2thread(RU_t *ru, int subframe);
|
||||
/*@}*/
|
||||
|
||||
|
||||
|
||||
@@ -46,3 +46,5 @@ void handle_nr_nfapi_dlsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
|
||||
uint8_t *sdu);
|
||||
|
||||
void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid);
|
||||
|
||||
void nr_fill_crc_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag);
|
||||
@@ -38,7 +38,7 @@
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/system.h"
|
||||
@@ -56,160 +56,236 @@ extern openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
extern int oai_exit;
|
||||
|
||||
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols) {
|
||||
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
|
||||
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
unsigned int aa,slot_offset,slot_offsetF;
|
||||
unsigned int slot_offset,slot_offsetF;
|
||||
int slot = tti_tx;
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0) , 1 );
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0) , 1 );
|
||||
|
||||
slot_offset = slot*fp->samples_per_slot;
|
||||
slot_offsetF = first_symbol*fp->ofdm_symbol_size;
|
||||
|
||||
|
||||
if (first_symbol>0) slot_offset += (fp->ofdm_symbol_size*first_symbol) + (fp->nb_prefix_samples0) + (fp->nb_prefix_samples*(first_symbol-1));
|
||||
|
||||
LOG_D(PHY,"SFN/SF:RU:TX:%d/%d Generating slot %d (first_symbol %d num_symbols %d)\n",ru->proc.frame_tx, ru->proc.tti_tx,slot,first_symbol,num_symbols);
|
||||
|
||||
for (aa=0; aa<ru->nb_tx; aa++) {
|
||||
if (fp->Ncp == 1) {
|
||||
if (fp->Ncp == 1) {
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
num_symbols,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
else {
|
||||
if (first_symbol==0) {
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
num_symbols,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
1,
|
||||
fp->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
|
||||
(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
|
||||
fp->ofdm_symbol_size,
|
||||
num_symbols-1,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
else {
|
||||
if (first_symbol==0) {
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
1,
|
||||
fp->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
|
||||
(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
|
||||
fp->ofdm_symbol_size,
|
||||
num_symbols-1,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
else {
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
num_symbols,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
num_symbols,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0);
|
||||
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+(first_symbol!=0?1:0), 0);
|
||||
}
|
||||
|
||||
void nr_feptx_ofdm_2thread(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
|
||||
NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
|
||||
nfapi_nr_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
struct timespec wait;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
RU_feptx_t *feptx = proc->feptx;
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
|
||||
int slot = tti_tx;
|
||||
|
||||
wait.tv_sec=0;
|
||||
wait.tv_nsec=5000000L;
|
||||
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int aa = 0;
|
||||
int ret = 0;
|
||||
int nb_antenna_ports = fp->N_ssb;
|
||||
int ofdm_mask_full = (1<<(ru->nb_tx*2))-1;
|
||||
int txdataF_offset = ((tti_tx%2)*fp->samples_per_slot_wCP);
|
||||
|
||||
if (nr_slot_select(cfg,slot,frame_tx) == SF_UL) return;
|
||||
|
||||
// this copy should be done in the precoding thread (currently inactive)
|
||||
for (int aa=0;aa<ru->nb_tx;aa++)
|
||||
memcpy((void*)ru->common.txdataF_BF[aa],
|
||||
|
||||
(void*)ru->gNB_list[0]->common_vars.txdataF[aa], fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
if (nr_slot_select(cfg,slot,frame_tx)==SF_DL) {
|
||||
// If this is not an S-tti
|
||||
if (pthread_mutex_timedlock(&proc->mutex_feptx,&wait) != 0) {
|
||||
printf("[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)\n", proc->instance_cnt_feptx);
|
||||
exit_fun( "error locking mutex_feptx" );
|
||||
return;
|
||||
}
|
||||
|
||||
if (proc->instance_cnt_feptx==0) {
|
||||
printf("[RU] FEPtx thread busy\n");
|
||||
exit_fun("FEPtx thread busy");
|
||||
pthread_mutex_unlock( &proc->mutex_feptx );
|
||||
return;
|
||||
}
|
||||
|
||||
++proc->instance_cnt_feptx;
|
||||
// slot to pass to worker thread
|
||||
proc->slot_feptx = slot;
|
||||
pthread_mutex_unlock( &proc->mutex_feptx );
|
||||
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_feptx) != 0) {
|
||||
printf("[RU] ERROR pthread_cond_signal for feptx thread\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return;
|
||||
}
|
||||
|
||||
for (aa=0; aa<fp->Lmax; aa++) {
|
||||
memset(ru->common.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
}
|
||||
|
||||
// call first half-slot in this thread
|
||||
nr_feptx0(ru,slot,0,fp->symbols_per_slot>>1);
|
||||
wait_on_busy_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"NR feptx thread");
|
||||
start_meas(&ru->ofdm_total_stats);
|
||||
|
||||
for(j=0; j<fp->symbols_per_slot; ++j){
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 1);
|
||||
start_meas(&ru->txdataF_copy_stats);
|
||||
if (ru->num_gNB == 1){
|
||||
gNB = ru->gNB_list[0];
|
||||
cfg = &gNB->gNB_config;
|
||||
|
||||
for(i=0; i<nb_antenna_ports; ++i){
|
||||
memcpy((void*)&ru->common.txdataF[i][j*fp->ofdm_symbol_size],
|
||||
(void*)&gNB->common_vars.txdataF[i][j*fp->ofdm_symbol_size + txdataF_offset],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
}
|
||||
|
||||
}//num_gNB == 1
|
||||
stop_meas(&ru->txdataF_copy_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+j , 0);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
if (nr_slot_select(cfg,slot,frame_tx)==SF_DL) {
|
||||
// If this is not an S-tti
|
||||
for(i=0; i<ru->nb_tx; ++i){
|
||||
if(j%2 == 0){
|
||||
while(feptx[i].instance_cnt_feptx != -1){
|
||||
usleep(5);
|
||||
}
|
||||
AssertFatal((ret=pthread_mutex_lock(&feptx[i].mutex_feptx))==0,"mutex_lock return %d\n",ret);
|
||||
feptx[i].aa = i;
|
||||
feptx[i].index = i;
|
||||
feptx[i].ru = ru;
|
||||
feptx[i].symbol = j;
|
||||
feptx[i].slot = slot;
|
||||
feptx[i].nb_antenna_ports = nb_antenna_ports;
|
||||
feptx[i].instance_cnt_feptx = 0;
|
||||
AssertFatal(pthread_cond_signal(&feptx[i].cond_feptx) == 0,"ERROR pthread_cond_signal for feptx_ofdm_thread\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&feptx[i].mutex_feptx))==0,"mutex_lock returns %d\n",ret);
|
||||
}
|
||||
else{
|
||||
while(feptx[i+ru->nb_tx].instance_cnt_feptx != -1){
|
||||
usleep(5);
|
||||
}
|
||||
AssertFatal((ret=pthread_mutex_lock(&feptx[i+ru->nb_tx].mutex_feptx))==0,"mutex_lock return %d\n",ret);
|
||||
feptx[i+ru->nb_tx].aa = i;
|
||||
feptx[i+ru->nb_tx].index = i+ru->nb_tx;
|
||||
feptx[i+ru->nb_tx].ru = ru;
|
||||
feptx[i+ru->nb_tx].symbol = j;
|
||||
feptx[i+ru->nb_tx].slot = slot;
|
||||
feptx[i+ru->nb_tx].nb_antenna_ports = nb_antenna_ports;
|
||||
feptx[i+ru->nb_tx].instance_cnt_feptx = 0;
|
||||
AssertFatal(pthread_cond_signal(&feptx[i+ru->nb_tx].cond_feptx) == 0,"ERROR pthread_cond_signal for feptx_ofdm_thread\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&feptx[i+ru->nb_tx].mutex_feptx))==0,"mutex_lock returns %d\n",ret);
|
||||
}
|
||||
}
|
||||
|
||||
}//if == SF_DL
|
||||
else {
|
||||
proc->feptx_mask = ofdm_mask_full;
|
||||
}
|
||||
}//j<fp->symbols_per_slot
|
||||
|
||||
// wait all process to finish
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_feptx))==0,"mutex_lock return %d\n",ret);
|
||||
while (proc->feptx_mask != ofdm_mask_full) {
|
||||
// most of the time the thread is waiting here
|
||||
// proc->instance_cnt_rxtx is -1
|
||||
pthread_cond_wait(&proc->cond_feptx,&proc->mutex_feptx); // this unlocks mutex_rxtx while waiting and then locks it again
|
||||
}
|
||||
proc->feptx_mask = 0;
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_feptx))==0,"mutex_lock return %d\n",ret);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK, proc->feptx_mask );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
|
||||
|
||||
//write_output
|
||||
|
||||
stop_meas(&ru->ofdm_mod_stats);
|
||||
stop_meas(&ru->ofdm_total_stats);
|
||||
|
||||
}
|
||||
|
||||
static void *nr_feptx_thread(void *param) {
|
||||
|
||||
RU_t *ru = (RU_t *)param;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
RU_feptx_t *feptx = (RU_feptx_t *)param;
|
||||
RU_t *ru;
|
||||
int aa, slot, start, l, nb_antenna_ports, ret;
|
||||
int32_t ***bw;
|
||||
NR_DL_FRAME_PARMS *fp;
|
||||
int ofdm_mask_full;
|
||||
|
||||
|
||||
while (!oai_exit) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_feptx,&proc->cond_feptx,&proc->instance_cnt_feptx,"NR feptx thread")<0) break;
|
||||
int slot=proc->slot_feptx;
|
||||
if (release_thread(&proc->mutex_feptx,&proc->instance_cnt_feptx,"NR feptx thread")<0) break;
|
||||
ret = 0;
|
||||
if (wait_on_condition(&feptx->mutex_feptx,&feptx->cond_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+feptx->index+1 , 1 );
|
||||
|
||||
nr_feptx0(ru,slot,ru->nr_frame_parms->symbols_per_slot>>1,ru->nr_frame_parms->symbols_per_slot>>1);
|
||||
ru = feptx->ru;
|
||||
slot = feptx->slot;
|
||||
aa = feptx->aa;
|
||||
l = feptx->symbol;
|
||||
fp = ru->nr_frame_parms;
|
||||
start = feptx->symbol;
|
||||
nb_antenna_ports = feptx->nb_antenna_ports;
|
||||
ofdm_mask_full = (1<<(ru->nb_tx*2))-1;
|
||||
|
||||
if (pthread_cond_signal(&proc->cond_feptx) != 0) {
|
||||
LOG_E(PHY,"[gNB] ERROR pthread_cond_signal for NR feptx thread exit\n");
|
||||
exit_fun( "ERROR pthread_cond_signal" );
|
||||
return NULL;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
|
||||
start_meas(&ru->precoding_stats);
|
||||
if (ru->nb_tx == 1) {
|
||||
AssertFatal(fp->N_ssb==ru->nb_tx,"Attempting to transmit %d SSB while Nb_tx = %d",fp->N_ssb,ru->nb_tx);
|
||||
for (int p=0; p<fp->Lmax; p++) {
|
||||
if ((fp->L_ssb >> p) & 0x01){
|
||||
memcpy((void*)&ru->common.txdataF_BF[0][l*fp->ofdm_symbol_size],
|
||||
(void*)&ru->common.txdataF[p][l*fp->ofdm_symbol_size],
|
||||
fp->ofdm_symbol_size*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
bw = ru->beam_weights[0];
|
||||
nr_beam_precoding(ru->common.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
fp,
|
||||
bw,
|
||||
slot,
|
||||
l,
|
||||
aa,
|
||||
nb_antenna_ports);
|
||||
}
|
||||
stop_meas(&ru->precoding_stats);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
|
||||
|
||||
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
nr_feptx0(ru,slot,start,1,aa);
|
||||
stop_meas(&ru->ofdm_mod_stats);
|
||||
|
||||
if (release_thread(&feptx->mutex_feptx,&feptx->instance_cnt_feptx,"NR feptx thread")<0) break;
|
||||
|
||||
if(l >= fp->symbols_per_slot -2){
|
||||
AssertFatal((ret=pthread_mutex_lock(&ru->proc.mutex_feptx))==0,"mutex_lock return %d\n",ret);
|
||||
ru->proc.feptx_mask |= 1<<(feptx->index);
|
||||
if(ru->proc.feptx_mask == ofdm_mask_full)
|
||||
AssertFatal(pthread_cond_signal(&ru->proc.cond_feptx) == 0,"ERROR pthread_cond_signal for precoding and ofdm finish\n");
|
||||
AssertFatal((ret=pthread_mutex_unlock(&ru->proc.mutex_feptx))==0,"mutex_lock returns %d\n",ret);
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK, ru->proc.feptx_mask );
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+feptx->index+1 , 0 );
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
void nr_init_feptx_thread(RU_t *ru) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
|
||||
proc->instance_cnt_feptx = -1;
|
||||
|
||||
pthread_mutex_init( &proc->mutex_feptx, NULL);
|
||||
pthread_cond_init( &proc->cond_feptx, NULL);
|
||||
|
||||
threadCreate(&proc->pthread_feptx, nr_feptx_thread, (void*)ru, "feptx", -1, OAI_PRIORITY_RT);
|
||||
|
||||
|
||||
}
|
||||
|
||||
// is this supposed to generate a slot or a subframe???
|
||||
// seems to be hardcoded to numerology 1 (2 slots=1 subframe)
|
||||
@@ -229,14 +305,9 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
|
||||
// this copy should be done in the precoding thread (currently inactive)
|
||||
for (int aa=0;aa<ru->nb_tx;aa++)
|
||||
memcpy((void*)ru->common.txdataF_BF[aa],
|
||||
(void*)ru->gNB_list[0]->common_vars.txdataF[aa], fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
|
||||
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
|
||||
|
||||
nr_feptx0(ru,slot,0,fp->symbols_per_slot);
|
||||
nr_feptx0(ru,slot,0,fp->symbols_per_slot,aa);
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 0 );
|
||||
@@ -248,6 +319,79 @@ void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx) {
|
||||
|
||||
}
|
||||
|
||||
void nr_init_feptx_thread(RU_t *ru) {
|
||||
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
RU_feptx_t *feptx = proc->feptx;
|
||||
int i = 0;
|
||||
|
||||
for(i=0; i<16; i++){
|
||||
feptx[i].instance_cnt_feptx = -1;
|
||||
|
||||
pthread_mutex_init( &feptx[i].mutex_feptx, NULL);
|
||||
pthread_cond_init( &feptx[i].cond_feptx, NULL);
|
||||
|
||||
threadCreate(&feptx[i].pthread_feptx, nr_feptx_thread, (void*)&feptx[i], "feptx", -1, OAI_PRIORITY_RT);
|
||||
LOG_I(PHY,"init feptx thread %d\n", i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
void nr_feptx_prec(RU_t *ru,int frame,int tti_tx) {
|
||||
|
||||
int l,aa;
|
||||
PHY_VARS_gNB **gNB_list = ru->gNB_list,*gNB;
|
||||
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
|
||||
nfapi_nr_config_request_t *cfg;
|
||||
int32_t ***bw;
|
||||
int i=0;
|
||||
|
||||
start_meas(&ru->precoding_stats);
|
||||
if (ru->num_gNB == 1){
|
||||
gNB = gNB_list[0];
|
||||
cfg = &gNB->gNB_config;
|
||||
if (nr_slot_select(cfg,tti_tx,frame) == SF_UL) return;
|
||||
|
||||
for(i=0; i<fp->Lmax; ++i)
|
||||
memcpy((void*)ru->common.txdataF[i],
|
||||
(void*)gNB->common_vars.txdataF[i],
|
||||
fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
|
||||
if (ru->nb_tx == 1) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 1);
|
||||
|
||||
AssertFatal(fp->N_ssb==ru->nb_tx,"Attempting to transmit %d SSB while Nb_tx = %d",fp->N_ssb,ru->nb_tx);
|
||||
|
||||
for (int p=0; p<fp->Lmax; p++) {
|
||||
if ((fp->L_ssb >> p) & 0x01){
|
||||
memcpy((void*)ru->common.txdataF_BF[0],
|
||||
(void*)ru->common.txdataF[p],
|
||||
fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC , 0);
|
||||
}// if (ru->nb_tx == 1)
|
||||
else {
|
||||
bw = ru->beam_weights[0];
|
||||
for (l=0;l<fp->symbols_per_slot;l++) {
|
||||
for (aa=0;aa<ru->nb_tx;aa++) {
|
||||
nr_beam_precoding(ru->common.txdataF,
|
||||
ru->common.txdataF_BF,
|
||||
fp,
|
||||
bw,
|
||||
tti_tx,
|
||||
l,
|
||||
aa,
|
||||
fp->Lmax);
|
||||
}// for (aa=0;aa<ru->nb_tx;aa++)
|
||||
}// for (l=0;l<fp->symbols_per_slot;l++)
|
||||
}// if (ru->nb_tx == 1)
|
||||
}// if (ru->num_gNB == 1)
|
||||
stop_meas(&ru->precoding_stats);
|
||||
}
|
||||
|
||||
void nr_fep0(RU_t *ru, int first_half) {
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
|
||||
uint8_t *pbch_pdu=&gNB->pbch_pdu[0];
|
||||
uint8_t ssb_index, n_hf;
|
||||
int ssb_start_symbol, rel_slot;
|
||||
int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP;
|
||||
uint16_t slots_per_hf = fp->slots_per_frame / 2;
|
||||
|
||||
n_hf = cfg->sch_config.half_frame_index.value;
|
||||
@@ -124,19 +125,20 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
|
||||
|
||||
nr_set_ssb_first_subcarrier(cfg, fp); // setting the first subcarrier
|
||||
|
||||
// it is supposed that each logical antenna port correspont to a different beam so each SSB is stored into its own index of txdataF
|
||||
LOG_D(PHY,"SS TX: frame %d, slot %d, start_symbol %d\n",frame,slot, ssb_start_symbol);
|
||||
nr_generate_pss(gNB->d_pss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_sss(gNB->d_sss, txdataF[0], AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_pss(gNB->d_pss, &txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_sss(gNB->d_sss, &txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
|
||||
if (fp->Lmax == 4)
|
||||
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index],&txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
else
|
||||
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index],txdataF[0], AMP, ssb_start_symbol, cfg, fp);
|
||||
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index],&txdataF[ssb_index][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
|
||||
|
||||
nr_generate_pbch(&gNB->pbch,
|
||||
pbch_pdu,
|
||||
gNB->nr_pbch_interleaver,
|
||||
txdataF[0],
|
||||
&txdataF[ssb_index][txdataF_offset],
|
||||
AMP,
|
||||
ssb_start_symbol,
|
||||
n_hf,fp->Lmax,ssb_index,
|
||||
@@ -155,6 +157,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
nfapi_nr_config_request_t *cfg = &gNB->gNB_config;
|
||||
int offset = gNB->CC_id;
|
||||
uint8_t ssb_frame_periodicity; // every how many frames SSB are generated
|
||||
int txdataF_offset = (slot%2)*fp->samples_per_slot_wCP;
|
||||
|
||||
if (cfg->sch_config.ssb_periodicity.value < 20)
|
||||
ssb_frame_periodicity = 1;
|
||||
@@ -168,8 +171,8 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
if (do_meas==1) start_meas(&gNB->phy_proc_tx);
|
||||
|
||||
// clear the transmit data array for the current subframe
|
||||
for (aa=0; aa<1/*15*/; aa++) {
|
||||
memset(gNB->common_vars.txdataF[aa],0,fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
for (aa=0; aa<fp->Lmax; aa++) {
|
||||
memset(&gNB->common_vars.txdataF[aa][txdataF_offset],0,fp->samples_per_slot_wCP*sizeof(int32_t));
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_COMMON_TX,1);
|
||||
@@ -187,10 +190,12 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
Calling nr_generate_dci_top (number of DCI %d)\n", gNB->Mod_id, frame, slot, num_dci);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,1);
|
||||
|
||||
nr_generate_dci_top(gNB->pdcch_vars.dci_alloc[i],
|
||||
gNB->nr_gold_pdcch_dmrs[slot],
|
||||
gNB->common_vars.txdataF[0],
|
||||
AMP, *fp, *cfg);
|
||||
gNB->nr_gold_pdcch_dmrs[slot],
|
||||
&gNB->common_vars.txdataF[0][txdataF_offset], // hardcoded to beam 0
|
||||
AMP, *fp, *cfg);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PDCCH_TX,0);
|
||||
}
|
||||
|
||||
@@ -267,17 +272,17 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
|
||||
// [hna] TO BE CLEANED
|
||||
// --------------------
|
||||
|
||||
// nfapi_rx_indication_pdu_t *pdu;
|
||||
|
||||
nfapi_rx_indication_pdu_t *pdu;
|
||||
int timing_advance_update;
|
||||
int sync_pos;
|
||||
|
||||
uint16_t mu = gNB->gNB_config.subframe_config.numerology_index_mu.value;
|
||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
|
||||
// gNB->UL_INFO.rx_ind.sfn_sf = frame<<4| slot_rx;
|
||||
// gNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
|
||||
|
||||
// pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
pdu = &gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
|
||||
|
||||
// pdu->rx_ue_information.handle = gNB->ulsch[UE_id+1][0]->handle;
|
||||
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
@@ -285,20 +290,16 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
|
||||
// pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
|
||||
// pdu->rx_indication_rel8.length = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->TBS>>3;
|
||||
// pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
|
||||
// pdu->data = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b;
|
||||
// estimate timing advance for MAC
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, UE_id);
|
||||
timing_advance_update = sync_pos; // - gNB->frame_parms.nb_prefix_samples/4; //to check
|
||||
// printf("\x1B[33m" "timing_advance_update = %d\n" "\x1B[0m", timing_advance_update);
|
||||
|
||||
pdu->data = gNB->ulsch[UE_id+1][0]->harq_processes[harq_pid]->b;
|
||||
sync_pos = nr_est_timing_advance_pusch(gNB, UE_id); // estimate timing advance for MAC
|
||||
timing_advance_update = sync_pos * (1 << mu); // scale by the used scs numerology
|
||||
|
||||
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
|
||||
switch (gNB->frame_parms.N_RB_DL) {
|
||||
// case 6: /* nothing to do */ break;
|
||||
// case 15: timing_advance_update /= 2; break;
|
||||
// case 25: timing_advance_update /= 4; break;
|
||||
// case 50: timing_advance_update /= 8; break;
|
||||
// case 75: timing_advance_update /= 12; break;
|
||||
case 106: timing_advance_update /= 16; break;
|
||||
case 217: timing_advance_update /= 32; break;
|
||||
case 245: timing_advance_update /= 32; break;
|
||||
case 273: timing_advance_update /= 32; break;
|
||||
default: abort();
|
||||
}
|
||||
@@ -309,7 +310,9 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
|
||||
if (timing_advance_update < 0) timing_advance_update = 0;
|
||||
if (timing_advance_update > 63) timing_advance_update = 63;
|
||||
|
||||
// pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
LOG_D(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update);
|
||||
|
||||
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
|
||||
|
||||
// estimate UL_CQI for MAC (from antenna port 0 only)
|
||||
// int SNRtimes10 = dB_fixed_times10(gNB->pusch_vars[UE_id]->ulsch_power[0]) - 300;//(10*gNB->measurements.n0_power_dB[0]);
|
||||
@@ -322,12 +325,28 @@ void nr_fill_rx_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id,
|
||||
// harq_pid,frame,slot_rx,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,pdu->rx_indication_rel8.timing_advance,
|
||||
// timing_advance_update);
|
||||
|
||||
// gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
|
||||
// gNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | slot_rx;
|
||||
|
||||
// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
void nr_fill_crc_indication (PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t crc_flag){
|
||||
// pthread_mutex_lock(&gNB->UL_INFO_mutex);
|
||||
nfapi_crc_indication_pdu_t *pdu = &gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
|
||||
// gNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
|
||||
// gNB->UL_INFO.crc_ind.header.message_id = NFAPI_CRC_INDICATION;
|
||||
// gNB->UL_INFO.crc_ind.crc_indication_body.tl.tag = NFAPI_CRC_INDICATION_BODY_TAG;
|
||||
// pdu->instance_length = 0; // don't know what to do with this
|
||||
// // pdu->rx_ue_information.handle = handle;
|
||||
// pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
|
||||
// pdu->rx_ue_information.rnti = gNB->ulsch[UE_id]->rnti;
|
||||
// pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
|
||||
// pdu->crc_indication_rel8.crc_flag = crc_flag;
|
||||
gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
|
||||
//LOG_D(PHY, "%s() rnti:%04x crcs:%d crc_flag:%d\n", __FUNCTION__, pdu->rx_ue_information.rnti, gNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs, crc_flag);
|
||||
// pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
}
|
||||
|
||||
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
|
||||
@@ -355,9 +374,10 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
int num_pusch_pdu = UL_tti_req->n_pdus;
|
||||
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d, num_pusch_pdu %d\n",frame_rx,slot_rx,num_pusch_pdu);
|
||||
|
||||
for (int i = 0; i < num_pusch_pdu; i++) {
|
||||
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
|
||||
for (int i = 0; i < num_pusch_pdu; i++) {
|
||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||
{
|
||||
@@ -378,6 +398,7 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
//LOG_M("rxdataF_ext.m","rxF_ext",gNB->pusch_vars[UE_id]->rxdataF_ext[0],6900,1,1);
|
||||
nr_ulsch_procedures(gNB, frame_rx, slot_rx, UE_id, harq_pid);
|
||||
nr_fill_rx_indication(gNB, frame_rx, slot_rx, UE_id, harq_pid); // indicate SDU to MAC
|
||||
nr_fill_crc_indication(gNB, frame_rx, slot_rx, UE_id, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,8 +42,12 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
|
||||
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);
|
||||
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols);
|
||||
void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa);
|
||||
void nr_init_feptx_thread(RU_t *ru);
|
||||
void fep_full(RU_t *ru,int slot);
|
||||
void nr_feptx_prec(RU_t *ru,int frame_tx,int tti_tx);
|
||||
void nr_init_feptx_prec_thread(RU_t *ru);
|
||||
void nr_feptx_prec_control(RU_t *ru,int frame,int tti_tx);
|
||||
void nr_init_feprx_thread(RU_t *ru);
|
||||
void nr_fep_full(RU_t *ru, int slot);
|
||||
void nr_fep_full_2thread(RU_t *ru, int slot);
|
||||
|
||||
@@ -289,7 +289,13 @@ uint16_t nr_get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
|
||||
|
||||
int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
|
||||
void nr_process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance);
|
||||
/*! \brief Compute the timing adjustment at UE side from the old TA offset and the new received TA command
|
||||
@param Mod_id Local UE index on which to act
|
||||
@param CC_id Component Carrier Index
|
||||
@param ta_command TA command received from the network
|
||||
@param mu numerology index (0,1,2..)
|
||||
*/
|
||||
void nr_process_timing_advance(module_id_t Mod_id,uint8_t CC_id,uint8_t ta_command, uint8_t mu, uint16_t bwp_ul_NB_RB);
|
||||
void nr_process_timing_advance_rar(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint16_t timing_advance);
|
||||
|
||||
unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb);
|
||||
|
||||
@@ -214,7 +214,7 @@ 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;
|
||||
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){
|
||||
if(phy_config->config_req.config_mask & FAPI_NR_CONFIG_REQUEST_MASK_PBCH){
|
||||
@@ -230,7 +230,7 @@ int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){
|
||||
LOG_I(MAC,"half frame bit: %d\n", phy_config->config_req.pbch_config.half_frame_bit);
|
||||
LOG_I(MAC,"-------------------------------\n");
|
||||
|
||||
memcpy(&nrUE_config.pbch_config,&phy_config->config_req.pbch_config,sizeof(fapi_nr_pbch_config_t));
|
||||
memcpy(&nrUE_config->pbch_config,&phy_config->config_req.pbch_config,sizeof(fapi_nr_pbch_config_t));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -21,11 +21,11 @@
|
||||
|
||||
/*! \file phy_procedures_nr_ue.c
|
||||
* \brief Implementation of UE procedures from 36.213 LTE specifications
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein, A. Mico Pereperez
|
||||
* \author R. Knopp, F. Kaltenberger, N. Nikaein, A. Mico Pereperez, G. Casati
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr
|
||||
* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr, navid.nikaein@eurecom.fr, guido.casati@iis.fraunhofer.de
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
@@ -45,6 +45,7 @@
|
||||
//#include "PHY/extern.h"
|
||||
#include "SCHED_NR_UE/defs.h"
|
||||
#include "SCHED_NR/extern.h"
|
||||
#include "SCHED_NR_UE/phy_sch_processing_time.h"
|
||||
//#include <sched.h>
|
||||
//#include "targets/RT/USER/nr-softmodem.h"
|
||||
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
|
||||
@@ -421,22 +422,6 @@ void nr_process_timing_advance_rar(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,ui
|
||||
LOG_I(PHY,"[UE %d] AbsoluteSubFrame %d.%d, received (rar) timing_advance %d\n",ue->Mod_id,proc->frame_rx, proc->nr_tti_rx, ue->timing_advance);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void nr_process_timing_advance(uint8_t Mod_id,uint8_t CC_id,int16_t timing_advance)
|
||||
{
|
||||
|
||||
// uint32_t frame = PHY_vars_UE_g[Mod_id]->frame;
|
||||
|
||||
// timing advance has Q1.5 format
|
||||
timing_advance = timing_advance - 31;
|
||||
|
||||
PHY_vars_UE_g[Mod_id][CC_id]->timing_advance = PHY_vars_UE_g[Mod_id][CC_id]->timing_advance+timing_advance*4; //this is for 25RB only!!!
|
||||
|
||||
|
||||
LOG_D(PHY,"[UE %d] Got timing advance %d from MAC, new value %d\n",Mod_id, timing_advance, PHY_vars_UE_g[Mod_id][CC_id]->timing_advance);
|
||||
|
||||
|
||||
}
|
||||
|
||||
uint8_t nr_is_SR_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id)
|
||||
@@ -1560,6 +1545,28 @@ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDUR
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
void nr_process_timing_advance(module_id_t Mod_id, uint8_t CC_id, uint8_t ta_command, uint8_t mu, uint16_t bwp_ul_NB_RB){
|
||||
|
||||
// 3GPP TS 38.213 p4.2
|
||||
// scale by the scs numerology
|
||||
int factor_mu = 1 << mu;
|
||||
uint16_t bw_scaling;
|
||||
|
||||
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
|
||||
switch (bwp_ul_NB_RB) {
|
||||
case 106: bw_scaling = 16; break;
|
||||
case 217: bw_scaling = 32; break;
|
||||
case 245: bw_scaling = 32; break;
|
||||
case 273: bw_scaling = 32; break;
|
||||
default: abort();
|
||||
}
|
||||
|
||||
PHY_vars_UE_g[Mod_id][CC_id]->timing_advance += (ta_command - 31) * bw_scaling / factor_mu;
|
||||
|
||||
LOG_D(PHY, "[UE %d] Got timing advance command %u from MAC, new value is %u\n", Mod_id, ta_command, PHY_vars_UE_g[Mod_id][CC_id]->timing_advance);
|
||||
}
|
||||
|
||||
void ue_ulsch_uespec_procedures(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t eNB_id,
|
||||
@@ -3154,7 +3161,7 @@ int nr_ue_pdcch_procedures(uint8_t eNB_id,
|
||||
dl_indication.dci_ind = &dci_ind;
|
||||
|
||||
// send to mac
|
||||
ue->if_inst->dl_indication(&dl_indication);
|
||||
ue->if_inst->dl_indication(&dl_indication, NULL);
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&ue->dlsch_rx_pdcch_stats);
|
||||
@@ -3528,7 +3535,6 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
int frame_rx = proc->frame_rx;
|
||||
int nr_tti_rx = proc->nr_tti_rx;
|
||||
int ret=0, ret1=0;
|
||||
//int CC_id = ue->CC_id;
|
||||
NR_UE_PDSCH *pdsch_vars;
|
||||
uint8_t is_cw0_active = 0;
|
||||
uint8_t is_cw1_active = 0;
|
||||
@@ -3539,6 +3545,20 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
uint16_t nb_symb_sch = 9;
|
||||
nr_downlink_indication_t dl_indication;
|
||||
fapi_nr_rx_indication_t rx_ind;
|
||||
// params for UL time alignment procedure
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment = &ue->ul_time_alignment[eNB_id];
|
||||
uint16_t slots_per_frame = ue->frame_parms.slots_per_frame;
|
||||
uint16_t slots_per_subframe = ue->frame_parms.slots_per_subframe;
|
||||
uint8_t numerology = ue->frame_parms.numerology_index, mapping_type_ul, mapping_type_dl;
|
||||
int ul_tx_timing_adjustment, N_TA_max, factor_mu, N_t_1, N_t_2, N_1, N_2, d_1_1, d_2_1, d;
|
||||
uint8_t d_2_2 = 0;// set to 0 because there is only 1 BWP
|
||||
// TODO this should corresponds to the switching time as defined in
|
||||
// TS 38.133
|
||||
uint16_t ofdm_symbol_size = ue->frame_parms.ofdm_symbol_size;
|
||||
uint16_t nb_prefix_samples = ue->frame_parms.nb_prefix_samples;
|
||||
uint32_t t_subframe = 1; // subframe duration of 1 msec
|
||||
uint16_t bw_scaling, start_symbol;
|
||||
float tc_factor;
|
||||
|
||||
if (dlsch0==NULL)
|
||||
AssertFatal(0,"dlsch0 should be defined at this level \n");
|
||||
@@ -3547,6 +3567,7 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
harq_pid = dlsch0->current_harq_pid;
|
||||
is_cw0_active = dlsch0->harq_processes[harq_pid]->status;
|
||||
nb_symb_sch = dlsch0->harq_processes[harq_pid]->nb_symbols;
|
||||
start_symbol = dlsch0->harq_processes[harq_pid]->start_symbol;
|
||||
|
||||
|
||||
|
||||
@@ -3798,13 +3819,128 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
|
||||
dl_indication.dci_ind = NULL; //&ue->dci_ind;
|
||||
// send to mac
|
||||
if (ue->if_inst && ue->if_inst->dl_indication)
|
||||
ue->if_inst->dl_indication(&dl_indication);
|
||||
ue->if_inst->dl_indication(&dl_indication, ul_time_alignment);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO CRC check for CW0
|
||||
|
||||
// Check CRC for CW 0
|
||||
/*if (ret == (1+dlsch0->max_turbo_iterations)) {
|
||||
*dlsch_errors=*dlsch_errors+1;
|
||||
if(dlsch0->rnti != 0xffff){
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : DLSCH CW0 in error (rv %d,round %d, mcs %d,TBS %d)\n",
|
||||
ue->Mod_id,dlsch0->rnti,
|
||||
harq_pid,frame_rx,subframe_rx,
|
||||
dlsch0->harq_processes[harq_pid]->rvidx,
|
||||
dlsch0->harq_processes[harq_pid]->round,
|
||||
dlsch0->harq_processes[harq_pid]->mcs,
|
||||
dlsch0->harq_processes[harq_pid]->TBS);
|
||||
}
|
||||
} else {
|
||||
if(dlsch0->rnti != 0xffff){
|
||||
LOG_D(PHY,"[UE %d][PDSCH %x/%d] AbsSubframe %d.%d : Received DLSCH CW0 (rv %d,round %d, mcs %d,TBS %d)\n",
|
||||
ue->Mod_id,dlsch0->rnti,
|
||||
harq_pid,frame_rx,subframe_rx,
|
||||
dlsch0->harq_processes[harq_pid]->rvidx,
|
||||
dlsch0->harq_processes[harq_pid]->round,
|
||||
dlsch0->harq_processes[harq_pid]->mcs,
|
||||
dlsch0->harq_processes[harq_pid]->TBS);
|
||||
}
|
||||
if ( LOG_DEBUGFLAG(DEBUG_UE_PHYPROC)){
|
||||
int j;
|
||||
LOG_D(PHY,"dlsch harq_pid %d (rx): \n",dlsch0->current_harq_pid);
|
||||
|
||||
for (j=0; j<dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS>>3; j++)
|
||||
LOG_T(PHY,"%x.",dlsch0->harq_processes[dlsch0->current_harq_pid]->b[j]);
|
||||
LOG_T(PHY,"\n");
|
||||
}*/
|
||||
|
||||
if (ue->mac_enabled == 1) {
|
||||
|
||||
// scale the 16 factor in N_TA calculation in 38.213 section 4.2 according to the used FFT size
|
||||
switch (ue->frame_parms.N_RB_DL) {
|
||||
case 106: bw_scaling = 16; break;
|
||||
case 217: bw_scaling = 32; break;
|
||||
case 245: bw_scaling = 32; break;
|
||||
case 273: bw_scaling = 32; break;
|
||||
default: abort();
|
||||
}
|
||||
|
||||
/* Time Alignment procedure
|
||||
// - UE processing capability 1
|
||||
// - Setting the TA update to be applied after the reception of the TA command
|
||||
// - Timing adjustment computed according to TS 38.213 section 4.2
|
||||
// - Durations of N1 and N2 symbols corresponding to PDSCH and PUSCH are
|
||||
// computed according to sections 5.3 and 6.4 of TS 38.214 */
|
||||
factor_mu = 1 << numerology;
|
||||
N_TA_max = 3846 * bw_scaling / factor_mu;
|
||||
|
||||
/* PDSCH decoding time N_1 for processing capability 1 */
|
||||
if (ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition == pdsch_dmrs_pos0)
|
||||
N_1 = pdsch_N_1_capability_1[numerology][1];
|
||||
else if (ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition == pdsch_dmrs_pos1 || ue->dmrs_DownlinkConfig.pdsch_dmrs_AdditionalPosition == 2) // TODO set to pdsch_dmrs_pos2 when available
|
||||
N_1 = pdsch_N_1_capability_1[numerology][2];
|
||||
else
|
||||
N_1 = pdsch_N_1_capability_1[numerology][3];
|
||||
|
||||
/* PUSCH preapration time N_2 for processing capability 1 */
|
||||
N_2 = pusch_N_2_timing_capability_1[numerology][1];
|
||||
mapping_type_dl = ue->PDSCH_Config.pdsch_TimeDomainResourceAllocation[0]->mappingType;
|
||||
mapping_type_ul = ue->pusch_config.pusch_TimeDomainResourceAllocation[0]->mappingType;
|
||||
|
||||
/* d_1_1 depending on the number of PDSCH symbols allocated */
|
||||
d = 0; // TODO number of overlapping symbols of the scheduling PDCCH and the scheduled PDSCH
|
||||
if (mapping_type_dl == typeA)
|
||||
if (nb_symb_sch + start_symbol < 7)
|
||||
d_1_1 = 7 - (nb_symb_sch + start_symbol);
|
||||
else
|
||||
d_1_1 = 0;
|
||||
else // mapping type B
|
||||
switch (nb_symb_sch){
|
||||
case 7: d_1_1 = 0; break;
|
||||
case 4: d_1_1 = 3; break;
|
||||
case 2: d_1_1 = 3 + d; break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
/* d_2_1 */
|
||||
if (mapping_type_ul == typeB && start_symbol != 0)
|
||||
d_2_1 = 0;
|
||||
else
|
||||
d_2_1 = 1;
|
||||
|
||||
/* N_t_1 time duration in msec of N_1 symbols corresponding to a PDSCH reception time
|
||||
// N_t_2 time duration in msec of N_2 symbols corresponding to a PUSCH preparation time */
|
||||
N_t_1 = (N_1 + d_1_1) * (ofdm_symbol_size + nb_prefix_samples) / factor_mu;
|
||||
N_t_2 = (N_2 + d_2_1) * (ofdm_symbol_size + nb_prefix_samples) / factor_mu;
|
||||
if (N_t_2 < d_2_2) N_t_2 = d_2_2;
|
||||
|
||||
/* Time alignment procedure */
|
||||
// N_t_1 + N_t_2 + N_TA_max is in unit of Ts, therefore must be converted to Tc
|
||||
// N_t_1 + N_t_2 + N_TA_max must be in msec
|
||||
tc_factor = 64 * 0.509 * 10e-7;
|
||||
ul_tx_timing_adjustment = 1 + ceil(slots_per_subframe*((N_t_1 + N_t_2 + N_TA_max)*tc_factor + 0.5)/t_subframe);
|
||||
|
||||
if (ul_time_alignment->apply_ta == 1){
|
||||
ul_time_alignment->ta_slot = (nr_tti_rx + ul_tx_timing_adjustment) % slots_per_frame;
|
||||
if (nr_tti_rx + ul_tx_timing_adjustment > slots_per_frame){
|
||||
ul_time_alignment->ta_frame = (frame_rx + 1) % 1024;
|
||||
} else {
|
||||
ul_time_alignment->ta_frame = frame_rx;
|
||||
}
|
||||
// reset TA flag
|
||||
ul_time_alignment->apply_ta = 0;
|
||||
LOG_D(PHY,"Frame %d slot %d -- Starting UL time alignment procedures. TA update will be applied at frame %d slot %d\n", frame_rx, nr_tti_rx, ul_time_alignment->ta_frame, ul_time_alignment->ta_slot);
|
||||
}
|
||||
}
|
||||
|
||||
/*ue->total_TBS[eNB_id] = ue->total_TBS[eNB_id] + dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS;
|
||||
ue->total_received_bits[eNB_id] = ue->total_TBS[eNB_id] + dlsch0->harq_processes[dlsch0->current_harq_pid]->TBS;
|
||||
}*/
|
||||
|
||||
// TODO CRC check for CW1
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4132,6 +4268,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
uint8_t do_pdcch_flag,
|
||||
runmode_t mode)
|
||||
{
|
||||
int l,l2;
|
||||
int pilot1;
|
||||
int frame_rx = proc->frame_rx;
|
||||
int nr_tti_rx = proc->nr_tti_rx;
|
||||
int slot_pbch;
|
||||
|
||||
109
openair1/SCHED_NR_UE/phy_sch_processing_time.h
Normal file
109
openair1/SCHED_NR_UE/phy_sch_processing_time.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file phy_sch_processing_time.h
|
||||
\brief tables for UE PDSCH processing and UE PUSCH preparation procedure time
|
||||
from TS 38.214 Physical procedures for data v15.6.0
|
||||
\author Guido Casati
|
||||
\date 2019
|
||||
\version 0.1
|
||||
\company Fraunhofer IIS
|
||||
\email: guido.casati@iis.fraunhofer.de
|
||||
\note
|
||||
\warning
|
||||
*/
|
||||
|
||||
/* TS 38.214 Table 5.3-1: PDSCH processing time for PDSCH processing capability 1
|
||||
// corresponding to the PDSCH decoding time N_1 [symbols]
|
||||
// where mu corresponds to the one of {mu_PDCCH, mu_PDSCH, mu_UL}
|
||||
// resulting with the largest T_proc_1
|
||||
// where mu_PDCCH is the SCS of PDCCH scheduling PDSCH
|
||||
// mu_PDSCH is the SCS of the scheduled PDSCH
|
||||
// mu_UL is the SCS of the UL channel with which the HARQ-ACK is to be transmitted
|
||||
// column A is N_1 corresponding to dmrs-AdditionalPosition pos0 in DMRS-DownlinkConfig
|
||||
// in both dmrs-DownlinkForPDSCH-MappingTypeA and dmrs-DownlinkForPDSCH-MappingTypeB
|
||||
// column B is N_1 corresponding to corresponds to dmrs-AdditionalPosition !0
|
||||
// in DMRS-DownlinkConfig in both dmrs-DownlinkForPDSCH-MappingTypeA,
|
||||
// dmrs-DownlinkForPDSCH-MappingTypeB or if the higher layer param is not configured
|
||||
// when PDSCH DM-RS position l1 for the additional DM-RS is l1 = 1,2
|
||||
// column C is N_1 corresponding to corresponds to dmrs-AdditionalPosition !0
|
||||
// in DMRS-DownlinkConfig in both dmrs-DownlinkForPDSCH-MappingTypeA,
|
||||
// dmrs-DownlinkForPDSCH-MappingTypeB or if the higher layer param is not configured
|
||||
// when PDSCH DM-RS position l1 for the additional DM-RS is != 1,2
|
||||
|
||||
*/
|
||||
int8_t pdsch_N_1_capability_1[4][4] = {
|
||||
/* mu A B C */
|
||||
{ 0, 8, 14, 13 },
|
||||
{ 1, 10, 13, 13 },
|
||||
{ 2, 17, 20, 20 },
|
||||
{ 3, 20, 24, 24 },
|
||||
};
|
||||
|
||||
/* TS 38.214 Table 5.3-2: PDSCH processing time for PDSCH processing capability 2
|
||||
// corresponding to the PDSCH decoding time N_1 [symbols]
|
||||
// where mu corresponds to the one of {mu_PDCCH, mu_PDSCH, mu_UL}
|
||||
// resulting with the largest T_proc_1
|
||||
// where mu_PDCCH is the SCS of PDCCH scheduling PDSCH
|
||||
// mu_PDSCH is the SCS of the scheduled PDSCH
|
||||
// mu_UL is the SCS of the UL channel with which the HARQ-ACK is to be transmitted
|
||||
// column A is N_1 corresponding to dmrs-AdditionalPosition pos0 in DMRS-DownlinkConfig in both
|
||||
// dmrs-DownlinkForPDSCH-MappingTypeA and dmrs-DownlinkForPDSCH-MappingTypeB
|
||||
// mu == 2 is for FR1 only
|
||||
*/
|
||||
float pdsch_N_1_capability_2[3][2] = {
|
||||
/* mu A */
|
||||
{ 0, 3 },
|
||||
{ 1, 4.5 },
|
||||
{ 2, 9 },
|
||||
};
|
||||
|
||||
/* TS 38.214 Table 6.4-1: PUSCH preparation time for PUSCH timing capability 1
|
||||
// corresponding to the PUSCH preparation time N_2 [symbols]
|
||||
// where mu corresponds to the one of {mu_DL, mu_UL}
|
||||
// resulting with the largest T_proc_2
|
||||
// where mu_DL is the SCS with which the PDCCH
|
||||
// carrying the DCI scheduling the PUSCH was transmitted
|
||||
// mu_UL is the SCS of the UL channel with which PUSCH to be transmitted
|
||||
*/
|
||||
int8_t pusch_N_2_timing_capability_1[4][2] = {
|
||||
/* mu N_2 */
|
||||
{ 0, 10 },
|
||||
{ 1, 12 },
|
||||
{ 2, 23 },
|
||||
{ 3, 36 },
|
||||
};
|
||||
|
||||
/* TS 38.214 Table 6.4-2: PUSCH preparation time for PUSCH timing capability 2
|
||||
// corresponding to the PUSCH preparation time N_2 [symbols]
|
||||
// where mu corresponds to the one of {mu_DL, mu_UL}
|
||||
// resulting with the largest T_proc_2
|
||||
// where mu_DL is the SCS with which the PDCCH
|
||||
// carrying the DCI scheduling the PUSCH was transmitted
|
||||
// mu_UL is the SCS of the UL channel with which PUSCH to be transmitted
|
||||
// mu == 2 is for FR1 only
|
||||
*/
|
||||
float pusch_N_2_timing_capability_2[3][2] = {
|
||||
/* mu N_2 */
|
||||
{ 0, 5 },
|
||||
{ 1, 5.5 },
|
||||
{ 2, 11 },
|
||||
};
|
||||
@@ -37,7 +37,7 @@ e@ieee.org
|
||||
#include "assertions.h"
|
||||
#include "PHY/defs_UE.h"
|
||||
#include "PHY/phy_extern_ue.h"
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
//#include "executables/nr-uesoftmodem.h"
|
||||
#include "targets/RT/USER/lte-softmodem.h"
|
||||
|
||||
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
|
||||
|
||||
@@ -56,7 +56,7 @@ RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
int nfapi_mode = 0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
|
||||
@@ -63,7 +63,7 @@ RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
int nfapi_mode=0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
//Dummy Functions
|
||||
@@ -552,6 +552,9 @@ int main(int argc, char **argv)
|
||||
nr_gold_pdcch(UE,0,2);
|
||||
|
||||
RC.nb_nr_macrlc_inst = 1;
|
||||
RC.nb_nr_mac_CC = (int*)malloc(RC.nb_nr_macrlc_inst*sizeof(int));
|
||||
for (i = 0; i < RC.nb_nr_macrlc_inst; i++)
|
||||
RC.nb_nr_mac_CC[i] = 1;
|
||||
mac_top_init_gNB();
|
||||
gNB_mac = RC.nrmac[0];
|
||||
|
||||
@@ -602,24 +605,26 @@ int main(int argc, char **argv)
|
||||
phy_procedures_gNB_TX(gNB,frame,slot,0);
|
||||
|
||||
//nr_common_signal_procedures (gNB,frame,subframe);
|
||||
int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP;
|
||||
|
||||
LOG_M("txsigF0.m","txsF0", gNB->common_vars.txdataF[0],frame_length_complex_samples_no_prefix,1,1);
|
||||
if (gNB->frame_parms.nb_antennas_tx>1)
|
||||
LOG_M("txsigF1.m","txsF1", gNB->common_vars.txdataF[1],frame_length_complex_samples_no_prefix,1,1);
|
||||
|
||||
int tx_offset = slot*frame_parms->samples_per_slot;
|
||||
printf("samples_per_slot_wCP = %d\n", frame_parms->samples_per_slot_wCP);
|
||||
|
||||
//TODO: loop over slots
|
||||
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) {
|
||||
if (gNB_config->subframe_config.dl_cyclic_prefix_type.value == 1) {
|
||||
PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
|
||||
PHY_ofdm_mod(&gNB->common_vars.txdataF[aa][txdataF_offset],
|
||||
&txdata[aa][tx_offset],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
12,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
nr_normal_prefix_mod(gNB->common_vars.txdataF[aa],
|
||||
nr_normal_prefix_mod(&gNB->common_vars.txdataF[aa][txdataF_offset],
|
||||
&txdata[aa][tx_offset],
|
||||
14,
|
||||
frame_parms);
|
||||
|
||||
@@ -55,7 +55,7 @@ RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
int nfapi_mode=0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
|
||||
@@ -53,7 +53,7 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
int nfapi_mode=0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
|
||||
@@ -55,7 +55,7 @@ RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
int nfapi_mode = 0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// needed for some functions
|
||||
|
||||
@@ -64,7 +64,7 @@ RAN_CONTEXT_t RC;
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
double cpuf;
|
||||
int nfapi_mode = 0;
|
||||
uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
// dummy functions
|
||||
@@ -394,6 +394,10 @@ int main(int argc, char **argv)
|
||||
gNB = RC.gNB[0][0];
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
|
||||
//memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = (nfapi_rx_indication_pdu_t *)malloc(NB_UE_INST*sizeof(nfapi_rx_indication_pdu_t));
|
||||
gNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
|
||||
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;
|
||||
|
||||
@@ -93,6 +93,7 @@ typedef enum {
|
||||
#define CONFIG_STRING_RU_SF_EXTENSION "sf_extension"
|
||||
#define CONFIG_STRING_RU_END_OF_BURST_DELAY "end_of_burst_delay"
|
||||
#define CONFIG_STRING_RU_OTA_SYNC_ENABLE "ota_sync_enabled"
|
||||
#define CONFIG_STRING_RU_BF_WEIGHTS_LIST "bf_weights"
|
||||
|
||||
#define RU_LOCAL_IF_NAME_IDX 0
|
||||
#define RU_LOCAL_ADDRESS_IDX 1
|
||||
@@ -118,23 +119,22 @@ typedef enum {
|
||||
#define RU_SF_EXTENSION_IDX 21
|
||||
#define RU_END_OF_BURST_DELAY_IDX 22
|
||||
#define RU_OTA_SYNC_ENABLE_IDX 23
|
||||
|
||||
|
||||
#define RU_BF_WEIGHTS_LIST_IDX 24
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define RUPARAMS_DESC { \
|
||||
{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \
|
||||
@@ -143,13 +143,14 @@ typedef enum {
|
||||
{CONFIG_STRING_RU_ENB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
|
||||
{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_IS_SLAVE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
|
||||
{CONFIG_STRING_RU_IS_SLAVE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFENBS, TYPE_INTARRAY, 1}, \
|
||||
{CONFIG_STRING_RU_SDR_ADDRS, NULL, 0, strptr:NULL, defstrval:"type=b200", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SDR_CLK_SRC, NULL, 0, strptr:NULL, defstrval:"internal", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_SF_EXTENSION, NULL, 0, uptr:NULL, defuintval:312, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_END_OF_BURST_DELAY, NULL, 0, uptr:NULL, defuintval:400, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_OTA_SYNC_ENABLE, NULL, 0, strptr:NULL, defstrval:"no", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_BF_WEIGHTS_LIST, NULL, 0, iptr:NULL, defintarrayval:DEFBFW, TYPE_INTARRAY, 0}, \
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -67,83 +67,9 @@ typedef enum {
|
||||
|
||||
#define CONFIG_STRING_ACTIVE_RUS "Active_RUs"
|
||||
/*------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RUs configuration section name */
|
||||
#define CONFIG_STRING_RU_LIST "RUs"
|
||||
#define CONFIG_STRING_RU_CONFIG "ru_config"
|
||||
|
||||
/* RUs configuration parameters name */
|
||||
#define CONFIG_STRING_RU_LOCAL_IF_NAME "local_if_name"
|
||||
#define CONFIG_STRING_RU_LOCAL_ADDRESS "local_address"
|
||||
#define CONFIG_STRING_RU_REMOTE_ADDRESS "remote_address"
|
||||
#define CONFIG_STRING_RU_LOCAL_PORTC "local_portc"
|
||||
#define CONFIG_STRING_RU_REMOTE_PORTC "remote_portc"
|
||||
#define CONFIG_STRING_RU_LOCAL_PORTD "local_portd"
|
||||
#define CONFIG_STRING_RU_REMOTE_PORTD "remote_portd"
|
||||
#define CONFIG_STRING_RU_LOCAL_RF "local_rf"
|
||||
#define CONFIG_STRING_RU_TRANSPORT_PREFERENCE "tr_preference"
|
||||
#define CONFIG_STRING_RU_BAND_LIST "bands"
|
||||
#define CONFIG_STRING_RU_GNB_LIST "gNB_instances"
|
||||
#define CONFIG_STRING_RU_NB_TX "nb_tx"
|
||||
#define CONFIG_STRING_RU_NB_RX "nb_rx"
|
||||
#define CONFIG_STRING_RU_ATT_TX "att_tx"
|
||||
#define CONFIG_STRING_RU_ATT_RX "att_rx"
|
||||
#define CONFIG_STRING_RU_MAX_RS_EPRE "max_pdschReferenceSignalPower"
|
||||
#define CONFIG_STRING_RU_MAX_RXGAIN "max_rxgain"
|
||||
#define CONFIG_STRING_RU_IF_COMPRESSION "if_compression"
|
||||
#define CONFIG_STRING_RU_NBIOTRRC_LIST "NbIoT_RRC_instances"
|
||||
#define CONFIG_STRING_RU_SDR_ADDRS "sdr_addrs"
|
||||
#define CONFIG_STRING_RU_SDR_CLK_SRC "clock_src"
|
||||
|
||||
#define RU_LOCAL_IF_NAME_IDX 0
|
||||
#define RU_LOCAL_ADDRESS_IDX 1
|
||||
#define RU_REMOTE_ADDRESS_IDX 2
|
||||
#define RU_LOCAL_PORTC_IDX 3
|
||||
#define RU_REMOTE_PORTC_IDX 4
|
||||
#define RU_LOCAL_PORTD_IDX 5
|
||||
#define RU_REMOTE_PORTD_IDX 6
|
||||
#define RU_TRANSPORT_PREFERENCE_IDX 7
|
||||
#define RU_LOCAL_RF_IDX 8
|
||||
#define RU_NB_TX_IDX 9
|
||||
#define RU_NB_RX_IDX 10
|
||||
#define RU_MAX_RS_EPRE_IDX 11
|
||||
#define RU_MAX_RXGAIN_IDX 12
|
||||
#define RU_BAND_LIST_IDX 13
|
||||
#define RU_GNB_LIST_IDX 14
|
||||
#define RU_ATT_TX_IDX 15
|
||||
#define RU_ATT_RX_IDX 16
|
||||
#define RU_IS_SLAVE_IDX 17
|
||||
#define RU_NBIOTRRC_LIST_IDX 18
|
||||
#define RU_SDR_ADDRS 19
|
||||
#define RU_SDR_CLK_SRC 20
|
||||
#define RU_SF_EXTENSION_IDX 21
|
||||
#define RU_END_OF_BURST_DELAY_IDX 22
|
||||
|
||||
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* RU configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define GNBRUPARAMS_DESC { \
|
||||
{CONFIG_STRING_RU_LOCAL_IF_NAME, NULL, 0, strptr:NULL, defstrval:"lo", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.2", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_ADDRESS, NULL, 0, strptr:NULL, defstrval:"127.0.0.1", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_PORTC, NULL, 0, uptr:NULL, defuintval:50000, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_REMOTE_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_TRANSPORT_PREFERENCE, NULL, 0, strptr:NULL, defstrval:"udp_if5", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_LOCAL_RF, NULL, 0, strptr:NULL, defstrval:"yes", TYPE_STRING, 0}, \
|
||||
{CONFIG_STRING_RU_NB_TX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_NB_RX, NULL, 0, uptr:NULL, defuintval:1, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_MAX_RS_EPRE, NULL, 0, iptr:NULL, defintval:-29, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_MAX_RXGAIN, NULL, 0, iptr:NULL, defintval:120, TYPE_INT, 0}, \
|
||||
{CONFIG_STRING_RU_BAND_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFNRBANDS, TYPE_INTARRAY, 1}, \
|
||||
{CONFIG_STRING_RU_GNB_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFGNBS, TYPE_INTARRAY, 1}, \
|
||||
{CONFIG_STRING_RU_ATT_TX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_ATT_RX, NULL, 0, uptr:NULL, defintval:0, TYPE_UINT, 0}, \
|
||||
{CONFIG_STRING_RU_NBIOTRRC_LIST, NULL, 0, uptr:NULL, defintarrayval:DEFGNBS, TYPE_INTARRAY, 1}, \
|
||||
}
|
||||
/* RUs configuration for gNB is the same for eNB */
|
||||
/* Check file enb_paramdef.h */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
|
||||
//#include "PHY/defs_common.h"
|
||||
#include "mac.h"
|
||||
|
||||
#include "RRC/LTE/rrc_defs.h"
|
||||
|
||||
extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
|
||||
@@ -51,13 +50,9 @@ extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
extern UE_MAC_INST *UE_mac_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 uint16_t NB_UE_INST;
|
||||
@@ -65,7 +60,6 @@ extern uint16_t NB_THREAD_INST;
|
||||
extern unsigned char NB_RN_INST;
|
||||
extern unsigned short NODE_ID[1];
|
||||
|
||||
|
||||
extern int cqi_to_mcs[16];
|
||||
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
136
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
Normal file
136
openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* 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_mac.h
|
||||
* \brief common MAC data structures, constant, and function prototype
|
||||
* \author R. Knopp, K.H. HSU, G. Casati
|
||||
* \date 2019
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST / Fraunhofer IIS
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr, guido.casati@iis.fraunhofer.de
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#ifndef __LAYER2_NR_MAC_H__
|
||||
#define __LAYER2_NR_MAC_H__
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define NR_BCCH_DL_SCH 3 // SI
|
||||
|
||||
#define NR_BCCH_BCH 5 // MIB
|
||||
|
||||
// For both DL/UL-SCH
|
||||
// Except:
|
||||
// - UL/DL-SCH: fixed-size MAC CE(known by LCID)
|
||||
// - UL/DL-SCH: padding
|
||||
// - UL-SCH: MSG3 48-bits
|
||||
// |0|1|2|3|4|5|6|7| bit-wise
|
||||
// |R|F| LCID |
|
||||
// | L |
|
||||
// |0|1|2|3|4|5|6|7| bit-wise
|
||||
// |R|F| LCID |
|
||||
// | L |
|
||||
// | L |
|
||||
|
||||
// For both DL/UL-SCH
|
||||
// For:
|
||||
// - UL/DL-SCH: fixed-size MAC CE(known by LCID)
|
||||
// - UL/DL-SCH: padding, for single/multiple 1-oct padding CE(s)
|
||||
// - UL-SCH: MSG3 48-bits
|
||||
// |0|1|2|3|4|5|6|7| bit-wise
|
||||
// |R|R| LCID |
|
||||
// LCID: The Logical Channel ID field identifies the logical channel instance of the corresponding MAC SDU or the type of the corresponding MAC CE or padding as described in Tables 6.2.1-1 and 6.2.1-2 for the DL-SCH and UL-SCH respectively. There is one LCID field per MAC subheader. The LCID field size is 6 bits;
|
||||
// L: The Length field indicates the length of the corresponding MAC SDU or variable-sized MAC CE in bytes. There is one L field per MAC subheader except for subheaders corresponding to fixed-sized MAC CEs and padding. The size of the L field is indicated by the F field;
|
||||
// F: lenght of L is 0:8 or 1:16 bits wide
|
||||
// R: Reserved bit, set to zero.
|
||||
|
||||
typedef struct {
|
||||
uint8_t LCID:6; // octet 1 [5:0]
|
||||
uint8_t F:1; // octet 1 [6]
|
||||
uint8_t R:1; // octet 1 [7]
|
||||
uint8_t L:8; // octet 2 [7:0]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_SHORT;
|
||||
|
||||
typedef struct {
|
||||
uint8_t LCID:6; // octet 1 [5:0]
|
||||
uint8_t F:1; // octet 1 [6]
|
||||
uint8_t R:1; // octet 1 [7]
|
||||
uint8_t L1:8; // octet 2 [7:0]
|
||||
uint8_t L2:8; // octet 3 [7:0]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_LONG;
|
||||
|
||||
typedef struct {
|
||||
uint8_t LCID:6; // octet 1 [5:0]
|
||||
uint8_t R:2; // octet 1 [7:6]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED;
|
||||
|
||||
// 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;
|
||||
|
||||
// 38.321 ch6.2.1, 38.331
|
||||
#define DL_SCH_LCID_CCCH 0x00
|
||||
#define DL_SCH_LCID_SRB1 0x01
|
||||
#define DL_SCH_LCID_SRB2 0x02
|
||||
#define DL_SCH_LCID_SRB3 0x03
|
||||
#define DL_SCH_LCID_RECOMMENDED_BITRATE 0x2F
|
||||
#define DL_SCH_LCID_SP_ZP_CSI_RS_RES_SET_ACT 0x30
|
||||
#define DL_SCH_LCID_PUCCH_SPATIAL_RELATION_ACT 0x31
|
||||
#define DL_SCH_LCID_SP_SRS_ACTIVATION 0x32
|
||||
#define DL_SCH_LCID_SP_CSI_REP_PUCCH_ACT 0x33
|
||||
#define DL_SCH_LCID_TCI_STATE_IND_UE_SPEC_PDCCH 0x34
|
||||
#define DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH 0x35
|
||||
#define DL_SCH_LCID_APERIODIC_CSI_TRI_STATE_SUBSEL 0x36
|
||||
#define DL_SCH_LCID_SP_CSI_RS_CSI_IM_RES_SET_ACT 0X37
|
||||
#define DL_SCH_LCID_DUPLICATION_ACT 0X38
|
||||
#define DL_SCH_LCID_SCell_ACT_4_OCT 0X39
|
||||
#define DL_SCH_LCID_SCell_ACT_1_OCT 0X3A
|
||||
#define DL_SCH_LCID_L_DRX 0x3B
|
||||
#define DL_SCH_LCID_DRX 0x3C
|
||||
#define DL_SCH_LCID_TA_COMMAND 0x3D
|
||||
#define DL_SCH_LCID_CON_RES_ID 0x3E
|
||||
#define DL_SCH_LCID_PADDING 0x3F
|
||||
|
||||
#define UL_SCH_LCID_CCCH 0x00
|
||||
#define UL_SCH_LCID_SRB1 0x01
|
||||
#define UL_SCH_LCID_SRB2 0x02
|
||||
#define UL_SCH_LCID_SRB3 0x03
|
||||
#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
|
||||
#define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37
|
||||
#define UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT 0x38
|
||||
#define UL_SCH_LCID_SINGLE_ENTRY_PHR 0x39
|
||||
#define UL_SCH_LCID_C_RNTI 0x3A
|
||||
#define UL_SCH_LCID_S_TRUNCATED_BSR 0x3B
|
||||
#define UL_SCH_LCID_L_TRUNCATED_BSR 0x3C
|
||||
#define UL_SCH_LCID_S_BSR 0x3D
|
||||
#define UL_SCH_LCID_L_BSR 0x3E
|
||||
#define UL_SCH_LCID_PADDING 0x3F
|
||||
|
||||
|
||||
#endif /*__LAYER2_MAC_H__ */
|
||||
73
openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h
Normal file
73
openair2/LAYER2/NR_MAC_COMMON/nr_mac_extern.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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 extern.h
|
||||
* \brief NR mac externs
|
||||
* \author G. Casati
|
||||
* \date 2019
|
||||
* \version 1.0
|
||||
* \email guido.casati@iis.fraunhofer.de
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
#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"
|
||||
|
||||
/* extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
|
||||
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
|
||||
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];
|
||||
extern mac_rlc_am_muilist_t rlc_am_mui;
|
||||
extern SCHEDULER_MODES global_scheduler_mode;
|
||||
extern unsigned char NB_UE_INST;*/
|
||||
|
||||
extern unsigned char NB_INST;
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern unsigned char NB_RN_INST;
|
||||
extern unsigned short NODE_ID[1];
|
||||
|
||||
/* Scheduler */
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern int phy_test;
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
/*#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;
|
||||
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
|
||||
@@ -37,10 +37,6 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define NR_BCCH_DL_SCH 3 // SI
|
||||
|
||||
#define NR_BCCH_BCH 5 // MIB
|
||||
|
||||
/*!\brief UE layer 2 status */
|
||||
typedef enum {
|
||||
UE_CONNECTION_OK = 0,
|
||||
@@ -49,65 +45,4 @@ typedef enum {
|
||||
UE_PHY_HO_PRACH
|
||||
} NR_UE_L2_STATE_t;
|
||||
|
||||
typedef struct {
|
||||
uint8_t LCID:6; // octet 1 [5:0]
|
||||
uint8_t F:1; // octet 1 [6]
|
||||
uint8_t R:1; // octet 1 [7]
|
||||
uint8_t L:8; // octet 2 [7:0]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_SHORT;
|
||||
|
||||
typedef struct {
|
||||
uint8_t LCID:6; // octet 1 [5:0]
|
||||
uint8_t F:1; // octet 1 [6]
|
||||
uint8_t R:1; // octet 1 [7]
|
||||
uint8_t L1:8; // octet 2 [7:0]
|
||||
uint8_t L2:8; // octet 3 [7:0]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_LONG;
|
||||
|
||||
typedef struct {
|
||||
uint8_t LCID:6; // octet 1 [5:0]
|
||||
uint8_t R:2; // octet 1 [7:6]
|
||||
} __attribute__ ((__packed__)) NR_MAC_SUBHEADER_FIXED;
|
||||
|
||||
// 38.321 ch6.2.1, 38.331
|
||||
#define DL_SCH_LCID_CCCH 0x00
|
||||
#define DL_SCH_LCID_SRB1 0x01
|
||||
#define DL_SCH_LCID_SRB2 0x02
|
||||
#define DL_SCH_LCID_SRB3 0x03
|
||||
#define DL_SCH_LCID_RECOMMENDED_BITRATE 0x2F
|
||||
#define DL_SCH_LCID_SP_ZP_CSI_RS_RES_SET_ACT 0x30
|
||||
#define DL_SCH_LCID_PUCCH_SPATIAL_RELATION_ACT 0x31
|
||||
#define DL_SCH_LCID_SP_SRS_ACTIVATION 0x32
|
||||
#define DL_SCH_LCID_SP_CSI_REP_PUCCH_ACT 0x33
|
||||
#define DL_SCH_LCID_TCI_STATE_IND_UE_SPEC_PDCCH 0x34
|
||||
#define DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH 0x35
|
||||
#define DL_SCH_LCID_APERIODIC_CSI_TRI_STATE_SUBSEL 0x36
|
||||
#define DL_SCH_LCID_SP_CSI_RS_CSI_IM_RES_SET_ACT 0X37
|
||||
#define DL_SCH_LCID_DUPLICATION_ACT 0X38
|
||||
#define DL_SCH_LCID_SCell_ACT_4_OCT 0X39
|
||||
#define DL_SCH_LCID_SCell_ACT_1_OCT 0X3A
|
||||
#define DL_SCH_LCID_L_DRX 0x3B
|
||||
#define DL_SCH_LCID_DRX 0x3C
|
||||
#define DL_SCH_LCID_TA_COMMAND 0x3D
|
||||
#define DL_SCH_LCID_CON_RES_ID 0x3E
|
||||
#define DL_SCH_LCID_PADDING 0x3F
|
||||
|
||||
#define UL_SCH_LCID_CCCH 0x00
|
||||
#define UL_SCH_LCID_SRB1 0x01
|
||||
#define UL_SCH_LCID_SRB2 0x02
|
||||
#define UL_SCH_LCID_SRB3 0x03
|
||||
#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
|
||||
#define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37
|
||||
#define UL_SCH_LCID_MULTI_ENTRY_PHR_1_OCT 0x38
|
||||
#define UL_SCH_LCID_SINGLE_ENTRY_PHR 0x39
|
||||
#define UL_SCH_LCID_C_RNTI 0x3A
|
||||
#define UL_SCH_LCID_S_TRUNCATED_BSR 0x3B
|
||||
#define UL_SCH_LCID_L_TRUNCATED_BSR 0x3C
|
||||
#define UL_SCH_LCID_S_BSR 0x3D
|
||||
#define UL_SCH_LCID_L_BSR 0x3E
|
||||
#define UL_SCH_LCID_PADDING 0x3F
|
||||
|
||||
|
||||
#endif /*__LAYER2_MAC_DEFS_H__ */
|
||||
#endif /*__LAYER2_NR_UE_MAC_DEFS_H__ */
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "mac_defs.h"
|
||||
|
||||
//extern NR_UE_MAC_INST_t *UE_mac_inst;
|
||||
|
||||
// Type0-PDCCH search space
|
||||
extern const int32_t table_38213_13_1_c2[16];
|
||||
extern const int32_t table_38213_13_1_c3[16];
|
||||
|
||||
@@ -125,16 +125,29 @@ 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
|
||||
@param frameP Current Rx frame
|
||||
@param ttiP Current Rx tti subframe
|
||||
@param pdu Pointer to the MAC PDU
|
||||
@param pdu_len Length of the MAC PDU
|
||||
@param eNB_id Index of eNB that UE is attached to
|
||||
@returns void
|
||||
*/
|
||||
void nr_ue_send_sdu(module_id_t module_idP,uint8_t CC_id, frame_t frameP, uint8_t ttiP,
|
||||
uint8_t * pdu, uint16_t pdu_len, uint8_t gNB_index, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
void nr_ue_process_mac_pdu(
|
||||
module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
uint8_t *pduP,
|
||||
uint16_t mac_pdu_len,
|
||||
uint8_t eNB_index);
|
||||
uint16_t mac_pdu_len,
|
||||
uint8_t eNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
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 nr_ue_send_sdu(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_frame_t subframeP, uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index);
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -21,22 +21,41 @@
|
||||
|
||||
/* \file ue_procedures.c
|
||||
* \brief procedures related to UE
|
||||
* \author R. Knopp, K.H. HSU
|
||||
* \author R. Knopp, K.H. HSU, G. Casati
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom / NTUST
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr
|
||||
* \email: knopp@eurecom.fr, kai-hsiang.hsu@eurecom.fr, guido.casati@iis.fraunhofer.de
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
/* MAC related headers */
|
||||
#include "mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#include "mac_extern.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*/
|
||||
#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"
|
||||
|
||||
/* log utils */
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "openair2/LAYER2/MAC/mac.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
|
||||
/* TODO remove this for debugging purpose
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
@@ -2028,21 +2047,91 @@ int8_t nr_ue_get_SR(module_id_t module_idP, int CC_id, frame_t frameP, uint8_t e
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_ue_send_sdu(module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
uint8_t ttiP,
|
||||
uint8_t * pdu, uint16_t pdu_len, uint8_t gNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){
|
||||
|
||||
LOG_D(MAC, "Handling PDU frame %d slot %d\n", frameP, ttiP);
|
||||
|
||||
// Changes wrt LTE: replaced subframeP with ttiP
|
||||
// TODO double check this and eventually create a type for TTI (tti_t)
|
||||
// Note: pdu_len was previously named sdu and sdu_len
|
||||
|
||||
uint8_t * pduP = pdu;
|
||||
NR_UE_MAC_INST_t *UE_mac_inst = get_mac_inst(module_idP);
|
||||
|
||||
/*
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
#endif
|
||||
*/
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_IN);
|
||||
|
||||
//LOG_D(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]);
|
||||
|
||||
if (opt_enabled) {
|
||||
trace_pdu(DIRECTION_DOWNLINK, pduP, pdu_len, module_idP, WS_C_RNTI,
|
||||
UE_mac_inst[module_idP].cs_RNTI, frameP, ttiP, 0, 0); //subframeP
|
||||
LOG_D(OPT, "[UE %d][DLSCH] Frame %d trace pdu for rnti %x with size %d\n",
|
||||
module_idP, frameP, UE_mac_inst[module_idP].cs_RNTI, pdu_len);
|
||||
}
|
||||
|
||||
/*
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC, "[UE %d] ue_send_sdu : Frame %d gNB_index %d : num_ce %d num_sdu %d\n",
|
||||
module_idP, frameP, gNB_index, num_ce, num_sdu);
|
||||
#endif
|
||||
*/
|
||||
|
||||
/*
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP);
|
||||
for (i = 0; i < 32; i++) {
|
||||
LOG_T(MAC, "%x.", sdu[i]);
|
||||
}
|
||||
LOG_T(MAC, "\n");
|
||||
#endif
|
||||
*/
|
||||
|
||||
// Processing MAC PDU
|
||||
// it parses MAC CEs subheaders, MAC CEs, SDU subheaderds and SDUs
|
||||
nr_ue_process_mac_pdu(module_idP, CC_id, pduP, pdu_len, gNB_index, ul_time_alignment);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT);
|
||||
|
||||
/*
|
||||
#if UE_TIMING_TRACE
|
||||
stop_meas(&UE_mac_inst[module_idP].rx_dlsch_sdu);
|
||||
#endif
|
||||
*/
|
||||
}
|
||||
|
||||
void nr_ue_process_mac_pdu(
|
||||
module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
uint8_t *pduP,
|
||||
uint16_t mac_pdu_len,
|
||||
uint8_t eNB_index){
|
||||
uint16_t mac_pdu_len,
|
||||
uint8_t gNB_index,
|
||||
NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){
|
||||
|
||||
// This function is adapting code from the old
|
||||
// parse_header(...) and ue_send_sdu(...) functions of OAI LTE
|
||||
|
||||
uint8_t *pdu_ptr = pduP;
|
||||
uint16_t pdu_len = mac_pdu_len;
|
||||
int pdu_len = mac_pdu_len;
|
||||
|
||||
uint16_t mac_ce_len;
|
||||
uint16_t mac_subheader_len;
|
||||
uint16_t mac_sdu_len;
|
||||
|
||||
NR_UE_MAC_INST_t *UE_mac_inst = get_mac_inst(module_idP);
|
||||
//uint8_t scs = UE_mac_inst->mib->subCarrierSpacingCommon;
|
||||
//uint16_t bwp_ul_NB_RB = UE_mac_inst->initial_bwp_ul.N_RB;
|
||||
|
||||
// For both DL/UL-SCH
|
||||
// Except:
|
||||
// - UL/DL-SCH: fixed-size MAC CE(known by LCID)
|
||||
@@ -2070,12 +2159,16 @@ void nr_ue_process_mac_pdu(
|
||||
|
||||
uint8_t done = 0;
|
||||
|
||||
while (!done || pdu_len <= 0){
|
||||
mac_ce_len = 0x0000;
|
||||
mac_subheader_len = 0x0001; // default to fixed-length subheader = 1-oct
|
||||
mac_sdu_len = 0x0000;
|
||||
while (!done && pdu_len > 0){
|
||||
mac_ce_len = 0;
|
||||
mac_subheader_len = 1; // default to fixed-length subheader = 1-oct
|
||||
mac_sdu_len = 0;
|
||||
switch(((NR_MAC_SUBHEADER_FIXED *)pdu_ptr)->LCID){
|
||||
// MAC CE
|
||||
|
||||
/*#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC, "[UE] LCID %d, PDU length %d\n", ((NR_MAC_SUBHEADER_FIXED *)pdu_ptr)->LCID, pdu_len);
|
||||
#endif*/
|
||||
case DL_SCH_LCID_CCCH:
|
||||
// MSG4 RRC Connection Setup 38.331
|
||||
// varialbe length
|
||||
@@ -2085,8 +2178,29 @@ void nr_ue_process_mac_pdu(
|
||||
mac_ce_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pdu_ptr)->L2)<<8;
|
||||
mac_subheader_len = 3;
|
||||
}
|
||||
|
||||
/*LOG_D(MAC, "[UE %d] rnti %x Frame %d : DLSCH -> DL-CCCH, RRC message (eNB %d, %d bytes)\n",
|
||||
module_idP, UE_mac_inst[module_idP].crnti, frameP, eNB_index, rx_lengths[i]);*/
|
||||
|
||||
/*#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
int j;
|
||||
for (j = 0; j < rx_lengths[i]; j++) {
|
||||
LOG_T(MAC, "%x.", (uint8_t) payload_ptr[j]);
|
||||
}
|
||||
LOG_T(MAC, "\n");
|
||||
#endif*/
|
||||
|
||||
/*mac_rrc_data_ind_ue(module_idP,
|
||||
CC_id,
|
||||
frameP, subframeP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
CCCH,
|
||||
(uint8_t *) payload_ptr,
|
||||
rx_lengths[i], eNB_index, 0);*/
|
||||
break;
|
||||
|
||||
case DL_SCH_LCID_TCI_STATE_ACT_UE_SPEC_PDSCH:
|
||||
|
||||
// 38.321 Ch6.1.3.14
|
||||
// varialbe length
|
||||
mac_ce_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->L;
|
||||
@@ -2172,10 +2286,69 @@ void nr_ue_process_mac_pdu(
|
||||
case DL_SCH_LCID_TA_COMMAND:
|
||||
// 38.321 Ch6.1.3.4
|
||||
mac_ce_len = 1;
|
||||
|
||||
/*uint8_t ta_command = ((NR_MAC_CE_TA *)pdu_ptr)[1].TA_COMMAND;
|
||||
uint8_t tag_id = ((NR_MAC_CE_TA *)pdu_ptr)[1].TAGID;*/
|
||||
|
||||
ul_time_alignment->apply_ta = 1;
|
||||
ul_time_alignment->ta_command = ((NR_MAC_CE_TA *)pdu_ptr)[1].TA_COMMAND;
|
||||
ul_time_alignment->tag_id = ((NR_MAC_CE_TA *)pdu_ptr)[1].TAGID;
|
||||
|
||||
/*
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC, "[UE] CE %d : UE Timing Advance : %d\n", i, pdu_ptr[1]);
|
||||
#endif
|
||||
*/
|
||||
|
||||
LOG_D(MAC, "Received TA_COMMAND %u TAGID %u CC_id %d\n", ul_time_alignment->ta_command, ul_time_alignment->tag_id, CC_id);
|
||||
|
||||
break;
|
||||
case DL_SCH_LCID_CON_RES_ID:
|
||||
// 38.321 Ch6.1.3.3
|
||||
mac_ce_len = 6;
|
||||
|
||||
// TODO index should be shifted by 1
|
||||
// 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, payload_ptr[0], payload_ptr[1], payload_ptr[2], payload_ptr[3], payload_ptr[4], payload_ptr[5]);
|
||||
|
||||
// TODO RACH is missing
|
||||
|
||||
/*if (UE_mac_inst[module_idP].RA_active == 1) {
|
||||
LOG_I(MAC, "[UE %d][RAPROC] Frame %d : Clearing RA_active flag\n",
|
||||
module_idP, frameP);
|
||||
UE_mac_inst[module_idP].RA_active = 0;
|
||||
// check if RA procedure has finished completely (no contention)
|
||||
tx_sdu = &UE_mac_inst[module_idP].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);
|
||||
if(nfapi_mode == 3) { // phy_stub mode
|
||||
// Modification for phy_stub mode operation here. We only need to make sure that the ue_mode is back to
|
||||
// PRACH state.
|
||||
LOG_I(MAC, "nfapi_mode3: Setting UE_mode BACK to PRACH 1\n");
|
||||
UE_mac_inst[module_idP].UE_mode[eNB_index] = PRACH;
|
||||
//ra_failed(module_idP,CC_id,eNB_index);UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
|
||||
}
|
||||
else{
|
||||
ra_failed(module_idP, CC_id, eNB_index);
|
||||
}
|
||||
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SEND_SDU, VCD_FUNCTION_OUT);
|
||||
return;
|
||||
}
|
||||
LOG_I(MAC,"[UE %d][RAPROC] Frame %d : Clearing contention resolution timer\n", module_idP, frameP);
|
||||
UE_mac_inst[module_idP].RA_contention_resolution_timer_active = 0;
|
||||
if(nfapi_mode == 3){
|
||||
// phy_stub mode
|
||||
// Modification for phy_stub mode operation here. We only need to change the ue_mode to PUSCH
|
||||
UE_mac_inst[module_idP].UE_mode[eNB_index] = PUSCH;
|
||||
} else { // Full stack mode
|
||||
ra_succeeded(module_idP,CC_id,eNB_index);
|
||||
}
|
||||
}*/
|
||||
|
||||
break;
|
||||
case DL_SCH_LCID_PADDING:
|
||||
done = 1;
|
||||
@@ -2183,235 +2356,62 @@ void nr_ue_process_mac_pdu(
|
||||
break;
|
||||
|
||||
// MAC SDU
|
||||
/* TODO double check SRBs 1-3 & DRB 1-3 */
|
||||
|
||||
case DL_SCH_LCID_SRB1:
|
||||
// check if LCID is valid at current time.
|
||||
// check if LCID is valid at current time.
|
||||
|
||||
/*if ((rx_lcids[i] == DCCH) || (rx_lcids[i] == DCCH1)) {
|
||||
|
||||
LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DCCH%d, RRC message (eNB %d, %d bytes)\n",
|
||||
module_idP, frameP, rx_lcids[i], eNB_index, rx_lengths[i]);
|
||||
|
||||
mac_rlc_data_ind(module_idP, UE_mac_inst[module_idP].crnti, eNB_index, frameP, ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO, rx_lcids[i], (char *) payload_ptr, rx_lengths[i], 1, NULL);
|
||||
} else if ((rx_lcids[i] < NB_RB_MAX) && (rx_lcids[i] > DCCH1)) {
|
||||
LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH%d (eNB %d, %d bytes)\n",
|
||||
module_idP, frameP, rx_lcids[i], eNB_index, rx_lengths[i]);
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
int j;
|
||||
for (j = 0; j < rx_lengths[i]; j++)
|
||||
LOG_T(MAC, "%x.", (unsigned char) payload_ptr[j]);
|
||||
LOG_T(MAC, "\n");
|
||||
#endif
|
||||
|
||||
mac_rlc_data_ind(module_idP,
|
||||
UE_mac_inst[module_idP].crnti,
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *) payload_ptr, rx_lengths[i], 1, NULL);
|
||||
}*/
|
||||
|
||||
case UL_SCH_LCID_SRB2:
|
||||
// check if LCID is valid at current time.
|
||||
case UL_SCH_LCID_SRB3:
|
||||
// check if LCID is valid at current time.
|
||||
default:
|
||||
// check if LCID is valid at current time.
|
||||
mac_sdu_len |= (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->L;
|
||||
mac_subheader_len = 2;
|
||||
if(((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->F){
|
||||
mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pdu_ptr)->L2)<<8;
|
||||
//mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pdu_ptr)->L2)<<8;
|
||||
mac_subheader_len = 3;
|
||||
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pdu_ptr)->L1 & 0x7f) << 8)
|
||||
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pdu_ptr)->L2 & 0xff);
|
||||
|
||||
} else {
|
||||
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pdu_ptr)->L;
|
||||
mac_subheader_len = 2;
|
||||
}
|
||||
|
||||
// DRB LCID by RRC
|
||||
break;
|
||||
}
|
||||
pdu_ptr += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
|
||||
pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len );
|
||||
|
||||
AssertFatal(pdu_len >= 0, "[MAC] nr_ue_process_mac_pdu, residual mac pdu length < 0!\n");
|
||||
}
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
||||
|
||||
unsigned char *parse_header(unsigned char *mac_header,
|
||||
unsigned char *num_ce,
|
||||
unsigned char *num_sdu,
|
||||
unsigned char *rx_ces,
|
||||
unsigned char *rx_lcids,
|
||||
unsigned short *rx_lengths,
|
||||
unsigned short tb_length)
|
||||
{
|
||||
|
||||
unsigned char not_done = 1, num_ces = 0, num_cont_res =
|
||||
0, num_padding = 0, num_sdus = 0, lcid, num_sdu_cnt;
|
||||
unsigned char *mac_header_ptr = mac_header;
|
||||
unsigned short length, ce_len = 0;
|
||||
|
||||
while (not_done == 1) {
|
||||
|
||||
if (((SCH_SUBHEADER_FIXED *) mac_header_ptr)->E == 0) {
|
||||
// printf("E=0\n");
|
||||
not_done = 0;
|
||||
}
|
||||
|
||||
lcid = ((SCH_SUBHEADER_FIXED *) mac_header_ptr)->LCID;
|
||||
|
||||
if (lcid < UE_CONT_RES) {
|
||||
//printf("[MAC][UE] header %x.%x.%x\n",mac_header_ptr[0],mac_header_ptr[1],mac_header_ptr[2]);
|
||||
if (not_done == 0) { // last MAC SDU, length is implicit
|
||||
mac_header_ptr++;
|
||||
length =
|
||||
tb_length - (mac_header_ptr - mac_header) - ce_len;
|
||||
|
||||
for (num_sdu_cnt = 0; num_sdu_cnt < num_sdus;
|
||||
num_sdu_cnt++) {
|
||||
length -= rx_lengths[num_sdu_cnt];
|
||||
}
|
||||
} else {
|
||||
if (((SCH_SUBHEADER_LONG *) mac_header_ptr)->F == 1) {
|
||||
length =
|
||||
((((SCH_SUBHEADER_LONG *) mac_header_ptr)->
|
||||
L_MSB & 0x7f)
|
||||
<< 8) | (((SCH_SUBHEADER_LONG *) mac_header_ptr)->
|
||||
L_LSB & 0xff);
|
||||
mac_header_ptr += 3;
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC, "[UE] parse long sdu, size %x \n", length);
|
||||
#endif
|
||||
|
||||
} else { //if (((SCH_SUBHEADER_SHORT *)mac_header_ptr)->F == 0) {
|
||||
length = ((SCH_SUBHEADER_SHORT *) mac_header_ptr)->L;
|
||||
mac_header_ptr += 2;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC, "[UE] sdu %d lcid %d length %d (offset now %ld)\n",
|
||||
num_sdus, lcid, length, mac_header_ptr - mac_header);
|
||||
#endif
|
||||
rx_lcids[num_sdus] = lcid;
|
||||
rx_lengths[num_sdus] = length;
|
||||
num_sdus++;
|
||||
} else { // This is a control element subheader
|
||||
if (lcid == SHORT_PADDING) {
|
||||
num_padding++;
|
||||
mac_header_ptr++;
|
||||
} else {
|
||||
rx_ces[num_ces] = lcid;
|
||||
num_ces++;
|
||||
mac_header_ptr++;
|
||||
|
||||
if (lcid == TIMING_ADV_CMD) {
|
||||
ce_len++;
|
||||
} else if (lcid == UE_CONT_RES) {
|
||||
|
||||
// FNA: check MAC Header is one of thoses defined in Annex B of 36.321
|
||||
// Check there is only 1 Contention Resolution
|
||||
if (num_cont_res) {
|
||||
LOG_W(MAC,
|
||||
"[UE] Msg4 Wrong received format: More than 1 Contention Resolution\n");
|
||||
// exit parsing
|
||||
return NULL;
|
||||
|
||||
}
|
||||
// UE_CONT_RES shall never be the last subheader unless this is the only MAC subheader
|
||||
if ((not_done == 0)
|
||||
&& ((num_sdus) || (num_ces > 1) || (num_padding))) {
|
||||
LOG_W(MAC,
|
||||
"[UE] Msg4 Wrong received format: Contention Resolution after num_ces=%d num_sdus=%d num_padding=%d\n",
|
||||
num_ces, num_sdus, num_padding);
|
||||
// exit parsing
|
||||
return NULL;
|
||||
}
|
||||
num_cont_res++;
|
||||
ce_len += 6;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC, "[UE] ce %d lcid %d (offset now %ld)\n", num_ces,
|
||||
lcid, mac_header_ptr - mac_header);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
*num_ce = num_ces;
|
||||
*num_sdu = num_sdus;
|
||||
|
||||
return (mac_header_ptr);
|
||||
}
|
||||
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void
|
||||
nr_ue_send_sdu(module_id_t module_idP,
|
||||
uint8_t CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t subframeP,
|
||||
uint8_t * sdu, uint16_t sdu_len, uint8_t eNB_index)
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
|
||||
unsigned char rx_ces[MAX_NUM_CE], num_ce, num_sdu, i, *payload_ptr;
|
||||
unsigned char rx_lcids[NB_RB_MAX];
|
||||
unsigned short rx_lengths[NB_RB_MAX];
|
||||
|
||||
|
||||
//LOG_D(MAC,"sdu: %x.%x.%x\n",sdu[0],sdu[1],sdu[2]);
|
||||
|
||||
|
||||
payload_ptr =
|
||||
parse_header(sdu, &num_ce, &num_sdu, rx_ces, rx_lcids, rx_lengths,
|
||||
sdu_len);
|
||||
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_D(MAC,
|
||||
"[UE %d] ue_send_sdu : Frame %d eNB_index %d : num_ce %d num_sdu %d\n",
|
||||
module_idP, frameP, eNB_index, num_ce, num_sdu);
|
||||
#endif
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP);
|
||||
|
||||
for (i = 0; i < 32; i++) {
|
||||
LOG_T(MAC, "%x.", sdu[i]);
|
||||
}
|
||||
|
||||
LOG_T(MAC, "\n");
|
||||
#endif
|
||||
|
||||
if (payload_ptr != NULL) {
|
||||
|
||||
for (i = 0; i < num_ce; i++) {
|
||||
// printf("ce %d : %d\n",i,rx_ces[i]);
|
||||
switch (rx_ces[i]) {
|
||||
case UE_CONT_RES:
|
||||
|
||||
break;
|
||||
|
||||
case TIMING_ADV_CMD:
|
||||
|
||||
break;
|
||||
|
||||
case DRX_CMD:
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < num_sdu; i++) {
|
||||
#ifdef DEBUG_HEADER_PARSING
|
||||
LOG_I(MAC, "[UE] SDU %d : LCID %d, length %d\n", i,
|
||||
rx_lcids[i], rx_lengths[i]);
|
||||
#endif
|
||||
if ((rx_lcids[i] < NB_RB_MAX) && (rx_lcids[i] > DCCH1)) {
|
||||
|
||||
LOG_D(MAC,
|
||||
"[UE %d] Frame %d : DLSCH -> DL-DTCH%d (eNB %d, %d bytes)\n",
|
||||
module_idP, frameP, rx_lcids[i], eNB_index,
|
||||
rx_lengths[i]);
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_I(MAC, "Printing MAC PDU contents at slot: %d \n", subframeP);
|
||||
int j;
|
||||
for (j = 0; j < 20; j++) //rx_lengths[i]
|
||||
LOG_I(MAC, "%x.", (unsigned char) payload_ptr[j]);
|
||||
LOG_I(MAC, "\n");
|
||||
#endif
|
||||
mac_rlc_data_ind(module_idP,
|
||||
4660, //UE_mac_inst[module_idP].crnti //hardcode value corresponding to the one from the eNB
|
||||
eNB_index,
|
||||
frameP,
|
||||
ENB_FLAG_NO,
|
||||
MBMS_FLAG_NO,
|
||||
rx_lcids[i],
|
||||
(char *) payload_ptr, rx_lengths[i], 1,
|
||||
NULL);
|
||||
} else {
|
||||
LOG_E(MAC, "[UE %d] Frame %d : unknown LCID %d (eNB %d)\n",
|
||||
module_idP, frameP, rx_lcids[i], eNB_index);
|
||||
}
|
||||
payload_ptr += rx_lengths[i];
|
||||
}
|
||||
} // end if (payload_ptr != NULL)
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -33,9 +33,10 @@
|
||||
#include "assertions.h"
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
@@ -64,10 +65,6 @@
|
||||
#define ENABLE_MAC_PAYLOAD_DEBUG
|
||||
#define DEBUG_eNB_SCHEDULER 1
|
||||
|
||||
extern RAN_CONTEXT_t RC;
|
||||
extern int phy_test;
|
||||
extern uint8_t nfapi_mode;
|
||||
|
||||
uint16_t nr_pdcch_order_table[6] = { 31, 31, 511, 2047, 2047, 8191 };
|
||||
|
||||
void clear_nr_nfapi_information(gNB_MAC_INST * gNB,
|
||||
@@ -302,12 +299,12 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
protocol_ctxt_t ctxt;
|
||||
|
||||
int CC_id, i = -1;
|
||||
UE_list_t *UE_list = &RC.nrmac[module_idP]->UE_list;
|
||||
rnti_t rnti;
|
||||
|
||||
NR_COMMON_channels_t *cc = RC.nrmac[module_idP]->common_channels;
|
||||
//nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config = NULL;
|
||||
int CC_id, i = -1, UE_id = 0;
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
UE_list_t *UE_list = &gNB->UE_list;
|
||||
rnti_t rnti;
|
||||
UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
NR_COMMON_channels_t *cc = gNB->common_channels;
|
||||
|
||||
start_meas(&RC.nrmac[module_idP]->eNB_scheduler);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ENB_DLSCH_ULSCH_SCHEDULER,VCD_FUNCTION_IN);
|
||||
@@ -375,12 +372,28 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
|
||||
// Phytest scheduling
|
||||
|
||||
if (slot_rxP==2){
|
||||
// TODO once RACH is available, start ta_timer when UE is connected
|
||||
if (ue_sched_ctl->ta_timer) ue_sched_ctl->ta_timer--;
|
||||
|
||||
if (ue_sched_ctl->ta_timer == 0) {
|
||||
gNB->ta_command = ue_sched_ctl->ta_update;
|
||||
/* if time is up, then set the timer to not send it for 5 frames
|
||||
// regardless of the TA value */
|
||||
ue_sched_ctl->ta_timer = 100;
|
||||
/* reset ta_update */
|
||||
ue_sched_ctl->ta_update = 31;
|
||||
/* MAC CE flag indicating TA length */
|
||||
gNB->ta_len = 2;
|
||||
}
|
||||
|
||||
if (slot_rxP == NR_UPLINK_SLOT){
|
||||
nr_schedule_uss_ulsch_phytest(&RC.nrmac[module_idP]->UL_tti_req[0], frame_rxP, slot_rxP);
|
||||
}
|
||||
|
||||
if (slot_txP==1){
|
||||
if (slot_txP == NR_DOWNLINK_SLOT){
|
||||
nr_schedule_uss_dlsch_phytest(module_idP, frame_txP, slot_txP,NULL);
|
||||
// resetting ta flag
|
||||
gNB->ta_len = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include "assertions.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "UTIL/OPT/opt.h"
|
||||
|
||||
181
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
Normal file
181
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_dlsch.c
Normal file
@@ -0,0 +1,181 @@
|
||||
/*
|
||||
* 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 gNB_scheduler_dlsch.c
|
||||
* \brief procedures related to gNB for the DLSCH transport channel
|
||||
* \author Guido Casati
|
||||
* \date 2019
|
||||
* \email: guido.casati@iis.fraunhofe.de
|
||||
* \version 1.0
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
/*PHY*/
|
||||
#include "PHY/CODING/coding_defs.h"
|
||||
#include "PHY/defs_nr_common.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
|
||||
/*MAC*/
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
|
||||
/*NFAPI*/
|
||||
#include "nfapi_nr_interface.h"
|
||||
/*TAG*/
|
||||
#include "NR_TAG-Id.h"
|
||||
|
||||
|
||||
int nr_generate_dlsch_pdu(module_id_t module_idP,
|
||||
unsigned char *sdus_payload,
|
||||
unsigned char *mac_pdu,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
unsigned char *sdu_lcids,
|
||||
unsigned char drx_cmd,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned short post_padding){
|
||||
|
||||
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
|
||||
|
||||
NR_MAC_SUBHEADER_FIXED *mac_pdu_ptr = (NR_MAC_SUBHEADER_FIXED *) mac_pdu;
|
||||
unsigned char * dlsch_buffer_ptr = sdus_payload;
|
||||
uint8_t last_size = 0;
|
||||
int offset = 0, mac_ce_size, i, timing_advance_cmd, tag_id = 0;
|
||||
|
||||
// MAC CEs
|
||||
uint8_t mac_header_control_elements[16], *ce_ptr;
|
||||
ce_ptr = &mac_header_control_elements[0];
|
||||
|
||||
// 1) Compute MAC CE and related subheaders
|
||||
|
||||
// DRX command subheader (MAC CE size 0)
|
||||
if (drx_cmd != 255) {
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = DL_SCH_LCID_DRX;
|
||||
//last_size = 1;
|
||||
mac_pdu_ptr++;
|
||||
}
|
||||
|
||||
// Timing Advance subheader
|
||||
/* This was done only when timing_advance_cmd != 31
|
||||
// now TA is always send when ta_timer resets regardless of its value
|
||||
// this is done to avoid issues with the timeAlignmentTimer which is
|
||||
// supposed to monitor if the UE received TA or not */
|
||||
if (gNB->ta_len){
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = DL_SCH_LCID_TA_COMMAND;
|
||||
//last_size = 1;
|
||||
mac_pdu_ptr++;
|
||||
|
||||
// TA MAC CE (1 octet)
|
||||
timing_advance_cmd = gNB->ta_command;
|
||||
AssertFatal(timing_advance_cmd < 64,"timing_advance_cmd %d > 63\n", timing_advance_cmd);
|
||||
((NR_MAC_CE_TA *) ce_ptr)->TA_COMMAND = timing_advance_cmd; //(timing_advance_cmd+31)&0x3f;
|
||||
if (gNB->tag->tag_Id != NULL){
|
||||
tag_id = gNB->tag->tag_Id;
|
||||
((NR_MAC_CE_TA *) ce_ptr)->TAGID = tag_id;
|
||||
}
|
||||
|
||||
LOG_D(MAC, "NR MAC CE timing advance command = %d (%d) TAG ID = %d\n", timing_advance_cmd, ((NR_MAC_CE_TA *) ce_ptr)->TA_COMMAND, tag_id);
|
||||
mac_ce_size = sizeof(NR_MAC_CE_TA);
|
||||
|
||||
// Copying bytes for 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;
|
||||
}
|
||||
|
||||
|
||||
// Contention resolution fixed subheader and MAC CE
|
||||
if (ue_cont_res_id) {
|
||||
mac_pdu_ptr->R = 0;
|
||||
mac_pdu_ptr->LCID = DL_SCH_LCID_CON_RES_ID;
|
||||
mac_pdu_ptr++;
|
||||
//last_size = 1;
|
||||
|
||||
// contention resolution identity MAC ce has a fixed 48 bit size
|
||||
// this contains the UL CCCH SDU. If UL CCCH SDU is longer than 48 bits,
|
||||
// it contains the first 48 bits of the UL CCCH SDU
|
||||
LOG_T(MAC, "[gNB ][RAPROC] Generate contention resolution msg: %x.%x.%x.%x.%x.%x\n",
|
||||
ue_cont_res_id[0], ue_cont_res_id[1], ue_cont_res_id[2],
|
||||
ue_cont_res_id[3], ue_cont_res_id[4], ue_cont_res_id[5]);
|
||||
|
||||
// Copying bytes (6 octects) to CEs pointer
|
||||
mac_ce_size = 6;
|
||||
memcpy(ce_ptr, ue_cont_res_id, mac_ce_size);
|
||||
|
||||
// Copying bytes for MAC CEs to 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;
|
||||
}
|
||||
|
||||
|
||||
// 2) Generation of DLSCH MAC SDU subheaders
|
||||
for (i = 0; i < num_sdus; i++) {
|
||||
LOG_D(MAC, "[gNB] Generate DLSCH header num sdu %d len sdu %d\n", num_sdus, sdu_lengths[i]);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
mac_pdu_ptr += last_size;
|
||||
|
||||
// 3) cycle through SDUs, compute each relevant and place dlsch_buffer in
|
||||
memcpy((void *) mac_pdu_ptr, (void *) dlsch_buffer_ptr, sdu_lengths[i]);
|
||||
dlsch_buffer_ptr+= sdu_lengths[i];
|
||||
mac_pdu_ptr += sdu_lengths[i];
|
||||
}
|
||||
|
||||
// 4) Compute final offset for padding
|
||||
if (post_padding > 0) {
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->R = 0;
|
||||
((NR_MAC_SUBHEADER_FIXED *) mac_pdu_ptr)->LCID = DL_SCH_LCID_PADDING;
|
||||
mac_pdu_ptr++;
|
||||
|
||||
// compute final offset
|
||||
offset = ((unsigned char *) mac_pdu_ptr - mac_pdu);
|
||||
|
||||
} else {
|
||||
// no MAC subPDU with padding
|
||||
}
|
||||
|
||||
//printf("Offset %d \n", ((unsigned char *) mac_pdu_ptr - mac_pdu));
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
||||
/* functionalities of this function have been moved to nr_schedule_uss_dlsch_phytest */
|
||||
void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slotP){
|
||||
}
|
||||
@@ -260,68 +260,70 @@ int configure_fapi_dl_Tx(nfapi_nr_dl_config_request_body_t *dl_req,
|
||||
return TBS/8; //Return TBS in bytes
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP,
|
||||
nfapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config) {
|
||||
LOG_D(MAC, "In nr_schedule_uss_dlsch_phytest \n");
|
||||
uint8_t CC_id;
|
||||
gNB_MAC_INST *nr_mac = RC.nrmac[module_idP];
|
||||
//NR_COMMON_channels_t *cc = nr_mac->common_channels;
|
||||
nfapi_nr_dl_config_request_body_t *dl_req;
|
||||
nfapi_tx_request_pdu_t *TX_req;
|
||||
uint16_t rnti = 0x1234;
|
||||
nfapi_nr_config_request_t *cfg = &nr_mac->config[0];
|
||||
uint16_t sfn_sf = frameP << 7 | slotP;
|
||||
// everything here is hard-coded to 30 kHz
|
||||
//int scs = get_dlscs(cfg);
|
||||
//int slots_per_frame = get_spf(cfg);
|
||||
int TBS;
|
||||
int TBS_bytes;
|
||||
int lcid;
|
||||
int ta_len = 0;
|
||||
int header_length_total=0;
|
||||
int header_length_last;
|
||||
int sdu_length_total = 0;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
uint16_t sdu_lengths[NB_RB_MAX];
|
||||
int num_sdus = 0;
|
||||
unsigned char dlsch_buffer[MAX_DLSCH_PAYLOAD_BYTES];
|
||||
int offset;
|
||||
int UE_id = 0;
|
||||
unsigned char sdu_lcids[NB_RB_MAX];
|
||||
int padding = 0, post_padding = 0;
|
||||
UE_list_t *UE_list = &nr_mac->UE_list;
|
||||
DLSCH_PDU DLSCH_pdu;
|
||||
//DLSCH_PDU *DLSCH_pdu = (DLSCH_PDU*) malloc(sizeof(DLSCH_PDU));
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
LOG_D(MAC, "Scheduling UE specific search space DCI type 1 for CC_id %d\n",CC_id);
|
||||
dl_req = &nr_mac->DL_req[CC_id].dl_config_request_body;
|
||||
TX_req = &nr_mac->TX_req[CC_id].tx_request_body.tx_pdu_list[nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
gNB_MAC_INST *gNB_mac = RC.nrmac[module_idP];
|
||||
UE_list_t *UE_list = &gNB_mac->UE_list;
|
||||
nfapi_nr_dl_config_request_body_t *dl_req;
|
||||
nfapi_tx_request_pdu_t *TX_req;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
nfapi_nr_config_request_t *cfg = &gNB_mac->config[0];
|
||||
|
||||
// TODO not sure why NR_MAX_NB_RB was used here
|
||||
unsigned char sdu_lcids[NB_RB_MAX] = {0};
|
||||
uint16_t sdu_lengths[NB_RB_MAX] = {0};
|
||||
|
||||
int padding = 0, post_padding = 0, ta_len = 0, header_length_total = 0, sdu_length_total = 0, num_sdus = 0;
|
||||
int CC_id, lcid, offset, i, j=0, k=0, header_length_last, TBS_bytes;
|
||||
|
||||
// hardcoded parameters to 30 kHz
|
||||
// for DMRS configuration type 1
|
||||
unsigned char dlsch_buffer[MAX_NR_DLSCH_PAYLOAD_BYTES];
|
||||
uint8_t Qm = 2;
|
||||
uint16_t R = 697;
|
||||
uint16_t nb_rb = 50;
|
||||
uint32_t TBS = nr_compute_tbs(Qm, R, nb_rb, 12, 6, 0, 1)/8; // this is in bits TODO use nr_get_tbs
|
||||
int UE_id = 0; // UE_list->head is -1 !
|
||||
uint16_t rnti = 0x1234;
|
||||
uint16_t sfn_sf = frameP << 7 | slotP;
|
||||
|
||||
UE_sched_ctrl_t *ue_sched_ctl = &UE_list->UE_sched_ctrl[UE_id];
|
||||
//ta_update = ue_sched_ctl->ta_update;
|
||||
|
||||
for (CC_id = 0; CC_id < RC.nb_nr_mac_CC[module_idP]; CC_id++) {
|
||||
|
||||
LOG_D(MAC, "Scheduling UE specific search space DCI type 1 for UE_id %d CC_id %d frame %d slot %d\n", UE_id, CC_id, frameP, slotP);
|
||||
|
||||
dl_req = &gNB_mac->DL_req[CC_id].dl_config_request_body;
|
||||
TX_req = &gNB_mac->TX_req[CC_id].tx_request_body.tx_pdu_list[gNB_mac->TX_req[CC_id].tx_request_body.number_of_pdus];
|
||||
ta_len = gNB_mac->ta_len;
|
||||
|
||||
//The --NOS1 use case currently schedules DLSCH transmissions only when there is IP traffic arriving
|
||||
//through the LTE stack
|
||||
if (IS_SOFTMODEM_NOS1) {
|
||||
memset(&DLSCH_pdu, 0, sizeof(DLSCH_pdu));
|
||||
int ta_update = 31;
|
||||
ta_len = 0;
|
||||
if (IS_SOFTMODEM_NOS1){
|
||||
|
||||
|
||||
// Hardcode it for now
|
||||
TBS = 6784/8; //TBS in bytes
|
||||
//TBS = 6784/8; //TBS in bytes
|
||||
//nr_get_tbs_dl(&dl_config_dlsch_pdu->dlsch_pdu, dl_config_dci_pdu->dci_dl_pdu, *cfg);
|
||||
//TBS = dl_config_dlsch_pdu->dlsch_pdu.dlsch_pdu_rel15.transport_block_size;
|
||||
|
||||
/* TODO
|
||||
// RLC data on DCCH
|
||||
if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) {
|
||||
}*/
|
||||
|
||||
/* TODO
|
||||
// RLC data on DCCH1
|
||||
if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) {
|
||||
}*/
|
||||
|
||||
for (lcid = NB_RB_MAX - 1; lcid >= DTCH; lcid--) {
|
||||
// TODO: check if the lcid is active
|
||||
LOG_D(MAC, "[eNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
|
||||
module_idP, frameP, lcid, TBS,
|
||||
TBS - ta_len - header_length_total - sdu_length_total - 3);
|
||||
LOG_D(MAC, "[gNB %d], Frame %d, DTCH%d->DLSCH, Checking RLC status (tbs %d, len %d)\n",
|
||||
module_idP, frameP, lcid, TBS, TBS - ta_len - header_length_total - sdu_length_total - 3);
|
||||
|
||||
if (TBS - ta_len - header_length_total - sdu_length_total - 3 > 0) {
|
||||
rlc_status = mac_rlc_status_ind(module_idP,
|
||||
@@ -337,127 +339,149 @@ void nr_schedule_uss_dlsch_phytest(module_id_t module_idP,
|
||||
0);
|
||||
|
||||
if (rlc_status.bytes_in_buffer > 0) {
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d), TBS: %d \n \n",
|
||||
module_idP, frameP,
|
||||
TBS - ta_len - header_length_total - sdu_length_total - 3,
|
||||
lcid,
|
||||
header_length_total,
|
||||
TBS);
|
||||
LOG_D(MAC, "[gNB %d][USER-PLANE DEFAULT DRB] Frame %d : DTCH->DLSCH, Requesting %d bytes from RLC (lcid %d total hdr len %d), TBS: %d \n \n",
|
||||
module_idP, frameP, TBS - ta_len - header_length_total - sdu_length_total - 3,
|
||||
lcid, header_length_total, TBS);
|
||||
|
||||
sdu_lengths[num_sdus] = mac_rlc_data_req(module_idP,
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS,
|
||||
(char *)&dlsch_buffer[sdu_length_total],
|
||||
0,
|
||||
0);
|
||||
LOG_D(MAC,
|
||||
"[eNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n",
|
||||
module_idP, sdu_lengths[num_sdus], lcid);
|
||||
rnti,
|
||||
module_idP,
|
||||
frameP,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
TBS,
|
||||
(char *)&dlsch_buffer[sdu_length_total],
|
||||
0,
|
||||
0);
|
||||
|
||||
LOG_D(MAC, "[gNB %d][USER-PLANE DEFAULT DRB] Got %d bytes for DTCH %d \n", module_idP, sdu_lengths[num_sdus], lcid);
|
||||
|
||||
sdu_lcids[num_sdus] = lcid;
|
||||
sdu_length_total += sdu_lengths[num_sdus];
|
||||
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_pdu_tx[lcid]++;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].lcid_sdu[num_sdus] = lcid;
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].sdu_length_tx[lcid] = sdu_lengths[num_sdus];
|
||||
UE_list->eNB_UE_stats[CC_id][UE_id].num_bytes_tx[lcid] += sdu_lengths[num_sdus];
|
||||
|
||||
header_length_last = 1 + 1 + (sdu_lengths[num_sdus] >= 128);
|
||||
header_length_total += header_length_last;
|
||||
|
||||
num_sdus++;
|
||||
UE_list->UE_sched_ctrl[UE_id].uplane_inactivity_timer = 0;
|
||||
|
||||
ue_sched_ctl->uplane_inactivity_timer = 0;
|
||||
}
|
||||
} else {
|
||||
// no TBS left
|
||||
} else { // no TBS left
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// // last header does not have length field
|
||||
// if (header_length_total) {
|
||||
// header_length_total -= header_length_last;
|
||||
// header_length_total++;
|
||||
// }
|
||||
|
||||
} //if (IS_SOFTMODEM_NOS1)
|
||||
else {
|
||||
//When the --NOS1 option is not enabled, DLSCH transmissions with random data
|
||||
//occur every time that the current function is called (dlsch phytest mode)
|
||||
|
||||
|
||||
// fill dlsch_buffer with random data
|
||||
for (i = 0; i < TBS/8; i++){
|
||||
dlsch_buffer[i] = (unsigned char) rand(); //i&0xFF;
|
||||
}
|
||||
|
||||
//Sending SDUs with size 1
|
||||
//Initialize elements of sdu_lcids and sdu_lengths
|
||||
//TODO this will be eventually be removed
|
||||
while (TBS >= 3 + header_length_total + sdu_length_total + ta_len){
|
||||
if (k < NR_MAX_NB_RB && j < NR_MAX_NB_RB){
|
||||
sdu_lcids[j] = 0x05; // DRB
|
||||
sdu_lengths[k] = 1;
|
||||
header_length_total += 2;
|
||||
sdu_length_total += 1;
|
||||
num_sdus +=1;
|
||||
k++, j++;
|
||||
}
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} // else IS_SOFTMODEM_NOS1
|
||||
|
||||
// last header does not have length field
|
||||
if (header_length_total) {
|
||||
header_length_total -= header_length_last;
|
||||
header_length_total++;
|
||||
// there is at least one SDU or TA command
|
||||
// if (num_sdus > 0 ){
|
||||
if (ta_len + sdu_length_total + header_length_total > 0) {
|
||||
|
||||
// Check if there is data from RLC or CE
|
||||
if (TBS >= 2 + header_length_total + sdu_length_total + ta_len) {
|
||||
// we have to consider padding
|
||||
// padding param currently not in use
|
||||
padding = TBS - header_length_total - sdu_length_total - ta_len - 1;
|
||||
post_padding = 1;
|
||||
} else {
|
||||
padding = 0;
|
||||
post_padding = 0;
|
||||
}
|
||||
|
||||
if (ta_len + sdu_length_total + header_length_total > 0) {
|
||||
if (TBS - header_length_total - sdu_length_total - ta_len <= 2) {
|
||||
padding = TBS - header_length_total - sdu_length_total - ta_len;
|
||||
post_padding = 0;
|
||||
} else {
|
||||
padding = 0;
|
||||
post_padding = 1;
|
||||
}
|
||||
|
||||
offset = generate_dlsch_header((unsigned char *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0], //DLSCH_pdu.payload[0],
|
||||
num_sdus, //num_sdus
|
||||
sdu_lengths, //
|
||||
sdu_lcids, 255, // no drx
|
||||
ta_update, // timing advance
|
||||
NULL, // contention res id
|
||||
padding, post_padding);
|
||||
LOG_D(MAC, "Offset bits: %d \n", offset);
|
||||
// Probably there should be other actions done before that
|
||||
// cycle through SDUs and place in dlsch_buffer
|
||||
//memcpy(&UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset], dlsch_buffer, sdu_length_total);
|
||||
memcpy(&nr_mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0][offset], dlsch_buffer, sdu_length_total);
|
||||
offset = nr_generate_dlsch_pdu(module_idP,
|
||||
(unsigned char *) dlsch_buffer,
|
||||
(unsigned char *) UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0],
|
||||
num_sdus, //num_sdus
|
||||
sdu_lengths,
|
||||
sdu_lcids,
|
||||
255, // no drx
|
||||
NULL, // contention res id
|
||||
post_padding);
|
||||
|
||||
// fill remainder of DLSCH with 0
|
||||
for (int j = 0; j < (TBS - sdu_length_total - offset); j++) {
|
||||
//UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + sdu_length_total + j] = 0;
|
||||
nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0][offset + sdu_length_total + j] = 0;
|
||||
}
|
||||
|
||||
TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id], dlsch_config);
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, , TBS size: %d \n \n", frameP, slotP, TBS_bytes);
|
||||
|
||||
for(int i = 0; i < 10; i++) { // TBS_bytes dlsch_pdu_rel15->transport_block_size/8 6784/8
|
||||
LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
|
||||
}
|
||||
|
||||
#endif
|
||||
//TX_req->segments[0].segment_length = 8;
|
||||
TX_req->segments[0].segment_length = TBS_bytes +2;
|
||||
TX_req->segments[0].segment_data = nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0];
|
||||
nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
nr_mac->TX_req[CC_id].sfn_sf = sfn_sf;
|
||||
nr_mac->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
|
||||
nr_mac->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
|
||||
} //if (ta_len + sdu_length_total + header_length_total > 0)
|
||||
} //if (IS_SOFTMODEM_NOS1)
|
||||
//When the --NOS1 option is not enabled, DLSCH transmissions with random data
|
||||
//occur every time that the current function is called (dlsch phytest mode)
|
||||
else {
|
||||
TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &nr_mac->coreset[CC_id][1], &nr_mac->search_space[CC_id][1], nr_mac->pdu_index[CC_id], dlsch_config);
|
||||
|
||||
for(int i = 0; i < TBS_bytes; i++) { //
|
||||
((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i] = (unsigned char) rand();
|
||||
//LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
|
||||
// Padding: fill remainder of DLSCH with 0
|
||||
if (post_padding > 0){
|
||||
for (int j = 0; j < (TBS - offset); j++)
|
||||
UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][offset + j] = 0;
|
||||
}
|
||||
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
TBS_bytes = configure_fapi_dl_Tx(dl_req, TX_req, cfg, &gNB_mac->coreset[CC_id][1], &gNB_mac->search_space[CC_id][1], gNB_mac->pdu_index[CC_id], dlsch_config);
|
||||
|
||||
if (frameP%100 == 0) {
|
||||
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, TBS size: %d \n", frameP, slotP, TBS_bytes);
|
||||
|
||||
for(int i = 0; i < 10; i++) {
|
||||
LOG_I(MAC, "%x. ", ((uint8_t *)nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0])[i]);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
//TX_req->segments[0].segment_length = 8;
|
||||
TX_req->segments[0].segment_length = TBS_bytes +2;
|
||||
TX_req->segments[0].segment_data = nr_mac->UE_list.DLSCH_pdu[CC_id][0][0].payload[0];
|
||||
nr_mac->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
nr_mac->TX_req[CC_id].sfn_sf = sfn_sf;
|
||||
nr_mac->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
|
||||
nr_mac->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
|
||||
TX_req->segments[0].segment_length = TBS_bytes + 2;
|
||||
TX_req->segments[0].segment_data = gNB_mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0];
|
||||
|
||||
gNB_mac->TX_req[CC_id].tx_request_body.number_of_pdus++;
|
||||
gNB_mac->TX_req[CC_id].sfn_sf = sfn_sf;
|
||||
gNB_mac->TX_req[CC_id].tx_request_body.tl.tag = NFAPI_TX_REQUEST_BODY_TAG;
|
||||
gNB_mac->TX_req[CC_id].header.message_id = NFAPI_TX_REQUEST;
|
||||
|
||||
if(IS_SOFTMODEM_NOS1){
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, TBS size: %d \n \n", frameP, slotP, TBS_bytes);
|
||||
for(int i = 0; i < 10; i++) { // TBS_bytes dlsch_pdu_rel15->transport_block_size/8 6784/8
|
||||
LOG_I(MAC, "%x. ", ((uint8_t *)gNB_mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0])[i]);
|
||||
}
|
||||
#endif
|
||||
} else {
|
||||
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
|
||||
if (frameP%100 == 0){
|
||||
LOG_I(MAC, "Printing first 10 payload bytes at the gNB side, Frame: %d, slot: %d, TBS size: %d \n", frameP, slotP, TBS_bytes);
|
||||
for(int i = 0; i < 10; i++) {
|
||||
LOG_I(MAC, "%x. ", ((uint8_t *)gNB_mac->UE_list.DLSCH_pdu[CC_id][0][UE_id].payload[0])[i]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Printing bit by bit for debugging purpose
|
||||
/*for (int k = 0; k < TBS; k++){
|
||||
printf("MAC PDU %u\n",((( UE_list->DLSCH_pdu[CC_id][0][UE_id].payload[0][k/8]) & (1 << (k & 7))) >> (k & 7)));
|
||||
if ((k+1)%8 == 0)
|
||||
printf("\n");
|
||||
}*/
|
||||
}
|
||||
} //for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
else { // There is no data from RLC or MAC header, so don't schedule
|
||||
}
|
||||
} // CC_id loop
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
@@ -464,3 +464,21 @@ int get_symbolsperslot(nfapi_nr_config_request_t *cfg) {
|
||||
|
||||
}
|
||||
|
||||
int find_nrUE_id(module_id_t mod_idP, rnti_t rntiP) {
|
||||
|
||||
int UE_id;
|
||||
UE_list_t *UE_list = &RC.nrmac[mod_idP]->UE_list;
|
||||
|
||||
for (UE_id = 0; UE_id < MAX_MOBILES_PER_GNB; UE_id++) {
|
||||
if (UE_list->active[UE_id] == TRUE) {
|
||||
if (UE_list->UE_template[nrUE_PCCID(mod_idP, UE_id)][UE_id].rnti == rntiP) {
|
||||
return UE_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int nrUE_PCCID(module_id_t mod_idP, int ue_idP) {
|
||||
return (RC.nrmac[mod_idP]->UE_list.pCC_id[ue_idP]);
|
||||
}
|
||||
|
||||
1935
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
Normal file
1935
openair2/LAYER2/NR_MAC_gNB/gNB_scheduler_ulsch.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "nr_mac_gNB.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "NR_TAG-Id.h"
|
||||
|
||||
void set_cset_offset(uint16_t);
|
||||
|
||||
@@ -70,6 +71,18 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
|
||||
frame_t frame_txP, sub_frame_t slot_txP,
|
||||
frame_t frame_rxP, sub_frame_t slot_rxP);
|
||||
|
||||
int nr_generate_dlsch_pdu(module_id_t Mod_idP,
|
||||
unsigned char *sdus_payload,
|
||||
unsigned char *mac_pdu,
|
||||
unsigned char num_sdus,
|
||||
unsigned short *sdu_lengths,
|
||||
unsigned char *sdu_lcids,
|
||||
unsigned char drx_cmd,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned short post_padding);
|
||||
|
||||
void nr_schedule_ue_spec(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
|
||||
|
||||
void schedule_nr_mib(module_id_t module_idP, frame_t frameP, sub_frame_t subframeP);
|
||||
|
||||
void nr_schedule_css_dlsch_phytest(module_id_t module_idP,
|
||||
@@ -135,6 +148,10 @@ uint32_t to_nrarfcn(int nr_bandP, uint64_t dl_CarrierFreq, uint32_t bw);
|
||||
|
||||
int32_t get_nr_uldl_offset(int nr_bandP);
|
||||
|
||||
int find_nrUE_id(module_id_t mod_idP, rnti_t rntiP);
|
||||
|
||||
int nrUE_PCCID(module_id_t mod_idP, int ue_idP);
|
||||
|
||||
void config_nr_mib(int Mod_idP,
|
||||
int CC_idP,
|
||||
int p_gNBP,
|
||||
@@ -145,4 +162,22 @@ void config_nr_mib(int Mod_idP,
|
||||
int cellBarred,
|
||||
int intraFreqReselection);
|
||||
|
||||
/* \brief Function to indicate a received SDU on ULSCH.
|
||||
@param Mod_id Instance ID of gNB
|
||||
@param CC_id Component carrier index
|
||||
@param rnti RNTI of UE transmitting the SDU
|
||||
@param sdu Pointer to received SDU
|
||||
@param sdu_len Length of SDU
|
||||
@param timing_advance timing advance adjustment after this pdu
|
||||
@param ul_cqi Uplink CQI estimate after this pdu (SNR quantized to 8 bits, -64 ... 63.5 dB in .5dB steps)
|
||||
*/
|
||||
void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP,
|
||||
uint8_t * sduP,
|
||||
const uint16_t sdu_lenP,
|
||||
const uint16_t timing_advance, const uint8_t ul_cqi);
|
||||
|
||||
#endif /*__LAYER2_NR_MAC_PROTO_H__*/
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h" //temporary
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "assertions.h"
|
||||
|
||||
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
|
||||
@@ -106,6 +106,9 @@ void mac_top_init_gNB(void)
|
||||
|
||||
RC.nrmac[i]->Mod_id = i;
|
||||
|
||||
RC.nrmac[i]->tag = (NR_TAG_t*)malloc(sizeof(NR_TAG_t));
|
||||
memset((void*)RC.nrmac[i]->tag,0,sizeof(NR_TAG_t));
|
||||
|
||||
|
||||
for (j = 0; j < MAX_NUM_CCs; j++) {
|
||||
RC.nrmac[i]->DL_req[j].dl_config_request_body.dl_config_pdu_list = RC.nrmac[i]->dl_config_pdu_list[j];
|
||||
|
||||
@@ -55,12 +55,14 @@
|
||||
#include "common/ran_context.h"
|
||||
#include "LAYER2/MAC/mac.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/TOOLS/time_meas.h"
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
|
||||
|
||||
#include "NR_TAG.h"
|
||||
|
||||
/*! \brief gNB common channels */
|
||||
typedef struct {
|
||||
int physCellId;
|
||||
@@ -107,10 +109,16 @@ typedef struct gNB_MAC_INST_s {
|
||||
/// frame counter
|
||||
frame_t frame;
|
||||
/// slot counter
|
||||
int slot;
|
||||
int slot;
|
||||
/// timing advance group
|
||||
NR_TAG_t *tag;
|
||||
/// Pointer to IF module instance for PHY
|
||||
NR_IF_Module_t *if_inst;
|
||||
/// Common cell resources
|
||||
/// TA command
|
||||
int ta_command;
|
||||
/// MAC CE flag indicating TA length
|
||||
int ta_len;
|
||||
/// Common cell resources
|
||||
NR_COMMON_channels_t common_channels[NFAPI_CC_MAX];
|
||||
/// current PDU index (BCH,DLSCH)
|
||||
uint16_t pdu_index[NFAPI_CC_MAX];
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#include "openair1/PHY/phy_extern.h"
|
||||
#include "openair1/SCHED_NR/fapi_nr_l1.h"
|
||||
#include "openair2/NR_PHY_INTERFACE/NR_IF_Module.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "LAYER2/MAC/mac_proto.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/ran_context.h"
|
||||
@@ -169,6 +169,7 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
UL_info->rx_ind.rx_indication_body.number_of_pdus = 0;
|
||||
}
|
||||
} else {
|
||||
// printf("UL_info->rx_ind.rx_indication_body.number_of_pdus %d UL_info->crc_ind.crc_indication_body.number_of_crcs %d\n", UL_info->rx_ind.rx_indication_body.number_of_pdus, UL_info->crc_ind.crc_indication_body.number_of_crcs);
|
||||
if (UL_info->rx_ind.rx_indication_body.number_of_pdus>0 && UL_info->crc_ind.crc_indication_body.number_of_crcs>0) {
|
||||
for (int i=0; i<UL_info->rx_ind.rx_indication_body.number_of_pdus; i++) {
|
||||
for (int j=0; j<UL_info->crc_ind.crc_indication_body.number_of_crcs; j++) {
|
||||
@@ -182,28 +183,29 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info) {
|
||||
|
||||
if (UL_info->crc_ind.crc_indication_body.crc_pdu_list[j].crc_indication_rel8.crc_flag == 1) { // CRC error indication
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC error) \n",UL_info->frame,UL_info->slot);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
} else {
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->slot);
|
||||
rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
(uint8_t *)NULL,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
|
||||
else {
|
||||
LOG_D(MAC,"Frame %d, Slot %d Calling rx_sdu (CRC ok) \n",UL_info->frame,UL_info->slot);
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
NFAPI_SFNSF2SFN(UL_info->rx_ind.sfn_sf), //UL_info->frame,
|
||||
NFAPI_SFNSF2SF(UL_info->rx_ind.sfn_sf), //UL_info->slot,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_ue_information.rnti,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].data,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.length,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance,
|
||||
UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.ul_cqi);
|
||||
}
|
||||
//printf("rx_indication_rel8.timing_advance %d\n", UL_info->rx_ind.rx_indication_body.rx_pdu_list[i].rx_indication_rel8.timing_advance);
|
||||
break;
|
||||
} //if (UL_info->crc_ind.crc_pdu_list[j].rx_ue_information.rnti ==
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "NR_IF_Module.h"
|
||||
#include "mac_proto.h"
|
||||
#include "assertions.h"
|
||||
@@ -71,22 +72,24 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, fapi_nr
|
||||
|
||||
}
|
||||
// L2 Abstraction Layer
|
||||
int8_t handle_dlsch (module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, uint8_t *pduP, uint32_t pdu_len, frame_t frame, int slot){
|
||||
int8_t handle_dlsch (module_id_t module_id, int cc_id, uint8_t gNB_index, fapi_nr_dci_indication_t *dci_ind, uint8_t *pduP, uint32_t pdu_len, frame_t frame, int slot, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){
|
||||
|
||||
//if (IS_SOFTMODEM_NOS1 || IS_SOFTMODEM_RFSIM)
|
||||
// sdu should be processed even when is S1 mode because data and timing advance updates are transmitted by the UE
|
||||
nr_ue_send_sdu(module_id, cc_id, frame, slot,
|
||||
pduP,
|
||||
pdu_len,
|
||||
gNB_index,
|
||||
ul_time_alignment);
|
||||
|
||||
LOG_I(MAC, "handle_dlsch at MAC layer \n");
|
||||
if (IS_SOFTMODEM_NOS1)
|
||||
nr_ue_send_sdu(module_id, 0, frame, slot,
|
||||
pduP,
|
||||
pdu_len,
|
||||
0);
|
||||
return 0;
|
||||
/*
|
||||
return nr_ue_process_dlsch( module_id,
|
||||
cc_id,
|
||||
gNB_index,
|
||||
dci_ind,
|
||||
pduP,
|
||||
pdu_len);
|
||||
return nr_ue_process_dlsch(module_id,
|
||||
cc_id,
|
||||
gNB_index,
|
||||
dci_ind,
|
||||
pduP,
|
||||
pdu_len);
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -130,7 +133,7 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
|
||||
return 0;
|
||||
}
|
||||
|
||||
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
|
||||
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment){
|
||||
|
||||
int32_t i;
|
||||
uint32_t ret_mask = 0x0;
|
||||
@@ -246,7 +249,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info){
|
||||
// ret_mask |= (0) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
ret_mask |= (handle_dlsch(dl_info->module_id, dl_info->cc_id, dl_info->gNB_index, dl_info->dci_ind,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu,
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length, dl_info->frame, dl_info->slot)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
(dl_info->rx_ind->rx_indication_body+i)->pdsch_pdu.pdu_length, dl_info->frame, dl_info->slot,ul_time_alignment)) << FAPI_NR_RX_PDU_TYPE_DLSCH;
|
||||
|
||||
LOG_I(MAC,"[L2][IF MODULE][DL INDICATION][RX_IND], DLSCH case Number of PDUs: %d \n", dl_info->rx_ind->number_pdus);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
#include <openair1/PHY/thread_NR_UE.h>
|
||||
#include "fapi_nr_ue_interface.h"
|
||||
|
||||
|
||||
typedef struct NR_UL_TIME_ALIGNMENT NR_UL_TIME_ALIGNMENT_t;
|
||||
|
||||
typedef struct {
|
||||
/// module id
|
||||
@@ -163,7 +163,7 @@ typedef int8_t (nr_ue_phy_config_request_f)(nr_phy_config_t *phy_config);
|
||||
* -1: Failed to consume bytes. Abort the mission.
|
||||
* Non-negative return values indicate success, and ignored.
|
||||
*/
|
||||
typedef int (nr_ue_dl_indication_f)(nr_downlink_indication_t *dl_info);
|
||||
typedef int (nr_ue_dl_indication_f)(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
/*
|
||||
* Generic type of an application-defined callback to return various
|
||||
@@ -202,7 +202,7 @@ int nr_ue_if_module_kill(uint32_t module_id);
|
||||
|
||||
/**\brief interface between L1/L2, indicating the downlink related information, like dci_ind and rx_req
|
||||
\param dl_info including dci_ind and rx_request messages*/
|
||||
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info);
|
||||
int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment);
|
||||
|
||||
int nr_ue_ul_indication(nr_uplink_indication_t *ul_info);
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
*/
|
||||
|
||||
#include "nr_rrc_extern.h"
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "COMMON/openair_defs.h"
|
||||
#include "COMMON/platform_types.h"
|
||||
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include "platform_types.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_UE/mac.h"
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac.h"
|
||||
#include "rrc_list.h"
|
||||
#include "NR_asn_constant.h"
|
||||
#include "NR_MeasConfig.h"
|
||||
|
||||
@@ -319,8 +319,11 @@ static int trx_usrp_start(openair0_device *device) {
|
||||
s->usrp->set_gpio_attr("FP0", "DDR", 0x7f, 0x7f);
|
||||
//set control register to ATR
|
||||
s->usrp->set_gpio_attr("FP0", "CTRL", 0x7f,0x7f);
|
||||
//set ATR register
|
||||
//set pins 4 (RX_TX_Switch) and 6 (Shutdown PA) to 1 when the radio is only receiving (ATR_RX)
|
||||
s->usrp->set_gpio_attr("FP0", "ATR_RX", (1<<4)|(1<<6), 0x7f);
|
||||
// set pin 5 (Shutdown LNA) to 1 when the radio is transmitting and receiveing (ATR_XX)
|
||||
// (we use full duplex here, because our RX is on all the time - this might need to change later)
|
||||
s->usrp->set_gpio_attr("FP0", "ATR_XX", (1<<5), 0x7f);
|
||||
// init recv and send streaming
|
||||
uhd::stream_cmd_t cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
|
||||
LOG_I(HW,"Time in secs now: %llu \n", s->usrp->get_time_now().to_ticks(s->sample_rate));
|
||||
@@ -455,14 +458,14 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifdef __AVX2__
|
||||
nsamps2 = (nsamps+7)>>3;
|
||||
__m256i buff_tx[2][nsamps2];
|
||||
__m256i buff_tx[8][nsamps2];
|
||||
#else
|
||||
nsamps2 = (nsamps+3)>>2;
|
||||
__m128i buff_tx[2][nsamps2];
|
||||
__m128i buff_tx[8][nsamps2];
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
nsamps2 = (nsamps+3)>>2;
|
||||
int16x8_t buff_tx[2][nsamps2];
|
||||
int16x8_t buff_tx[8][nsamps2];
|
||||
#else
|
||||
#error Unsupported CPU architecture, USRP device cannot be built
|
||||
#endif
|
||||
@@ -566,14 +569,14 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
#if defined(__x86_64) || defined(__i386__)
|
||||
#ifdef __AVX2__
|
||||
nsamps2 = (nsamps+7)>>3;
|
||||
__m256i buff_tmp[2][nsamps2];
|
||||
__m256i buff_tmp[8][nsamps2];
|
||||
#else
|
||||
nsamps2 = (nsamps+3)>>2;
|
||||
__m128i buff_tmp[2][nsamps2];
|
||||
__m128i buff_tmp[8][nsamps2];
|
||||
#endif
|
||||
#elif defined(__arm__)
|
||||
nsamps2 = (nsamps+3)>>2;
|
||||
int16x8_t buff_tmp[2][nsamps2];
|
||||
int16x8_t buff_tmp[8][nsamps2];
|
||||
#endif
|
||||
|
||||
if (device->type == USRP_B200_DEV) {
|
||||
@@ -1217,9 +1220,9 @@ extern "C" {
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
case 46080000:
|
||||
//openair0_cfg[0].samples_per_packet = 1024;
|
||||
openair0_cfg[0].tx_sample_advance = 115;
|
||||
case 46080000:
|
||||
//openair0_cfg[0].samples_per_packet = 2048;
|
||||
openair0_cfg[0].tx_sample_advance = 15;
|
||||
openair0_cfg[0].tx_bw = 40e6;
|
||||
openair0_cfg[0].rx_bw = 40e6;
|
||||
break;
|
||||
|
||||
@@ -246,15 +246,16 @@ L1s = (
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
nb_tx = 1;
|
||||
nb_rx = 1;
|
||||
att_tx = 0;
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 114;
|
||||
eNB_instances = [0];
|
||||
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,mgmt_addr=192.168.10.2,clock_source=external,time_source=external";
|
||||
|
||||
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2,clock_source=external,time_source=external";
|
||||
|
||||
}
|
||||
);
|
||||
|
||||
@@ -70,7 +70,7 @@ gNBs =
|
||||
UL_BWP_prefix_type = "NORMAL";
|
||||
UL_timeAlignmentTimerCommon = "infinity";
|
||||
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
|
||||
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;
|
||||
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;#####
|
||||
ServingCellConfigCommon_ssb_periodicityServingCell = 10;
|
||||
ServingCellConfigCommon_dmrs_TypeA_Position = 2;
|
||||
NIA_SubcarrierSpacing = "kHz15";
|
||||
@@ -246,7 +246,7 @@ L1s = (
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_tx = 1
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
@@ -264,7 +264,7 @@ THREAD_STRUCT = (
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_DISABLE";
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ gNBs =
|
||||
UL_BWP_prefix_type = "NORMAL";
|
||||
UL_timeAlignmentTimerCommon = "infinity";
|
||||
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
|
||||
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x01;
|
||||
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x0ff;
|
||||
ServingCellConfigCommon_ssb_periodicityServingCell = 10;
|
||||
ServingCellConfigCommon_dmrs_TypeA_Position = 2;
|
||||
NIA_SubcarrierSpacing = "kHz15";
|
||||
@@ -246,7 +246,7 @@ L1s = (
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 1
|
||||
nb_tx = 8
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
@@ -264,7 +264,7 @@ THREAD_STRUCT = (
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_SINGLE_THREAD";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_DISABLE";
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -0,0 +1,291 @@
|
||||
Active_gNBs = ( "gNB-Eurecom-5GNRBox");
|
||||
# Asn1_verbosity, choice in: none, info, annoying
|
||||
Asn1_verbosity = "none";
|
||||
|
||||
gNBs =
|
||||
(
|
||||
{
|
||||
////////// Identification parameters:
|
||||
gNB_ID = 0xe00;
|
||||
|
||||
cell_type = "CELL_MACRO_GNB";
|
||||
|
||||
gNB_name = "gNB-Eurecom-5GNRBox";
|
||||
|
||||
// Tracking area code, 0x0000 and 0xfffe are reserved values
|
||||
tracking_area_code = 1;
|
||||
|
||||
plmn_list = ({mcc = 208; mnc = 93; mnc_length = 2;});
|
||||
|
||||
tr_s_preference = "local_mac"
|
||||
|
||||
////////// Physical parameters:
|
||||
|
||||
component_carriers = (
|
||||
{
|
||||
node_function = "3GPP_gNODEB";
|
||||
node_timing = "synch_to_ext_device";
|
||||
node_synch_ref = 0;
|
||||
frame_type = "TDD";
|
||||
DL_prefix_type = "NORMAL";
|
||||
UL_prefix_type = "NORMAL";
|
||||
eutra_band = 78;
|
||||
downlink_frequency = 3510000000L;
|
||||
uplink_frequency_offset = -120000000;
|
||||
Nid_cell = 0;
|
||||
N_RB_DL = 217;
|
||||
nb_antenna_ports = 1;
|
||||
nb_antennas_tx = 1;
|
||||
nb_antennas_rx = 1;
|
||||
tx_gain = 90;
|
||||
rx_gain = 125;
|
||||
MIB_subCarrierSpacingCommon = 30;
|
||||
MIB_ssb_SubcarrierOffset = 0;
|
||||
MIB_dmrs_TypeA_Position = 2;
|
||||
pdcch_ConfigSIB1 = 0;
|
||||
SIB1_frequencyOffsetSSB = "khz5";
|
||||
SIB1_ssb_PeriodicityServingCell = 5;
|
||||
SIB1_ss_PBCH_BlockPower = -60;
|
||||
absoluteFrequencySSB = 0;
|
||||
DL_FreqBandIndicatorNR = 15;
|
||||
DL_absoluteFrequencyPointA = 15;
|
||||
DL_offsetToCarrier = 15;
|
||||
DL_SCS_SubcarrierSpacing = "kHz30";
|
||||
DL_SCS_SpecificCarrier_k0 = 0;
|
||||
DL_carrierBandwidth = 15;
|
||||
DL_locationAndBandwidth = 15;
|
||||
DL_BWP_SubcarrierSpacing = "kHz30";
|
||||
DL_BWP_prefix_type = "NORMAL";
|
||||
UL_FreqBandIndicatorNR = 15;
|
||||
UL_absoluteFrequencyPointA = 13;
|
||||
UL_additionalSpectrumEmission = 3;
|
||||
UL_p_Max = -1;
|
||||
UL_frequencyShift7p5khz = "TRUE";
|
||||
UL_offsetToCarrier = 10;
|
||||
UL_SCS_SubcarrierSpacing = "kHz30";
|
||||
UL_SCS_SpecificCarrier_k0 = 0;
|
||||
UL_carrierBandwidth = 15;
|
||||
UL_locationAndBandwidth = 15;
|
||||
UL_BWP_SubcarrierSpacing = "kHz30";
|
||||
UL_BWP_prefix_type = "NORMAL";
|
||||
UL_timeAlignmentTimerCommon = "infinity";
|
||||
ServingCellConfigCommon_n_TimingAdvanceOffset = "n0"
|
||||
ServingCellConfigCommon_ssb_PositionsInBurst_PR = 0x03;
|
||||
ServingCellConfigCommon_ssb_periodicityServingCell = 10;
|
||||
ServingCellConfigCommon_dmrs_TypeA_Position = 2;
|
||||
NIA_SubcarrierSpacing = "kHz15";
|
||||
ServingCellConfigCommon_ss_PBCH_BlockPower = -60;
|
||||
referenceSubcarrierSpacing = "kHz15";
|
||||
dl_UL_TransmissionPeriodicity = "ms0p5";
|
||||
nrofDownlinkSlots = 10;
|
||||
nrofDownlinkSymbols = 10;
|
||||
nrofUplinkSlots = 10;
|
||||
nrofUplinkSymbols = 10;
|
||||
rach_totalNumberOfRA_Preambles = 63;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_choice = "oneEighth";
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneEighth = 4;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneFourth = 8;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_oneHalf = 16;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_one = 24;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_two = 32;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_four = 8;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_eight = 4;
|
||||
rach_ssb_perRACH_OccasionAndCB_PreamblesPerSSB_sixteen = 2;
|
||||
rach_groupBconfigured = "ENABLE";
|
||||
rach_ra_Msg3SizeGroupA = 56;
|
||||
rach_messagePowerOffsetGroupB = "dB0";
|
||||
rach_numberOfRA_PreamblesGroupA = 32;
|
||||
rach_ra_ContentionResolutionTimer = 8;
|
||||
rsrp_ThresholdSSB = 64;
|
||||
rsrp_ThresholdSSB_SUL = 64;
|
||||
prach_RootSequenceIndex_choice = "l839";
|
||||
prach_RootSequenceIndex_l839 = 0;
|
||||
prach_RootSequenceIndex_l139 = 0;
|
||||
prach_msg1_SubcarrierSpacing = "kHz30";
|
||||
restrictedSetConfig = "unrestrictedSet";
|
||||
msg3_transformPrecoding = "ENABLE";
|
||||
prach_ConfigurationIndex = 10;
|
||||
prach_msg1_FDM = "one";
|
||||
prach_msg1_FrequencyStart = 10;
|
||||
zeroCorrelationZoneConfig = 10;
|
||||
preambleReceivedTargetPower = -150;
|
||||
preambleTransMax = 6;
|
||||
powerRampingStep = "dB0";
|
||||
ra_ResponseWindow = 8;
|
||||
groupHoppingEnabledTransformPrecoding = "ENABLE";
|
||||
msg3_DeltaPreamble = 0;
|
||||
p0_NominalWithGrant = 0;
|
||||
PUSCH_TimeDomainResourceAllocation_k2 = 0;
|
||||
PUSCH_TimeDomainResourceAllocation_mappingType = "typeA";
|
||||
PUSCH_TimeDomainResourceAllocation_startSymbolAndLength = 0;
|
||||
pucch_ResourceCommon = 0;
|
||||
pucch_GroupHopping = "neither";
|
||||
hoppingId = 0;
|
||||
p0_nominal = -30;
|
||||
PDSCH_TimeDomainResourceAllocation_k0 = 2;
|
||||
PDSCH_TimeDomainResourceAllocation_mappingType = "typeA";
|
||||
PDSCH_TimeDomainResourceAllocation_startSymbolAndLength = 0;
|
||||
rateMatchPatternId = 0;
|
||||
RateMatchPattern_patternType = "bitmaps";
|
||||
symbolsInResourceBlock = "oneSlot";
|
||||
periodicityAndPattern = 2;
|
||||
RateMatchPattern_controlResourceSet = 5;
|
||||
RateMatchPattern_subcarrierSpacing = "kHz30";
|
||||
RateMatchPattern_mode = "dynamic";
|
||||
controlResourceSetZero = 0;
|
||||
searchSpaceZero = 0;
|
||||
searchSpaceSIB1 = 10;
|
||||
searchSpaceOtherSystemInformation = 10;
|
||||
pagingSearchSpace = 10;
|
||||
ra_SearchSpace = 10;
|
||||
PDCCH_common_controlResourceSetId = 5;
|
||||
PDCCH_common_ControlResourceSet_duration = 2;
|
||||
PDCCH_cce_REG_MappingType = "nonInterleaved";
|
||||
PDCCH_reg_BundleSize = 3;
|
||||
PDCCH_interleaverSize = 3;
|
||||
PDCCH_shiftIndex = 10;
|
||||
PDCCH_precoderGranularity = "sameAsREG-bundle";
|
||||
PDCCH_TCI_StateId = 32;
|
||||
tci_PresentInDCI = "ENABLE";
|
||||
PDCCH_DMRS_ScramblingID = 0;
|
||||
SearchSpaceId = 10;
|
||||
commonSearchSpaces_controlResourceSetId = 5;
|
||||
SearchSpace_monitoringSlotPeriodicityAndOffset_choice = "sl1";
|
||||
SearchSpace_monitoringSlotPeriodicityAndOffset_value = 0;
|
||||
SearchSpace_duration = 2;
|
||||
SearchSpace_nrofCandidates_aggregationLevel1 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel2 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel4 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel8 = 0;
|
||||
SearchSpace_nrofCandidates_aggregationLevel16 = 0;
|
||||
SearchSpace_searchSpaceType = "common";
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel1 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel2 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel4 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel8 = 1;
|
||||
Common_dci_Format2_0_nrofCandidates_SFI_aggregationLevel16 = 1;
|
||||
Common_dci_Format2_3_monitoringPeriodicity = 1;
|
||||
Common_dci_Format2_3_nrofPDCCH_Candidates = 1;
|
||||
ue_Specific__dci_Formats = "formats0-0-And-1-0";
|
||||
RateMatchPatternLTE_CRS_carrierFreqDL = 6;
|
||||
RateMatchPatternLTE_CRS_carrierBandwidthDL = 6;
|
||||
RateMatchPatternLTE_CRS_nrofCRS_Ports = 1;
|
||||
RateMatchPatternLTE_CRS_v_Shift = 0;
|
||||
RateMatchPatternLTE_CRS_radioframeAllocationPeriod = 1;
|
||||
RateMatchPatternLTE_CRS_radioframeAllocationOffset = 0;
|
||||
RateMatchPatternLTE_CRS_subframeAllocation_choice = "oneFrame";
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
srb1_parameters :
|
||||
{
|
||||
# timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
|
||||
timer_poll_retransmit = 80;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
|
||||
timer_reordering = 35;
|
||||
|
||||
# timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
|
||||
timer_status_prohibit = 0;
|
||||
|
||||
# poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
|
||||
poll_pdu = 4;
|
||||
|
||||
# poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
|
||||
poll_byte = 99999;
|
||||
|
||||
# max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
|
||||
max_retx_threshold = 4;
|
||||
}
|
||||
|
||||
# ------- SCTP definitions
|
||||
SCTP :
|
||||
{
|
||||
# Number of streams to use in input/output
|
||||
SCTP_INSTREAMS = 2;
|
||||
SCTP_OUTSTREAMS = 2;
|
||||
};
|
||||
|
||||
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
);
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
GNB_INTERFACE_NAME_FOR_S1_MME = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1_MME = "192.168.12.111/24";
|
||||
GNB_INTERFACE_NAME_FOR_S1U = "eth0";
|
||||
GNB_IPV4_ADDRESS_FOR_S1U = "192.168.12.111/24";
|
||||
GNB_PORT_FOR_S1U = 2152; # Spec 2152
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
MACRLCs = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_s_preference = "local_L1";
|
||||
tr_n_preference = "local_RRC";
|
||||
}
|
||||
);
|
||||
|
||||
L1s = (
|
||||
{
|
||||
num_cc = 1;
|
||||
tr_n_preference = "local_mac";
|
||||
}
|
||||
);
|
||||
|
||||
RUs = (
|
||||
{
|
||||
local_rf = "yes"
|
||||
nb_tx = 2
|
||||
nb_rx = 1
|
||||
att_tx = 0
|
||||
att_rx = 0;
|
||||
bands = [7];
|
||||
max_pdschReferenceSignalPower = -27;
|
||||
max_rxgain = 114;
|
||||
eNB_instances = [0];
|
||||
sdr_addrs = "addr=192.168.10.2";
|
||||
# beamforming weights for static beams each of them is a int32 composed by two int16 representing imaginary and real part of the weight
|
||||
# weights are input in an array, starting with the weights associated to first logical beam for all nb_tx , than the weights for 2nd logical beam and so on
|
||||
# the list size is (nb_tx) X (number of logical beams)
|
||||
bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
|
||||
}
|
||||
);
|
||||
|
||||
THREAD_STRUCT = (
|
||||
{
|
||||
#three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
|
||||
parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
|
||||
#two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
|
||||
worker_config = "WORKER_ENABLE";
|
||||
}
|
||||
);
|
||||
|
||||
log_config :
|
||||
{
|
||||
global_log_level ="info";
|
||||
global_log_verbosity ="medium";
|
||||
hw_log_level ="info";
|
||||
hw_log_verbosity ="medium";
|
||||
phy_log_level ="info";
|
||||
phy_log_verbosity ="medium";
|
||||
mac_log_level ="info";
|
||||
mac_log_verbosity ="high";
|
||||
rlc_log_level ="info";
|
||||
rlc_log_verbosity ="medium";
|
||||
pdcp_log_level ="info";
|
||||
pdcp_log_verbosity ="medium";
|
||||
rrc_log_level ="info";
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
@@ -1,19 +1,19 @@
|
||||
[*]
|
||||
[*] GTKWave Analyzer v3.3.61 (w)1999-2014 BSI
|
||||
[*] Sat May 18 17:25:11 2019
|
||||
[*] GTKWave Analyzer v3.3.58 (w)1999-2014 BSI
|
||||
[*] Fri Sep 6 15:01:30 2019
|
||||
[*]
|
||||
[dumpfile] "/tmp/openair_dump_gNB40.vcd"
|
||||
[dumpfile_mtime] "Sat May 18 17:11:31 2019"
|
||||
[dumpfile_size] 53148516
|
||||
[savefile] "/home/caracal/raymond/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw"
|
||||
[timestart] 11552775390
|
||||
[size] 1840 795
|
||||
[dumpfile] "/tmp/gNB_prec.vcd"
|
||||
[dumpfile_mtime] "Fri Sep 6 14:59:50 2019"
|
||||
[dumpfile_size] 13106022
|
||||
[savefile] "/homes/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw"
|
||||
[timestart] 2183320000
|
||||
[size] 1920 1018
|
||||
[pos] -1 -1
|
||||
*-13.848083 11552814436 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
*-18.423141 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
|
||||
[sst_width] 386
|
||||
[signals_width] 344
|
||||
[sst_expanded] 1
|
||||
[sst_vpaned_height] 197
|
||||
[sst_vpaned_height] 267
|
||||
@28
|
||||
functions.trx_read
|
||||
functions.trx_write
|
||||
@@ -24,9 +24,8 @@ variables.frame_number_TX1_UE[63:0]
|
||||
functions.ue_gain_control
|
||||
@420
|
||||
variables.frame_number_RX1_UE[63:0]
|
||||
@25
|
||||
variables.trx_ts_ue[63:0]
|
||||
@24
|
||||
variables.trx_ts_ue[63:0]
|
||||
variables.trx_ts[63:0]
|
||||
variables.trx_tst[63:0]
|
||||
variables.frame_number_RX0_RU[63:0]
|
||||
@@ -63,5 +62,7 @@ functions.phy_procedures_ru_feptx_ofdm0
|
||||
functions.phy_procedures_ru_feptx_ofdm1
|
||||
functions.phy_procedures_ru_feptx_prec0
|
||||
functions.phy_procedures_ru_feptx_prec1
|
||||
@23
|
||||
variables.ru_tx_ofdm_mask[63:0]
|
||||
[pattern_trace] 1
|
||||
[pattern_trace] 0
|
||||
|
||||
@@ -81,6 +81,7 @@
|
||||
/* these variables have to be defined before including ENB_APP/enb_paramdef.h */
|
||||
static int DEFBANDS[] = {7};
|
||||
static int DEFENBS[] = {0};
|
||||
static int DEFBFW[] = {0x00007fff};
|
||||
|
||||
#include "ENB_APP/enb_paramdef.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
Reference in New Issue
Block a user