Commit fdc78bfb authored by tyhsu's avatar tyhsu

v1. ru in gpu

parent d252696b

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

......@@ -44,7 +44,7 @@ pipeline {
disableConcurrentBuilds()
timestamps()
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-Mono-FDD-Band13-X2-HO"])
ansiColor('xterm')
}
......@@ -57,9 +57,6 @@ pipeline {
echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
def allParametersPresent = true
if (env.TESTPLATFORM_OWNER) {
echo "Platform is ${env.TESTPLATFORM_OWNER}"
}
if (params.RedHatRemoteServer == null) {
allParametersPresent = false
......@@ -365,7 +362,7 @@ pipeline {
stage ("Test physical simulators") {
steps {
script {
timeout (time: 90, unit: 'MINUTES') {
timeout (time: 20, unit: 'MINUTES') {
try {
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}"
......@@ -618,25 +615,6 @@ pipeline {
}
}
}
stage ("Test OAI NR UE - OAI gNB - TDD - Band 78 - N300") {
steps {
script {
triggerSlaveJob ('gNB-nrUE-MONO-TDD-Band78-N300', 'Test-TDD-Band78-gNB-NR-UE')
}
}
post {
always {
script {
finalizeSlaveJob('gNB-nrUE-MONO-TDD-Band78-N300')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
}
post {
always {
......
......@@ -51,10 +51,14 @@ def eNB_Repository
def eNB_Branch
def eNB_CommitID
def eNB_AllowMergeRequestProcess = false
def eNB_TargetBranch = "develop-nr"
def GIT_COMMIT_AUTHOR
def eNB_TargetBranch
def PROJECT_NAME = "test-boris"
def GIT_COMMIT_AUTHORi
def GIT_COMMIT_EMAIL
def testStageName
// Reversing list because pop() will take the last (right-most) element
//def modeList = ['TesteNB', 'TestUE', 'TesteNB'].reverse()
// Global Parameters not to break the main.py command line and code.
def ADB_IPAddress = "none"
def ADB_Username = "none"
......@@ -197,12 +201,12 @@ pipeline {
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password'],
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password']
]) {
sh "python3 main.py --mode=InitiateHtml --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} ${mainPythonAllXmlFiles}"
sh "python3 main.py --mode=InitiateHtml --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --ADBIPAddress=${ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} ${mainPythonAllXmlFiles}"
String[] myXmlTestSuite = testXMLFile.split("\\r?\\n")
for (xmlFile in myXmlTestSuite) {
if (fileExists(xmlFile)) {
try {
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath} --UEIPAddress=${params.eNB_IPAddress} --UEUserName=${eNB_Username} --UEPassword=${eNB_Password} --UESourceCodePath=${params.eNB_SourceCodePath} --eNBRepository=${eNB_Repository} --eNBBranch=${eNB_Branch} --eNBCommitID=${eNB_CommitID} --eNB_AllowMerge=${eNB_AllowMergeRequestProcess} --eNBTargetBranch=${eNB_TargetBranch} --ADBIPAddress=${ADB_IPAddress} --ADBUserName=${ADB_Username} --ADBPassword=${ADB_Password} --EPCIPAddress=${EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCSourceCodePath=/tmp/${EPC_Username} --EPCType=ltebox --XMLTestFile=${xmlFile}"
sh "python3 main.py --mode=TesteNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --UEIPAddress=${params.eNB_IPAddress} --UEUserName=${eNB_Username} --UEPassword=${eNB_Password} --eNBBranch=${eNB_Branch} --eNBSourceCodePath=${params.eNB_SourceCodePath} --UESourceCodePath=${params.eNB_SourceCodePath} --eNBRepository=${eNB_Repository} --eNBCommitID=${eNB_CommitID} --ADBIPAddress=${ADB_IPAddress} --EPCIPAddress=${EPC_IPAddress} --XMLTestFile=${xmlFile}"
} catch (Exception e) {
currentBuild.result = 'FAILURE'
buildStageStatus = false
......
......@@ -54,10 +54,6 @@ def eNB_CommitID
def eNB_AllowMergeRequestProcess = false
def eNB_TargetBranch
def doEpcLogCollection = true
pipeline {
agent {
label pythonExecutor
......@@ -65,7 +61,7 @@ pipeline {
options {
disableConcurrentBuilds()
ansiColor('xterm')
lock(extra: [[resource: oaiUEResource]], resource: ciSmartPhoneResource)
lock(extra: [[resource: ciSmartPhoneResource]], resource: ciSmartPhoneResource)
}
stages {
......@@ -143,11 +139,6 @@ pipeline {
if (params.EPC_IPAddress == null) {
allParametersPresent = false
} else {
if (params.EPC_IPAddress == "none") {
doEpcLogCollection = false
echo "No EPC collections (ping/iperf/hss/mme/spgw)"
}
}
if (params.EPC_Type == null) {
allParametersPresent = false
......@@ -176,8 +167,8 @@ pipeline {
sh "git checkout -f ${eNB_CommitID}"
}
} else {
currentBuild.result = 'ABORTED'
error('Stopping early because some parameters are missing')
echo "Some parameters are missing"
sh "./ci-scripts/fail.sh"
}
}
}
......@@ -308,9 +299,6 @@ pipeline {
}
}
stage('Log Collection (Ping)') {
when {
expression {doEpcLogCollection}
}
steps {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
......@@ -329,9 +317,6 @@ pipeline {
}
}
stage('Log Collection (Iperf)') {
when {
expression {doEpcLogCollection}
}
steps {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
......@@ -350,9 +335,6 @@ pipeline {
}
}
stage('Log Collection (SPGW)') {
when {
expression {doEpcLogCollection}
}
steps {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
......@@ -371,9 +353,6 @@ pipeline {
}
}
stage('Log Collection (MME)') {
when {
expression {doEpcLogCollection}
}
steps {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
......@@ -392,9 +371,6 @@ pipeline {
}
}
stage('Log Collection (HSS)') {
when {
expression {doEpcLogCollection}
}
steps {
withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
......
......@@ -44,7 +44,7 @@ function build_on_vm {
STATUS=1
return
fi
if [[ ! -f /etc/apt/apt.conf.d/01proxy ]] && [[ "$OPTIONAL_APTCACHER" != "true" ]]
if [ ! -f /etc/apt/apt.conf.d/01proxy ]
then
echo "Missing /etc/apt/apt.conf.d/01proxy file!"
echo "Is apt-cacher installed and configured?"
......@@ -96,14 +96,13 @@ function build_on_vm {
else
scp -o StrictHostKeyChecking=no $JENKINS_WKSP/localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
fi
[ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
echo "############################################################"
echo "Running install and build script on VM ($VM_NAME)"
echo "############################################################"
echo "[ -f 01proxy ] && sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
echo "touch /home/ubuntu/.hushlogin" >> $VM_CMDS
echo "git config --global https.postBuffer 123289600" >> $VM_CMDS
if [[ "$VM_NAME" == *"-cppcheck"* ]]
then
if [ $DAEMON -eq 0 ]
......@@ -180,7 +179,7 @@ function build_on_vm {
echo "echo \"./tools/install_dependencies \"" >> $VM_CMDS
echo "./tools/install_dependencies > cmake_targets/log/install-build.txt 2>&1" >> $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.Rel14.txt 2>&1" >> $VM_CMDS
fi
if [[ "$VM_NAME" != *"-cppcheck"* ]] && [[ "$VM_NAME" != *"-flexran-rtc"* ]]
then
......
......@@ -233,7 +233,6 @@ eNBs =
#pdsch_maxNumRepetitionCEmodeB_r13 = "r384"; # NULL - 2
pusch_maxNumRepetitionCEmodeA_r13 = "r8"; #0
pusch_repetitionLevelCEmodeA_r13 = "l1";
#pusch_maxNumRepetitionCEmodeB_r13 = "r768"; #4 #NULL
#pusch_HoppingOffset_v1310 = 5; #NULL
......
......@@ -83,43 +83,43 @@ You can get the list of variant specific variables specifying the variant argume
VM_NAME=ci-flexran-rtc ARCHIVES_LOC=flexran
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=1 BUILD_OPTIONS="cmake . && make -j2"
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant enb-usrp OR -v1 ( build and test )
VM_NAME=ci-enb-usrp ARCHIVES_LOC=enb_usrp
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS="--eNB -w USRP --mu"
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant l1-sim OR -v20 ( test )
VM_NAME=ci-l1-sim ARCHIVES_LOC=l1_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant rf-sim OR -v21 ( test )
VM_NAME=ci-rf-sim ARCHIVES_LOC=rf_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant l2-sim OR -v22 ( test )
VM_NAME=ci-l2-sim ARCHIVES_LOC=l2_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant basic-sim OR -v2 ( build and test )
VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim
VM_MEMORY=8192 VM_CPU=4
NB_PATTERN_FILES=13 BUILD_OPTIONS="--eNB --UE"
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant phy-sim OR -v3 ( build and test )
VM_NAME=ci-phy-sim ARCHIVES_LOC=phy_sim
VM_MEMORY=2048 VM_CPU=4
NB_PATTERN_FILES=3 BUILD_OPTIONS="--phy_simulators"
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant cppcheck OR -v4 ( build and test )
VM_NAME=ci-cppcheck ARCHIVES_LOC=cppcheck
......@@ -131,13 +131,13 @@ You can get the list of variant specific variables specifying the variant argume
VM_NAME=ci-enb-ethernet ARCHIVES_LOC=enb_eth
VM_MEMORY=4096 VM_CPU=4
NB_PATTERN_FILES=8 BUILD_OPTIONS="--eNB"
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
--variant ue-ethernet OR -v8 ( build and test )
VM_NAME=ci-ue-ethernet ARCHIVES_LOC=ue_eth
VM_MEMORY=4096 VM_CPU=4
NB_PATTERN_FILES=12 BUILD_OPTIONS="--UE"
LOG_PATTERN=.Rel15.txt
LOG_PATTERN=.Rel14.txt
```
......
This diff is collapsed.
......@@ -140,25 +140,10 @@ function command_options_usage {
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 {
declare -A HELP_VAR
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["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:"
for i in ${AUTHORIZED_VAR[@]}; do printf "%20s : %s\n" "$i" "${HELP_VAR[$i]}" ;done
}
......@@ -192,7 +177,7 @@ function variant__v4__cppcheck {
VM_MEMORY=4096
LOG_PATTERN=cppcheck.xml
NB_PATTERN_FILES=1
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"
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"
}
function variant__v5__gnb_usrp {
......@@ -343,7 +328,6 @@ function check_setvar {
exit 1
}
platform_set
MY_DIR=$(dirname $(readlink -f $0))
. $MY_DIR/createVM.sh
. $MY_DIR/buildOnVM.sh
......@@ -353,7 +337,6 @@ MY_DIR=$(dirname $(readlink -f $0))
. $MY_DIR/reportBuildLocally.sh
. $MY_DIR/reportTestLocally.sh
if [ $# -lt 1 ]
then
echo "Syntax Error: too few arguments"
......@@ -365,11 +348,10 @@ fi
VM_TEMPLATE=ci-
# look for ASN1 release in cmake directives
# look for default ASN1 release in cmake directives
# It will be the release used when building
ASN1VEROPT=( `grep "set (RRC_ASN1_VERSION" cmake_targets/CMakeLists.txt` )
ASN1VER=${ASN1VEROPT[2]//\"}
ASN1VER=${ASN1VER//)}
ASN1VEROPT=( `grep "add_list2_option(RRC_ASN1_VERSION" cmake_targets/CMakeLists.txt` )
ASN1VER=${ASN1VEROPT[1]//\"}
unset ASN1VEROPT
# variable to identify and store the command (build, create ...)
......@@ -471,7 +453,7 @@ RUN_OPTIONS="none"
# list of variables that can be set via the --setvar option
AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL OPTIONAL_APTCACHER TESTPLATFORM_OWNER")
AUTHORIZED_VAR=("VM_OSREL RUN_EXPERIMENTAL")
#variables to set which OS VM should use
......
......@@ -476,7 +476,7 @@ function install_epc_on_vm {
local LOC_EPC_VM_IP_ADDR=`uvt-kvm ip $LOC_EPC_VM_NAME`
echo "$LOC_EPC_VM_NAME has for IP addr = $LOC_EPC_VM_IP_ADDR"
[ -f /etc/apt/apt.conf.d/01proxy ] && scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$LOC_EPC_VM_IP_ADDR:/home/ubuntu
# ltebox specific actions (install and start)
LTE_BOX_TO_INSTALL=1
......@@ -500,7 +500,7 @@ function install_epc_on_vm {
echo "############################################################"
echo "Install EPC on EPC VM ($LOC_EPC_VM_NAME)"
echo "############################################################"
echo "sudo [ -f 01proxy ] && cp 01proxy /etc/apt/apt.conf.d/" > $LOC_EPC_VM_CMDS
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $LOC_EPC_VM_CMDS
echo "touch /home/ubuntu/.hushlogin" >> $LOC_EPC_VM_CMDS
echo "echo \"sudo apt-get --yes --quiet install zip openjdk-8-jre libconfuse-dev libreadline-dev liblog4c-dev libgcrypt-dev libsctp-dev python2.7 python2.7-dev daemon iperf\"" >> $LOC_EPC_VM_CMDS
echo "sudo apt-get update > zip-install.txt 2>&1" >> $LOC_EPC_VM_CMDS
......
......@@ -168,9 +168,6 @@ function check_on_vm_build {
if [[ "$VM_NAME" == *"-cppcheck"* ]]
then
echo "COMMAND: cppcheck $BUILD_OPTIONS . 2> cppcheck.xml" > $ARCHIVES_LOC/build_final_status.log
elif [[ "$VM_NAME" == *"-flexran-rtc"* ]]
then
echo "COMMAND: $BUILD_OPTIONS" > $ARCHIVES_LOC/build_final_status.log
else
echo "COMMAND: build_oai -I $BUILD_OPTIONS" > $ARCHIVES_LOC/build_final_status.log
fi
......
......@@ -25,23 +25,10 @@
<htmlTabName>EPC-Start</htmlTabName>
<htmlTabIcon>log-in</htmlTabIcon>
<TestCaseRequestedList>
010101 090101
050101 060101 070101
</TestCaseRequestedList>
<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">
<class>Initialize_HSS</class>
<desc>Initialize HSS</desc>
......
......@@ -24,7 +24,7 @@
<htmlTabRef>test-05-tm1-nos1-tunnel</htmlTabRef>
<htmlTabName>Test-05MHz-TM1-noS1-tunnel</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>4</repeatCount>
<repeatCount>2</repeatCount>
<TestCaseRequestedList>
030201 090109
030101 000001 090101 000002 040501 040502 000001 040601 040602 040641 040642 000001 090109 030201
......
......@@ -25,16 +25,10 @@
<htmlTabName>EPC-Closure</htmlTabName>
<htmlTabIcon>log-out</htmlTabIcon>
<TestCaseRequestedList>
040202
050201 060201 070201
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="040202">
<class>Terminate_CatM_module</class>
<desc>Terminate CAT-M Module</desc>
</testCase>
<testCase id="050201">
<class>Terminate_HSS</class>
<desc>Terminate HSS</desc>
......
......@@ -24,7 +24,6 @@
<htmlTabRef>test-10-tm1</htmlTabRef>
<htmlTabName>Test-10MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>2</repeatCount>
<TestCaseRequestedList>
030201
040102
......
......@@ -24,7 +24,6 @@
<htmlTabRef>test-20-tm1</htmlTabRef>
<htmlTabName>Test-20MHz-TM1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>4</repeatCount>
<TestCaseRequestedList>
030201
040101
......
......@@ -21,19 +21,18 @@
-->
<testCaseList>
<htmlTabRef>run-oai-gnb-nr-ue</htmlTabRef>
<htmlTabName>Run-gNB-and-NR-UE</htmlTabName>
<htmlTabRef>run-OAI-gNB-NR-UE-USRP</htmlTabRef>
<htmlTabName>run OAI gNB and OAI NR UE USRP</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>4</repeatCount>
<TestCaseRequestedList>
090101 000001 090102 000002 090108 090109
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="090101">
<class>Initialize_eNB</class>
<class>Initialize_OAI_eNB</class>
<desc>Initialize gNB USRP</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf</Initialize_eNB_args>
<Initialize_OAI_eNB_args>-O ../../../ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf</Initialize_OAI_eNB_args>
<air_interface>NR</air_interface>
</testCase>
......
......@@ -20,7 +20,6 @@
contact@openairinterface.org
-->
<testCaseList>
<TestCaseRequestedList>010101 050101 060101 070101 030101 030201 050201 070201 060201</TestCaseRequestedList>
<TestCaseExclusionList>010102 030102 030103 030104 030105 030106</TestCaseExclusionList>
......
......@@ -26,7 +26,6 @@
<htmlTabIcon>tasks</htmlTabIcon>
<TestCaseRequestedList>
030201 030202
050202
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
......@@ -44,9 +43,4 @@
<eNB_serverId>1</eNB_serverId>
</testCase>
<testCase id="050202">
<class>Terminate_FlexranCtrl</class>
<desc>Stopping Flexran Controller</desc>
</testCase>
</testCaseList>
This diff is collapsed.
......@@ -47,6 +47,7 @@ VCD_TIMING="False"
DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False
REL="Rel15"
NR_REL="NR_Rel15"
HW="None"
TP="None"
EPC=0
......@@ -106,6 +107,10 @@ Options
Makes test program for haw latency tests
-a | --agent
Enables agent for software-defined control of the eNB
-r | --3gpp-release
default is Rel14,
Rel8 limits the implementation to 3GPP Release 8 version
Rel10 limits the implementation to 3GPP Release 10 version
-w | --hardware
EXMIMO, USRP, BLADERF, LMSSDR, IRIS, ADRV9371_ZC706, SIMU, None (Default)
Adds this RF board support (in external packages installation and in compilation)
......@@ -149,7 +154,7 @@ Options
--build-eclipse
Build eclipse project files. Paths are auto corrected by fixprj.sh
--build-lib <libraries>
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES or \"all\"
Build optional shared library, <libraries> can be one or several of $OPTIONAL_LIBRARIES
--usrp-recplay
Build for I/Q record-playback modes
-h | --help
......@@ -231,6 +236,10 @@ function main() {
--UE-gen-nvram)
gen_nvram_path=$(readlink -f $2)
shift 2;;
-r | --3gpp-release)
REL=$2
echo_info "Setting release to: $REL"
shift 2;;
-w | --hardware)
# Use OAI_USRP as the key word USRP is used inside UHD driver
case "$2" in
......@@ -346,21 +355,16 @@ function main() {
shift 1;;
--build-lib)
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
if [ "$alib" = "$oklib" ] ; then
BUILD_OPTLIB="$BUILD_OPTLIB $alib"
echo_info "Enabling build of lib${alib}.so"
fi
done
if [ "$alib" = "$oklib" ] ; then
BUILD_OPTLIB="$BUILD_OPTLIB $alib"
echo_info "Enabling build of lib${alib}.so"
fi
done
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
fi
done
if [ "${BUILD_OPTLIB## }" != "$2" ] ; then
echo_fatal "Unknown optional library in $2, valid libraries are $OPTIONAL_LIBRARIES"
fi
shift 2;;
--usrp-recplay)
......@@ -547,6 +551,8 @@ function main() {
# echo "set ( PHY_TX_THREAD $UE_EXPANSION )" >> $cmake_file
echo "set ( PRE_SCD_THREAD $UE_EXPANSION )" >> $cmake_file
echo "set ( UESIM_EXPANSION $UESIM_EXPANSION )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( NR_RRC_ASN1_VERSION \"${NR_REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
......@@ -585,8 +591,7 @@ function main() {
nr-uesoftmodem $dbin/nr-uesoftmodem.$REL
fi
# mandatory shared libraries common to UE and (e/g)NB
# mandatory shared lib
compilations \
$build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
......@@ -870,6 +875,7 @@ function main() {
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to ETHERNET transport"
fi
###################
# Doxygen Support #
......
......@@ -11,14 +11,5 @@ if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
mkdir -p "$GENERATED_FULL_DIR"
asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u
if [ "$ASN1C_PREFIX" = "X2AP_" ] ; then
sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReport-Item.c
sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReport-Item.c
fi
if [ "$ASN1C_PREFIX" = "S1AP_" ] ; then
sed -i 's/18446744073709551615))/18446744073709551615U))/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
sed -i 's/18446744073709551615 }/18446744073709551615U }/g' "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}E-RABUsageReportItem.c
fi
fi
touch $done_flag
touch $done_flag
\ No newline at end of file
## config module management
```c
configmodule_interface_t *load_configmodule(int argc, char **argv, uint32_t initflags)
```
......@@ -16,17 +14,23 @@ void End_configmodule(void)
* Free memory which has been allocated by the configuration module since its initialization.
* Possibly calls the `config_<config source>_end` function
## Retrieving parameter's values
```c
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
* Calls the `config_<config source>_get` 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 `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)
* `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
- `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
* `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
......@@ -40,9 +44,6 @@ 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.
* 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 home](../../config.md)
......@@ -5,7 +5,6 @@ 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 |
| `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 |
| `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 |
......@@ -13,22 +12,6 @@ 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 |
| `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
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.
......
......@@ -167,8 +167,8 @@ int config_check_unknown_cmdlineopt(char *prefix) {
char testprefix[CONFIG_MAXOPTLENGTH];
int finalcheck = 0;
memset(testprefix,0,sizeof(testprefix));
memset(testprefix,0,sizeof(testprefix));
memset(testprefix,0,sizeof(testprefix));
if (prefix != NULL) {
if (strcmp(prefix,CONFIG_CHECKALLSECTIONS) == 0)
finalcheck = 1;
......@@ -253,9 +253,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
}
if ( ((strlen(oneargv) == 2) && (strcmp(oneargv + 1,cfgpath) == 0)) || /* short option, one "-" */
((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 )) ) {
((strlen(oneargv) > 2) && (strcmp(oneargv + 2,cfgpath ) == 0 )) ) {
char *valptr=NULL;
int ret;
config_get_if()->argv_info[i] |= CONFIG_CMDLINEOPT_PROCESSED;
......
......@@ -45,7 +45,7 @@
#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_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*/
#define PARAMFLAG_MALLOCINCONFIG (1 << 15) // parameter allocated in config module
......
......@@ -172,7 +172,7 @@ int config_get_processedint(paramdef_t *cfgoption) {
return ret;
}
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++) {
printf(" %s%s: %s",
......@@ -204,16 +204,6 @@ int config_execcheck(paramdef_t *params, int numparams, char *prefix) {
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 ret= -1;
......@@ -448,7 +438,7 @@ int config_setdefault_intlist(paramdef_t *cfgoptions, char *prefix) {
status=1;
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]);
}
}
......@@ -462,7 +452,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
if( ((cfgoptions->paramflags & PARAMFLAG_MANDATORY) == 0)) {
*(cfgoptions->dblptr)=cfgoptions->defdblval;
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;
......@@ -470,7 +460,7 @@ int config_setdefault_double(paramdef_t *cfgoptions, char *prefix) {
int config_assign_ipv4addr(paramdef_t *cfgoptions, char *ipv4addr) {
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) {
printf_params("[CONFIG] %s: %s\n",cfgoptions->optname, ipv4addr);
......
......@@ -39,7 +39,6 @@ extern "C"
{
#endif
/* utility functions to ease usage of config module structures */
#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_GETP(P) ( (config_get_if()==NULL) ? NULL : config_get_if()->cfgP[P] )
......@@ -47,8 +46,6 @@ extern "C"
#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_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 */
extern configmodule_interface_t *config_get_if(void);
extern char *config_check_valptr(paramdef_t *cfgoptions, char **ptr, int length) ;
......
......@@ -232,7 +232,7 @@ int write_file_matlab(const char *fname,
void log_getconfig(log_t *g_log)
{
char *gloglevel = NULL;
int consolelog = 0;
int consolelog ;
paramdef_t logparams_defaults[] = LOG_GLOBALPARAMS_DESC;
paramdef_t logparams_level[MAX_LOG_PREDEF_COMPONENTS];
paramdef_t logparams_logfile[MAX_LOG_PREDEF_COMPONENTS];
......
......@@ -25,6 +25,7 @@
* \date 2009 - 2014
* \version 0.5
* @ingroup util
*/
#ifndef __LOG_H__
......@@ -296,7 +297,7 @@ extern "C" {
# include "log_if.h"
/*----------------------------------------------------------------------------*/
int logInit (void);
int isLogInitDone (void);
int isLogInitDone (void);
void logRecord_mt(const char *file, const char *func, int line,int comp, int level, const char *format, ...) __attribute__ ((format (printf, 6, 7)));
void vlogRecord_mt(const char *file, const char *func, int line, int comp, int level, const char *format, va_list args );
void log_dump(int component, void *buffer, int buffsize,int datatype, const char *format, ... );
......@@ -362,14 +363,14 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOG globalconfiguration parameters */
/* optname help paramflags XXXptr defXXXval type numelt */
/*-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* LOG globalconfiguration parameters */
/* optname help paramflags XXXptr defXXXval type numelt */
/*------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#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_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_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_OPTIONS, LOG_CONFIG_HELP_OPTIONS, 0, strlistptr:NULL, defstrlistval:NULL, TYPE_STRINGLIST,0} \
}
#define LOG_OPTIONS_IDX 2
......
......@@ -351,7 +351,6 @@ const char* eurecomFunctionsNames[] = {
"phy_procedures_ue_tx",
"phy_procedures_ue_rx",
"phy_procedures_ue_tx_ulsch_uespec",
"phy_procedures_nr_ue_tx_ulsch_uespec",
"phy_procedures_ue_tx_pucch",
"phy_procedures_ue_tx_ulsch_common",
"phy_procedures_ue_tx_prach",
......@@ -375,11 +374,6 @@ const char* eurecomFunctionsNames[] = {
"dlsch_decoding5",
"dlsch_decoding6",
"dlsch_decoding7",
"dlsch_segmentation",
"dlsch_deinterleaving",
"dlsch_rate_matching",
"dlsch_ldpc",
"dlsch_compine_seg",
"dlsch_pmch_decoding",
"rx_pdcch",
"dci_decoding",
......@@ -510,7 +504,6 @@ const char* eurecomFunctionsNames[] = {
"pdcch_interleaving",
"pdcch_tx",
/*NR softmodem signal*/
"wakeup_txfh",
"gNB_thread_rxtx0",
"gNB_thread_rxtx1"
};
......@@ -631,10 +624,6 @@ inline static uint32_t vcd_get_write_index(void)
return write_index;
}
#if defined(ENABLE_ITTI)
int signal_mask(void);
#endif
void *vcd_dumper_thread_rt(void *args)
{
vcd_queue_user_data_t *data;
......@@ -643,7 +632,7 @@ void *vcd_dumper_thread_rt(void *args)
uint32_t data_ready_wait;
# if defined(ENABLE_ITTI)
return 0; //signal_mask(); //function defined at common/utils/ocp_itti/intertask_interface.cpp
signal_mask();
# endif
sched_param.sched_priority = sched_get_priority_min(SCHED_FIFO) + 1;
......
......@@ -332,7 +332,6 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_NR_UE_TX_ULSCH_UESPEC,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PUCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_ULSCH_COMMON,
VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH,
......@@ -356,11 +355,6 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING5,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING6,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DECODING7,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_SEGMENTATION,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG,
VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_PMCH_DECODING,
VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH,
VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING,
......@@ -502,7 +496,6 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_PDCCH_TX,
/*NR softmodem signal*/
VCD_SIGNAL_DUMPER_FUNCTIONS_WAKEUP_TXFH,
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX0,
VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PROC_RXTX1,
......@@ -564,20 +557,12 @@ extern int ouput_vcd;
#include "T.h"
#define VCD_SIGNAL_DUMPER_INIT(x) /* nothing */
#define VCD_SIGNAL_DUMPER_CLOSE() /* nothing */
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() /* nothing */
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val) T_VCD_VARIABLE(var, val)
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val) T_VCD_FUNCTION(var, val)
#else
#else /* T_TRACER */
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT) vcd_signal_dumper_init(aRgUmEnT)
#define VCD_SIGNAL_DUMPER_CLOSE() vcd_signal_dumper_close()
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() vcd_signal_dumper_create_header()
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_variable_by_name(vAr1,vAr2)
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_function_by_name(vAr1,vAr2)
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(var, val)
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(var, val)
#endif /* T_TRACER */
......
......@@ -73,7 +73,7 @@ typedef struct {
} T_cache_t;
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS (245)
#define VCD_NUM_FUNCTIONS (238)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (186)
......
......@@ -2533,11 +2533,6 @@ ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX_ULSCH_UESPEC
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_ue_tx_ulsch_uespec
ID = VCD_FUNCTION_PHY_PROCEDURES_NR_UE_TX_ULSCH_UESPEC
DESC = VCD function PHY_PROCEDURES_NR_UE_TX_ULSCH_UESPEC
GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = phy_procedures_nr_ue_tx_ulsch_uespec
ID = VCD_FUNCTION_PHY_PROCEDURES_UE_TX_PUCCH
DESC = VCD function PHY_PROCEDURES_UE_TX_PUCCH
GROUP = ALL:VCD:UE:VCD_FUNCTION
......@@ -2653,31 +2648,6 @@ ID = VCD_FUNCTION_DLSCH_DECODING7
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = dlsch_decoding7
ID = VCD_FUNCTION_DLSCH_SEGMENTATION
DESC = VCD function DLSCH_SEGMENTATION
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = dlsch_segmentation
ID = VCD_FUNCTION_DLSCH_DEINTERLEAVING
DESC = VCD function DLSCH_DEINTERLEAVING
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = dlsch_deinterleaving
ID = VCD_FUNCTION_DLSCH_RATE_MATCHING
DESC = VCD function DLSCH_RATE_MATCHING
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = dlsch_rate_matching
ID = VCD_FUNCTION_DLSCH_LDPC
DESC = VCD function DLSCH_LDPC
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = dlsch_ldpc
ID = VCD_FUNCTION_DLSCH_COMBINE_SEG
DESC = VCD function DLSCH_COMBINE_SEG
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = dlsch_compine_seg
ID = VCD_FUNCTION_DLSCH_PMCH_DECODING
DESC = VCD function DLSCH_PMCH_DECODING
GROUP = ALL:VCD:ENB:VCD_FUNCTION
......@@ -3270,11 +3240,6 @@ ID = VCD_FUNCTION_PDCCH_TX
VCD_NAME = pdcch_tx
#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
DESC = VCD function gNB_PROC_RXTX0
GROUP = ALL:VCD:ENB:VCD_FUNCTION
......
......@@ -11,11 +11,11 @@
#include <common/utils/system.h>
typedef struct timer_elm_s {
timer_type_t type; ///< Timer type
long instance;
timer_type_t type; ///< Timer type
long instance;
long duration;
uint64_t timeout;
void *timer_arg; ///< Optional argument that will be passed when timer expires
void *timer_arg; ///< Optional argument that will be passed when timer expires
} timer_elm_t ;
typedef struct task_list_s {
......
......@@ -25,7 +25,7 @@ typedef struct {
typedef struct {
uint32_t interval_sec;
uint32_t interval_us;
long task_id;
long task_id;
int32_t instance;
timer_type_t type;
void *timer_arg;
......@@ -33,7 +33,7 @@ typedef struct {
} timer_create_t;
typedef struct {
long task_id;
long task_id;
long timer_id;
} timer_delete_t;
......@@ -536,7 +536,6 @@ int timer_setup(
int timer_remove(long timer_id);
#define timer_stop timer_remove
int signal_handle(int *end);
int signal_mask(void);
#ifdef __cplusplus
}
......
......@@ -123,7 +123,7 @@ void client_printf(const char *message, ...) {
if (telnetparams.new_socket > 0) {
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 {
vprintf(message, va_args);
}
......@@ -475,7 +475,7 @@ int process_command(char *buf) {
memset(cmdb,0,sizeof(cmdb));
bufbck=strdup(buf);
rt=CMDSTATUS_NOTFOUND;
j = sscanf(buf,"%19s %19s %19[^\t\n]",modulename,cmd,cmdb);
j = sscanf(buf,"%9s %9s %9[^\t\n]",modulename,cmd,cmdb);
if (telnetparams.telnetdbg > 0)
printf("process_command: %i words, module=%s cmd=%s, parameters= %s\n",j,modulename,cmd,cmdb);
......@@ -543,7 +543,7 @@ void run_telnetsrv(void) {
char buf[TELNET_MAX_MSGLENGTH];
struct sockaddr cli_addr;
unsigned int cli_len = sizeof(cli_addr);
int readc, filled;
int readc , filled;
int status;
int optval = 1;
pthread_setname_np(pthread_self(), "telnet");
......@@ -604,7 +604,7 @@ void run_telnetsrv(void) {
}
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[1] == '!') {
......
......@@ -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 `-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.
- 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.
- `--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
......
......@@ -99,10 +99,10 @@
#if defined(ENABLE_ITTI)
extern volatile int start_gNB;
extern volatile int start_UE;
extern volatile int start_gNB;
extern volatile int start_UE;
#endif
extern volatile int oai_exit;
extern volatile int oai_exit;
extern openair0_config_t openair0_cfg[MAX_CARDS];
......@@ -133,14 +133,13 @@ extern double cpuf;
void init_gNB(int,int);
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_tx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, uint64_t timestamp_tx);
#include "executables/thread-common.h"
//extern PARALLEL_CONF_t get_thread_parallel_conf(void);
//extern WORKER_CONF_t get_thread_worker_conf(void);
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);
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 void oai_subframe_ind(uint16_t sfn, uint16_t sf);
......@@ -150,7 +149,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)
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);
// *******************************************************************
......@@ -185,20 +184,17 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
// ****************************************
// Common RX procedures subframe n
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 (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);
}
// UE-specific RX processing for subframe n
if (nfapi_mode == 0 || nfapi_mode == 1) */
if (slot_rx == NR_UPLINK_SLOT || gNB->frame_parms.frame_type == FDD) {
nfapi_nr_ul_config_ulsch_pdu_rel15_t *ulsch_pdu_rel15 = &gNB->ulsch[1][0]->harq_processes[0]->ulsch_pdu.ulsch_pdu_rel15;
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx, ulsch_pdu_rel15->start_symbol, ulsch_pdu_rel15->start_symbol + ulsch_pdu_rel15->number_symbols);
}
/*
// if this is IF5 or 3GPP_gNB
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);
}
// UE-specific RX processing for subframe n
if (nfapi_mode == 0 || nfapi_mode == 1) {
phy_procedures_gNB_uespec_RX(gNB, proc, no_relay );
}
*/
pthread_mutex_lock(&gNB->UL_INFO_mutex);
gNB->UL_INFO.frame = frame_rx;
gNB->UL_INFO.slot = slot_rx;
......@@ -292,8 +288,6 @@ 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_FRAME_NUMBER_TX1_GNB,frame_tx);
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 );
L1_proc_tx->instance_cnt = -1;
......@@ -305,7 +299,6 @@ static void *gNB_L1_thread_tx(void *param) {
pthread_mutex_unlock(&L1_proc_tx->mutex);
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 );
}
......@@ -670,7 +663,11 @@ static void* gNB_thread_prach( void* param ) {
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"gNB_prach_thread") < 0) break;
LOG_D(PHY,"Running gNB prach procedures\n");
prach_procedures(gNB ,0);
prach_procedures(gNB
#if (RRC_VERSION >= MAKE_VERSION(14, 0, 0))
,0
#endif
);
if (release_thread(&proc->mutex_prach,&proc->instance_cnt_prach,"gNB_prach_thread") < 0) break;
}
......
This diff is collapsed.
#ifndef NR_SOFTMODEM_COMMON_H
#define NR_SOFTMODEM_COMMON_H
#ifndef _GNU_SOURCE
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
......@@ -98,8 +98,6 @@
#define CONFIG_HLP_TELN "Start embedded telnet server \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_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
/*--------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters for LOG utility */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
......
......@@ -63,6 +63,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
//#include "PHY/TOOLS/time_meas.h"
......@@ -83,8 +84,6 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "PHY/TOOLS/nr_phy_scope.h"
#include "stats.h"
#include "nr-softmodem.h"
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
#include "NB_IoT_interface.h"
short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT] = {0,0,16384,16384,-16384,-16384,16384,16384,16384,-16384,-16384,16384,-16384,-16384,7327,7327,7327,21981,21981,7327,21981,21981,7327,-7327,7327,-21981,21981,-7327,21981,-21981,-7327,7327,-7327,21981,-21981,7327,-21981,21981,-7327,-7327,-7327,-21981,-21981,-7327,-21981,-21981,10726,10726,10726,3576,3576,10726,3576,3576,10726,17876,10726,25027,3576,17876,3576,25027,17876,10726,17876,3576,25027,10726,25027,3576,17876,17876,17876,25027,25027,17876,25027,25027,10726,-10726,10726,-3576,3576,-10726,3576,-3576,10726,-17876,10726,-25027,3576,-17876,3576,-25027,17876,-10726,17876,-3576,25027,-10726,25027,-3576,17876,-17876,17876,-25027,25027,-17876,25027,-25027,-10726,10726,-10726,3576,-3576,10726,-3576,3576,-10726,17876,-10726,25027,-3576,17876,-3576,25027,-17876,10726,-17876,3576,-25027,10726,-25027,3576,-17876,17876,-17876,25027,-25027,17876,-25027,25027,-10726,-10726,-10726,-3576,-3576,-10726,-3576,-3576,-10726,-17876,-10726,-25027,-3576,-17876,-3576,-25027,-17876,-10726,-17876,-3576,-25027,-10726,-25027,-3576,-17876,-17876,-17876,-25027,-25027,-17876,-25027,-25027,8886,8886,8886,12439,12439,8886,12439,12439,8886,5332,8886,1778,12439,5332,12439,1778,5332,8886,5332,12439,1778,8886,1778,12439,5332,5332,5332,1778,1778,5332,1778,1778,8886,19547,8886,15993,12439,19547,12439,15993,8886,23101,8886,26655,12439,23101,12439,26655,5332,19547,5332,15993,1778,19547,1778,15993,5332,23101,5332,26655,1778,23101,1778,26655,19547,8886,19547,12439,15993,8886,15993,12439,19547,5332,19547,1778,15993,5332,15993,1778,23101,8886,23101,12439,26655,8886,26655,12439,23101,5332,23101,1778,26655,5332,26655,1778,19547,19547,19547,15993,15993,19547,15993,15993,19547,23101,19547,26655,15993,23101,15993,26655,23101,19547,23101,15993,26655,19547,26655,15993,23101,23101,23101,26655,26655,23101,26655,26655,8886,-8886,8886,-12439,12439,-8886,12439,-12439,8886,-5332,8886,-1778,12439,-5332,12439,-1778,5332,-8886,5332,-12439,1778,-8886,1778,-12439,5332,-5332,5332,-1778,1778,-5332,1778,-1778,8886,-19547,8886,-15993,12439,-19547,12439,-15993,8886,-23101,8886,-26655,12439,-23101,12439,-26655,5332,-19547,5332,-15993,1778,-19547,1778,-15993,5332,-23101,5332,-26655,1778,-23101,1778,-26655,19547,-8886,19547,-12439,15993,-8886,15993,-12439,19547,-5332,19547,-1778,15993,-5332,15993,-1778,23101,-8886,23101,-12439,26655,-8886,26655,-12439,23101,-5332,23101,-1778,26655,-5332,26655,-1778,19547,-19547,19547,-15993,15993,-19547,15993,-15993,19547,-23101,19547,-26655,15993,-23101,15993,-26655,23101,-19547,23101,-15993,26655,-19547,26655,-15993,23101,-23101,23101,-26655,26655,-23101,26655,-26655,-8886,8886,-8886,12439,-12439,8886,-12439,12439,-8886,5332,-8886,1778,-12439,5332,-12439,1778,-5332,8886,-5332,12439,-1778,8886,-1778,12439,-5332,5332,-5332,1778,-1778,5332,-1778,1778,-8886,19547,-8886,15993,-12439,19547,-12439,15993,-8886,23101,-8886,26655,-12439,23101,-12439,26655,-5332,19547,-5332,15993,-1778,19547,-1778,15993,-5332,23101,-5332,26655,-1778,23101,-1778,26655,-19547,8886,-19547,12439,-15993,8886,-15993,12439,-19547,5332,-19547,1778,-15993,5332,-15993,1778,-23101,8886,-23101,12439,-26655,8886,-26655,12439,-23101,5332,-23101,1778,-26655,5332,-26655,1778,-19547,19547,-19547,15993,-15993,19547,-15993,15993,-19547,23101,-19547,26655,-15993,23101,-15993,26655,-23101,19547,-23101,15993,-26655,19547,-26655,15993,-23101,23101,-23101,26655,-26655,23101,-26655,26655,-8886,-8886,-8886,-12439,-12439,-8886,-12439,-12439,-8886,-5332,-8886,-1778,-12439,-5332,-12439,-1778,-5332,-8886,-5332,-12439,-1778,-8886,-1778,-12439,-5332,-5332,-5332,-1778,-1778,-5332,-1778,-1778,-8886,-19547,-8886,-15993,-12439,-19547,-12439,-15993,-8886,-23101,-8886,-26655,-12439,-23101,-12439,-26655,-5332,-19547,-5332,-15993,-1778,-19547,-1778,-15993,-5332,-23101,-5332,-26655,-1778,-23101,-1778,-26655,-19547,-8886,-19547,-12439,-15993,-8886,-15993,-12439,-19547,-5332,-19547,-1778,-15993,-5332,-15993,-1778,-23101,-8886,-23101,-12439,-26655,-8886,-26655,-12439,-23101,-5332,-23101,-1778,-26655,-5332,-26655,-1778,-19547,-19547,-19547,-15993,-15993,-19547,-15993,-15993,-19547,-23101,-19547,-26655,-15993,-23101,-15993,-26655,-23101,-19547,-23101,-15993,-26655,-19547,-26655,-15993,-23101,-23101,-23101,-26655,-26655,-23101,-26655,-26655};
......@@ -169,7 +168,7 @@ int rx_input_level_dBm;
uint32_t do_forms=0;
int otg_enabled;
//int number_of_cards = 1;
//int number_of_cards = 1;
//static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
......@@ -190,10 +189,46 @@ int transmission_mode=1;
int emulate_rf = 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 char *parallel_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 */
eth_params_t *eth_params;
......@@ -473,14 +508,22 @@ static void get_options(void) {
int tddflag, nonbiotflag;
uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv = 0;
uint32_t noS1;
uint32_t nokrnmod;
uint32_t start_telnetsrv;
paramdef_t cmdline_params[] = CMDLINE_PARAMS_DESC_GNB ;
paramdef_t cmdline_logparams[] = CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
if (strlen(in_path) > 0) {
opt_type = OPT_PCAP;
opt_enabled=1;
printf("Enabling OPT for PCAP with the following file %s \n",in_path);
}
if (strlen(in_ip) > 0) {
opt_enabled=1;
opt_type = OPT_WIRESHARK;
printf("Enabling OPT for wireshark for local interface");
}
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
......@@ -513,7 +556,6 @@ static void get_options(void) {
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
}
......@@ -834,30 +876,6 @@ static void wait_nfapi_init(char *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 i, ru_id, CC_id = 0;
......@@ -879,7 +897,6 @@ int main( int argc, char **argv )
configure_linux();
printf("Reading in command-line options\n");
get_options ();
get_common_options();
if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
fprintf(stderr,"Getting configuration failed\n");
......@@ -906,8 +923,10 @@ int main( int argc, char **argv )
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif
init_opt();
if (opt_type != OPT_NONE) {
if (init_opt() == -1)
LOG_E(OPT,"failed to run OPT \n");
}
#ifdef PDCP_USE_NETLINK
netlink_init();
......@@ -942,9 +961,6 @@ init_opt();
flexran_agent_start(i);
}
if(IS_SOFTMODEM_NOS1)
init_pdcp();
// init UE_PF_PO and mutex lock
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);
......@@ -1142,6 +1158,8 @@ init_opt();
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
}
if (opt_enabled == 1)
terminate_opt();
logClean();
printf("Bye.\n");
......
......@@ -5,18 +5,18 @@
#include "flexran_agent.h"
#include "PHY/defs_gNB.h"
#include "proto_agent.h"
#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
when calling config_get or config_getlist functions */
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* command line parameters common to eNodeB and UE */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
#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)},\
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
......@@ -34,6 +34,8 @@
{"K" , CONFIG_HLP_ITTIL, PARAMFLAG_NOFREE, strptr:&itti_dump_file, defstrval:"/tmp/itti.dump", TYPE_STRING, 0}, \
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
{"W" , CONFIG_HLP_L2MONW, 0, strptr:(char **)&in_ip, defstrval:"127.0.0.1", TYPE_STRING, sizeof(in_ip)}, \
{"P" , CONFIG_HLP_L2MONP, 0, strptr:(char **)&in_path, defstrval:"/tmp/oai_opt.pcap", TYPE_STRING, sizeof(in_path)},\
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
{"S" , CONFIG_HLP_MSLOTS, PARAMFLAG_BOOL, u8ptr:&exit_missed_slots, defintval:1, TYPE_UINT8, 0}, \
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
......@@ -42,19 +44,14 @@
{"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}, \
{"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}, \
{"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} \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0} \
}
#define SOFTMODEM_NOS1_BIT (1<<0)
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
extern uint64_t get_softmodem_optmask(void);
extern void get_common_options(void);
typedef struct {
int *argc;
char **argv;
} scopeParms_t;
extern int T_port;
extern int T_nowait;
......
......@@ -45,7 +45,6 @@
#include "common/utils/LOG/log.h"
#include "common/utils/system.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "executables/nr-softmodem.h"
#include "T.h"
......@@ -142,10 +141,8 @@ 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));
memset(ue,0,sizeof(PHY_VARS_NR_UE));
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
ue->Mod_id = UE_id;
ue->mac_enabled = 1;
// initialize all signal buffers
init_nr_ue_signal(ue,1,abstraction_flag);
// intialize transport
......@@ -356,9 +353,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nr_dcireq_t dcireq;
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
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_DOWNLINK_SLOT) {
......@@ -371,38 +365,12 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
nr_ue_dcireq(&dcireq); //to be replaced with function pointer later
scheduled_response.dl_config = &dcireq.dl_config_req;
scheduled_response.ul_config = &dcireq.ul_config_req;
scheduled_response.ul_config = NULL;
scheduled_response.tx_request = NULL;
scheduled_response.module_id = UE->Mod_id;
scheduled_response.CC_id = 0;
scheduled_response.frame = proc->frame_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);
#ifdef UE_SLOT_PARALLELISATION
......@@ -413,15 +381,6 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
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");
#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);
}
}
......@@ -456,14 +415,13 @@ typedef struct processingData_s {
} processingData_t;
void UE_processing(void *arg) {
uint8_t thread_id;
processingData_t *rxtxD=(processingData_t *) arg;
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
PHY_VARS_NR_UE *UE = rxtxD->UE;
processSlotRX(UE, proc);
//printf(">>> mac ended\n");
// Prepare the future Tx data
/*
#if 0
#ifndef NO_RAT_NR
if (slot_select_nr(&UE->frame_parms, proc->frame_tx, proc->nr_tti_tx) & NR_UPLINK_SLOT)
......@@ -471,21 +429,11 @@ void UE_processing(void *arg) {
if ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_UL) ||
(UE->frame_parms.frame_type == FDD) )
#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)
phy_procedures_nrUE_TX(UE,proc,0,thread_id);
}
phy_procedures_nrUE_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 ((subframe_select( &UE->frame_parms, proc->subframe_tx) == SF_S) &&
......@@ -709,7 +657,7 @@ void *UE_thread(void *arg) {
slot_nr*UE->frame_parms.samples_per_slot];
for (int i=0; i<UE->frame_parms.nb_antennas_tx; i++)
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];
txp[i] = (void *)&UE->common_vars.txdata[i][curMsg->proc.nr_tti_tx*UE->frame_parms.samples_per_slot];
int readBlockSize, writeBlockSize;
......@@ -735,7 +683,7 @@ void *UE_thread(void *arg) {
AssertFatal( writeBlockSize ==
UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+
(DURATION_RX_TO_TX*UE->frame_parms.samples_per_slot) -
(2*UE->frame_parms.samples_per_slot) -
UE->frame_parms.ofdm_symbol_size-UE->frame_parms.nb_prefix_samples0 -
openair0_cfg[0].tx_sample_advance,
txp,
......@@ -786,7 +734,7 @@ void *UE_thread(void *arg) {
msgToPush->key=slot_nr;
pushTpool(Tpool, msgToPush);
if (getenv("RFSIMULATOR") || IS_SOFTMODEM_NOS1) { //getenv("RFSIMULATOR")
if (getenv("RFSIMULATOR")) {
// 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
// We must receive one message, that proves the slot processing is done
......
......@@ -29,7 +29,6 @@
#include "PHY/defs_nr_UE.h"
#include "common/ran_context.h"
#include "common/config/config_userapi.h"
//#include "common/utils/threadPool/thread-pool.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
......@@ -78,11 +77,9 @@ unsigned short config_frames[4] = {2,9,11,13};
#include <forms.h>
/* Callbacks, globals and object handlers */
extern void reset_stats( FL_OBJECT *, long );
//extern void initTpool(char *params,tpool_t *pool, bool performanceMeas);
/* Forms and Objects */
......@@ -105,11 +102,9 @@ FD_phy_scope_nrue *form_nrue[NUMBER_OF_UE_MAX];
//FD_lte_phy_scope_enb *form_enb[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
//FD_stats_form *form_stats=NULL,*form_stats_l2=NULL;
char title[255];
static pthread_t forms_thread; //xforms
static pthread_t forms_thread; //xforms
#include <executables/nr-uesoftmodem.h>
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
RAN_CONTEXT_t RC;
volatile int start_eNB = 0;
......@@ -125,7 +120,6 @@ int threequarter_fs=0;
uint32_t downlink_frequency[MAX_NUM_CCs][4];
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int16_t nr_dlsch_demod_shift;
int UE_scan = 0;
......@@ -152,7 +146,7 @@ double bw = 10.0e6;
static int tx_max_power[MAX_NUM_CCs] = {0};
char rf_config_file[1024];
char rf_config_file[1024];
int chain_offset=0;
int phy_test = 0;
......@@ -167,18 +161,53 @@ uint8_t nb_antenna_rx = 1;
char ref[128] = "internal";
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 char *parallel_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;
//static int online_log_messages=0;
uint32_t do_forms=0;
int otg_enabled;
//int number_of_cards = 1;
//int number_of_cards = 1;
static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
int16_t node_synch_ref[MAX_NUM_CCs];
......@@ -368,18 +397,28 @@ int16_t dlsch_demod_shift;
static void get_options(void) {
int CC_id;
int tddflag=0, nonbiotflag, vcdflag=0;
int tddflag=0, nonbiotflag;
char *loopfile=NULL;
int dumpframe=0;
uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv=0;
//uint32_t noS1;
//uint32_t nokrnmod;
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC_NR ;
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
if (strlen(in_path) > 0) {
opt_type = OPT_PCAP;
opt_enabled=1;
printf("Enabling OPT for PCAP with the following file %s \n",in_path);
}
if (strlen(in_ip) > 0) {
opt_enabled=1;
opt_type = OPT_WIRESHARK;
printf("Enabling OPT for wireshark for local interface");
}
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) {
......@@ -427,9 +466,6 @@ static void get_options(void) {
frame_parms[CC_id]->frame_type = TDD;
}
if (vcdflag > 0)
ouput_vcd = 1;
/*if (frame_parms[0]->N_RB_DL !=0) {
if ( frame_parms[0]->N_RB_DL < 6 ) {
frame_parms[0]->N_RB_DL = 6;
......@@ -631,27 +667,6 @@ 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 ) {
//uint8_t beta_ACK=0,beta_RI=0,beta_CQI=2;
......@@ -671,7 +686,6 @@ int main( int argc, char **argv ) {
logInit();
// get options and fill parameters from configuration file
get_options (); //Command-line options, enb_properties
get_common_options();
#if T_TRACER
T_Config_Init();
#endif
......@@ -684,23 +698,18 @@ int main( int argc, char **argv ) {
cpuf=get_cpu_freq_GHz();
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info);
init_opt() ;
if(IS_SOFTMODEM_NOS1)
init_pdcp();
if (ouput_vcd) {
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
if (opt_type != OPT_NONE) {
if (init_opt() == -1)
LOG_E(OPT,"failed to run OPT \n");
}
/*
#ifdef PDCP_USE_NETLINK
netlink_init();
#if defined(PDCP_USE_NETLINK_QUEUES)
pdcp_netlink_init();
#endif
#endif
*/
#ifndef PACKAGE_VERSION
#ifndef PACKAGE_VERSION
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
......@@ -726,7 +735,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);
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
if (phy_test==1)
UE[CC_id]->mac_enabled = 0;
else
......@@ -776,7 +784,6 @@ int main( int argc, char **argv ) {
PHY_vars_UE_g[0][CC_id]->rf_map.chain=CC_id+chain_offset;
#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]->timing_advance = timing_advance;
#else
PHY_vars_UE_g[0][CC_id]->hw_timing_advance = 160;
#endif
......@@ -789,8 +796,5 @@ int main( int argc, char **argv ) {
while(true)
sleep(3600);
if (ouput_vcd)
vcd_signal_dumper_close();
return 0;
}
This diff is collapsed.
......@@ -574,44 +574,44 @@ typedef struct {
} nfapi_nr_dl_config_bch_pdu;
typedef struct {
nfapi_tl_t tl;
uint16_t length;
uint8_t pdu_index;
uint16_t rnti;
uint16_t nb_mod_symbols;
uint8_t time_allocation_type;
uint8_t freq_allocation_type;
uint16_t start_prb;
uint16_t n_prb;
uint8_t start_symbol;
uint8_t nb_symbols;
uint8_t mcs_idx;
uint8_t ndi;
uint8_t nb_codewords;
uint8_t nb_layers;
uint16_t coding_rate;
uint8_t modulation;
uint8_t modulation_order;
uint16_t transport_block_size;
uint8_t nb_re_dmrs;
uint8_t time_alloc_list_flag;
uint8_t time_alloc_list;
uint8_t rbg_list;
uint8_t virtual_resource_block_assignment_flag;
uint32_t resource_block_coding;
uint8_t redundancy_version;
uint8_t transport_blocks;
uint8_t transmission_scheme;
uint8_t number_of_subbands;
uint8_t codebook_index[NFAPI_MAX_NUM_SUBBANDS];
uint8_t ue_category_capacity;
uint8_t pa;
uint8_t delta_power_offset_index;
uint8_t ngap;
uint8_t transmission_mode;
uint8_t num_bf_prb_per_subband;
uint8_t num_bf_vector;
nfapi_bf_vector_t bf_vector[NFAPI_MAX_BF_VECTORS];
nfapi_tl_t tl;
uint16_t length;
uint8_t pdu_index;
uint16_t rnti;
uint16_t nb_mod_symbols;
uint8_t time_allocation_type;
uint8_t freq_allocation_type;
uint8_t start_prb;
uint16_t n_prb;
uint8_t start_symbol;
uint8_t nb_symbols;
uint8_t mcs_idx;
uint8_t ndi;
uint8_t nb_codewords;
uint8_t nb_layers;
uint16_t coding_rate;
uint8_t modulation;
uint8_t modulation_order;
uint16_t transport_block_size;
uint8_t nb_re_dmrs;
uint8_t time_alloc_list_flag;
uint8_t time_alloc_list;
uint8_t rbg_list;
uint8_t virtual_resource_block_assignment_flag;
uint32_t resource_block_coding;
uint8_t redundancy_version;
uint8_t transport_blocks;
uint8_t transmission_scheme;
uint8_t number_of_subbands;
uint8_t codebook_index[NFAPI_MAX_NUM_SUBBANDS];
uint8_t ue_category_capacity;
uint8_t pa;
uint8_t delta_power_offset_index;
uint8_t ngap;
uint8_t transmission_mode;
uint8_t num_bf_prb_per_subband;
uint8_t num_bf_vector;
nfapi_bf_vector_t bf_vector[NFAPI_MAX_BF_VECTORS];
}nfapi_nr_dl_config_dlsch_pdu_rel15_t;
#define NFAPI_NR_DL_CONFIG_REQUEST_DLSCH_PDU_REL15_TAG
......
......@@ -376,11 +376,9 @@ int send_mac_subframe_indications(vnf_p7_t* vnf_p7)
if(curr->in_sync == 1)
{
// ask for subframes in the future
//uint16_t sfn_sf_adv = increment_sfn_sf_by(curr->sfn_sf, 2);
uint16_t sfn_sf_adv = increment_sfn_sf_by(curr->sfn_sf, 2);
//vnf_p7->_public.subframe_indication(&(vnf_p7->_public), curr->phy_id, sfn_sf_adv);
// suggestion fix by Haruki NAOI
vnf_p7->_public.subframe_indication(&(vnf_p7->_public), curr->phy_id, curr->sfn_sf);
vnf_p7->_public.subframe_indication(&(vnf_p7->_public), curr->phy_id, sfn_sf_adv);
}
curr = curr->next;
......
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file CUDA_phy_procedure.cu
* \brief Create and Implementation of beamforming and ifft in gpu
* \author TY Hsu, CW Chang
* \date 2018
* \version 0.1
* \company ISIP@NCTU and Eurecom
* \email: tyhsu@cs.nctu.edu.tw, zhang0756107.cs07g@nctu.edu.tw
* \note
* \warning
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cufft.h>
#include "CUDA/checkError.h"
#include "CUDA/struct.h"
#include "CUDA/cuda_struct.h"
__global__ void cu_intToComplex(int *input, Complex *signal){
int id = blockIdx.x*1024 + threadIdx.x;
signal[id].x = ((short*)&input[id])[0];
signal[id].y = ((short*)&input[id])[1];
}
__global__ void cu_ComplexToInt(int *output, Complex *signal){
int id = blockIdx.x*1024 + threadIdx.x;
((short*)&output[id])[0] = round(signal[id].x);
((short*)&output[id])[1] = round(signal[id].y);
}
__global__ void cu_CP_fft_resultin(unsigned char nb_prefix_samples, int *input, int *output, int fftsize, int nb_symbols){
int id = blockIdx.x*1024 + threadIdx.x;
int elementId = id%fftsize;
int symbolId = id/fftsize;
int slotId = symbolId/nb_symbols;
int symbIdinSlot = symbolId%nb_symbols;
int slotElmtNum = fftsize*(nb_symbols+1);
int CPElmtNum = fftsize+nb_prefix_samples;
int offset = slotId*slotElmtNum + symbIdinSlot*CPElmtNum;
output[offset + nb_prefix_samples + elementId] = input[id];
if(elementId >= fftsize-nb_prefix_samples){
output[offset + (fftsize-nb_prefix_samples)] = input[id];
}
}
__global__ void cu_CP0_fft_resultin(unsigned char nb_prefix_samples0, unsigned char nb_prefix_samples,
int *input, int *output, int fftsize, int nb_symbols){
int id = blockIdx.x*1024 + threadIdx.x;
int elementId = id%fftsize;
int symbolId = id/fftsize;
int slotId = symbolId/nb_symbols;
int symbIdinSlot = symbolId%nb_symbols;
int slotElmtNum = fftsize*(nb_symbols+1);
int CP0ElmtNum = fftsize+nb_prefix_samples0;
int CPElmtNum = fftsize+nb_prefix_samples;
if(symbIdinSlot==0){
int offset = slotId*slotElmtNum;
output[offset + nb_prefix_samples0+ elementId] = input[id];
if(elementId >= fftsize-nb_prefix_samples0){
output[offset + (fftsize-nb_prefix_samples0)] = input[id];
}
}else{
int offset = slotId*slotElmtNum + CP0ElmtNum + (symbIdinSlot-1)*CPElmtNum;
output[offset + nb_prefix_samples + elementId] = input[id];
if(elementId >= fftsize-nb_prefix_samples){
output[offset + (fftsize-nb_prefix_samples)] = input[id];
}
}
}
extern "C" void CUDA_ifft_ofdm( int **output,
int fftsize,
unsigned char nb_symbols,
unsigned char nb_prefix_samples,
unsigned char nb_prefix_samples0,
int nb_tx,
int Ncp,
Extension_t etype){
//for(int i=0; i<fftsize; i++) printf("%d+%di\n", ((short*)&input[0][i])[0], ((short*)&input[0][i])[1]);
int *d_txdataF_BF = cu_ru.d_txdataF_BF;
int *d_data_wCP = cu_ru.d_data_wCP;
Complex *d_signal = cu_ru.d_signal;
cufftHandle plan = cu_ru.plan;
/*
for(int aa=0; aa<nb_tx; aa++){
int elementNum = fftsize*nb_symbols;
gpuErrchk( cudaMemcpy(&d_data[aa*elementNum], input[aa], sizeof(int)*elementNum, cudaMemcpyHostToDevice) );
}*/
int threadNum = 1024;
int blockNum = fftsize*nb_symbols*nb_tx / threadNum;
cu_intToComplex<<<blockNum, threadNum>>>(d_txdataF_BF, d_signal);
//CHECK_STATE("cu_intToComplex");
cufftErrchk( cufftExecC2C(plan, (cufftComplex *)d_signal, (cufftComplex *)d_signal, CUFFT_INVERSE));
cu_ComplexToInt<<<blockNum, threadNum>>>(d_txdataF_BF, d_signal);
//CHECK_STATE("cu_ComplexToInt");
//only do cyclic_prefix, suffix/none not finish yet.
if(Ncp==1){
cu_CP_fft_resultin<<<blockNum, threadNum>>>(nb_prefix_samples, d_txdataF_BF, d_data_wCP, fftsize, nb_symbols);
//CHECK_STATE("cu_CP_fft_resultin");
}else{
cu_CP0_fft_resultin<<<blockNum, threadNum>>>(nb_prefix_samples0, nb_prefix_samples, d_txdataF_BF, d_data_wCP, fftsize, nb_symbols);
//CHECK_STATE("cu_CP0_fft_resultin");
}
//write back gpu->cpu
for(int aa=0; aa<nb_tx; aa++){
gpuErrchk( cudaMemcpy(output[aa], &d_data_wCP[aa*(nb_symbols+1)*fftsize], fftsize*(nb_symbols+1)*sizeof(int), cudaMemcpyDeviceToHost) );
}
cudaDeviceSynchronize();
}
__global__ void conjMul(int *d_x1, int *d_x2, int *d_y, int aa, int div, int fftsize, int nb_symbols){
int id = blockIdx.x*1024 + threadIdx.x;
int *x1 = &d_x1[id];
int *x2 = &d_x2[id%fftsize];
int *y = &d_y[aa*fftsize*nb_symbols + id];
int re, im;
//conj(x1) * x2
re = ((short*)x1)[0]*((short*)x2)[0] + ((short*)x1)[1]*((short*)x2)[1];
im = ((short*)x1)[0]*((short*)x2)[1] - ((short*)x1)[1]*((short*)x2)[0];
re = re / div;
im = im / div;
((short*)y)[0] += re;
((short*)y)[1] += im;
}
extern "C" void CUDA_beam_precoding(int **txdataF, int ***weight, int L_ssb, int shift, int fftsize, int nb_symbols, int nb_antenna_ports, int nb_tx){
//initial BF data;
gpuErrchk( cudaMemset(cu_ru.d_txdataF_BF, 0, fftsize*nb_symbols*sizeof(int)*nb_tx) );
//move data to gpu
for(int p=0; p<nb_antenna_ports; p++){
gpuErrchk( cudaMemcpy(cu_ru.d_txdataF[p], txdataF[p], fftsize*sizeof(int)*nb_symbols, cudaMemcpyHostToDevice) );
}
int threadNum = 1024;
int blockNum = fftsize*nb_symbols/threadNum;
int div = 1<<shift;
for(int aa=0; aa<nb_tx; aa++){
for(int p=0; p<nb_antenna_ports; p++){
if((L_ssb>>p) & 0x01){
gpuErrchk( cudaMemcpy(cu_ru.d_weight[p][aa], weight[p][aa], fftsize*sizeof(int), cudaMemcpyHostToDevice) );
conjMul<<<blockNum, threadNum>>>(cu_ru.d_txdataF[p], cu_ru.d_weight[p][aa],
cu_ru.d_txdataF_BF, aa, div, fftsize, nb_symbols);
}
}
}
}
#ifndef CUDA
#define CUDA
#include "cuda_struct.h"
#if __cplusplus
extern "C" {
#endif
void CUDA_hello(void);
void CUDA_ifft_ofdm( int **output,
int fftsize,
unsigned char nb_symbols,
unsigned char nb_prefix_samples,
unsigned char nb_prefix_samples0,
int nb_tx,
int Ncp,
Extension_t etype);
void CUDA_beam_precoding(int **txdataF, int ***weight, int L_ssb, int shift, int fftsize, int nb_symbols, int nb_antenna_ports, int nb_tx);
#if __cplusplus
}
#endif
#endif
#ifndef CHECKERROR_H
#define CHECKERROR_H
static const char* _cudaGetErrorEnum(cufftResult error){
switch (error){
case CUFFT_SUCCESS:{return "CUFFT_SUCCESS";}
case CUFFT_INVALID_PLAN:{return "CUFFT_INVALID_PLAN";}
case CUFFT_ALLOC_FAILED:{return "CUFFT_ALLOC_FAILED";}
case CUFFT_INVALID_TYPE:{return "CUFFT_INVALID_TYPE";}
case CUFFT_INVALID_VALUE:{return "CUFFT_INVALID_VALUE";}
case CUFFT_INTERNAL_ERROR:{return "CUFFT_INTERNAL_ERROR";}
case CUFFT_EXEC_FAILED:{return "CUFFT_EXEC_FAILED";}
case CUFFT_SETUP_FAILED:{return "CUFFT_SETUP_FAILED";}
case CUFFT_INVALID_SIZE:{return "CUFFT_INVALID_SIZE";}
case CUFFT_UNALIGNED_DATA:{return "CUFFT_UNALIGNED_DATA";}
}
return "<unknown>";
}
#define cufftErrchk(ans) { __cufftSafeCall((ans), __FILE__, __LINE__); }
inline void __cufftSafeCall(cufftResult err, const char *file, const int line, bool abort=true){
if (err != CUFFT_SUCCESS ){
fprintf(stderr,"CUFFT assert: %s %s %d\n", _cudaGetErrorEnum(err), file, line);
if (abort) exit(err);
}
}
#define gpuErrchk(ans) { gpuAssert((ans), __FILE__, __LINE__); }
inline void gpuAssert(cudaError_t code, const char *file, int line, bool abort=true){
if (code != cudaSuccess){
fprintf(stderr,"GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
if (abort) exit(code);
}
}
#define CHECK_STATE(msg) {checkCudaState((msg), __FILE__, __LINE__);}
inline void checkCudaState(const char *msg, const char *file, const int line){
cudaDeviceSynchronize();
cudaError_t err = cudaGetLastError();
if(err != cudaSuccess) {
fprintf(stderr, "[%s]gpu error: %s %s %d\n", msg, cudaGetErrorString(err), file, line);
}
}
#endif
#ifndef CUDA_STRUCT_H
#define CUDA_STRUCT_H
#include <cuda.h>
#include <cuda_runtime.h>
#include <cufft.h>
#if __cplusplus
extern "C" {
#endif
typedef float2 Complex;
typedef struct cuda_cu_ru_t{
//beamforming precoding
int **d_txdataF;//14symb-port0, 14symb-port1, ......
int ***d_weight;//[p][tx][symb]
cudaStream_t *d_beam_stream;
//ifft
int *d_txdataF_BF;//14symb-tx0, 14symb-tx1, ......
Complex *d_signal;
int *d_data_wCP;
cufftHandle plan;
}cuda_cu_ru;
extern cuda_cu_ru cu_ru;
#if __cplusplus
}
#endif
#endif
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file init_cuda.cu
* \brief Create and Implementation of beamforming and ifft in gpu
* \author TY Hsu, CW Chang
* \date 2018
* \version 0.1
* \company ISIP@NCTU and Eurecom
* \email: tyhsu@cs.nctu.edu.tw, zhang0756107.cs07g@nctu.edu.tw
* \note
* \warning
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cuda.h>
#include <cuda_runtime.h>
#include <cufft.h>
#include "CUDA/checkError.h"
#include "CUDA/struct.h"
#include "CUDA/cuda_struct.h"
cuda_cu_ru cu_ru;
extern "C" void init_cuda(int nb_tx, int nb_symbols, int fftsize){
printf("init_cuda %d %d %d \n\n\n", nb_tx, nb_symbols, fftsize);
int nb_antenna_ports = 8;
//beamforming precoding
cu_ru.d_txdataF = (int**)malloc(sizeof(int*) * nb_antenna_ports);
for(int p=0; p<nb_antenna_ports; p++){
gpuErrchk( cudaMalloc((void**)&cu_ru.d_txdataF[p], fftsize*sizeof(int)*nb_symbols) );
}
cu_ru.d_beam_stream = (cudaStream_t*)malloc(sizeof(cudaStream_t)*nb_tx);
for(int aa=0; aa<nb_tx; aa++){
gpuErrchk( cudaStreamCreate(&cu_ru.d_beam_stream[aa]) );
}
cu_ru.d_weight = (int***)malloc(sizeof(int**) * nb_antenna_ports);
for(int p=0; p<nb_antenna_ports; p++){
cu_ru.d_weight[p] = (int**)malloc(sizeof(int*) * nb_tx);
for(int aa=0; aa<nb_tx; aa++){
gpuErrchk( cudaMalloc((void**)&cu_ru.d_weight[p][aa], fftsize*sizeof(int)) );
}
}
//ifft
gpuErrchk( cudaMalloc((void**)&cu_ru.d_txdataF_BF, fftsize*sizeof(int)*nb_symbols*nb_tx) );
gpuErrchk( cudaMalloc((void**)&cu_ru.d_signal, fftsize*sizeof(Complex)*nb_symbols*nb_tx) );
gpuErrchk( cudaMalloc((void**)&cu_ru.d_data_wCP, fftsize*(nb_symbols+1)*nb_tx*sizeof(int)) );
cufftErrchk( cufftPlan1d(&cu_ru.plan, fftsize, CUFFT_C2C, nb_symbols*nb_tx) );
}
#ifndef INIT_CUDA_DEF
#define INIT_CUDA_DEF
#include "cuda_struct.h"
#if __cplusplus
extern "C" {
#endif
void init_cuda(int nb_tx, int nb_symbols, int fftsize);
#if __cplusplus
}
#endif
#endif
#ifndef OAI_STRUCT
#define OAI_STRUCT
typedef enum {
CYCLIC_PREFIX,
CYCLIC_SUFFIX,
ZEROS,
NONE
} Extension_t;
#endif
......@@ -23,14 +23,13 @@
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "assertions.h"
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/CODING/nrLDPC_encoder/defs.h"
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#define MAX_NUM_DLSCH_SEGMENTS 16
#define MAX_BLOCK_LENGTH 8448
#ifndef malloc16
# ifdef __AVX2__
......@@ -43,6 +42,7 @@
#define NR_LDPC_PROFILER_DETAIL
#define NR_LDPC_ENABLE_PARITY_CHECK
// 4-bit quantizer
char quantize4bit(double D,double x)
{
......@@ -76,15 +76,31 @@ char quantize8bit(double D,double x)
return((char)qxd);
}
char quantize(double D,double x,unsigned char B)
{
double qxd;
short maxlev;
qxd = floor(x/D);
maxlev = 1<<(B-1);//(char)(pow(2,B-1));
//printf("x=%f,qxd=%f,maxlev=%d\n",x,qxd, maxlev);
if (qxd <= -maxlev)
qxd = -maxlev;
else if (qxd >= maxlev)
qxd = maxlev-1;
return((char)qxd);
}
typedef struct {
double n_iter_mean;
double n_iter_std;
int n_iter_max;
double n_iter_mean;
double n_iter_std;
int n_iter_max;
} n_iter_stats_t;
RAN_CONTEXT_t RC;
PHY_VARS_UE ***PHY_vars_UE_g;
uint16_t NB_UE_INST = 1;
#define MAX_BLOCK_LENGTH 8448
short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
......@@ -102,7 +118,7 @@ int test_ldpc(short No_iteration,
unsigned int *crc_misses,
time_stats_t *time_optim,
time_stats_t *time_decoder,
n_iter_stats_t *dec_iter)
n_iter_stats_t * dec_iter)
{
//clock initiate
//time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder;
......@@ -130,12 +146,12 @@ int test_ldpc(short No_iteration,
double *modulated_input[MAX_NUM_DLSCH_SEGMENTS];
char *channel_output_fixed[MAX_NUM_DLSCH_SEGMENTS];
unsigned int i,j,trial=0;
short BG=0,Zc,Kb=0,nrows=0;//,ncols;
short BG,Zc,Kb,nrows;//,ncols;
int no_punctured_columns,removed_bit;
int i1;
int R_ind = 0;
//Table of possible lifting sizes
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
//short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
//int n_segments=1;
int code_rate_vec[8] = {15, 13, 25, 12, 23, 34, 56, 89};
//double code_rate_actual_vec[8] = {0.2, 0.33333, 0.4, 0.5, 0.66667, 0.73333, 0.81481, 0.88};
......@@ -211,15 +227,15 @@ int test_ldpc(short No_iteration,
//determine number of bits in codeword
if (block_length>3840)
{
BG = 1;
BG=1;
Kb = 22;
nrows = 46; //parity check bits
nrows=46; //parity check bits
//ncols=22; //info bits
}
else if (block_length<=3840)
{
BG = 2;
nrows = 42; //parity check bits
BG=2;
nrows=42; //parity check bits
//ncols=10; // info bits
if (block_length>640)
......@@ -230,7 +246,7 @@ int test_ldpc(short No_iteration,
Kb = 8;
else
Kb = 6;
}
}
if (nom_rate == 1)
if (denom_rate == 5)
......@@ -282,7 +298,7 @@ int test_ldpc(short No_iteration,
}
}
printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length, BG, Zc, Kb);
printf("ldpc_test: codeword_length %d, n_segments %d, block_length %d, BG %d, Zc %d, Kb %d\n",n_segments *block_length, n_segments, block_length,BG, Zc, Kb);
no_punctured_columns=(int)((nrows-2)*Zc+block_length-block_length*(1/((float)nom_rate/(float)denom_rate)))/Zc;
// printf("puncture:%d\n",no_punctured_columns);
removed_bit=(nrows-no_punctured_columns-2) * Zc+block_length-(int)(block_length/((float)nom_rate/(float)denom_rate));
......@@ -314,11 +330,11 @@ int test_ldpc(short No_iteration,
if (ntrials==1)
for (j=0;j<n_segments;j++)
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
if (channel_input[j][i]!=channel_input_optim[j][i]) {
printf("differ in seg %u pos %u (%u,%u)\n", j, i, channel_input[j][i], channel_input_optim[j][i]);
return (-1);
}
for (i = 0; i < block_length+(nrows-no_punctured_columns) * Zc - removed_bit; i++)
if (channel_input[j][i]!=channel_input_optim[j][i]) {
printf("differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
return (-1);
}
//else{
// printf("NOT differ in seg %d pos %d (%d,%d)\n",j,i,channel_input[j][i],channel_input_optim[j][i]);
// }
......@@ -328,6 +344,7 @@ int test_ldpc(short No_iteration,
printf("removed_bit: %d\n", removed_bit);
printf("To: %d\n", (Kb+nrows-no_punctured_columns) * Zc-removed_bit);
printf("number of undecoded bits: %d\n", (Kb+nrows-no_punctured_columns-2) * Zc-removed_bit);
}
//print_meas_now(&time, "", stdout);
......@@ -342,17 +359,17 @@ int test_ldpc(short No_iteration,
for (i = 2*Zc; i < (Kb+nrows-no_punctured_columns) * Zc-removed_bit; i++) {
#ifdef DEBUG_CODER
if ((i&0xf)==0)
printf("\ne %u..%u: ",i,i+15);
printf("\ne %d..%d: ",i,i+15);
#endif
if (channel_input_optim[j][i-2*Zc]==0)
if (channel_input[j][i-2*Zc]==0)
modulated_input[j][i]=1.0;///sqrt(2); //QPSK
else
modulated_input[j][i]=-1.0;///sqrt(2);
///channel_output[i] = modulated_input[i] + gaussdouble(0.0,1.0) * 1/sqrt(2*SNR);
//channel_output_fixed[i] = (char) ((channel_output[i]*128)<0?(channel_output[i]*128-0.5):(channel_output[i]*128+0.5)); //fixed point 9-7
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
//printf("llr[%d]=%d\n",i,channel_output_fixed[i]);
//channel_output_fixed[i] = (char)quantize(sigma/4.0,(2.0*modulated_input[i]) - 1.0 + sigma*gaussdouble(0.0,1.0),qbits);
channel_output_fixed[j][i] = (char)quantize(sigma/4.0/4.0,modulated_input[j][i] + sigma*gaussdouble(0.0,1.0),qbits);
......@@ -366,10 +383,10 @@ int test_ldpc(short No_iteration,
//Uncoded BER
if (channel_output_fixed[j][i]<0)
channel_output_uncoded[j][i]=1; //QPSK demod
else
else
channel_output_uncoded[j][i]=0;
if (channel_output_uncoded[j][i] != channel_input_optim[j][i-2*Zc])
if (channel_output_uncoded[j][i] != channel_input[j][i-2*Zc])
*errors_bit_uncoded = (*errors_bit_uncoded) + 1;
}
......@@ -524,7 +541,7 @@ int main(int argc, char *argv[])
time_stats_t time_optim[10], time_decoder[10];
n_iter_stats_t dec_iter[3];
short BG=0,Zc,Kb;
short BG,Zc,Kb;
while ((c = getopt (argc, argv, "q:r:s:S:l:n:d:i:t:u:h")) != -1)
switch (c)
......@@ -554,8 +571,8 @@ int main(int argc, char *argv[])
break;
case 'S':
n_segments = atof(optarg);
break;
n_segments = atof(optarg);
break;
case 't':
SNR_step = atof(optarg);
......@@ -566,8 +583,8 @@ int main(int argc, char *argv[])
break;
case 'u':
test_uncoded = atoi(optarg);
break;
test_uncoded = atoi(optarg);
break;
case 'h':
default:
......@@ -605,14 +622,14 @@ int main(int argc, char *argv[])
//determine number of bits in codeword
if (block_length>3840)
{
BG = 1;
BG=1;
Kb = 22;
//nrows=46; //parity check bits
//ncols=22; //info bits
}
else if (block_length<=3840)
{
BG = 2;
BG=2;
//nrows=42; //parity check bits
//ncols=10; // info bits
......@@ -646,7 +663,8 @@ int main(int argc, char *argv[])
fprintf(fd,"SNR BLER BER UNCODED_BER ENCODER_MEAN ENCODER_STD ENCODER_MAX DECODER_TIME_MEAN DECODER_TIME_STD DECODER_TIME_MAX DECODER_ITER_MEAN DECODER_ITER_STD DECODER_ITER_MAX\n");
for (SNR=SNR0;SNR<SNR0+20.0;SNR+=SNR_step) {
for (SNR=SNR0;SNR<SNR0+20.0;SNR+=SNR_step)
{
//reset_meas(&time_optim);
//reset_meas(&time_decoder);
//n_iter_stats_t dec_iter = {0, 0, 0};
......@@ -671,9 +689,9 @@ int main(int argc, char *argv[])
time_decoder,
dec_iter);
printf("SNR %f, BLER %f (%u/%d)\n", SNR, (float)decoded_errors[i]/(float)n_trials, decoded_errors[i], n_trials);
printf("SNR %f, BER %f (%u/%d)\n", SNR, (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments, decoded_errors[i], n_trials);
printf("SNR %f, Uncoded BER %f (%u/%d)\n",SNR, errors_bit_uncoded/(float)n_trials/(double)n_segments, decoded_errors[i], n_trials);
printf("SNR %f, BLER %f (%d/%d)\n",SNR,(float)decoded_errors[i]/(float)n_trials,decoded_errors[i],n_trials);
printf("SNR %f, BER %f (%d/%d)\n",SNR,(float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments ,decoded_errors[i],n_trials);
printf("SNR %f, Uncoded BER %f (%d/%d)\n",SNR,errors_bit_uncoded/(float)n_trials/(double)n_segments ,decoded_errors[i],n_trials);
printf("SNR %f, Mean iterations: %f\n",SNR, dec_iter->n_iter_mean);
printf("SNR %f, Std iterations: %f\n",SNR, dec_iter->n_iter_std);
printf("SNR %f, Max iterations: %d\n",SNR, dec_iter->n_iter_max);
......@@ -702,11 +720,23 @@ int main(int argc, char *argv[])
dec_iter->n_iter_max
);
if (decoded_errors[i] == 0) break;
if (decoded_errors[i] == 0)
break;
i=i+1;
}
fclose(fd);
return(0);
}
......@@ -11,7 +11,6 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
#include "PHY/CODING/coding_defs.h"
#include "SIMULATION/TOOLS/sim.h"
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
//#include "PHY/NR_TRANSPORT/nr_transport.h"
//#include "common/utils/LOG/log.h"
......@@ -19,12 +18,7 @@
//#define DEBUG_POLAR_TIMING
//#define DEBUG_POLARTEST
RAN_CONTEXT_t RC;
PHY_VARS_UE ***PHY_vars_UE_g;
uint16_t NB_UE_INST = 1;
int main(int argc, char *argv[])
{
int main(int argc, char *argv[]) {
//Default simulation values (Aim for iterations = 1000000.)
int decoder_int16=0;
int itr, iterations = 1000, arguments, polarMessageType = 0; //0=PBCH, 1=DCI, -1=UCI
......
#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"
#include "SIMULATION/TOOLS/sim.h"
#include <getopt.h>
//#define DEBUG_SMALLBLOCKTEST
RAN_CONTEXT_t RC;
PHY_VARS_UE ***PHY_vars_UE_g;
uint16_t NB_UE_INST = 1;
int main(int argc, char *argv[])
signed char quantize(double D, double x, unsigned char B)
{
double qxd;
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[]) {
time_stats_t timeEncoder,timeDecoder;
opp_enabled=1;
cpu_freq_GHz = get_cpu_freq_GHz();
......
......@@ -38,7 +38,7 @@
#define MAX_TURBO_ITERATIONS_MBSFN 8
#define MAX_TURBO_ITERATIONS max_turbo_iterations
#define MAX_LDPC_ITERATIONS 5
#define MAX_LDPC_ITERATIONS 4
#define MAX_LDPC_ITERATIONS_MBSFN 4
#define LTE_NULL 2
......
No preview for this file type
......@@ -771,7 +771,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
INPUT = ../nrLDPC_defs.h ../nrLDPC_types.h ../nrLDPC_init.h ../nrLDPC_cnProc.h ../nrLDPC_bnProc.h ../nrLDPC_mPass.h ../nrLDPC_decoder.h ../nrLDPC_decoder.c ../nrLDPC_lut.h
INPUT = ../nrLDPC_defs.h ../nrLDPC_types.h ../nrLDPC_init.h ../nrLDPC_cnProc.h ../nrLDPC_bnProc.h ../nrLDPC_mPass.h ../nrLDPC_decoder.h ../nrLDPC_decoder.c ../nrLDPC_lut/nrLDPC_lut.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
......
......@@ -47,7 +47,7 @@ static inline void nrLDPC_bnProcPc(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_proc
int8_t* bnProcBufRes = p_procBuf->bnProcBufRes;
int8_t* llrRes = p_procBuf->llrRes;
int8_t* llrProcBuf = p_procBuf->llrProcBuf;
__m128i* p_bnProcBuf;
__m256i* p_bnProcBufRes;
__m128i* p_llrProcBuf;
......@@ -1693,7 +1693,7 @@ static inline void nrLDPC_bnProc(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBu
int8_t* bnProcBuf = p_procBuf->bnProcBuf;
int8_t* bnProcBufRes = p_procBuf->bnProcBufRes;
int8_t* llrRes = p_procBuf->llrRes;
__m256i* p_bnProcBuf;
__m256i* p_bnProcBufRes;
__m256i* p_llrRes;
......@@ -2775,35 +2775,24 @@ static inline void nrLDPC_llr2bit(int8_t* out, int8_t* llrOut, uint16_t numLLR)
}
/**
\brief Performs hard-decision on output LLRs and packs the output in byte aligned output according to TS 38.321 Section 6.1.1.
i = 0,1,2,...
IN[i] : a0, a1, a2, ..., a_{A-1}
OUT[i]: a7,a6,a5,a4,a3,a2,a1,a0|a15,14,...,a8|a23,a22,...,a16|a31,a30,...,a24|...
\brief Performs hard-decision on output LLRs and packs the output in 32 bit values.
\param out Pointer hard-decision output, every int8_t contains 8 bits
\param llrOut Pointer to output LLRs
\param numLLR Number of LLRs
*/
static inline void nrLDPC_llr2bitPacked(int8_t* out, int8_t* llrOut, uint16_t numLLR)
{
/** Vector of indices for shuffling input */
const uint8_t constShuffle_256_epi8[32] __attribute__ ((aligned(32))) = {7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8};
__m256i* p_llrOut = (__m256i*) llrOut;
uint32_t* p_bits = (uint32_t*) out;
__m256i inPerm;
int8_t* p_llrOut8;
uint32_t bitsTmp = 0;
uint32_t i;
uint32_t M = numLLR>>5;
uint32_t Mr = numLLR&31;
const __m256i* p_shuffle = (__m256i*) constShuffle_256_epi8;
for (i=0; i<M; i++)
{
// Move LSB to MSB on 8 bits
inPerm = _mm256_shuffle_epi8(*p_llrOut,*p_shuffle);
// Hard decision
*p_bits++ = _mm256_movemask_epi8(inPerm);
*p_bits++ = _mm256_movemask_epi8(*p_llrOut);
p_llrOut++;
}
......@@ -2816,11 +2805,11 @@ static inline void nrLDPC_llr2bitPacked(int8_t* out, int8_t* llrOut, uint16_t nu
{
if (p_llrOut8[i] < 0)
{
bitsTmp |= (1<<((7-i) + (16*(i/8))));
bitsTmp |= (1<<i);
}
else
{
bitsTmp |= (0<<((7-i) + (16*(i/8))));
bitsTmp &= (0<<i);
}
}
}
......
......@@ -22,7 +22,7 @@
/*!\file nrLDPC_cnProc.h
* \brief Defines the functions for check node processing
* \author Sebastian Wagner (TCL Communications) Email: <mailto:sebastian.wagner@tcl.com>
* \date 30-09-2019
* \date 27-03-2018
* \version 1.0
* \note
* \warning
......@@ -34,7 +34,6 @@
/**
\brief Performs CN processing for BG2 on the CN processing buffer and stores the results in the CN processing results buffer.
\param p_lut Pointer to decoder LUTs
\param p_procBuf Pointer to processing buffers
\param Z Lifting size
*/
static inline void nrLDPC_cnProc_BG2(t_nrLDPC_lut* p_lut, t_nrLDPC_procBuf* p_procBuf, uint16_t Z)
......
......@@ -22,8 +22,8 @@
/*!\file nrLDPC_decoder.c
* \brief Defines the LDPC decoder
* \author Sebastian Wagner (TCL Communications) Email: <mailto:sebastian.wagner@tcl.com>
* \date 30-09-2019
* \version 2.0
* \date 27-03-2018
* \version 1.0
* \note
* \warning
*/
......@@ -96,8 +96,6 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
{
// Use LLR processing buffer as temporary output buffer
p_llrOut = p_procBuf->llrProcBuf;
// Clear llrProcBuf
memset(p_llrOut,0, NR_LDPC_MAX_NUM_LLR*sizeof(int8_t));
}
......@@ -118,14 +116,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->llr2CnProcBuf);
#endif
if (BG == 1)
{
nrLDPC_llr2CnProcBuf_BG1(p_lut, p_llr, p_procBuf, Z);
}
else
{
nrLDPC_llr2CnProcBuf_BG2(p_lut, p_llr, p_procBuf, Z);
}
nrLDPC_llr2CnProcBuf(p_lut, p_llr, p_procBuf, numLLR, Z, BG);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llr2CnProcBuf);
#endif
......@@ -167,7 +158,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
}
else
{
nrLDPC_cn2bnProcBuf_BG2(p_lut, p_procBuf, Z);
nrLDPC_cn2bnProcBuf(p_lut, p_procBuf, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
......@@ -215,7 +206,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
}
else
{
nrLDPC_bn2cnProcBuf_BG2(p_lut, p_procBuf, Z);
nrLDPC_bn2cnProcBuf(p_lut, p_procBuf, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bn2cnProcBuf);
......@@ -266,7 +257,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
}
else
{
nrLDPC_cn2bnProcBuf_BG2(p_lut, p_procBuf, Z);
nrLDPC_cn2bnProcBuf(p_lut, p_procBuf, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
......@@ -311,7 +302,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
}
else
{
nrLDPC_bn2cnProcBuf_BG2(p_lut, p_procBuf, Z);
nrLDPC_bn2cnProcBuf(p_lut, p_procBuf, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bn2cnProcBuf);
......@@ -338,6 +329,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
stop_meas(&p_profiler->cnProcPc);
#endif
#endif
}
// Last iteration
......@@ -376,7 +368,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
}
else
{
nrLDPC_cn2bnProcBuf_BG2(p_lut, p_procBuf, Z);
nrLDPC_cn2bnProcBuf(p_lut, p_procBuf, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->cn2bnProcBuf);
......@@ -424,7 +416,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
}
else
{
nrLDPC_bn2cnProcBuf_BG2(p_lut, p_procBuf, Z);
nrLDPC_bn2cnProcBuf(p_lut, p_procBuf, Z);
}
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->bn2cnProcBuf);
......@@ -452,21 +444,19 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
#endif
}
// If maximum number of iterations reached an PC still fails increase number of iterations
// Thus, i > numMaxIter indicates that PC has failed
#ifdef NR_LDPC_ENABLE_PARITY_CHECK
if (pcRes != 0)
{
i++;
}
#endif
// Assign results from processing buffer to output
#ifdef NR_LDPC_PROFILER_DETAIL
start_meas(&p_profiler->llrRes2llrOut);
#endif
nrLDPC_llrRes2llrOut(p_lut, p_llrOut, p_procBuf, Z, BG);
nrLDPC_llrRes2llrOut(p_lut, p_llrOut, p_procBuf, numLLR);
#ifdef NR_LDPC_PROFILER_DETAIL
stop_meas(&p_profiler->llrRes2llrOut);
#endif
......
This source diff could not be displayed because it is too large. You can view the blob instead.
static const uint32_t lut_cn2bnProcBuf_BG1_Z10_R23[1440] = {52227, 52228, 52229, 52230, 52231, 52232, 52233, 52224, 52225, 52226, 47621, 47622, 47623, 47624, 47625, 47616, 47617, 47618, 47619, 47620, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 53378, 53379, 53380, 53381, 53382, 53383, 53384, 53385, 53376, 53377, 49540, 49541, 49542, 49543, 49544, 49545, 49536, 49537, 49538, 49539, 54921, 54912, 54913, 54914, 54915, 54916, 54917, 54918, 54919, 54920, 48392, 48393, 48384, 48385, 48386, 48387, 48388, 48389, 48390, 48391, 13440, 13441, 13442, 13443, 13444, 13445, 13446, 13447, 13448, 13449, 50309, 50310, 50311, 50312, 50313, 50304, 50305, 50306, 50307, 50308, 22673, 22674, 22675, 22666, 22667, 22668, 22669, 22670, 22671, 22672, 25355, 25356, 25357, 25358, 25359, 25360, 25361, 25362, 25363, 25354, 43401, 43392, 43393, 43394, 43395, 43396, 43397, 43398, 43399, 43400, 22676, 22677, 22678, 22679, 22680, 22681, 22682, 22683, 22684, 22685, 25369, 25370, 25371, 25372, 25373, 25364, 25365, 25366, 25367, 25368, 43410, 43411, 43402, 43403, 43404, 43405, 43406, 43407, 43408, 43409, 22691, 22692, 22693, 22694, 22695, 22686, 22687, 22688, 22689, 22690, 25375, 25376, 25377, 25378, 25379, 25380, 25381, 25382, 25383, 25374, 43427, 43428, 43429, 43430, 43431, 43422, 43423, 43424, 43425, 43426, 22702, 22703, 22704, 22705, 22696, 22697, 22698, 22699, 22700, 22701, 25385, 25386, 25387, 25388, 25389, 25390, 25391, 25392, 25393, 25384, 43444, 43445, 43446, 43447, 43448, 43449, 43450, 43451, 43442, 43443, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 52611, 52612, 52613, 52614, 52615, 52616, 52617, 52608, 52609, 52610, 54534, 54535, 54536, 54537, 54528, 54529, 54530, 54531, 54532, 54533, 48002, 48003, 48004, 48005, 48006, 48007, 48008, 48009, 48000, 48001, 49927, 49928, 49929, 49920, 49921, 49922, 49923, 49924, 49925, 49926, 22656, 22657, 22658, 22659, 22660, 22661, 22662, 22663, 22664, 22665, 43412, 43413, 43414, 43415, 43416, 43417, 43418, 43419, 43420, 43421, 37276, 37277, 37268, 37269, 37270, 37271, 37272, 37273, 37274, 37275, 43441, 43432, 43433, 43434, 43435, 43436, 43437, 43438, 43439, 43440, 37289, 37290, 37291, 37292, 37293, 37294, 37295, 37296, 37297, 37288, 43459, 43460, 43461, 43452, 43453, 43454, 43455, 43456, 43457, 43458, 37315, 37316, 37317, 37308, 37309, 37310, 37311, 37312, 37313, 37314, 43465, 43466, 43467, 43468, 43469, 43470, 43471, 43462, 43463, 43464, 37327, 37318, 37319, 37320, 37321, 37322, 37323, 37324, 37325, 37326, 8094, 8095, 8096, 8097, 8098, 8099, 8100, 8101, 8102, 8103, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 53001, 52992, 52993, 52994, 52995, 52996, 52997, 52998, 52999, 53000, 54153, 54144, 54145, 54146, 54147, 54148, 54149, 54150, 54151, 54152, 13451, 13452, 13453, 13454, 13455, 13456, 13457, 13458, 13459, 13450, 49156, 49157, 49158, 49159, 49160, 49161, 49152, 49153, 49154, 49155, 37251, 37252, 37253, 37254, 37255, 37256, 37257, 37248, 37249, 37250, 40326, 40327, 40328, 40329, 40320, 40321, 40322, 40323, 40324, 40325, 37261, 37262, 37263, 37264, 37265, 37266, 37267, 37258, 37259, 37260, 40336, 40337, 40338, 40339, 40330, 40331, 40332, 40333, 40334, 40335, 37280, 37281, 37282, 37283, 37284, 37285, 37286, 37287, 37278, 37279, 40351, 40352, 40353, 40354, 40355, 40356, 40357, 40358, 40359, 40350, 22708, 22709, 22710, 22711, 22712, 22713, 22714, 22715, 22706, 22707, 25401, 25402, 25403, 25394, 25395, 25396, 25397, 25398, 25399, 25400, 37306, 37307, 37298, 37299, 37300, 37301, 37302, 37303, 37304, 37305, 40375, 40376, 40377, 40378, 40379, 40370, 40371, 40372, 40373, 40374, 22721, 22722, 22723, 22724, 22725, 22716, 22717, 22718, 22719, 22720, 25413, 25404, 25405, 25406, 25407, 25408, 25409, 25410, 25411, 25412, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 53765, 53766, 53767, 53768, 53769, 53760, 53761, 53762, 53763, 53764, 48771, 48772, 48773, 48774, 48775, 48776, 48777, 48768, 48769, 48770, 25344, 25345, 25346, 25347, 25348, 25349, 25350, 25351, 25352, 25353, 40341, 40342, 40343, 40344, 40345, 40346, 40347, 40348, 40349, 40340, 40366, 40367, 40368, 40369, 40360, 40361, 40362, 40363, 40364, 40365, 13460, 13461, 13462, 13463, 13464, 13465, 13466, 13467, 13468, 13469, 40389, 40380, 40381, 40382, 40383, 40384, 40385, 40386, 40387, 40388, 40395, 40396, 40397, 40398, 40399, 40390, 40391, 40392, 40393, 40394, 8108, 8109, 8110, 8111, 8112, 8113, 8104, 8105, 8106, 8107, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50691, 50692, 50693, 50694, 50695, 50696, 50697, 50688, 50689, 50690, 51075, 51076, 51077, 51078, 51079, 51080, 51081, 51072, 51073, 51074, 51464, 51465, 51456, 51457, 51458, 51459, 51460, 51461, 51462, 51463, 51840, 51841, 51842, 51843, 51844, 51845, 51846, 51847, 51848, 51849, 46469, 46470, 46471, 46472, 46473, 46464, 46465, 46466, 46467, 46468, 11140, 11141, 11142, 11143, 11144, 11145, 11136, 11137, 11138, 11139, 46855, 46856, 46857, 46848, 46849, 46850, 46851, 46852, 46853, 46854, 47240, 47241, 47232, 47233, 47234, 47235, 47236, 47237, 47238, 47239, 9987, 9988, 9989, 9990, 9991, 9992, 9993, 9984, 9985, 9986, 17287, 17288, 17289, 17280, 17281, 17282, 17283, 17284, 17285, 17286, 12288, 12289, 12290, 12291, 12292, 12293, 12294, 12295, 12296, 12297, 19968, 19969, 19970, 19971, 19972, 19973, 19974, 19975, 19976, 19977, 14601, 14592, 14593, 14594, 14595, 14596, 14597, 14598, 14599, 14600, 14603, 14604, 14605, 14606, 14607, 14608, 14609, 14610, 14611, 14602, 17290, 17291, 17292, 17293, 17294, 17295, 17296, 17297, 17298, 17299, 19985, 19986, 19987, 19978, 19979, 19980, 19981, 19982, 19983, 19984, 4224, 4225, 4226, 4227, 4228, 4229, 4230, 4231, 4232, 4233, 6145, 6146, 6147, 6148, 6149, 6150, 6151, 6152, 6153, 6144, 8072, 8073, 8064, 8065, 8066, 8067, 8068, 8069, 8070, 8071, 12299, 12300, 12301, 12302, 12303, 12304, 12305, 12306, 12307, 12298, 10003, 9994, 9995, 9996, 9997, 9998, 9999, 10000, 10001, 10002, 14615, 14616, 14617, 14618, 14619, 14620, 14621, 14612, 14613, 14614, 11153, 11154, 11155, 11146, 11147, 11148, 11149, 11150, 11151, 11152, 19993, 19994, 19995, 19996, 19997, 19988, 19989, 19990, 19991, 19992, 4239, 4240, 4241, 4242, 4243, 4234, 4235, 4236, 4237, 4238, 14626, 14627, 14628, 14629, 14630, 14631, 14622, 14623, 14624, 14625, 17302, 17303, 17304, 17305, 17306, 17307, 17308, 17309, 17300, 17301, 20007, 19998, 19999, 20000, 20001, 20002, 20003, 20004, 20005, 20006, 28034, 28035, 28036, 28037, 28038, 28039, 28040, 28041, 28032, 28033, 6154, 6155, 6156, 6157, 6158, 6159, 6160, 6161, 6162, 6163, 17310, 17311, 17312, 17313, 17314, 17315, 17316, 17317, 17318, 17319, 34177, 34178, 34179, 34180, 34181, 34182, 34183, 34184, 34185, 34176, 28047, 28048, 28049, 28050, 28051, 28042, 28043, 28044, 28045, 28046, 31123, 31114, 31115, 31116, 31117, 31118, 31119, 31120, 31121, 31122, 8075, 8076, 8077, 8078, 8079, 8080, 8081, 8082, 8083, 8074, 34189, 34190, 34191, 34192, 34193, 34194, 34195, 34186, 34187, 34188, 28056, 28057, 28058, 28059, 28060, 28061, 28052, 28053, 28054, 28055, 31124, 31125, 31126, 31127, 31128, 31129, 31130, 31131, 31132, 31133, 31110, 31111, 31112, 31113, 31104, 31105, 31106, 31107, 31108, 31109, 34199, 34200, 34201, 34202, 34203, 34204, 34205, 34196, 34197, 34198, 28065, 28066, 28067, 28068, 28069, 28070, 28071, 28062, 28063, 28064, 14638, 14639, 14640, 14641, 14632, 14633, 14634, 14635, 14636, 14637, 31139, 31140, 31141, 31142, 31143, 31134, 31135, 31136, 31137, 31138, 34210, 34211, 34212, 34213, 34214, 34215, 34206, 34207, 34208, 34209, 4252, 4253, 4244, 4245, 4246, 4247, 4248, 4249, 4250, 4251, 6170, 6171, 6172, 6173, 6164, 6165, 6166, 6167, 6168, 6169, 17323, 17324, 17325, 17326, 17327, 17328, 17329, 17320, 17321, 17322, 20011, 20012, 20013, 20014, 20015, 20016, 20017, 20008, 20009, 20010, 28072, 28073, 28074, 28075, 28076, 28077, 28078, 28079, 28080, 28081, 31146, 31147, 31148, 31149, 31150, 31151, 31152, 31153, 31144, 31145, 8085, 8086, 8087, 8088, 8089, 8090, 8091, 8092, 8093, 8084, 34220, 34221, 34222, 34223, 34224, 34225, 34216, 34217, 34218, 34219, 28085, 28086, 28087, 28088, 28089, 28090, 28091, 28082, 28083, 28084, 14645, 14646, 14647, 14648, 14649, 14650, 14651, 14642, 14643, 14644, 17334, 17335, 17336, 17337, 17338, 17339, 17330, 17331, 17332, 17333, 20026, 20027, 20018, 20019, 20020, 20021, 20022, 20023, 20024, 20025, 10010, 10011, 10012, 10013, 10004, 10005, 10006, 10007, 10008, 10009, 11156, 11157, 11158, 11159, 11160, 11161, 11162, 11163, 11164, 11165, 31160, 31161, 31162, 31163, 31154, 31155, 31156, 31157, 31158, 31159, 34233, 34234, 34235, 34226, 34227, 34228, 34229, 34230, 34231, 34232, 14661, 14652, 14653, 14654, 14655, 14656, 14657, 14658, 14659, 14660, 31165, 31166, 31167, 31168, 31169, 31170, 31171, 31172, 31173, 31164, 12308, 12309, 12310, 12311, 12312, 12313, 12314, 12315, 12316, 12317, 20037, 20028, 20029, 20030, 20031, 20032, 20033, 20034, 20035, 20036, 28094, 28095, 28096, 28097, 28098, 28099, 28100, 28101, 28092, 28093, 31174, 31175, 31176, 31177, 31178, 31179, 31180, 31181, 31182, 31183, 17346, 17347, 17348, 17349, 17340, 17341, 17342, 17343, 17344, 17345, 34244, 34245, 34236, 34237, 34238, 34239, 34240, 34241, 34242, 34243, 28103, 28104, 28105, 28106, 28107, 28108, 28109, 28110, 28111, 28102, 6174, 6175, 6176, 6177, 6178, 6179, 6180, 6181, 6182, 6183, 6184, 6185, 6186, 6187, 6188, 6189, 6190, 6191, 6192, 6193, 34247, 34248, 34249, 34250, 34251, 34252, 34253, 34254, 34255, 34246, 4254, 4255, 4256, 4257, 4258, 4259, 4260, 4261, 4262, 4263, 4264, 4265, 4266, 4267, 4268, 4269, 4270, 4271, 4272, 4273, 3456, 3457, 3458, 3459, 3460, 3461, 3462, 3463, 3464, 3465, 3840, 3841, 3842, 3843, 3844, 3845, 3846, 3847, 3848, 3849};
\ No newline at end of file
static const uint32_t lut_cn2bnProcBuf_BG1_Z10_R89[790] = {29955, 29956, 29957, 29958, 29959, 29960, 29961, 29952, 29953, 29954, 28037, 28038, 28039, 28040, 28041, 28032, 28033, 28034, 28035, 28036, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 28419, 28420, 28421, 28422, 28423, 28424, 28425, 28416, 28417, 28418, 28803, 28804, 28805, 28806, 28807, 28808, 28809, 28800, 28801, 28802, 29192, 29193, 29184, 29185, 29186, 29187, 29188, 29189, 29190, 29191, 29568, 29569, 29570, 29571, 29572, 29573, 29574, 29575, 29576, 29577, 26885, 26886, 26887, 26888, 26889, 26880, 26881, 26882, 26883, 26884, 10756, 10757, 10758, 10759, 10760, 10761, 10752, 10753, 10754, 10755, 27271, 27272, 27273, 27264, 27265, 27266, 27267, 27268, 27269, 27270, 27656, 27657, 27648, 27649, 27650, 27651, 27652, 27653, 27654, 27655, 2691, 2692, 2693, 2694, 2695, 2696, 2697, 2688, 2689, 2690, 10769, 10770, 10771, 10762, 10763, 10764, 10765, 10766, 10767, 10768, 18816, 18817, 18818, 18819, 18820, 18821, 18822, 18823, 18824, 18825, 18826, 18827, 18828, 18829, 18830, 18831, 18832, 18833, 18834, 18835, 2707, 2698, 2699, 2700, 2701, 2702, 2703, 2704, 2705, 2706, 2709, 2710, 2711, 2712, 2713, 2714, 2715, 2716, 2717, 2708, 10772, 10773, 10774, 10775, 10776, 10777, 10778, 10779, 10780, 10781, 18843, 18844, 18845, 18836, 18837, 18838, 18839, 18840, 18841, 18842, 2718, 2719, 2720, 2721, 2722, 2723, 2724, 2725, 2726, 2727, 10783, 10784, 10785, 10786, 10787, 10788, 10789, 10790, 10791, 10782, 18854, 18855, 18846, 18847, 18848, 18849, 18850, 18851, 18852, 18853, 18857, 18858, 18859, 18860, 18861, 18862, 18863, 18864, 18865, 18856, 2737, 2728, 2729, 2730, 2731, 2732, 2733, 2734, 2735, 2736, 2741, 2742, 2743, 2744, 2745, 2746, 2747, 2738, 2739, 2740, 10799, 10800, 10801, 10792, 10793, 10794, 10795, 10796, 10797, 10798, 18871, 18872, 18873, 18874, 18875, 18866, 18867, 18868, 18869, 18870, 2763, 2764, 2765, 2766, 2767, 2758, 2759, 2760, 2761, 2762, 2752, 2753, 2754, 2755, 2756, 2757, 2748, 2749, 2750, 2751, 10804, 10805, 10806, 10807, 10808, 10809, 10810, 10811, 10802, 10803, 18885, 18876, 18877, 18878, 18879, 18880, 18881, 18882, 18883, 18884, 2770, 2771, 2772, 2773, 2774, 2775, 2776, 2777, 2768, 2769, 10822, 10823, 10824, 10825, 10826, 10827, 10828, 10829, 10830, 10831, 10812, 10813, 10814, 10815, 10816, 10817, 10818, 10819, 10820, 10821, 18897, 18898, 18899, 18900, 18901, 18902, 18903, 18904, 18905, 18896, 2783, 2784, 2785, 2786, 2787, 2778, 2779, 2780, 2781, 2782, 10851, 10842, 10843, 10844, 10845, 10846, 10847, 10848, 10849, 10850, 18887, 18888, 18889, 18890, 18891, 18892, 18893, 18894, 18895, 18886, 18909, 18910, 18911, 18912, 18913, 18914, 18915, 18906, 18907, 18908, 2792, 2793, 2794, 2795, 2796, 2797, 2788, 2789, 2790, 2791, 10852, 10853, 10854, 10855, 10856, 10857, 10858, 10859, 10860, 10861, 10838, 10839, 10840, 10841, 10832, 10833, 10834, 10835, 10836, 10837, 18919, 18920, 18921, 18922, 18923, 18924, 18925, 18916, 18917, 18918, 2801, 2802, 2803, 2804, 2805, 2806, 2807, 2798, 2799, 2800, 2814, 2815, 2816, 2817, 2808, 2809, 2810, 2811, 2812, 2813, 10867, 10868, 10869, 10870, 10871, 10862, 10863, 10864, 10865, 10866, 18930, 18931, 18932, 18933, 18934, 18935, 18926, 18927, 18928, 18929, 2826, 2827, 2818, 2819, 2820, 2821, 2822, 2823, 2824, 2825, 10888, 10889, 10890, 10891, 10882, 10883, 10884, 10885, 10886, 10887, 10875, 10876, 10877, 10878, 10879, 10880, 10881, 10872, 10873, 10874, 18939, 18940, 18941, 18942, 18943, 18944, 18945, 18936, 18937, 18938, 2828, 2829, 2830, 2831, 2832, 2833, 2834, 2835, 2836, 2837, 10894, 10895, 10896, 10897, 10898, 10899, 10900, 10901, 10892, 10893, 18947, 18948, 18949, 18950, 18951, 18952, 18953, 18954, 18955, 18946, 18960, 18961, 18962, 18963, 18964, 18965, 18956, 18957, 18958, 18959, 2851, 2852, 2853, 2854, 2855, 2856, 2857, 2848, 2849, 2850, 2841, 2842, 2843, 2844, 2845, 2846, 2847, 2838, 2839, 2840, 10906, 10907, 10908, 10909, 10910, 10911, 10902, 10903, 10904, 10905, 18974, 18975, 18966, 18967, 18968, 18969, 18970, 18971, 18972, 18973, 2864, 2865, 2866, 2867, 2858, 2859, 2860, 2861, 2862, 2863, 10922, 10923, 10924, 10925, 10926, 10927, 10928, 10929, 10930, 10931, 10918, 10919, 10920, 10921, 10912, 10913, 10914, 10915, 10916, 10917, 18983, 18984, 18985, 18976, 18977, 18978, 18979, 18980, 18981, 18982, 2877, 2868, 2869, 2870, 2871, 2872, 2873, 2874, 2875, 2876, 10943, 10944, 10945, 10946, 10947, 10948, 10949, 10950, 10951, 10942, 18986, 18987, 18988, 18989, 18990, 18991, 18992, 18993, 18994, 18995, 19005, 18996, 18997, 18998, 18999, 19000, 19001, 19002, 19003, 19004, 2880, 2881, 2882, 2883, 2884, 2885, 2886, 2887, 2878, 2879, 10952, 10953, 10954, 10955, 10956, 10957, 10958, 10959, 10960, 10961, 10938, 10939, 10940, 10941, 10932, 10933, 10934, 10935, 10936, 10937, 19014, 19015, 19006, 19007, 19008, 19009, 19010, 19011, 19012, 19013, 2889, 2890, 2891, 2892, 2893, 2894, 2895, 2896, 2897, 2888, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 1543, 1544, 1545, 1546, 1547, 1548, 1549, 1550, 1551, 1552, 1553, 1554, 1555, 19017, 19018, 19019, 19020, 19021, 19022, 19023, 19024, 19025, 19016, 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 1556, 1557, 1558, 1559, 1560, 1561, 1562, 1563, 1564, 1565};
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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