Commit 8f462415 authored by matzakos's avatar matzakos

ENDC: Merge NR_RRCConfiguration into nr-dual-connectivity branch

parents c1345294 7639d9a1
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
# log and exec file # log and exec file
cmake_targets/log/ cmake_targets/log/
cmake_targets/*/build/ cmake_targets/*/build/
cmake_targets/ran_build/
log/ log/
lte_build_oai/ lte_build_oai/
targets/bin/ targets/bin/
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "enter program name, for example ${workspaceFolder}/a.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "/path/to/gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}
\ No newline at end of file
...@@ -44,7 +44,7 @@ pipeline { ...@@ -44,7 +44,7 @@ pipeline {
disableConcurrentBuilds() disableConcurrentBuilds()
timestamps() timestamps()
gitLabConnection('OAI GitLab') gitLabConnection('OAI GitLab')
gitlabBuilds(builds: ["Build gNB-USRP", "Build nr-UE-USRP", "Build eNB-USRP", "Build basic-sim", "Build phy-sim", "Build eNB-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13", "Test-Mono-FDD-Band13-X2-HO", "Test-TDD-Band78-gNB-NR-UE"]) gitlabBuilds(builds: ["Build gNB-USRP", "Build nr-UE-USRP", "Build eNB-USRP", "Build basic-sim", "Build phy-sim", "Build eNB-ethernet", "Build UE-ethernet", "Analysis with cppcheck", "Test phy-sim", "Test basic-sim", "Test L2-sim", "Test-Mono-FDD-Band7", "Test-Mono-TDD-Band40", "Test-IF4p5-FDD-Band7", "Test-IF4p5-TDD-Band40", "Test-Mono-FDD-Band13", "Test-IF4p5-TDD-Band38-Multi-RRU" , "Test-Mono-FDD-Band13-X2-HO", "Test-TDD-Band78-gNB-NR-UE"])
ansiColor('xterm') ansiColor('xterm')
} }
...@@ -57,6 +57,9 @@ pipeline { ...@@ -57,6 +57,9 @@ pipeline {
echo '\u2705 \u001B[32mVerify Parameters\u001B[0m' echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
def allParametersPresent = true def allParametersPresent = true
if (env.TESTPLATFORM_OWNER) {
echo "Platform is ${env.TESTPLATFORM_OWNER}"
}
if (params.RedHatRemoteServer == null) { if (params.RedHatRemoteServer == null) {
allParametersPresent = false allParametersPresent = false
...@@ -128,8 +131,8 @@ pipeline { ...@@ -128,8 +131,8 @@ pipeline {
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.FlexRanRtcGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.FlexRanRtcGitLabRepository_Credentials}", usernameVariable: 'git_username', passwordVariable: 'git_password']
]) { ]) {
sh "git clone https://${git_username}:${git_password}@gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1" sh "git clone https://${git_username}:${git_password}@gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1"
sh "git checkout develop >> ../git_clone.log 2>&1"
} }
sh "sed -i -e 's#add-apt-repository.*cleishm.*neo4j#add-apt-repository ppa:cleishm/neo4j -y#' -e 's#libneo4j-client-dev#libneo4j-client-dev -y#' tools/install_dependencies"
sh "zip -r -qq flexran.zip ." sh "zip -r -qq flexran.zip ."
} }
} }
...@@ -362,7 +365,7 @@ pipeline { ...@@ -362,7 +365,7 @@ pipeline {
stage ("Test physical simulators") { stage ("Test physical simulators") {
steps { steps {
script { script {
timeout (time: 45, unit: 'MINUTES') { timeout (time: 90, unit: 'MINUTES') {
try { try {
gitlabCommitStatus(name: "Test phy-sim") { gitlabCommitStatus(name: "Test phy-sim") {
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}" sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
...@@ -575,6 +578,25 @@ pipeline { ...@@ -575,6 +578,25 @@ pipeline {
} }
} }
} }
stage ("Test IF4p5 - TDD - Band 38 - B210 - MultiRRU") {
steps {
script {
triggerSlaveJob ('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210', 'Test-IF4p5-TDD-Band38-Multi-RRU')
}
}
post {
always {
script {
finalizeSlaveJob('eNB-CI-IF4p5-TDD-Band38-MultiRRU-B210')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
stage ("Test OAI UE - FDD - Band 20 - B200") { stage ("Test OAI UE - FDD - Band 20 - B200") {
steps { steps {
script { script {
......
...@@ -44,7 +44,7 @@ function build_on_vm { ...@@ -44,7 +44,7 @@ function build_on_vm {
STATUS=1 STATUS=1
return return
fi fi
if [ ! -f /etc/apt/apt.conf.d/01proxy ] if [[ ! -f /etc/apt/apt.conf.d/01proxy ]] && [[ "$OPTIONAL_APTCACHER" != "true" ]]
then then
echo "Missing /etc/apt/apt.conf.d/01proxy file!" echo "Missing /etc/apt/apt.conf.d/01proxy file!"
echo "Is apt-cacher installed and configured?" echo "Is apt-cacher installed and configured?"
...@@ -68,11 +68,12 @@ function build_on_vm { ...@@ -68,11 +68,12 @@ function build_on_vm {
then then
echo "VM_MEMORY = $VM_MEMORY MBytes" echo "VM_MEMORY = $VM_MEMORY MBytes"
echo "VM_CPU = $VM_CPU" echo "VM_CPU = $VM_CPU"
echo "VM_DISK = $VM_DISK GBytes"
echo "############################################################" echo "############################################################"
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################" echo "############################################################"
acquire_vm_create_lock acquire_vm_create_lock
uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --disk $VM_DISK --unsafe-caching --template ci-scripts/template-host.xml
echo "Waiting for VM to be started" echo "Waiting for VM to be started"
uvt-kvm wait $VM_NAME --insecure uvt-kvm wait $VM_NAME --insecure
...@@ -96,12 +97,12 @@ function build_on_vm { ...@@ -96,12 +97,12 @@ function build_on_vm {
else else
scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
fi fi
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu [ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
echo "############################################################" echo "############################################################"
echo "Running install and build script on VM ($VM_NAME)" echo "Running install and build script on VM ($VM_NAME)"
echo "############################################################" echo "############################################################"
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS echo "[ -f 01proxy ] && sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS
echo "git config --global https.postBuffer 123289600" >> $VM_CMDS echo "git config --global https.postBuffer 123289600" >> $VM_CMDS
if [[ "$VM_NAME" == *"-cppcheck"* ]] if [[ "$VM_NAME" == *"-cppcheck"* ]]
...@@ -179,8 +180,12 @@ function build_on_vm { ...@@ -179,8 +180,12 @@ function build_on_vm {
echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS
echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS
echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $VM_CMDS echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $VM_CMDS
echo "echo \"mkdir build\"" >> $VM_CMDS
echo "mkdir build" >> $VM_CMDS
echo "echo \"cd build\"" >> $VM_CMDS
echo "cd build" >> $VM_CMDS
echo "echo \"$BUILD_OPTIONS \"" >> $VM_CMDS echo "echo \"$BUILD_OPTIONS \"" >> $VM_CMDS
echo "$BUILD_OPTIONS > cmake_targets/log/rt_controller.Rel15.txt 2>&1" >> $VM_CMDS echo "$BUILD_OPTIONS > ../cmake_targets/log/rt_controller.Rel15.txt 2>&1" >> $VM_CMDS
fi fi
if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]] if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]]
then then
......
...@@ -233,6 +233,7 @@ eNBs = ...@@ -233,6 +233,7 @@ eNBs =
#pdsch_maxNumRepetitionCEmodeB_r13 = "r384"; # NULL - 2 #pdsch_maxNumRepetitionCEmodeB_r13 = "r384"; # NULL - 2
pusch_maxNumRepetitionCEmodeA_r13 = "r8"; #0 pusch_maxNumRepetitionCEmodeA_r13 = "r8"; #0
pusch_repetitionLevelCEmodeA_r13 = "l1";
#pusch_maxNumRepetitionCEmodeB_r13 = "r768"; #4 #NULL #pusch_maxNumRepetitionCEmodeB_r13 = "r768"; #4 #NULL
#pusch_HoppingOffset_v1310 = 5; #NULL #pusch_HoppingOffset_v1310 = 5; #NULL
......
...@@ -85,12 +85,13 @@ function create_vm { ...@@ -85,12 +85,13 @@ function create_vm {
echo "VM_NAME = $VM_NAME" echo "VM_NAME = $VM_NAME"
echo "VM_MEMORY = $VM_MEMORY MBytes" echo "VM_MEMORY = $VM_MEMORY MBytes"
echo "VM_CPU = $VM_CPU" echo "VM_CPU = $VM_CPU"
echo "VM_DISK = $VM_DISK GBytes"
echo "############################################################" echo "############################################################"
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base" echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
echo "############################################################" echo "############################################################"
acquire_vm_create_lock acquire_vm_create_lock
uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --unsafe-caching --template ci-scripts/template-host.xml uvt-kvm create $VM_NAME release=$VM_OSREL --memory $VM_MEMORY --cpu $VM_CPU --disk $VM_DISK --unsafe-caching --template ci-scripts/template-host.xml
echo "Waiting for VM to be started" echo "Waiting for VM to be started"
uvt-kvm wait $VM_NAME --insecure uvt-kvm wait $VM_NAME --insecure
......
This diff is collapsed.
...@@ -52,7 +52,7 @@ function variant_usage { ...@@ -52,7 +52,7 @@ function variant_usage {
if [ "$1" = "full" ] if [ "$1" = "full" ]
then then
printf " VM_NAME=%-15s ARCHIVES_LOC=%-15s\n" "$VM_NAME" "$ARCHIVES_LOC" printf " VM_NAME=%-15s ARCHIVES_LOC=%-15s\n" "$VM_NAME" "$ARCHIVES_LOC"
printf " VM_MEMORY=%-15s VM_CPU=%-15s\n" "$VM_MEMORY" "$VM_CPU" printf " VM_MEMORY=%-15s VM_CPU=%-15s VM_DISK=%-15s\n" "$VM_MEMORY" "$VM_CPU" "$VM_DISK"
printf " NB_PATTERN_FILES=%-15s BUILD_OPTIONS=%-15s\n" "$NB_PATTERN_FILES" "\"$BUILD_OPTIONS\"" printf " NB_PATTERN_FILES=%-15s BUILD_OPTIONS=%-15s\n" "$NB_PATTERN_FILES" "\"$BUILD_OPTIONS\""
printf " LOG_PATTERN=%-15s EXPERIMENTAL=%-15s\n\n\n" "$LOG_PATTERN" "$EXPERIMENTAL" printf " LOG_PATTERN=%-15s EXPERIMENTAL=%-15s\n\n\n" "$LOG_PATTERN" "$EXPERIMENTAL"
fi fi
...@@ -140,10 +140,25 @@ function command_options_usage { ...@@ -140,10 +140,25 @@ function command_options_usage {
echo "" echo ""
} }
# function to set specific behavior depending on the TESTPLATFORM_OWNER variable
# which may be set by a jenkins server for exemple
function platform_set {
if [ "$TESTPLATFORM_OWNER" != "" ]
then
echo "Running on $TESTPLATFORM_OWNER platform"
if [ -x "/usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh" ]
then
. /usr/local/bin/oai_${TESTPLATFORM_OWNER}_setenv.sh
fi
fi
}
function setvar_usage { function setvar_usage {
declare -A HELP_VAR declare -A HELP_VAR
HELP_VAR["VM_OSREL"]="OS release to use in virtual machines" HELP_VAR["VM_OSREL"]="OS release to use in virtual machines"
HELP_VAR["RUN_EXPERIMENTAL"]="Enforce execution of variants with EXPERIMENTAL variable set to \"true\"" HELP_VAR["RUN_EXPERIMENTAL"]="Enforce execution of variants with EXPERIMENTAL variable set to \"true\""
HELP_VAR["OPTIONAL_APTCACHER"]="build and Run tests will fail if apt-cacher not installed and this variable not set to \"true\""
HELP_VAR["TESTPLATFORM_OWNER"]="Allow pipeline customization via execution of an externel scripts residing on the jenkins server"
echo "--setvar_<varname> <value> where varname is one of:" echo "--setvar_<varname> <value> where varname is one of:"
for i in ${AUTHORIZED_VAR[@]}; do printf "%20s : %s\n" "$i" "${HELP_VAR[$i]}" ;done for i in ${AUTHORIZED_VAR[@]}; do printf "%20s : %s\n" "$i" "${HELP_VAR[$i]}" ;done
} }
...@@ -167,25 +182,30 @@ function variant__v2__basic_sim { ...@@ -167,25 +182,30 @@ function variant__v2__basic_sim {
} }
function variant__v3__phy_sim { function variant__v3__phy_sim {
NB_PATTERN_FILES=12 NB_PATTERN_FILES=13
BUILD_OPTIONS="--phy_simulators" BUILD_OPTIONS="--phy_simulators"
VM_MEMORY=8192 VM_MEMORY=8192
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510*\" -q -np -b" VM_DISK=20
RUN_OPTIONS="./run_exec_autotests.bash -g \"01510* 015111\" -q -np -b"
} }
function variant__v4__cppcheck { function variant__v4__cppcheck {
VM_MEMORY=4096 VM_MEMORY=4096
LOG_PATTERN=cppcheck.xml LOG_PATTERN=cppcheck.xml
NB_PATTERN_FILES=1 NB_PATTERN_FILES=1
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4" BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2 -i openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c --suppressions-list=ci-scripts/cppcheck_suppressions.list -I common/utils -I openair3/NAS/COMMON/UTIL -j4"
} }
function variant__v5__gnb_usrp { function variant__v5__gnb_usrp {
VM_MEMORY=8192
VM_CPU=8
NB_PATTERN_FILES=9 NB_PATTERN_FILES=9
BUILD_OPTIONS="--gNB -w USRP" BUILD_OPTIONS="--gNB -w USRP"
} }
function variant__v6__nr_ue_usrp { function variant__v6__nr_ue_usrp {
VM_MEMORY=4096
VM_CPU=4
NB_PATTERN_FILES=9 NB_PATTERN_FILES=9
BUILD_OPTIONS="--nrUE -w USRP" BUILD_OPTIONS="--nrUE -w USRP"
} }
...@@ -207,7 +227,7 @@ function variant__v8__ue_ethernet { ...@@ -207,7 +227,7 @@ function variant__v8__ue_ethernet {
function variant__v10__flexran_rtc { function variant__v10__flexran_rtc {
ARCHIVES_LOC=flexran ARCHIVES_LOC=flexran
NB_PATTERN_FILES=1 NB_PATTERN_FILES=1
BUILD_OPTIONS="cmake . && make -j2" BUILD_OPTIONS="cmake .. && make -j2"
VARIANT_INFO="non-OSA" VARIANT_INFO="non-OSA"
} }
...@@ -218,8 +238,8 @@ function variant__v20__l1_sim { ...@@ -218,8 +238,8 @@ function variant__v20__l1_sim {
} }
function variant__v21__rf_sim { function variant__v21__rf_sim {
ARCHIVES_LOC=rf_sim
RUN_OPTIONS="complex" RUN_OPTIONS="complex"
EXPERIMENTAL="true"
} }
function variant__v22__l2_sim { function variant__v22__l2_sim {
...@@ -257,6 +277,7 @@ function check_set_variant { ...@@ -257,6 +277,7 @@ function check_set_variant {
ARCHIVES_LOC=${VARIANTS_LONG[$i]//"-"/"_"} ARCHIVES_LOC=${VARIANTS_LONG[$i]//"-"/"_"}
VM_MEMORY=2048 VM_MEMORY=2048
VM_CPU=4 VM_CPU=4
VM_DISK=10
EXPERIMENTAL="" EXPERIMENTAL=""
NBARGS=$[$NBARGS+$VARIANT_OPTID] NBARGS=$[$NBARGS+$VARIANT_OPTID]
variant__${VARIANTS_SHORT[$i]}__${VARIANTS_LONG[$i]//"-"/"_"} variant__${VARIANTS_SHORT[$i]}__${VARIANTS_LONG[$i]//"-"/"_"}
...@@ -328,6 +349,7 @@ function check_setvar { ...@@ -328,6 +349,7 @@ function check_setvar {
exit 1 exit 1
} }
platform_set
MY_DIR=$(dirname $(readlink -f $0)) MY_DIR=$(dirname $(readlink -f $0))
. $MY_DIR/createVM.sh . $MY_DIR/createVM.sh
. $MY_DIR/buildOnVM.sh . $MY_DIR/buildOnVM.sh
...@@ -337,6 +359,7 @@ MY_DIR=$(dirname $(readlink -f $0)) ...@@ -337,6 +359,7 @@ MY_DIR=$(dirname $(readlink -f $0))
. $MY_DIR/reportBuildLocally.sh . $MY_DIR/reportBuildLocally.sh
. $MY_DIR/reportTestLocally.sh . $MY_DIR/reportTestLocally.sh
if [ $# -lt 1 ] if [ $# -lt 1 ]
then then
echo "Syntax Error: too few arguments" echo "Syntax Error: too few arguments"
...@@ -454,7 +477,7 @@ RUN_OPTIONS="none" ...@@ -454,7 +477,7 @@ RUN_OPTIONS="none"
# list of variables that can be set via the --setvar option # list of variables that can be set via the --setvar option
AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL") AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL OPTIONAL_APTCACHER TESTPLATFORM_OWNER")
#variables to set which OS VM should use #variables to set which OS VM should use
...@@ -477,6 +500,7 @@ AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL") ...@@ -477,6 +500,7 @@ AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL")
# -V<xx> option. # -V<xx> option.
VM_NAME="" VM_NAME=""
VM_MEMORY=0 VM_MEMORY=0
VM_DISK=0
VM_CPU=0 VM_CPU=0
ARCHIVES_LOC="" ARCHIVES_LOC=""
LOG_PATTERN="" LOG_PATTERN=""
......
 (ׂ\ No newline at end of file
...@@ -97,14 +97,20 @@ function analyzeIperfFiles { ...@@ -97,14 +97,20 @@ function analyzeIperfFiles {
FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE` FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE`
if [ $FILE_COMPLETE -eq 0 ] if [ $FILE_COMPLETE -eq 0 ]
then then
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"` SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"`
FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'` FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'`
EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'` EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}else{printf "%.2f KBits/sec", br/1000}}'`
PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'` PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'`
PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'`
JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'` JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'`
PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'` PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'`
PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"` PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"`
if [[ $PERF_INT -lt 80 ]]
then
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
else
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
fi
else else
EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"` EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]] if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]]
...@@ -394,6 +400,126 @@ function report_test { ...@@ -394,6 +400,126 @@ function report_test {
echo " </div>" >> ./test_simulator_results.html echo " </div>" >> ./test_simulator_results.html
fi fi
ARCHIVES_LOC=archives/rf_sim/test
if [ -d $ARCHIVES_LOC ]
then
echo " <h3>5G NR RF Simulator Check</h3>" >> ./test_simulator_results.html
if [ -f $ARCHIVES_LOC/test_final_status.log ]
then
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
then
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
else
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
echo " <button data-toggle=\"collapse\" data-target=\"#oai-rf-sim-test-details\">More details on 5G RF Simulator test results</button>" >> ./test_simulator_results.html
echo " <div id=\"oai-rf-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
echo " <table border = \"1\">" >> ./test_simulator_results.html
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
echo " <th>Command</th>" >> ./test_simulator_results.html
echo " <th>Status</th>" >> ./test_simulator_results.html
echo " <th>Statistics</th>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
EPC_CONFIGS=("noS1")
TRANS_MODES=("tdd")
BW_CASES=(106)
for CN_CONFIG in ${EPC_CONFIGS[@]}
do
for TMODE in ${TRANS_MODES[@]}
do
for BW in ${BW_CASES[@]}
do
echo " <tr bgcolor = \"#8FBC8F\" >" >> ./test_simulator_results.html
if [[ $CN_CONFIG =~ .*wS1.* ]]
then
echo " <td align = \"center\" colspan = 4 >Test with EPC (aka withS1): ${TMODE} -- ${BW}PRB </td>" >> ./test_simulator_results.html
else
echo " <td align = \"center\" colspan = 4 >Test without EPC (aka noS1): ${TMODE} -- ${BW}PRB </td>" >> ./test_simulator_results.html
fi
echo " </tr>" >> ./test_simulator_results.html
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
UE_LOG=`echo $ENB_LOG | sed -e "s#gnb#ue#"`
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
then
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
echo " <tr>" >> ./test_simulator_results.html
echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
echo " <td>N/A</td>" >> ./test_simulator_results.html
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfuly configured" $ENB_LOG`
NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG`
NB_ENB_SYNCED_WITH_UE=`egrep -c "Initial sync: starting PBCH detection" $UE_LOG`
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfuly configured" $UE_LOG`
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
else
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
fi
echo " <td><pre>" >> ./test_simulator_results.html
if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "<font color = \"blue\">- gNB --> got sync</font>" >> ./test_simulator_results.html
else
echo "<font color = \"red\"><b>- gNB NEVER got sync</b></font>" >> ./test_simulator_results.html
fi
if [ $NB_ENB_TUNNEL_UP -gt 0 ]
then
echo "<font color = \"blue\">- gNB mounted oaitun_enb1 interface</font>" >> ./test_simulator_results.html
else
echo "<font color = \"red\"><b>- gNB NEVER mounted oaitun_enb1 interface</b></font>" >> ./test_simulator_results.html
fi
if [ $NB_UE_GOT_SYNC -gt 0 ]
then
echo "<font color = \"blue\">- NR UE --> got sync</font>" >> ./test_simulator_results.html
else
echo "<font color = \"red\"><b>- NR UE NEVER got sync</b></font>" >> ./test_simulator_results.html
fi
if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then
echo "<font color = \"blue\">- NR UE attached to gNB</font>" >> ./test_simulator_results.html
else
echo "<font color = \"red\"><b>- NR UE NEVER attached to eNB</b></font>" >> ./test_simulator_results.html
fi
if [ $NB_UE_TUNNEL_UP -gt 0 ]
then
echo "<font color = \"blue\">- NR UE mounted oaitun_ue1 interface</font>" >> ./test_simulator_results.html
else
echo "<font color = \"red\"><b>- NR UE NEVER mounted oaitun_ue1 interface</b></font>" >> ./test_simulator_results.html
fi
echo " </pre></td>" >> ./test_simulator_results.html
echo " </tr>" >> ./test_simulator_results.html
fi
#PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.log 2> /dev/null`
#analyzePingFiles
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null`
analyzeIperfFiles
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
#analyzeIperfFiles
done
done
done
echo " </table>" >> ./test_simulator_results.html
echo " </div>" >> ./test_simulator_results.html
fi
ARCHIVES_LOC=archives/l2_sim/test ARCHIVES_LOC=archives/l2_sim/test
if [ -d $ARCHIVES_LOC ] if [ -d $ARCHIVES_LOC ]
then then
......
This diff is collapsed.
...@@ -76,6 +76,8 @@ function wait_on_vm_build { ...@@ -76,6 +76,8 @@ function wait_on_vm_build {
echo "echo \"ps -aux | grep build \"" >> $VM_CMDS echo "echo \"ps -aux | grep build \"" >> $VM_CMDS
echo "while [ \$(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS echo "while [ \$(ps -aux | grep --color=never build_oai | grep -v grep | wc -l) -gt 0 ]; do sleep 3; done" >> $VM_CMDS
fi fi
echo "echo \"df -h\"" >> $VM_CMDS
echo "df -h" >> $VM_CMDS
ssh -T -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS ssh -T -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS
rm -f $VM_CMDS rm -f $VM_CMDS
......
...@@ -25,10 +25,23 @@ ...@@ -25,10 +25,23 @@
<htmlTabName>EPC-Start</htmlTabName> <htmlTabName>EPC-Start</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon> <htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList> <TestCaseRequestedList>
010101 090101
050101 060101 070101 050101 060101 070101
</TestCaseRequestedList> </TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList> <TestCaseExclusionList></TestCaseExclusionList>
<testCase id="010101">
<class>Build_eNB</class>
<desc>Build eNB (USRP)</desc>
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
</testCase>
<testCase id="090101">
<class>Build_OAI_UE</class>
<desc>Build OAI UE</desc>
<Build_OAI_UE_args>-w USRP --UE</Build_OAI_UE_args>
</testCase>
<testCase id="050101"> <testCase id="050101">
<class>Initialize_HSS</class> <class>Initialize_HSS</class>
<desc>Initialize HSS</desc> <desc>Initialize HSS</desc>
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<htmlTabRef>test-05-tm1-nos1-tunnel</htmlTabRef> <htmlTabRef>test-05-tm1-nos1-tunnel</htmlTabRef>
<htmlTabName>Test-05MHz-TM1-noS1-tunnel</htmlTabName> <htmlTabName>Test-05MHz-TM1-noS1-tunnel</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>2</repeatCount> <repeatCount>4</repeatCount>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 090109 030201 090109
030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201 030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201
......
...@@ -25,10 +25,16 @@ ...@@ -25,10 +25,16 @@
<htmlTabName>EPC-Closure</htmlTabName> <htmlTabName>EPC-Closure</htmlTabName>
<htmlTabIcon>log-out</htmlTabIcon> <htmlTabIcon>log-out</htmlTabIcon>
<TestCaseRequestedList> <TestCaseRequestedList>
040202
050201 060201 070201 050201 060201 070201
</TestCaseRequestedList> </TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList> <TestCaseExclusionList></TestCaseExclusionList>
<testCase id="040202">
<class>Terminate_CatM_module</class>
<desc>Terminate CAT-M Module</desc>
</testCase>
<testCase id="050201"> <testCase id="050201">
<class>Terminate_HSS</class> <class>Terminate_HSS</class>
<desc>Terminate HSS</desc> <desc>Terminate HSS</desc>
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
<class>Build_eNB</class> <class>Build_eNB</class>
<desc>Build gNB (USRP)</desc> <desc>Build gNB (USRP)</desc>
<Build_eNB_args>--gNB -w USRP</Build_eNB_args> <Build_eNB_args>--gNB -w USRP</Build_eNB_args>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase> </testCase>
</testCaseList> </testCaseList>
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>build-tab</htmlTabRef>
<htmlTabName>Build</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
010101
</TestCaseRequestedList>
<TestCaseExclusionList>
</TestCaseExclusionList>
<testCase id="010101">
<class>Build_eNB</class>
<desc>Build Master eNB (USRP)</desc>
<Build_eNB_args>-w USRP -c --eNB</Build_eNB_args>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
</testCaseList>
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<TestCaseRequestedList> <TestCaseRequestedList>
030201 030202 030201 030202
050202
</TestCaseRequestedList> </TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList> <TestCaseExclusionList></TestCaseExclusionList>
...@@ -43,4 +44,9 @@ ...@@ -43,4 +44,9 @@
<eNB_serverId>1</eNB_serverId> <eNB_serverId>1</eNB_serverId>
</testCase> </testCase>
<testCase id="050202">
<class>Terminate_FlexranCtrl</class>
<desc>Stopping Flexran Controller</desc>
</testCase>
</testCaseList> </testCaseList>
This diff is collapsed.
...@@ -96,11 +96,41 @@ Obj.# Case# Test# Description ...@@ -96,11 +96,41 @@ Obj.# Case# Test# Description
(Test 4, 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)), (Test 4, 10 MHz, R3-1.FDD (MCS 16), AWGN, 12dB (70%)),
(Test 5, 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)), (Test 5, 20 MHz, FDD (MCS 5), AWGN, 6dB (70%)),
(Test 6, 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%)) (Test 6, 20 MHz, FDD (MCS 16), AWGN, 12 dB (70%))
01 51 02 pucchsim (TBD) 01 51 02 ldpc Test cases. (Test1: block length = 3872),
01 51 03 prachsim (TBD) (Test2: block length = 4224),
01 51 04 pdcchsim (TBD) (Test3: block length = 4576),
01 51 05 pbchsim (TBD) (Test4: block length = 4928),
01 51 06 mbmssim (TBD) (Test5: block length = 5280),
(Test6: block length = 5632),
(Test7: block length = 6336),
(Test8: block length = 7040),
(Test9: block length = 7744),
(Test10: block length = 8448)
01 51 03 polartest Test cases. (Test1: PBCH polar test),
(Test2: DCI polar test)
01 51 04 nr_pbchsim Test cases. (Test1: PBCH-only, 106 PRB),
(Test2: PBCH and synchronization, 106PBR),
(Test3: PBCH-only, 217 PRB),
(Test4: PBCH and synchronization, 217 RPB),
(Test5: PBCH-only, 273 PRB),
(Test6: PBCH and synchronization, 273 PRB)
01 51 05 nr_dlsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB),
(Test3: 273 PRB)
01 51 06 nr_dlschsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB),
(Test3: 273 PRB)
01 51 07 shortblocktest Test cases. (Test1: 3 bits),
(Test2: 6 bits),
(Test3: 7 bits),
(Test4: 11 bits)
01 51 08 nr_ulschsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB),
(Test3: 273 PRB)
01 51 09 nr_pucchsim Test cases. (Test1: Format 0 ACK miss 106 PRB),
(Test2: Format 1 ACK miss 106 PRB),
(Test3: Format 1 ACK miss 273 PRB),
(Test4: Format 1 NACKtoACK 106 PRB)
01 51 10 dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB), 01 51 10 dlsim_tm4 test cases (Test 1: 10 MHz, R2.FDD (MCS 5), EVA5, -1dB),
(Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)), (Test 5: 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)),
(Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)), (Test 6: 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)),
...@@ -112,6 +142,9 @@ Obj.# Case# Test# Description ...@@ -112,6 +142,9 @@ Obj.# Case# Test# Description
(Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)) (Test 11: 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%))
(TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)), (TM2 Test 1 10 MHz, R.11 FDD (MCS 14), EVA5, 6.8 dB (70%)),
(TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)), (TM2 Test 1b 20 MHz, R.11-2 FDD (MCS 13), EVA5, 5.9 dB (70%)),
01 51 11 nr_ulsim Test cases. (Test1: MCS 9),
(Test2: MCS 16),
(Test3: MCS 28)
......
...@@ -1081,18 +1081,35 @@ ...@@ -1081,18 +1081,35 @@
<class>execution</class> <class>execution</class>
<desc>nr_dlsim Test cases. (Test1: 106 PRB), <desc>nr_dlsim Test cases. (Test1: 106 PRB),
(Test2: 217 PRB), (Test2: 217 PRB),
(Test3: 273 PRB)</desc> (Test3: 273 PRB),
(Test4: 106 PRB 12 CSET-Offset),
(Test5: 217 PRB 48 CSET-Offset),
(Test6: 106 PRB 25 PDSCH-Offset),
(Test7: 106 PRB 51 PDSCH-Offset),
(Test8: 217 PRB 100 PDSCH-PRBs),
(Test9: 217 PRB 80 PDSCH-Offset),
(Test10: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
(Test11: 106 PRBs 50 PDSCH-PRBs MCS Index 28</desc>
<pre_compile_prog></pre_compile_prog> <pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args> <compile_prog_args> --phy_simulators -c </compile_prog_args>
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec> <pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args> <pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_dlsim.Rel15</main_exec> <main_exec> $OPENAIR_DIR/targets/bin/nr_dlsim.Rel15</main_exec>
<main_exec_args>-n100 -R106 <main_exec_args>-n100 -R106 -b106
-n100 -R217 -n100 -R217 -b217
-n100 -R273</main_exec_args> -n100 -R273 -b273
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3</tags> -n100 -R106 -o12
<search_expr_true>PDCCH test OK</search_expr_true> -n100 -R217 -o48
-n100 -R106 -a25
-n100 -R106 -a51
-n100 -R217 -b100
-n100 -R217 -a80
-n100 -R217 -a110 -b100
-n100 -e28</main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7
nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11</tags>
<search_expr_true>PDSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns> <nruns>3</nruns>
</testCase> </testCase>
...@@ -1220,6 +1237,30 @@ ...@@ -1220,6 +1237,30 @@
<nruns>3</nruns> <nruns>3</nruns>
</testCase> </testCase>
<testCase id="015111">
<class>execution</class>
<desc>nr_ulsim Test cases. (Test1: MCS 9 106 PRBs),
(Test2: MCS 16 50 PRBs),
(Test3: MCS 28 50 PRBs),
(Test4: MCS 9 217 PRBs),
(Test5: MCS 9 273 PRBs)</desc>
<pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args>
<pre_exec>$OPENAIR_DIR/cmake_targets/autotests/tools/free_mem.bash</pre_exec>
<pre_exec_args></pre_exec_args>
<main_exec> $OPENAIR_DIR/targets/bin/nr_ulsim.Rel15</main_exec>
<main_exec_args>-f100 -m9 -r106 -s10
-f100 -m16 -s20
-f100 -m28 -s30
-f100 -m9 -R217 -r217 -s10
-f100 -m9 -R273 -r273 -s10</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5</tags>
<search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns>
</testCase>
<testCase id="015500" > <testCase id="015500" >
<class>lte-softmodem</class> <class>lte-softmodem</class>
<desc></desc> <desc></desc>
......
...@@ -149,7 +149,7 @@ Options ...@@ -149,7 +149,7 @@ Options
--build-eclipse --build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh Build eclipse project files. Paths are auto corrected by fixprj.sh
--build-lib <libraries> --build-lib <libraries>
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES or \"all\"
--usrp-recplay --usrp-recplay
Build for I/Q record-playback modes Build for I/Q record-playback modes
-h | --help -h | --help
...@@ -346,6 +346,10 @@ function main() { ...@@ -346,6 +346,10 @@ function main() {
shift 1;; shift 1;;
--build-lib) --build-lib)
BUILD_OPTLIB="" BUILD_OPTLIB=""
if [ "$2" == "all" ] ; then
BUILD_OPTLIB="$OPTIONAL_LIBRARIES"
echo_info "Enabling build of all optional shared libraries ($OPTIONAL_LIBRARIES)"
else
for alib in $2 ; do for alib in $2 ; do
for oklib in $OPTIONAL_LIBRARIES ; do for oklib in $OPTIONAL_LIBRARIES ; do
if [ "$alib" = "$oklib" ] ; then if [ "$alib" = "$oklib" ] ; then
...@@ -357,6 +361,7 @@ function main() { ...@@ -357,6 +361,7 @@ function main() {
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES" echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
fi fi
fi
shift 2;; shift 2;;
--usrp-recplay) --usrp-recplay)
USRP_REC_PLAY="True" USRP_REC_PLAY="True"
...@@ -580,7 +585,8 @@ function main() { ...@@ -580,7 +585,8 @@ function main() {
nr-uesoftmodem $dbin/nr-uesoftmodem.$REL nr-uesoftmodem $dbin/nr-uesoftmodem.$REL
fi fi
# mandatory shared lib # mandatory shared libraries common to UE and (e/g)NB
compilations \ compilations \
$build_dir $config_libconfig_shlib \ $build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
...@@ -865,7 +871,6 @@ function main() { ...@@ -865,7 +871,6 @@ function main() {
echo_info "liboai_transpro.so is linked to ETHERNET transport" echo_info "liboai_transpro.so is linked to ETHERNET transport"
fi fi
################### ###################
# Doxygen Support # # Doxygen Support #
################### ###################
......
...@@ -103,6 +103,7 @@ check_supported_distribution() { ...@@ -103,6 +103,7 @@ check_supported_distribution() {
"fedora24") return 0 ;; "fedora24") return 0 ;;
"rhel7") return 0 ;; "rhel7") return 0 ;;
"rhel7.6") return 0 ;; "rhel7.6") return 0 ;;
"rhel7.7") return 0 ;;
"centos7") return 0 ;; "centos7") return 0 ;;
esac esac
return 1 return 1
......
## config module management
```c ```c
configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags) configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags)
``` ```
...@@ -14,23 +16,17 @@ void End_configmodule(void) ...@@ -14,23 +16,17 @@ void End_configmodule(void)
* Free memory which has been allocated by the configuration module since its initialization. * Free memory which has been allocated by the configuration module since its initialization.
* Possibly calls the `config_<config source>_end` function * Possibly calls the `config_<config source>_end` function
## Retrieving parameter's values
```c ```c
int config_get(paramdef_t *params,int numparams, char *prefix) int config_get(paramdef_t *params,int numparams, char *prefix)
``` ```
* Reads as many parameters as described in params, they must all be in the same configuration file section * Reads as many parameters as described in params, they must all be in the same configuration file section
* Calls the `config_<config source>_get` function * Calls the `config_<config source>_get` function
* Calls the `config_process_cmdline` function * Calls the `config_process_cmdline` function
* `params` points to an array of `paramdef_t` structures which describes the parameters to be read, possibly including a pointer to a checking function. The following bits can possibly be set in the `paramflags` mask before calling * `params` points to an array of `paramdef_t` structures which describes the parameters to be read, possibly including a pointer to a checking function.The `paramflags` bit mask can be used to modify how a specific parameter is processed and the same mask is also used by the configuration module to return information about how the parameter has been processed. Bits definitions are described in the [`paramdef_t` structure description](./struct.md)
- `PARAMFLAG_MANDATORY`: -1 is returned if the parameter is not explicitly defined in the config source.
- `PARAMFLAG_DISABLECMDLINE`: parameter cannot be modified via the command line
- `PARAMFLAG_DONOTREAD`: ignore the parameter, can be used at run-time, to alter a pre-defined `paramdef_t` array which is used in several `config_get` or/and `config_getlist` calls.
- `PARAMFLAG_NOFREE`: do not free the memory possibly allocated by the config module to store the value of the parameter. Default behavior is for the config module to free the memory it has allocated when the `config_end` function is called.
- `PARAMFLAG_BOOL`: Only relevant for integer types. tell the config module that when processing the command line, the corresponding option can be specified without any arggument and that in this case it must set the value to 1.
* `params` is also used as an output parameter, `< XXX >ptr >` field is used by the config module to store the value it has read. The following bits can possibly be set in the `paramflags` mask after the call:
- `PARAMFLAG_MALLOCINCONFIG`: memory has been allocated for the ` < XXX >ptr > ` field
- `PARAMFLAG_PARAMSET`: parameter has been found in the config source, it is not set to default value.
- `PARAMFLAG_PARAMSET`: parameter has been set to its default value
* `numparams` is the number of entries in the params array * `numparams` is the number of entries in the params array
* `prefix` is a character string to be appended to the parameters name, it defines the parameters position in the configuration file hierarchy (the section name in libconfig terminology). * `prefix` is a character string to be appended to the parameters name, it defines the parameters position in the configuration file hierarchy (the section name in libconfig terminology).
* The returned value is the number of parameters which have been assigned a value or -1 if a severe error occured * The returned value is the number of parameters which have been assigned a value or -1 if a severe error occured
...@@ -44,6 +40,9 @@ int config_libconfig_getlist(paramlist_def_t *ParamList, paramdef_t *params, int ...@@ -44,6 +40,9 @@ int config_libconfig_getlist(paramlist_def_t *ParamList, paramdef_t *params, int
* `ParamList` points to a structure, where `paramarray` field points to an array of `paramdef_t` structure, allocated by the function. It is used to return the values of the parameters. * `ParamList` points to a structure, where `paramarray` field points to an array of `paramdef_t` structure, allocated by the function. It is used to return the values of the parameters.
* The returned value is the number of occurrences in the list or -1 in case of severe error * The returned value is the number of occurrences in the list or -1 in case of severe error
## utility functions and macros
The configuration module also defines APIs to access the `paramdef_t` and `configmodule_interface_t` fields. They are listed in the configuration module [include file `common/config/config_userapi.h`](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_userapi.h)
[Configuration module developer main page](../../config/devusage.md) [Configuration module developer main page](../../config/devusage.md)
[Configuration module home](../../config.md) [Configuration module home](../../config.md)
...@@ -5,6 +5,7 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla ...@@ -5,6 +5,7 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla
|:-----------|:------------------------------------------------------------------|----:| |:-----------|:------------------------------------------------------------------|----:|
| `optname` | parameter name, as used when looking for it in the config source, 63 bytes max (64 with trailing \0) | I | | `optname` | parameter name, as used when looking for it in the config source, 63 bytes max (64 with trailing \0) | I |
| `helstr` | pointer to a C string printed when using --help on the command line | I | | `helstr` | pointer to a C string printed when using --help on the command line | I |
| `paramflags` | bit mask, used to modify how the parameter is processed, or to return to the API caller how the parameter has been set, see list in the next table | IO |
| `strptr` `strlistptr` `u8ptr` `i8ptr` `u16ptr` `i16ptr` `uptr` `iptr` `u64ptr` `i64ptr` `dblptr` `voidptr` | a pointer to a variable where the parameter value(s) will be returned. This field is an anonymous union, the supported pointer types have been built to avoid type mismatch warnings at compile time. | O | | `strptr` `strlistptr` `u8ptr` `i8ptr` `u16ptr` `i16ptr` `uptr` `iptr` `u64ptr` `i64ptr` `dblptr` `voidptr` | a pointer to a variable where the parameter value(s) will be returned. This field is an anonymous union, the supported pointer types have been built to avoid type mismatch warnings at compile time. | O |
| `defstrval` `defstrlistval` `defuintval` `defintval` `defint64val` `defintarrayval` `defdblval` | this field is an anonymous union, it can be used to define the default value for the parameter. It is ignored if `PARAMFLAG_MANDATORY` is set in the `paramflags` field.| I | | `defstrval` `defstrlistval` `defuintval` `defintval` `defint64val` `defintarrayval` `defdblval` | this field is an anonymous union, it can be used to define the default value for the parameter. It is ignored if `PARAMFLAG_MANDATORY` is set in the `paramflags` field.| I |
| `type` | Supported parameter types are defined as integer macros. Supported simple types are `TYPE_STRING`, parameter value is returned in `strptr` field, `TYPE_INT8` `TYPE_UINT8` `TYPE_INT16` `TYPE_UINT16` `TYPE_INT32` `TYPE_UINT32` `TYPE_INT64` `TYPE_UINT64`, parameter value is returned in the corresponding uXptr or iXptr, `TYPE_MASK`, value is returned in `u32ptr`, `TYPE_DOUBLE` value is returned in `dblptr`, `TYPE_IPV4ADDR` value is returned in binary, network bytes order in `u32ptr` field. `TYPE_STRINGLIST`, `TYPE_INTARRAY` and `TYPE_UINTARRAY` are multiple values types. Multiple values are returned in respectively, `strlistptr`, `iptr` and `uptr` fields which then point to arrays. The `numelt` field gives the number of item in the array. | I | | `type` | Supported parameter types are defined as integer macros. Supported simple types are `TYPE_STRING`, parameter value is returned in `strptr` field, `TYPE_INT8` `TYPE_UINT8` `TYPE_INT16` `TYPE_UINT16` `TYPE_INT32` `TYPE_UINT32` `TYPE_INT64` `TYPE_UINT64`, parameter value is returned in the corresponding uXptr or iXptr, `TYPE_MASK`, value is returned in `u32ptr`, `TYPE_DOUBLE` value is returned in `dblptr`, `TYPE_IPV4ADDR` value is returned in binary, network bytes order in `u32ptr` field. `TYPE_STRINGLIST`, `TYPE_INTARRAY` and `TYPE_UINTARRAY` are multiple values types. Multiple values are returned in respectively, `strlistptr`, `iptr` and `uptr` fields which then point to arrays. The `numelt` field gives the number of item in the array. | I |
...@@ -12,6 +13,22 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla ...@@ -12,6 +13,22 @@ It is defined in include file [ common/config/config_paramdesc.h ](https://gitla
| `chkPptr` | possible pointer to the structure containing the info used to check parameter values | I | | `chkPptr` | possible pointer to the structure containing the info used to check parameter values | I |
| `processedvalue` | When `chkPptr` is not `ǸULL`, is used to return a value, computed from the original parameter, as read from the configuration source. | O | | `processedvalue` | When `chkPptr` is not `ǸULL`, is used to return a value, computed from the original parameter, as read from the configuration source. | O |
## `paramflags` bits definition
| C macro bit definition | usage | I/O |
|:-------------------------------------|:---------------------------------------------------------------------------------------------------------------------|----:|
| `PARAMFLAG_MANDATORY` | parameter is mandatory, comfiguration module will stop the process if it is not specified. Default value is ignored | I |
| `PARAMFLAG_DISABLECMDLINE` | parameter cannot be specified on the command line | I |
| `PARAMFLAG_DONOTREAD` | ignore the parameter, usefull when a parameter group is used in different context | I |
| `PARAMFLAG_NOFREE` | The end_configmodule API won't free the memory which has been possibly allocated to store the value of the parameter.| I |
| `PARAMFLAG_BOOL` | Parameter is a boolean, it can be specified without a value to set it to true | I |
| `PARAMFLAG_CMDLINE_NOPREFIXENABLED` | parameter can be specified without the prefix on the command line. Must be used with care, carefuly checking unicity, especially for short parameter names | I |
| `PARAMFLAG_MALLOCINCONFIG` | Memory for the parameter value has been allocated by the configuration module |O |
| `PARAMFLAG_PARAMSET` | Parameter value has been explicitely set, as the parameter was specified either on the command line or the config source | O |
| `PARAMFLAG_PARAMSETDEF` | Parameter value has been set to it's default | O |
# `paramlist_def_t`structure # `paramlist_def_t`structure
It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L160). It is defined in include file [ common/config/config_paramdesc.h ](https://gitlab.eurecom.fr/oai/openairinterface5g/blob/develop/common/config/config_paramdesc.h#L160).
It is used as an argument to `config_getlist` calls, to get values of multiple occurrences of group of parameters. It is used as an argument to `config_getlist` calls, to get values of multiple occurrences of group of parameters.
......
...@@ -167,8 +167,8 @@ int config_check_unknown_cmdlineopt(char *prefix) { ...@@ -167,8 +167,8 @@ int config_check_unknown_cmdlineopt(char *prefix) {
char testprefix[CONFIG_MAXOPTLENGTH]; char testprefix[CONFIG_MAXOPTLENGTH];
int finalcheck = 0; int finalcheck = 0;
memset(testprefix,0,sizeof(testprefix)); memset(testprefix,0,sizeof(testprefix));
memset(testprefix,0,sizeof(testprefix)); memset(testprefix,0,sizeof(testprefix));
if (prefix != NULL) { if (prefix != NULL) {
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0) if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
finalcheck = 1; finalcheck = 1;
...@@ -253,7 +253,9 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix) ...@@ -253,7 +253,9 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
} }
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */ if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) { ((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) || /* long option beginning with "--" */
((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgoptions[n].optname) == 0) && (cfgoptions[n].paramflags & PARAMFLAG_CMDLINE_NOPREFIXENABLED )) ||
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 ) && (cfgoptions[n].paramflags & PARAMFLAG_CMDLINE_NOPREFIXENABLED )) ) {
char *valptr=NULL; char *valptr=NULL;
int ret; int ret;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED; config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#define PARAMFLAG_DONOTREAD (1 << 2) // parameter must be ignored in get function #define PARAMFLAG_DONOTREAD (1 << 2) // parameter must be ignored in get function
#define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function #define PARAMFLAG_NOFREE (1 << 3) // don't free parameter in end function
#define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1 #define PARAMFLAG_BOOL (1 << 4) // integer param can be 0 or 1
#define PARAMFLAG_CMDLINE_NOPREFIXENABLED (1 << 5) // on the command line, allow a parameter to be specified without the prefix
/* Flags used by config modules to return info to calling modules and/or to for internal usage*/ /* Flags used by config modules to return info to calling modules and/or to for internal usage*/
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module #define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
......
...@@ -81,7 +81,7 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) { ...@@ -81,7 +81,7 @@ char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) {
} }
if (*ptr == NULL) { if (*ptr == NULL) {
*ptr = malloc(length); *ptr = malloc(length>40?length:40); // LTS: dummy fix, waiting Francois full fix in 4G branch
if ( *ptr != NULL) { if ( *ptr != NULL) {
memset(*ptr,0,length); memset(*ptr,0,length);
...@@ -172,7 +172,7 @@ int config_get_processedint(paramdef_t *cfgoption) { ...@@ -172,7 +172,7 @@ int config_get_processedint(paramdef_t *cfgoption) {
return ret; return ret;
} }
void config_printhelp(paramdef_t *params,int numparams, char *prefix) { void config_printhelp(paramdef_t *params,int numparams, char *prefix) {
printf("\n-----Help for section %-26s: %03i entries------\n",(prefix==NULL)?"(root section)":prefix ,numparams); printf("\n-----Help for section %-26s: %03i entries------\n",(prefix==NULL)?"(root section)":prefix,numparams);
for (int i=0 ; i<numparams ; i++) { for (int i=0 ; i<numparams ; i++) {
printf(" %s%s: %s", printf(" %s%s: %s",
...@@ -204,6 +204,16 @@ int config_execcheck(paramdef_t *params, int numparams, char *prefix) { ...@@ -204,6 +204,16 @@ int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
return st; return st;
} }
int config_paramidx_fromname(paramdef_t *params, int numparams, char *name) {
for (int i=0; i<numparams ; i++) {
if (strcmp(name,params[i].optname) == 0)
return i;
}
fprintf(stderr,"[CONFIG]config_paramidx_fromname , %s is not a valid parameter name\n",name);
return -1;
}
int config_get(paramdef_t *params, int numparams, char *prefix) { int config_get(paramdef_t *params, int numparams, char *prefix) {
int ret= -1; int ret= -1;
...@@ -375,13 +385,12 @@ int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) { ...@@ -375,13 +385,12 @@ int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) {
status=1; status=1;
if (cfgoptions->numelt == 0 ) { if (cfgoptions->numelt == 0 ) {
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(cfgoptions->defstrval)+1); config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(cfgoptions->defstrval)+1);
sprintf(*(cfgoptions->strptr), "%s",cfgoptions->defstrval); sprintf(*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *(cfgoptions->strptr)); printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *(cfgoptions->strptr));
} else { } else {
sprintf((char *)*(cfgoptions->strptr), "%s",cfgoptions->defstrval); sprintf((char *)(cfgoptions->strptr), "%s",cfgoptions->defstrval);
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (char *)*(cfgoptions->strptr)); printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (char *)(cfgoptions->strptr));
} }
} }
...@@ -437,7 +446,7 @@ int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) { ...@@ -437,7 +446,7 @@ int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
status=1; status=1;
for (int j=0; j<cfgoptions->numelt ; j++) { for (int j=0; j<cfgoptions->numelt ; j++) {
printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname ,j,(int)cfgoptions->iptr[j]); printf_params("[CONFIG] %s[%i] set to default value %i\n",cfgoptions->optname,j,(int)cfgoptions->iptr[j]);
} }
} }
...@@ -451,7 +460,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) { ...@@ -451,7 +460,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) { if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
*(cfgoptions->dblptr)=cfgoptions->defdblval; *(cfgoptions->dblptr)=cfgoptions->defdblval;
status=1; status=1;
printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname , *(cfgoptions->dblptr)); printf_params("[CONFIG] %s set to default value %lf\n",cfgoptions->optname, *(cfgoptions->dblptr));
} }
return status; return status;
...@@ -459,7 +468,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) { ...@@ -459,7 +468,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr) { int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr) {
config_check_valptr(cfgoptions,(char **)&(cfgoptions->uptr), sizeof(int)); config_check_valptr(cfgoptions,(char **)&(cfgoptions->uptr), sizeof(int));
int rst=inet_pton(AF_INET, ipv4addr ,cfgoptions->uptr ); int rst=inet_pton(AF_INET, ipv4addr,cfgoptions->uptr );
if (rst == 1 && *(cfgoptions->uptr) > 0) { if (rst == 1 && *(cfgoptions->uptr) > 0) {
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr); printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
......
...@@ -39,6 +39,7 @@ extern "C" ...@@ -39,6 +39,7 @@ extern "C"
{ {
#endif #endif
/* utility functions to ease usage of config module structures */
#define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode ) #define CONFIG_GETSOURCE ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgmode )
#define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP ) #define CONFIG_GETNUMP ( (config_get_if()==NULL) ? 0 : config_get_if()->num_cfgP )
#define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] ) #define CONFIG_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
...@@ -46,6 +47,8 @@ extern "C" ...@@ -46,6 +47,8 @@ extern "C"
#define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; } #define CONFIG_SETRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags |= P; }
#define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); } #define CONFIG_CLEARRTFLAG(P) if (config_get_if()) { config_get_if()->rtflags &= (~P); }
#define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F)) #define CONFIG_ISPARAMFLAGSET(P,F) ( !!(P.paramflags & F))
extern int config_paramidx_fromname(paramdef_t *params,int numparams, char *name);
/* utility functions, to be used by configuration module and/or configuration libraries */ /* utility functions, to be used by configuration module and/or configuration libraries */
extern configmodule_interface_t *config_get_if(void); extern configmodule_interface_t *config_get_if(void);
extern char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ; extern char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
......
...@@ -232,7 +232,7 @@ int write_file_matlab(const char *fname, ...@@ -232,7 +232,7 @@ int write_file_matlab(const char *fname,
void log_getconfig(log_t *g_log) void log_getconfig(log_t *g_log)
{ {
char *gloglevel = NULL; char *gloglevel = NULL;
int consolelog ; int consolelog = 0;
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC; paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS]; paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS]; paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
...@@ -324,7 +324,9 @@ void log_getconfig(log_t *g_log) ...@@ -324,7 +324,9 @@ void log_getconfig(log_t *g_log)
config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX); config_get( logparams_debug,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX); config_get( logparams_dump,(sizeof(log_maskmap)/sizeof(mapping)) - 1,CONFIG_STRING_LOG_PREFIX);
config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX);
if (config_check_unknown_cmdlineopt(CONFIG_STRING_LOG_PREFIX) > 0)
exit(1);
/* set the debug mask according to the debug parameters values */ /* set the debug mask according to the debug parameters values */
for (int i=0; log_maskmap[i].name != NULL ; i++) { for (int i=0; log_maskmap[i].name != NULL ; i++) {
...@@ -434,6 +436,10 @@ int logInit (void) ...@@ -434,6 +436,10 @@ int logInit (void)
register_log_component("ASN","log",ASN); register_log_component("ASN","log",ASN);
register_log_component("NFAPI_VNF","log",NFAPI_VNF); register_log_component("NFAPI_VNF","log",NFAPI_VNF);
register_log_component("NFAPI_PNF","log",NFAPI_PNF); register_log_component("NFAPI_PNF","log",NFAPI_PNF);
register_log_component("GNB_APP","log",GNB_APP);
register_log_component("NR_RRC","log",NR_RRC);
register_log_component("NR_MAC","log",NR_MAC);
register_log_component("NR_PHY","log",NR_PHY);
for (int i=0 ; log_level_names[i].name != NULL ; i++) for (int i=0 ; log_level_names[i].name != NULL ; i++)
g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name g_log->level2string[i] = toupper(log_level_names[i].name[0]); // uppercased first letter of level name
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
* \date 2009 - 2014 * \date 2009 - 2014
* \version 0.5 * \version 0.5
* @ingroup util * @ingroup util
*/ */
#ifndef __LOG_H__ #ifndef __LOG_H__
...@@ -363,14 +362,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int ...@@ -363,14 +362,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOG globalconfiguration parameters */ /* LOG globalconfiguration parameters */
/* optname help paramflags XXXptr defXXXval type numelt */ /* optname help paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define LOG_GLOBALPARAMS_DESC { \ #define LOG_GLOBALPARAMS_DESC { \
{LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_LEVEL, "Default log level for all componemts\n", 0, strptr:(char **)&gloglevel, defstrval:log_level_names[2].name, TYPE_STRING, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \ {LOG_CONFIG_STRING_GLOBAL_LOG_ONLINE, "Default console output option, for all components\n", 0, iptr:&(consolelog), defintval:1, TYPE_INT, 0}, \
{LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \ {LOG_CONFIG_STRING_GLOBAL_LOG_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST, 0} \
} }
#define LOG_OPTIONS_IDX 2 #define LOG_OPTIONS_IDX 2
......
...@@ -247,7 +247,8 @@ const char* eurecomVariablesNames[] = { ...@@ -247,7 +247,8 @@ const char* eurecomVariablesNames[] = {
"slot_number_TX0_gNB", "slot_number_TX0_gNB",
"slot_number_TX1_gNB", "slot_number_TX1_gNB",
"slot_number_RX0_gNB", "slot_number_RX0_gNB",
"slot_number_RX1_gNB" "slot_number_RX1_gNB",
"ru_tx_ofdm_mask"
}; };
const char* eurecomFunctionsNames[] = { const char* eurecomFunctionsNames[] = {
...@@ -328,6 +329,13 @@ const char* eurecomFunctionsNames[] = { ...@@ -328,6 +329,13 @@ const char* eurecomFunctionsNames[] = {
"phy_procedures_ru_feptx_ofdm7", "phy_procedures_ru_feptx_ofdm7",
"phy_procedures_ru_feptx_ofdm8", "phy_procedures_ru_feptx_ofdm8",
"phy_procedures_ru_feptx_ofdm9", "phy_procedures_ru_feptx_ofdm9",
"phy_procedures_ru_feptx_ofdm10",
"phy_procedures_ru_feptx_ofdm11",
"phy_procedures_ru_feptx_ofdm12",
"phy_procedures_ru_feptx_ofdm13",
"phy_procedures_ru_feptx_ofdm14",
"phy_procedures_ru_feptx_ofdm15",
"phy_procedures_ru_feptx_ofdm16",
"phy_procedures_ru_feptx_prec0", "phy_procedures_ru_feptx_prec0",
"phy_procedures_ru_feptx_prec1", "phy_procedures_ru_feptx_prec1",
"phy_procedures_ru_feptx_prec2", "phy_procedures_ru_feptx_prec2",
...@@ -502,6 +510,7 @@ const char* eurecomFunctionsNames[] = { ...@@ -502,6 +510,7 @@ const char* eurecomFunctionsNames[] = {
"pdcch_interleaving", "pdcch_interleaving",
"pdcch_tx", "pdcch_tx",
/*NR softmodem signal*/ /*NR softmodem signal*/
"wakeup_txfh",
"gNB_thread_rxtx0", "gNB_thread_rxtx0",
"gNB_thread_rxtx1" "gNB_thread_rxtx1"
}; };
...@@ -634,7 +643,7 @@ void *vcd_dumper_thread_rt(void *args) ...@@ -634,7 +643,7 @@ void *vcd_dumper_thread_rt(void *args)
uint32_t data_ready_wait; uint32_t data_ready_wait;
# if defined(ENABLE_ITTI) # if defined(ENABLE_ITTI)
signal_mask(); return 0; //signal_mask(); //function defined at common/utils/ocp_itti/intertask_interface.cpp
# endif # endif
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1; sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
......
...@@ -225,6 +225,7 @@ typedef enum { ...@@ -225,6 +225,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK,
VCD_SIGNAL_DUMPER_VARIABLES_END VCD_SIGNAL_DUMPER_VARIABLES_END
...@@ -309,6 +310,13 @@ typedef enum { ...@@ -309,6 +310,13 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM7, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM7,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM8, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM8,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM9, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM9,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM10,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM11,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM12,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM13,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM14,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM15,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM16,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC1,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC2, VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC2,
...@@ -494,6 +502,7 @@ typedef enum { ...@@ -494,6 +502,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX, VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
/*NR softmodem signal*/ /*NR softmodem signal*/
VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH,
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0, VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1,
......
...@@ -73,10 +73,10 @@ typedef struct { ...@@ -73,10 +73,10 @@ typedef struct {
} T_cache_t; } T_cache_t;
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */ /* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS (237)//(232) #define VCD_NUM_FUNCTIONS (245)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */ /* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (185) #define VCD_NUM_VARIABLES (186)
/* first VCD function (to be kept up to date! see in T_messages.txt) */ /* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
...@@ -2050,6 +2050,11 @@ ID = VCD_VARIABLE_SLOT_NUMBER_RX1_GNB ...@@ -2050,6 +2050,11 @@ ID = VCD_VARIABLE_SLOT_NUMBER_RX1_GNB
GROUP = ALL:VCD:ENB:VCD_VARIABLE GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value FORMAT = ulong,value
VCD_NAME = slot_number_RX1_gNB VCD_NAME = slot_number_RX1_gNB
ID = VCD_VARIABLE_RU_TX_OFDM_MASK
DESC = VCD variable RU_TX_OFDM_MASK
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = ru_tx_ofdm_mask
#functions #functions
...@@ -2418,6 +2423,41 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM9 ...@@ -2418,6 +2423,41 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM9
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm9 VCD_NAME = phy_procedures_ru_feptx_ofdm9
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM10
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM10
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm10
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM11
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM11
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm11
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM12
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM12
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm12
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM13
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM13
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm13
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM14
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM14
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm14
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM15
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM15
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm15
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_OFDM16
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_OFDM16
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ru_feptx_ofdm16
ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC ID = VCD_FUNCTION_PHY_PROCEDURES_RU_FEPTX_PREC
DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC DESC = VCD function PHY_PROCEDURES_RU_FEPTX_PREC
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
...@@ -3230,6 +3270,11 @@ ID = VCD_FUNCTION_PDCCH_TX ...@@ -3230,6 +3270,11 @@ ID = VCD_FUNCTION_PDCCH_TX
VCD_NAME = pdcch_tx VCD_NAME = pdcch_tx
#function for gNB #function for gNB
ID = VCD_FUNCTION_WAKEUP_TXFH
DESC = VCD function WAKEUP_TXFH
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = wakeup_txfh
ID = VCD_FUNCTION_gNB_PROC_RXTX0 ID = VCD_FUNCTION_gNB_PROC_RXTX0
DESC = VCD function gNB_PROC_RXTX0 DESC = VCD function gNB_PROC_RXTX0
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
......
...@@ -162,34 +162,6 @@ hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtblP, cons ...@@ -162,34 +162,6 @@ hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtblP, cons
return HASH_TABLE_KEY_NOT_EXISTS; return HASH_TABLE_KEY_NOT_EXISTS;
} }
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *const hashtblP, void functP(hash_key_t keyP, void *dataP, void *parameterP), void *parameterP)
//-------------------------------------------------------------------------------------------------------------------------------
{
hash_node_t *node = NULL;
unsigned int i = 0;
unsigned int num_elements = 0;
if (hashtblP == NULL) {
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
}
while ((num_elements < hashtblP->num_elements) && (i < hashtblP->size)) {
if (hashtblP->nodes[i] != NULL) {
node=hashtblP->nodes[i];
while(node) {
num_elements += 1;
functP(node->key, node->data, parameterP);
node=node->next;
}
}
i += 1;
}
return HASH_TABLE_OK;
}
//-------------------------------------------------------------------------------------------------------------------------------
hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP ) hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP )
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
{ {
...@@ -266,7 +238,6 @@ hashtable_rc_t hashtable_insert(hash_table_t *const hashtblP, const hash_key_t k ...@@ -266,7 +238,6 @@ hashtable_rc_t hashtable_insert(hash_table_t *const hashtblP, const hash_key_t k
} }
hashtblP->nodes[hash]=node; hashtblP->nodes[hash]=node;
hashtblP->num_elements += 1;
return HASH_TABLE_OK; return HASH_TABLE_OK;
} }
//------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------
...@@ -295,7 +266,6 @@ hashtable_rc_t hashtable_remove(hash_table_t *const hashtblP, const hash_key_t k ...@@ -295,7 +266,6 @@ hashtable_rc_t hashtable_remove(hash_table_t *const hashtblP, const hash_key_t k
} }
free(node); free(node);
hashtblP->num_elements -= 1;
return HASH_TABLE_OK; return HASH_TABLE_OK;
} }
...@@ -335,47 +305,3 @@ hashtable_rc_t hashtable_get(const hash_table_t *const hashtblP, const hash_key_ ...@@ -335,47 +305,3 @@ hashtable_rc_t hashtable_get(const hash_table_t *const hashtblP, const hash_key_
*dataP = NULL; *dataP = NULL;
return HASH_TABLE_KEY_NOT_EXISTS; return HASH_TABLE_KEY_NOT_EXISTS;
} }
//-------------------------------------------------------------------------------------------------------------------------------
/*
* Resizing
* The number of elements in a hash table is not always known when creating the table.
* If the number of elements grows too large, it will seriously reduce the performance of most hash table operations.
* If the number of elements are reduced, the hash table will waste memory. That is why we provide a function for resizing the table.
* Resizing a hash table is not as easy as a realloc(). All hash values must be recalculated and each element must be inserted into its new position.
* We create a temporary hash_table_t object (newtbl) to be used while building the new hashes.
* This allows us to reuse hashtable_insert() and hashtable_remove(), when moving the elements to the new table.
* After that, we can just free the old table and copy the elements from newtbl to hashtbl.
*/
hashtable_rc_t hashtable_resize(hash_table_t *const hashtblP, const hash_size_t sizeP) {
hash_table_t newtbl;
hash_size_t n;
hash_node_t *node,*next;
if (hashtblP == NULL) {
return HASH_TABLE_BAD_PARAMETER_HASHTABLE;
}
newtbl.size = sizeP;
newtbl.hashfunc = hashtblP->hashfunc;
newtbl.num_elements = 0;
if(!(newtbl.nodes=calloc(sizeP, sizeof(hash_node_t *)))) return -1;
for(n=0; n<hashtblP->size; ++n) {
for(node=hashtblP->nodes[n]; node; node=next) {
next = node->next;
hashtable_insert(&newtbl, node->key, node->data);
// Lionel GAUTHIER: BAD CODE TO BE REWRITTEN
hashtable_remove(hashtblP, node->key);
}
}
free(hashtblP->nodes);
hashtblP->size=newtbl.size;
hashtblP->nodes=newtbl.nodes;
return HASH_TABLE_OK;
}
...@@ -49,7 +49,6 @@ typedef struct hash_node_s { ...@@ -49,7 +49,6 @@ typedef struct hash_node_s {
typedef struct hash_table_s { typedef struct hash_table_s {
hash_size_t size; hash_size_t size;
hash_size_t num_elements;
struct hash_node_s **nodes; struct hash_node_s **nodes;
hash_size_t (*hashfunc)(const hash_key_t); hash_size_t (*hashfunc)(const hash_key_t);
void (*freefunc)(void *); void (*freefunc)(void *);
...@@ -60,12 +59,10 @@ void hash_free_int_func(void *memoryP); ...@@ -60,12 +59,10 @@ void hash_free_int_func(void *memoryP);
hash_table_t *hashtable_create (const hash_size_t size, hash_size_t (*hashfunc)(const hash_key_t ), void (*freefunc)(void *)); hash_table_t *hashtable_create (const hash_size_t size, hash_size_t (*hashfunc)(const hash_key_t ), void (*freefunc)(void *));
hashtable_rc_t hashtable_destroy(hash_table_t **hashtbl); hashtable_rc_t hashtable_destroy(hash_table_t **hashtbl);
hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtbl, const uint64_t key); hashtable_rc_t hashtable_is_key_exists (const hash_table_t *const hashtbl, const uint64_t key);
hashtable_rc_t hashtable_apply_funct_on_elements (hash_table_t *const hashtblP, void funct(hash_key_t keyP, void *dataP, void *parameterP), void *parameterP);
hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP ); hashtable_rc_t hashtable_dump_content (const hash_table_t *const hashtblP, char *const buffer_pP, int *const remaining_bytes_in_buffer_pP );
hashtable_rc_t hashtable_insert (hash_table_t *const hashtbl, const hash_key_t key, void *data); hashtable_rc_t hashtable_insert (hash_table_t *const hashtbl, const hash_key_t key, void *data);
hashtable_rc_t hashtable_remove (hash_table_t *const hashtbl, const hash_key_t key); hashtable_rc_t hashtable_remove (hash_table_t *const hashtbl, const hash_key_t key);
hashtable_rc_t hashtable_get (const hash_table_t *const hashtbl, const hash_key_t key, void **dataP); hashtable_rc_t hashtable_get (const hash_table_t *const hashtbl, const hash_key_t key, void **dataP);
hashtable_rc_t hashtable_resize (hash_table_t *const hashtbl, const hash_size_t size);
......
...@@ -37,8 +37,8 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB) { ...@@ -37,8 +37,8 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB) {
int tmp = locationAndBandwidth/N_RB; int tmp = locationAndBandwidth/N_RB;
int tmp2 = locationAndBandwidth%N_RB; int tmp2 = locationAndBandwidth%N_RB;
if (tmp <= (N_RB-tmp2+1)) return(tmp); if (tmp <= ((N_RB>>1)-tmp2+1)) return(tmp+1);
else return(N_RB-tmp); else return(N_RB+1-tmp);
} }
...@@ -46,17 +46,19 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB) { ...@@ -46,17 +46,19 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB) {
int tmp = locationAndBandwidth/N_RB; int tmp = locationAndBandwidth/N_RB;
int tmp2 = locationAndBandwidth%N_RB; int tmp2 = locationAndBandwidth%N_RB;
if (tmp <= (N_RB-tmp2+1)) return(tmp2); if (tmp <= ((N_RB>>1)-tmp2+1)) return(tmp2);
else return(N_RB-tmp2); else return(N_RB-1-tmp2);
} }
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart) { int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize) {
if (NPRB < 138) AssertFatal(NPRB>0 && (NPRB + RBstart <= BWPsize),"Illegal NPRB/RBstart Configuration (%d,%d)\n",NPRB,RBstart);
return(275*(NPRB-1)+RBstart); if (NPRB <= 1+(BWPsize>>1)) return(BWPsize*(NPRB-1)+RBstart);
else else return(BWPsize*(BWPsize+1-NPRB) + (BWPsize-1-RBstart));
return(275*(276-NPRB) + (274-RBstart));
} }
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart) {
return(PRBalloc_to_locationandbandwidth0(NPRB,RBstart,275));
}
/// Target code rate tables indexed by Imcs /// Target code rate tables indexed by Imcs
uint16_t nr_target_code_rate_table1[29] = {120, 157, 193, 251, 308, 379, 449, 526, 602, 679, 340, 378, 434, 490, 553, \ uint16_t nr_target_code_rate_table1[29] = {120, 157, 193, 251, 308, 379, 449, 526, 602, 679, 340, 378, 434, 490, 553, \
616, 658, 438, 466, 517, 567, 616, 666, 719, 772, 822, 873, 910, 948}; 616, 658, 438, 466, 517, 567, 616, 666, 719, 772, 822, 873, 910, 948};
...@@ -128,3 +130,18 @@ int get_subband_size(int NPRB,int size) { ...@@ -128,3 +130,18 @@ int get_subband_size(int NPRB,int size) {
AssertFatal(1==0,"Shouldn't get here, NPRB %d\n",NPRB); AssertFatal(1==0,"Shouldn't get here, NPRB %d\n",NPRB);
} }
void SLIV2SL(int SLIV,int *S,int *L) {
int SLIVdiv14 = SLIV/14;
int SLIVmod14 = SLIV%14;
// Either SLIV = 14*(L-1) + S, or SLIV = 14*(14-L+1) + (14-1-S). Condition is 0 <= L <= 14-S
if ((SLIVdiv14 + 1) >= 0 && (SLIVdiv14 <= 13-SLIVmod14)) {
*L=SLIVdiv14+1;
*S=SLIVmod14;
} else {
*L=15-SLIVdiv14;
*S=13-SLIVmod14;
}
}
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
int NRRIV2BW(int locationAndBandwidth,int N_RB); int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize);
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart); int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart);
extern uint16_t nr_target_code_rate_table1[29]; extern uint16_t nr_target_code_rate_table1[29];
extern uint16_t nr_target_code_rate_table2[28]; extern uint16_t nr_target_code_rate_table2[28];
...@@ -43,3 +44,22 @@ extern uint16_t nr_tbs_table[93]; ...@@ -43,3 +44,22 @@ extern uint16_t nr_tbs_table[93];
uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx); uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx);
uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx); uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx);
int get_subband_size(int NPRB,int size); int get_subband_size(int NPRB,int size);
void SLIV2SL(int SLIV,int *S,int *L);
#define CEILIDIV(a,b) ((a+b-1)/b)
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
#define cmax(a,b) ((a>b) ? (a) : (b))
#define cmax3(a,b,c) ((cmax(a,b)>c) ? (cmax(a,b)) : (c))
#define cmin(a,b) ((a<b) ? (a) : (b))
#ifdef __cplusplus
#ifdef min
#undef min
#undef max
#endif
#else
#define max(a,b) cmax(a,b)
#define min(a,b) cmin(a,b)
#endif
...@@ -536,6 +536,7 @@ int timer_setup( ...@@ -536,6 +536,7 @@ int timer_setup(
int timer_remove(long timer_id); int timer_remove(long timer_id);
#define timer_stop timer_remove #define timer_stop timer_remove
int signal_handle(int *end); int signal_handle(int *end);
int signal_mask(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -123,7 +123,7 @@ void client_printf(const char *message, ...) { ...@@ -123,7 +123,7 @@ void client_printf(const char *message, ...) {
if (telnetparams.new_socket > 0) { if (telnetparams.new_socket > 0) {
vsnprintf(telnetparams.msgbuff,sizeof(telnetparams.msgbuff)-1,message, va_args); vsnprintf(telnetparams.msgbuff,sizeof(telnetparams.msgbuff)-1,message, va_args);
send(telnetparams.new_socket,telnetparams.msgbuff , strlen(telnetparams.msgbuff), MSG_NOSIGNAL); send(telnetparams.new_socket,telnetparams.msgbuff, strlen(telnetparams.msgbuff), MSG_NOSIGNAL);
} else { } else {
vprintf(message, va_args); vprintf(message, va_args);
} }
...@@ -475,7 +475,7 @@ int process_command(char *buf) { ...@@ -475,7 +475,7 @@ int process_command(char *buf) {
memset(cmdb,0,sizeof(cmdb)); memset(cmdb,0,sizeof(cmdb));
bufbck=strdup(buf); bufbck=strdup(buf);
rt=CMDSTATUS_NOTFOUND; rt=CMDSTATUS_NOTFOUND;
j = sscanf(buf,"%9s %9s %9[^\t\n]",modulename,cmd,cmdb); j = sscanf(buf,"%19s %19s %19[^\t\n]",modulename,cmd,cmdb);
if (telnetparams.telnetdbg > 0) if (telnetparams.telnetdbg > 0)
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb); printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb);
...@@ -543,7 +543,7 @@ void run_telnetsrv(void) { ...@@ -543,7 +543,7 @@ void run_telnetsrv(void) {
char buf[TELNET_MAX_MSGLENGTH]; char buf[TELNET_MAX_MSGLENGTH];
struct sockaddr cli_addr; struct sockaddr cli_addr;
unsigned int cli_len = sizeof(cli_addr); unsigned int cli_len = sizeof(cli_addr);
int readc , filled; int readc, filled;
int status; int status;
int optval = 1; int optval = 1;
pthread_setname_np(pthread_self(), "telnet"); pthread_setname_np(pthread_self(), "telnet");
...@@ -604,7 +604,7 @@ void run_telnetsrv(void) { ...@@ -604,7 +604,7 @@ void run_telnetsrv(void) {
} }
if (telnetparams.telnetdbg > 0) if (telnetparams.telnetdbg > 0)
printf("[TELNETSRV] Command received: readc %i filled %i \"%s\"\n", readc, filled ,buf); printf("[TELNETSRV] Command received: readc %i filled %i \"%s\"\n", readc, filled,buf);
if (buf[0] == '!') { if (buf[0] == '!') {
if (buf[1] == '!') { if (buf[1] == '!') {
......
all: measurement_display thread-pool-test all:
measurement_display thread-pool-test
measurement_display: measurement_display.c thread-pool.h measurement_display:
gcc measurement_display.c -I ${OPENAIR_DIR}/ -I ${OPENAIR_DIR}/common/utils/ -I. ${OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o measurement_display measurement_display.c thread-pool.h
gcc measurement_display.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -lpthread -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o
measurement_display
thread-pool-test: thread-pool.c thread-pool.h thread-pool-test:
gcc -g thread-pool.c -I ${OPENAIR_DIR}/ -I ${OPENAIR_DIR}/common/utils/ -I. ${OPENAIR_DIR}/common/utils/backtrace.c -I ${OPENAIR_DIR}/openair2/COMMON ${OPENAIR_DIR}/common/utils/LOG/log.c ${OPENAIR_DIR}/common/config/config_userapi.c ${OPENAIR_DIR}/common/config/config_load_configmodule.c ${OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test thread-pool.c thread-pool.h
gcc -g thread-pool.c -I $ {OPENAIR_DIR}/ -I $ {OPENAIR_DIR}/common/utils/ -I. $ {OPENAIR_DIR}/common/utils/backtrace.c -I $ {OPENAIR_DIR}/openair2/COMMON $ {OPENAIR_DIR}/common/utils/LOG/log.c $ {OPENAIR_DIR}/common/config/config_userapi.c
$ {OPENAIR_DIR}/common/config/config_load_configmodule.c $ {OPENAIR_DIR}/common/config/config_cmdline.c -lpthread -ldl -D TEST_THREAD_POOL -I../LOG -I../../utils/T -o thread-pool-test
...@@ -67,7 +67,7 @@ void *one_thread(void *arg) { ...@@ -67,7 +67,7 @@ void *one_thread(void *arg) {
delNotifiedFIFO_elt(elt); delNotifiedFIFO_elt(elt);
else else
pushNotifiedFIFO(elt->reponseFifo, elt); pushNotifiedFIFO(elt->reponseFifo, elt);
myThread->runningOnKey=-1;
mutexunlock(tp->incomingFifo.lockF); mutexunlock(tp->incomingFifo.lockF);
} }
} while (true); } while (true);
...@@ -95,7 +95,7 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) { ...@@ -95,7 +95,7 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
pool->nbThreads=0; pool->nbThreads=0;
pool->restrictRNTI=false; pool->restrictRNTI=false;
curptr=strtok_r(params,",",&saveptr); curptr=strtok_r(params,",",&saveptr);
struct one_thread * ptr;
while ( curptr!=NULL ) { while ( curptr!=NULL ) {
int c=toupper(curptr[0]); int c=toupper(curptr[0]);
...@@ -109,8 +109,9 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) { ...@@ -109,8 +109,9 @@ void initTpool(char *params,tpool_t *pool, bool performanceMeas) {
break; break;
default: default:
ptr=pool->allthreads;
pool->allthreads=(struct one_thread *)malloc(sizeof(struct one_thread)); pool->allthreads=(struct one_thread *)malloc(sizeof(struct one_thread));
pool->allthreads->next=pool->allthreads; pool->allthreads->next=ptr;
printf("create a thread for core %d\n", atoi(curptr)); printf("create a thread for core %d\n", atoi(curptr));
pool->allthreads->coreID=atoi(curptr); pool->allthreads->coreID=atoi(curptr);
pool->allthreads->id=pool->nbThreads; pool->allthreads->id=pool->nbThreads;
......
...@@ -150,8 +150,9 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) { ...@@ -150,8 +150,9 @@ static inline notifiedFIFO_elt_t *pollNotifiedFIFO(notifiedFIFO_t *nf) {
// This function aborts all messages matching the key // This function aborts all messages matching the key
// If the queue is used in thread pools, it doesn't cancels already running processing // If the queue is used in thread pools, it doesn't cancels already running processing
// because the message has already been picked // because the message has already been picked
static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) { static inline int abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) {
mutexlock(nf->lockF); mutexlock(nf->lockF);
int nbDeleted=0;
notifiedFIFO_elt_t **start=&nf->outF; notifiedFIFO_elt_t **start=&nf->outF;
while(*start!=NULL) { while(*start!=NULL) {
...@@ -159,13 +160,16 @@ static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) { ...@@ -159,13 +160,16 @@ static inline void abortNotifiedFIFO(notifiedFIFO_t *nf, uint64_t key) {
notifiedFIFO_elt_t *request=*start; notifiedFIFO_elt_t *request=*start;
*start=(*start)->next; *start=(*start)->next;
delNotifiedFIFO_elt(request); delNotifiedFIFO_elt(request);
} nbDeleted++;
} else
if (*start != NULL)
start=&(*start)->next; start=&(*start)->next;
} }
if (nf->outF == NULL)
nf->inF=NULL;
mutexunlock(nf->lockF); mutexunlock(nf->lockF);
return nbDeleted;
} }
struct one_thread { struct one_thread {
...@@ -195,7 +199,20 @@ typedef struct thread_pool { ...@@ -195,7 +199,20 @@ typedef struct thread_pool {
static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) { static inline void pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg) {
if (t->measurePerf) msg->creationTime=rdtsc(); if (t->measurePerf) msg->creationTime=rdtsc();
if ( t->activated)
pushNotifiedFIFO(&t->incomingFifo, msg); pushNotifiedFIFO(&t->incomingFifo, msg);
else {
if (t->measurePerf)
msg->startProcessingTime=rdtsc();
msg->processingFunc(NotifiedFifoData(msg));
if (t->measurePerf)
msg->endProcessingTime=rdtsc();
if (msg->reponseFifo)
pushNotifiedFIFO(msg->reponseFifo, msg);
}
} }
static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_t *t) { static inline notifiedFIFO_elt_t *pullTpool(notifiedFIFO_t *responseFifo, tpool_t *t) {
...@@ -225,7 +242,8 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo ...@@ -225,7 +242,8 @@ static inline notifiedFIFO_elt_t *tryPullTpool(notifiedFIFO_t *responseFifo, tpo
return msg; return msg;
} }
static inline void abortTpool(tpool_t *t, uint64_t key) { static inline int abortTpool(tpool_t *t, uint64_t key) {
int nbRemoved=0;
notifiedFIFO_t *nf=&t->incomingFifo; notifiedFIFO_t *nf=&t->incomingFifo;
mutexlock(nf->lockF); mutexlock(nf->lockF);
notifiedFIFO_elt_t **start=&nf->outF; notifiedFIFO_elt_t **start=&nf->outF;
...@@ -235,22 +253,27 @@ static inline void abortTpool(tpool_t *t, uint64_t key) { ...@@ -235,22 +253,27 @@ static inline void abortTpool(tpool_t *t, uint64_t key) {
notifiedFIFO_elt_t *request=*start; notifiedFIFO_elt_t *request=*start;
*start=(*start)->next; *start=(*start)->next;
delNotifiedFIFO_elt(request); delNotifiedFIFO_elt(request);
} nbRemoved++;
} else
if (*start != NULL)
start=&(*start)->next; start=&(*start)->next;
} }
if (t->incomingFifo.outF==NULL)
t->incomingFifo.inF=NULL;
struct one_thread *ptr=t->allthreads; struct one_thread *ptr=t->allthreads;
while(ptr!=NULL) { while(ptr!=NULL) {
if (ptr->runningOnKey==key) if (ptr->runningOnKey==key) {
ptr->abortFlag=true; ptr->abortFlag=true;
nbRemoved++;
}
ptr=ptr->next; ptr=ptr->next;
} }
mutexunlock(nf->lockF); mutexunlock(nf->lockF);
return nbRemoved;
} }
void initTpool(char *params,tpool_t *pool, bool performanceMeas); void initTpool(char *params,tpool_t *pool, bool performanceMeas);
......
...@@ -3,69 +3,90 @@ ...@@ -3,69 +3,90 @@
The thread pool is a working server, made of a set of worker threads that can be mapped on CPU cores. The thread pool is a working server, made of a set of worker threads that can be mapped on CPU cores.
Each worker loop on pick from the same input queue jobs to do. Each worker loop on pick from the same input queue jobs to do.
When a job is done, the worker sends a return if a return is defined. When a job is done, the worker sends a return if a return is defined.
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless). A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client, so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter. All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client,
so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
## license ## license
Author: Laurent Thomas, Open cells project Author:
The owner share this piece code to Openairsoftware alliance as per OSA license terms Laurent Thomas, Open cells project
The owner share this piece code to Openairsoftware alliance as per OSA license terms
# jobs # jobs
A job is a message (notifiedFIFO_elt_t): A job is a message (notifiedFIFO_elt_t):
next: internal FIFO chain, do not set it next:
key: a long int that the client can use to identify a message or a group of messages internal FIFO chain, do not set it
responseFifo: if the client defines a response FIFO, the message will be posted back after processing key:
processingFunc: any funtion (type void processingFunc(void *)) that the worker will launch a long int that the client can use to identify a message or a group of messages
msgData: the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing responseFifo:
malloced: a boolean that enable internal free in these cases: no return Fifo or Abort feature if the client defines a response FIFO, the message will be posted back after processing
processingFunc:
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client. any funtion (type void processingFunc(void *)) that the worker will launch
msgData:
the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
malloced:
a boolean that enable internal free in these cases:
no return Fifo or Abort feature
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
# Queues of jobs # Queues of jobs
Queues are type of: notifiedFIFO_t that must be initialized by init_notifiedFIFO() Queues are type of:
No delete function is required, the creator has only to free the data of type notifiedFIFO_t notifiedFIFO_t that must be initialized by init_notifiedFIFO()
No delete function is required, the creator has only to free the data of type notifiedFIFO_t
push_notifiedFIFO() add a job in the queue push_notifiedFIFO() add a job in the queue
pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition) abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
# Thread pools # Thread pools
## initialization ## initialization
The clients can create one or more thread pools with init_tpool() The clients can create one or more thread pools with init_tpool()
the params string structure: describes a list of cores, separated by "," that run a worker thread the params string structure:
describes a list of cores, separated by "," that run a worker thread
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and the related code (use negative values is allowed, so the thread will never be mapped on a specific core). If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and
the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>" The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
## adding jobs ## adding jobs
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO()) The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job. If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
## abort ## abort
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues. A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue. Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
## Performance measurements ## Performance measurements
A performance measurement is integrated: the pool will automacillay fill timestamps: A performance measurement is integrated:
the pool will automacillay fill timestamps:
* creationTime:
time the request is push to the pool;
* creationTime: time the request is push to the pool; * startProcessingTime:
* startProcessingTime: time a worker start to run on the job time a worker start to run on the job
* endProcessingTime: time the worker finished the job * endProcessingTime:
* returnTime: time the client reads the result time the worker finished the job
* returnTime:
time the client reads the result
if you set the environement variable: thread-pool-measurements to a valid file name if you set the environement variable:
thread-pool-measurements to a valid file name
These measurements will be wrote to this Linux pipe. These measurements will be wrote to this Linux pipe.
A tool to read the linux fifo and display it in ascii is provided: see the local directory Makefile for this tool and to compile the thread pool unitary tests. A tool to read the linux fifo and display it in ascii is provided:
see the local directory Makefile for this tool and to compile the thread pool unitary tests.
...@@ -54,7 +54,7 @@ cd cmake_targets/ ...@@ -54,7 +54,7 @@ cd cmake_targets/
``` ```
- The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed. - The `-I` option is to install pre-requisites, you only need it the first time you build the softmodem or when some oai dependencies have changed.
- The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. - The `-w` option is to select the radio head support you want to include in your build. Radio head support is provided via a shared library, which is called the "oai device" The build script creates a soft link from `liboai_device.so` to the true device which will be used at run-time (here the USRP one,`liboai_usrpdevif.so` . USRP is the only hardware tested today in the Continuous Integration process. The RF simulator[RF simulator](../targets/ARCH/rfsimulator/README.md) is implemented as a specific device replacing RF hardware, it can be build using `-w SIMU` option.
- `--eNB` is to build the `lte-softmodem` executable and all required shared libraries - `--eNB` is to build the `lte-softmodem` executable and all required shared libraries
- `--UE` is to build the `lte-uesoftmodem` executable and all required shared libraries - `--UE` is to build the `lte-uesoftmodem` executable and all required shared libraries
......
...@@ -108,8 +108,8 @@ extern openair0_config_t openair0_cfg[MAX_CARDS]; ...@@ -108,8 +108,8 @@ extern openair0_config_t openair0_cfg[MAX_CARDS];
extern int transmission_mode; extern int transmission_mode;
uint16_t sl_ahead=4; uint16_t sl_ahead=6;
uint16_t sf_ahead=4; uint16_t sf_ahead=6;
//pthread_t main_gNB_thread; //pthread_t main_gNB_thread;
time_stats_t softmodem_stats_mt; // main thread time_stats_t softmodem_stats_mt; // main thread
...@@ -133,13 +133,14 @@ extern double cpuf; ...@@ -133,13 +133,14 @@ extern double cpuf;
void init_gNB(int,int); void init_gNB(int,int);
void stop_gNB(int nb_inst); void stop_gNB(int nb_inst);
int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot_tx,uint64_t timestamp_tx); int wakeup_txfh(PHY_VARS_gNB *gNB, gNB_L1_rxtx_proc_t *proc, int frame_tx, int slot_tx, uint64_t timestamp_tx);
int wakeup_tx(PHY_VARS_gNB *gNB,int frame_rx,int slot_rx,int frame_tx,int slot_tx,uint64_t timestamp_tx); int wakeup_tx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, uint64_t timestamp_tx);
extern PARALLEL_CONF_t get_thread_parallel_conf(void); #include "executables/thread-common.h"
extern WORKER_CONF_t get_thread_worker_conf(void); //extern PARALLEL_CONF_t get_thread_parallel_conf(void);
//extern WORKER_CONF_t get_thread_worker_conf(void);
void wakeup_prach_gNB(PHY_VARS_gNB *gNB,RU_t *ru,int frame,int subframe); void wakeup_prach_gNB(PHY_VARS_gNB *gNB, RU_t *ru, int frame, int subframe);
extern uint8_t nfapi_mode; extern uint8_t nfapi_mode;
extern void oai_subframe_ind(uint16_t sfn, uint16_t sf); extern void oai_subframe_ind(uint16_t sfn, uint16_t sf);
...@@ -149,7 +150,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset); ...@@ -149,7 +150,7 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials) #define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) { static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
// ******************************************************************* // *******************************************************************
...@@ -184,17 +185,15 @@ static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx ...@@ -184,17 +185,15 @@ static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx
// **************************************** // ****************************************
// Common RX procedures subframe n // Common RX procedures subframe n
T(T_GNB_PHY_DL_TICK, T_INT(gNB->Mod_id), T_INT(frame_tx), T_INT(slot_tx)); T(T_GNB_PHY_DL_TICK, T_INT(gNB->Mod_id), T_INT(frame_tx), T_INT(slot_tx));
/* /*
// if this is IF5 or 3GPP_gNB // if this is IF5 or 3GPP_gNB
if (gNB && gNB->RU_list && gNB->RU_list[0] && gNB->RU_list[0]->function < NGFI_RAU_IF4p5) { if (gNB && gNB->RU_list && gNB->RU_list[0] && gNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
wakeup_prach_gNB(gNB,NULL,proc->frame_rx,proc->slot_rx); wakeup_prach_gNB(gNB,NULL,proc->frame_rx,proc->slot_rx);
} }
// UE-specific RX processing for subframe n // UE-specific RX processing for subframe n
if (nfapi_mode == 0 || nfapi_mode == 1) { if (nfapi_mode == 0 || nfapi_mode == 1) */
phy_procedures_gNB_uespec_RX(gNB, proc, no_relay );
}
*/
pthread_mutex_lock(&gNB->UL_INFO_mutex); pthread_mutex_lock(&gNB->UL_INFO_mutex);
gNB->UL_INFO.frame = frame_rx; gNB->UL_INFO.frame = frame_rx;
gNB->UL_INFO.slot = slot_rx; gNB->UL_INFO.slot = slot_rx;
...@@ -213,6 +212,9 @@ static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx ...@@ -213,6 +212,9 @@ static inline int rxtx(PHY_VARS_gNB *gNB,int frame_rx, int slot_rx, int frame_tx
if (oai_exit) return(-1); if (oai_exit) return(-1);
//if (slot_rx == NR_UPLINK_SLOT || gNB->frame_parms.frame_type == FDD)
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) { if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) {
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1); phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
} }
...@@ -288,6 +290,8 @@ static void *gNB_L1_thread_tx(void *param) { ...@@ -288,6 +290,8 @@ static void *gNB_L1_thread_tx(void *param) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,slot_tx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_TX1_GNB,slot_tx);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,frame_tx); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX1_GNB,frame_tx);
phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1); phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, 1 );
pthread_mutex_lock( &L1_proc_tx->mutex ); pthread_mutex_lock( &L1_proc_tx->mutex );
L1_proc_tx->instance_cnt = -1; L1_proc_tx->instance_cnt = -1;
...@@ -299,6 +303,7 @@ static void *gNB_L1_thread_tx(void *param) { ...@@ -299,6 +303,7 @@ static void *gNB_L1_thread_tx(void *param) {
pthread_mutex_unlock(&L1_proc_tx->mutex); pthread_mutex_unlock(&L1_proc_tx->mutex);
wakeup_txfh(gNB,L1_proc_tx,frame_tx,slot_tx,timestamp_tx); wakeup_txfh(gNB,L1_proc_tx,frame_tx,slot_tx,timestamp_tx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH, 0 );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1, 0 );
} }
...@@ -418,10 +423,10 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot ...@@ -418,10 +423,10 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
// note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time // note this should depend on the numerology used by the TX L1 thread, set here for 500us slot time
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,1); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,1);
waitret=timedwait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh",1000000); waitret=wait_on_condition(&proc->mutex_RUs_tx,&proc->cond_RUs,&proc->instance_cnt_RUs,"wakeup_txfh");
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,0); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL,0);
AssertFatal(release_thread(&proc->mutex_RUs_tx,&proc->instance_cnt_RUs,"wakeup_txfh")==0, "error releaseing gNB lock on RUs\n");
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_RX0_UE,proc->instance_cnt_RUs);
if (waitret == ETIMEDOUT) { if (waitret == ETIMEDOUT) {
...@@ -446,7 +451,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot ...@@ -446,7 +451,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
ru = gNB->RU_list[i]; ru = gNB->RU_list[i];
ru_proc = &ru->proc; ru_proc = &ru->proc;
AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_gNBs))==0,"ERROR pthread_mutex_lock failed on mutex_gNBs L1_thread_tx with ret=%d\n",ret); //AssertFatal((ret = pthread_mutex_lock(&ru_proc->mutex_gNBs))==0,"ERROR pthread_mutex_lock failed on mutex_gNBs L1_thread_tx with ret=%d\n",ret);
if (ru_proc->instance_cnt_gNBs == 0) { if (ru_proc->instance_cnt_gNBs == 0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 1); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 1);
...@@ -454,7 +459,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot ...@@ -454,7 +459,7 @@ int wakeup_txfh(PHY_VARS_gNB *gNB,gNB_L1_rxtx_proc_t *proc,int frame_tx,int slot
AssertFatal((ret=pthread_mutex_lock(&gNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(&gNB->proc.mutex_RU_tx))==0,"mutex_lock returns %d\n",ret);
gNB->proc.RU_mask_tx = 0; gNB->proc.RU_mask_tx = 0;
AssertFatal((ret=pthread_mutex_unlock(&gNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(&gNB->proc.mutex_RU_tx))==0,"mutex_unlock returns %d\n",ret);
AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_gNBs ))==0,"mutex_unlock return %d\n",ret); //AssertFatal((ret=pthread_mutex_unlock( &ru_proc->mutex_gNBs ))==0,"mutex_unlock return %d\n",ret);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 0); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST_UE, 0);
return(-1); return(-1);
...@@ -520,6 +525,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { ...@@ -520,6 +525,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
RU_proc_t *ru_proc=&ru->proc; RU_proc_t *ru_proc=&ru->proc;
int ret; int ret;
int i; int i;
struct timespec abstime;
int time_ns = 50000;
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret); AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret);
for (i=0;i<gNB->num_RU;i++) { for (i=0;i<gNB->num_RU;i++) {
...@@ -540,14 +547,22 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) { ...@@ -540,14 +547,22 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret); AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret);
} }
clock_gettime(CLOCK_REALTIME, &abstime);
abstime.tv_nsec = abstime.tv_nsec + time_ns;
if (abstime.tv_nsec >= 1000*1000*1000) {
abstime.tv_nsec -= 1000*1000*1000;
abstime.tv_sec += 1;
}
// wake up TX for subframe n+sl_ahead // wake up TX for subframe n+sl_ahead
// lock the TX mutex and make sure the thread is ready // lock the TX mutex and make sure the thread is ready
AssertFatal((ret=pthread_mutex_lock(&L1_proc->mutex)) == 0,"mutex_lock returns %d\n", ret); AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret); AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx); LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
return(-1);
} }
++L1_proc->instance_cnt; ++L1_proc->instance_cnt;
...@@ -929,13 +944,13 @@ void init_gNB(int single_thread_flag,int wait_for_sync) { ...@@ -929,13 +944,13 @@ void init_gNB(int single_thread_flag,int wait_for_sync) {
#ifndef OCP_FRAMEWORK #ifndef OCP_FRAMEWORK
LOG_I(PHY,"Initializing gNB %d\n",inst); LOG_I(PHY,"Initializing gNB %d\n",inst);
#endif #endif
LOG_I(PHY,"Registering with MAC interface module (before %p)\n",gNB->if_inst); LOG_I(PHY,"Registering with MAC interface module (before %p)\n",gNB->if_inst);
AssertFatal((gNB->if_inst = NR_IF_Module_init(inst))!=NULL,"Cannot register interface"); AssertFatal((gNB->if_inst = NR_IF_Module_init(inst))!=NULL,"Cannot register interface");
LOG_I(PHY,"Registering with MAC interface module (after %p)\n",gNB->if_inst); LOG_I(PHY,"Registering with MAC interface module (after %p)\n",gNB->if_inst);
gNB->if_inst->NR_Schedule_response = nr_schedule_response; gNB->if_inst->NR_Schedule_response = nr_schedule_response;
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request; gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO)); memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
memset((void *)&gNB->Sched_INFO,0,sizeof(gNB->Sched_INFO));
LOG_I(PHY,"Setting indication lists\n"); LOG_I(PHY,"Setting indication lists\n");
gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = gNB->rx_pdu_list; gNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list = gNB->rx_pdu_list;
gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = gNB->crc_pdu_list; gNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list = gNB->crc_pdu_list;
......
This diff is collapsed.
...@@ -83,6 +83,7 @@ ...@@ -83,6 +83,7 @@
#define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n" #define CONFIG_HLP_TNOFORK "to ease debugging with gdb\n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n" #define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n" #define CONFIG_HLP_DISABLETIMECORR "disable UE timing correction\n"
#define CONFIG_HLP_RRC_CFG_PATH "path for RRC configuration\n"
#define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n" #define CONFIG_HLP_NUMEROLOGY "adding numerology for 5G\n"
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n" #define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
...@@ -98,6 +99,8 @@ ...@@ -98,6 +99,8 @@
#define CONFIG_HLP_TELN "Start embedded telnet server \n" #define CONFIG_HLP_TELN "Start embedded telnet server \n"
#define CONFIG_HLP_MSC "Enable the MSC tracing utility \n" #define CONFIG_HLP_MSC "Enable the MSC tracing utility \n"
#define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n" #define CONFIG_HLP_SNR "Set average SNR in dB (for --siml1 option)\n"
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
/*--------------------------------------------------------------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */ /* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
......
...@@ -83,6 +83,8 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -83,6 +83,8 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "PHY/TOOLS/nr_phy_scope.h" #include "PHY/TOOLS/nr_phy_scope.h"
#include "stats.h" #include "stats.h"
#include "nr-softmodem.h" #include "nr-softmodem.h"
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
#include "NB_IoT_interface.h" #include "NB_IoT_interface.h"
#include "x2ap_eNB.h" #include "x2ap_eNB.h"
...@@ -105,7 +107,6 @@ int config_sync_var=-1; ...@@ -105,7 +107,6 @@ int config_sync_var=-1;
#endif #endif
volatile int oai_exit = 0; volatile int oai_exit = 0;
static clock_source_t clock_source = internal;
static int wait_for_sync = 0; static int wait_for_sync = 0;
unsigned int mmapped_dma=0; unsigned int mmapped_dma=0;
...@@ -189,46 +190,10 @@ int transmission_mode=1; ...@@ -189,46 +190,10 @@ int transmission_mode=1;
int emulate_rf = 0; int emulate_rf = 0;
int numerology = 0; int numerology = 0;
typedef struct {
uint64_t optmask;
THREAD_STRUCT thread_struct;
char rf_config_file[1024];
int phy_test;
uint8_t usim_test;
int emulate_rf;
int wait_for_sync; //eNodeB only
int single_thread_flag; //eNodeB only
int chain_offset;
int numerology;
unsigned int start_msc;
uint32_t clock_source;
int hw_timing_advance;
} softmodem_params_t;
static softmodem_params_t softmodem_params; static softmodem_params_t softmodem_params;
static char *parallel_config = NULL; static char *parallel_config = NULL;
static char *worker_config = NULL; static char *worker_config = NULL;
static THREAD_STRUCT thread_struct;
void set_parallel_conf(char *parallel_conf) {
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
}
void set_worker_conf(char *worker_conf) {
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
}
PARALLEL_CONF_t get_thread_parallel_conf(void) {
return thread_struct.parallel_conf;
}
WORKER_CONF_t get_thread_worker_conf(void) {
return thread_struct.worker_conf;
}
/* struct for ethernet specific parameters given in eNB conf file */ /* struct for ethernet specific parameters given in eNB conf file */
eth_params_t *eth_params; eth_params_t *eth_params;
...@@ -246,7 +211,7 @@ char uecap_xer_in=0; ...@@ -246,7 +211,7 @@ char uecap_xer_in=0;
uint8_t abstraction_flag=0; uint8_t abstraction_flag=0;
/* forward declarations */ /* forward declarations */
void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs], NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
/*---------------------BMC: timespec helpers -----------------------------*/ /*---------------------BMC: timespec helpers -----------------------------*/
...@@ -520,7 +485,9 @@ static void get_options(void) { ...@@ -520,7 +485,9 @@ static void get_options(void) {
int tddflag, nonbiotflag; int tddflag, nonbiotflag;
uint32_t online_log_messages; uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity; uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv; uint32_t start_telnetsrv = 0;
uint32_t noS1;
uint32_t nokrnmod;
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ; paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ; paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
...@@ -558,6 +525,7 @@ static void get_options(void) { ...@@ -558,6 +525,7 @@ static void get_options(void) {
if(parallel_config != NULL) set_parallel_conf(parallel_config); if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config); if(worker_config != NULL) set_worker_conf(worker_config);
} }
...@@ -569,18 +537,18 @@ static void get_options(void) { ...@@ -569,18 +537,18 @@ static void get_options(void) {
void set_default_frame_parms(nfapi_nr_config_request_t *config[MAX_NUM_CCs], void set_default_frame_parms(nfapi_nr_config_request_scf_t *config[MAX_NUM_CCs],
NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs])
{ {
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS)); frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) malloc(sizeof(NR_DL_FRAME_PARMS));
config[CC_id] = (nfapi_nr_config_request_t *) malloc(sizeof(nfapi_nr_config_request_t)); config[CC_id] = (nfapi_nr_config_request_scf_t *) malloc(sizeof(nfapi_nr_config_request_scf_t));
config[CC_id]->subframe_config.numerology_index_mu.value =1; config[CC_id]->ssb_config.scs_common.value = 1;
config[CC_id]->subframe_config.duplex_mode.value = 1; //FDD config[CC_id]->cell_config.frame_duplex_type.value = 1; //FDD
config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL //config[CC_id]->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
config[CC_id]->rf_config.dl_carrier_bandwidth.value = 106; config[CC_id]->carrier_config.dl_grid_size[1].value = 106;
config[CC_id]->rf_config.ul_carrier_bandwidth.value = 106; config[CC_id]->carrier_config.ul_grid_size[1].value = 106;
config[CC_id]->sch_config.physical_cell_id.value = 0; config[CC_id]->cell_config.phy_cell_id.value = 0;
///dl frequency to be filled in ///dl frequency to be filled in
/* //Set some default values that may be overwritten while reading options /* //Set some default values that may be overwritten while reading options
frame_parms[CC_id]->frame_type = FDD; frame_parms[CC_id]->frame_type = FDD;
...@@ -873,6 +841,30 @@ static void wait_nfapi_init(char *thread_name) { ...@@ -873,6 +841,30 @@ static void wait_nfapi_init(char *thread_name) {
printf( "NFAPI: got sync (%s)\n", thread_name); printf( "NFAPI: got sync (%s)\n", thread_name);
} }
void init_pdcp(void) {
//if (!NODE_IS_DU(RC.rrc[0]->node_type)) {
pdcp_layer_init();
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1){
printf("IS_SOFTMODEM_NOS1 option enabled \n");
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT ;
}
pdcp_module_init(pdcp_initmask);
/*if (NODE_IS_CU(RC.rrc[0]->node_type)) {
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
} else {*/
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
//}
/*} else {
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
}*/
}
int main( int argc, char **argv ) int main( int argc, char **argv )
{ {
int i, ru_id, CC_id = 0; int i, ru_id, CC_id = 0;
...@@ -894,6 +886,7 @@ int main( int argc, char **argv ) ...@@ -894,6 +886,7 @@ int main( int argc, char **argv )
configure_linux(); configure_linux();
printf("Reading in command-line options\n"); printf("Reading in command-line options\n");
get_options (); get_options ();
get_common_options();
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) { if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
fprintf(stderr,"Getting configuration failed\n"); fprintf(stderr,"Getting configuration failed\n");
...@@ -939,6 +932,9 @@ init_opt(); ...@@ -939,6 +932,9 @@ init_opt();
#endif #endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
if(IS_SOFTMODEM_NOS1)
init_pdcp();
if (RC.nb_nr_inst > 0) { if (RC.nb_nr_inst > 0) {
// don't create if node doesn't connect to RRC/S1/GTP // don't create if node doesn't connect to RRC/S1/GTP
...@@ -958,6 +954,7 @@ init_opt(); ...@@ -958,6 +954,7 @@ init_opt();
flexran_agent_start(i); flexran_agent_start(i);
} }
*/ */
// init UE_PF_PO and mutex lock // init UE_PF_PO and mutex lock
pthread_mutex_init(&ue_pf_po_mutex, NULL); pthread_mutex_init(&ue_pf_po_mutex, NULL);
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs); memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
......
...@@ -5,25 +5,24 @@ ...@@ -5,25 +5,24 @@
#include "flexran_agent.h" #include "flexran_agent.h"
#include "PHY/defs_gNB.h" #include "PHY/defs_gNB.h"
#include "proto_agent.h"
#define DEFAULT_DLF 2680000000 #define DEFAULT_DLF 2680000000
/***************************************************************************************************************************************/ /***************************************************************************************************************************************/
/* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument /* command line options definitions, CMDLINE_XXXX_DESC macros are used to initialize paramdef_t arrays which are then used as argument
when calling config_get or config_getlist functions */ when calling config_get or config_getlist functions */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */ /* command line parameters common to eNodeB and UE */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_PARAMS_DESC_GNB { \ #define CMDLINE_PARAMS_DESC_GNB { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\ {"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ {"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ {"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \ {"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \ {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
...@@ -42,14 +41,21 @@ ...@@ -42,14 +41,21 @@
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \ {"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0} \
} }
#define SOFTMODEM_NOS1_BIT (1<<0)
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
#define SOFTMODEM_RFSIM_BIT (1<<10)
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
typedef struct { #define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT)
int *argc; extern uint64_t get_softmodem_optmask(void);
char **argv; extern void get_common_options(void);
} scopeParms_t;
extern int T_port; extern int T_port;
extern int T_nowait; extern int T_nowait;
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#include "common/utils/system.h" #include "common/utils/system.h"
#include "common/utils/LOG/vcd_signal_dumper.h" #include "common/utils/LOG/vcd_signal_dumper.h"
#include "executables/nr-softmodem.h"
#include "T.h" #include "T.h"
...@@ -141,8 +142,10 @@ PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, ...@@ -141,8 +142,10 @@ PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms,
ue = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE)); ue = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
memset(ue,0,sizeof(PHY_VARS_NR_UE)); memset(ue,0,sizeof(PHY_VARS_NR_UE));
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS)); memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
ue->Mod_id = UE_id; ue->Mod_id = UE_id;
ue->mac_enabled = 1; ue->mac_enabled = 1;
// initialize all signal buffers // initialize all signal buffers
init_nr_ue_signal(ue,1,abstraction_flag); init_nr_ue_signal(ue,1,abstraction_flag);
// intialize transport // intialize transport
...@@ -353,6 +356,9 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ...@@ -353,6 +356,9 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nr_dcireq_t dcireq; nr_dcireq_t dcireq;
nr_scheduled_response_t scheduled_response; nr_scheduled_response_t scheduled_response;
uint32_t nb_rb, start_rb;
uint8_t nb_symb_sch, start_symbol, mcs, precod_nbr_layers, harq_pid, rvidx;
uint16_t n_rnti;
// Process Rx data for one sub-frame // Process Rx data for one sub-frame
if (nr_slot_select(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) { if (nr_slot_select(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) {
...@@ -365,22 +371,57 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) { ...@@ -365,22 +371,57 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
scheduled_response.dl_config = &dcireq.dl_config_req; scheduled_response.dl_config = &dcireq.dl_config_req;
scheduled_response.ul_config = NULL; scheduled_response.ul_config = &dcireq.ul_config_req;
scheduled_response.tx_request = NULL; scheduled_response.tx_request = NULL;
scheduled_response.module_id = UE->Mod_id; scheduled_response.module_id = UE->Mod_id;
scheduled_response.CC_id = 0; scheduled_response.CC_id = 0;
scheduled_response.frame = proc->frame_rx; scheduled_response.frame = proc->frame_rx;
scheduled_response.slot = proc->nr_tti_rx; scheduled_response.slot = proc->nr_tti_rx;
//--------------------------Temporary configuration-----------------------------//
n_rnti = 0x1234;
nb_rb = 50;
start_rb = 0;
nb_symb_sch = 12;
start_symbol = 2;
precod_nbr_layers = 1;
mcs = 9;
harq_pid = 0;
rvidx = 0;
//------------------------------------------------------------------------------//
scheduled_response.ul_config->sfn_slot = NR_UPLINK_SLOT;
scheduled_response.ul_config->number_pdus = 1;
scheduled_response.ul_config->ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.rnti = n_rnti;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_rbs = nb_rb;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_rb = start_rb;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.number_symbols = nb_symb_sch;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.start_symbol = start_symbol;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.mcs = mcs;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.ndi = 0;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.rv = rvidx;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.n_layers = precod_nbr_layers;
scheduled_response.ul_config->ul_config_list[0].ulsch_config_pdu.ulsch_pdu_rel15.harq_process_nbr = harq_pid;
nr_ue_scheduled_response(&scheduled_response); nr_ue_scheduled_response(&scheduled_response);
#ifdef UE_SLOT_PARALLELISATION #ifdef UE_SLOT_PARALLELISATION
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL ); phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
#else #else
uint64_t a=rdtsc(); uint64_t a=rdtsc();
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode, scheduled_response.dl_config); phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode);
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500); LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
//printf(">>> nr_ue_pdcch_procedures ended\n"); //printf(">>> nr_ue_pdcch_procedures ended\n");
#endif #endif
if(IS_SOFTMODEM_NOS1){ //&& proc->nr_tti_rx==1
//Hardcoded rnti value
protocol_ctxt_t ctxt;
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE->Mod_id, ENB_FLAG_NO,
0x1234, proc->frame_rx,
proc->nr_tti_rx, 0);
pdcp_run(&ctxt);
pdcp_fifo_flush_sdus(&ctxt);
}
} }
...@@ -415,13 +456,14 @@ typedef struct processingData_s { ...@@ -415,13 +456,14 @@ typedef struct processingData_s {
} processingData_t; } processingData_t;
void UE_processing(void *arg) { void UE_processing(void *arg) {
uint8_t thread_id;
processingData_t *rxtxD=(processingData_t *) arg; processingData_t *rxtxD=(processingData_t *) arg;
UE_nr_rxtx_proc_t *proc = &rxtxD->proc; UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
PHY_VARS_NR_UE *UE = rxtxD->UE; PHY_VARS_NR_UE *UE = rxtxD->UE;
processSlotRX(UE, proc); processSlotRX(UE, proc);
//printf(">>> mac ended\n"); //printf(">>> mac ended\n");
// Prepare the future Tx data // Prepare the future Tx data
#if 0 /*
#ifndef NO_RAT_NR #ifndef NO_RAT_NR
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT) if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
...@@ -429,11 +471,21 @@ void UE_processing(void *arg) { ...@@ -429,11 +471,21 @@ void UE_processing(void *arg) {
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) || if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) ) (UE->frame_parms.frame_type == FDD) )
#endif #endif
*/
if (proc->nr_tti_tx == NR_UPLINK_SLOT || UE->frame_parms.frame_type == FDD){
thread_id = PHY_vars_UE_g[UE->Mod_id][0]->current_thread_id[proc->nr_tti_tx];
if (UE->mode != loop_through_memory) if (UE->mode != loop_through_memory)
phy_procedures_nrUE_TX(UE,proc,0,0,UE->mode,no_relay); phy_procedures_nrUE_TX(UE,proc,0,thread_id);
}
//phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay); //phy_procedures_UE_TX(UE,proc,0,0,UE->mode,no_relay);
#endif
#if 0 #if 0
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) && if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
...@@ -486,6 +538,9 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) { ...@@ -486,6 +538,9 @@ void trashFrame(PHY_VARS_NR_UE *UE, openair0_timestamp *timestamp) {
dummy_rx, dummy_rx,
UE->frame_parms.samples_per_subframe, UE->frame_parms.samples_per_subframe,
UE->frame_parms.nb_antennas_rx); UE->frame_parms.nb_antennas_rx);
if (IS_SOFTMODEM_RFSIM ) {
usleep(1000); // slow down, as would do actuall rf to let cpu for the synchro thread
}
} }
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
...@@ -643,12 +698,12 @@ void *UE_thread(void *arg) { ...@@ -643,12 +698,12 @@ void *UE_thread(void *arg) {
//LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB); //LOG_I(PHY,"Process slot %d thread Idx %d total gain %d\n", slot_nr, thread_idx, UE->rx_total_gain_dB);
#ifdef OAI_ADRV9371_ZC706 #ifdef OAI_ADRV9371_ZC706
uint32_t total_gain_dB_prev = 0; /*uint32_t total_gain_dB_prev = 0;
if (total_gain_dB_prev != UE->rx_total_gain_dB) { if (total_gain_dB_prev != UE->rx_total_gain_dB) {
total_gain_dB_prev = UE->rx_total_gain_dB; total_gain_dB_prev = UE->rx_total_gain_dB;
openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB-20; openair0_cfg[0].rx_gain[0] = UE->rx_total_gain_dB;
UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]); UE->rfdevice.trx_set_gains_func(&UE->rfdevice,&openair0_cfg[0]);
} }*/
#endif #endif
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
...@@ -657,7 +712,7 @@ void *UE_thread(void *arg) { ...@@ -657,7 +712,7 @@ void *UE_thread(void *arg) {
slot_nr*UE->frame_parms.samples_per_slot]; slot_nr*UE->frame_parms.samples_per_slot];
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
txp[i] = (void *)&UE->common_vars.txdata[i][curMsg->proc.nr_tti_tx*UE->frame_parms.samples_per_slot]; txp[i] = (void *)&UE->common_vars.txdata[i][((curMsg->proc.nr_tti_rx + DURATION_RX_TO_TX)%nb_slot_frame)*UE->frame_parms.samples_per_slot];
int readBlockSize, writeBlockSize; int readBlockSize, writeBlockSize;
...@@ -680,16 +735,18 @@ void *UE_thread(void *arg) { ...@@ -680,16 +735,18 @@ void *UE_thread(void *arg) {
rxp, rxp,
readBlockSize, readBlockSize,
UE->frame_parms.nb_antennas_rx),""); UE->frame_parms.nb_antennas_rx),"");
if (slot_nr==18)
AssertFatal( writeBlockSize == AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice, UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+ timestamp+
(2*UE->frame_parms.samples_per_slot) - (DURATION_RX_TO_TX*UE->frame_parms.samples_per_slot) -
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 - UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 -
openair0_cfg[0].tx_sample_advance, openair0_cfg[0].tx_sample_advance,
txp, txp,
writeBlockSize, writeBlockSize,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
1),""); 4),"");
if( slot_nr==(nb_slot_frame-1)) { if( slot_nr==(nb_slot_frame-1)) {
// read in first symbol of next frame and adjust for timing drift // read in first symbol of next frame and adjust for timing drift
...@@ -734,7 +791,7 @@ void *UE_thread(void *arg) { ...@@ -734,7 +791,7 @@ void *UE_thread(void *arg) {
msgToPush->key=slot_nr; msgToPush->key=slot_nr;
pushTpool(Tpool, msgToPush); pushTpool(Tpool, msgToPush);
if (getenv("RFSIMULATOR")) { if (getenv("RFSIMULATOR") || IS_SOFTMODEM_NOS1) { //getenv("RFSIMULATOR")
// FixMe: Wait previous thread is done, because race conditions seems too bad // FixMe: Wait previous thread is done, because race conditions seems too bad
// in case of actual RF board, the overlap between threads mitigate the issue // in case of actual RF board, the overlap between threads mitigate the issue
// We must receive one message, that proves the slot processing is done // We must receive one message, that proves the slot processing is done
...@@ -752,7 +809,7 @@ void *UE_thread(void *arg) { ...@@ -752,7 +809,7 @@ void *UE_thread(void *arg) {
return NULL; return NULL;
} }
void init_NR_UE(int nb_inst) { void init_NR_UE(int nb_inst, char* rrc_config_path) {
int inst; int inst;
NR_UE_MAC_INST_t *mac_inst; NR_UE_MAC_INST_t *mac_inst;
pthread_t threads[nb_inst]; pthread_t threads[nb_inst];
...@@ -760,21 +817,10 @@ void init_NR_UE(int nb_inst) { ...@@ -760,21 +817,10 @@ void init_NR_UE(int nb_inst) {
for (inst=0; inst < nb_inst; inst++) { for (inst=0; inst < nb_inst; inst++) {
PHY_VARS_NR_UE *UE = PHY_vars_UE_g[inst][0]; PHY_VARS_NR_UE *UE = PHY_vars_UE_g[inst][0];
AssertFatal((UE->if_inst = nr_ue_if_module_init(inst)) != NULL, "can not initial IF module\n"); AssertFatal((UE->if_inst = nr_ue_if_module_init(inst)) != NULL, "can not initial IF module\n");
nr_l3_init_ue(); nr_l3_init_ue(rrc_config_path);
nr_l2_init_ue(); nr_l2_init_ue();
mac_inst = get_mac_inst(inst); mac_inst = get_mac_inst(inst);
mac_inst->if_module = UE->if_inst; mac_inst->if_module = UE->if_inst;
// Initial bandwidth part configuration -- full carrier bandwidth
mac_inst->initial_bwp_dl.bwp_id = 0;
mac_inst->initial_bwp_dl.location = 0;
mac_inst->initial_bwp_dl.scs = UE->frame_parms.subcarrier_spacing;
mac_inst->initial_bwp_dl.N_RB = UE->frame_parms.N_RB_DL;
mac_inst->initial_bwp_dl.cyclic_prefix = UE->frame_parms.Ncp;
mac_inst->initial_bwp_ul.bwp_id = 0;
mac_inst->initial_bwp_ul.location = 0;
mac_inst->initial_bwp_ul.scs = UE->frame_parms.subcarrier_spacing;
mac_inst->initial_bwp_ul.N_RB = UE->frame_parms.N_RB_UL;
mac_inst->initial_bwp_ul.cyclic_prefix = UE->frame_parms.Ncp;
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]); LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX); threadCreate(&threads[inst], UE_thread, (void *)UE, "UEthread", -1, OAI_PRIORITY_RT_MAX);
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#include "PHY/defs_nr_UE.h" #include "PHY/defs_nr_UE.h"
#include "common/ran_context.h" #include "common/ran_context.h"
#include "common/config/config_userapi.h" #include "common/config/config_userapi.h"
//#include "common/utils/threadPool/thread-pool.h"
#include "common/utils/load_module_shlib.h" #include "common/utils/load_module_shlib.h"
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all //#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
...@@ -77,9 +78,11 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -77,9 +78,11 @@ unsigned short config_frames[4] = {2,9,11,13};
#include <forms.h> #include <forms.h>
/* Callbacks, globals and object handlers */ /* Callbacks, globals and object handlers */
extern void reset_stats( FL_OBJECT *, long ); extern void reset_stats( FL_OBJECT *, long );
//extern void initTpool(char *params,tpool_t *pool, bool performanceMeas);
/* Forms and Objects */ /* Forms and Objects */
...@@ -105,13 +108,15 @@ char title[255]; ...@@ -105,13 +108,15 @@ char title[255];
static pthread_t forms_thread; //xforms static pthread_t forms_thread; //xforms
#include <executables/nr-uesoftmodem.h> #include <executables/nr-uesoftmodem.h>
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
RAN_CONTEXT_t RC; RAN_CONTEXT_t RC;
volatile int start_eNB = 0; volatile int start_eNB = 0;
volatile int start_UE = 0; volatile int start_UE = 0;
volatile int oai_exit = 0; volatile int oai_exit = 0;
static clock_source_t clock_source = internal; static clock_source_t clock_source = unset;
int single_thread_flag=1; int single_thread_flag=1;
static double snr_dB=20; static double snr_dB=20;
...@@ -162,46 +167,11 @@ uint8_t nb_antenna_rx = 1; ...@@ -162,46 +167,11 @@ uint8_t nb_antenna_rx = 1;
char ref[128] = "internal"; char ref[128] = "internal";
char channels[128] = "0"; char channels[128] = "0";
typedef struct {
uint64_t optmask;
THREAD_STRUCT thread_struct;
char rf_config_file[1024];
int phy_test;
uint8_t usim_test;
int emulate_rf;
int wait_for_sync; //eNodeB only
int single_thread_flag; //eNodeB only
int chain_offset;
int numerology;
unsigned int start_msc;
uint32_t clock_source;
int hw_timing_advance;
} softmodem_params_t;
static softmodem_params_t softmodem_params; static softmodem_params_t softmodem_params;
static char *parallel_config = NULL; static char *parallel_config = NULL;
static char *worker_config = NULL; static char *worker_config = NULL;
static THREAD_STRUCT thread_struct;
void set_parallel_conf(char *parallel_conf) {
if(strcmp(parallel_conf,"PARALLEL_SINGLE_THREAD")==0) thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_SPLIT;
else if(strcmp(parallel_conf,"PARALLEL_RU_L1_TRX_SPLIT")==0) thread_struct.parallel_conf = PARALLEL_RU_L1_TRX_SPLIT;
printf("[CONFIG] parallel conf is set to %d\n",thread_struct.parallel_conf);
}
void set_worker_conf(char *worker_conf) {
if(strcmp(worker_conf,"WORKER_DISABLE")==0) thread_struct.worker_conf = WORKER_DISABLE;
else if(strcmp(worker_conf,"WORKER_ENABLE")==0) thread_struct.worker_conf = WORKER_ENABLE;
printf("[CONFIG] worker conf is set to %d\n",thread_struct.worker_conf);
}
PARALLEL_CONF_t get_thread_parallel_conf(void) {
return thread_struct.parallel_conf;
}
WORKER_CONF_t get_thread_worker_conf(void) {
return thread_struct.worker_conf;
}
int rx_input_level_dBm; int rx_input_level_dBm;
//static int online_log_messages=0; //static int online_log_messages=0;
...@@ -239,6 +209,8 @@ tpool_t *Tpool; ...@@ -239,6 +209,8 @@ tpool_t *Tpool;
char *usrp_args=NULL; char *usrp_args=NULL;
char *rrc_config_path=NULL;
/* forward declarations */ /* forward declarations */
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]); void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
...@@ -404,6 +376,8 @@ static void get_options(void) { ...@@ -404,6 +376,8 @@ static void get_options(void) {
uint32_t online_log_messages; uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity; uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv=0; uint32_t start_telnetsrv=0;
//uint32_t noS1;
//uint32_t nokrnmod;
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
...@@ -549,14 +523,23 @@ void init_openair0(void) { ...@@ -549,14 +523,23 @@ void init_openair0(void) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=92.16e6; openair0_cfg[card].sample_rate=92.16e6;
openair0_cfg[card].samples_per_frame = 921600; openair0_cfg[card].samples_per_frame = 921600;
openair0_cfg[card].tx_bw = 40e6;
openair0_cfg[card].rx_bw = 40e6;
} }
else { else {
openair0_cfg[card].sample_rate=122.88e6; openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800; openair0_cfg[card].samples_per_frame = 1228800;
openair0_cfg[card].tx_bw = 40e6; }
openair0_cfg[card].rx_bw = 40e6; } else {
LOG_E(PHY,"Unsupported numerology!\n");
exit(-1);
}
}else if(frame_parms[0]->N_RB_DL == 273) {
if (numerology==1) {
if (frame_parms[0]->threequarter_fs) {
AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n");
}
else {
openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800;
} }
} else { } else {
LOG_E(PHY,"Unsupported numerology!\n"); LOG_E(PHY,"Unsupported numerology!\n");
...@@ -567,32 +550,22 @@ void init_openair0(void) { ...@@ -567,32 +550,22 @@ void init_openair0(void) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=23.04e6; openair0_cfg[card].sample_rate=23.04e6;
openair0_cfg[card].samples_per_frame = 230400; openair0_cfg[card].samples_per_frame = 230400;
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
} else { } else {
openair0_cfg[card].sample_rate=30.72e6; openair0_cfg[card].sample_rate=30.72e6;
openair0_cfg[card].samples_per_frame = 307200; openair0_cfg[card].samples_per_frame = 307200;
openair0_cfg[card].tx_bw = 10e6;
openair0_cfg[card].rx_bw = 10e6;
} }
} else if (numerology==1) { } else if (numerology==1) {
if (frame_parms[0]->threequarter_fs) { if (frame_parms[0]->threequarter_fs) {
openair0_cfg[card].sample_rate=46.08e6; openair0_cfg[card].sample_rate=46.08e6;
openair0_cfg[card].samples_per_frame = 480800; openair0_cfg[card].samples_per_frame = 480800;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
} }
else { else {
openair0_cfg[card].sample_rate=61.44e6; openair0_cfg[card].sample_rate=61.44e6;
openair0_cfg[card].samples_per_frame = 614400; openair0_cfg[card].samples_per_frame = 614400;
openair0_cfg[card].tx_bw = 20e6;
openair0_cfg[card].rx_bw = 20e6;
} }
} else if (numerology==2) { } else if (numerology==2) {
openair0_cfg[card].sample_rate=122.88e6; openair0_cfg[card].sample_rate=122.88e6;
openair0_cfg[card].samples_per_frame = 1228800; openair0_cfg[card].samples_per_frame = 1228800;
openair0_cfg[card].tx_bw = 40e6;
openair0_cfg[card].rx_bw = 40e6;
} else { } else {
LOG_E(PHY,"Unsupported numerology!\n"); LOG_E(PHY,"Unsupported numerology!\n");
exit(-1); exit(-1);
...@@ -600,18 +573,12 @@ void init_openair0(void) { ...@@ -600,18 +573,12 @@ void init_openair0(void) {
} else if(frame_parms[0]->N_RB_DL == 50) { } else if(frame_parms[0]->N_RB_DL == 50) {
openair0_cfg[card].sample_rate=15.36e6; openair0_cfg[card].sample_rate=15.36e6;
openair0_cfg[card].samples_per_frame = 153600; openair0_cfg[card].samples_per_frame = 153600;
openair0_cfg[card].tx_bw = 5e6;
openair0_cfg[card].rx_bw = 5e6;
} else if (frame_parms[0]->N_RB_DL == 25) { } else if (frame_parms[0]->N_RB_DL == 25) {
openair0_cfg[card].sample_rate=7.68e6; openair0_cfg[card].sample_rate=7.68e6;
openair0_cfg[card].samples_per_frame = 76800; openair0_cfg[card].samples_per_frame = 76800;
openair0_cfg[card].tx_bw = 2.5e6;
openair0_cfg[card].rx_bw = 2.5e6;
} else if (frame_parms[0]->N_RB_DL == 6) { } else if (frame_parms[0]->N_RB_DL == 6) {
openair0_cfg[card].sample_rate=1.92e6; openair0_cfg[card].sample_rate=1.92e6;
openair0_cfg[card].samples_per_frame = 19200; openair0_cfg[card].samples_per_frame = 19200;
openair0_cfg[card].tx_bw = 1.5e6;
openair0_cfg[card].rx_bw = 1.5e6;
} }
else { else {
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL); LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL);
...@@ -659,6 +626,27 @@ void init_openair0(void) { ...@@ -659,6 +626,27 @@ void init_openair0(void) {
} }
} }
void init_pdcp(void) {
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
/*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}*/
if (IS_SOFTMODEM_NOKRNMOD)
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
/*if (rlc_module_init() != 0) {
LOG_I(RLC, "Problem at RLC initiation \n");
}
pdcp_layer_init();
nr_ip_over_LTE_DRB_preconfiguration();*/
pdcp_module_init(pdcp_initmask);
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
LOG_I(PDCP, "Before getting out from init_pdcp() \n");
}
int main( int argc, char **argv ) { int main( int argc, char **argv ) {
//uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2; //uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
...@@ -678,6 +666,7 @@ int main( int argc, char **argv ) { ...@@ -678,6 +666,7 @@ int main( int argc, char **argv ) {
logInit(); logInit();
// get options and fill parameters from configuration file // get options and fill parameters from configuration file
get_options (); //Command-line options, enb_properties get_options (); //Command-line options, enb_properties
get_common_options();
#if T_TRACER #if T_TRACER
T_Config_Init(); T_Config_Init();
#endif #endif
...@@ -691,18 +680,22 @@ int main( int argc, char **argv ) { ...@@ -691,18 +680,22 @@ int main( int argc, char **argv ) {
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info); itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
init_opt() ; init_opt() ;
if(IS_SOFTMODEM_NOS1)
init_pdcp();
if (ouput_vcd) { if (ouput_vcd) {
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd"); vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
} }
/*
#ifdef PDCP_USE_NETLINK #ifdef PDCP_USE_NETLINK
netlink_init(); netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES) #if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init(); pdcp_netlink_init();
#endif #endif
#endif #endif
#ifndef PACKAGE_VERSION */
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL" # define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif #endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION); LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
...@@ -728,9 +721,6 @@ int main( int argc, char **argv ) { ...@@ -728,9 +721,6 @@ int main( int argc, char **argv ) {
PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag); PHY_vars_UE_g[0][CC_id] = init_nr_ue_vars(frame_parms[CC_id], 0,abstraction_flag);
UE[CC_id] = PHY_vars_UE_g[0][CC_id]; UE[CC_id] = PHY_vars_UE_g[0][CC_id];
if (phy_test==1)
UE[CC_id]->mac_enabled = 0;
else
UE[CC_id]->mac_enabled = 1; UE[CC_id]->mac_enabled = 1;
UE[CC_id]->UE_scan = UE_scan; UE[CC_id]->UE_scan = UE_scan;
...@@ -740,13 +730,6 @@ int main( int argc, char **argv ) { ...@@ -740,13 +730,6 @@ int main( int argc, char **argv ) {
UE[CC_id]->no_timing_correction = UE_no_timing_correction; UE[CC_id]->no_timing_correction = UE_no_timing_correction;
printf("UE[%d]->mode = %d\n",CC_id,mode); printf("UE[%d]->mode = %d\n",CC_id,mode);
for (uint8_t i=0; i<RX_NB_TH_MAX; i++) {
if (UE[CC_id]->mac_enabled == 1)
UE[CC_id]->pdcch_vars[i][0]->crnti = 0x1234;
else
UE[CC_id]->pdcch_vars[i][0]->crnti = 0x1235;
}
UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off; UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id]; UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
...@@ -777,6 +760,7 @@ int main( int argc, char **argv ) { ...@@ -777,6 +760,7 @@ int main( int argc, char **argv ) {
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset; PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset;
#if defined(OAI_USRP) || defined(OAI_ADRV9371_ZC706) #if defined(OAI_USRP) || defined(OAI_ADRV9371_ZC706)
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = timing_advance; PHY_vars_UE_g[0][CC_id]->hw_timing_advance = timing_advance;
PHY_vars_UE_g[0][CC_id]->timing_advance = timing_advance;
#else #else
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160; PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
#endif #endif
...@@ -784,7 +768,7 @@ int main( int argc, char **argv ) { ...@@ -784,7 +768,7 @@ int main( int argc, char **argv ) {
// wait for end of program // wait for end of program
printf("TYPE <CTRL-C> TO TERMINATE\n"); printf("TYPE <CTRL-C> TO TERMINATE\n");
init_NR_UE(1); init_NR_UE(1,rrc_config_path);
while(true) while(true)
sleep(3600); sleep(3600);
......
#ifndef NR_UESOFTMODEM_H #ifndef NR_UESOFTMODEM_H
#define NR_UESOFTMODEM_H #define NR_UESOFTMODEM_H
#include <executables/nr-softmodem-common.h> #include <executables/nr-softmodem-common.h>
#include <executables/softmodem-common.h>
#include "PHY/defs_nr_UE.h" #include "PHY/defs_nr_UE.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h" #include "SIMULATION/ETH_TRANSPORT/proto.h"
#include <openair2/LAYER2/NR_MAC_gNB/mac_proto.h> #include <openair2/LAYER2/NR_MAC_gNB/mac_proto.h>
...@@ -55,16 +56,16 @@ ...@@ -55,16 +56,16 @@
#define DEFAULT_DLF 2680000000 #define DEFAULT_DLF 2680000000
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */ /* command line parameters common to eNodeB and UE */
/* optname helpstr paramflags XXXptr defXXXval type numelt */ /* optname helpstr paramflags XXXptr defXXXval type numelt */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------------------------------------------------------------------------------*/
#define CMDLINE_PARAMS_DESC_UE { \ #define CMDLINE_PARAMS_DESC_UE { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\ {"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:(char **)&rf_config_file, defstrval:NULL, TYPE_STRING, sizeof(rf_config_file)},\
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \ {"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \ {"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \ {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \ {"clock-source", CONFIG_HLP_EXCCLK, 0, iptr:&clock_source, defintval:0, TYPE_INT, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \ {"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \ {"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \ {"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
...@@ -84,7 +85,8 @@ ...@@ -84,7 +85,8 @@
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \ {"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \ {"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \ {"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0} \ {"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \
} }
...@@ -94,15 +96,12 @@ extern int T_dont_fork; ...@@ -94,15 +96,12 @@ extern int T_dont_fork;
// In nr-ue.c // In nr-ue.c
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
openair0_config_t *openair0_cfg);
extern void fill_ue_band_info(void); extern void fill_ue_band_info(void);
extern void init_NR_UE(int); extern void init_NR_UE(int, char*);
extern void reset_opp_meas(void); extern void reset_opp_meas(void);
extern void print_opp_meas(void); extern void print_opp_meas(void);
void *UE_thread(void *arg); void *UE_thread(void *arg);
PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, PHY_VARS_NR_UE *init_nr_ue_vars(NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
uint8_t UE_id,
uint8_t abstraction_flag);
extern tpool_t *Tpool; extern tpool_t *Tpool;
#endif #endif
#ifndef SOFTMODEM_COMMON_H
#define SOFTMODEM_COMMON_H
typedef struct {
uint64_t optmask;
THREAD_STRUCT thread_struct;
char rf_config_file[1024];
int phy_test;
uint8_t usim_test;
int emulate_rf;
int wait_for_sync; //eNodeB only
int single_thread_flag; //eNodeB only
int chain_offset;
int numerology;
unsigned int start_msc;
uint32_t clock_source;
uint32_t timing_source;
int hw_timing_advance;
uint32_t send_dmrs_sync;
} softmodem_params_t;
#endif
#ifndef THREAD_COMMON_H
#define THREAD_COMMON_H
#include "PHY/defs_common.h"
THREAD_STRUCT thread_struct;
static inline void set_parallel_conf(char *parallel_conf) {
mapping config[]= {
FOREACH_PARALLEL(GENERATE_ENUMTXT)
{NULL,-1}
};
thread_struct.parallel_conf = (PARALLEL_CONF_t)map_str_to_int(config, parallel_conf);
if (thread_struct.parallel_conf == -1 ) {
LOG_E(ENB_APP,"Impossible value: %s\n", parallel_conf);
thread_struct.parallel_conf = PARALLEL_SINGLE_THREAD;
}
printf("[CONFIG] parallel_conf is set to %d\n", thread_struct.parallel_conf);
}
static inline void set_worker_conf(char *worker_conf) {
mapping config[]={
FOREACH_WORKER(GENERATE_ENUMTXT)
{NULL, -1}
};
thread_struct.worker_conf = (WORKER_CONF_t)map_str_to_int(config, worker_conf);
if (thread_struct.worker_conf == -1 ) {
LOG_E(ENB_APP,"Impossible value: %s\n", worker_conf);
thread_struct.worker_conf = WORKER_DISABLE ;
}
printf("[CONFIG] worker_conf is set to %d\n", thread_struct.worker_conf);
}
static inline PARALLEL_CONF_t get_thread_parallel_conf(void) {
return thread_struct.parallel_conf;
}
static inline WORKER_CONF_t get_thread_worker_conf(void) {
return thread_struct.worker_conf;
}
#endif
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#include <netinet/in.h> #include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h"
#include "nfapi_vnf_interface.h" #include "nfapi_vnf_interface.h"
#include "nfapi.h" #include "nfapi.h"
#include "vendor_ext.h" #include "vendor_ext.h"
...@@ -1169,7 +1169,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { ...@@ -1169,7 +1169,7 @@ int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) {
return retval; return retval;
} }
int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_tti_request_t *dl_config_req)
{ {
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
...@@ -1177,9 +1177,9 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req) ...@@ -1177,9 +1177,9 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_config_request_t *dl_config_req)
int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req); int retval = nfapi_vnf_p7_nr_dl_config_req(p7_config, dl_config_req);
dl_config_req->dl_config_request_body.number_dci = 0; dl_config_req->dl_tti_request_body.nPDUs = 0;
dl_config_req->dl_config_request_body.number_pdu = 0; dl_config_req->dl_tti_request_body.nGroup = 0;
dl_config_req->dl_config_request_body.number_pdsch_rnti = 0;
if (retval!=0) { if (retval!=0) {
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval); LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
......
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
#define FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16 #define FAPI_NR_MAX_NUM_ZP_CSI_RS_RESOURCE_PER_SET 16
#define FAPI_NR_MAX_NUM_CANDIDATE_BEAMS 16 #define FAPI_NR_MAX_NUM_CANDIDATE_BEAMS 16
#define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64 #define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64
// Constants Defined in 38.213
#define FAPI_NR_MAX_CORESET_PER_BWP 3
#define FAPI_NR_MAX_SS_PER_CORESET 10
/// RX_IND /// RX_IND
...@@ -41,8 +44,8 @@ ...@@ -41,8 +44,8 @@
#define FAPI_NR_DL_CONFIG_TYPE_DLSCH 0x02 #define FAPI_NR_DL_CONFIG_TYPE_DLSCH 0x02
#define CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01 #define FAPI_NR_CCE_REG_MAPPING_TYPE_INTERLEAVED 0x01
#define CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02 #define FAPI_NR_CCE_REG_MAPPING_TYPE_NON_INTERLEAVED 0x02
#define PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE 0x01 #define PRECODER_GRANULARITY_SAME_AS_REG_BUNDLE 0x01
#define PRECODER_GRANULARITY_ALL_CONTIGUOUS_RBS 0x02 #define PRECODER_GRANULARITY_ALL_CONTIGUOUS_RBS 0x02
...@@ -51,8 +54,8 @@ ...@@ -51,8 +54,8 @@
#define FAPI_NR_UL_CONFIG_LIST_NUM 10 #define FAPI_NR_UL_CONFIG_LIST_NUM 10
#define FAPI_NR_UL_CONFIG_TYPE_PRACH 0x01 #define FAPI_NR_UL_CONFIG_TYPE_PRACH 0x01
#define FAPI_NR_UL_CONFIG_TYPE_UCI 0x02 #define FAPI_NR_UL_CONFIG_TYPE_PUCCH 0x02
#define FAPI_NR_UL_CONFIG_TYPE_ULSCH 0x03 #define FAPI_NR_UL_CONFIG_TYPE_PUSCH 0x03
#define FAPI_NR_UL_CONFIG_TYPE_SRS 0x04 #define FAPI_NR_UL_CONFIG_TYPE_SRS 0x04
......
This diff is collapsed.
...@@ -18,7 +18,8 @@ ...@@ -18,7 +18,8 @@
#define _NFAPI_VNF_INTERFACE_H_ #define _NFAPI_VNF_INTERFACE_H_
#include "nfapi_interface.h" #include "nfapi_interface.h"
#include "nfapi_nr_interface.h" #include "nfapi_nr_interface_scf.h"
#include "debug.h" #include "debug.h"
#include "netinet/in.h" #include "netinet/in.h"
...@@ -938,7 +939,7 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id); ...@@ -938,7 +939,7 @@ int nfapi_vnf_p7_del_pnf(nfapi_vnf_p7_config_t* config, int phy_id);
* may be released after this function call has returned or at a later pointer * may be released after this function call has returned or at a later pointer
*/ */
int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req); int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_request_t* req);
int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_config_request_t* req); int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req);
/*! Send the UL_CONFIG.request /*! Send the UL_CONFIG.request
* \param config A pointer to the vnf p7 configuration * \param config A pointer to the vnf p7 configuration
......
...@@ -482,7 +482,7 @@ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_re ...@@ -482,7 +482,7 @@ int nfapi_vnf_p7_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_dl_config_re
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header); return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
} }
int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_config_request_t* req) int nfapi_vnf_p7_nr_dl_config_req(nfapi_vnf_p7_config_t* config, nfapi_nr_dl_tti_request_t* req)
{ {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s(config:%p req:%p)\n", __FUNCTION__, config, req);
......
This diff is collapsed.
This diff is collapsed.
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
#include "SIMULATION/TOOLS/sim.h"
#include <getopt.h> #include <getopt.h>
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
//#define DEBUG_SMALLBLOCKTEST //#define DEBUG_SMALLBLOCKTEST
signed char quantize(double D, double x, unsigned char B) RAN_CONTEXT_t RC;
{ PHY_VARS_UE ***PHY_vars_UE_g;
double qxd; uint16_t NB_UE_INST = 1;
short maxlev;
qxd = floor(x/D);
maxlev = 1<<(B-1);//(char)(pow(2,B-1));
if (qxd <= -maxlev)
qxd = -maxlev;
else if (qxd >= maxlev)
qxd = maxlev-1;
return((char)qxd);
}
int main(int argc, char *argv[]) {
int main(int argc, char *argv[])
{
time_stats_t timeEncoder,timeDecoder; time_stats_t timeEncoder,timeDecoder;
opp_enabled=1; opp_enabled=1;
cpu_freq_GHz = get_cpu_freq_GHz(); cpu_freq_GHz = get_cpu_freq_GHz();
......
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.
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.
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.
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.
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.
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.
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.
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.
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.
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