Merge remote-tracking branch 'origin/develop' into develop-oriecpriupdates
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
*.log
|
||||
cmake_targets/log/
|
||||
cmake_targets/ran_build/
|
||||
common/utils/T/T_IDs.h
|
||||
common/utils/T/T_messages.txt.h
|
||||
common/utils/T/genids
|
||||
common/utils/T/genids.o
|
||||
targets/bin/
|
||||
@@ -35,6 +35,9 @@ def doFlexranCtrlTest = false
|
||||
// Location of the executor node
|
||||
def nodeExecutor = params.nodeExecutor
|
||||
|
||||
// VM Lockable resources
|
||||
def vmResource = params.vmLockableResource
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label nodeExecutor
|
||||
@@ -159,65 +162,81 @@ pipeline {
|
||||
|
||||
stage ("Start VM -- basic-sim") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 5, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- gnb-usrp") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 5, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- nr-ue-usrp") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 5, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant nr-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- enb-usrp") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 5, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- phy-sim") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 5, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- enb-ethernet") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 7, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant enb-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- ue-ethernet") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 7, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- cppcheck") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 7, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,11 +307,14 @@ pipeline {
|
||||
}
|
||||
stage ("Build UE-ethernet") {
|
||||
steps {
|
||||
// This is typically the last one to finish.
|
||||
lock (vmResource) {
|
||||
gitlabCommitStatus(name: "Build UE-ethernet") {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant ue-ethernet --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -354,6 +376,7 @@ pipeline {
|
||||
stages {
|
||||
stage ("Test physical simulators") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 90, unit: 'MINUTES') {
|
||||
try {
|
||||
@@ -365,6 +388,7 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build Flexran Controller") {
|
||||
@@ -372,6 +396,7 @@ pipeline {
|
||||
expression {doFlexranCtrlTest}
|
||||
}
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
try {
|
||||
@@ -381,10 +406,12 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test basic simulator") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
try {
|
||||
@@ -396,10 +423,12 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test L1 simulator") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
try {
|
||||
@@ -411,10 +440,12 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test RF simulator") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 40, unit: 'MINUTES') {
|
||||
try {
|
||||
@@ -426,10 +457,12 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test L2 simulator") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
try {
|
||||
@@ -441,11 +474,14 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Destroy all Virtual Machines") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
sh "./ci-scripts/oai-ci-vm-tool destroy --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,6 +266,42 @@ pipeline {
|
||||
}
|
||||
stage('Log Collection') {
|
||||
parallel {
|
||||
stage('Log Collection (eNB - Build)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (eNB - Build)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (eNB - Build)\u001B[0m'
|
||||
sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("build.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "build.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (OAI UE - Build)') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mLog Collection (OAI UE - Build)\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectBuild --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (UE - Build)\u001B[0m'
|
||||
sh "sshpass -p \'${UE_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${UE_Username}@${params.UE_IPAddress}:${UE_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("build.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "build.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (eNB - Run)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
|
||||
@@ -59,7 +59,7 @@ if [ $# -eq 0 ]
|
||||
then
|
||||
echo " ---- Checking the whole repository ----"
|
||||
echo ""
|
||||
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted `
|
||||
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted || true`
|
||||
echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT"
|
||||
echo $NB_FILES_TO_FORMAT > ./oai_rules_result.txt
|
||||
|
||||
@@ -67,17 +67,17 @@ then
|
||||
awk '/#[ \t]*ifndef/ { gsub("^.*ifndef *",""); if (names[$1]!="") print "files with same {define ", FILENAME, names[$1]; names[$1]=FILENAME } /#[ \t]*define/ { gsub("^.*define *",""); if(names[$1]!=FILENAME) print "error in declaration", FILENAME, $1, names[$1]; nextfile }' `find openair* common targets executables -name *.h |grep -v LFDS` > header-files-w-incorrect-define.txt
|
||||
|
||||
# Testing if explicit GNU GPL license banner
|
||||
egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "General Public License" . > files-w-gnu-gpl-license-banner.txt
|
||||
egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "General Public License" . | egrep -v "openair3/NAS/COMMON/milenage.h" > files-w-gnu-gpl-license-banner.txt
|
||||
|
||||
# Looking at exotic/suspect banner
|
||||
LIST_OF_FILES_W_BANNER=`egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "Copyright|copyleft" .`
|
||||
if [ -f ./files-w-suspect-banner.txt ]; then rm -f ./files-w-suspect-banner.txt; fi
|
||||
for FILE in $LIST_OF_FILES_W_BANNER
|
||||
do
|
||||
IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext"`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FILE`
|
||||
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_"`
|
||||
IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FILE || true`
|
||||
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair3/NAS/COMMON/milenage.h" || true`
|
||||
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
|
||||
then
|
||||
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
|
||||
@@ -178,7 +178,7 @@ do
|
||||
EXT="${filename##*.}"
|
||||
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
|
||||
then
|
||||
TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted `
|
||||
TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted || true`
|
||||
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
|
||||
if [ $TO_FORMAT -ne 0 ]
|
||||
then
|
||||
@@ -186,15 +186,19 @@ do
|
||||
echo $FULLFILE >> ./oai_rules_result_list.txt
|
||||
fi
|
||||
# Testing if explicit GNU GPL license banner
|
||||
egrep -i "General Public License" $FULLFILE >> files-w-gnu-gpl-license-banner.txt
|
||||
GNU_EXCEPTION=`echo $FULLFILE | egrep -c "openair3/NAS/COMMON/milenage.h" || true`
|
||||
if [ $GNU_EXCEPTION -eq 0 ]
|
||||
then
|
||||
egrep -il "General Public License" $FULLFILE >> files-w-gnu-gpl-license-banner.txt
|
||||
fi
|
||||
# Looking at exotic/suspect banner
|
||||
IS_BANNER=`egrep -i -c "Copyright|copyleft" $FULLFILE`
|
||||
IS_BANNER=`egrep -i -c "Copyright|copyleft" $FULLFILE || true`
|
||||
if [ $IS_BANNER -ne 0 ]
|
||||
then
|
||||
IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext"`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FULLFILE`
|
||||
IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_"`
|
||||
IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FULLFILE || true`
|
||||
IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair3/NAS/COMMON/milenage.h" || true`
|
||||
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
|
||||
then
|
||||
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
|
||||
|
||||
@@ -72,6 +72,9 @@ class OaiCiTest():
|
||||
self.ADBCentralized = True
|
||||
self.testCase_id = ''
|
||||
self.testXMLfiles = []
|
||||
self.testUnstable = False
|
||||
self.testMinStableId = '999999'
|
||||
self.testStabilityPointReached = False
|
||||
self.desc = ''
|
||||
self.ping_args = ''
|
||||
self.ping_packetloss_threshold = ''
|
||||
@@ -211,7 +214,7 @@ class OaiCiTest():
|
||||
logging.error('\u001B[1m Building OAI UE Failed\u001B[0m')
|
||||
HTML.CreateHtmlTestRow(self.Build_OAI_UE_args, 'KO', CONST.ALL_PROCESSES_OK, 'OAI UE')
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
self.ConditionalExit()
|
||||
|
||||
def CheckFlexranCtrlInstallation(self,RAN,EPC):
|
||||
if EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '':
|
||||
@@ -335,7 +338,7 @@ class OaiCiTest():
|
||||
if (pStatus < 0):
|
||||
HTML.CreateHtmlTestRow(self.air_interface + ' ' + self.Initialize_OAI_UE_args, 'KO', pStatus)
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
self.ConditionalExit()
|
||||
UE_prefix = ''
|
||||
else:
|
||||
UE_prefix = 'NR '
|
||||
@@ -719,7 +722,7 @@ class OaiCiTest():
|
||||
logging.debug('Using the OAI EPC HSS: not implemented yet')
|
||||
HTML.CreateHtmlTestRow(self.ping_args, 'KO', pStatus)
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
self.ConditionalExit()
|
||||
else:
|
||||
SSH.command('egrep --color=never "Allocated ipv4 addr" /opt/ltebox/var/log/xGwLog.0', '\$', 5)
|
||||
result = re.search('Allocated ipv4 addr: (?P<ipaddr>[0-9\.]+) from Pool', SSH.getBefore())
|
||||
@@ -1046,7 +1049,7 @@ class OaiCiTest():
|
||||
if (pStatus < 0):
|
||||
HTML.CreateHtmlTestRow('N/A', 'KO', pStatus)
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
self.ConditionalExit()
|
||||
multi_jobs = []
|
||||
for device_id in self.UEDevices:
|
||||
p = Process(target = self.RebootUE_common, args = (device_id,))
|
||||
@@ -1154,15 +1157,18 @@ class OaiCiTest():
|
||||
self.UEDevicesRebootCmd.append(comma_split[5])
|
||||
phone_list_file.close()
|
||||
|
||||
# better handling of the case when no UE detected
|
||||
# Sys-exit is now dealt by the calling function
|
||||
if terminate_ue_flag == True:
|
||||
if len(self.UEDevices) == 0:
|
||||
logging.debug('\u001B[1;37;41m UE Not Found! \u001B[0m')
|
||||
sys.exit(1)
|
||||
return False
|
||||
if len(self.UEDevicesStatus) == 0:
|
||||
cnt = 0
|
||||
while cnt < len(self.UEDevices):
|
||||
self.UEDevicesStatus.append(CONST.UE_STATUS_DETACHED)
|
||||
cnt += 1
|
||||
return True
|
||||
|
||||
def GetAllCatMDevices(self, terminate_ue_flag):
|
||||
if self.ADBIPAddress == '' or self.ADBUserName == '' or self.ADBPassword == '':
|
||||
@@ -1248,7 +1254,7 @@ class OaiCiTest():
|
||||
if (pStatus < 0):
|
||||
HTML.CreateHtmlTestRow('N/A', 'KO', pStatus)
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
sys.exit(1)
|
||||
self.ConditionalExit()
|
||||
multi_jobs = []
|
||||
lock = Lock()
|
||||
status_queue = SimpleQueue()
|
||||
@@ -1386,7 +1392,14 @@ class OaiCiTest():
|
||||
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
|
||||
SSH.command('cd ' + EPC.SourceCodePath, '\$', 5)
|
||||
SSH.command('cd scripts', '\$', 5)
|
||||
ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
|
||||
# In case of a docker-based deployment, we need to ping from the trf-gen container
|
||||
launchFromTrfContainer = False
|
||||
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
|
||||
launchFromTrfContainer = True
|
||||
if launchFromTrfContainer:
|
||||
ping_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "ping ' + self.ping_args + ' ' + UE_IPAddress + '" 2>&1 | tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
|
||||
else:
|
||||
ping_status = SSH.command('stdbuf -o0 ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 | stdbuf -o0 tee ping_' + self.testCase_id + '_' + device_id + '.log', '\$', int(ping_time[0])*1.5)
|
||||
else:
|
||||
cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log'
|
||||
message = cmd + '\n'
|
||||
@@ -2028,7 +2041,8 @@ class OaiCiTest():
|
||||
SSH.command('adb -s ' + device_id + ' shell "ls /data/local/tmp"', '\$', 5)
|
||||
else:
|
||||
SSH.command('ssh ' + self.UEDevicesRemoteUser[idx] + '@' + self.UEDevicesRemoteServer[idx] + ' \'adb -s ' + device_id + ' shell "ls /data/local/tmp"\'', '\$', 60)
|
||||
result = re.search('iperf3', SSH.getBefore())
|
||||
# DEBUG: disabling iperf3 usage for the moment
|
||||
result = re.search('iperf4', SSH.getBefore())
|
||||
if result is None:
|
||||
result = re.search('iperf', SSH.getBefore())
|
||||
if result is None:
|
||||
@@ -2105,6 +2119,10 @@ class OaiCiTest():
|
||||
launchFromEpc = True
|
||||
if re.match('OAI-Rel14-CUPS', EPC.Type, re.IGNORECASE):
|
||||
launchFromEpc = False
|
||||
# When using a docker-based deployment, IPERF client shall be launched from trf container
|
||||
launchFromTrfContainer = False
|
||||
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
|
||||
launchFromTrfContainer = True
|
||||
if launchFromEpc:
|
||||
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
|
||||
SSH.command('cd ' + EPC.SourceCodePath + '/scripts', '\$', 5)
|
||||
@@ -2129,7 +2147,16 @@ class OaiCiTest():
|
||||
self.Iperf_analyzeV3Output(lock, UE_IPAddress, device_id, statusQueue,SSH)
|
||||
else:
|
||||
if launchFromEpc:
|
||||
iperf_status = SSH.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0)
|
||||
if launchFromTrfContainer:
|
||||
if self.ueIperfVersion == self.dummyIperfVersion:
|
||||
prefix = ''
|
||||
else:
|
||||
prefix = ''
|
||||
if self.ueIperfVersion == '2.0.5':
|
||||
prefix = '/iperf-2.0.5/bin/'
|
||||
iperf_status = SSH.command('docker exec -it prod-trf-gen /bin/bash -c "' + prefix + 'iperf -c ' + UE_IPAddress + ' ' + modified_options + '" 2>&1 | tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0)
|
||||
else:
|
||||
iperf_status = SSH.command('stdbuf -o0 iperf -c ' + UE_IPAddress + ' ' + modified_options + ' 2>&1 | stdbuf -o0 tee iperf_' + self.testCase_id + '_' + device_id + '.log', '\$', int(iperf_time)*5.0)
|
||||
else:
|
||||
if self.ueIperfVersion == self.dummyIperfVersion:
|
||||
prefix = ''
|
||||
@@ -3148,6 +3175,12 @@ class OaiCiTest():
|
||||
HTML.CpuMHz[idx]=CpuMHz
|
||||
SSH.close()
|
||||
|
||||
def ConditionalExit(self):
|
||||
if self.testUnstable:
|
||||
if self.testStabilityPointReached or self.testMinStableId == '999999':
|
||||
sys.exit(0)
|
||||
sys.exit(1)
|
||||
|
||||
def ShowTestID(self):
|
||||
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
|
||||
logging.debug('\u001B[1mTest ID:' + self.testCase_id + '\u001B[0m')
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs = (
|
||||
{
|
||||
ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs = (
|
||||
{
|
||||
ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs = (
|
||||
{
|
||||
ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -356,6 +356,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ gNBs =
|
||||
dl_carrierBandwidth = 106;
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=50 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 13475;
|
||||
# this is RBstart=41,L=24 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 6366;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
@@ -59,7 +59,7 @@ gNBs =
|
||||
#initialULBWPmappingType
|
||||
#0=typeA,1=typeB
|
||||
initialDLBWPmappingType_0 = 0;
|
||||
#this is SS=2,L=3
|
||||
#this is SS=1,L=13
|
||||
initialDLBWPstartSymbolAndLength_0 = 40;
|
||||
|
||||
initialDLBWPk0_1 = 0;
|
||||
@@ -74,7 +74,7 @@ gNBs =
|
||||
|
||||
initialDLBWPk0_3 = 0;
|
||||
initialDLBWPmappingType_3 = 0;
|
||||
#this is SS=1,L=4
|
||||
#this is SS=1,L=5
|
||||
initialDLBWPstartSymbolAndLength_3 = 57;
|
||||
|
||||
#uplinkConfigCommon
|
||||
@@ -89,7 +89,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 13475;
|
||||
initialULBWPlocationAndBandwidth = 6366;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
@@ -126,17 +126,17 @@ gNBs =
|
||||
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
|
||||
#
|
||||
msg1_SubcarrierSpacing = 1,
|
||||
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
@@ -145,7 +145,7 @@ gNBs =
|
||||
initialULBWPmappingType_2 = 1;
|
||||
# this is SS=10 L=4
|
||||
initialULBWPstartSymbolAndLength_2 = 52;
|
||||
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
@@ -204,6 +204,7 @@ gNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
@@ -249,7 +250,7 @@ RUs = (
|
||||
eNB_instances = [0];
|
||||
#beamforming 1x4 matrix:
|
||||
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
|
||||
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2";
|
||||
sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
|
||||
clock_src = "external";
|
||||
}
|
||||
);
|
||||
|
||||
@@ -201,6 +201,7 @@ gNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
@@ -291,3 +292,6 @@ THREAD_STRUCT = (
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
uicc: {
|
||||
opc = "testopc";
|
||||
};
|
||||
|
||||
@@ -173,6 +173,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.15.130";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "127.0.0.3";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -84,6 +84,12 @@ nullPointer:common/utils/T/tracer/multi.c:265
|
||||
arrayIndexOutOfBounds:openair2/LAYER2/rlc_v2/tests/test.c:401
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// this file is used for testing the NR RLC implementation, this error is
|
||||
// not a problem, the programmer has to know what she does when writing
|
||||
// the tests
|
||||
arrayIndexOutOfBounds:openair2/LAYER2/nr_rlc/tests/test.c:451
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// cppcheck does not understand the different lengths of arrays
|
||||
arrayIndexOutOfBounds:openair1/SIMULATION/TOOLS/random_channel.c:705
|
||||
arrayIndexOutOfBounds:openair1/SIMULATION/TOOLS/random_channel.c:706
|
||||
|
||||
+2
-1
@@ -65,6 +65,7 @@ class EPCManagement():
|
||||
self.testCase_id = ''
|
||||
self.MmeIPAddress = ''
|
||||
self.containerPrefix = 'prod'
|
||||
self.mmeConfFile = 'mme.conf'
|
||||
|
||||
|
||||
#-----------------------------------------------------------
|
||||
@@ -127,7 +128,7 @@ class EPCManagement():
|
||||
logging.debug('Using the OAI EPC Release 14 MME in Docker')
|
||||
mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup tshark -i eth0 -i lo:s10 -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 5)
|
||||
time.sleep(5)
|
||||
mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/mme.conf > mme_check_run.log 2>&1"', '\$', 5)
|
||||
mySSH.command('docker exec -d ' + self.containerPrefix + '-oai-mme /bin/bash -c "nohup ./bin/oai_mme -c ./etc/' + self.mmeConfFile + ' > mme_check_run.log 2>&1"', '\$', 5)
|
||||
elif re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
|
||||
logging.debug('Using the OAI EPC Release 14 MME')
|
||||
mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5)
|
||||
|
||||
+16
-2
@@ -64,6 +64,10 @@ class HTMLManagement():
|
||||
self.htmlTabIcons = []
|
||||
self.testXMLfiles = []
|
||||
|
||||
self.testUnstable = False
|
||||
self.testMinStableId = '999999'
|
||||
self.testStabilityPointReached = False
|
||||
|
||||
self.htmleNBFailureMsg = ''
|
||||
self.htmlUEFailureMsg = ''
|
||||
|
||||
@@ -230,13 +234,20 @@ class HTMLManagement():
|
||||
|
||||
def CreateHtmlTabFooter(self, passStatus):
|
||||
if ((not self.htmlFooterCreated) and (self.htmlHeaderCreated)):
|
||||
testOkEvenIfUnstable = False
|
||||
if self.testUnstable and not passStatus:
|
||||
if self.testStabilityPointReached or self.testMinStableId == '999999':
|
||||
testOkEvenIfUnstable = True
|
||||
self.htmlFile = open('test_results.html', 'a')
|
||||
self.htmlFile.write(' <tr>\n')
|
||||
self.htmlFile.write(' <th bgcolor = "#33CCFF" colspan=3>Final Tab Status</th>\n')
|
||||
if passStatus:
|
||||
self.htmlFile.write(' <th bgcolor = "green" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">PASS <span class="glyphicon glyphicon-ok"></span> </font></th>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <th bgcolor = "red" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
if testOkEvenIfUnstable:
|
||||
self.htmlFile.write(' <th bgcolor = "orange" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">KNOWN UNSTABLE SCENARIO <span class="glyphicon glyphicon-exclamation-sign"></span> </font></th>\n')
|
||||
else:
|
||||
self.htmlFile.write(' <th bgcolor = "red" colspan=' + str(2 + self.htmlUEConnected) + '><font color="white">FAIL <span class="glyphicon glyphicon-remove"></span> </font></th>\n')
|
||||
self.htmlFile.write(' </tr>\n')
|
||||
self.htmlFile.write(' </table>\n')
|
||||
self.htmlFile.write(' </div>\n')
|
||||
@@ -246,7 +257,10 @@ class HTMLManagement():
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__//' test_results.html"
|
||||
subprocess.run(cmd, shell=True)
|
||||
else:
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-remove\"><\/span>/' test_results.html"
|
||||
if testOkEvenIfUnstable:
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-exclamation-sign\"><\/span>/' test_results.html"
|
||||
else:
|
||||
cmd = "sed -i -e 's/__STATE_" + self.htmlTabNames[0] + "__/<span class=\"glyphicon glyphicon-remove\"><\/span>/' test_results.html"
|
||||
subprocess.run(cmd, shell=True)
|
||||
self.htmlFooterCreated = False
|
||||
|
||||
|
||||
+29
-2
@@ -283,6 +283,11 @@ def GetParametersFromXML(action):
|
||||
else:
|
||||
ldpc.forced_workspace_cleanup=False
|
||||
|
||||
elif action == 'Initialize_MME':
|
||||
string_field = test.findtext('option')
|
||||
if (string_field is not None):
|
||||
EPC.mmeConfFile = string_field
|
||||
|
||||
else: # ie action == 'Run_PhySim':
|
||||
ldpc.runargs = test.findtext('physim_run_args')
|
||||
|
||||
@@ -489,6 +494,9 @@ elif re.match('^FinalizeHtml$', mode, re.IGNORECASE):
|
||||
CiTestObj.RetrieveSystemVersion('UE',HTML,RAN)
|
||||
HTML.CreateHtmlFooter(CiTestObj.finalStatus)
|
||||
elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re.IGNORECASE):
|
||||
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
|
||||
logging.debug('\u001B[1m Starting Scenario \u001B[0m')
|
||||
logging.debug('\u001B[1m----------------------------------------\u001B[0m')
|
||||
if re.match('^TesteNB$', mode, re.IGNORECASE):
|
||||
if RAN.eNBIPAddress == '' or RAN.ranRepository == '' or RAN.ranBranch == '' or RAN.eNBUserName == '' or RAN.eNBPassword == '' or RAN.eNBSourceCodePath == '' or EPC.IPAddress == '' or EPC.UserName == '' or EPC.Password == '' or EPC.Type == '' or EPC.SourceCodePath == '' or CiTestObj.ADBIPAddress == '' or CiTestObj.ADBUserName == '' or CiTestObj.ADBPassword == '':
|
||||
HELP.GenericHelp(CONST.Version)
|
||||
@@ -524,7 +532,14 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
HTML.htmlTabRefs.append(xmlRoot.findtext('htmlTabRef',default='test-tab-0'))
|
||||
HTML.htmlTabNames.append(xmlRoot.findtext('htmlTabName',default='Test-0'))
|
||||
repeatCount = xmlRoot.findtext('repeatCount',default='1')
|
||||
testStability = xmlRoot.findtext('TestUnstable',default='False')
|
||||
CiTestObj.repeatCounts.append(int(repeatCount))
|
||||
if testStability == 'True':
|
||||
CiTestObj.testUnstable = True
|
||||
HTML.testUnstable = True
|
||||
CiTestObj.testMinStableId = xmlRoot.findtext('TestMinId',default='999999')
|
||||
HTML.testMinStableId = CiTestObj.testMinStableId
|
||||
logging.debug('Test is tagged as Unstable -- starting from TestID ' + str(CiTestObj.testMinStableId))
|
||||
all_tests=xmlRoot.findall('testCase')
|
||||
|
||||
exclusion_tests=exclusion_tests.split()
|
||||
@@ -605,7 +620,11 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
if (CiTestObj.ADBIPAddress != 'none'):
|
||||
#in these cases, having no devices is critical, GetAllUEDevices function has to manage it as a critical error, reason why terminate_ue_flag is set to True
|
||||
terminate_ue_flag = True
|
||||
CiTestObj.GetAllUEDevices(terminate_ue_flag)
|
||||
# Now we stop properly the test-suite --> clean reporting
|
||||
status = CiTestObj.GetAllUEDevices(terminate_ue_flag)
|
||||
if not status:
|
||||
RAN.prematureExit = True
|
||||
break
|
||||
if action == 'Build_eNB':
|
||||
RAN.BuildeNB()
|
||||
elif action == 'WaitEndBuild_eNB':
|
||||
@@ -681,11 +700,19 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
|
||||
HTML=ldpc.Run_PhySim(HTML,CONST,id)
|
||||
else:
|
||||
sys.exit('Invalid class (action) from xml')
|
||||
if not RAN.prematureExit:
|
||||
if CiTestObj.testCase_id == CiTestObj.testMinStableId:
|
||||
logging.debug('Scenario has reached minimal stability point')
|
||||
CiTestObj.testStabilityPointReached = True
|
||||
HTML.testStabilityPointReached = True
|
||||
CiTestObj.FailReportCnt += 1
|
||||
if CiTestObj.FailReportCnt == CiTestObj.repeatCounts[0] and RAN.prematureExit:
|
||||
logging.debug('Testsuite failed ' + str(CiTestObj.FailReportCnt) + ' time(s)')
|
||||
HTML.CreateHtmlTabFooter(False)
|
||||
sys.exit('Failed Scenario')
|
||||
if CiTestObj.testUnstable and (CiTestObj.testStabilityPointReached or CiTestObj.testMinStableId == '999999'):
|
||||
logging.debug('Scenario has reached minimal stability point -- Not a Failure')
|
||||
else:
|
||||
sys.exit('Failed Scenario')
|
||||
else:
|
||||
logging.info('Testsuite passed after ' + str(CiTestObj.FailReportCnt) + ' time(s)')
|
||||
HTML.CreateHtmlTabFooter(True)
|
||||
|
||||
+39
-2
@@ -133,7 +133,7 @@ class RANManagement():
|
||||
self.air_interface[self.eNB_instance] = 'nr-softmodem'
|
||||
else:
|
||||
self.air_interface[self.eNB_instance] = 'lte-softmodem'
|
||||
|
||||
|
||||
# Worakround for some servers, we need to erase completely the workspace
|
||||
if self.Build_eNB_forced_workspace_cleanup:
|
||||
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15)
|
||||
@@ -427,7 +427,7 @@ class RANManagement():
|
||||
# Launch eNB with the modified config file
|
||||
mySSH.command('source oaienv', '\$', 5)
|
||||
mySSH.command('cd cmake_targets', '\$', 5)
|
||||
if self.air_interface == 'nr':
|
||||
if self.air_interface[self.eNB_instance] == 'nr-softmodem':
|
||||
mySSH.command('if [ -e rbconfig.raw ]; then echo ' + lPassWord + ' | sudo -S rm rbconfig.raw; fi', '\$', 5)
|
||||
mySSH.command('if [ -e reconfig.raw ]; then echo ' + lPassWord + ' | sudo -S rm reconfig.raw; fi', '\$', 5)
|
||||
# NOTE: WE SHALL do a check if the executable is present (in case build went wrong)
|
||||
@@ -705,6 +705,11 @@ class RANManagement():
|
||||
systemTime = ''
|
||||
maxPhyMemUsage = ''
|
||||
nbContextSwitches = ''
|
||||
#NSA FR1 check
|
||||
NSA_RAPROC_PUSCH_check = 0
|
||||
#dlsch and ulsch statistics (dictionary)
|
||||
dlsch_ulsch_stats = {}
|
||||
|
||||
for line in enb_log_file.readlines():
|
||||
# Runtime statistics
|
||||
result = re.search('Run time:' ,str(line))
|
||||
@@ -855,12 +860,27 @@ class RANManagement():
|
||||
result = re.search('MBMS USER-PLANE.*Requesting.*bytes from RLC', str(line))
|
||||
if result is not None:
|
||||
mbmsRequestMsg += 1
|
||||
#FR1 NSA test : add new markers to make sure gNB is used
|
||||
result = re.search('\[gNB [0-9]+\]\[RAPROC\] PUSCH with TC_RNTI [0-9a-fA-F]+ received correctly, adding UE MAC Context UE_id [0-9]+\/RNTI [0-9a-fA-F]+', str(line))
|
||||
if result is not None:
|
||||
NSA_RAPROC_PUSCH_check = 1
|
||||
#dlsch and ulsch statistics
|
||||
#keys below are the markers we are loooking for, loop over this keys list
|
||||
#everytime these markers are found in the log file, the previous ones are overwritten in the dict
|
||||
#eventually we record and print only the last occurence
|
||||
keys = {'dlsch_rounds','dlsch_total_bytes','ulsch_rounds','ulsch_total_bytes_scheduled'}
|
||||
for k in keys:
|
||||
result = re.search(k, line)
|
||||
if result is not None:
|
||||
#remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char
|
||||
dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip())
|
||||
enb_log_file.close()
|
||||
logging.debug(' File analysis completed')
|
||||
if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'):
|
||||
nodeB_prefix = 'e'
|
||||
else:
|
||||
nodeB_prefix = 'g'
|
||||
|
||||
if self.air_interface[self.eNB_instance] == 'nr-softmodem':
|
||||
if ulschReceiveOK > 0:
|
||||
statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)'
|
||||
@@ -874,6 +894,23 @@ class RANManagement():
|
||||
statMsg = nodeB_prefix + 'NB ran with TX Write thread enabled'
|
||||
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
|
||||
htmleNBFailureMsg += statMsg + '\n'
|
||||
#FR1 NSA test : add new markers to make sure gNB is used
|
||||
if NSA_RAPROC_PUSCH_check:
|
||||
statMsg = '[RAPROC] PUSCH with TC_RNTI message check for ' + nodeB_prefix + 'NB : PASS '
|
||||
htmlMsg = statMsg+'\n'
|
||||
else:
|
||||
statMsg = '[RAPROC] PUSCH with TC_RNTI message check for ' + nodeB_prefix + 'NB : FAIL '
|
||||
htmlMsg = statMsg+'\n'
|
||||
logging.debug(statMsg)
|
||||
htmleNBFailureMsg += htmlMsg
|
||||
#ulsch and dlsch statistics
|
||||
if len(dlsch_ulsch_stats)!=0: #check if dictionary is not empty
|
||||
statMsg=''
|
||||
for key in dlsch_ulsch_stats: #for each dictionary key
|
||||
statMsg += dlsch_ulsch_stats[key] + '\n'
|
||||
logging.debug(dlsch_ulsch_stats[key])
|
||||
htmleNBFailureMsg += statMsg
|
||||
|
||||
if uciStatMsgCount > 0:
|
||||
statMsg = nodeB_prefix + 'NB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)'
|
||||
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
|
||||
|
||||
@@ -470,7 +470,7 @@ function report_test {
|
||||
then
|
||||
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG`
|
||||
else
|
||||
NB_UE_TUNNEL_UP=`egrep -c "executing ifconfig oaitun_ue1" $UE_LOG`
|
||||
NB_UE_TUNNEL_UP=`egrep -c "ip link set oaitun_ue1 up" $UE_LOG`
|
||||
fi
|
||||
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
|
||||
then
|
||||
@@ -768,55 +768,47 @@ function report_test {
|
||||
|
||||
#RA test (--do-ra option)
|
||||
|
||||
# Currently disabled
|
||||
# #build log files names
|
||||
# RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_test.log
|
||||
# RA_UE_LOG=$ARCHIVES_LOC/ra_check_${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_test.log
|
||||
# if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
|
||||
# then
|
||||
# #get rid of full path
|
||||
# NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
# NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
# echo " <tr>" >> ./test_simulator_results.html
|
||||
# echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
|
||||
# echo " <td>Check if RA proc succeeded</td>" >> ./test_simulator_results.html
|
||||
#
|
||||
# #gNB RA check
|
||||
# GNB_RECEIVED=`egrep -c "received correctly" $RA_ENB_LOG`
|
||||
# GNB_CONNECTED=`egrep -c "now 5G connected" $RA_ENB_LOG`
|
||||
# #UE RA check
|
||||
# UE_RA_PROC_OK=`egrep -c "RA procedure succeeded" $RA_UE_LOG`
|
||||
#
|
||||
#
|
||||
# if [ $GNB_RECEIVED -gt 0 ] && [ $GNB_CONNECTED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ]
|
||||
# then
|
||||
# echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
# else
|
||||
# echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
# fi
|
||||
#
|
||||
# echo " <td><pre>" >> ./test_simulator_results.html
|
||||
# if [ $GNB_RECEIVED -gt 0 ]
|
||||
# then
|
||||
# echo "<font color = \"blue\">- gNB --> RA received</font>" >> ./test_simulator_results.html
|
||||
# else
|
||||
# echo "<font color = \"red\"><b>- gNB RA NOT RECEIVED</b></font>" >> ./test_simulator_results.html
|
||||
# fi
|
||||
# if [ $GNB_CONNECTED -gt 0 ]
|
||||
# then
|
||||
# echo "<font color = \"blue\">- gNB --> 5G connected</font>" >> ./test_simulator_results.html
|
||||
# else
|
||||
# echo "<font color = \"red\"><b>- gNB NOT 5G CONNECTED</b></font>" >> ./test_simulator_results.html
|
||||
# fi
|
||||
# if [ $UE_RA_PROC_OK -gt 0 ]
|
||||
# then
|
||||
# echo "<font color = \"blue\">- NR UE --> RA procedure succeded</font>" >> ./test_simulator_results.html
|
||||
# else
|
||||
# echo "<font color = \"red\"><b>- NR UE RA procedure failed</b></font>" >> ./test_simulator_results.html
|
||||
# fi
|
||||
# echo " </pre></td>" >> ./test_simulator_results.html
|
||||
# echo " </tr>" >> ./test_simulator_results.html
|
||||
# fi
|
||||
#build log files names
|
||||
RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_test.log
|
||||
RA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_test.log
|
||||
if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
|
||||
then
|
||||
#get rid of full path
|
||||
NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
|
||||
echo " <td>Check if RA proc succeeded</td>" >> ./test_simulator_results.html
|
||||
|
||||
#gNB RA check
|
||||
GNB_RECEIVED=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $RA_ENB_LOG`
|
||||
#UE RA check
|
||||
UE_RA_PROC_OK=`egrep -c "\[RAPROC\] RA procedure succeeded" $RA_UE_LOG`
|
||||
|
||||
|
||||
if [ $GNB_RECEIVED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
echo " <td><pre>" >> ./test_simulator_results.html
|
||||
if [ $GNB_RECEIVED -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- gNB --> RA received</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- gNB RA NOT RECEIVED</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $UE_RA_PROC_OK -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- NR UE --> RA procedure succeded</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- NR UE RA procedure failed</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </pre></td>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
#SYNC test
|
||||
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
|
||||
|
||||
+87
-119
@@ -281,14 +281,35 @@ function check_ra_result {
|
||||
local LOC_GNB_LOG=$1
|
||||
local LOC_UE_LOG=$2
|
||||
|
||||
#gNB RA test
|
||||
echo "Checking gNB Log for RA success"
|
||||
egrep "received correctly" $1
|
||||
egrep "now 5G connected" $1
|
||||
|
||||
#UE RA test
|
||||
echo 'Checking UE Log for RA success'
|
||||
egrep "RA procedure succeeded" $2
|
||||
#if log files exist
|
||||
if [ -f $LOC_GNB_LOG ] && [ -f $LOC_UE_LOG ]
|
||||
then
|
||||
|
||||
#gNB RA test
|
||||
#console check
|
||||
echo "Checking gNB Log for RA success"
|
||||
egrep "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $1
|
||||
#script check
|
||||
local GNB_COMPLETE=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $1`
|
||||
|
||||
#UE RA test
|
||||
#console check
|
||||
echo 'Checking UE Log for RA success'
|
||||
egrep "\[RAPROC\] RA procedure succeeded" $2
|
||||
#script check
|
||||
local UE_COMPLETE=`egrep -c "\[RAPROC\] RA procedure succeeded" $2`
|
||||
|
||||
#generate status
|
||||
if [ $GNB_COMPLETE -eq 0 ] || [ $UE_COMPLETE -eq 0 ]
|
||||
then
|
||||
RA_STATUS=-1
|
||||
echo "RA test FAILED, could not find the markers"
|
||||
fi
|
||||
#case where log files do not exist
|
||||
else
|
||||
echo "RA test log files not present"
|
||||
RA_STATUS=-1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
@@ -1199,6 +1220,8 @@ function start_rf_sim_gnb {
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"source oaienv\"" >> $1
|
||||
echo "source oaienv" >> $1
|
||||
echo "echo \"export RFSIMULATOR=server\"" >> $1
|
||||
echo "export RFSIMULATOR=server" >> $1
|
||||
echo "cd ci-scripts/conf_files/" >> $1
|
||||
echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1
|
||||
#echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1
|
||||
@@ -1212,9 +1235,9 @@ function start_rf_sim_gnb {
|
||||
then
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #RA test => use --do-ra option
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -1225,16 +1248,6 @@ function start_rf_sim_gnb {
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
|
||||
# For the moment, in RA test, no check and no copy of generated raw files
|
||||
if [ $LOC_RA_TEST -eq 1 ] # RA test
|
||||
then
|
||||
sleep 30
|
||||
echo "echo \"free -m\"" > $1
|
||||
echo "free -m" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
return 0
|
||||
fi
|
||||
|
||||
local i="0"
|
||||
echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
@@ -1258,7 +1271,9 @@ function start_rf_sim_gnb {
|
||||
GNB_SYNC=1
|
||||
echo "RF-SIM gNB is sync'ed: waiting for UE(s) to connect"
|
||||
fi
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
|
||||
# check noS1 config only outside RA test (as it does not support noS1)
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_TEST -eq 0 ]
|
||||
then
|
||||
echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
|
||||
# Checking oaitun_enb1 interface has now an IP address
|
||||
@@ -1307,30 +1322,25 @@ function start_rf_sim_nr_ue {
|
||||
local LOC_RA_TEST=$8
|
||||
|
||||
# Copy the RAW files from the gNB run
|
||||
# In RA test mode, they were not copied from gNB VM
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
scp -o StrictHostKeyChecking=no reconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
fi
|
||||
scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
scp -o StrictHostKeyChecking=no reconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
|
||||
echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"export RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}\"" >> $1
|
||||
echo "export RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}" >> $1
|
||||
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "sudo cp /home/ubuntu/tmp/r*config.raw /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "sudo chmod 666 /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1
|
||||
fi
|
||||
echo "sudo cp /home/ubuntu/tmp/r*config.raw /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "sudo chmod 666 /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #RA test => use --do-ra option
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -1341,14 +1351,6 @@ function start_rf_sim_nr_ue {
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
|
||||
# In case of RA test mode, no UE sync check for the moment.
|
||||
# To be removed later?
|
||||
if [ $LOC_RA_TEST -eq 1 ] # RA test
|
||||
then
|
||||
sleep 30
|
||||
NR_UE_SYNC=1
|
||||
return 0
|
||||
fi
|
||||
local i="0"
|
||||
echo "egrep -c \"Initial sync: pbch decoded sucessfully\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
@@ -1372,11 +1374,13 @@ function start_rf_sim_nr_ue {
|
||||
else
|
||||
echo "RF-SIM NR-UE is sync'ed w/ gNB"
|
||||
fi
|
||||
# Checking oaitun_ue1 interface has now an IP address
|
||||
i="0"
|
||||
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
# Checking oaitun_ue1 interface has now an IP address (only outside RA test)
|
||||
if [ $LOC_RA_TEST -eq 0 ]
|
||||
then
|
||||
i="0"
|
||||
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -eq 1 ]
|
||||
@@ -1385,21 +1389,20 @@ function start_rf_sim_nr_ue {
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
echo "echo \"free -m\"" > $1
|
||||
echo "free -m" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
done
|
||||
echo "echo \"free -m\"" > $1
|
||||
echo "free -m" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
NR_UE_SYNC=0
|
||||
echo "RF-SIM NR-UE oaitun_ue1 is DOWN or NOT CONFIGURED"
|
||||
else
|
||||
else
|
||||
echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED"
|
||||
fi
|
||||
sleep 10
|
||||
|
||||
|
||||
fi
|
||||
sleep 10
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
@@ -2192,14 +2195,21 @@ function run_test_on_vm {
|
||||
PRB=106
|
||||
FREQUENCY=3510
|
||||
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir --parents $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
local try_cnt="0"
|
||||
NR_STATUS=0
|
||||
|
||||
######### start of RA TEST loop
|
||||
while [ $try_cnt -lt 1 ]
|
||||
while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
|
||||
do
|
||||
|
||||
SYNC_STATUS=0
|
||||
RA_STATUS=0
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*ra_test.log
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
@@ -2241,75 +2251,32 @@ function run_test_on_vm {
|
||||
echo "############################################################"
|
||||
|
||||
# Proper check to be done when RA test is working!
|
||||
#check_ra_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE
|
||||
|
||||
try_cnt=$[$try_cnt+1]
|
||||
|
||||
########### end RA test
|
||||
check_ra_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE
|
||||
if [ $RA_STATUS -ne 0 ]
|
||||
then
|
||||
echo "RA test NOT OK"
|
||||
try_cnt=$[$try_cnt+1]
|
||||
else
|
||||
try_cnt=$[$try_cnt+10]
|
||||
fi
|
||||
done
|
||||
sleep 10
|
||||
try_cnt="0"
|
||||
########### end RA test
|
||||
|
||||
sleep 30
|
||||
|
||||
|
||||
######### start of PHY TEST loop
|
||||
try_cnt="0"
|
||||
while [ $try_cnt -lt 4 ]
|
||||
do
|
||||
|
||||
#start RA test
|
||||
SYNC_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
echo "############################################################"
|
||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
|
||||
#last argument = 1 is to enable --do-ra for RA test
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||
echo "############################################################"
|
||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
#last argument = 1 is to enable --do-ra for RA test
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1
|
||||
if [ $NR_UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ gNB and NR-UE not syncing"
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
|
||||
SYNC_STATUS=-1
|
||||
try_cnt=$[$try_cnt+1]
|
||||
continue
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
|
||||
echo "############################################################"
|
||||
sleep 20
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
|
||||
|
||||
#check RA markers in gNB and NR UE log files
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Checking RA on gNB / NR-UE"
|
||||
echo "############################################################"
|
||||
|
||||
mv $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_GNB_LOG_FILE
|
||||
mv $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_NR_UE_LOG_FILE
|
||||
# Proper check to be done when RA test is working!
|
||||
#check_ra_result $ARCHIVES_LOC/ra_check_$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_NR_UE_LOG_FILE
|
||||
|
||||
|
||||
#end RA test
|
||||
sleep 30
|
||||
|
||||
SYNC_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_gnb.log $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_ping_gnb_from_nrue.log $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_ping_from_gnb_nrue.log
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_iperf_dl*txt $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_iperf_ul*txt
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
@@ -2409,6 +2376,7 @@ function run_test_on_vm {
|
||||
echo "Checking run status"
|
||||
echo "############################################################"
|
||||
|
||||
if [ $RA_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
if [ $PING_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
if [ $IPERF_STATUS -ne 0 ]; then NR_STATUS=-1; fi
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
<htmlTabName>Test-LTE-M-10MHz-TM1</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>1</repeatCount>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040102
|
||||
|
||||
@@ -26,6 +26,8 @@
|
||||
<htmlTabName>Test-05MHz-TM2</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>2</repeatCount>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestMinId>040608</TestMinId>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040101
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<htmlTabRef>test-10-tm1</htmlTabRef>
|
||||
<htmlTabName>Test-10MHz-TM1</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestMinId>040615</TestMinId>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040101
|
||||
|
||||
@@ -25,6 +25,8 @@
|
||||
<htmlTabName>Test-20MHz-TM1</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>4</repeatCount>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestMinId>040623</TestMinId>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040101
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
<htmlTabRef>test-20-tm1-defSched</htmlTabRef>
|
||||
<htmlTabName>Test-20MHz-TM1-default-scheduler</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestMinId>040522</TestMinId>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040101
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
<!--
|
||||
|
||||
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
contributor license agreements. See the NOTICE file distributed with
|
||||
this work for additional information regarding copyright ownership.
|
||||
The OpenAirInterface Software Alliance licenses this file to You under
|
||||
the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.openairinterface.org/?page_id=698
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
contact@openairinterface.org
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>epc-start-tab</htmlTabRef>
|
||||
<htmlTabName>EPC-Start</htmlTabName>
|
||||
<htmlTabIcon>log-in</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
000100 000101 000102
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList>
|
||||
</TestCaseExclusionList>
|
||||
|
||||
<testCase id="000100">
|
||||
<class>Initialize_HSS</class>
|
||||
<desc>Initialize HSS</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000101">
|
||||
<class>Initialize_MME</class>
|
||||
<desc>Initialize MME</desc>
|
||||
<option>mme-verizon.conf</option>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000102">
|
||||
<class>Initialize_SPGW</class>
|
||||
<desc>Initialize SPGW</desc>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -89,14 +89,14 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings in 20sec</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 5pings in 1sec</desc>
|
||||
<ping_args>-c 5 -i 0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070000">
|
||||
@@ -104,6 +104,7 @@
|
||||
<desc>Terminate eNB</desc>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
<air_interface>lte</air_interface>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070001">
|
||||
@@ -111,6 +112,7 @@
|
||||
<desc>Terminate gNB</desc>
|
||||
<eNB_instance>1</eNB_instance>
|
||||
<eNB_serverId>1</eNB_serverId>
|
||||
<air_interface>nr</air_interface>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<!--
|
||||
|
||||
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
|
||||
030101 040301 040501 040603 040604 040605 040606 040607 040641 040642 040643 040644 040401 040201 030201
|
||||
|
||||
-->
|
||||
<testCaseList>
|
||||
<htmlTabRef>test-05-tm1</htmlTabRef>
|
||||
<htmlTabName>Test-05MHz-TM1</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040101
|
||||
030101 040301 000001 040501 040603 040401 030201
|
||||
</TestCaseRequestedList>
|
||||
<TestCaseExclusionList></TestCaseExclusionList>
|
||||
|
||||
<testCase id="000001">
|
||||
<class>IdleSleep</class>
|
||||
<desc>Sleep</desc>
|
||||
<idle_sleep_time_in_sec>5</idle_sleep_time_in_sec>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030101">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize eNB (FDD/Band7/5MHz)</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/enb.band7.tm1.25PRB.usrpb210.conf --eNBs.[0].plmn_list.[0].mcc 311 --eNBs.[0].plmn_list.[0].mnc 480 --eNBs.[0].plmn_list.[0].mnc_length 3 --eNBs.[0].component_carriers.[0].Nid_cell 10</Initialize_eNB_args>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
<class>Terminate_eNB</class>
|
||||
<desc>Terminate eNB</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040101">
|
||||
<class>Initialize_UE</class>
|
||||
<desc>Initialize UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040201">
|
||||
<class>Terminate_UE</class>
|
||||
<desc>Terminate UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040301">
|
||||
<class>Attach_UE</class>
|
||||
<desc>Attach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040401">
|
||||
<class>Detach_UE</class>
|
||||
<desc>Detach UE</desc>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040501">
|
||||
<class>Ping</class>
|
||||
<desc>ping (5MHz - 20 sec)</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>5</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040603">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(balanced profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 30 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040604">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 30 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040605">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/15Mbps/UDP)(30 sec)(unbalanced profile)</desc>
|
||||
<iperf_args>-u -b 15M -t 30 -i 1</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>unbalanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040606">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/TCP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-t 30 -i 1 -fm</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040607">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - DL/TCP)(30 sec)(balanced profile)</desc>
|
||||
<iperf_args>-t 30 -i 1 -fm</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040641">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/9Mbps/UDP)(30 sec)(balanced profile)</desc>
|
||||
<iperf_args>-u -b 9M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040642">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/9Mbps/UDP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 9M -t 30 -i 1 -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040643">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/TCP)(30 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-t 30 -i 1 -fm -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="040644">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (5MHz - UL/TCP)(30 sec)(balanced profile)</desc>
|
||||
<iperf_args>-t 30 -i 1 -fm -R</iperf_args>
|
||||
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
|
||||
<iperf_profile>balanced</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
@@ -25,6 +25,8 @@
|
||||
<htmlTabName>Test-10MHz</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>2</repeatCount>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestMinId>040612</TestMinId>
|
||||
<TestCaseRequestedList>
|
||||
030201
|
||||
040101
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
<htmlTabName>Test-X2-HO-FDD-05MHz-TM1</htmlTabName>
|
||||
<htmlTabIcon>tasks</htmlTabIcon>
|
||||
<repeatCount>2</repeatCount>
|
||||
<TestUnstable>True</TestUnstable>
|
||||
<TestCaseRequestedList>
|
||||
030201 030202
|
||||
040101
|
||||
|
||||
+195
-130
@@ -23,6 +23,114 @@
|
||||
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
|
||||
|
||||
# System packages that are required
|
||||
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
|
||||
# or cmake provide a generic interface to pkg-config that widely used
|
||||
###################################
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
|
||||
include_directories(${LIBXML2_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(LIBXSLT libxslt REQUIRED)
|
||||
include_directories(${LIBXSLT_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(OPENSSL openssl REQUIRED)
|
||||
include_directories(${OPENSSL_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CONFIG libconfig REQUIRED)
|
||||
include_directories(${CONFIG_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CRYPTO libcrypto REQUIRED)
|
||||
include_directories(${CRYPTO_INCLUDE_DIRS})
|
||||
|
||||
#use native cmake method as this package is not in pkg-config
|
||||
if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
find_package(Boost REQUIRED)
|
||||
include_directories(${LIBBOOST_INCLUDE_DIR})
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/")
|
||||
include_directories("/usr/local/include/")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp)
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
set(option_HW_lib "-lSoapySDR -rdynamic -ldl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
|
||||
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
|
||||
if(NOT ${OPENPGM_FOUND})
|
||||
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
|
||||
else()
|
||||
include_directories(${OPENPGM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_search_module(NETTLE nettle)
|
||||
if(NOT ${NETTLE_FOUND})
|
||||
message( FATAL_ERROR "PACKAGE nettle not found: some targets will fail. Run build_oai -I again!")
|
||||
else()
|
||||
include_directories(${NETTLE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
message ("NETTLE VERSION_INSTALLED = ${NETTLE_VERSION}")
|
||||
|
||||
string(REGEX REPLACE "([0-9]+).*" "\\1" NETTLE_VERSION_MAJOR ${NETTLE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" NETTLE_VERSION_MINOR ${NETTLE_VERSION})
|
||||
message ("NETTLE_VERSION_MAJOR = ${NETTLE_VERSION_MAJOR}")
|
||||
message ("NETTLE_VERSION_MINOR = ${NETTLE_VERSION_MINOR}")
|
||||
|
||||
if ("${NETTLE_VERSION_MAJOR}" STREQUAL "" OR "${NETTLE_VERSION_MINOR}" STREQUAL "")
|
||||
message( FATAL_ERROR "The nettle version not detected properly. Try to run build_oai -I again" )
|
||||
endif()
|
||||
|
||||
add_definitions("-DNETTLE_VERSION_MAJOR=${NETTLE_VERSION_MAJOR}")
|
||||
add_definitions("-DNETTLE_VERSION_MINOR=${NETTLE_VERSION_MINOR}")
|
||||
|
||||
pkg_search_module(XPM xpm)
|
||||
if(NOT ${XPM_FOUND})
|
||||
message("PACKAGE xpm not found: some targets will fail")
|
||||
else()
|
||||
include_directories(${XPM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Atlas is required by some packages, but not found in pkg-config
|
||||
# So, here are some hacks here. Hope this gets fixed in future!
|
||||
if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
|
||||
include_directories("/usr/include/atlas")
|
||||
LINK_DIRECTORIES("/usr/lib/lapack")
|
||||
LINK_DIRECTORIES("/usr/lib64")
|
||||
LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here!
|
||||
|
||||
if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES blas)
|
||||
|
||||
else() # Case for Ubuntu
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
endif()
|
||||
|
||||
if(EXISTS "/usr/lib/atlas/libtatlas.so" OR EXISTS "/usr/lib64/atlas/libtatlas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES tatlas)
|
||||
else()
|
||||
list(APPEND ATLAS_LIBRARIES atlas) #Case for Ubuntu
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
# for ubuntu 17.10, directories are different
|
||||
elseif(EXISTS "/usr/include/x86_64-linux-gnu/cblas.h")
|
||||
|
||||
include_directories("/usr/include/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
list(APPEND ATLAS_LIBRARIES atlas)
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
else()
|
||||
message("No Blas/Atlas libs found, some targets will fail")
|
||||
endif()
|
||||
|
||||
#########################################################
|
||||
# Base directories, compatible with legacy OAI building #
|
||||
#########################################################
|
||||
@@ -232,8 +340,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0 -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2 -fno-delete-null-pointer-checks")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
|
||||
|
||||
set(GIT_BRANCH "UNKNOWN")
|
||||
@@ -302,7 +410,6 @@ set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
|
||||
add_library(ITTI
|
||||
${OCP_ITTI}/intertask_interface.cpp
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/memory_pools.c
|
||||
)
|
||||
add_dependencies(ITTI rrc_flag)
|
||||
set(ITTI_LIB ITTI)
|
||||
@@ -378,6 +485,7 @@ add_custom_target (
|
||||
|
||||
add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
|
||||
${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c
|
||||
${OPENAIR2_DIR}/RRC/NR/nr_ngap_gNB.c
|
||||
)
|
||||
add_dependencies(NR_RRC_LIB nr_rrc_flag)
|
||||
include_directories ("${NR_RRC_FULL_DIR}")
|
||||
@@ -622,7 +730,7 @@ add_library(X2AP_ENB
|
||||
${X2AP_DIR}/x2ap_ids.c
|
||||
${X2AP_DIR}/x2ap_timers.c
|
||||
)
|
||||
add_dependencies(X2AP_ENB rrc_flag x2_flag)
|
||||
add_dependencies(X2AP_ENB X2AP_LIB rrc_flag x2_flag)
|
||||
|
||||
|
||||
# F1AP
|
||||
@@ -813,7 +921,7 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
|
||||
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
|
||||
|
||||
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
|
||||
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
|
||||
add_boolean_option(DEADLINE_SCHEDULER False "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
|
||||
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
|
||||
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
|
||||
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
|
||||
@@ -825,7 +933,6 @@ add_boolean_option(MESSAGE_CHART_GENERATOR_PHY False "trace some PHY exchang
|
||||
add_boolean_option(UE_EXPANSION False "enable UE_EXPANSION with max 256 UE")
|
||||
add_boolean_option(PHY_TX_THREAD False "enable UE_EXPANSION with max 256 UE")
|
||||
add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION with max 256 UE")
|
||||
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
|
||||
|
||||
########################
|
||||
# Include order
|
||||
@@ -835,9 +942,9 @@ add_boolean_option(ENB_MODE True "Swap the include directories between openair2
|
||||
##########################
|
||||
# SCHEDULING/REAL-TIME/PERF options
|
||||
##########################
|
||||
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues")
|
||||
add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays")
|
||||
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
|
||||
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME False "Add data in vcd traces: disable it if perf issues")
|
||||
add_boolean_option(ENABLE_VCD False "always true now, time measurements of proc calls and var displays")
|
||||
add_boolean_option(ENABLE_VCD_FIFO False "time measurements of proc calls and var displays sent to FIFO (one more thread)")
|
||||
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
|
||||
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
|
||||
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
|
||||
@@ -1251,6 +1358,7 @@ set(SECU_OSA_SRC
|
||||
${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eia.c
|
||||
)
|
||||
add_library(SECU_OSA ${SECU_OSA_SRC})
|
||||
target_link_libraries(SECU_OSA ${NETTLE_LIBRARIES})
|
||||
|
||||
set(SECU_CN_SRC
|
||||
${OPENAIR3_DIR}/SECU/kdf.c
|
||||
@@ -1264,6 +1372,8 @@ set(SECU_CN_SRC
|
||||
)
|
||||
add_library(SECU_CN ${SECU_CN_SRC})
|
||||
|
||||
target_link_libraries(SECU_CN ${NETTLE_LIBRARIES})
|
||||
|
||||
# Physical Channel Procedures Scheduling
|
||||
################################"
|
||||
set(SCHED_SRC
|
||||
@@ -1594,6 +1704,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_llr_computation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
|
||||
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_csi_rs.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/scrambling_luts.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c
|
||||
@@ -1628,6 +1739,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/sss_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/cic_filter_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_pbch.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
|
||||
@@ -2047,6 +2159,11 @@ set (GTPV1U_SRC
|
||||
add_library(GTPV1U ${GTPV1U_SRC})
|
||||
add_dependencies(GTPV1U rrc_flag)
|
||||
|
||||
#add_library (GTPV1U_OCP
|
||||
#${OPENAIR3_DIR}/ocp-gtp/gtp_itf.cpp
|
||||
#)
|
||||
#include_directories(${OPENAIR3_DIR}/ocp-gtp)
|
||||
|
||||
#NR case
|
||||
set (NR_GTPV1U_SRC
|
||||
${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
|
||||
@@ -2350,6 +2467,14 @@ set (SHLIB_LOADER_SOURCES
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
)
|
||||
|
||||
add_library(LIB_5GNAS_GNB
|
||||
${NAS_SRC}/COMMON/nr_common.c
|
||||
${NAS_SRC}/gNB/network_process_nas.c
|
||||
${NAS_SRC}/NR_UE/ue_process_nas.c
|
||||
${OPENAIR3_DIR}//UICC/usim_interface.c
|
||||
)
|
||||
target_link_libraries(LIB_5GNAS_GNB SECU_CN ${CRYPTO_LIBRARIES})
|
||||
|
||||
# Make lfds as a own source code (even if it is a outside library)
|
||||
# For better intergration with compilation flags & structure of cmake
|
||||
###################################################################
|
||||
@@ -2426,114 +2551,6 @@ include_directories("${NFAPI_DIR}/nfapi/inc")
|
||||
include_directories("${NFAPI_DIR}/sim_common/inc")
|
||||
include_directories("${NFAPI_DIR}/pnf_sim/inc")
|
||||
|
||||
|
||||
# System packages that are required
|
||||
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
|
||||
# or cmake provide a generic interface to pkg-config that widely used
|
||||
###################################
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
|
||||
include_directories(${LIBXML2_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(LIBXSLT libxslt REQUIRED)
|
||||
include_directories(${LIBXSLT_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(OPENSSL openssl REQUIRED)
|
||||
include_directories(${OPENSSL_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CONFIG libconfig REQUIRED)
|
||||
include_directories(${CONFIG_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CRYPTO libcrypto REQUIRED)
|
||||
include_directories(${CRYPTO_INCLUDE_DIRS})
|
||||
|
||||
#use native cmake method as this package is not in pkg-config
|
||||
if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
find_package(Boost REQUIRED)
|
||||
include_directories(${LIBBOOST_INCLUDE_DIR})
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/")
|
||||
include_directories("/usr/local/include/")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp)
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
set(option_HW_lib "-lSoapySDR -rdynamic -ldl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
|
||||
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
|
||||
if(NOT ${OPENPGM_FOUND})
|
||||
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
|
||||
else()
|
||||
include_directories(${OPENPGM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_search_module(NETTLE nettle)
|
||||
if(NOT ${NETTLE_FOUND})
|
||||
message( FATAL_ERROR "PACKAGE nettle not found: some targets will fail. Run build_oai -I again!")
|
||||
else()
|
||||
include_directories(${NETTLE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
message ("NETTLE VERSION_INSTALLED = ${NETTLE_VERSION}")
|
||||
|
||||
string(REGEX REPLACE "([0-9]+).*" "\\1" NETTLE_VERSION_MAJOR ${NETTLE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" NETTLE_VERSION_MINOR ${NETTLE_VERSION})
|
||||
message ("NETTLE_VERSION_MAJOR = ${NETTLE_VERSION_MAJOR}")
|
||||
message ("NETTLE_VERSION_MINOR = ${NETTLE_VERSION_MINOR}")
|
||||
|
||||
if ("${NETTLE_VERSION_MAJOR}" STREQUAL "" OR "${NETTLE_VERSION_MINOR}" STREQUAL "")
|
||||
message( FATAL_ERROR "The nettle version not detected properly. Try to run build_oai -I again" )
|
||||
endif()
|
||||
|
||||
add_definitions("-DNETTLE_VERSION_MAJOR=${NETTLE_VERSION_MAJOR}")
|
||||
add_definitions("-DNETTLE_VERSION_MINOR=${NETTLE_VERSION_MINOR}")
|
||||
|
||||
pkg_search_module(XPM xpm)
|
||||
if(NOT ${XPM_FOUND})
|
||||
message("PACKAGE xpm not found: some targets will fail")
|
||||
else()
|
||||
include_directories(${XPM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Atlas is required by some packages, but not found in pkg-config
|
||||
# So, here are some hacks here. Hope this gets fixed in future!
|
||||
if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
|
||||
include_directories("/usr/include/atlas")
|
||||
LINK_DIRECTORIES("/usr/lib/lapack")
|
||||
LINK_DIRECTORIES("/usr/lib64")
|
||||
LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here!
|
||||
|
||||
if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES blas)
|
||||
|
||||
else() # Case for Ubuntu
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
endif()
|
||||
|
||||
if(EXISTS "/usr/lib/atlas/libtatlas.so" OR EXISTS "/usr/lib64/atlas/libtatlas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES tatlas)
|
||||
else()
|
||||
list(APPEND ATLAS_LIBRARIES atlas) #Case for Ubuntu
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
# for ubuntu 17.10, directories are different
|
||||
elseif(EXISTS "/usr/include/x86_64-linux-gnu/cblas.h")
|
||||
|
||||
include_directories("/usr/include/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
list(APPEND ATLAS_LIBRARIES atlas)
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
else()
|
||||
message("No Blas/Atlas libs found, some targets will fail")
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack lapacke)
|
||||
|
||||
include_directories ("/usr/include/X11")
|
||||
@@ -2640,6 +2657,12 @@ add_executable(measurement_display
|
||||
${OPENAIR_DIR}/common/utils/threadPool/measurement_display.c)
|
||||
target_link_libraries (measurement_display minimal_lib)
|
||||
|
||||
add_executable(test5Gnas
|
||||
${OPENAIR_DIR}/openair3/TEST/test5Gnas.c
|
||||
)
|
||||
target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib )
|
||||
|
||||
|
||||
# lte-softmodem is both eNB and UE implementation
|
||||
###################################################
|
||||
|
||||
@@ -2681,7 +2704,7 @@ target_link_libraries (lte-softmodem
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${T_LIB})
|
||||
|
||||
@@ -2720,7 +2743,7 @@ target_link_libraries (ocp-enb
|
||||
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
|
||||
add_executable(cu_test
|
||||
${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c
|
||||
@@ -2792,7 +2815,7 @@ target_link_libraries (lte-uesoftmodem
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem ${T_LIB})
|
||||
|
||||
@@ -2835,11 +2858,52 @@ target_link_libraries (nr-softmodem
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem ${T_LIB})
|
||||
|
||||
add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
|
||||
|
||||
add_executable(ocp-gnb
|
||||
${rrc_h}
|
||||
${nr_rrc_h}
|
||||
${s1ap_h}
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_DIR}/executables/ocp-gnb.c
|
||||
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${GTPU_need_ITTI}
|
||||
${XFORMS_SOURCE_NR}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
${XFORMSINTERFACE_SOURCE}
|
||||
)
|
||||
|
||||
target_link_libraries (ocp-gnb
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} )
|
||||
target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (ocp-gnb ${T_LIB})
|
||||
add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope)
|
||||
|
||||
|
||||
# nr-uesoftmodem is UE implementation
|
||||
#######################################
|
||||
|
||||
@@ -2874,11 +2938,11 @@ target_link_libraries (nr-uesoftmodem
|
||||
RRC_LIB NR_RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem ${T_LIB})
|
||||
|
||||
@@ -3045,7 +3109,7 @@ add_executable(nr_dlsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR HASHTABLE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
@@ -3063,7 +3127,8 @@ add_executable(nr_prachsim
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES})
|
||||
target_link_libraries(nr_prachsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB MAC_UE_NR SCHED_NR_UE_LIB RRC_LIB NR_RRC_LIB L2_NR CONFIG_LIB HASHTABLE -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
|
||||
add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
@@ -3095,7 +3160,7 @@ add_executable(nr_ulsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_ulsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR HASHTABLE -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
@@ -3130,7 +3195,7 @@ add_executable(test_epc_generate_scenario
|
||||
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
|
||||
)
|
||||
target_link_libraries (test_epc_generate_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
|
||||
add_executable(test_epc_play_scenario
|
||||
@@ -3149,7 +3214,7 @@ add_executable(test_epc_play_scenario
|
||||
)
|
||||
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
|
||||
target_link_libraries (test_epc_play_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
|
||||
|
||||
@@ -3169,7 +3234,7 @@ foreach(myExe s1ap
|
||||
${OPENAIR3_DIR}/TEST/test_${myExe}.c
|
||||
)
|
||||
target_link_libraries (test_${myExe}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
endforeach(myExe)
|
||||
|
||||
@@ -3194,7 +3259,7 @@ if (${T_TRACER})
|
||||
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE MAC_NR_COMMON MAC_NR MAC_UE_NR
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR
|
||||
CN_UTILS GTPV1U NR_GTPV1U SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
|
||||
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
|
||||
if (TARGET ${i})
|
||||
|
||||
@@ -42,7 +42,6 @@ MSC_GEN=0
|
||||
XFORMS="True"
|
||||
SKIP_SHARED_LIB_FLAG="False"
|
||||
UE_EXPANSION="False"
|
||||
UESIM_EXPANSION="False"
|
||||
PRINT_STATS="False"
|
||||
VCD_TIMING="False"
|
||||
DEADLINE_SCHEDULER_FLAG_USER=""
|
||||
@@ -264,10 +263,6 @@ function main() {
|
||||
UE_EXPANSION="True"
|
||||
echo_info "Will compile with UE_EXPANSION"
|
||||
shift;;
|
||||
--musim)
|
||||
UESIM_EXPANSION="True"
|
||||
echo_info "Will compile with UESIM_EXPANSION"
|
||||
shift;;
|
||||
--UE-conf-nvram)
|
||||
conf_nvram_path=$(readlink -f $2)
|
||||
shift 2;;
|
||||
@@ -488,11 +483,6 @@ function main() {
|
||||
echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
|
||||
echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
|
||||
|
||||
if [ -n "$UHD_IMAGES_DIR" ] && [ -z "$INSTALL_EXTERNAL" ]; then
|
||||
echo_error "UHD images download settings will not be applied without -I present"
|
||||
exit
|
||||
fi
|
||||
|
||||
#######################################################
|
||||
# Setting and printing OAI envs, we should check here #
|
||||
#######################################################
|
||||
@@ -593,7 +583,6 @@ function main() {
|
||||
echo "set ( UE_EXPANSION $UE_EXPANSION )" >> $cmake_file
|
||||
# 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 ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
|
||||
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
|
||||
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
|
||||
|
||||
+505
@@ -0,0 +1,505 @@
|
||||
#!/bin/bash
|
||||
#/*
|
||||
# * 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
|
||||
# */
|
||||
|
||||
# brief
|
||||
# authors Laurent Thomas
|
||||
#
|
||||
#######################################
|
||||
if [ ! -f /etc/os-release ]; then
|
||||
echo "No /etc/os-release file found. You're likely on an unsupported distro."
|
||||
exit 1
|
||||
fi
|
||||
OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
|
||||
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
|
||||
case "$OS_DISTRO" in
|
||||
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt"; CMAKE="cmake" ;;
|
||||
esac
|
||||
|
||||
SUDO='sudo -E'
|
||||
|
||||
###############################
|
||||
## echo and family
|
||||
###############################
|
||||
black='\E[30m'
|
||||
red='\E[31m'
|
||||
green='\E[32m'
|
||||
yellow='\E[33m'
|
||||
blue='\E[1;34m'
|
||||
magenta='\E[35m'
|
||||
cyan='\E[36m'
|
||||
white='\E[37m'
|
||||
reset_color='\E[00m'
|
||||
COLORIZE=1
|
||||
|
||||
cecho() {
|
||||
# Color-echo
|
||||
# arg1 = message
|
||||
# arg2 = color
|
||||
local default_msg="No Message."
|
||||
message=${1:-$default_msg}
|
||||
color=${2:-$green}
|
||||
[ "$COLORIZE" = "1" ] && message="$color$message$reset_color"
|
||||
echo -e "$message"
|
||||
return
|
||||
}
|
||||
|
||||
echo_error() { cecho "$* $red" ;}
|
||||
echo_fatal() { cecho "$* $red"; exit 1 ;}
|
||||
echo_warning() { cecho "$* $yellow" ;}
|
||||
echo_success() { cecho "$* $green" ;}
|
||||
echo_info() { cecho "$* $blue" ;}
|
||||
|
||||
########################
|
||||
# distribution helpers #
|
||||
########################
|
||||
|
||||
# This function return a string to identify the distribution we are running
|
||||
# Examples:
|
||||
# ubuntu16.04
|
||||
# debian8.5
|
||||
get_distribution_release() {
|
||||
echo "$OS_DISTRO$OS_RELEASE"
|
||||
}
|
||||
|
||||
check_supported_distribution() {
|
||||
case $(get_distribution_release) in
|
||||
"ubuntu20.04") return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
##################
|
||||
# Error handlers #
|
||||
##################
|
||||
|
||||
handler_EXIT() {
|
||||
local exit_code=$?
|
||||
[ "$exit_code" -eq 0 ] || echo_error "build have failed"
|
||||
exit $exit_code
|
||||
}
|
||||
|
||||
trap handler_EXIT EXIT
|
||||
|
||||
###########################
|
||||
# Cleaners
|
||||
###########################
|
||||
|
||||
clean_kernel() {
|
||||
$SUDO modprobe ip_tables
|
||||
$SUDO modprobe x_tables
|
||||
$SUDO iptables -P INPUT ACCEPT
|
||||
$SUDO iptables -F INPUT
|
||||
$SUDO iptables -P OUTPUT ACCEPT
|
||||
$SUDO iptables -F OUTPUT
|
||||
$SUDO iptables -P FORWARD ACCEPT
|
||||
$SUDO iptables -F FORWARD
|
||||
$SUDO iptables -t nat -F
|
||||
$SUDO iptables -t mangle -F
|
||||
$SUDO iptables -t filter -F
|
||||
$SUDO iptables -t raw -F
|
||||
echo_info "Flushed iptables"
|
||||
$SUDO rmmod nasmesh > /dev/null 2>&1
|
||||
$SUDO rmmod oai_nw_drv > /dev/null 2>&1
|
||||
$SUDO rmmod openair_rf > /dev/null 2>&1
|
||||
$SUDO rmmod ue_ip > /dev/null 2>&1
|
||||
echo_info "removed drivers from kernel"
|
||||
}
|
||||
|
||||
clean_all_files() {
|
||||
set_openair_env
|
||||
rm -rf "$OPENAIR_DIR"/targets/bin/*
|
||||
dir="$OPENAIR_DIR/cmake_targets"
|
||||
rm -rf "$dir"/log/*
|
||||
rm -rf "$dir"/ran_build/build
|
||||
rm -rf "$dir"/ran_build_noLOG/build
|
||||
rm -rf "$dir"/lte-simulators/build
|
||||
rm -rf "$dir"/phy_simulators/build
|
||||
rm -rf "$dir"/nas_sim_tools/build
|
||||
rm -rf "$dir"/oaisim_build_oai/build
|
||||
rm -rf "$dir"/oaisim_build_oai/CMakeLists.txt
|
||||
rm -rf "$dir"/autotests/bin
|
||||
rm -rf "$dir"/autotests/log
|
||||
rm -rf "$dir"/autotests/*/build
|
||||
}
|
||||
|
||||
############################################
|
||||
# External packages installers
|
||||
############################################
|
||||
|
||||
install_protobuf_from_source(){
|
||||
protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt
|
||||
echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading protobuf"
|
||||
#rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1
|
||||
#wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
|
||||
#tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
#cd protobuf-2.6.1/
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner "$USER" --group "$(groups | cut -d" " -f1)" --no-same-owner
|
||||
cd protobuf-3.3.0/ || exit
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$protobuf_install_log"
|
||||
}
|
||||
|
||||
install_protobuf_c_from_source(){
|
||||
protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt
|
||||
echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log "
|
||||
(
|
||||
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
fi
|
||||
cd /tmp || exit
|
||||
echo "Downloading protobuf-c"
|
||||
rm -rf /tmp/protobuf-c
|
||||
git clone https://github.com/protobuf-c/protobuf-c.git
|
||||
cd protobuf-c || exit
|
||||
git checkout 2a46af42784abf86804d536f6e0122d47cfeea45
|
||||
./autogen.sh
|
||||
./configure
|
||||
echo "Compiling protobuf-c"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$protobuf_c_install_log"
|
||||
}
|
||||
|
||||
install_usrp_uhd_driver_from_source(){
|
||||
uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt
|
||||
echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading UHD driver"
|
||||
rm -rf /tmp/uhd
|
||||
git clone https://github.com/EttusResearch/uhd.git
|
||||
cd uhd || exit
|
||||
git checkout tags/v3.13.0.2
|
||||
mkdir -p host/build
|
||||
cd host/build || exit
|
||||
$CMAKE ../
|
||||
echo "Compiling UHD"
|
||||
make -j"$(nproc)"
|
||||
make test
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$uhd_install_log"
|
||||
}
|
||||
|
||||
install_bladerf_driver_from_source(){
|
||||
bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt
|
||||
echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading BladeRF driver"
|
||||
rm -rf /tmp/bladeRF
|
||||
git clone https://github.com/Nuand/bladeRF.git
|
||||
cd bladeRF || exit
|
||||
git checkout tags/2016.06
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
$CMAKE ../
|
||||
echo "Compiling BladeRF driver"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
echo "Downloading FPGA and firmware images"
|
||||
cd /tmp/bladeRF || exit
|
||||
wget --tries=3 --retry-connrefused https://www.nuand.com/fx3/bladeRF_fw_latest.img
|
||||
wget --tries=3 --retry-connrefused https://www.nuand.com/fpga/hostedx40-latest.rbf
|
||||
sudo mkdir -p /usr/share/Nuand/bladeRF
|
||||
sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf
|
||||
) >& "$bladerf_install_log"
|
||||
}
|
||||
|
||||
check_install_bladerf_driver(){
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
$SUDO apt-get install -y bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y bladerf-fpga-hostedx40
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
install_bladerf_driver_from_source
|
||||
else
|
||||
echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website"
|
||||
fi
|
||||
}
|
||||
|
||||
flash_firmware_bladerf() {
|
||||
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
}
|
||||
|
||||
install_soapy_from_source(){
|
||||
soapy_install_log=$OPENAIR_DIR/cmake_targets/log/soapy_install_log.txt
|
||||
echo_info "\nInstalling Soapy EcoSystem from source. The log file for Soapy installation is here: $soapy_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading SoapySDR"
|
||||
rm -rf /tmp/soapysdr
|
||||
git clone -b soapy-sdr-0.7.0 --single-branch https://github.com/pothosware/SoapySDR.git
|
||||
cd SoapySDR || exit
|
||||
#git checkout tags/release_003_010_001_001
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
$CMAKE ../
|
||||
echo "Compiling SoapySDR"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
cd /tmp || exit
|
||||
echo "Downloading SoapyRemote"
|
||||
rm -rf /tmp/soapyremote
|
||||
git clone -b soapy-remote-0.5.0 --single-branch https://github.com/pothosware/SoapyRemote.git
|
||||
cd SoapyRemote || exit
|
||||
#git checkout tags/release_003_010_001_001
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
cmake ../
|
||||
echo "Compiling SoapyRemote"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$soapy_install_log"
|
||||
}
|
||||
|
||||
install_soapy_iris_from_source(){
|
||||
iris_install_log=$OPENAIR_DIR/cmake_targets/log/iris_install_log.txt
|
||||
echo_info "\nInstalling Iris driver from source. The log file for Iris driver installation is here: $iris_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading SoapyIris"
|
||||
rm -rf /tmp/sklk-soapyiris
|
||||
git clone -b soapy-iris-2018.08.0.1 --single-branch https://github.com/skylarkwireless/sklk-soapyiris.git
|
||||
cd sklk-soapyiris || exit
|
||||
mkdir -p build
|
||||
cd build ||exit
|
||||
cmake ../
|
||||
echo "Compiling SoapyIris"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$iris_install_log"
|
||||
}
|
||||
|
||||
check_install_soapy () {
|
||||
#if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true
|
||||
#$SUDO add-apt-repository -y ppa:myriadrf/drivers
|
||||
#$SUDO apt-get update
|
||||
#$SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote
|
||||
|
||||
#elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
# $SUDO $INSTALLER -y install software-properties-common python3-software-properties python-software-properties subversion git python3 python-numpy python3-numpy cmake swig python-dev
|
||||
install_soapy_from_source
|
||||
#fi
|
||||
install_soapy_iris_from_source
|
||||
|
||||
}
|
||||
|
||||
check_install_ubuntu_packages() {
|
||||
$SUDO $INSTALLER update -y
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
local LAPACK_LIBNAME="liblapack.so"
|
||||
local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so"
|
||||
$SUDO apt install -y software-properties-common
|
||||
case "$(get_distribution_release)" in
|
||||
"ubuntu20.04")
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
esac
|
||||
$SUDO $INSTALLER install -y \
|
||||
$specific_packages \
|
||||
check \
|
||||
dialog \
|
||||
dkms \
|
||||
gawk \
|
||||
libboost-all-dev \
|
||||
libpthread-stubs0-dev \
|
||||
openvpn \
|
||||
pkg-config \
|
||||
python3-dev \
|
||||
python-pexpect \
|
||||
sshfs \
|
||||
swig \
|
||||
tshark \
|
||||
uml-utilities \
|
||||
unzip \
|
||||
valgrind \
|
||||
vlan \
|
||||
exuberant-ctags \
|
||||
ntpdate \
|
||||
iperf3 \
|
||||
android-tools-adb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass \
|
||||
nscd \
|
||||
bc \
|
||||
ntp \
|
||||
python3-scipy \
|
||||
python3-matplotlib \
|
||||
bison \
|
||||
build-essential \
|
||||
cmake \
|
||||
cmake-curses-gui \
|
||||
ninja-build \
|
||||
doxygen \
|
||||
doxygen-gui \
|
||||
texlive-latex-base \
|
||||
ethtool \
|
||||
flex \
|
||||
gdb \
|
||||
git \
|
||||
graphviz \
|
||||
gtkwave \
|
||||
guile-2.0-dev \
|
||||
iperf \
|
||||
iptables \
|
||||
libxtables-dev \
|
||||
libatlas-base-dev \
|
||||
libblas-dev \
|
||||
liblapack-dev\
|
||||
liblapacke-dev\
|
||||
libffi-dev \
|
||||
libforms-bin \
|
||||
libforms-dev \
|
||||
libgcrypt20-dev \
|
||||
libgmp-dev \
|
||||
libgtk-3-dev \
|
||||
libidn2-0-dev \
|
||||
libidn11-dev \
|
||||
libmysqlclient-dev \
|
||||
libpython2.7-dev \
|
||||
libsctp1 \
|
||||
libsctp-dev \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
libusb-1.0-0-dev \
|
||||
libxml2 \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
mscgen \
|
||||
octave-signal \
|
||||
openssh-client \
|
||||
openssh-server \
|
||||
openssl \
|
||||
python3 \
|
||||
subversion \
|
||||
xmlstarlet \
|
||||
python3-pip \
|
||||
libyaml-dev \
|
||||
wget \
|
||||
libxpm-dev \
|
||||
libboost-all-dev \
|
||||
nettle-dev \
|
||||
nettle-bin
|
||||
fi
|
||||
|
||||
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
|
||||
|
||||
}
|
||||
|
||||
install_asn1c_from_source(){
|
||||
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
cd /tmp/asn1c || exit
|
||||
# better to use a given commit than a branch in case the branch
|
||||
# is updated and requires modifications in the source of OAI
|
||||
#git checkout velichkov_s1ap_plus_option_group
|
||||
git checkout f12568d617dbf48497588f8e227d70388fa217c9
|
||||
autoreconf -iv
|
||||
./configure
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
cd - || exit
|
||||
$SUDO ldconfig
|
||||
) > "$asn1_install_log" 2>&1
|
||||
}
|
||||
|
||||
#################################################
|
||||
# 2. compile
|
||||
################################################
|
||||
|
||||
install_nas_tools() {
|
||||
echo_success "generate .ue_emm.nvram .ue.nvram"
|
||||
./nvram --gen -c "$1" -o "$2"
|
||||
./usim --gen -c "$1" -o "$2"
|
||||
}
|
||||
|
||||
|
||||
################################
|
||||
# set_openair_env
|
||||
###############################
|
||||
set_openair_env(){
|
||||
fullpath=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
[ -f "/.$fullpath" ] || fullpath=$(readlink -f "$PWD/$fullpath")
|
||||
openair_path=${fullpath%/cmake_targets/*}
|
||||
openair_path=${openair_path%/targets/*}
|
||||
openair_path=${openair_path%/openair[123]/*}
|
||||
export OPENAIR_DIR=$openair_path
|
||||
export OPENAIR1_DIR=$openair_path/openair1
|
||||
export OPENAIR2_DIR=$openair_path/openair2
|
||||
export OPENAIR3_DIR=$openair_path/openair3
|
||||
export OPENAIR_TARGETS=$openair_path/targets
|
||||
}
|
||||
|
||||
if ! check_supported_distribution; then
|
||||
echo_error "Your distribution $(get_distribution_release) is not supported by oai !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo_info "Installing packages"
|
||||
check_install_ubuntu_packages
|
||||
|
||||
echo_info "installing ASN.1 compiler"
|
||||
install_asn1c_from_source
|
||||
|
||||
echo_info "installing protobuf/protobuf-c for flexran agent support"
|
||||
install_protobuf_from_source
|
||||
install_protobuf_c_from_source
|
||||
|
||||
if [ "$1" == "USRP" ] ; then
|
||||
echo_info "installing packages for USRP support"
|
||||
install_usrp_uhd_driver
|
||||
fi
|
||||
if [ "$1" == "BLADERF" ] ; then
|
||||
echo_info "installing packages for BLADERF support"
|
||||
check_install_bladerf_driver
|
||||
flash_firmware_bladerf
|
||||
fi
|
||||
if [ "$1" == "IRIS" ] ; then
|
||||
echo_info "installing packages for IRIS support"
|
||||
check_install_soapy
|
||||
# flash_firmware_iris
|
||||
fi
|
||||
@@ -4,7 +4,6 @@ set ( CMAKE_BUILD_TYPE )
|
||||
set ( CFLAGS_PROCESSOR_USER "" )
|
||||
set ( UE_EXPANSION False )
|
||||
set ( PRE_SCD_THREAD False )
|
||||
set ( UESIM_EXPANSION False )
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( RF_BOARD "None")
|
||||
set ( TRANSP_PRO "None")
|
||||
|
||||
@@ -42,12 +42,12 @@ KERNEL_MAJOR=$(uname -r | cut -d '.' -f2)
|
||||
|
||||
#check if we run inside a container
|
||||
IS_CONTAINER=`egrep -c "docker|podman|kubepods" /proc/self/cgroup || true`
|
||||
#sudo is not needed inside a container
|
||||
if [ $IS_CONTAINER -eq 0 ]
|
||||
#sudo is not needed when we are root
|
||||
if [ "$UID" = 0 ]
|
||||
then
|
||||
SUDO='sudo -S -E'
|
||||
else
|
||||
SUDO=''
|
||||
else
|
||||
SUDO='sudo -S -E'
|
||||
fi
|
||||
|
||||
###############################
|
||||
@@ -251,18 +251,13 @@ install_protobuf_from_source(){
|
||||
#wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
|
||||
#tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
#cd protobuf-2.6.1/
|
||||
|
||||
|
||||
if [ $IS_CONTAINER -eq 0 ]
|
||||
then
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $(id -u) --group $(id -g) --no-same-owner
|
||||
cd protobuf-3.3.0/
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
else
|
||||
export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs
|
||||
rm -rf /tmp/protobuf
|
||||
@@ -270,11 +265,12 @@ install_protobuf_from_source(){
|
||||
cd /tmp/protobuf
|
||||
git submodule update --init --recursive
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j`nproc`
|
||||
make install
|
||||
ldconfig
|
||||
fi
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& $protobuf_install_log
|
||||
}
|
||||
|
||||
|
||||
+12
-9
@@ -397,18 +397,21 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
/* define variable only used in LOG macro's */
|
||||
# define LOG_VAR(A,B) A B
|
||||
# else /* T_TRACER: remove all debugging and tracing messages, except errors */
|
||||
# define LOG_I(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)/* */
|
||||
# define LOG_W(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ; } while(0)/* */
|
||||
# define LOG_E(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ; } while(0)/* */
|
||||
# define LOG_D(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ; } while(0)/* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
|
||||
# define LOG_DUMPMSG(c, b, s, x...) /* */
|
||||
# define LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0)
|
||||
# define LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0)
|
||||
# define LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0)
|
||||
# define LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0)
|
||||
# define LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0)
|
||||
# define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0)
|
||||
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
|
||||
# define LOG_DEBUGFLAG(D) ( 0 )
|
||||
# define LOG_DUMPFLAG(D) ( 0 )
|
||||
# define LOG_DEBUGFLAG(D) (g_log->dump_mask & D)
|
||||
# define LOG_DUMPFLAG(D) (g_log->debug_mask & D)
|
||||
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
|
||||
|
||||
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
|
||||
# define LOG_VAR(A,B)
|
||||
# define LOG_VAR(A,B) A B
|
||||
# endif /* T_TRACER */
|
||||
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
|
||||
#define GCC_NOTUSED __attribute__((unused))
|
||||
|
||||
@@ -814,6 +814,7 @@ static inline unsigned long long int vcd_get_time(void)
|
||||
return (long long unsigned int)((time.tv_nsec - g_time_start.tv_nsec)) +
|
||||
((long long unsigned int)time.tv_sec - (long long unsigned int)g_time_start.tv_sec) * 1000000000UL;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vcd_signal_dumper_create_header(void)
|
||||
|
||||
@@ -601,11 +601,19 @@ extern int ouput_vcd;
|
||||
|
||||
#else /* T_TRACER */
|
||||
|
||||
#if ENABLE_VCD
|
||||
#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)
|
||||
#else
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* T_TRACER */
|
||||
|
||||
@@ -85,6 +85,10 @@ ID = ENB_PHY_MIB
|
||||
DESC = MIB data
|
||||
GROUP = ALL:PHY:ENB:WIRESHARK
|
||||
FORMAT = int,eNB_ID : int,frame : int,subframe : buffer,data
|
||||
ID = GNB_PHY_MIB
|
||||
DESC = NR MIB data
|
||||
GROUP = ALL:PHY:GNB:WIRESHARK
|
||||
FORMAT = int,gNB_ID : int,frame : int,slot : buffer,data
|
||||
|
||||
#MAC logs
|
||||
ID = ENB_MAC_UE_DL_SDU
|
||||
@@ -131,6 +135,18 @@ ID = ENB_MAC_UE_DL_RAR_PDU_WITH_DATA
|
||||
DESC = MAC downlink PDU for an UE
|
||||
GROUP = ALL:MAC:ENB:WIRESHARK
|
||||
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
|
||||
ID = GNB_MAC_DL_PDU_WITH_DATA
|
||||
DESC = NR MAC downlink PDU for an UE
|
||||
GROUP = ALL:MAC:GNB:WIRESHARK
|
||||
FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data
|
||||
ID = GNB_MAC_UL_PDU_WITH_DATA
|
||||
DESC = NR MAC uplink PDU for an UE
|
||||
GROUP = ALL:MAC:GNB:WIRESHARK
|
||||
FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data
|
||||
ID = GNB_MAC_DL_RAR_PDU_WITH_DATA
|
||||
DESC = NR MAC downlink PDU for RAR
|
||||
GROUP = ALL:MAC:GNB:WIRESHARK
|
||||
FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data
|
||||
|
||||
#RLC logs
|
||||
ID = ENB_RLC_DL
|
||||
|
||||
@@ -23,6 +23,8 @@ typedef struct {
|
||||
int socket;
|
||||
struct sockaddr_in to;
|
||||
OBUF buf;
|
||||
|
||||
/* LTE traces */
|
||||
/* ul */
|
||||
int ul_rnti;
|
||||
int ul_frame;
|
||||
@@ -46,6 +48,28 @@ typedef struct {
|
||||
int rar_frame;
|
||||
int rar_subframe;
|
||||
int rar_data;
|
||||
|
||||
/* NR traces */
|
||||
/* NR ul */
|
||||
int nr_ul_rnti;
|
||||
int nr_ul_frame;
|
||||
int nr_ul_slot;
|
||||
int nr_ul_data;
|
||||
/* NR dl */
|
||||
int nr_dl_rnti;
|
||||
int nr_dl_frame;
|
||||
int nr_dl_slot;
|
||||
int nr_dl_data;
|
||||
/* NR mib */
|
||||
int nr_mib_frame;
|
||||
int nr_mib_slot;
|
||||
int nr_mib_data;
|
||||
/* NR RAR */
|
||||
int nr_rar_rnti;
|
||||
int nr_rar_frame;
|
||||
int nr_rar_slot;
|
||||
int nr_rar_data;
|
||||
|
||||
/* config */
|
||||
int no_mib;
|
||||
int no_sib;
|
||||
@@ -58,8 +82,13 @@ typedef struct {
|
||||
int cur_sib;
|
||||
} ev_data;
|
||||
|
||||
void trace(ev_data *d, int direction, int rnti_type, int rnti,
|
||||
int frame, int subframe, void *buf, int bufsize, int preamble) {
|
||||
/****************************************************************************/
|
||||
/* LTE */
|
||||
/****************************************************************************/
|
||||
|
||||
void trace_lte(ev_data *d, int direction, int rnti_type, int rnti,
|
||||
int frame, int subframe, void *buf, int bufsize, int preamble)
|
||||
{
|
||||
ssize_t ret;
|
||||
int fsf;
|
||||
int i;
|
||||
@@ -100,15 +129,17 @@ void trace(ev_data *d, int direction, int rnti_type, int rnti,
|
||||
if (ret != d->buf.osize) abort();
|
||||
}
|
||||
|
||||
void ul(void *_d, event e) {
|
||||
void ul(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
trace(d, DIRECTION_UPLINK, C_RNTI, e.e[d->ul_rnti].i,
|
||||
e.e[d->ul_frame].i, e.e[d->ul_subframe].i,
|
||||
e.e[d->ul_data].b, e.e[d->ul_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
trace_lte(d, DIRECTION_UPLINK, C_RNTI, e.e[d->ul_rnti].i,
|
||||
e.e[d->ul_frame].i, e.e[d->ul_subframe].i,
|
||||
e.e[d->ul_data].b, e.e[d->ul_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
}
|
||||
|
||||
void dl(void *_d, event e) {
|
||||
void dl(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
|
||||
if (e.e[d->dl_rnti].i == 0xffff) {
|
||||
@@ -119,14 +150,15 @@ void dl(void *_d, event e) {
|
||||
d->cur_sib++;
|
||||
}
|
||||
|
||||
trace(d, DIRECTION_DOWNLINK,
|
||||
e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI, e.e[d->dl_rnti].i,
|
||||
e.e[d->dl_frame].i, e.e[d->dl_subframe].i,
|
||||
e.e[d->dl_data].b, e.e[d->dl_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
trace_lte(d, DIRECTION_DOWNLINK,
|
||||
e.e[d->dl_rnti].i != 0xffff ? C_RNTI : SI_RNTI, e.e[d->dl_rnti].i,
|
||||
e.e[d->dl_frame].i, e.e[d->dl_subframe].i,
|
||||
e.e[d->dl_data].b, e.e[d->dl_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
}
|
||||
|
||||
void mib(void *_d, event e) {
|
||||
void mib(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
|
||||
if (d->no_mib) return;
|
||||
@@ -134,30 +166,141 @@ void mib(void *_d, event e) {
|
||||
if (d->max_mib && d->cur_mib == d->max_mib) return;
|
||||
|
||||
d->cur_mib++;
|
||||
trace(d, DIRECTION_DOWNLINK, NO_RNTI, 0,
|
||||
e.e[d->mib_frame].i, e.e[d->mib_subframe].i,
|
||||
e.e[d->mib_data].b, e.e[d->mib_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
trace_lte(d, DIRECTION_DOWNLINK, NO_RNTI, 0,
|
||||
e.e[d->mib_frame].i, e.e[d->mib_subframe].i,
|
||||
e.e[d->mib_data].b, e.e[d->mib_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
}
|
||||
|
||||
void preamble(void *_d, event e) {
|
||||
void preamble(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
trace(d, DIRECTION_UPLINK, NO_RNTI, 0,
|
||||
e.e[d->preamble_frame].i, e.e[d->preamble_subframe].i,
|
||||
NULL, 0,
|
||||
e.e[d->preamble_preamble].i);
|
||||
trace_lte(d, DIRECTION_UPLINK, NO_RNTI, 0,
|
||||
e.e[d->preamble_frame].i, e.e[d->preamble_subframe].i,
|
||||
NULL, 0,
|
||||
e.e[d->preamble_preamble].i);
|
||||
}
|
||||
|
||||
void rar(void *_d, event e) {
|
||||
void rar(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
trace(d, DIRECTION_DOWNLINK, RA_RNTI, e.e[d->rar_rnti].i,
|
||||
e.e[d->rar_frame].i, e.e[d->rar_subframe].i,
|
||||
e.e[d->rar_data].b, e.e[d->rar_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
trace_lte(d, DIRECTION_DOWNLINK, RA_RNTI, e.e[d->rar_rnti].i,
|
||||
e.e[d->rar_frame].i, e.e[d->rar_subframe].i,
|
||||
e.e[d->rar_data].b, e.e[d->rar_data].bsize,
|
||||
NO_PREAMBLE);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/* NR */
|
||||
/****************************************************************************/
|
||||
|
||||
#define MAC_NR_START_STRING "mac-nr"
|
||||
|
||||
#define MAC_NR_PAYLOAD_TAG 0x01
|
||||
#define MAC_NR_RNTI_TAG 0x02
|
||||
#define MAC_NR_FRAME_SLOT_TAG 0x07
|
||||
|
||||
#define NR_FDD_RADIO 1
|
||||
#define NR_TDD_RADIO 2
|
||||
|
||||
#define NR_DIRECTION_UPLINK 0
|
||||
#define NR_DIRECTION_DOWNLINK 1
|
||||
|
||||
#define NR_NO_RNTI 0
|
||||
#define NR_RA_RNTI 2
|
||||
#define NR_C_RNTI 3
|
||||
|
||||
void trace_nr(ev_data *d, int direction, int rnti_type, int rnti,
|
||||
int frame, int slot, void *buf, int bufsize, int preamble)
|
||||
{
|
||||
ssize_t ret;
|
||||
int i;
|
||||
d->buf.osize = 0;
|
||||
PUTS(&d->buf, MAC_NR_START_STRING);
|
||||
PUTC(&d->buf, NR_TDD_RADIO);
|
||||
PUTC(&d->buf, direction);
|
||||
PUTC(&d->buf, rnti_type);
|
||||
|
||||
if (rnti_type == NR_C_RNTI || rnti_type == NR_RA_RNTI) {
|
||||
PUTC(&d->buf, MAC_NR_RNTI_TAG);
|
||||
PUTC(&d->buf, (rnti>>8) & 255);
|
||||
PUTC(&d->buf, rnti & 255);
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* for old versions of wireshark; not sure if correct */
|
||||
int fsf = (frame << 4) + slot;
|
||||
PUTC(&d->buf, 4 /* MAC_NR_FRAME_SUBFRAME_TAG */);
|
||||
PUTC(&d->buf, (fsf>>8) & 255);
|
||||
PUTC(&d->buf, fsf & 255);
|
||||
#else
|
||||
PUTC(&d->buf, MAC_NR_FRAME_SLOT_TAG);
|
||||
PUTC(&d->buf, (frame>>8) & 255);
|
||||
PUTC(&d->buf, frame & 255);
|
||||
PUTC(&d->buf, (slot>>8) & 255);
|
||||
PUTC(&d->buf, slot & 255);
|
||||
#endif
|
||||
|
||||
PUTC(&d->buf, MAC_NR_PAYLOAD_TAG);
|
||||
|
||||
for (i = 0; i < bufsize; i++)
|
||||
PUTC(&d->buf, ((char *)buf)[i]);
|
||||
|
||||
ret = sendto(d->socket, d->buf.obuf, d->buf.osize, 0,
|
||||
(struct sockaddr *)&d->to, sizeof(struct sockaddr_in));
|
||||
|
||||
if (ret != d->buf.osize) abort();
|
||||
}
|
||||
|
||||
void nr_ul(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
|
||||
trace_nr(d, NR_DIRECTION_UPLINK, NR_C_RNTI, e.e[d->nr_ul_rnti].i,
|
||||
e.e[d->nr_ul_frame].i, e.e[d->nr_ul_slot].i,
|
||||
e.e[d->nr_ul_data].b, e.e[d->nr_ul_data].bsize, NO_PREAMBLE);
|
||||
}
|
||||
|
||||
void nr_dl(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
|
||||
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_C_RNTI, e.e[d->nr_dl_rnti].i,
|
||||
e.e[d->nr_dl_frame].i, e.e[d->nr_dl_slot].i,
|
||||
e.e[d->nr_dl_data].b, e.e[d->nr_dl_data].bsize, NO_PREAMBLE);
|
||||
}
|
||||
|
||||
void nr_mib(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
|
||||
if (d->no_mib) return;
|
||||
|
||||
if (d->max_mib && d->cur_mib == d->max_mib) return;
|
||||
|
||||
d->cur_mib++;
|
||||
|
||||
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_NO_RNTI, 0,
|
||||
e.e[d->nr_mib_frame].i, e.e[d->nr_mib_slot].i,
|
||||
e.e[d->nr_mib_data].b, e.e[d->nr_mib_data].bsize, NO_PREAMBLE);
|
||||
}
|
||||
|
||||
void nr_rar(void *_d, event e)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
|
||||
trace_nr(d, NR_DIRECTION_DOWNLINK, NR_RA_RNTI, e.e[d->nr_rar_rnti].i,
|
||||
e.e[d->nr_rar_frame].i, e.e[d->nr_rar_slot].i,
|
||||
e.e[d->nr_rar_data].b, e.e[d->nr_rar_data].bsize, NO_PREAMBLE);
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
/****************************************************************************/
|
||||
|
||||
void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
|
||||
int preamble_id, int rar_id) {
|
||||
int preamble_id, int rar_id,
|
||||
int nr_ul_id, int nr_dl_id, int nr_mib_id, int nr_rar_id)
|
||||
{
|
||||
database_event_format f;
|
||||
int i;
|
||||
d->ul_rnti = -1;
|
||||
@@ -174,10 +317,27 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
|
||||
d->preamble_frame = -1;
|
||||
d->preamble_subframe = -1;
|
||||
d->preamble_preamble = -1;
|
||||
d->rar_rnti = -1;
|
||||
d->rar_frame = -1;
|
||||
d->rar_subframe = -1;
|
||||
d->rar_data = -1;
|
||||
d->rar_rnti = -1;
|
||||
d->rar_frame = -1;
|
||||
d->rar_subframe = -1;
|
||||
d->rar_data = -1;
|
||||
|
||||
d->nr_ul_rnti = -1;
|
||||
d->nr_ul_frame = -1;
|
||||
d->nr_ul_slot = -1;
|
||||
d->nr_ul_data = -1;
|
||||
d->nr_dl_rnti = -1;
|
||||
d->nr_dl_frame = -1;
|
||||
d->nr_dl_slot = -1;
|
||||
d->nr_dl_data = -1;
|
||||
d->nr_mib_frame = -1;
|
||||
d->nr_mib_slot = -1;
|
||||
d->nr_mib_data = -1;
|
||||
d->nr_rar_rnti = -1;
|
||||
d->nr_rar_frame = -1;
|
||||
d->nr_rar_slot = -1;
|
||||
d->nr_rar_data = -1;
|
||||
|
||||
#define G(var_name, var_type, var) \
|
||||
if (!strcmp(f.name[i], var_name)) { \
|
||||
if (strcmp(f.type[i], var_type)) goto error; \
|
||||
@@ -247,6 +407,60 @@ void setup_data(ev_data *d, void *database, int ul_id, int dl_id, int mib_id,
|
||||
if (d->rar_rnti == -1 || d->rar_frame == -1 || d->rar_subframe == -1 ||
|
||||
d->rar_data == -1) goto error;
|
||||
|
||||
/* NR ul: rnti, frame, slot, data */
|
||||
f = get_format(database, nr_ul_id);
|
||||
|
||||
for (i = 0; i < f.count; i++) {
|
||||
G("rnti", "int", d->nr_ul_rnti);
|
||||
G("frame", "int", d->nr_ul_frame);
|
||||
G("slot", "int", d->nr_ul_slot);
|
||||
G("data", "buffer", d->nr_ul_data);
|
||||
}
|
||||
|
||||
if (d->nr_ul_rnti == -1 || d->nr_ul_frame == -1 || d->nr_ul_slot == -1 ||
|
||||
d->nr_ul_data == -1)
|
||||
goto error;
|
||||
|
||||
/* NR dl: rnti, frame, slot, data */
|
||||
f = get_format(database, nr_dl_id);
|
||||
|
||||
for (i = 0; i < f.count; i++) {
|
||||
G("rnti", "int", d->nr_dl_rnti);
|
||||
G("frame", "int", d->nr_dl_frame);
|
||||
G("slot", "int", d->nr_dl_slot);
|
||||
G("data", "buffer", d->nr_dl_data);
|
||||
}
|
||||
|
||||
if (d->nr_dl_rnti == -1 || d->nr_dl_frame == -1 || d->nr_dl_slot == -1 ||
|
||||
d->nr_dl_data == -1)
|
||||
goto error;
|
||||
|
||||
/* NR MIB: frame, slot, data */
|
||||
f = get_format(database, nr_mib_id);
|
||||
|
||||
for (i = 0; i < f.count; i++) {
|
||||
G("frame", "int", d->nr_mib_frame);
|
||||
G("slot", "int", d->nr_mib_slot);
|
||||
G("data", "buffer", d->nr_mib_data);
|
||||
}
|
||||
|
||||
if (d->nr_mib_frame == -1 || d->nr_mib_slot== -1 || d->nr_mib_data == -1)
|
||||
goto error;
|
||||
|
||||
/* NR RAR: rnti, frame, slot, data */
|
||||
f = get_format(database, nr_rar_id);
|
||||
|
||||
for (i = 0; i < f.count; i++) {
|
||||
G("rnti", "int", d->nr_rar_rnti);
|
||||
G("frame", "int", d->nr_rar_frame);
|
||||
G("slot", "int", d->nr_rar_slot);
|
||||
G("data", "buffer", d->nr_rar_data);
|
||||
}
|
||||
|
||||
if (d->nr_rar_rnti == -1 || d->nr_rar_frame == -1 || d->nr_rar_slot == -1 ||
|
||||
d->nr_rar_data == -1)
|
||||
goto error;
|
||||
|
||||
#undef G
|
||||
return;
|
||||
error:
|
||||
@@ -254,7 +468,8 @@ error:
|
||||
abort();
|
||||
}
|
||||
|
||||
void *receiver(void *_d) {
|
||||
void *receiver(void *_d)
|
||||
{
|
||||
ev_data *d = _d;
|
||||
int s;
|
||||
char buf[100000];
|
||||
@@ -279,7 +494,8 @@ void *receiver(void *_d) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void usage(void) {
|
||||
void usage(void)
|
||||
{
|
||||
printf(
|
||||
"options:\n"
|
||||
" -d <database file> this option is mandatory\n"
|
||||
@@ -304,14 +520,16 @@ void usage(void) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
int main(int n, char **v) {
|
||||
int main(int n, char **v)
|
||||
{
|
||||
char *database_filename = NULL;
|
||||
char *input_filename = NULL;
|
||||
void *database;
|
||||
event_handler *h;
|
||||
int in;
|
||||
int i;
|
||||
int ul_id, dl_id, mib_id = -1, preamble_id, rar_id;
|
||||
int ul_id, dl_id, mib_id, preamble_id, rar_id;
|
||||
int nr_ul_id, nr_dl_id, nr_mib_id, nr_rar_id;
|
||||
ev_data d;
|
||||
char *ip = DEFAULT_IP;
|
||||
int port = DEFAULT_PORT;
|
||||
@@ -382,6 +600,11 @@ int main(int n, char **v) {
|
||||
on_off(database, "ENB_PHY_INITIATE_RA_PROCEDURE", is_on, 1);
|
||||
on_off(database, "ENB_MAC_UE_DL_RAR_PDU_WITH_DATA", is_on, 1);
|
||||
|
||||
on_off(database, "GNB_MAC_UL_PDU_WITH_DATA", is_on, 1);
|
||||
on_off(database, "GNB_MAC_DL_PDU_WITH_DATA", is_on, 1);
|
||||
on_off(database, "GNB_PHY_MIB", is_on, 1);
|
||||
on_off(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA", is_on, 1);
|
||||
|
||||
/* activate selected traces */
|
||||
if (socket_send(in, &mt, 1) == -1 ||
|
||||
socket_send(in, &number_of_events, sizeof(int)) == -1 ||
|
||||
@@ -398,12 +621,26 @@ int main(int n, char **v) {
|
||||
mib_id = event_id_from_name(database, "ENB_PHY_MIB");
|
||||
preamble_id = event_id_from_name(database, "ENB_PHY_INITIATE_RA_PROCEDURE");
|
||||
rar_id = event_id_from_name(database, "ENB_MAC_UE_DL_RAR_PDU_WITH_DATA");
|
||||
setup_data(&d, database, ul_id, dl_id, mib_id, preamble_id, rar_id);
|
||||
|
||||
nr_ul_id = event_id_from_name(database, "GNB_MAC_UL_PDU_WITH_DATA");
|
||||
nr_dl_id = event_id_from_name(database, "GNB_MAC_DL_PDU_WITH_DATA");
|
||||
nr_mib_id = event_id_from_name(database, "GNB_PHY_MIB");
|
||||
nr_rar_id = event_id_from_name(database, "GNB_MAC_DL_RAR_PDU_WITH_DATA");
|
||||
|
||||
setup_data(&d, database, ul_id, dl_id, mib_id, preamble_id, rar_id,
|
||||
nr_ul_id, nr_dl_id, nr_mib_id, nr_rar_id);
|
||||
|
||||
register_handler_function(h, ul_id, ul, &d);
|
||||
register_handler_function(h, dl_id, dl, &d);
|
||||
register_handler_function(h, mib_id, mib, &d);
|
||||
register_handler_function(h, preamble_id, preamble, &d);
|
||||
register_handler_function(h, rar_id, rar, &d);
|
||||
|
||||
register_handler_function(h, nr_ul_id, nr_ul, &d);
|
||||
register_handler_function(h, nr_dl_id, nr_dl, &d);
|
||||
register_handler_function(h, nr_mib_id, nr_mib, &d);
|
||||
register_handler_function(h, nr_rar_id, nr_rar, &d);
|
||||
|
||||
d.socket = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
|
||||
if (d.socket == -1) {
|
||||
@@ -424,8 +661,10 @@ int main(int n, char **v) {
|
||||
|
||||
if (e.type == -1) break;
|
||||
|
||||
if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id ||
|
||||
e.type == preamble_id || e.type == rar_id)) continue;
|
||||
if (!(e.type == ul_id || e.type == dl_id || e.type == mib_id ||
|
||||
e.type == preamble_id || e.type == rar_id ||
|
||||
e.type == nr_ul_id || e.type == nr_dl_id ||
|
||||
e.type == nr_mib_id || e.type == nr_rar_id)) continue;
|
||||
|
||||
handle_event(h, e);
|
||||
}
|
||||
|
||||
@@ -101,11 +101,11 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) {
|
||||
|
||||
shift = ((asn->size - 1) * 8) - asn->bits_unused;
|
||||
for (index = 0; index < (asn->size - 1); index++) {
|
||||
result |= asn->buf[index] << shift;
|
||||
result |= ((uint64_t)asn->buf[index]) << shift;
|
||||
shift -= 8;
|
||||
}
|
||||
|
||||
result |= asn->buf[index] >> asn->bits_unused;
|
||||
result |= ((uint64_t)asn->buf[index]) >> asn->bits_unused;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -1,490 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "assertions.h"
|
||||
#include "memory_pools.h"
|
||||
|
||||
#if T_TRACER
|
||||
#include <string.h>
|
||||
#include "T.h"
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
const static int mp_debug = 0;
|
||||
|
||||
# define MP_DEBUG(x, args...) do { if (mp_debug) fprintf(stdout, "[MP][D]"x, ##args); fflush (stdout); } \
|
||||
while(0)
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
#ifndef CHARS_TO_UINT32
|
||||
#define CHARS_TO_UINT32(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
|
||||
#endif
|
||||
|
||||
#define MEMORY_POOL_ITEM_INFO_NUMBER 2
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
typedef int32_t items_group_position_t;
|
||||
typedef int32_t items_group_index_t;
|
||||
|
||||
typedef union items_group_positions_u {
|
||||
uint64_t all;
|
||||
struct {
|
||||
items_group_position_t put;
|
||||
items_group_position_t get;
|
||||
} ind;
|
||||
} items_group_positions_t;
|
||||
|
||||
typedef struct items_group_s {
|
||||
items_group_position_t number_plus_one;
|
||||
volatile uint32_t minimum;
|
||||
volatile items_group_positions_t positions;
|
||||
volatile items_group_index_t *indexes;
|
||||
} items_group_t;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
//static const items_group_position_t ITEMS_GROUP_POSITION_INVALID = -1;
|
||||
static const items_group_index_t ITEMS_GROUP_INDEX_INVALID = -1;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
typedef uint32_t pool_item_start_mark_t;
|
||||
typedef uint32_t pool_item_end_mark_t;
|
||||
|
||||
typedef uint32_t memory_pool_data_t;
|
||||
|
||||
typedef uint32_t pool_start_mark_t;
|
||||
|
||||
typedef uint32_t pools_start_mark_t;
|
||||
|
||||
typedef uint8_t pool_id_t;
|
||||
typedef uint8_t item_status_t;
|
||||
|
||||
typedef struct memory_pool_item_start_s {
|
||||
pool_item_start_mark_t start_mark;
|
||||
|
||||
pool_id_t pool_id;
|
||||
item_status_t item_status;
|
||||
uint16_t info[MEMORY_POOL_ITEM_INFO_NUMBER];
|
||||
} memory_pool_item_start_t;
|
||||
|
||||
typedef struct memory_pool_item_end_s {
|
||||
pool_item_end_mark_t end_mark;
|
||||
} memory_pool_item_end_t;
|
||||
|
||||
typedef struct memory_pool_item_s {
|
||||
memory_pool_item_start_t start;
|
||||
memory_pool_data_t data[0];
|
||||
memory_pool_item_end_t end;
|
||||
} memory_pool_item_t;
|
||||
|
||||
typedef struct memory_pool_s {
|
||||
pool_start_mark_t start_mark;
|
||||
|
||||
pool_id_t pool_id;
|
||||
uint32_t item_data_number;
|
||||
uint32_t pool_item_size;
|
||||
items_group_t items_group_free;
|
||||
memory_pool_item_t *items;
|
||||
} memory_pool_t;
|
||||
|
||||
|
||||
typedef struct memory_pools_s {
|
||||
pools_start_mark_t start_mark;
|
||||
|
||||
uint32_t pools_number;
|
||||
uint32_t pools_defined;
|
||||
memory_pool_t *pools;
|
||||
} memory_pools_t;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static const uint32_t MAX_POOLS_NUMBER = 20;
|
||||
static const uint32_t MAX_POOL_ITEMS_NUMBER = 200 * 1000;
|
||||
static const uint32_t MAX_POOL_ITEM_SIZE = 100 * 1000;
|
||||
|
||||
static const pool_item_start_mark_t POOL_ITEM_START_MARK = CHARS_TO_UINT32 ('P', 'I', 's', 't');
|
||||
static const pool_item_end_mark_t POOL_ITEM_END_MARK = CHARS_TO_UINT32 ('p', 'i', 'E', 'N');
|
||||
|
||||
static const item_status_t ITEM_STATUS_FREE = 'F';
|
||||
static const item_status_t ITEM_STATUS_ALLOCATED = 'a';
|
||||
|
||||
static const pool_start_mark_t POOL_START_MARK = CHARS_TO_UINT32 ('P', '_', 's', 't');
|
||||
|
||||
static const pools_start_mark_t POOLS_START_MARK = CHARS_TO_UINT32 ('P', 'S', 's', 't');
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static inline uint32_t items_group_number_items (items_group_t *items_group) {
|
||||
return items_group->number_plus_one - 1;
|
||||
}
|
||||
|
||||
static inline uint32_t items_group_free_items (items_group_t *items_group) {
|
||||
items_group_positions_t positions;
|
||||
uint32_t free_items;
|
||||
positions.all = items_group->positions.all;
|
||||
free_items = items_group->number_plus_one + positions.ind.put - positions.ind.get;
|
||||
free_items %= items_group->number_plus_one;
|
||||
return free_items;
|
||||
}
|
||||
|
||||
static inline items_group_index_t items_group_get_free_item (items_group_t *items_group) {
|
||||
items_group_position_t get_raw;
|
||||
items_group_position_t put;
|
||||
items_group_position_t get;
|
||||
items_group_position_t free_items;
|
||||
items_group_index_t index = ITEMS_GROUP_INDEX_INVALID;
|
||||
/* Get current put position */
|
||||
put = items_group->positions.ind.put % items_group->number_plus_one;
|
||||
/* Get current get position and increase it */
|
||||
get_raw = __sync_fetch_and_add (&items_group->positions.ind.get, 1);
|
||||
get = get_raw % items_group->number_plus_one;
|
||||
|
||||
if(put == get) {
|
||||
/* No more item free, restore previous position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.get, 1);
|
||||
} else {
|
||||
/* Get index at current get position */
|
||||
index = items_group->indexes[get];
|
||||
|
||||
if (index <= ITEMS_GROUP_INDEX_INVALID) {
|
||||
/* Index has not yet been completely freed, restore previous get position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.get, 1);
|
||||
} else {
|
||||
if (get_raw == items_group->number_plus_one) {
|
||||
/* Wrap get position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.get, items_group->number_plus_one);
|
||||
}
|
||||
|
||||
free_items = items_group_free_items(items_group);
|
||||
|
||||
/* Updates minimum free items if needed */
|
||||
while (items_group->minimum > free_items) {
|
||||
items_group->minimum = free_items;
|
||||
}
|
||||
|
||||
/* Clear index at current get position to indicate that item is free */
|
||||
items_group->indexes[get] = ITEMS_GROUP_INDEX_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
return (index);
|
||||
}
|
||||
|
||||
static inline int items_group_put_free_item (items_group_t *items_group, items_group_index_t index) {
|
||||
items_group_position_t put_raw;
|
||||
items_group_position_t put;
|
||||
/* Get current put position and increase it */
|
||||
put_raw = __sync_fetch_and_add (&items_group->positions.ind.put, 1);
|
||||
put = put_raw % items_group->number_plus_one;
|
||||
|
||||
if (put_raw == items_group->number_plus_one) {
|
||||
/* Wrap position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.put, items_group->number_plus_one);
|
||||
}
|
||||
|
||||
AssertError (items_group->indexes[put] <= ITEMS_GROUP_INDEX_INVALID, return (EXIT_FAILURE),
|
||||
"Index at current put position (%d) is not marked as free (%d)!\n", put, items_group->number_plus_one);
|
||||
/* Save freed item index at current put position */
|
||||
items_group->indexes[put] = index;
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static inline memory_pools_t *memory_pools_from_handler (memory_pools_handle_t memory_pools_handle) {
|
||||
memory_pools_t *memory_pools;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = (memory_pools_t *) memory_pools_handle;
|
||||
/* Sanity check on passed handle */
|
||||
AssertError (memory_pools->start_mark == POOLS_START_MARK, memory_pools = NULL,
|
||||
"Handle %p is not a valid memory pools handle, start mark is missing!\n", memory_pools_handle);
|
||||
return (memory_pools);
|
||||
}
|
||||
|
||||
static inline memory_pool_item_t *memory_pool_item_from_handler (memory_pool_item_handle_t memory_pool_item_handle) {
|
||||
void *address;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
/* Recover memory_pools */
|
||||
address = memory_pool_item_handle - sizeof(memory_pool_item_start_t);
|
||||
memory_pool_item = (memory_pool_item_t *) address;
|
||||
/* Sanity check on passed handle */
|
||||
AssertError (memory_pool_item->start.start_mark == POOL_ITEM_START_MARK, memory_pool_item = NULL,
|
||||
"Handle %p is not a valid memory pool item handle, start mark is missing!\n", memory_pool_item);
|
||||
return (memory_pool_item);
|
||||
}
|
||||
|
||||
static inline memory_pool_item_t *memory_pool_item_from_index (memory_pool_t *memory_pool, items_group_index_t index) {
|
||||
void *address;
|
||||
address = (void *) memory_pool->items;
|
||||
address += index * memory_pool->pool_item_size;
|
||||
return (address);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
memory_pools_handle_t memory_pools_create (uint32_t pools_number) {
|
||||
memory_pools_t *memory_pools;
|
||||
pool_id_t pool;
|
||||
AssertFatal (pools_number <= MAX_POOLS_NUMBER, "Too many memory pools requested (%d/%d)!\n", pools_number, MAX_POOLS_NUMBER); /* Limit to a reasonable number of pools */
|
||||
/* Allocate memory_pools */
|
||||
memory_pools = malloc (sizeof(memory_pools_t));
|
||||
AssertFatal (memory_pools != NULL, "Memory pools structure allocation failed!\n");
|
||||
/* Initialize memory_pools */
|
||||
{
|
||||
memory_pools->start_mark = POOLS_START_MARK;
|
||||
memory_pools->pools_number = pools_number;
|
||||
memory_pools->pools_defined = 0;
|
||||
/* Allocate pools */
|
||||
memory_pools->pools = calloc (pools_number, sizeof(memory_pool_t));
|
||||
AssertFatal (memory_pools->pools != NULL, "Memory pools allocation failed!\n");
|
||||
|
||||
/* Initialize pools */
|
||||
for (pool = 0; pool < pools_number; pool++) {
|
||||
memory_pools->pools[pool].start_mark = POOL_START_MARK;
|
||||
}
|
||||
}
|
||||
return ((memory_pools_handle_t) memory_pools);
|
||||
}
|
||||
|
||||
char *memory_pools_statistics(memory_pools_handle_t memory_pools_handle) {
|
||||
memory_pools_t *memory_pools;
|
||||
pool_id_t pool;
|
||||
char *statistics;
|
||||
int printed_chars;
|
||||
uint32_t allocated_pool_memory;
|
||||
uint32_t allocated_pools_memory = 0;
|
||||
items_group_t *items_group;
|
||||
uint32_t pool_items_size;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertFatal (memory_pools != NULL, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
statistics = malloc(memory_pools->pools_defined * 200);
|
||||
printed_chars = sprintf (&statistics[0], "Pool: size, number, minimum, free, address space and memory used in Kbytes\n");
|
||||
|
||||
for (pool = 0; pool < memory_pools->pools_defined; pool++) {
|
||||
items_group = &memory_pools->pools[pool].items_group_free;
|
||||
allocated_pool_memory = items_group_number_items (items_group) * memory_pools->pools[pool].pool_item_size;
|
||||
allocated_pools_memory += allocated_pool_memory;
|
||||
pool_items_size = memory_pools->pools[pool].item_data_number * sizeof(memory_pool_data_t);
|
||||
printed_chars += sprintf (&statistics[printed_chars], " %2u: %6u, %6u, %6u, %6u, [%p-%p] %6u\n",
|
||||
pool, pool_items_size,
|
||||
items_group_number_items (items_group),
|
||||
items_group->minimum,
|
||||
items_group_free_items (items_group),
|
||||
memory_pools->pools[pool].items,
|
||||
((void *) memory_pools->pools[pool].items) + allocated_pool_memory,
|
||||
allocated_pool_memory / (1024));
|
||||
}
|
||||
|
||||
printed_chars = sprintf (&statistics[printed_chars], "Pools memory %u Kbytes\n", allocated_pools_memory / (1024));
|
||||
return (statistics);
|
||||
}
|
||||
|
||||
int memory_pools_add_pool (memory_pools_handle_t memory_pools_handle, uint32_t pool_items_number, uint32_t pool_item_size) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_t *memory_pool;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
AssertFatal (pool_items_number <= MAX_POOL_ITEMS_NUMBER, "Too many items for a memory pool (%u/%d)!\n", pool_items_number, MAX_POOL_ITEMS_NUMBER); /* Limit to a reasonable number of items */
|
||||
AssertFatal (pool_item_size <= MAX_POOL_ITEM_SIZE, "Item size is too big for memory pool items (%u/%d)!\n", pool_item_size, MAX_POOL_ITEM_SIZE); /* Limit to a reasonable item size */
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertFatal (memory_pools != NULL, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
/* Check number of already created pools */
|
||||
AssertFatal (memory_pools->pools_defined < memory_pools->pools_number, "Can not allocate more memory pool (%d)!\n", memory_pools->pools_number);
|
||||
/* Select pool */
|
||||
pool = memory_pools->pools_defined;
|
||||
memory_pool = &memory_pools->pools[pool];
|
||||
/* Initialize pool */
|
||||
{
|
||||
memory_pool->pool_id = pool;
|
||||
/* Item size in memory_pool_data_t items by excess */
|
||||
memory_pool->item_data_number = (pool_item_size + sizeof(memory_pool_data_t) - 1) / sizeof(memory_pool_data_t);
|
||||
memory_pool->pool_item_size = (memory_pool->item_data_number * sizeof(memory_pool_data_t)) + sizeof(memory_pool_item_t);
|
||||
memory_pool->items_group_free.number_plus_one = pool_items_number + 1;
|
||||
memory_pool->items_group_free.minimum = pool_items_number;
|
||||
memory_pool->items_group_free.positions.ind.put = pool_items_number;
|
||||
memory_pool->items_group_free.positions.ind.get = 0;
|
||||
/* Allocate free indexes */
|
||||
memory_pool->items_group_free.indexes = malloc(memory_pool->items_group_free.number_plus_one * sizeof(items_group_index_t));
|
||||
AssertFatal (memory_pool->items_group_free.indexes != NULL, "Memory pool indexes allocation failed!\n");
|
||||
|
||||
/* Initialize free indexes */
|
||||
for (item_index = 0; item_index < pool_items_number; item_index++) {
|
||||
memory_pool->items_group_free.indexes[item_index] = item_index;
|
||||
}
|
||||
|
||||
/* Last index is not allocated */
|
||||
memory_pool->items_group_free.indexes[item_index] = ITEMS_GROUP_INDEX_INVALID;
|
||||
/* Allocate items */
|
||||
memory_pool->items = calloc (pool_items_number, memory_pool->pool_item_size);
|
||||
AssertFatal (memory_pool->items != NULL, "Memory pool items allocation failed!\n");
|
||||
|
||||
/* Initialize items */
|
||||
for (item_index = 0; item_index < pool_items_number; item_index++) {
|
||||
memory_pool_item = memory_pool_item_from_index (memory_pool, item_index);
|
||||
memory_pool_item->start.start_mark = POOL_ITEM_START_MARK;
|
||||
memory_pool_item->start.pool_id = pool;
|
||||
memory_pool_item->start.item_status = ITEM_STATUS_FREE;
|
||||
memory_pool_item->data[memory_pool->item_data_number] = POOL_ITEM_END_MARK;
|
||||
}
|
||||
}
|
||||
memory_pools->pools_defined ++;
|
||||
return (0);
|
||||
}
|
||||
|
||||
memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_pools_handle, uint32_t item_size, uint16_t info_0, uint16_t info_1) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
memory_pool_item_handle_t memory_pool_item_handle = NULL;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index = ITEMS_GROUP_INDEX_INVALID;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertError (memory_pools != NULL, {}, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
|
||||
for (pool = 0; pool < memory_pools->pools_defined; pool++) {
|
||||
if ((memory_pools->pools[pool].item_data_number * sizeof(memory_pool_data_t)) < item_size) {
|
||||
/* This memory pool has too small items, skip it */
|
||||
continue;
|
||||
}
|
||||
|
||||
item_index = items_group_get_free_item(&memory_pools->pools[pool].items_group_free);
|
||||
|
||||
if (item_index <= ITEMS_GROUP_INDEX_INVALID) {
|
||||
/* Allocation failed, skip this pool */
|
||||
continue;
|
||||
} else {
|
||||
/* Allocation succeed, exit searching loop */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (item_index > ITEMS_GROUP_INDEX_INVALID) {
|
||||
/* Convert item index into memory_pool_item address */
|
||||
memory_pool_item = memory_pool_item_from_index (&memory_pools->pools[pool], item_index);
|
||||
/* Sanity check on item status, must be free */
|
||||
AssertFatal (memory_pool_item->start.item_status == ITEM_STATUS_FREE, "Item status is not set to free (%d) in pool %u, item %d!\n",
|
||||
memory_pool_item->start.item_status, pool, item_index);
|
||||
memory_pool_item->start.item_status = ITEM_STATUS_ALLOCATED;
|
||||
memory_pool_item->start.info[0] = info_0;
|
||||
memory_pool_item->start.info[1] = info_1;
|
||||
memory_pool_item_handle = memory_pool_item->data;
|
||||
MP_DEBUG(" Alloc [%2u][%6d]{%6d}, %3u %3u, %6u, %p, %p, %p\n",
|
||||
pool, item_index,
|
||||
items_group_free_items (&memory_pools->pools[pool].items_group_free),
|
||||
info_0, info_1,
|
||||
item_size,
|
||||
memory_pools->pools[pool].items,
|
||||
memory_pool_item,
|
||||
memory_pool_item_handle);
|
||||
} else {
|
||||
MP_DEBUG(" Alloc [--][------]{------}, %3u %3u, %6u, failed!\n", info_0, info_1, item_size);
|
||||
}
|
||||
|
||||
return memory_pool_item_handle;
|
||||
}
|
||||
|
||||
int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_item_handle_t memory_pool_item_handle, uint16_t info_0) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index;
|
||||
uint32_t item_size;
|
||||
uint32_t pool_item_size;
|
||||
uint16_t info_1;
|
||||
int result;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertError (memory_pools != NULL, return (EXIT_FAILURE), "Failed to retrieve memory pools for handle %p!\n", memory_pools_handle);
|
||||
/* Recover memory pool item */
|
||||
memory_pool_item = memory_pool_item_from_handler (memory_pool_item_handle);
|
||||
AssertError (memory_pool_item != NULL, return (EXIT_FAILURE), "Failed to retrieve memory pool item for handle %p!\n", memory_pool_item_handle);
|
||||
info_1 = memory_pool_item->start.info[1];
|
||||
/* Recover pool index */
|
||||
pool = memory_pool_item->start.pool_id;
|
||||
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
|
||||
item_size = memory_pools->pools[pool].item_data_number;
|
||||
pool_item_size = memory_pools->pools[pool].pool_item_size;
|
||||
item_index = (((void *) memory_pool_item) - ((void *) memory_pools->pools[pool].items)) / pool_item_size;
|
||||
MP_DEBUG(" Free [%2u][%6d]{%6d}, %3u %3u, %p, %p, %p, %u\n",
|
||||
pool, item_index,
|
||||
items_group_free_items (&memory_pools->pools[pool].items_group_free),
|
||||
memory_pool_item->start.info[0], info_1,
|
||||
memory_pool_item_handle, memory_pool_item,
|
||||
memory_pools->pools[pool].items, ((uint32_t) (item_size * sizeof(memory_pool_data_t))));
|
||||
/* Sanity check on calculated item index */
|
||||
AssertFatal (memory_pool_item == memory_pool_item_from_index(&memory_pools->pools[pool], item_index),
|
||||
"Incorrect memory pool item address (%p, %p) for pool %u, item %d!\n",
|
||||
memory_pool_item,(void *)memory_pool_item_from_index(&memory_pools->pools[pool], item_index), pool, item_index);
|
||||
/* Sanity check on end marker, must still be present (no write overflow) */
|
||||
AssertFatal (memory_pool_item->data[item_size] == POOL_ITEM_END_MARK,
|
||||
"Memory pool item is corrupted, end mark is not present for pool %u, item %d!\n", pool, item_index);
|
||||
/* Sanity check on item status, must be allocated */
|
||||
AssertFatal (memory_pool_item->start.item_status == ITEM_STATUS_ALLOCATED,
|
||||
"Trying to free a non allocated (%x) memory pool item (pool %u, item %d)!\n",
|
||||
memory_pool_item->start.item_status, pool, item_index);
|
||||
memory_pool_item->start.item_status = ITEM_STATUS_FREE;
|
||||
result = items_group_put_free_item(&memory_pools->pools[pool].items_group_free, item_index);
|
||||
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory pool item (pool %u, item %d)!\n", pool, item_index);
|
||||
return (result);
|
||||
}
|
||||
|
||||
void memory_pools_set_info (memory_pools_handle_t memory_pools_handle, memory_pool_item_handle_t memory_pool_item_handle, int index, uint16_t info) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index;
|
||||
uint32_t item_size;
|
||||
uint32_t pool_item_size;
|
||||
AssertFatal (index < MEMORY_POOL_ITEM_INFO_NUMBER, "Incorrect info index (%d/%d)!\n", index, MEMORY_POOL_ITEM_INFO_NUMBER);
|
||||
/* Recover memory pool item */
|
||||
memory_pool_item = memory_pool_item_from_handler (memory_pool_item_handle);
|
||||
AssertFatal (memory_pool_item != NULL, "Failed to retrieve memory pool item for handle %p!\n", memory_pool_item_handle);
|
||||
/* Set info[1] */
|
||||
memory_pool_item->start.info[index] = info;
|
||||
|
||||
/* Check item validity and log (not mandatory) */
|
||||
if (1) {
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertFatal (memory_pools != NULL, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
/* Recover pool index */
|
||||
pool = memory_pool_item->start.pool_id;
|
||||
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
|
||||
item_size = memory_pools->pools[pool].item_data_number;
|
||||
pool_item_size = memory_pools->pools[pool].pool_item_size;
|
||||
item_index = (((void *) memory_pool_item) - ((void *) memory_pools->pools[pool].items)) / pool_item_size;
|
||||
MP_DEBUG(" Info [%2u][%6d]{%6d}, %3u %3u, %p, %p, %p, %u\n",
|
||||
pool, item_index,
|
||||
items_group_free_items (&memory_pools->pools[pool].items_group_free),
|
||||
memory_pool_item->start.info[0], memory_pool_item->start.info[1],
|
||||
memory_pool_item_handle, memory_pool_item,
|
||||
memory_pools->pools[pool].items, ((uint32_t) (item_size * sizeof(memory_pool_data_t))));
|
||||
/* Sanity check on calculated item index */
|
||||
AssertFatal (memory_pool_item == memory_pool_item_from_index(&memory_pools->pools[pool], item_index),
|
||||
"Incorrect memory pool item address (%p, %p) for pool %u, item %d!\n",
|
||||
memory_pool_item, (void *)memory_pool_item_from_index(&memory_pools->pools[pool], item_index), pool, item_index);
|
||||
/* Sanity check on end marker, must still be present (no write overflow) */
|
||||
AssertFatal (memory_pool_item->data[item_size] == POOL_ITEM_END_MARK,
|
||||
"Memory pool item is corrupted, end mark is not present for pool %u, item %d!\n", pool, item_index);
|
||||
/* Sanity check on item status, must be allocated */
|
||||
AssertFatal (memory_pool_item->start.item_status == ITEM_STATUS_ALLOCATED,
|
||||
"Trying to free a non allocated (%x) memory pool item (pool %u, item %d)\n",
|
||||
memory_pool_item->start.item_status, pool, item_index);
|
||||
}
|
||||
}
|
||||
@@ -121,9 +121,11 @@ char toksep[2];
|
||||
case SCHED_RR:
|
||||
lptr+=sprintf(lptr,"%s ","rt: rr");
|
||||
break;
|
||||
#ifdef SCHED_DEADLINE
|
||||
case SCHED_DEADLINE:
|
||||
lptr+=sprintf(lptr,"%s ","rt: deadline");
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
lptr+=sprintf(lptr,"%s ","????");
|
||||
break;
|
||||
|
||||
@@ -6,10 +6,9 @@ Each worker loop on pick from the same input queue jobs to do.
|
||||
|
||||
When a job is done, the worker sends a return if a return is defined.
|
||||
|
||||
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
|
||||
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
|
||||
|
||||
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client,
|
||||
so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
|
||||
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client, so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
|
||||
|
||||
## license
|
||||
Author:
|
||||
@@ -18,65 +17,187 @@ When a job is done, the worker sends a return if a return is defined.
|
||||
|
||||
# jobs
|
||||
|
||||
A job is a message (notifiedFIFO_elt_t):
|
||||
next:
|
||||
internal FIFO chain, do not set it
|
||||
key:
|
||||
a long int that the client can use to identify a message or a group of messages
|
||||
responseFifo:
|
||||
if the client defines a response FIFO, the message will be posted back after processing
|
||||
processingFunc:
|
||||
any funtion (type void processingFunc(void *)) that the worker will launch
|
||||
msgData:
|
||||
the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
|
||||
malloced:
|
||||
a boolean that enable internal free in these cases:
|
||||
no return Fifo or Abort feature
|
||||
A job is a message (notifiedFIFO_elt_t):
|
||||
|
||||
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
|
||||
* next:
|
||||
internal FIFO chain, do not set it
|
||||
* key:
|
||||
a long int that the client can use to identify a message or a group of messages
|
||||
* ResponseFifo:
|
||||
if the client defines a response FIFO, the message will be posted back after processing
|
||||
* processingFunc:
|
||||
any funtion (type void processingFunc(void *)) that the worker will launch
|
||||
* msgData:
|
||||
the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
|
||||
* malloced:
|
||||
a boolean that enable internal free in these cases:
|
||||
no return Fifo or Abort feature
|
||||
|
||||
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
|
||||
|
||||
# Queues of jobs
|
||||
|
||||
Queues are type of:
|
||||
notifiedFIFO_t that must be initialized by init_notifiedFIFO()
|
||||
No delete function is required, the creator has only to free the data of type notifiedFIFO_t
|
||||
Queues are type of:
|
||||
|
||||
push_notifiedFIFO() add a job in the queue
|
||||
pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
|
||||
* notifiedFIFO_t that must be initialized by init_notifiedFIFO()
|
||||
* No delete function is required, the creator has only to free the data of type notifiedFIFO_t
|
||||
* push_notifiedFIFO() add a job in the queue
|
||||
* pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
|
||||
* abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
|
||||
|
||||
abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
|
||||
These queues details hereafter
|
||||
|
||||
## Common
|
||||
|
||||
newNotifiedFIFO_elt()
|
||||
|
||||
creates a message, that will later be used in queues/FIFO
|
||||
|
||||
delNotifiedFIFO_elt()
|
||||
|
||||
deletes it
|
||||
|
||||
NotifiedFifoData()
|
||||
|
||||
gives a pointer to the beginning of free usage memory in a message (you can put any data there, up to 'size' parameter you passed to newNotifiedFIFO_elt()
|
||||
|
||||
These 3 calls are not mandatory, you can also use your own memory to save the malloc()/free() that are behind these calls
|
||||
iFirst level: non thread safe FIFO (or queues)
|
||||
|
||||
# low level: fast and simple
|
||||
|
||||
initNotifiedFIFO_nothreadSafe()
|
||||
|
||||
to create a queue
|
||||
|
||||
pushNotifiedFIFO_nothreadSafe()
|
||||
|
||||
Add a element in a queue
|
||||
|
||||
pullNotifiedFIFO_nothreadSafe()
|
||||
|
||||
pull a element from a queue
|
||||
|
||||
As these queues are not thread safe, there is NO blocking mechanism, neither pull() versus poll() calls
|
||||
|
||||
There is no delete for a message queue: you only have to abandon the memory you allocated to call iinitNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf)
|
||||
|
||||
So if you malloced the memory under 'nf' parameter you have to free it, if it is automatic variable (local variable) or global variable, nothing is to be done.
|
||||
|
||||
|
||||
## thread safe queues
|
||||
|
||||
These queues are built on not thread safe queues when we need thread to thread protection
|
||||
|
||||
initNotifiedFIFO()
|
||||
|
||||
to create a queue
|
||||
|
||||
pushNotifiedFIFO()
|
||||
|
||||
Add a element in a queue
|
||||
|
||||
pullNotifiedFIFO()
|
||||
|
||||
pull a element from a queue, this call is blocking until a message arrived
|
||||
|
||||
pollNotifiedFIFO()
|
||||
|
||||
pull a element from a queue, this call is not blocking, so it returns always very shortly
|
||||
|
||||
in 99.9% cases, pull() is better than poll()
|
||||
|
||||
No delete() call, same principle as not thread safe queues
|
||||
|
||||
# Thread pools
|
||||
|
||||
## initialization
|
||||
The clients can create one or more thread pools with init_tpool()
|
||||
the params string structure:
|
||||
describes a list of cores, separated by "," that run a worker thread
|
||||
The clients can create one or more thread pools with init_tpool()
|
||||
|
||||
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and
|
||||
the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
|
||||
the params string structure: describes a list of cores, separated by "," that run a worker thread
|
||||
|
||||
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
|
||||
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
|
||||
|
||||
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
|
||||
|
||||
## adding jobs
|
||||
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
|
||||
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
|
||||
|
||||
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
|
||||
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
|
||||
|
||||
## abort
|
||||
|
||||
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
|
||||
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
|
||||
|
||||
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
|
||||
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
|
||||
|
||||
## API details
|
||||
Each thread pool (there can be several in the same process) should be initialized
|
||||
|
||||
### initTpool(char *params,tpool_t *pool, bool performanceMeas) is to be called oncepool
|
||||
|
||||
the configuration parameter is a string, elements separated by ",":
|
||||
|
||||
* N: if a N is in the parameter list, no threads are created
|
||||
The purpose is to keep the same API in any case
|
||||
* a CPU with a little number of cores,
|
||||
or in debugging sessions to simplify the human work
|
||||
* a number that represent a valid CPU core on the target CPU
|
||||
A thread is created and stick on the core (with set affinity)
|
||||
* a number that is not a valid CPU core
|
||||
a floating thread is created (Linux is responsible of the real time core allocation)
|
||||
|
||||
example: "-1,-1,-1"
|
||||
as there is no core number -1, the thread pool is made of 3 floating threads
|
||||
be careful with fix allocation: it is hard to be more clever than Linux kernel
|
||||
|
||||
pool is the memory you allocated before to store the thread pool internal state (same concept as above queues)
|
||||
|
||||
performanceMeas is a flag to enable measurements (well described in documentation)
|
||||
|
||||
### pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg)
|
||||
|
||||
adds a job to do in the thread pool
|
||||
|
||||
The msg data you can set are:
|
||||
|
||||
* key:
|
||||
a value for you that you will find back in the response
|
||||
it is also the key for abortTpool()
|
||||
* reponseFifo
|
||||
if you set it, the message will be sent back on this queue when the job is done
|
||||
if you don't set it, no return is performed, the thread pool frees the message 'msg' when the job is done
|
||||
* processingFunc
|
||||
the function the job will run. the function prototype is void <func>(void *memory)
|
||||
the data part (the pointer returned by NotifiedFifoData(msg)) is passed to the function
|
||||
it is used to send data to the processing function and also to write back results
|
||||
of course, writing back results will lead you to use also a return queue (the parameter reponseFifo)
|
||||
|
||||
### pullTpool() collects job result in a return queue
|
||||
|
||||
you collect results in one result queue: the message you gave to pushTpool(), nevertheless it has been updated by processingFunc()
|
||||
|
||||
An example of multiple return queues, in eNB: I created one single thread pool (because it depends mainly on CPU hardware), but i use two return queues: one for turbo encode, one for turbo decode.
|
||||
|
||||
### tryPullTpool()
|
||||
|
||||
is the same, but not blocking (pollTpool() would have been a better name)
|
||||
|
||||
### abortTpool()
|
||||
|
||||
Is a facility to cancel work you pushed to a thread pool
|
||||
|
||||
I used it once: when eNB performs turbo decode, I push all segments in the thread pool.
|
||||
|
||||
But when I get back the decoding results, if one segment can't be decoded, I don't need the results of the other segments of the same UE.
|
||||
|
||||
## Performance measurements
|
||||
|
||||
A performance measurement is integrated:
|
||||
the pool will automacillay fill timestamps:
|
||||
|
||||
* creationTime:
|
||||
time the request is push to the pool;
|
||||
A performance measurement is integrated:
|
||||
the pool will automacillay fill timestamps:
|
||||
|
||||
* creationTime:
|
||||
time the request is push to the pool;
|
||||
* startProcessingTime:
|
||||
time a worker start to run on the job
|
||||
* endProcessingTime:
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
<style type="text/css" rel="stylesheet">
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #fff;
|
||||
background-color: #110F14;
|
||||
}
|
||||
h2 { margin-left: 20px; }
|
||||
h3 { margin-left: 40px; }
|
||||
h4 { margin-left: 60px; }
|
||||
|
||||
.func2 { margin-left: 20px; }
|
||||
.func3 { margin-left: 40px; }
|
||||
.func4 { margin-left: 60px; }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
This tuto for 5G gNB NAS design
|
||||
{: .text-center}
|
||||
|
||||
# source files
|
||||
|
||||
executables/ocp-gnb.c: a main loop to create a debuggable gNB, see document SW_archi.md
|
||||
openair2/RRC/NR/nr_ngap_gNB.c: skeleton for interface with NGAP
|
||||
openair3/NAS/COMMON/milenage.h: a simple milenage implementation, depend only on crypto library
|
||||
openair3/NAS/COMMON/NR_NAS_defs.h: messages defined for NAS implemented in C: C struct, C enums and automatic conversion to labels for debug messages
|
||||
openair3/NAS/COMMON/nr_common.c: 5G NAS common code between gNB and UE
|
||||
openair3/UICC/usim_interface.c: UICC simulation for USIM messages
|
||||
|
||||
openair3/NAS/NR_UE/ue_process_nas.c: NAS code for UE
|
||||
|
||||
openair3/NAS/gNB/network_process_nas.c: NAS code for gNB running without 5GC
|
||||
|
||||
openair3/TEST/test5Gnas.c: unitary testing of NAS messages: encodes+decode a standard network entry, mixing code from UE and 5GC (or gNB in noCore)
|
||||
|
||||
# USIM simulation
|
||||
A new USIM simulation, that parameters are in regular OAI config files
|
||||
|
||||
## To open the USIM
|
||||
init_uicc() takes a parameter: the name of the block in the config file
|
||||
In case we run several UEs in one process, the variable section name allows to make several UEs configurations in one config file.
|
||||
|
||||
The NAS implementation uses this possibility.
|
||||
|
||||
# UE side
|
||||
UEprocessNAS() is the entry for all messages.
|
||||
It decodes the message type and call the specific function for each messgae
|
||||
|
||||
## Identityrequest + IdentityResponse
|
||||
When the UE receives the request, it stores the 5GC request parameters in the UE context ( UE->uicc pointer)
|
||||
It calls "scheduleNAS", that would trigger a answer (seeing general archtecture, it will probly be a itti message to future RRC or NGAP thread).
|
||||
|
||||
When the scheduler wants to encode the answer, it calls identityResponse()
|
||||
The UE search for a section in the config file called "uicc"
|
||||
it encodes the NAS answer with the IMSI, as a 4G compatible authentication.
|
||||
A future release would encode 5G SUPI as native 5G UICC.
|
||||
|
||||
## Authenticationrequest + authenticationResponse
|
||||
When the UE receives the request, it stores the 5GC request parameters in the UE context ( UE->uicc pointer)
|
||||
It calls "scheduleNAS", that would trigger a answer (seeing general archtecture, it will probly be a itti message to future RRC or NGAP thread).
|
||||
|
||||
When the scheduler wants to encode the answer, it calls authenticationResponse()
|
||||
The UE search for a section in the config file called "uicc"
|
||||
It uses the Milenage parameters of this section to encode a milenage response
|
||||
A future release would encode 5G new authentication cyphering functions.
|
||||
|
||||
## SecurityModeCommand + securityModeComplete
|
||||
When the UE receives the request it will:
|
||||
Selected NAS security algorithms: store it for future encoding
|
||||
Replayed UE security capabilities: check if it is equal to UE capabilities it sent to the 5GC
|
||||
IMEISV request: to implement
|
||||
ngKSI: Key set Indicator, similator to 4G to select a ciphering keys set
|
||||
|
||||
When the scheduler wants to encode the answer, it calls registrationComplete()
|
||||
|
||||
## registrationComplete
|
||||
To be defined in UE, this NAS message is done after RRC sequence completes
|
||||
|
||||
# gNB side
|
||||
gNB NGAP thread receives the NAS message from PHY layers
|
||||
In normal mode, it send it to the core network with no decoding.
|
||||
|
||||
Here after, the gNB mode "noCore" processing in gNB: NGAP calls the entry function: processNAS() instead of forwarding the packet to the 5GC
|
||||
|
||||
## RRCModeComplete + Identityrequest
|
||||
When the gNB completes RRC attach, it sends a first message to NGAP thread.
|
||||
Normal processing sends NGAP initial UE message, in noCore mode, it should call: identityRequest() that encode the NAS identity request inside the gNB.
|
||||
The gNB NGAP thread then should call the piece of code that forward the message to the UE as when it receives a NAS message from 5GC.
|
||||
|
||||
## All NAS coming from UE
|
||||
When NGAP thread receives a NAS message from lower layers, it encapsulates it to forward it to the 5GC. In "noCore" mode it calls processNAS().
|
||||
|
||||
This function stores in the gNB the NAS data, then it should encode the next message (identity, authentication, security mode) or do nothing (registration complete).
|
||||
|
||||
|
||||
<div class="panel panel-info">
|
||||
**Note**
|
||||
{: .panel-heading}
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -254,9 +254,11 @@ The NAS layer is based on **3GPP 24.301** and implements the following functions
|
||||
The following features are valid for the gNB and the 5G-NR UE.
|
||||
|
||||
* Static TDD,
|
||||
* FDD
|
||||
* Normal CP
|
||||
* 30 kHz subcarrier spacing
|
||||
* Bandwidths up to 80MHz (217 Physical Resource Blocks)
|
||||
* Intermediate downlink and uplink frequencies to interface with IF equipment
|
||||
* Single antenna port (single beam)
|
||||
* Slot format: 14 OFDM symbols in UL or DL
|
||||
* Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 supported)
|
||||
|
||||
@@ -132,6 +132,42 @@ With the RF simulator (on the same machine):
|
||||
|
||||
`sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --do-ra --rfsim --parallel-config PARALLEL_SINGLE_THREAD`
|
||||
|
||||
## IF setup with OAI
|
||||
|
||||
The -C and -CO flags can be used together at UE side to set custom downlink and uplink FR1 intermediate frequencies for the IF equipment.
|
||||
|
||||
In order to run this setup, the following flags are needed at the UE side:
|
||||
|
||||
`-C`
|
||||
|
||||
`--CO`
|
||||
|
||||
and the following parameters must be configured in the RUs section of the gNB configuration file:
|
||||
|
||||
`if_freq`
|
||||
|
||||
`if_offset`
|
||||
|
||||
### Run OAI with custom DL/UL intermediate frequencies
|
||||
|
||||
The following example uses DL frequency 2169.080 MHz and UL frequency offset -400 MHz, with a configuration file for band 66 at gNB side.
|
||||
|
||||
From the `cmake_targets/ran_build/build` folder:
|
||||
|
||||
gNB on machine 1:
|
||||
|
||||
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf`
|
||||
|
||||
UE on machine 2:
|
||||
|
||||
`sudo ./nr-uesoftmodem -C 2169080000 --CO -400000000`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
|
||||
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
<style type="text/css" rel="stylesheet">
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #fff;
|
||||
background-color: #110F14;
|
||||
}
|
||||
h2 { margin-left: 20px; }
|
||||
h3 { margin-left: 40px; }
|
||||
h4 { margin-left: 60px; }
|
||||
|
||||
.func2 { margin-left: 20px; }
|
||||
.func3 { margin-left: 40px; }
|
||||
.func4 { margin-left: 60px; }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
This tuto for 5G gNB design, with Open Cells main
|
||||
{: .text-center}
|
||||
|
||||
# Top file: executables/ocp-gnb.c
|
||||
|
||||
the function main() initializes the data from configuration file
|
||||
|
||||
# The main thread is in ru_thread()
|
||||
The infinite loop:
|
||||
## rx_rf()
|
||||
Collect radio signal samples from RF board
|
||||
all SDR processing is triggered by I/Q sample reception and it's date (timestamp)
|
||||
TX I/Q samples will have a date in the future, compared to RX timestamp
|
||||
called for each 5G NR slot
|
||||
it blocks until data is available
|
||||
the internal time comes from the RF board sampling numbers
|
||||
(each sample has a incremental number representing a very accurate timing)
|
||||
raw incoming data is in buffer called "rxdata"
|
||||
We derivate frame number, slot number, ... from the RX timestamp
|
||||
{: .func2}
|
||||
## nr_fep_full()
|
||||
"front end processing" of uplink signal
|
||||
performs DFT on the signal
|
||||
same function (duplicates): phy_procedures_gNB_common_RX()
|
||||
it computes the buffer rxdataF (for frequency) from rxdata (samples over time)
|
||||
rxdataF is the rxdata in frequency domain, phase aligned
|
||||
{: .func3}
|
||||
## gNB_top()
|
||||
only compute frame numbre, slot number, ...
|
||||
{: .func3}
|
||||
## ocp_rxtx()
|
||||
main processing for both UL and DL
|
||||
start by calling oai_subframe_ind() that trigger processing in pnf_p7_subframe_ind() purpose ???
|
||||
all the context is in the passed structure UL_INFO
|
||||
the context is not very clear: there is a mutex on it,
|
||||
but not actual coherency (see below handle_nr_rach() assumes data is up-to-date)
|
||||
The first part (in NR_UL_indication, uses the data computed by the lower part (phy_procedures_gNB_uespec_RX), but for the **previous** slot
|
||||
Then, phy_procedures_gNB_uespec_RX will hereafter replace the data for the next run
|
||||
This is very tricky and not thread safe at all.
|
||||
{: .func3}
|
||||
|
||||
### NR_UL_indication()
|
||||
This block processes data already decoded and stored in structures behind UL_INFO
|
||||
{: .func4}
|
||||
|
||||
* handle_nr_rach()
|
||||
process data from RACH primary detection
|
||||
if the input is a UE RACH detection
|
||||
{: .func4}
|
||||
* nr_schedule_msg2()
|
||||
{: .func4}
|
||||
* handle_nr_uci()
|
||||
????
|
||||
{: .func4}
|
||||
* handle_nr_ulsch()
|
||||
handles ulsch data prepared by nr_fill_indication()
|
||||
{: .func4}
|
||||
* gNB_dlsch_ulsch_scheduler ()
|
||||
the **scheduler** is called here, see dedicated chapter
|
||||
{: .func4}
|
||||
* NR_Schedule_response()
|
||||
process as per the scheduler decided
|
||||
{: .func4}
|
||||
|
||||
### L1_nr_prach_procedures()
|
||||
????
|
||||
{: .func4}
|
||||
### phy_procedures_gNB_uespec_RX()
|
||||
* nr_decode_pucch0()
|
||||
actual CCH channel decoding form rxdataF (rx data in frequency domain)
|
||||
populates UL_INFO.uci_ind, actual uci data is in gNB->pucch
|
||||
{: .func4}
|
||||
* nr_rx_pusch()
|
||||
{: .func4}
|
||||
* extracts data from rxdataF (frequency transformed received data)
|
||||
{: .func4}
|
||||
* nr_pusch_channel_estimation()
|
||||
{: .func4}
|
||||
* nr_ulsch_extract_rbs_single()
|
||||
{: .func4}
|
||||
* nr_ulsch_scale_channel()
|
||||
{: .func4}
|
||||
* nr_ulsch_channel_level()
|
||||
{: .func4}
|
||||
* nr_ulsch_channel_compensation()
|
||||
{: .func4}
|
||||
* nr_ulsch_compute_llr()
|
||||
this function creates the "likelyhood ratios"
|
||||
{: .func4}
|
||||
* nr_ulsch_procedures()
|
||||
{: .func4}
|
||||
* actual ULsch decoding
|
||||
{: .func4}
|
||||
* nr_ulsch_unscrambling()
|
||||
{: .func4}
|
||||
* nr_ulsch_decoding()
|
||||
{: .func4}
|
||||
* nr_fill_indication()
|
||||
populate the data for the next call to "NR_UL_indication()"
|
||||
it would be better to call **NR_UL_indication()** now instead of before (on previous slot)
|
||||
{: .func4}
|
||||
|
||||
### phy_procedures_gNB_TX()
|
||||
* nr_common_signal_procedures()
|
||||
generate common signals
|
||||
{: .func4}
|
||||
* nr_generate_dci_top()
|
||||
generate DCI: the scheduling informtion for each UE in both DL and UL
|
||||
{: .func4}
|
||||
* nr_generate_pdsch()
|
||||
generate DL shared channel (user data)
|
||||
{: .func4}
|
||||
|
||||
### nr_feptx_prec()
|
||||
tx precoding
|
||||
{: .func3}
|
||||
### nr_feptx0
|
||||
do the inverse DFT
|
||||
{: .func3}
|
||||
### tx_rf()
|
||||
send radio signal samples to the RF board
|
||||
the samples numbers are the future time for these samples emission on-air
|
||||
{: .func3}
|
||||
|
||||
# Scheduler
|
||||
The scheduler is called by the chain: nr_ul_indication()=>gNB_dlsch_ulsch_scheduler()
|
||||
It calls sub functions to process each physical channel (rach, ...)
|
||||
The scheduler uses and internal map of used RB: vrb_map and vrb_map_UL, so each specific channel scheduler can see the already filled RB in each subframe (the function gNB_dlsch_ulsch_scheduler() clears these two arrays when it starts)
|
||||
|
||||
The scheduler also calls "run_pdcp()", as this is not a autonomous thread, it needs to be called here to update traffic requests (DL) and to propagate waiting UL to upper layers
|
||||
After calling run_pdcp, it updates "rlc" time data but it doesn't actually process rlc
|
||||
it sends a iiti message to activate the thread for RRC, the answer will be asynchronous in ????
|
||||
|
||||
Calls schedule_nr_mib() that calls mac_rrc_nr_data_req() to fill MIB,
|
||||
|
||||
Calls each channel allocation: schedule SI, schedule_ul, schedule_dl, ...
|
||||
this is a major entry for "phy-test" mode: in this mode, the allocation is fixed
|
||||
all these channels goes to mac_rrc_nr_data_req() to get the data to transmit
|
||||
|
||||
nr_schedule_ue_spec() is called
|
||||
* calls nr_simple_dlsch_preprocessor()=> mac_rlc_status_ind() mac_rlc_status_ind() locks and checks directly inside rlc data the quantity of waiting data. So, the scheduler can allocate RBs
|
||||
* calls nr_update_pucch_scheduling()
|
||||
* get_pdsch_to_harq_feedback() to schedule retransmission in DL
|
||||
|
||||
Calls nr_fill_nfapi_dl_pdu() to actually populate what should be done by the lower layers to make the Tx subframe
|
||||
|
||||
|
||||
|
||||
# RRC
|
||||
RRC is a regular thread with itti loop on queue: TASK_RRC_GNB
|
||||
it receives it's configuration in message NRRRC_CONFIGURATION_REQ, then real time mesages for all events: S1/NGAP events, X2AP messages and RRC_SUBFRAME_PROCESS
|
||||
|
||||
RRC_SUBFRAME_PROCESS message is send each subframe
|
||||
|
||||
how does it communicate to scheduler ?
|
||||
|
||||
|
||||
# RLC
|
||||
RLC code is new implementation, not using OAI mechanisms: it is implmented directly on pthreads, ignoring OAI common functions.
|
||||
It runs a thread waiting incoming data, but it is mainly running inside calling thread.
|
||||
It is a library, running in thread RRC (except on itti message: F1AP_UL_RRC_MESSAGE for F1).
|
||||
|
||||
# NGAP
|
||||
NGAP would be a itti thread as is S1AP (+twin thread SCTP that is almost void processing)?
|
||||
About all messages are exchanged with RRC thread
|
||||
|
||||
|
||||
# GTP
|
||||
Gtp + UDP are two twin threads performing the data plane interface to the core network
|
||||
The design is hybrid: thread and inside other threads calls. It should at least be protected by a mutex.
|
||||
## GTP thread
|
||||
Gtp thread has a itti interface: queue TASK_GTPV1_U
|
||||
The interface is about full definition: control messages (create/delet GTP tunnels) and data messages (user plane UL and DL).
|
||||
PDCP layer push to the GTP queue (outside UDP thread that do almost nothing and work only with GTP thread) is to push a UL packet.
|
||||
|
||||
|
||||
## GTP thread running code from other layers
|
||||
gtp thread calls directly pdcp_data_req(), so it runs inside it's context internal pdcp structures updates
|
||||
|
||||
## inside other threads
|
||||
gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the other threads, without mutex.
|
||||
|
||||
|
||||
<div class="panel panel-info">
|
||||
**Note**
|
||||
{: .panel-heading}
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -49,6 +49,7 @@ RUN yum update -y && \
|
||||
nettle \
|
||||
atlas \
|
||||
net-tools \
|
||||
iputils \
|
||||
iproute \
|
||||
libyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
@@ -120,3 +121,4 @@ WORKDIR /opt/oai-enb
|
||||
|
||||
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -51,6 +51,7 @@ RUN yum update -y && \
|
||||
atlas \
|
||||
net-tools \
|
||||
iproute \
|
||||
iputils \
|
||||
libyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
|
||||
@@ -121,4 +122,4 @@ WORKDIR /opt/oai-enb
|
||||
|
||||
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -57,6 +57,7 @@ RUN apt-get update && \
|
||||
libconfig9 \
|
||||
openssl \
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
libyaml-0-2 && \
|
||||
# Install UHD driver from ettus ppa
|
||||
@@ -120,3 +121,4 @@ WORKDIR /opt/oai-enb
|
||||
|
||||
#CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
#/*
|
||||
# * 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
|
||||
# */
|
||||
#---------------------------------------------------------------------
|
||||
#
|
||||
# Dockerfile for the Open-Air-Interface eNB service
|
||||
# Valid for RHEL7 in the OpenShift context (v4.4)
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
|
||||
ARG REGISTRY=localhost
|
||||
FROM $REGISTRY/oai-build-base:latest.el7 AS builder
|
||||
|
||||
ARG GIT_TAG=v1.1.1
|
||||
|
||||
WORKDIR /root
|
||||
|
||||
RUN if [ "$EURECOM_PROXY" == true ]; then git config --global http.proxy http://:@proxy.eurecom.fr:8080; fi
|
||||
|
||||
RUN git clone --depth=1 --branch=$GIT_TAG https://gitlab.eurecom.fr/oai/openairinterface5g.git
|
||||
COPY patches patches/
|
||||
RUN patch -p1 -d openairinterface5g < patches/disable_building_nasmesh_and_rbtool.patch \
|
||||
&& patch -p1 -d openairinterface5g < patches/disable_sched_fifo_fail_exits.patch
|
||||
RUN cd openairinterface5g/cmake_targets \
|
||||
&& ln -sf /usr/local/bin/asn1c_oai /usr/local/bin/asn1c \
|
||||
&& ln -sf /usr/local/share/asn1c_oai /usr/local/share/asn1c \
|
||||
&& ./build_oai -c --eNB -w USRP --verbose-compile
|
||||
|
||||
|
||||
FROM registry.redhat.io/ubi7/ubi
|
||||
LABEL name="oai-enb" \
|
||||
version="$GIT_TAG" \
|
||||
maintainer="Frank A. Zdarsky <fzdarsky@redhat.com>" \
|
||||
io.k8s.description="openairinterface5g eNB $GIT_TAG." \
|
||||
io.openshift.tags="oai,enb" \
|
||||
io.openshift.non-scalable="true"
|
||||
|
||||
RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm \
|
||||
&& REPOLIST="rhel-7-server-optional-rpms" \
|
||||
&& PKGLIST="boost libconfig lksctp-tools protobuf-c iproute iputils procps-ng bind-utils xforms nettle libyaml libusb" \
|
||||
# && yum -y upgrade-minimal --setopt=tsflags=nodocs --security --sec-severity=Critical --sec-severity=Important && \
|
||||
&& yum -y install --enablerepo ${REPOLIST} --setopt=tsflag=nodocs ${PKGLIST} \
|
||||
&& yum -y clean all \
|
||||
&& rm -rf /var/cache/yum
|
||||
|
||||
ENV APP_ROOT=/opt/oai-enb
|
||||
ENV PATH=${APP_ROOT}:${PATH} HOME=${APP_ROOT}
|
||||
COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/lte-softmodem ${APP_ROOT}/bin/
|
||||
COPY --from=builder /root/openairinterface5g/cmake_targets/lte_build_oai/build/*.so* /lib64
|
||||
COPY --from=builder /usr/local/lib64 /lib64
|
||||
COPY --from=builder /usr/local/bin/uhd_* /usr/local/bin
|
||||
COPY --from=builder /usr/local/share/uhd /usr/local/share/uhd
|
||||
RUN cd /lib64 \
|
||||
&& ln -sf liboai_eth_transpro.so liboai_transpro.so \
|
||||
&& ln -sf liboai_usrpdevif.so liboai_device.so \
|
||||
&& ln -sf libuhd.so.3.13 libuhd.so.3 \
|
||||
&& ln -sf libuhd.so.3 libuhd.so
|
||||
COPY scripts ${APP_ROOT}/bin/
|
||||
COPY configs ${APP_ROOT}/etc/
|
||||
RUN chmod -R u+x ${APP_ROOT} && \
|
||||
chgrp -R 0 ${APP_ROOT} && \
|
||||
chmod -R g=u ${APP_ROOT} /etc/passwd
|
||||
USER 10001
|
||||
WORKDIR ${APP_ROOT}
|
||||
|
||||
EXPOSE 2152/udp # S1U, GTP/UDP
|
||||
EXPOSE 22100/tcp # ?
|
||||
EXPOSE 36412/udp # S1C, SCTP/UDP
|
||||
EXPOSE 36422/udp # X2C, SCTP/UDP
|
||||
EXPOSE 50000/udp # IF5 / ORI (control)
|
||||
EXPOSE 50001/udp # IF5 / ECPRI (data)
|
||||
|
||||
CMD ["/opt/oai-enb/bin/lte-softmodem", "-O", "/opt/oai-enb/etc/enb.conf"]
|
||||
ENTRYPOINT ["/opt/oai-enb/bin/entrypoint.sh"]
|
||||
@@ -52,6 +52,8 @@ RUN yum repolist --disablerepo=* && \
|
||||
atlas \
|
||||
lksctp-tools \
|
||||
nettle \
|
||||
net-tools \
|
||||
iputils \
|
||||
libyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
|
||||
@@ -123,4 +125,4 @@ WORKDIR /opt/oai-gnb
|
||||
|
||||
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -53,6 +53,8 @@ RUN yum repolist --disablerepo=* && \
|
||||
atlas \
|
||||
lksctp-tools \
|
||||
nettle \
|
||||
net-tools \
|
||||
iputils \
|
||||
libyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
|
||||
@@ -124,4 +126,4 @@ WORKDIR /opt/oai-gnb
|
||||
|
||||
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -59,6 +59,7 @@ RUN apt-get update && \
|
||||
openssl \
|
||||
net-tools \
|
||||
iproute2 \
|
||||
iputils-ping \
|
||||
libyaml-0-2 && \
|
||||
# Install UHD driver from ettus ppa
|
||||
# At time of writing, it is 3.14
|
||||
@@ -121,4 +122,4 @@ WORKDIR /opt/oai-gnb
|
||||
|
||||
#CMD ["/opt/oai-gnb/bin/nr-softmodem", "-O", "/opt/oai-gnb/etc/gnb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-gnb/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -51,6 +51,7 @@ RUN yum update -y && \
|
||||
atlas \
|
||||
iproute \
|
||||
net-tools \
|
||||
iputils \
|
||||
libyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
|
||||
@@ -114,8 +115,9 @@ RUN ldconfig
|
||||
# Copy the relevant configuration files for eNB
|
||||
WORKDIR /opt/oai-lte-ue/etc
|
||||
COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
|
||||
|
||||
WORKDIR /opt/oai-lte-ue
|
||||
#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -51,6 +51,7 @@ RUN yum update -y && \
|
||||
atlas \
|
||||
iproute \
|
||||
net-tools \
|
||||
iputils \
|
||||
libyaml && \
|
||||
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
|
||||
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
|
||||
@@ -114,8 +115,9 @@ RUN ldd /usr/local/lib/libdfts.so
|
||||
# Copy the relevant configuration files for eNB
|
||||
WORKDIR /opt/oai-lte-ue/etc
|
||||
COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
|
||||
|
||||
WORKDIR /opt/oai-lte-ue
|
||||
#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -58,6 +58,7 @@ RUN apt-get update && \
|
||||
libconfig9 \
|
||||
openssl \
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
libyaml-0-2 && \
|
||||
# Install UHD driver from ettus ppa
|
||||
@@ -114,8 +115,9 @@ RUN ldconfig
|
||||
# Copy the relevant configuration files for eNB
|
||||
WORKDIR /opt/oai-lte-ue/etc
|
||||
COPY --from=lte-ue-build /oai-ran/ci-scripts/conf_files/ue.* ./
|
||||
COPY --from=lte-ue-build /oai-ran/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf ./ue_usim.conf
|
||||
|
||||
WORKDIR /opt/oai-lte-ue
|
||||
#CMD ["/opt/oai-lte-ue/bin/lte-uesoftmodem", "-O", "/opt/oai-lte-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-lte-ue/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -48,6 +48,8 @@ RUN yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
lksctp-tools \
|
||||
nettle \
|
||||
net-tools \
|
||||
iputils \
|
||||
atlas \
|
||||
libXpm \
|
||||
libX11 \
|
||||
@@ -114,4 +116,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
WORKDIR /opt/oai-nr-ue
|
||||
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -49,6 +49,8 @@ RUN yum update -y && \
|
||||
yum install -y --enablerepo="ubi-8-codeready-builder" \
|
||||
lksctp-tools \
|
||||
nettle \
|
||||
net-tools \
|
||||
iputils \
|
||||
atlas \
|
||||
libXpm \
|
||||
libX11 \
|
||||
@@ -115,4 +117,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
WORKDIR /opt/oai-nr-ue
|
||||
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
@@ -58,6 +58,7 @@ RUN apt-get update && \
|
||||
libconfig9 \
|
||||
openssl \
|
||||
net-tools \
|
||||
iputils-ping \
|
||||
iproute2 \
|
||||
libyaml-0-2 && \
|
||||
# Install UHD driver from ettus ppa
|
||||
@@ -114,4 +115,4 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/ue.* .
|
||||
WORKDIR /opt/oai-nr-ue
|
||||
#CMD ["/opt/oai-nr-ue/bin/nr-uesoftmodem", "-O", "/opt/oai-nr-ue/etc/enb.conf"]
|
||||
#ENTRYPOINT ["/opt/oai-nr-ue/bin/entrypoint.sh"]
|
||||
|
||||
CMD ["sleep", "infinity"]
|
||||
|
||||
+151
-3
@@ -1,5 +1,153 @@
|
||||
---
|
||||
|
||||
to be done
|
||||
<table style="border-collapse: collapse; border: none;">
|
||||
<tr style="border-collapse: collapse; border: none;">
|
||||
<td style="border-collapse: collapse; border: none;">
|
||||
<a href="http://www.openairinterface.org/">
|
||||
<img src="../doc/images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
||||
</img>
|
||||
</a>
|
||||
</td>
|
||||
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
||||
<b><font size = "5">OAI Docker/Podman Build and Usage Procedures</font></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
---
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
1. [Build Strategy](#1-build-strategy)
|
||||
2. [File organization](#2-file-organization)
|
||||
3. [Building using docker under Ubuntu 18.04](#3-building-using-docker-under-ubuntu-1804)
|
||||
4. [Building using podman under Red Hat Entreprise Linux 8.2](#4-building-using-podman-under-red-hat-entreprise-linux-82)
|
||||
5. [Running modems using docker under Ubuntu 18.04](#5-running-modems-using-docker-under-ubuntu-1804)
|
||||
6. [Running modems using podman under Red Hat Entreprise Linux 8.2](#6-running-modems-using-podman-under-red-hat-entreprise-linux-82)
|
||||
|
||||
---
|
||||
|
||||
# 1. Build Strategy #
|
||||
|
||||
For all platforms, the strategy for building docker/podman images is the same:
|
||||
|
||||
* First we create a common shared image that contains:
|
||||
- the latest source files (by using the `COPY` function)
|
||||
- all the means to build an OAI RAN executable
|
||||
* all packages, compilers, ...
|
||||
* especially UHD is installed
|
||||
* Then from this shared image (`ran-build`) we can build target images for:
|
||||
- eNB
|
||||
- gNB
|
||||
- lte-UE
|
||||
- nr-UE
|
||||
* These target images will only contain:
|
||||
- the generated executable (for example `lte-softmodem.Rel15`)
|
||||
- the generated shared libraries (for example `liboai_usrpdevif.so.Rel15`)
|
||||
- the needed libraries and packages to run these generated binaries
|
||||
- Some configuration file templates
|
||||
- Some tools (such as `ping`, `ifconfig`)
|
||||
|
||||
TO DO:
|
||||
|
||||
- Proper entrypoints
|
||||
- Proper port exposure
|
||||
- ...
|
||||
|
||||
# 2. File organization #
|
||||
|
||||
Dockerfiles are named with the following naming convention: `Dockerfile.${target}.${OS-version}.${cluster-version}`
|
||||
|
||||
Targets can be:
|
||||
|
||||
- `ran` for an image named `ran-build` (the shared image)
|
||||
- `eNB` for an image named `oai-enb`
|
||||
- `gNB` for an image named `oai-gnb`
|
||||
- `lteUE` for an image named `oai-lte-ue`
|
||||
- `nrUE` for an image named `oai-nr-ue`
|
||||
|
||||
The currently-supported OS are:
|
||||
|
||||
- `rhel8.2` for Red Hat Entreprise Linux
|
||||
- `ubuntu18` for Ubuntu 18.04 LTS
|
||||
|
||||
The currently-supported cluster version is:
|
||||
|
||||
- `rhel8.2.oc4-4`
|
||||
|
||||
We have also `rhel7.oc4-4` support but it will be discontinued soon.
|
||||
|
||||
For more details in build within a Openshift Cluster, see [OpenShift README](../openshift/README.md) for more details.
|
||||
|
||||
# 3. Building using `docker` under Ubuntu 18.04 #
|
||||
|
||||
## 3.1. Pre-requisites ##
|
||||
|
||||
* `git` installed
|
||||
* `docker-ce` installed
|
||||
* Pulling `ubuntu:bionic` from DockerHub
|
||||
|
||||
## 3.2. Building the shared image ##
|
||||
|
||||
This can be done starting `2020.w41` tag on the `develop` branch, or any branch that includes that tag.
|
||||
|
||||
```bash
|
||||
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
|
||||
cd openairinterface5g
|
||||
git checkout develop
|
||||
```
|
||||
|
||||
In our Eurecom/OSA environment we need to pass a GIT proxy.
|
||||
|
||||
```bash
|
||||
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.ran.ubuntu18 --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" .
|
||||
```
|
||||
|
||||
if you don't need it, do NOT pass any value:
|
||||
|
||||
```bash
|
||||
docker build --target ran-build --tag ran-build:latest --file docker/Dockerfile.ran.ubuntu18 .
|
||||
```
|
||||
|
||||
After a while:
|
||||
|
||||
```bash
|
||||
docker image ls
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
ran-build latest ccb721bc0b57 1 minute ago 4.06GB
|
||||
...
|
||||
```
|
||||
|
||||
## 3.3. Building any target image ##
|
||||
|
||||
For example, the eNB:
|
||||
|
||||
```bash
|
||||
docker build --target oai-enb --tag oai-enb:latest --file docker/Dockerfile.eNB.ubuntu18 .
|
||||
```
|
||||
|
||||
After a while:
|
||||
|
||||
```
|
||||
docker image ls
|
||||
REPOSITORY TAG IMAGE ID CREATED SIZE
|
||||
oai-enb latest 25ddbd8b7187 1 minute ago 516MB
|
||||
<none> <none> 875ea3b05b60 8 minutes ago 8.18GB
|
||||
ran-build latest ccb721bc0b57 1 hour ago 4.06GB
|
||||
```
|
||||
|
||||
Do not forget to remove the temporary image:
|
||||
|
||||
```
|
||||
docker image prune --force
|
||||
```
|
||||
|
||||
# 4. Building using `podman` under Red Hat Entreprise Linux 8.2 #
|
||||
|
||||
TODO.
|
||||
|
||||
# 5. Running modems using `docker` under Ubuntu 18.04 #
|
||||
|
||||
TODO.
|
||||
|
||||
# 6. Running modems using `podman` under Red Hat Entreprise Linux 8.2 #
|
||||
|
||||
TODO.
|
||||
|
||||
@@ -435,7 +435,7 @@ void pusch_procedures_tosplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *eN
|
||||
if ((ulsch) &&
|
||||
(ulsch->rnti>0) &&
|
||||
(ulsch_harq->status == ACTIVE) &&
|
||||
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
|
||||
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
|
||||
((ulsch_harq->subframe == subframe) || (ulsch_harq->repetition_number >1) ) &&
|
||||
(ulsch_harq->handled == 0)) {
|
||||
// UE has ULSCH scheduling
|
||||
@@ -1520,7 +1520,7 @@ void *cu_fs6(void *arg) {
|
||||
remoteIP[i]=0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
AssertFatal(createUDPsock(NULL, CU_PORT, remoteIP, port_def, &sockFS6), "");
|
||||
L1_rxtx_proc_t L1proc= {0};
|
||||
// We pick the global thread pool from the legacy code global vars
|
||||
|
||||
+105
-147
@@ -78,9 +78,18 @@ int otg_enabled;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
int split73;
|
||||
int usrp_tx_thread = 0;
|
||||
char * split73_config;
|
||||
int split73;
|
||||
int usrp_tx_thread = 0;
|
||||
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
|
||||
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0};
|
||||
void flexran_agent_slice_update(mid_t module_idP) {
|
||||
}
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p){
|
||||
return 0;
|
||||
}
|
||||
void proto_agent_stop(mod_id_t mod_id){
|
||||
}
|
||||
|
||||
static void *ru_thread( void *param );
|
||||
void kill_RU_proc(RU_t *ru) {
|
||||
@@ -101,21 +110,6 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
close_log_mem();
|
||||
oai_exit = 1;
|
||||
|
||||
if (RC.ru == NULL)
|
||||
exit(-1); // likely init not completed, prevent crash or hang, exit now...
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
if (RC.ru[ru_id] && RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (RC.ru[ru_id] && RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
sleep(1); //allow lte-softmodem threads to exit first
|
||||
exit(1);
|
||||
}
|
||||
@@ -399,6 +393,7 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void init_precoding_weights(PHY_VARS_eNB *eNB) {
|
||||
int layer,ru_id,aa,re,ue,tb;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
@@ -431,6 +426,7 @@ void init_precoding_weights(PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void ocp_rx_prach(PHY_VARS_eNB *eNB,
|
||||
L1_rxtx_proc_t *proc,
|
||||
@@ -804,8 +800,7 @@ int init_rf(RU_t *ru) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
RU_t *ru;
|
||||
void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
|
||||
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
|
||||
int i;
|
||||
int CC_id;
|
||||
@@ -821,11 +816,8 @@ void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
|
||||
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
LOG_D(PHY,"Process RC.ru[%d]\n",ru_id);
|
||||
ru = RC.ru[ru_id];
|
||||
ru->rf_config_file = rf_config_file;
|
||||
ru->idx = ru_id;
|
||||
ru->idx = 0;
|
||||
ru->ts_offset = 0;
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
@@ -849,8 +841,6 @@ void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
ru->wakeup_L1_sleep_cnt_max = 3;
|
||||
|
||||
if (ru->num_eNB > 0) {
|
||||
LOG_D(PHY, "%s() RC.ru[%d].num_eNB:%d ru->eNB_list[0]:%p RC.eNB[0][0]:%p rf_config_file:%s\n",
|
||||
__FUNCTION__, ru_id, ru->num_eNB, ru->eNB_list[0], RC.eNB[0][0], ru->rf_config_file);
|
||||
AssertFatal(ru->eNB_list[0], "ru->eNB_list is not initialized\n");
|
||||
} else {
|
||||
LOG_E(PHY,"Wrong data model, assigning eNB 0, carrier 0 to RU 0\n");
|
||||
@@ -867,20 +857,19 @@ void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
int ruIndex=eNB0->num_RU++;
|
||||
eNB0->RU_list[ruIndex] = ru;
|
||||
}
|
||||
} // for ru_id
|
||||
}
|
||||
|
||||
void stop_RU(int nb_ru) {
|
||||
for (int inst = 0; inst < nb_ru; inst++) {
|
||||
LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
|
||||
kill_RU_proc(RC.ru[inst]);
|
||||
//kill_RU_proc(RC.ru[inst]);
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------*/
|
||||
/* from here function to use configuration module */
|
||||
static int DEFBFW[] = {0x00007fff};
|
||||
void RCconfig_RU(void) {
|
||||
void ocpRCconfig_RU(RU_t* ru) {
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
|
||||
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
|
||||
@@ -891,87 +880,74 @@ void RCconfig_RU(void) {
|
||||
return;
|
||||
} // setting != NULL
|
||||
|
||||
if ( RC.ru != NULL ) {
|
||||
LOG_W(PHY, "Calling RCconfig_RU twice (nb ru=%d), ignoring the second call data structure is %p\n",
|
||||
RUParamList.numelt,RC.ru);
|
||||
return;
|
||||
ru->idx = 0;
|
||||
ru->if_timing = synch_to_ext_device;
|
||||
paramdef_t *vals=RUParamList.paramarray[0];
|
||||
|
||||
if (RC.nb_L1_inst >0)
|
||||
ru->num_eNB = vals[RU_ENB_LIST_IDX].numelt;
|
||||
else
|
||||
ru->num_eNB = 0;
|
||||
|
||||
for (int i=0; i<ru->num_eNB; i++)
|
||||
ru->eNB_list[i] = RC.eNB[vals[RU_ENB_LIST_IDX].iptr[i]][0];
|
||||
|
||||
if (config_isparamset(vals, RU_SDR_ADDRS)) {
|
||||
ru->openair0_cfg.sdr_addrs = strdup(*(vals[RU_SDR_ADDRS].strptr));
|
||||
}
|
||||
|
||||
RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *));
|
||||
|
||||
for (int j = 0; j < RC.nb_RU; j++) {
|
||||
RC.ru[j] = (RU_t *)calloc(sizeof(RU_t), 1);
|
||||
RC.ru[j]->idx = j;
|
||||
LOG_I(PHY,"Creating RC.ru[%d]:%p\n", j, RC.ru[j]);
|
||||
RC.ru[j]->if_timing = synch_to_ext_device;
|
||||
paramdef_t *vals=RUParamList.paramarray[j];
|
||||
|
||||
if (RC.nb_L1_inst >0)
|
||||
RC.ru[j]->num_eNB = vals[RU_ENB_LIST_IDX].numelt;
|
||||
else
|
||||
RC.ru[j]->num_eNB = 0;
|
||||
|
||||
for (int i=0; i<RC.ru[j]->num_eNB; i++)
|
||||
RC.ru[j]->eNB_list[i] = RC.eNB[vals[RU_ENB_LIST_IDX].iptr[i]][0];
|
||||
|
||||
if (config_isparamset(vals, RU_SDR_ADDRS)) {
|
||||
RC.ru[j]->openair0_cfg.sdr_addrs = strdup(*(vals[RU_SDR_ADDRS].strptr));
|
||||
}
|
||||
|
||||
if (config_isparamset(vals, RU_SDR_CLK_SRC)) {
|
||||
char *paramVal=*(vals[RU_SDR_CLK_SRC].strptr);
|
||||
LOG_D(PHY, "RU clock source set as %s\n", paramVal);
|
||||
|
||||
if (strcmp(paramVal, "internal") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = internal;
|
||||
} else if (strcmp(paramVal, "external") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = external;
|
||||
} else if (strcmp(paramVal, "gpsdo") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = gpsdo;
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", paramVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(*(vals[RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(vals,RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
RC.ru[j]->if_south = LOCAL_RF;
|
||||
RC.ru[j]->function = eNodeB_3GPP;
|
||||
LOG_I(PHY, "Setting function for RU %d to eNodeB_3GPP\n",j);
|
||||
} else {
|
||||
RC.ru[j]->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
}
|
||||
|
||||
RC.ru[j]->max_pdschReferenceSignalPower = *(vals[RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
RC.ru[j]->max_rxgain = *(vals[RU_MAX_RXGAIN_IDX].uptr);
|
||||
RC.ru[j]->num_bands = vals[RU_BAND_LIST_IDX].numelt;
|
||||
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
|
||||
RC.ru[j]->sf_extension = *(vals[RU_SF_EXTENSION_IDX].uptr);
|
||||
RC.ru[j]->end_of_burst_delay = *(vals[RU_END_OF_BURST_DELAY_IDX].uptr);
|
||||
|
||||
for (int i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = vals[RU_BAND_LIST_IDX].iptr[i];
|
||||
if (config_isparamset(vals, RU_SDR_CLK_SRC)) {
|
||||
char *paramVal=*(vals[RU_SDR_CLK_SRC].strptr);
|
||||
LOG_D(PHY, "RU clock source set as %s\n", paramVal);
|
||||
|
||||
if (strcmp(paramVal, "internal") == 0) {
|
||||
ru->openair0_cfg.clock_source = internal;
|
||||
} else if (strcmp(paramVal, "external") == 0) {
|
||||
ru->openair0_cfg.clock_source = external;
|
||||
} else if (strcmp(paramVal, "gpsdo") == 0) {
|
||||
ru->openair0_cfg.clock_source = gpsdo;
|
||||
} else {
|
||||
LOG_I(PHY,"RU %d: Transport %s\n",j,*(vals[RU_TRANSPORT_PREFERENCE_IDX].strptr));
|
||||
RC.ru[j]->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", paramVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(*(vals[RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(vals,RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->function = eNodeB_3GPP;
|
||||
} else {
|
||||
ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
}
|
||||
|
||||
ru->max_pdschReferenceSignalPower = *(vals[RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
ru->max_rxgain = *(vals[RU_MAX_RXGAIN_IDX].uptr);
|
||||
ru->num_bands = vals[RU_BAND_LIST_IDX].numelt;
|
||||
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
|
||||
ru->sf_extension = *(vals[RU_SF_EXTENSION_IDX].uptr);
|
||||
ru->end_of_burst_delay = *(vals[RU_END_OF_BURST_DELAY_IDX].uptr);
|
||||
|
||||
for (int i=0; i<ru->num_bands; i++)
|
||||
ru->band[i] = vals[RU_BAND_LIST_IDX].iptr[i];
|
||||
} else {
|
||||
ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
} /* strcmp(local_rf, "yes") != 0 */
|
||||
|
||||
RC.ru[j]->nb_tx = *(vals[RU_NB_TX_IDX].uptr);
|
||||
RC.ru[j]->nb_rx = *(vals[RU_NB_RX_IDX].uptr);
|
||||
RC.ru[j]->att_tx = *(vals[RU_ATT_TX_IDX].uptr);
|
||||
RC.ru[j]->att_rx = *(vals[RU_ATT_RX_IDX].uptr);
|
||||
}// j=0..num_rus
|
||||
ru->nb_tx = *(vals[RU_NB_TX_IDX].uptr);
|
||||
ru->nb_rx = *(vals[RU_NB_RX_IDX].uptr);
|
||||
ru->att_tx = *(vals[RU_ATT_TX_IDX].uptr);
|
||||
ru->att_rx = *(vals[RU_ATT_RX_IDX].uptr);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1055,13 +1031,13 @@ void init_pdcp(void) {
|
||||
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);
|
||||
//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);
|
||||
//pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,16 +1063,11 @@ void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to) {
|
||||
int stop_L1L2(module_id_t enb_id) {
|
||||
LOG_W(ENB_APP, "stopping lte-softmodem\n");
|
||||
|
||||
if (!RC.ru) {
|
||||
LOG_UI(ENB_APP, "no RU configured\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* these tasks need to pick up new configuration */
|
||||
terminate_task(enb_id, TASK_ENB_APP, TASK_RRC_ENB);
|
||||
oai_exit = 1;
|
||||
LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", enb_id);
|
||||
kill_RU_proc(RC.ru[enb_id]);
|
||||
//kill_RU_proc(RC.ru[enb_id]);
|
||||
LOG_I(ENB_APP, "calling kill_eNB_proc() for instance %d\n", enb_id);
|
||||
kill_eNB_proc(enb_id);
|
||||
oai_exit = 0;
|
||||
@@ -1106,7 +1077,7 @@ int stop_L1L2(module_id_t enb_id) {
|
||||
phy_free_lte_eNB(RC.eNB[enb_id][cc_id]);
|
||||
}
|
||||
|
||||
phy_free_RU(RC.ru[enb_id]);
|
||||
//phy_free_RU(RC.ru[enb_id]);
|
||||
free_lte_top();
|
||||
return 0;
|
||||
}
|
||||
@@ -1115,14 +1086,18 @@ int stop_L1L2(module_id_t enb_id) {
|
||||
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
|
||||
*/
|
||||
int restart_L1L2(module_id_t enb_id) {
|
||||
RU_t *ru = RC.ru[enb_id];
|
||||
RU_t *ru = NULL; //RC.ru[enb_id];
|
||||
MessageDef *msg_p = NULL;
|
||||
LOG_W(ENB_APP, "restarting lte-softmodem\n");
|
||||
/* block threads */
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
sync_var = -1;
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
|
||||
/* copy the changed frame parameters to the RU */
|
||||
/* TODO this should be done for all RUs associated to this eNB */
|
||||
memcpy(&ru->frame_parms, &RC.eNB[enb_id][0]->frame_parms, sizeof(LTE_DL_FRAME_PARMS));
|
||||
|
||||
/* reset the list of connected UEs in the MAC, since in this process with
|
||||
* loose all UEs (have to reconnect) */
|
||||
init_UE_info(&RC.mac[enb_id]->UE_info);
|
||||
@@ -1135,11 +1110,6 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
||||
* broken, so we cannot test it */
|
||||
init_RU_proc(ru);
|
||||
ru->rf_map.card = 0;
|
||||
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||
init_eNB_afterRU();
|
||||
printf("Sending sync to all threads\n");
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
@@ -1187,10 +1157,16 @@ int main ( int argc, char **argv ) {
|
||||
RCconfig_L1();
|
||||
}
|
||||
|
||||
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
|
||||
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
|
||||
// some initialization is necessary and init_ru_vnf do this.
|
||||
RU_t ru;
|
||||
|
||||
|
||||
/* We need to read RU configuration before FlexRAN starts so it knows what
|
||||
* splits to report. Actual RU start comes later. */
|
||||
if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
RCconfig_RU();
|
||||
if ( NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
ocpRCconfig_RU(&ru);
|
||||
LOG_I(PHY,
|
||||
"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
|
||||
RC.nb_L1_inst, RC.nb_RU, get_nprocs());
|
||||
@@ -1211,7 +1187,7 @@ int main ( int argc, char **argv ) {
|
||||
if (RC.nb_inst > 0) {
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
for (i = 0; i < RC.nb_inst; i++) {
|
||||
flexran_agent_start(i);
|
||||
//flexran_agent_start(i);
|
||||
}
|
||||
|
||||
/* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks
|
||||
@@ -1292,20 +1268,16 @@ int main ( int argc, char **argv ) {
|
||||
|
||||
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
|
||||
|
||||
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
|
||||
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
|
||||
// some initialization is necessary and init_ru_vnf do this.
|
||||
|
||||
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
printf("Initializing RU threads\n");
|
||||
init_RU(get_softmodem_params()->rf_config_file,
|
||||
ocp_init_RU(&ru,
|
||||
get_softmodem_params()->rf_config_file,
|
||||
get_softmodem_params()->send_dmrs_sync);
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
RC.ru[ru_id]->rf_map.card=0;
|
||||
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
LOG_I(PHY,"Starting ru_thread %d\n",ru_id);
|
||||
init_RU_proc(RC.ru[ru_id]);
|
||||
}
|
||||
ru.rf_map.card=0;
|
||||
ru.rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
init_RU_proc(&ru);
|
||||
|
||||
config_sync_var=0;
|
||||
|
||||
@@ -1316,6 +1288,7 @@ int main ( int argc, char **argv ) {
|
||||
LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init eNBs\n");
|
||||
sleep(1);
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_PNF && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
@@ -1369,10 +1342,6 @@ int main ( int argc, char **argv ) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int inst = 0; inst < RC.nb_RU; inst++) {
|
||||
phy_free_RU(RC.ru[inst]);
|
||||
}
|
||||
|
||||
free_lte_top();
|
||||
end_configmodule();
|
||||
pthread_cond_destroy(&sync_cond);
|
||||
@@ -1381,17 +1350,6 @@ int main ( int argc, char **argv ) {
|
||||
pthread_mutex_destroy(&nfapi_sync_mutex);
|
||||
pthread_mutex_destroy(&ue_pf_po_mutex);
|
||||
|
||||
for(int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
if (RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
terminate_opt();
|
||||
|
||||
+10
-1
@@ -256,6 +256,15 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
|
||||
// Do PRACH RU processing
|
||||
L1_nr_prach_procedures(gNB,frame_rx,slot_rx);
|
||||
|
||||
//apply the rx signal rotation here
|
||||
apply_nr_rotation_ul(&gNB->frame_parms,
|
||||
gNB->common_vars.rxdataF[0],
|
||||
slot_rx,
|
||||
0,
|
||||
gNB->frame_parms.Ncp==EXTENDED?12:14,
|
||||
gNB->frame_parms.ofdm_symbol_size);
|
||||
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
|
||||
}
|
||||
|
||||
@@ -266,7 +275,7 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
||||
// (may be relaxed in the future for performance reasons)
|
||||
// *****************************************
|
||||
|
||||
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
|
||||
|
||||
if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) {
|
||||
|
||||
+39
-38
@@ -623,6 +623,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
unsigned int rxs;
|
||||
int i;
|
||||
uint32_t samples_per_slot = fp->get_samples_per_slot(*slot,fp);
|
||||
uint32_t samples_per_slot_prev ;
|
||||
openair0_timestamp ts,old_ts;
|
||||
AssertFatal(*slot<fp->slots_per_frame && *slot>=0, "slot %d is illegal (%d)\n",*slot,fp->slots_per_frame);
|
||||
|
||||
@@ -658,16 +659,16 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
ru->ts_offset = proc->timestamp_rx;
|
||||
proc->timestamp_rx = 0;
|
||||
} else {
|
||||
if (proc->timestamp_rx - old_ts != fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp)) {
|
||||
LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot,ru->ts_offset);
|
||||
ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot);
|
||||
samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp);
|
||||
if (proc->timestamp_rx - old_ts != samples_per_slot_prev) {
|
||||
LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot_prev,ru->ts_offset);
|
||||
ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot_prev);
|
||||
proc->timestamp_rx = ts-ru->ts_offset;
|
||||
}
|
||||
}
|
||||
|
||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
|
||||
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe;
|
||||
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
|
||||
proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx,fp);
|
||||
// synchronize first reception to frame 0 subframe 0
|
||||
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
|
||||
ru->idx,
|
||||
@@ -688,7 +689,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
}
|
||||
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",(long long unsigned int)proc->timestamp_rx,proc->frame_rx,*frame);
|
||||
LOG_E(PHY,"Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d, proc->tti_rx %d, slot %d)\n",(long long unsigned int)proc->timestamp_rx,proc->frame_rx,*frame,proc->tti_rx,*slot);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} else {
|
||||
@@ -727,38 +728,34 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
//nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
|
||||
if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) {
|
||||
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
txsymb = 0;
|
||||
for(int symbol_count =0;symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT;symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==0)
|
||||
txsymb++;
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD){
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
txsymb = 0;
|
||||
for(int symbol_count = 0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
|
||||
txsymb++;
|
||||
}
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags=3; // end of burst
|
||||
}
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD &&
|
||||
slot_type == NR_DOWNLINK_SLOT &&
|
||||
prevslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 2; // start of burst
|
||||
}
|
||||
if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT)
|
||||
flags = 2; // start of burst
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD &&
|
||||
slot_type == NR_DOWNLINK_SLOT &&
|
||||
nextslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 3; // end of burst
|
||||
if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT)
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
|
||||
if (fp->freq_range==nr_FR2) {
|
||||
// the beam index is written in bits 8-10 of the flags
|
||||
// bit 11 enables the gpio programming
|
||||
int beam=0;
|
||||
if (slot==0) beam = 11; //3 for boresight & 8 to enable
|
||||
//if (slot==0) beam = 11; //3 for boresight & 8 to enable
|
||||
/*
|
||||
if (slot==0 || slot==40) beam=0&8;
|
||||
if (slot==10 || slot==50) beam=1&8;
|
||||
@@ -767,7 +764,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
*/
|
||||
flags |= beam<<8;
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
|
||||
@@ -861,9 +858,9 @@ void *ru_thread_prach( void *param ) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
|
||||
/*VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
|
||||
|
||||
/*if (ru->gNB_list[0]){
|
||||
if (ru->gNB_list[0]){
|
||||
prach_procedures(
|
||||
ru->gNB_list[0],0
|
||||
);
|
||||
@@ -1149,19 +1146,22 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
if (ru->if_frequency == 0) {
|
||||
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
|
||||
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
|
||||
}
|
||||
else {
|
||||
} else if (ru->if_freq_offset){
|
||||
cfg->tx_freq[i] = (double)(ru->if_frequency);
|
||||
cfg->rx_freq[i] = (double)(ru->if_frequency + ru->if_freq_offset);
|
||||
LOG_I(PHY, "Setting IF TX frequency to %lu Hz with IF RX frequency offset %d Hz\n", ru->if_frequency, ru->if_freq_offset);
|
||||
} else {
|
||||
cfg->tx_freq[i] = (double)ru->if_frequency;
|
||||
cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq);
|
||||
}
|
||||
cfg->tx_gain[i] = ru->att_tx;
|
||||
cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx;
|
||||
cfg->configFilename = rf_config_file;
|
||||
printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n",
|
||||
LOG_I(PHY, "Channel %d: setting tx_gain offset %f, rx_gain offset %f, tx_freq %lu Hz, rx_freq %lu Hz\n",
|
||||
i, cfg->tx_gain[i],
|
||||
cfg->rx_gain[i],
|
||||
cfg->tx_freq[i],
|
||||
cfg->rx_freq[i]);
|
||||
(unsigned long)cfg->tx_freq[i],
|
||||
(unsigned long)cfg->rx_freq[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2220,7 +2220,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
case REMOTE_IF4p5:
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = NULL; // DFTs
|
||||
ru->feptx_prec = (get_thread_worker_conf() == WORKER_ENABLE) ? NULL : nr_feptx_prec; // Precoding operation
|
||||
ru->feptx_prec = nr_feptx_prec; // Precoding operation
|
||||
ru->feptx_ofdm = NULL; // no OFDM mod
|
||||
ru->fh_south_in = fh_if4p5_south_in; // synchronous IF4p5 reception
|
||||
ru->fh_south_out = fh_if4p5_south_out; // synchronous IF4p5 transmission
|
||||
@@ -2494,6 +2494,7 @@ void RCconfig_RU(void)
|
||||
RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
|
||||
RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
|
||||
RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr);
|
||||
RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr);
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
|
||||
RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
|
||||
|
||||
@@ -956,7 +956,7 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init gNBs\n");
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
|
||||
sleep(1);
|
||||
scopeParms_t p;
|
||||
p.argc=&argc;
|
||||
p.argv=argv;
|
||||
|
||||
+39
-49
@@ -135,17 +135,15 @@ typedef enum {
|
||||
|
||||
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
int nb_connected_gNB = 1, gNB_id;
|
||||
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
|
||||
ue->Mod_id = UE_id;
|
||||
ue->mac_enabled = 1;
|
||||
ue->if_inst = nr_ue_if_module_init(0);
|
||||
|
||||
// Setting UE mode to NOT_SYNCHED by default
|
||||
for (gNB_id = 0; gNB_id < nb_connected_gNB; gNB_id++){
|
||||
@@ -158,6 +156,9 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
|
||||
|
||||
// intialize transport
|
||||
init_nr_ue_transport(ue, abstraction_flag);
|
||||
|
||||
// init N_TA offset
|
||||
init_N_TA_offset(ue);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -175,24 +176,30 @@ static void UE_synch(void *arg) {
|
||||
int i, hw_slot_offset;
|
||||
PHY_VARS_NR_UE *UE = syncD->UE;
|
||||
sync_mode_t sync_mode = pbch;
|
||||
int CC_id = UE->CC_id;
|
||||
int freq_offset=0;
|
||||
//int CC_id = UE->CC_id;
|
||||
static int freq_offset=0;
|
||||
UE->is_synchronized = 0;
|
||||
|
||||
if (UE->UE_scan == 0) {
|
||||
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu64", UL %"PRIu64" (oai_exit %d, rx_num_channels %d)\n",
|
||||
UE->frame_parms.dl_CarrierFreq, UE->frame_parms.ul_CarrierFreq,
|
||||
oai_exit, openair0_cfg[0].rx_num_channels);
|
||||
|
||||
#ifdef FR2_TEST
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0){
|
||||
UE->frame_parms.dl_CarrierFreq = downlink_frequency[0][0];
|
||||
UE->frame_parms.ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = UE->frame_parms.dl_CarrierFreq;
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = UE->frame_parms.ul_CarrierFreq;
|
||||
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
|
||||
|
||||
if (UE->frame_parms.frame_type == FDD)
|
||||
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_FDD;
|
||||
else
|
||||
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_TDD;
|
||||
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n",
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i],
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i],
|
||||
UE->rf_map.card,
|
||||
oai_exit,
|
||||
i,
|
||||
openair0_cfg[0].rx_num_channels);
|
||||
|
||||
}
|
||||
|
||||
sync_mode = pbch;
|
||||
@@ -247,31 +254,25 @@ static void UE_synch(void *arg) {
|
||||
case pbch:
|
||||
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
|
||||
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
double rx_gain_off = 0;
|
||||
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) {
|
||||
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
|
||||
hw_slot_offset = ((UE->rx_offset<<1) / UE->frame_parms.samples_per_subframe * UE->frame_parms.slots_per_subframe) +
|
||||
round((float)((UE->rx_offset<<1) % UE->frame_parms.samples_per_subframe)/UE->frame_parms.samples_per_slot0);
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %lu, UL %lu), UE_scan_carrier %d\n",
|
||||
hw_slot_offset,
|
||||
freq_offset,
|
||||
UE->rx_total_gain_dB,
|
||||
UE->frame_parms.dl_CarrierFreq+freq_offset,
|
||||
UE->frame_parms.ul_CarrierFreq+freq_offset,
|
||||
UE->UE_scan_carrier );
|
||||
|
||||
// rerun with new cell parameters and frequency-offset
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
|
||||
// todo: the freq_offset computed on DL shall be scaled before being applied to UL
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
if (freq_offset >= 0)
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] += abs(freq_offset);
|
||||
else
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] -= abs(freq_offset);
|
||||
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] =
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i]+(UE->frame_parms.ul_CarrierFreq-UE->frame_parms.dl_CarrierFreq);
|
||||
UE->frame_parms.dl_CarrierFreq = openair0_cfg[CC_id].rx_freq[i];
|
||||
}
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %f (DL %f Hz, UL %f Hz)\n",
|
||||
hw_slot_offset,
|
||||
freq_offset,
|
||||
openair0_cfg[UE->rf_map.card].rx_gain[0],
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[0],
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[0]);
|
||||
|
||||
// reconfigure for potentially different bandwidth
|
||||
switch(UE->frame_parms.N_RB_DL) {
|
||||
@@ -315,7 +316,6 @@ static void UE_synch(void *arg) {
|
||||
//UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]);
|
||||
//UE->rfdevice.trx_stop_func(&UE->rfdevice);
|
||||
// sleep(1);
|
||||
//nr_init_frame_parms_ue(&UE->frame_parms);
|
||||
/*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) {
|
||||
LOG_E(HW,"Could not start the device\n");
|
||||
oai_exit=1;
|
||||
@@ -328,31 +328,21 @@ static void UE_synch(void *arg) {
|
||||
UE->is_synchronized = 1;
|
||||
}
|
||||
} else {
|
||||
// initial sync failed
|
||||
// calculate new offset and try again
|
||||
|
||||
if (UE->UE_scan_carrier == 1) {
|
||||
|
||||
if (freq_offset >= 0)
|
||||
freq_offset += 100;
|
||||
|
||||
freq_offset *= -1;
|
||||
LOG_I(PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %lu, UL %lu)\n",
|
||||
freq_offset,
|
||||
UE->rx_total_gain_dB,
|
||||
UE->frame_parms.dl_CarrierFreq+freq_offset,
|
||||
UE->frame_parms.ul_CarrierFreq+freq_offset );
|
||||
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = UE->frame_parms.dl_CarrierFreq+freq_offset;
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = UE->frame_parms.ul_CarrierFreq+freq_offset;
|
||||
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
if (UE->UE_scan_carrier==1)
|
||||
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
|
||||
}
|
||||
LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset);
|
||||
|
||||
if (UE->mode != loop_through_memory)
|
||||
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
|
||||
}// initial_sync=0
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
+124
-315
@@ -40,7 +40,7 @@
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
#include "openair1/PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/phy_vars_nr_ue.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
//#include "../../SIMU/USER/init_lte.h"
|
||||
@@ -85,7 +85,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
// Raphael : missing
|
||||
extern const char *duplex_mode[];
|
||||
|
||||
// Thread variables
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
@@ -94,30 +96,40 @@ pthread_cond_t sync_cond;
|
||||
pthread_mutex_t sync_mutex;
|
||||
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
int config_sync_var=-1;
|
||||
tpool_t *Tpool;
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
volatile int start_eNB = 0;
|
||||
volatile int start_UE = 0;
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
int single_thread_flag=1;
|
||||
static double snr_dB=20;
|
||||
// Command line options
|
||||
|
||||
int threequarter_fs=0;
|
||||
extern int16_t nr_dlsch_demod_shift;
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
//int32_t uplink_counter = 0;
|
||||
|
||||
|
||||
extern int16_t nr_dlsch_demod_shift;
|
||||
|
||||
int UE_scan = 0;
|
||||
int UE_scan_carrier = 0;
|
||||
int UE_fo_compensation = 0;
|
||||
int single_thread_flag = 1;
|
||||
int threequarter_fs = 0;
|
||||
int UE_scan_carrier = 0;
|
||||
int UE_fo_compensation = 0;
|
||||
int UE_no_timing_correction = 0;
|
||||
runmode_t mode = normal_txrx;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int N_RB_DL = 0;
|
||||
int tddflag = 0;
|
||||
int vcdflag = 0;
|
||||
uint8_t nb_antenna_tx = 1;
|
||||
uint8_t nb_antenna_rx = 1;
|
||||
double rx_gain_off = 0.0;
|
||||
uint32_t timing_advance = 0;
|
||||
char *usrp_args = NULL;
|
||||
char *rrc_config_path = NULL;
|
||||
int dumpframe = 0;
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
int rx_input_level_dBm;
|
||||
|
||||
#if MAX_NUM_CCs == 1
|
||||
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
|
||||
@@ -129,74 +141,25 @@ double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0},{20,0,0,0}};
|
||||
double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}};
|
||||
#endif
|
||||
|
||||
double rx_gain_off = 0.0;
|
||||
// UE and OAI config variables
|
||||
|
||||
double sample_rate=30.72e6;
|
||||
double bw = 10.0e6;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
int otg_enabled;
|
||||
double cpuf;
|
||||
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
|
||||
int chain_offset=0;
|
||||
|
||||
|
||||
uint8_t dci_Format = 0;
|
||||
uint8_t agregation_Level =0xFF;
|
||||
|
||||
uint8_t nb_antenna_tx = 1;
|
||||
uint8_t nb_antenna_rx = 1;
|
||||
|
||||
char ref[128] = "internal";
|
||||
char channels[128] = "0";
|
||||
|
||||
|
||||
int rx_input_level_dBm;
|
||||
|
||||
//static int online_log_messages=0;
|
||||
|
||||
|
||||
int otg_enabled;
|
||||
//int number_of_cards = 1;
|
||||
|
||||
static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
|
||||
uint32_t target_dl_mcs = 28; //maximum allowed mcs
|
||||
uint32_t target_ul_mcs = 20;
|
||||
uint32_t timing_advance = 0;
|
||||
uint64_t num_missed_slots=0; // counter for the number of missed slots
|
||||
|
||||
|
||||
int transmission_mode=1;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
|
||||
/* flag set by eNB conf file to specify if the radio head is local or remote (default option is local) */
|
||||
//uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD;
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
//eth_params_t *eth_params;
|
||||
|
||||
double cpuf;
|
||||
runmode_t mode = normal_txrx;
|
||||
int UE_scan = 0;
|
||||
int chain_offset = 0;
|
||||
uint64_t num_missed_slots = 0; // counter for the number of missed slots
|
||||
int transmission_mode = 1;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
int oaisim_flag = 0;
|
||||
int emulate_rf = 0;
|
||||
|
||||
char uecap_xer[1024],uecap_xer_in=0;
|
||||
|
||||
int oaisim_flag=0;
|
||||
int emulate_rf = 0;
|
||||
|
||||
tpool_t *Tpool;
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
|
||||
char *usrp_args=NULL;
|
||||
|
||||
char *rrc_config_path=NULL;
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
*/
|
||||
@@ -245,37 +208,6 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
void reset_stats(long arg) {
|
||||
//int i,j,k;
|
||||
/*PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[0][0];
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
for (k=0; k<8; k++) { //harq_processes
|
||||
for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) {
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0;
|
||||
}
|
||||
|
||||
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
||||
|
||||
for (j=0; j<phy_vars_eNB->ulsch[i]->Mlimit; j++) {
|
||||
phy_vars_eNB->UE_stats[i].ulsch_decoding_attempts[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_decoding_attempts_last[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_round_errors[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_round_fer[k][j]=0;
|
||||
}
|
||||
}
|
||||
|
||||
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
||||
}*/
|
||||
}
|
||||
|
||||
void *l2l1_task(void *arg) {
|
||||
MessageDef *message_p = NULL;
|
||||
int result;
|
||||
@@ -316,21 +248,12 @@ void *l2l1_task(void *arg) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int16_t dlsch_demod_shift;
|
||||
|
||||
static void get_options(void) {
|
||||
int CC_id;
|
||||
int tddflag=0, nonbiotflag, vcdflag=0;
|
||||
|
||||
char *loopfile=NULL;
|
||||
int dumpframe=0;
|
||||
//uint32_t noS1;
|
||||
//uint32_t nokrnmod;
|
||||
//uint32_t nokrnmod;
|
||||
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
|
||||
|
||||
paramdef_t cmdline_uemodeparams[] = CMDLINE_UEMODEPARAMS_DESC;
|
||||
paramdef_t cmdline_ueparams[] = CMDLINE_NRUEPARAMS_DESC;
|
||||
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
|
||||
@@ -351,54 +274,12 @@ static void get_options(void) {
|
||||
if (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr)
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
||||
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
|
||||
UE_scan=0;
|
||||
|
||||
if (tddflag > 0) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
frame_parms[CC_id]->frame_type = TDD;
|
||||
}
|
||||
if ((cmdline_uemodeparams[CMDLINE_DUMPMEMORY_IDX].paramflags & PARAMFLAG_PARAMSET) != 0)
|
||||
mode = rx_dump_frame;
|
||||
|
||||
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;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 100;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 50;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||
frame_parms[0]->N_RB_DL = 25;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
UE_scan = 0;
|
||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
||||
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
||||
}
|
||||
}*/
|
||||
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
}
|
||||
|
||||
|
||||
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) {
|
||||
// Here the configuration file is the XER encoded UE capabilities
|
||||
// Read it in and store in asn1c data structures
|
||||
@@ -408,44 +289,56 @@ static void get_options(void) {
|
||||
} /* UE with config file */
|
||||
}
|
||||
|
||||
// set PHY vars from command line
|
||||
void set_options(int CC_id, PHY_VARS_NR_UE *UE){
|
||||
|
||||
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||
int CC_id;
|
||||
// Init power variables
|
||||
tx_max_power[CC_id] = tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
/* Set some default values that may be overwritten while reading options */
|
||||
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) calloc(sizeof(NR_DL_FRAME_PARMS),1);
|
||||
frame_parms[CC_id]->nr_band = 78;
|
||||
frame_parms[CC_id]->frame_type = FDD;
|
||||
frame_parms[CC_id]->tdd_config = 3;
|
||||
//frame_parms[CC_id]->tdd_config_S = 0;
|
||||
frame_parms[CC_id]->N_RB_DL = 106;
|
||||
frame_parms[CC_id]->N_RB_UL = 106;
|
||||
frame_parms[CC_id]->Ncp = NORMAL;
|
||||
//frame_parms[CC_id]->Ncp_UL = NORMAL;
|
||||
frame_parms[CC_id]->Nid_cell = 0;
|
||||
//frame_parms[CC_id]->num_MBSFN_config = 0;
|
||||
frame_parms[CC_id]->nb_antenna_ports_gNB = 1;
|
||||
frame_parms[CC_id]->nb_antennas_tx = 1;
|
||||
frame_parms[CC_id]->nb_antennas_rx = 1;
|
||||
//frame_parms[CC_id]->nushift = 0;
|
||||
// NR: Init to legacy LTE 20Mhz params
|
||||
frame_parms[CC_id]->numerology_index = 0;
|
||||
frame_parms[CC_id]->ttis_per_subframe = 1;
|
||||
frame_parms[CC_id]->slots_per_tti = 2;
|
||||
// Set UE variables
|
||||
UE->UE_scan = UE_scan;
|
||||
UE->UE_scan_carrier = UE_scan_carrier;
|
||||
UE->UE_fo_compensation = UE_fo_compensation;
|
||||
UE->no_timing_correction = UE_no_timing_correction;
|
||||
UE->mode = mode;
|
||||
UE->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
|
||||
UE->tx_total_gain_dB = (int)tx_gain[CC_id][0];
|
||||
UE->tx_power_max_dBm = tx_max_power[CC_id];
|
||||
|
||||
LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan %d, UE_scan_carrier %d, UE_no_timing_correction %d \n", mode, UE_fo_compensation, UE_scan, UE_scan_carrier, UE_no_timing_correction);
|
||||
|
||||
// Set FP variables
|
||||
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
|
||||
fp->nb_antennas_tx = nb_antenna_tx;
|
||||
fp->nb_antennas_rx = nb_antenna_rx;
|
||||
fp->threequarter_fs = threequarter_fs;
|
||||
if (tddflag){
|
||||
fp->frame_type = TDD;
|
||||
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
|
||||
}
|
||||
if (N_RB_DL){
|
||||
fp->N_RB_DL = N_RB_DL;
|
||||
LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", nb_antenna_rx, nb_antenna_tx, threequarter_fs);
|
||||
|
||||
}
|
||||
|
||||
void init_openair0(void) {
|
||||
int card;
|
||||
int i;
|
||||
int freq_off = 0;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[0][0]->frame_parms;
|
||||
|
||||
for (card=0; card<MAX_CARDS; card++) {
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
openair0_cfg[card].configFilename = NULL;
|
||||
openair0_cfg[card].threequarter_fs = frame_parms[0]->threequarter_fs;
|
||||
numerology = frame_parms[0]->numerology_index;
|
||||
openair0_cfg[card].threequarter_fs = frame_parms->threequarter_fs;
|
||||
numerology = frame_parms->numerology_index;
|
||||
|
||||
if(frame_parms[0]->N_RB_DL == 66) {
|
||||
if(frame_parms->N_RB_DL == 66) {
|
||||
if (numerology==3) {
|
||||
openair0_cfg[card].sample_rate=122.88e6;
|
||||
openair0_cfg[card].samples_per_frame = 1228800;
|
||||
@@ -453,7 +346,7 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}else if(frame_parms[0]->N_RB_DL == 32) {
|
||||
}else if(frame_parms->N_RB_DL == 32) {
|
||||
if (numerology==3) {
|
||||
openair0_cfg[card].sample_rate=61.44e6;
|
||||
openair0_cfg[card].samples_per_frame = 614400;
|
||||
@@ -461,9 +354,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}else if(frame_parms[0]->N_RB_DL == 217) {
|
||||
}else if(frame_parms->N_RB_DL == 217) {
|
||||
if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=92.16e6;
|
||||
openair0_cfg[card].samples_per_frame = 921600;
|
||||
}
|
||||
@@ -475,9 +368,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 273) {
|
||||
} else if(frame_parms->N_RB_DL == 273) {
|
||||
if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n");
|
||||
}
|
||||
else {
|
||||
@@ -488,9 +381,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 106) {
|
||||
} else if(frame_parms->N_RB_DL == 106) {
|
||||
if (numerology==0) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=23.04e6;
|
||||
openair0_cfg[card].samples_per_frame = 230400;
|
||||
} else {
|
||||
@@ -498,7 +391,7 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].samples_per_frame = 307200;
|
||||
}
|
||||
} else if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=46.08e6;
|
||||
openair0_cfg[card].samples_per_frame = 460800;
|
||||
}
|
||||
@@ -513,57 +406,44 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 50) {
|
||||
} else if(frame_parms->N_RB_DL == 50) {
|
||||
openair0_cfg[card].sample_rate=15.36e6;
|
||||
openair0_cfg[card].samples_per_frame = 153600;
|
||||
} else if (frame_parms[0]->N_RB_DL == 25) {
|
||||
} else if (frame_parms->N_RB_DL == 25) {
|
||||
openair0_cfg[card].sample_rate=7.68e6;
|
||||
openair0_cfg[card].samples_per_frame = 76800;
|
||||
} else if (frame_parms[0]->N_RB_DL == 6) {
|
||||
} else if (frame_parms->N_RB_DL == 6) {
|
||||
openair0_cfg[card].sample_rate=1.92e6;
|
||||
openair0_cfg[card].samples_per_frame = 19200;
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL);
|
||||
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms->N_RB_DL);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (frame_parms[0]->frame_type==TDD)
|
||||
if (frame_parms->frame_type==TDD)
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
|
||||
else //FDD
|
||||
else
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
||||
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %hhu/%hhu\n",card,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].Mod_id = 0;
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL;
|
||||
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
|
||||
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
|
||||
openair0_cfg[card].tx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].tx_num_channels = min(2, frame_parms->nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels = min(2, frame_parms->nb_antennas_rx);
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
if (i<openair0_cfg[card].tx_num_channels)
|
||||
openair0_cfg[card].tx_freq[i] = frame_parms[0]->ul_CarrierFreq;
|
||||
else
|
||||
openair0_cfg[card].tx_freq[i]=0.0;
|
||||
LOG_I(PHY, "HW: Configuring card %d, tx/rx num_channels %d/%d, duplex_mode %s\n",
|
||||
card,
|
||||
openair0_cfg[card].tx_num_channels,
|
||||
openair0_cfg[card].rx_num_channels,
|
||||
duplex_mode[openair0_cfg[card].duplex_mode]);
|
||||
|
||||
if (i<openair0_cfg[card].rx_num_channels)
|
||||
openair0_cfg[card].rx_freq[i] = frame_parms[0]->dl_CarrierFreq;
|
||||
else
|
||||
openair0_cfg[card].rx_freq[i]=0.0;
|
||||
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
openair0_cfg[card].autocal[i] = 1;
|
||||
openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
|
||||
openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB - rx_gain_off;
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
|
||||
card,i, openair0_cfg[card].tx_gain[i],
|
||||
openair0_cfg[card].rx_gain[i],
|
||||
openair0_cfg[card].tx_freq[i],
|
||||
openair0_cfg[card].rx_freq[i]);
|
||||
}
|
||||
nr_rf_card_config(&openair0_cfg[card], rx_gain_off, ul_carrier, dl_carrier, freq_off);
|
||||
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
|
||||
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
|
||||
|
||||
@@ -607,14 +487,12 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
set_softmodem_sighandler();
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
set_default_frame_parms(frame_parms);
|
||||
mode = normal_txrx;
|
||||
memset(openair0_cfg,0,sizeof(openair0_config_t)*MAX_CARDS);
|
||||
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
|
||||
// initialize logging
|
||||
logInit();
|
||||
// get options and fill parameters from configuration file
|
||||
get_options (); //Command-line options, enb_properties
|
||||
get_options(); //Command-line options
|
||||
get_common_options(SOFTMODEM_5GUE_BIT );
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
@@ -649,14 +527,6 @@ int main( int argc, char **argv ) {
|
||||
init_NR_UE(1,rrc_config_path);
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
init_pdcp();
|
||||
/*
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
NB_UE_INST=1;
|
||||
NB_INST=1;
|
||||
@@ -667,93 +537,33 @@ int main( int argc, char **argv ) {
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
|
||||
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
|
||||
frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
|
||||
frame_parms[CC_id]->nb_antenna_ports_gNB = 1; //initial value overwritten by initial sync later
|
||||
frame_parms[CC_id]->threequarter_fs = threequarter_fs;
|
||||
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx);
|
||||
|
||||
PHY_vars_UE_g[0][CC_id] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
|
||||
|
||||
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
|
||||
memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE));
|
||||
|
||||
set_options(CC_id, UE[CC_id]);
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL)
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
nr_init_frame_parms_ue(frame_parms[CC_id],nrUE_config,NORMAL);
|
||||
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
init_symbol_rotation(&UE[CC_id]->frame_parms, UE[CC_id]->frame_parms.dl_CarrierFreq);
|
||||
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
|
||||
|
||||
#ifdef FR2_TEST
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0) {
|
||||
if (downlink_frequency[0][0]!=0){
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
|
||||
init_symbol_rotation(frame_parms[CC_id],frame_parms[CC_id]->dl_CarrierFreq);
|
||||
init_nr_ue_vars(UE[CC_id],frame_parms[CC_id],0,abstraction_flag);
|
||||
|
||||
UE[CC_id]->mac_enabled = 1;
|
||||
UE[CC_id]->if_inst = nr_ue_if_module_init(0);
|
||||
UE[CC_id]->UE_scan = UE_scan;
|
||||
UE[CC_id]->UE_scan_carrier = UE_scan_carrier;
|
||||
UE[CC_id]->UE_fo_compensation = UE_fo_compensation;
|
||||
UE[CC_id]->mode = mode;
|
||||
UE[CC_id]->no_timing_correction = UE_no_timing_correction;
|
||||
printf("UE[%d]->mode = %d\n",CC_id,mode);
|
||||
|
||||
UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
|
||||
UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
|
||||
|
||||
if (UE[CC_id]->frame_parms.frame_type == FDD) {
|
||||
UE[CC_id]->N_TA_offset = 0;
|
||||
} else {
|
||||
int N_RB = UE[CC_id]->frame_parms.N_RB_DL;
|
||||
int N_TA_offset = UE[CC_id]->frame_parms.ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
double factor=1;
|
||||
switch (UE[CC_id]->frame_parms.numerology_index) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n");
|
||||
if (N_RB <= 25) factor = .25; // 7.68 Ms/s
|
||||
else if (N_RB <=50) factor = .5; // 15.36 Ms/s
|
||||
else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s
|
||||
else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s
|
||||
else AssertFatal(1==0,"Too many PRBS for mu=0\n");
|
||||
break;
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n");
|
||||
if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s
|
||||
break;
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n");
|
||||
break;
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s
|
||||
else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB);
|
||||
break;
|
||||
|
||||
if (N_RB == 100)
|
||||
UE[CC_id]->N_TA_offset = 624;
|
||||
else if (N_RB == 50)
|
||||
UE[CC_id]->N_TA_offset = 624/2;
|
||||
else if (N_RB == 25)
|
||||
UE[CC_id]->N_TA_offset = 624/4;
|
||||
}
|
||||
if (UE[CC_id]->frame_parms.threequarter_fs == 1) factor = factor*.75;
|
||||
UE[CC_id]->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d)\n", UE[CC_id]->Mod_id, UE[CC_id]->N_TA_offset, factor, UE[CC_id]->frame_parms.ul_CarrierFreq, N_RB);
|
||||
if (frame_parms[CC_id]->frame_type == TDD)
|
||||
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// printf("tx_max_power = %d -> amp %d\n",tx_max_power[0],get_tx_amp(tx_max_poHwer,tx_max_power));
|
||||
init_openair0();
|
||||
// init UE_PF_PO and mutex lock
|
||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||
@@ -764,7 +574,6 @@ int main( int argc, char **argv ) {
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
load_softscope("nr",PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
number_of_cards = 1;
|
||||
|
||||
for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
|
||||
@@ -48,13 +48,12 @@
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-fo-compensation", CONFIG_HLP_UEFO, PARAMFLAG_BOOL, iptr:&UE_fo_compensation, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, iptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT, 0}, \
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, iptr:&(N_RB_DL), defintval:25, TYPE_UINT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* command line parameters common to gNB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC_UE { \
|
||||
@@ -62,22 +61,16 @@
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 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}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 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}, \
|
||||
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \
|
||||
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
|
||||
extern int T_port;
|
||||
extern int T_nowait;
|
||||
extern int T_dont_fork;
|
||||
|
||||
|
||||
// In nr-ue.c
|
||||
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
extern void fill_ue_band_info(void);
|
||||
@@ -86,7 +79,7 @@ extern void init_NR_UE_threads(int);
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
void *UE_thread(void *arg);
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id, uint8_t abstraction_flag);
|
||||
extern tpool_t *Tpool;
|
||||
extern tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -63,6 +63,7 @@ extern "C"
|
||||
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
|
||||
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
|
||||
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
|
||||
#define CONFIG_HLP_ULF "Set the uplink frequency offset for all component carriers\n"
|
||||
#define CONFIG_HLP_CHOFF "Channel id offset\n"
|
||||
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
|
||||
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
|
||||
@@ -123,6 +124,7 @@ extern "C"
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
|
||||
{"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
@@ -230,6 +232,7 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
|
||||
#define SOFTMODEM_RTSIGNAL (SIGRTMIN+1)
|
||||
extern void set_softmodem_sighandler(void);
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -720,9 +720,6 @@ int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfa
|
||||
}
|
||||
|
||||
int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) {
|
||||
if (RC.ru == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (RC.eNB == 0) {
|
||||
return -2;
|
||||
@@ -847,9 +844,6 @@ int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n
|
||||
req->ul_config_request_body.srs_present
|
||||
);
|
||||
|
||||
if (RC.ru == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (RC.eNB == 0) {
|
||||
return -2;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
|
||||
#define NFAPI_UE_MAX_NUM_CB 8
|
||||
#define NFAPI_MAX_NUM_UL_PDU 8
|
||||
|
||||
/*
|
||||
typedef unsigned int uint32_t;
|
||||
@@ -155,7 +156,7 @@ typedef struct {
|
||||
uint16_t slot;
|
||||
fapi_nr_tx_config_t tx_config;
|
||||
uint16_t number_of_pdus;
|
||||
fapi_nr_tx_request_body_t *tx_request_body;
|
||||
fapi_nr_tx_request_body_t tx_request_body[NFAPI_MAX_NUM_UL_PDU];
|
||||
} fapi_nr_tx_request_t;
|
||||
|
||||
/// This struct replaces:
|
||||
@@ -170,6 +171,7 @@ typedef struct {
|
||||
uint8_t prach_format;
|
||||
/// Num RA
|
||||
uint8_t num_ra;
|
||||
uint8_t prach_slot;
|
||||
uint8_t prach_start_symbol;
|
||||
/// 38.211 (NCS 38.211 6.3.3.1).
|
||||
uint16_t num_cs;
|
||||
@@ -179,6 +181,8 @@ typedef struct {
|
||||
uint8_t restricted_set;
|
||||
/// see TS 38.211 (6.3.3.2).
|
||||
uint16_t freq_msg1;
|
||||
// When multiple SSBs per RO is configured, this indicates which one is selected in this RO -> this is used to properly compute the PRACH preamble
|
||||
uint8_t ssb_nb_in_ro;
|
||||
// nfapi_nr_ul_beamforming_t beamforming;
|
||||
} fapi_nr_ul_config_prach_pdu;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user