Merge remote-tracking branch 'origin/develop' into feature-68-enb-agent
Conflicts: openair2/RRC/LITE/rrc_eNB.c
This commit is contained in:
@@ -39,3 +39,7 @@ v0.3 -> Last stable commit on develop branch before the merge of feature-131-new
|
||||
v0.4 -> Merge of feature-131-new-license. It closes issue#131 and changes the license to OAI Public License V1.0
|
||||
v0.5 -> Merge of enhancement-10-harmony-lts. It includes fixes for Ubuntu 16.04 support
|
||||
v0.5.1 -> Merge of bugfix-137-uplink-fixes. It includes stablity fixes for eNB
|
||||
v0.5.2 -> Last version with old code for oaisim (abstraction mode works)
|
||||
v0.6 -> RRH functionality, UE greatly improved, better TDD support,
|
||||
a lot of bugs fixed. WARNING: oaisim in PHY abstraction mode does not
|
||||
work, you need to use v0.5.2 for that.
|
||||
|
||||
@@ -499,18 +499,18 @@ set(HWLIB_EXMIMO_SOURCE
|
||||
add_library(oai_exmimodevif MODULE ${HWLIB_EXMIMO_SOURCE} )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
set (option_HWUSRPLIB_lib "-l uhd")
|
||||
set(HWLIB_USRP_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
|
||||
)
|
||||
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
|
||||
target_link_libraries(oai_usrpdevif uhd)
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
|
||||
set (option_HWBLADERFLIB_lib "-l bladerf")
|
||||
set(HWLIB_BLADERF_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
add_library(oai_bladerfdevif MODULE ${HWLIB_BLADERF_SOURCE} )
|
||||
target_link_libraries(oai_bladerfdevif bladeRF)
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/")
|
||||
|
||||
@@ -518,6 +518,8 @@ set(HWLIB_LMSSDR_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp
|
||||
)
|
||||
add_library(oai_lmssdrdevif MODULE ${HWLIB_LMSSDR_SOURCE} )
|
||||
target_include_directories(oai_lmssdrdevif PRIVATE /usr/local/include/lime)
|
||||
target_link_libraries(oai_lmssdrdevif LimeSuite )
|
||||
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/")
|
||||
set(TPLIB_ETHERNET_SOURCE
|
||||
@@ -528,70 +530,6 @@ set(TPLIB_ETHERNET_SOURCE
|
||||
add_library(oai_eth_transpro MODULE ${TPLIB_ETHERNET_SOURCE} )
|
||||
|
||||
|
||||
# RF devices / transport protocols settings
|
||||
######################################################################
|
||||
if (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
set(DRIVER2013)
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/")
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/EXMIMO/DEFS/")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.c)
|
||||
# ${OPENAIR_TARGETS}/ARCH/EXMIMO/USERSPACE/LIB/gain_control.c)
|
||||
set(option_HW_lib "-rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
include_directories("/opt/include/uhd")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp)
|
||||
LINK_DIRECTORIES("/opt/lib")
|
||||
set(option_HW_lib "-luhd -rdynamic -ldl -lboost_system")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_BLADERF")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/LOG")
|
||||
include_directories("/usr/include")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/BLADERF/USERSPACE/LIB/bladerf_lib.c
|
||||
)
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
|
||||
set(option_HW_lib "bladeRF -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_LMSSDR")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB")
|
||||
include_directories("/usr/local/include/lime")
|
||||
include_directories("/usr/include/lime")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lmsSDR")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/lms7002m")
|
||||
LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/Si5351C")
|
||||
set(HW_SOURCE ${HW_SOURCE} ${OPENAIR_TARGETS}/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp)
|
||||
set(option_HW_lib "-lLimeSuite -rdynamic -ldl")
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "CPRIGW")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/cprigw_lib.c
|
||||
)
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/CPRIGW/USERSPACE/LIB/")
|
||||
set(option_HW_lib "-rdynamic dl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "EXMIMO")
|
||||
|
||||
|
||||
if (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB")
|
||||
set(TRANSPORT_SOURCE ${TRANSPORT_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c
|
||||
${OPENAIR_TARGETS}/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c
|
||||
)
|
||||
set(option_TP_lib "-rdynamic -ldl")
|
||||
|
||||
|
||||
endif (${TRANSP_PRO} STREQUAL "ETHERNET")
|
||||
##########################################################
|
||||
|
||||
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
|
||||
@@ -1777,8 +1715,6 @@ add_executable(lte-softmodem
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${GTPU_need_ITTI}
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${RTAI_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
@@ -1791,7 +1727,7 @@ target_link_libraries (lte-softmodem -ldl
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${T_LIB})
|
||||
|
||||
@@ -1813,8 +1749,6 @@ add_executable(lte-softmodem-nos1
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${RTAI_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
@@ -1826,7 +1760,7 @@ target_link_libraries (lte-softmodem-nos1
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
|
||||
|
||||
@@ -1839,24 +1773,17 @@ add_executable(rrh_gw
|
||||
${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${T_SOURCE}
|
||||
)
|
||||
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
|
||||
target_link_libraries(rrh_gw
|
||||
-Wl,--start-group
|
||||
UTIL LFDS
|
||||
UTIL LFDS -ldl
|
||||
-Wl,--end-group )
|
||||
target_link_libraries (rrh_gw rt pthread m )
|
||||
target_link_libraries (rrh_gw ${option_HW_lib} ${option_TP_lib})
|
||||
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (rrh_gw ${T_LIB})
|
||||
|
||||
Message("-- option_HW_lib=${option_HW_lib}")
|
||||
Message("-- HW_SOURCE=${HW_SOURCE}")
|
||||
Message("-- option_TP_lib=${option_TP_lib}")
|
||||
Message("-- TRANSPORT_SOURCE=${TRANSPORT_SOURCE}")
|
||||
|
||||
# USIM process
|
||||
#################
|
||||
@@ -1911,8 +1838,6 @@ add_executable(oaisim
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${GTPU_need_ITTI}
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
)
|
||||
@@ -1925,7 +1850,7 @@ target_link_libraries (oaisim
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (oaisim ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${option_HW_lib} ${option_TP_lib}
|
||||
target_link_libraries (oaisim pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp
|
||||
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES})
|
||||
#Force link with forms, regardless XFORMS option
|
||||
target_link_libraries (oaisim forms)
|
||||
@@ -1956,8 +1881,6 @@ add_executable(oaisim_nos1
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
${XFORMS_SOURCE}
|
||||
${T_SOURCE}
|
||||
)
|
||||
@@ -1968,7 +1891,7 @@ target_link_libraries (oaisim_nos1
|
||||
-Wl,--end-group )
|
||||
|
||||
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
|
||||
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${option_HW_lib} ${option_TP_lib}
|
||||
target_link_libraries (oaisim_nos1 pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES}
|
||||
${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${OPENPGM_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
#Force link with forms, regardless XFORMS option
|
||||
target_link_libraries (oaisim_nos1 forms)
|
||||
|
||||
@@ -785,20 +785,19 @@ function main() {
|
||||
build_dir=$rrh_build_dir
|
||||
fi
|
||||
|
||||
# build RF device libraries (currently EXMIMO is not complied with the rest of HW targets)
|
||||
# build RF device libraries
|
||||
if [ "$HW" != "None" ] ; then
|
||||
rm -f liboai_device.so
|
||||
rm -f $dbin/liboai_device.so
|
||||
|
||||
|
||||
# link liboai_device.so with the selected RF device library
|
||||
if [ "$HW" == "EXMIMO" ] ; then
|
||||
|
||||
#add exmimo compilation
|
||||
#TODO EXMIMO library support
|
||||
compilations \
|
||||
$build_dir oai_exmimodevif \
|
||||
liboai_exmimodevif.so $dbin/liboai_exmimodevif.so.$REL
|
||||
|
||||
ln -sf liboai_exmimodevif.so liboai_device.so
|
||||
ln -sf $dbin/liboai_exmimodevif.so.$REL $dbin/liboai_device.so
|
||||
echo_info "liboai_device.so is linked to EXMIMO device library"
|
||||
elif [ "$HW" == "OAI_USRP" ] ; then
|
||||
if [ -d "/usr/include/uhd" ] ; then
|
||||
|
||||
@@ -243,7 +243,7 @@ check_install_bladerf_driver(){
|
||||
$SUDO add-apt-repository -y ppa:bladerf/bladerf
|
||||
$SUDO apt-get update
|
||||
fi
|
||||
$SUDO apt-get install -y--allow-unauthenticated bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y --allow-unauthenticated bladerf-fpga-hostedx40
|
||||
}
|
||||
@@ -252,6 +252,21 @@ flash_firmware_bladerf() {
|
||||
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
}
|
||||
|
||||
check_install_lmssdr_driver(){
|
||||
if ( [ -d "/usr/local/include/lime" ] &&
|
||||
[ -f "/usr/local/include/lime/LimeSuite.h" ] )
|
||||
then
|
||||
echo_success "Found lmssdr drivers and tools installed from source"
|
||||
else
|
||||
echo_error "lmssdr support implies installing lmssdr drivers and tools" \
|
||||
" from sources. check:"
|
||||
echo_info "https://open-cells.com/index.php/2017/05/10/limesdr-installation/"
|
||||
echo_fatal "Cannot compile lmssdr device"
|
||||
fi
|
||||
|
||||
|
||||
}
|
||||
|
||||
check_install_additional_tools (){
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get install -y \
|
||||
|
||||
@@ -150,7 +150,7 @@ function main()
|
||||
# -u | --num-ue )
|
||||
|
||||
-V | --vcd)
|
||||
"setting gtk-wave output"
|
||||
echo "setting gtk-wave output"
|
||||
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
|
||||
shift ;
|
||||
;;
|
||||
@@ -164,6 +164,11 @@ function main()
|
||||
exe_arguments="$exe_arguments -n $2"
|
||||
shift 2;
|
||||
;;
|
||||
-x | --xforms)
|
||||
echo "running with xforms"
|
||||
exe_arguments="$exe_arguments --xforms"
|
||||
shift 1;
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option $1"
|
||||
help
|
||||
@@ -212,11 +217,11 @@ function main()
|
||||
fi
|
||||
|
||||
if [ $run_gdb -eq 0 ]; then
|
||||
exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
|
||||
exec $SUDO $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14 $exe_arguments | tee /tmp/enb_ue_nos1.log.txt
|
||||
else
|
||||
touch ~/.gdb_enb_ue_nos1
|
||||
chmod 777 ~/.gdb_enb_ue_nos1
|
||||
echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel10" > ~/.gdb_enb_ue_nos1
|
||||
echo "file $OPENAIR_DIR/targets/bin/oaisim_nos1.Rel14" > ~/.gdb_enb_ue_nos1
|
||||
echo "set args $exe_arguments" >> ~/.gdb_enb_ue_nos1
|
||||
echo "run" >> ~/.gdb_enb_ue_nos1
|
||||
cat ~/.gdb_enb_ue_nos1
|
||||
|
||||
@@ -174,7 +174,7 @@ function main()
|
||||
;;
|
||||
|
||||
-V | --vcd)
|
||||
"setting gtk-wave output"
|
||||
echo "setting gtk-wave output"
|
||||
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
|
||||
shift ;
|
||||
;;
|
||||
@@ -183,6 +183,11 @@ function main()
|
||||
exe_arguments="$exe_arguments -P wireshark"
|
||||
shift 2;
|
||||
;;
|
||||
-x | --xforms)
|
||||
echo "running with xforms"
|
||||
exe_arguments="$exe_arguments --xforms"
|
||||
shift 1;
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option $1"
|
||||
help
|
||||
@@ -258,11 +263,11 @@ function main()
|
||||
fi
|
||||
|
||||
if [ $run_gdb -eq 0 ]; then
|
||||
exec $OPENAIR_DIR/targets/bin/oaisim.Rel10 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
|
||||
exec $OPENAIR_DIR/targets/bin/oaisim.Rel14 $exe_arguments | tee /tmp/enb_ue_s1.log.txt
|
||||
else
|
||||
touch ~/.gdb_enb_ue_s1
|
||||
chmod 777 ~/.gdb_enb_ue_s1
|
||||
echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel10" > ~/.gdb_enb_ue_s1
|
||||
echo "file $OPENAIR_DIR/targets/bin/oaisim.Rel14" > ~/.gdb_enb_ue_s1
|
||||
echo "set args $exe_arguments" >> ~/.gdb_enb_ue_s1
|
||||
echo "run" >> ~/.gdb_enb_ue_s1
|
||||
cat ~/.gdb_enb_ue_s1
|
||||
|
||||
@@ -28,7 +28,7 @@ ID = ENB_PHY_DLSCH_UE_NACK
|
||||
ID = ENB_PHY_ULSCH_UE_DCI
|
||||
DESC = eNodeB uplink UE specific DCI as sent by the PHY layer
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : int,UE_id : int,rnti : int,harq_pid : int,mcs : int,round : int,first_rb : int,nb_rb : int,TBS : int,L : int,firstCCE
|
||||
ID = ENB_PHY_ULSCH_UE_NO_DCI_RETRANSMISSION
|
||||
DESC = eNodeB uplink UE retransmission due to PHICH NACK (see generate_phich_top)
|
||||
GROUP = ALL:PHY:GRAPHIC:ENB
|
||||
|
||||
@@ -77,7 +77,7 @@ typedef struct items_group_s {
|
||||
} items_group_t;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static const items_group_position_t ITEMS_GROUP_POSITION_INVALID = -1;
|
||||
//static const items_group_position_t ITEMS_GROUP_POSITION_INVALID = -1;
|
||||
static const items_group_index_t ITEMS_GROUP_INDEX_INVALID = -1;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
|
||||
Executable → Regular
@@ -23,6 +23,7 @@
|
||||
#include <string.h>
|
||||
#endif
|
||||
#include "defs.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "filt96_32.h"
|
||||
#include "T.h"
|
||||
@@ -637,105 +638,129 @@ int lte_dl_channel_estimation(PHY_VARS_UE *ue,
|
||||
32767-ue->ch_est_alpha,
|
||||
dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // high_speed_flag == 1
|
||||
if (symbol == 0) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if ((symbol == 0)) {
|
||||
// printf("Interpolating %d->0\n",4-ue->frame_parms.Ncp);
|
||||
// dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][(4-ue->frame_parms.Ncp)*(ue->frame_parms.ofdm_symbol_size)];
|
||||
if(((Ns>>1)!=0) || ( ((Ns>>1)==0) && interpolateS11S12))
|
||||
{
|
||||
//LOG_D(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
//LOG_I(PHY,"Interpolate s11-->s0 to get s12 and s13 Ns %d \n", Ns);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates_previous[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
|
||||
//LOG_I(PHY,"Interpolate s0-->s4 to get s1 s2 and s3 Ns %d \n", Ns);
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
|
||||
uint8_t previous_subframe;
|
||||
if(Ns>>1 == 0)
|
||||
previous_subframe = 9;
|
||||
else
|
||||
previous_subframe = ((Ns>>1) - 1 )%9;
|
||||
|
||||
if((subframe_select(&ue->frame_parms,previous_subframe) == SF_UL))
|
||||
{
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,32440,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
}
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,328,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
} else if (symbol == pilot2) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
} else { // symbol == pilot3
|
||||
// printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
interpolateS11S12 = 1;
|
||||
} // this is 1/3,2/3 combination for pilots spaced by 3 symbols
|
||||
else if (symbol == pilot1) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][0];
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
} else if (symbol == pilot2) {
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot1*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else { // symbol == pilot3
|
||||
// printf("Interpolating 0->%d\n",4-ue->frame_parms.Ncp);
|
||||
dl_ch_prev = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
if (ue->frame_parms.Ncp==0) {// pilot spacing 4 symbols (1/4,1/2,3/4 combination)
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,24576,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,8192,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,16384,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,8192,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,24576,dl_ch_prev+(3*2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,10923,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
multadd_complex_vector_real_scalar(dl_ch_prev,21845,dl_ch_prev+(2*(ue->frame_parms.ofdm_symbol_size)<<1),1,ue->frame_parms.ofdm_symbol_size);
|
||||
multadd_complex_vector_real_scalar(dl_ch,10923,dl_ch_prev+(2*((ue->frame_parms.ofdm_symbol_size)<<1)),0,ue->frame_parms.ofdm_symbol_size);
|
||||
} // pilot spacing 3 symbols (1/3,2/3 combination)
|
||||
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
|
||||
{
|
||||
//LOG_D(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
if((ue->rx_offset_diff !=0) && ((Ns>>1) == 9))
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
//LOG_I(PHY,"Extrapolate s7-->s11 to get s12 and s13 Ns %d\n", Ns);
|
||||
interpolateS11S12 = 0;
|
||||
//LOG_E(PHY,"Interpolate s7--s11 s12 s13 pilot 3 Ns %d l %d symbol %d \n", Ns, l, symbol);
|
||||
int16_t *dlChEst_ofdm11 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot3*(ue->frame_parms.ofdm_symbol_size)];
|
||||
int16_t *dlChEst_ofdm7 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][pilot2*(ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
// interpolate ofdm s12: 5/4*ofdms11 + -1/4*ofdms7 5/4 q1.15 40960 -1/4 q1.15 8192
|
||||
int16_t *dlChEst_ofdm12 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][12*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 40960 - (int64_t)dlChEst_ofdm7[i] * 8192);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm12[i] = tmp_mult;
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
|
||||
// interpolate ofdm s13: 3/2*ofdms11 + -1/2*ofdms7 3/2 q1.15 49152 1/2 q1.15 16384
|
||||
int16_t *dlChEst_ofdm13 = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][13*ue->frame_parms.ofdm_symbol_size];
|
||||
for(int i=0; i<(2*ue->frame_parms.ofdm_symbol_size); i++)
|
||||
{
|
||||
int64_t tmp_mult = 0;
|
||||
tmp_mult = ((int64_t)dlChEst_ofdm11[i] * 49152 - (int64_t)dlChEst_ofdm7[i] * 16384);
|
||||
|
||||
tmp_mult = tmp_mult >> 15;
|
||||
dlChEst_ofdm13[i] = tmp_mult;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -171,20 +171,25 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
{
|
||||
|
||||
uint8_t subframe = slot>>1;
|
||||
int aarx,rb,n;
|
||||
int aarx,rb;
|
||||
uint8_t pss_symb;
|
||||
uint8_t sss_symb;
|
||||
|
||||
int32_t **rxdataF;
|
||||
int16_t *rxF,*rxF_pss,*rxF_sss;
|
||||
|
||||
uint16_t Nid_cell = ue->frame_parms.Nid_cell;
|
||||
uint8_t eNB_offset,nu,l,nushift,k;
|
||||
uint16_t off;
|
||||
|
||||
uint8_t isPss; // indicate if this is a slot for extracting PSS
|
||||
uint8_t isSss; // indicate if this is a slot for extracting SSS
|
||||
int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS
|
||||
int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS
|
||||
int32_t (*xss_ext)[72]; // point to either pss_ext or sss_ext for common calculation
|
||||
int16_t *re,*im; // real and imag part of each 32-bit xss_ext[][] value
|
||||
//uint8_t isPss; // indicate if this is a slot for extracting PSS
|
||||
//uint8_t isSss; // indicate if this is a slot for extracting SSS
|
||||
//int32_t pss_ext[4][72]; // contain the extracted 6*12 REs for mapping the PSS
|
||||
//int32_t sss_ext[4][72]; // contain the extracted 6*12 REs for mapping the SSS
|
||||
//int32_t (*xss_ext)[72]; // point to either pss_ext or sss_ext for common calculation
|
||||
//int16_t *re,*im; // real and imag part of each 32-bit xss_ext[][] value
|
||||
|
||||
//LOG_I(PHY,"UE RRC MEAS Start Subframe %d Frame Type %d slot %d \n",subframe,ue->frame_parms.frame_type,slot);
|
||||
for (eNB_offset = 0; eNB_offset<1+ue->measurements.n_adj_cells; eNB_offset++) {
|
||||
|
||||
if (eNB_offset==0) {
|
||||
@@ -192,27 +197,28 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
//ue->measurements.n0_power_tot = 0;
|
||||
|
||||
if (abstraction_flag == 0) {
|
||||
if ((ue->frame_parms.frame_type == FDD) &&
|
||||
((subframe == 0) || (subframe == 5))) { // FDD PSS/SSS, compute noise in DTX REs
|
||||
if ( ((ue->frame_parms.frame_type == FDD) && ((subframe == 0) || (subframe == 5))) ||
|
||||
((ue->frame_parms.frame_type == TDD) && ((subframe == 1) || (subframe == 6)))
|
||||
)
|
||||
{ // FDD PSS/SSS, compute noise in DTX REs
|
||||
|
||||
if (ue->frame_parms.Ncp==NORMAL) {
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
if(ue->frame_parms.frame_type == FDD)
|
||||
{
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)];
|
||||
}
|
||||
//-ve spectrum from SSS
|
||||
// printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]);
|
||||
|
||||
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
// printf("sssn36 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
|
||||
// printf("sssm32 %d\n",ue->measurements.n0_power[aarx]);
|
||||
//+ve spectrum from SSS
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63]));
|
||||
@@ -223,18 +229,34 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
|
||||
// printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
if(ue->frame_parms.frame_type == FDD)
|
||||
{
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
}
|
||||
else
|
||||
{
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[aarx][(14*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(3*ue->frame_parms.ofdm_symbol_size)];
|
||||
}
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
// printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
|
||||
|
||||
ue->measurements.n0_power[aarx] = (((int32_t)rxF_sss[-70]*rxF_sss[-70])+((int32_t)rxF_sss[-69]*rxF_sss[-69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[-68]*rxF_sss[-68])+((int32_t)rxF_sss[-67]*rxF_sss[-67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[-66]*rxF_sss[-66])+((int32_t)rxF_sss[-65]*rxF_sss[-65]));
|
||||
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
|
||||
// printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12);
|
||||
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
|
||||
}
|
||||
|
||||
//LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
|
||||
|
||||
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
|
||||
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
|
||||
} else {
|
||||
@@ -242,87 +264,61 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
|
||||
}
|
||||
}
|
||||
else if ((ue->frame_parms.frame_type == TDD) &&
|
||||
((slot == 2) || (slot == 12) || (slot == 1) || (slot == 11))) { // TDD PSS/SSS, compute noise in DTX REs // 2016-09-29 wilson fix incorrect noise power calculation
|
||||
((subframe == 1) || (subframe == 6))) { // TDD PSS/SSS, compute noise in DTX REs // 2016-09-29 wilson fix incorrect noise power calculation
|
||||
|
||||
#if 1 // fixing REs extraction in noise power calculation
|
||||
|
||||
// check if this slot has a PSS or SSS sequence
|
||||
if ((slot == 2) || (slot == 12)) {
|
||||
isPss = 1;
|
||||
} else {
|
||||
isPss = 0;
|
||||
}
|
||||
if ((slot == 1) || (slot == 11)) {
|
||||
isSss = 1;
|
||||
} else {
|
||||
isSss = 0;
|
||||
}
|
||||
|
||||
if (isPss) {
|
||||
pss_only_extract(ue, pss_ext);
|
||||
xss_ext = pss_ext;
|
||||
}
|
||||
|
||||
if (isSss) {
|
||||
sss_only_extract(ue, sss_ext);
|
||||
xss_ext = sss_ext;
|
||||
}
|
||||
|
||||
// calculate noise power
|
||||
int num_tot=0; // number of REs totally used in calculating noise power
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
int num_per_rx=0; // number of REs used in caluclaing noise power for this RX antenna
|
||||
ue->measurements.n0_power[aarx] = 0;
|
||||
for (n=2; n<70; n++) { // skip the 2 REs next to PDSCH, i.e. n={0,1,70,71}
|
||||
if (n==5) {n=67;}
|
||||
|
||||
re = (int16_t*)(&(xss_ext[aarx][n]));
|
||||
im = re+1;
|
||||
ue->measurements.n0_power[aarx] += (*re)*(*re) + (*im)*(*im);
|
||||
num_per_rx++;
|
||||
num_tot++;
|
||||
}
|
||||
|
||||
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(num_per_rx));
|
||||
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
|
||||
}
|
||||
|
||||
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(num_tot));
|
||||
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
#else
|
||||
pss_symb = 2;
|
||||
sss_symb = ue->frame_parms.symbols_per_tti-1;
|
||||
if (ue->frame_parms.Ncp==NORMAL) {
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)];
|
||||
// note this is a dummy pointer, the pss is not really there!
|
||||
// in FDD the pss is in the symbol after the sss, but not in TDD
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
|
||||
rxF_pss = (int16_t *) &rxdataF[aarx][((pss_symb*(ue->frame_parms.ofdm_symbol_size)))];
|
||||
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
|
||||
rxF_sss = (int16_t *) &rxdataF[aarx][((sss_symb*(ue->frame_parms.ofdm_symbol_size)))];
|
||||
|
||||
//-ve spectrum from SSS
|
||||
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
|
||||
//+ve spectrum from SSS
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+72]*rxF_sss[2+72])+((int32_t)rxF_sss[2+71]*rxF_sss[2+71]));
|
||||
ue->measurements.n0_power[aarx] = (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63]));
|
||||
//-ve spectrum from SSS
|
||||
// printf("slot %d: SSS DTX: %d,%d, non-DTX %d,%d\n",slot,rxF_pss[-72],rxF_pss[-71],rxF_pss[-36],rxF_pss[-35]);
|
||||
|
||||
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/(6));
|
||||
ue->measurements.n0_power_tot += ue->measurements.n0_power[aarx];
|
||||
// ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
// printf("sssn36 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power[aarx] = (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
|
||||
// printf("sssm32 %d\n",ue->measurements.n0_power[aarx]);
|
||||
//+ve spectrum from SSS
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+70]*rxF_sss[2+70])+((int32_t)rxF_sss[2+69]*rxF_sss[2+69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+68]*rxF_sss[2+68])+((int32_t)rxF_sss[2+67]*rxF_sss[2+67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+66]*rxF_sss[2+66])+((int32_t)rxF_sss[2+65]*rxF_sss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_sss[2+64]*rxF_sss[2+64])+((int32_t)rxF_sss[2+63]*rxF_sss[2+63]));
|
||||
// printf("sssp32 %d\n",ue->measurements.n0_power[aarx]);
|
||||
//+ve spectrum from PSS
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+70]*rxF_pss[2+70])+((int32_t)rxF_pss[2+69]*rxF_pss[2+69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+68]*rxF_pss[2+68])+((int32_t)rxF_pss[2+67]*rxF_pss[2+67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+66]*rxF_pss[2+66])+((int32_t)rxF_pss[2+65]*rxF_pss[2+65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[2+64]*rxF_pss[2+64])+((int32_t)rxF_pss[2+63]*rxF_pss[2+63]));
|
||||
// printf("pss32 %d\n",ue->measurements.n0_power[aarx]); //-ve spectrum from PSS
|
||||
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[aarx][(7*ue->frame_parms.ofdm_symbol_size)];
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-72]*rxF_pss[-72])+((int32_t)rxF_pss[-71]*rxF_pss[-71]));
|
||||
// printf("pssm36 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-70]*rxF_pss[-70])+((int32_t)rxF_pss[-69]*rxF_pss[-69]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-68]*rxF_pss[-68])+((int32_t)rxF_pss[-67]*rxF_pss[-67]));
|
||||
ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-66]*rxF_pss[-66])+((int32_t)rxF_pss[-65]*rxF_pss[-65]));
|
||||
// ue->measurements.n0_power[aarx] += (((int32_t)rxF_pss[-64]*rxF_pss[-64])+((int32_t)rxF_pss[-63]*rxF_pss[-63]));
|
||||
// printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
|
||||
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12);
|
||||
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
|
||||
}
|
||||
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(6*aarx));
|
||||
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
|
||||
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
|
||||
|
||||
|
||||
//LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
|
||||
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -550,6 +546,8 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
(((k1*((long long int)(ue->measurements.rx_power_avg[eNB_id]))) +
|
||||
(k2*((long long int)(ue->measurements.rx_power_tot[eNB_id]))))>>10);
|
||||
|
||||
//LOG_I(PHY,"Noise Power Computation: k1 %d k2 %d n0 avg %d n0 tot %d\n", k1, k2, ue->measurements.n0_power_avg,
|
||||
// ue->measurements.n0_power_tot);
|
||||
ue->measurements.n0_power_avg = (int)
|
||||
(((k1*((long long int) (ue->measurements.n0_power_avg))) +
|
||||
(k2*((long long int) (ue->measurements.n0_power_tot))))>>10);
|
||||
@@ -567,8 +565,9 @@ void lte_ue_measurements(PHY_VARS_UE *ue,
|
||||
ue->measurements.wideband_cqi_avg[eNB_id] = dB_fixed2(ue->measurements.rx_power_avg[eNB_id],ue->measurements.n0_power_avg);
|
||||
ue->measurements.rx_rssi_dBm[eNB_id] = ue->measurements.rx_power_avg_dB[eNB_id] - ue->rx_total_gain_dB;
|
||||
#ifdef DEBUG_MEAS_UE
|
||||
LOG_D(PHY,"[eNB %d] RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
|
||||
LOG_I(PHY,"[eNB %d] Subframe %d, RSSI %d dBm, RSSI (digital) %d dB, WBandCQI %d dB, rxPwrAvg %d, n0PwrAvg %d\n",
|
||||
eNB_id,
|
||||
subframe,
|
||||
ue->measurements.rx_rssi_dBm[eNB_id],
|
||||
ue->measurements.rx_power_avg_dB[eNB_id],
|
||||
ue->measurements.wideband_cqi_avg[eNB_id],
|
||||
|
||||
Regular → Executable
+12
-3
@@ -1979,6 +1979,9 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
|
||||
uint16_t numCCE = 0;
|
||||
uint8_t i;
|
||||
uint8_t nCCEmin = 0;
|
||||
uint16_t CCE_max_used_index = 0;
|
||||
uint16_t firstCCE_max = dci_alloc[0].firstCCE;
|
||||
uint8_t L = dci_alloc[0].L;
|
||||
|
||||
// check pdcch duration imposed by PHICH duration (Section 6.9 of 36-211)
|
||||
if (frame_parms->Ncp==1) { // extended prefix
|
||||
@@ -1995,16 +1998,22 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
|
||||
for (i=0; i<num_dci; i++) {
|
||||
// printf("dci %d => %d\n",i,dci_alloc[i].L);
|
||||
numCCE += (1<<(dci_alloc[i].L));
|
||||
|
||||
if(firstCCE_max < dci_alloc[i].firstCCE) {
|
||||
firstCCE_max = dci_alloc[i].firstCCE;
|
||||
L = dci_alloc[i].L;
|
||||
}
|
||||
}
|
||||
CCE_max_used_index = firstCCE_max + (1<<L) - 1;
|
||||
|
||||
//if ((9*numCCE) <= (frame_parms->N_RB_DL*2))
|
||||
if (numCCE <= get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)))
|
||||
if (CCE_max_used_index < get_nCCE(1, frame_parms, get_mi(frame_parms, subframe)))
|
||||
return(cmax(1,nCCEmin));
|
||||
//else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 4 : 5)))
|
||||
else if (numCCE <= get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
|
||||
else if (CCE_max_used_index < get_nCCE(2, frame_parms, get_mi(frame_parms, subframe)))
|
||||
return(cmax(2,nCCEmin));
|
||||
//else if ((9*numCCE) <= (frame_parms->N_RB_DL*((frame_parms->nb_antenna_ports_eNB==4) ? 7 : 8)))
|
||||
else if (numCCE <= get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
|
||||
else if (CCE_max_used_index < get_nCCE(3, frame_parms, get_mi(frame_parms, subframe)))
|
||||
return(cmax(3,nCCEmin));
|
||||
else if (frame_parms->N_RB_DL<=10) {
|
||||
if (frame_parms->Ncp == 0) { // normal CP
|
||||
|
||||
@@ -4888,7 +4888,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
|
||||
|
||||
if(rballoc > RIV_max)
|
||||
{
|
||||
LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %d \n",rballoc, RIV_max);
|
||||
LOG_I(PHY,"bad dci rballoc rballoc %d RIV_max %lld \n",rballoc, RIV_max);
|
||||
// DCI false detection
|
||||
return(0);
|
||||
}
|
||||
@@ -5124,7 +5124,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
|
||||
if( (rballoc > RIV_max) && (rah == 1) )
|
||||
{
|
||||
// DCI false detection
|
||||
LOG_I(PHY,"bad rballoc %d RIV_max %d\n", rballoc, RIV_max);
|
||||
LOG_I(PHY,"bad rballoc %d RIV_max %lld\n", rballoc, RIV_max);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -8013,13 +8013,20 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
ulsch->bundling = 1-AckNackFBMode;
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
|
||||
//int dl_subframe = (subframe<4) ? (subframe+6) : (subframe-4);
|
||||
int dl_subframe = subframe;
|
||||
|
||||
if (ue->dlsch[dl_subframe&0x1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status>0) { // we have downlink transmission
|
||||
ulsch->harq_processes[harq_pid]->O_ACK = 1;
|
||||
} else {
|
||||
ulsch->harq_processes[harq_pid]->O_ACK = 0;
|
||||
}
|
||||
/*LOG_I(PHY,"DCI 0 Processing: dl_subframe %d send_harq_status Odd %d send_harq_status Even %d harq_pid %d O_ACK %d\n", dl_subframe,
|
||||
ue->dlsch[0][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
|
||||
ue->dlsch[1][eNB_id][0]->harq_ack[dl_subframe].send_harq_status,
|
||||
harq_pid,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK);*/
|
||||
|
||||
} else {
|
||||
if (ulsch->bundling)
|
||||
ulsch->harq_processes[harq_pid]->O_ACK = (dai == 3)? 0 : 1;
|
||||
@@ -8031,10 +8038,16 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
|
||||
|
||||
dlsch[0]->harq_ack[subframe].vDAI_UL = dai+1;
|
||||
|
||||
LOG_D(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d\n",
|
||||
|
||||
/*LOG_I(PHY, "[PUSCH %d] Format0 DCI %s, CQI_req=%d, cshift=%d, TPC=%d, DAI=%d, vDAI_UL[sf#%d]=%d, NDI=%d, MCS=%d, RBalloc=%d, first_rb=%d, harq_pid=%d, nb_rb=%d, subframe_scheduling_flag=%d"
|
||||
" ulsch->bundling %d, O_ACK %d \n",
|
||||
harq_pid,
|
||||
(frame_parms->frame_type == TDD? "TDD" : "FDD"),
|
||||
cqi_req, cshift, TPC, dai, subframe, dlsch[0]->harq_ack[subframe].vDAI_UL, ndi, mcs, rballoc, ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag);
|
||||
cqi_req, cshift, TPC, dai, subframe, dlsch[0]->harq_ack[subframe].vDAI_UL, ndi, mcs, rballoc,
|
||||
ulsch->harq_processes[harq_pid]->first_rb, harq_pid, ulsch->harq_processes[harq_pid]->nb_rb,
|
||||
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,
|
||||
ulsch->bundling,
|
||||
ulsch->harq_processes[harq_pid]->O_ACK);*/
|
||||
|
||||
ulsch->beta_offset_cqi_times8 = beta_cqi[ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index];//18;
|
||||
ulsch->beta_offset_ri_times8 = beta_ri[ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index];//10;
|
||||
|
||||
Executable → Regular
+2
-1
@@ -777,7 +777,8 @@ typedef enum {
|
||||
pucch_format1b,
|
||||
pucch_format2,
|
||||
pucch_format2a,
|
||||
pucch_format2b
|
||||
pucch_format2b,
|
||||
pucch_format3 // PUCCH format3
|
||||
} PUCCH_FMT_t;
|
||||
|
||||
|
||||
|
||||
@@ -461,11 +461,11 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
//#ifndef __AVX2__
|
||||
#if 1
|
||||
if (err_flag == 0) {
|
||||
|
||||
LOG_D(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
|
||||
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,
|
||||
/*
|
||||
LOG_I(PHY, "turbo algo Kr=%d cb_cnt=%d C=%d nbRB=%d crc_type %d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d maxIter %d\n",
|
||||
Kr,r,harq_process->C,harq_process->nb_rb,crc_type,A,harq_process->TBS,
|
||||
harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_turbo_iterations);
|
||||
|
||||
*/
|
||||
if (llr8_flag) {
|
||||
AssertFatal (Kr >= 256, "turbo algo issue Kr=%d cb_cnt=%d C=%d nbRB=%d TBSInput=%d TBSHarq=%d TBSplus24=%d mcs=%d Qm=%d RIV=%d round=%d\n",
|
||||
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
|
||||
@@ -641,8 +641,8 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
frame_rx_prev = frame_rx_prev%1024;
|
||||
|
||||
if (err_flag == 1) {
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, round %d, subframe %d)\n",
|
||||
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->round, subframe);
|
||||
//LOG_I(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
// phy_vars_ue->Mod_id, frame, subframe, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs,Kr,r,harq_process->round);
|
||||
|
||||
dlsch->harq_ack[subframe].ack = 0;
|
||||
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
||||
@@ -665,13 +665,16 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
|
||||
return((1+dlsch->max_turbo_iterations));
|
||||
} else {
|
||||
|
||||
//LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for subframe %d TBS %d harq_process->mcs %d harq_process->nb_rb %d\n",
|
||||
//phy_vars_ue->Mod_id,subframe,harq_process->TBS,harq_process->mcs,harq_process->nb_rb);
|
||||
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
dlsch->harq_ack[subframe].ack = 1;
|
||||
dlsch->harq_ack[subframe].harq_id = harq_pid;
|
||||
dlsch->harq_ack[subframe].send_harq_status = 1;
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, pid status %d, round %d, subframe %d)\n",
|
||||
phy_vars_ue->Mod_id, frame_rx_prev, subframe_rx_prev, harq_pid, harq_process->status, harq_process->round, subframe);
|
||||
//LOG_I(PHY,"[UE %d] DLSCH: Setting ACK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d)\n",
|
||||
// phy_vars_ue->Mod_id, frame, subframe, harq_pid, harq_process->status, harq_process->round,harq_process->TBS,harq_process->mcs);
|
||||
|
||||
if(is_crnti)
|
||||
{
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
//#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "defs.h"
|
||||
#include "extern.h"
|
||||
#include "PHY/sse_intrin.h"
|
||||
@@ -256,12 +257,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
ue->high_speed_flag,
|
||||
frame_parms,
|
||||
dlsch0_harq->mimo_mode);
|
||||
//#ifdef DEBUG_DLSCH_MOD
|
||||
/* printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
|
||||
#ifdef DEBUG_DLSCH_MOD
|
||||
printf("dlsch: using pmi %lx, rb_alloc %x, pmi_ext ",pmi2hex_2Ar1(dlsch0_harq->pmi_alloc),*rballoc);
|
||||
for (rb=0;rb<nb_rb;rb++)
|
||||
printf("%d",pdsch_vars[eNB_id]->pmi_ext[rb]);
|
||||
printf("\n");*/
|
||||
//#endif
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
if (rx_type >= rx_IC_single_stream) {
|
||||
if (eNB_id_i<ue->n_connected_eNB) // we are in TM5
|
||||
@@ -353,7 +354,7 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_D(PHY,"[DLSCH] log2_maxh = %d (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
|
||||
LOG_D(PHY,"[DLSCH] nb_rb %d log2_maxh = %d (%d,%d)\n",nb_rb,pdsch_vars[eNB_id]->log2_maxh,avg[0],avgs);
|
||||
LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
|
||||
#endif
|
||||
|
||||
@@ -465,11 +466,12 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
symbol,
|
||||
nb_rb);
|
||||
#ifdef DEBUG_PHY
|
||||
LOG_I(PHY,"[DLSCH] log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",pdsch_vars[eNB_id]->log2_maxh,
|
||||
LOG_I(PHY,"[DLSCH] AbsSubframe %d.%d log2_maxh = %d [log2_maxh0 %d log2_maxh1 %d] (%d,%d)\n",
|
||||
frame%1024,subframe, pdsch_vars[eNB_id]->log2_maxh,
|
||||
pdsch_vars[eNB_id]->log2_maxh0,
|
||||
pdsch_vars[eNB_id]->log2_maxh1,
|
||||
avg[0],avgs);
|
||||
LOG_I(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
|
||||
LOG_D(PHY,"[DLSCH] mimo_mode = %d\n", dlsch0_harq->mimo_mode);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -744,6 +746,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
//i_mod should have been passed as a parameter
|
||||
}
|
||||
|
||||
//printf("LLR dlsch0_harq->Qm %d rx_type %d cw0 %d cw1 %d symbol %d \n",dlsch0_harq->Qm,rx_type,codeword_TB0,codeword_TB1,symbol);
|
||||
|
||||
switch (dlsch0_harq->Qm) {
|
||||
case 2 :
|
||||
if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
|
||||
@@ -909,6 +913,8 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
}
|
||||
break;
|
||||
case 6 :
|
||||
//printf("LLR rx_type %d cw0 %d cw1 %d symbol %d first symbol %d nb_rb %d rballoceven %d sfn %d beamforming_mode %d\n",
|
||||
// rx_type,codeword_TB0,codeword_TB1,symbol,first_symbol_flag,nb_rb,dlsch0_harq->rb_alloc_even,subframe,beamforming_mode);
|
||||
if ((rx_type==rx_standard) || (codeword_TB0 == -1) || (codeword_TB1 == -1)) {
|
||||
dlsch_64qam_llr(frame_parms,
|
||||
pdsch_vars[eNB_id]->rxdataF_comp0,
|
||||
@@ -1045,15 +1051,15 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
|
||||
// Please keep it: useful for debugging
|
||||
#if 0
|
||||
if( (symbol == 13) && (dlsch0_harq->mimo_mode == 2) )
|
||||
if( (symbol == 13) && (subframe==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/)
|
||||
{
|
||||
LOG_E(PHY,"Dump Phy Chan Est \n");
|
||||
if(subframe&0x1)
|
||||
if(1)
|
||||
{
|
||||
#if 1
|
||||
//write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[subframe&0x1].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
@@ -1064,16 +1070,16 @@ int rx_pdsch(PHY_VARS_UE *ue,
|
||||
//write_output("rxdataF_ext10.m" , "rxdataF_ext10", &pdsch_vars[eNB_id]->rxdataF_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_ext11.m" , "rxdataF_ext11", &pdsch_vars[eNB_id]->rxdataF_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("dl_ch_estimates_ext00.m", "dl_ch_estimates_ext00", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("rxdataF_comp00.m","rxdataF_comp00", &pdsch_vars[eNB_id]->rxdataF_comp0[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("rxdataF_comp01.m","rxdataF_comp01", &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("rxdataF_comp10.m","rxdataF_comp10", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("rxdataF_comp11.m","rxdataF_comp11", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_comp01.m","rxdataF_comp01", &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_comp10.m","rxdataF_comp10", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_comp11.m","rxdataF_comp11", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
#endif
|
||||
write_output("llr0.m","llr0", &pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
|
||||
write_output("llr1.m","llr1", &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
|
||||
//write_output("llr1.m","llr1", &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
|
||||
|
||||
|
||||
AssertFatal(0," ");
|
||||
@@ -3323,7 +3329,7 @@ void dlsch_scale_channel(int **dl_ch_estimates_ext,
|
||||
|
||||
ch_amp = ((pilots) ? (dlsch_ue[0]->sqrt_rho_b) : (dlsch_ue[0]->sqrt_rho_a));
|
||||
|
||||
LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
|
||||
LOG_D(PHY,"Scaling PDSCH Chest in OFDM symbol %d by %d, pilots %d nb_rb %d NCP %d symbol %d\n",symbol_mod,ch_amp,pilots,nb_rb,frame_parms->Ncp,symbol);
|
||||
// printf("Scaling PDSCH Chest in OFDM symbol %d by %d\n",symbol_mod,ch_amp);
|
||||
|
||||
ch_amp128 = _mm_set1_epi16(ch_amp); // Q3.13
|
||||
|
||||
@@ -583,7 +583,7 @@ int allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->frame_parms;
|
||||
|
||||
|
||||
int first_layer0; //= dlsch0_harq->first_layer;
|
||||
int first_layer0 = -1; //= dlsch0_harq->first_layer;
|
||||
int Nlayers0 = -1; // = dlsch0_harq->Nlayers;
|
||||
uint8_t mod_order0=0; // = get_Qm(dlsch0_harq->mcs);
|
||||
uint8_t mod_order1=0; //=2;
|
||||
|
||||
Executable → Regular
@@ -135,6 +135,17 @@ unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char su
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if ( (subframe == 8) || (subframe == 9) ) {
|
||||
return(subframe-8);
|
||||
} else {
|
||||
LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
@@ -1396,6 +1407,7 @@ void rx_phich(PHY_VARS_UE *ue,
|
||||
HI16,
|
||||
nseq_PHICH,
|
||||
ngroup_PHICH,
|
||||
ulsch->harq_processes[harq_pid]->round,
|
||||
ulsch->Mlimit);
|
||||
//#endif
|
||||
|
||||
|
||||
@@ -1333,7 +1333,8 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
@returns 0 on success
|
||||
*/
|
||||
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
int32_t pss_ext[4][72]);
|
||||
int32_t pss_ext[4][72],
|
||||
uint8_t subframe);
|
||||
|
||||
/*! \brief Extract only SSS resource elements
|
||||
@param phy_vars_ue Pointer to UE variables
|
||||
@@ -1341,7 +1342,8 @@ int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
@returns 0 on success
|
||||
*/
|
||||
int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
int32_t sss_ext[4][72]);
|
||||
int32_t sss_ext[4][72],
|
||||
uint8_t subframe);
|
||||
|
||||
/*! \brief Performs detection of SSS to find cell ID and other framing parameters (FDD/TDD, normal/extended prefix)
|
||||
@param phy_vars_ue Pointer to UE variables
|
||||
@@ -1998,6 +2000,17 @@ void generate_pucch2x(int32_t **txdataF,
|
||||
uint8_t subframe,
|
||||
uint16_t rnti);
|
||||
|
||||
void generate_pucch3x(int32_t **txdataF,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t ncs_cell[20][7],
|
||||
PUCCH_FMT_t fmt,
|
||||
PUCCH_CONFIG_DEDICATED *pucch_config_dedicated,
|
||||
uint16_t n3_pucch,
|
||||
uint8_t shortened_format,
|
||||
uint8_t *payload,
|
||||
int16_t amp,
|
||||
uint8_t subframe,
|
||||
uint16_t rnti);
|
||||
|
||||
void generate_pucch_emul(PHY_VARS_UE *phy_vars_ue,
|
||||
UE_rxtx_proc_t *proc,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -238,7 +238,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
|
||||
|
||||
|
||||
|
||||
ulsch->harq_processes[harq_pid]->TPC = (rar[3]>>3)&7;//rar->TPC;
|
||||
ulsch->harq_processes[harq_pid]->TPC = (rar[3]>>2)&7;//rar->TPC;
|
||||
|
||||
rballoc = (((uint16_t)(rar[1]&7))<<7)|(rar[2]>>1);
|
||||
cqireq=rar[3]&1;
|
||||
|
||||
@@ -166,6 +166,7 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
|
||||
|
||||
int32_t **rxdataF;
|
||||
|
||||
//LOG_I(PHY,"do_pss_sss_extract subframe %d \n",subframe);
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
@@ -180,11 +181,26 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
|
||||
pss_symb = 2;
|
||||
sss_symb = frame_parms->symbols_per_tti-1;
|
||||
|
||||
if(subframe==5 || subframe==0)
|
||||
{
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
|
||||
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
|
||||
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
}
|
||||
else if(subframe==6 || subframe==1)
|
||||
{
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
|
||||
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
|
||||
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertFatal(0,"");
|
||||
}
|
||||
|
||||
}
|
||||
//printf("extract_rbs: symbol_mod=%d, rx_offset=%d, ch_offset=%d\n",symbol_mod,
|
||||
@@ -204,11 +220,26 @@ int _do_pss_sss_extract(PHY_VARS_UE *ue,
|
||||
}
|
||||
else
|
||||
{
|
||||
if(subframe==5 || subframe==0)
|
||||
{
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
|
||||
sss_rxF = &rxdataF[aarx][(1 + (sss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[((subframe+1)&0x1)].rxdataF;
|
||||
pss_rxF = &rxdataF[aarx][(1 + (pss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
}
|
||||
else if(subframe==6 || subframe==1)
|
||||
{
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe&0x1)].rxdataF;
|
||||
pss_rxF = &rxdataF[aarx][(rx_offset + (pss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
|
||||
rxdataF = ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF;
|
||||
sss_rxF = &rxdataF[aarx][(rx_offset + (sss_symb*(frame_parms->ofdm_symbol_size)))];
|
||||
}
|
||||
else
|
||||
{
|
||||
AssertFatal(0,"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,18 +268,20 @@ int pss_sss_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
int pss_only_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
int32_t pss_ext[4][72])
|
||||
int32_t pss_ext[4][72],
|
||||
uint8_t subframe)
|
||||
{
|
||||
static int32_t dummy[4][72];
|
||||
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, 0);
|
||||
return _do_pss_sss_extract(phy_vars_ue, pss_ext, dummy, 1 /* doPss */, 0 /* doSss */, subframe);
|
||||
}
|
||||
|
||||
|
||||
int sss_only_extract(PHY_VARS_UE *phy_vars_ue,
|
||||
int32_t sss_ext[4][72])
|
||||
int32_t sss_ext[4][72],
|
||||
uint8_t subframe)
|
||||
{
|
||||
static int32_t dummy[4][72];
|
||||
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, 0);
|
||||
return _do_pss_sss_extract(phy_vars_ue, dummy, sss_ext, 0 /* doPss */, 1 /* doSss */, subframe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2067,7 +2067,8 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
|
||||
if ((UE_index >= oai_emulation.info.first_ue_local) ||(UE_index <(oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local))) {
|
||||
get_ack(&eNB->frame_parms,
|
||||
PHY_vars_UE_g[UE_id][CC_id]->dlsch[0][0][0]->harq_ack,
|
||||
subframe,
|
||||
proc->subframe_tx,
|
||||
proc->subframe_rx,
|
||||
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK,0);
|
||||
} else { // get remote UEs' ack
|
||||
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[0] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[0];
|
||||
|
||||
@@ -2510,6 +2510,8 @@ const static int16_t tw64[96] __attribute__((aligned(32))) = {
|
||||
-30273,12539,-25330,20787,-18205,27244,-9512,31356
|
||||
};
|
||||
|
||||
#if 0
|
||||
/* this is defined but not used, let's comment */
|
||||
const static int16_t tw64rep[192] __attribute__((aligned(32))) = {
|
||||
32767,0,32609,-3212,32137,-6393,31356,-9512,32767,0,32609,-3212,32137,-6393,31356,-9512,
|
||||
30272,-12540,28897,-15447,27244,-18205,25329,-20788,30272,-12540,28897,-15447,27244,-18205,25329,-20788,
|
||||
@@ -2524,6 +2526,7 @@ const static int16_t tw64rep[192] __attribute__((aligned(32))) = {
|
||||
-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,-23170,-23170,-28898,-15447,-32138,-6393,-32610,3211,
|
||||
-30273,12539,-25330,20787,-18205,27244,-9512,31356,-30273,12539,-25330,20787,-18205,27244,-9512,31356
|
||||
};
|
||||
#endif
|
||||
|
||||
const static int16_t tw64a[96] __attribute__((aligned(32))) = {
|
||||
32767,0,32609,3212,32137,6393,31356,9512,
|
||||
@@ -2539,6 +2542,8 @@ const static int16_t tw64a[96] __attribute__((aligned(32))) = {
|
||||
-23170,23170,-28898,15447,-32138,6393,-32610,-3211,
|
||||
-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
|
||||
};
|
||||
#if 0
|
||||
/* this is defined but not used, let's comment */
|
||||
const static int16_t tw64arep[192] __attribute__((aligned(32))) = {
|
||||
32767,0,32609,3212,32137,6393,31356,9512,32767,0,32609,3212,32137,6393,31356,9512,
|
||||
30272,12540,28897,15447,27244,18205,25329,20788,30272,12540,28897,15447,27244,18205,25329,20788,
|
||||
@@ -2553,6 +2558,7 @@ const static int16_t tw64arep[192] __attribute__((aligned(32))) = {
|
||||
-23170,23170,-28898,15447,-32138,6393,-32610,-3211,-23170,23170,-28898,15447,-32138,6393,-32610,-3211,
|
||||
-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356,-30273,-12539,-25330,-20787,-18205,-27244,-9512,-31356
|
||||
};
|
||||
#endif
|
||||
|
||||
const static int16_t tw64b[96] __attribute__((aligned(32))) = {
|
||||
0,32767,-3212,32609,-6393,32137,-9512,31356,
|
||||
@@ -2569,6 +2575,8 @@ const static int16_t tw64b[96] __attribute__((aligned(32))) = {
|
||||
12539,-30273,20787,-25330,27244,-18205,31356,-9512
|
||||
};
|
||||
|
||||
#if 0
|
||||
/* this is defined but not used, let's comment */
|
||||
const static int16_t tw64brep[192] __attribute__((aligned(32))) = {
|
||||
0,32767,-3212,32609,-6393,32137,-9512,31356,0,32767,-3212,32609,-6393,32137,-9512,31356,
|
||||
-12540,30272,-15447,28897,-18205,27244,-20788,25329,-12540,30272,-15447,28897,-18205,27244,-20788,25329,
|
||||
@@ -2583,6 +2591,7 @@ const static int16_t tw64brep[192] __attribute__((aligned(32))) = {
|
||||
-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,-23170,-23170,-15447,-28898,-6393,-32138,3211,-32610,
|
||||
12539,-30273,20787,-25330,27244,-18205,31356,-9512,12539,-30273,20787,-25330,27244,-18205,31356,-9512
|
||||
};
|
||||
#endif
|
||||
|
||||
const static int16_t tw64c[96] __attribute__((aligned(32))) = {
|
||||
0,32767,3212,32609,6393,32137,9512,31356,
|
||||
@@ -2599,6 +2608,8 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = {
|
||||
-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
|
||||
};
|
||||
|
||||
#if 0
|
||||
/* this is defined but not used, let's comment */
|
||||
const static int16_t tw64crep[192] __attribute__((aligned(32))) = {
|
||||
0,32767,3212,32609,6393,32137,9512,31356,0,32767,3212,32609,6393,32137,9512,31356,
|
||||
12540,30272,15447,28897,18205,27244,20788,25329,12540,30272,15447,28897,18205,27244,20788,25329,
|
||||
@@ -2613,6 +2624,7 @@ const static int16_t tw64crep[192] __attribute__((aligned(32))) = {
|
||||
23170,-23170,15447,-28898,6393,-32138,-3211,-32610,23170,-23170,15447,-28898,6393,-32138,-3211,-32610,
|
||||
-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512,-12539,-30273,-20787,-25330,-27244,-18205,-31356,-9512
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
|
||||
Executable → Regular
Executable → Regular
@@ -212,6 +212,7 @@ void prach_procedures(PHY_VARS_eNB *eNB);
|
||||
|
||||
lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
|
||||
/*! \brief Function to compute which type of DCIs to detect in the given subframe
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param subframe Subframe index
|
||||
@@ -305,7 +306,7 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
|
||||
@param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
|
||||
@returns status indicator for PUCCH/PUSCH transmission
|
||||
*/
|
||||
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe,uint8_t *o_ACK, uint8_t cw_idx);
|
||||
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t subframe_tx,uint8_t subframe_rx,uint8_t *o_ACK, uint8_t cw_idx);
|
||||
|
||||
/*! \brief Reset ACK/NACK information
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@@ -316,8 +317,10 @@ uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,harq_status_t *harq_ack,uint8_t
|
||||
*/
|
||||
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
harq_status_t *harq_ack,
|
||||
unsigned char subframe,
|
||||
unsigned char subframe_tx,
|
||||
unsigned char subframe_rx,
|
||||
unsigned char *o_ACK,
|
||||
uint8_t *pN_bundled,
|
||||
uint8_t cw_idx);
|
||||
|
||||
/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
|
||||
|
||||
@@ -105,7 +105,47 @@ void get_Msg3_alloc(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
*frame = (current_frame+2) & 1023;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else if (frame_parms->tdd_config == 4) {
|
||||
switch (current_subframe) {
|
||||
|
||||
case 0:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
*subframe = 2;
|
||||
*frame = (current_frame+1) & 1023;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
*subframe = 3;
|
||||
*frame = (current_frame+1) & 1023;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 9:
|
||||
*subframe = 2;
|
||||
*frame = (current_frame+2) & 1023;
|
||||
break;
|
||||
}
|
||||
} else if (frame_parms->tdd_config == 5) {
|
||||
switch (current_subframe) {
|
||||
|
||||
case 0:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
*subframe = 2;
|
||||
*frame = (current_frame+1) & 1023;
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
*subframe = 2;
|
||||
*frame = (current_frame+2) & 1023;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,6 +177,13 @@ void get_Msg3_alloc_ret(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// original PUSCH in 3, PHICH in 9, ret in 3 next frame
|
||||
// original PUSCH in 4, PHICH in 0, ret in 4 next frame
|
||||
*frame=(current_frame+1) & 1023;
|
||||
} else if (frame_parms->tdd_config == 4) {
|
||||
// original PUSCH in 2, PHICH in 8, ret in 2 next frame
|
||||
// original PUSCH in 3, PHICH in 9, ret in 3 next frame
|
||||
*frame=(current_frame+1) & 1023;
|
||||
} else if (frame_parms->tdd_config == 5) {
|
||||
// original PUSCH in 2, PHICH in 8, ret in 2 next frame
|
||||
*frame=(current_frame+1) & 1023;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -253,6 +300,24 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (subframe == 2) { // ACK subframes 0, 4 and 5
|
||||
//if (ACK_index==2)
|
||||
// return(1); TBC
|
||||
if (ACK_index==2)
|
||||
return(0);
|
||||
|
||||
return(4+ACK_index);
|
||||
} else if (subframe == 3) { // ACK subframes 6, 7 8 and 9
|
||||
return(6+ACK_index); // To be updated
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(5+ACK_index);
|
||||
@@ -297,6 +362,30 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (subframe == 2) { // ACK subframes 0,4 and 5
|
||||
return(3); // should be 4
|
||||
} else if (subframe == 3) { // ACK subframes 6,7,8 and 9
|
||||
return(4);
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (subframe == 2) { // ACK subframes 0,3,4,5,6,7,8 and 9
|
||||
return(8); // should be 3
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(2);
|
||||
@@ -323,70 +412,73 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
|
||||
// return the number 'Nbundled'
|
||||
uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
harq_status_t *harq_ack,
|
||||
unsigned char subframe,
|
||||
unsigned char subframe_tx,
|
||||
unsigned char subframe_rx,
|
||||
unsigned char *o_ACK,
|
||||
uint8_t *pN_bundled,
|
||||
uint8_t cw_idx,
|
||||
uint8_t do_reset) // 1 to reset ACK/NACK status : 0 otherwise
|
||||
{
|
||||
uint8_t status=0;
|
||||
uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff;
|
||||
uint8_t subframe_ul=0xff, subframe_dl0=0xff, subframe_dl1=0xff,subframe_dl2=0xff, subframe_dl3=0xff;
|
||||
|
||||
// printf("get_ack: SF %d\n",subframe);
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
if (subframe < 4)
|
||||
subframe_dl0 = subframe + 6;
|
||||
if (subframe_tx < 4)
|
||||
subframe_dl0 = subframe_tx + 6;
|
||||
else
|
||||
subframe_dl0 = subframe - 4;
|
||||
subframe_dl0 = subframe_tx - 4;
|
||||
|
||||
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
|
||||
status = harq_ack[subframe_dl0].send_harq_status;
|
||||
|
||||
//LOG_I(PHY,"dl subframe %d send_harq_status %d cw_idx %d, reset %d\n",subframe_dl0, status, cw_idx, do_reset);
|
||||
if(do_reset)
|
||||
harq_ack[subframe_dl0].send_harq_status = 0;
|
||||
//printf("get_ack: Getting ACK/NAK for PDSCH (subframe %d) => %d\n",subframe_dl,o_ACK[0]);
|
||||
} else {
|
||||
switch (frame_parms->tdd_config) {
|
||||
case 1:
|
||||
if (subframe == 2) { // ACK subframes 5,6
|
||||
if (subframe_tx == 2) { // ACK subframes 5,6
|
||||
subframe_ul = 6;
|
||||
subframe_dl0 = 5;
|
||||
subframe_dl1 = 6;
|
||||
} else if (subframe == 3) { // ACK subframe 9
|
||||
} else if (subframe_tx == 3) { // ACK subframe 9
|
||||
subframe_ul = 9;
|
||||
subframe_dl0 = 9;
|
||||
subframe_dl1 = 0xff;
|
||||
} else if (subframe == 4) { // nothing
|
||||
} else if (subframe_tx == 4) { // nothing
|
||||
subframe_ul = 0xff;
|
||||
subframe_dl0 = 0xff; // invalid subframe number indicates ACK/NACK is not needed
|
||||
subframe_dl1 = 0xff;
|
||||
} else if (subframe == 7) { // ACK subframes 0,1
|
||||
} else if (subframe_tx == 7) { // ACK subframes 0,1
|
||||
subframe_ul = 1;
|
||||
subframe_dl0 = 0;
|
||||
subframe_dl1 = 1;
|
||||
} else if (subframe == 8) { // ACK subframes 4
|
||||
} else if (subframe_tx == 8) { // ACK subframes 4
|
||||
subframe_ul = 4;
|
||||
subframe_dl0 = 4;
|
||||
subframe_dl1 = 0xff;
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
|
||||
subframe_tx,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
// report ACK/NACK status
|
||||
o_ACK[0] = 1;
|
||||
o_ACK[cw_idx] = 1;
|
||||
status = 0;
|
||||
if ((subframe_dl0 < 10) && (harq_ack[subframe_dl0].send_harq_status)) {
|
||||
o_ACK[0] &= harq_ack[subframe_dl0].ack;
|
||||
o_ACK[cw_idx] &= harq_ack[subframe_dl0].ack;
|
||||
status = harq_ack[subframe_dl0].send_harq_status;
|
||||
}
|
||||
if ((subframe_dl1 < 10) && (harq_ack[subframe_dl1].send_harq_status)) {
|
||||
o_ACK[0] &= harq_ack[subframe_dl1].ack;
|
||||
o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
|
||||
status = harq_ack[subframe_dl1].send_harq_status;
|
||||
}
|
||||
// report status = Nbundled
|
||||
if (!status) {
|
||||
o_ACK[0] = 0;
|
||||
o_ACK[cw_idx] = 0;
|
||||
} else {
|
||||
if (harq_ack[subframe_ul].vDAI_UL < 0xff) {
|
||||
status = harq_ack[subframe_ul].vDAI_UL;
|
||||
@@ -396,26 +488,26 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
if (!do_reset && (subframe_ul < 10)) {
|
||||
if ((subframe_dl0 < 10) && (subframe_dl1 < 10)) {
|
||||
LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d harq_status=%d vDAI_DL=%d, dlsf#%d ACK=%d harq_status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
|
||||
subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||
subframe_tx, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||
subframe_dl0, harq_ack[subframe_dl0].ack, harq_ack[subframe_dl0].send_harq_status, harq_ack[subframe_dl0].vDAI_DL,
|
||||
subframe_dl1, harq_ack[subframe_dl1].ack, harq_ack[subframe_dl1].send_harq_status, harq_ack[subframe_dl1].vDAI_DL,
|
||||
o_ACK[0], status);
|
||||
o_ACK[cw_idx], status);
|
||||
} else if (subframe_dl0 < 10) {
|
||||
LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
|
||||
subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||
subframe_tx, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||
subframe_dl0, harq_ack[subframe_dl0].ack, harq_ack[subframe_dl0].send_harq_status, harq_ack[subframe_dl0].vDAI_DL,
|
||||
o_ACK[0], status);
|
||||
o_ACK[cw_idx], status);
|
||||
}else if (subframe_dl1 < 10) {
|
||||
LOG_D(PHY,"ul-sf#%d vDAI_UL[sf#%d]=%d Nbundled=%d: dlsf#%d ACK=%d status=%d vDAI_DL=%d, o_ACK[0]=%d status=%d\n",
|
||||
subframe, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||
subframe_tx, subframe_ul, harq_ack[subframe_ul].vDAI_UL, status,
|
||||
subframe_dl1, harq_ack[subframe_dl1].ack, harq_ack[subframe_dl1].send_harq_status, harq_ack[subframe_dl1].vDAI_DL,
|
||||
o_ACK[0], status);
|
||||
o_ACK[cw_idx], status);
|
||||
}
|
||||
}
|
||||
|
||||
// reset ACK/NACK status
|
||||
if (do_reset) {
|
||||
LOG_D(PHY,"ul-sf#%d ACK/NACK status resetting @ dci0-sf#%d, dci1x/2x-sf#%d, dci1x/2x-sf#%d\n", subframe, subframe_ul, subframe_dl0, subframe_dl1);
|
||||
LOG_D(PHY,"ul-sf#%d ACK/NACK status resetting @ dci0-sf#%d, dci1x/2x-sf#%d, dci1x/2x-sf#%d\n", subframe_tx, subframe_ul, subframe_dl0, subframe_dl1);
|
||||
if (subframe_ul < 10) {
|
||||
harq_ack[subframe_ul].vDAI_UL = 0xff;
|
||||
}
|
||||
@@ -434,36 +526,44 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
break;
|
||||
|
||||
case 3:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
if (subframe_tx == 2) { // ACK subframes 5 and 6
|
||||
subframe_dl0 = 5;
|
||||
subframe_dl1 = 6;
|
||||
//printf("Subframe 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
|
||||
} else if (subframe == 3) { // ACK subframes 7 and 8
|
||||
subframe_ul = 2;
|
||||
//printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
|
||||
} else if (subframe_tx == 3) { // ACK subframes 7 and 8
|
||||
subframe_dl0 = 7;
|
||||
subframe_dl1 = 8;
|
||||
subframe_ul = 3;
|
||||
//printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
|
||||
//printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
|
||||
} else if (subframe == 4) { // ACK subframes 9 and 0
|
||||
} else if (subframe_tx == 4) { // ACK subframes 9 and 0
|
||||
subframe_dl0 = 9;
|
||||
subframe_dl1 = 0;
|
||||
subframe_ul = 4;
|
||||
//printf("Subframe 4, TDD config 3: harq_ack[9] = %d,harq_ack[0] = %d\n",harq_ack[9].ack,harq_ack[0].ack);
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
|
||||
subframe_tx,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
// report ACK/NACK status
|
||||
o_ACK[cw_idx] = 0;
|
||||
if (harq_ack[subframe_dl0].send_harq_status == 1) {
|
||||
o_ACK[0] = harq_ack[subframe_dl0].ack;
|
||||
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
|
||||
|
||||
if (harq_ack[subframe_dl1].send_harq_status == 1)
|
||||
o_ACK[1] = harq_ack[subframe_dl1].ack;
|
||||
o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
|
||||
} else if (harq_ack[subframe_dl1].send_harq_status == 1)
|
||||
o_ACK[0] = harq_ack[subframe_dl1].ack;
|
||||
o_ACK[cw_idx] = harq_ack[subframe_dl1].ack;
|
||||
|
||||
status = harq_ack[subframe_dl0].send_harq_status + (harq_ack[subframe_dl1].send_harq_status<<1);
|
||||
pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL;
|
||||
status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status;
|
||||
|
||||
//LOG_D(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d subframe_rx %d N_bundled %d \n",
|
||||
// subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack,
|
||||
// subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack, subframe_rx, pN_bundled[0]);
|
||||
if (do_reset) {
|
||||
// reset ACK/NACK status
|
||||
harq_ack[subframe_dl0].ack = 2;
|
||||
@@ -474,6 +574,63 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if (subframe_tx == 2) { // ACK subframes 4, 5 and 0
|
||||
subframe_dl0 = 4;
|
||||
subframe_dl1 = 5;
|
||||
subframe_dl2 = 0;
|
||||
subframe_ul = 2;
|
||||
//printf("subframe_tx 2, TDD config 3: harq_ack[5] = %d (%d),harq_ack[6] = %d (%d)\n",harq_ack[5].ack,harq_ack[5].send_harq_status,harq_ack[6].ack,harq_ack[6].send_harq_status);
|
||||
} else if (subframe_tx == 3) { // ACK subframes 6, 7 8 and 9
|
||||
subframe_dl0 = 6;
|
||||
subframe_dl1 = 7;
|
||||
subframe_dl2 = 8;
|
||||
subframe_dl3 = 9;
|
||||
subframe_ul = 3;
|
||||
//printf("Subframe 3, TDD config 3: harq_ack[7] = %d,harq_ack[8] = %d\n",harq_ack[7].ack,harq_ack[8].ack);
|
||||
//printf("status %d : o_ACK (%d,%d)\n", status,o_ACK[0],o_ACK[1]);
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte.c: get_ack, illegal subframe_tx %d for tdd_config %d\n",
|
||||
subframe_tx,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
// report ACK/NACK status
|
||||
o_ACK[cw_idx] = 0;
|
||||
if (harq_ack[subframe_dl0].send_harq_status == 1)
|
||||
o_ACK[cw_idx] = harq_ack[subframe_dl0].ack;
|
||||
|
||||
if (harq_ack[subframe_dl1].send_harq_status == 1)
|
||||
o_ACK[cw_idx] &= harq_ack[subframe_dl1].ack;
|
||||
|
||||
if (harq_ack[subframe_dl2].send_harq_status == 1)
|
||||
o_ACK[cw_idx] &= harq_ack[subframe_dl2].ack;
|
||||
|
||||
if (harq_ack[subframe_dl3].send_harq_status == 1)
|
||||
o_ACK[cw_idx] &= harq_ack[subframe_dl3].ack;
|
||||
|
||||
pN_bundled[0] = harq_ack[subframe_rx].vDAI_UL;
|
||||
status = harq_ack[subframe_dl0].send_harq_status + harq_ack[subframe_dl1].send_harq_status + harq_ack[subframe_dl2].send_harq_status + harq_ack[subframe_dl3].send_harq_status;
|
||||
|
||||
LOG_I(PHY,"TDD Config3 UL Sfn %d, dl Sfn0 %d status %d o_Ack %d, dl Sfn1 %d status %d o_Ack %d dl Sfn2 %d status %d o_Ack %d dl Sfn3 %d status %d o_Ack %d subframe_rx %d N_bundled %d status %d\n",
|
||||
subframe_tx, subframe_dl0, harq_ack[subframe_dl0].send_harq_status,harq_ack[subframe_dl0].ack,
|
||||
subframe_dl1, harq_ack[subframe_dl1].send_harq_status,harq_ack[subframe_dl1].ack,
|
||||
subframe_dl2, harq_ack[subframe_dl2].send_harq_status,harq_ack[subframe_dl2].ack,
|
||||
subframe_dl3, harq_ack[subframe_dl3].send_harq_status,harq_ack[subframe_dl3].ack,subframe_rx, pN_bundled[0], status);
|
||||
if (do_reset) {
|
||||
// reset ACK/NACK status
|
||||
harq_ack[subframe_dl0].ack = 2;
|
||||
harq_ack[subframe_dl1].ack = 2;
|
||||
harq_ack[subframe_dl2].ack = 2;
|
||||
harq_ack[subframe_dl3].ack = 2;
|
||||
harq_ack[subframe_dl0].send_harq_status = 0;
|
||||
harq_ack[subframe_dl1].send_harq_status = 0;
|
||||
harq_ack[subframe_dl2].send_harq_status = 0;
|
||||
harq_ack[subframe_dl3].send_harq_status = 0;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -484,20 +641,24 @@ uint8_t get_reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
uint8_t get_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
harq_status_t *harq_ack,
|
||||
unsigned char subframe,
|
||||
unsigned char subframe_tx,
|
||||
unsigned char subframe_rx,
|
||||
unsigned char *o_ACK,
|
||||
uint8_t cw_idx)
|
||||
{
|
||||
return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, cw_idx, 0);
|
||||
uint8_t N_bundled = 0;
|
||||
return get_reset_ack(frame_parms, harq_ack, subframe_tx, subframe_rx, o_ACK, &N_bundled, cw_idx, 0);
|
||||
}
|
||||
|
||||
uint8_t reset_ack(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
harq_status_t *harq_ack,
|
||||
unsigned char subframe,
|
||||
unsigned char subframe_tx,
|
||||
unsigned char subframe_rx,
|
||||
unsigned char *o_ACK,
|
||||
uint8_t *pN_bundled,
|
||||
uint8_t cw_idx)
|
||||
{
|
||||
return get_reset_ack(frame_parms, harq_ack, subframe, o_ACK, cw_idx, 1);
|
||||
return get_reset_ack(frame_parms, harq_ack, subframe_tx, subframe_rx, o_ACK, pN_bundled, cw_idx, 1);
|
||||
}
|
||||
|
||||
|
||||
@@ -594,6 +755,29 @@ lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
|
||||
return(255);
|
||||
}
|
||||
|
||||
case 4:
|
||||
if ((subframe<1) || (subframe>=4))
|
||||
return(SF_DL);
|
||||
else if ((subframe>1) && (subframe < 4))
|
||||
return(SF_UL);
|
||||
else if (subframe==1)
|
||||
return (SF_S);
|
||||
else {
|
||||
LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n");
|
||||
return(255);
|
||||
}
|
||||
|
||||
case 5:
|
||||
if ((subframe<1) || (subframe>=3))
|
||||
return(SF_DL);
|
||||
else if ((subframe>1) && (subframe < 3))
|
||||
return(SF_UL);
|
||||
else if (subframe==1)
|
||||
return (SF_S);
|
||||
else {
|
||||
LOG_E(PHY,"[PHY_PROCEDURES_LTE] Unknown subframe number\n");
|
||||
return(255);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -668,13 +852,13 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
|
||||
break;
|
||||
|
||||
case 4:
|
||||
if ((subframe == 0) || (subframe == 8) )
|
||||
if ((subframe == 8) || (subframe == 9) )
|
||||
return(1);
|
||||
|
||||
break;
|
||||
|
||||
case 5:
|
||||
if (subframe == 0)
|
||||
if (subframe == 8)
|
||||
return(1);
|
||||
|
||||
break;
|
||||
|
||||
@@ -906,7 +906,9 @@ void generate_eNB_ulsch_params(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,DCI_ALLOC
|
||||
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->round),
|
||||
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->first_rb),
|
||||
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->nb_rb),
|
||||
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS));
|
||||
T_INT(eNB->ulsch[(uint32_t)UE_id]->harq_processes[harq_pid]->TBS),
|
||||
T_INT(dci_alloc->L),
|
||||
T_INT(dci_alloc->firstCCE));
|
||||
}
|
||||
|
||||
void pdsch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,LTE_eNB_DLSCH_t *dlsch, LTE_eNB_DLSCH_t *dlsch1,LTE_eNB_UE_stats *ue_stats,int ra_flag,int num_pdcch_symbols) {
|
||||
@@ -2272,7 +2274,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
|
||||
|
||||
if ((fp->frame_type==FDD) ||
|
||||
(bundling_flag==bundling) ||
|
||||
((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)||(subframe!=7)))) {
|
||||
((fp->frame_type==TDD)&&(fp->tdd_config==1)&&((subframe!=2)&&(subframe!=7)))) {
|
||||
format = pucch_format1a;
|
||||
} else {
|
||||
format = pucch_format1b;
|
||||
|
||||
@@ -444,8 +444,26 @@ uint8_t is_ri_TXOp(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id)
|
||||
return(0);
|
||||
}
|
||||
|
||||
void compute_cqi_ri_resources(PHY_VARS_UE *ue,
|
||||
LTE_UE_ULSCH_t *ulsch,
|
||||
uint8_t eNB_id,
|
||||
uint16_t rnti,
|
||||
uint16_t p_rnti,
|
||||
uint16_t cba_rnti,
|
||||
uint8_t cqi_status,
|
||||
uint8_t ri_status)
|
||||
{
|
||||
//PHY_MEASUREMENTS *meas = &ue->measurements;
|
||||
//uint8_t transmission_mode = ue->transmission_mode[eNB_id];
|
||||
|
||||
|
||||
//LOG_I(PHY,"compute_cqi_ri_resources O_RI %d O %d uci format %d \n",ulsch->O_RI,ulsch->O,ulsch->uci_format);
|
||||
if (cqi_status == 1 || ri_status == 1)
|
||||
{
|
||||
ulsch->O = 4;
|
||||
}
|
||||
}
|
||||
|
||||
void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t isSubframeSRS)
|
||||
{
|
||||
|
||||
@@ -511,7 +529,7 @@ void ue_compute_srs_occasion(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id
|
||||
uint8_t pucch_ack_payload[2];
|
||||
if (get_ack(&ue->frame_parms,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
|
||||
subframe_tx,pucch_ack_payload,0) > 0)
|
||||
subframe_tx,proc->subframe_rx,pucch_ack_payload,0) > 0)
|
||||
{
|
||||
is_sr_an_subframe = 1;
|
||||
}
|
||||
@@ -633,13 +651,15 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type,
|
||||
}
|
||||
if(SR_payload == 1)
|
||||
{
|
||||
return pucch_format1;
|
||||
/*
|
||||
if (frame_type == FDD) {
|
||||
return pucch_format1;
|
||||
} else if (frame_type == TDD) {
|
||||
return pucch_format1b;
|
||||
} else {
|
||||
AssertFatal(1==0,"Unknown frame_type");
|
||||
}
|
||||
}*/
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -680,13 +700,14 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
||||
{
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
uint8_t nCCE0,nCCE1,harq_ack1,harq_ack0;
|
||||
uint8_t nCCE0,nCCE1,nCCE2,nCCE3,harq_ack1,harq_ack0,harq_ack3,harq_ack2;
|
||||
ANFBmode_t bundling_flag;
|
||||
uint16_t n1_pucch0=0,n1_pucch1=0;
|
||||
uint16_t n1_pucch0=0,n1_pucch1=0,n1_pucch2=0,n1_pucch3=0,n1_pucch_inter;
|
||||
static uint8_t candidate_dl[9]; // which downlink(s) the current ACK/NACK is associating to
|
||||
uint8_t last_dl=0xff; // the last downlink with valid DL-DCI. for calculating the PUCCH resource index
|
||||
int sf;
|
||||
int M;
|
||||
uint8_t ack_counter=0;
|
||||
// clear this, important for case where n1_pucch selection is not used
|
||||
int subframe=proc->subframe_tx;
|
||||
|
||||
@@ -706,10 +727,10 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
|
||||
if (bundling_flag==bundling) {
|
||||
LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
|
||||
LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, bundling, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
|
||||
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
||||
} else {
|
||||
LOG_D(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
|
||||
LOG_I(PHY,"[UE%d] Frame %d subframe %d : get_n1_pucch, multiplexing, SR %d/%d\n",ue->Mod_id,proc->frame_tx,subframe,SR,
|
||||
ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
||||
}
|
||||
|
||||
@@ -815,6 +836,11 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
||||
harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+last_dl].ack;
|
||||
|
||||
LOG_D(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d\n",
|
||||
proc->frame_tx%1024,
|
||||
proc->subframe_tx,
|
||||
nCCE0,n1_pucch0,
|
||||
nCCE1,n1_pucch1);
|
||||
|
||||
if (harq_ack1!=2) { // n-6 // subframe 6,8,0 and maybe 5,7,9 is to be ACK/NAKed
|
||||
|
||||
@@ -871,6 +897,239 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
|
||||
|
||||
break;
|
||||
|
||||
case 4: // DL:S:UL:UL:DL:DL:DL:DL:DL:DL
|
||||
// in this configuration we have M=4 from pg 68 of 36.213 (v8.6)
|
||||
// Note: this doesn't allow using subframe 1 for PDSCH transmission!!! (i.e. SF 1 cannot be acked in SF 2)
|
||||
// set ACK/NAKs to DTX
|
||||
harq_ack3 = 2; // DTX
|
||||
harq_ack2 = 2; // DTX
|
||||
harq_ack1 = 2; // DTX
|
||||
harq_ack0 = 2; // DTX
|
||||
// This is the offset for a particular subframe (2,3,4) => (0,2,4)
|
||||
//last_dl = (subframe-2)<<1;
|
||||
if (subframe == 2) {
|
||||
// i=0
|
||||
//nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe];
|
||||
nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10];
|
||||
n1_pucch0 = 2*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
// i=1
|
||||
nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[2+subframe];
|
||||
n1_pucch1 = get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
// i=2
|
||||
nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(8+subframe)%10];
|
||||
n1_pucch2 = 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
// i=3
|
||||
//nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(9+subframe)%10];
|
||||
//n1_pucch3 = get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
|
||||
// set ACK/NAK to values if not DTX
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed
|
||||
harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(8+subframe)%10].ack;
|
||||
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
||||
harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[2+subframe].ack;
|
||||
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed
|
||||
harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[3+subframe].ack;
|
||||
|
||||
//if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
||||
//harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(9+subframe)%10].ack;
|
||||
//LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d cce1=%d n1_pucch1=%d cce2=%d n1_pucch2=%d\n",
|
||||
// proc->frame_tx%1024,
|
||||
// proc->subframe_tx,
|
||||
// nCCE0,n1_pucch0,
|
||||
// nCCE1,n1_pucch1, nCCE2, n1_pucch2);
|
||||
}else if (subframe == 3) {
|
||||
// i=0
|
||||
|
||||
nCCE0 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[4+subframe];
|
||||
n1_pucch0 = 3*get_Np(frame_parms->N_RB_DL,nCCE0,0) + nCCE0+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
// i=1
|
||||
nCCE1 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[5+subframe];
|
||||
n1_pucch1 = 2*get_Np(frame_parms->N_RB_DL,nCCE1,0) + get_Np(frame_parms->N_RB_DL,nCCE1,1) + nCCE1 + frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
// i=2
|
||||
nCCE2 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(6+subframe)];
|
||||
n1_pucch2 = get_Np(frame_parms->N_RB_DL,nCCE2,0) + 2*get_Np(frame_parms->N_RB_DL,nCCE2,1) + nCCE2+ frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
// i=3
|
||||
nCCE3 = ue->pdcch_vars[proc->subframe_rx & 0x1][eNB_id]->nCCE[(3+subframe)];
|
||||
n1_pucch3 = 3*get_Np(frame_parms->N_RB_DL,nCCE3,1) + nCCE3 + frame_parms->pucch_config_common.n1PUCCH_AN;
|
||||
|
||||
// set ACK/NAK to values if not DTX
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed
|
||||
harq_ack0 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[4+subframe].ack;
|
||||
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
||||
harq_ack1 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[5+subframe].ack;
|
||||
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].send_harq_status>0) // n-6 // subframe 6 is to be ACK/NAKed
|
||||
harq_ack2 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(6+subframe)].ack;
|
||||
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].send_harq_status>0) // n-6 // subframe 5 is to be ACK/NAKed
|
||||
harq_ack3 = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack[(3+subframe)].ack;
|
||||
}
|
||||
|
||||
//LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch cce0=%d n1_pucch0=%d harq_ack0=%d cce1=%d n1_pucch1=%d harq_ack1=%d cce2=%d n1_pucch2=%d harq_ack2=%d cce3=%d n1_pucch3=%d harq_ack3=%d bundling_flag=%d\n",
|
||||
// proc->frame_tx%1024,
|
||||
// proc->subframe_tx,
|
||||
// nCCE0,n1_pucch0,harq_ack0,
|
||||
// nCCE1,n1_pucch1,harq_ack1, nCCE2, n1_pucch2, harq_ack2,
|
||||
// nCCE3, n1_pucch3, harq_ack3, bundling_flag);
|
||||
|
||||
if ((bundling_flag==bundling)&&(SR == 0)) { // This is for bundling without SR,
|
||||
if ((harq_ack0!=2) ) {
|
||||
b[0] = harq_ack0;
|
||||
n1_pucch_inter = n1_pucch0;
|
||||
}
|
||||
if ((harq_ack1!=2) ) {
|
||||
b[0] = b[0]&harq_ack1;
|
||||
n1_pucch_inter = n1_pucch1;
|
||||
}
|
||||
if ((harq_ack2!=2) ) {
|
||||
b[0] = b[0]&harq_ack2;
|
||||
n1_pucch_inter = n1_pucch2;
|
||||
}
|
||||
if ((harq_ack3!=2) ) {
|
||||
b[0] = b[0]&harq_ack3;
|
||||
n1_pucch_inter = n1_pucch3;
|
||||
}
|
||||
|
||||
if (subframe == 3) {
|
||||
n1_pucch_inter = n1_pucch2;
|
||||
} else if (subframe == 2) {
|
||||
n1_pucch_inter = n1_pucch2;
|
||||
}
|
||||
|
||||
//LOG_I(PHY,"SFN/SF %d/%d calculating n1_pucch n1_pucch_inter=%d b[0]=%d b[1]=%d \n",
|
||||
// proc->frame_tx%1024,
|
||||
// proc->subframe_tx,n1_pucch_inter,
|
||||
// b[0],b[1]);
|
||||
|
||||
return(n1_pucch_inter);
|
||||
|
||||
} else if ((bundling_flag==multiplexing)&&(SR==0)) { // Table 10.1
|
||||
|
||||
if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
|
||||
b[1] = 1;
|
||||
b[0] = 1;
|
||||
return(n1_pucch1);
|
||||
} else if ((harq_ack0 == 1) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[0] = 1;
|
||||
b[1] = 0;
|
||||
return(n1_pucch1);
|
||||
} else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 0) && (harq_ack3 == 2)) {
|
||||
b[1] = 1;
|
||||
b[0] = 1;
|
||||
return(n1_pucch2);
|
||||
} else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) {
|
||||
b[1] = 1;
|
||||
b[0] = 0;
|
||||
return(n1_pucch1);
|
||||
} else if ((harq_ack0 == 0) && (harq_ack1 == 2) && (harq_ack2 == 2) && (harq_ack3 == 2)) {
|
||||
b[1] = 1;
|
||||
b[0] = 0;
|
||||
return(n1_pucch0);
|
||||
} else if ((harq_ack0 == 1) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[1] = 1;
|
||||
b[0] = 0;
|
||||
return(n1_pucch1);
|
||||
} else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch3);
|
||||
} else if (((harq_ack0 == 0) || (harq_ack0 == 2)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 0)) {
|
||||
b[1] = 1;
|
||||
b[0] = 1;
|
||||
return(n1_pucch3);
|
||||
} else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch2);
|
||||
} else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch0);
|
||||
} else if ((harq_ack0 == 1) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch0);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch3);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 0) && (harq_ack2 == 2) && (harq_ack3 == 2)) {
|
||||
b[0] = 0;
|
||||
b[1] = 0;
|
||||
return(n1_pucch1);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[0] = 1;
|
||||
b[1] = 0;
|
||||
return(n1_pucch2);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && (harq_ack3 == 1)) {
|
||||
b[0] = 1;
|
||||
b[1] = 0;
|
||||
return(n1_pucch3);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && (harq_ack1 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0)) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch1);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && (harq_ack3 == 1)) {
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
return(n1_pucch3);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack2 == 1) && ((harq_ack3 == 2) || (harq_ack3 == 0))) {
|
||||
b[0] = 0;
|
||||
b[1] = 0;
|
||||
return(n1_pucch2);
|
||||
} else if (((harq_ack0 == 2) || (harq_ack0 == 0)) && ((harq_ack1 == 2) || (harq_ack1 == 0)) && (harq_ack3 == 1) && ((harq_ack2 == 2) || (harq_ack2 == 0))) {
|
||||
b[0] = 0;
|
||||
b[1] = 0;
|
||||
return(n1_pucch3);
|
||||
}
|
||||
|
||||
} else if (SR==1) { // SR and 0,1,or 2 ACKS, (first 3 entries in Table 7.3-1 of 36.213)
|
||||
// this should be number of ACKs (including
|
||||
if (harq_ack0==1)
|
||||
ack_counter ++;
|
||||
if (harq_ack1==1)
|
||||
ack_counter ++;
|
||||
if (harq_ack2==1)
|
||||
ack_counter ++;
|
||||
if (harq_ack3==1)
|
||||
ack_counter ++;
|
||||
|
||||
switch (ack_counter) {
|
||||
case 0:
|
||||
b[0] = 0;
|
||||
b[1] = 0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
b[0] = 1;
|
||||
b[1] = 1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
b[0] = 1;
|
||||
b[1] = 0;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
b[0] = 0;
|
||||
b[1] = 1;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
b[0] = 1;
|
||||
b[1] = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
ack_counter = 0;
|
||||
return(ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
} // switch tdd_config
|
||||
}
|
||||
|
||||
@@ -1216,9 +1475,11 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
uint8_t ulsch_input_buffer[5477] __attribute__ ((aligned(32)));
|
||||
uint8_t access_mode;
|
||||
uint8_t Nbundled=0;
|
||||
uint8_t NbundledCw1=0;
|
||||
uint8_t ack_status_cw0=0;
|
||||
uint8_t ack_status_cw1=0;
|
||||
|
||||
uint8_t cqi_status = 0;
|
||||
uint8_t ri_status = 0;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,VCD_FUNCTION_IN);
|
||||
|
||||
// get harq_pid from subframe relationship
|
||||
@@ -1321,25 +1582,45 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
ack_status_cw0 = reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
|
||||
subframe_tx,
|
||||
ue->ulsch[eNB_id]->o_ACK,0);
|
||||
proc->subframe_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&Nbundled,
|
||||
0);
|
||||
ack_status_cw1 = reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack,
|
||||
subframe_tx,
|
||||
ue->ulsch[eNB_id]->o_ACK,1);
|
||||
proc->subframe_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&NbundledCw1,
|
||||
1);
|
||||
|
||||
//Nbundled = ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack;
|
||||
//ue->ulsch[eNB_id]->bundling = Nbundled;
|
||||
|
||||
Nbundled = ack_status_cw0;
|
||||
first_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->first_rb;
|
||||
nb_rb = ue->ulsch[eNB_id]->harq_processes[harq_pid]->nb_rb;
|
||||
|
||||
|
||||
// check Periodic CQI/RI reporting
|
||||
cqi_status = ((ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex>0)&&
|
||||
(is_cqi_TXOp(ue,proc,eNB_id)==1));
|
||||
|
||||
ri_status = ((ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex>0) &&
|
||||
(is_ri_TXOp(ue,proc,eNB_id)==1));
|
||||
|
||||
|
||||
// compute CQI/RI resources
|
||||
compute_cqi_ri_resources(ue, ue->ulsch[eNB_id], eNB_id, ue->ulsch[eNB_id]->rnti, P_RNTI, CBA_RNTI, cqi_status, ri_status);
|
||||
|
||||
|
||||
if (ack_status_cw0 > 0) {
|
||||
|
||||
// check if we received a PDSCH at subframe_tx - 4
|
||||
// ==> send ACK/NACK on PUSCH
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1;
|
||||
if (ue->frame_parms.frame_type == FDD)
|
||||
{
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = ack_status_cw0 + ack_status_cw1;
|
||||
}
|
||||
|
||||
|
||||
#if T_TRACER
|
||||
if(ue->ulsch[eNB_id]->o_ACK[0])
|
||||
@@ -1366,8 +1647,9 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,
|
||||
"[UE %d][PUSCH %d] AbsSubframe %d.%d %d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, bundling %d\n",
|
||||
Mod_id,harq_pid,frame_tx,subframe_tx,proc->subframe_rx,
|
||||
"[UE %d][PUSCH %d] AbsSubframe %d.%d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, "
|
||||
"cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d, ack_status_cw0 %d ack_status_cw1 %d bundling %d, Nbundled %d, CQI %d, RI %d\n",
|
||||
Mod_id,harq_pid,frame_tx%1024,subframe_tx,
|
||||
first_rb,nb_rb,
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round,
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->mcs,
|
||||
@@ -1380,7 +1662,11 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
|
||||
ue->frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[subframe_tx<<1],
|
||||
ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1],
|
||||
ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK,
|
||||
ue->ulsch[eNB_id]->bundling);
|
||||
ack_status_cw0,
|
||||
ack_status_cw1,
|
||||
ue->ulsch[eNB_id]->bundling, Nbundled,
|
||||
cqi_status,
|
||||
ri_status);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -1619,11 +1905,16 @@ int16_t get_pucch2_cqi(PHY_VARS_UE *ue,int eNB_id,int *len) {
|
||||
if ((ue->transmission_mode[eNB_id]<4)||
|
||||
(ue->transmission_mode[eNB_id]==7)) { // Mode 1-0 feedback
|
||||
// 4-bit CQI message
|
||||
/*LOG_I(PHY,"compute CQI value, TM %d, length 4, Cqi Avg %d, value %d \n", ue->transmission_mode[eNB_id],
|
||||
ue->measurements.wideband_cqi_avg[eNB_id],
|
||||
sinr2cqi((double)ue->measurements.wideband_cqi_avg[eNB_id],
|
||||
ue->transmission_mode[eNB_id]));*/
|
||||
*len=4;
|
||||
return(sinr2cqi((double)ue->measurements.wideband_cqi_avg[eNB_id],
|
||||
ue->transmission_mode[eNB_id]));
|
||||
}
|
||||
else { // Mode 1-1 feedback, later
|
||||
//LOG_I(PHY,"compute CQI value, TM %d, length 0, Cqi Avg 0 \n", ue->transmission_mode[eNB_id]);
|
||||
*len=0;
|
||||
// 2-antenna ports RI=1, 6 bits (2 PMI, 4 CQI)
|
||||
|
||||
@@ -1694,6 +1985,10 @@ void get_pucch_param(PHY_VARS_UE *ue,
|
||||
case pucch_format2b:
|
||||
LOG_E(PHY,"NO Resource available for PUCCH 2a/2b \n");
|
||||
break;
|
||||
|
||||
case pucch_format3:
|
||||
fprintf(stderr, "PUCCH format 3 not handled\n");
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1784,16 +2079,18 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
ack_status_cw0 = get_ack(&ue->frame_parms,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
|
||||
subframe_tx,
|
||||
proc->subframe_rx,
|
||||
pucch_ack_payload,
|
||||
0);
|
||||
|
||||
ack_status_cw1 = get_ack(&ue->frame_parms,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack,
|
||||
subframe_tx,
|
||||
proc->subframe_rx,
|
||||
pucch_ack_payload,
|
||||
1);
|
||||
|
||||
nb_cw = ack_status_cw0 + ack_status_cw1;
|
||||
nb_cw = ( (ack_status_cw0 != 0) ? 1:0) + ( (ack_status_cw1 != 0) ? 1:0);
|
||||
|
||||
cqi_status = ((ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex>0)&&
|
||||
(is_cqi_TXOp(ue,proc,eNB_id)==1));
|
||||
@@ -1803,7 +2100,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
|
||||
// Part - II
|
||||
// if nothing to report ==> exit function
|
||||
if( (nb_cw==0) && (SR_payload==0) && (cqi_status==0) && (ri_status==0))
|
||||
if( (nb_cw==0) && (SR_payload==0) && (cqi_status==0) && (ri_status==0) )
|
||||
{
|
||||
LOG_D(PHY,"PUCCH No feedback AbsSubframe %d.%d SR_payload %d nb_cw %d pucch_ack_payload[0] %d pucch_ack_payload[1] %d cqi_status %d Return \n",
|
||||
frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status);
|
||||
@@ -1830,8 +2127,8 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
(uint8_t *)&pucch_payload,
|
||||
&len);
|
||||
|
||||
LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n",
|
||||
frame_tx%1024, subframe_tx, SR_payload, nb_cw, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]);
|
||||
LOG_D(PHY,"PUCCH feedback AbsSubframe %d.%d SR %d NbCW %d (%d %d) AckNack %d.%d CQI %d RI %d format %d pucch_resource %d pucch_payload %d %d \n",
|
||||
frame_tx%1024, subframe_tx, SR_payload, nb_cw, ack_status_cw0, ack_status_cw1, pucch_ack_payload[0], pucch_ack_payload[1], cqi_status, ri_status, format, pucch_resource,pucch_payload[0],pucch_payload[1]);
|
||||
|
||||
|
||||
// Part - IV
|
||||
@@ -1995,13 +2292,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
break;
|
||||
|
||||
case pucch_format2a:
|
||||
LOG_I(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2a (RI or CQI) Ack/Nack 1bit \n",
|
||||
LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2a (RI or CQI) Ack/Nack 1bit \n",
|
||||
Mod_id,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti,
|
||||
frame_tx%1024, subframe_tx);
|
||||
break;
|
||||
case pucch_format2b:
|
||||
LOG_I(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2b (RI or CQI) Ack/Nack 2bits\n",
|
||||
LOG_D(PHY,"[UE %d][RNTI %x] AbsSubFrame %d.%d Generating PUCCH 2b (RI or CQI) Ack/Nack 2bits\n",
|
||||
Mod_id,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->rnti,
|
||||
frame_tx%1024, subframe_tx);
|
||||
@@ -2145,17 +2442,33 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
|
||||
}
|
||||
|
||||
// reset DL ACK/NACK status
|
||||
uint8_t N_bundled = 0;
|
||||
if (ue->dlsch[proc->subframe_rx&0x1][eNB_id][0] != NULL)
|
||||
{
|
||||
reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
|
||||
subframe_tx,
|
||||
ue->ulsch[eNB_id]->o_ACK,0);
|
||||
proc->subframe_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
reset_ack(&ue->frame_parms,
|
||||
ue->dlsch[(proc->subframe_rx+1)&0x1][eNB_id][0]->harq_ack,
|
||||
subframe_tx,
|
||||
proc->subframe_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
}
|
||||
|
||||
if (ue->dlsch_SI[eNB_id] != NULL)
|
||||
reset_ack(&ue->frame_parms,
|
||||
ue->dlsch_SI[eNB_id]->harq_ack,
|
||||
subframe_tx,
|
||||
ue->ulsch[eNB_id]->o_ACK,0);
|
||||
proc->subframe_rx,
|
||||
ue->ulsch[eNB_id]->o_ACK,
|
||||
&N_bundled,
|
||||
0);
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
|
||||
@@ -2191,6 +2504,8 @@ void ue_measurement_procedures(
|
||||
uint16_t slot, // slot index of each radio frame [0..19]
|
||||
uint8_t abstraction_flag,runmode_t mode)
|
||||
{
|
||||
//LOG_I(PHY,"ue_measurement_procedures l %d Ncp %d\n",l,ue->frame_parms.Ncp);
|
||||
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms=&ue->frame_parms;
|
||||
|
||||
@@ -2230,6 +2545,7 @@ void ue_measurement_procedures(
|
||||
if (l==(6-ue->frame_parms.Ncp)) {
|
||||
|
||||
// make sure we have signal from PSS/SSS for N0 measurement
|
||||
// LOG_I(PHY," l==(6-ue->frame_parms.Ncp) ue_rrc_measurements\n");
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_RRC_MEASUREMENTS, VCD_FUNCTION_IN);
|
||||
ue_rrc_measurements(ue,
|
||||
@@ -3142,6 +3458,48 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
|
||||
} // is_pmch_subframe=true
|
||||
}
|
||||
|
||||
void copy_harq_proc_struct(LTE_DL_UE_HARQ_t *harq_processes_dest, LTE_DL_UE_HARQ_t *current_harq_processes)
|
||||
{
|
||||
harq_processes_dest->B = current_harq_processes->B ;
|
||||
harq_processes_dest->C = current_harq_processes->C ;
|
||||
harq_processes_dest->Cminus = current_harq_processes->Cminus ;
|
||||
harq_processes_dest->Cplus = current_harq_processes->Cplus ;
|
||||
harq_processes_dest->DCINdi = current_harq_processes->DCINdi ;
|
||||
harq_processes_dest->F = current_harq_processes->F ;
|
||||
harq_processes_dest->G = current_harq_processes->G ;
|
||||
harq_processes_dest->Kminus = current_harq_processes->Kminus ;
|
||||
harq_processes_dest->Kplus = current_harq_processes->Kplus ;
|
||||
harq_processes_dest->Nl = current_harq_processes->Nl ;
|
||||
harq_processes_dest->Qm = current_harq_processes->Qm ;
|
||||
harq_processes_dest->TBS = current_harq_processes->TBS ;
|
||||
harq_processes_dest->b = current_harq_processes->b ;
|
||||
harq_processes_dest->codeword = current_harq_processes->codeword ;
|
||||
harq_processes_dest->delta_PUCCH = current_harq_processes->delta_PUCCH ;
|
||||
harq_processes_dest->dl_power_off = current_harq_processes->dl_power_off ;
|
||||
harq_processes_dest->first_tx = current_harq_processes->first_tx ;
|
||||
harq_processes_dest->mcs = current_harq_processes->mcs ;
|
||||
harq_processes_dest->mimo_mode = current_harq_processes->mimo_mode ;
|
||||
harq_processes_dest->nb_rb = current_harq_processes->nb_rb ;
|
||||
harq_processes_dest->pmi_alloc = current_harq_processes->pmi_alloc ;
|
||||
harq_processes_dest->rb_alloc_even[0] = current_harq_processes->rb_alloc_even[0] ;
|
||||
harq_processes_dest->rb_alloc_even[1] = current_harq_processes->rb_alloc_even[1] ;
|
||||
harq_processes_dest->rb_alloc_even[2] = current_harq_processes->rb_alloc_even[2] ;
|
||||
harq_processes_dest->rb_alloc_even[3] = current_harq_processes->rb_alloc_even[3] ;
|
||||
harq_processes_dest->rb_alloc_odd[0] = current_harq_processes->rb_alloc_odd[0] ;
|
||||
harq_processes_dest->rb_alloc_odd[1] = current_harq_processes->rb_alloc_odd[1] ;
|
||||
harq_processes_dest->rb_alloc_odd[2] = current_harq_processes->rb_alloc_odd[2] ;
|
||||
harq_processes_dest->rb_alloc_odd[3] = current_harq_processes->rb_alloc_odd[3] ;
|
||||
harq_processes_dest->round = current_harq_processes->round ;
|
||||
harq_processes_dest->rvidx = current_harq_processes->rvidx ;
|
||||
harq_processes_dest->status = current_harq_processes->status ;
|
||||
harq_processes_dest->vrb_type = current_harq_processes->vrb_type ;
|
||||
}
|
||||
|
||||
void copy_ack_struct(harq_status_t *harq_ack_dest, harq_status_t *current_harq_ack)
|
||||
{
|
||||
memcpy(harq_ack_dest, current_harq_ack, sizeof(harq_status_t));
|
||||
}
|
||||
|
||||
void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSCH_t pdsch, LTE_UE_DLSCH_t *dlsch0, LTE_UE_DLSCH_t *dlsch1, int s0, int s1, int abstraction_flag) {
|
||||
|
||||
int subframe_rx = proc->subframe_rx;
|
||||
@@ -3157,7 +3515,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
|
||||
|
||||
if (dlsch0 && (!dlsch1)) {
|
||||
harq_pid = dlsch0->current_harq_pid;
|
||||
LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d\n",ue->Mod_id,subframe_rx,harq_pid);
|
||||
LOG_D(PHY,"[UE %d] PDSCH active in subframe %d, harq_pid %d Symbol %d\n",ue->Mod_id,subframe_rx,harq_pid,m);
|
||||
|
||||
if ((pdsch==PDSCH) &&
|
||||
(ue->transmission_mode[eNB_id] == 5) &&
|
||||
@@ -3929,6 +4287,27 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
}
|
||||
|
||||
start_meas(&ue->generic_stat);
|
||||
|
||||
#if 0
|
||||
if(subframe_rx==5 && ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid]->nb_rb > 20){
|
||||
//write_output("decoder_llr.m","decllr",dlsch_llr,G,1,0);
|
||||
//write_output("llr.m","llr", &ue->pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
|
||||
|
||||
write_output("rxdataF0_current.m" , "rxdataF0", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
//write_output("rxdataF0_previous.m" , "rxdataF0_prev_sss", &ue->common_vars.common_vars_rx_data_per_thread[(subframe_rx+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
|
||||
//write_output("rxdataF0_previous.m" , "rxdataF0_prev", &ue->common_vars.common_vars_rx_data_per_thread[(subframe+1)&0x1].rxdataF[0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
|
||||
write_output("dl_ch_estimates.m", "dl_ch_estimates_sfn5", &ue->common_vars.common_vars_rx_data_per_thread[subframe_rx&0x1].dl_ch_estimates[0][0][0],14*ue->frame_parms.ofdm_symbol_size,1,1);
|
||||
write_output("dl_ch_estimates_ext.m", "dl_ch_estimatesExt_sfn5", &ue->pdsch_vars[subframe_rx&0x1][0]->dl_ch_estimates_ext[0][0],14*ue->frame_parms.N_RB_DL*12,1,1);
|
||||
write_output("rxdataF_comp00.m","rxdataF_comp00", &ue->pdsch_vars[subframe_rx&0x1][0]->rxdataF_comp0[0][0],14*ue->frame_parms.N_RB_DL*12,1,1);
|
||||
//write_output("magDLFirst.m", "magDLFirst", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_mag0[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("magDLSecond.m", "magDLSecond", &phy_vars_ue->pdsch_vars[subframe&0x1][0]->dl_ch_magb0[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
|
||||
AssertFatal (0,"");
|
||||
}
|
||||
#endif
|
||||
|
||||
// do procedures for SI-RNTI
|
||||
if ((ue->dlsch_SI[eNB_id]) && (ue->dlsch_SI[eNB_id]->active == 1)) {
|
||||
ue_pdsch_procedures(ue,
|
||||
@@ -3999,6 +4378,18 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
|
||||
ue->dlsch_ra[eNB_id]->active = 0;
|
||||
}
|
||||
|
||||
// duplicate harq structure
|
||||
|
||||
uint8_t current_harq_pid = ue->dlsch[subframe_rx&0x1][eNB_id][0]->current_harq_pid;
|
||||
LTE_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_processes[current_harq_pid];
|
||||
LTE_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_processes[current_harq_pid];
|
||||
|
||||
harq_status_t *current_harq_ack = &ue->dlsch[subframe_rx&0x1][eNB_id][0]->harq_ack[subframe_rx];
|
||||
harq_status_t *harq_ack_dest = &ue->dlsch[(subframe_rx+1)&0x1][eNB_id][0]->harq_ack[subframe_rx];
|
||||
|
||||
copy_harq_proc_struct(harq_processes_dest, current_harq_processes);
|
||||
copy_ack_struct(harq_ack_dest, current_harq_ack);
|
||||
|
||||
if (subframe_rx==9) {
|
||||
if (frame_rx % 10 == 0) {
|
||||
if ((ue->dlsch_received[eNB_id] - ue->dlsch_received_last[eNB_id]) != 0)
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "PHY/defs.h"
|
||||
#include "SCHED/defs.h"
|
||||
#include "PHY/LTE_TRANSPORT/proto.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
@@ -85,6 +86,10 @@ int16_t pucch_power_cntl(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t subframe,u
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case pucch_format3:
|
||||
fprintf(stderr, "PUCCH format 3 not handled\n");
|
||||
abort();
|
||||
}
|
||||
|
||||
if (pucch_fmt!=pucch_format1) {
|
||||
|
||||
@@ -308,10 +308,10 @@ void* multicast_link_main_loop (void *param)
|
||||
}
|
||||
|
||||
void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
|
||||
unsigned char multicast_group, char *multicast_ifname)
|
||||
unsigned char _multicast_group, char *multicast_ifname)
|
||||
{
|
||||
rx_handler = rx_handlerP;
|
||||
multicast_group = multicast_group;
|
||||
multicast_group = _multicast_group;
|
||||
multicast_if = multicast_ifname;
|
||||
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
|
||||
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
|
||||
|
||||
@@ -1341,7 +1341,7 @@ int main(int argc, char **argv)
|
||||
//int iii;
|
||||
|
||||
int ch_realization;
|
||||
int pmi_feedback=0;
|
||||
//int pmi_feedback=0;
|
||||
int hold_channel=0;
|
||||
|
||||
// void *data;
|
||||
@@ -1379,6 +1379,7 @@ int main(int argc, char **argv)
|
||||
uint8_t Kmimo;
|
||||
uint8_t ue_category=4;
|
||||
uint32_t Nsoft;
|
||||
int sf;
|
||||
|
||||
|
||||
|
||||
@@ -1390,7 +1391,7 @@ int main(int argc, char **argv)
|
||||
|
||||
FILE *csv_fd=NULL;
|
||||
char csv_fname[32];
|
||||
int dci_flag=1;
|
||||
//int dci_flag=1;
|
||||
int two_thread_flag=0;
|
||||
int DLSCH_RB_ALLOC = 0;
|
||||
|
||||
@@ -1452,9 +1453,9 @@ int main(int argc, char **argv)
|
||||
Nid_cell = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'd':
|
||||
dci_flag = 1;
|
||||
break;
|
||||
//case 'd':
|
||||
// dci_flag = 1;
|
||||
// break;
|
||||
|
||||
case 'D':
|
||||
frame_type=TDD;
|
||||
@@ -1481,7 +1482,7 @@ int main(int argc, char **argv)
|
||||
case 'i':
|
||||
input_fd = fopen(optarg,"r");
|
||||
input_file=1;
|
||||
dci_flag = 1;
|
||||
//dci_flag = 1;
|
||||
break;
|
||||
|
||||
case 'I':
|
||||
@@ -2104,15 +2105,22 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[subframe&0x1][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
/* allocate memory for both subframes (only one is really used
|
||||
* but there is now "copy_harq_proc_struct" which needs both
|
||||
* to be valid)
|
||||
* TODO: refine this somehow (necessary?)
|
||||
*/
|
||||
for (sf = 0; sf < 2; sf++) {
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[sf][0][i] = new_ue_dlsch(Kmimo,8,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!UE->dlsch[subframe&0x1][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
if (!UE->dlsch[sf][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
UE->dlsch[sf][0][i]->rnti = n_rnti;
|
||||
}
|
||||
|
||||
UE->dlsch[subframe&0x1][0][i]->rnti = n_rnti;
|
||||
}
|
||||
|
||||
UE->dlsch_SI[0] = new_ue_dlsch(1,1,Nsoft,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
@@ -2317,10 +2325,10 @@ int main(int argc, char **argv)
|
||||
// printf("Trial %d, round %d\n",trials,round);
|
||||
round_trials[round]++;
|
||||
|
||||
if(transmission_mode>=5)
|
||||
pmi_feedback=1;
|
||||
else
|
||||
pmi_feedback=0;
|
||||
//if(transmission_mode>=5)
|
||||
// pmi_feedback=1;
|
||||
//else
|
||||
// pmi_feedback=0;
|
||||
|
||||
if (abstx) {
|
||||
if (trials==0 && round==0 && SNR==snr0) //generate a new channel
|
||||
|
||||
@@ -85,11 +85,13 @@ int main(int argc, char **argv)
|
||||
|
||||
// double pucch_sinr;
|
||||
uint8_t osf=1,N_RB_DL=25;
|
||||
uint32_t pucch_tx=0,pucch1_missed=0,pucch1_false=0,sig;
|
||||
uint32_t pucch_tx=0,pucch1_missed=0,pucch1_false=0,pucch3_false=0,sig;
|
||||
PUCCH_FMT_t pucch_format = pucch_format1;
|
||||
PUCCH_CONFIG_DEDICATED pucch_config_dedicated;
|
||||
uint8_t subframe=0;
|
||||
uint8_t pucch_payload,pucch_payload_rx;
|
||||
uint8_t pucch3_payload_size=7;
|
||||
uint8_t pucch3_payload[21],pucch3_payload_rx[21];
|
||||
double tx_gain=1.0;
|
||||
int32_t stat;
|
||||
double stat_no_sig,stat_sig;
|
||||
@@ -98,6 +100,9 @@ int main(int argc, char **argv)
|
||||
|
||||
uint16_t n1_pucch = 0;
|
||||
uint16_t n2_pucch = 0;
|
||||
uint16_t n3_pucch = 20;
|
||||
|
||||
uint16_t n_rnti=0x1234;
|
||||
|
||||
number_of_cards = 1;
|
||||
|
||||
@@ -118,6 +123,8 @@ int main(int argc, char **argv)
|
||||
pucch_format = pucch_format1a;
|
||||
else if (atoi(optarg)==2)
|
||||
pucch_format = pucch_format1b;
|
||||
else if (atoi(optarg)==6) // 3,4,5 is reserved for format2,2a,2b
|
||||
pucch_format = pucch_format3;
|
||||
else {
|
||||
printf("Unsupported pucch_format %d\n",atoi(optarg));
|
||||
exit(-1);
|
||||
@@ -282,7 +289,7 @@ int main(int argc, char **argv)
|
||||
printf("-N Noise variance in dB\n");
|
||||
printf("-R N_RB_DL\n");
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
printf("-f PUCCH format (0=1,1=1a,2=1b), formats 2/2a/2b not supported\n");
|
||||
printf("-f PUCCH format (0=1,1=1a,2=1b,6=3), formats 2/2a/2b not supported\n");
|
||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||
exit (-1);
|
||||
break;
|
||||
@@ -362,18 +369,34 @@ int main(int argc, char **argv)
|
||||
UE->frame_parms.pucch_config_common.nRB_CQI = 4;
|
||||
UE->frame_parms.pucch_config_common.nCS_AN = 6;
|
||||
|
||||
pucch_payload = 0;
|
||||
|
||||
generate_pucch1x(UE->common_vars.txdataF,
|
||||
frame_parms,
|
||||
UE->ncs_cell,
|
||||
pucch_format,
|
||||
&pucch_config_dedicated,
|
||||
n1_pucch,
|
||||
0, //shortened_format,
|
||||
&pucch_payload,
|
||||
AMP, //amp,
|
||||
subframe); //subframe
|
||||
if( (pucch_format == pucch_format1) || (pucch_format == pucch_format1a) || (pucch_format == pucch_format1b) ){
|
||||
pucch_payload = 0;
|
||||
generate_pucch1x(UE->common_vars.txdataF,
|
||||
frame_parms,
|
||||
UE->ncs_cell,
|
||||
pucch_format,
|
||||
&pucch_config_dedicated,
|
||||
n1_pucch,
|
||||
0, //shortened_format,
|
||||
&pucch_payload,
|
||||
AMP, //amp,
|
||||
subframe); //subframe
|
||||
}else if( pucch_format == pucch_format3){
|
||||
for(i=0;i<pucch3_payload_size;i++)
|
||||
pucch3_payload[i]=(uint8_t)(taus()&0x1);
|
||||
generate_pucch3x(UE->common_vars.txdataF,
|
||||
frame_parms,
|
||||
UE->ncs_cell,
|
||||
pucch_format,
|
||||
&pucch_config_dedicated,
|
||||
n3_pucch,
|
||||
0, //shortened_format,
|
||||
pucch3_payload,
|
||||
AMP, //amp,
|
||||
subframe, //subframe
|
||||
n_rnti); //rnti
|
||||
}
|
||||
write_output("txsigF0.m","txsF0", &UE->common_vars.txdataF[0][2*subframe*nsymb*OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX],OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES_NO_PREFIX*nsymb,1,1);
|
||||
|
||||
tx_lev = 0;
|
||||
@@ -429,6 +452,7 @@ int main(int argc, char **argv)
|
||||
pucch_tx = 0;
|
||||
pucch1_missed=0;
|
||||
pucch1_false=0;
|
||||
pucch3_false=0;
|
||||
|
||||
stat_no_sig = 0;
|
||||
stat_sig = 0;
|
||||
@@ -540,7 +564,7 @@ int main(int argc, char **argv)
|
||||
n1_pucch,
|
||||
n2_pucch,
|
||||
0, //shortened_format,
|
||||
&pucch_payload_rx, //payload,
|
||||
(pucch_format==pucch_format3) ? pucch3_payload_rx : &pucch_payload_rx, //payload,
|
||||
0 /* frame not defined, let's pass 0 */,
|
||||
subframe,
|
||||
pucch1_thres);
|
||||
@@ -561,8 +585,15 @@ int main(int argc, char **argv)
|
||||
printf("EXIT\n");
|
||||
exit(-1);
|
||||
}*/
|
||||
} else {
|
||||
} else if( (pucch_format==pucch_format1a) || (pucch_format==pucch_format1b) ) {
|
||||
pucch1_false = (pucch_payload_rx != pucch_payload) ? (pucch1_false+1) : pucch1_false;
|
||||
} else if (pucch_format==pucch_format3){
|
||||
for(i=0;i<pucch3_payload_size;i++){
|
||||
if(pucch3_payload[i]!=pucch3_payload_rx[i]){
|
||||
pucch3_false = (pucch3_false+1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// printf("sig %d\n",sig);
|
||||
@@ -576,7 +607,8 @@ int main(int argc, char **argv)
|
||||
printf("pucch_trials %d : pucch1a_errors %d\n",pucch_tx,pucch1_false);
|
||||
else if (pucch_format==pucch_format1b)
|
||||
printf("pucch_trials %d : pucch1b_errors %d\n",pucch_tx,pucch1_false);
|
||||
|
||||
else if (pucch_format==pucch_format3)
|
||||
printf("pucch_trials %d : pucch3_errors %d\n",pucch_tx,pucch3_false);
|
||||
}
|
||||
|
||||
if (n_frames==1) {
|
||||
|
||||
@@ -253,7 +253,7 @@ int main(int argc, char **argv)
|
||||
|
||||
uint8_t N_RB_DL=25,osf=1;
|
||||
|
||||
uint8_t cyclic_shift = 0;
|
||||
//uint8_t cyclic_shift = 0;
|
||||
uint8_t cooperation_flag = 0; //0 no cooperation, 1 delay diversity, 2 Alamouti
|
||||
uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
|
||||
uint8_t tdd_config=3,frame_type=FDD;
|
||||
@@ -275,6 +275,7 @@ int main(int argc, char **argv)
|
||||
uint8_t max_turbo_iterations=4;
|
||||
uint8_t parallel_flag=0;
|
||||
int nb_rb_set = 0;
|
||||
int sf;
|
||||
|
||||
int threequarter_fs=0;
|
||||
int ndi;
|
||||
@@ -462,9 +463,9 @@ int main(int argc, char **argv)
|
||||
first_rb = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
cyclic_shift = atoi(optarg);
|
||||
break;
|
||||
//case 'c':
|
||||
// cyclic_shift = atoi(optarg);
|
||||
// break;
|
||||
|
||||
case 'E':
|
||||
threequarter_fs=1;
|
||||
@@ -556,7 +557,9 @@ int main(int argc, char **argv)
|
||||
|
||||
case 'h':
|
||||
default:
|
||||
printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -c cyclic_shift -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
|
||||
/* option "-c cyclic_shift" is not used, let's remove from documentation */
|
||||
//printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -c cyclic_shift -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
|
||||
printf("%s -h(elp) -a(wgn on) -m mcs -n n_frames -s snr0 -t delay_spread -p (extended prefix on) -r nb_rb -f first_rb -o (srs on) -g channel_model [A:M] Use 3GPP 25.814 SCM-A/B/C/D('A','B','C','D') or 36-101 EPA('E'), EVA ('F'),ETU('G') models (ignores delay spread and Ricean factor), Rayghleigh8 ('H'), Rayleigh1('I'), Rayleigh1_corr('J'), Rayleigh1_anticorr ('K'), Rice8('L'), Rice1('M'), -d Channel delay, -D maximum Doppler shift \n",
|
||||
argv[0]);
|
||||
exit(1);
|
||||
break;
|
||||
@@ -709,22 +712,27 @@ int main(int argc, char **argv)
|
||||
// Create transport channel structures for 2 transport blocks (MIMO)
|
||||
for (i=0; i<2; i++) {
|
||||
eNB->dlsch[0][i] = new_eNB_dlsch(1,8,1827072,N_RB_DL,0,&eNB->frame_parms);
|
||||
UE->dlsch[subframe&1][0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
if (!eNB->dlsch[0][i]) {
|
||||
printf("Can't get eNB dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (!UE->dlsch[subframe&1][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
eNB->dlsch[0][i]->rnti = 14;
|
||||
UE->dlsch[subframe&1][0][i]->rnti = 14;
|
||||
|
||||
}
|
||||
}
|
||||
/* allocate memory for both subframes (only one is really used
|
||||
* but there is now "copy_harq_proc_struct" which needs both
|
||||
* to be valid)
|
||||
* TODO: refine this somehow (necessary?)
|
||||
*/
|
||||
for (sf = 0; sf < 2; sf++) {
|
||||
for (i=0; i<2; i++) {
|
||||
UE->dlsch[sf][0][i] = new_ue_dlsch(1,8,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
if (!UE->dlsch[sf][0][i]) {
|
||||
printf("Can't get ue dlsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
UE->dlsch[sf][0][i]->rnti = 14;
|
||||
}
|
||||
}
|
||||
|
||||
UE->dlsch_SI[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
UE->dlsch_ra[0] = new_ue_dlsch(1,1,1827072,MAX_TURBO_ITERATIONS,N_RB_DL,0);
|
||||
|
||||
@@ -101,7 +101,7 @@ void fill_channel_desc(channel_desc_t *chan_desc,
|
||||
|
||||
LOG_D(OCM,"[CHANNEL] Filling a (nb_taps %d)\n",nb_taps);
|
||||
for (i = 0; i<nb_taps; i++) {
|
||||
LOG_D(OCM,"tap %d (%p,%d)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex));
|
||||
LOG_D(OCM,"tap %d (%p,%zu)\n",i,&chan_desc->a[i],nb_tx*nb_rx * sizeof(struct complex));
|
||||
chan_desc->a[i] = (struct complex*) malloc(nb_tx*nb_rx * sizeof(struct complex));
|
||||
}
|
||||
|
||||
|
||||
@@ -140,10 +140,14 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
|
||||
|
||||
rnti = UE_RNTI(module_idP, i);
|
||||
CC_id = UE_PCCID(module_idP, i);
|
||||
if ((frameP==0)&&(subframeP==0))
|
||||
LOG_I(MAC,"UE rnti %x : %s, PHR %d dB\n", rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][i].phr_info);
|
||||
if ((frameP==0)&&(subframeP==0)) {
|
||||
LTE_eNB_UE_stats *eNB_UE_stats = mac_xface->get_eNB_UE_stats(module_idP, CC_id, rnti);
|
||||
int cqi = eNB_UE_stats == NULL ? -1 : eNB_UE_stats->DL_cqi[0];
|
||||
LOG_I(MAC,"UE rnti %x : %s, PHR %d dB CQI %d\n", rnti,
|
||||
UE_list->UE_sched_ctrl[i].ul_out_of_sync==0 ? "in synch" : "out of sync",
|
||||
UE_list->UE_template[CC_id][i].phr_info,
|
||||
cqi);
|
||||
}
|
||||
|
||||
PHY_vars_eNB_g[module_idP][CC_id]->pusch_stats_bsr[i][(frameP*10)+subframeP]=-63;
|
||||
if (i==UE_list->head)
|
||||
|
||||
Regular → Executable
+22
-22
@@ -520,25 +520,27 @@ schedule_ue_spec(
|
||||
// mac_xface->macphy_exit("[MAC][eNB] Cannot find eNB_UE_stats\n");
|
||||
continue_flag=1;
|
||||
}
|
||||
|
||||
switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)){
|
||||
case 1:
|
||||
case 2:
|
||||
case 7:
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
|
||||
if (continue_flag != 1){
|
||||
switch(mac_xface->get_transmission_mode(module_idP,CC_id,rnti)){
|
||||
case 1:
|
||||
case 2:
|
||||
case 7:
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
eNB_UE_stats->DL_cqi[0],
|
||||
format1);
|
||||
break;
|
||||
case 3:
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
break;
|
||||
case 3:
|
||||
aggregation = get_aggregation(get_bw_index(module_idP,CC_id),
|
||||
eNB_UE_stats->DL_cqi[0],
|
||||
format2A);
|
||||
break;
|
||||
default:
|
||||
LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(module_idP,CC_id,rnti));
|
||||
aggregation = 2;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
LOG_W(MAC,"Unsupported transmission mode %d\n", mac_xface->get_transmission_mode(module_idP,CC_id,rnti));
|
||||
aggregation = 2;
|
||||
}
|
||||
} /* if (continue_flag != 1 */
|
||||
|
||||
if ((ue_sched_ctl->pre_nb_available_rbs[CC_id] == 0) || // no RBs allocated
|
||||
CCE_allocation_infeasible(module_idP,CC_id,0,subframeP,aggregation,rnti)
|
||||
) {
|
||||
@@ -610,17 +612,15 @@ schedule_ue_spec(
|
||||
|
||||
if (round > 0) {
|
||||
|
||||
if (frame_parms[CC_id]->frame_type == TDD) {
|
||||
UE_list->UE_template[CC_id][UE_id].DAI++;
|
||||
update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n",
|
||||
CC_id,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
}
|
||||
|
||||
// get freq_allocation
|
||||
nb_rb = UE_list->UE_template[CC_id][UE_id].nb_rb[harq_pid];
|
||||
|
||||
if (nb_rb <= nb_available_rb) {
|
||||
if (frame_parms[CC_id]->frame_type == TDD) {
|
||||
UE_list->UE_template[CC_id][UE_id].DAI++;
|
||||
update_ul_dci(module_idP,CC_id,rnti,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
LOG_D(MAC,"DAI update: CC_id %d subframeP %d: UE %d, DAI %d\n", CC_id,subframeP,UE_id,UE_list->UE_template[CC_id][UE_id].DAI);
|
||||
}
|
||||
|
||||
if(nb_rb == ue_sched_ctl->pre_nb_available_rbs[CC_id]) {
|
||||
for(j=0; j<frame_parms[CC_id]->N_RBG; j++) { // for indicating the rballoc for each sub-band
|
||||
|
||||
@@ -87,7 +87,7 @@ int schedule_MBMS(module_id_t module_idP, uint8_t CC_id, frame_t frameP, sub_fra
|
||||
unsigned char header_len_mcch=0,header_len_msi=0,header_len_mtch=0, header_len_mtch_temp=0, header_len_mcch_temp=0, header_len_msi_temp=0;
|
||||
int ii=0, msi_pos=0;
|
||||
int mcch_mcs = -1;
|
||||
uint16_t TBS,j,padding=0,post_padding=0;
|
||||
uint16_t TBS,j=-1,padding=0,post_padding=0;
|
||||
mac_rlc_status_resp_t rlc_status;
|
||||
int num_mtch;
|
||||
int msi_length,i,k;
|
||||
|
||||
@@ -66,14 +66,29 @@
|
||||
*/
|
||||
|
||||
/* this function checks that get_eNB_UE_stats returns
|
||||
* a non-NULL pointer for all CCs for a given UE
|
||||
* a non-NULL pointer for all the active CCs of an UE
|
||||
*/
|
||||
int phy_stats_exist(module_id_t Mod_id, int rnti)
|
||||
{
|
||||
int CC_id;
|
||||
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
|
||||
int i;
|
||||
int UE_id = find_UE_id(Mod_id, rnti);
|
||||
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
|
||||
if (UE_id == -1) {
|
||||
LOG_W(MAC, "[eNB %d] UE %x not found, should be there (in phy_stats_exist)\n",
|
||||
Mod_id, rnti);
|
||||
return 0;
|
||||
}
|
||||
if (UE_list->numactiveCCs[UE_id] == 0) {
|
||||
LOG_W(MAC, "[eNB %d] UE %x has no active CC (in phy_stats_exist)\n",
|
||||
Mod_id, rnti);
|
||||
return 0;
|
||||
}
|
||||
for (i = 0; i < UE_list->numactiveCCs[UE_id]; i++) {
|
||||
CC_id = UE_list->ordered_CCids[i][UE_id];
|
||||
if (mac_xface->get_eNB_UE_stats(Mod_id, CC_id, rnti) == NULL)
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -545,7 +545,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
pdcp_read_state_g = 0;
|
||||
// print_active_requests()
|
||||
#ifdef PDCP_DEBUG
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %d \n",
|
||||
LOG_D(PDCP, "[PDCP][NETLINK] Something in socket, length %zu\n",
|
||||
nas_nlh_rx->nlmsg_len - sizeof(struct nlmsghdr));
|
||||
#endif
|
||||
|
||||
@@ -603,7 +603,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
#ifdef PDCP_DEBUG
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
|
||||
LOG_D(PDCP, "[FRAME %5u][eNB][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
len,
|
||||
@@ -693,7 +693,7 @@ int pdcp_fifo_read_input_sdus (const protocol_ctxt_t* const ctxt_pP)
|
||||
if (h_rc == HASH_TABLE_OK) {
|
||||
rab_id = pdcp_p->rb_id;
|
||||
#ifdef PDCP_DEBUG
|
||||
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %d) on Rab %d \n",
|
||||
LOG_D(PDCP, "[FRAME %5u][UE][NETLINK][IP->PDCP] INST %d: Received socket with length %d (nlmsg_len = %zu) on Rab %d \n",
|
||||
ctxt.frame,
|
||||
pdcp_read_header_g.inst,
|
||||
len,
|
||||
|
||||
@@ -408,19 +408,27 @@ rlc_am_receive_process_control_pdu(
|
||||
//TODO : this part does not cover all cases of Data Cnf and move it at the end of Status PDU processing
|
||||
sn_cursor = rlc_pP->vt_a;
|
||||
|
||||
/* Handle all acked PDU up to and excluding sn_data_cnf */
|
||||
while (sn_cursor != sn_data_cnf) {
|
||||
rlc_am_pdu_sdu_data_cnf(ctxt_pP,rlc_pP,sn_cursor);
|
||||
sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
|
||||
}
|
||||
// Fix Issue 238 : check sn_data_cnf has been transmitted
|
||||
if ((rlc_pP->tx_data_pdu_buffer[sn_data_cnf % RLC_AM_WINDOW_SIZE].flags.transmitted) &&
|
||||
(rlc_pP->tx_data_pdu_buffer[sn_data_cnf % RLC_AM_WINDOW_SIZE].sn == sn_data_cnf)) {
|
||||
/* Handle all acked PDU up to and excluding sn_data_cnf */
|
||||
while (sn_cursor != sn_data_cnf) {
|
||||
rlc_am_pdu_sdu_data_cnf(ctxt_pP,rlc_pP,sn_cursor);
|
||||
sn_cursor = RLC_AM_NEXT_SN(sn_cursor);
|
||||
}
|
||||
|
||||
// Handle last SN. TO DO : case of PDU partially ACKED with SDU to be data conf
|
||||
if (data_cnf_so_stop == 0x7FFF) {
|
||||
rlc_am_pdu_sdu_data_cnf(ctxt_pP,rlc_pP,sn_data_cnf);
|
||||
}
|
||||
// Handle last SN. TO DO : case of PDU partially ACKED with SDU to be data conf
|
||||
if (data_cnf_so_stop == 0x7FFF) {
|
||||
rlc_am_pdu_sdu_data_cnf(ctxt_pP,rlc_pP,sn_data_cnf);
|
||||
}
|
||||
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RECEIVE STATUS PDU ACK_SN=%d NewvtA=%d OldvtA=%d SnDataCnf=%d DataCnfSOStop=%d vtS=%d\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,vt_a_new,rlc_pP->vt_a,sn_data_cnf,data_cnf_so_stop,rlc_pP->vt_s);
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RECEIVE STATUS PDU ACK_SN=%d NewvtA=%d OldvtA=%d SnDataCnf=%d DataCnfSOStop=%d vtS=%d\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,vt_a_new,rlc_pP->vt_a,sn_data_cnf,data_cnf_so_stop,rlc_pP->vt_s);
|
||||
}
|
||||
else {
|
||||
LOG_D(RLC, PROTOCOL_RLC_AM_CTXT_FMT" RECEIVE STATUS PDU WITH NO SDU CNF ACK_SN=%d NewvtA=%d OldvtA=%d vtS=%d\n",
|
||||
PROTOCOL_RLC_AM_CTXT_ARGS(ctxt_pP,rlc_pP),ack_sn,vt_a_new,rlc_pP->vt_a,rlc_pP->vt_s);
|
||||
}
|
||||
|
||||
/* Update vtA and vtMS */
|
||||
rlc_pP->vt_a = vt_a_new;
|
||||
|
||||
@@ -228,7 +228,7 @@ void rlc_am_v9_3_0_test_read_write_bit_field()
|
||||
uint8_t* byte_pos_read = g_buffer;
|
||||
uint16_t read_value;
|
||||
|
||||
memset (g_buffer, 0, 1024);
|
||||
memset (g_buffer, 0, sizeof(g_buffer));
|
||||
// byte 0
|
||||
rlc_am_write8_bit_field(&byte_pos_write, &bit_pos_write, 1, 1);
|
||||
rlc_am_write8_bit_field(&byte_pos_write, &bit_pos_write, 1, 0);
|
||||
|
||||
@@ -404,6 +404,7 @@ void rrc_ue_generate_RRCConnectionRequest( const protocol_ctxt_t* const ctxt_pP,
|
||||
|
||||
mui_t rrc_mui=0;
|
||||
|
||||
#if !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME))
|
||||
/* NAS Attach request with IMSI */
|
||||
static const char const nas_attach_req_imsi[] = {
|
||||
0x07, 0x41,
|
||||
@@ -417,7 +418,9 @@ static const char const nas_attach_req_imsi[] = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
#endif /* !(defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)) */
|
||||
|
||||
#if 0
|
||||
/* NAS Attach request with GUTI */
|
||||
static const char const nas_attach_req_guti[] = {
|
||||
0x07, 0x41,
|
||||
@@ -431,6 +434,7 @@ static const char const nas_attach_req_guti[] = {
|
||||
0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x0A, 0x00, 0x52, 0x12, 0xF2,
|
||||
0x01, 0x27, 0x11,
|
||||
};
|
||||
#endif
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
static void rrc_ue_generate_RRCConnectionSetupComplete( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index, const uint8_t Transaction_id )
|
||||
@@ -743,10 +747,10 @@ rrc_ue_establish_drb(
|
||||
# ifdef OAI_EMU
|
||||
oai_emulation.info.oai_ifup[ue_mod_idP]=1;
|
||||
# endif
|
||||
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
|
||||
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ue_mod_idP,
|
||||
ip_addr_offset3+ue_mod_idP,
|
||||
(eNB_index * maxDRB) + DRB_config->drb_Identity);
|
||||
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
|
||||
|
||||
rb_conf_ipv4(0,//add
|
||||
ue_mod_idP,//cx align with the UE index
|
||||
@@ -1038,7 +1042,7 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
|
||||
// Update cqi_ReportConfig
|
||||
if(radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig != NULL)
|
||||
{
|
||||
LOG_I(RRC,"Update cqi_ReportConfig config (size=%d,%d)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig), sizeof(CQI_ReportConfig_t));
|
||||
LOG_I(RRC,"Update cqi_ReportConfig config (size=%zu,%zu)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig), sizeof(CQI_ReportConfig_t));
|
||||
|
||||
if(UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig == NULL)
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig = CALLOC(1,sizeof(CQI_ReportConfig_t));
|
||||
@@ -1048,7 +1052,7 @@ rrc_ue_update_radioResourceConfigDedicated(RadioResourceConfigDedicated_t* radio
|
||||
sizeof(*physicalConfigDedicated2->cqi_ReportConfig));
|
||||
|
||||
if (radioResourceConfigDedicated->physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic != NULL) {
|
||||
LOG_I(RRC,"Update cqi_ReportPeriodic config (size=%d,%d)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic), sizeof(CQI_ReportPeriodic_t));
|
||||
LOG_I(RRC,"Update cqi_ReportPeriodic config (size=%zu,%zu)\n", sizeof(*physicalConfigDedicated2->cqi_ReportConfig->cqi_ReportPeriodic), sizeof(CQI_ReportPeriodic_t));
|
||||
|
||||
if(UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic == NULL)
|
||||
UE_rrc_inst[ctxt_pP->module_id].physicalConfigDedicated[eNB_index]->cqi_ReportConfig->cqi_ReportPeriodic = CALLOC(1,sizeof(CQI_ReportPeriodic_t));
|
||||
|
||||
@@ -2866,6 +2866,8 @@ rrc_eNB_process_MeasurementReport(
|
||||
// #if defined(Rel10) || defined(Rel14)
|
||||
LOG_I(RRC, "RSRP of Source %ld\n", measResults2->measResultPCell.rsrpResult);
|
||||
LOG_I(RRC, "RSRQ of Source %ld\n", measResults2->measResultPCell.rsrqResult);
|
||||
|
||||
|
||||
// #else
|
||||
// LOG_I(RRC, "RSRP of Source %d\n", measResults2->measResultServCell.rsrpResult);
|
||||
// LOG_I(RRC, "RSRQ of Source %d\n", measResults2->measResultServCell.rsrqResult);
|
||||
@@ -4212,9 +4214,9 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
|
||||
dest_ip_offset = 8;
|
||||
# endif
|
||||
LOG_I(OIP,
|
||||
"[eNB %d] Config the oai%d to send/receive pkt on DRB %d to/from the protocol stack\n",
|
||||
"[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
|
||||
ctxt_pP->module_id, ctxt_pP->module_id,
|
||||
(ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity);
|
||||
(long int)((ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity));
|
||||
ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid];
|
||||
rb_conf_ipv4(0, //add
|
||||
ue_module_id, //cx
|
||||
|
||||
@@ -287,10 +287,10 @@ rrc_eNB_process_security(
|
||||
|
||||
// translation
|
||||
LOG_D(RRC,
|
||||
"[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %u NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n",
|
||||
"[eNB %d] NAS security_capabilities.encryption_algorithms %u AS ciphering_algorithm %lu NAS security_capabilities.integrity_algorithms %u AS integrity_algorithm %u\n",
|
||||
ctxt_pP->module_id,
|
||||
ue_context_pP->ue_context.security_capabilities.encryption_algorithms,
|
||||
ue_context_pP->ue_context.ciphering_algorithm,
|
||||
(unsigned long)ue_context_pP->ue_context.ciphering_algorithm,
|
||||
ue_context_pP->ue_context.security_capabilities.integrity_algorithms,
|
||||
ue_context_pP->ue_context.integrity_algorithm);
|
||||
/* Select relevant algorithms */
|
||||
@@ -308,11 +308,11 @@ rrc_eNB_process_security(
|
||||
changed = TRUE;
|
||||
}
|
||||
|
||||
LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %x, %x, %s\n",
|
||||
LOG_I (RRC, "[eNB %d][UE %x] Selected security algorithms (%p): %lx, %x, %s\n",
|
||||
ctxt_pP->module_id,
|
||||
ue_context_pP->ue_context.rnti,
|
||||
security_capabilities_pP,
|
||||
cipheringAlgorithm,
|
||||
(unsigned long)cipheringAlgorithm,
|
||||
integrityProtAlgorithm,
|
||||
changed ? "changed" : "same");
|
||||
|
||||
|
||||
@@ -259,8 +259,8 @@ void log_set_instance_type (log_instance_type_t instance);
|
||||
# include "log_if.h"
|
||||
/*----------------------------------------------------------------------------*/
|
||||
int logInit (void);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...);
|
||||
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...);
|
||||
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
void logRecord(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
|
||||
int set_comp_log(int component, int level, int verbosity, int interval);
|
||||
int set_log(int component, int level, int interval);
|
||||
void set_glog(int level, int verbosity);
|
||||
|
||||
@@ -98,7 +98,7 @@ void *recv_ip4_tcp(void* csock)
|
||||
|
||||
|
||||
LOG_I(OTG,"SOCKET:: TCP-IP4 :: size=%d received=%d, Received buffer: %s \n\n\n", strlen(buffer), sock_rcv, buffer);
|
||||
buffer[PAYLOAD_MAX] != '\0';
|
||||
//buffer[PAYLOAD_MAX] != '\0';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -248,6 +248,14 @@ void display_usim_data(const char *filename) {
|
||||
memcpy(key, data.keys.ik, USIM_IK_SIZE);
|
||||
printf("\tIK\t: \"%s\"\n", key);
|
||||
|
||||
printf("\n\tusim_api_k:");
|
||||
for (int i = 0; i < 16; i++)
|
||||
printf(" %2.2x", data.keys.usim_api_k[i]);
|
||||
printf("\n\topc :");
|
||||
for (int i = 0; i < 16; i++)
|
||||
printf(" %2.2x", data.keys.opc[i]);
|
||||
printf("\n\n");
|
||||
|
||||
printf("EPS NAS security context:\n");
|
||||
printf("\tKSIasme\t: 0x%.2x\n", data.securityctx.KSIasme.value[0]);
|
||||
char kasme[USIM_K_ASME_SIZE + 1];
|
||||
|
||||
@@ -203,6 +203,52 @@ void emm_main_initialize(nas_user_t *user, emm_indication_callback_t cb, const c
|
||||
LOG_TRACE(INFO, "EMM-MAIN - USIM application data successfully read");
|
||||
user->emm_data->usim_is_valid = TRUE;
|
||||
|
||||
/* print keys (for debugging) */
|
||||
{
|
||||
char usim_api_k[256];
|
||||
char opc[256];
|
||||
sprintf(usim_api_k,
|
||||
"%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x "
|
||||
"%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
|
||||
user->usim_data.keys.usim_api_k[0],
|
||||
user->usim_data.keys.usim_api_k[1],
|
||||
user->usim_data.keys.usim_api_k[2],
|
||||
user->usim_data.keys.usim_api_k[3],
|
||||
user->usim_data.keys.usim_api_k[4],
|
||||
user->usim_data.keys.usim_api_k[5],
|
||||
user->usim_data.keys.usim_api_k[6],
|
||||
user->usim_data.keys.usim_api_k[7],
|
||||
user->usim_data.keys.usim_api_k[8],
|
||||
user->usim_data.keys.usim_api_k[9],
|
||||
user->usim_data.keys.usim_api_k[10],
|
||||
user->usim_data.keys.usim_api_k[11],
|
||||
user->usim_data.keys.usim_api_k[12],
|
||||
user->usim_data.keys.usim_api_k[13],
|
||||
user->usim_data.keys.usim_api_k[14],
|
||||
user->usim_data.keys.usim_api_k[15]);
|
||||
sprintf(opc,
|
||||
"%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x "
|
||||
"%2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x %2.2x",
|
||||
user->usim_data.keys.opc[0],
|
||||
user->usim_data.keys.opc[1],
|
||||
user->usim_data.keys.opc[2],
|
||||
user->usim_data.keys.opc[3],
|
||||
user->usim_data.keys.opc[4],
|
||||
user->usim_data.keys.opc[5],
|
||||
user->usim_data.keys.opc[6],
|
||||
user->usim_data.keys.opc[7],
|
||||
user->usim_data.keys.opc[8],
|
||||
user->usim_data.keys.opc[9],
|
||||
user->usim_data.keys.opc[10],
|
||||
user->usim_data.keys.opc[11],
|
||||
user->usim_data.keys.opc[12],
|
||||
user->usim_data.keys.opc[13],
|
||||
user->usim_data.keys.opc[14],
|
||||
user->usim_data.keys.opc[15]);
|
||||
LOG_TRACE(INFO, "EMM-MAIN - usim_api_k: %s", usim_api_k);
|
||||
LOG_TRACE(INFO, "EMM-MAIN - opc: %s", opc);
|
||||
}
|
||||
|
||||
/* Get the Home PLMN derived from the IMSI */
|
||||
user->emm_data->hplmn.MCCdigit1 = user->usim_data.imsi.u.num.digit1;
|
||||
user->emm_data->hplmn.MCCdigit2 = user->usim_data.imsi.u.num.digit2;
|
||||
|
||||
@@ -139,11 +139,6 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
|
||||
int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
|
||||
int rc=0;
|
||||
//ToDo: EXMIMO harmonization is not complete. That is the reason for this ifdef
|
||||
#ifdef EXMIMO
|
||||
int device_init(openair0_device *device, openair0_config_t *openair0_cfg);
|
||||
rc = device_init(device, openair0_cfg);
|
||||
#else
|
||||
rc=load_lib(device, openair0_cfg, NULL,BBU_LOCAL_RADIO_HEAD );
|
||||
if ( rc >= 0) {
|
||||
if ( set_device(device) < 0) {
|
||||
@@ -151,7 +146,6 @@ int openair0_device_load(openair0_device *device, openair0_config_t *openair0_cf
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
@@ -297,7 +297,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
printf ("[ETHERNET] status of %s is %d\n", system_cmd, WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Coalesce parameters %s\n",system_cmd);
|
||||
} else {
|
||||
@@ -314,7 +314,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
printf ("[ETHERNET] status of %s is %d\n", system_cmd, WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Pause parameters %s\n",system_cmd);
|
||||
} else {
|
||||
@@ -329,7 +329,7 @@ int ethernet_tune(openair0_device *device, unsigned int option, int value) {
|
||||
if (ret == -1) {
|
||||
fprintf (stderr,"[ETHERNET] Can't start shell to execute %s %s",system_cmd, strerror(errno));
|
||||
} else {
|
||||
printf ("[ETHERNET] status of %s is %i\n",WEXITSTATUS(ret));
|
||||
printf ("[ETHERNET] status of %s is %d\n", system_cmd, WEXITSTATUS(ret));
|
||||
}
|
||||
printf("[ETHERNET] Ring parameters %s\n",system_cmd);
|
||||
} else {
|
||||
|
||||
@@ -261,7 +261,7 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
|
||||
LOG_E(PHY,"[recv] received %d samples out of %d\n",samples_received,nsamps);
|
||||
|
||||
if ( s->rx_md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE)
|
||||
LOG_E(PHY,s->rx_md.to_pp_string(true).c_str());
|
||||
LOG_E(PHY, "%s\n", s->rx_md.to_pp_string(true).c_str());
|
||||
|
||||
s->rx_count += nsamps;
|
||||
s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate);
|
||||
@@ -664,7 +664,7 @@ extern "C" {
|
||||
LOG_I(PHY,"RF board max packet size %u, size for 100µs jitter %d \n", max, samples);
|
||||
if ( samples < max )
|
||||
stream_args_rx.args["spp"] = str(boost::format("%d") % samples );
|
||||
LOG_I(PHY,"rx_max_num_samps %u\n",
|
||||
LOG_I(PHY,"rx_max_num_samps %zu\n",
|
||||
s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps());
|
||||
|
||||
for (int i = 0; i<openair0_cfg[0].rx_num_channels; i++)
|
||||
|
||||
@@ -972,8 +972,8 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
|
||||
end_rf_ts = proc->timestamp_rx+eNB->ts_offset+(tx_sfoffset*fp->samples_per_tti)-openair0_cfg[0].tx_sample_advance;
|
||||
if (recv_if_count != 0 ) {
|
||||
recv_if_count = recv_if_count-1;
|
||||
LOG_D(HW,"[From Timestamp %d to Timestamp %d] RTT_RF: %"PRId64"; RTT_RF\n", start_rf_prev_ts, end_rf_ts, clock_difftime_ns(start_rf_prev, end_rf));
|
||||
LOG_D(HW,"[From Timestamp %d to Timestamp %d] RTT_RF: %"PRId64"; RTT_RF\n",start_rf_prev2_ts, end_rf_ts, clock_difftime_ns(start_rf_prev2, end_rf));
|
||||
LOG_D(HW,"[From Timestamp %"PRId64" to Timestamp %"PRId64"] RTT_RF: %"PRId64"; RTT_RF\n", start_rf_prev_ts, end_rf_ts, clock_difftime_ns(start_rf_prev, end_rf));
|
||||
LOG_D(HW,"[From Timestamp %"PRId64" to Timestamp %"PRId64"] RTT_RF: %"PRId64"; RTT_RF\n",start_rf_prev2_ts, end_rf_ts, clock_difftime_ns(start_rf_prev2, end_rf));
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
|
||||
|
||||
|
||||
@@ -284,8 +284,12 @@ void Channel_Inst(int node_id,int port,double **s_re[MAX_eNB+MAX_UE],double **s_
|
||||
u2e_t[UE_id][eNB_id]->next_slot=&next_slot;
|
||||
u2e_t[UE_id][eNB_id]->abstraction_flag=&abstraction_flag;
|
||||
u2e_t[UE_id][eNB_id]->frame_parms=frame_parms;
|
||||
u2e_t[UE_id][eNB_id]->tx_data[3]=tx[eNB_id][3];
|
||||
u2e_t[UE_id][eNB_id]->rx_data[3]=rx[NB_eNB_INST+UE_id][3];
|
||||
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
u2e_t[UE_id][eNB_id]->tx_data[i]=tx[eNB_id][i];
|
||||
u2e_t[UE_id][eNB_id]->rx_data[i]=rx[NB_eNB_INST+UE_id][i];
|
||||
}
|
||||
|
||||
if(pthread_cond_init (&downlink_cond[eNB_id][UE_id], NULL)) exit(1);
|
||||
|
||||
@@ -316,8 +320,11 @@ void Channel_Inst(int node_id,int port,double **s_re[MAX_eNB+MAX_UE],double **s_
|
||||
e2u_t[eNB_id][UE_id]->next_slot=&next_slot;
|
||||
e2u_t[eNB_id][UE_id]->abstraction_flag=&abstraction_flag;
|
||||
e2u_t[eNB_id][UE_id]->frame_parms=frame_parms;
|
||||
e2u_t[eNB_id][UE_id]->tx_data[3]=tx[NB_eNB_INST+UE_id][3];
|
||||
e2u_t[eNB_id][UE_id]->rx_data[3]=rx[eNB_id][3];
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
e2u_t[eNB_id][UE_id]->tx_data[i]=tx[NB_eNB_INST+UE_id][i];
|
||||
e2u_t[eNB_id][UE_id]->rx_data[i]=rx[eNB_id][i];
|
||||
}
|
||||
|
||||
if(pthread_cond_init (&uplink_cond[UE_id][eNB_id], NULL)) exit(1);
|
||||
|
||||
|
||||
@@ -183,8 +183,13 @@ void do_DL_sig_channel_T(void *param)
|
||||
next_slot=(cthread->next_slot);
|
||||
abstraction_flag=*(cthread->abstraction_flag);
|
||||
thread_id=(cthread->thread_id);
|
||||
tx_data[3]=cthread->tx_data[3];
|
||||
rx_data[3]=cthread->rx_data[3];
|
||||
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
tx_data[i]=cthread->tx_data[i];
|
||||
rx_data[i]=cthread->rx_data[i];
|
||||
}
|
||||
|
||||
s32 att_eNB_id=-1;
|
||||
s32 **txdata,**rxdata;
|
||||
|
||||
|
||||
@@ -281,7 +281,7 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr %f dBm/RE (%f dBm RSSI)for subframe %d\n",UE_id,
|
||||
10*log10(rx_pwr),
|
||||
10*log10(rx_pwr*(double)frame_parms->N_RB_DL*12),subframe);
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for slot %d (subframe %d)\n",
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (noise) -132 dBm/RE (N0fs = %.1f dBm, N0B = %.1f dBm) for subframe %d\n",
|
||||
UE_id,
|
||||
10*log10(eNB2UE[eNB_id][UE_id][CC_id]->sampling_rate*1e6)-174,
|
||||
10*log10(eNB2UE[eNB_id][UE_id][CC_id]->sampling_rate*1e6*12*frame_parms->N_RB_DL/(double)frame_parms->ofdm_symbol_size)-174,
|
||||
|
||||
@@ -513,7 +513,7 @@ void update_mac(Event_t event)
|
||||
if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) {
|
||||
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
|
||||
}
|
||||
|
||||
@@ -637,7 +637,7 @@ void update_mac(Event_t event)
|
||||
if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) {
|
||||
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
|
||||
}
|
||||
|
||||
@@ -903,13 +903,13 @@ void update_mac(Event_t event)
|
||||
for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval;
|
||||
UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
|
||||
LOG_I(EMU,"cqiSchedInterval UE :\n", i);
|
||||
LOG_I(EMU,"cqiSchedInterval UE %d:\n", i);
|
||||
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval);
|
||||
}
|
||||
} else {
|
||||
oai_emulation->mac_config[event.ue].cqiSchedInterval= mac_config[event.ue].cqiSchedInterval;
|
||||
UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval = oai_emulation->mac_config[event.ue].cqiSchedInterval;
|
||||
LOG_I(EMU,"cqiSchedInterval UE :\n", event.ue);
|
||||
LOG_I(EMU,"cqiSchedInterval UE %d:\n", event.ue);
|
||||
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval);
|
||||
}
|
||||
} else if(!strcmp((char *) event.key, "mac_ContentionResolutionTimer") && event.value!=NULL && validate_mac(event)) {
|
||||
@@ -923,13 +923,13 @@ void update_mac(Event_t event)
|
||||
for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", i);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", i);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
|
||||
}
|
||||
} else {
|
||||
oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer= mac_config[event.ue].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer = oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", event.ue);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", event.ue);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer);
|
||||
}
|
||||
} else if(!strcmp((char *) event.key, "max_allowed_rbs") && event.value!=NULL && validate_mac(event)) {
|
||||
@@ -1040,7 +1040,7 @@ void update_sys_model(Event_t event)
|
||||
LOG_I(EMU,"free_space_model_parameters.pathloss_exponent %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_exponent);
|
||||
LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB);
|
||||
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
|
||||
//Antenna
|
||||
LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors);
|
||||
@@ -1103,7 +1103,7 @@ void update_sys_model(Event_t event)
|
||||
} else if(!strcmp((char *) event.key, "free_space_model_parameters.pathloss_0_dB")) {
|
||||
LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB);
|
||||
} else if(!strcmp((char *) event.key, "ricean_8tap.rice_factor_dB")) {
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
} else if(!strcmp((char *) event.key, "antenna.eNB_antenna.number_of_sectors")) {
|
||||
LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors);
|
||||
} else if(!strcmp((char *) event.key, "antenna.eNB_antenna.beam_width_dB")) {
|
||||
@@ -1202,8 +1202,8 @@ void update_topo_model(Event_t event)
|
||||
LOG_I(EMU,"UE_moving_dynamics_max_speed_mps %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps);
|
||||
LOG_I(EMU,"UE_moving_dynamics_min_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms);
|
||||
LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms);
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option);
|
||||
LOG_I(EMU,"random_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.random_UE_distribution.number_of_nodes);
|
||||
LOG_I(EMU,"concentrated_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.concentrated_UE_distribution.number_of_nodes);
|
||||
@@ -1245,9 +1245,9 @@ void update_topo_model(Event_t event)
|
||||
} else if(!strcmp((char *) event.key, "UE_moving_dynamics_max_journey_time_ms")) {
|
||||
LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms);
|
||||
} else if(!strcmp((char *) event.key, "grid_map_horizontal_grid")) {
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
} else if(!strcmp((char *) event.key, "grid_map_vertical_grid")) {
|
||||
LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
} else if(!strcmp((char *) event.key, "UE_initial_distribution_selected_option")) {
|
||||
LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option);
|
||||
} else if(!strcmp((char *) event.key, "random_UE_distribution_number_of_nodes")) {
|
||||
|
||||
@@ -1188,6 +1188,15 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */
|
||||
int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
|
||||
#endif
|
||||
|
||||
static void print_current_directory(void)
|
||||
{
|
||||
char dir[8192]; /* arbitrary size (should be big enough) */
|
||||
if (getcwd(dir, 8192) == NULL)
|
||||
printf("ERROR getting working directory\n");
|
||||
else
|
||||
printf("working directory: %s\n", dir);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
@@ -1195,6 +1204,8 @@ main (int argc, char **argv)
|
||||
|
||||
clock_t t;
|
||||
|
||||
print_current_directory();
|
||||
|
||||
start_background_system();
|
||||
|
||||
#ifdef SMBV
|
||||
@@ -1350,6 +1361,11 @@ main (int argc, char **argv)
|
||||
LOG_N(EMU,
|
||||
">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
|
||||
|
||||
#ifndef PACKAGE_VERSION
|
||||
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
||||
#endif
|
||||
LOG_I(EMU, "Version: %s\n", PACKAGE_VERSION);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
// Handle signals until all tasks are terminated
|
||||
|
||||
@@ -468,7 +468,7 @@ int ocg_config_env(void)
|
||||
oai_emulation.info.frame_type[CC_id] = map_str_to_int(frame_type_names, oai_emulation.info.frame_type_name[CC_id]);
|
||||
|
||||
if (oai_emulation.info.frame_type[CC_id] == -1) {
|
||||
LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name);
|
||||
LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name[CC_id]);
|
||||
oai_emulation.info.frame_type[CC_id]=TDD;
|
||||
} else
|
||||
LOG_I(EMU,"Frame type is %s \n",oai_emulation.info.frame_type_name[CC_id]);
|
||||
@@ -478,7 +478,7 @@ int ocg_config_env(void)
|
||||
LOG_E(EMU,"TDD config %d out of range, set it to 3\n",oai_emulation.info.tdd_config[CC_id]);
|
||||
oai_emulation.info.tdd_config[CC_id]=3;
|
||||
} else
|
||||
LOG_I(EMU,"TDD config is set to \n",oai_emulation.info.tdd_config[CC_id]);
|
||||
LOG_I(EMU,"TDD config is set to %d\n",oai_emulation.info.tdd_config[CC_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1087,8 +1087,8 @@ int ocg_config_app(void)
|
||||
oai_emulation.application_config.customized_traffic.holding_time_pe_off[customized_traffic_config_index];
|
||||
|
||||
|
||||
LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%d:%d) source = %d, dest = %d, dist type for size = %d start/duration %d/%d\n", source_id_start, source_id_end, source_id_index,
|
||||
destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0],
|
||||
LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%s:%s) source = %d, dest = %d, dist type for size = %d [TODO: check code, printed value may not be correct, checks the indexes of the arry access] start/duration %d/%d\n", source_id_start, source_id_end, source_id_index,
|
||||
destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0][0],
|
||||
g_otg->flow_start[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]],
|
||||
g_otg->flow_duration[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]);
|
||||
per_source_id = strtok(NULL, comma);
|
||||
|
||||
@@ -1050,15 +1050,15 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
|
||||
|
||||
*ptimestamp = last_eNB_rx_timestamp[eNB_id][CC_id];
|
||||
|
||||
LOG_D(EMU,"eNB_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps,
|
||||
(unsigned long long)current_eNB_rx_timestamp[eNB_id][CC_id],
|
||||
(unsigned long long)last_eNB_rx_timestamp[eNB_id][CC_id],
|
||||
(*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10);
|
||||
LOG_D(EMU,"eNB_trx_read nsamps %d TS(%"PRId64",%"PRId64") => subframe %d\n",nsamps,
|
||||
current_eNB_rx_timestamp[eNB_id][CC_id],
|
||||
last_eNB_rx_timestamp[eNB_id][CC_id],
|
||||
(int)((*ptimestamp/PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.samples_per_tti)%10));
|
||||
// if we're at a subframe boundary generate UL signals for this eNB
|
||||
|
||||
while (nsamps) {
|
||||
while (current_eNB_rx_timestamp[eNB_id][CC_id] == last) {
|
||||
LOG_D(EMU,"eNB: current TS %llu, last TS %llu, sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]);
|
||||
LOG_D(EMU,"eNB: current TS %"PRId64", last TS %"PRId64", sleeping\n",current_eNB_rx_timestamp[eNB_id][CC_id],last_eNB_rx_timestamp[eNB_id][CC_id]);
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
@@ -1126,7 +1126,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
usleep(500);
|
||||
}
|
||||
while (current_UE_rx_timestamp[UE_id][CC_id] == last) {
|
||||
LOG_D(EMU,"UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
LOG_D(EMU,"UE_trx_read : current TS %"PRId64", last TS %"PRId64", sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
usleep(500);
|
||||
}
|
||||
@@ -1486,7 +1486,7 @@ void init_ocm(void)
|
||||
break;
|
||||
|
||||
case TDD:
|
||||
frame_type = "FDD";
|
||||
frame_type = "TDD";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user