merge oai/develop and oai-internal/T
This commit is contained in:
+4
-4
@@ -32,8 +32,8 @@ job1:
|
||||
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
|
||||
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
|
||||
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
|
||||
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest.log `
|
||||
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest.log. Please check the logs\e[0m" ; fi
|
||||
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log `
|
||||
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
|
||||
- exce_log=`egrep -i 'warning|error|critical|exception' $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log |cat `
|
||||
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log. Please check the logs\e[0m" ; fi
|
||||
- exce_log=`egrep -i 'warning|error|critical|exception' $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log |cat `
|
||||
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
|
||||
|
||||
|
||||
@@ -1518,7 +1518,7 @@ if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
include_directories(${LIBBOOST_INCLUDE_DIR})
|
||||
endif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
|
||||
pkg_search_module(OPENPGM openpgm-5.1)
|
||||
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
|
||||
if(NOT ${OPENPGM_FOUND})
|
||||
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
|
||||
else()
|
||||
@@ -1625,7 +1625,7 @@ add_executable(lte-softmodem
|
||||
${T_SOURCE}
|
||||
)
|
||||
|
||||
target_link_libraries (lte-softmodem
|
||||
target_link_libraries (lte-softmodem -ldl
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB PHY LFDS L2 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${MIH_LIB}
|
||||
-Wl,--end-group )
|
||||
@@ -1652,8 +1652,8 @@ add_executable(lte-softmodem-nos1
|
||||
${OPENAIR_TARGETS}/SIMU/USER/init_lte.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
#${OPENAIR2_DIR}/RRC/NAS/nas_config.c # enable if you want rrc to mount ip interface
|
||||
#${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${HW_SOURCE}
|
||||
${TRANSPORT_SOURCE}
|
||||
@@ -1929,6 +1929,11 @@ foreach( d ${DirDefs} )
|
||||
list(APPEND itti_compiler_options "-I${d}")
|
||||
endforeach()
|
||||
|
||||
# castxml doesn't work with c11 (gcc 5 default)
|
||||
# force castxml and clang compilation with gnu89 standard
|
||||
# we can't use cXX standard as pthread_rwlock_t is gnu standard
|
||||
list(APPEND itti_compiler_options "-std=gnu89")
|
||||
|
||||
set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
|
||||
add_custom_command (
|
||||
OUTPUT ${OPENAIR_BIN_DIR}/messages.xml
|
||||
|
||||
@@ -12,10 +12,12 @@ Obj.# Case# Test# Description
|
||||
01 01 11 Build lte-softmodem_noS1.EXMIMO.Rel10
|
||||
01 01 12 Build lte-softmodem_noS1.BLADERF.Rel10
|
||||
01 01 13 Build lte-softmodem_noS1.ETHERNET.Rel10
|
||||
01 01 14 Build lte-softmodem_noS1.LMSSDR.Rel10
|
||||
01 01 20 Build lte-softmodem.USRP.Rel10
|
||||
01 01 21 Build lte-softmodem.EXMIMO.Rel10
|
||||
01 01 22 Build lte-softmodem.BLADERF.Rel10
|
||||
01 01 23 Build lte-softmodem.ETHERNET.Rel10
|
||||
01 01 24 Build lte-softmodem.LMSSDR.Rel10
|
||||
|
||||
01 01 30 Build (dlsim.Rel10 + ulsim.Rel10 + pucchsim.Rel10 + prachsim.Rel10 + pdcchsim.Rel10 + pbchsim.Rel10 + mbmssim.Rel10
|
||||
secu_knas_encrypt_eia1.Rel10 secu_kenb.Rel10 aes128_ctr_encrypt.Rel10 aes128_ctr_decrypt.Rel10 secu_knas_encrypt_eea2.Rel10
|
||||
@@ -24,7 +26,7 @@ Obj.# Case# Test# Description
|
||||
01 01 40 Build RRH Gateway for USRP (Rel 10)
|
||||
01 01 41 Build RRH Gateway for EXMIMO (Rel 10)
|
||||
01 01 42 Build RRH Gateway for BLADERF (Rel 10)
|
||||
|
||||
01 01 43 Build RRH Gateway for LMSSDR (Rel 10)
|
||||
|
||||
|
||||
01 02 Run OAISIM-NOS1 Rel10 (TDD + 5MHz/10MHz/20MHz + TM 1,2), and check the operation
|
||||
|
||||
@@ -781,7 +781,7 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
|
||||
task_eNB = task_eNB + 'echo eNB_traffic_exec PID = $! \n'
|
||||
|
||||
task_eNB = task_eNB + ' (date; sudo rm -f ' + logfile_pcap_tmp_eNB + ' ; sudo -E tshark -i any -s 65535 -a duration:' + str(timeout_cmd-10)+ ' -w ' + logfile_pcap_tmp_eNB+ ' ; sudo -E chown ' + user + ' ' + logfile_pcap_tmp_eNB + ' ; zip -j -9 ' + logfile_pcap_zip_eNB + ' ' + logfile_pcap_tmp_eNB + ' ) > ' + logfile_tshark_eNB + ' 2>&1 & \n '
|
||||
task_eNB = task_eNB + ' (date; sudo rm -f ' + logfile_pcap_tmp_eNB + ' ; sudo -E tshark -i lo -s 65535 -a duration:' + str(timeout_cmd-10)+ ' -w ' + logfile_pcap_tmp_eNB+ ' ; sudo -E chown ' + user + ' ' + logfile_pcap_tmp_eNB + ' ; zip -j -9 ' + logfile_pcap_zip_eNB + ' ' + logfile_pcap_tmp_eNB + ' ) > ' + logfile_tshark_eNB + ' 2>&1 & \n '
|
||||
task_eNB = task_eNB + 'array_exec_pid+=($!) \n'
|
||||
task_eNB = task_eNB + 'echo eNB_tshark_exec PID = $! \n'
|
||||
#terminate the eNB test case after timeout_cmd seconds
|
||||
@@ -1005,7 +1005,21 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
|
||||
run_result_string = ' RUN_'+str(run) + ' = PASS'
|
||||
else:
|
||||
run_result_string = ' RUN_'+str(run) + ' = FAIL'
|
||||
|
||||
|
||||
#If there is assertion, we mark the test case as failure as most likely eNB crashed
|
||||
cmd = "grep -ilr \"assertion\" " + logdir_local_testcase + " | cat "
|
||||
cmd_out = subprocess.check_output ([cmd], shell=True)
|
||||
if len(cmd_out) !=0 :
|
||||
run_result=0
|
||||
run_result_string = ' RUN_'+str(run) + ' = FAIL(Assert)'
|
||||
|
||||
#If there is thread busy error, we mark the test case as failure as most likely eNB crashed
|
||||
cmd = "grep -ilr \"thread busy\" " + logdir_local_testcase + " | cat "
|
||||
cmd_out = subprocess.check_output ([cmd], shell=True)
|
||||
if len(cmd_out) !=0:
|
||||
run_result=0
|
||||
run_result_string = ' RUN_'+str(run) + ' = FAIL(Thread_Busy)'
|
||||
|
||||
run_result_string = run_result_string + tput_run_string
|
||||
|
||||
test_result=test_result & run_result
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -33,6 +33,7 @@
|
||||
# brief OAI automated build tool that can be used to install, compile, run OAI.
|
||||
# author Navid Nikaein, Lionel GAUTHIER, Laurent Thomas
|
||||
|
||||
set -e
|
||||
|
||||
################################
|
||||
# include helper functions
|
||||
@@ -59,6 +60,7 @@ RUN_GROUP=0
|
||||
TEST_CASE_GROUP=""
|
||||
BUILD_DOXYGEN=0
|
||||
T_TRACER="False"
|
||||
DISABLE_HARDWARE_DEPENDENCY="False"
|
||||
trap handle_ctrl_c INT
|
||||
|
||||
function print_help() {
|
||||
@@ -131,6 +133,8 @@ Options
|
||||
Disables CPU Affinity between UHD/TX/RX Threads (Valid only when deadline scheduler is disabled). By defaulT, CPU Affinity is enabled when not using deadline scheduler. It is enabled only with >2 CPUs. For eNB, CPU_0-> Device library (UHD), CPU_1->TX Threads, CPU_2...CPU_MAX->Rx Threads. For UE, CPU_0->Device Library(UHD), CPU_1..CPU_MAX -> All the UE threads
|
||||
--T-tracer
|
||||
Enables the T tracer.
|
||||
--disable-hardware-dependency
|
||||
Disable HW dependency during installation
|
||||
Usage (first build):
|
||||
oaisim (eNB + UE): ./build_oai -I -g --oaisim -x --install-system-files
|
||||
Eurecom EXMIMO + COTS UE : ./build_oai -I -g --eNB -x --install-system-files
|
||||
@@ -277,6 +281,10 @@ function main() {
|
||||
T_TRACER="True"
|
||||
echo_info "Enabling the T tracer"
|
||||
shift 1;;
|
||||
--disable-hardware-dependency)
|
||||
echo_info "Disabling hardware dependency for compiling software"
|
||||
DISABLE_HARDWARE_DEPENDENCY="True"
|
||||
shift 1;;
|
||||
-h | --help)
|
||||
print_help
|
||||
exit 1;;
|
||||
@@ -386,10 +394,16 @@ function main() {
|
||||
if [ "$HW" == "OAI_USRP" ] ; then
|
||||
echo_info "installing packages for USRP support"
|
||||
check_install_usrp_uhd_driver
|
||||
if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
|
||||
install_usrp_uhd_driver
|
||||
fi
|
||||
fi
|
||||
if [ "$HW" == "OAI_BLADERF" ] ; then
|
||||
echo_info "installing packages for BLADERF support"
|
||||
check_install_bladerf_driver
|
||||
if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
|
||||
flash_firmware_bladerf
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -67,7 +67,45 @@ echo_warning() { cecho "$*" $yellow ;}
|
||||
echo_success() { cecho "$*" $green ;}
|
||||
echo_info() { cecho "$*" $blue ;}
|
||||
|
||||
########################
|
||||
# distribution helpers #
|
||||
########################
|
||||
|
||||
# This function return a string to identify the distribution we are running
|
||||
# If we can't check the distribution, it returns "Unknown"
|
||||
# This function return always true as exit code by design
|
||||
# Examples:
|
||||
# Ubuntu16.04
|
||||
# Debian8.5
|
||||
get_distribution_release() {
|
||||
local distributor
|
||||
if distributor=$(lsb_release -si 2>/dev/null) ; then
|
||||
echo $distributor$(lsb_release -sr)
|
||||
else
|
||||
echo Unknown
|
||||
fi
|
||||
}
|
||||
|
||||
check_supported_distribution() {
|
||||
local distribution=$(get_distribution_release)
|
||||
case "$distribution" in
|
||||
"Ubuntu16.04") return 0 ;;
|
||||
"Ubuntu14.04") return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
##################
|
||||
# Error handlers #
|
||||
##################
|
||||
|
||||
handler_EXIT() {
|
||||
local exit_code=$?
|
||||
[ "$exit_code" -eq 0 ] || echo_error "build have failed"
|
||||
exit $exit_code
|
||||
}
|
||||
|
||||
trap handler_EXIT EXIT
|
||||
|
||||
###########################
|
||||
# Cleaners
|
||||
@@ -109,6 +147,7 @@ clean_all_files() {
|
||||
|
||||
compilations() {
|
||||
cd $OPENAIR_DIR/cmake_targets/$1/build
|
||||
set +e
|
||||
{
|
||||
rm -f $3
|
||||
if [ "$VERBOSE_COMPILE" == "1" ]; then
|
||||
@@ -118,12 +157,14 @@ compilations() {
|
||||
fi
|
||||
|
||||
} > $dlog/$2.$REL.txt 2>&1
|
||||
set -e
|
||||
echo_info "Log file for compilation has been written to: $dlog/$2.$REL.txt"
|
||||
if [ -s $3 ] ; then
|
||||
cp $3 $4
|
||||
echo_success "$2 compiled"
|
||||
else
|
||||
echo_error "$2 compilation failed"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -186,23 +227,36 @@ install_gnutls_from_source(){
|
||||
|
||||
check_install_usrp_uhd_driver(){
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove uhd libuhd-dev libuhd003 uhd-host -y
|
||||
$SUDO apt-get remove -y uhd || true
|
||||
$SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y
|
||||
v=$(lsb_release -cs)
|
||||
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
|
||||
#The new USRP repository
|
||||
$SUDO add-apt-repository ppa:ettusresearch/uhd -y
|
||||
$SUDO apt-get update
|
||||
$SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev
|
||||
$SUDO apt-get -y install libuhd-dev libuhd003 uhd-host
|
||||
$SUDO apt-get -y install libuhd-dev libuhd003
|
||||
}
|
||||
|
||||
install_usrp_uhd_driver() {
|
||||
# We move uhd-host apart because it depends on linux kernel version
|
||||
# On newer kernels, it fails to install
|
||||
$SUDO apt-get -y install uhd-host
|
||||
$SUDO uhd_images_downloader
|
||||
}
|
||||
|
||||
check_install_bladerf_driver(){
|
||||
$SUDO add-apt-repository -y ppa:bladerf/bladerf
|
||||
$SUDO apt-get update
|
||||
if [ "$(get_distribution_release)" == "Ubuntu14.04" ] ; then
|
||||
$SUDO add-apt-repository -y ppa:bladerf/bladerf
|
||||
$SUDO apt-get update
|
||||
fi
|
||||
$SUDO apt-get install -y bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y bladerf-fpga-hostedx40
|
||||
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
}
|
||||
|
||||
flash_firmware_bladerf() {
|
||||
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
}
|
||||
|
||||
check_install_additional_tools (){
|
||||
@@ -228,7 +282,10 @@ check_install_additional_tools (){
|
||||
ctags \
|
||||
ntpdate \
|
||||
iperf3 \
|
||||
android-tools-adb
|
||||
android-tools-adb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass
|
||||
|
||||
$SUDO pip install paramiko
|
||||
$SUDO pip install pyroute2
|
||||
@@ -248,8 +305,26 @@ check_install_additional_tools (){
|
||||
}
|
||||
|
||||
check_install_oai_software() {
|
||||
local specific_packages=""
|
||||
if ! check_supported_distribution; then
|
||||
echo_error "Your distribution $(get_distribution_release) is not supported by oai !"
|
||||
exit 1
|
||||
fi
|
||||
$SUDO apt-get update
|
||||
$SUDO apt install -y software-properties-common
|
||||
case "$(get_distribution_release)" in
|
||||
"Ubuntu14.04")
|
||||
specific_packages="libtasn1-3-dev"
|
||||
# For iperf3
|
||||
$SUDO add-apt-repository "deb http://archive.ubuntu.com/ubuntu trusty-backports universe"
|
||||
$SUDO apt-get update
|
||||
;;
|
||||
"Ubuntu16.04")
|
||||
specific_packages="libtasn1-6-dev"
|
||||
;;
|
||||
esac
|
||||
$SUDO apt-get install -y \
|
||||
$specific_packages \
|
||||
autoconf \
|
||||
automake \
|
||||
bison \
|
||||
@@ -273,9 +348,9 @@ check_install_oai_software() {
|
||||
iptables-dev \
|
||||
libatlas-base-dev \
|
||||
libatlas-dev \
|
||||
libblas3gf \
|
||||
libblas-dev \
|
||||
libconfig8-dev \
|
||||
libffi-dev \
|
||||
libforms-bin \
|
||||
libforms-dev \
|
||||
libgcrypt11-dev \
|
||||
@@ -285,16 +360,16 @@ check_install_oai_software() {
|
||||
libidn11-dev \
|
||||
libmysqlclient-dev \
|
||||
liboctave-dev \
|
||||
libpgm-5.1 \
|
||||
libpgm-dev \
|
||||
libpython2.7-dev \
|
||||
libsctp1 \
|
||||
libsctp-dev \
|
||||
libssl-dev \
|
||||
libtasn1-3-dev \
|
||||
libtool \
|
||||
libusb-1.0-0-dev \
|
||||
libxml2 \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
linux-headers-`uname -r` \
|
||||
mscgen \
|
||||
octave \
|
||||
@@ -307,11 +382,7 @@ check_install_oai_software() {
|
||||
xmlstarlet \
|
||||
python-pip \
|
||||
pydb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass \
|
||||
libxslt1-dev \
|
||||
android-tools-adb
|
||||
wget
|
||||
|
||||
$SUDO update-alternatives --set liblapack.so /usr/lib/atlas-base/atlas/liblapack.so
|
||||
|
||||
@@ -337,6 +408,7 @@ install_asn1c_from_source(){
|
||||
./configure
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
cd -
|
||||
) > $asn1_install_log 2>&1
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,9 @@ function help()
|
||||
echo_error " -f, --rf-config-file filename RF specific configuration file"
|
||||
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
|
||||
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
|
||||
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
|
||||
echo_error " -n, --T-no-wait don't wait for tracer, start immediately"
|
||||
echo_error " -p, --T-port port use given port"
|
||||
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
|
||||
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
|
||||
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
|
||||
echo_error " -T, --target-ul-mcs mcs Uplink target MCS."
|
||||
@@ -188,7 +190,17 @@ function main()
|
||||
exe_arguments="$exe_arguments -m $2"
|
||||
shift 2;
|
||||
;;
|
||||
-V | --vcd)
|
||||
-n | --T-no-wait)
|
||||
echo "setting T tracer operation"
|
||||
exe_arguments="$exe_arguments --T_nowait"
|
||||
shift ;
|
||||
;;
|
||||
-p | --T-port)
|
||||
echo "setting T tracer port"
|
||||
exe_arguments="$exe_arguments --T_port $2"
|
||||
shift 2;
|
||||
;;
|
||||
-V | --vcd)
|
||||
echo "setting gtk-wave output"
|
||||
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
|
||||
shift ;
|
||||
|
||||
@@ -1126,12 +1126,8 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
dlsch[0]->harq_ids[subframe] = harq_pid;
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
|
||||
if (dlsch0_harq->round == 0)
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
@@ -1265,9 +1261,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
// MCS and TBS don't change across HARQ rounds
|
||||
@@ -1635,19 +1628,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
}
|
||||
|
||||
// reset HARQ process if this is the first transmission
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
if (dlsch0_harq->round == 0)
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
if (dlsch1_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch1_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch1, harq_pid);
|
||||
if (dlsch1_harq->round == 0)
|
||||
dlsch1_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
dlsch0->rnti = rnti;
|
||||
dlsch1->rnti = rnti;
|
||||
@@ -2022,19 +2007,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
}
|
||||
|
||||
// reset HARQ process if this is the first transmission
|
||||
if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
if ((dlsch0->active==1) && (dlsch0_harq->round == 0))
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) {
|
||||
/* necessary test? */
|
||||
if (dlsch1_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch1, harq_pid);
|
||||
if ((dlsch1->active==1) && (dlsch1_harq->round == 0))
|
||||
dlsch1_harq->status = ACTIVE;
|
||||
}
|
||||
|
||||
dlsch0->rnti = rnti;
|
||||
dlsch1->rnti = rnti;
|
||||
@@ -2174,23 +2151,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
// check if either TB is disabled (see 36-213 V8.6 p. 26)
|
||||
|
||||
|
||||
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
|
||||
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
|
||||
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0))
|
||||
dlsch0_harq->status = DISABLED;
|
||||
}
|
||||
|
||||
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
|
||||
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
|
||||
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0))
|
||||
dlsch1_harq->status = DISABLED;
|
||||
}
|
||||
|
||||
dlsch0_harq->Nl = 1;
|
||||
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
}
|
||||
@@ -2355,17 +2325,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
|
||||
if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
dlsch0_harq->mcs = mcs1;
|
||||
}
|
||||
|
||||
if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) {
|
||||
/* necessary test? */
|
||||
if (dlsch1_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch1, harq_pid);
|
||||
dlsch1_harq->status = ACTIVE;
|
||||
dlsch1_harq->mcs = mcs2;
|
||||
}
|
||||
@@ -2529,9 +2493,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
}
|
||||
@@ -2661,9 +2622,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
|
||||
|
||||
// dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi;
|
||||
if (dlsch0_harq->round == 0) {
|
||||
/* necessary test? */
|
||||
if (dlsch0_harq->status == SCH_IDLE)
|
||||
remove_harq_pid_from_freelist(dlsch0, harq_pid);
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
|
||||
}
|
||||
|
||||
@@ -258,13 +258,6 @@ typedef struct {
|
||||
uint8_t error_threshold;
|
||||
/// Pointers to 8 HARQ processes for the DLSCH
|
||||
LTE_DL_eNB_HARQ_t *harq_processes[8];
|
||||
/// circular list of free harq PIDs (the oldest come first)
|
||||
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
|
||||
int harq_pid_freelist[10];
|
||||
/// the head position of the free list (if list is free then head=tail)
|
||||
int head_freelist;
|
||||
/// the tail position of the free list
|
||||
int tail_freelist;
|
||||
/// Number of soft channel bits
|
||||
uint32_t G;
|
||||
/// Codebook index for this dlsch (0,1,2,3)
|
||||
|
||||
@@ -156,9 +156,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
for (i=0; i<10; i++)
|
||||
dlsch->harq_ids[i] = Mdlharq;
|
||||
|
||||
dlsch->head_freelist = 0;
|
||||
dlsch->tail_freelist = 0;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
|
||||
LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
|
||||
@@ -199,8 +196,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
msg("Can't get harq_p %d\n",i);
|
||||
exit_flag=3;
|
||||
}
|
||||
|
||||
put_harq_pid_in_freelist(dlsch, i);
|
||||
}
|
||||
|
||||
if (exit_flag==0) {
|
||||
|
||||
@@ -55,7 +55,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
|
||||
unsigned int rx_offset;
|
||||
|
||||
void (*dft)(int16_t *,int16_t *, int);
|
||||
int tmp_dft_in[2048]; // This is for misalignment issues for 6 and 15 PRBs
|
||||
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
|
||||
|
||||
switch (frame_parms->ofdm_symbol_size) {
|
||||
case 128:
|
||||
|
||||
@@ -400,9 +400,6 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
|
||||
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
|
||||
|
||||
|
||||
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
|
||||
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
|
||||
|
||||
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti);
|
||||
|
||||
@@ -155,10 +155,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->type = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->vrb_type = 0;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rballoc = computeRIV(50,10,3);
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->ndi = subframe / 5;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->rv = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->mcs = 1;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1A_10MHz_TDD_1_6_t*)&bcch_pdu)->TPC = 1; // set to 3 PRB
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],&bcch_pdu,sizeof(DCI1A_10MHz_TDD_1_6_t));
|
||||
}
|
||||
@@ -233,10 +233,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->ndi = subframe / 5;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
((DCI1_5MHz_FDD_t *)&dlsch_pdu)->rah = 0;
|
||||
|
||||
@@ -266,10 +266,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(25,10,3);
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//((DCI1_5MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||
((DCI1_5MHz_TDD_t *)&dlsch_pdu)->rah = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_5MHz_TDD_t));
|
||||
@@ -304,10 +304,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3);
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//((DCI1_10MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->ndi = subframe / 5;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
((DCI1_10MHz_FDD_t *)&dlsch_pdu)->rah = 0;
|
||||
|
||||
@@ -338,10 +338,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(50,10,3);
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//((DCI1_10MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||
((DCI1_10MHz_TDD_t *)&dlsch_pdu)->rah = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_10MHz_TDD_t));
|
||||
@@ -375,10 +375,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3);
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//((DCI1_5MHz_FDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->ndi = subframe / 5;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rv = 0;
|
||||
((DCI1_20MHz_FDD_t *)&dlsch_pdu)->rah = 0;
|
||||
|
||||
@@ -409,10 +409,10 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rballoc = rballoc; //computeRIV(100,10,3);
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->TPC = 0;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->dai = 0;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->harq_pid = subframe % 5;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
//((DCI1_20MHz_TDD_t *)&dlsch_pdu)->mcs = (unsigned char) ((phy_vars_eNB->frame%1024)%28);
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->ndi = subframe / 5;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rv = 0;
|
||||
((DCI1_20MHz_TDD_t *)&dlsch_pdu)->rah = 0;
|
||||
memcpy((void*)&DCI_pdu->dci_alloc[0].dci_pdu[0],(void *)&dlsch_pdu,sizeof(DCI1_20MHz_TDD_t));
|
||||
@@ -451,13 +451,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tpmi = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv1 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi1 = subframe / 5;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs1 = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rv2 = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->ndi2 = subframe / 5;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->mcs2 = openair_daq_vars.target_ue_dl_mcs;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->tb_swap = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->harq_pid = subframe % 5;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->TPC = 0;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rballoc = openair_daq_vars.ue_dl_rb_alloc;
|
||||
((DCI2_5MHz_2A_FDD_t*) (&DCI_pdu->dci_alloc[0].dci_pdu))->rah = 0;
|
||||
@@ -473,13 +473,13 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_e
|
||||
|
||||
DLSCH_alloc_pdu1E.tpmi = 5; //5=use feedback
|
||||
DLSCH_alloc_pdu1E.rv = 0;
|
||||
DLSCH_alloc_pdu1E.ndi = phy_vars_eNB->proc[sched_subframe].frame_tx&1;
|
||||
DLSCH_alloc_pdu1E.ndi = subframe / 5;
|
||||
//DLSCH_alloc_pdu1E.mcs = cqi_to_mcs[phy_vars_eNB->eNB_UE_stats->DL_cqi[0]];
|
||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) (taus()%28);
|
||||
DLSCH_alloc_pdu1E.mcs = openair_daq_vars.target_ue_dl_mcs;
|
||||
//DLSCH_alloc_pdu1E.mcs = (unsigned char) ((phy_vars_eNB->proc[subframe].frame%1024)%28);
|
||||
phy_vars_eNB->eNB_UE_stats[0].dlsch_mcs1 = DLSCH_alloc_pdu1E.mcs;
|
||||
DLSCH_alloc_pdu1E.harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
DLSCH_alloc_pdu1E.harq_pid = subframe % 5;
|
||||
DLSCH_alloc_pdu1E.dai = 0;
|
||||
DLSCH_alloc_pdu1E.TPC = 0;
|
||||
DLSCH_alloc_pdu1E.rballoc = openair_daq_vars.ue_dl_rb_alloc;
|
||||
|
||||
@@ -133,30 +133,6 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su
|
||||
return(0);
|
||||
}
|
||||
|
||||
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
|
||||
{
|
||||
DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->tail_freelist] = harq_pid;
|
||||
DLSCH_ptr->tail_freelist = (DLSCH_ptr->tail_freelist + 1) % 10;
|
||||
}
|
||||
|
||||
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
|
||||
{
|
||||
if (DLSCH_ptr->head_freelist == DLSCH_ptr->tail_freelist) {
|
||||
LOG_E(PHY, "%s:%d: you cannot read this!\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
/* basic check, in case several threads deal with the free list at the same time
|
||||
* in normal situations it should not happen, that's also why we don't use any
|
||||
* locking mechanism to protect the free list
|
||||
* to be refined in case things don't work properly
|
||||
*/
|
||||
if (harq_pid != DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]) {
|
||||
LOG_E(PHY, "%s:%d: critical error, get in touch with the authors\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
DLSCH_ptr->head_freelist = (DLSCH_ptr->head_freelist + 1) % 10;
|
||||
}
|
||||
|
||||
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
|
||||
{
|
||||
uint8_t i;
|
||||
@@ -221,12 +197,6 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
|
||||
memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
|
||||
// mac_exit_wrapper("Removing UE");
|
||||
|
||||
/* clear the harq pid freelist */
|
||||
phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0;
|
||||
phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0;
|
||||
for (j = 0; j < 8; j++)
|
||||
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j);
|
||||
|
||||
return(i);
|
||||
}
|
||||
}
|
||||
@@ -258,9 +228,8 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
|
||||
LTE_eNB_DLSCH_t *DLSCH_ptr;
|
||||
LTE_eNB_ULSCH_t *ULSCH_ptr;
|
||||
uint8_t ulsch_subframe,ulsch_frame;
|
||||
uint8_t i;
|
||||
int i;
|
||||
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
|
||||
int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
|
||||
|
||||
if (UE_id==-1) {
|
||||
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
|
||||
@@ -271,40 +240,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
|
||||
if (ul_flag == 0) {// this is a DL request
|
||||
DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][0];
|
||||
|
||||
// set to no available process first
|
||||
*harq_pid = -1;
|
||||
/* let's go synchronous for the moment - maybe we can change at some point */
|
||||
i = (frame * 10 + subframe) % 8;
|
||||
|
||||
for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
|
||||
if (DLSCH_ptr->harq_processes[i]!=NULL) {
|
||||
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
|
||||
sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
|
||||
if (sf2<=sf1)
|
||||
sfdiff = sf1-sf2;
|
||||
else // this happens when wrapping around 1024 frame barrier
|
||||
sfdiff = 10240 + sf1-sf2;
|
||||
LOG_D(PHY,"process %d is active, round %d (waiting %d)\n",i,DLSCH_ptr->harq_processes[i]->round,sfdiff);
|
||||
|
||||
if (sfdiff>sfdiff_max) { // this is an active process that is waiting longer than the others (and longer than 7 ms)
|
||||
sfdiff_max = sfdiff;
|
||||
*harq_pid = i;
|
||||
*round = DLSCH_ptr->harq_processes[i]->round;
|
||||
}
|
||||
}
|
||||
} else { // a process is not defined
|
||||
LOG_E(PHY,"[eNB %d] DLSCH process %d for rnti %x (UE_id %d) not allocated\n",Mod_id,i,rnti,UE_id);
|
||||
return(-1);
|
||||
}
|
||||
}
|
||||
|
||||
/* if no active harq pid, get the oldest in the freelist, if any */
|
||||
if (*harq_pid == 255 && DLSCH_ptr->head_freelist != DLSCH_ptr->tail_freelist) {
|
||||
*harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
|
||||
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
|
||||
*harq_pid = i;
|
||||
*round = DLSCH_ptr->harq_processes[i]->round;
|
||||
} else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) {
|
||||
*harq_pid = i;
|
||||
*round = 0;
|
||||
LOG_D(PHY,"process %d is first free process\n", *harq_pid);
|
||||
} else {
|
||||
printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__);
|
||||
abort();
|
||||
}
|
||||
|
||||
LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
|
||||
frame,subframe,*harq_pid);
|
||||
} else { // This is a UL request
|
||||
|
||||
ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[(uint32_t)UE_id];
|
||||
@@ -1906,7 +1854,6 @@ void process_HARQ_feedback(uint8_t UE_id,
|
||||
dlsch_harq_proc->round = 0;
|
||||
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
|
||||
dlsch_harq_proc->status = SCH_IDLE;
|
||||
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
|
||||
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
|
||||
}
|
||||
} else {
|
||||
@@ -1923,7 +1870,6 @@ void process_HARQ_feedback(uint8_t UE_id,
|
||||
// Received ACK so set round to 0 and set dlsch_harq_pid IDLE
|
||||
dlsch_harq_proc->round = 0;
|
||||
dlsch_harq_proc->status = SCH_IDLE;
|
||||
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
|
||||
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
|
||||
|
||||
ue_stats->total_TBS = ue_stats->total_TBS +
|
||||
@@ -2345,9 +2291,6 @@ void pucch_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_
|
||||
phy_vars_eNB->eNB_UE_stats[UE_id].sr_received++;
|
||||
|
||||
if (phy_vars_eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
|
||||
/* is this test necessary? */
|
||||
if (phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status != SCH_IDLE)
|
||||
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[UE_id][0], 0);
|
||||
phy_vars_eNB->first_sr[UE_id] = 0;
|
||||
phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->round=0;
|
||||
phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status=SCH_IDLE;
|
||||
|
||||
@@ -298,6 +298,12 @@ int rrc_mac_remove_ue(module_id_t mod_idP,rnti_t rntiP)
|
||||
int UE_id = find_UE_id(mod_idP,rntiP);
|
||||
int pCC_id = UE_PCCID(mod_idP,UE_id);
|
||||
|
||||
if (UE_id == -1) {
|
||||
LOG_W(MAC,"rrc_mac_remove_ue: UE %x not found\n", rntiP);
|
||||
mac_phy_remove_ue(mod_idP,rntiP);
|
||||
return 0;
|
||||
}
|
||||
|
||||
LOG_I(MAC,"Removing UE %d from Primary CC_id %d (rnti %x)\n",UE_id,pCC_id, rntiP);
|
||||
dump_ue_list(UE_list,0);
|
||||
|
||||
|
||||
@@ -719,12 +719,12 @@ mac_eNB_get_rrc_status(
|
||||
}
|
||||
}
|
||||
|
||||
void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const int CC_idP,
|
||||
void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
const int CC_idP,
|
||||
const frame_t frameP,
|
||||
const sub_frame_t subframeP,
|
||||
const rnti_t rntiP) {
|
||||
|
||||
const rnti_t rntiP)
|
||||
{
|
||||
struct rrc_eNB_ue_context_s* ue_context_p = NULL;
|
||||
ue_context_p = rrc_eNB_get_ue_context(
|
||||
&eNB_rrc_inst[Mod_instP],
|
||||
@@ -735,10 +735,9 @@ void mac_eNB_rrc_ul_failure(const module_id_t Mod_instP,
|
||||
ue_context_p->ue_context.ul_failure_timer=1;
|
||||
}
|
||||
else {
|
||||
LOG_W(RRC,"Frame %d, Subframe %d: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||
rrc_mac_remove_ue(Mod_instP,rntiP);
|
||||
LOG_W(RRC,"Frame %d, Subframe %d: UL failure: UE %x unknown \n",frameP,subframeP,rntiP);
|
||||
}
|
||||
|
||||
rrc_mac_remove_ue(Mod_instP,rntiP);
|
||||
}
|
||||
|
||||
void mac_eNB_rrc_ul_in_sync(const module_id_t Mod_instP,
|
||||
|
||||
@@ -3790,14 +3790,29 @@ rrc_eNB_decode_ccch(
|
||||
//#warning "TODO: stmsi_exist: remove UE from MAC/PHY (how?)"
|
||||
LOG_I(RRC," S-TMSI exists, ue_context_p %p\n",ue_context_p);
|
||||
stmsi_received=1;
|
||||
/* replace rnti in the context */
|
||||
/* for that, remove the context from the RB tree */
|
||||
RB_REMOVE(rrc_ue_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
|
||||
/* and insert again, after changing rnti everywhere it has to be changed */
|
||||
ue_context_p->ue_id_rnti = ctxt_pP->rnti;
|
||||
ue_context_p->ue_context.rnti = ctxt_pP->rnti;
|
||||
RB_INSERT(rrc_ue_tree_s, &eNB_rrc_inst[ctxt_pP->module_id].rrc_ue_head, ue_context_p);
|
||||
/* reset timers */
|
||||
ue_context_p->ue_context.ul_failure_timer = 0;
|
||||
ue_context_p->ue_context.ue_release_timer = 0;
|
||||
// AssertFatal(0 == 1, "TODO: remove UE from MAC/PHY (how?)");
|
||||
// ue_context_p = NULL;
|
||||
} else {
|
||||
ue_context_p = rrc_eNB_get_next_free_ue_context(ctxt_pP, NOT_A_RANDOM_UE_IDENTITY);
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE;
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code;
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi;
|
||||
if (ue_context_p == NULL)
|
||||
LOG_E(RRC, "%s:%d:%s: rrc_eNB_get_next_free_ue_context returned NULL\n", __FILE__, __LINE__, __FUNCTION__);
|
||||
if (ue_context_p != NULL) {
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.presence = TRUE;
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.mme_code = mme_code;
|
||||
ue_context_p->ue_context.Initialue_identity_s_TMSI.m_tmsi = m_tmsi;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
MSC_LOG_RX_MESSAGE(
|
||||
|
||||
+52
-89
@@ -137,27 +137,15 @@ typedef guint8 gboolean;
|
||||
|
||||
//static unsigned char g_PDUBuffer[1600];
|
||||
//static unsigned int g_PDUOffset;
|
||||
#ifdef JUMBO_FRAME
|
||||
static unsigned char g_frameBuffer[9000];
|
||||
#else
|
||||
static unsigned char g_frameBuffer[1600];
|
||||
#endif
|
||||
//static unsigned char g_fileBuffer[1600];
|
||||
static unsigned int g_frameOffset;
|
||||
|
||||
|
||||
char in_ip[40];
|
||||
char in_path[100];
|
||||
static uint16_t in_port;
|
||||
FILE *file_fd = NULL;
|
||||
|
||||
trace_mode_t opt_type = OPT_NONE;
|
||||
static radio_type_t radio_type;
|
||||
static unsigned int subframesSinceCaptureStart;
|
||||
// double timing_perf[250];
|
||||
// clock_t timing_in[250];
|
||||
// clock_t timing_out[250];
|
||||
int test=0;
|
||||
int init_value=0;
|
||||
|
||||
static int g_socksd = -1;/* UDP socket used for sending frames */
|
||||
static struct sockaddr_in g_serv_addr;
|
||||
@@ -277,66 +265,73 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
|
||||
guint8 oob_event, guint8 oob_event_value,
|
||||
uint8_t *pdu_buffer, unsigned int pdu_buffer_size)
|
||||
{
|
||||
#ifdef JUMBO_FRAME
|
||||
static unsigned char frameBuffer[9000];
|
||||
#else
|
||||
static unsigned char frameBuffer[1600];
|
||||
#endif
|
||||
static unsigned int frameOffset;
|
||||
|
||||
ssize_t bytesSent;
|
||||
g_frameOffset = 0;
|
||||
frameOffset = 0;
|
||||
uint16_t tmp16;
|
||||
|
||||
/********************************************************************/
|
||||
/* Fixed start to each frame (allowing heuristic dissector to work) */
|
||||
/* Not NULL terminated */
|
||||
memset(g_frameBuffer+g_frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
|
||||
memset(frameBuffer+frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
|
||||
|
||||
memcpy(g_frameBuffer+g_frameOffset, MAC_LTE_START_STRING,
|
||||
memcpy(frameBuffer+frameOffset, MAC_LTE_START_STRING,
|
||||
strlen(MAC_LTE_START_STRING));
|
||||
g_frameOffset += strlen(MAC_LTE_START_STRING);
|
||||
frameOffset += strlen(MAC_LTE_START_STRING);
|
||||
|
||||
/******************************************************************************/
|
||||
/* Now write out fixed fields (the mandatory elements of struct mac_lte_info) */
|
||||
g_frameBuffer[g_frameOffset++] = radioType;
|
||||
g_frameBuffer[g_frameOffset++] = direction;
|
||||
g_frameBuffer[g_frameOffset++] = rntiType;
|
||||
frameBuffer[frameOffset++] = radioType;
|
||||
frameBuffer[frameOffset++] = direction;
|
||||
frameBuffer[frameOffset++] = rntiType;
|
||||
|
||||
/*************************************/
|
||||
/* Now optional fields */
|
||||
|
||||
/* RNTI */
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_RNTI_TAG;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_RNTI_TAG;
|
||||
tmp16 = htons(rnti);
|
||||
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
|
||||
g_frameOffset += 2;
|
||||
memcpy(frameBuffer+frameOffset, &tmp16, 2);
|
||||
frameOffset += 2;
|
||||
|
||||
/* UEId */
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_UEID_TAG;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_UEID_TAG;
|
||||
tmp16 = htons(ueid);
|
||||
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
|
||||
g_frameOffset += 2;
|
||||
memcpy(frameBuffer+frameOffset, &tmp16, 2);
|
||||
frameOffset += 2;
|
||||
|
||||
/* Subframe number */
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_SUBFRAME_TAG;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_SUBFRAME_TAG;
|
||||
tmp16 = htons(subframeNumber); // frame counter : this will give an expert info as wireshark expects SF and not F
|
||||
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
|
||||
g_frameOffset += 2;
|
||||
memcpy(frameBuffer+frameOffset, &tmp16, 2);
|
||||
frameOffset += 2;
|
||||
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
|
||||
g_frameBuffer[g_frameOffset++] = crcStatus;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
|
||||
frameBuffer[frameOffset++] = crcStatus;
|
||||
|
||||
#ifdef WIRESHARK_DEV
|
||||
g_frameOffset += 2;
|
||||
frameOffset += 2;
|
||||
tmp16 = htons(subframeNumber); // subframe
|
||||
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
|
||||
g_frameOffset += 2;
|
||||
memcpy(frameBuffer+frameOffset, &tmp16, 2);
|
||||
frameOffset += 2;
|
||||
#endif
|
||||
|
||||
/***********************************************************/
|
||||
/* For these optional fields, no need to encode if value is default */
|
||||
if (!isPredefinedData) {
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
|
||||
g_frameBuffer[g_frameOffset++] = isPredefinedData;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
|
||||
frameBuffer[frameOffset++] = isPredefinedData;
|
||||
}
|
||||
|
||||
if (retx != 0) {
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_RETX_TAG;
|
||||
g_frameBuffer[g_frameOffset++] = retx;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_RETX_TAG;
|
||||
frameBuffer[frameOffset++] = retx;
|
||||
}
|
||||
|
||||
#ifdef WIRESHARK_DEV
|
||||
@@ -347,19 +342,19 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
|
||||
switch (oob_event) {
|
||||
case ltemac_send_preamble :
|
||||
LOG_D(OPT,"oob event %d %d\n",ltemac_send_preamble );
|
||||
//g_frameBuffer[g_frameOffset++]=0;
|
||||
//g_frameBuffer[g_frameOffset++]=0;
|
||||
//g_frameBuffer[g_frameOffset++]=0;
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
|
||||
g_frameBuffer[g_frameOffset++]=ltemac_send_preamble;
|
||||
g_frameBuffer[g_frameOffset++]=rnti; // is the preamble
|
||||
g_frameBuffer[g_frameOffset++]=oob_event_value;
|
||||
//frameBuffer[frameOffset++]=0;
|
||||
//frameBuffer[frameOffset++]=0;
|
||||
//frameBuffer[frameOffset++]=0;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
|
||||
frameBuffer[frameOffset++]=ltemac_send_preamble;
|
||||
frameBuffer[frameOffset++]=rnti; // is the preamble
|
||||
frameBuffer[frameOffset++]=oob_event_value;
|
||||
break;
|
||||
|
||||
case ltemac_send_sr:
|
||||
g_frameBuffer[g_frameOffset++]=ltemac_send_sr;
|
||||
g_frameOffset+=2;
|
||||
g_frameBuffer[g_frameOffset++]=oob_event_value;
|
||||
frameBuffer[frameOffset++]=ltemac_send_sr;
|
||||
frameOffset+=2;
|
||||
frameBuffer[frameOffset++]=oob_event_value;
|
||||
break;
|
||||
|
||||
case ltemac_sr_failure:
|
||||
@@ -372,23 +367,23 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
|
||||
#endif
|
||||
/***************************************/
|
||||
/* Now write the MAC PDU */
|
||||
g_frameBuffer[g_frameOffset++] = MAC_LTE_PAYLOAD_TAG;
|
||||
frameBuffer[frameOffset++] = MAC_LTE_PAYLOAD_TAG;
|
||||
|
||||
/* Append actual PDU */
|
||||
//memcpy(g_frameBuffer+g_frameOffset, g_PDUBuffer, g_PDUOffset);
|
||||
//g_frameOffset += g_PDUOffset;
|
||||
//memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset);
|
||||
//frameOffset += g_PDUOffset;
|
||||
if (pdu_buffer != NULL) {
|
||||
memcpy(g_frameBuffer+g_frameOffset, (void*)pdu_buffer, pdu_buffer_size);
|
||||
g_frameOffset += pdu_buffer_size;
|
||||
memcpy(frameBuffer+frameOffset, (void*)pdu_buffer, pdu_buffer_size);
|
||||
frameOffset += pdu_buffer_size;
|
||||
}
|
||||
|
||||
/* Send out the data over the UDP socket */
|
||||
bytesSent = sendto(g_socksd, g_frameBuffer, g_frameOffset, 0,
|
||||
bytesSent = sendto(g_socksd, frameBuffer, frameOffset, 0,
|
||||
(const struct sockaddr *)&g_serv_addr, sizeof(g_serv_addr));
|
||||
|
||||
if (bytesSent != g_frameOffset) {
|
||||
if (bytesSent != frameOffset) {
|
||||
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %d (errno=%d)\n",
|
||||
g_frameOffset, bytesSent, errno);
|
||||
frameOffset, bytesSent, errno);
|
||||
//exit(1);
|
||||
}
|
||||
}
|
||||
@@ -509,6 +504,7 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
|
||||
/*---------------------------------------------------*/
|
||||
int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p)
|
||||
{
|
||||
uint16_t in_port;
|
||||
subframesSinceCaptureStart = 0;
|
||||
|
||||
if (path != NULL) {
|
||||
@@ -612,37 +608,4 @@ void terminate_opt(void)
|
||||
break;
|
||||
}
|
||||
}
|
||||
/*
|
||||
double *timing_analyzer(int index, int direction ){
|
||||
//
|
||||
int i;
|
||||
if (direction==0)// in
|
||||
{
|
||||
timing_in[index]=clock();
|
||||
//if(timing_out[index+100]>timing_in[index+100]);
|
||||
//timing_perf[index+100] +=(double)((double)(timing_out[index+100]-timing_in[index+100])/(double)CLOCKS_PER_SEC);
|
||||
}
|
||||
else
|
||||
{
|
||||
timing_out[index]=clock();
|
||||
if(index==5)timing_perf[index]=0;
|
||||
timing_perf[index] +=(double)((double)(timing_out[index]-timing_in[index])/(((double)CLOCKS_PER_SEC)/1000000));
|
||||
|
||||
//LOG_I(OPT,"timing_analyser index %d =%f\n",index,timing_perf[index]);
|
||||
init_value++;
|
||||
if(init_value==500)
|
||||
{
|
||||
for(i=0;i<6;i++)
|
||||
{
|
||||
LOG_I(OPT,"timing_analyser index %d =%f\n",i,timing_perf[i]);
|
||||
}
|
||||
init_value=0;
|
||||
}
|
||||
|
||||
return(&timing_perf[0]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
@@ -14,14 +14,15 @@ typedef struct
|
||||
int16_t q;
|
||||
} complex16_t;
|
||||
|
||||
typedef struct
|
||||
class SamplesPacket
|
||||
{
|
||||
public:
|
||||
uint64_t timestamp; //timestamp of the packet
|
||||
uint16_t first; //index of first unused sample in samples[]
|
||||
uint16_t last; //end index of samples
|
||||
static const uint16_t samplesCount = 1024; //maximum number of samples in packet
|
||||
complex16_t samples[samplesCount]; //must be power of two
|
||||
} SamplesPacket;
|
||||
};
|
||||
|
||||
complex16_t operator &=(complex16_t & other1, const complex16_t & other) // copy assignment
|
||||
{
|
||||
@@ -30,4 +31,4 @@ complex16_t operator &=(complex16_t & other1, const complex16_t & other) // copy
|
||||
return other1;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+46
-40
@@ -49,15 +49,16 @@ NUM_eNB=1
|
||||
NUM_TRIALS=3
|
||||
|
||||
PRB=[25,50,100]
|
||||
MCS=[0,4,9,10,13,16,17,22,27]
|
||||
MCS=[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]
|
||||
#MCS=[0,4,9,10,13,16,17,22,27]
|
||||
#PRB=[100]
|
||||
#MCS=[16]
|
||||
ANT_TX=1 # 2
|
||||
ANT_TX=2 # 2
|
||||
ANT_RX=2 # 2
|
||||
CHANNEL=["N"]
|
||||
#CHANNEL=["C","E","F","G","H","I","L","M"] # A,B,C,D,E,F,
|
||||
TX_MODE=2 # 2,
|
||||
MIN_SNR=0
|
||||
MIN_SNR=10
|
||||
MAX_SNR=40
|
||||
PERF=75
|
||||
OPT="-L"
|
||||
@@ -69,9 +70,9 @@ FRAME=2000
|
||||
def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
|
||||
|
||||
case = '10'
|
||||
oai.send('cd $OPENAIR1_DIR;')
|
||||
oai.send('cd SIMULATION/LTE_PHY;')
|
||||
|
||||
oai.send('cd $OPENAIR_TARGETS;')
|
||||
oai.send('cd bin;')
|
||||
oai.send('cp ./ulsim.Rel10 ./ulsim.Rel10.'+host)
|
||||
try:
|
||||
log.start()
|
||||
test = '300'
|
||||
@@ -80,13 +81,13 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
|
||||
diag = 'ulsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
|
||||
trace = logdir + '/log_' + host + case + test + '_1.txt;'
|
||||
tee = ' 2>&1 | tee ' + trace
|
||||
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
|
||||
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
|
||||
trace = logdir + '/log_' + host + case + test + '_2.txt;'
|
||||
tee = ' 2>&1 | tee ' + trace
|
||||
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Exiting', 30)
|
||||
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Exiting', 30)
|
||||
trace = logdir + '/log_' + host + case + test + '_3.txt;'
|
||||
tee = ' 2>&1 | tee ' + trace
|
||||
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'FATAL', 30)
|
||||
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'FATAL', 30)
|
||||
|
||||
except log.err, e:
|
||||
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
|
||||
@@ -100,42 +101,47 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
|
||||
diag = 'no diagnostic is available, check the log file'
|
||||
for i in range(len(PRB)):
|
||||
for o in range(len(CHANNEL)):
|
||||
MIN_SNR=0
|
||||
MIN_SNR=10
|
||||
for j in range(len(MCS)):
|
||||
for m in range (1,ANT_RX):
|
||||
for p in range(1,TX_MODE):
|
||||
for q in range(MIN_SNR,MAX_SNR):
|
||||
#if if PRB[i] :
|
||||
for r in range(5,PRB[i]):
|
||||
for q in range(MIN_SNR,MAX_SNR):
|
||||
|
||||
|
||||
if r ==7 or r ==11 or r ==14 or r == 17 or r==19 or r == 21 or r == 23 or r == 26 or r == 28 :
|
||||
continue
|
||||
|
||||
conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT
|
||||
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
|
||||
tee = ' 2>&1 | tee ' + trace
|
||||
if cpu > -1 :
|
||||
cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.rel8.'+ host + ' ' + conf + tee
|
||||
else :
|
||||
cmd = './ulsim.rel8.'+ host + ' ' + conf + tee
|
||||
|
||||
if debug :
|
||||
print cmd
|
||||
|
||||
# match = oai.send_expect_re(cmd, 'passed', 0, 1000)
|
||||
match =1
|
||||
if match :
|
||||
log.ok(case, str(test), name, conf, '', logfile)
|
||||
MIN_SNR = q - 1 # just to speed up the test
|
||||
test+=1
|
||||
break # found the smallest snr
|
||||
else :
|
||||
if q == MAX_SNR -1 :
|
||||
log.skip(case,str(test), name, conf,'','',logfile)
|
||||
conf = '-B' + str(PRB[i]) + ' -r'+str(r) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT
|
||||
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+ '_rb'+str(r)+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
|
||||
tee = ' 2>&1 | tee ' + trace
|
||||
if cpu > -1 :
|
||||
cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.Rel10.'+ host + ' ' + conf + tee
|
||||
else :
|
||||
cmd = './ulsim.Rel10.'+ host + ' ' + conf + tee
|
||||
|
||||
if debug :
|
||||
print cmd
|
||||
|
||||
match = oai.send_expect_re(cmd, 'passed', 0, 1000)
|
||||
#match =1
|
||||
if match :
|
||||
|
||||
log.ok(case, str(test), name, conf, '', logfile)
|
||||
MIN_SNR = q - 1 # just to speed up the test
|
||||
test+=1
|
||||
break
|
||||
try:
|
||||
if os.path.isfile(trace) :
|
||||
os.remove(trace)
|
||||
except OSError, e: ## if failed, report it back to the user ##
|
||||
print ("Error: %s - %s." % (e.filename,e.strerror))
|
||||
|
||||
break # found the smallest snr
|
||||
else :
|
||||
if q == MAX_SNR -1 :
|
||||
log.skip(case,str(test), name, conf,'','',logfile)
|
||||
test+=1
|
||||
break
|
||||
try:
|
||||
if os.path.isfile(trace) :
|
||||
os.remove(trace)
|
||||
except OSError, e: ## if failed, report it back to the user ##
|
||||
print ("Error: %s - %s." % (e.filename,e.strerror))
|
||||
|
||||
|
||||
|
||||
except log.err, e:
|
||||
|
||||
Reference in New Issue
Block a user