isolation of RU (no use of RC.xxx)

This commit is contained in:
magounak
2020-07-13 08:00:59 +02:00
parent 26da5a6286
commit 1698f9e20f
42 changed files with 386 additions and 376 deletions
+64 -47
View File
@@ -286,8 +286,11 @@ add_definitions(-DLTE_RRC_VERSION=${LTE_RRC_VERSION})
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION}) set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_" if (${RU} STREQUAL 0)
RESULT_VARIABLE ret) execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_"
RESULT_VARIABLE ret)
endif (${RU} STREQUAL 0)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
@@ -315,13 +318,16 @@ add_definitions(-DNR_RRC_VERSION=${NR_RRC_VERSION})
set (NR_RRC_FULL_DIR ${asn1_generated_dir}/RRC_${NR_RRC_ASN1_VERSION}) set (NR_RRC_FULL_DIR ${asn1_generated_dir}/RRC_${NR_RRC_ASN1_VERSION})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice" if (${RU} STREQUAL 0)
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice"
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
endif () endif ()
file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c) file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c)
file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h) file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h)
endif (${RU} STREQUAL 0)
add_custom_target ( add_custom_target (
nr_rrc_flag ALL nr_rrc_flag ALL
${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice" ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice"
@@ -349,31 +355,33 @@ set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE}) set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps if (${RU} STREQUAL 0)
RESULT_VARIABLE ret) execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
if (NOT ${ret} STREQUAL 0) RESULT_VARIABLE ret)
message(FATAL_ERROR "${ret}: error") if (NOT ${ret} STREQUAL 0)
endif (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error")
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c) endif (NOT ${ret} STREQUAL 0)
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
endif (${RU} STREQUAL 0)
add_custom_target ( add_custom_target (
s1ap_flag ALL s1ap_flag ALL
${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
)
add_library(S1AP_LIB
${S1AP_source}
${S1AP_DIR}/s1ap_common.c
) )
add_dependencies(S1AP_LIB rrc_flag s1ap_flag)
include_directories ("${S1AP_C_DIR}") add_library(S1AP_LIB
include_directories ("${S1AP_DIR}") ${S1AP_source}
${S1AP_DIR}/s1ap_common.c
)
add_dependencies(S1AP_LIB rrc_flag s1ap_flag)
include_directories ("${S1AP_C_DIR}")
include_directories ("${S1AP_DIR}")
add_library(S1AP_ENB add_library(S1AP_ENB
${S1AP_DIR}/s1ap_eNB.c ${S1AP_DIR}/s1ap_eNB.c
${S1AP_DIR}/s1ap_eNB_context_management_procedures.c ${S1AP_DIR}/s1ap_eNB_context_management_procedures.c
${S1AP_DIR}/s1ap_eNB_decoder.c ${S1AP_DIR}/s1ap_eNB_decoder.c
${S1AP_DIR}/s1ap_eNB_encoder.c ${S1AP_DIR}/s1ap_eNB_encoder.c
${S1AP_DIR}/s1ap_eNB_handlers.c ${S1AP_DIR}/s1ap_eNB_handlers.c
@@ -416,11 +424,13 @@ set(M2AP_ASN_DIR ${M2AP_DIR}/MESSAGES/ASN1/${M2AP_RELEASE})
set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE}) set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps -DEMIT_ASN_DEBUG=1 if (${RU} STREQUAL 0)
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps -DEMIT_ASN_DEBUG=1
RESULT_VARIABLE ret) RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error") message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
endif (${RU} STREQUAL 0)
file(GLOB M2AP_source ${M2AP_C_DIR}/*.c) file(GLOB M2AP_source ${M2AP_C_DIR}/*.c)
@@ -486,11 +496,13 @@ set(M3AP_ASN_DIR ${M3AP_DIR}/MESSAGES/ASN1/${M3AP_RELEASE})
set(M3AP_C_DIR ${asn1_generated_dir}/M3AP_${M3AP_RELEASE}) set(M3AP_C_DIR ${asn1_generated_dir}/M3AP_${M3AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps if (${RU} STREQUAL 0)
RESULT_VARIABLE ret) execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps
if (NOT ${ret} STREQUAL 0) RESULT_VARIABLE ret)
message(FATAL_ERROR "${ret}: error") if (NOT ${ret} STREQUAL 0)
endif (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
endif (${RU} STREQUAL 0)
file(GLOB M3AP_source ${M3AP_C_DIR}/*.c) file(GLOB M3AP_source ${M3AP_C_DIR}/*.c)
@@ -540,11 +552,13 @@ add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE}) set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE})
set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE}) set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make # Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps if (${RU} STREQUAL 0)
RESULT_VARIABLE ret) execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps
if (NOT ${ret} STREQUAL 0) RESULT_VARIABLE ret)
message(FATAL_ERROR "${ret}: error") if (NOT ${ret} STREQUAL 0)
endif (NOT ${ret} STREQUAL 0) message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
endif (${RU} STREQUAL 0)
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c) file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
@@ -596,17 +610,18 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn ${F1AP_ASN_DIR}/F1AP-Containers.asn
) )
set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR}) if (${RU} STREQUAL 0)
message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}") set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR} message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES} execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR}
RESULT_VARIABLE ret COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
OUTPUT_QUIET RESULT_VARIABLE ret
ERROR_QUIET) OUTPUT_QUIET
ERROR_QUIET)
if (NOT ${ret} STREQUAL 0) if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "asn1c: error") message(FATAL_ERROR "asn1c: error")
endif (NOT ${ret} STREQUAL 0) endif (NOT ${ret} STREQUAL 0)
file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c) file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
add_library(F1AP_LIB add_library(F1AP_LIB
@@ -621,6 +636,8 @@ add_library(F1AP
${F1AP_C_FILES} ${F1AP_C_FILES}
) )
endif (${RU} STREQUAL 0)
# Hardware dependant options # Hardware dependant options
################################### ###################################
+18 -11
View File
@@ -237,10 +237,12 @@ function main() {
shift;; shift;;
--eNB) --eNB)
eNB=1 eNB=1
RU=0
echo_info "Will compile eNB" echo_info "Will compile eNB"
shift;; shift;;
--gNB) --gNB)
gNB=1 gNB=1
RU=0
NR="True" NR="True"
echo_info "Will compile gNB" echo_info "Will compile gNB"
shift;; shift;;
@@ -252,10 +254,12 @@ function main() {
echo_info "FlexRAN support is always compiled into the eNB" echo_info "FlexRAN support is always compiled into the eNB"
shift;; shift;;
--UE) --UE)
RU=0
UE=1 UE=1
echo_info "Will compile UE" echo_info "Will compile UE"
shift;; shift;;
--nrUE) --nrUE)
RU=0
nrUE=1 nrUE=1
NR="True" NR="True"
echo_info "Will compile NR UE" echo_info "Will compile NR UE"
@@ -604,6 +608,7 @@ function main() {
echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file
echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file
echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
echo "set ( RU $RU )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$build_dir/build cd $DIR/$build_dir/build
eval $CMAKE_CMD eval $CMAKE_CMD
@@ -642,20 +647,22 @@ function main() {
$build_dir $config_libconfig_shlib \ $build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
compilations \ if [ "$RU" = "0" ] ; then
$build_dir coding \
libcoding.so $dbin/libcoding.so
compilations \ compilations \
$build_dir nasmesh \ $build_dir coding \
CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko libcoding.so $dbin/libcoding.so
compilations \ compilations \
$build_dir rb_tool \ $build_dir nasmesh \
rb_tool $dbin/rb_tool CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
compilations \
$build_dir rb_tool \
rb_tool $dbin/rb_tool
cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
fi
fi fi
fi fi
if [ "$UE" = 1 ] ; then if [ "$UE" = 1 ] ; then
+1 -1
View File
@@ -39,7 +39,7 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/impl_defs_top.h" #include "PHY/impl_defs_top.h"
#include "ENB_APP/enb_config.h" //#include "ENB_APP/enb_config.h"
#include "flexran_agent_defs.h" #include "flexran_agent_defs.h"
#include "gtpv1u.h" #include "gtpv1u.h"
+14 -3
View File
@@ -41,7 +41,6 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_RU.h" #include "PHY/defs_RU.h"
#include "common/ran_context.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
@@ -60,7 +59,7 @@
#include "system.h" #include "system.h"
#include <executables/split_headers.h> #include <executables/split_headers.h>
#include <targets/RT/USER/lte-softmodem.h> #include <executables/softmodem-common.h>
#include <executables/thread-common.h> #include <executables/thread-common.h>
static int DEFBANDS[] = {7}; static int DEFBANDS[] = {7};
@@ -77,7 +76,10 @@ uint16_t sf_ahead = 4;
RU_t ru_m; RU_t ru_m;
void init_RU0(RU_t *ru,int ru_id,char *rf_config_file, int send_dmrssync); extern void init_RU0(RU_t *ru,int ru_id,char *rf_config_file, int send_dmrssync);
extern void init_RU_proc(RU_t *ru);
extern void kill_RU_proc(RU_t *ru);
extern void set_function_spec_param(RU_t *ru);
void exit_function(const char *file, const char *function, const int line, const char *s) { void exit_function(const char *file, const char *function, const int line, const char *s) {
@@ -97,6 +99,8 @@ void exit_function(const char *file, const char *function, const int line, const
ru_m.ifdevice.trx_end_func = NULL; ru_m.ifdevice.trx_end_func = NULL;
} }
pthread_mutex_destroy(ru_m.ru_mutex);
pthread_cond_destroy(ru_m.ru_cond);
sleep(1); //allow lte-softmodem threads to exit first sleep(1); //allow lte-softmodem threads to exit first
exit(1); exit(1);
} }
@@ -169,6 +173,13 @@ int main ( int argc, char **argv )
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL); config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
int j=0; int j=0;
uint64_t ru_mask=1;
pthread_mutex_t ru_mutex; pthread_mutex_init(&ru_mutex,NULL);
pthread_cond_t ru_cond; pthread_cond_init(&ru_cond,NULL);
ru->ru_mask= &ru_mask;
ru->ru_mutex = &ru_mutex;
ru->ru_cond = &ru_cond;
ru->if_timing = synch_to_ext_device; ru->if_timing = synch_to_ext_device;
ru->num_eNB = 0; ru->num_eNB = 0;
+8 -7
View File
@@ -21,9 +21,8 @@
#include "phy_init.h" #include "phy_init.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
#include "SIMULATION/TOOLS/sim.h" //#include "SIMULATION/TOOLS/sim.h"
#include "LTE_RadioResourceConfigCommonSIB.h" #include "LTE_RadioResourceConfigCommonSIB.h"
#include "LTE_RadioResourceConfigDedicated.h" #include "LTE_RadioResourceConfigDedicated.h"
#include "LTE_TDD-Config.h" #include "LTE_TDD-Config.h"
@@ -34,6 +33,8 @@
void init_7_5KHz(void); void init_7_5KHz(void);
extern const char ru_if_types[MAX_RU_IF_TYPES][20];
int phy_init_RU(RU_t *ru) { int phy_init_RU(RU_t *ru) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms; LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_CALIBRATION *calibration = &ru->calibration; RU_CALIBRATION *calibration = &ru->calibration;
@@ -135,14 +136,14 @@ int phy_init_RU(RU_t *ru) {
} }
} }
AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n", AssertFatal(ru->num_eNB <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
RC.nb_L1_inst,NUMBER_OF_eNB_MAX); ru->num_eNB,NUMBER_OF_eNB_MAX);
LOG_D(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst); LOG_D(PHY,"[INIT] %s() ru->num_eNB:%d \n", __FUNCTION__, ru->num_eNB);
int starting_antenna_index=0; int starting_antenna_index=0;
for (i=0; i<ru->idx; i++) starting_antenna_index+=ru->nb_tx; for (i=0; i<ru->idx; i++) starting_antenna_index+=ru->nb_tx;
for (i=0; i<RC.nb_L1_inst; i++) { for (i=0; i<ru->num_eNB; i++) {
for (p=0; p<15; p++) { for (p=0; p<15; p++) {
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB); LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
@@ -241,7 +242,7 @@ void phy_free_RU(RU_t *ru) {
free_and_zero(ru->prach_rxsigF); free_and_zero(ru->prach_rxsigF);
/* ru->prach_rxsigF_br is not allocated -> don't free */ /* ru->prach_rxsigF_br is not allocated -> don't free */
for (i = 0; i < RC.nb_L1_inst; i++) { for (i = 0; i < ru->num_eNB; i++) {
for (p = 0; p < 15; p++) { for (p = 0; p < 15; p++) {
if (p < ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p == 5) { if (p < ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p == 5) {
for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
+3 -2
View File
@@ -25,7 +25,6 @@
#include <execinfo.h> #include <execinfo.h>
#include <signal.h> #include <signal.h>
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
@@ -33,7 +32,9 @@
#include "phy_init.h" #include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h" #include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "targets/RT/USER/lte-softmodem.h" #include "executables/softmodem-common.h"
#include "SIMULATION/TOOLS/sim.h"
extern PHY_VARS_eNB *eNB; extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE; extern PHY_VARS_UE *UE;
extern RU_t *ru; extern RU_t *ru;
+9 -9
View File
@@ -21,8 +21,6 @@
#include "phy_init.h" #include "phy_init.h"
#include "SCHED/sched_common.h" #include "SCHED/sched_common.h"
#include "PHY/phy_extern.h"
#include "SIMULATION/TOOLS/sim.h"
/*#include "RadioResourceConfigCommonSIB.h" /*#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h" #include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h" #include "TDD-Config.h"
@@ -32,6 +30,8 @@
#include <math.h> #include <math.h>
#include "openair1/PHY/defs_RU.h" #include "openair1/PHY/defs_RU.h"
extern const char ru_if_types[MAX_RU_IF_TYPES][20];
int nr_phy_init_RU(RU_t *ru) { int nr_phy_init_RU(RU_t *ru) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
@@ -43,8 +43,8 @@ int nr_phy_init_RU(RU_t *ru) {
nfapi_nr_config_request_scf_t *cfg; nfapi_nr_config_request_scf_t *cfg;
ru->nb_log_antennas=0; ru->nb_log_antennas=0;
for (int n=0;n<RC.nb_nr_L1_inst;n++) { for (int n=0;n<ru->num_gNB;n++) {
cfg = &RC.gNB[n]->gNB_config; cfg = &ru->gNB_list[n]->gNB_config;
if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas) ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value; if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas) ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
} }
AssertFatal(ru->nb_log_antennas > 0 && ru->nb_log_antennas < 13, "ru->nb_log_antennas %d ! \n",ru->nb_log_antennas); AssertFatal(ru->nb_log_antennas > 0 && ru->nb_log_antennas < 13, "ru->nb_log_antennas %d ! \n",ru->nb_log_antennas);
@@ -111,10 +111,10 @@ int nr_phy_init_RU(RU_t *ru) {
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]); LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,ru->prach_rxsigF[i]);
} }
AssertFatal(RC.nb_nr_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n", AssertFatal(ru->num_gNB <= NUMBER_OF_gNB_MAX,"gNB instances %d > %d\n",
RC.nb_nr_L1_inst,NUMBER_OF_gNB_MAX); ru->num_gNB,NUMBER_OF_gNB_MAX);
LOG_E(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst); LOG_E(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
int beam_count = 0; int beam_count = 0;
if (ru->nb_log_antennas>1) { if (ru->nb_log_antennas>1) {
@@ -125,7 +125,7 @@ int nr_phy_init_RU(RU_t *ru) {
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx)); AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
int l_ind = 0; int l_ind = 0;
for (i=0; i<RC.nb_nr_L1_inst; i++) { for (i=0; i<ru->num_gNB; i++) {
for (p=0;p<ru->nb_log_antennas;p++) { for (p=0;p<ru->nb_log_antennas;p++) {
if ((fp->L_ssb >> p) & 0x01) { if ((fp->L_ssb >> p) & 0x01) {
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*)); ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
@@ -184,7 +184,7 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->prach_rxsigF[i]); free_and_zero(ru->prach_rxsigF[i]);
} }
for (i = 0; i < RC.nb_nr_L1_inst; i++) { for (i = 0; i < ru->num_gNB; i++) {
for (p = 0; p < 15; p++) { for (p = 0; p < 15; p++) {
for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
free_and_zero(ru->beam_weights[i][p]); free_and_zero(ru->beam_weights[i][p]);
@@ -20,7 +20,6 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
// This is 512/(1:256) in __m128i format // This is 512/(1:256) in __m128i format
@@ -21,7 +21,6 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
@@ -27,12 +27,10 @@
//#include <string.h> //#include <string.h>
#include <math.h> #include <math.h>
#include "LAYER2/MAC/mac.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h" #include "PHY/phy_extern_ue.h"
#include "PHY_INTERFACE/phy_interface.h" #include "PHY_INTERFACE/phy_interface.h"
#include "PHY/LTE_REFSIG/lte_refsig.h" #include "PHY/LTE_REFSIG/lte_refsig.h"
#include "RRC/LTE/rrc_extern.h"
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs) // Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h" #include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
@@ -20,7 +20,7 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h" //#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
//#define DEBUG_CH //#define DEBUG_CH
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
@@ -34,6 +34,12 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF #define SCALE 0x3FFF
static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
extern unsigned short dftsizes[34];
extern int16_t *ul_ref_sigs_rx[30][2][34];
int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms, int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
L1_rxtx_proc_t *proc, L1_rxtx_proc_t *proc,
LTE_eNB_ULSCH_t * ulsch, LTE_eNB_ULSCH_t * ulsch,
@@ -100,7 +100,6 @@ uint16_t RIV2nb_rb_LUT100[6000];
uint16_t RIV2first_rb_LUT100[6000]; uint16_t RIV2first_rb_LUT100[6000];
uint16_t RIV_max100=0; uint16_t RIV_max100=0;
extern RAN_CONTEXT_t RC;
extern uint32_t current_dlsch_cqi; extern uint32_t current_dlsch_cqi;
@@ -273,15 +272,6 @@ uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint
uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
{
// check for eNB only !
return(get_nCCE(num_pdcch_symbols,
&RC.eNB[Mod_id][CC_id]->frame_parms,
get_mi(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe)));
}
void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc) void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc)
{ {
+4 -2
View File
@@ -30,9 +30,11 @@
* \warning * \warning
*/ */
#include "PHY/defs_eNB.h" #include <stdio.h>
//#include "PHY/defs_eNB.h"
#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h" #include "PHY/TOOLS/alaw_lut.h"
#include "PHY/phy_extern.h" //#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" //#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
+2 -2
View File
@@ -31,11 +31,11 @@
*/ */
#include <time.h> #include <time.h>
#include "PHY/defs_eNB.h" #include <stdio.h>
#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h" #include "PHY/TOOLS/alaw_lut.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h" //#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include <intertask_interface.h>
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
//#define DEBUG_DL_MOBIPASS //#define DEBUG_DL_MOBIPASS
//#define DEBUG_UL_MOBIPASS //#define DEBUG_UL_MOBIPASS
-16
View File
@@ -24,22 +24,6 @@
#include "transport_eNB.h" #include "transport_eNB.h"
#include "transport_proto.h" #include "transport_proto.h"
#include "transport_common_proto.h" #include "transport_common_proto.h"
// Mask for identifying subframe for MBMS
#define MBSFN_TDD_SF3 0x80// for TDD
#define MBSFN_TDD_SF4 0x40
#define MBSFN_TDD_SF7 0x20
#define MBSFN_TDD_SF8 0x10
#define MBSFN_TDD_SF9 0x08
#define MBSFN_FDD_SF1 0x80// for FDD
#define MBSFN_FDD_SF2 0x40
#define MBSFN_FDD_SF3 0x20
#define MBSFN_FDD_SF6 0x10
#define MBSFN_FDD_SF7 0x08
#define MBSFN_FDD_SF8 0x04
+1 -1
View File
@@ -31,7 +31,7 @@
*/ */
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h" //#include "PHY/phy_extern.h"
//#include "prach.h" //#include "prach.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
+1 -1
View File
@@ -35,7 +35,7 @@
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h" //#include "PHY/phy_extern.h"
//#define PRACH_DEBUG 1 //#define PRACH_DEBUG 1
//#define PRACH_WRITE_OUTPUT_DEBUG 1 //#define PRACH_WRITE_OUTPUT_DEBUG 1
@@ -35,9 +35,9 @@
#include "dci.h" #include "dci.h"
#include "mdci.h" #include "mdci.h"
//#include "uci.h" //#include "uci.h"
#ifndef STANDALONE_COMPILE //#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h" // #include "UTIL/LISTS/list.h"
#endif //#endif
#define MOD_TABLE_QPSK_OFFSET 1 #define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5 #define MOD_TABLE_16QAM_OFFSET 5
+3 -3
View File
@@ -36,9 +36,9 @@
#include "dci.h" #include "dci.h"
#include "mdci.h" #include "mdci.h"
#include "uci_common.h" #include "uci_common.h"
#ifndef STANDALONE_COMPILE //#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h" // #include "UTIL/LISTS/list.h"
#endif //#endif
// structures below implement 36-211 and 36-212 // structures below implement 36-211 and 36-212
@@ -31,12 +31,12 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h" //#include "PHY/phy_extern.h"
#include "transport_eNB.h" #include "transport_eNB.h"
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "transport_common_proto.h" #include "transport_common_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/MODULATION/modulation_eNB.h" //#include "PHY/MODULATION/modulation_eNB.h"
#include "T.h" #include "T.h"
@@ -45,8 +45,11 @@
//extern int **ulchmag_eren; //extern int **ulchmag_eren;
//eren //eren
static short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0}; static const short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0};
static short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1}; static const short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1};
static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) { void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
-1
View File
@@ -44,7 +44,6 @@
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/CODING/coding_defs.h" #include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/coding_extern.h" #include "PHY/CODING/coding_extern.h"
#include "PHY/CODING/lte_interleaver_inline.h" #include "PHY/CODING/lte_interleaver_inline.h"
+2 -2
View File
@@ -20,8 +20,8 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h" //#include "PHY/phy_extern.h"
#include "modulation_eNB.h" //#include "modulation_eNB.h"
//#define DEBUG_FEP //#define DEBUG_FEP
-1
View File
@@ -20,7 +20,6 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include <math.h> #include <math.h>
#include "PHY/sse_intrin.h" #include "PHY/sse_intrin.h"
#include "modulation_extern.h" #include "modulation_extern.h"
@@ -42,7 +42,7 @@
#include "UTIL/LISTS/list.h" #include "UTIL/LISTS/list.h"
#endif #endif
#include "LAYER2/NR_MAC_gNB/mac_proto.h" //#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h" #include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
//#include "../LTE_TRANSPORT/transport_common.h" //#include "../LTE_TRANSPORT/transport_common.h"
+8 -6
View File
@@ -32,17 +32,17 @@
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
#define OAIDFTS_MAIN #define OAIDFTS_MAIN
#ifndef MR_MAIN //#ifndef MR_MAIN
#include "PHY/defs_common.h" //#include "PHY/defs_common.h"
#include "PHY/impl_defs_top.h" //#include "PHY/impl_defs_top.h"
#else //#else
#include "time_meas.h" #include "time_meas.h"
#include "LOG/log.h" #include "LOG/log.h"
#define debug_msg #define debug_msg
#define ONE_OVER_SQRT2_Q15 23170 #define ONE_OVER_SQRT2_Q15 23170
int oai_exit=0; //int oai_exit=0;
#endif //#endif
#define ONE_OVER_SQRT3_Q15 18919 #define ONE_OVER_SQRT3_Q15 18919
@@ -50,6 +50,8 @@ int oai_exit=0;
#include "assertions.h" #include "assertions.h"
#include "tools_defs.h"
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7]) #define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15]) #define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15])
+15 -1
View File
@@ -38,7 +38,7 @@
#include "openairinterface5g_limits.h" #include "openairinterface5g_limits.h"
#include "PHY/TOOLS/time_meas.h" #include "PHY/TOOLS/time_meas.h"
#include "defs_common.h" #include "defs_common.h"
#include <openair2/PHY_INTERFACE/IF_Module.h> //#include <openair2/PHY_INTERFACE/IF_Module.h>
#define MAX_BANDS_PER_RRU 4 #define MAX_BANDS_PER_RRU 4
@@ -421,6 +421,14 @@ typedef enum {
typedef struct RU_t_s { typedef struct RU_t_s {
/// index of this ru /// index of this ru
uint32_t idx; uint32_t idx;
/// pointer to first RU
struct RU_t_s *ru0;
/// pointer to ru_mask
uint64_t *ru_mask;
/// pointer to ru_mutex
pthread_mutex_t *ru_mutex;
/// pointer to ru_cond
pthread_cond_t *ru_cond;
/// Pointer to configuration file /// Pointer to configuration file
char *rf_config_file; char *rf_config_file;
/// southbound interface /// southbound interface
@@ -431,6 +439,12 @@ typedef struct RU_t_s {
node_function_t function; node_function_t function;
/// Ethernet parameters for fronthaul interface /// Ethernet parameters for fronthaul interface
eth_params_t eth_params; eth_params_t eth_params;
/// flag to indicate RF emulation mode
int emulate_rf;
/// numerology index
int numerology;
/// flag to indicate basicsim operation
int basicsim;
/// flag to indicate the RU is in sync with a master reference /// flag to indicate the RU is in sync with a master reference
int in_synch; int in_synch;
/// timing offset /// timing offset
+17
View File
@@ -943,6 +943,23 @@ extern int sync_var;
#define DECODE_NUM_FPTR 13 #define DECODE_NUM_FPTR 13
// Mask for identifying subframe for MBMS
#define MBSFN_TDD_SF3 0x80// for TDD
#define MBSFN_TDD_SF4 0x40
#define MBSFN_TDD_SF7 0x20
#define MBSFN_TDD_SF8 0x10
#define MBSFN_TDD_SF9 0x08
#define MBSFN_FDD_SF1 0x80// for FDD
#define MBSFN_FDD_SF2 0x40
#define MBSFN_FDD_SF3 0x20
#define MBSFN_FDD_SF6 0x10
#define MBSFN_FDD_SF7 0x08
#define MBSFN_FDD_SF8 0x04
typedef uint8_t(decoder_if_t)(int16_t *y, typedef uint8_t(decoder_if_t)(int16_t *y,
int16_t *y2, int16_t *y2,
uint8_t *decoded_bytes, uint8_t *decoded_bytes,
+8 -2
View File
@@ -36,7 +36,6 @@
#include <stdbool.h> #include <stdbool.h>
#include "types.h" #include "types.h"
#include "NR_PDSCH-TimeDomainResourceAllocation.h"
#ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H #ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
#define EXTERN #define EXTERN
@@ -397,6 +396,13 @@ typedef struct{
typedef struct{ typedef struct{
// to be defined FIXME!!! // to be defined FIXME!!!
}zp_CSI_RS_Resource_t; }zp_CSI_RS_Resource_t;
typedef struct{
int k0;
int mappingType;
int startSymbolAndLength;
}PDSCH_TimeDomainResourceAllocation_t;
typedef struct { typedef struct {
/* /*
* resourceAllocation * resourceAllocation
@@ -449,7 +455,7 @@ typedef struct {
*/ */
maxNrofCodeWordsScheduledByDCI_t maxNrofCodeWordsScheduledByDCI; maxNrofCodeWordsScheduledByDCI_t maxNrofCodeWordsScheduledByDCI;
NR_PDSCH_TimeDomainResourceAllocation_t *pdsch_TimeDomainResourceAllocation[MAX_NR_OF_DL_ALLOCATIONS]; PDSCH_TimeDomainResourceAllocation_t *pdsch_TimeDomainResourceAllocation[MAX_NR_OF_DL_ALLOCATIONS];
} PDSCH_Config_t; } PDSCH_Config_t;
+1 -3
View File
@@ -23,7 +23,6 @@
#define __PHY_EXTERN_H__ #define __PHY_EXTERN_H__
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "common/ran_context.h"
extern char* namepointer_chMag ; extern char* namepointer_chMag ;
extern char* namepointer_log2; extern char* namepointer_log2;
@@ -33,14 +32,13 @@ extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX]; extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
#include "PHY/LTE_TRANSPORT/transport_extern.h" #include "PHY/LTE_TRANSPORT/transport_extern.h"
//#include "SIMULATION/ETH_TRANSPORT/extern.h" #include "PHY/defs_RU.h"
extern unsigned int DAQ_MBOX; extern unsigned int DAQ_MBOX;
extern int number_of_cards; extern int number_of_cards;
extern const short conjugate[8],conjugate2[8]; extern const short conjugate[8],conjugate2[8];
extern RAN_CONTEXT_t RC;
extern short primary_synch0[144]; extern short primary_synch0[144];
extern short primary_synch1[144]; extern short primary_synch1[144];
-1
View File
@@ -23,7 +23,6 @@
#define __PHY_EXTERN_UE__H__ #define __PHY_EXTERN_UE__H__
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "common/ran_context.h"
extern char* namepointer_chMag ; extern char* namepointer_chMag ;
extern char* namepointer_log2; extern char* namepointer_log2;
+2 -2
View File
@@ -25,7 +25,6 @@
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h" #include "PHY/defs_UE.h"
#include "common/ran_context.h"
char* namepointer_chMag ; char* namepointer_chMag ;
char fmageren_name2[512]; char fmageren_name2[512];
@@ -41,9 +40,10 @@ int16_t *primary_synch2_time;
#include "PHY/LTE_TRANSPORT/transport_vars.h" #include "PHY/LTE_TRANSPORT/transport_vars.h"
#include "PHY/MODULATION/modulation_vars.h" #include "PHY/MODULATION/modulation_vars.h"
#include "nfapi/oai_integration/vendor_ext.h"
PHY_VARS_UE ***PHY_vars_UE_g; PHY_VARS_UE ***PHY_vars_UE_g;
RAN_CONTEXT_t RC;
UL_RCC_IND_t UL_RCC_INFO; UL_RCC_IND_t UL_RCC_INFO;
unsigned short rev[2048],rev_times4[8192],rev_half[1024]; unsigned short rev[2048],rev_times4[8192],rev_half[1024];
-1
View File
@@ -31,7 +31,6 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "SCHED/sched_common.h" #include "SCHED/sched_common.h"
-2
View File
@@ -31,7 +31,6 @@
*/ */
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "fapi_l1.h" #include "fapi_l1.h"
@@ -46,7 +45,6 @@
#include <time.h> #include <time.h>
#include "intertask_interface.h"
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
-1
View File
@@ -43,7 +43,6 @@
#include "PHY/defs_eNB.h" #include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
-3
View File
@@ -31,15 +31,12 @@
*/ */
#include "PHY/defs_gNB.h" #include "PHY/defs_gNB.h"
#include "PHY/phy_extern.h"
#include "sched_nr.h" #include "sched_nr.h"
#include "PHY/MODULATION/modulation_common.h" #include "PHY/MODULATION/modulation_common.h"
#include "PHY/MODULATION/nr_modulation.h" #include "PHY/MODULATION/nr_modulation.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
#include "LAYER2/MAC/mac.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/system.h" #include "common/utils/system.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
+1 -1
View File
@@ -440,7 +440,7 @@ void init_channelmod(void) ;
double N_RB2sampling_rate(uint16_t N_RB); double N_RB2sampling_rate(uint16_t N_RB);
double N_RB2channel_bandwidth(uint16_t N_RB); double N_RB2channel_bandwidth(uint16_t N_RB);
#include "targets/RT/USER/rfsim.h" //#include "targets/RT/USER/rfsim.h"
void do_DL_sig(sim_t *sim, void do_DL_sig(sim_t *sim,
uint16_t subframe, uint16_t subframe,
+2 -1
View File
@@ -40,7 +40,8 @@
#include "assertions.h" #include "assertions.h"
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "targets/RT/USER/lte-softmodem.h" //#include "targets/RT/USER/lte-softmodem.h"
#include "executables/softmodem-common.h"
char *get_devname(int devtype) { char *get_devname(int devtype) {
char *devnames[MAX_RF_DEV_TYPE]=DEVTYPE_NAMES; char *devnames[MAX_RF_DEV_TYPE]=DEVTYPE_NAMES;
@@ -45,7 +45,6 @@
#include "common_lib.h" #include "common_lib.h"
#include "ethernet_lib.h" #include "ethernet_lib.h"
#include "common/ran_context.h"
#define DEBUG 0 #define DEBUG 0
+2 -2
View File
@@ -1251,7 +1251,7 @@ extern "C" {
LOG_I(HW,"Actual time source %s...\n",s->usrp->get_time_source(0).c_str()); LOG_I(HW,"Actual time source %s...\n",s->usrp->get_time_source(0).c_str());
sleep(1); sleep(1);
// create tx & rx streamer // create tx & rx streamer
uhd::stream_args_t stream_args_rx("sc12", "sc12"); uhd::stream_args_t stream_args_rx("sc16", "sc12");
int samples=openair0_cfg[0].sample_rate; int samples=openair0_cfg[0].sample_rate;
int max=s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps(); int max=s->usrp->get_rx_stream(stream_args_rx)->get_max_num_samps();
samples/=10000; samples/=10000;
@@ -1268,7 +1268,7 @@ extern "C" {
stream_args_rx.channels.push_back(i); stream_args_rx.channels.push_back(i);
s->rx_stream = s->usrp->get_rx_stream(stream_args_rx); s->rx_stream = s->usrp->get_rx_stream(stream_args_rx);
uhd::stream_args_t stream_args_tx("sc12", "sc12"); uhd::stream_args_t stream_args_tx("sc16", "sc12");
for (int i = 0; i<openair0_cfg[0].tx_num_channels; i++) for (int i = 0; i<openair0_cfg[0].tx_num_channels; i++)
stream_args_tx.channels.push_back(i); stream_args_tx.channels.push_back(i);
-3
View File
@@ -60,10 +60,7 @@
#define MAX_SIMULATION_CONNECTED_NODES 5 #define MAX_SIMULATION_CONNECTED_NODES 5
#define GENERATE_CHANNEL 10 //each frame in DL #define GENERATE_CHANNEL 10 //each frame in DL
// Fixme: datamodel, external variables in .h files, ...
#include <common/ran_context.h>
extern RAN_CONTEXT_t RC;
// //
#define RFSIMU_SECTION "rfsimulator" #define RFSIMU_SECTION "rfsimulator"
+163 -180
View File
@@ -51,7 +51,6 @@
#include "assertions.h" #include "assertions.h"
#include "msc.h" #include "msc.h"
#include "PHY/defs_common.h" #include "PHY/defs_common.h"
#include "PHY/phy_extern.h"
#include "PHY/types.h" #include "PHY/types.h"
#include "PHY/INIT/phy_init.h" #include "PHY/INIT/phy_init.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
@@ -59,23 +58,11 @@
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY_INTERFACE/phy_interface.h" #include "SCHED/sched_common.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
#include "RRC/LTE/rrc_extern.h"
#include "SCHED/sched_eNB.h"
#include "UTIL/OPT/opt.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "UTIL/MATH/oml.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "enb_config.h"
#include "targets/ARCH/COMMON/common_lib.h" #include "targets/ARCH/COMMON/common_lib.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h" #include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "targets/RT/USER/lte-softmodem.h"
//#include "PHY/TOOLS/time_meas.h" //#include "PHY/TOOLS/time_meas.h"
/* these variables have to be defined before including ENB_APP/enb_paramdef.h */ /* these variables have to be defined before including ENB_APP/enb_paramdef.h */
@@ -86,29 +73,24 @@ static int DEFBFW[] = {0x00007fff};
#include "ENB_APP/enb_paramdef.h" #include "ENB_APP/enb_paramdef.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
#ifndef OPENAIR2
#include "UTIL/OTG/otg_extern.h"
#endif
#include "s1ap_eNB.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "T.h" #include "T.h"
#include "pdcp.h"
#define MBMS_EXPERIMENTAL #define MBMS_EXPERIMENTAL
extern volatile int oai_exit; extern volatile int oai_exit;
extern int emulate_rf;
extern int numerology;
extern clock_source_t clock_source; extern clock_source_t clock_source;
#include "executables/thread-common.h" #include "executables/thread-common.h"
//extern PARALLEL_CONF_t get_thread_parallel_conf(void); //extern PARALLEL_CONF_t get_thread_parallel_conf(void);
//extern WORKER_CONF_t get_thread_worker_conf(void); //extern WORKER_CONF_t get_thread_worker_conf(void);
extern void phy_init_RU(RU_t *); extern void phy_init_RU(RU_t *);
void stop_RU(int nb_ru); void prach_procedures(PHY_VARS_eNB *eNB,int br_flag);
void stop_RU(RU_t **rup,int nb_ru);
void do_ru_synch(RU_t *ru); void do_ru_synch(RU_t *ru);
void configure_ru(int idx, void configure_ru(int idx,
@@ -122,8 +104,14 @@ int connect_rau(RU_t *ru);
const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERROR","RU_SYNC"}; const char ru_states[6][9] = {"RU_IDLE","RU_CONFIG","RU_READY","RU_RUN","RU_ERROR","RU_SYNC"};
extern const char NB_functions[7][20];
extern const char NB_timing[2][20];
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
extern const char ru_if_types[MAX_RU_IF_TYPES][20];
#if defined(PRE_SCD_THREAD) #if defined(PRE_SCD_THREAD)
extern uint8_t dlsch_ue_select_tbl_in_use; extern uint8_t dlsch_ue_select_tbl_in_use;
void init_ru_vnf(void); void init_ru_vnf(void);
@@ -139,7 +127,7 @@ extern uint16_t sf_ahead;
// southbound IF5 fronthaul for 16-bit OAI format // southbound IF5 fronthaul for 16-bit OAI format
static inline void fh_if5_south_out(RU_t *ru,int frame, int subframe, uint64_t timestamp) { static inline void fh_if5_south_out(RU_t *ru,int frame, int subframe, uint64_t timestamp) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
send_IF5(ru, timestamp, subframe, &ru->seqno, IF5_RRH_GW_DL); send_IF5(ru, timestamp, subframe, &ru->seqno, IF5_RRH_GW_DL);
} }
@@ -147,7 +135,7 @@ static inline void fh_if5_south_out(RU_t *ru,int frame, int subframe, uint64_t t
// southbound IF5 fronthaul for Mobipass packet format // southbound IF5 fronthaul for Mobipass packet format
static inline void fh_if5_mobipass_south_out(RU_t *ru,int frame, int subframe, uint64_t timestamp) { static inline void fh_if5_mobipass_south_out(RU_t *ru,int frame, int subframe, uint64_t timestamp) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
send_IF5(ru, timestamp, subframe, &ru->seqno, IF5_MOBIPASS); send_IF5(ru, timestamp, subframe, &ru->seqno, IF5_MOBIPASS);
} }
@@ -158,7 +146,7 @@ static inline void fh_if4p5_south_out(RU_t *ru,
int frame, int frame,
int subframe, int subframe,
uint64_t timestamp) { uint64_t timestamp) {
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff ); if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
LOG_D(PHY,"ENTERED fh_if4p5_south_out Sending IF4p5 for frame %d subframe %d ru %d\n",ru->proc.frame_tx,ru->proc.tti_tx,ru->idx); LOG_D(PHY,"ENTERED fh_if4p5_south_out Sending IF4p5 for frame %d subframe %d ru %d\n",ru->proc.frame_tx,ru->proc.tti_tx,ru->idx);
@@ -168,7 +156,7 @@ static inline void fh_if4p5_south_out(RU_t *ru,
LOG_D(PHY,"south_out_cnt %d\n",ru->south_out_cnt); LOG_D(PHY,"south_out_cnt %d\n",ru->south_out_cnt);
} }
/*if (ru == RC.ru[0] || ru == RC.ru[1]) { /*if (ru->idx == 0 || ru->idx == ru) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU+ru->idx, ru->proc.frame_tx );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU+ru->idx, ru->proc.subframe_tx ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_TX0_RU+ru->idx, ru->proc.subframe_tx );
}*/ }*/
@@ -291,7 +279,7 @@ void fh_if4p5_south_in(RU_t *ru,
*subframe = proc->tti_rx; *subframe = proc->tti_rx;
} }
/*if (ru == RC.ru[0] || ru == RC.ru[1]) { /*if (ru->idx == 0 || ru->idx == 1) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU+ru->idx, f ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU+ru->idx, f );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU+ru->idx, sf ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SUBFRAME_NUMBER_RX0_RU+ru->idx, sf );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, f ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_RU, f );
@@ -441,7 +429,7 @@ void fh_if4p5_north_in(RU_t *ru,
ru->north_in_cnt++; ru->north_in_cnt++;
// dump VCD output for first RU in list // dump VCD output for first RU in list
if (ru == RC.ru[0]) { if (ru->idx == 0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, *frame ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, *frame );
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, *subframe ); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, *subframe );
} }
@@ -599,8 +587,8 @@ volatile late_control_e late_control=STATE_BURST_NORMAL;
static void *emulatedRF_thread(void *param) { static void *emulatedRF_thread(void *param) {
RU_proc_t *proc = (RU_proc_t *) param; RU_proc_t *proc = (RU_proc_t *) param;
int microsec = 500; // length of time to sleep, in miliseconds int microsec = 500; // length of time to sleep, in miliseconds
int numerology = 0 ;
struct timespec req = {0}; struct timespec req = {0};
int numerology = get_softmodem_params()->numerology;
req.tv_sec = 0; req.tv_sec = 0;
req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2; req.tv_nsec = (numerology>0)? ((microsec * 1000L)/numerology):(microsec * 1000L)*2;
cpu_set_t cpuset; cpu_set_t cpuset;
@@ -651,7 +639,7 @@ void rx_rf(RU_t *ru,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ, 1 );
old_ts = proc->timestamp_rx; old_ts = proc->timestamp_rx;
if(get_softmodem_params()->emulate_rf) { if(ru->emulate_rf) {
wait_on_condition(&proc->mutex_emulateRF,&proc->cond_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread"); wait_on_condition(&proc->mutex_emulateRF,&proc->cond_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread");
release_thread(&proc->mutex_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread"); release_thread(&proc->mutex_emulateRF,&proc->instance_cnt_emulateRF,"emulatedRF_thread");
rxs = fp->samples_per_tti; rxs = fp->samples_per_tti;
@@ -997,7 +985,7 @@ void *ru_thread_prach( void *param ) {
thread_top_init("ru_thread_prach",1,500000,1000000,20000000); thread_top_init("ru_thread_prach",1,500000,1000000,20000000);
//wait_sync("ru_thread_prach"); //wait_sync("ru_thread_prach");
while (RC.ru_mask>0 && ru->function!=eNodeB_3GPP) { while (*ru->ru_mask>0 && ru->function!=eNodeB_3GPP) {
usleep(1e6); usleep(1e6);
LOG_D(PHY,"%s() RACH waiting for RU to be configured\n", __FUNCTION__); LOG_D(PHY,"%s() RACH waiting for RU to be configured\n", __FUNCTION__);
} }
@@ -1345,11 +1333,9 @@ void fill_rf_config(RU_t *ru,
char *rf_config_file) { char *rf_config_file) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms; LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
openair0_config_t *cfg = &ru->openair0_cfg; openair0_config_t *cfg = &ru->openair0_cfg;
//printf("////////////////numerology in config = %d\n",numerology);
int numerology = get_softmodem_params()->numerology;
if(fp->N_RB_DL == 100) { if(fp->N_RB_DL == 100) {
if(numerology == 0) { if(ru->numerology == 0) {
if (fp->threequarter_fs) { if (fp->threequarter_fs) {
cfg->sample_rate=23.04e6; cfg->sample_rate=23.04e6;
cfg->samples_per_frame = 230400; cfg->samples_per_frame = 230400;
@@ -1361,18 +1347,18 @@ void fill_rf_config(RU_t *ru,
cfg->tx_bw = 10e6; cfg->tx_bw = 10e6;
cfg->rx_bw = 10e6; cfg->rx_bw = 10e6;
} }
} else if(numerology == 1) { } else if(ru->numerology == 1) {
cfg->sample_rate=61.44e6; cfg->sample_rate=61.44e6;
cfg->samples_per_frame = 307200; cfg->samples_per_frame = 307200;
cfg->tx_bw = 20e6; cfg->tx_bw = 20e6;
cfg->rx_bw = 20e6; cfg->rx_bw = 20e6;
} else if(numerology == 2) { } else if(ru->numerology == 2) {
cfg->sample_rate=122.88e6; cfg->sample_rate=122.88e6;
cfg->samples_per_frame = 307200; cfg->samples_per_frame = 307200;
cfg->tx_bw = 40e6; cfg->tx_bw = 40e6;
cfg->rx_bw = 40e6; cfg->rx_bw = 40e6;
} else { } else {
printf("Wrong input for numerology %d\n setting to 20MHz normal CP configuration",numerology); printf("Wrong input for numerology %d\n setting to 20MHz normal CP configuration",ru->numerology);
cfg->sample_rate=30.72e6; cfg->sample_rate=30.72e6;
cfg->samples_per_frame = 307200; cfg->samples_per_frame = 307200;
cfg->tx_bw = 10e6; cfg->tx_bw = 10e6;
@@ -1443,7 +1429,7 @@ int setup_RU_buffers(RU_t *ru) {
else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2; else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2;
else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4; else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4;
if(IS_SOFTMODEM_BASICSIM) if(ru->basicsim)
/* this is required for the basic simulator in TDD mode /* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution * TODO: find a proper cleaner solution
*/ */
@@ -1575,7 +1561,7 @@ static void *ru_thread_tx( void *param ) {
// do OFDM if needed // do OFDM if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx);
if(!(get_softmodem_params()->emulate_rf)) { //if(!emulate_rf){ if(!(ru->emulate_rf)) { //if(!emulate_rf){
// do outgoing fronthaul (south) if needed // do outgoing fronthaul (south) if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru,proc->frame_tx,proc->tti_tx,proc->timestamp_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru,proc->frame_tx,proc->tti_tx,proc->timestamp_tx);
@@ -1670,7 +1656,7 @@ static void *ru_thread( void *param ) {
LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid)); LOG_I(PHY,"thread ru created id=%ld\n", syscall(__NR_gettid));
LOG_I(PHY,"Starting RU %d (%s,%s),\n", ru->idx, NB_functions[ru->function], NB_timing[ru->if_timing]); LOG_I(PHY,"Starting RU %d (%s,%s),\n", ru->idx, NB_functions[ru->function], NB_timing[ru->if_timing]);
if(get_softmodem_params()->emulate_rf) { if(ru->emulate_rf) {
fill_rf_config(ru,ru->rf_config_file); fill_rf_config(ru,ru->rf_config_file);
init_frame_parms(ru->frame_parms,1); init_frame_parms(ru->frame_parms,1);
phy_init_RU(ru); phy_init_RU(ru);
@@ -1681,10 +1667,10 @@ static void *ru_thread( void *param ) {
} }
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
AssertFatal((ret=pthread_mutex_lock(&RC.ru_mutex))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret);
RC.ru_mask &= ~(1<<ru->idx); *ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(ru->ru_cond);
AssertFatal((ret=pthread_mutex_unlock(&RC.ru_mutex))==0,"mutex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret);
ru->state = RU_RUN; ru->state = RU_RUN;
} else if (ru->has_ctrl_prt == 0) { } else if (ru->has_ctrl_prt == 0) {
// There is no control port: start everything here // There is no control port: start everything here
@@ -1702,16 +1688,16 @@ static void *ru_thread( void *param ) {
exit(-1); exit(-1);
} }
AssertFatal((ret=pthread_mutex_lock(&RC.ru_mutex))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret);
RC.ru_mask &= ~(1<<ru->idx); *ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(ru->ru_cond);
AssertFatal((ret=pthread_mutex_unlock(&RC.ru_mutex))==0,"mutex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret);
} }
AssertFatal((ret=pthread_mutex_lock(&RC.ru_mutex))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret);
RC.ru_mask &= ~(1<<ru->idx); *ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(ru->ru_cond);
AssertFatal((ret=pthread_mutex_unlock(&RC.ru_mutex))==0,"mutex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret);
ru->state = RU_RUN; ru->state = RU_RUN;
} }
@@ -1735,7 +1721,7 @@ static void *ru_thread( void *param ) {
} else wait_sync("ru_thread"); } else wait_sync("ru_thread");
LOG_I(PHY,"Got start from control thread\n"); LOG_I(PHY,"Got start from control thread\n");
if(!(get_softmodem_params()->emulate_rf)) { if(!(ru->emulate_rf)) {
if (ru->is_slave == 0) AssertFatal(ru->state == RU_RUN,"ru-%d state = %s != RU_RUN\n",ru->idx,ru_states[ru->state]); if (ru->is_slave == 0) AssertFatal(ru->state == RU_RUN,"ru-%d state = %s != RU_RUN\n",ru->idx,ru_states[ru->state]);
else if (ru->is_slave == 1) AssertFatal(ru->state == RU_SYNC || ru->state == RU_RUN || else if (ru->is_slave == 1) AssertFatal(ru->state == RU_SYNC || ru->state == RU_RUN ||
ru->state == RU_CHECK_SYNC,"ru %d state = %s != RU_SYNC or RU_RUN or RU_CHECK_SYNC\n",ru->idx,ru_states[ru->state]); ru->state == RU_CHECK_SYNC,"ru %d state = %s != RU_SYNC or RU_RUN or RU_CHECK_SYNC\n",ru->idx,ru_states[ru->state]);
@@ -1823,14 +1809,14 @@ static void *ru_thread( void *param ) {
ru->wait_cnt--; ru->wait_cnt--;
LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt); LOG_D(PHY,"RU thread %d, frame %d, subframe %d, wait_cnt %d \n",ru->idx, frame, subframe, ru->wait_cnt);
if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != RC.ru[0]->proc.frame_rx && resynch_done == 0) { if (ru->if_south!=LOCAL_RF && ru->wait_cnt <=20 && subframe == 5 && frame != ru->ru0->proc.frame_rx && resynch_done == 0) {
// Send RRU_frame adjust // Send RRU_frame adjust
RRU_CONFIG_msg_t rru_config_msg; RRU_CONFIG_msg_t rru_config_msg;
rru_config_msg.type = RRU_frame_resynch; rru_config_msg.type = RRU_frame_resynch;
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
((uint16_t *)&rru_config_msg.msg[0])[0] = RC.ru[0]->proc.frame_rx; ((uint16_t *)&rru_config_msg.msg[0])[0] = ru->ru0->proc.frame_rx;
ru->cmd=WAIT_RESYNCH; ru->cmd=WAIT_RESYNCH;
LOG_I(PHY,"Sending Frame Resynch %d to RRU %d\n", RC.ru[0]->proc.frame_rx,ru->idx); LOG_I(PHY,"Sending Frame Resynch %d to RRU %d\n", ru->ru0->proc.frame_rx,ru->idx);
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU\n"); AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU\n");
resynch_done=1; resynch_done=1;
} }
@@ -1888,9 +1874,9 @@ static void *ru_thread( void *param ) {
#ifdef MBMS_EXPERIMENTAL #ifdef MBMS_EXPERIMENTAL
//Workaround ... this must be properly handled //Workaround ... this must be properly handled
if(ru->if_south==LOCAL_RF && ru->function==eNodeB_3GPP && RC.eNB[0][0]!=NULL){ if(ru->if_south==LOCAL_RF && ru->function==eNodeB_3GPP && ru->eNB_list[0]!=NULL){
if(ru->frame_parms->num_MBSFN_config!=RC.eNB[0][0]->frame_parms.num_MBSFN_config){ if(ru->frame_parms->num_MBSFN_config!=ru->eNB_list[0]->frame_parms.num_MBSFN_config){
ru->frame_parms = &RC.eNB[0][0]->frame_parms;//->frame_parms; ru->frame_parms = &ru->eNB_list[0]->frame_parms;//->frame_parms;
LOG_W(PHY,"RU MBSFN SF PARAMS Updated\n"); LOG_W(PHY,"RU MBSFN SF PARAMS Updated\n");
} }
} }
@@ -1905,7 +1891,7 @@ static void *ru_thread( void *param ) {
// do OFDM if needed // do OFDM if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru, proc->frame_tx, proc->tti_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru, proc->frame_tx, proc->tti_tx);
if(!(get_softmodem_params()->emulate_rf)) { //if(!emulate_rf){ if(!(ru->emulate_rf)) { //if(!emulate_rf){
// do outgoing fronthaul (south) if needed // do outgoing fronthaul (south) if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru, proc->frame_tx, proc->tti_tx, proc->timestamp_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru, proc->frame_tx, proc->tti_tx, proc->timestamp_tx);
@@ -1944,7 +1930,7 @@ static void *ru_thread( void *param ) {
printf( "Exiting ru_thread \n"); printf( "Exiting ru_thread \n");
if (!(get_softmodem_params()->emulate_rf)) { if (!(ru->emulate_rf)) {
if (ru->stop_rf != NULL) { if (ru->stop_rf != NULL) {
if (ru->stop_rf(ru) != 0) if (ru->stop_rf(ru) != 0)
LOG_E(HW,"Could not stop the RF device\n"); LOG_E(HW,"Could not stop the RF device\n");
@@ -2162,7 +2148,7 @@ static void *rf_tx( void *param ) {
// do OFDM if needed // do OFDM if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->feptx_ofdm)) ru->feptx_ofdm(ru,proc->frame_tx,proc->tti_tx);
if(!emulate_rf) { if(!ru->emulate_rf) {
// do outgoing fronthaul (south) if needed // do outgoing fronthaul (south) if needed
if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru,proc->frame_tx,proc->tti_tx,proc->timestamp_tx); if ((ru->fh_north_asynch_in == NULL) && (ru->fh_south_out)) ru->fh_south_out(ru,proc->frame_tx,proc->tti_tx,proc->timestamp_tx);
@@ -2315,7 +2301,7 @@ void init_RU_proc(RU_t *ru) {
pthread_create( &proc->pthread_rf_tx, NULL, rf_tx, (void *)ru ); pthread_create( &proc->pthread_rf_tx, NULL, rf_tx, (void *)ru );
#endif #endif
if (get_softmodem_params()->emulate_rf) if (ru->emulate_rf)
pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void *)proc ); pthread_create( &proc->pthread_emulateRF, attr_emulateRF, emulatedRF_thread, (void *)proc );
if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT) if (get_thread_parallel_conf() == PARALLEL_RU_L1_SPLIT || get_thread_parallel_conf() == PARALLEL_RU_L1_TRX_SPLIT)
@@ -2364,10 +2350,10 @@ void init_RU_proc(RU_t *ru) {
if (ru->function == eNodeB_3GPP) { if (ru->function == eNodeB_3GPP) {
usleep(10000); usleep(10000);
LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d,send_dmrs %d) is ready in state %s\n",ru->idx,ru->is_slave,ru->generate_dmrs_sync,ru_states[ru->state]); LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d,send_dmrs %d) is ready in state %s\n",ru->idx,ru->is_slave,ru->generate_dmrs_sync,ru_states[ru->state]);
AssertFatal((ret=pthread_mutex_lock(&RC.ru_mutex))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(ru->ru_mutex))==0,"mutex_lock returns %d\n",ret);
RC.ru_mask &= ~(1<<ru->idx); *ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(ru->ru_cond);
AssertFatal((ret=pthread_mutex_unlock(&RC.ru_mutex))==0,"mutex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(ru->ru_mutex))==0,"mutex_unlock returns %d\n",ret);
} }
} }
@@ -2494,7 +2480,7 @@ void kill_RU_proc(RU_t *ru) {
} }
void init_precoding_weights(PHY_VARS_eNB *eNB) { void init_precoding_weights(RU_t **rup,int nb_RU,PHY_VARS_eNB *eNB) {
int layer,ru_id,aa,re,ue,tb; int layer,ru_id,aa,re,ue,tb;
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms; LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
RU_t *ru; RU_t *ru;
@@ -2508,8 +2494,8 @@ void init_precoding_weights(PHY_VARS_eNB *eNB) {
for (layer=0; layer<4; layer++) { for (layer=0; layer<4; layer++) {
int nb_tx=0; int nb_tx=0;
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<nb_RU; ru_id++) {
ru = RC.ru[ru_id]; ru = rup[ru_id];
nb_tx+=ru->nb_tx; nb_tx+=ru->nb_tx;
} }
@@ -2710,33 +2696,29 @@ void init_RU0(RU_t *ru,int ru_id,char *rf_config_file, int send_dmrssync) {
} }
// This part if on eNB side // This part if on eNB side
void init_RU(char *rf_config_file, int send_dmrssync) { void init_RU(RU_t **rup,int nb_RU,PHY_VARS_eNB ***eNBp,int nb_L1,int *nb_CC,char *rf_config_file, int send_dmrssync) {
int ru_id, i, CC_id; int ru_id, i, CC_id;
RU_t *ru; RU_t *ru;
PHY_VARS_eNB *eNB0 = (PHY_VARS_eNB *)NULL; PHY_VARS_eNB *eNB0 = (PHY_VARS_eNB *)NULL;
LTE_DL_FRAME_PARMS *fp = (LTE_DL_FRAME_PARMS *)NULL; LTE_DL_FRAME_PARMS *fp = (LTE_DL_FRAME_PARMS *)NULL;
// create status mask // create status mask
RC.ru_mask= (1 << RC.nb_RU) - 1; if (nb_CC != NULL)
pthread_mutex_init(&RC.ru_mutex,NULL); for (i=0; i<nb_L1; i++)
pthread_cond_init(&RC.ru_cond,NULL); for (CC_id=0; CC_id<nb_CC[i]; CC_id++) eNBp[i][CC_id]->num_RU=0;
if (RC.nb_CC != 0) LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",nb_RU);
for (i=0; i<RC.nb_L1_inst; i++)
for (CC_id=0; CC_id<RC.nb_CC[i]; CC_id++) RC.eNB[i][CC_id]->num_RU=0;
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU); for (ru_id=0; ru_id<nb_RU; ru_id++) {
LOG_D(PHY,"Process ru[%d]\n",ru_id);
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { ru = rup[ru_id];
LOG_D(PHY,"Process RC.ru[%d]\n",ru_id);
ru = RC.ru[ru_id];
init_RU0(ru,ru_id,rf_config_file,send_dmrssync); init_RU0(ru,ru_id,rf_config_file,send_dmrssync);
ru->ru0 = rup[0];
if (ru->num_eNB > 0) { if (ru->num_eNB > 0) {
LOG_D(PHY, "%s() RC.ru[%d].num_eNB:%d ru->eNB_list[0]:%p RC.eNB[0][0]:%p rf_config_file:%s\n", __FUNCTION__, ru_id, ru->num_eNB, ru->eNB_list[0], RC.eNB[0][0], ru->rf_config_file); LOG_D(PHY, "%s() ru[%d].num_eNB:%d ru->eNB_list[0]:%p eNB[0][0]:%p rf_config_file:%s\n", __FUNCTION__, ru_id, ru->num_eNB, ru->eNB_list[0], eNBp[0][0], ru->rf_config_file);
if (ru->eNB_list[0] == 0) { if (ru->eNB_list[0] == 0) {
LOG_E(PHY,"%s() DJP - ru->eNB_list ru->num_eNB are not initialized - so do it manually\n", __FUNCTION__); LOG_E(PHY,"%s() DJP - ru->eNB_list ru->num_eNB are not initialized - so do it manually\n", __FUNCTION__);
ru->eNB_list[0] = RC.eNB[0][0]; ru->eNB_list[0] = eNBp[0][0];
ru->num_eNB=1; ru->num_eNB=1;
// //
// DJP - feptx_prec() / feptx_ofdm() parses the eNB_list (based on num_eNB) and copies the txdata_F to txdata in RU // DJP - feptx_prec() / feptx_ofdm() parses the eNB_list (based on num_eNB) and copies the txdata_F to txdata in RU
@@ -2814,10 +2796,10 @@ void stop_ru(RU_t *ru) {
} }
void stop_RU(int nb_ru) { void stop_RU(RU_t **rup,int nb_ru) {
for (int inst = 0; inst < nb_ru; inst++) { for (int inst = 0; inst < nb_ru; inst++) {
LOG_I(PHY, "Stopping RU %d processing threads\n", inst); LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
kill_RU_proc(RC.ru[inst]); kill_RU_proc(rup[inst]);
} }
} }
@@ -2834,11 +2816,11 @@ void init_ru_vnf(void) {
dlsch_ue_select_tbl_in_use = 1; dlsch_ue_select_tbl_in_use = 1;
// create status mask // create status mask
RC.ru_mask = 0; RC.ru_mask = 0;
pthread_mutex_init(&RC.ru_mutex,NULL); pthread_mutex_init(ru->ru_mutex,NULL);
pthread_cond_init(&RC.ru_cond,NULL); pthread_cond_init(ru->ru_cond,NULL);
// read in configuration file) // read in configuration file)
printf("configuring RU from file\n"); printf("configuring RU from file\n");
RCconfig_RU(); RC.ru = RCconfig_RU();
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs()); LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_L1_inst,RC.nb_RU,get_nprocs());
if (RC.nb_CC != 0) if (RC.nb_CC != 0)
@@ -2914,180 +2896,181 @@ void init_ru_vnf(void) {
/* --------------------------------------------------------*/ /* --------------------------------------------------------*/
/* from here function to use configuration module */ /* from here function to use configuration module */
void RCconfig_RU(void) { RU_t **RCconfig_RU(int nb_RU,int nb_L1_inst,PHY_VARS_eNB ***eNB,uint64_t *ru_mask,pthread_mutex_t *ru_mutex,pthread_cond_t *ru_cond) {
int i = 0; int i = 0;
paramdef_t RUParams[] = RUPARAMS_DESC; paramdef_t RUParams[] = RUPARAMS_DESC;
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0}; paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL); config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
RU_t **ru=NULL;
if ( RUParamList.numelt > 0) { if ( RUParamList.numelt > 0) {
RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *)); ru = (RU_t **)malloc(nb_RU*sizeof(RU_t *));
for (int j = 0; j < RC.nb_RU; j++) { for (int j = 0; j < nb_RU; j++) {
RC.ru[j] = (RU_t *)malloc(sizeof(RU_t)); ru[j] = (RU_t *)malloc(sizeof(RU_t));
memset((void *)RC.ru[j],0,sizeof(RU_t)); memset((void *)ru[j],0,sizeof(RU_t));
RC.ru[j]->idx = j; ru[j]->idx = j;
printf("Creating RC.ru[%d]:%p\n", j, RC.ru[j]); printf("Creating ru[%d]:%p\n", j, ru[j]);
RC.ru[j]->if_timing = synch_to_ext_device; ru[j]->if_timing = synch_to_ext_device;
if (RC.nb_L1_inst >0) ru[j]->ru_mask = ru_mask;
RC.ru[j]->num_eNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt; ru[j]->ru_mutex = ru_mutex;
ru[j]->ru_cond = ru_cond;
if (nb_L1_inst >0)
ru[j]->num_eNB = RUParamList.paramarray[j][RU_ENB_LIST_IDX].numelt;
else else
RC.ru[j]->num_eNB = 0; ru[j]->num_eNB = 0;
for (i=0; i<RC.ru[j]->num_eNB; i++) RC.ru[j]->eNB_list[i] = RC.eNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0]; for (i=0; i<ru[j]->num_eNB; i++) ru[j]->eNB_list[i] = eNB[RUParamList.paramarray[j][RU_ENB_LIST_IDX].iptr[i]][0];
RC.ru[j]->has_ctrl_prt = 1; ru[j]->has_ctrl_prt = 1;
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) { if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) {
RC.ru[j]->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr)); ru[j]->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr));
} }
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) { if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) {
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) { if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) {
RC.ru[j]->openair0_cfg.clock_source = internal; ru[j]->openair0_cfg.clock_source = internal;
LOG_D(PHY, "RU clock source set as internal\n"); LOG_D(PHY, "RU clock source set as internal\n");
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) {
RC.ru[j]->openair0_cfg.clock_source = external; ru[j]->openair0_cfg.clock_source = external;
LOG_D(PHY, "RU clock source set as external\n"); LOG_D(PHY, "RU clock source set as external\n");
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) {
RC.ru[j]->openair0_cfg.clock_source = gpsdo; ru[j]->openair0_cfg.clock_source = gpsdo;
LOG_D(PHY, "RU clock source set as gpsdo\n"); LOG_D(PHY, "RU clock source set as gpsdo\n");
} else { } else {
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr)); LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
} }
} }
else { else {
RC.ru[j]->openair0_cfg.clock_source = unset; ru[j]->openair0_cfg.clock_source = unset;
} }
if (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) { if (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) {
if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) { if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) {
RC.ru[j]->openair0_cfg.time_source = internal; ru[j]->openair0_cfg.time_source = internal;
LOG_D(PHY, "RU time source set as internal\n"); LOG_D(PHY, "RU time source set as internal\n");
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) {
RC.ru[j]->openair0_cfg.time_source = external; ru[j]->openair0_cfg.time_source = external;
LOG_D(PHY, "RU time source set as external\n"); LOG_D(PHY, "RU time source set as external\n");
} else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) {
RC.ru[j]->openair0_cfg.time_source = gpsdo; ru[j]->openair0_cfg.time_source = gpsdo;
LOG_D(PHY, "RU time source set as gpsdo\n"); LOG_D(PHY, "RU time source set as gpsdo\n");
} else { } else {
LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr)); LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
} }
} }
else { else {
RC.ru[j]->openair0_cfg.time_source = unset; ru[j]->openair0_cfg.time_source = unset;
} }
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) { if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) { if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
RC.ru[j]->if_south = LOCAL_RF; ru[j]->if_south = LOCAL_RF;
RC.ru[j]->function = eNodeB_3GPP; ru[j]->function = eNodeB_3GPP;
RC.ru[j]->state = RU_RUN; ru[j]->state = RU_RUN;
printf("Setting function for RU %d to eNodeB_3GPP\n",j); printf("Setting function for RU %d to eNodeB_3GPP\n",j);
} else { } else {
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr)); ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr)); ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr)); ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr); ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr); ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
// Check if control port set // Check if control port set
if (!(config_isparamset(RUParamList.paramarray[j],RU_REMOTE_PORTC_IDX)) ) { if (!(config_isparamset(RUParamList.paramarray[j],RU_REMOTE_PORTC_IDX)) ) {
printf("Removing control port for RU %d\n",j); printf("Removing control port for RU %d\n",j);
RC.ru[j]->has_ctrl_prt = 0; ru[j]->has_ctrl_prt = 0;
} else { } else {
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr); ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr); ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
printf(" Control port %u \n",RC.ru[j]->eth_params.my_portc); printf(" Control port %u \n",ru[j]->eth_params.my_portc);
} }
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) { if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
RC.ru[j]->if_south = LOCAL_RF; ru[j]->if_south = LOCAL_RF;
RC.ru[j]->function = NGFI_RRU_IF5; ru[j]->function = NGFI_RRU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; ru[j]->eth_params.transp_preference = ETH_UDP_MODE;
printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j); printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j);
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
RC.ru[j]->if_south = LOCAL_RF; ru[j]->if_south = LOCAL_RF;
RC.ru[j]->function = NGFI_RRU_IF5; ru[j]->function = NGFI_RRU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; ru[j]->eth_params.transp_preference = ETH_RAW_MODE;
printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j); printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j);
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
RC.ru[j]->if_south = LOCAL_RF; ru[j]->if_south = LOCAL_RF;
RC.ru[j]->function = NGFI_RRU_IF4p5; ru[j]->function = NGFI_RRU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j); printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j);
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
RC.ru[j]->if_south = LOCAL_RF; ru[j]->if_south = LOCAL_RF;
RC.ru[j]->function = NGFI_RRU_IF4p5; ru[j]->function = NGFI_RRU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j); printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j);
} }
printf("RU %d is_slave=%s\n",j,*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr)); printf("RU %d is_slave=%s\n",j,*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr));
if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) RC.ru[j]->is_slave=1; if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru[j]->is_slave=1;
else RC.ru[j]->is_slave=0; else ru[j]->is_slave=0;
printf("RU %d ota_sync_enabled=%s\n",j,*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr)); printf("RU %d ota_sync_enabled=%s\n",j,*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr));
if (strcmp(*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr), "yes") == 0) RC.ru[j]->ota_sync_enable=1; if (strcmp(*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr), "yes") == 0) ru[j]->ota_sync_enable=1;
else RC.ru[j]->ota_sync_enable=0; else ru[j]->ota_sync_enable=0;
} }
RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt; ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */ /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i]; for (i=0; i<ru[j]->num_bands; i++) ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
} //strcmp(local_rf, "yes") == 0 } //strcmp(local_rf, "yes") == 0
else { else {
printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr)); printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
RC.ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr)); ru[j]->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
RC.ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr)); ru[j]->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr)); ru[j]->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
RC.ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr); ru[j]->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
RC.ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr); ru[j]->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
RC.ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr); ru[j]->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
RC.ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr); ru[j]->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) { if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
RC.ru[j]->if_south = REMOTE_IF5; ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE; ru[j]->eth_params.transp_preference = ETH_UDP_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
RC.ru[j]->if_south = REMOTE_IF5; ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_MODE; ru[j]->eth_params.transp_preference = ETH_RAW_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
RC.ru[j]->if_south = REMOTE_IF4p5; ru[j]->if_south = REMOTE_IF4p5;
RC.ru[j]->function = NGFI_RAU_IF4p5; ru[j]->function = NGFI_RAU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE; ru[j]->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
RC.ru[j]->if_south = REMOTE_IF4p5; ru[j]->if_south = REMOTE_IF4p5;
RC.ru[j]->function = NGFI_RAU_IF4p5; ru[j]->function = NGFI_RAU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE; ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if5_mobipass") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if5_mobipass") == 0) {
RC.ru[j]->if_south = REMOTE_IF5; ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->if_timing = synch_to_other; ru[j]->if_timing = synch_to_other;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF5_MOBIPASS; ru[j]->eth_params.transp_preference = ETH_RAW_IF5_MOBIPASS;
} }
if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) RC.ru[j]->is_slave=1; if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru[j]->is_slave=1;
else RC.ru[j]->is_slave=0; else ru[j]->is_slave=0;
} /* strcmp(local_rf, "yes") != 0 */ } /* strcmp(local_rf, "yes") != 0 */
RC.ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr); ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
RC.ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr); ru[j]->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr);
RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr); ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr); ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
}// j=0..num_rus }// j=0..num_rus
} else { }
RC.nb_RU = 0;
} // setting != NULL
return; return ru;
} }
+17 -32
View File
@@ -61,29 +61,16 @@
#include "PHY/LTE_TRANSPORT/if4_tools.h" #include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h" #include "PHY/LTE_TRANSPORT/if5_tools.h"
#include "PHY/phy_extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h" #include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h" #include "SCHED/sched_eNB.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h" #include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/INIT/phy_init.h" #include "PHY/INIT/phy_init.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
#include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface.h"
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "UTIL/OTG/otg_tx.h"
#include "UTIL/OTG/otg_externs.h"
#include "UTIL/MATH/oml.h"
#include "UTIL/OPT/opt.h"
#include "enb_config.h"
int attach_rru(RU_t *ru); int attach_rru(RU_t *ru);
void configure_ru(int idx, void *arg); void configure_ru(RU_t *ru, void *arg);
void configure_rru(RU_t *ru, void *arg); void configure_rru(RU_t *ru, void *arg);
void fill_rf_config(RU_t *ru, char *rf_config_file); void fill_rf_config(RU_t *ru, char *rf_config_file);
void* ru_thread_control( void* param ); void* ru_thread_control( void* param );
@@ -164,7 +151,7 @@ int send_capab(RU_t *ru)
cap->FH_fmt = MBP_IF5; cap->FH_fmt = MBP_IF5;
break; break;
default: default:
AssertFatal(1==0,"RU_function is unknown %d\n",RC.ru[0]->function); AssertFatal(1==0,"RU_function is unknown %d\n",ru->function);
break; break;
} }
cap->num_bands = ru->num_bands; cap->num_bands = ru->num_bands;
@@ -224,7 +211,7 @@ int attach_rru(RU_t *ru)
LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx); LOG_E(PHY,"Received incorrect message %d from RRU %d\n",rru_config_msg.type,ru->idx);
} }
} }
configure_ru(ru->idx, configure_ru(ru,
(RRU_capabilities_t *)&rru_config_msg.msg[0]); (RRU_capabilities_t *)&rru_config_msg.msg[0]);
rru_config_msg.type = RRU_config; rru_config_msg.type = RRU_config;
@@ -296,7 +283,7 @@ int connect_rau(RU_t *ru)
cap->FH_fmt = MBP_IF5; cap->FH_fmt = MBP_IF5;
break; break;
default: default:
AssertFatal(1==0,"RU_function is unknown %d\n",RC.ru[0]->function); AssertFatal(1==0,"RU_function is unknown %d\n",ru->function);
break; break;
} }
cap->num_bands = ru->num_bands; cap->num_bands = ru->num_bands;
@@ -388,21 +375,20 @@ int check_capabilities(RU_t *ru,
return(-1); return(-1);
} }
void configure_ru(int idx, void configure_ru(RU_t *ru,
void *arg) void *arg)
{ {
RU_t *ru = RC.ru[idx];
RRU_config_t *config = (RRU_config_t *)arg; RRU_config_t *config = (RRU_config_t *)arg;
RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg; RRU_capabilities_t *capabilities = (RRU_capabilities_t*)arg;
int ret; int ret;
LOG_I(PHY, "Received capabilities from RRU %d\n",idx); LOG_I(PHY, "Received capabilities from RRU %d\n",ru->idx);
if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]); if (capabilities->FH_fmt < MAX_FH_FMTs) LOG_I(PHY, "RU FH options %s\n",rru_format_options[capabilities->FH_fmt]);
AssertFatal((ret=check_capabilities(ru,capabilities)) == 0, AssertFatal((ret=check_capabilities(ru,capabilities)) == 0,
"Cannot configure RRU %d, check_capabilities returned %d\n", idx,ret); "Cannot configure RRU %d, check_capabilities returned %d\n", ru->idx,ret);
// take antenna capabilities of RRU // take antenna capabilities of RRU
ru->nb_tx = capabilities->nb_tx[0]; ru->nb_tx = capabilities->nb_tx[0];
ru->nb_rx = capabilities->nb_rx[0]; ru->nb_rx = capabilities->nb_rx[0];
@@ -485,7 +471,6 @@ void configure_rru(RU_t *ru,
static int send_update_rru(RU_t * ru, LTE_DL_FRAME_PARMS * fp){ static int send_update_rru(RU_t * ru, LTE_DL_FRAME_PARMS * fp){
//ssize_t msg_len/*,len*/; //ssize_t msg_len/*,len*/;
int i; int i;
//LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms;
RRU_CONFIG_msg_t rru_config_msg; RRU_CONFIG_msg_t rru_config_msg;
memset((void *)&rru_config_msg,0,sizeof(rru_config_msg)); memset((void *)&rru_config_msg,0,sizeof(rru_config_msg));
rru_config_msg.type = RRU_config_update; rru_config_msg.type = RRU_config_update;
@@ -534,7 +519,7 @@ void* ru_thread_control( void* param )
send_tick(ru); send_tick(ru);
if (ru->state == RU_RUN && ru->if_south != LOCAL_RF){ if (ru->state == RU_RUN && ru->if_south != LOCAL_RF){
LTE_DL_FRAME_PARMS *fp = &RC.eNB[0][0]->frame_parms; LTE_DL_FRAME_PARMS *fp = &ru->eNB_list[0]->frame_parms;
LOG_D(PHY,"Check MBSFN SF changes\n"); LOG_D(PHY,"Check MBSFN SF changes\n");
if(fp->num_MBSFN_config != ru_sf_update){ if(fp->num_MBSFN_config != ru_sf_update){
ru_sf_update = fp->num_MBSFN_config; ru_sf_update = fp->num_MBSFN_config;
@@ -578,7 +563,7 @@ void* ru_thread_control( void* param )
((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_tx[0], ((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_tx[0],
((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_rx[0]); ((RRU_capabilities_t*)&rru_config_msg.msg[0])->nb_rx[0]);
configure_ru(ru->idx,(RRU_capabilities_t *)&rru_config_msg.msg[0]); configure_ru(ru,(RRU_capabilities_t *)&rru_config_msg.msg[0]);
// send config // send config
if (send_config(ru,rru_config_msg) == 0) ru->state = RU_CONFIG; if (send_config(ru,rru_config_msg) == 0) ru->state = RU_CONFIG;
@@ -651,10 +636,10 @@ void* ru_thread_control( void* param )
LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d) is ready in state %s\n",ru->idx,ru->is_slave,ru_states[ru->state]); LOG_I(PHY, "Signaling main thread that RU %d (is_slave %d) is ready in state %s\n",ru->idx,ru->is_slave,ru_states[ru->state]);
pthread_mutex_lock(&RC.ru_mutex); pthread_mutex_lock(ru->ru_mutex);
RC.ru_mask &= ~(1<<ru->idx); *ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(ru->ru_cond);
pthread_mutex_unlock(&RC.ru_mutex); pthread_mutex_unlock(ru->ru_mutex);
wait_sync("ru_thread_control"); wait_sync("ru_thread_control");
@@ -709,10 +694,10 @@ void* ru_thread_control( void* param )
if (ru->state == RU_READY){ if (ru->state == RU_READY){
LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx); LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
pthread_mutex_lock(&RC.ru_mutex); pthread_mutex_lock(ru->ru_mutex);
RC.ru_mask &= ~(1<<ru->idx); *ru->ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(ru->ru_cond);
pthread_mutex_unlock(&RC.ru_mutex); pthread_mutex_unlock(ru->ru_mutex);
wait_sync("ru_thread_control"); wait_sync("ru_thread_control");