Commit 08ab9440 authored by masayuki.harada's avatar masayuki.harada

Merge remote-tracking branch 'remotes/oai/develop-SA-CBRA' into integration_w5GC_CBRA

# Conflicts:
#	openair2/LAYER2/NR_MAC_COMMON/nr_mac.h
parents 23524982 114508c1
#!/bin/groovy
/*
* 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
*/
// Location of the executor node
def nodeExecutor = params.nodeExecutor
// Tags to shorten pipeline duration
def doMandatoryTests = false
def doFullTestsuite = false
pipeline {
agent {
label nodeExecutor
}
options {
disableConcurrentBuilds()
timestamps()
gitLabConnection('OAI GitLab')
ansiColor('xterm')
}
stages {
stage ("Verify Parameters") {
steps {
script {
JOB_TIMESTAMP = sh returnStdout: true, script: 'date --utc --rfc-3339=seconds | sed -e "s#+00:00##"'
JOB_TIMESTAMP = JOB_TIMESTAMP.trim()
echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
def allParametersPresent = true
echo '\u2705 \u001B[32mVerify Labels\u001B[0m'
if ("MERGE".equals(env.gitlabActionType)) {
LABEL_CHECK = sh returnStdout: true, script: 'ci-scripts/checkGitLabMergeRequestLabels.sh --mr-id ' + env.gitlabMergeRequestIid
LABEL_CHECK = LABEL_CHECK.trim()
if (LABEL_CHECK == 'NONE') {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Your merge request has none of the mandatory labels:\n\n"
message += " - BUILD-ONLY\n"
message += " - 4G-LTE\n"
message += " - 5G-NR\n"
message += " - CI\n\n"
message += "Not performing CI due to lack of labels"
addGitLabMRComment comment: message
error('Not performing CI due to lack of labels')
} else if (LABEL_CHECK == 'FULL') {
doMandatoryTests = true
doFullTestsuite = true
} else if (LABEL_CHECK == 'SHORTEN-5G') {
doMandatoryTests = true
} else {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): We will perform only build stages on your Merge Request"
addGitLabMRComment comment: message
}
} else {
doMandatoryTests = true
doFullTestsuite = true
}
}
}
}
stage ("Verify Guidelines") {
steps {
echo "Git URL is ${GIT_URL}"
echo "GitLab Act is ${env.gitlabActionType}"
script {
if ("MERGE".equals(env.gitlabActionType)) {
// since a bit, in push events, gitlabUserEmail is not populated
gitCommitAuthorEmailAddr = env.gitlabUserEmail
echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}"
// GitLab-Jenkins plugin integration is lacking to perform the merge by itself
// Doing it manually --> it may have merge conflicts
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
} else {
echo "Git Branch is ${GIT_BRANCH}"
echo "Git Commit is ${GIT_COMMIT}"
// since a bit, in push events, gitlabUserEmail is not populated
gitCommitAuthorEmailAddr = sh returnStdout: true, script: 'git log -n1 --pretty=format:%ae ${GIT_COMMIT}'
gitCommitAuthorEmailAddr = gitCommitAuthorEmailAddr.trim()
echo "GitLab Usermail is ${gitCommitAuthorEmailAddr}"
sh "git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG"
}
}
}
post {
failure {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Merge Conflicts -- Cannot perform CI"
addGitLabMRComment comment: message
currentBuild.result = 'FAILURE'
}
}
}
}
// Build Stages are Mandatory
// Later we will add a Ubuntu20 build
stage ("Image Building Processes") {
parallel {
stage ("Ubuntu18 Build") {
steps {
script {
triggerSlaveJob ('RAN-Ubuntu18-Image-Builder', 'Ubuntu18-Images-Build')
}
}
post {
always {
script {
finalizeSlaveJob('RAN-Ubuntu18-Image-Builder')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
stage ("RHEL8 Build") {
steps {
script {
triggerSlaveJob ('RAN-RHEL8-Image-Builder', 'RHEL8-Images-Build')
}
}
post {
always {
script {
finalizeSlaveJob('RAN-RHEL8-Image-Builder')
}
}
failure {
script {
currentBuild.result = 'FAILURE'
}
}
}
}
}
}
}
post {
always {
script {
emailext attachmentsPattern: '*results*.html',
body: '''Hi,
Here are attached HTML report files for $PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!
Regards,
OAI CI Team''',
replyTo: 'no-reply@openairinterface.org',
subject: '$PROJECT_NAME - Build # $BUILD_NUMBER - $BUILD_STATUS!',
to: gitCommitAuthorEmailAddr
if (fileExists('.git/CI_COMMIT_MSG')) {
sh "rm -f .git/CI_COMMIT_MSG"
}
}
}
success {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
}
}
}
failure {
script {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
if ("MERGE".equals(env.gitlabActionType)) {
echo "This is a MERGE event"
addGitLabMRComment comment: message
}
}
}
}
}
// ---- Slave Job functions
def triggerSlaveJob (jobName, gitlabStatusName) {
// Workaround for the "cancelled" GitLab pipeline notification
// The slave job is triggered with the propagate false so the following commands are executed
// Its status is now PASS/SUCCESS from a stage pipeline point of view
// localStatus variable MUST be analyzed to properly assess the status
localStatus = build job: jobName,
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: "MERGE".equals(env.gitlabActionType)),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
], propagate: false
localResult = localStatus.getResult()
echo "${jobName} Slave Job status is ${localResult}"
gitlabCommitStatus(name: gitlabStatusName) {
if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) {
echo "${jobName} Slave Job is OK"
} else {
echo "${jobName} Slave Job is KO"
sh "ci-scripts/fail.sh"
}
}
}
def triggerSlaveJobNoGitLab (jobName) {
// Workaround for the "cancelled" GitLab pipeline notification
// The slave job is triggered with the propagate false so the following commands are executed
// Its status is now PASS/SUCCESS from a stage pipeline point of view
// localStatus variable MUST be analyzed to properly assess the status
localStatus = build job: jobName,
parameters: [
string(name: 'eNB_Repository', value: String.valueOf(GIT_URL)),
string(name: 'eNB_Branch', value: String.valueOf(env.gitlabSourceBranch)),
string(name: 'eNB_CommitID', value: String.valueOf(env.gitlabMergeRequestLastCommit)),
booleanParam(name: 'eNB_mergeRequest', value: "MERGE".equals(env.gitlabActionType)),
string(name: 'eNB_TargetBranch', value: String.valueOf(env.gitlabTargetBranch))
], propagate: false
localResult = localStatus.getResult()
echo "${jobName} Slave Job status is ${localResult}"
if (localStatus.resultIsBetterOrEqualTo('SUCCESS')) {
echo "${jobName} Slave Job is OK"
} else {
echo "${jobName} Slave Job is KO"
sh "ci-scripts/fail.sh"
}
}
def finalizeSlaveJob(jobName) {
// In case of any non-success, we are retrieving the HTML report of the last completed
// slave job. The only drop-back is that we may retrieve the HTML report of a previous build
fileName = "test_results-${jobName}.html"
if (!fileExists(fileName)) {
copyArtifacts(projectName: jobName,
filter: 'test_results*.html',
selector: lastCompleted())
if (fileExists(fileName)) {
sh "sed -i -e 's#TEMPLATE_BUILD_TIME#${JOB_TIMESTAMP}#' ${fileName}"
archiveArtifacts artifacts: fileName
}
}
}
This diff is collapsed.
...@@ -34,8 +34,9 @@ def buildStageStatus = true ...@@ -34,8 +34,9 @@ def buildStageStatus = true
def testStageName = params.pipelineTestStageName def testStageName = params.pipelineTestStageName
// Name of the phone resource // Name of the phone resource
def ciSmartPhoneResource1 = params.smartphonesResource1 def ciSmartPhonesResource1 = params.SmartPhonesResource1
def ciSmartPhoneResource2 = params.smartphonesResource2 def ciSmartPhonesResource2 = params.SmartPhonesResource2
def ciSmartPhonesResource3 = params.SmartPhonesResource3
// Global Parameters. Normally they should be populated when the master job // Global Parameters. Normally they should be populated when the master job
// triggers the slave job with parameters // triggers the slave job with parameters
...@@ -52,7 +53,7 @@ pipeline { ...@@ -52,7 +53,7 @@ pipeline {
options { options {
disableConcurrentBuilds() disableConcurrentBuilds()
ansiColor('xterm') ansiColor('xterm')
lock(extra: [[resource: ciSmartPhoneResource2]], resource: ciSmartPhoneResource1) lock(extra: [[resource: ciSmartPhonesResource2],[resource: ciSmartPhonesResource3]], resource: ciSmartPhonesResource1)
} }
stages { stages {
stage("Build Init") { stage("Build Init") {
...@@ -78,10 +79,13 @@ pipeline { ...@@ -78,10 +79,13 @@ pipeline {
testStageName = 'Template Test Stage' testStageName = 'Template Test Stage'
} }
if (params.smartphonesResource1 == null) { if (params.SmartPhonesResource1 == null) {
allParametersPresent = false allParametersPresent = false
} }
if (params.smartphonesResource2 == null) { if (params.SmartPhonesResource2 == null) {
allParametersPresent = false
}
if (params.SmartPhonesResource3== null) {
allParametersPresent = false allParametersPresent = false
} }
// 1st eNB parameters // 1st eNB parameters
......
...@@ -241,6 +241,10 @@ pipeline { ...@@ -241,6 +241,10 @@ pipeline {
stage ("Terminate") { stage ("Terminate") {
parallel { parallel {
stage('Terminate UE') { stage('Terminate UE') {
// Bypassing this stage if there are no abd server defined
when {
expression { params.ADB_IPAddress != "none" }
}
steps { steps {
echo '\u2705 \u001B[32mTerminate UE\u001B[0m' echo '\u2705 \u001B[32mTerminate UE\u001B[0m'
withCredentials([ withCredentials([
...@@ -275,6 +279,10 @@ pipeline { ...@@ -275,6 +279,10 @@ pipeline {
} }
} }
stage('Terminate SPGW') { stage('Terminate SPGW') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
echo '\u2705 \u001B[32mTerminate SPGW\u001B[0m' echo '\u2705 \u001B[32mTerminate SPGW\u001B[0m'
withCredentials([ withCredentials([
...@@ -292,6 +300,10 @@ pipeline { ...@@ -292,6 +300,10 @@ pipeline {
} }
} }
stage('Terminate MME') { stage('Terminate MME') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
echo '\u2705 \u001B[32mTerminate MME\u001B[0m' echo '\u2705 \u001B[32mTerminate MME\u001B[0m'
withCredentials([ withCredentials([
...@@ -309,6 +321,10 @@ pipeline { ...@@ -309,6 +321,10 @@ pipeline {
} }
} }
stage('Terminate HSS') { stage('Terminate HSS') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
echo '\u2705 \u001B[32mTerminate HSS\u001B[0m' echo '\u2705 \u001B[32mTerminate HSS\u001B[0m'
withCredentials([ withCredentials([
...@@ -371,6 +387,10 @@ pipeline { ...@@ -371,6 +387,10 @@ pipeline {
} }
} }
stage('Log Collection (SPGW)') { stage('Log Collection (SPGW)') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
...@@ -389,6 +409,10 @@ pipeline { ...@@ -389,6 +409,10 @@ pipeline {
} }
} }
stage('Log Collection (MME)') { stage('Log Collection (MME)') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
...@@ -407,6 +431,10 @@ pipeline { ...@@ -407,6 +431,10 @@ pipeline {
} }
} }
stage('Log Collection (HSS)') { stage('Log Collection (HSS)') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
...@@ -425,6 +453,10 @@ pipeline { ...@@ -425,6 +453,10 @@ pipeline {
} }
} }
stage('Log Collection (Ping)') { stage('Log Collection (Ping)') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
...@@ -443,6 +475,10 @@ pipeline { ...@@ -443,6 +475,10 @@ pipeline {
} }
} }
stage('Log Collection (Iperf)') { stage('Log Collection (Iperf)') {
// Bypassing this stage if EPC server is not defined
when {
expression { params.EPC_IPAddress != "none" }
}
steps { steps {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
...@@ -482,7 +518,7 @@ pipeline { ...@@ -482,7 +518,7 @@ pipeline {
// Making sure that we really shutdown every thing before leaving // Making sure that we really shutdown every thing before leaving
failure { failure {
script { script {
if (!termStatusArray[termUE]) { if ((!termStatusArray[termUE]) && (params.ADB_IPAddress != "none")) {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.ADB_Credentials}", usernameVariable: 'ADB_Username', passwordVariable: 'ADB_Password']
]) { ]) {
...@@ -496,21 +532,21 @@ pipeline { ...@@ -496,21 +532,21 @@ pipeline {
sh "python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}" sh "python3 ci-scripts/main.py --mode=TerminateeNB --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password}"
} }
} }
if (!termStatusArray[termSPGW]) { if ((!termStatusArray[termSPGW]) && (params.EPC_IPAddress != "none")) {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
]) { ]) {
sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" sh "python3 ci-scripts/main.py --mode=TerminateSPGW --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
} }
} }
if (!termStatusArray[termMME]) { if ((!termStatusArray[termMME]) && (params.EPC_IPAddress != "none")) {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
]) { ]) {
sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}" sh "python3 ci-scripts/main.py --mode=TerminateMME --EPCIPAddress=${params.EPC_IPAddress} --EPCUserName=${EPC_Username} --EPCPassword=${EPC_Password} --EPCType=${params.EPC_Type} --EPCSourceCodePath=${params.EPC_SourceCodePath}"
} }
} }
if (!termStatusArray[termHSS]) { if ((!termStatusArray[termHSS]) && (params.EPC_IPAddress != "none")) {
withCredentials([ withCredentials([
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password'] [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
]) { ]) {
......
...@@ -33,19 +33,21 @@ pipeline { ...@@ -33,19 +33,21 @@ pipeline {
label pythonExecutor label pythonExecutor
} }
stages { stages {
stage ("NSA Test Loop") { stage ("Launcher") {
steps { steps {
script { script {
//retrieve MR that are opened nd with tag READY_TO_BE_MERGED
MR_LIST= sh returnStdout: true, script: 'curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100&labels=READY_TO_BE_MERGED" | jq ".[].iid" || true ' MR_LIST= sh returnStdout: true, script: 'curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests?state=opened&per_page=100&labels=READY_TO_BE_MERGED" | jq ".[].iid" || true '
echo "List of selected MR:\n${MR_LIST}" echo "List of selected MR:\n${MR_LIST}"
def MR_ARRAY = MR_LIST.split('\n') def MR_ARRAY = MR_LIST.split('\n')
//for every selected MR, retrieve the branch name and the latest commit
for (MR in MR_ARRAY) { for (MR in MR_ARRAY) {
SRC_BRANCH=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".source_branch" || true """ SRC_BRANCH=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".source_branch" || true """
SRC_BRANCH=SRC_BRANCH.trim() SRC_BRANCH=SRC_BRANCH.trim()
COMMIT_ID=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".sha" || true """ COMMIT_ID=sh returnStdout: true, script: """curl --silent "https://gitlab.eurecom.fr/api/v4/projects/oai%2Fopenairinterface5g/merge_requests/${MR}" | jq ".sha" || true """
COMMIT_ID=COMMIT_ID.trim() COMMIT_ID=COMMIT_ID.trim()
echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}" echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}"
//calling sub job //calling NSA sub job
build job: "RAN-CI-NSA-B210", wait : false, propagate : false, parameters: [ build job: "RAN-CI-NSA-B210", wait : false, propagate : false, parameters: [
string(name: 'eNB_MR', value: String.valueOf(MR)), string(name: 'eNB_MR', value: String.valueOf(MR)),
string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)), string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)),
...@@ -53,6 +55,14 @@ pipeline { ...@@ -53,6 +55,14 @@ pipeline {
string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)), string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)),
booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE)) booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE))
] ]
//calling Benetel sub job
build job: "RAN-CI-BENETEL", wait : false, propagate : false, parameters: [
string(name: 'eNB_MR', value: String.valueOf(MR)),
string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)),
string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)),
booleanParam(name: 'eNB_AllowMergeRequestProcess', value: Boolean.valueOf(ALLOW_MERGE))
]
} }
} }
} }
......
...@@ -35,6 +35,7 @@ import sys # arg ...@@ -35,6 +35,7 @@ import sys # arg
import re # reg import re # reg
import logging import logging
import os import os
import shutil
import time import time
from multiprocessing import Process, Lock, SimpleQueue from multiprocessing import Process, Lock, SimpleQueue
from zipfile import ZipFile from zipfile import ZipFile
...@@ -124,7 +125,7 @@ class Containerize(): ...@@ -124,7 +125,7 @@ class Containerize():
self.cli = 'docker' self.cli = 'docker'
self.dockerfileprefix = '.ubuntu18' self.dockerfileprefix = '.ubuntu18'
elif self.host == 'Red Hat': elif self.host == 'Red Hat':
self.cli = 'podman' self.cli = 'sudo podman'
self.dockerfileprefix = '.rhel8.2' self.dockerfileprefix = '.rhel8.2'
imageNames = [] imageNames = []
...@@ -173,6 +174,7 @@ class Containerize(): ...@@ -173,6 +174,7 @@ class Containerize():
# if the branch is not develop, then it is a merge request and we need to do # if the branch is not develop, then it is a merge request and we need to do
# the potential merge. Note that merge conflicts should already been checked earlier # the potential merge. Note that merge conflicts should already been checked earlier
imageTag = 'develop' imageTag = 'develop'
sharedTag = 'develop'
if (self.ranAllowMerge): if (self.ranAllowMerge):
imageTag = 'ci-temp' imageTag = 'ci-temp'
if self.ranTargetBranch == '': if self.ranTargetBranch == '':
...@@ -189,37 +191,22 @@ class Containerize(): ...@@ -189,37 +191,22 @@ class Containerize():
mySSH.command('sudo cp /etc/rhsm/ca/redhat-uep.pem tmp/ca/', '\$', 5) mySSH.command('sudo cp /etc/rhsm/ca/redhat-uep.pem tmp/ca/', '\$', 5)
mySSH.command('sudo cp /etc/pki/entitlement/*.pem tmp/entitlement/', '\$', 5) mySSH.command('sudo cp /etc/pki/entitlement/*.pem tmp/entitlement/', '\$', 5)
#mySSH.close()
#return 0
sharedimage = 'ran-build' sharedimage = 'ran-build'
# Let's remove any previous run artifacts if still there # Let's remove any previous run artifacts if still there
mySSH.command(self.cli + ' image prune --force', '\$', 5) mySSH.command(self.cli + ' image prune --force', '\$', 30)
mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + imageTag, '\$', 5) if (not self.ranAllowMerge):
mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + sharedTag, '\$', 30)
for image,pattern in imageNames: for image,pattern in imageNames:
mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag, '\$', 5) mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag, '\$', 30)
# Build the shared image
mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag ' + sharedimage + ':' + imageTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 1600)
# Build the target image(s)
previousImage = sharedimage + ':' + imageTag
danglingShaOnes=[]
for image,pattern in imageNames:
# the archived Dockerfiles have "ran-build:latest" as base image
# we need to update them with proper tag
mySSH.command('sed -i -e "s#' + sharedimage + ':latest#' + sharedimage + ':' + imageTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5)
mySSH.command(self.cli + ' build --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200)
# Retrieving the dangling image(s) for the log collection
mySSH.command(self.cli + ' images --filter "dangling=true" --filter "since=' + previousImage + '" -q | sed -e "s#^#sha=#"', '\$', 5)
result = re.search('sha=(?P<imageShaOne>[a-zA-Z0-9\-\_]+)', mySSH.getBefore())
if result is not None:
danglingShaOnes.append((image, result.group('imageShaOne')))
previousImage = image + ':' + imageTag
imageTag = 'ci-temp' # Build the shared image only on Push Events (not on Merge Requests)
# First verify if images were properly created. if (not self.ranAllowMerge):
mySSH.command(self.cli + ' build --target ' + sharedimage + ' --tag ' + sharedimage + ':' + sharedTag + ' --file docker/Dockerfile.ran' + self.dockerfileprefix + ' --build-arg NEEDED_GIT_PROXY="http://proxy.eurecom.fr:8080" . > cmake_targets/log/ran-build.log 2>&1', '\$', 1600)
# First verify if the shared image was properly created.
status = True status = True
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + sharedimage + ':' + imageTag, '\$', 5) mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + sharedimage + ':' + sharedTag, '\$', 5)
if mySSH.getBefore().count('No such object') != 0: if mySSH.getBefore().count('o such image') != 0:
logging.error('Could not build properly ran-build') logging.error('\u001B[1m Could not build properly ran-build\u001B[0m')
status = False status = False
else: else:
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
...@@ -240,11 +227,40 @@ class Containerize(): ...@@ -240,11 +227,40 @@ class Containerize():
self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' Gbytes' self.allImagesSize['ran-build'] = str(round(imageSize,1)) + ' Gbytes'
else: else:
logging.debug('ran-build size is unknown') logging.debug('ran-build size is unknown')
# If the shared image failed, no need to continue
if not status:
# Recover the name of the failed container?
mySSH.command(self.cli + ' ps --quiet --filter "status=exited" -n1 | xargs ' + self.cli + ' rm -f', '\$', 5)
mySSH.command(self.cli + ' image prune --force', '\$', 30)
mySSH.close()
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
else:
# Recover build logs, for the moment only possible when build is successful
mySSH.command(self.cli + ' create --name test ' + sharedimage + ':' + sharedTag, '\$', 5)
mySSH.command('mkdir -p cmake_targets/log/ran-build', '\$', 5)
mySSH.command(self.cli + ' cp test:/oai-ran/cmake_targets/log/. cmake_targets/log/ran-build', '\$', 5)
mySSH.command(self.cli + ' rm -f test', '\$', 5)
# Build the target image(s)
for image,pattern in imageNames: for image,pattern in imageNames:
# the archived Dockerfiles have "ran-build:latest" as base image
# we need to update them with proper tag
mySSH.command('sed -i -e "s#' + sharedimage + ':latest#' + sharedimage + ':' + sharedTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5)
mySSH.command(self.cli + ' build --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200)
# split the log
mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5)
mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5)
# checking the status of the build
mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + image + ':' + imageTag, '\$', 5) mySSH.command(self.cli + ' image inspect --format=\'Size = {{.Size}} bytes\' ' + image + ':' + imageTag, '\$', 5)
if mySSH.getBefore().count('No such object') != 0: if mySSH.getBefore().count('o such image') != 0:
logging.error('Could not build properly ' + image) logging.error('\u001B[1m Could not build properly ' + image + '\u001B[0m')
status = False status = False
# Here we should check if the last container corresponds to a failed command and destroy it
mySSH.command(self.cli + ' ps --quiet --filter "status=exited" -n1 | xargs ' + self.cli + ' rm -f', '\$', 5)
self.allImagesSize[image] = 'N/A -- Build Failed'
else: else:
result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore()) result = re.search('Size *= *(?P<size>[0-9\-]+) *bytes', mySSH.getBefore())
if result is not None: if result is not None:
...@@ -264,36 +280,24 @@ class Containerize(): ...@@ -264,36 +280,24 @@ class Containerize():
self.allImagesSize[image] = str(round(imageSize,1)) + ' Gbytes' self.allImagesSize[image] = str(round(imageSize,1)) + ' Gbytes'
else: else:
logging.debug('ran-build size is unknown') logging.debug('ran-build size is unknown')
if not status: self.allImagesSize[image] = 'unknown'
mySSH.close() # Now pruning dangling images in between target builds
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m') mySSH.command(self.cli + ' image prune --force', '\$', 30)
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
#HTML.CreateHtmlNextTabHeaderTestRow(self.collectInfo, self.allImagesSize)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
# Recover build logs, for the moment only possible when build is successful # Analyzing the logs
mySSH.command(self.cli + ' create --name test ' + sharedimage + ':' + imageTag, '\$', 5) mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
mySSH.command('mkdir -p cmake_targets/log/ran-build', '\$', 5)
mySSH.command(self.cli + ' cp test:/oai-ran/cmake_targets/log/. cmake_targets/log/ran-build', '\$', 5)
mySSH.command(self.cli + ' rm -f test', '\$', 5)
for image,shaone in danglingShaOnes:
mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5)
mySSH.command(self.cli + ' create --name test ' + shaone, '\$', 5)
mySSH.command(self.cli + ' cp test:/oai-ran/cmake_targets/log/. cmake_targets/log/' + image, '\$', 5)
mySSH.command(self.cli + ' rm -f test', '\$', 5)
mySSH.command(self.cli + ' image prune --force', '\$', 5)
mySSH.command('cd cmake_targets', '\$', 5)
mySSH.command('mkdir -p build_log_' + self.testCase_id, '\$', 5) mySSH.command('mkdir -p build_log_' + self.testCase_id, '\$', 5)
mySSH.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5) mySSH.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5)
#mySSH.close()
mySSH.command('cd /tmp/CI-eNB/cmake_targets', '\$', 5) mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
mySSH.command('rm -f build_log_' + self.testCase_id + '.zip || true', '\$', 5)
if (os.path.isfile('./build_log_' + self.testCase_id + '.zip')): if (os.path.isfile('./build_log_' + self.testCase_id + '.zip')):
os.remove('./build_log_' + self.testCase_id + '.zip') os.remove('./build_log_' + self.testCase_id + '.zip')
if (os.path.isdir('./build_log_' + self.testCase_id)):
shutil.rmtree('./build_log_' + self.testCase_id)
mySSH.command('zip -r -qq build_log_' + self.testCase_id + '.zip build_log_' + self.testCase_id, '\$', 5) mySSH.command('zip -r -qq build_log_' + self.testCase_id + '.zip build_log_' + self.testCase_id, '\$', 5)
mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/build_log_' + self.testCase_id + '.zip', '.') mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/build_log_' + self.testCase_id + '.zip', '.')
#mySSH.command('rm -f build_log_' + self.testCase_id + '.zip','\$', 5) mySSH.command('rm -f build_log_' + self.testCase_id + '.zip','\$', 5)
mySSH.close() mySSH.close()
ZipFile('build_log_' + self.testCase_id + '.zip').extractall('.') ZipFile('build_log_' + self.testCase_id + '.zip').extractall('.')
...@@ -328,9 +332,16 @@ class Containerize(): ...@@ -328,9 +332,16 @@ class Containerize():
files[fil] = errorandwarnings files[fil] = errorandwarnings
self.collectInfo[image] = files self.collectInfo[image] = files
if status:
logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m') logging.info('\u001B[1m Building OAI Image(s) Pass\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.imageKind, 'OK', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(self.collectInfo, self.allImagesSize) HTML.CreateHtmlNextTabHeaderTestRow(self.collectInfo, self.allImagesSize)
else:
logging.error('\u001B[1m Building OAI Images Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.imageKind, 'KO', CONST.ALL_PROCESSES_OK)
HTML.CreateHtmlNextTabHeaderTestRow(self.collectInfo, self.allImagesSize)
HTML.CreateHtmlTabFooter(False)
sys.exit(1)
def DeployObject(self, HTML, EPC): def DeployObject(self, HTML, EPC):
if self.eNB_serverId[self.eNB_instance] == '0': if self.eNB_serverId[self.eNB_instance] == '0':
......
This diff is collapsed.
This diff is collapsed.
#/*
# * 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
# */
#---------------------------------------------------------------------
# Python for CI of OAI-eNB + COTS-UE
#
# Required Python Version
# Python 3.x
#
# Required Python Package
# pexpect
#---------------------------------------------------------------------
#-----------------------------------------------------------
# Import Libs
#-----------------------------------------------------------
import sys # arg
import re # reg
import os
import subprocess
class SplitReport():
def __init__(self):
self.logfilename = ''
self.destinationFolder = ''
def split(self):
self.destinationFolder = self.logfilename.replace(".log","")
if os.path.isfile(self.logfilename):
newImageLog = open(self.logfilename + '.new', 'w')
copyFlag = True
with open(self.logfilename, 'r') as imageLog:
for line in imageLog:
header = False
ret = re.search('====== Start of log for ([0-9\.A-Za-z\-\_]+) ======', line)
if ret is not None:
copyFlag = False
header = True
detailedLogFile = open(self.destinationFolder + '/' + ret.group(1), 'w')
if copyFlag:
newImageLog.write(line)
ret = re.search('====== End of log for ([0-9\.A-Za-z\-\_]+) ======', line)
if ret is not None:
copyFlag = True
detailedLogFile.close()
elif not copyFlag and not header:
detailedLogFile.write(line)
imageLog.close()
newImageLog.close()
os.rename(self.logfilename + '.new', self.logfilename)
else:
print('Cannot split unfound file')
#--------------------------------------------------------------------------------------------------------
#
# Start of main
#
#--------------------------------------------------------------------------------------------------------
argvs = sys.argv
argc = len(argvs)
SP = SplitReport()
while len(argvs) > 1:
myArgv = argvs.pop(1)
if re.match('^\-\-logfilename=(.+)$', myArgv, re.IGNORECASE):
matchReg = re.match('^\-\-logfilename=(.+)$', myArgv, re.IGNORECASE)
SP.logfilename = matchReg.group(1)
SP.split()
sys.exit(0)
...@@ -239,6 +239,7 @@ class RANManagement(): ...@@ -239,6 +239,7 @@ class RANManagement():
while (count > 0) and buildOAIprocess: while (count > 0) and buildOAIprocess:
mySSH.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 6) mySSH.command('ps aux | grep --color=never build_ | grep -v grep', '\$', 6)
result = re.search('build_oai', mySSH.getBefore()) result = re.search('build_oai', mySSH.getBefore())
print(result)
if result is None: if result is None:
buildOAIprocess = False buildOAIprocess = False
else: else:
...@@ -464,7 +465,7 @@ class RANManagement(): ...@@ -464,7 +465,7 @@ class RANManagement():
self.prematureExit = True self.prematureExit = True
return return
else: else:
mySSH.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Starting"', '\$', 4) mySSH.command('stdbuf -o0 cat enb_' + self.testCase_id + '.log | egrep --text --color=never -i "wait|sync|Starting|Started"', '\$', 4)
if rruCheck: if rruCheck:
result = re.search('wait RUs', mySSH.getBefore()) result = re.search('wait RUs', mySSH.getBefore())
else: else:
......
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>build-tab</htmlTabRef>
<htmlTabName>Build</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
000001 000002
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>Build_eNB</class>
<desc>Build eNB</desc>
<Build_eNB_args>--eNB -t benetel4g -w None</Build_eNB_args>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
</testCase>
<testCase id="000002">
<class>Build_eNB</class>
<desc>Build gNB</desc>
<Build_eNB_args>--gNB -t benetel5g -w None</Build_eNB_args>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
<eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId>
</testCase>
</testCaseList>
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>TEST-FR1-TM1</htmlTabRef>
<htmlTabName>FR1</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<TestCaseRequestedList>
010000
030000
040000
010001
000001
050000
050001
000001
060000
060001
000001
070000
070001
010002
000001
080001
080000
010003
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="010000">
<class>Initialize_UE</class>
<desc>Initialize UE</desc>
</testCase>
<testCase id="010003">
<class>Terminate_UE</class>
<desc>Terminate UE</desc>
</testCase>
<testCase id="010001">
<class>Attach_UE</class>
<desc>Attach UE</desc>
</testCase>
<testCase id="010002">
<class>Detach_UE</class>
<desc>Detach UE</desc>
</testCase>
<testCase id="030000">
<class>Initialize_eNB</class>
<desc>Initialize eNB</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/benetel-4g.conf</Initialize_eNB_args>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<air_interface>lte</air_interface>
</testCase>
<testCase id="040000">
<class>Initialize_eNB</class>
<desc>Initialize gNB</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/benetel-5g.conf</Initialize_eNB_args>
<eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId>
<air_interface>nr</air_interface>
</testCase>
<testCase id="000001">
<class>IdleSleep</class>
<desc>Sleep</desc>
<idle_sleep_time_in_sec>20</idle_sleep_time_in_sec>
</testCase>
<testCase id="050000">
<class>Ping</class>
<desc>Ping: 20pings in 20sec</desc>
<ping_args>-c 20</ping_args>
<ping_packetloss_threshold>50</ping_packetloss_threshold>
</testCase>
<testCase id="050001">
<class>Ping</class>
<desc>Ping: 100pings in 20sec</desc>
<ping_args>-c 100 -i 0.2</ping_args>
<ping_packetloss_threshold>50</ping_packetloss_threshold>
</testCase>
<testCase id="060000">
<class>Iperf</class>
<desc>iperf (DL/2.5Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 2.5M -t 60 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="060001">
<class>Iperf</class>
<desc>iperf (UL/1.5Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 1.5M -t 60 -i 1 -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070000">
<class>Iperf</class>
<desc>iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)</desc>
<iperf_args>-u -b 20M -t 20 -i 1</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070001">
<class>Iperf</class>
<desc>iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)</desc>
<iperf_args>-u -b 3M -t 20 -i 1 -R</iperf_args>
<iperf_packetloss_threshold>50</iperf_packetloss_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="080000">
<class>Terminate_eNB</class>
<desc>Terminate eNB</desc>
<eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId>
<air_interface>lte</air_interface>
</testCase>
<testCase id="080001">
<class>Terminate_eNB</class>
<desc>Terminate gNB</desc>
<eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId>
<air_interface>nr</air_interface>
</testCase>
</testCaseList>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
--> -->
<testCaseList> <testCaseList>
<htmlTabRef>build-tab</htmlTabRef> <htmlTabRef>build-tab</htmlTabRef>
<htmlTabName>Build</htmlTabName> <htmlTabName>Build Container Images</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon> <htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList> <TestCaseRequestedList>
000001 000001
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<testCase id="000001"> <testCase id="000001">
<class>Build_Image</class> <class>Build_Image</class>
<desc>Build eNB Image</desc> <desc>Build all Images</desc>
<kind>all</kind> <kind>all</kind>
<eNB_instance>0</eNB_instance> <eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId> <eNB_serverId>0</eNB_serverId>
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
<eNB_instance>0</eNB_instance> <eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId> <eNB_serverId>0</eNB_serverId>
<backgroundBuild>True</backgroundBuild> <backgroundBuild>True</backgroundBuild>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase> </testCase>
<testCase id="000004"> <testCase id="000004">
...@@ -53,6 +54,7 @@ ...@@ -53,6 +54,7 @@
<eNB_instance>1</eNB_instance> <eNB_instance>1</eNB_instance>
<eNB_serverId>1</eNB_serverId> <eNB_serverId>1</eNB_serverId>
<backgroundBuild>True</backgroundBuild> <backgroundBuild>True</backgroundBuild>
<forced_workspace_cleanup>True</forced_workspace_cleanup>
</testCase> </testCase>
<testCase id="000003"> <testCase id="000003">
......
...@@ -926,6 +926,9 @@ set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidd ...@@ -926,6 +926,9 @@ set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidd
# Benetel 4G library # Benetel 4G library
###################################################################### ######################################################################
include_directories ("/usr/include/dpdk")
set(HWLIB_BENETEL_4G_SOURCE set(HWLIB_BENETEL_4G_SOURCE
${OPENAIR_TARGETS}/ARCH/ETHERNET/benetel/4g/benetel.c ${OPENAIR_TARGETS}/ARCH/ETHERNET/benetel/4g/benetel.c
${OPENAIR_TARGETS}/ARCH/ETHERNET/benetel/4g/shared_buffers.c ${OPENAIR_TARGETS}/ARCH/ETHERNET/benetel/4g/shared_buffers.c
......
...@@ -48,8 +48,9 @@ DEADLINE_SCHEDULER_FLAG_USER="" ...@@ -48,8 +48,9 @@ DEADLINE_SCHEDULER_FLAG_USER=""
CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False CPU_AFFINITY_FLAG_USER="False" #Only valid when low-latency flag is set to False
REL="Rel15" REL="Rel15"
HW="None" HW="None"
TP="None" TP="Ethernet"
EPC=0 EPC=0
VERBOSE_CI=0
VERBOSE_COMPILE=0 VERBOSE_COMPILE=0
CFLAGS_PROCESSOR_USER="" CFLAGS_PROCESSOR_USER=""
RUN_GROUP=0 RUN_GROUP=0
...@@ -292,6 +293,9 @@ function main() { ...@@ -292,6 +293,9 @@ function main() {
esac esac
echo_info "Setting hardware to: $HW" echo_info "Setting hardware to: $HW"
shift 2;; shift 2;;
-t | --transport)
TP=$2
shift 2;;
-P | --phy_simulators) -P | --phy_simulators)
SIMUS_PHY=1 SIMUS_PHY=1
echo_info "Will compile dlsim, ulsim, ..." echo_info "Will compile dlsim, ulsim, ..."
...@@ -327,6 +331,10 @@ function main() { ...@@ -327,6 +331,10 @@ function main() {
HWLAT_TEST=1 HWLAT_TEST=1
echo_info "Will compile hw latency test program" echo_info "Will compile hw latency test program"
shift;; shift;;
--verbose-ci)
VERBOSE_CI=1
echo_info "Will compile with verbose instructions in CI Docker env"
shift;;
--verbose-compile) --verbose-compile)
VERBOSE_COMPILE=1 VERBOSE_COMPILE=1
echo_info "Will compile with verbose instructions" echo_info "Will compile with verbose instructions"
...@@ -940,6 +948,7 @@ function main() { ...@@ -940,6 +948,7 @@ function main() {
echo_info "Building transport protocol libraries" echo_info "Building transport protocol libraries"
rm -f liboai_transpro.so rm -f liboai_transpro.so
rm -f $dbin/liboai_transpro.so rm -f $dbin/liboai_transpro.so
if [ "$TP" == "Ethernet" ]; then
compilations \ compilations \
$build_dir oai_eth_transpro \ $build_dir oai_eth_transpro \
liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL liboai_eth_transpro.so $dbin/liboai_eth_transpro.so.$REL
...@@ -947,6 +956,23 @@ function main() { ...@@ -947,6 +956,23 @@ function main() {
ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so ln -sf $dbin/liboai_eth_transpro.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to ETHERNET transport" echo_info "liboai_transpro.so is linked to ETHERNET transport"
fi fi
if [ "$TP" == "benetel4g" ]; then
compilations \
$build_dir benetel_4g \
libbenetel_4g.so $dbin/libbenetel_4g.$REL
ln -sf libbenetel_4g.so liboai_transpro.so
ln -sf $dbin/libbenetel_4g.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to BENETEL4G transport"
fi
if [ "$TP" == "benetel5g" ]; then
compilations \
$build_dir benetel_5g \
libbenetel_5g.so $dbin/libbenetel_5g.$REL
ln -sf libbenetel_5g.so liboai_transpro.so
ln -sf $dbin/libbenetel_5g.so.$REL $dbin/liboai_transpro.so
echo_info "liboai_transpro.so is linked to BENETEL4G transport"
fi
fi
fi fi
################### ###################
......
...@@ -41,7 +41,7 @@ KERNEL_VERSION=$(uname -r | cut -d '.' -f1) ...@@ -41,7 +41,7 @@ KERNEL_VERSION=$(uname -r | cut -d '.' -f1)
KERNEL_MAJOR=$(uname -r | cut -d '.' -f2) KERNEL_MAJOR=$(uname -r | cut -d '.' -f2)
#check if we run inside a container #check if we run inside a container
IS_CONTAINER=`egrep -c "docker|podman|kubepods" /proc/self/cgroup || true` IS_CONTAINER=`egrep -c "docker|podman|kubepods|libpod|buildah" /proc/self/cgroup || true`
#sudo is not needed when we are root #sudo is not needed when we are root
if [ "$UID" = 0 ] if [ "$UID" = 0 ]
then then
...@@ -221,6 +221,11 @@ compilations() { ...@@ -221,6 +221,11 @@ compilations() {
ret=$? ret=$?
} > $dlog/$2.$REL.txt 2>&1 } > $dlog/$2.$REL.txt 2>&1
set -e set -e
if [ "$VERBOSE_CI" == "1" ]; then
echo_info "====== Start of log for $2.$REL.txt ======"
cat $dlog/$2.$REL.txt
echo_info "====== End of log for $2.$REL.txt ======"
fi
if [[ $ret -ne 0 ]]; then if [[ $ret -ne 0 ]]; then
check_warnings "$dlog/$2.$REL.txt" check_warnings "$dlog/$2.$REL.txt"
check_errors "$dlog/$2.$REL.txt" check_errors "$dlog/$2.$REL.txt"
...@@ -359,10 +364,10 @@ check_install_usrp_uhd_driver(){ ...@@ -359,10 +364,10 @@ check_install_usrp_uhd_driver(){
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
if [ $IS_CONTAINER -eq 0 ] if [ $IS_CONTAINER -eq 0 ]
then then
$SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils cmake $SUDO $INSTALLER -y install python boost libusb-devel libusbx-devel boost-devel python-mako python-docutils $CMAKE
$SUDO -H pip install requests $SUDO -H pip install requests
else else
$SUDO $INSTALLER -y install boost boost-devel cmake3 $SUDO $INSTALLER -y install boost boost-devel $CMAKE
$SUDO pip3 install mako requests $SUDO pip3 install mako requests
fi fi
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
...@@ -488,7 +493,7 @@ install_soapy_from_source(){ ...@@ -488,7 +493,7 @@ install_soapy_from_source(){
#git checkout tags/release_003_010_001_001 #git checkout tags/release_003_010_001_001
mkdir -p build mkdir -p build
cd build cd build
cmake ../ $CMAKE ../
echo "Compiling SoapyRemote" echo "Compiling SoapyRemote"
make -j`nproc` make -j`nproc`
$SUDO make install $SUDO make install
...@@ -507,7 +512,7 @@ install_soapy_iris_from_source(){ ...@@ -507,7 +512,7 @@ install_soapy_iris_from_source(){
cd sklk-soapyiris cd sklk-soapyiris
mkdir -p build mkdir -p build
cd build cd build
cmake ../ $CMAKE ../
echo "Compiling SoapyIris" echo "Compiling SoapyIris"
make -j`nproc` make -j`nproc`
$SUDO make install $SUDO make install
...@@ -684,7 +689,7 @@ check_install_oai_software() { ...@@ -684,7 +689,7 @@ check_install_oai_software() {
automake \ automake \
bison \ bison \
build-essential \ build-essential \
cmake \ $CMAKE \
cmake-curses-gui \ cmake-curses-gui \
ninja-build \ ninja-build \
doxygen \ doxygen \
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
/* maximum size of a message - increase if needed */ /* maximum size of a message - increase if needed */
#if BASIC_SIMULATOR #if BASIC_SIMULATOR
/* let's have 100 RBs functional for the basic simulator */ /* let's have 100 RBs functional for the basic simulator */
# define T_BUFFER_MAX (1024*64*2) # define T_BUFFER_MAX (1024*64*4)
#else #else
# define T_BUFFER_MAX (1024*64*2) # define T_BUFFER_MAX (1024*64*4)
#endif #endif
/* size of the local cache for messages (must be pow(2,something)) */ /* size of the local cache for messages (must be pow(2,something)) */
......
...@@ -93,6 +93,10 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ ...@@ -93,6 +93,10 @@ ID = GNB_PHY_PUCCH_PUSCH_IQ
DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done DESC = gNodeB input data in the frequency domain for a slot where some PUCCH or PUSCH detection was done
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : buffer,rxdataF FORMAT = int,frame : int,slot : buffer,rxdataF
ID = GNB_PHY_PRACH_INPUT_SIGNAL
DESC = gNodeB input data in the time domain for slots with PRACH detection
GROUP = ALL:PHY:GRAPHIC:HEAVY:GNB
FORMAT = int,frame : int,slot : int,antenna : buffer,rxdata
#MAC logs #MAC logs
ID = ENB_MAC_UE_DL_SDU ID = ENB_MAC_UE_DL_SDU
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM localhost/ran-build:latest AS enb-build FROM localhost/ran-build:latest AS enb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --eNB --ninja -w USRP ./build_oai --eNB --ninja -w USRP --verbose-ci
# debug # debug
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15 #RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-softmodem.Rel15
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM ran-build:latest AS enb-build FROM ran-build:latest AS enb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --eNB --ninja -w USRP ./build_oai --eNB --ninja -w USRP --verbose-ci
RUN apt-get install -y python3-pip && \ RUN apt-get install -y python3-pip && \
pip3 install --ignore-installed pyyaml && \ pip3 install --ignore-installed pyyaml && \
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM localhost/ran-build:latest AS gnb-build FROM localhost/ran-build:latest AS gnb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --gNB --ninja -w USRP ./build_oai --gNB --ninja -w USRP --verbose-ci
#debug #debug
#RUN ldconfig -v #RUN ldconfig -v
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM ran-build:latest AS gnb-build FROM ran-build:latest AS gnb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --gNB --ninja -w USRP ./build_oai --gNB --ninja -w USRP --verbose-ci
#debug #debug
RUN ldconfig -v RUN ldconfig -v
......
...@@ -27,15 +27,15 @@ ...@@ -27,15 +27,15 @@
FROM localhost/ran-build:latest AS lte-ue-build FROM localhost/ran-build:latest AS lte-ue-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --UE --ninja -w USRP ./build_oai --UE --ninja -w USRP --verbose-ci
# debug # debug
#RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-uesoftmodem.Rel15 #RUN ldconfig -v && ldd /oai-ran/targets/bin/lte-uesoftmodem.Rel15
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM ran-build:latest AS lte-ue-build FROM ran-build:latest AS lte-ue-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --UE --ninja -w USRP ./build_oai --UE --ninja -w USRP --verbose-ci
# debug # debug
#RUN ldconfig -v #RUN ldconfig -v
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM localhost/ran-build:latest AS nr-ue-build FROM localhost/ran-build:latest AS nr-ue-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --nrUE --ninja -w USRP ./build_oai --nrUE --ninja -w USRP --verbose-ci
# debug # debug
#RUN ldconfig -v #RUN ldconfig -v
......
...@@ -27,14 +27,15 @@ ...@@ -27,14 +27,15 @@
FROM ran-build:latest AS nr-ue-build FROM ran-build:latest AS nr-ue-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran WORKDIR /oai-ran
COPY . .
#run build_oai to build the target image #run build_oai to build the target image
RUN /bin/sh oaienv && \ RUN /bin/sh oaienv && \
cd cmake_targets && \ cd cmake_targets && \
rm -Rf log && \
mkdir -p log && \ mkdir -p log && \
./build_oai --nrUE --ninja -w USRP ./build_oai --nrUE --ninja -w USRP --verbose-ci
# debug # debug
#RUN ldconfig -v #RUN ldconfig -v
......
...@@ -1343,6 +1343,10 @@ void *ru_thread( void *param ) { ...@@ -1343,6 +1343,10 @@ void *ru_thread( void *param ) {
int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST); int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST);
uint8_t prachStartSymbol,N_dur; uint8_t prachStartSymbol,N_dur;
if (prach_id>=0) { if (prach_id>=0) {
T(T_GNB_PHY_PRACH_INPUT_SIGNAL, T_INT(proc->frame_rx), T_INT(proc->tti_rx), T_INT(0),
T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx-1,fp,0)]/*-ru->N_TA_offset*/, fp->get_samples_per_slot(proc->tti_rx,fp)*4*2));
N_dur = get_nr_prach_duration(ru->prach_list[prach_id].fmt); N_dur = get_nr_prach_duration(ru->prach_list[prach_id].fmt);
/* /*
get_nr_prach_info_from_index(ru->config.prach_config.prach_ConfigurationIndex.value, get_nr_prach_info_from_index(ru->config.prach_config.prach_ConfigurationIndex.value,
......
...@@ -171,6 +171,9 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -171,6 +171,9 @@ void rx_nr_prach_ru(RU_t *ru,
int16_t *prach[ru->nb_rx]; int16_t *prach[ru->nb_rx];
int prach_sequence_length = ru->config.prach_config.prach_sequence_length.value; int prach_sequence_length = ru->config.prach_config.prach_sequence_length.value;
int msg1_frequencystart = ru->config.prach_config.num_prach_fd_occasions_list[numRA].k1.value;
int sample_offset_slot = (prachStartSymbol==0?0:fp->ofdm_symbol_size*prachStartSymbol+fp->nb_prefix_samples0+fp->nb_prefix_samples*(prachStartSymbol-1)); int sample_offset_slot = (prachStartSymbol==0?0:fp->ofdm_symbol_size*prachStartSymbol+fp->nb_prefix_samples0+fp->nb_prefix_samples*(prachStartSymbol-1));
//to be checked for mu=0; //to be checked for mu=0;
...@@ -192,7 +195,8 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -192,7 +195,8 @@ void rx_nr_prach_ru(RU_t *ru,
int16_t *prach2; int16_t *prach2;
if (prach_sequence_length == 0) { if (prach_sequence_length == 0) {
LOG_D(PHY,"PRACH (ru %d) in %d.%d, format %d\n", ru->idx,frame,slot2,prachFormat); LOG_D(PHY,"PRACH (ru %d) in %d.%d, format %d, msg1_frequencyStart %d\n",
ru->idx,frame,slot2,prachFormat,msg1_frequencystart);
AssertFatal(prachFormat<4,"Illegal prach format %d for length 839\n",prachFormat); AssertFatal(prachFormat<4,"Illegal prach format %d for length 839\n",prachFormat);
switch (prachFormat) { switch (prachFormat) {
case 0: case 0:
...@@ -214,8 +218,8 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -214,8 +218,8 @@ void rx_nr_prach_ru(RU_t *ru,
} }
} }
else { else {
LOG_D(PHY,"PRACH (ru %d) in %d.%d, format %s,startSymbol %d\n", LOG_D(PHY,"PRACH (ru %d) in %d.%d, format %s, msg1_frequencyStart %d,startSymbol %d\n",
ru->idx,frame,slot,prachfmt[prachFormat],prachStartSymbol); ru->idx,frame,slot,prachfmt[prachFormat],msg1_frequencystart,prachStartSymbol);
switch (prachFormat) { switch (prachFormat) {
case 4: //A1 case 4: //A1
...@@ -280,15 +284,15 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -280,15 +284,15 @@ void rx_nr_prach_ru(RU_t *ru,
K=1; K=1;
kbar=2; kbar=2;
} }
int n_ra_prb = msg1_frequencystart;
int k1 = (int16_t)ru->config.prach_config.num_prach_fd_occasions_list[numRA].k1.value; int k = (12*n_ra_prb) - 6*fp->N_RB_UL;
int N_ZC = (prach_sequence_length==0)?839:139; int N_ZC = (prach_sequence_length==0)?839:139;
if (k1<0) k1+=(fp->ofdm_symbol_size); if (k<0) k+=(fp->ofdm_symbol_size);
k1*=K; k*=K;
k1+=kbar; k+=kbar;
int reps=1; int reps=1;
...@@ -649,7 +653,7 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -649,7 +653,7 @@ void rx_nr_prach_ru(RU_t *ru,
int16_t rxsigF_tmp[N_ZC<<1]; int16_t rxsigF_tmp[N_ZC<<1];
// if (k+N_ZC > dftlen) { // PRACH signal is split around DC // if (k+N_ZC > dftlen) { // PRACH signal is split around DC
int16_t *rxsigF2=rxsigF[aa]; int16_t *rxsigF2=rxsigF[aa];
int k2=k1<<1; int k2=k<<1;
for (int j=0;j<N_ZC<<1;j++,k2++) { for (int j=0;j<N_ZC<<1;j++,k2++) {
if (k2==(dftlen<<1)) k2=0; if (k2==(dftlen<<1)) k2=0;
...@@ -681,6 +685,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -681,6 +685,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
uint16_t rootSequenceIndex; uint16_t rootSequenceIndex;
int numrootSequenceIndex; int numrootSequenceIndex;
uint8_t restricted_set; uint8_t restricted_set;
uint8_t n_ra_prb=0xFF;
int16_t *prachF=NULL; int16_t *prachF=NULL;
int nb_rx; int nb_rx;
...@@ -715,6 +720,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -715,6 +720,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
numrootSequenceIndex = cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].num_root_sequences.value; numrootSequenceIndex = cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].num_root_sequences.value;
NCS = prach_pdu->num_cs;//cfg->num_prach_fd_occasions_list[0].prach_zero_corr_conf.value; NCS = prach_pdu->num_cs;//cfg->num_prach_fd_occasions_list[0].prach_zero_corr_conf.value;
int prach_sequence_length = cfg->prach_sequence_length.value; int prach_sequence_length = cfg->prach_sequence_length.value;
int msg1_frequencystart = cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].k1.value;
// int num_unused_root_sequences = cfg->num_prach_fd_occasions_list[0].num_unused_root_sequences.value; // int num_unused_root_sequences = cfg->num_prach_fd_occasions_list[0].num_unused_root_sequences.value;
// cfg->num_prach_fd_occasions_list[0].unused_root_sequences_list // cfg->num_prach_fd_occasions_list[0].unused_root_sequences_list
...@@ -728,8 +734,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -728,8 +734,7 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
prach_ifft = gNB->prach_vars.prach_ifft; prach_ifft = gNB->prach_vars.prach_ifft;
prachF = gNB->prach_vars.prachF; prachF = gNB->prach_vars.prachF;
if (LOG_DEBUGFLAG(PRACH)){ if (LOG_DEBUGFLAG(PRACH)){
if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for subframe %d, rootSequenceIndex %d\n", if ((frame&1023) < 20) LOG_D(PHY,"PRACH (gNB) : running rx_prach for subframe %d, msg1_frequencystart %d, rootSequenceIndex %d\n", subframe,msg1_frequencystart,rootSequenceIndex);
subframe, rootSequenceIndex);
} }
start_meas(&gNB->rx_prach); start_meas(&gNB->rx_prach);
...@@ -931,13 +936,14 @@ void rx_nr_prach(PHY_VARS_gNB *gNB, ...@@ -931,13 +936,14 @@ void rx_nr_prach(PHY_VARS_gNB *gNB,
if (LOG_DUMPFLAG(PRACH)) { if (LOG_DUMPFLAG(PRACH)) {
//int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840)); //int en = dB_fixed(signal_energy((int32_t*)&rxsigF[0][0],840));
// if (en>60) { // if (en>60) {
int k1 = (int16_t)cfg->num_prach_fd_occasions_list[prach_pdu->num_ra].k1.value; int k = (12*n_ra_prb) - 6*fp->N_RB_UL;
if (k<0) k+=fp->ofdm_symbol_size;
if (k1<0) k1+=fp->ofdm_symbol_size; k*=12;
k+=13;
k*=2;
k1*=12;
k1+=13;
k1*=2;
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1); LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1); LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
......
...@@ -71,7 +71,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -71,7 +71,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
int16_t Ncp = 0, amp, *prach, *prach2, *prachF, *Xu; int16_t Ncp = 0, amp, *prach, *prach2, *prachF, *Xu;
int32_t Xu_re, Xu_im; int32_t Xu_re, Xu_im;
int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, k1, prachStartSymbol, sample_offset_slot; int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, n_ra_prb, k, prachStartSymbol, sample_offset_slot;
//int restricted_Type; //int restricted_Type;
prach = prach_tmp; prach = prach_tmp;
...@@ -83,6 +83,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -83,6 +83,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
mu = nrUE_config->prach_config.prach_sub_c_spacing; mu = nrUE_config->prach_config.prach_sub_c_spacing;
restricted_set = prach_pdu->restricted_set; restricted_set = prach_pdu->restricted_set;
rootSequenceIndex = prach_pdu->root_seq_id; rootSequenceIndex = prach_pdu->root_seq_id;
n_ra_prb = prach_pdu->freq_msg1;
NCS = prach_pdu->num_cs; NCS = prach_pdu->num_cs;
prach_fmt_id = prach_pdu->prach_format; prach_fmt_id = prach_pdu->prach_format;
preamble_index = prach_resources->ra_PreambleIndex; preamble_index = prach_resources->ra_PreambleIndex;
...@@ -92,7 +93,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -92,7 +93,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
first_nonzero_root_idx = 0; first_nonzero_root_idx = 0;
kbar = 1; kbar = 1;
K = 24; K = 24;
k1 = (int16_t)prach_pdu->freq_msg1; k = 12*n_ra_prb - 6*fp->N_RB_UL;
prachStartSymbol = prach_pdu->prach_start_symbol; prachStartSymbol = prach_pdu->prach_start_symbol;
//restricted_Type = 0; //restricted_Type = 0;
...@@ -184,7 +185,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -184,7 +185,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
// now generate PRACH signal // now generate PRACH signal
#ifdef NR_PRACH_DEBUG #ifdef NR_PRACH_DEBUG
if (NCS>0) if (NCS>0)
LOG_I(PHY, "PRACH [UE %d] generate PRACH in slot %d for RootSeqIndex %d, Preamble Index %d, PRACH Format %s, NCS %d (N_ZC %d): Preamble_offset %d, Preamble_shift %dn", LOG_I(PHY, "PRACH [UE %d] generate PRACH in slot %d for RootSeqIndex %d, Preamble Index %d, PRACH Format %s, NCS %d (N_ZC %d): Preamble_offset %d, Preamble_shift %d msg1 frequency start %d\n",
Mod_id, Mod_id,
slot, slot,
rootSequenceIndex, rootSequenceIndex,
...@@ -193,7 +194,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -193,7 +194,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
NCS, NCS,
N_ZC, N_ZC,
preamble_offset, preamble_offset,
preamble_shift); preamble_shift,
n_ra_prb);
#endif #endif
// nsymb = (frame_parms->Ncp==0) ? 14:12; // nsymb = (frame_parms->Ncp==0) ? 14:12;
...@@ -207,16 +209,17 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -207,16 +209,17 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
kbar = 2; kbar = 2;
} }
if (k1<0) if (k<0)
k1 += fp->ofdm_symbol_size; k += fp->ofdm_symbol_size;
k1 *= K; k *= K;
k1 += kbar; k += kbar;
k1 *= 2; k *= 2;
LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id, LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d, preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id,
slot, slot,
k1, k,
n_ra_prb,
preamble_offset, preamble_offset,
first_nonzero_root_idx); first_nonzero_root_idx);
...@@ -341,10 +344,10 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -341,10 +344,10 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
Xu_re = (((int32_t)Xu[offset<<1]*amp)>>15); Xu_re = (((int32_t)Xu[offset<<1]*amp)>>15);
Xu_im = (((int32_t)Xu[1+(offset<<1)]*amp)>>15); Xu_im = (((int32_t)Xu[1+(offset<<1)]*amp)>>15);
prachF[k1++]= ((Xu_re*nr_ru[offset2<<1]) - (Xu_im*nr_ru[1+(offset2<<1)]))>>15; prachF[k++]= ((Xu_re*nr_ru[offset2<<1]) - (Xu_im*nr_ru[1+(offset2<<1)]))>>15;
prachF[k1++]= ((Xu_im*nr_ru[offset2<<1]) + (Xu_re*nr_ru[1+(offset2<<1)]))>>15; prachF[k++]= ((Xu_im*nr_ru[offset2<<1]) + (Xu_re*nr_ru[1+(offset2<<1)]))>>15;
if (k1==dftlen) k1=0; if (k==dftlen) k=0;
} }
#if defined (PRACH_WRITE_OUTPUT_DEBUG) #if defined (PRACH_WRITE_OUTPUT_DEBUG)
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include "SCHED_NR_UE/phy_frame_config_nr.h" #include "SCHED_NR_UE/phy_frame_config_nr.h"
#include "PHY/phy_vars_nr_ue.h" #include "PHY/phy_vars_nr_ue.h"
#include "PHY/NR_REFSIG/refsig_defs_ue.h" #include "PHY/NR_REFSIG/refsig_defs_ue.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/MODULATION/modulation_eNB.h" #include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/MODULATION/modulation_UE.h" #include "PHY/MODULATION/modulation_UE.h"
#include "PHY/INIT/phy_init.h" #include "PHY/INIT/phy_init.h"
...@@ -177,7 +178,7 @@ int main(int argc, char **argv){ ...@@ -177,7 +178,7 @@ int main(int argc, char **argv){
double sigma2, sigma2_dB = 0, SNR, snr0 = -2.0, snr1 = 0.0, ue_speed0 = 0.0, ue_speed1 = 0.0; double sigma2, sigma2_dB = 0, SNR, snr0 = -2.0, snr1 = 0.0, ue_speed0 = 0.0, ue_speed1 = 0.0;
double **s_re, **s_im, **r_re, **r_im, iqim = 0.0, delay_avg = 0, ue_speed = 0, fs, bw; double **s_re, **s_im, **r_re, **r_im, iqim = 0.0, delay_avg = 0, ue_speed = 0, fs, bw;
int i, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1; int i, l, aa, aarx, **txdata, trial, n_frames = 1, prach_start, rx_prach_start; //, ntrials=1;
int N_RB_UL = 106, delay = 0, NCS_config = 13, rootSequenceIndex = 1, threequarter_fs = 0, mu = 1, fd_occasion = 0, loglvl = OAILOG_INFO, numRA = 0, prachStartSymbol = 0; int N_RB_UL = 106, delay = 0, NCS_config = 13, rootSequenceIndex = 1, threequarter_fs = 0, mu = 1, fd_occasion = 0, loglvl = OAILOG_INFO, numRA = 0, prachStartSymbol = 0;
uint8_t snr1set = 0, ue_speed1set = 0, transmission_mode = 1, n_tx = 1, n_rx = 1, awgn_flag = 0, msg1_frequencystart = 0, num_prach_fd_occasions = 1, prach_format=0; uint8_t snr1set = 0, ue_speed1set = 0, transmission_mode = 1, n_tx = 1, n_rx = 1, awgn_flag = 0, msg1_frequencystart = 0, num_prach_fd_occasions = 1, prach_format=0;
uint8_t frame = 1, slot=19, slot_gNB=19, config_index = 98, prach_sequence_length = 1, restrictedSetConfig = 0, N_dur, N_t_slot, start_symbol; uint8_t frame = 1, slot=19, slot_gNB=19, config_index = 98, prach_sequence_length = 1, restrictedSetConfig = 0, N_dur, N_t_slot, start_symbol;
...@@ -808,6 +809,16 @@ int main(int argc, char **argv){ ...@@ -808,6 +809,16 @@ int main(int argc, char **argv){
} }
} }
for (l = 0; l < frame_parms->symbols_per_slot; l++) {
for (aa = 0; aa < frame_parms->nb_antennas_rx; aa++) {
nr_slot_fep_ul(frame_parms,
ru->common.rxdata[aa],
ru->common.rxdataF[aa],
l,
slot,
ru->N_TA_offset);
}
}
rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, prachOccasion, frame, slot); rx_nr_prach_ru(ru, prach_format, numRA, prachStartSymbol, prachOccasion, frame, slot);
...@@ -831,7 +842,8 @@ int main(int argc, char **argv){ ...@@ -831,7 +842,8 @@ int main(int argc, char **argv){
LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1); LOG_M("prachF0.m","prachF0", &gNB->prach_vars.prachF[0], N_ZC, 1, 1);
LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("rxsig0.m","rxs0", &gNB->common_vars.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1); LOG_M("ru_rxsig0.m","rxs0", &ru->common.rxdata[0][subframe*frame_parms->samples_per_subframe], frame_parms->samples_per_subframe, 1, 1);
LOG_M("ru_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1); LOG_M("ru_rxsigF0.m","rxsF0", ru->common.rxdataF[0], frame_parms->ofdm_symbol_size*frame_parms->symbols_per_slot, 1, 1);
LOG_M("ru_prach_rxsigF0.m","rxsF0", ru->prach_rxsigF[0][0], N_ZC, 1, 1);
LOG_M("prach_preamble.m","prachp", &gNB->X_u[0], N_ZC, 1, 1); LOG_M("prach_preamble.m","prachp", &gNB->X_u[0], N_ZC, 1, 1);
LOG_M("ue_prach_preamble.m","prachp", &UE->X_u[0], N_ZC, 1, 1); LOG_M("ue_prach_preamble.m","prachp", &UE->X_u[0], N_ZC, 1, 1);
#endif #endif
......
...@@ -334,12 +334,12 @@ typedef struct { ...@@ -334,12 +334,12 @@ typedef struct {
#define DL_SCH_LCID_CON_RES_ID 0x3E #define DL_SCH_LCID_CON_RES_ID 0x3E
#define DL_SCH_LCID_PADDING 0x3F #define DL_SCH_LCID_PADDING 0x3F
#define UL_SCH_LCID_CCCH 0x00 #define UL_SCH_LCID_CCCH1 0x00
#define UL_SCH_LCID_SRB1 0x01 #define UL_SCH_LCID_SRB1 0x01
#define UL_SCH_LCID_SRB2 0x02 #define UL_SCH_LCID_SRB2 0x02
#define UL_SCH_LCID_SRB3 0x03 #define UL_SCH_LCID_SRB3 0x03
#define UL_SCH_LCID_DTCH 0x04 #define UL_SCH_LCID_DTCH 0x04
#define UL_SCH_LCID_CCCH_48 0x34 #define UL_SCH_LCID_CCCH 0x34
#define UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY 0x35 #define UL_SCH_LCID_RECOMMENDED_BITRATE_QUERY 0x35
#define UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT 0x36 #define UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT 0x36
#define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37 #define UL_SCH_LCID_CONFIGURED_GRANT_CONFIRMATION 0x37
......
...@@ -310,11 +310,8 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, ...@@ -310,11 +310,8 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139; cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
else else
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839; cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
cfg->prach_config.num_prach_fd_occasions_list[i].k1 =
(NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + cfg->prach_config.num_prach_fd_occasions_list[i].k1 = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart +
(get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i))*12 -
6*scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig; cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup, nb_preambles, mac->frame_type, frequency_range); cfg->prach_config.num_prach_fd_occasions_list[i].num_root_sequences = compute_nr_root_seq(scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup, nb_preambles, mac->frame_type, frequency_range);
//cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences = ??? //cfg->prach_config.num_prach_fd_occasions_list[i].num_unused_root_sequences = ???
......
...@@ -208,11 +208,8 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm ...@@ -208,11 +208,8 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839; cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l839;
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.tl.tag = NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG; cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.tl.tag = NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG;
cfg->num_tlv++; cfg->num_tlv++;
cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = cfg->prach_config.num_prach_fd_occasions_list[i].k1.value = NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart + (get_N_RA_RB( cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i);
(NRRIV2PRBOFFSET(scc->uplinkConfigCommon->initialUplinkBWP->genericParameters.locationAndBandwidth, MAX_BWP_SIZE) + //k1= msg1_FrequencyStart + 12 (no. of FDM)(RB for PRACH occasion);
scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.msg1_FrequencyStart +
(get_N_RA_RB(cfg->prach_config.prach_sub_c_spacing.value, scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing ) * i))*12 -
6*scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
cfg->prach_config.num_prach_fd_occasions_list[i].k1.tl.tag = NFAPI_NR_CONFIG_K1_TAG; cfg->prach_config.num_prach_fd_occasions_list[i].k1.tl.tag = NFAPI_NR_CONFIG_K1_TAG;
cfg->num_tlv++; cfg->num_tlv++;
cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig; cfg->prach_config.num_prach_fd_occasions_list[i].prach_zero_corr_conf.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->rach_ConfigGeneric.zeroCorrelationZoneConfig;
......
...@@ -577,7 +577,8 @@ void nr_initiate_ra_proc(module_id_t module_idP, ...@@ -577,7 +577,8 @@ void nr_initiate_ra_proc(module_id_t module_idP,
LOG_D(MAC, "%s() Msg2[%04d%d] SFN/SF:%04d%d\n", __FUNCTION__, ra->Msg2_frame, ra->Msg2_slot, frameP, slotP); LOG_D(MAC, "%s() Msg2[%04d%d] SFN/SF:%04d%d\n", __FUNCTION__, ra->Msg2_frame, ra->Msg2_slot, frameP, slotP);
int loop = 0; int loop = 0;
if (!ra->cfra) { // This condition allows for the usage of a preconfigured rnti for the first UE
if (!ra->cfra || ra->rnti == 0) {
do { do {
ra->rnti = (taus() % 65518) + 1; ra->rnti = (taus() % 65518) + 1;
loop++; loop++;
...@@ -1293,6 +1294,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra ...@@ -1293,6 +1294,7 @@ void nr_generate_Msg4(module_id_t module_idP, int CC_id, frame_t frameP, sub_fra
pdsch_pdu_rel15->rbStart, pdsch_pdu_rel15->rbStart,
pdsch_pdu_rel15->BWPSize); pdsch_pdu_rel15->BWPSize);
dci_payload.format_indicator = 1;
dci_payload.time_domain_assignment.val = time_domain_assignment; dci_payload.time_domain_assignment.val = time_domain_assignment;
dci_payload.vrb_to_prb_mapping.val = 0; dci_payload.vrb_to_prb_mapping.val = 0;
dci_payload.mcs = pdsch_pdu_rel15->mcsIndex[0]; dci_payload.mcs = pdsch_pdu_rel15->mcsIndex[0];
...@@ -1378,14 +1380,13 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram ...@@ -1378,14 +1380,13 @@ void nr_check_Msg4_Ack(module_id_t module_id, int CC_id, frame_t frame, sub_fram
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info; NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
NR_UE_harq_t *harq = &UE_info->UE_sched_ctrl[UE_id].harq_processes[current_harq_pid]; NR_UE_harq_t *harq = &UE_info->UE_sched_ctrl[UE_id].harq_processes[current_harq_pid];
LOG_D(MAC, "ue %d, rnti %d, harq is waiting %d, round %d, frame %d %d, harq id %d\n", UE_id, ra->rnti, harq->is_waiting, harq->round, frame, slot, current_harq_pid); LOG_D(NR_MAC, "ue %d, rnti %d, harq is waiting %d, round %d, frame %d %d, harq id %d\n", UE_id, ra->rnti, harq->is_waiting, harq->round, frame, slot, current_harq_pid);
if (harq->is_waiting == 0) if (harq->is_waiting == 0)
{ {
if (harq->round == 0) if (harq->round == 0)
{ {
nr_clear_ra_proc(module_id, CC_id, frame, ra); nr_clear_ra_proc(module_id, CC_id, frame, ra);
free(ra->preambles.preamble_list);
UE_info->active[UE_id] = true; UE_info->active[UE_id] = true;
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti); LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) Received Ack of RA-Msg4. CBRA procedure succeeded!\n", UE_id, ra->rnti);
} }
......
...@@ -1756,12 +1756,22 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti) ...@@ -1756,12 +1756,22 @@ void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti)
if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1); if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1);
if (rnti_to_remove_count == 10) exit(1); if (rnti_to_remove_count == 10) exit(1);
rnti_to_remove[rnti_to_remove_count] = rnti; rnti_to_remove[rnti_to_remove_count] = rnti;
LOG_W(MAC, "to remove in mac rnti_to_remove[%d]=%d\n", rnti_to_remove_count, rnti); LOG_W(NR_MAC, "to remove in mac rnti_to_remove[%d] = 0x%04x\n", rnti_to_remove_count, rnti);
rnti_to_remove_count++; rnti_to_remove_count++;
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1); if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
} }
} }
void nr_mac_remove_ra_rnti_ue(module_id_t mod_id, rnti_t rnti) {
// Hack to remove UE in the phy (following the same procedure as in function mac_remove_nr_ue)
if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1);
if (rnti_to_remove_count == 10) exit(1);
rnti_to_remove[rnti_to_remove_count] = rnti;
LOG_W(NR_MAC, "to remove in mac rnti_to_remove[%d] = 0x%04x\n", rnti_to_remove_count, rnti);
rnti_to_remove_count++;
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
}
uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) { uint8_t nr_get_tpc(int target, uint8_t cqi, int incr) {
// al values passed to this function are x10 // al values passed to this function are x10
......
...@@ -257,19 +257,7 @@ void nr_process_mac_pdu( ...@@ -257,19 +257,7 @@ void nr_process_mac_pdu(
// todo // todo
break; break;
case UL_SCH_LCID_CCCH: case UL_SCH_LCID_CCCH:
mac_subheader_len = 1; case UL_SCH_LCID_CCCH1:
nr_mac_rrc_data_ind(module_idP,
CC_id,
frameP,
0,
0,
rnti,
CCCH,
pdu_ptr+mac_subheader_len,
pdu_len-mac_subheader_len,
0);
break;
case UL_SCH_LCID_CCCH_48:
mac_subheader_len = 1; mac_subheader_len = 1;
nr_mac_rrc_data_ind(module_idP, nr_mac_rrc_data_ind(module_idP,
CC_id, CC_id,
...@@ -523,6 +511,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -523,6 +511,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if(no_sig) { if(no_sig) {
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state); LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
nr_mac_remove_ra_rnti_ue(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
} else { } else {
...@@ -547,8 +536,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -547,8 +536,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if(ra->cfra) { if(ra->cfra) {
LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CFRA procedure succeeded!\n", UE_id, ra->rnti); LOG_I(NR_MAC, "(ue %i, rnti 0x%04x) CFRA procedure succeeded!\n", UE_id, ra->rnti);
nr_mac_remove_ra_rnti_ue(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
free(ra->preambles.preamble_list);
UE_info->active[UE_id] = true; UE_info->active[UE_id] = true;
} else { } else {
...@@ -586,6 +575,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -586,6 +575,7 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
continue; continue;
LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state); LOG_W(NR_MAC, "Random Access %i failed at state %i\n", i, ra->state);
nr_mac_remove_ra_rnti_ue(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra); nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
} }
} }
......
...@@ -312,6 +312,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon ...@@ -312,6 +312,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *secon
void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti); void mac_remove_nr_ue(module_id_t mod_id, rnti_t rnti);
void nr_mac_remove_ra_rnti_ue(module_id_t mod_id, rnti_t rnti);
int allocate_nr_CCEs(gNB_MAC_INST *nr_mac, int allocate_nr_CCEs(gNB_MAC_INST *nr_mac,
NR_BWP_Downlink_t *bwp, NR_BWP_Downlink_t *bwp,
NR_ControlResourceSet_t *coreset, NR_ControlResourceSet_t *coreset,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment