Merge remote-tracking branch 'origin/develop_integration_2018_w04' into develop

Summary of changes:
- heavy code cleanup (#ifdef removal)
- bugfixes
This commit is contained in:
Cedric Roux
2018-01-23 09:30:04 +01:00
254 changed files with 123 additions and 28673 deletions
+9 -104
View File
@@ -262,9 +262,6 @@ if (${ENABLE_ITTI})
set(GTPU_need_ITTI ${OPENAIR3_DIR}/GTPV1-U/gtpv1u_eNB.c)
endif (${ENABLE_ITTI})
add_boolean_option(RTAI False "Use RTAI")
#############################
# ASN.1 grammar C code generation & dependancies
################################
@@ -485,7 +482,6 @@ include_directories ("${X2AP_DIR}")
###################################
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TXRX "2" "Number of antennas in ????" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
@@ -587,15 +583,13 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
add_boolean_option(ENABLE_SECURITY True "Enable LTE integrity and ciphering between RRC UE and eNB")
add_boolean_option(ENABLE_USE_MME True "eNB connected to MME (INTERFACE S1-C), not standalone eNB")
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
add_boolean_option(USER_MODE True "????")
add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "set the RLC mode to AM for the default bearer")
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
add_boolean_option(DISABLE_USE_NAS False "???")
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
add_boolean_option(NAS_ADDRESS_FIX False "specific to oaisim: for nasmesh driver")
add_boolean_option(NAS_NETLINK False "???? Must be True to compile nasmesh driver without rtai")
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
add_boolean_option(OAISIM False "specific to oaisim")
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
@@ -612,22 +606,12 @@ add_boolean_option(FLEXRAN_AGENT_SB_IF False "enable FlexRAN
##########################
add_boolean_option(ENB_MODE True "Swap the include directories between openair2 and openair3" )
##########################
# Emulation options
##########################
add_boolean_option(ENABLE_PGM_TRANSPORT False "specific to oaisim, emulation through ethernet, reliable multicast")
add_boolean_option(ADDR_CONF False "specific to oaisim, IP autoconf of user-plane IP interface")
add_boolean_option(OPENAIR_EMU False "specific to oaisim")
add_boolean_option(OAI_EMU False "specific to oaisim")
add_boolean_option(PHY_ABSTRACTION False "specific to oaisim")
##########################
# SCHEDULING/REAL-TIME/PERF options
##########################
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues")
add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays")
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
add_boolean_option(HARD_RT False "???")
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
add_boolean_option(LOG_NO_THREAD True "Disable thread for log, seems always set to true")
@@ -637,24 +621,15 @@ add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
# PHY options
##########################
add_boolean_option(DRIVER2013 True "only relevant for EXMIMO")
add_boolean_option(ENABLE_FXP True "????")
add_boolean_option(ENABLE_NEW_MULTICAST False "specific to oaisim")
add_boolean_option(EXMIMO_IOT True "????")
add_boolean_option(LARGE_SCALE False "specific to oaisim: defines max eNB=2 and max UE=120")
add_boolean_option(LOCALIZATION False "???")
add_integer_option(MAX_NUM_CCs 1 "????")
add_boolean_option(MU_RECEIVER False "????")
add_boolean_option(NEW_FFT True "????")
add_boolean_option(OPENAIR1 True "????")
add_boolean_option(PBS_SIM False "????")
add_boolean_option(PC_DSP True "????")
add_boolean_option(PC_TARGET True "????")
add_boolean_option(PERFECT_CE False "????")
add_boolean_option(PHYSIM True "for L1 simulators (dlsim, ulsim, ...)")
add_boolean_option(PHY_CONTEXT True "not clear: must remain False for dlsim")
add_boolean_option(PHY_EMUL False "not clear: must remain False for dlsim")
add_boolean_option(PUCCH True "????")
add_boolean_option(RANDOM_BF False "????")
add_boolean_option(SMBV False "Rohde&Schwarz SMBV100A vector signal generator")
add_boolean_option(DEBUG_PHY False "Enable PHY layer debugging options")
add_boolean_option(DEBUG_PHY_PROC False "Enable debugging of PHY layer procedures")
@@ -727,23 +702,7 @@ add_boolean_option(RRC_DEFAULT_RAB_IS_AM False "Otherwise it is UM, confi
##########################
# none
##########################
# PROJECTS (IST, FRENCH COLL., etc)
# SPECIFIC OPTIONS
##########################
add_boolean_option(SPECTRA False "???")
add_boolean_option(MIH_C_MEDIEVAL_EXTENSIONS False "EXTENSIONS TO MIH 802.21 IN CONTEXT OF IST PROJECT CALLED MEDIEVAL")
add_boolean_option(EMOS False "????")
if(${EMOS})
add_definitions("-D_FILE_OFFSET_BITS=64")
set(EMOS_LIB gps)
endif(${EMOS})
# add the binary tree to the search path for include files
# add the binary tree to the search path for include files
#######################################################
# We will find ConfigOAI.h after generation in target directory
include_directories("${OPENAIR_BIN_DIR}")
@@ -776,7 +735,6 @@ include_directories("${NFAPI_DIR}/nfapi/inc")
include_directories("${NFAPI_DIR}/sim_common/inc")
include_directories("${NFAPI_DIR}/pnf_sim/inc")
include_directories("${OPENAIR1_DIR}")
include_directories("${OPENAIR2_DIR}/NAS")
include_directories("${OPENAIR2_DIR}")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC")
include_directories("${OPENAIR2_DIR}/LAYER2/RLC/AM_v9.3.0")
@@ -1302,26 +1260,6 @@ if (${ENABLE_RAL})
set(RAL_LIB RAL)
endif()
if(${MIH_C_MEDIEVAL_EXTENSIONS})
set(MIH_SRC
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_header_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_msg_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_primitive_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_F1_basic_data_types_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_F2_general_data_types_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_F3_data_types_for_address_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_F4_data_types_for_links_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_F9_data_types_for_qos_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_F13_data_types_for_information_elements_codec.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_L2_type_values_for_tlv_encoding.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_Medieval_extensions.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C_bit_buffer.c
${RAL_LTE_DIR}INTERFACE-802.21/C/MIH_C.c
)
add_library(MIH ${MIH_SRC})
set(MIH_LIB MIH)
endif()
# CN libs
##########################
@@ -1671,7 +1609,6 @@ ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/bypass_session_layer.c
#${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/emu_transport.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/pgm_link.c
)
add_library(OPENAIR0_LIB
@@ -1843,7 +1780,6 @@ add_executable(lte-softmodem
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI}
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
@@ -1853,7 +1789,7 @@ add_executable(lte-softmodem
target_link_libraries (lte-softmodem
-Wl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB
-Wl,--end-group z dl)
@@ -1882,7 +1818,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
${RTAI_SOURCE}
${XFORMS_SOURCE}
${XFORMS_SOURCE_SOFTMODEM}
${T_SOURCE}
@@ -1891,7 +1826,7 @@ add_executable(lte-softmodem-nos1
)
target_link_libraries (lte-softmodem-nos1
-Wl,--start-group
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group )
target_link_libraries (lte-softmodem-nos1 ${LIBXML2_LIBRARIES})
@@ -1899,27 +1834,6 @@ target_link_libraries (lte-softmodem-nos1 pthread m ${CONFIG_LIBRARIES} rt crypt
target_link_libraries (lte-softmodem-nos1 ${LIB_LMS_LIBRARIES})
target_link_libraries (lte-softmodem-nos1 ${T_LIB})
# rrh
################################
#Note: only one RF type (USRP) is currently supported for RRH
add_executable(rrh_gw
${OPENAIR_TARGETS}/RT/USER/rrh_gw.c
${OPENAIR_TARGETS}/RT/USER/eNB_transport_IQ.c
${OPENAIR_TARGETS}/RT/USER/UE_transport_IQ.c
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${T_SOURCE}
)
target_include_directories(rrh_gw PRIVATE ${OPENAIR_DIR}/common/utils/itti)
target_link_libraries(rrh_gw
-Wl,--start-group
UTIL LFDS -ldl
-Wl,--end-group )
target_link_libraries (rrh_gw rt pthread m )
target_link_libraries (rrh_gw ${LIB_LMS_LIBRARIES})
target_link_libraries (rrh_gw ${T_LIB})
# USIM process
#################
#add_executable(usim
@@ -1983,7 +1897,7 @@ add_executable(oaisim
target_include_directories(oaisim PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim
-Wl,-ldl,--start-group
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} LIB_NAS_UE SIMU SECU_OSA ${ITTI_LIB} ${MIH_LIB}
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB GTPV1U SECU_CN UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} LIB_NAS_UE SIMU SECU_OSA ${ITTI_LIB}
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB
-Wl,--end-group )
@@ -2028,7 +1942,7 @@ add_executable(oaisim_nos1
target_include_directories(oaisim_nos1 PUBLIC ${OPENAIR_TARGETS}/SIMU/USER)
target_link_libraries (oaisim_nos1
-Wl,--start-group
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SECU_OSA ${ITTI_LIB} ${MIH_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
RRC_LIB X2AP_LIB SECU_CN UTIL HASHTABLE SCHED_LIB PHY LFDS ${MSC_LIB} L2 ${RAL_LIB} SIMU SECU_OSA ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7
-Wl,--end-group )
target_link_libraries (oaisim_nos1 ${LIBXML2_LIBRARIES} ${LAPACK_LIBRARIES})
@@ -2136,7 +2050,7 @@ endforeach(myExe)
if (${T_TRACER})
foreach(i
#all "add_executable" definitions (except tests, rb_tool, updatefw)
lte-softmodem lte-softmodem-nos1 rrh_gw oaisim oaisim_nos1
lte-softmodem lte-softmodem-nos1 oaisim oaisim_nos1
dlsim_tm4 dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim
pdcchsim pucchsim prachsim syncsim
#all "add_library" definitions
@@ -2144,7 +2058,7 @@ if (${T_TRACER})
oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif
oai_eth_transpro
FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO SECU_OSA
SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL MIH CN_UTILS
SECU_CN SCHED_LIB PHY L2 default_sched remote_sched RAL CN_UTILS
GTPV1U SCTP_CLIENT UDP LIB_NAS_UE LFDS LFDS7 SIMU OPENAIR0_LIB)
if (TARGET ${i})
add_dependencies(${i} generate_T)
@@ -2206,7 +2120,6 @@ get_directory_property(DirDefs COMPILE_DEFINITIONS )
foreach( d ${DirDefs} )
set(module_cc_opt_tmp "${module_cc_opt_tmp} -D${d}")
endforeach()
string(REPLACE "-DUSER_MODE" "" module_cc_opt ${module_cc_opt_tmp})
get_directory_property( DirDefs INCLUDE_DIRECTORIES )
foreach( d ${DirDefs} )
set(module_cc_opt "${module_cc_opt} -I${d}")
@@ -2238,15 +2151,7 @@ endfunction(make_driver name dir src)
# nashmesh module
################
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
# Actually nasty stuff to be FIXED: the hereafter flag is for RTAI compilation in the driver,
# but has different meaning in the other parts of the code
# We should change the constant name to xxx_RTAI or likely
if(NOT ${module_cc_opt} MATCHES "DRTAI")
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK")
else()
string(REPLACE "-DNAS_NETLINK" "" tmp "${module_cc_opt}")
set(module_cc_opt ${tmp})
endif()
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK -DPDCP_USE_NETLINK")
# legacy Makefile was using NAS_NETLINK flag, but other drivers the hereafter flag
# so, this cmake use OAI_NW_DRIVER_USE_NETLINK everywhere
if (OAI_NW_DRIVER_USE_NETLINK)
+3 -52
View File
@@ -100,8 +100,6 @@ Options
Specify conf_nvram_path (default \"$conf_nvram_path\")
--UE-gen-nvram [output path]
Specify gen_nvram_path (default \"$gen_nvram_path\")
--RRH
Makes the RRH
-a | --agent
Enables agent for software-defined control of the eNB
-r | --3gpp-release
@@ -219,10 +217,6 @@ function main() {
--UE-gen-nvram)
gen_nvram_path=$(readlink -f $2)
shift 2;;
--RRH)
RRH=1
echo_info "Will compile RRH"
shift;;
-r | --3gpp-release)
REL=$2
echo_info "Setting release to: $REL"
@@ -371,7 +365,7 @@ function main() {
echo_info "CMAKE_CMD=$CMAKE_CMD"
#########################################################
# check validity of HW and TP parameters for RRH and eNB
# check validity of HW and TP parameters for eNB
#########################################################
# to be discussed
@@ -387,15 +381,6 @@ function main() {
fi
fi
if [ "$RRH" = "1" ] ; then
if [ "$TP" = "None" ] ; then
echo_fatal "A transport protocol (e.g. -t ETHERNET) must be defined!"
fi
if [ "$HW" = "None" ] ; then
echo_info "No radio head has been selected (HW set to $HW)"
fi
fi
echo_info "RF HW set to $HW"
#Now we set flags to enable deadline scheduler settings
#By default: USRP: disable,
@@ -793,36 +778,6 @@ function main() {
# oaisim_mme $dbin/oaisim_mme.$REL
fi
# RRH compilation
#####################
if [ "$RRH" = "1" ] ; then
rrh_exec=rrh_gw
rrh_build_dir=rrh_gw
echo_info "Compiling $rrh_exec ..."
[ "$CLEAN" = "1" ] && rm -rf $DIR/rrh_gw/build
mkdir -p $DIR/$rrh_build_dir/build
cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( ENABLE_ITTI False )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set ( PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
eval $CMAKE_CMD
compilations \
rrh_gw rrh_gw \
rrh_gw $dbin/rrh_gw
fi
# Telnet server compilation
#####################
if [ "$BUILD_TELNETSRV" = "1" ] ; then
@@ -841,13 +796,9 @@ function main() {
fi
# build RF device and transport protocol libraries
#####################################
if [ "$eNB" = "1" -o "$UE" = "1" -o "$RRH" = "1" ] ; then
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
build_dir=$lte_build_dir
else
build_dir=$rrh_build_dir
fi
build_dir=$lte_build_dir
# build RF device libraries
if [ "$HW" != "None" ] ; then
@@ -2,17 +2,13 @@ cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ASN_DEBUG False)
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( EMIT_ASN_DEBUG False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
set ( ENABLE_USE_CPU_EXECUTION_TIME True )
@@ -21,7 +17,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
@@ -33,7 +28,6 @@ set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
@@ -42,38 +36,25 @@ set ( NAS_MME False )
set ( NAS_UE True )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "epc_test" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( TEST_OMG False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT True )
@@ -6,9 +6,6 @@ set(XFORMS True)
set(ENABLE_ITTI False)
set(DEBUG_PHY False)
set(MU_RECIEVER False)
set(RANDOM_BF False)
set(PBS_SIM False)
set(PERFECT_CE True)
set(NAS_UE False)
set(MESSAGE_CHART_GENERATOR False)
@@ -1,16 +1,12 @@
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
@@ -20,7 +16,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
@@ -32,7 +27,6 @@ set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
@@ -41,40 +35,26 @@ set ( NAS_MME False )
set ( NAS_UE True )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "oaisim" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
@@ -1,16 +1,12 @@
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 False )
set ( EMOS False )
set ( ENABLE_FXP False )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST False )
set ( ENABLE_PGM_TRANSPORT False )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False )
@@ -21,7 +17,6 @@ set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE False )
set ( EPC_BUILD True )
set ( EXMIMO_IOT False )
set ( HARD_RT False )
set ( JUMBO_FRAME False )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
@@ -32,7 +27,6 @@ set ( LOG_NO_THREAD False )
set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
@@ -42,42 +36,27 @@ set ( NAS_NETLINK False )
set ( NAS_UE False )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT False )
set ( NO_RRM False )
set ( OAI_EMU False )
set ( OAISIM False )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK False )
set ( OPENAIR1 False )
set ( OPENAIR2 False )
set ( OPENAIR_EMU False )
set ( OPENAIR_LTE False )
set ( PACKAGE_NAME "EPC" )
set ( PBS_SIM False )
set ( PC_DSP False )
set ( PC_TARGET False )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION False )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM False )
set ( PUCCH False )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( UPDATE_RELEASE_9 True)
set ( UPDATE_RELEASE_10 True)
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XFORMS False )
@@ -1,15 +1,11 @@
cmake_minimum_required(VERSION 2.8)
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING False )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY False )
set ( ENABLE_STANDALONE_EPC False)
@@ -19,7 +15,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI False)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U False)
@@ -33,7 +28,6 @@ set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False )
set ( MESSAGE_CHART_GENERATOR_RLC_MAC False )
set ( MESSAGE_CHART_GENERATOR_PHY False )
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX True )
@@ -42,42 +36,27 @@ set ( NAS_MME False )
set ( NAS_UE False )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_EMU False )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "oaisim" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( DEBUG_PHY False )
set ( DEBUG_PHY_PROC False)
@@ -1,17 +1,13 @@
cmake_minimum_required(VERSION 2.8)
set ( CMAKE_BUILD_TYPE "RelWithDebInfo" )
set ( ADDR_CONF False )
set ( DEBUG_OMG False )
set ( DISABLE_XER_PRINT False )
set ( DRIVER2013 True )
set ( EMOS False )
set ( ENABLE_FXP True )
set ( ENABLE_ITTI True )
set ( ENABLE_NAS_UE_LOGGING True )
set ( ENABLE_NEW_MULTICAST True )
set ( ENABLE_PDCP_NETLINK_FIFO False )
set ( ENABLE_PGM_TRANSPORT True )
set ( ENABLE_RAL False )
set ( ENABLE_SECURITY True )
set ( ENABLE_STANDALONE_EPC False)
@@ -21,7 +17,6 @@ set ( ENABLE_USE_RAW_SOCKET_FOR_SGI True)
set ( ENABLE_VCD_FIFO False )
set ( ENB_MODE True )
set ( EXMIMO_IOT True )
set ( HARD_RT False )
set ( JUMBO_FRAME True )
set ( LARGE_SCALE False )
set ( LINK_ENB_PDCP_TO_GTPV1U True)
@@ -33,7 +28,6 @@ set ( DEADLINE_SCHEDULER False )
set ( MAC_CONTEXT 1 )
set ( MAX_NUM_CCs 1 )
set ( MESSAGE_CHART_GENERATOR False)
set ( MIH_C_MEDIEVAL_EXTENSIONS False )
set ( MSG_PRINT False )
set ( MU_RECEIVER False )
set ( NAS_ADDRESS_FIX False )
@@ -42,44 +36,30 @@ set ( NAS_MME False )
set ( NAS_UE True )
set ( NB_ANTENNAS_RX "2" )
set ( NB_ANTENNAS_TX "2" )
set ( NB_ANTENNAS_TXRX "2" )
set ( NEW_FFT True )
set ( NO_RRM True )
set ( OAI_EMU True )
set ( OAISIM True )
set ( OAI_NW_DRIVER_TYPE_ETHERNET False )
set ( OAI_NW_DRIVER_USE_NETLINK True )
set ( OPENAIR1 True )
set ( OPENAIR2 True )
set ( OPENAIR_LTE True )
set ( PACKAGE_NAME "oaisim" )
set ( PBS_SIM False )
set ( PDCP_USE_NETLINK True )
set ( PC_DSP True )
set ( PC_TARGET True )
set ( PDCP_MSG_PRINT False )
set ( PERFECT_CE False )
set ( PHY_ABSTRACTION True )
set ( PHY_CONTEXT False )
set ( PHY_EMUL False )
set ( PHYSIM True )
set ( PUCCH True )
set ( RANDOM_BF False )
set ( RF_BOARD "False" )
set ( RLC_STOP_ON_LOST_PDU False )
set ( RRC_ASN1_VERSION "Rel10" )
set ( RRC_DEFAULT_RAB_IS_AM True)
set ( RRC_MSG_PRINT False )
set ( RTAI False )
set ( SECU False )
set ( SMBV False )
set ( SPECTRA False )
set ( TEST_OMG False )
set ( TEST_S1C_MME True )
set ( USE_3GPP_ADDR_AS_LINK_ADDR False )
set ( USE_MME "R10" )
set ( USER_MODE True )
set ( XER_PRINT False )
set ( XFORMS False )
+1 -232
View File
@@ -31,10 +31,6 @@
#include <sys/epoll.h>
#include <sys/eventfd.h>
#ifdef RTAI
# include <rtai_shm.h>
#endif
#if !defined(TRUE)
#define TRUE 1
#endif
@@ -45,11 +41,6 @@
#include "intertask_interface.h"
#include "intertask_interface_dump.h"
#if defined(OAI_EMU) || defined(RTAI)
# include "memory_pools.h"
# include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include "T.h"
#endif
@@ -64,14 +55,6 @@
#include "signals.h"
#include "timer.h"
#ifdef RTAI
# include <rtai.h>
# include <rtai_fifos.h>
# define FIFO_PRINTF_MAX_STRING_SIZE 1000
# define FIFO_PRINTF_NO 62
# define FIFO_PRINTF_SIZE 65536
#endif
/* ITTI DEBUG groups */
#define ITTI_DEBUG_POLL (1<<0)
#define ITTI_DEBUG_SEND (1<<1)
@@ -83,22 +66,12 @@
const int itti_debug = (ITTI_DEBUG_ISSUES | ITTI_DEBUG_MP_STATISTICS);
/* Don't flush if using RTAI */
#ifdef RTAI
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) rt_log_debug (x, ##args); } while(0);
#else
# define ITTI_DEBUG(m, x, args...) do { if ((m) & itti_debug) {fprintf(stdout, "[ITTI][D]"x, ##args); fflush (stdout);} } while(0);
#endif
#define ITTI_ERROR(x, args...) do { fprintf(stdout, "[ITTI][E]"x, ##args); fflush (stdout); } while(0);
/* Global message size */
#define MESSAGE_SIZE(mESSAGEiD) (sizeof(MessageHeader) + itti_desc.messages_info[mESSAGEiD].size)
#ifdef RTAI
# define ITTI_MEM_PAGE_SIZE (1024)
# define ITTI_MEM_SIZE (16 * 1024 * 1024)
#endif
typedef enum task_state_s {
TASK_STATE_NOT_CONFIGURED, TASK_STATE_STARTING, TASK_STATE_READY, TASK_STATE_ENDED, TASK_STATE_MAX,
} task_state_t;
@@ -137,13 +110,11 @@ typedef struct thread_desc_s {
int epoll_nb_events;
//#ifdef RTAI
/* Flag to mark real time thread */
unsigned real_time;
/* Counter to indicate from RTAI threads that messages are pending for the thread */
/* Counter to indicate that messages are pending for the thread */
unsigned messages_pending;
//#endif
} thread_desc_t;
typedef struct task_desc_s {
@@ -175,17 +146,6 @@ typedef struct itti_desc_s {
volatile uint32_t created_tasks;
volatile uint32_t ready_tasks;
volatile int wait_tasks;
#ifdef RTAI
pthread_t rt_relay_thread;
#endif
#if defined(OAI_EMU) || defined(RTAI)
memory_pools_handle_t memory_pools_handle;
uint64_t vcd_poll_msg;
uint64_t vcd_receive_msg;
uint64_t vcd_send_msg;
#endif
} itti_desc_t;
static itti_desc_t itti_desc;
@@ -194,20 +154,8 @@ void *itti_malloc(task_id_t origin_task_id, task_id_t destination_task_id, ssize
{
void *ptr = NULL;
#if defined(OAI_EMU) || defined(RTAI)
ptr = memory_pools_allocate (itti_desc.memory_pools_handle, size, origin_task_id, destination_task_id);
if (ptr == NULL) {
char *statistics = memory_pools_statistics (itti_desc.memory_pools_handle);
ITTI_ERROR (" Memory pools statistics:\n%s", statistics);
free (statistics);
}
#else
ptr = malloc (size);
if (ptr) memset(ptr,0,size);
#endif
AssertFatal (ptr != NULL, "Memory allocation of %d bytes failed (%d -> %d)!\n", (int) size, origin_task_id, destination_task_id);
@@ -219,13 +167,7 @@ int itti_free(task_id_t task_id, void *ptr)
int result = EXIT_SUCCESS;
AssertFatal (ptr != NULL, "Trying to free a NULL pointer (%d)!\n", task_id);
#if defined(OAI_EMU) || defined(RTAI)
result = memory_pools_free (itti_desc.memory_pools_handle, ptr, task_id);
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory at %p (%d)!\n", ptr, task_id);
#else
free (ptr);
#endif
return (result);
}
@@ -281,27 +223,6 @@ static task_id_t itti_get_current_task_id(void)
return TASK_UNKNOWN;
}
#ifdef RTAI
static void rt_log_debug(char *format, ...)
{
task_id_t task_id;
va_list args;
char log_buffer[FIFO_PRINTF_MAX_STRING_SIZE];
int len;
task_id = itti_get_current_task_id ();
len = snprintf(log_buffer, FIFO_PRINTF_MAX_STRING_SIZE-1, "[ITTI][D][%s]", itti_get_task_name(task_id));
va_start(args, format);
len += vsnprintf(&log_buffer[len], FIFO_PRINTF_MAX_STRING_SIZE-1-len, format, args);
va_end (args);
if (task_id != TASK_UNKNOWN)
fwrite(log_buffer, len, 1, stdout);
else
rtf_put (FIFO_PRINTF_NO, log_buffer, len);
}
#endif
void itti_update_lte_time(uint32_t frame, uint8_t slot)
{
itti_desc.lte_time.frame = frame;
@@ -358,10 +279,6 @@ MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, MessagesIds m
AssertFatal (message_id < itti_desc.messages_id_max, "Message id (%d) is out of range (%d)!\n", message_id, itti_desc.messages_id_max);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_ALLOC_MSG, size);
#endif
if (origin_task_id == TASK_UNKNOWN) {
/* Try to identify real origin task ID */
origin_task_id = itti_get_current_task_id();
@@ -373,10 +290,6 @@ MessageDef *itti_alloc_new_message_sized(task_id_t origin_task_id, MessagesIds m
temp->ittiMsgHeader.originTaskId = origin_task_id;
temp->ittiMsgHeader.ittiMsgSize = size;
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_ALLOC_MSG, 0);
#endif
return temp;
}
@@ -394,11 +307,6 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
message_number_t message_number;
uint32_t message_id;
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
__sync_or_and_fetch (&itti_desc.vcd_send_msg, 1L << destination_task_id));
#endif
AssertFatal (message != NULL, "Message is NULL!\n");
AssertFatal (destination_task_id < itti_desc.task_max, "Destination task id (%d) is out of range (%d)\n", destination_task_id, itti_desc.task_max);
@@ -421,11 +329,6 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
sizeof(MessageHeader) + message->ittiMsgHeader.ittiMsgSize);
if (destination_task_id != TASK_UNKNOWN) {
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
memory_pools_set_info (itti_desc.memory_pools_handle, message, 1, destination_task_id);
#endif
if (itti_desc.threads[destination_thread_id].task_state == TASK_STATE_ENDED) {
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Message %s, number %lu with priority %d can not be sent from %s to queue (%u:%s), ended destination task!\n",
@@ -458,17 +361,6 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
AssertFatal(0, "Error: lfds611_queue_enqueue returns 0, queue is full, exiting\n");
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
#endif
#ifdef RTAI
if (itti_desc.threads[TASK_GET_THREAD_ID(origin_task_id)].real_time) {
/* This is a RT task, increase destination task messages pending counter */
__sync_fetch_and_add (&itti_desc.threads[destination_thread_id].messages_pending, 1);
} else
#endif
{
/* Only use event fd for tasks, subtasks will pool the queue */
if (TASK_GET_PARENT_TASK_ID(destination_task_id) == TASK_UNKNOWN) {
@@ -496,11 +388,6 @@ int itti_send_msg_to_task(task_id_t destination_task_id, instance_t instance, Me
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_SEND_MSG,
__sync_and_and_fetch (&itti_desc.vcd_send_msg, ~(1L << destination_task_id)));
#endif
return 0;
}
@@ -645,17 +532,9 @@ static inline void itti_receive_msg_internal_event_fd(task_id_t task_id, uint8_t
void itti_receive_msg(task_id_t task_id, MessageDef **received_msg)
{
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
__sync_and_and_fetch (&itti_desc.vcd_receive_msg, ~(1L << task_id)));
#endif
itti_receive_msg_internal_event_fd(task_id, 0, received_msg);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
__sync_or_and_fetch (&itti_desc.vcd_receive_msg, 1L << task_id));
#endif
}
void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
@@ -664,11 +543,6 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
*received_msg = NULL;
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG,
__sync_or_and_fetch (&itti_desc.vcd_poll_msg, 1L << task_id));
#endif
{
struct message_list_s *message;
@@ -685,10 +559,6 @@ void itti_poll_msg(task_id_t task_id, MessageDef **received_msg)
ITTI_DEBUG(ITTI_DEBUG_POLL, " No message in queue[(%u:%s)]\n", task_id, itti_get_task_name(task_id));
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_POLL_MSG,
__sync_and_and_fetch (&itti_desc.vcd_poll_msg, ~(1L << task_id)));
#endif
}
int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *args_p)
@@ -720,7 +590,6 @@ int itti_create_task(task_id_t task_id, void *(*start_routine)(void *), void *ar
return 0;
}
//#ifdef RTAI
void itti_set_task_real_time(task_id_t task_id)
{
thread_id_t thread_id = TASK_GET_THREAD_ID(task_id);
@@ -729,7 +598,6 @@ void itti_set_task_real_time(task_id_t task_id)
itti_desc.threads[thread_id].real_time = TRUE;
}
//#endif
void itti_wait_ready(int wait_tasks)
{
@@ -757,15 +625,6 @@ void itti_mark_task_ready(task_id_t task_id)
/* Mark the thread as using LFDS queue */
lfds611_queue_use(itti_desc.tasks[task_id].message_queue);
#ifdef RTAI
/* Assign low priority to created threads */
{
struct sched_param sched_param;
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
sched_setscheduler(0, SCHED_FIFO, &sched_param);
}
#endif
itti_desc.threads[thread_id].task_state = TASK_STATE_READY;
itti_desc.ready_tasks ++;
@@ -778,15 +637,6 @@ void itti_mark_task_ready(task_id_t task_id)
void itti_exit_task(void)
{
#if defined(OAI_EMU) || defined(RTAI)
task_id_t task_id = itti_get_current_task_id();
if (task_id > TASK_UNKNOWN) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_ITTI_RECV_MSG,
__sync_and_and_fetch (&itti_desc.vcd_receive_msg, ~(1L << task_id)));
}
#endif
pthread_exit (NULL);
}
@@ -802,45 +652,6 @@ void itti_terminate_tasks(task_id_t task_id)
pthread_exit (NULL);
}
#ifdef RTAI
static void *itti_rt_relay_thread(void *arg)
{
thread_id_t thread_id;
unsigned pending_messages;
while (itti_desc.running) {
usleep (200); // Poll for messages a little more than 2 time by slot to get a small latency between RT and other tasks
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_FUNCTION_IN);
#endif
/* Checks for all non real time tasks if they have pending messages */
for (thread_id = THREAD_FIRST; thread_id < itti_desc.thread_max; thread_id++) {
if ((itti_desc.threads[thread_id].task_state == TASK_STATE_READY)
&& (itti_desc.threads[thread_id].real_time == FALSE)) {
pending_messages = __sync_fetch_and_and (&itti_desc.threads[thread_id].messages_pending, 0);
if (pending_messages > 0) {
ssize_t write_ret;
eventfd_t sem_counter = pending_messages;
/* Call to write for an event fd must be of 8 bytes */
write_ret = write (itti_desc.threads[thread_id].task_event_fd, &sem_counter, sizeof(sem_counter));
DevCheck(write_ret == sizeof(sem_counter), write_ret, sem_counter, thread_id);
}
}
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_RELAY_THREAD, VCD_FUNCTION_OUT);
#endif
}
return NULL;
}
#endif
int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_id_max, const task_info_t *tasks_info,
const message_info_t *messages_info, const char * const messages_definition_xml, const char * const dump_file_name)
{
@@ -921,45 +732,12 @@ int itti_init(task_id_t task_max, thread_id_t thread_max, MessagesIds messages_i
ITTI_DEBUG(ITTI_DEBUG_EVEN_FD, " Successfully subscribed fd %d for thread %d\n",
itti_desc.threads[thread_id].task_event_fd, thread_id);
#ifdef RTAI
itti_desc.threads[thread_id].real_time = FALSE;
itti_desc.threads[thread_id].messages_pending = 0;
#endif
}
itti_desc.running = 1;
itti_desc.wait_tasks = 0;
itti_desc.created_tasks = 0;
itti_desc.ready_tasks = 0;
#ifdef RTAI
/* Start RT relay thread */
DevAssert(pthread_create (&itti_desc.rt_relay_thread, NULL, itti_rt_relay_thread, NULL) >= 0);
rt_global_heap_open();
#endif
#if defined(OAI_EMU) || defined(RTAI)
itti_desc.memory_pools_handle = memory_pools_create (5);
memory_pools_add_pool (itti_desc.memory_pools_handle, 1000 + ITTI_QUEUE_MAX_ELEMENTS, 50);
memory_pools_add_pool (itti_desc.memory_pools_handle, 1000 + (2 * ITTI_QUEUE_MAX_ELEMENTS), 100);
memory_pools_add_pool (itti_desc.memory_pools_handle, 10000, 1000);
memory_pools_add_pool (itti_desc.memory_pools_handle, 400, 20050);
memory_pools_add_pool (itti_desc.memory_pools_handle, 100, 30050);
{
char *statistics = memory_pools_statistics (itti_desc.memory_pools_handle);
ITTI_DEBUG(ITTI_DEBUG_MP_STATISTICS, " Memory pools statistics:\n%s", statistics);
free (statistics);
}
#endif
#if defined(OAI_EMU) || defined(RTAI)
itti_desc.vcd_poll_msg = 0;
itti_desc.vcd_receive_msg = 0;
itti_desc.vcd_send_msg = 0;
#endif
itti_dump_init (messages_definition_xml, dump_file_name);
CHECK_INIT_RETURN(timer_init ());
@@ -1022,15 +800,6 @@ void itti_wait_tasks_end(void)
itti_desc.running = 0;
#if defined(OAI_EMU) || defined(RTAI)
{
char *statistics = memory_pools_statistics (itti_desc.memory_pools_handle);
ITTI_DEBUG(ITTI_DEBUG_MP_STATISTICS, " Memory pools statistics:\n%s", statistics);
free (statistics);
}
#endif
if (ready_tasks > 0) {
ITTI_DEBUG(ITTI_DEBUG_ISSUES, " Some threads are still running, force exit\n");
exit (0);
-6
View File
@@ -27,10 +27,6 @@
#include <sys/epoll.h>
#ifdef RTAI
# include <rtai_sem.h>
#endif
#ifndef INTERTASK_INTERFACE_H_
#define INTERTASK_INTERFACE_H_
@@ -155,12 +151,10 @@ int itti_create_task(task_id_t task_id,
void *(*start_routine) (void *),
void *args_p);
//#ifdef RTAI
/** \brief Mark the task as a real time task
* \param task_id task to mark as real time
**/
void itti_set_task_real_time(task_id_t task_id);
//#endif
/** \brief Indicates to ITTI if newly created tasks should wait for all tasks to be ready
* \param wait_tasks non 0 to make new created tasks to wait, 0 to let created tasks to run
@@ -51,23 +51,14 @@
#include "intertask_interface.h"
#include "intertask_interface_dump.h"
#if defined(OAI_EMU) || defined(RTAI)
#include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include "T.h"
#endif
static const int itti_dump_debug = 0; // 0x8 | 0x4 | 0x2;
#ifdef RTAI
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) rt_printk("[ITTI_DUMP][D]"x, ##args); } \
while(0)
#else
# define ITTI_DUMP_DEBUG(m, x, args...) do { if ((m) & itti_dump_debug) fprintf(stdout, "[ITTI_DUMP][D]"x, ##args); } \
while(0)
#endif
#define ITTI_DUMP_ERROR(x, args...) do { fprintf(stdout, "[ITTI_DUMP][E]"x, ##args); } \
while(0)
@@ -99,13 +90,8 @@ typedef struct itti_desc_s {
int nb_connected;
#ifndef RTAI
/* Event fd used to notify new messages (semaphore) */
int event_fd;
#else
unsigned long messages_in_queue __attribute__((aligned(8)));
#endif
int itti_listen_socket;
itti_client_desc_t itti_clients[ITTI_DUMP_MAX_CON];
@@ -194,9 +180,7 @@ static int itti_dump_fwrite_message(itti_dump_queue_item_t *message)
fwrite (&new_message_header, sizeof(itti_dump_message_t), 1, dump_file);
fwrite (message->data, message->data_size, 1, dump_file);
fwrite (&itti_dump_message_type_end, sizeof(itti_message_types_t), 1, dump_file);
// #if !defined(RTAI)
fflush (dump_file);
// #endif
return (1);
}
@@ -280,10 +264,6 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
int overwrite_flag;
AssertFatal (new != NULL, "Message to queue is NULL!\n");
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_IN);
#endif
new->message_type = message_type;
new->message_size = message_size;
@@ -303,9 +283,6 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
lfds611_ringbuffer_put_write_element(itti_dump_queue.itti_message_queue, new_queue_element);
if (overwrite_flag == 0) {
#ifdef RTAI
__sync_fetch_and_add (&itti_dump_queue.messages_in_queue, 1);
#else
{
ssize_t write_ret;
eventfd_t sem_counter = 1;
@@ -314,25 +291,18 @@ static int itti_dump_enqueue_message(itti_dump_queue_item_t *new, uint32_t messa
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (write_ret == sizeof(sem_counter), "Write to dump event failed (%d/%d)!\n", (int) write_ret, (int) sizeof(sem_counter));
}
#endif
// add one to pending_messages, atomically
__sync_fetch_and_add (&pending_messages, 1);
}
ITTI_DUMP_DEBUG (0x2, " Added element to queue %p %p, pending %u, type %u\n", new_queue_element, new, pending_messages, message_type);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE, VCD_FUNCTION_OUT);
#endif
return 0;
}
static void itti_dump_socket_exit(void)
{
#ifndef RTAI
close(itti_dump_queue.event_fd);
#endif
close(itti_dump_queue.itti_listen_socket);
/* Leave the thread as we detected end signal */
@@ -346,10 +316,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
int j;
int consumer;
#ifdef RTAI
unsigned long number_of_messages;
#endif
/* Check if there is a least one consumer */
consumer = 0;
@@ -365,18 +331,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
}
if (consumer > 0) {
#ifdef RTAI
number_of_messages = itti_dump_queue.messages_in_queue;
ITTI_DUMP_DEBUG(0x4, "%lu elements in queue\n", number_of_messages);
if (number_of_messages == 0) {
return (consumer);
}
__sync_sub_and_fetch(&itti_dump_queue.messages_in_queue, number_of_messages);
#endif
do {
/* Acquire the ring element */
lfds611_ringbuffer_get_read_element(itti_dump_queue.itti_message_queue, &element);
@@ -419,9 +373,6 @@ static int itti_dump_flush_ring_buffer(int flush_all)
lfds611_ringbuffer_put_read_element(itti_dump_queue.itti_message_queue, element);
}
} while(flush_all
#ifdef RTAI
&& --number_of_messages
#endif
);
}
@@ -478,9 +429,6 @@ static void *itti_dump_socket(void *arg_p)
struct sockaddr_in servaddr; /* socket address structure */
struct timeval *timeout_p = NULL;
#ifdef RTAI
struct timeval timeout;
#endif
ITTI_DUMP_DEBUG(0x2, " Creating TCP dump socket on port %u\n", ITTI_PORT);
@@ -536,15 +484,11 @@ static void *itti_dump_socket(void *arg_p)
/* Add the listener */
FD_SET(itti_listen_socket, &read_set);
#ifndef RTAI
/* Add the event fd */
FD_SET(itti_dump_queue.event_fd, &read_set);
/* Max of both sd */
max_sd = itti_listen_socket > itti_dump_queue.event_fd ? itti_listen_socket : itti_dump_queue.event_fd;
#else
max_sd = itti_listen_socket;
#endif
itti_dump_queue.itti_listen_socket = itti_listen_socket;
@@ -557,14 +501,7 @@ static void *itti_dump_socket(void *arg_p)
int i;
memcpy(&working_set, &read_set, sizeof(read_set));
#ifdef RTAI
timeout.tv_sec = 0;
timeout.tv_usec = 100000;
timeout_p = &timeout;
#else
timeout_p = NULL;
#endif
/* No timeout: select blocks till a new event has to be handled
* on sd's.
@@ -592,8 +529,6 @@ static void *itti_dump_socket(void *arg_p)
if (FD_ISSET(i, &working_set)) {
desc_ready -= 1;
#ifndef RTAI
if (i == itti_dump_queue.event_fd) {
/* Notification of new element to dump from other tasks */
eventfd_t sem_counter;
@@ -613,7 +548,6 @@ static void *itti_dump_socket(void *arg_p)
if (itti_dump_running) {
ITTI_DUMP_DEBUG (0x4, " No messages consumers, waiting ...\n");
usleep(100 * 1000);
#ifndef RTAI
{
ssize_t write_ret;
@@ -622,7 +556,6 @@ static void *itti_dump_socket(void *arg_p)
write_ret = write(itti_dump_queue.event_fd, &sem_counter, sizeof(sem_counter));
AssertFatal (write_ret == sizeof(sem_counter), "Failed to write to dump event FD (%d/%d)!\n", (int) write_ret, (int) sem_counter);
}
#endif
} else {
itti_dump_socket_exit();
}
@@ -630,7 +563,6 @@ static void *itti_dump_socket(void *arg_p)
ITTI_DUMP_DEBUG(0x1, " Write element to file\n");
}
} else
#endif
if (i == itti_listen_socket) {
do {
client_socket = accept(itti_listen_socket, NULL, NULL);
@@ -719,21 +651,9 @@ int itti_dump_queue_message(task_id_t sender_task,
AssertFatal (message_name != NULL, "Message name is NULL!\n");
AssertFatal (message_p != NULL, "Message is NULL!\n");
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new = itti_malloc(sender_task, TASK_MAX, sizeof(itti_dump_queue_item_t));
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_IN);
#endif
new->data = itti_malloc(sender_task, TASK_MAX, message_size);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_ITTI_DUMP_ENQUEUE_MESSAGE_MALLOC, VCD_FUNCTION_OUT);
#endif
memcpy(new->data, message_p, message_size);
new->data_size = message_size;
@@ -791,9 +711,6 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
AssertFatal (0, " Failed to create ring buffer!\n");
}
#ifdef RTAI
itti_dump_queue.messages_in_queue = 0;
#else
itti_dump_queue.event_fd = eventfd(0, EFD_SEMAPHORE);
if (itti_dump_queue.event_fd == -1) {
@@ -801,8 +718,6 @@ int itti_dump_init(const char * const messages_definition_xml, const char * cons
AssertFatal (0, "eventfd failed: %s!\n", strerror(errno));
}
#endif
itti_dump_queue.nb_connected = 0;
for(i = 0; i < ITTI_DUMP_MAX_CON; i++) {
-4
View File
@@ -27,11 +27,7 @@
#ifndef _ITTI_TYPES_H_
#define _ITTI_TYPES_H_
#ifdef USER_MODE
#include <stdint.h>
#else
#include <linux/types.h>
#endif
#define CHARS_TO_UINT32(c1, c2, c3, c4) (((c4) << 24) | ((c3) << 16) | ((c2) << 8) | (c1))
-37
View File
@@ -19,15 +19,8 @@
* contact@openairinterface.org
*/
#ifdef RTAI
# include <rtai_shm.h>
#endif
#include "assertions.h"
#include "memory_pools.h"
#if defined(OAI_EMU) || defined(RTAI)
# include "vcd_signal_dumper.h"
#endif
#if T_TRACER
#include <string.h>
@@ -37,18 +30,8 @@
/*------------------------------------------------------------------------------*/
const static int mp_debug = 0;
#ifdef RTAI
# define MP_DEBUG(x, args...) do { if (mp_debug) rt_printk("[MP][D]"x, ##args); } \
while(0)
#else
# define MP_DEBUG(x, args...) do { if (mp_debug) fprintf(stdout, "[MP][D]"x, ##args); fflush (stdout); } \
while(0)
#endif
#if defined(OAI_EMU) || defined(RTAI)
uint64_t vcd_mp_alloc;
uint64_t vcd_mp_free;
#endif
/*------------------------------------------------------------------------------*/
#ifndef CHARS_TO_UINT32
@@ -414,11 +397,6 @@ memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_po
pool_id_t pool;
items_group_index_t item_index = ITEMS_GROUP_INDEX_INVALID;
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_ALLOC,
__sync_or_and_fetch (&vcd_mp_alloc, 1L << info_0));
#endif
/* Recover memory_pools */
memory_pools = memory_pools_from_handler (memory_pools_handle);
AssertError (memory_pools != NULL, {}, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
@@ -464,11 +442,6 @@ memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_po
MP_DEBUG(" Alloc [--][------]{------}, %3u %3u, %6u, failed!\n", info_0, info_1, item_size);
}
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_ALLOC,
__sync_and_and_fetch (&vcd_mp_alloc, ~(1L << info_0)));
#endif
return memory_pool_item_handle;
}
@@ -493,11 +466,6 @@ int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_it
info_1 = memory_pool_item->start.info[1];
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
__sync_or_and_fetch (&vcd_mp_free, 1L << info_1));
#endif
/* Recover pool index */
pool = memory_pool_item->start.pool_id;
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
@@ -531,11 +499,6 @@ int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_it
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory pool item (pool %u, item %d)!\n", pool, item_index);
#if defined(OAI_EMU) || defined(RTAI)
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLE_MP_FREE,
__sync_and_and_fetch (&vcd_mp_free, ~(1L << info_1)));
#endif
return (result);
}
+1 -1
View File
@@ -24,7 +24,7 @@ set(OPENAIR_NFAPIINC $ENV{NFAPI_DIR} )
set(CMAKE_INSTALL_PREFIX $ENV{OPENAIR_TARGETS})
add_definitions (-DRel14 -DCMAKER -DENABLE_FXP -DENABLE_ITTI -DENABLE_NAS_UE_LOGGING -DENABLE_SECURITY -DENABLE_USE_CPU_EXECUTION_TIME -DENABLE_USE_MME -DENABLE_VCD -DENB_AGENT -DENB_MODE -DETHERNET=1 -DEXMIMO_IOT -DJUMBO_FRAME -DLINK_ENB_PDCP_TO_GTPV1U -DLOG_NO_THREAD -DMAC_CONTEXT -DMAX_NUM_CCs=1 -DNAS_BUILT_IN_UE -DNAS_UE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNB_ANTENNAS_TXRX=2 -DNEW_FFT -DNO_RRM -DNone=1 -DOAI_NW_DRIVER_USE_NETLINK -DOPENAIR1 -DOPENAIR2 -DOPENAIR_LTE -DPC_DSP -DPC_TARGET -DPHYSIM -DPHY_CONTEXT -DPUCCH -DRel10=1 -DS1AP_VERSION=R10 -DTRACE_RLC_MUTEX -DUSER_MODE -DX2AP_VERSION=R11 -DXFORMS -mavx2 -msse4.1 -mssse3)
add_definitions (-DRel14 -DCMAKER -DENABLE_ITTI -DENABLE_NAS_UE_LOGGING -DENABLE_SECURITY -DENABLE_USE_CPU_EXECUTION_TIME -DENABLE_USE_MME -DENABLE_VCD -DENB_AGENT -DENB_MODE -DETHERNET=1 -DEXMIMO_IOT -DJUMBO_FRAME -DLINK_ENB_PDCP_TO_GTPV1U -DLOG_NO_THREAD -DMAC_CONTEXT -DMAX_NUM_CCs=1 -DNAS_BUILT_IN_UE -DNAS_UE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DNO_RRM -DNone=1 -DOAI_NW_DRIVER_USE_NETLINK -DOPENAIR2 -DOPENAIR_LTE -DPHYSIM -DPHY_CONTEXT -DRel10=1 -DS1AP_VERSION=R10 -DTRACE_RLC_MUTEX -DX2AP_VERSION=R11 -DXFORMS -mavx2 -msse4.1 -mssse3)
add_compile_options( -fPIC -march=native -Ofast)
include_directories( ./ ${OPENAIR_COMMON_DIR} ${OPENAIR_DIR} ${OPENAIR1_DIR} ${OPENAIR2_DIR} ${OPENAIR2_COMMON_DIR} ${OPENAIR2_DIR}/UTIL/LOG
+1
View File
@@ -21,6 +21,7 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdint.h>
#include <nfapi_interface.h>
#include <nfapi.h>
+1
View File
@@ -29,6 +29,7 @@
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include <stdint.h>
#include <nfapi_interface.h>
#include <nfapi.h>
+1
View File
@@ -31,6 +31,7 @@
#include <unistd.h>
#include <errno.h>
#include <pthread.h>
#include <stdint.h>
#include <nfapi_interface.h>
#include <nfapi.h>
-121
View File
@@ -1,121 +0,0 @@
# command line flags are automatically exported and thus passed down to any sub-make.
# here we set the default flags in case on command line flags are provided
# these flags have to be explicitely exported so that the sub-make is aware of them
include $(OPENAIR_DIR)/common/utils/Makefile.inc
ifndef OPENAIR_LTE
export OPENAIR_LTE=1
endif
ifndef OPENAIR1
export OPENAIR1=1
endif
ifndef OPENAIR2
export OPENAIR2=0
endif
ifndef EMOS
export EMOS=0
endif
ifndef FIRMWARE2010
export FIRMWARE2010=0
endif
all: openair_rf_cbmimo1_softmodem.ko asn1_msg_kern.ko
openair_rf_cbmimo1_softmodem.ko:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 && mv openair_rf.ko openair_rf_softmodem.ko)
oai_user_cbmimo1.ko:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 BIT8_TX=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko openair_rf_softmodem.ko)
oai_user_exmimo.ko:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) -C $(KERNEL_DIR)/build V=1 M=`pwd` RTAI=1 CBMIMO1=1 OPENAIR1=0 OPENAIR2=0 && mv openair_rf.ko openair_rf_softmodem.ko)
asn1_msg_kern.ko:
(cd ../openair2/RRC/LITE/MESSAGES && $(MAKE) -C $(KERNEL_DIR) V=0 M=`pwd` RTAI=1 -j2)
#Remove all but source files
cleanall:
find -name '*.o' -delete -print; \
find -name '*.ko' -delete -print; \
find -name '*.bak' -delete -print; \
find -name '*.cmd' -delete -print; \
find -name '*~' -delete -print; \
find -name octave-core -delete -print; \
#Remove files created by SVN, dangerous!!! DO NOT RUN ON YOUR WORKING REPOSITORY!
#FK: Don't do this! Use svn export instead.
#cleansvn:
# rm -rf `find -name *.svn* -print`; \
# find -name *.svn* -delete -print
tgz:
mkdir /tmp/openair1_tmp; \
$(MAKE) cleanall; \
cp -r . /tmp/openair1_tmp; \
(cd /tmp/openair1_tmp && $(MAKE) cleansvn && cd .. && tar czfv openair1.tgz openair1_tmp) ; \
cp /tmp/openair1.tgz . ;\
rm -rf /tmp/openair1_tmp
fifos:
@for i in `seq 0 64`;\
do \
have_rtfX=`ls /dev/ |grep -c rtf$$i`;\
if [ "$$have_rtfX" -eq 0 ] ;then \
mknod -m 666 /dev/rtf$$i c 150 $$i; \
fi;\
done
openair0:
mknod /dev/openair0 c 127 0
chmod a+rw /dev/openair0
install_oai_user:
make fifos
insmod ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko
updatefw:
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr_exmimo2/main -s 0x43fffff0
boot_exmimo:
sudo make install_oai_user
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0
sudo rmmod openair_rf
sudo make install_oai_user
reboot_exmimo:
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0 -b
rmmod openair_rf
make install_oai_user
USERSPACE_TOOLS/OAI_FW_INIT/updatefw -f $$OPENAIR0_DIR/express-mimo/software/sdr/main -s 0x43fffff0
rmmod openair_rf
make install_oai_user
install_softmodem:
make fifos
ifeq ($(OPENAIR2),1)
insmod ../openair2/RRC/LITE/MESSAGES/asn1_msg_kern.ko
endif
insmod ARCH/CBMIMO1/DEVICE_DRIVER/openair_rf_softmodem.ko ; \
remove:
rmmod openair_rf
ifeq ($(OPENAIR2),1)
rmmod asn1_msg_kern
endif
test:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) test RTAI=1 CBMIMO1=1)
(cd ../openair2/RRC/LITE/MESSAGES && $(MAKE) test)
clean: clean_l1
clean_l1:
(cd ARCH/CBMIMO1/DEVICE_DRIVER && $(MAKE) clean RTAI=1 CBMIMO1=1)
clean_asn1:
(cd ../openair2/RRC/LITE/MESSAGES && $(MAKE) clean)
+1 -1
View File
@@ -5,7 +5,7 @@ RATE12CC_SRC = ccoding_byte.c viterbi.c crc_byte.c
all: 3gpplte_sse
3gpplte_sse: $(TURBO_SRC)
gcc -O3 -gdwarf-2 -mfloat-abi=hard -mfpu=neon -lm -lgcc -lrt ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DTC_MAIN -DNB_ANTENNAS_RX=1 -o 3gpplte_sse 3gpplte_sse.c -Wall -g -ggdb -DTC_MAIN
gcc -O3 -gdwarf-2 -mfloat-abi=hard -mfpu=neon -lm -lgcc -lrt ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DTC_MAIN -DNB_ANTENNAS_RX=1 -o 3gpplte_sse 3gpplte_sse.c -Wall -g -ggdb -DTC_MAIN
+1 -1
View File
@@ -7,7 +7,7 @@ OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DNODE_RG -DUSER_MODE -DPC_TARGET -DNO_UL_REF -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DOPENAIR_LTE -DMAX_NUM_CCs=1
CFLAGS += -DNODE_RG -DNO_UL_REF -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TX=2 -DOPENAIR_LTE -DMAX_NUM_CCs=1
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
-7
View File
@@ -31,13 +31,6 @@
*/
#ifndef USER_MODE
#define __NO_VERSION__
#endif
//#include "PHY/types.h"
#include "defs.h"
-4
View File
@@ -29,11 +29,7 @@
#include <stdint.h>
#ifndef NO_OPENAIR1
#include "PHY/defs.h"
#else
#include "PHY/TOOLS/time_meas.h"
#endif
#define CRC24_A 0
#define CRC24_B 1
+1 -5
View File
@@ -28,10 +28,6 @@
date: 21.10.2009
*/
#ifdef USER_MODE
#include <stdio.h>
#endif
#ifndef TEST_DEBUG
#include "PHY/defs.h"
#include "PHY/extern.h"
@@ -126,7 +122,7 @@ void print_shorts(__m128i x,char *s) {
}
*/
#endif // USER_MODE
#endif // DEBUG_VITERBI
-4
View File
@@ -20,10 +20,6 @@
*/
/*!\brief Initilization and reconfiguration routines for LTE PHY */
#ifndef USER_MODE
#define __NO_VERSION__
#endif
#include "defs.h"
#include "PHY/extern.h"
#include "MAC_INTERFACE/extern.h"
-18
View File
@@ -23,12 +23,6 @@
#define __LTE_ESTIMATION_DEFS__H__
#include "PHY/defs.h"
/*
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
*/
/** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_
* @{
*/
@@ -136,18 +130,6 @@ int lte_dl_mbsfn_channel_estimation(PHY_VARS_UE *phy_vars_ue,
int subframe,
unsigned char l);
/*
#ifdef EMOS
int lte_dl_channel_estimation_emos(int dl_ch_estimates_emos[NB_ANTENNAS_RX*NB_ANTENNAS_TX][N_RB_DL_EMOS*N_PILOTS_PER_RB*N_SLOTS_EMOS],
int **rxdataF,
LTE_DL_FRAME_PARMS *frame_parms,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char sector);
#endif
*/
/*!
\brief Frequency offset estimation for LTE
We estimate the frequency offset by calculating the phase difference between channel estimates for symbols carrying pilots (l==0 or l==3/4). We take a moving average of the phase difference.
@@ -149,10 +149,8 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
int temp, i, aa, max_pos = 0,ind;
int max_val=0;
short Re,Im,ncoef;
#ifdef USER_MODE
#ifdef DEBUG_PHY
char fname[100],vname[100];
#endif
#endif
ncoef = 32768 - coef;
@@ -187,12 +185,10 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
1);
break;
}
#ifdef USER_MODE
#ifdef DEBUG_PHY
sprintf(fname,"srs_ch_estimates_time_%d%d.m",ind,aa);
sprintf(vname,"srs_time_%d%d",ind,aa);
write_output(fname,vname,lte_eNB_srs->srs_ch_estimates_time[aa],frame_parms->ofdm_symbol_size*2,2,1);
#endif
#endif
}
@@ -19,9 +19,7 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <string.h>
#endif
#include "defs.h"
#include "PHY/defs.h"
#include "filt16_32.h"
@@ -19,9 +19,7 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <string.h>
#endif
#include "defs.h"
#include "SCHED/defs.h"
#include "PHY/defs.h"
@@ -1,151 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <string.h>
#endif
#include "defs.h"
#include "PHY/defs.h"
#include "SCHED/phy_procedures_emos.h"
// TODO: make channel estimation possible for multiple sectors (Gold sequences for pilots)
//#define DEBUG_CH
int lte_dl_channel_estimation_emos(int dl_ch_estimates_emos[NB_ANTENNAS_RX*NB_ANTENNAS_TX][N_RB_DL_EMOS*N_PILOTS_PER_RB*N_SLOTS_EMOS],
int **rxdataF,
LTE_DL_FRAME_PARMS *frame_parms,
unsigned char Ns,
unsigned char p,
unsigned char l,
unsigned char sector)
{
int pilot[2][200] __attribute__((aligned(16)));
unsigned char nu,aarx;
unsigned short k;
unsigned int rb,pilot_cnt;
short ch[2],*pil,*rxF,*dl_ch,*dl_ch_prev; //*f,*f2,*fl,*f2l2,*fr,*f2r2;
int ch_offset,symbol_offset;
unsigned int n;
int i;
unsigned char symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
if ((p==0) && (l==0) )
nu = 0;
else if ((p==0) && (l>0))
nu = 3;
else if ((p==1) && (l==0))
nu = 3;
else if ((p==1) && (l>0))
nu = 0;
else {
msg("lte_dl_channel_estimation_emos: p %d, l %d -> ERROR\n",p,l);
return(-1);
}
if (sector > 2) {
msg("lte_dl_channel_estimation_emos: sector must be 0,1, or 2\n");
return(-1);
}
switch (Ns) {
case 0:
ch_offset = ((l==0)?0:1)*2*frame_parms->N_RB_DL;
break;
case 1:
ch_offset = ((l==0)?2:3)*2*frame_parms->N_RB_DL;
break;
case 12:
ch_offset = ((l==0)?4:5)*2*frame_parms->N_RB_DL;
break;
case 13:
ch_offset = ((l==0)?6:7)*2*frame_parms->N_RB_DL;
break;
default:
msg("lte_dl_channel_estimation_emos: Ns must be 0, 1, 12, or 13\n");
return(-1);
break;
}
symbol_offset = symbol*frame_parms->ofdm_symbol_size; // offset within rxdataF
k = nu + sector;
if (k > 6)
k -=6;
#ifdef DEBUG_CH
printf("Channel Estimation : ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d, symbol=%d\n",ch_offset,frame_parms->ofdm_symbol_size,frame_parms->Ncp,l,Ns,k,symbol);
#endif
// generate pilot
lte_dl_cell_spec_rx(&pilot[p][0],
frame_parms,
Ns,
(l==0)?0:1,
p);
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
pil = (short *)&pilot[p][0];
rxF = (short *)&rxdataF[aarx][((symbol_offset+k+frame_parms->first_carrier_offset)<<1)];
dl_ch = (short *)&dl_ch_estimates_emos[(p<<1)+aarx][ch_offset];
memset(dl_ch,0,frame_parms->N_RB_DL);
for (pilot_cnt=0; pilot_cnt<frame_parms->N_RB_DL; pilot_cnt++) {
dl_ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
dl_ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
pil+=2; // Re Im
rxF+=24; // remember replicated format (Re0 Im0 Re0 Im0) !!!
dl_ch+=2;
}
// printf("Second half\n");
// Second half of RBs
rxF = (short *)&rxdataF[aarx][((symbol_offset+1+k)<<1)];
for (pilot_cnt=0; pilot_cnt<frame_parms->N_RB_DL; pilot_cnt++) {
dl_ch[0] = (short)(((int)pil[0]*rxF[0] - (int)pil[1]*rxF[1])>>15);
dl_ch[1] = (short)(((int)pil[0]*rxF[1] + (int)pil[1]*rxF[0])>>15);
pil+=2;
rxF+=24;
dl_ch+=2;
}
}
return(0);
}
@@ -19,9 +19,7 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <string.h>
#endif
#include "defs.h"
#include "PHY/defs.h"
@@ -578,30 +578,3 @@ int lte_sync_time_eNB(int32_t **rxdata, ///rx data in time domain
}
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
//extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
int lte_sync_time_eNB_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t sect_id,
int32_t *sync_val)
{
uint8_t UE_id;
uint8_t CC_id = phy_vars_eNB->CC_id;
LOG_E(PHY,"[PHY] EMUL lte_sync_time_eNB_emul eNB %d, sect_id %d\n",phy_vars_eNB->Mod_id,sect_id);
*sync_val = 0;
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
//LOG_E(PHY,"[PHY] EMUL : eNB %d checking UE %d (PRACH %d) PL %d dB\n",phy_vars_eNB->Mod_id,UE_id,PHY_vars_UE_g[UE_id]->generate_prach,UE2eNB[UE_id][phy_vars_eNB->Mod_id]->path_loss_dB);
if ((PHY_vars_UE_g[UE_id][CC_id]->generate_prach == 1) && (phy_vars_eNB->Mod_id == (UE_id % NB_eNB_INST))) {
*sync_val = 1;
return(0);
}
}
return(-1);
}
#endif
@@ -38,7 +38,6 @@
int16_t cond_num_threshold = 0;
#ifdef USER_MODE
void print_shorts(char *s,short *x)
{
@@ -57,8 +56,6 @@ void print_ints(char *s,int *x)
);
}
#endif
int16_t get_PL(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index)
{
@@ -91,7 +91,6 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
eNB->ulsch[UE_id]->harq_processes[harq_pid]->n_DMRS2 +
frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12;
#if defined(USER_MODE)
Msc_idx_ptr = (uint16_t*) bsearch(&Msc_RS, dftsizes, 33, sizeof(uint16_t), compareints);
if (Msc_idx_ptr)
@@ -101,26 +100,14 @@ int32_t temp_in_ifft_0[2048*2] __attribute__((aligned(32)));
return(-1);
}
#else
uint8_t b;
for (b=0; b<33; b++)
if (Msc_RS==dftsizes[b])
Msc_RS_idx = b;
#endif
// LOG_I(PHY,"subframe %d, Ns %d, l %d, Msc_RS = %d, Msc_RS_idx = %d, u %d, v %d, cyclic_shift %d\n",subframe,Ns,l,Msc_RS, Msc_RS_idx,u,v,cyclic_shift);
#ifdef DEBUG_CH
#ifdef USER_MODE
if (Ns==0)
write_output("drs_seq0.m","drsseq0",ul_ref_sigs_rx[u][v][Msc_RS_idx],2*Msc_RS,2,1);
else
write_output("drs_seq1.m","drsseq1",ul_ref_sigs_rx[u][v][Msc_RS_idx],2*Msc_RS,2,1);
#endif
#endif
@@ -489,12 +476,10 @@ int32_t lte_srs_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
15,
0);
#ifdef USER_MODE
#ifdef DEBUG_SRS
sprintf(fname,"srs_ch_est%d.m",aa);
sprintf(vname,"srs_est%d",aa);
write_output(fname,vname,srs_vars->srs_ch_estimates[aa],frame_parms->ofdm_symbol_size,1,1);
#endif
#endif
}
@@ -19,10 +19,8 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#endif
#include "defs.h"
#include "PHY/defs.h"
-2
View File
@@ -21,10 +21,8 @@
// 6.10.2.2 MBSFN reference signals Mapping to resource elements
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#endif
#include "defs.h"
#include "PHY/defs.h"
-2
View File
@@ -30,10 +30,8 @@
* \warning
*/
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#endif
#include "defs.h"
#include "PHY/defs.h"
-32
View File
@@ -29,11 +29,9 @@
* \note
* \warning
*/
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
@@ -4240,33 +4238,3 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
return(dci_cnt);
}
#ifdef PHY_ABSTRACTION
uint16_t dci_decoding_procedure_emul(LTE_UE_PDCCH **pdcch_vars,
uint8_t num_ue_spec_dci,
uint8_t num_common_dci,
DCI_ALLOC_t *dci_alloc_tx,
DCI_ALLOC_t *dci_alloc_rx,
int16_t eNB_id)
{
uint8_t dci_cnt=0,i;
memcpy(dci_alloc_rx,dci_alloc_tx,num_common_dci*sizeof(DCI_ALLOC_t));
dci_cnt = num_common_dci;
LOG_D(PHY,"[DCI][EMUL] : num_common_dci %d\n",num_common_dci);
for (i=num_common_dci; i<(num_ue_spec_dci+num_common_dci); i++) {
LOG_D(PHY,"[DCI][EMUL] Checking dci %d => %x format %d (bit 0 %d)\n",i,pdcch_vars[eNB_id]->crnti,dci_alloc_tx[i].format,
dci_alloc_tx[i].dci_pdu[0]&0x80);
if (dci_alloc_tx[i].rnti == pdcch_vars[eNB_id]->crnti) {
memcpy(dci_alloc_rx+dci_cnt,dci_alloc_tx+i,sizeof(DCI_ALLOC_t));
dci_cnt++;
}
}
return(dci_cnt);
}
#endif
@@ -247,6 +247,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
Mdlharq = dlsch->Mdlharq;
dlsch->rnti = 0;
dlsch->active = 0;
dlsch->harq_mask = 0;
for (i=0; i<10; i++)
dlsch->harq_ids[i] = Mdlharq;
-315
View File
@@ -758,318 +758,3 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
return(ret);
}
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#ifdef OPENAIR2
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#endif
int dlsch_abstraction_EESM(double* sinr_dB, uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs, uint8_t dl_power_off)
{
int ii;
double sinr_eff = 0;
int rb_count = 0;
int offset;
double bler = 0;
if(TM==5 && dl_power_off==1) {
//do nothing -- means there is no second UE and TM 5 is behaving like TM 6 for a singal user
} else
TM = TM-1;
for (offset = 0; offset <= 24; offset++) {
if (rb_alloc[0] & (1<<offset)) {
rb_count++;
for(ii=0; ii<12; ii++) {
sinr_eff += exp(-(pow(10, 0.1*(sinr_dB[(offset*12)+ii])))/beta1_dlsch[TM][mcs]);
//printf("sinr_eff1 = %f, power %lf\n",sinr_eff, exp(-pow(10,6.8)));
// sinr_eff += exp(-(pow(10, (sinr_dB[offset*2+1])/10))/beta1_dlsch[TM][mcs]);
//printf("sinr_dB[%d]=%f\n",offset,sinr_dB[offset*2]);
}
}
}
LOG_D(OCM,"sinr_eff (lin, unweighted) = %f\n",sinr_eff);
sinr_eff = -beta2_dlsch[TM][mcs]*log((sinr_eff)/(12*rb_count));
LOG_D(OCM,"sinr_eff (lin, weighted) = %f\n",sinr_eff);
sinr_eff = 10 * log10(sinr_eff);
LOG_D(OCM,"sinr_eff (dB) = %f\n",sinr_eff);
bler = interp(sinr_eff,&sinr_bler_map[mcs][0][0],&sinr_bler_map[mcs][1][0],table_length[mcs]);
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
if (uniformrandom() < bler) {
LOG_I(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f, TM %d)\n",mcs,sinr_eff,bler, TM);
return(1);
} else {
LOG_I(OCM,"abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f, TM %d)\n",mcs,sinr_eff,bler, TM);
return(1);
}
#endif
}
int dlsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint32_t rb_alloc[4], uint8_t mcs,uint8_t dl_power_off)
{
int ii;
double sinr_eff = 0;
double x = 0;
double I =0;
double qpsk_max=12.2;
double qam16_max=19.2;
double qam64_max=25.2;
double sinr_min = -20;
int rb_count = 0;
int offset=0;
double bler = 0;
if(TM==5 && dl_power_off==1) {
//do nothing -- means there is no second UE and TM 5 is behaving like TM 6 for a singal user
} else
TM = TM-1;
for (offset = 0; offset <= 24; offset++) {
if (rb_alloc[0] & (1<<offset)) {
rb_count++;
for(ii=0; ii<12; ii++) {
//x is the sinr_dB in dB
x = sinr_dB[(offset*12)+ii] - 10*log10(beta1_dlsch_MI[TM][mcs]);
if(x<sinr_min)
I +=0;
else {
if(mcs<10) {
if(x>qpsk_max)
I += 1;
else
I += (q_qpsk[0]*pow(x,7) + q_qpsk[1]*pow(x,6) + q_qpsk[2]*pow(x,5) + q_qpsk[3]*pow(x,4) + q_qpsk[4]*pow(x,3) + q_qpsk[5]*pow(x,2) + q_qpsk[6]*x + q_qpsk[7]);
} else if(mcs>9 && mcs<17) {
if(x>qam16_max)
I += 1;
else
I += (q_qam16[0]*pow(x,7) + q_qam16[1]*pow(x,6) + q_qam16[2]*pow(x,5) + q_qam16[3]*pow(x,4) + q_qam16[4]*pow(x,3) + q_qam16[5]*pow(x,2) + q_qam16[6]*x + q_qam16[7]);
} else if(mcs>16 && mcs<23) {
if(x>qam64_max)
I += 1;
else
I += (q_qam64[0]*pow(x,7) + q_qam64[1]*pow(x,6) + q_qam64[2]*pow(x,5) + q_qam64[3]*pow(x,4) + q_qam64[4]*pow(x,3) + q_qam64[5]*pow(x,2) + q_qam64[6]*x + q_qam64[7]);
}
}
}
}
}
// averaging of accumulated MI
I = I/(12*rb_count);
//Now I->SINR_effective Mapping
if(mcs<10) {
sinr_eff = (p_qpsk[0]*pow(I,7) + p_qpsk[1]*pow(I,6) + p_qpsk[2]*pow(I,5) + p_qpsk[3]*pow(I,4) + p_qpsk[4]*pow(I,3) + p_qpsk[5]*pow(I,2) + p_qpsk[6]*I + p_qpsk[7]);
} else if(mcs>9 && mcs<17) {
sinr_eff = (p_qam16[0]*pow(I,7) + p_qam16[1]*pow(I,6) + p_qam16[2]*pow(I,5) + p_qam16[3]*pow(I,4) + p_qam16[4]*pow(I,3) + p_qam16[5]*pow(I,2) + p_qam16[6]*I + p_qam16[7]);
} else if(mcs>16 && mcs<23) {
sinr_eff = (p_qam64[0]*pow(I,7) + p_qam64[1]*pow(I,6) + p_qam64[2]*pow(I,5) + p_qam64[3]*pow(I,4) + p_qam64[4]*pow(I,3) + p_qam64[5]*pow(I,2) + p_qam64[6]*I + p_qam64[7]);
}
//sinr_eff = sinr_eff + 10*log10(beta2_dlsch_MI[TM][mcs]);
LOG_D(OCM,"SINR_Eff = %e\n",sinr_eff);
bler = interp(sinr_eff,&sinr_bler_map[mcs][0][0],&sinr_bler_map[mcs][1][0],table_length[mcs]);
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
if (uniformrandom() < bler) {
LOG_N(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(0);
} else {
LOG_I(OCM,"abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(1);
}
#endif
}
/*
uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe,
PDSCH_t dlsch_id,
uint8_t eNB_id)
{
LTE_UE_DLSCH_t *dlsch_ue;
LTE_eNB_DLSCH_t *dlsch_eNB;
uint8_t harq_pid;
uint32_t eNB_id2;
uint32_t ue_id;
#ifdef DEBUG_DLSCH_DECODING
uint16_t i;
#endif
uint8_t CC_id = phy_vars_ue->CC_id;
// may not be necessary for PMCH??
for (eNB_id2=0; eNB_id2<NB_eNB_INST; eNB_id2++) {
if (RC.eNB[eNB_id2][CC_id]->frame_parms.Nid_cell == phy_vars_ue->frame_parms.Nid_cell)
break;
}
AssertFatal(eNB_id2!=NB_eNB_INST,
"FATAL : Could not find attached eNB for DLSCH emulation !!!!\n");
LOG_D(PHY,"[UE] dlsch_decoding_emul : subframe %d, eNB_id %d, dlsch_id %d\n",subframe,eNB_id2,dlsch_id);
// printf("dlsch_eNB_ra->harq_processes[0] %p\n",PHY_vars_eNB_g[eNB_id]->dlsch_eNB_ra->harq_processes[0]);
switch (dlsch_id) {
case SI_PDSCH: // SI
dlsch_ue = phy_vars_ue->dlsch_SI[eNB_id];
dlsch_eNB = RC.eNB[eNB_id2][CC_id]->dlsch_SI;
// printf("Doing SI: TBS %d\n",dlsch_ue->harq_processes[0]->TBS>>3);
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING
LOG_D(PHY,"SI Decoded\n");
for (i=0; i<dlsch_ue->harq_processes[0]->TBS>>3; i++)
LOG_T(PHY,"%x.",dlsch_eNB->harq_processes[0]->b[i]);
LOG_T(PHY,"\n");
#endif
return(1);
break;
case RA_PDSCH: // RA
dlsch_ue = phy_vars_ue->dlsch_ra[eNB_id];
dlsch_eNB = RC.eNB[eNB_id2][CC_id]->dlsch_ra;
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING
LOG_D(PHY,"RA Decoded\n");
for (i=0; i<dlsch_ue->harq_processes[0]->TBS>>3; i++)
LOG_T(PHY,"%x.",dlsch_eNB->harq_processes[0]->b[i]);
LOG_T(PHY,"\n");
#endif
return(1);
break;
case PDSCH: // TB0
dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0];
harq_pid = dlsch_ue->current_harq_pid;
ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][(uint32_t)eNB_id]->crnti,RC.eNB[eNB_id2][CC_id]);
DevAssert( ue_id != (uint32_t)-1 );
dlsch_eNB = RC.eNB[eNB_id2][CC_id]->dlsch[ue_id][0];
#ifdef DEBUG_DLSCH_DECODING
for (i=0; i<dlsch_ue->harq_processes[harq_pid]->TBS>>3; i++)
LOG_T(PHY,"%x.",dlsch_eNB->harq_processes[harq_pid]->b[i]);
LOG_T(PHY,"\n current harq pid is %d ue id %d \n", harq_pid, ue_id);
#endif
if (dlsch_abstraction_MIESM(phy_vars_ue->sinr_dB,
phy_vars_ue->transmission_mode[eNB_id],
dlsch_eNB->harq_processes[harq_pid]->rb_alloc,
dlsch_eNB->harq_processes[harq_pid]->mcs,
RC.eNB[eNB_id][CC_id]->mu_mimo_mode[ue_id].dl_pow_off) == 1) {
// reset HARQ
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0;
dlsch_ue->harq_ack[subframe].ack = 1;
dlsch_ue->harq_ack[subframe].harq_id = harq_pid;
dlsch_ue->harq_ack[subframe].send_harq_status = 1;
if (dlsch_ue->harq_processes[harq_pid]->round == 0)
memcpy(dlsch_ue->harq_processes[harq_pid]->b,
dlsch_eNB->harq_processes[harq_pid]->b,
dlsch_ue->harq_processes[harq_pid]->TBS>>3);
return(1);
} else {
// retransmission
dlsch_ue->harq_processes[harq_pid]->status = ACTIVE;
dlsch_ue->harq_processes[harq_pid]->round++;
dlsch_ue->harq_ack[subframe].ack = 0;
dlsch_ue->harq_ack[subframe].harq_id = harq_pid;
dlsch_ue->harq_ack[subframe].send_harq_status = 1;
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
}
break;
case PDSCH1: { // TB1
dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][1];
harq_pid = dlsch_ue->current_harq_pid;
int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->crnti, RC.eNB[eNB_id2][CC_id] );
DevAssert( UE_id != -1 );
dlsch_eNB = RC.eNB[eNB_id2][CC_id]->dlsch[UE_id][1];
// reset HARQ
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0;
dlsch_ue->harq_ack[subframe].ack = 1;
dlsch_ue->harq_ack[subframe].harq_id = harq_pid;
dlsch_ue->harq_ack[subframe].send_harq_status = 1;
if (dlsch_ue->harq_processes[harq_pid]->round == 0)
memcpy(dlsch_eNB->harq_processes[harq_pid]->b,dlsch_ue->harq_processes[harq_pid]->b,dlsch_ue->harq_processes[harq_pid]->TBS>>3);
break;
}
case PMCH: // PMCH
dlsch_ue = phy_vars_ue->dlsch_MCH[eNB_id];
dlsch_eNB = RC.eNB[eNB_id2][CC_id]->dlsch_MCH;
LOG_D(PHY,"decoding pmch emul (size is %d, enb %d %d)\n", dlsch_ue->harq_processes[0]->TBS>>3, eNB_id, eNB_id2);
#ifdef DEBUG_DLSCH_DECODING
for (i=0; i<dlsch_ue->harq_processes[0]->TBS>>3; i++)
printf("%x.",dlsch_eNB->harq_processes[0]->b[i]);
printf("\n");
#endif
// if (dlsch_abstraction_MIESM(phy_vars_ue->sinr_dB, phy_vars_ue->transmission_mode[eNB_id], dlsch_eNB->rb_alloc,
// dlsch_eNB->harq_processes[0]->mcs,RC.eNB[eNB_id]->mu_mimo_mode[ue_id].dl_pow_off) == 1) {
if (1) {
// reset HARQ
dlsch_ue->harq_processes[0]->status = SCH_IDLE;
dlsch_ue->harq_processes[0]->round = 0;
memcpy(dlsch_ue->harq_processes[0]->b,
dlsch_eNB->harq_processes[0]->b,
dlsch_ue->harq_processes[0]->TBS>>3);
dlsch_ue->last_iteration_cnt = 1;
return(1);
} else {
// retransmission
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
}
break;
default:
dlsch_ue = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0];
LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id);
dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations);
}
LOG_E(PHY,"[FATAL] dlsch_decoding.c: Should never exit here ...\n");
return(0);
}*/
#endif
@@ -37,11 +37,7 @@
#include "PHY/sse_intrin.h"
#include "T.h"
#ifndef USER_MODE
#define NOCYGWIN_STATIC static
#else
#define NOCYGWIN_STATIC
#endif
/* dynamic shift for LLR computation for TM3/4
* set as command line argument, see lte-softmodem.c
@@ -6027,9 +6023,6 @@ unsigned short dlsch_extract_rbs_TM7(int **rxdataF,
//==============================================================================================
#ifdef USER_MODE
void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *coded_bits_per_codeword,int round, unsigned char harq_pid)
{
unsigned int nsymb = (ue->frame_parms.Ncp == 0) ? 14 : 12;
@@ -6119,7 +6112,6 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t subframe,unsigned int *c
// printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh);
}
#endif
#ifdef DEBUG_DLSCH_DEMOD
/*
@@ -81,7 +81,6 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
// cyclic_shift1 = 0;
Msc_RS = 12*nb_rb;
#ifdef USER_MODE
Msc_idx_ptr = (uint16_t*) bsearch(&Msc_RS, dftsizes, 33, sizeof(uint16_t), compareints);
if (Msc_idx_ptr)
@@ -91,20 +90,6 @@ int generate_drs_pusch(PHY_VARS_UE *ue,
return(-1);
}
#else
uint8_t b;
for (b=0; b<33; b++)
if (Msc_RS==dftsizes[b])
Msc_RS_idx = b;
#endif
#ifdef DEBUG_DRS
printf("[PHY] drs_modulation: Msc_RS = %d, Msc_RS_idx = %d,cyclic_shift %d, u0 %d, v0 %d, u1 %d, v1 %d,cshift0 %d,cshift1 %d\n",Msc_RS, Msc_RS_idx,cyclic_shift,u0,v0,u1,v1,cyclic_shift0,cyclic_shift1);
#endif
for (l = (3 - frame_parms->Ncp),u=u0,v=v0,cyclic_shift=cyclic_shift0;
l<frame_parms->symbols_per_tti;
l += (7 - frame_parms->Ncp),u=u1,v=v1,cyclic_shift=cyclic_shift1) {
-2
View File
@@ -29,11 +29,9 @@
* \note
* \warning
*/
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SCHED/defs.h"
@@ -237,10 +237,6 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2;
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2;
#ifndef USER_MODE
// one frame delay
ue->proc.proc_rxtx[i].frame_rx ++;
#endif
ue->proc.proc_rxtx[i].frame_tx = ue->proc.proc_rxtx[0].frame_rx;
}
#ifdef DEBUG_INITIAL_SYNCH
-56
View File
@@ -37,11 +37,6 @@
#include "PHY/extern.h"
#include "PHY/sse_intrin.h"
#ifdef PHY_ABSTRACTION
#include "SIMULATION/TOOLS/defs.h"
#endif
//#define DEBUG_PBCH 1
//#define DEBUG_PBCH_ENCODING
//#define INTERFERENCE_MITIGATION 1
@@ -260,13 +255,11 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
#endif
#ifdef DEBUG_PBCH
#ifdef USER_MODE
write_output("pbch_encoded_output2.m","pbch_encoded_out2",
pbch_coded_data2,
pbch_coded_bits,
1,
4);
#endif //USER_MODE
#endif //DEBUG_PBCH
*/
#ifdef DEBUG_PBCH_ENCODING
@@ -288,8 +281,6 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
#ifdef DEBUG_PBCH
#ifdef USER_MODE
if (frame_mod4==0) {
write_output("pbch_e.m","pbch_e",
eNB_pbch->pbch_e,
@@ -300,8 +291,6 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
for (i=0; i<16; i++)
printf("e[%d] %d\n",i,eNB_pbch->pbch_e[i]);
}
#endif //USER_MODE
#endif //DEBUG_PBCH
// scrambling
@@ -309,8 +298,6 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
eNB_pbch->pbch_e,
pbch_E);
#ifdef DEBUG_PBCH
#ifdef USER_MODE
if (frame_mod4==0) {
write_output("pbch_e_s.m","pbch_e_s",
eNB_pbch->pbch_e,
@@ -321,8 +308,6 @@ int generate_pbch(LTE_eNB_PBCH *eNB_pbch,
for (i=0; i<16; i++)
printf("e_s[%d] %d\n",i,eNB_pbch->pbch_e[i]);
}
#endif //USER_MODE
#endif //DEBUG_PBCH
} // frame_mod4==0
@@ -1028,44 +1013,3 @@ uint16_t rx_pbch(LTE_UE_COMMON *lte_ue_common_vars,
}
#ifdef PHY_ABSTRACTION
uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t eNB_id,
uint8_t pbch_phase)
{
double bler=0.0;//, x=0.0;
double sinr=0.0;
uint16_t nb_rb = phy_vars_ue->frame_parms.N_RB_DL;
int16_t f;
uint8_t CC_id=phy_vars_ue->CC_id;
int frame_rx = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
// compute effective sinr
// TODO: adapt this to varible bandwidth
for (f=(nb_rb*6-3*12); f<(nb_rb*6+3*12); f++) {
if (f!=0) //skip DC
sinr += pow(10, 0.1*(phy_vars_ue->sinr_dB[f]));
}
sinr = 10*log10(sinr/(6*12));
bler = pbch_bler(sinr);
LOG_D(PHY,"EMUL UE rx_pbch_emul: eNB_id %d, pbch_phase %d, sinr %f dB, bler %f \n",
eNB_id,
pbch_phase,
sinr,
bler);
if (pbch_phase == (frame_rx % 4)) {
if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->pbch_vars[eNB_id]->decoded_output,RC.eNB[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(RC.eNB[eNB_id][CC_id]->frame_parms.nb_antenna_ports_eNB);
} else
return(-1);
} else
return(-1);
}
#endif
-4
View File
@@ -38,10 +38,6 @@
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#ifndef USER_MODE
#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
#endif
#include "T.h"
//#define DEBUG_PHICH 1
-2
View File
@@ -342,7 +342,6 @@ uint16_t prach_root_sequence_map4[138] = { 1,138,2,137,3,136,4,135,5,134,6,133,
61,78,62,77,63,76,64,75,65,74,66,73,67,72,68,71,69,70
};
#ifdef USER_MODE
void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
{
@@ -363,7 +362,6 @@ void dump_prach_config(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
fclose(fd);
}
#endif
// This function computes the du
void fill_du(uint8_t prach_fmt)
+6 -2
View File
@@ -2151,9 +2151,13 @@ void rx_prach(PHY_VARS_eNB *phy_vars_eNB,RU_t *ru,
uint16_t *max_preamble,
uint16_t *max_preamble_energy,
uint16_t *max_preamble_delay,
#ifdef Rel14
uint16_t Nf, uint8_t tdd_mapindex,
uint8_t br_flag);
uint8_t br_flag
#else
uint16_t Nf, uint8_t tdd_mapindex
#endif
);
/*!
\brief Helper for MAC, returns number of available PRACH in TDD for a particular configuration index
@param frame_parms Pointer to LTE_DL_FRAME_PARMS structure
@@ -180,7 +180,6 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
return(-1);
}
#ifdef USER_MODE
Msc_idx_ptr = (uint16_t*) bsearch((uint16_t*) &Msc_RS, (uint16_t*) dftsizes, 33, sizeof(uint16_t), compareints);
if (Msc_idx_ptr)
@@ -190,19 +189,6 @@ int32_t generate_srs(LTE_DL_FRAME_PARMS *frame_parms,
return(-1);
}
#else //stdlib not availiable in RTAI
if (Msc_RS==216)
Msc_RS_idx = 12;
else if (Msc_RS==144)
Msc_RS_idx = 9;
else {
LOG_E(PHY,"generate_srs: index for Msc_RS=%d not implemented\n",Msc_RS);
return(-1);
}
#endif
#ifdef DEBUG_SRS
LOG_D(PHY,"generate_srs_tx: Msc_RS = %d, Msc_RS_idx = %d, k0 = %d\n",Msc_RS, Msc_RS_idx,k0);
#endif
@@ -279,7 +265,6 @@ int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms,
return(-1);
}
#ifdef USER_MODE
Msc_idx_ptr = (uint16_t*) bsearch((uint16_t*) &Msc_RS, (uint16_t*) dftsizes, 33, sizeof(uint16_t), compareints);
if (Msc_idx_ptr)
@@ -289,19 +274,6 @@ int generate_srs_rx(LTE_DL_FRAME_PARMS *frame_parms,
return(-1);
}
#else //stdlib not availiable in RTAI
if (Msc_RS==216)
Msc_RS_idx = 12;
else if (Msc_RS==144)
Msc_RS_idx = 9;
else {
LOG_E(PHY,"generate_srs: index for Msc_RS=%d not implemented\n",Msc_RS);
return(-1);
}
#endif
#ifdef DEBUG_SRS
LOG_I(PHY,"generate_srs_rx: Msc_RS = %d, Msc_RS_idx = %d, k0=%d\n",Msc_RS, Msc_RS_idx,k0);
#endif
-74
View File
@@ -953,77 +953,3 @@ uint32_t ulsch_encoding(uint8_t *a,
return(0);
}
#ifdef PHY_ABSTRACTION
#ifdef OPENAIR2
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#endif
int ulsch_encoding_emul(uint8_t *ulsch_buffer,
PHY_VARS_UE *ue,
uint8_t eNB_id,
uint8_t subframe_rx,
uint8_t harq_pid,
uint8_t control_only_flag)
{
LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[0][eNB_id];
PHY_MEASUREMENTS *meas = &ue->measurements;
uint8_t tmode = ue->transmission_mode[eNB_id];
uint16_t rnti=ue->pdcch_vars[ue->current_thread_id[subframe_rx]][eNB_id]->crnti;
LOG_D(PHY,"EMUL UE ulsch_encoding for eNB %d,mod_id %d, harq_pid %d rnti %x, ACK(%d,%d) \n",
eNB_id,ue->Mod_id, harq_pid, rnti,ulsch->o_ACK[0],ulsch->o_ACK[1]);
if (ulsch->O>0) {
/*
if(flag_LA==1)
sinr_eff = sinr_eff_cqi_calc(ue, eNB_id);
else
sinr_eff = meas->wideband_cqi_avg[eNB_id];
*/
fill_CQI(ulsch,meas,eNB_id,harq_pid,ue->frame_parms.N_RB_DL,rnti,tmode,ue->sinr_eff);
//LOG_D(PHY,"UE CQI\n");
// print_CQI(ulsch->o,ulsch->uci_format,eNB_id);
// save PUSCH pmi for later (transmission modes 4,5,6)
// printf("ulsch: saving pmi for DL %x\n",pmi2hex_2Ar1(((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi));
// if (ulsch->uci_format != HLC_subband_cqi_mcs_CBA)
dlsch[0]->harq_processes[harq_pid]->pmi_alloc = ((wideband_cqi_rank1_2A_5MHz *)ulsch->o)->pmi;
}
memcpy(ue->ulsch[eNB_id]->harq_processes[harq_pid]->b,
ulsch_buffer,
ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3);
//memcpy(&UE_transport_info[ue->Mod_id].transport_blocks[UE_transport_info_TB_index[ue->Mod_id]],
memcpy(&UE_transport_info[ue->Mod_id][ue->CC_id].transport_blocks,
ulsch_buffer,
ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3);
//UE_transport_info_TB_index[ue->Mod_id]+=ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3;
// navid: currently more than one eNB is not supported in the code
UE_transport_info[ue->Mod_id][ue->CC_id].num_eNB = 1;
UE_transport_info[ue->Mod_id][ue->CC_id].rnti[0] = ue->pdcch_vars[ue->current_thread_id[subframe_rx]][0]->crnti;
UE_transport_info[ue->Mod_id][ue->CC_id].eNB_id[0] = eNB_id;
UE_transport_info[ue->Mod_id][ue->CC_id].harq_pid[0] = harq_pid;
UE_transport_info[ue->Mod_id][ue->CC_id].tbs[0] = ue->ulsch[eNB_id]->harq_processes[harq_pid]->TBS>>3 ;
// printf("\nue->Mod_id%d\n",ue->Mod_id);
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_flag = 1;
//UE_transport_info[ue->Mod_id].cntl.pusch_uci = *(uint32_t *)ulsch->o;
memcpy(UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_uci,
ulsch->o,
MAX_CQI_BYTES);
// printf("[UE]cqi is %d \n", ((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1);
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.length_uci = ulsch->O;
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.uci_format = ulsch->uci_format;
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ri = (ulsch->o_RI[0]&1)+((ulsch->o_RI[1]&1)<<1);
UE_transport_info[ue->Mod_id][ue->CC_id].cntl.pusch_ack = (ulsch->o_ACK[0]&1) + ((ulsch->o_ACK[1]&1)<<1);
//printf("ack is %d %d %d\n",UE_transport_info[ue->Mod_id].cntl.pusch_ack, (ulsch->o_ACK[1]&1)<<1, ulsch->o_ACK[0]&1);
return(0);
}
#endif
+1 -463
View File
@@ -44,11 +44,6 @@
#include "PHY_INTERFACE/extern.h"
#endif
#ifdef PHY_ABSTRACTION
#include "UTIL/OCG/OCG.h"
#include "UTIL/OCG/OCG_extern.h"
#endif
#include "UTIL/LOG/vcd_signal_dumper.h"
//#define DEBUG_ULSCH_DECODING
@@ -170,6 +165,7 @@ void clean_eNb_ulsch(LTE_eNB_ULSCH_t *ulsch)
//ulsch = (LTE_eNB_ULSCH_t *)malloc16(sizeof(LTE_eNB_ULSCH_t));
if (ulsch) {
ulsch->rnti = 0;
ulsch->harq_mask = 0;
for (i=0; i<8; i++) {
if (ulsch->harq_processes[i]) {
@@ -1604,461 +1600,3 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
return(ret);
}
#ifdef PHY_ABSTRACTION
#ifdef PHY_ABSTRACTION_UL
int ulsch_abstraction(double* sinr_dB, uint8_t TM, uint8_t mcs,uint16_t nrb, uint16_t frb)
{
int index,ii;
double sinr_eff = 0;
int rb_count = 0;
int offset;
double bler = 0;
TM = TM-1;
sinr_eff = sinr_dB[frb]; //the single sinr_eff value we calculated with MMSE FDE formula in init_snr_up function
sinr_eff *= 10;
sinr_eff = floor(sinr_eff);
sinr_eff /= 10;
LOG_D(PHY,"[ABSTRACTION] sinr_eff after rounding = %f\n",sinr_eff);
for (index = 0; index < 16; index++) {
if(index == 0) {
if (sinr_eff < sinr_bler_map_up[mcs][0][index]) {
bler = 1;
break;
}
}
if (sinr_eff == sinr_bler_map_up[mcs][0][index]) {
bler = sinr_bler_map_up[mcs][1][index];
}
}
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
if (uniformrandom() < bler) {
LOG_I(OCM,"abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(0);
} else {
LOG_I(OCM,"abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(1);
}
#endif
}
int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb, uint16_t frb)
{
int index;
double sinr_eff = 0;
double sinr_db1 = 0;
double sinr_db2 = 0;
double SI=0;
double RBIR=0;
int rb_count = 0;
int offset, M=0;
double bler = 0;
int start,middle,end;
TM = TM-1;
for (offset = frb; offset <= (frb + nrb -1); offset++) {
rb_count++;
//we need to do the table lookups here for the mutual information corresponding to the certain sinr_dB.
sinr_db1 = sinr_dB[offset*2];
sinr_db2 = sinr_dB[offset*2+1];
printf("sinr_db1=%f\n,sinr_db2=%f\n",sinr_db1,sinr_db2);
//rounding up for the table lookup
sinr_db1 *= 10;
sinr_db2 *= 10;
sinr_db1 = floor(sinr_db1);
sinr_db2 = floor(sinr_db2);
if ((int)sinr_db1%2) {
sinr_db1 += 1;
}
if ((int)sinr_db2%2) {
sinr_db2 += 1;
}
sinr_db1 /= 10;
sinr_db2 /= 10;
if(mcs<10) {
//for sinr_db1
for (index = 0; index < 162; index++) {
if (sinr_db1 < MI_map_4qam[0][0]) {
SI += (MI_map_4qam[1][0]/beta1_dlsch_MI[TM][mcs]);
M +=2;
break;
}
if (sinr_db1 > MI_map_4qam[0][161]) {
SI += (MI_map_4qam[1][161]/beta1_dlsch_MI[TM][mcs]);
M +=2;
break;
}
if (sinr_db1 == MI_map_4qam[0][index]) {
SI += (MI_map_4qam[1][index]/beta1_dlsch_MI[TM][mcs]);
M +=2;
break;
}
}
//for sinr_db2
for (index = 0; index < 162; index++) {
if (sinr_db2 < MI_map_4qam[0][0]) {
SI += (MI_map_4qam[1][0]/beta1_dlsch_MI[TM][mcs]);
M +=2;
break;
}
if (sinr_db2 > MI_map_4qam[0][161]) {
SI += (MI_map_4qam[1][161]/beta1_dlsch_MI[TM][mcs]);
M +=2;
break;
}
if (sinr_db2 == MI_map_4qam[0][index]) {
SI += (MI_map_4qam[1][index]/beta1_dlsch_MI[TM][mcs]);
M +=2;
break;
}
}
} else if(mcs>9 && mcs<17) {
//for sinr_db1
for (index = 0; index < 197; index++) {
if (sinr_db1 < MI_map_16qam[0][0]) {
SI += (MI_map_16qam[1][0]/beta1_dlsch_MI[TM][mcs]);
M +=4;
break;
}
if (sinr_db1 > MI_map_16qam[0][196]) {
SI += (MI_map_16qam[1][196]/beta1_dlsch_MI[TM][mcs]);
M +=4;
break;
}
if (sinr_db1 == MI_map_16qam[0][index]) {
SI += (MI_map_16qam[1][index]/beta1_dlsch_MI[TM][mcs]);
M +=4;
break;
}
}
//for sinr_db2
for (index = 0; index < 197; index++) {
if (sinr_db2 < MI_map_16qam[0][0]) {
SI += (MI_map_16qam[1][0]/beta1_dlsch_MI[TM][mcs]);
M +=4;
break;
}
if (sinr_db2 > MI_map_16qam[0][196]) {
SI += (MI_map_16qam[1][196]/beta1_dlsch_MI[TM][mcs]);
M +=4;
break;
}
if (sinr_db2 == MI_map_16qam[0][index]) {
SI += (MI_map_16qam[1][index]/beta1_dlsch_MI[TM][mcs]);
M +=4;
break;
}
}
} else if(mcs>16 && mcs<22) {
//for sinr_db1
for (index = 0; index < 227; index++) {
if (sinr_db1 < MI_map_64qam[0][0]) {
SI += (MI_map_64qam[1][0]/beta1_dlsch_MI[TM][mcs]);
M +=6;
break;
}
if (sinr_db1 > MI_map_64qam[0][226]) {
SI += (MI_map_64qam[1][226]/beta1_dlsch_MI[TM][mcs]);
M +=6;
break;
}
if (sinr_db1 == MI_map_64qam[0][index]) {
SI += (MI_map_64qam[1][index]/beta1_dlsch_MI[TM][mcs]);
M +=6;
break;
}
}
//for sinr_db2
for (index = 0; index < 227; index++) {
if (sinr_db2 < MI_map_64qam[0][0]) {
SI += (MI_map_64qam[1][0]/beta1_dlsch_MI[TM][mcs]);
M +=6;
break;
}
if (sinr_db2 > MI_map_64qam[0][226]) {
SI += (MI_map_64qam[1][226]/beta1_dlsch_MI[TM][mcs]);
M +=6;
break;
}
if (sinr_db2 == MI_map_64qam[0][index]) {
SI += (MI_map_64qam[1][index]/beta1_dlsch_MI[TM][mcs]);
M +=6;
break;
}
}
}
}
// }
RBIR = SI/M;
//Now RBIR->SINR_effective Mapping
//binary search method is performed here
if(mcs<10) {
start = 0;
end = 161;
middle = end/2;
if (RBIR <= MI_map_4qam[2][start]) {
sinr_eff = MI_map_4qam[0][start];
} else {
if (RBIR >= MI_map_4qam[2][end])
sinr_eff = MI_map_4qam[0][end];
else {
//while((end-start > 1) && (RBIR >= MI_map_4qam[2]))
if (RBIR < MI_map_4qam[2][middle]) {
end = middle;
middle = end/2;
} else {
start = middle;
middle = (end-middle)/2;
}
}
for (; end>start; end--) {
if ((RBIR < MI_map_4qam[2][end]) && (RBIR > MI_map_4qam[2][end-2])) {
sinr_eff = MI_map_4qam[0][end-1];
break;
}
}
}
sinr_eff = sinr_eff * beta2_dlsch_MI[TM][mcs];
}
else if (mcs>9 && mcs<17) {
start = 0;
end = 196;
middle = end/2;
if (RBIR <= MI_map_16qam[2][start]) {
sinr_eff = MI_map_16qam[0][start];
} else {
if (RBIR >= MI_map_16qam[2][end])
sinr_eff = MI_map_16qam[0][end];
else {
//while((end-start > 1) && (RBIR >= MI_map_4qam[2]))
if (RBIR < MI_map_16qam[2][middle]) {
end = middle;
middle = end/2;
} else {
start = middle;
middle = (end-middle)/2;
}
}
for (; end>start; end--) {
if ((RBIR < MI_map_16qam[2][end]) && (RBIR > MI_map_16qam[2][end-2])) {
sinr_eff = MI_map_16qam[0][end-1];
break;
}
}
}
sinr_eff = sinr_eff * beta2_dlsch_MI[TM][mcs];
} else if (mcs>16) {
start = 0;
end = 226;
middle = end/2;
if (RBIR <= MI_map_64qam[2][start]) {
sinr_eff = MI_map_64qam[0][start];
} else {
if (RBIR >= MI_map_64qam[2][end])
sinr_eff = MI_map_64qam[0][end];
else {
//while((end-start > 1) && (RBIR >= MI_map_4qam[2]))
if (RBIR < MI_map_64qam[2][middle]) {
end = middle;
middle = end/2;
} else {
start = middle;
middle = (end-middle)/2;
}
}
for (; end>start; end--) {
if ((RBIR < MI_map_64qam[2][end]) && (RBIR > MI_map_64qam[2][end-2])) {
sinr_eff = MI_map_64qam[0][end-1];
break;
}
}
}
sinr_eff = sinr_eff * beta2_dlsch_MI[TM][mcs];
}
printf("SINR_Eff = %e\n",sinr_eff);
sinr_eff *= 10;
sinr_eff = floor(sinr_eff);
// if ((int)sinr_eff%2) {
// sinr_eff += 1;
// }
sinr_eff /= 10;
printf("sinr_eff after rounding = %f\n",sinr_eff);
for (index = 0; index < 16; index++) {
if(index == 0) {
if (sinr_eff < sinr_bler_map_up[mcs][0][index]) {
bler = 1;
break;
}
}
if (sinr_eff == sinr_bler_map_up[mcs][0][index]) {
bler = sinr_bler_map_up[mcs][1][index];
}
}
#ifdef USER_MODE // need to be adapted for the emulation in the kernel space
if (uniformrandom() < bler) {
printf("abstraction_decoding failed (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(0);
} else {
printf("abstraction_decoding successful (mcs=%d, sinr_eff=%f, bler=%f)\n",mcs,sinr_eff,bler);
return(1);
}
#endif
}
#endif
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
uint8_t UE_index,
uint16_t *crnti)
{
uint8_t UE_id;
uint16_t rnti;
int subframe = proc->subframe_rx;
uint8_t harq_pid;
uint8_t CC_id = eNB->CC_id;
harq_pid = subframe2harq_pid(&eNB->frame_parms,proc->frame_rx,subframe);
rnti = eNB->ulsch[UE_index]->rnti;
#ifdef DEBUG_PHY
LOG_D(PHY,"[eNB %d] ulsch_decoding_emul : subframe %d UE_index %d harq_pid %d rnti %x\n",eNB->Mod_id,subframe,UE_index,harq_pid,rnti);
#endif
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[PHY_vars_UE_g[UE_id][CC_id]->current_thread_id[subframe]][0]->crnti)
break;
}
if (UE_id==NB_UE_INST) {
LOG_W(PHY,"[eNB %d] ulsch_decoding_emul: FATAL, didn't find UE with rnti %x (UE index %d)\n",
eNB->Mod_id, rnti, UE_index);
return(1+eNB->ulsch[UE_id]->max_turbo_iterations);
} else {
LOG_D(PHY,"[eNB %d] Found UE with rnti %x => UE_id %d\n",eNB->Mod_id, rnti, UE_id);
}
if (PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->harq_processes[harq_pid]->status == CBA_ACTIVE) {
*crnti = rnti;
PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->harq_processes[harq_pid]->status=IDLE;
} else
*crnti = 0x0;
if (1) {
LOG_D(PHY,"ulsch_decoding_emul abstraction successful\n");
memcpy(eNB->ulsch[UE_index]->harq_processes[harq_pid]->b,
PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->harq_processes[harq_pid]->b,
eNB->ulsch[UE_index]->harq_processes[harq_pid]->TBS>>3);
// get local ue's ack
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,
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];
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[1] = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_ACK[1];
}
// Do abstraction of PUSCH feedback
#ifdef DEBUG_PHY
LOG_D(PHY,"[eNB %d][EMUL] ue index %d UE_id %d: subframe %d : o_ACK (%d %d), cqi (val %d, len %d)\n",
eNB->Mod_id,UE_index, UE_id, subframe,eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[0],
eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_ACK[1],
((HLC_subband_cqi_rank1_2A_5MHz *)PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o)->cqi1,
PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->O);
#endif
eNB->ulsch[UE_index]->harq_processes[harq_pid]->Or1 = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->O;
eNB->ulsch[UE_index]->harq_processes[harq_pid]->Or2 = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->O;
eNB->ulsch[UE_index]->harq_processes[harq_pid]->uci_format = PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->uci_format;
memcpy(eNB->ulsch[UE_index]->harq_processes[harq_pid]->o,PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o,MAX_CQI_BYTES);
memcpy(eNB->ulsch[UE_index]->harq_processes[harq_pid]->o_RI,PHY_vars_UE_g[UE_id][CC_id]->ulsch[0]->o_RI,2);
eNB->ulsch[UE_index]->harq_processes[harq_pid]->cqi_crc_status = 1;
return(1);
} else {
LOG_W(PHY,"[eNB %d] ulsch_decoding_emul abstraction failed for UE %d\n",eNB->Mod_id,UE_index);
eNB->ulsch[UE_index]->harq_processes[harq_pid]->cqi_crc_status = 0;
// retransmission
return(1+eNB->ulsch[UE_index]->max_turbo_iterations);
}
}
#endif
@@ -1360,7 +1360,6 @@ void rx_ulsch_emul(PHY_VARS_eNB *eNB,
subframe,harq_pid,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
//#ifndef OAI_EMU
write_output("/tmp/ulsch_d.m","ulsch_dseq",&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) write_output("/tmp/rxsig0.m","rxs0", &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
-4
View File
@@ -23,11 +23,7 @@
#include "PHY/extern.h"
#include "extern.h"
#include "kHz_7_5.h"
#ifdef USER_MODE
#include <math.h>
#else
#include "rtai_math.h"
#endif
#include "PHY/sse_intrin.h"
short conjugate75[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
+4 -4
View File
@@ -1,14 +1,14 @@
lte_dfts_sse4: lte_dfts.c
gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -msse4.1 -g -ggdb -o lte_dfts_sse4 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
lte_dfts_avx2: lte_dfts.c
gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -mavx2 -g -ggdb -o lte_dfts_avx2 lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
lte_dfts_avx2.s: lte_dfts.c
gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -mavx2 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
lte_dfts_sse4.s: lte_dfts.c
gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DUSER_MODE -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
gcc -O2 -msse4.1 -S lte_dfts.c time_meas.c file_output.c ../../SIMULATION/TOOLS/taus.c -I$$OPENAIR1_DIR -I$$OPENAIR_TARGETS -I$$OPENAIR2_DIR/COMMON -DMR_MAIN -DNB_ANTENNAS_RX=1 # -DD256STATS #-DD64STATS
dft_cycles_avx2: lte_dfts_avx2
./lte_dfts_avx2 | egrep cycles
+1 -4
View File
@@ -20,10 +20,7 @@
*/
#include "defs.h"
//#include "MAC_INTERFACE/extern.h"
#ifdef USER_MODE
#include <stdio.h>
#endif
#if defined(__x86_64__) || defined(__i386__)
int16_t conjug[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1} ;
@@ -267,4 +264,4 @@ int multadd_cpx_vector(int16_t *x1,
_mm_empty();
_m_empty();
return(0);
}
}
-16
View File
@@ -34,13 +34,10 @@
#include "PHY/sse_intrin.h"
//defined in rtai_math.h
#ifndef _RTAI_MATH_H
struct complex {
double x;
double y;
};
#endif
struct complexf {
float r;
@@ -286,7 +283,6 @@ void bit8_txmux(int32_t length,int32_t offset);
void bit8_rxdemux(int32_t length,int32_t offset);
#ifdef USER_MODE
/*!\fn int32_t write_output(const char *fname, const char *vname, void *data, int length, int dec, char format);
\brief Write output file from signal data
@param fname output file name
@@ -297,7 +293,6 @@ void bit8_rxdemux(int32_t length,int32_t offset);
@param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit)
*/
int32_t write_output(const char *fname, const char *vname, void *data, int length, int dec, char format);
#endif
void Zero_Buffer(void *,uint32_t);
void Zero_Buffer_nommx(void *buf,uint32_t length);
@@ -361,17 +356,6 @@ int16_t dB_fixed_times10(uint32_t x);
int32_t phy_phase_compensation_top (uint32_t pilot_type, uint32_t initial_pilot,
uint32_t last_pilot, int32_t ignore_prefix);
/*!\fn void phy_phase_compensation (int16_t *ref_sch, int16_t *tgt_sch, int16_t *out_sym, int32_t ignore_prefix, int32_t aa, struct complex16 *perror_out);
This function is used by the EMOS to compensate the phase rotation of the RF. It has been designed for symbols of type CHSCH or SCH, but cannot be used for the data channels.
@param ref_sch reference symbol
@param tgt_sch target symbol
@param out_sym output of the operation
@param ignore_prefix set to 1 if cyclic prefix has not been removed (by the hardware)
@param aa antenna index
@param perror_out phase error (output parameter)
*/
void phy_phase_compensation (int16_t *ref_sch, int16_t *tgt_sch, int16_t *out_sym, int32_t ignore_prefix, int32_t aa, struct complex16 *perror_out );
int32_t dot_product(int16_t *x,
int16_t *y,
uint32_t N, //must be a multiple of 8
-4
View File
@@ -19,8 +19,6 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -180,5 +178,3 @@ int write_output(const char *fname,const char *vname,void *data,int length,int d
return 0;
}
#endif // USER_MODE
-2
View File
@@ -19,11 +19,9 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
#include <stdint.h>
+2
View File
@@ -153,7 +153,9 @@ typedef struct {
/// prach_Config_enabled=1 means enabled. \vr{[0..1]}
uint8_t prach_Config_enabled;
/// PRACH Configuration Information
#ifdef Rel14
PRACH_eMTC_CONFIG_INFO prach_ConfigInfo;
#endif
} PRACH_eMTC_CONFIG_COMMON;
/// Enumeration for parameter \f$N_\text{ANRep}\f$ \ref PUCCH_CONFIG_DEDICATED::repetitionFactor.
-4
View File
@@ -125,10 +125,6 @@
#define FIRST_CARRIER_OFFSET (HALF_NUMBER_OF_USEFUL_CARRIERS+NUMBER_OF_ZERO_CARRIERS)
#define NUMBER_OF_OFDM_SYMBOLS_PER_SLOT (NUMBER_OF_SYMBOLS_PER_FRAME/LTE_SLOTS_PER_FRAME)
#ifdef EMOS
#define EMOS_SCH_INDEX 1
#endif //EMOS
#define EXTENSION_TYPE (PHY_config->PHY_framing.Extension_type)
#define NUMBER_OF_OFDM_CARRIERS_BYTES NUMBER_OF_OFDM_CARRIERS*4
-4
View File
@@ -22,11 +22,7 @@
#ifndef __openair_TYPES_H__
#define __openair_TYPES_H__
#ifdef USER_MODE
#include <stdint.h>
#else
#include <linux/types.h>
#endif
#endif /*__openair_TYPES_H__ */
+4 -3
View File
@@ -208,11 +208,12 @@ void phy_procedures_eNB_S_RX(PHY_VARS_eNB *phy_vars_eNB,eNB_rxtx_proc_t *proc,re
@param phy_vars_eNB Pointer to eNB variables on which to act
@param br_flag indicator for eMTC PRACH
*/
void prach_procedures(PHY_VARS_eNB *eNB,
#ifdef Rel14
int br_flag
void prach_procedures(PHY_VARS_eNB *eNB,
int br_flag);
#else
void prach_procedures(PHY_VARS_eNB *eNB);
#endif
);
/*! \brief Function to compute subframe Number(DL and S) as a function of Frame type and TDD Configuration
@param frame_parms Pointer to DL frame parameter descriptor
-40
View File
@@ -24,40 +24,6 @@
#ifndef __SCHED_EXTERN_H__
#define __SCHED_EXTERN_H__
#ifndef USER_MODE
#define __NO_VERSION__
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <asm/io.h>
#include <asm/bitops.h>
#include <asm/uaccess.h>
#include <asm/segment.h>
#include <asm/page.h>
#ifdef RTAI_ENABLED
#include <rtai.h>
//#include <rtai_posix.h>
#include <rtai_fifos.h>
#include <rtai_sched.h>
#include <rtai_sem.h>
//#include "rt_compat.h"
#else
#include <unistd.h>
#endif
#endif /* USER_MODE */
#include "defs.h"
//#include "dlc_engine.h"
@@ -71,11 +37,5 @@ extern int synch_wait_cnt;
extern int16_t hundred_times_delta_TF[100];
extern uint16_t hundred_times_log10_NPRB[100];
/*
#ifdef EMOS
extern fifo_dump_emos_UE emos_dump_UE;
extern fifo_dump_emos_eNB emos_dump_eNB;
#endif
*/
#endif /*__SCHED_EXTERN_H__ */
+4
View File
@@ -62,6 +62,7 @@ void handle_nfapi_dci_dl_pdu(PHY_VARS_eNB *eNB,
LOG_D(PHY,"Frame %d, Subframe %d: DCI processing - populated pdcch_vars->dci_alloc[%d] proc:subframe_tx:%d idx:%d pdcch_vars->num_dci:%d\n",proc->frame_tx,proc->subframe_tx, pdcch_vars->num_dci, proc->subframe_tx, idx, pdcch_vars->num_dci);
}
#ifdef Rel14
void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc,
nfapi_dl_config_request_pdu_t *dl_config_pdu)
@@ -75,6 +76,7 @@ void handle_nfapi_mpdcch_pdu(PHY_VARS_eNB *eNB,
// copy dci configuration into eNB structure
fill_mdci_and_dlsch(eNB,proc,&mpdcch_vars->mdci_alloc[mpdcch_vars->num_dci],pdu);
}
#endif
void handle_nfapi_hi_dci0_dci_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
nfapi_hi_dci0_request_pdu_t *hi_dci0_config_pdu)
@@ -754,10 +756,12 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
case NFAPI_DL_CONFIG_EPDCCH_DL_PDU_TYPE:
// handle_nfapi_epdcch_pdu(eNB,dl_config_pdu);
break;
#ifdef Rel14
case NFAPI_DL_CONFIG_MPDCCH_PDU_TYPE:
handle_nfapi_mpdcch_pdu(eNB,proc,dl_config_pdu);
eNB->mpdcch_vars[subframe&1].num_dci++;
break;
#endif
}
}
-182
View File
@@ -36,10 +36,6 @@
#include "SCHED/extern.h"
#include "LAYER2/MAC/extern.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
/* SYRTEM */
uint8_t dci_ndi_toggle_even[8] = {0, 0, 0, 0, 0, 0, 0, 0};
uint8_t dci_ndi_toggle_odd[8] = {0, 0, 0, 0, 0, 0, 0, 0};
@@ -733,181 +729,3 @@ void fill_dci(DCI_PDU *DCI_pdu,PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
}
*/
}
void fill_dci_emos(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *eNB)
{
//uint8_t cooperation_flag = eNB->cooperation_flag;
uint8_t transmission_mode = eNB->transmission_mode[0];
//uint32_t rballoc = 0x00F0;
//uint32_t rballoc2 = 0x000F;
/*
uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0))
rand = (rand%5)+5;
else
rand = (rand%4)+5;
*/
DCI_pdu->Num_dci = 0;
switch (subframe) {
case 5:
DCI_pdu->Num_dci = 1;
if (transmission_mode<3) {
//user 1
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1235;
DCI_pdu->dci_alloc[0].format = format1;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE;
DLSCH_alloc_pdu.rballoc = eNB->ue_dl_rb_alloc;
DLSCH_alloc_pdu.TPC = 0;
DLSCH_alloc_pdu.dai = 0;
DLSCH_alloc_pdu.harq_pid = 1;
DLSCH_alloc_pdu.mcs = eNB->target_ue_dl_mcs;
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
/*
//user2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1_5MHz_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1;
DCI_pdu->dci_alloc[1].ra_flag = 0;
DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE;
DLSCH_alloc_pdu.rballoc = rballoc2;
DLSCH_alloc_pdu.TPC = 0;
DLSCH_alloc_pdu.dai = 0;
DLSCH_alloc_pdu.harq_pid = 1;
DLSCH_alloc_pdu.mcs = eNB->target_ue_dl_mcs;
DLSCH_alloc_pdu.ndi = 1;
DLSCH_alloc_pdu.rv = 0;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_TDD_t));
*/
} else if (transmission_mode==5) {
DCI_pdu->Num_dci = 2;
// user 1
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1235;
DCI_pdu->dci_alloc[0].format = format1E_2A_M10PRB;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE;
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
DLSCH_alloc_pdu1E.rv = 0;
DLSCH_alloc_pdu1E.ndi = 1;
DLSCH_alloc_pdu1E.mcs = eNB->target_ue_dl_mcs;
DLSCH_alloc_pdu1E.harq_pid = 1;
DLSCH_alloc_pdu1E.dai = 0;
DLSCH_alloc_pdu1E.TPC = 0;
DLSCH_alloc_pdu1E.rballoc = eNB->ue_dl_rb_alloc;
DLSCH_alloc_pdu1E.rah = 0;
DLSCH_alloc_pdu1E.dl_power_off = 0; //0=second user present
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
//user 2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format1E_2A_M10PRB;
DCI_pdu->dci_alloc[1].ra_flag = 0;
DCI_pdu->dci_alloc[1].search_space = DCI_UE_SPACE;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&DLSCH_alloc_pdu1E,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
// set the precoder of the second UE orthogonal to the first
eNB->UE_stats[1].DL_pmi_single = (eNB->UE_stats[0].DL_pmi_single ^ 0x1555);
}
break;
case 7:
DCI_pdu->Num_dci = 1;
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI1A_5MHz_TDD_1_6_t;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0xbeef;
DCI_pdu->dci_alloc[0].format = format1A;
DCI_pdu->dci_alloc[0].ra_flag = 1;
DCI_pdu->dci_alloc[0].search_space = DCI_COMMON_SPACE;
RA_alloc_pdu.type = 1;
RA_alloc_pdu.vrb_type = 0;
RA_alloc_pdu.rballoc = computeRIV(25,12,3);
RA_alloc_pdu.ndi = 1;
RA_alloc_pdu.rv = 1;
RA_alloc_pdu.mcs = 4;
RA_alloc_pdu.harq_pid = 0;
RA_alloc_pdu.TPC = 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&RA_alloc_pdu,sizeof(DCI1A_5MHz_TDD_1_6_t));
break;
case 9:
DCI_pdu->Num_dci = 1;
//user 1
DCI_pdu->dci_alloc[0].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[0].L = 2;
DCI_pdu->dci_alloc[0].rnti = 0x1235;
DCI_pdu->dci_alloc[0].format = format0;
DCI_pdu->dci_alloc[0].ra_flag = 0;
DCI_pdu->dci_alloc[0].search_space = DCI_UE_SPACE;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
UL_alloc_pdu.rballoc = computeRIV(25,0,eNB->ue_ul_nb_rb);
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
UL_alloc_pdu.cshift = 0;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
/*
//user 2
DCI_pdu->dci_alloc[1].dci_length = sizeof_DCI0_5MHz_TDD_1_6_t ;
DCI_pdu->dci_alloc[1].L = 2;
DCI_pdu->dci_alloc[1].rnti = 0x1236;
DCI_pdu->dci_alloc[1].format = format0;
DCI_pdu->dci_alloc[1].ra_flag = 0;
UL_alloc_pdu.type = 0;
UL_alloc_pdu.hopping = 0;
if (cooperation_flag==0)
UL_alloc_pdu.rballoc = computeRIV(25,2+eNB->ue_ul_nb_rb,eNB->ue_ul_nb_rb);
else
UL_alloc_pdu.rballoc = computeRIV(25,0,eNB->ue_ul_nb_rb);
UL_alloc_pdu.mcs = eNB->target_ue_ul_mcs;
UL_alloc_pdu.ndi = 1;
UL_alloc_pdu.TPC = 0;
if ((cooperation_flag==0) || (cooperation_flag==1))
UL_alloc_pdu.cshift = 0;
else
UL_alloc_pdu.cshift = 1;
UL_alloc_pdu.dai = 0;
UL_alloc_pdu.cqi_req = 1;
memcpy((void*)&DCI_pdu->dci_alloc[1].dci_pdu[0],(void *)&UL_alloc_pdu,sizeof(DCI0_5MHz_TDD_1_6_t));
*/
break;
default:
break;
}
/*
DCI_pdu->nCCE = 0;
for (i=0; i<DCI_pdu->Num_dci; i++) {
DCI_pdu->nCCE += (1<<(DCI_pdu->dci_alloc[i].L));
}
*/
}
-108
View File
@@ -1,108 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __PHY_PROCEDURES_EMOS_H__
#define __PHY_PROCEDURES_EMOS_H__
/*
#ifndef RTAI
typedef uint64_t RTIME;
#else
*/
#ifdef RTAI
#include <rtai.h>
#include <rtai_fifos.h>
#endif
//#include "PHY/TOOLS/defs.h"
#include "PHY/defs.h"
#define CHANSOUNDER_FIFO_SIZE 10485760 // 10 Mbytes FIFO
//#define CHANSOUNDER_FIFO_SIZE 20971520 // 20 Mbytes FIFO
#define CHANSOUNDER_FIFO_MINOR 4 // minor of the FIFO device - this is /dev/rtf3
#define CHANSOUNDER_FIFO_DEV "/dev/rtf4"
#define NUMBER_OF_OFDM_CARRIERS_EMOS 512 // the number of OFDM carriers used for channel sounding
#define NUMBER_OF_USEFUL_CARRIERS_EMOS 300 // the number of OFDM carriers that contain data
#define N_RB_UL_EMOS 25
#define N_PILOTS_DL_EMOS 2 // ofdm symbols with pilots per slot
#define N_PILOTS_UL_EMOS 2 // ofdm symbols with pilots per subframe
#define N_SLOTS_DL_EMOS 2 // we take slots 14,15
#define N_SUBFRAMES_UL_EMOS 1 // we take subframes 4
#define NB_ANTENNAS_TX_EMOS 2
#define NB_ANTENNAS_RX_EMOS 2
struct fifo_dump_emos_struct_UE {
// RX
uint64_t timestamp; //! Timestamp of the receiver
unsigned int frame_tx; //! Framenumber of the TX (encoded in the BCH)
unsigned int frame_rx; //! Framenumber of the RX
UE_MODE_t UE_mode;
PHY_MEASUREMENTS PHY_measurements; //! Structure holding all PHY measurements (one for every slot)
unsigned int pbch_errors; /// Total number of errors on PBCH
unsigned int pbch_errors_last; /// Total number of errors on PBCH 100 frames ago
unsigned int pbch_errors_conseq; /// Total number of consecutive errors on PBCH
unsigned int pbch_fer; /// PBCH FER (in percent)
unsigned int dlsch_errors; /// Total number of error on the DLSCH (data)
unsigned int dlsch_errors_last;
unsigned int dlsch_received;
unsigned int dlsch_received_last;
unsigned int dlsch_fer;
unsigned int dlsch_cntl_errors; /// Total number of error on the DLSCH (control)
unsigned int dlsch_ra_errors; /// Total number of error on the DLSCH (random access)
unsigned int total_TBS;
unsigned int total_TBS_last;
unsigned int bitrate;
unsigned int total_received_bits;
int timing_offset; /// Timing offset
int timing_advance; /// Timing advance
int freq_offset; /// Frequency offset
int use_ia_receiver;
unsigned short pmi_saved;
unsigned short mcs;
unsigned int rx_total_gain_dB; /// Total gain
unsigned char eNb_id; /// eNb_id UE is synched to
unsigned char mimo_mode; /// Transmission mode
#ifdef EMOS_CHANNEL
int channel[NB_ANTENNAS_RX_EMOS][NB_ANTENNAS_TX_EMOS][NUMBER_OF_OFDM_CARRIERS_EMOS*N_PILOTS_DL_EMOS*N_SLOTS_DL_EMOS];
#endif
};
typedef struct fifo_dump_emos_struct_UE fifo_dump_emos_UE;
struct fifo_dump_emos_struct_eNB {
// TX
uint64_t timestamp; //! Timestamp of the receiver
unsigned int frame_tx; //! Framenumber of the TX
unsigned char mimo_mode; /// Transmission mode
// RX
PHY_MEASUREMENTS_eNB PHY_measurements_eNB; /// UL measurements
LTE_eNB_UE_stats eNB_UE_stats[NUMBER_OF_UE_MAX]; /// Contains received feedback
unsigned int rx_total_gain_dB; /// Total gain
#ifdef EMOS_CHANNEL
int channel[NB_ANTENNAS_RX_EMOS][N_RB_UL_EMOS*12*N_PILOTS_UL_EMOS*N_SUBFRAMES_UL_EMOS]; ///UL channel estimate
#endif
};
typedef struct fifo_dump_emos_struct_eNB fifo_dump_emos_eNB;
#endif
+4 -3
View File
@@ -576,11 +576,12 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
}
void prach_procedures(PHY_VARS_eNB *eNB,
#ifdef Rel14
int br_flag
void prach_procedures(PHY_VARS_eNB *eNB,
int br_flag) {
#else
void prach_procedures(PHY_VARS_eNB *eNB) {
#endif
) {
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4];
uint16_t i;
int frame,subframe;
+2 -64
View File
@@ -51,10 +51,6 @@
#include "LAYER2/MAC/defs.h"
#include "UTIL/LOG/log.h"
#ifdef EMOS
fifo_dump_emos_UE emos_dump_UE;
#endif
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
@@ -68,6 +64,8 @@ fifo_dump_emos_UE emos_dump_UE;
#include "T.h"
#include "PHY/TOOLS/defs.h"
#define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs)
#define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs)
@@ -1193,38 +1191,6 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
}
#ifdef EMOS
/*
void phy_procedures_emos_UE_TX(uint8_t next_slot,uint8_t eNB_id) {
uint8_t harq_pid;
if (next_slot%2==0) {
// get harq_pid from subframe relationship
harq_pid = subframe2harq_pid(&ue->frame_parms,ue->frame,(next_slot>>1));
if (harq_pid==255) {
LOG_E(PHY,"[UE%d] Frame %d : FATAL ERROR: illegal harq_pid, returning\n",
0,ue->frame);
return;
}
if (ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag == 1) {
emos_dump_UE.uci_cnt[next_slot>>1] = 1;
memcpy(emos_dump_UE.UCI_data[0][next_slot>>1].o,ulsch[eNB_id]->o,MAX_CQI_BITS*sizeof(char));
emos_dump_UE.UCI_data[0][next_slot>>1].O = ulsch[eNB_id]->O;
memcpy(emos_dump_UE.UCI_data[0][next_slot>>1].o_RI,ulsch[eNB_id]->o_RI,2*sizeof(char));
emos_dump_UE.UCI_data[0][next_slot>>1].O_RI = ulsch[eNB_id]->O_RI;
memcpy(emos_dump_UE.UCI_data[0][next_slot>>1].o_ACK,ulsch[eNB_id]->o_ACK,4*sizeof(char));
emos_dump_UE.UCI_data[0][next_slot>>1].O_ACK = ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK;
}
else {
emos_dump_UE.uci_cnt[next_slot>>1] = 0;
}
}
}
*/
#endif
void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empty_subframe) {
int aa;
@@ -1424,9 +1390,6 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
ue->prach_cnt=0;
#ifdef SMBV
ue->prach_resources[eNB_id]->ra_PreambleIndex = 19;
#endif
#ifdef OAI_EMU
ue->prach_PreambleIndex=ue->prach_resources[eNB_id]->ra_PreambleIndex;
#endif
LOG_I(PHY,"mode %d\n",mode);
@@ -1834,12 +1797,6 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB
}
}
#ifdef PHY_ABSTRACTION
else {
ulsch_encoding_emul(ulsch_input_buffer,ue,eNB_id,proc->subframe_rx,harq_pid,0);
}
#endif
#if UE_TIMING_TRACE
stop_meas(&ue->ulsch_encoding_stats);
#endif
@@ -2390,10 +2347,6 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
start_meas(&ue->phy_proc_tx);
#endif
#ifdef EMOS
//phy_procedures_emos_UE_TX(next_slot);
#endif
ue->tx_power_dBm[subframe_tx]=-127;
@@ -2674,11 +2627,6 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
}
#ifdef EMOS
//emos_dump_UE.frame_tx = frame_tx;
//emos_dump_UE.mimo_mode = ue->pbch_vars[eNB_id]->decoded_output[1];
#endif
if (first_run) {
first_run = 0;
@@ -4676,11 +4624,6 @@ int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *pr
}
#ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,eNB_id);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE
@@ -5160,11 +5103,6 @@ int phy_procedures_UE_RX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,
printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0));
#endif
#ifdef EMOS
phy_procedures_emos_UE_RX(ue,slot,eNB_id);
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
#if UE_TIMING_TRACE
-138
View File
@@ -1,138 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/* Header file for making PLATON work on both RTLinux and RTAI using pthreads
* Copyright Frank Wartena, 2004
* Version: 0.1 January 28th, 2004 ## First version for scheduling test
* 0.2 February 20th, 2004 ## All PLATON functions added
* It is mostly a conversion from RTLinux to RTAI, because PLATON was written
* for RTLinux.
* Not all necessary conversions can be done in this header file, other
* adjustments in the code are also necessary.
*/
#ifndef _RT_COMPAT_H_
#define _RT_COMPAT_H_
#ifdef RTAI_ENABLED
//the conversions from RTLinux to RTAI
//variable for containing times
#define hrtime_t RTIME
//function for making a thread periodic
#define pthread_make_periodic_np(x,y,z) rt_task_make_periodic(x,rt_get_time(),nano2count(z))
//function for printing to the kernel log
#define rtl_printf printk
//function for determining the current cpu
#define rtl_getcpuid hard_cpu_id
//function for initialising a mutex
#define pthread_mutex_init pthread_mutex_init_rt
//function for initialising a mutex attribute
#define pthread_mutexattr_init pthread_mutexattr_init_rt
//function for setting a mutex protocol, does not exist in RTAI
#define pthread_mutexattr_setprotocol(x,y);
//function for locking a mutex
#define pthread_mutex_lock pthread_mutex_lock_rt
//function for unlocking a mutex
#define pthread_mutex_unlock pthread_mutex_unlock_rt
//function for destroying a mutex
#define pthread_mutex_destroy pthread_mutex_destroy_rt
//function for getting the current time
#define clock_gethrtime(x) rt_get_time_ns()
#define gethrtime rt_get_time_ns
//function for initialising a condition
#define pthread_cond_init pthread_cond_init_rt
//function for waiting on a condition
#define pthread_cond_wait pthread_cond_wait_rt
//function for signalling a condition
#define pthread_cond_signal pthread_cond_signal_rt
//function for destroying a condition
#define pthread_cond_destroy pthread_cond_destroy_rt
//function for waking up a thread
#define pthread_wakeup_np rt_task_resume
//function for getting the current thread
#define pthread_self rt_whoami
//function for initialising an attribute
#define pthread_attr_init pthread_attr_init_rt
//function for setting a schedparam
#define pthread_attr_setschedparam pthread_attr_setschedparam_rt
//funcion for setting a schedpolicy
#define pthread_attr_setschedpolicy pthread_attr_setschedpolicy_rt
//function for creating a thread
#define pthread_create pthread_create_rt
//function for cancelling a thread
#define pthread_cancel pthread_cancel_rt
//function for deleting a thread, in RTAI both by calling cancel
#define pthread_delete_np pthread_cancel_rt
//testing if a cpuid exists
#define rtl_cpu_exists(x) x<NR_RT_CPUS
//function for flushing a fifo does not exist in RTAI
#define rtf_flush(x);
//function for setting the stacksize
#define pthread_attr_setstacksize pthread_attr_setstacksize_rt
//function for sleeping the indicated amount in nanoseconds
//#define rtl_delay(x) rt_sleep(nano2count(x))
//#define udelay(x) rt_sleep(nano2count(1000*x))
//#define usleep(x) rt_sleep(nano2count(1000*x))
#define pthread_exit pthread_exit_rt
//function for indicating that a thread uses the FPU
#define pthread_setfp_np rt_task_use_fpu
//function for freeing a soft irq
#define rtl_free_soft_irq(x) rt_free_linux_irq(x,NULL)
//function for triggering a soft irq
#define rtl_global_pend_irq rt_pend_linux_irq
//function for setting the thread scheduling, does not exist in RTAI
#define pthread_setschedparam(x,y,z);
#endif /* RTAI_ENABLED */
#endif /* _RT_COMPAT_H_ */
-4
View File
@@ -38,10 +38,6 @@
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
#include "UTIL/LOG/log.h"
@@ -38,10 +38,7 @@
#include "UTIL/OCG/OCG_extern.h"
#include "UTIL/LOG/log.h"
#ifdef USER_MODE
# include "multicast_link.h"
# include "pgm_link.h"
#endif
#include "multicast_link.h"
char rx_bufferP[BYPASS_RX_BUFFER_SIZE];
unsigned int num_bytesP = 0;
@@ -51,10 +48,6 @@ static unsigned int byte_tx_count;
unsigned int Master_list_rx;
static uint64_t seq_num_tx = 0;
#if defined(ENABLE_PGM_TRANSPORT)
extern unsigned int pgm_would_block;
#endif
mapping transport_names[] = {
{"WAIT PM TRANSPORT INFO", EMU_TRANSPORT_INFO_WAIT_PM},
{"WAIT SM TRANSPORT INFO", EMU_TRANSPORT_INFO_WAIT_SM},
@@ -62,9 +55,6 @@ mapping transport_names[] = {
{"ENB_TRANSPORT INFO", EMU_TRANSPORT_INFO_ENB},
{"UE TRANSPORT INFO", EMU_TRANSPORT_INFO_UE},
{"RELEASE TRANSPORT INFO", EMU_TRANSPORT_INFO_RELEASE},
#if defined(ENABLE_PGM_TRANSPORT)
{"NACK TRANSPORT INFO", EMU_TRANSPORT_NACK},
#endif
{NULL, -1}
};
@@ -79,9 +69,6 @@ void init_bypass (void)
pthread_mutex_init (&emul_low_mutex, NULL);
pthread_cond_init (&emul_low_cond, NULL);
emul_low_mutex_var = 1;
#endif
#if defined(ENABLE_PGM_TRANSPORT)
pgm_oai_init(oai_emulation.info.multicast_ifname);
#endif
bypass_init (emul_tx_handler, emul_rx_handler);
}
@@ -90,10 +77,8 @@ void init_bypass (void)
void bypass_init (tx_handler_t tx_handlerP, rx_handler_t rx_handlerP)
{
/***************************************************************************/
#if defined(USER_MODE)
multicast_link_start (bypass_rx_handler, oai_emulation.info.multicast_group,
oai_emulation.info.multicast_ifname);
#endif //USER_MODE
tx_handler = tx_handlerP;
rx_handler = rx_handlerP;
Master_list_rx=0;
@@ -322,20 +307,12 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
frame, next_slot, is_master);
#if defined(ENABLE_NEW_MULTICAST)
# if defined(ENABLE_PGM_TRANSPORT)
num_bytesP = pgm_recv_msg(oai_emulation.info.multicast_group,
(uint8_t *)&rx_bufferP[0], sizeof(rx_bufferP),
frame, next_slot);
DevCheck(num_bytesP > 0, num_bytesP, 0, 0);
# else
if (multicast_link_read_data_from_sock(is_master) == 1) {
/* We got a timeout */
return -1;
}
# endif
#else
pthread_mutex_lock(&emul_low_mutex);
@@ -363,10 +340,6 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
num_bytesP, map_int_to_str(transport_names, messg->Message_type),
messg->master_id,
messg->seq_num);
#if defined(ENABLE_PGM_TRANSPORT)
if (messg->Message_type != EMU_TRANSPORT_NACK)
#endif
DevCheck4((messg->frame == frame) && (messg->subframe == (next_slot>>1)),
messg->frame, frame, messg->subframe, next_slot>>1);
@@ -409,20 +382,6 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
Master_list_rx = oai_emulation.info.master_list;
LOG_E(EMU, "RX EMU_TRANSPORT_INFO_RELEASE\n");
break;
#if defined(ENABLE_PGM_TRANSPORT)
case EMU_TRANSPORT_NACK:
if (messg->failing_master_id == oai_emulation.info.master_id) {
/* We simply re-send the last message */
pgm_link_send_msg(oai_emulation.info.multicast_group,
(uint8_t *)bypass_tx_buffer, byte_tx_count);
} else {
/* Sleep awhile till other peers have recovered data */
usleep(500);
}
break;
#endif
default:
LOG_E(EMU, "[MAC][BYPASS] ERROR RX UNKNOWN MESSAGE\n");
@@ -448,35 +407,6 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
return bytes_read;
}
/******************************************************************************************************/
#ifndef USER_MODE
int bypass_rx_handler(unsigned int fifo, int rw)
{
/******************************************************************************************************/
int bytes_read;
int bytes_processed=0;
int header_bytes; //, elapsed_time;
//printk("[BYPASS] BYPASS_RX_HANDLER IN...\n");
header_bytes= rtf_get(fifo_bypass_phy_user2kern, rx_bufferP,
sizeof(bypass_proto2multicast_header_t) );
if (header_bytes> 0) {
bytes_read = rtf_get(fifo_bypass_phy_user2kern, &rx_bufferP[header_bytes],
((bypass_proto2multicast_header_t *) (&rx_bufferP[0]))->size);
// printk("BYTES_READ=%d\n",bytes_read);
if (bytes_read > 0) {
num_bytesP=header_bytes+bytes_read;
emul_low_mutex_var=0;
//printk("BYPASS_PHY SIGNAL MAC_LOW...\n");
pthread_cond_signal(&emul_low_cond);
}
}
// }
return 0;
}
#else //USER_MODE
/******************************************************************************************************/
void bypass_rx_handler(unsigned int Num_bytes,char *Rx_buffer)
{
@@ -503,7 +433,6 @@ void bypass_rx_handler(unsigned int Num_bytes,char *Rx_buffer)
#endif
}
}
#endif //USER_MODE
/******************************************************************************************************/
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
@@ -511,57 +440,12 @@ void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
{
/******************************************************************************************************/
if (Master_list_rx != oai_emulation.info.master_list) {
#ifndef USER_MODE
rtf_put(fifo_mac_bypass, &tt, 1);
/* the Rx window is still opened (Re)signal bypass_phy (emulate MAC signal) */
#endif
bypass_rx_data(frame, last_slot, next_slot, is_master);
} else {
Master_list_rx = 0;
}
}
#ifndef USER_MODE
/***************************************************************************/
int multicast_link_write_sock (int groupP, char *dataP, unsigned int sizeP)
{
/***************************************************************************/
int tx_bytes=0;
pthread_mutex_lock(&Tx_mutex);
while(!Tx_mutex_var) {
pthread_cond_wait(&Tx_cond,&Tx_mutex);
}
Tx_mutex_var=0;
N_P=(int)((sizeP-sizeof (bypass_proto2multicast_header_t))/1000)+2;
tx_bytes += rtf_put (fifo_bypass_phy_kern2user, &dataP[tx_bytes],
sizeof (bypass_proto2multicast_header_t));
while(tx_bytes<sizeP) {
if(sizeP-tx_bytes<=1000) {
tx_bytes += rtf_put (fifo_bypass_phy_kern2user, &dataP[tx_bytes],
sizeP-tx_bytes);
} else {
tx_bytes += rtf_put (fifo_bypass_phy_kern2user, &dataP[tx_bytes],1000);
}
}
//RG_tx_mutex_var=0;
pthread_mutex_unlock(&Tx_mutex);
return tx_bytes;
}
#endif
#if defined(ENABLE_PGM_TRANSPORT)
void bypass_tx_nack(unsigned int frame, unsigned int next_slot)
{
bypass_tx_data(NACK_TRANSPORT, frame, next_slot);
}
#endif
/***************************************************************************/
void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int next_slot)
{
@@ -591,26 +475,6 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
byte_tx_count = sizeof (bypass_msg_header_t) + sizeof (
bypass_proto2multicast_header_t);
#if defined(ENABLE_PGM_TRANSPORT)
if (Type == NACK_TRANSPORT) {
int i;
messg->Message_type = EMU_TRANSPORT_NACK;
for (i = 0; i < oai_emulation.info.nb_master; i++) {
/* Skip our id */
if (i == oai_emulation.info.master_id)
continue;
if ((Master_list_rx & (1 << i)) == 0) {
messg->failing_master_id = i;
break;
}
}
LOG_T(EMU,"[TX_DATA] NACK TRANSPORT\n");
} else
#endif
if (Type == WAIT_PM_TRANSPORT) {
messg->Message_type = EMU_TRANSPORT_INFO_WAIT_PM;
LOG_T(EMU,"[TX_DATA] WAIT SYNC PM TRANSPORT\n");
@@ -702,32 +566,11 @@ void bypass_tx_data(emu_transport_info_t Type, unsigned int frame, unsigned int
((bypass_proto2multicast_header_t *) bypass_tx_buffer)->size = byte_tx_count -
sizeof (bypass_proto2multicast_header_t);
#if defined(ENABLE_PGM_TRANSPORT)
pgm_link_send_msg(oai_emulation.info.multicast_group,
(uint8_t *)bypass_tx_buffer, byte_tx_count);
#else
multicast_link_write_sock(oai_emulation.info.multicast_group,
bypass_tx_buffer, byte_tx_count);
#endif
LOG_D(EMU, "Frame %d, subframe %d (%d): Sent %d bytes [%s] with master_id %d and seq %"PRIuMAX"\n",
frame, next_slot>>1, next_slot,byte_tx_count, map_int_to_str(transport_names, Type),
messg->master_id, messg->seq_num);
}
#ifndef USER_MODE
/*********************************************************************************************************************/
int bypass_tx_handler(unsigned int fifo, int rw)
{
/***************************************************************************/
if(++N_R==N_P) {
rtf_reset(fifo_bypass_phy_kern2user);
Tx_mutex_var=1;
N_R=0;
pthread_cond_signal(&Tx_cond);
}
}
#endif
-6
View File
@@ -41,9 +41,6 @@ typedef enum emu_transport_info_e {
EMU_TRANSPORT_INFO_ENB,
EMU_TRANSPORT_INFO_UE,
EMU_TRANSPORT_INFO_RELEASE
#if defined(ENABLE_PGM_TRANSPORT)
,EMU_TRANSPORT_NACK
#endif
} emu_transport_info_t;
#define WAIT_PM_TRANSPORT 1
@@ -52,9 +49,6 @@ typedef enum emu_transport_info_e {
#define ENB_TRANSPORT 4
#define UE_TRANSPORT 5
#define RELEASE_TRANSPORT 6
#if defined(ENABLE_PGM_TRANSPORT)
# define NACK_TRANSPORT 7
#endif
#define WAIT_SYNC_TRANSPORT 1
#define SYNCED_TRANSPORT 2
@@ -40,49 +40,17 @@
#include "UTIL/LOG/log.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "pgm_link.h"
extern unsigned int Master_list_rx;
extern unsigned char NB_INST;
//#define DEBUG_CONTROL 1
//#define DEBUG_EMU 1
#if defined(ENABLE_PGM_TRANSPORT)
extern unsigned int pgm_would_block;
#endif
void emu_transport_sync(void)
{
LOG_D(EMU, "Entering EMU transport SYNC is primary master %d\n",
oai_emulation.info.is_primary_master);
#if defined(ENABLE_PGM_TRANSPORT)
if (oai_emulation.info.is_primary_master == 0) {
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
// just wait to recieve the master 0 msg
Master_list_rx = oai_emulation.info.master_list - 1;
bypass_rx_data(0,0,0,1);
} else {
bypass_rx_data(0,0,0,0);
bypass_tx_data(WAIT_PM_TRANSPORT,0,0);
}
if (oai_emulation.info.master_list != 0) {
bypass_tx_data(SYNC_TRANSPORT,0,0);
bypass_rx_data(0,0,0,0);
// i received the sync from all secondary masters
if (emu_rx_status == SYNCED_TRANSPORT) {
emu_tx_status = SYNCED_TRANSPORT;
}
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
}
#else
if (oai_emulation.info.is_primary_master == 0) {
retry:
bypass_tx_data(WAIT_SM_TRANSPORT,0,0);
@@ -115,8 +83,6 @@ retry2:
LOG_D(EMU,"TX secondary master SYNC_TRANSPORT state \n");
}
#endif
LOG_D(EMU, "Leaving EMU transport SYNC is primary master %d\n",
oai_emulation.info.is_primary_master);
}
@@ -154,9 +120,6 @@ void emu_transport(unsigned int frame, unsigned int last_slot,
}
}
#if defined(ENABLE_PGM_TRANSPORT)
pgm_would_block = 0;
#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(
VCD_SIGNAL_DUMPER_FUNCTIONS_EMU_TRANSPORT, VCD_FUNCTION_OUT);
}
@@ -31,11 +31,7 @@
#ifndef __BYPASS_SESSION_LAYER_EXTERN_H__
# define __BYPASS_SESSION_LAYER_EXTERN_H__
#ifndef USER_MODE
#include <rtai_posix.h>
#else
#include <pthread.h>
#endif //RTAI_ENABLED
extern unsigned char Emulation_status;
extern unsigned char emu_tx_status;
@@ -54,9 +54,7 @@
#include "socket.h"
#include "multicast_link.h"
#ifdef USER_MODE
# include "UTIL/LOG/log.h"
#endif //USER_MODE
#include "UTIL/LOG/log.h"
extern unsigned short Master_id;
@@ -316,9 +314,7 @@ void multicast_link_start(void (*rx_handlerP) (unsigned int, char *),
LOG_I(EMU, "[MULTICAST] LINK START on interface=%s for group=%d: handler=%p\n",
(multicast_if == NULL) ? "not specified" : multicast_if, multicast_group,
rx_handler);
#if !defined(ENABLE_PGM_TRANSPORT)
multicast_link_init ();
#endif
#if ! defined(ENABLE_NEW_MULTICAST)
LOG_D(EMU, "[MULTICAST] multicast link start thread\n");
@@ -1,417 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file pgm_link.c
* \brief implementation a warpper for openpgm for reliable multicast transmission
* \author Navid Nikaein and S. Roux
* \date 2013 - 2014
* \version 1.0
* \company Eurecom
* \email: navid.nikaein@eurecom.fr
*/
#include <pthread.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <arpa/inet.h>
#if defined(ENABLE_PGM_TRANSPORT)
#include <pgm/pgm.h>
#include "assertions.h"
#include "pgm_link.h"
#include "multicast_link.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OCG/OCG_extern.h"
#include "UTIL/LOG/log.h"
// #define ENABLE_PGM_DEBUG
typedef struct {
pgm_sock_t *sock;
uint16_t port;
uint8_t rx_buffer[40000];
} pgm_multicast_group_t;
pgm_multicast_group_t pgm_multicast_group[MULTICAST_LINK_NUM_GROUPS];
static
int pgm_create_socket(int index, const char *if_addr);
unsigned int pgm_would_block = 1;
#if defined(ENABLE_PGM_DEBUG)
static void
log_handler (
const int log_level,
const char* message,
void* closure
)
{
printf("%s\n", message);
}
#endif
int pgm_oai_init(char *if_addr)
{
pgm_error_t* pgm_err = NULL;
memset(pgm_multicast_group, 0,
MULTICAST_LINK_NUM_GROUPS * sizeof(pgm_multicast_group_t));
#if defined(ENABLE_PGM_DEBUG)
pgm_messages_init();
pgm_min_log_level = PGM_LOG_LEVEL_DEBUG;
pgm_log_mask = 0xFFF;
pgm_log_set_handler(log_handler, NULL);
#endif
if (!pgm_init(&pgm_err)) {
LOG_E(EMU, "Unable to start PGM engine: %s\n", pgm_err->message);
pgm_error_free (pgm_err);
exit(EXIT_FAILURE);
}
return pgm_create_socket(oai_emulation.info.multicast_group, if_addr);
}
int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
unsigned int frame, unsigned int next_slot)
{
size_t num_bytes = 0;
int status = 0;
pgm_error_t* pgm_err = NULL;
struct pgm_sockaddr_t from;
socklen_t fromlen = sizeof(from);
uint32_t timeout = 0;
int flags = 0;
if (pgm_would_block == 0) {
flags = MSG_DONTWAIT;
}
DevCheck((group <= MULTICAST_LINK_NUM_GROUPS) && (group >= 0),
group, MULTICAST_LINK_NUM_GROUPS, 0);
#ifdef DEBUG_EMU
LOG_I(EMU, "[PGM] Entering recv function for group %d\n", group);
#endif
do {
status = pgm_recvfrom(pgm_multicast_group[group].sock,
buffer,
length,
flags,
&num_bytes,
&from,
&fromlen,
&pgm_err);
if (PGM_IO_STATUS_NORMAL == status) {
#ifdef DEBUG_EMU
LOG_D(EMU, "[PGM] Received %d bytes for group %d\n", num_bytes, group);
#endif
return num_bytes;
} else if (PGM_IO_STATUS_TIMER_PENDING == status) {
if (pgm_would_block == 0) {
/* We sleep for 50 usec */
usleep(50);
timeout ++;
if (timeout == (1000000 / 50)) {
LOG_W(EMU, "[PGM] A packet has been lost -> ask for retransmit\n");
/* If we do not receive a packet after 10000usec
* -> send a NACK */
bypass_tx_nack(frame, next_slot);
timeout = 0;
}
}
} else if (PGM_IO_STATUS_RESET == status) {
LOG_W(EMU, "[PGM] Got session reset\n");
} else {
#ifdef DEBUG_EMU
LOG_D(EMU, "[PGM] Got status %d\n", status);
#endif
if (pgm_err) {
LOG_E(EMU, "[PGM] recvform failed: %s", pgm_err->message);
pgm_error_free (pgm_err);
pgm_err = NULL;
}
}
} while(status != PGM_IO_STATUS_NORMAL);
return -1;
}
int pgm_link_send_msg(int group, uint8_t *data, uint32_t len)
{
int status;
size_t bytes_written = 0;
do {
status = pgm_send(pgm_multicast_group[group].sock, data, len, &bytes_written);
} while(status == PGM_IO_STATUS_WOULD_BLOCK);
if (status != PGM_IO_STATUS_NORMAL) {
return -1;
}
return bytes_written;
}
static
int pgm_create_socket(int index, const char *if_addr)
{
struct pgm_addrinfo_t* res = NULL;
pgm_error_t* pgm_err = NULL;
sa_family_t sa_family = AF_INET;
int udp_encap_port = 46014 + index;
int max_tpdu = 1500;
int sqns = 100;
int port = 0;
struct pgm_sockaddr_t addr;
int blocking = 1;
int multicast_loop = 0;
int multicast_hops = 0;
int dscp, i;
port = udp_encap_port;
/* Use PGM */
udp_encap_port = 0;
LOG_D(EMU, "[PGM] Preparing socket for group %d and address %s\n",
index, if_addr);
if (!pgm_getaddrinfo(if_addr, NULL, &res, &pgm_err)) {
LOG_E(EMU, "Parsing network parameter: %s\n", pgm_err->message);
goto err_abort;
}
if (udp_encap_port) {
LOG_I(EMU, "[PGM] Creating PGM/UDP socket for encapsulated port %d\n",
udp_encap_port);
if (!pgm_socket (&pgm_multicast_group[index].sock, sa_family,
SOCK_SEQPACKET, IPPROTO_UDP, &pgm_err)) {
LOG_E(EMU, "[PGM] Socket: %s\n", pgm_err->message);
goto err_abort;
}
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_UDP_ENCAP_UCAST_PORT, &udp_encap_port,
sizeof(udp_encap_port));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_UDP_ENCAP_MCAST_PORT, &udp_encap_port,
sizeof(udp_encap_port));
} else {
LOG_I(EMU, "[PGM] Creating PGM/IP socket\n");
if (!pgm_socket(&pgm_multicast_group[index].sock, sa_family,
SOCK_SEQPACKET, IPPROTO_PGM, &pgm_err)) {
LOG_E(EMU, "Creating PGM/IP socket: %s\n", pgm_err->message);
goto err_abort;
}
}
{
/* Use RFC 2113 tagging for PGM Router Assist */
const int no_router_assist = 0;
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_IP_ROUTER_ALERT, &no_router_assist,
sizeof(no_router_assist));
}
// pgm_drop_superuser();
{
/* set PGM parameters */
const int recv_only = 0,
passive = 0,
peer_expiry = pgm_secs (300),
spmr_expiry = pgm_msecs (250),
nak_bo_ivl = pgm_msecs (10),
nak_rpt_ivl = pgm_secs (2),
nak_rdata_ivl = pgm_secs (2),
nak_data_retries = 50,
nak_ncf_retries = 50,
ambient_spm = pgm_secs(30);
const int heartbeat_spm[] = {
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (100),
pgm_msecs (1300),
pgm_secs (7),
pgm_secs (16),
pgm_secs (25),
pgm_secs (30)
};
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_RECV_ONLY, &recv_only, sizeof(recv_only));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_PASSIVE, &passive, sizeof(passive));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MTU, &max_tpdu, sizeof(max_tpdu));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_RXW_SQNS, &sqns, sizeof(sqns));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_PEER_EXPIRY, &peer_expiry, sizeof(peer_expiry));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_SPMR_EXPIRY, &spmr_expiry, sizeof(spmr_expiry));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_BO_IVL, &nak_bo_ivl, sizeof(nak_bo_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_RPT_IVL, &nak_rpt_ivl, sizeof(nak_rpt_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_RDATA_IVL, &nak_rdata_ivl, sizeof(nak_rdata_ivl));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_DATA_RETRIES, &nak_data_retries, sizeof(nak_data_retries));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_NAK_NCF_RETRIES, &nak_ncf_retries, sizeof(nak_ncf_retries));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_AMBIENT_SPM, &ambient_spm, sizeof(ambient_spm));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_HEARTBEAT_SPM, &heartbeat_spm, sizeof(heartbeat_spm));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_TXW_SQNS, &sqns, sizeof(sqns));
}
/* create global session identifier */
memset (&addr, 0, sizeof(addr));
/* sa_port should be in host byte order */
addr.sa_port = port;
addr.sa_addr.sport = DEFAULT_DATA_SOURCE_PORT + index;
if (!pgm_gsi_create_from_hostname(&addr.sa_addr.gsi, &pgm_err)) {
LOG_E(EMU, "[PGM] Creating GSI: %s\n", pgm_err->message);
goto err_abort;
}
LOG_D(EMU, "[PGM] Created GSI %s\n", pgm_tsi_print(&addr.sa_addr));
/* assign socket to specified address */
{
struct pgm_interface_req_t if_req;
memset (&if_req, 0, sizeof(if_req));
if_req.ir_interface = res->ai_recv_addrs[0].gsr_interface;
if_req.ir_scope_id = 0;
if (AF_INET6 == sa_family) {
struct sockaddr_in6 sa6;
memcpy (&sa6, &res->ai_recv_addrs[0].gsr_group, sizeof(sa6));
if_req.ir_scope_id = sa6.sin6_scope_id;
}
if (!pgm_bind3(pgm_multicast_group[index].sock, &addr, sizeof(addr),
&if_req, sizeof(if_req), /* tx interface */
&if_req, sizeof(if_req), /* rx interface */
&pgm_err)) {
LOG_E(EMU, "[PGM] Error: %s\n", pgm_err->message);
goto err_abort;
}
}
/* join IP multicast groups */
{
struct group_req req;
struct sockaddr_in addr_in;
memset(&req, 0, sizeof(req));
/* Interface index */
req.gr_interface = res->ai_recv_addrs[0].gsr_interface;
addr_in.sin_family = AF_INET;
addr_in.sin_port = htons(port);
for (i = 0; i < MULTICAST_LINK_NUM_GROUPS; i++) {
addr_in.sin_addr.s_addr = inet_addr(multicast_group_list[i]);
memcpy(&req.gr_group, &addr_in, sizeof(addr_in));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_JOIN_GROUP, &req,
sizeof(struct group_req));
}
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_SEND_GROUP, &req,
sizeof(struct group_req));
}
pgm_freeaddrinfo(res);
res = NULL;
/* set IP parameters */
multicast_hops = 64;
dscp = 0x2e << 2; /* Expedited Forwarding PHB for network elements, no ECN. */
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MULTICAST_LOOP, &multicast_loop, sizeof(multicast_loop));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM,
PGM_MULTICAST_HOPS, &multicast_hops, sizeof(multicast_hops));
if (AF_INET6 != sa_family)
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM, PGM_TOS,
&dscp, sizeof(dscp));
pgm_setsockopt(pgm_multicast_group[index].sock, IPPROTO_PGM, PGM_NOBLOCK,
&blocking, sizeof(blocking));
if (!pgm_connect(pgm_multicast_group[index].sock, &pgm_err)) {
LOG_E(EMU, "[PGM] Connecting socket: %s\n", pgm_err->message);
goto err_abort;
}
return 0;
err_abort:
if (NULL != pgm_multicast_group[index].sock) {
pgm_close(pgm_multicast_group[index].sock, FALSE);
pgm_multicast_group[index].sock = NULL;
}
if (NULL != res) {
pgm_freeaddrinfo(res);
res = NULL;
}
if (NULL != pgm_err) {
pgm_error_free(pgm_err);
pgm_err = NULL;
}
exit(EXIT_FAILURE);
}
#endif
@@ -1,38 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef PGM_LINK_H_
#define PGM_LINK_H_
/* Define prototypes only if enabled */
#if defined(ENABLE_PGM_TRANSPORT)
void bypass_tx_nack(unsigned int frame, unsigned int next_slot);
int pgm_oai_init(char *if_name);
int pgm_recv_msg(int group, uint8_t *buffer, uint32_t length,
unsigned int frame, unsigned int next_slot);
int pgm_link_send_msg(int group, uint8_t *data, uint32_t len);
#endif
#endif /* PGM_LINK_H_ */
@@ -39,14 +39,6 @@ int bypass_rx_data(unsigned int frame, unsigned int last_slot,
unsigned int next_slot, uint8_t is_master);
void bypass_signal_mac_phy(unsigned int frame, unsigned int last_slot,
unsigned int next_slot, uint8_t is_master);
#ifndef USER_MODE
int multicast_link_write_sock (int groupP, char *dataP, unsigned int sizeP);
int bypass_tx_handler(unsigned int fifo, int rw);
int bypass_rx_handler(unsigned int fifo, int rw);
#else
void bypass_rx_handler(unsigned int Num_bytes,char *Rx_buffer);
#endif
void bypass_tx_data (emu_transport_info_t Type, unsigned int frame, unsigned int next_slot);
void emulation_tx_rx(void);
@@ -41,9 +41,7 @@
//#include "openair_defs.h"
#include "socket.h"
#ifdef USER_MODE
#define msg printf
#endif
//------------------------------------------------------------------------------
void
socket_setnonblocking (int sockP)
-4
View File
@@ -28,11 +28,7 @@
* \email: navid.nikaein@eurecom.fr
*/
#ifndef USER_MODE
#include <rtai_posix.h>
#else
#include <pthread.h>
#endif
#include "defs.h"
#ifndef __BYPASS_SESSION_LAYER_VARS_H__
-202
View File
@@ -1,202 +0,0 @@
include $(OPENAIR_DIR)/common/utils/Makefile.inc
COMMON_UTILS_DIR = $(OPENAIR_DIR)/common/utils
TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3 = $(OPENAIR3_DIR)
CFLAGS += -DMAX_NUM_CCs=1 -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -DMALLOC_CHECK_=1 -DENABLE_VCD_FIFO -DLOG_NO_THREAD # -Wno-packed-bitfield-compat
# enable C99 mode
CFLAGS += -std=gnu99
# DCI Debug
# CFLAGS += -DDEBUG_DCI_ENCODING
# TODO: only for framegen
#CFLAGS += -DOPENAIR2
#CFLAGS += -DDEBUG_PHY_PROC
#CFLAGS += -DDEBUG_GROUPHOP
ifdef OMP
CFLAGS += -DOMP -fopenmp
endif
ifdef LLR8
CFLAGS += -DLLR8
endif
CFLAGS += -DNEW_FFT
LFLAGS = -lm -lblas -lxml2 -lrt -lpthread $(LFDS_DIR)/bin/liblfds611.a
ifdef GPIB
LFLAGS += -lgpib
endif
CFLAGS += -DOPENAIR_LTE #-DOFDMA_ULSCH #-DIFFT_FPGA -DIFFT_FPGA_UE
#CFLAGS += -DTBS_FIX
CFLAGS += -DCELLULAR
ASN1_MSG_INC = $(OPENAIR2_DIR)/RRC/LITE/MESSAGES
ifdef EMOS
CFLAGS += -DEMOS
endif
ifdef DEBUG_PHY
CFLAGS += -DDEBUG_PHY
endif
ifdef MeNBMUE
CFLAGS += -DMeNBMUE
endif
ifdef MU_RECEIVER
CFLAGS += -DMU_RECEIVER
endif
ifdef ZBF_ENABLED
CFLAGS += -DNULL_SHAPE_BF_ENABLED
endif
ifdef RANDOM_BF
CFLAGS += -DRANDOM_BF
endif
ifdef PBS_SIM
CFLAGS += -DPBS_SIM
endif
ifdef XFORMS
CFLAGS += -DXFORMS
LFLAGS += -lforms
endif
ifdef SMBV
CFLAGS += -DSMBV
endif
ifdef PERFECT_CE
CFLAGS += -DPERFECT_CE
endif
ifdef BIT8_TX
CFLAGS += -DBIT8_TX
endif
CFLAGS += -DNO_RRM -DOPENAIR1 -DPHY_ABSTRACTION #-DOPENAIR2
CFLAGS += -I/usr/include/X11 -I/usr/X11R6/include
ifdef RTAI
CFLAGS += -DRTAI_ENABLED -D__IN_RTAI__ $(shell rtai-config --lxrt-cflags)
LFLAGS += $(shell rtai-config --lxrt-ldflags) -llxrt
endif
include $(COMMON_UTILS_DIR)/Makefile.inc
include $(TOP_DIR)/PHY/Makefile.inc
include $(TOP_DIR)/SCHED/Makefile.inc
include $(TOP_DIR)/SIMULATION/Makefile.inc
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
#LOG_OBJS += $(LOG_DIR)/vcd_signal_dumper.o
CFLAGS += $(L2_incl) -I$(ASN1_MSG_INC) -I$(TOP_DIR) -I$(OPENAIR2_DIR) -I$(OPENAIR3) $(UTIL_incl) $(UTILS_incl)
# EXTRA_CFLAGS =
#STATS_OBJS += $(TOP_DIR)/ARCH/CBMIMO1/DEVICE_DRIVER/cbmimo1_proc.o
#LAYER2_OBJ += $(OPENAIR2_DIR)/LAYER2/MAC/rar_tools.o
#LAYER2_OBJ = $(OPENAIR2_DIR)/LAYER2/MAC/lte_transport_init.o
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(LAYER2_OBJ) $(LOG_OBJS) $(ITTI_DIR)/backtrace.o
ifdef GPIB
OBJ += LTE_Configuration.o
endif
#OBJ2 = $(PHY_OBJS) $(SIMULATION_OBJS) $(TOOLS_OBJS)
ifdef XFORMS
OBJ += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
endif
ifdef STATIC
LFLAGS += -static -L/usr/lib/libblas
endif
all: dlsim pbchsim pdcchsim ulsim pucchsim prachsim mbmssim scansim
$(LFDS_DIR)/bin/liblfds611.a:
$(MAKE) -C $(LFDS_DIR) -f makefile.linux
test: $(SIMULATION_OBJS) $(TOOLS_OBJS) $(TOP_DIR)/PHY/INIT/lte_init.o test.c
$(CC) test.c -I$(TOP_DIR) -o test $(CFLAGS) $(SIMULATION_OBJS) $(TOOLS_OBJS) -lm
OBJ += $(LIST_OBJ)
OBJ += $(MEM_OBJ)
$(OBJ) : %.o : %.c
@echo Compiling $< ...
@$(CC) -c $(CFLAGS) -o $@ $<
dlsim : $(OBJ) dlsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling dlsim.c ..."
@$(CC) dlsim.c -o dlsim $(CFLAGS) $(OBJ) $(LFLAGS)
dlsim2 : $(OBJ) dlsim2.c
@echo "Compiling dlsim2.c ..."
@$(CC) dlsim2.c -o dlsim2 $(CFLAGS) $(OBJ) $(LFLAGS)
framegen: $(OBJ) framegen.c
@echo "Compiling framegen.c"
@$(CC) framegen.c -o framegen $(CFLAGS) $(OBJ) $(LFLAGS)
pbchsim : $(OBJ) pbchsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling pbchsim.c"
@$(CC) pbchsim.c -o pbchsim $(CFLAGS) $(OBJ) $(LFLAGS)
scansim : $(OBJ) scansim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling scansim.c"
@$(CC) scansim.c -o scansim $(CFLAGS) $(OBJ) $(LFLAGS)
mbmssim : $(OBJ) mbmssim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling mbmssim.c"
@$(CC) mbmssim.c -o mbmssim $(CFLAGS) $(OBJ) $(LFLAGS)
pdcchsim : $(OBJ) pdcchsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling pdcchsim.c"
@$(CC) pdcchsim.c -o pdcchsim $(CFLAGS) $(OBJ) $(LFLAGS)
pucchsim : $(OBJ) pucchsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling pucchsim.c"
@$(CC) pucchsim.c -o pucchsim $(CFLAGS) $(OBJ) $(LFLAGS)
prachsim : $(OBJ) prachsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling prachsim.c"
@$(CC) prachsim.c -o prachsim $(CFLAGS) $(OBJ) $(LFLAGS)
ulsim : $(OBJ) ulsim.c $(LFDS_DIR)/bin/liblfds611.a #ulsim_form.c
@echo "Compiling [ulsim.c]"
@$(CC) ulsim.c -o ulsim $(CFLAGS) $(OBJ) $(LFLAGS)
syncsim : $(OBJ) syncsim.c $(LFDS_DIR)/bin/liblfds611.a
@echo "Compiling syncsim.c"
@$(CC) syncsim.c -o syncsim $(CFLAGS) $(OBJ) $(LFLAGS)
clean :
rm -f $(OBJ)
rm -f *.o
cleanall : clean
rm -f dlsim pbchsim pdcchsim ulsim pucchsim mbmssim prachsim
rm -f *.exe*
showflags :
@echo $(CFLAGS)
@echo $(LFLAGS)
showobj:
@echo $(SCHED_OBJS)
cppcheck:
@echo "cppcheck ..."
cppcheck $(INCLUDES) ${OBJ:.o=.c} ${OAISIM_OBJS,.o=.c} ${ASN1_RRC_MSG_OBJS1,.o=.c}
-3
View File
@@ -31,9 +31,6 @@
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
-6
View File
@@ -32,9 +32,6 @@
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
@@ -91,9 +88,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0;
int8_t interf1=-21,interf2=-21;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
FILE *input_fd=NULL,*pbch_file_fd=NULL;
char input_val_str[50],input_val_str2[50];
-3
View File
@@ -28,9 +28,6 @@
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
-7
View File
@@ -27,9 +27,6 @@
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
@@ -76,10 +73,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0;
// int8_t interf1=-19,interf2=-19;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
SCM_t channel_model=Rayleigh1;
-6
View File
@@ -27,9 +27,6 @@
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
@@ -77,9 +74,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
SCM_t channel_model=Rayleigh1_corr;
-6
View File
@@ -33,9 +33,6 @@
#include "PHY/vars.h"
#include "MAC_INTERFACE/vars.h"
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "LAYER2/MAC/vars.h"
@@ -91,9 +88,6 @@ int main(int argc, char **argv)
uint32_t nsymb,tx_lev,tx_lev1,tx_lev2;
uint8_t extended_prefix_flag=0;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
FILE *input_fd=NULL,*pbch_file_fd=NULL;
char input_val_str[50],input_val_str2[50];
-45
View File
@@ -30,11 +30,6 @@
#include <sys/ioctl.h>
#include <sys/mman.h>
#ifdef RTAI_ENABLED
#include <rtai_mbx.h>
#include <rtai_msg.h>
#endif
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "PHY/types.h"
@@ -44,9 +39,6 @@
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "ARCH/CBMIMO1/DEVICE_DRIVER/vars.h"
@@ -381,9 +373,6 @@ int main(int argc, char **argv)
uint8_t extended_prefix_flag=0,frame_type=1;
int8_t interf1=-21,interf2=-21;
LTE_DL_FRAME_PARMS *frame_parms;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
FILE *input_fd=NULL,*pbch_file_fd=NULL;
char input_val_str[50],input_val_str2[50];
@@ -430,13 +419,6 @@ int main(int argc, char **argv)
int rx_offset_mod;
#ifdef RTAI_ENABLED
int period;
RTIME expected;
RT_TASK *task;
#define PERIOD 1000000000
#endif
logInit();
number_of_cards = 1;
@@ -694,23 +676,6 @@ int main(int argc, char **argv)
}
}
#ifdef RTAI_ENABLED
if (!(task = rt_task_init_schmod(nam2num("SYNCSIM"), 0, 0, 0, SCHED_FIFO, 0xF))) {
printf("CANNOT INIT MASTER TASK\n");
exit(1);
}
rt_set_periodic_mode();
period = start_rt_timer(nano2count(PERIOD));
mlockall(MCL_CURRENT | MCL_FUTURE);
rt_make_hard_real_time();
rt_task_make_periodic(task, expected = rt_get_time() + 10*period, period);
#endif
#ifdef XFORMS
if (do_forms==1) {
@@ -1374,11 +1339,6 @@ int main(int argc, char **argv)
for (trial=0; trial<n_frames; trial++) {
#ifdef RTAI_ENABLED
ret = rt_task_wait_period();
printf("rt_task_wait_period() returns %d, time %llu\n",ret, rt_get_time());
#endif
if (oai_hw_input == 0) {
if (awgn_flag == 0) {
@@ -1752,11 +1712,6 @@ int main(int argc, char **argv)
ioctl(openair_fd,openair_START_TX_SIG,(void *)NULL);
}
#ifdef RTAI_ENABLED
rt_make_soft_real_time();
rt_task_delete(task);
#endif
#ifdef XFORMS
if (do_forms==1) {
-9
View File
@@ -30,9 +30,6 @@
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#ifdef EMOS
#include "SCHED/phy_procedures_emos.h"
#endif
#define BW 10.0
#define Td 1.0
@@ -69,12 +66,6 @@ int main(int argc, char **argv)
double ip =0.0;
double N0W, path_loss, path_loss_dB;
#ifdef EMOS
fifo_dump_emos emos_dump;
#endif
if (argc>1)
sigma2_dB = atoi(argv[1]);
+1 -1
View File
@@ -1,6 +1,6 @@
include $(OPENAIR_DIR)/common/utils/Makefile.inc
OBJS = rf.o ../../PHY/TOOLS/file_output.o ../TOOLS/rangen_double.o
CFLAGS += -DRF_MAIN -DUSER_MODE -DDEBUG_PHY
CFLAGS += -DRF_MAIN -DDEBUG_PHY
all: $(OBJS)
gcc -o rf $(OBJS) -lm
@@ -19,12 +19,10 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>
#endif
#include "defs.h"
-26
View File
@@ -19,18 +19,8 @@
* contact@openairinterface.org
*/
#ifdef USER_MODE
#include <time.h>
#include <stdlib.h>
#else
#include <asm/io.h>
#include <asm/rtai.h>
#endif
#ifdef RTAI_ENABLED
#include <rtai.h>
#include <rtai_sched.h>
#define time(x) (unsigned int)(rt_get_time_ns())
#endif
unsigned int s0, s1, s2, b;
@@ -55,21 +45,14 @@ unsigned int taus(void)
void set_taus_seed(unsigned int seed_init)
{
#ifdef USER_MODE
struct drand48_data buffer;
unsigned long result = 0;
#endif
if (seed_init == 0) {
s0 = (unsigned int)time(NULL);
s1 = (unsigned int)time(NULL);
s2 = (unsigned int)time(NULL);
} else {
#ifndef USER_MODE
s0 = (unsigned int)0x1e23d852;
s1 = (unsigned int)0x81f38a1c;
s2 = (unsigned int)0xfe1a133e;
#else
/* Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
srand48_r((long int)seed_init, &buffer);
mrand48_r(&buffer, (long int *)&result);
@@ -78,7 +61,6 @@ void set_taus_seed(unsigned int seed_init)
s1 = result;
mrand48_r(&buffer, (long int *)&result);
s2 = result;
#endif
}
}
#endif
@@ -87,10 +69,8 @@ void set_taus_seed(unsigned int seed_init)
void set_taus_seed(unsigned int seed_init)
{
#ifdef USER_MODE
struct drand48_data buffer;
unsigned long result = 0;
#endif
s0 = (unsigned int)0x1e23d852;
s1 = (unsigned int)0x81f38a1c;
s2 = (unsigned int)0xfe1a133e;
@@ -102,11 +82,6 @@ void set_taus_seed(unsigned int seed_init)
s1 = (unsigned int)time(NULL);
s2 = (unsigned int)time(NULL);
} else {
#ifndef USER_MODE
s0 = (unsigned int)0x1e23d852;
s1 = (unsigned int)0x81f38a1c;
s2 = (unsigned int)0xfe1a133e;
#else
// Use reentrant version of rand48 to ensure that no conflicts with other generators occur */
srand48_r((long int)seed_init, &buffer);
mrand48_r(&buffer, (long int *)&result);
@@ -115,7 +90,6 @@ void set_taus_seed(unsigned int seed_init)
s1 = result;
mrand48_r(&buffer, (long int *)&result);
s2 = result;
#endif
}
}
#endif
-8
View File
@@ -244,9 +244,7 @@ typedef struct {
LCHAN_DESC Lchan_desc[2]; /*!< \brief Logical Channel QoS Descriptor (MAC component) */
uint8_t L3_info_type;
uint8_t L3_info[16];
//#ifndef CELLULAR
unsigned short UE_eNB_index;
//#endif
} __attribute__ ((__packed__)) MAC_CONFIG_REQ;
#define MAC_CONFIG_REQ_SIZE sizeof(MAC_CONFIG_REQ)
@@ -314,18 +312,12 @@ typedef struct {
#ifndef OPENAIR2_IN
#ifndef CELLULAR
//#include "L3_rrc_defs.h"
#endif
typedef struct { //RRC_INTERFACE_FUNCTIONS
unsigned int Frame_index;
unsigned short UE_index[NB_MODULES_MAX][NB_SIG_CNX_UE];
uint8_t eNB_id[NB_MODULES_MAX][NB_CNX_UE];
#ifndef CELLULAR
// L2_ID UE_id[NB_MODULES_MAX][NB_CNX_CH];
uint8_t UE_id[NB_MODULES_MAX][NB_CNX_CH][5];
#endif
void (*openair_rrc_top_init)(void);
char (*openair_rrc_eNB_init)(uint8_t );
char (*openair_rrc_UE_init)(uint8_t, uint8_t);
-43
View File
@@ -22,12 +22,6 @@
#ifndef __openair_DEFS_H__
#define __openair_DEFS_H__
#ifndef USER_MODE
#include <linux/kernel.h>
#endif //USER_MODE
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#if !defined (msg)
@@ -49,44 +43,7 @@
#define PAGE_MASK 0xfffff000
#define virt_to_phys(x) (x)
#else // USER_MODE
#include <rtai.h>
#define msg rt_printk
#ifdef BIGPHYSAREA
#define bigmalloc(x) (bigphys_malloc(x))
#define bigmalloc16(x) (bigphys_malloc(x))
#define malloc16(x) (bigphys_malloc(x))
#define free16(y,x)
#define bigfree(y,x)
#else // BIGPHYSAREA
#define bigmalloc(x) (dma_alloc_coherent(pdev[0],(x),&dummy_dma_ptr,0))
#define bigmalloc16(x) (dma_alloc_coherent(pdev[0],(x),&dummy_dma_ptr,0))
#define bigfree(y,x) (dma_free_coherent(pdev[0],(x),(void *)(y),dummy_dma_ptr))
#define malloc16(x) (kmalloc(x,GFP_KERNEL))
#define free16(y,x) (kfree(y))
#endif // BIGPHYSAREA
#ifdef CBMIMO1
#define openair_get_mbox() (*(unsigned int *)mbox)
#else //CBMIMO1
#define openair_get_mbox() (*(unsigned int *)PHY_vars->mbox>>1)
#endif //CBMIMO1
#endif // USERMODE
// #define bzero(s,n) (memset((s),0,(n)))
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmin(a,b) ((a<b) ? (a) : (b))
#endif // /*__openair_DEFS_H__ */
-39
View File
@@ -1,39 +0,0 @@
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
#ifndef __openair_TYPES_H__
#define __openair_TYPES_H__
//#ifdef USER_MODE
//#include <stdint.h>
//typedef int8_t s8; /* 8 bit signed integer */
//typedef int16_t s16; /* 16 bit signed integer */
//typedef int32_t s32; /* 32 bit signed integer */
//typedef int64_t s64; /* 64 bit signed integer */
//typedef uint8_t u8; /* 8 bit unsigned integer */
//typedef uint16_t u16; /* 16 bit unsigned integer */
//typedef uint32_t u32; /* 32 bit unsigned integer */
//typedef uint64_t u64; /* 64 bit unsigned integer */
//#else
//#include <linux/types.h>
//#endif
#endif /*__openair_TYPES_H__ */
-8
View File
@@ -43,7 +43,6 @@
#define NL_MAX_PAYLOAD 9000 /* this should cover the max mtu size*/
#endif
#ifdef USER_MODE
#ifdef LARGE_SCALE
# define NB_MODULES_MAX 128
# define NB_NODE_MAX 128
@@ -51,11 +50,6 @@
# define NB_MODULES_MAX 32
# define NB_NODE_MAX 32
#endif
#else
# define NB_MODULES_MAX 1
# define NB_NODE_MAX 1
#endif //PHY_EMUL
#ifdef JUMBO_FRAME
# define MAX_IP_PACKET_SIZE 10000 // 9000
@@ -132,9 +126,7 @@
#define UNUSED_PARAM_MBMS_SESSION_ID 0
#define UNUSED_PARAM_MBMS_SERVICE_ID 0
#ifdef USER_MODE
#define printk printf
#endif
#define UNUSED_VARIABLE(vARIABLE) (void)(vARIABLE)
+1 -25
View File
@@ -30,7 +30,7 @@
#ifndef __PLATFORM_TYPES_H__
# define __PLATFORM_TYPES_H__
#ifdef USER_MODE
#if !defined(NAS_NETLINK)
#include <stdint.h>
#endif
@@ -271,29 +271,5 @@ typedef struct protocol_ctxt_s {
(CTXT_Pp)->module_id, \
(CTXT_Pp)->rnti
#ifdef OAI_EMU
#define CHECK_CTXT_ARGS(CTXT_Pp) \
if ((CTXT_Pp)->enb_flag) {\
AssertFatal (((CTXT_Pp)->module_id >= oai_emulation.info.first_enb_local) && (oai_emulation.info.nb_enb_local > 0),\
"eNB module id is too low (%u/%d/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_enb_local,\
oai_emulation.info.nb_enb_local);\
AssertFatal (((CTXT_Pp)->module_id < (oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local)) && (oai_emulation.info.nb_enb_local > 0),\
"eNB module id is too high (%u/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local);\
} else {\
AssertFatal ((CTXT_Pp)->module_id < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local),\
"UE module id is too high (%u/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local);\
AssertFatal ((CTXT_Pp)->module_id >= oai_emulation.info.first_ue_local,\
"UE module id is too low (%u/%d)!\n",\
(CTXT_Pp)->module_id,\
oai_emulation.info.first_ue_local);\
}
#else
#define CHECK_CTXT_ARGS(CTXT_Pp)
#endif
#endif
+9 -41
View File
@@ -20,45 +20,13 @@
*/
#ifndef _RTOS_HEADER_H_
# define _RTOS_HEADER_H_
# if defined(RTAI) && !defined(USER_MODE)
// CONVERSION BETWEEN POSIX PTHREAD AND RTAI FUNCTIONS
/*
# define pthread_mutex_init pthread_mutex_init_rt
# define pthread_mutexattr_init pthread_mutexattr_init_rt
# define pthread_mutex_lock pthread_mutex_lock_rt
# define pthread_mutex_unlock pthread_mutex_unlock_rt
# define pthread_mutex_destroy pthread_mutex_destroy_rt
# define pthread_cond_init pthread_cond_init_rt
# define pthread_cond_wait pthread_cond_wait_rt
# define pthread_cond_signal pthread_cond_signal_rt
# define pthread_cond_destroy pthread_cond_destroy_rt
# define pthread_attr_init pthread_attr_init_rt
# define pthread_attr_setschedparam pthread_attr_setschedparam_rt
# define pthread_create pthread_create_rt
# define pthread_cancel pthread_cancel_rt
# define pthread_delete_np pthread_cancel_rt
# define pthread_attr_setstacksize pthread_attr_setstacksize_rt
# define pthread_self rt_whoami
*/
# include <asm/rtai.h>
# include <rtai.h>
# include <rtai_posix.h>
# include <rtai_fifos.h>
# include <rtai_sched.h>
# ifdef CONFIG_PROC_FS
# include <rtai_proc_fs.h>
# endif
# else
# ifdef USER_MODE
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
# include <math.h>
# include <pthread.h>
# include <assert.h>
# define rtf_get read
# define rtf_put write
# endif
# endif
#define _RTOS_HEADER_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <pthread.h>
#include <assert.h>
#define rtf_get read
#define rtf_put write
#endif
-30
View File
@@ -36,10 +36,6 @@
#include "common/ran_context.h"
#include "log.h"
#if defined(OAI_EMU)
# include "OCG.h"
# include "OCG_extern.h"
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
@@ -215,9 +211,6 @@ static uint32_t eNB_app_register(uint32_t enb_id_start, uint32_t enb_id_end)//,
uint32_t register_enb_pending = 0;
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) {
# if defined(OAI_EMU)
if (oai_emulation.info.cli_start_enb[enb_id] == 1)
# endif
{
s1ap_register_enb_req_t *s1ap_register_eNB;
@@ -314,19 +307,6 @@ void *eNB_app_task(void *args_p)
if (RC.nb_L1_inst>0) AssertFatal(l1_north_init_eNB()==0,"could not initialize L1 north interface\n");
# if defined(ENABLE_ITTI)
# if defined(OAI_EMU)
enb_nb = oai_emulation.info.nb_enb_local;
enb_id_start = oai_emulation.info.first_enb_local;
enb_id_end = oai_emulation.info.first_enb_local + enb_nb;
AssertFatal (enb_id_end <= NUMBER_OF_eNB_MAX,
"Last eNB index is greater or equal to maximum eNB index (%d/%d)!",
enb_id_end, NUMBER_OF_eNB_MAX);
# endif
# endif
AssertFatal (enb_nb <= RC.nb_inst,
"Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
enb_nb, RC.nb_inst);
@@ -402,16 +382,6 @@ void *eNB_app_task(void *args_p)
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_L2L1, INSTANCE_DEFAULT, msg_init_p);
# if defined(OAI_EMU)
/* Also inform all NAS UE tasks */
for (instance = NB_eNB_INST + oai_emulation.info.first_ue_local;
instance < (NB_eNB_INST + oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local); instance ++) {
msg_init_p = itti_alloc_new_message (TASK_ENB_APP, INITIALIZE_MESSAGE);
itti_send_msg_to_task (TASK_NAS_UE, instance, msg_init_p);
}
# endif
} else {
uint32_t not_associated = enb_nb - registered_enb;
-4
View File
@@ -36,10 +36,6 @@
#include "enb_config.h"
#include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_externs.h"
#if defined(OAI_EMU)
# include "OCG.h"
# include "OCG_extern.h"
#endif
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# if defined(ENABLE_USE_MME)
-8
View File
@@ -39,15 +39,9 @@
#ifdef USER_MODE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
//#include "COMMON/openair_defs.h"
#include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/defs.h"
@@ -109,9 +103,7 @@
//#define MCH_PAYLOAD_SIZE_MAX 16384// this value is using in case mcs and TBS index are high
#endif
#ifdef USER_MODE
#define printk printf
#endif //USER_MODE
/*!\brief Maximum number of logical channl group IDs */
#define MAX_NUM_LCGID 4

Some files were not shown because too many files have changed in this diff Show More