Commit 7df4a781 authored by Xenofon Foukas's avatar Xenofon Foukas

Merge remote-tracking branch 'origin/feature-68-enb-agent' into feature-68-uplink

parents a08178fa 3bd3bedc
...@@ -820,6 +820,7 @@ include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/") ...@@ -820,6 +820,7 @@ include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/USERSPACE/LIB/")
include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS") include_directories("${OPENAIR_DIR}/targets/ARCH/EXMIMO/DEFS")
include_directories("${OPENAIR2_DIR}/ENB_APP") include_directories("${OPENAIR2_DIR}/ENB_APP")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC") include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC")
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC")
include_directories("${OPENAIR2_DIR}/UTIL/OSA") include_directories("${OPENAIR2_DIR}/UTIL/OSA")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc") include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
...@@ -905,8 +906,11 @@ if (FLEXRAN_AGENT_SB_IF) ...@@ -905,8 +906,11 @@ if (FLEXRAN_AGENT_SB_IF)
add_library(FLEXRAN_AGENT add_library(FLEXRAN_AGENT
${OPENAIR2_DIR}/ENB_APP/flexran_agent_handler.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_handler.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_common.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_timer.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_common_internal.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c ${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC/flexran_agent_rrc.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_task_manager.c
${OPENAIR2_DIR}/ENB_APP/flexran_agent_net_comm.c ${OPENAIR2_DIR}/ENB_APP/flexran_agent_net_comm.c
......
...@@ -33,6 +33,13 @@ ORIGIN_PATH=$PWD ...@@ -33,6 +33,13 @@ ORIGIN_PATH=$PWD
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0)) THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/tools/build_helper source $THIS_SCRIPT_PATH/tools/build_helper
# set environment variables (OPENAIR_HOME, ...)
set_openair_env
#variables for UE data generation
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
MSC_GEN="False" MSC_GEN="False"
XFORMS="True" XFORMS="True"
FLEXRAN_AGENT_SB_IF="True" FLEXRAN_AGENT_SB_IF="True"
...@@ -55,11 +62,10 @@ T_TRACER="False" ...@@ -55,11 +62,10 @@ T_TRACER="False"
DISABLE_HARDWARE_DEPENDENCY="False" DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE="" CMAKE_BUILD_TYPE=""
UE_AUTOTEST_TRACE="False" UE_AUTOTEST_TRACE="False"
BUILD_ECLIPSE=0
CMAKE_CMD='cmake'
trap handle_ctrl_c INT trap handle_ctrl_c INT
gen_nvram_path=$OPENAIR_DIR/targets/bin
conf_nvram_path=$OPENAIR_DIR/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
function print_help() { function print_help() {
echo_info " echo_info "
This program installs OpenAirInterface Software This program installs OpenAirInterface Software
...@@ -141,6 +147,8 @@ Options ...@@ -141,6 +147,8 @@ Options
Disable HW dependency during installation Disable HW dependency during installation
--ue-autotest-trace --ue-autotest-trace
Enable specific traces for UE autotest framework Enable specific traces for UE autotest framework
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
Usage (first build): Usage (first build):
oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files oaisim (eNB + UE): ./build_oai -I --oaisim -x --install-system-files
Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files Eurecom EXMIMO + COTS UE : ./build_oai -I --eNB -x --install-system-files
...@@ -179,6 +187,7 @@ function main() { ...@@ -179,6 +187,7 @@ function main() {
GDB=1 GDB=1
CMAKE_BUILD_TYPE="Debug" CMAKE_BUILD_TYPE="Debug"
echo_info "Will Compile with gdb symbols and disable compiler optimization" echo_info "Will Compile with gdb symbols and disable compiler optimization"
CMAKE_CMD="$CMAKE_CMD -DCMAKE_BUILD_TYPE=Debug"
shift;; shift;;
--eNB) --eNB)
eNB=1 eNB=1
...@@ -311,6 +320,11 @@ function main() { ...@@ -311,6 +320,11 @@ function main() {
UHD_IMAGES_DIR=$2 UHD_IMAGES_DIR=$2
echo_info "Downloading UHD images in the indicated location" echo_info "Downloading UHD images in the indicated location"
shift 2;; shift 2;;
--build-eclipse)
BUILD_ECLIPSE=1
CMAKE_CMD="$CMAKE_CMD"' -DCMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT=TRUE -G"Eclipse CDT4 - Unix Makefiles"'
echo_info "Enabling build eclipse project support"
shift 1;;
-h | --help) -h | --help)
print_help print_help
exit 1;; exit 1;;
...@@ -321,6 +335,9 @@ function main() { ...@@ -321,6 +335,9 @@ function main() {
esac esac
done done
CMAKE_CMD="$CMAKE_CMD .."
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 RRH and eNB
######################################################### #########################################################
...@@ -391,7 +408,6 @@ function main() { ...@@ -391,7 +408,6 @@ function main() {
echo_info "2. Setting the OAI PATHS ..." echo_info "2. Setting the OAI PATHS ..."
set_openair_env
cecho "OPENAIR_DIR = $OPENAIR_DIR" $green cecho "OPENAIR_DIR = $OPENAIR_DIR" $green
# for conf files copy in this bash script # for conf files copy in this bash script
...@@ -495,7 +511,7 @@ function main() { ...@@ -495,7 +511,7 @@ function main() {
fi fi
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$lte_build_dir/build cd $DIR/$lte_build_dir/build
cmake .. eval $CMAKE_CMD
fi fi
if [ "$eNB" = "1" -o "$UE" = "1" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
...@@ -524,7 +540,7 @@ function main() { ...@@ -524,7 +540,7 @@ function main() {
# mkdir -p $DIR/at_commands/build # mkdir -p $DIR/at_commands/build
# cd $DIR/at_commands/build # cd $DIR/at_commands/build
# cmake .. # eval $CMAKE_CMD
# compilations \ # compilations \
# at_commands at_nas_ue \ # at_commands at_nas_ue \
# at_nas_ue $dbin/at_nas_ue # at_nas_ue $dbin/at_nas_ue
...@@ -533,7 +549,7 @@ function main() { ...@@ -533,7 +549,7 @@ function main() {
mkdir -p $DIR/nas_sim_tools/build mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
nas_sim_tools usim \ nas_sim_tools usim \
usim $dbin/usim usim $dbin/usim
...@@ -562,7 +578,7 @@ function main() { ...@@ -562,7 +578,7 @@ function main() {
mkdir -p build mkdir -p build
cd build cd build
rm -f *sim rm -f *sim
cmake .. eval $CMAKE_CMD
fi fi
if [ "$SIMUS_PHY" = "1" ] ; then if [ "$SIMUS_PHY" = "1" ] ; then
...@@ -640,7 +656,7 @@ function main() { ...@@ -640,7 +656,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build [ "$CLEAN" = "1" ] && rm -rf $DIR/$oaisim_build_dir/build
mkdir -p $DIR/$oaisim_build_dir/build mkdir -p $DIR/$oaisim_build_dir/build
cd $DIR/$oaisim_build_dir/build cd $DIR/$oaisim_build_dir/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
$oaisim_build_dir $oaisim_exec \ $oaisim_build_dir $oaisim_exec \
$oaisim_exec $dbin/$oaisim_exec.$REL $oaisim_exec $dbin/$oaisim_exec.$REL
...@@ -651,7 +667,7 @@ function main() { ...@@ -651,7 +667,7 @@ function main() {
echo_info "Compiling at_nas_ue" echo_info "Compiling at_nas_ue"
mkdir -p $DIR/at_commands/build mkdir -p $DIR/at_commands/build
cd $DIR/at_commands/build cd $DIR/at_commands/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
at_commands at_nas_ue \ at_commands at_nas_ue \
at_nas_ue $dbin/at_nas_ue at_nas_ue $dbin/at_nas_ue
...@@ -665,7 +681,7 @@ function main() { ...@@ -665,7 +681,7 @@ function main() {
[ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build [ "$CLEAN" = "1" ] && rm -rf $DIR/nas_sim_tools/build
mkdir -p $DIR/nas_sim_tools/build mkdir -p $DIR/nas_sim_tools/build
cd $DIR/nas_sim_tools/build cd $DIR/nas_sim_tools/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
nas_sim_tools usim \ nas_sim_tools usim \
usim $dbin/usim usim $dbin/usim
...@@ -722,7 +738,7 @@ function main() { ...@@ -722,7 +738,7 @@ function main() {
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build #[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
#mkdir -p $DIR/oaisim_mme_build_oai/build #mkdir -p $DIR/oaisim_mme_build_oai/build
#cd $DIR/oaisim_mme_build_oai/build #cd $DIR/oaisim_mme_build_oai/build
#cmake .. #eval $CMAKE_CMD
#compilations \ #compilations \
# oaisim_mme_build_oai oaisim_mme \ # oaisim_mme_build_oai oaisim_mme \
# oaisim_mme $dbin/oaisim_mme.$REL # oaisim_mme $dbin/oaisim_mme.$REL
...@@ -752,7 +768,7 @@ function main() { ...@@ -752,7 +768,7 @@ function main() {
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build cd $DIR/$rrh_build_dir/build
cmake .. eval $CMAKE_CMD
compilations \ compilations \
rrh_gw rrh_gw \ rrh_gw rrh_gw \
rrh_gw $dbin/rrh_gw rrh_gw $dbin/rrh_gw
...@@ -761,9 +777,9 @@ function main() { ...@@ -761,9 +777,9 @@ function main() {
# build RF device and transport protocol libraries # build RF device and transport protocol libraries
##################################### #####################################
if [ "$eNB" = "1" -o "$RRH" = "1" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" -o "$RRH" = "1" ] ; then
if [ "$eNB" = "1" ] ; then if [ "$eNB" = "1" -o "$UE" = "1" ] ; then
build_dir=$lte_build_dir build_dir=$lte_build_dir
else else
build_dir=$rrh_build_dir build_dir=$rrh_build_dir
...@@ -847,7 +863,7 @@ fi ...@@ -847,7 +863,7 @@ fi
[ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build [ "$CLEAN" = "1" ] && rm -rf $OPENAIR_DIR/cmake_targets/doxygen/build
mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build mkdir -p $OPENAIR_DIR/cmake_targets/doxygen/build
cd $OPENAIR_DIR/cmake_targets/doxygen/build cd $OPENAIR_DIR/cmake_targets/doxygen/build
cmake .. eval $CMAKE_CMD
make doc make doc
) >& $doxygen_log ) >& $doxygen_log
fi fi
......
#!/bin/bash
#sudo ./build_oai -c -C -I --install-optional-packages --install-system-files --UE -w USRP -V
#sudo ./build_oai -c -C -I --install-optional-packages --UE -w USRP -V
#sudo ./build_oai -c -C --UE -w USRP -V
sudo ./build_oai -c -C --UE -w USRP
#sudo ./build_oai -c -C --UE -w USRP --build-eclipse
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
# #
####################################### #######################################
LTEIF=oip0 LTEIF=oip1
#OPENAIR_DIR=/home/oai/svn-oai/openair4G #OPENAIR_DIR=/home/oai/svn-oai/openair4G
load_module() { load_module() {
...@@ -48,11 +48,11 @@ load_module() { ...@@ -48,11 +48,11 @@ load_module() {
sudo insmod $1 sudo insmod $1
} }
load_module $OPENAIR_DIR/targets/bin/ue_ip.ko load_module ../../targets/bin/ue_ip.ko
if [ "$1" = "UE" ]; then if [ "$1" = "UE" ]; then
echo "bring up oip0 interface for UE" echo "bring up $LTEIF interface for UE"
ifconfig oip0 up ifconfig $LTEIF up
fi fi
ip route flush cache ip route flush cache
......
#!/bin/bash
# Carrier frequency in Hz
#FREQ=2660000000 #FDD
FREQ=2350000000 #TDD
NRB=50
TA=0
#9:trace, 8/7:debug, 6:info, 4:warn, 3:error
LOGLEVEL=6
#enable or disable soft scope
#SCOPE=''
SCOPE='-d'
#enable or disable VCD logging
VCD=''
#VCD='-V'
ISTDD='-T'
#ISTDD=''
#use external clock
ECLK="--external-clock"
#ECLK=""
#UE scan carrier
#ISSCAN="--ue-scan-carrier"
ISSCAN=""
sudo sh -c './init_nas_s1 UE'
cd ../../targets/bin/
sudo -E ./lte-softmodem.Rel10 -U -C$FREQ -r$NRB $ISSCAN --ue-txgain 70 --ue-rxgain 80 -A $TA $ECLK -W $ISTDD -g $LOGLEVEL $SCOPE 2>&1 | sudo tee /tmp/UE.log
...@@ -2,4 +2,6 @@ This directory contains files related to initialization of variables/structures ...@@ -2,4 +2,6 @@ This directory contains files related to initialization of variables/structures
init_top.c : initialize top-level variables and signal buffers, FFT twiddle factors, etc. init_top.c : initialize top-level variables and signal buffers, FFT twiddle factors, etc.
lte_init.c : LTE specific initlization routines (DLSCH/ULSCH signal buffers for RX, data buffers for TX, etc.) lte_init.c : LTE specific initlization routines (DLSCH/ULSCH signal buffers for RX, data buffers for TX, etc.)
init.c : non-LTE initialization routines (to be removed) lte_param_init.c: used only in unitary simulations. initializes the global variables eNB and UE.
lte_parms.c: contains init_frame_parms to initialize frame parameters structure
...@@ -4799,7 +4799,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format, ...@@ -4799,7 +4799,7 @@ int check_dci_format1_1a_coherency(DCI_format_t dci_format,
return(0); return(0);
} }
if(harq_pid >8) if(harq_pid>=8)
{ {
LOG_I(PHY,"bad harq id \n"); LOG_I(PHY,"bad harq id \n");
return(0); return(0);
...@@ -5013,7 +5013,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format, ...@@ -5013,7 +5013,7 @@ int check_dci_format2_2a_coherency(DCI_format_t dci_format,
#endif #endif
// I- check dci content minimum coherency // I- check dci content minimum coherency
if(harq_pid >8) if(harq_pid>=8)
{ {
LOG_I(PHY,"bad harq pid\n"); LOG_I(PHY,"bad harq pid\n");
return(0); return(0);
......
...@@ -258,7 +258,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue, ...@@ -258,7 +258,7 @@ int generate_ue_ulsch_params_from_rar(PHY_VARS_UE *ue,
if (ulsch->harq_processes[harq_pid]->nb_rb > 4) { if (ulsch->harq_processes[harq_pid]->nb_rb > 4) {
msg("rar_tools.c: unlikely rb count for RAR grant : nb_rb > 3\n"); msg("rar_tools.c: unlikely rb count for RAR grant : nb_rb > 3\n");
return(-1); // return(-1);
} }
// ulsch->harq_processes[harq_pid]->Ndi = 1; // ulsch->harq_processes[harq_pid]->Ndi = 1;
......
...@@ -242,7 +242,7 @@ uint32_t ulsch_encoding(uint8_t *a, ...@@ -242,7 +242,7 @@ uint32_t ulsch_encoding(uint8_t *a,
return(-1); return(-1);
} }
if (harq_pid > 7) { if (harq_pid >= 8) {
LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid); LOG_E(PHY,"Illegal harq_pid %d\n",harq_pid);
return(-1); return(-1);
} }
......
...@@ -402,7 +402,7 @@ void ulsch_modulation(int32_t **txdataF, ...@@ -402,7 +402,7 @@ void ulsch_modulation(int32_t **txdataF,
// x1 is set in lte_gold_generic // x1 is set in lte_gold_generic
x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 x2 = (ulsch->rnti<<14) + (subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
if (harq_pid > 7) { if (harq_pid>=8) {
printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid); printf("ulsch_modulation.c: Illegal harq_pid %d\n",harq_pid);
return; return;
} }
......
...@@ -493,7 +493,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -493,7 +493,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int16_t **chest_f; int16_t **chest_f;
int16_t *pdsch_llr; int16_t *pdsch_llr;
int16_t *pdsch_comp; int16_t *pdsch_comp;
int8_t *pdcch_llr; int16_t *pdsch_mag;
int8_t *pdcch_llr;
int16_t *pdcch_comp; int16_t *pdcch_comp;
int8_t *pbch_llr; int8_t *pbch_llr;
int16_t *pbch_comp; int16_t *pbch_comp;
...@@ -571,6 +572,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -571,6 +572,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0 pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->llr[0]; // stream 0
// pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0 // pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0]; pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->rxdataF_comp0[0];
pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[subframe&0x1][eNB_id]->dl_ch_mag0[0];
// Received signal in time domain of receive antenna 0 // Received signal in time domain of receive antenna 0
if (rxsig_t != NULL) { if (rxsig_t != NULL) {
...@@ -752,8 +754,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form, ...@@ -752,8 +754,9 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
for (k=0; k<frame_parms->symbols_per_tti; k++) { for (k=0; k<frame_parms->symbols_per_tti; k++) {
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) { for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
I[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i]; int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
Q[ind] = pdsch_comp[(2*frame_parms->N_RB_DL*12*k)+4*i+1]; I[ind] = (pdsch_mag[j ]!=0? 1.0/pdsch_mag[j ]: 0.0) * pdsch_comp[j ]*1.0;
Q[ind] = (pdsch_mag[j+1]!=0? 1.0/pdsch_mag[j+1]: 0.0) * pdsch_comp[j+1]*1.0;
ind++; ind++;
} }
} }
......
This folder contains the software for the device driver of CBMIMO1 and the physical layer signal processing. This folder contains the software for the device driver of CBMIMO1 and the physical layer signal processing.
|-- ARCH // contains drivers for hardware
| |-- CBMIMO1 // contains everything related to CBMIMO1
| | `-- DEVICE_DRIVER
| | |-- Makefile // main Makefile used to compile the driver; usually invoked from the top level Makefile
| | |-- cbmimo1_device.c // main file for device driver (initializes the card, bigphys, main variables)
| | |-- cbmimo1_device.h
| | |-- cbmimo1_dma.c
| | |-- cbmimo1_fileops.c // file that processes IOCTL commands coming from the userspace control utility (USERSPACE_TOOLS/OPENAIR_RF/)
| | |-- cbmimo1_generate_fs4.c // generates test signals (DEBUGGING)
| | |-- cbmimo1_generate_ofdm.c // generates test signals (DEBUGGING)
| | |-- cbmimo1_get_frame.c // code to grab a frame from the card
| | |-- cbmimo1_init.c // code to set up the registers of the card
| | |-- cbmimo1_pci.h
| | |-- cbmimo1_proc.c // generates the proc entries /proc/openair1/bch_stats and /proc/openair1/openair1_state
| | |-- cbmimo1_rf_cntl.c // controls the RF chipset on the card
| | |-- cbmimo1_test.c
| | |-- from_grlib_softconfig.h
| | |-- from_grlib_softregs.h
| | |-- defs.h
| | |-- extern.h
| | `-- vars.h
| |-- COMMON // common for all hardware (mainly bigphys)
| |-- EXPRESS_MIMO // contains everything related to EXPRESS MIMO
|-- DOCS // Documentation
| |-- DOXYGEN // Automaitcally generated DOXYGEN documentation in latex and html
| `-- PAPERS // papers related to openair1
|-- EMOS // this contains everything related to Eurecom MIMO Openair Sounder (EMOS)
| |-- DOC
| |-- DUMP // program that dumps channel estimate to disk using a FIFO
| |-- GUI
| |-- MATLAB // Matlab code to process measurements
| |-- SIM // EMOS simulator (for DEBUGGING)
| `-- UTIL
|-- MAC_INTERFACE // interface with MAC layer (in openair2)
|-- PHY // contains all signal processing related to physical layer (used in real-time AND simulation) |-- PHY // contains all signal processing related to physical layer (used in real-time AND simulation)
General remarks: every directory contains at least defs.h (for declaration of structure and functions), vars.h (for definitions of variables), and extern.h (variables are defined only once in cbmimo1_device.c (for real-time HW operation) or a top-level simulation (in SIMULATION/xxx), if variables are needed in another file, use extern.h) General remarks: every directory contains at least defs.h (for declaration of structure and functions), vars.h (for definitions of variables), and extern.h (variables are defined only once in cbmimo1_device.c (for real-time HW operation) or a top-level simulation (in SIMULATION/xxx), if variables are needed in another file, use extern.h)
...@@ -57,17 +22,19 @@ General remarks: every directory contains at least defs.h (for declaration of st ...@@ -57,17 +22,19 @@ General remarks: every directory contains at least defs.h (for declaration of st
| |-- spec_defs_top.h | |-- spec_defs_top.h
| |-- types.h | |-- types.h
| `-- vars.h | `-- vars.h
|-- SCHED // schedules the different PHY functions according to the nodes role (CH=BS, MR=UE) |-- SCHED // schedules the different PHY functions according to the nodes role
| |-- defs.h | |-- defs.h
| |-- extern.h | |-- extern.h
| |-- phy_procedures.c // non-LTE PHY procedures this is used in synchronized mode to schedule the slot processing
| |-- phy_procedures_emos.c // non-LTE PHY procedures for EMOS | |-- phy_procedures_emos.c // non-LTE PHY procedures for EMOS
| |-- phy_procedures_emos.h | |-- phy_procedures_emos.h
| |-- phy_procedures_lte_eNb.c // LTE PHY procedures for eNB (from 36-213) | |-- phy_procedures_lte_eNb.c // LTE PHY procedures for eNB (from 36-213)
| |-- phy_procedures_lte_ue.c // LTE PHY procedures for UE (from 36-213) | |-- phy_procedures_lte_ue.c // LTE PHY procedures for UE (from 36-213)
| |-- phy_procedures_lte_common.c // LTE PHY procedures common for UE and eNB (from 36-213)
| |-- phy_mac_stub.c //MAC stub that generates channels when used in phy-test-mode
| |-- pucch_pc.c // power control for PUCCH
| |-- pusch_pc.c // power control for PUSCH
| |-- srs_pc.c // power control for SRS
| |-- rt_compat.h | |-- rt_compat.h
| |-- sched.c // contains the top level scheduler (only for CBMIMO1 HW)
| |-- sched_lte.c // same as sched.c for LTE (only for CBMIMO1 HW)
| `-- vars.h | `-- vars.h
|-- SIMULATION // contains simulation routines to test PHY |-- SIMULATION // contains simulation routines to test PHY
| |-- LTE_PHY // LTE simulation testbenches for unitary simulation of transport/physical channels | |-- LTE_PHY // LTE simulation testbenches for unitary simulation of transport/physical channels
...@@ -76,17 +43,9 @@ General remarks: every directory contains at least defs.h (for declaration of st ...@@ -76,17 +43,9 @@ General remarks: every directory contains at least defs.h (for declaration of st
| | |-- dlsim.c // PDSCH simulation testbench | | |-- dlsim.c // PDSCH simulation testbench
| | |-- ulsim.c // PUSCH simulation testbench | | |-- ulsim.c // PUSCH simulation testbench
| | |-- pucchsim.c // PUCCH simulation testbench | | |-- pucchsim.c // PUCCH simulation testbench
| |-- LTE_PHY_L2 // LTE simulation testbench for full system simulation (PHY,MAC,RLC,RRC,PDCP)
| `-- TOOLS
| |-- RF | |-- RF
|-- USERSPACE_TOOLS // tools that run in userspace (not kernel) | |-- ETH_TRANSPORT
| |-- OCTAVE | `-- TOOLS
| | |-- AGILE_RF_TOOLS // octave tools to test agile RF
| | |-- CBMIMO1_TOOLS // octave interface for CBMIMO1
| | |-- GPIB // octave tools to control signal generator (used for calibration)
| | `-- PHY_SIM // octave implementation of sync
| |-- OPENAIR_RF // tool to interface with the device driver using IOCTL
| |-- SCOPE // tool to visualize data from PHY (channel estimates, IQ plots, etc.). Communicates with kernel module using shared memory.
| `-- SENSING // tools related to sensing
...@@ -190,7 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) { ...@@ -190,7 +190,7 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
eNB = PHY_vars_eNB_g[Mod_idP][CC_id]; eNB = PHY_vars_eNB_g[Mod_idP][CC_id];
for (i=0; i<NUMBER_OF_UE_MAX; i++) { for (i=0; i<NUMBER_OF_UE_MAX; i++) {
if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) { if ((eNB->dlsch[i]==NULL) || (eNB->ulsch[i]==NULL)) {
MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rnti); MSC_LOG_EVENT(MSC_PHY_ENB, "0 Failed remove ue %"PRIx16" (ENOMEM)", rntiP);
LOG_E(PHY,"Can't remove UE, not enough memory allocated\n"); LOG_E(PHY,"Can't remove UE, not enough memory allocated\n");
return(-1); return(-1);
} else { } else {
......
...@@ -633,7 +633,13 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type, ...@@ -633,7 +633,13 @@ PUCCH_FMT_t get_pucch_format(lte_frame_type_t frame_type,
} }
if(SR_payload == 1) if(SR_payload == 1)
{ {
return pucch_format1; if (frame_type == FDD) {
return pucch_format1;
} else if (frame_type == TDD) {
return pucch_format1b;
} else {
AssertFatal(1==0,"Unknown frame_type");
}
} }
} }
else else
...@@ -729,7 +735,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, ...@@ -729,7 +735,7 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
} else if (subframe == 8) { // ACK subframes 4 } else if (subframe == 8) { // ACK subframes 4
candidate_dl[0] = 4; candidate_dl[0] = 4;
} else { } else {
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n", LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal tx-subframe %d for tdd_config %d\n",
ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config); ue->Mod_id,proc->frame_tx,subframe,frame_parms->tdd_config);
return(0); return(0);
} }
...@@ -743,8 +749,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue, ...@@ -743,8 +749,8 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
} }
} }
if (last_dl >= 10) { if (last_dl >= 10) {
LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal subframe %d for tdd_config %d\n", LOG_E(PHY,"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal rx-subframe %d (tx-subframe %d) for tdd_config %d\n",
ue->Mod_id,proc->frame_tx,last_dl,frame_parms->tdd_config); ue->Mod_id,proc->frame_tx,last_dl,subframe,frame_parms->tdd_config);
return (0); return (0);
} }
...@@ -1775,13 +1781,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1775,13 +1781,13 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
} }
} }
ack_status_cw0 = reset_ack(&ue->frame_parms, ack_status_cw0 = get_ack(&ue->frame_parms,
ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack, ue->dlsch[proc->subframe_rx&0x1][eNB_id][0]->harq_ack,
subframe_tx, subframe_tx,
pucch_ack_payload, pucch_ack_payload,
0); 0);
ack_status_cw1 = reset_ack(&ue->frame_parms, ack_status_cw1 = get_ack(&ue->frame_parms,
ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack, ue->dlsch[proc->subframe_rx&0x1][eNB_id][1]->harq_ack,
subframe_tx, subframe_tx,
pucch_ack_payload, pucch_ack_payload,
...@@ -3236,7 +3242,8 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo ...@@ -3236,7 +3242,8 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo
ue->prach_resources[eNB_id]->ra_RNTI, ue->prach_resources[eNB_id]->ra_RNTI,
dlsch0->harq_processes[0]->b, dlsch0->harq_processes[0]->b,
&ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti, &ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti,
ue->prach_resources[eNB_id]->ra_PreambleIndex); ue->prach_resources[eNB_id]->ra_PreambleIndex,
dlsch0->harq_processes[0]->b); // alter the 'b' buffer so it contains only the selected RAR header and RAR payload
ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti; ue->pdcch_vars[(subframe_rx+1) & 0x1][eNB_id]->crnti = ue->pdcch_vars[subframe_rx & 0x1][eNB_id]->crnti;
......
...@@ -1301,7 +1301,7 @@ int main(int argc, char **argv) ...@@ -1301,7 +1301,7 @@ int main(int argc, char **argv)
unsigned int ret; unsigned int ret;
unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0; unsigned int coded_bits_per_codeword=0,nsymb; //,tbs=0;
unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors=0;//,num_layers; unsigned int tx_lev=0,tx_lev_dB=0,trials,errs[4]= {0,0,0,0},errs2[4]= {0,0,0,0},round_trials[4]= {0,0,0,0},dci_errors[4]={0,0,0,0};//,num_layers;
//int re_allocated; //int re_allocated;
char fname[32],vname[32]; char fname[32],vname[32];
FILE *bler_fd; FILE *bler_fd;
...@@ -1998,7 +1998,7 @@ int main(int argc, char **argv) ...@@ -1998,7 +1998,7 @@ int main(int argc, char **argv)
} }
*/ */
UE->pdcch_vars[0][0]->crnti = n_rnti; UE->pdcch_vars[subframe & 0x1][0]->crnti = n_rnti;
// Fill in UL_alloc // Fill in UL_alloc
UL_alloc_pdu.type = 0; UL_alloc_pdu.type = 0;
...@@ -2246,7 +2246,10 @@ int main(int argc, char **argv) ...@@ -2246,7 +2246,10 @@ int main(int argc, char **argv)
round_trials[2] = 0; round_trials[2] = 0;
round_trials[3] = 0; round_trials[3] = 0;
dci_errors=0; dci_errors[0]=0;
dci_errors[1]=0;
dci_errors[2]=0;
dci_errors[3]=0;
// avg_ber = 0; // avg_ber = 0;
round=0; round=0;
...@@ -2499,6 +2502,9 @@ int main(int argc, char **argv) ...@@ -2499,6 +2502,9 @@ int main(int argc, char **argv)
if (UE->dlsch[subframe&0x1][0][0]->active == 0) { if (UE->dlsch[subframe&0x1][0][0]->active == 0) {
//printf("DCI not received\n"); //printf("DCI not received\n");
dci_errors[round]++;
UE->dlsch_errors[0] = 1;
/* /*
write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1); write_output("pdcchF0_ext.m","pdcchF_ext", UE->pdcch_vars[eNB_id]->rxdataF_ext[0],2*3*UE->frame_parms.ofdm_symbol_size,1,1);
write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1); write_output("pdcch00_ch0_ext.m","pdcch00_ch0_ext",UE->pdcch_vars[eNB_id]->dl_ch_estimates_ext[0],12*UE->frame_parms.N_RB_DL*3,1,1);
...@@ -2837,13 +2843,13 @@ int main(int argc, char **argv) ...@@ -2837,13 +2843,13 @@ int main(int argc, char **argv)
double std_phy_proc_rx_demod=0; double std_phy_proc_rx_demod=0;
double std_phy_proc_rx_dec=0; double std_phy_proc_rx_dec=0;
effective_rate = ((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3])); effective_rate = 1.0-((double)(errs[0]+errs[1]+errs[2]+errs[3])/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
printf("\n**********************SNR = %f dB (tx_lev %f)**************************\n", printf("\n**********************SNR = %f dB (tx_lev %f)**************************\n",
SNR, SNR,
(double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12))); (double)tx_lev_dB+10*log10(UE->frame_parms.ofdm_symbol_size/(NB_RB*12)));
printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f (%2.1f%%,%f, %f), normalized delay %f (%f)\n", printf("Errors (%d(%d)/%d %d/%d %d/%d %d/%d), Pe = (%e,%e,%e,%e), dci_errors %d/%d, Pe = %e => effective rate %f, normalized delay %f (%f)\n",
errs[0], errs[0],
errs2[0], errs2[0],
round_trials[0], round_trials[0],
...@@ -2857,13 +2863,13 @@ int main(int argc, char **argv) ...@@ -2857,13 +2863,13 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]), (double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[3]/(round_trials[0]),
dci_errors, dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3],
round_trials[0], round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3],
(double)dci_errors/(round_trials[0]), (double)(dci_errors[0]+dci_errors[1]+dci_errors[2]+dci_errors[3])/(round_trials[0]+round_trials[1]+round_trials[2]+round_trials[3]),
rate*effective_rate, //rate*effective_rate,
100*effective_rate, 100*effective_rate,
rate, //rate,
rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs), //rate*get_Qm(UE->dlsch[subframe&0x1][0][0]->harq_processes[UE->dlsch[subframe&0x1][0][0]->current_harq_pid]->mcs),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
...@@ -2986,7 +2992,7 @@ int main(int argc, char **argv) ...@@ -2986,7 +2992,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
} else { } else {
fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
SNR, SNR,
...@@ -3002,7 +3008,7 @@ int main(int argc, char **argv) ...@@ -3002,7 +3008,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
} }
...@@ -3035,7 +3041,7 @@ int main(int argc, char **argv) ...@@ -3035,7 +3041,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;", fprintf(time_meas_fd,"%f;%d;%d;%f; %2.1f%%;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
...@@ -3058,9 +3064,9 @@ int main(int argc, char **argv) ...@@ -3058,9 +3064,9 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]), (double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[3]/(round_trials[0]),
dci_errors, dci_errors[0],
round_trials[0], round_trials[0],
(double)dci_errors/(round_trials[0]), (double)dci_errors[0]/(round_trials[0]),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
...@@ -3079,7 +3085,7 @@ int main(int argc, char **argv) ...@@ -3079,7 +3085,7 @@ int main(int argc, char **argv)
round_trials[2], round_trials[2],
errs[3], errs[3],
round_trials[3], round_trials[3],
dci_errors); dci_errors[0]);
//fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n"); //fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;", fprintf(time_meas_fd,"%f;%d;%d;%d;%d;%f;%2.1f;%f;%f;%d;%d;%d;%d;%d;%d;%d;%d;%e;%e;%e;%e;%d;%d;%e;%f;%f;",
...@@ -3103,9 +3109,9 @@ int main(int argc, char **argv) ...@@ -3103,9 +3109,9 @@ int main(int argc, char **argv)
(double)errs[1]/(round_trials[0]), (double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]), (double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]), (double)errs[3]/(round_trials[0]),
dci_errors, dci_errors[0],
round_trials[0], round_trials[0],
(double)dci_errors/(round_trials[0]), (double)dci_errors[0]/(round_trials[0]),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/ (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/
(double)eNB->dlsch[0][0]->harq_processes[0]->TBS, (double)eNB->dlsch[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
......
...@@ -653,6 +653,7 @@ int main(int argc, char **argv) ...@@ -653,6 +653,7 @@ int main(int argc, char **argv)
printf("-h This message\n"); printf("-h This message\n");
printf("-a Use AWGN channel and not multipath\n"); printf("-a Use AWGN channel and not multipath\n");
printf("-c TDD config\n"); printf("-c TDD config\n");
printf("-S Subframe number (0..9)\n");
printf("-R N_RB_DL\n"); printf("-R N_RB_DL\n");
printf("-F use FDD frame\n"); printf("-F use FDD frame\n");
printf("-p Use extended prefix mode\n"); printf("-p Use extended prefix mode\n");
......
...@@ -388,9 +388,9 @@ typedef struct { ...@@ -388,9 +388,9 @@ typedef struct {
struct PMCH_InfoList_r9 *pmch_InfoList struct PMCH_InfoList_r9 *pmch_InfoList
#endif #endif
); );
unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, char*); unsigned int (*mac_rlc_data_req)(module_id_t, unsigned int, const unsigned int,char*);
void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* ); void (*mac_rlc_data_ind)(module_id_t, logical_chan_id_t, char*, tb_size_t, num_tb_t, crc_t* );
mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP, mac_rlc_status_resp_t (*mac_rlc_status_ind) (module_id_t enb_mod_idP, module_id_t ue_mod_idP, frame_t frameP, sub_frame_t subframeP, eNB_flag_t eNB_flagP, MBMS_flag_t MBMS_flagP,
logical_chan_id_t channel_idP, tb_size_t tb_sizeP); logical_chan_id_t channel_idP, tb_size_t tb_sizeP);
signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *); signed int (*rrc_rlc_data_req)(module_id_t, rb_id_t, mui_t, confirm_t, sdu_size_t, char *);
void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ), void (*rrc_rlc_register_rrc) (void (*rrc_data_indP)(module_id_t , rb_id_t , sdu_size_t , char* ),
......
...@@ -37,50 +37,10 @@ ...@@ -37,50 +37,10 @@
#include "flexran_agent_common.h" #include "flexran_agent_common.h"
#include "flexran_agent_extern.h" #include "flexran_agent_extern.h"
/* These types will be used to give
instructions for the type of stats reports
we need to create */
typedef struct {
uint16_t ue_rnti;
uint32_t ue_report_flags; /* Indicates the report elements
required for this UE id. See
FlexRAN specification 1.2.4.2 */
} ue_report_type_t;
typedef struct {
uint16_t cc_id;
uint32_t cc_report_flags; /* Indicates the report elements
required for this CC index. See
FlexRAN specification 1.2.4.3 */
} cc_report_type_t;
typedef struct {
int nr_ue;
ue_report_type_t *ue_report_type;
int nr_cc;
cc_report_type_t *cc_report_type;
} report_config_t;
typedef struct stats_request_config_s{
uint8_t report_type;
uint8_t report_frequency;
uint16_t period; /*In number of subframes*/
report_config_t *config;
} stats_request_config_t;
/* Initialization function for the agent structures etc */ /* Initialization function for the agent structures etc */
void flexran_agent_init_mac_agent(mid_t mod_id); void flexran_agent_init_mac_agent(mid_t mod_id);
int flexran_agent_mac_handle_stats(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
/* Statistics request protocol message constructor and destructor */
int flexran_agent_mac_stats_request(mid_t mod_id, xid_t xid, const stats_request_config_t *report_config, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_stats_request(Protocol__FlexranMessage *msg);
/* Statistics reply protocol message constructor and destructor */
int flexran_agent_mac_stats_reply(mid_t mod_id, xid_t xid, const report_config_t *report_config, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
/* Scheduling request information protocol message constructor and estructor */ /* Scheduling request information protocol message constructor and estructor */
int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); int flexran_agent_mac_sr_info(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg); int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
...@@ -89,6 +49,10 @@ int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg); ...@@ -89,6 +49,10 @@ int flexran_agent_mac_destroy_sr_info(Protocol__FlexranMessage *msg);
int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg); int flexran_agent_mac_sf_trigger(mid_t mod_id, const void *params, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg); int flexran_agent_mac_destroy_sf_trigger(Protocol__FlexranMessage *msg);
/* Statistics reply protocol message constructor and destructor */
int flexran_agent_mac_stats_reply(mid_t mod_id, const report_config_t *report_config, Protocol__FlexUeStatsReport **ue_report, Protocol__FlexCellStatsReport **cell_report);
int flexran_agent_mac_destroy_stats_reply(Protocol__FlexranMessage *msg);
/* DL MAC scheduling decision protocol message constructor (empty command) and destructor */ /* DL MAC scheduling decision protocol message constructor (empty command) and destructor */
int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg); int flexran_agent_mac_create_empty_dl_config(mid_t mod_id, Protocol__FlexranMessage **msg);
int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg); int flexran_agent_mac_destroy_dl_config(Protocol__FlexranMessage *msg);
......
...@@ -48,7 +48,7 @@ typedef struct { ...@@ -48,7 +48,7 @@ typedef struct {
/// Send to the controller all the mac stat updates that occured during this subframe /// Send to the controller all the mac stat updates that occured during this subframe
/// based on the stats request configuration /// based on the stats request configuration
void (*flexran_agent_send_update_mac_stats)(mid_t mod_id); // void (*flexran_agent_send_update_mac_stats)(mid_t mod_id);
/// Provide to the scheduler a pending dl_mac_config message /// Provide to the scheduler a pending dl_mac_config message
void (*flexran_agent_get_pending_dl_mac_config)(mid_t mod_id, void (*flexran_agent_get_pending_dl_mac_config)(mid_t mod_id,
...@@ -63,8 +63,8 @@ typedef struct { ...@@ -63,8 +63,8 @@ typedef struct {
/// Notify the controller for a state change of a particular UE, by sending the proper /// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER) /// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti, // int (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint8_t state_change); // uint8_t state_change);
void *dl_scheduler_loaded_lib; void *dl_scheduler_loaded_lib;
......
...@@ -180,10 +180,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport * ...@@ -180,10 +180,12 @@ Protocol__FlexUeStatsReport * copy_ue_stats_report(Protocol__FlexUeStatsReport *
} }
} }
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PRH) {
copy->has_phr = original->has_phr;
copy->phr = original->phr; if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_PHR) {
} copy->has_phr = original->has_phr;
copy->phr = original->phr;
}
if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) { if (copy->flags & PROTOCOL__FLEX_UE_STATS_TYPE__FLUST_RLC_BS) {
copy->n_rlc_report = original->n_rlc_report; copy->n_rlc_report = original->n_rlc_report;
......
This diff is collapsed.
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file flexran_agent_rrc.h
* \brief FlexRAN agent Control Module RRC header
* \author shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
*/
#ifndef FLEXRAN_AGENT_RRC_H_
#define FLEXRAN_AGENT_RRC_H_
#include "header.pb-c.h"
#include "flexran.pb-c.h"
#include "stats_messages.pb-c.h"
#include "stats_common.pb-c.h"
#include "flexran_agent_common.h"
#include "flexran_agent_rrc_defs.h"
/* Initialization function for the agent structures etc */
void flexran_agent_init_rrc_agent(mid_t mod_id);
/* UE state change message constructor and destructor */
void flexran_agent_ue_state_change(mid_t mod_id, uint32_t rnti, uint8_t state_change);
int flexran_agent_destroy_ue_state_change(Protocol__FlexranMessage *msg);
/**********************************
* FlexRAN agent - technology RRC API
**********************************/
/* Send to the controller all the rrc stat updates that occured during this subframe*/
// void flexran_agent_send_update_rrc_stats(mid_t mod_id);
/* this is called by RRC as a part of rrc xface . The controller previously requested this*/
void flexran_trigger_rrc_measurements (mid_t mod_id, MeasResults_t *);
/*Register technology specific interface callbacks*/
int flexran_agent_register_rrc_xface(mid_t mod_id, AGENT_RRC_xface *xface);
/*Unregister technology specific callbacks*/
int flexran_agent_unregister_rrc_xface(mid_t mod_id, AGENT_RRC_xface*xface);
#endif
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2016 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@lists.eurecom.fr
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France.
*******************************************************************************/
/*! \file flexran_agent_rrc_defs.h
* \brief FlexRAN agent - RRC interface primitives
* \author shahab SHARIAT BAGHERI
* \date 2017
* \version 0.1
* \mail
*/
#ifndef __FLEXRAN_AGENT_RRC_PRIMITIVES_H__
#define __FLEXRAN_AGENT_RRC_PRIMITIVES_H__
#include "PHY/extern.h"
#include "flexran_agent_defs.h"
#include "flexran.pb-c.h"
#include "header.pb-c.h"
#include "MeasResults.h"
#define RINGBUFFER_SIZE 100
/* FLEXRAN AGENT-RRC Interface */
typedef struct {
/// Inform the controller about the scheduling requests received during the subframe
//void (*flexran_agent_send_update_rrc_stats)(mid_t mod_id);
/// Notify the controller for a state change of a particular UE, by sending the proper
/// UE state change message (ACTIVATION, DEACTIVATION, HANDOVER)
void (*flexran_agent_notify_ue_state_change)(mid_t mod_id, uint32_t rnti,
uint8_t state_change);
void (*flexran_trigger_rrc_measurements)(mid_t mod_id, MeasResults_t* measResults);
} AGENT_RRC_xface;
#endif
...@@ -25,10 +25,11 @@ message flexran_message { ...@@ -25,10 +25,11 @@ message flexran_message {
flex_lc_config_request lc_config_request_msg = 12; flex_lc_config_request lc_config_request_msg = 12;
flex_lc_config_reply lc_config_reply_msg = 13; flex_lc_config_reply lc_config_reply_msg = 13;
flex_dl_mac_config dl_mac_config_msg = 14; flex_dl_mac_config dl_mac_config_msg = 14;
flex_ul_mac_config ul_mac_config_msg = 18; flex_ul_mac_config ul_mac_config_msg = 19;
flex_ue_state_change ue_state_change_msg = 15; flex_ue_state_change ue_state_change_msg = 15;
flex_control_delegation control_delegation_msg = 16; flex_control_delegation control_delegation_msg = 16;
flex_agent_reconfiguration agent_reconfiguration_msg = 17; flex_agent_reconfiguration agent_reconfiguration_msg = 17;
flex_rrc_triggering rrc_triggering = 18;
} }
} }
...@@ -164,12 +165,22 @@ message flex_dl_mac_config { ...@@ -164,12 +165,22 @@ message flex_dl_mac_config {
repeated flex_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC repeated flex_pdcch_ofdm_sym_count ofdm_sym = 6; // OFDM symbol count for each CC
} }
message flex_ul_mac_config { message flex_ul_mac_config {
optional flex_header header = 1; optional flex_header header = 1;
optional uint32 sfn_sf = 2; optional uint32 sfn_sf = 2;
repeated flex_ul_data ul_ue_data = 3; repeated flex_ul_data ul_ue_data = 3;
} }
message flex_rrc_triggering {
optional flex_header header = 1;
optional string rrc_trigger = 2;
}
// //
// UE state change message // UE state change message
// //
......
...@@ -39,5 +39,7 @@ enum flex_type { ...@@ -39,5 +39,7 @@ enum flex_type {
// Control delegation messages // Control delegation messages
FLPT_DELEGATE_CONTROL = 15; FLPT_DELEGATE_CONTROL = 15;
FLPT_RECONFIGURE_AGENT = 16; FLPT_RECONFIGURE_AGENT = 16;
FLPT_RRC_TRIGGERING = 17;
} }
...@@ -181,3 +181,63 @@ message flex_noise_interference_report { ...@@ -181,3 +181,63 @@ message flex_noise_interference_report {
optional int32 p0_nominal_pucch = 4; optional int32 p0_nominal_pucch = 4;
} }
//
// RRC Primitives
//
message flex_rrc_measurements {
// Measurement identifier.
optional int32 measid = 1;
// Primary Cell Reference Signal Received Power (RSRP).
optional int32 pcell_rsrp = 2;
// Primary Cell Reference Signal Received Quality (RSRQ).
optional int32 pcell_rsrq = 3;
// Neighboring cells measurements performed by UE.
optional flex_neigh_cells_measurements neigh_meas = 4;
}
message flex_neigh_cells_measurements {
// Neighboring EUTRA cells measurements.
repeated flex_eutra_measurements eutra_meas = 1;
}
message flex_eutra_measurements {
// Physical Cell identifier.
optional int32 phys_cell_id = 1;
// EUTRA Cell Global Identity (CGI) measurement.
optional flex_eutra_cgi_measurements cgi_meas = 2;
// EUTRA nearby cell reference signal measurement.
optional flex_eutra_ref_signal_meas meas_result = 3;
}
message flex_eutra_cgi_measurements {
// EUTRA Cell Global Identity (CGI).
optional flex_cell_global_eutra_id cgi = 1;
// Tracking area code of the neighbor cell.
optional uint32 tracking_area_code = 2;
// Public land mobile network identifiers of neighbor cell.
repeated flex_plmn_identity plmn_id = 3;
}
message flex_cell_global_eutra_id {
// Public land mobile network identifier of neighbor cell.
optional flex_plmn_identity plmn_id = 1;
// Cell identifier of neighbor cell.
optional uint32 cell_id = 2;
}
message flex_plmn_identity {
// Mobile Network Code (MNC).
repeated uint32 mnc = 1;
// Mobile Country Code (MCC).
repeated uint32 mcc = 2;
// tracking area code
repeated uint32 tac = 3;
}
message flex_eutra_ref_signal_meas {
// Neighboring Cell Reference Signal Received Power (RSRP).
optional int32 rsrp = 1;
// Neighboring Cell Reference Signal Received Quality (RSRQ).
optional int32 rsrq = 2;
}
...@@ -46,6 +46,7 @@ message flex_ue_stats_report { ...@@ -46,6 +46,7 @@ message flex_ue_stats_report {
optional flex_dl_cqi_report dl_cqi_report = 7; optional flex_dl_cqi_report dl_cqi_report = 7;
optional flex_paging_buffer_report pbr = 8; optional flex_paging_buffer_report pbr = 8;
optional flex_ul_cqi_report ul_cqi_report = 9; optional flex_ul_cqi_report ul_cqi_report = 9;
optional flex_rrc_measurements rrc_measurements = 10;
} }
// //
...@@ -76,11 +77,12 @@ enum flex_cell_stats_type { ...@@ -76,11 +77,12 @@ enum flex_cell_stats_type {
// Flags for UE-related statistics // Flags for UE-related statistics
enum flex_ue_stats_type { enum flex_ue_stats_type {
FLUST_BSR = 1; FLUST_BSR = 1;
FLUST_PRH = 2; FLUST_PHR = 2;
FLUST_RLC_BS = 4; FLUST_RLC_BS = 4;
FLUST_MAC_CE_BS = 8; FLUST_MAC_CE_BS = 8;
FLUST_DL_CQI = 16; FLUST_DL_CQI = 16;
FLUST_PBS = 32; FLUST_PBS = 32;
FLUST_UL_CQI = 64; FLUST_UL_CQI = 64;
// To be extended with more types of stats // To be extended with more types of stats
} FLUST_RRC_MEASUREMENTS = 65536;
\ No newline at end of file }
...@@ -98,6 +98,8 @@ ...@@ -98,6 +98,8 @@
#define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band" #define ENB_CONFIG_STRING_EUTRA_BAND "eutra_band"
#define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency" #define ENB_CONFIG_STRING_DOWNLINK_FREQUENCY "downlink_frequency"
#define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset" #define ENB_CONFIG_STRING_UPLINK_FREQUENCY_OFFSET "uplink_frequency_offset"
#define ENB_CONFIG_STRING_RRC_REPORT_CONFIG_AMOUNT "report_amount"
#define ENB_CONFIG_STRING_RRC_REPORT_CONFIG_INTERVAL "report_interval"
#define ENB_CONFIG_STRING_NID_CELL "Nid_cell" #define ENB_CONFIG_STRING_NID_CELL "Nid_cell"
#define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL" #define ENB_CONFIG_STRING_N_RB_DL "N_RB_DL"
...@@ -165,7 +167,7 @@ ...@@ -165,7 +167,7 @@
#define ENB_CONFIG_STRING_UETIMERS_N310 "ue_TimersAndConstants_n310" #define ENB_CONFIG_STRING_UETIMERS_N310 "ue_TimersAndConstants_n310"
#define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311" #define ENB_CONFIG_STRING_UETIMERS_N311 "ue_TimersAndConstants_n311"
#define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode" #define ENB_CONFIG_STRING_UE_TRANSMISSION_MODE "ue_TransmissionMode"
#define ENB_CONFIG_STRING_RRC_CONFIG "rrc_config"
#define ENB_CONFIG_STRING_SRB1 "srb1_parameters" #define ENB_CONFIG_STRING_SRB1 "srb1_parameters"
#define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit" #define ENB_CONFIG_STRING_SRB1_TIMER_POLL_RETRANSMIT "timer_poll_retransmit"
#define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering" #define ENB_CONFIG_STRING_SRB1_TIMER_REORDERING "timer_reordering"
...@@ -456,6 +458,10 @@ void enb_config_display(void) ...@@ -456,6 +458,10 @@ void enb_config_display(void)
printf( "\tue_TransmissionMode for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TransmissionMode[j]); printf( "\tue_TransmissionMode for CC %d:\t%ld:\n",j,enb_properties.properties[i]->ue_TransmissionMode[j]);
printf( "\n\tRRC Report Config: \n");
printf( "\n\t Report interval \t%ld: ", enb_properties.properties[i]->rrc_report_interval);
printf( "\n\t Report amount \t%ld: \n", enb_properties.properties[i]->rrc_report_amount);
} }
for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) { for (j=0; j < enb_properties.properties[i]->num_otg_elements; j++) {
...@@ -545,6 +551,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -545,6 +551,7 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
config_setting_t *setting_enb = NULL; config_setting_t *setting_enb = NULL;
config_setting_t *setting_otg = NULL; config_setting_t *setting_otg = NULL;
config_setting_t *subsetting_otg = NULL; config_setting_t *subsetting_otg = NULL;
config_setting_t *setting_rrc = NULL;
int parse_errors = 0; int parse_errors = 0;
int num_enb_properties = 0; int num_enb_properties = 0;
int enb_properties_index = 0; int enb_properties_index = 0;
...@@ -651,7 +658,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -651,7 +658,8 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
libconfig_int srb1_max_retx_threshold = 0; libconfig_int srb1_max_retx_threshold = 0;
libconfig_int my_int; libconfig_int my_int;
const char* rrc_report_amount = NULL;
const char* rrc_report_interval = NULL;
char* if_name = NULL; char* if_name = NULL;
char* ipv4 = NULL; char* ipv4 = NULL;
...@@ -1968,6 +1976,75 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP) ...@@ -1968,6 +1976,75 @@ const Enb_properties_array_t *enb_config_init(char* lib_config_file_name_pP)
} }
} }
setting_rrc = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_RRC_CONFIG);
if (setting_rrc != NULL) {
if (!(config_setting_lookup_string(setting_rrc, ENB_CONFIG_STRING_RRC_REPORT_CONFIG_AMOUNT, &rrc_report_amount)
&& config_setting_lookup_string(setting_rrc, ENB_CONFIG_STRING_RRC_REPORT_CONFIG_INTERVAL, &rrc_report_interval)))
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d, rrc_report_amount and rrc_reporyt_interval !\n",
lib_config_file_name_pP, i);
if (strcmp(rrc_report_amount, "r1") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r1;
} else if (strcmp(rrc_report_amount, "r2") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r2;
}else if (strcmp(rrc_report_amount, "r4") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r4;
}else if (strcmp(rrc_report_amount, "r8") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r8;
}else if (strcmp(rrc_report_amount, "r16") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r16;
}else if (strcmp(rrc_report_amount, "r32") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r32;
}else if (strcmp(rrc_report_amount, "r64") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r64;
}else if (strcmp(rrc_report_amount, "infinity") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_infinity;
}else{
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for report_amount choice: r1, r2, r4, r8, r16, r32, r64, infinity !\n",
lib_config_file_name_pP, i,rrc_report_amount);
}
if (strcmp(rrc_report_interval, "120ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms120;
} else if (strcmp(rrc_report_interval, "240ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms240;
}else if (strcmp(rrc_report_interval, "480ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms480;
}else if (strcmp(rrc_report_interval, "640ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms640;
}else if (strcmp(rrc_report_interval, "1024ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms1024;
}else if (strcmp(rrc_report_interval, "2048ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms2048;
}else if (strcmp(rrc_report_interval, "5120ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms5120;
}else if (strcmp(rrc_report_interval, "10240ms") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms10240;
}else if (strcmp(rrc_report_interval, "1min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min1;
}else if (strcmp(rrc_report_interval, "6min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min6;
}else if (strcmp(rrc_report_interval, "12min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min12;
}else if (strcmp(rrc_report_interval, "30min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min30;
} else if (strcmp(rrc_report_interval, "60min") == 0) {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_min60;
} else {
AssertFatal (0,
"Failed to parse eNB configuration file %s, enb %d unknown value \"%d\" for report_interval choice: 120ms, 240ms, 480ms, 640ms, 1024ms, 2048ms, 5120ms, 10240ms, 1min, 6min, 12",
lib_config_file_name_pP, i,rrc_report_interval);
}
} else {
enb_properties.properties[enb_properties_index]->rrc_report_interval = ReportInterval_ms120;
enb_properties.properties[enb_properties_index]->rrc_report_amount = ReportConfigEUTRA__reportAmount_r1;
}
setting_srb1 = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SRB1); setting_srb1 = config_setting_get_member (setting_enb, ENB_CONFIG_STRING_SRB1);
if (setting_srb1 != NULL) { if (setting_srb1 != NULL) {
......
...@@ -214,6 +214,10 @@ typedef struct Enb_properties_s { ...@@ -214,6 +214,10 @@ typedef struct Enb_properties_s {
long srb1_poll_pdu; long srb1_poll_pdu;
long srb1_poll_byte; long srb1_poll_byte;
long srb1_max_retx_threshold; long srb1_max_retx_threshold;
long rrc_report_amount;
long rrc_report_interval;
/* Nb of MME to connect to */ /* Nb of MME to connect to */
uint8_t nb_mme; uint8_t nb_mme;
/* List of MME to connect to */ /* List of MME to connect to */
......
...@@ -21,27 +21,16 @@ ...@@ -21,27 +21,16 @@
/*! \file flexran_agent.h /*! \file flexran_agent.h
* \brief top level flexran agent receive thread and itti task * \brief top level flexran agent receive thread and itti task
* \author Xenofon Foukas and Navid Nikaein * \author Xenofon Foukas and Navid Nikaein and shahab SHARIAT BAGHERI
* \date 2016 * \date 2017
* \version 0.1 * \version 0.1
*/ */
#include "flexran_agent_common.h"
#include "log.h"
#include "flexran_agent.h" #include "flexran_agent.h"
#include "flexran_agent_mac_defs.h"
#include "flexran_agent_mac.h"
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_extern.h"
#include "assertions.h"
#include "flexran_agent_net_comm.h"
#include "flexran_agent_async.h"
#include <arpa/inet.h> #include <arpa/inet.h>
//#define TEST_TIMER //#define TEST_TIMER
flexran_agent_instance_t flexran_agent[NUM_MAX_ENB]; flexran_agent_instance_t flexran_agent[NUM_MAX_ENB];
...@@ -264,8 +253,8 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti ...@@ -264,8 +253,8 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
*flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAC); *flexran_agent_register_channel(mod_id, channel, FLEXRAN_AGENT_MAC);
*/ */
/*Initialize the continuous MAC stats update mechanism*/ /*Initialize the continuous stats update mechanism*/
flexran_agent_init_cont_mac_stats_update(mod_id); flexran_agent_init_cont_stats_update(mod_id);
new_thread(receive_thread, &flexran_agent[mod_id]); new_thread(receive_thread, &flexran_agent[mod_id]);
...@@ -275,6 +264,9 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti ...@@ -275,6 +264,9 @@ int flexran_agent_start(mid_t mod_id, const Enb_properties_array_t* enb_properti
AGENT_MAC_xface *mac_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface)); AGENT_MAC_xface *mac_agent_xface = (AGENT_MAC_xface *) malloc(sizeof(AGENT_MAC_xface));
flexran_agent_register_mac_xface(mod_id, mac_agent_xface); flexran_agent_register_mac_xface(mod_id, mac_agent_xface);
AGENT_RRC_xface *rrc_agent_xface = (AGENT_RRC_xface *) malloc(sizeof(AGENT_RRC_xface));
flexran_agent_register_rrc_xface(mod_id, rrc_agent_xface);
/* /*
* initilize a timer * initilize a timer
*/ */
......
...@@ -22,15 +22,26 @@ ...@@ -22,15 +22,26 @@
/*! \file flexran_agent.h /*! \file flexran_agent.h
* \brief top level flexran agent * \brief top level flexran agent
* \author Navid Nikaein and Xenofon Foukas * \author Navid Nikaein and Xenofon Foukas
* \date 2016 * \date 2017
* \version 0.1 * \version 0.1
*/ */
#ifndef FLEXRAN_AGENT_H_ #ifndef FLEXRAN_AGENT_H_
#define FLEXRAN_AGENT_H_ #define FLEXRAN_AGENT_H_
#include "enb_config.h" // for enb properties
#include "flexran_agent_common.h" #include "flexran_agent_common.h"
#include "flexran_agent_async.h"
#include "flexran_agent_extern.h"
#include "flexran_agent_timer.h"
#include "flexran_agent_defs.h"
#include "flexran_agent_net_comm.h"
#include "flexran_agent_ran_api.h"
#include "flexran_agent_mac.h"
#include "flexran_agent_rrc.h"
#include "log.h"
#include "assertions.h"
#include "enb_config.h" // for enb properties
/* Initiation and termination of the eNodeB agent */ /* Initiation and termination of the eNodeB agent */
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -20,9 +20,9 @@ ...@@ -20,9 +20,9 @@
*/ */
/*! \file ENB_APP/extern.h /*! \file ENB_APP/extern.h
* \brief FlexRAN agent - mac interface primitives * \brief FlexRAN agent - Extern VSF xfaces
* \author Xenofon Foukas * \author Xenofon Foukas and shahab SHARIAT BAGHERI
* \date 2016 * \date 2017
* \version 0.1 * \version 0.1
* \mail x.foukas@sms.ed.ac.uk * \mail x.foukas@sms.ed.ac.uk
*/ */
...@@ -30,9 +30,9 @@ ...@@ -30,9 +30,9 @@
#ifndef __FLEXRAN_AGENT_EXTERN_H__ #ifndef __FLEXRAN_AGENT_EXTERN_H__
#define __FLEXRAN_AGENT_EXTERN_H__ #define __FLEXRAN_AGENT_EXTERN_H__
#include "flexran_agent_defs.h" // #include "flexran_agent_defs.h"
#include "flexran_agent_mac_defs.h" #include "flexran_agent_mac_defs.h"
#include "flexran_agent_rrc_defs.h"
//extern msg_context_t shared_ctxt[NUM_MAX_ENB][FLEXRAN_AGENT_MAX]; //extern msg_context_t shared_ctxt[NUM_MAX_ENB][FLEXRAN_AGENT_MAX];
...@@ -45,6 +45,12 @@ extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]; ...@@ -45,6 +45,12 @@ extern AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
/* Flag indicating whether the VSFs for the MAC control module have been registered */ /* Flag indicating whether the VSFs for the MAC control module have been registered */
extern unsigned int mac_agent_registered[NUM_MAX_ENB]; extern unsigned int mac_agent_registered[NUM_MAX_ENB];
/* Control module interface for the communication of the RRC Control Module with the agent */
extern AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB];
/* Flag indicating whether the VSFs for the RRC control module have been registered */
extern unsigned int rrc_agent_registered[NUM_MAX_ENB];
/* Requried to know which UEs had a harq updated over some subframe */ /* Requried to know which UEs had a harq updated over some subframe */
extern int harq_pid_updated[NUMBER_OF_UE_MAX][8]; extern int harq_pid_updated[NUMBER_OF_UE_MAX][8];
extern int harq_pid_round[NUMBER_OF_UE_MAX][8]; extern int harq_pid_round[NUMBER_OF_UE_MAX][8];
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -332,15 +332,17 @@ rrc_mac_config_req( ...@@ -332,15 +332,17 @@ rrc_mac_config_req(
if (eNB_flagP == 0) { if (eNB_flagP == 0) {
if (measObj!= NULL) { if (measObj!= NULL) {
if (measObj[0]!= NULL) { if (measObj[0]!= NULL) {
UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count; if (measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList != NULL) {
LOG_I(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells); UE_mac_inst[Mod_idP].n_adj_cells = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.count;
LOG_D(MAC,"Number of adjacent cells %d\n",UE_mac_inst[Mod_idP].n_adj_cells);
for (i=0; i<UE_mac_inst[Mod_idP].n_adj_cells; i++) { for (i=0; i<UE_mac_inst[Mod_idP].n_adj_cells; i++) {
UE_mac_inst[Mod_idP].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId; UE_mac_inst[Mod_idP].adj_cell_id[i] = measObj[0]->measObject.choice.measObjectEUTRA.cellsToAddModList->list.array[i]->physCellId;
LOG_I(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]); LOG_D(MAC,"Cell %d : Nid_cell %d\n",i,UE_mac_inst[Mod_idP].adj_cell_id[i]);
} }
mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id); mac_xface->phy_config_meas_ue(Mod_idP,0,eNB_index,UE_mac_inst[Mod_idP].n_adj_cells,UE_mac_inst[Mod_idP].adj_cell_id);
}
} }
/* /*
......
...@@ -158,8 +158,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -158,8 +158,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
//mac_remove_ue(module_idP, i, frameP, subframeP); //mac_remove_ue(module_idP, i, frameP, subframeP);
//Inform the controller about the UE deactivation. Should be moved to RRC agent in the future //Inform the controller about the UE deactivation. Should be moved to RRC agent in the future
#if defined(FLEXRAN_AGENT_SB_IF) #if defined(FLEXRAN_AGENT_SB_IF)
if (mac_agent_registered[module_idP]) { if (rrc_agent_registered[module_idP]) {
agent_mac_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP, agent_rrc_xface[module_idP]->flexran_agent_notify_ue_state_change(module_idP,
rnti, rnti,
PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED); PROTOCOL__FLEX_UE_STATE_CHANGE_TYPE__FLUESC_DEACTIVATED);
} }
...@@ -1084,10 +1084,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -1084,10 +1084,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
#if defined(FLEXRAN_AGENT_SB_IF) #if defined(FLEXRAN_AGENT_SB_IF)
#ifndef DISABLE_CONT_STATS #ifndef DISABLE_CONT_STATS
flexran_agent_send_update_stats(module_idP);
//Send subframe trigger to the controller //Send subframe trigger to the controller
if (mac_agent_registered[module_idP]) { // if (mac_agent_registered[module_idP]) {
agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP); // agent_mac_xface[module_idP]->flexran_agent_send_update_mac_stats(module_idP);
} // }
#endif #endif
#endif #endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment