diff --git a/ci-scripts/Jenkinsfile-GitLab-Container b/ci-scripts/Jenkinsfile-GitLab-Container
index f4b99e7f92..b413617580 100644
--- a/ci-scripts/Jenkinsfile-GitLab-Container
+++ b/ci-scripts/Jenkinsfile-GitLab-Container
@@ -220,6 +220,21 @@ pipeline {
}
}
}
+ stage ("Images Push to Registries") {
+ when { expression {"PUSH".equals(env.gitlabActionType)} }
+ steps {
+ script {
+ triggerSlaveJob ('RAN-DockerHub-Push', 'Push-to-Docker-Hub')
+ }
+ post {
+ failure {
+ script {
+ currentBuild.result = 'FAILURE'
+ }
+ }
+ }
+ }
+ }
}
post {
always {
@@ -247,6 +262,7 @@ pipeline {
echo "This is a MERGE event"
addGitLabMRComment comment: message
}
+ echo "Pipeline is SUCCESSFUL"
}
}
failure {
@@ -256,6 +272,7 @@ pipeline {
echo "This is a MERGE event"
addGitLabMRComment comment: message
}
+ echo "Pipeline FAILED"
}
}
}
diff --git a/ci-scripts/Jenkinsfile-push-registry b/ci-scripts/Jenkinsfile-push-registry
new file mode 100644
index 0000000000..91d6136e0a
--- /dev/null
+++ b/ci-scripts/Jenkinsfile-push-registry
@@ -0,0 +1,86 @@
+#!/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 python executor node shall be in the same subnet as the others servers
+def nodeExecutor = params.nodeExecutor
+
+// Name of the phone resource
+def ciServerResource = params.serverResource
+
+pipeline {
+ agent {
+ label nodeExecutor
+ }
+ options {
+ disableConcurrentBuilds()
+ ansiColor('xterm')
+ lock (ciServerResource)
+ }
+ stages {
+ stage ("Verify Parameters") {
+ steps {
+ script {
+ echo '\u2705 \u001B[32mVerify Parameters\u001B[0m'
+ def allParametersPresent = true
+
+ // It is already to late to check it
+ if (params.nodeExecutor != null) {
+ echo "Docker Push executor node : ${nodeExecutor}"
+ }
+ if (params.serverResource == null) {
+ allParametersPresent = false
+ }
+ }
+ }
+ }
+ stage ("Push to DockerHub") {
+ steps {
+ script {
+ WEEK_TAG = sh returnStdout: true, script: 'date +"%Y.w%U"'
+ WEEK_TAG = WEEK_TAG.trim()
+
+ withCredentials([
+ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.DH_Credentials}", usernameVariable: 'DH_Username', passwordVariable: 'DH_Password']
+ ]) {
+ def listOfImages = ["oai-enb", "oai-gnb", "oai-lte-ue", "oai-nr-ue"]
+ sh "docker login -u ${DH_Username} -p ${DH_Password} > /dev/null 2>&1"
+ listOfImages.eachWithIndex { item, iindex ->
+ sh "docker image tag ${item}:develop ${DH_Username}/${item}:develop"
+ sh "docker image tag ${item}:develop ${DH_Username}/${item}:${WEEK_TAG}"
+ sh "docker push --quiet ${DH_Username}/${item}:${WEEK_TAG}"
+ sh "docker push --quiet ${DH_Username}/${item}:develop"
+ sh "docker rmi ${DH_Username}/${item}:${WEEK_TAG} ${DH_Username}/${item}:develop"
+ }
+ sh "docker logout > /dev/null 2>&1"
+ }
+ }
+ }
+ }
+ }
+ post {
+ always {
+ script {
+ echo "End of Registry Push"
+ }
+ }
+ }
+}
diff --git a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa
index 95aa4046d7..3243d1645d 100644
--- a/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa
+++ b/ci-scripts/Jenkinsfile-tmp-multi-enb-nsa
@@ -265,6 +265,21 @@ pipeline {
if(fileExists("enb.log.${env.BUILD_ID}.zip")) {
archiveArtifacts "enb.log.${env.BUILD_ID}.zip"
}
+ }
+ }
+ }
+ stage('Log Collection (CN)') {
+ steps {
+ withCredentials([
+ [$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.EPC_Credentials}", usernameVariable: 'EPC_Username', passwordVariable: 'EPC_Password']
+ ]) {
+ echo '\u2705 \u001B[32mLog Transfer (CN)\u001B[0m'
+ sh "sshpass -p \'${EPC_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${EPC_Username}@${params.EPC_IPAddress}:${EPC_SourceCodePath}/logs/oai-cn5g.log.zip ./oai-cn5g.log.${env.BUILD_ID}.zip || true"
+ }
+ script {
+ if(fileExists("oai-cn5g.log.${env.BUILD_ID}.zip")) {
+ archiveArtifacts "oai-cn5g.log.${env.BUILD_ID}.zip"
+ }
if(fileExists("ci-scripts/test_results.html")) {
sh "mv ci-scripts/test_results.html test_results-${JOB_NAME}.html"
sh "sed -i -e 's#TEMPLATE_JOB_NAME#${JOB_NAME}#' -e 's@build #TEMPLATE_BUILD_ID@build #${BUILD_ID}@' -e 's#Build-ID: TEMPLATE_BUILD_ID#Build-ID: ${BUILD_ID}#' -e 's#TEMPLATE_STAGE_NAME#${testStageName}#' test_results-${JOB_NAME}.html"
diff --git a/ci-scripts/Jenkinsfile-trig-nsa b/ci-scripts/Jenkinsfile-trig-nsa
index 2dcaf1a04f..40d74f4da0 100644
--- a/ci-scripts/Jenkinsfile-trig-nsa
+++ b/ci-scripts/Jenkinsfile-trig-nsa
@@ -47,30 +47,38 @@ pipeline {
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()
echo "Testing NSA on : ${MR} ${SRC_BRANCH} ${COMMIT_ID}"
- //calling NSA sub job
- build job: "RAN-NSA-Mini-Module", wait : true, propagate : false, parameters: [
+ //calling NSA B200
+ build job: "RAN-NSA-B200-Module-LTEBOX", wait : true, 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))
]
- //calling NSA long sub job
-// build job: "RAN-NSA-Mini-Module-Long", wait : true, 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))
-// ]
- //calling NSA attach/detach job
-// build job: "RAN-NSA-Mini-Module-Attach-Detach", wait : true, 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))
-// ]
+ //calling NSA 2x2
+ build job: "RAN-NSA-2x2-Module-OAIEPC", wait : true, 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))
+ ]
+ //calling LTE 2x2
+ build job: "RAN-LTE-2x2-Module-OAIEPC", wait : true, 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))
+ ]
+ //calling SA
+ build job: "RAN-SA-Module-CN5G", wait : true, 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))
+ ]
}
}
diff --git a/ci-scripts/ci_ueinfra.yaml b/ci-scripts/ci_ueinfra.yaml
index 619e8fba15..51acb75968 100644
--- a/ci-scripts/ci_ueinfra.yaml
+++ b/ci-scripts/ci_ueinfra.yaml
@@ -4,7 +4,9 @@ idefix:
Kind : quectel
Process :
Name : quectel-CM
- Cmd : /home/oaicicd/quectel-CM/quectel-CM -s oai.ipv4 -4
+ Cmd : /home/oaicicd/quectel-CM/quectel-CM -4 -s
+ Apn :
+ ltebox : oai.ipv4
WakeupScript : ci_ctl_qtel.py /dev/ttyUSB2 wup
DetachScript : ci_ctl_qtel.py /dev/ttyUSB2 detach
LogStore : /media/usb-drive/ci_qlogs
@@ -14,22 +16,29 @@ idefix:
HostUsername : oaicicd
HostPassword : oaicicd
HostSourceCodePath : none
+ MTU : 1500
nrmodule2_quectel:
ID: nrmodule2_quectel
State : enabled
Kind : quectel
Process :
Name : quectel-CM
- Cmd : /home/nrmodule2/quectel-CM/quectel-CM -s oai.ipv4 -4
+ Cmd : /home/nrmodule2/quectel-CM/quectel-CM -4 -s
+ Apn :
+ OAICN5G : oai
+ OAI-Rel14-Docker : oai.ipv4
WakeupScript : ci_ctl_qtel.py /dev/ttyUSB7 wup
DetachScript : ci_ctl_qtel.py /dev/ttyUSB7 detach
LogStore : /media/ci_qlogs
- PLMN : 20899
+ PLMN : 20897
UENetwork : wwan1
HostIPAddress : 192.168.18.189
HostUsername : nrmodule2
HostPassword : linux
HostSourceCodePath : none
+ StartCommands :
+ - sudo -S ip link set dev wwan1 mtu 1500
+ MTU : 1500
dummy:
ID: ''
State : ''
diff --git a/ci-scripts/cls_containerize.py b/ci-scripts/cls_containerize.py
index ea09cd0585..ff2b261424 100644
--- a/ci-scripts/cls_containerize.py
+++ b/ci-scripts/cls_containerize.py
@@ -196,6 +196,7 @@ class Containerize():
# the potential merge. Note that merge conflicts should already been checked earlier
imageTag = 'develop'
sharedTag = 'develop'
+ forceSharedImageBuild = False
if (self.ranAllowMerge):
imageTag = 'ci-temp'
if self.ranTargetBranch == '':
@@ -204,6 +205,13 @@ class Containerize():
else:
logging.debug('Merging with the target branch: ' + self.ranTargetBranch)
mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5)
+ mySSH.command('git diff HEAD..origin/develop -- docker/Dockerfile.ran' + self.dockerfileprefix + ' | grep -i INDEX', '\$', 5)
+ result = re.search('index', mySSH.getBefore())
+ if result is not None:
+ forceSharedImageBuild = True
+ sharedTag = 'ci-temp'
+ else:
+ forceSharedImageBuild = True
# if asterix, copy the entitlement and subscription manager configurations
if self.host == 'Red Hat':
@@ -215,13 +223,14 @@ class Containerize():
sharedimage = 'ran-build'
# Let's remove any previous run artifacts if still there
mySSH.command(self.cli + ' image prune --force', '\$', 30)
- if (not self.ranAllowMerge):
- mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + sharedTag, '\$', 30)
+ if forceSharedImageBuild:
+ mySSH.command(self.cli + ' image rm ' + sharedimage + ':' + sharedTag + ' || true', '\$', 30)
for image,pattern in imageNames:
- mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag, '\$', 30)
+ mySSH.command(self.cli + ' image rm ' + image + ':' + imageTag + ' || true', '\$', 30)
# Build the shared image only on Push Events (not on Merge Requests)
- if (not self.ranAllowMerge):
+ # On when the shared image docker file is being modified.
+ if forceSharedImageBuild:
mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --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
diff --git a/ci-scripts/cls_module_ue.py b/ci-scripts/cls_module_ue.py
index 96d4e0310e..74ae9c207e 100644
--- a/ci-scripts/cls_module_ue.py
+++ b/ci-scripts/cls_module_ue.py
@@ -61,7 +61,7 @@ class Module_UE:
#this method checks if the specified Process is running on the server hosting the module
#if not it will be started
- def CheckCMProcess(self):
+ def CheckCMProcess(self,CNType):
HOST=self.HostUsername+'@'+self.HostIPAddress
COMMAND="ps aux | grep " + self.Process['Name'] + " | grep -v grep "
logging.debug(COMMAND)
@@ -76,7 +76,7 @@ class Module_UE:
logging.debug('Starting ' + self.Process['Name'])
mySSH = sshconnection.SSHConnection()
mySSH.open(self.HostIPAddress, self.HostUsername, self.HostPassword)
- mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S ' + self.Process['Cmd'] + ' &','\$',5)
+ mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' &','\$',5)
mySSH.close()
#checking the process
time.sleep(5)
@@ -131,6 +131,33 @@ class Module_UE:
logging.debug('\u001B[1;37;41m Module IP Address Not Found! \u001B[0m')
return -1
+ def CheckModuleMTU(self):
+ HOST=self.HostUsername+'@'+self.HostIPAddress
+ response= []
+ tentative = 3
+ while (len(response)==0) and (tentative>0):
+ COMMAND="ip a show dev " + self.UENetwork + " | grep mtu"
+ logging.debug(COMMAND)
+ ssh = subprocess.Popen(["ssh", "%s" % HOST, COMMAND],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ response = ssh.stdout.readlines()
+ tentative-=1
+ time.sleep(10)
+ if (tentative==0) and (len(response)==0):
+ logging.debug('\u001B[1;37;41m Module NIC MTU Not Found! Time expired \u001B[0m')
+ return -1
+ else: #check response
+ result = re.search('mtu (?P[0-9]+)', response[0].decode("utf-8") )
+ if result is not None:
+ if (result.group('mtu') is not None) and (str(result.group('mtu'))==str(self.MTU)) :
+ logging.debug('\u001B[1mUE Module NIC MTU is ' + str(self.MTU) + ' as expected\u001B[0m')
+ return 0
+ else:
+ logging.debug('\u001B[1;37;41m Incorrect Module NIC MTU ' + str(result.group('mtu')) + '! Expected : ' + str(self.MTU) + '\u001B[0m')
+ return -1
+ else:
+ logging.debug('\u001B[1;37;41m Module NIC MTU Not Found! \u001B[0m')
+ return -1
+
def EnableTrace(self):
if self.ue_trace=="yes":
mySSH = sshconnection.SSHConnection()
diff --git a/ci-scripts/cls_oaicitest.py b/ci-scripts/cls_oaicitest.py
index f1ab8c106f..92a4e8637e 100644
--- a/ci-scripts/cls_oaicitest.py
+++ b/ci-scripts/cls_oaicitest.py
@@ -388,22 +388,45 @@ class OaiCiTest():
#RH
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
Module_UE.ue_trace=ue_trace
- is_module=Module_UE.CheckCMProcess()
+ is_module=Module_UE.CheckCMProcess(EPC.Type)
if is_module:
Module_UE.EnableTrace()
time.sleep(5)
- Module_UE.Command("wup")
- logging.debug("Waiting for IP address to be assigned")
- time.sleep(20)
- logging.debug("Retrieve IP address")
- status=Module_UE.GetModuleIPAddress()
- if status==0:
+
+ # Looping attach / detach / wait to be successful at least once
+ cnt = 0
+ status = -1
+ while cnt < 4:
+ Module_UE.Command("wup")
+ logging.debug("Waiting for IP address to be assigned")
+ time.sleep(20)
+ logging.debug("Retrieve IP address")
+ status=Module_UE.GetModuleIPAddress()
+ if status==0:
+ cnt = 10
+ else:
+ cnt += 1
+ Module_UE.Command("detach")
+ time.sleep(20)
+
+ if cnt == 10 and status == 0:
HTML.CreateHtmlTestRow(Module_UE.UEIPAddress, 'OK', CONST.ALL_PROCESSES_OK)
logging.debug('UE IP addresss : '+ Module_UE.UEIPAddress)
+ #execute additional commands from yaml file after UE attach
+ SSH = sshconnection.SSHConnection()
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ if hasattr(Module_UE,'StartCommands'):
+ for startcommand in Module_UE.StartCommands:
+ cmd = 'echo ' + Module_UE.HostPassword + ' | ' + startcommand
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ #check that the MTU is as expected / requested
+ Module_UE.CheckModuleMTU()
else: #status==-1 failed to retrieve IP address
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.UE_IP_ADDRESS_ISSUE)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE)
return
+
def InitializeOAIUE(self,HTML,RAN,EPC,COTS_UE,InfraUE):
@@ -1033,14 +1056,34 @@ class OaiCiTest():
#Attention, as opposed to InitializeUE, the connect manager process is not checked as it is supposed to be active already
#only 1- module wakeup, 2- check IP address
Module_UE = cls_module_ue.Module_UE(InfraUE.ci_ue_infra[self.ue_id])
- Module_UE.Command("wup")
- logging.debug("Waiting for IP address to be assigned")
- time.sleep(20)
- logging.debug("Retrieve IP address")
- status=Module_UE.GetModuleIPAddress()
- if status==0:
+ status = -1
+ cnt = 0
+ while cnt < 4:
+ Module_UE.Command("wup")
+ logging.debug("Waiting for IP address to be assigned")
+ time.sleep(20)
+ logging.debug("Retrieve IP address")
+ status=Module_UE.GetModuleIPAddress()
+ if status==0:
+ cnt = 10
+ else:
+ cnt += 1
+ Module_UE.Command("detach")
+ time.sleep(20)
+
+ if cnt == 10 and status == 0:
HTML.CreateHtmlTestRow(Module_UE.UEIPAddress, 'OK', CONST.ALL_PROCESSES_OK)
logging.debug('UE IP addresss : '+ Module_UE.UEIPAddress)
+ #execute additional commands from yaml file after UE attach
+ SSH = sshconnection.SSHConnection()
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ if hasattr(Module_UE,'StartCommands'):
+ for startcommand in Module_UE.StartCommands:
+ cmd = 'echo ' + Module_UE.HostPassword + ' | ' + startcommand
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ #check that the MTU is as expected / requested
+ Module_UE.CheckModuleMTU()
else: #status==-1 failed to retrieve IP address
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.UE_IP_ADDRESS_ISSUE)
self.AutoTerminateUEandeNB(HTML,RAN,COTS_UE,EPC,InfraUE)
@@ -1539,6 +1582,8 @@ class OaiCiTest():
#target address is different depending on EPC type
if re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE):
Target = EPC.MmeIPAddress
+ elif re.match('OAICN5G', EPC.Type, re.IGNORECASE):
+ Target = '8.8.8.8'
else:
Target = EPC.IPAddress
#ping from module NIC rather than IP address to make sure round trip is over the air
@@ -1986,7 +2031,7 @@ class OaiCiTest():
if type==0:
result = re.search('(?P[0-9\.]+ [KMG]bits\/sec) +(?P[0-9\.]+ ms) +(?P[0-9]+)/ +(?P[0-9]+)', str(line))
else:
- result = re.search('^\[ \d\].+ +(?P[0-9\.]+ [KMG]bits\/sec) +(?P[0-9\.]+ ms) +(?P[0-9]+)\/(?P[0-9]+)', str(line))
+ result = re.search('^\[\s+\d\].+ (?P[0-9\.]+ [KMG]bits\/sec) +(?P[0-9\.]+ ms) +(?P[0-9]+)\/\s*(?P[0-9]+)', str(line))
if result is not None:
bitrate = result.group('bitrate')
@@ -2230,85 +2275,157 @@ class OaiCiTest():
def Iperf_Module(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC, Module_UE):
- SSH = sshconnection.SSHConnection()
- #RH temporary quick n dirty for test
- SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
- cmd = 'echo ' + EPC.Password + ' | sudo -S ip link set dev tun5 mtu 1358'
- SSH.command(cmd,'\$',5)
- SSH.close()
-
-
- #kill iperf processes before (in case there are still some remaining)
- SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
- cmd = 'killall --signal=SIGKILL iperf'
- SSH.command(cmd,'\$',5)
- SSH.close()
- SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
- cmd = 'killall --signal=SIGKILL iperf'
- SSH.command(cmd,'\$',5)
- SSH.close()
-
-
- iperf_time = self.Iperf_ComputeTime()
- if self.iperf_direction=="DL":
- logging.debug("Iperf for Module in DL mode detected")
- #server side UE
- SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
- cmd = 'rm iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
- SSH.command(cmd,'\$',5)
- cmd = 'echo $USER; nohup /opt/iperf-2.0.10/iperf -s -B ' + UE_IPAddress + ' -u 2>&1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
- SSH.command(cmd,'\$',5)
- SSH.close()
- #client side EPC
+ if (re.match('OAI-Rel14-Docker', EPC.Type, re.IGNORECASE)) or (re.match('OAICN5G', EPC.Type, re.IGNORECASE)):
+ #retrieve trf-gen container IP address
+ SSH = sshconnection.SSHConnection()
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
- cmd = 'rm iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
- SSH.command(cmd,'\$',5)
- cmd = 'iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
- SSH.command(cmd,'\$',int(iperf_time)*5.0)
+ SSH.command('docker inspect --format="TRF_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-trf-gen', '\$', 5)
+ result = re.search('TRF_IP_ADDR = (?P[0-9\.]+)', SSH.getBefore())
+ if result is not None:
+ trf_gen_IP = result.group('trf_ip_addr')
SSH.close()
- #copy the 2 resulting files locally
- SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
- SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
- #send for analysis
- filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
- self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1)
-
- elif self.iperf_direction=="UL":#does not work at the moment
- logging.debug("Iperf for Module in UL mode detected")
- #server side EPC
- SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
- cmd = 'rm iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
- SSH.command(cmd,'\$',5)
- cmd = 'echo $USER; nohup iperf -s -u 2>&1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
- SSH.command(cmd,'\$',5)
- SSH.close()
-
- #client side UE
+ #kill iperf processes on UE side before (in case there are still some remaining)
SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
- cmd = 'rm iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
+ cmd = 'killall --signal=SIGKILL iperf'
SSH.command(cmd,'\$',5)
- SSH.command('/opt/iperf-2.0.10/iperf -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', int(iperf_time)*5.0)
SSH.close()
- #copy the 2 resulting files locally
- SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
- SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
- #send for analysis
- filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
- self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1)
- else :
- logging.debug("Incorrect or missing IPERF direction in XML")
+ iperf_time = self.Iperf_ComputeTime()
+ if self.iperf_direction=="DL":
+ logging.debug("Iperf for Module in DL mode detected")
+ #server side UE
+ server_filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ cmd = 'rm ' + server_filename
+ SSH.command(cmd,'\$',5)
+ cmd = 'echo $USER; nohup iperf -s -B ' + UE_IPAddress + ' -u 2>&1 > ' + server_filename + ' &'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ #client side EPC
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5)
+ iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename
+ cmd = 'docker exec -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"'
+ SSH.command(cmd,'\$',int(iperf_time)*5.0)
+ SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/'+ client_filename + ' ' + EPC.SourceCodePath, '\$', 5)
+ SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + client_filename, '.')
+ SSH.close()
- #kill iperf processes after to be clean
- SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
- cmd = 'killall --signal=SIGKILL iperf'
- SSH.command(cmd,'\$',5)
- SSH.close()
- SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
- cmd = 'killall --signal=SIGKILL iperf'
- SSH.command(cmd,'\$',5)
- SSH.close()
- return
+ #copy the 2 resulting files locally
+ SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, server_filename, '.')
+ SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, client_filename, '.')
+ #send for analysis
+ self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,server_filename,1)
+
+ elif self.iperf_direction=="UL":
+ logging.debug("Iperf for Module in UL mode detected")
+ #server side EPC
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command('docker exec -it prod-trf-gen /bin/bash -c "killall --signal SIGKILL iperf"', '\$', 5)
+ iperf_cmd = 'echo $USER; nohup bin/iperf -s -u 2>&1 > ' + server_filename
+ cmd = 'docker exec -it prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+
+ #client side UE
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
+ cmd = 'rm '+ client_filename
+ SSH.command(cmd,'\$',5)
+ SSH.command('iperf -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0)
+ SSH.close()
+
+ #once client is done, retrieve the server file from container to EPC Host
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ SSH.command('docker cp prod-trf-gen:/iperf-2.0.13/' + server_filename + ' ' + EPC.SourceCodePath, '\$', 5)
+ SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, EPC.SourceCodePath + '/' + server_filename, '.')
+ SSH.close()
+
+ #copy the 2 resulting files locally
+ SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, client_filename, '.')
+ SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, server_filename, '.')
+ #send for analysis
+ self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,server_filename,1)
+ else :
+ logging.debug("Incorrect or missing IPERF direction in XML")
+
+ else: #default is ltebox
+
+ SSH = sshconnection.SSHConnection()
+
+ #kill iperf processes before (in case there are still some remaining)
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ cmd = 'killall --signal=SIGKILL iperf'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ cmd = 'killall --signal=SIGKILL iperf'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+
+
+ iperf_time = self.Iperf_ComputeTime()
+ if self.iperf_direction=="DL":
+ logging.debug("Iperf for Module in DL mode detected")
+ #server side UE
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ cmd = 'rm iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command(cmd,'\$',5)
+ cmd = 'echo $USER; nohup /opt/iperf-2.0.10/iperf -s -B ' + UE_IPAddress + ' -u 2>&1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log &'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ #client side EPC
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ cmd = 'rm iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command(cmd,'\$',5)
+ cmd = 'iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command(cmd,'\$',int(iperf_time)*5.0)
+ SSH.close()
+ #copy the 2 resulting files locally
+ SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
+ SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
+ #send for analysis
+ filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
+ self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1)
+
+ elif self.iperf_direction=="UL":
+ logging.debug("Iperf for Module in UL mode detected")
+ #server side EPC
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ cmd = 'rm iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command(cmd,'\$',5)
+ cmd = 'echo $USER; nohup iperf -s -u 2>&1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log &'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+
+ #client side UE
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ cmd = 'rm iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
+ SSH.command(cmd,'\$',5)
+ SSH.command('/opt/iperf-2.0.10/iperf -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '\$', int(iperf_time)*5.0)
+ SSH.close()
+
+ #copy the 2 resulting files locally
+ SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
+ SSH.copyin(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
+ #send for analysis
+ filename='iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
+ self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1)
+ else :
+ logging.debug("Incorrect or missing IPERF direction in XML")
+
+ #kill iperf processes after to be clean
+ SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
+ cmd = 'killall --signal=SIGKILL iperf'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
+ cmd = 'killall --signal=SIGKILL iperf'
+ SSH.command(cmd,'\$',5)
+ SSH.close()
+ return
def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC):
try:
diff --git a/ci-scripts/conf_files/channelmod_rfsimu.conf b/ci-scripts/conf_files/channelmod_rfsimu.conf
index 9a6ded24f1..cd4490d9ba 100644
--- a/ci-scripts/conf_files/channelmod_rfsimu.conf
+++ b/ci-scripts/conf_files/channelmod_rfsimu.conf
@@ -15,7 +15,7 @@ channelmod = {
ds_tdl = 0;
},
{
- model_name = "rfsimu_channel_ue1"
+ model_name = "rfsimu_channel_ue0"
type = "AWGN";
ploss_dB = 0;
noise_power_dB = 0;
diff --git a/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
new file mode 100644
index 0000000000..d2e91fb872
--- /dev/null
+++ b/ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf
@@ -0,0 +1,281 @@
+Active_eNBs = ( "eNB-Eurecom-B38");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+eNBs =
+(
+ {
+ ////////// Identification parameters:
+ eNB_ID = 0xe02;
+
+ cell_type = "CELL_MACRO_ENB";
+
+ eNB_name = "eNB-Eurecom-B38";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ( { mcc = 208; mnc = 97; mnc_length = 2; } );
+
+ tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ component_carriers = (
+ {
+ node_function = "3GPP_eNODEB";
+ node_timing = "synch_to_ext_device";
+ node_synch_ref = 0;
+ frame_type = "TDD";
+ tdd_config = 1;
+ tdd_config_s = 0;
+ prefix_type = "NORMAL";
+ eutra_band = 38;
+ downlink_frequency = 2605000000L;
+ nr_scg_ssb_freq = 624608;
+ uplink_frequency_offset = 0;
+ Nid_cell = 0;
+ N_RB_DL = 100;
+ Nid_cell_mbsfn = 0;
+ nb_antenna_ports = 1;
+ nb_antennas_tx = 2;
+ nb_antennas_rx = 2;
+ tx_gain = 90;
+ rx_gain = 125;
+ pbch_repetition = "FALSE";
+ prach_root = 0;
+ prach_config_index = 0;
+ prach_high_speed = "DISABLE";
+ prach_zero_correlation = 1;
+ prach_freq_offset = 2;
+ pucch_delta_shift = 1;
+ pucch_nRB_CQI = 0;
+ pucch_nCS_AN = 0;
+ pucch_n1_AN = 0;
+ pdsch_referenceSignalPower = -29;
+ pdsch_p_b = 0;
+ pusch_n_SB = 1;
+ pusch_enable64QAM = "DISABLE";
+ pusch_hoppingMode = "interSubFrame";
+ pusch_hoppingOffset = 0;
+ pusch_groupHoppingEnabled = "ENABLE";
+ pusch_groupAssignment = 0;
+ pusch_sequenceHoppingEnabled = "DISABLE";
+ pusch_nDMRS1 = 1;
+ phich_duration = "NORMAL";
+ phich_resource = "ONESIXTH";
+ srs_enable = "DISABLE";
+ /* srs_BandwidthConfig =;
+ srs_SubframeConfig =;
+ srs_ackNackST =;
+ srs_MaxUpPts =;*/
+
+ pusch_p0_Nominal = -96;
+ pusch_alpha = "AL1";
+ pucch_p0_Nominal = -104;
+ msg3_delta_Preamble = 6;
+ pucch_deltaF_Format1 = "deltaF2";
+ pucch_deltaF_Format1b = "deltaF3";
+ pucch_deltaF_Format2 = "deltaF0";
+ pucch_deltaF_Format2a = "deltaF0";
+ pucch_deltaF_Format2b = "deltaF0";
+
+ rach_numberOfRA_Preambles = 64;
+ rach_preamblesGroupAConfig = "DISABLE";
+ /*
+ rach_sizeOfRA_PreamblesGroupA = ;
+ rach_messageSizeGroupA = ;
+ rach_messagePowerOffsetGroupB = ;
+ */
+ rach_powerRampingStep = 4;
+ rach_preambleInitialReceivedTargetPower = -108;
+ rach_preambleTransMax = 10;
+ rach_raResponseWindowSize = 10;
+ rach_macContentionResolutionTimer = 48;
+ rach_maxHARQ_Msg3Tx = 4;
+
+ pcch_default_PagingCycle = 128;
+ pcch_nB = "oneT";
+ bcch_modificationPeriodCoeff = 2;
+ ue_TimersAndConstants_t300 = 1000;
+ ue_TimersAndConstants_t301 = 1000;
+ ue_TimersAndConstants_t310 = 1000;
+ ue_TimersAndConstants_t311 = 10000;
+ ue_TimersAndConstants_n310 = 20;
+ ue_TimersAndConstants_n311 = 1;
+ ue_TransmissionMode = 1;
+
+ //Parameters for SIB18
+ rxPool_sc_CP_Len = "normal";
+ rxPool_sc_Period = "sf40";
+ rxPool_data_CP_Len = "normal";
+ rxPool_ResourceConfig_prb_Num = 20;
+ rxPool_ResourceConfig_prb_Start = 5;
+ rxPool_ResourceConfig_prb_End = 44;
+ rxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ rxPool_ResourceConfig_offsetIndicator_choice = 0;
+ rxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "00000000000000000000";
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
+ rxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
+/* rxPool_dataHoppingConfig_hoppingParameter = 0;
+ rxPool_dataHoppingConfig_numSubbands = "ns1";
+ rxPool_dataHoppingConfig_rbOffset = 0;
+ rxPool_commTxResourceUC-ReqAllowed = "TRUE";
+*/
+ // Parameters for SIB19
+ discRxPool_cp_Len = "normal"
+ discRxPool_discPeriod = "rf32"
+ discRxPool_numRetx = 1;
+ discRxPool_numRepetition = 2;
+ discRxPool_ResourceConfig_prb_Num = 5;
+ discRxPool_ResourceConfig_prb_Start = 3;
+ discRxPool_ResourceConfig_prb_End = 21;
+ discRxPool_ResourceConfig_offsetIndicator_present = "prSmall";
+ discRxPool_ResourceConfig_offsetIndicator_choice = 0;
+ discRxPool_ResourceConfig_subframeBitmap_present = "prBs40";
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_buf = "f0ffffffff";
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
+ discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
+
+ }
+ );
+
+
+ srb1_parameters :
+ {
+ # timer_poll_retransmit = (ms) [5, 10, 15, 20,... 250, 300, 350, ... 500]
+ timer_poll_retransmit = 80;
+
+ # timer_reordering = (ms) [0,5, ... 100, 110, 120, ... ,200]
+ timer_reordering = 35;
+
+ # timer_reordering = (ms) [0,5, ... 250, 300, 350, ... ,500]
+ timer_status_prohibit = 0;
+
+ # poll_pdu = [4, 8, 16, 32 , 64, 128, 256, infinity(>10000)]
+ poll_pdu = 4;
+
+ # poll_byte = (kB) [25,50,75,100,125,250,375,500,750,1000,1250,1500,2000,3000,infinity(>10000)]
+ poll_byte = 99999;
+
+ # max_retx_threshold = [1, 2, 3, 4 , 6, 8, 16, 32]
+ max_retx_threshold = 4;
+ }
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+
+ ////////// MME parameters:
+ mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ enable_measurement_reports = "no";
+
+ ///X2
+ enable_x2 = "yes";
+ t_reloc_prep = 1000; /* unit: millisecond */
+ tx2_reloc_overall = 2000; /* unit: millisecond */
+ t_dc_prep = 1000; /* unit: millisecond */
+ t_dc_overall = 2000; /* unit: millisecond */
+
+ NETWORK_INTERFACES :
+ {
+ ENB_INTERFACE_NAME_FOR_S1_MME = "eno1";
+ ENB_IPV4_ADDRESS_FOR_S1_MME = "CI_ENB_IP_ADDR";
+ ENB_INTERFACE_NAME_FOR_S1U = "eno1";
+ ENB_IPV4_ADDRESS_FOR_S1U = "CI_ENB_IP_ADDR";
+ ENB_PORT_FOR_S1U = 2152; # Spec 2152
+ ENB_IPV4_ADDRESS_FOR_X2C = "CI_ENB_IP_ADDR";
+ ENB_PORT_FOR_X2C = 36422; # Spec 36422
+ };
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ phy_test_mode = 0;
+ scheduler_mode = "fairRR";
+ bler_target_upper = 20.0;
+ bler_target_lower = 10.0;
+ max_ul_rb_index = 27;
+ puSch10xSnr = 200;
+ puCch10xSnr = 150;
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ prach_dtx_threshold = 200;
+ pucch1_dtx_threshold = 5
+ pucch1ab_dtx_threshold =0;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 2
+ nb_rx = 2
+ att_tx = 0
+ att_rx = 0;
+ bands = [38];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ sdr_addrs = "mgmt_addr=192.168.18.241,addr=192.168.20.2,second_addr=192.168.10.2";
+
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+NETWORK_CONTROLLER :
+{
+ FLEXRAN_ENABLED = "no";
+ FLEXRAN_INTERFACE_NAME = "lo";
+ FLEXRAN_IPV4_ADDRESS = "127.0.0.1";
+ FLEXRAN_PORT = 2210;
+ FLEXRAN_CACHE = "/mnt/oai_agent_cache";
+ FLEXRAN_AWAIT_RECONF = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ };
+
diff --git a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
index db0802fdd7..6c8d5ba6f0 100644
--- a/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
@@ -6,7 +6,7 @@ eNBs =
(
{
////////// Identification parameters:
- eNB_ID = 0xe00;
+ eNB_ID = 0xe04;
cell_type = "CELL_MACRO_ENB";
@@ -14,7 +14,7 @@ eNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
- plmn_list = ( { mcc = 208; mnc = 99; mnc_length = 2; } );
+ plmn_list = ( { mcc = 208; mnc = 97; mnc_length = 2; } );
tr_s_preference = "local_mac"
@@ -31,6 +31,7 @@ eNBs =
prefix_type = "NORMAL";
eutra_band = 38;
downlink_frequency = 2605000000L;
+ nr_scg_ssb_freq = 624608;
uplink_frequency_offset = 0;
Nid_cell = 0;
N_RB_DL = 100;
@@ -209,8 +210,8 @@ MACRLCs = (
scheduler_mode = "fairRR";
bler_target_upper = 20.0;
bler_target_lower = 10.0;
- max_ul_rb_index = 24;
- puSch10xSnr = 100;
+ max_ul_rb_index = 27;
+ puSch10xSnr = 200;
puCch10xSnr = 150;
}
);
diff --git a/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
new file mode 100644
index 0000000000..9bf3136690
--- /dev/null
+++ b/ci-scripts/conf_files/gNB_SA_n78_106PRB.2x2_usrpn310.conf
@@ -0,0 +1,338 @@
+Active_gNBs = ( "gNB-OAI");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_CU_ID = 0xe00;
+
+# cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-OAI";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x010203; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+ });
+
+ nr_cellid = 12345678L
+
+# tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 2;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 11;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6
+ #absoluteFrequencySSB = 620640;
+ # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68
+ absoluteFrequencySSB = 621312;
+ # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2
+ #absoluteFrequencySSB = 634080;
+ # this is 3600.48 MHz
+ #absoluteFrequencySSB = 640032;
+ #dl_frequencyBand = 78;
+ # this is 3301.68 MHz
+ #dl_absoluteFrequencyPointA = 620112;
+ # this is 3300.60 MHz
+ dl_absoluteFrequencyPointA = 620040;
+ # this is 3502.56 MHz
+ #dl_absoluteFrequencyPointA = 633552;
+ # this is 3600.48 MHz
+ #dl_absoluteFrequencyPointA = 640032;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=0,L=106 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 11;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0;
+ #initialULBWPmappingType
+ #0=typeA,1=typeB
+ initialDLBWPmappingType_0 = 0;
+ #this is SS=1,L=13
+ initialDLBWPstartSymbolAndLength_0 = 40;
+
+ initialDLBWPk0_1 = 0;
+ initialDLBWPmappingType_1 = 0;
+ #this is SS=1,L=5
+ initialDLBWPstartSymbolAndLength_1 = 57;
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 12;
+ preambleReceivedTargetPower = -104;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # 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 = 2;
+ initialULBWPmappingType_0 = 1
+ # this is SS=2 L=13
+ initialULBWPstartSymbolAndLength_0 = 41;
+
+ initialULBWPk2_1 = 2;
+ initialULBWPmappingType_1 = 1;
+ # this is SS=0 L=4
+ initialULBWPstartSymbolAndLength_1 = 52;
+
+ initialULBWPk2_2 = 7;
+ initialULBWPmappingType_2 = 1;
+ # this is SS=10 L=4
+ initialULBWPstartSymbolAndLength_2 = 52;
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+ ////////// AMF parameters:
+ amf_ip_address = ( { ipv4 = "192.168.69.131";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ {
+
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "em1";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.194/24";
+ GNB_INTERFACE_NAME_FOR_NGU = "em1";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.194/24";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 200;
+ pucch_TargetSNRx10 = 150;
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 2;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 2
+ nb_rx = 2
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ ##beamforming 1x2 matrix: 1 layer x 2 antennas
+ bf_weights = [0x00007fff, 0x0000];
+ ##beamforming 1x4 matrix: 1 layer x 4 antennas
+ #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
+ ## beamforming 2x2 matrix:
+ # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
+ ## beamforming 4x4 matrix:
+ #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
+
+ sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ f1ap_log_level ="debug";
+ f1ap_log_verbosity ="medium";
+ };
diff --git a/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
new file mode 100644
index 0000000000..dfbbdf659d
--- /dev/null
+++ b/ci-scripts/conf_files/gNB_SA_n78_133PRB.2x2_usrpn310.conf
@@ -0,0 +1,334 @@
+Active_gNBs = ( "gNB-OAI");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+Num_Threads_PUSCH = 8;
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_CU_ID = 0xe00;
+
+# cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-OAI";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x010203; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+ });
+
+ nr_cellid = 12345678L
+
+# tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 2;
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 10;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6
+ absoluteFrequencySSB = 620640;
+ # this is 3502.56 MHz
+ #absoluteFrequencySSB = 633504;
+ # this is 3600.48 MHz
+ #absoluteFrequencySSB = 640032;
+ #dl_frequencyBand = 78;
+ # this is 3301.68 MHz
+ dl_absoluteFrequencyPointA = 620112;
+ # this is 3502.56 MHz
+ #dl_absoluteFrequencyPointA = 633504;
+ # this is 3600.48 MHz
+ #dl_absoluteFrequencyPointA = 640032;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 133;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=0,L=133 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 36300;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 10;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0;
+ #initialULBWPmappingType
+ #0=typeA,1=typeB
+ initialDLBWPmappingType_0 = 0;
+ #this is SS=1,L=13
+ initialDLBWPstartSymbolAndLength_0 = 40;
+
+ initialDLBWPk0_1 = 0;
+ initialDLBWPmappingType_1 = 0;
+ #this is SS=1,L=5
+ initialDLBWPstartSymbolAndLength_1 = 57;
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 133;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 36300;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 12;
+ preambleReceivedTargetPower = -108;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # 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=2 L=13
+ initialULBWPstartSymbolAndLength_0 = 41;
+
+ initialULBWPk2_1 = 6;
+ initialULBWPmappingType_1 = 1;
+ # this is SS=0 L=4
+ initialULBWPstartSymbolAndLength_1 = 52;
+
+ initialULBWPk2_2 = 7;
+ initialULBWPmappingType_2 = 1;
+ # this is SS=10 L=4
+ initialULBWPstartSymbolAndLength_2 = 52;
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+ ////////// AMF parameters:
+ amf_ip_address = ( { ipv4 = "192.168.69.131";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ {
+
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "em1";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.18.194/24";
+ GNB_INTERFACE_NAME_FOR_NGU = "em1";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.18.194/24";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+ pusch_TargetSNRx10 = 200;
+ pucch_TargetSNRx10 = 150;
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 2;
+ prach_dtx_threshold = 120;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 2
+ nb_rx = 2
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ ##beamforming 1x2 matrix: 1 layer x 2 antennas
+ bf_weights = [0x00007fff, 0x0000];
+ ##beamforming 1x4 matrix: 1 layer x 4 antennas
+ #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
+ ## beamforming 2x2 matrix:
+ # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
+ ## beamforming 4x4 matrix:
+ #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
+
+ sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_RU_L1_TRX_SPLIT";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ f1ap_log_level ="debug";
+ f1ap_log_verbosity ="medium";
+ };
diff --git a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
index 8d403cf4ce..1c62882406 100644
--- a/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band261.tm1.32PRB.usrpn300.conf
@@ -228,9 +228,8 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
- ulsch_max_slots_inactivity = 1;
pusch_TargetSNRx10 = 200;
- pucch_TargetSNRx10 = 200;
+ pucch_TargetSNRx10 = 200;
}
);
@@ -270,6 +269,23 @@ THREAD_STRUCT = (
}
);
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
index 05c71c082e..850cf9a60c 100644
--- a/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band66.tm1.106PRB.usrpn300.conf
@@ -259,6 +259,23 @@ THREAD_STRUCT = (
}
);
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
index 24dbdbd74b..a4452b202d 100644
--- a/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf
@@ -13,7 +13,7 @@ gNBs =
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
- plmn_list = ({mcc = 208; mnc = 99; mnc_length = 2;});
+ plmn_list = ({mcc = 208; mnc = 97; mnc_length = 2;});
tr_s_preference = "local_mac"
@@ -24,6 +24,7 @@ gNBs =
pusch_AntennaPorts = 2;
pusch_TargetSNRx10 = 200;
pucch_TargetSNRx10 = 200;
+ ul_prbblacklist = "51,52,53,54"
servingCellConfigCommon = (
{
@@ -33,11 +34,11 @@ gNBs =
# downlinkConfigCommon
#frequencyInfoDL
- # this is 3600 MHz + 84 PRBs@30kHz SCS (same as initial BWP)
- absoluteFrequencySSB = 641272; //641032; #641968; 641968=start of ssb at 3600MHz + 82 RBs 641032=center of SSB at center of cell
+ # this is 3350.04 MHz + 53 PRBs@30kHz SCS (same as initial BWP)
+ absoluteFrequencySSB = 624608;
dl_frequencyBand = 78;
- # this is 3600 MHz
- dl_absoluteFrequencyPointA = 640000;
+ # this is 3350.04 MHz
+ dl_absoluteFrequencyPointA = 623336;
#scs-SpecificCarrierList
dl_offstToCarrier = 0;
# subcarrierSpacing
@@ -46,7 +47,7 @@ gNBs =
dl_carrierBandwidth = 106;
#initialDownlinkBWP
#genericParameters
- # this is RBstart=84,L=13 (275*(L-1))+RBstart
+ # this is RBstart=43,L=24 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6368;
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
@@ -233,7 +234,7 @@ L1s = (
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
- prach_dtx_threshold = 100;
+ prach_dtx_threshold = 120;
}
);
@@ -250,6 +251,7 @@ RUs = (
eNB_instances = [0];
bf_weights = [0x00007fff, 0x00007fff];
#clock_src = "external";
+ sf_extension = 0
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
}
);
@@ -268,12 +270,17 @@ security = {
# preferred ciphering algorithms
# the first one of the list that an UE supports in chosen
# valid values: nea0, nea1, nea2, nea3
- ciphering_algorithms = ( "nea0", "nea2" );
+ ciphering_algorithms = ( "nea0" );
# preferred integrity algorithms
# the first one of the list that an UE supports in chosen
# valid values: nia0, nia1, nia2, nia3
- integrity_algorithms = ( "nia0" );
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
};
log_config :
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
new file mode 100644
index 0000000000..c889ba2b89
--- /dev/null
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf
@@ -0,0 +1,340 @@
+Active_gNBs = ( "gNB-OAI");
+# Asn1_verbosity, choice in: none, info, annoying
+Asn1_verbosity = "none";
+
+gNBs =
+(
+ {
+ ////////// Identification parameters:
+ gNB_CU_ID = 0xe00;
+
+# cell_type = "CELL_MACRO_GNB";
+
+ gNB_name = "gNB-OAI";
+
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+
+ plmn_list = ({
+ mcc = 208;
+ mnc = 97;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x010203; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+ });
+
+ nr_cellid = 12345678L
+
+# tr_s_preference = "local_mac"
+
+ ////////// Physical parameters:
+
+ ssb_SubcarrierOffset = 0;
+ pdsch_AntennaPorts = 1;
+ pusch_AntennaPorts = 2;
+ ul_prbblacklist = "51,52,53,54"
+
+ pdcch_ConfigSIB1 = (
+ {
+ controlResourceSetZero = 11;
+ searchSpaceZero = 0;
+ }
+ );
+
+ servingCellConfigCommon = (
+ {
+ #spCellConfigCommon
+
+ physCellId = 0;
+
+# downlinkConfigCommon
+ #frequencyInfoDL
+ # this is 3301.68 MHz + 22*12*30e-3 MHz = 3309.6
+ #absoluteFrequencySSB = 620640;
+ # this is 3300.60 MHz + 53*12*30e-3 MHz = 3319.68
+ absoluteFrequencySSB = 621312;
+ # this is 3503.28 MHz + 22*12*30e-3 MHz = 3511.2
+ #absoluteFrequencySSB = 634080;
+ # this is 3600.48 MHz
+ #absoluteFrequencySSB = 640032;
+ #dl_frequencyBand = 78;
+ # this is 3301.68 MHz
+ #dl_absoluteFrequencyPointA = 620112;
+ # this is 3300.60 MHz
+ dl_absoluteFrequencyPointA = 620040;
+ # this is 3502.56 MHz
+ #dl_absoluteFrequencyPointA = 633552;
+ # this is 3600.48 MHz
+ #dl_absoluteFrequencyPointA = 640032;
+ #scs-SpecificCarrierList
+ dl_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ dl_subcarrierSpacing = 1;
+ dl_carrierBandwidth = 106;
+ #initialDownlinkBWP
+ #genericParameters
+ # this is RBstart=0,L=106 (275*(L-1))+RBstart
+ initialDLBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialDLBWPsubcarrierSpacing = 1;
+ #pdcch-ConfigCommon
+ initialDLBWPcontrolResourceSetZero = 11;
+ initialDLBWPsearchSpaceZero = 0;
+ #pdsch-ConfigCommon
+ #pdschTimeDomainAllocationList (up to 16 entries)
+ initialDLBWPk0_0 = 0;
+ #initialULBWPmappingType
+ #0=typeA,1=typeB
+ initialDLBWPmappingType_0 = 0;
+ #this is SS=1,L=13
+ initialDLBWPstartSymbolAndLength_0 = 40;
+
+ initialDLBWPk0_1 = 0;
+ initialDLBWPmappingType_1 = 0;
+ #this is SS=1,L=5
+ initialDLBWPstartSymbolAndLength_1 = 57;
+
+ #uplinkConfigCommon
+ #frequencyInfoUL
+ ul_frequencyBand = 78;
+ #scs-SpecificCarrierList
+ ul_offstToCarrier = 0;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ ul_subcarrierSpacing = 1;
+ ul_carrierBandwidth = 106;
+ pMax = 20;
+ #initialUplinkBWP
+ #genericParameters
+ initialULBWPlocationAndBandwidth = 28875;
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ initialULBWPsubcarrierSpacing = 1;
+ #rach-ConfigCommon
+ #rach-ConfigGeneric
+ prach_ConfigurationIndex = 98;
+#prach_msg1_FDM
+#0 = one, 1=two, 2=four, 3=eight
+ prach_msg1_FDM = 0;
+ prach_msg1_FrequencyStart = 0;
+ zeroCorrelationZoneConfig = 12;
+ preambleReceivedTargetPower = -104;
+#preamblTransMax (0...10) = (3,4,5,6,7,8,10,20,50,100,200)
+ preambleTransMax = 6;
+#powerRampingStep
+# 0=dB0,1=dB2,2=dB4,3=dB6
+ powerRampingStep = 1;
+#ra_ReponseWindow
+#1,2,4,8,10,20,40,80
+ ra_ResponseWindow = 4;
+#ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR
+#1=oneeighth,2=onefourth,3=half,4=one,5=two,6=four,7=eight,8=sixteen
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB_PR = 3;
+#oneHalf (0..15) 4,8,12,16,...60,64
+ ssb_perRACH_OccasionAndCB_PreamblesPerSSB = 15;
+#ra_ContentionResolutionTimer
+#(0..7) 8,16,24,32,40,48,56,64
+ ra_ContentionResolutionTimer = 7;
+ rsrp_ThresholdSSB = 19;
+#prach-RootSequenceIndex_PR
+#1 = 839, 2 = 139
+ prach_RootSequenceIndex_PR = 2;
+ prach_RootSequenceIndex = 1;
+ # 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=2 L=13
+ initialULBWPstartSymbolAndLength_0 = 41;
+
+ initialULBWPk2_1 = 6;
+ initialULBWPmappingType_1 = 1;
+ # this is SS=0 L=4
+ initialULBWPstartSymbolAndLength_1 = 52;
+
+ initialULBWPk2_2 = 7;
+ initialULBWPmappingType_2 = 1;
+ # this is SS=10 L=4
+ initialULBWPstartSymbolAndLength_2 = 52;
+
+ msg3_DeltaPreamble = 1;
+ p0_NominalWithGrant =-90;
+
+# pucch-ConfigCommon setup :
+# pucchGroupHopping
+# 0 = neither, 1= group hopping, 2=sequence hopping
+ pucchGroupHopping = 0;
+ hoppingId = 40;
+ p0_nominal = -90;
+# ssb_PositionsInBurs_BitmapPR
+# 1=short, 2=medium, 3=long
+ ssb_PositionsInBurst_PR = 2;
+ ssb_PositionsInBurst_Bitmap = 1;
+
+# ssb_periodicityServingCell
+# 0 = ms5, 1=ms10, 2=ms20, 3=ms40, 4=ms80, 5=ms160, 6=spare2, 7=spare1
+ ssb_periodicityServingCell = 2;
+
+# dmrs_TypeA_position
+# 0 = pos2, 1 = pos3
+ dmrs_TypeA_Position = 0;
+
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ subcarrierSpacing = 1;
+
+
+ #tdd-UL-DL-ConfigurationCommon
+# subcarrierSpacing
+# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
+ referenceSubcarrierSpacing = 1;
+ # pattern1
+ # dl_UL_TransmissionPeriodicity
+ # 0=ms0p5, 1=ms0p625, 2=ms1, 3=ms1p25, 4=ms2, 5=ms2p5, 6=ms5, 7=ms10
+ dl_UL_TransmissionPeriodicity = 6;
+ nrofDownlinkSlots = 7;
+ nrofDownlinkSymbols = 6;
+ nrofUplinkSlots = 2;
+ nrofUplinkSymbols = 4;
+
+ ssPBCH_BlockPower = -25;
+ }
+
+ );
+
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 2;
+ SCTP_OUTSTREAMS = 2;
+ };
+
+ ////////// AMF parameters:
+ amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+
+ NETWORK_INTERFACES :
+ {
+
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "em1";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
+ GNB_INTERFACE_NAME_FOR_NGU = "em1";
+ GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+
+ }
+);
+
+MACRLCs = (
+ {
+ num_cc = 1;
+ tr_s_preference = "local_L1";
+ tr_n_preference = "local_RRC";
+# pusch_TargetSNRx10 = 200;
+# pucch_TargetSNRx10 = 150;
+ ulsch_max_slots_inactivity=20;
+ }
+);
+
+L1s = (
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 2;
+ prach_dtx_threshold = 120;
+# pucch0_dtx_threshold = 150;
+ }
+);
+
+RUs = (
+ {
+ local_rf = "yes"
+ nb_tx = 2
+ nb_rx = 2
+ att_tx = 0
+ att_rx = 0;
+ bands = [78];
+ max_pdschReferenceSignalPower = -27;
+ max_rxgain = 75;
+ eNB_instances = [0];
+ ##beamforming 1x2 matrix: 1 layer x 2 antennas
+ bf_weights = [0x00007fff, 0x0000];
+ ##beamforming 1x4 matrix: 1 layer x 4 antennas
+ #bf_weights = [0x00007fff, 0x0000,0x0000, 0x0000];
+ ## beamforming 2x2 matrix:
+ # bf_weights = [0x00007fff, 0x00000000, 0x00000000, 0x00007fff];
+ ## beamforming 4x4 matrix:
+ #bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
+ sf_extension = 0
+ sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
+ }
+);
+
+THREAD_STRUCT = (
+ {
+ #three config for level of parallelism "PARALLEL_SINGLE_THREAD", "PARALLEL_RU_L1_SPLIT", or "PARALLEL_RU_L1_TRX_SPLIT"
+ parallel_config = "PARALLEL_SINGLE_THREAD";
+ #two option for worker "WORKER_DISABLE" or "WORKER_ENABLE"
+ worker_config = "WORKER_ENABLE";
+ }
+);
+
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
+ log_config :
+ {
+ global_log_level ="info";
+ global_log_verbosity ="medium";
+ hw_log_level ="info";
+ hw_log_verbosity ="medium";
+ phy_log_level ="info";
+ phy_log_verbosity ="medium";
+ mac_log_level ="info";
+ mac_log_verbosity ="high";
+ rlc_log_level ="info";
+ rlc_log_verbosity ="medium";
+ pdcp_log_level ="info";
+ pdcp_log_verbosity ="medium";
+ rrc_log_level ="info";
+ rrc_log_verbosity ="medium";
+ f1ap_log_level ="debug";
+ f1ap_log_verbosity ="medium";
+ };
diff --git a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
index db190f177d..a5d35d450e 100644
--- a/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf
@@ -1,4 +1,4 @@
-Active_gNBs = ( "gNB-Eurecom-DU");
+Active_gNBs = ( "gNB-OAI");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
@@ -7,7 +7,7 @@ gNBs =
{
////////// Identification parameters:
gNB_ID = 0xe00;
- gNB_name = "gNB-Eurecom-DU";
+ gNB_name = "gNB-OAI";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1;
@@ -35,6 +35,7 @@ gNBs =
ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts = 1;
pusch_AntennaPorts = 1;
+ ul_prbblacklist = "51,52,53,54"
pdcch_ConfigSIB1 = (
{
@@ -203,7 +204,7 @@ gNBs =
};
- ////////// MME parameters:
+ ////////// AMF parameters:
amf_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
ipv6 = "192:168:30::17";
active = "yes";
@@ -218,7 +219,7 @@ gNBs =
GNB_IPV4_ADDRESS_FOR_NG_AMF = "CI_GNB_IP_ADDR";
GNB_INTERFACE_NAME_FOR_NGU = "eth0";
GNB_IPV4_ADDRESS_FOR_NGU = "CI_GNB_IP_ADDR";
- GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ GNB_PORT_FOR_NGU = 2152; # Spec 2152
};
}
@@ -229,18 +230,19 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
- ulsch_max_slots_inactivity = 100;
pusch_TargetSNRx10 = 200;
- pucch_TargetSNRx10 = 200;
+ pucch_TargetSNRx10 = 150;
}
);
L1s = (
- {
- num_cc = 1;
- tr_n_preference = "local_mac";
- pusch_proc_threads = 8;
- }
+ {
+ num_cc = 1;
+ tr_n_preference = "local_mac";
+ pusch_proc_threads = 8;
+ prach_dtx_threshold = 120;
+ pucch0_dtx_threshold = 150;
+ }
);
RUs = (
@@ -250,9 +252,9 @@ RUs = (
nb_rx = 1
att_tx = 0
att_rx = 0;
- bands = [7];
+ bands = [78];
max_pdschReferenceSignalPower = -27;
- max_rxgain = 81;
+ max_rxgain = 75;
eNB_instances = [0];
#beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
@@ -279,6 +281,23 @@ rfsimulator :
IQfile = "/tmp/rfsimulator.iqs";
};
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
index 8d32e8b792..4f0f7c6b2e 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf
@@ -211,7 +211,6 @@ MACRLCs = (
num_cc = 1;
tr_s_preference = "local_L1";
tr_n_preference = "local_RRC";
- ulsch_max_slots_inactivity = 1;
}
);
@@ -257,6 +256,23 @@ THREAD_STRUCT = (
}
);
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
index df2fd874ca..7bda7f7eb5 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf
@@ -262,6 +262,23 @@ THREAD_STRUCT = (
}
);
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
index b981b27f53..e6bbbf2d41 100644
--- a/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
+++ b/ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpn310.conf
@@ -272,6 +272,23 @@ THREAD_STRUCT = (
}
);
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/ci-scripts/datalog_rt_stats.yaml b/ci-scripts/datalog_rt_stats.yaml
index 548caa0bdd..507ea5d182 100644
--- a/ci-scripts/datalog_rt_stats.yaml
+++ b/ci-scripts/datalog_rt_stats.yaml
@@ -12,7 +12,8 @@ Ref :
feptx_prec : 8.0
feptx_ofdm : 50.0
feptx_total : 75.0
- L1 Tx processing : 300.0
+ L1 Tx processing thread 0 : 300.0
+ L1 Tx processing thread 1 : 300.0
DLSCH encoding : 230.0
L1 Rx processing : 175.0
PUSCH inner-receiver : 100.0
@@ -24,7 +25,8 @@ Threshold :
feptx_prec : 1.25
feptx_ofdm : 1.25
feptx_total : 1.25
- L1 Tx processing : 1.25
+ L1 Tx processing thread 0 : 1.25
+ L1 Tx processing thread 1 : 1.25
DLSCH encoding : 1.25
L1 Rx processing : 1.25
PUSCH inner-receiver : 1.25
diff --git a/ci-scripts/epc.py b/ci-scripts/epc.py
index 1c202438d2..8376e07fd5 100644
--- a/ci-scripts/epc.py
+++ b/ci-scripts/epc.py
@@ -66,6 +66,7 @@ class EPCManagement():
self.containerPrefix = 'prod'
self.mmeConfFile = 'mme.conf'
self.yamlPath = ''
+ self.isMagmaUsed = False
#-----------------------------------------------------------
@@ -164,7 +165,15 @@ class EPCManagement():
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password)
- mySSH.command('docker inspect --format="MME_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" ' + self.containerPrefix + '-oai-mme', '\$', 5)
+ self.isMagmaUsed = False
+ mySSH.command('docker ps -a', '\$', 5)
+ result = re.search('magma', mySSH.getBefore())
+ if result is not None:
+ self.isMagmaUsed = True
+ if self.isMagmaUsed:
+ mySSH.command('docker inspect --format="MME_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" ' + self.containerPrefix + '-magma-mme', '\$', 5)
+ else:
+ mySSH.command('docker inspect --format="MME_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" ' + self.containerPrefix + '-oai-mme', '\$', 5)
result = re.search('MME_IP_ADDR = (?P[0-9\.]+)', mySSH.getBefore())
if result is not None:
self.MmeIPAddress = result.group('mme_ip_addr')
@@ -220,7 +229,7 @@ class EPCManagement():
mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('ltebox', self.Type, re.IGNORECASE):
- logging.debug('Using the sabox simulated HSS')
+ logging.debug('Using the SABOX simulated HSS')
mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command('cd /opt/hss_sim0609', '\$', 5)
@@ -229,6 +238,12 @@ class EPCManagement():
logging.debug('Using the sabox')
mySSH.command('cd /opt/ltebox/tools', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./start_sabox', '\$', 5)
+ elif re.match('OAICN5G', self.Type, re.IGNORECASE):
+ logging.debug('Starting OAI CN5G')
+ mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
+ mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
+ mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5)
+ mySSH.command('./core-network.sh start nrf spgwu', '\$', 60)
else:
logging.error('This option should not occur!')
mySSH.close()
@@ -242,6 +257,16 @@ class EPCManagement():
return
if re.match('ltebox', self.Type, re.IGNORECASE):
self.MmeIPAddress = self.IPAddress
+ elif re.match('OAICN5G', self.Type, re.IGNORECASE):
+ mySSH = SSH.SSHConnection()
+ mySSH.open(self.IPAddress, self.UserName, self.Password)
+ response=mySSH.command3('docker container ls -f name=oai-amf', 10)
+ if len(response)>1:
+ response=mySSH.command3('docker inspect --format=\'{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}\' oai-amf', 10)
+ tmp = str(response[0],'utf-8')
+ self.MmeIPAddress = tmp.rstrip()
+ logging.debug('AMF IP Address ' + self.MmeIPAddress)
+ mySSH.close()
def CheckHSSProcess(self, status_queue):
try:
@@ -273,7 +298,15 @@ class EPCManagement():
mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
- mySSH.command('docker top ' + self.containerPrefix + '-oai-mme', '\$', 5)
+ self.isMagmaUsed = False
+ mySSH.command('docker ps -a', '\$', 5)
+ result = re.search('magma', mySSH.getBefore())
+ if result is not None:
+ self.isMagmaUsed = True
+ if self.isMagmaUsed:
+ mySSH.command('docker top ' + self.containerPrefix + '-magma-mme', '\$', 5)
+ else:
+ mySSH.command('docker top ' + self.containerPrefix + '-oai-mme', '\$', 5)
else:
mySSH.command('stdbuf -o0 ps -aux | grep --color=never mme | grep -v grep', '\$', 5)
if re.match('OAI-Rel14-Docker', self.Type, re.IGNORECASE):
@@ -433,6 +466,7 @@ class EPCManagement():
mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password)
if re.match('ltebox', self.Type, re.IGNORECASE):
+ logging.debug('Terminating SA BOX')
mySSH.command('cd /opt/ltebox/tools', '\$', 5)
mySSH.command('echo ' + self.Password + ' | sudo -S ./stop_sabox', '\$', 5)
time.sleep(1)
@@ -440,6 +474,12 @@ class EPCManagement():
mySSH.command('cd scripts', '\$', 5)
time.sleep(1)
mySSH.command('echo ' + self.Password + ' | sudo -S screen -S simulated_5g_hss -X quit', '\$', 5)
+ elif re.match('OAICN5G', self.Type, re.IGNORECASE):
+ self.LogCollectOAICN5G()
+ logging.debug('Terminating OAI CN5G')
+ mySSH.command('cd /opt/oai-cn5g-fed/docker-compose', '\$', 5)
+ mySSH.command('docker-compose down', '\$', 5)
+ mySSH.command('./core-network.sh stop nrf spgwu', '\$', 60)
else:
logging.error('This should not happen!')
mySSH.close()
@@ -466,6 +506,12 @@ class EPCManagement():
HTML.CreateHtmlTabFooter(False)
sys.exit('docker-compose not installed on ' + self.IPAddress)
+ # Checking if it is a MAGMA deployment
+ self.isMagmaUsed = False
+ if os.path.isfile('./' + self.yamlPath + '/redis_extern.conf'):
+ self.isMagmaUsed = True
+ logging.debug('MAGMA MME is used!')
+
mySSH.command('if [ -d ' + self.SourceCodePath + '/scripts ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/scripts ; fi', '\$', 5)
mySSH.command('if [ -d ' + self.SourceCodePath + '/logs ]; then echo ' + self.Password + ' | sudo -S rm -Rf ' + self.SourceCodePath + '/logs ; fi', '\$', 5)
mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts ' + self.SourceCodePath + '/logs', '\$', 5)
@@ -477,10 +523,15 @@ class EPCManagement():
# - docker-compose config | grep container_name
mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/docker-compose.yml', self.SourceCodePath + '/scripts')
+ if self.isMagmaUsed:
+ mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/entrypoint.sh', self.SourceCodePath + '/scripts')
+ mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/mme.conf', self.SourceCodePath + '/scripts')
+ mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/mme_fd.sprint.conf', self.SourceCodePath + '/scripts')
+ mySSH.copyout(self.IPAddress, self.UserName, self.Password, './' + self.yamlPath + '/redis_extern.conf', self.SourceCodePath + '/scripts')
+ mySSH.command('chmod a+x ' + self.SourceCodePath + '/scripts/entrypoint.sh', '\$', 5)
mySSH.command('wget --quiet --tries=3 --retry-connrefused https://raw.githubusercontent.com/OPENAIRINTERFACE/openair-hss/develop/src/hss_rel14/db/oai_db.cql', '\$', 30)
mySSH.command('docker-compose down', '\$', 60)
mySSH.command('docker-compose up -d db_init', '\$', 60)
-
# databases take time...
time.sleep(10)
cnt = 0
@@ -502,8 +553,12 @@ class EPCManagement():
# deploying EPC cNFs
mySSH.command('docker-compose up -d oai_spgwu', '\$', 60)
- listOfContainers = 'prod-cassandra prod-oai-hss prod-oai-mme prod-oai-spgwc prod-oai-spgwu-tiny'
- expectedHealthyContainers = 5
+ if self.isMagmaUsed:
+ listOfContainers = 'prod-cassandra prod-oai-hss prod-magma-mme prod-oai-spgwc prod-oai-spgwu-tiny prod-redis'
+ expectedHealthyContainers = 6
+ else:
+ listOfContainers = 'prod-cassandra prod-oai-hss prod-oai-mme prod-oai-spgwc prod-oai-spgwu-tiny'
+ expectedHealthyContainers = 5
# Checking for additional services
mySSH.command('docker-compose config', '\$', 5)
@@ -534,7 +589,10 @@ class EPCManagement():
logging.debug(' -- ' + str(startingNb) + ' still starting container(s)')
if healthyNb == expectedHealthyContainers:
mySSH.command('docker exec -d prod-oai-hss /bin/bash -c "nohup tshark -i any -f \'port 9042 or port 3868\' -w /tmp/hss_check_run.pcap 2>&1 > /dev/null"', '\$', 5)
- mySSH.command('docker exec -d prod-oai-mme /bin/bash -c "nohup tshark -i any -f \'port 3868 or port 2123 or port 36412\' -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 10)
+ if self.isMagmaUsed:
+ mySSH.command('docker exec -d prod-magma-mme /bin/bash -c "nohup tshark -i any -f \'port 3868 or port 2123 or port 36412\' -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 10)
+ else:
+ mySSH.command('docker exec -d prod-oai-mme /bin/bash -c "nohup tshark -i any -f \'port 3868 or port 2123 or port 36412\' -w /tmp/mme_check_run.pcap 2>&1 > /dev/null"', '\$', 10)
mySSH.command('docker exec -d prod-oai-spgwc /bin/bash -c "nohup tshark -i any -f \'port 2123 or port 8805\' -w /tmp/spgwc_check_run.pcap 2>&1 > /dev/null"', '\$', 10)
# on SPGW-U, not capturing on SGI to avoid huge file
mySSH.command('docker exec -d prod-oai-spgwu-tiny /bin/bash -c "nohup tshark -i any -f \'port 8805\' -w /tmp/spgwu_check_run.pcap 2>&1 > /dev/null"', '\$', 10)
@@ -552,24 +610,45 @@ class EPCManagement():
mySSH = SSH.SSHConnection()
mySSH.open(self.IPAddress, self.UserName, self.Password)
+ # Checking if it is a MAGMA deployment.
+ mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5)
+ mySSH.command('docker-compose ps -a', '\$', 5)
+ self.isMagmaUsed = False
+ result = re.search('magma', mySSH.getBefore())
+ if result is not None:
+ self.isMagmaUsed = True
+ logging.debug('MAGMA MME is used!')
# Recovering logs and pcap files
mySSH.command('cd ' + self.SourceCodePath + '/logs', '\$', 5)
mySSH.command('docker exec -it prod-oai-hss /bin/bash -c "killall --signal SIGINT oai_hss tshark"', '\$', 5)
- mySSH.command('docker exec -it prod-oai-mme /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5)
+ if self.isMagmaUsed:
+ mySSH.command('docker exec -it prod-magma-mme /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5)
+ else:
+ mySSH.command('docker exec -it prod-oai-mme /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5)
mySSH.command('docker exec -it prod-oai-spgwc /bin/bash -c "killall --signal SIGINT oai_spgwc tshark"', '\$', 5)
mySSH.command('docker exec -it prod-oai-spgwu-tiny /bin/bash -c "killall --signal SIGINT tshark"', '\$', 5)
mySSH.command('docker logs prod-oai-hss > hss_' + self.testCase_id + '.log', '\$', 5)
- mySSH.command('docker logs prod-oai-mme > mme_' + self.testCase_id + '.log', '\$', 5)
+ if self.isMagmaUsed:
+ mySSH.command('docker cp --follow-link prod-magma-mme:/var/log/mme.log mme_' + self.testCase_id + '.log', '\$', 15)
+ else:
+ mySSH.command('docker logs prod-oai-mme > mme_' + self.testCase_id + '.log', '\$', 5)
mySSH.command('docker logs prod-oai-spgwc > spgwc_' + self.testCase_id + '.log', '\$', 5)
mySSH.command('docker logs prod-oai-spgwu-tiny > spgwu_' + self.testCase_id + '.log', '\$', 5)
mySSH.command('docker cp prod-oai-hss:/tmp/hss_check_run.pcap hss_' + self.testCase_id + '.pcap', '\$', 60)
- mySSH.command('docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60)
+ if self.isMagmaUsed:
+ mySSH.command('docker cp prod-magma-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60)
+ else:
+ mySSH.command('docker cp prod-oai-mme:/tmp/mme_check_run.pcap mme_' + self.testCase_id + '.pcap', '\$', 60)
mySSH.command('docker cp prod-oai-spgwc:/tmp/spgwc_check_run.pcap spgwc_' + self.testCase_id + '.pcap', '\$', 60)
mySSH.command('docker cp prod-oai-spgwu-tiny:/tmp/spgwu_check_run.pcap spgwu_' + self.testCase_id + '.pcap', '\$', 60)
# Remove all
mySSH.command('cd ' + self.SourceCodePath + '/scripts', '\$', 5)
- listOfContainers = 'prod-cassandra prod-oai-hss prod-oai-mme prod-oai-spgwc prod-oai-spgwu-tiny'
- nbContainers = 5
+ if self.isMagmaUsed:
+ listOfContainers = 'prod-cassandra prod-oai-hss prod-magma-mme prod-oai-spgwc prod-oai-spgwu-tiny prod-redis'
+ nbContainers = 6
+ else:
+ listOfContainers = 'prod-cassandra prod-oai-hss prod-oai-mme prod-oai-spgwc prod-oai-spgwu-tiny'
+ nbContainers = 5
# Checking for additional services
mySSH.command('docker-compose config', '\$', 5)
configResponse = mySSH.getBefore()
@@ -679,3 +758,16 @@ class EPCManagement():
logging.error('This option should not occur!')
mySSH.close()
+ def LogCollectOAICN5G(self):
+ mySSH = SSH.SSHConnection()
+ mySSH.open(self.IPAddress, self.UserName, self.Password)
+ logging.debug('OAI CN5G Collecting Log files to workspace')
+ mySSH.command('echo ' + self.Password + ' | sudo rm -rf ' + self.SourceCodePath + '/logs', '\$', 5)
+ mySSH.command('mkdir ' + self.SourceCodePath + '/logs','\$', 5)
+ containers_list=['oai-smf','oai-spgwu','oai-amf','oai-nrf']
+ for c in containers_list:
+ mySSH.command('docker logs ' + c + ' > ' + self.SourceCodePath + '/logs/' + c + '.log', '\$', 5)
+ mySSH.command('cd ' + self.SourceCodePath + '/logs', '\$', 5)
+ mySSH.command('zip oai-cn5g.log.zip *.log', '\$', 60)
+ mySSH.close()
+
diff --git a/ci-scripts/main.py b/ci-scripts/main.py
index d66c0c6305..9923d515a4 100644
--- a/ci-scripts/main.py
+++ b/ci-scripts/main.py
@@ -154,6 +154,7 @@ def GetParametersFromXML(action):
elif action == 'Initialize_eNB':
RAN.eNB_Trace=test.findtext('eNB_Trace')
+ RAN.eNB_Stats=test.findtext('eNB_Stats')
RAN.Initialize_eNB_args=test.findtext('Initialize_eNB_args')
eNB_instance=test.findtext('eNB_instance')
USRPIPAddress=test.findtext('USRP_IPAddress')
diff --git a/ci-scripts/ran.py b/ci-scripts/ran.py
index 5e3d8e388f..9acb1de34e 100644
--- a/ci-scripts/ran.py
+++ b/ci-scripts/ran.py
@@ -39,7 +39,6 @@ import time
from multiprocessing import Process, Lock, SimpleQueue
import yaml
-
#-----------------------------------------------------------
# OAI Testing modules
#-----------------------------------------------------------
@@ -94,6 +93,7 @@ class RANManagement():
self.runtime_stats= ''
self.datalog_rt_stats={}
self.eNB_Trace = '' #if 'yes', Tshark will be launched at initialization
+ self.eNB_Stats = '' #if 'yes', Statistics Monitor will be launched at initialization
self.USRPIPAddress = ''
@@ -341,6 +341,8 @@ class RANManagement():
self.testCase_id = HTML.testCase_id
mySSH = SSH.SSHConnection()
+ cwd = os.getcwd()
+ mySSH.copyout(lIpAddr,lUserName,lPassWord, cwd + "/active_net_interfaces.awk", "/tmp")
#reboot USRP if requested in xml
if self.USRPIPAddress!='':
@@ -461,10 +463,36 @@ class RANManagement():
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)
- mySSH.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
+
+ #hack UHD_RFNOC_DIR variable for gNB / N310 on RHEL8 server:
+ #if the USRP address is in the xml then we are using an eth USRP (N3xx)
+ if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'):
+ gNB = False
+ else:
+ gNB = True
+ if ((self.USRPIPAddress!='') and (gNB==True)):
+ mySSH.command('echo ' + lPassWord + ' | echo "ulimit -c unlimited && sudo UHD_RFNOC_DIR=/usr/local/share/uhd/rfnoc ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
+ #otherwise the regular command is ok
+ else:
+ mySSH.command('echo "ulimit -c unlimited && ./ran_build/build/' + self.air_interface[self.eNB_instance] + ' -O ' + lSourcePath + '/' + ci_full_config_file + extra_options + '" > ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
+
mySSH.command('chmod 775 ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh', '\$', 5)
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf enb_' + self.testCase_id + '.log', '\$', 5)
mySSH.command('echo $USER; nohup sudo -E ./my-lte-softmodem-run' + str(self.eNB_instance) + '.sh > ' + lSourcePath + '/cmake_targets/enb_' + self.testCase_id + '.log 2>&1 &', lUserName, 10)
+
+
+ #stats monitoring during runtime
+ time.sleep(20)
+ monitor_file='../ci-scripts/stats_monitor.py'
+ conf_file='../ci-scripts/stats_monitor_conf.yaml'
+ if self.eNB_Stats=='yes':
+ if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'):
+ mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' enb 2>&1 > enb_stats_monitor_execution.log &', '\$', 5)
+ else:
+ mySSH.command('echo $USER; nohup python3 ' + monitor_file + ' ' + conf_file + ' gnb 2>&1 > gnb_stats_monitor_execution.log &', '\$', 5)
+
+
+
self.eNBLogFiles[int(self.eNB_instance)] = 'enb_' + self.testCase_id + '.log'
if extra_options != '':
self.eNBOptions[int(self.eNB_instance)] = extra_options
@@ -539,6 +567,8 @@ class RANManagement():
self.eNBstatuses[int(self.eNB_instance)] = int(self.eNB_serverId[self.eNB_instance])
mySSH.close()
+
+
HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'OK', CONST.ALL_PROCESSES_OK)
logging.debug('\u001B[1m Initialize eNB/gNB/ocp-eNB Completed\u001B[0m')
@@ -657,6 +687,11 @@ class RANManagement():
fileToAnalyze = self.eNBLogFiles[int(self.eNB_instance)]
self.eNBLogFiles[int(self.eNB_instance)] = ''
if analyzeFile:
+ #*stats.log files + pickle + png
+ mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*stats.log', '.')
+ mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.pickle', '.')
+ mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/*.png', '.')
+ #
copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.')
if (copyin_res == -1):
logging.debug('\u001B[1;37;41m Could not copy ' + nodeB_prefix + 'NB logfile to analyze it! \u001B[0m')
@@ -665,12 +700,20 @@ class RANManagement():
self.eNBmbmsEnables[int(self.eNB_instance)] = False
return
if self.eNB_serverId[self.eNB_instance] != '0':
+ #*stats.log files + pickle + png
+
+ #debug / tentative
+ mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrL1_stats.log', self.eNBSourceCodePath + '/cmake_targets/')
+ mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './nrMAC_stats.log', self.eNBSourceCodePath + '/cmake_targets/')
+ mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.pickle', self.eNBSourceCodePath + '/cmake_targets/')
+ mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/')
+ #
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword, './' + fileToAnalyze, self.eNBSourceCodePath + '/cmake_targets/')
logging.debug('\u001B[1m Analyzing ' + nodeB_prefix + 'NB logfile \u001B[0m ' + fileToAnalyze)
logStatus = self.AnalyzeLogFile_eNB(fileToAnalyze, HTML)
if (logStatus < 0):
HTML.CreateHtmlTestRow('N/A', 'KO', logStatus)
- self.preamtureExit = True
+ self.prematureExit = True
self.eNBmbmsEnables[int(self.eNB_instance)] = False
return
else:
@@ -691,8 +734,8 @@ class RANManagement():
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/enb_*.pcap .','\$',20)
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S mv /tmp/gnb_*.pcap .','\$',20)
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm -f enb.log.zip', '\$', 5)
- mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log', '\$', 60)
- mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log', '\$', 5)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor.png', '\$', 60)
+ mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *.pickle *.png', '\$', 5)
mySSH.close()
def AnalyzeLogFile_eNB(self, eNBlogFile, HTML):
@@ -1032,7 +1075,7 @@ class RANManagement():
for k in datalog_rt_stats['Data']:
if float(datalog_rt_stats['Data'][k][2])> datalog_rt_stats['Threshold'][k]: #condition for fail : avg/ref is greater than the fixed threshold
#setting prematureExit is ok although not the best option
- self.prematureExit=True
+ self.prematureExit=False #temp for debug : do not stop the test if RT stats are excedeed
else:
statMsg = 'No real time stats found in the log file\n'
logging.debug('No real time stats found in the log file')
diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py
index b4087c9695..b85c40a0be 100644
--- a/ci-scripts/sshconnection.py
+++ b/ci-scripts/sshconnection.py
@@ -163,6 +163,18 @@ class SSHConnection():
lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
self.cmd2Results = str(lSsh.stdout.readlines())
+ def command3(self, commandline, timeout, silent=False):
+ if not silent:
+ logging.debug(commandline)
+ self.cmd2Results = ''
+ myHost = self.username + '@' + self.ipaddress
+ # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS
+ # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST
+ # OTHERWISE IT WON'T WORK
+ lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ return lSsh.stdout.readlines()
+
+
def close(self):
self.ssh.timeout = 5
self.ssh.sendline('exit')
diff --git a/ci-scripts/stats_monitor.py b/ci-scripts/stats_monitor.py
new file mode 100755
index 0000000000..877194de59
--- /dev/null
+++ b/ci-scripts/stats_monitor.py
@@ -0,0 +1,102 @@
+"""
+To create graphs and pickle from runtime statistics in L1,MAC,RRC,PDCP files
+"""
+
+import subprocess
+import time
+import shlex
+import re
+import sys
+import pickle
+import matplotlib.pyplot as plt
+import numpy as np
+import yaml
+
+
+class StatMonitor():
+ def __init__(self,cfg_file):
+ with open(cfg_file,'r') as file:
+ self.d = yaml.load(file)
+ for node in self.d:
+ for metric in self.d[node]:
+ self.d[node][metric]=[]
+
+
+ def process_gnb (self,node_type,output):
+ for line in output:
+ tmp=line.decode("utf-8")
+ result=re.match(r'^.*\bdlsch_rounds\b ([0-9]+)\/([0-9]+).*\bdlsch_errors\b ([0-9]+)',tmp)
+ if result is not None:
+ self.d[node_type]['dlsch_err'].append(int(result.group(3)))
+ percentage=float(result.group(2))/float(result.group(1))
+ self.d[node_type]['dlsch_err_perc_round_1'].append(percentage)
+ result=re.match(r'^.*\bulsch_rounds\b ([0-9]+)\/([0-9]+).*\bulsch_errors\b ([0-9]+)',tmp)
+ if result is not None:
+ self.d[node_type]['ulsch_err'].append(int(result.group(3)))
+ percentage=float(result.group(2))/float(result.group(1))
+ self.d[node_type]['ulsch_err_perc_round_1'].append(percentage)
+
+
+ def process_enb (self,node_type,output):
+ for line in output:
+ tmp=line.decode("utf-8")
+ result=re.match(r'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp)
+ if result is not None:
+ self.d[node_type]['PHR'].append(int(result.group(1)))
+ self.d[node_type]['bler'].append(float(result.group(2)))
+ self.d[node_type]['mcsoff'].append(int(result.group(3)))
+ self.d[node_type]['mcs'].append(int(result.group(4)))
+
+
+ def collect(self,node_type):
+ if node_type=='enb':
+ cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log'
+ else: #'gnb'
+ cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log'
+ process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ if node_type=='enb':
+ self.process_enb(node_type,output)
+ else: #'gnb'
+ self.process_gnb(node_type,output)
+
+
+ def graph(self,node_type):
+ col = 1
+ figure, axis = plt.subplots(len(self.d[node_type]), col ,figsize=(10, 10))
+ i=0
+ for metric in self.d[node_type]:
+ major_ticks = np.arange(0, len(self.d[node_type][metric])+1, 1)
+ axis[i].set_xticks(major_ticks)
+ axis[i].set_xticklabels([])
+ axis[i].plot(self.d[node_type][metric],marker='o')
+ axis[i].set_xlabel('time')
+ axis[i].set_ylabel(metric)
+ axis[i].set_title(metric)
+ i+=1
+
+ plt.tight_layout()
+ # Combine all the operations and display
+ plt.savefig(node_type+'_stats_monitor.png')
+ plt.show()
+
+
+if __name__ == "__main__":
+
+ cfg_filename = sys.argv[1] #yaml file as metrics config
+ node = sys.argv[2]#enb or gnb
+ mon=StatMonitor(cfg_filename)
+
+ #collecting stats when modem process is stopped
+ CMD='ps aux | grep mode | grep -v grep'
+ process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ while len(output)!=0 :
+ mon.collect(node)
+ process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ time.sleep(1)
+ print('Process stopped')
+ with open(node+'_stats_monitor.pickle', 'wb') as handle:
+ pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL)
+ mon.graph(node)
diff --git a/ci-scripts/stats_monitor.py.old b/ci-scripts/stats_monitor.py.old
new file mode 100755
index 0000000000..ae9b39bfa6
--- /dev/null
+++ b/ci-scripts/stats_monitor.py.old
@@ -0,0 +1,94 @@
+import subprocess
+import time
+import shlex
+import re
+import sys
+import matplotlib.pyplot as plt
+import pickle
+import numpy as np
+import os
+
+def collect(d, node_type):
+ if node_type=='enb':
+ cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log'
+ else: #'gnb'
+ cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log'
+ process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ for l in output:
+ tmp=l.decode("utf-8")
+ result=re.match(rf'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp)
+ if result is not None:
+ d['PHR'].append(int(result.group(1)))
+ d['bler'].append(float(result.group(2)))
+ d['mcsoff'].append(int(result.group(3)))
+ d['mcs'].append(int(result.group(4)))
+
+
+def graph(d, node_type):
+
+
+ figure, axis = plt.subplots(4, 1,figsize=(10, 10))
+
+ major_ticks = np.arange(0, len(d['PHR'])+1, 1)
+ axis[0].set_xticks(major_ticks)
+ axis[0].set_xticklabels([])
+ axis[0].plot(d['PHR'],marker='o')
+ axis[0].set_xlabel('time')
+ axis[0].set_ylabel('PHR')
+ axis[0].set_title("PHR")
+
+ major_ticks = np.arange(0, len(d['bler'])+1, 1)
+ axis[1].set_xticks(major_ticks)
+ axis[1].set_xticklabels([])
+ axis[1].plot(d['bler'],marker='o')
+ axis[1].set_xlabel('time')
+ axis[1].set_ylabel('bler')
+ axis[1].set_title("bler")
+
+ major_ticks = np.arange(0, len(d['mcsoff'])+1, 1)
+ axis[2].set_xticks(major_ticks)
+ axis[2].set_xticklabels([])
+ axis[2].plot(d['mcsoff'],marker='o')
+ axis[2].set_xlabel('time')
+ axis[2].set_ylabel('mcsoff')
+ axis[2].set_title("mcsoff")
+
+ major_ticks = np.arange(0, len(d['mcs'])+1, 1)
+ axis[3].set_xticks(major_ticks)
+ axis[3].set_xticklabels([])
+ axis[3].plot(d['mcs'],marker='o')
+ axis[3].set_xlabel('time')
+ axis[3].set_ylabel('mcs')
+ axis[3].set_title("mcs")
+
+ plt.tight_layout()
+ # Combine all the operations and display
+ plt.savefig(node_type+'_stats_monitor.png')
+ plt.show()
+
+if __name__ == "__main__":
+
+ node_type = sys.argv[1]#enb or gnb
+
+ d={}
+ d['PHR']=[]
+ d['bler']=[]
+ d['mcsoff']=[]
+ d['mcs']=[]
+
+
+ cmd='ps aux | grep modem | grep -v grep'
+ process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ while len(output)!=0 :
+ collect(d, node_type)
+ process=subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ time.sleep(1)
+ print('process stopped')
+ with open(node_type+'_stats_monitor.pickle', 'wb') as handle:
+ pickle.dump(d, handle, protocol=pickle.HIGHEST_PROTOCOL)
+ graph(d, node_type)
+
+
diff --git a/ci-scripts/stats_monitor_conf.yaml b/ci-scripts/stats_monitor_conf.yaml
new file mode 100644
index 0000000000..6c0a2b0225
--- /dev/null
+++ b/ci-scripts/stats_monitor_conf.yaml
@@ -0,0 +1,11 @@
+enb :
+ PHR:
+ bler:
+ mcsoff:
+ mcs:
+
+gnb :
+ dlsch_err:
+ dlsch_err_perc_round_1:
+ ulsch_err:
+ ulsch_err_perc_round_1:
\ No newline at end of file
diff --git a/ci-scripts/stats_monitor_dev.py b/ci-scripts/stats_monitor_dev.py
new file mode 100755
index 0000000000..83de20f5d2
--- /dev/null
+++ b/ci-scripts/stats_monitor_dev.py
@@ -0,0 +1,101 @@
+"""
+To create graphs and pickle from runtime statistics in L1,MAC,RRC,PDCP files
+"""
+
+import subprocess
+import time
+import shlex
+import re
+import sys
+import pickle
+import matplotlib.pyplot as plt
+import numpy as np
+import yaml
+
+
+class StatMonitor():
+ def __init__(self,):
+ with open('stats_monitor_conf.yaml','r') as file:
+ self.d = yaml.load(file)
+ for node in self.d:
+ for metric in self.d[node]:
+ self.d[node][metric]=[]
+
+
+ def process_gnb (self,node_type,output):
+ for line in output:
+ tmp=line.decode("utf-8")
+ result=re.match(r'^.*\bdlsch_rounds\b ([0-9]+)\/([0-9]+).*\bdlsch_errors\b ([0-9]+)',tmp)
+ if result is not None:
+ self.d[node_type]['dlsch_err'].append(int(result.group(3)))
+ percentage=float(result.group(2))/float(result.group(1))
+ self.d[node_type]['dlsch_err_perc_round_1'].append(percentage)
+ result=re.match(r'^.*\bulsch_rounds\b ([0-9]+)\/([0-9]+).*\bulsch_errors\b ([0-9]+)',tmp)
+ if result is not None:
+ self.d[node_type]['ulsch_err'].append(int(result.group(3)))
+ percentage=float(result.group(2))/float(result.group(1))
+ self.d[node_type]['ulsch_err_perc_round_1'].append(percentage)
+
+
+ def process_enb (self,node_type,output):
+ for line in output:
+ tmp=line.decode("utf-8")
+ result=re.match(r'^.*\bPHR\b ([0-9]+).+\bbler\b ([0-9]+\.[0-9]+).+\bmcsoff\b ([0-9]+).+\bmcs\b ([0-9]+)',tmp)
+ if result is not None:
+ self.d[node_type]['PHR'].append(int(result.group(1)))
+ self.d[node_type]['bler'].append(float(result.group(2)))
+ self.d[node_type]['mcsoff'].append(int(result.group(3)))
+ self.d[node_type]['mcs'].append(int(result.group(4)))
+
+
+ def collect(self,node_type):
+ if node_type=='enb':
+ cmd='cat L1_stats.log MAC_stats.log PDCP_stats.log RRC_stats.log'
+ else: #'gnb'
+ cmd='cat nrL1_stats.log nrMAC_stats.log nrPDCP_stats.log nrRRC_stats.log'
+ process=subprocess.Popen(shlex.split(cmd), stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ if node_type=='enb':
+ self.process_enb(node_type,output)
+ else: #'gnb'
+ self.process_gnb(node_type,output)
+
+
+ def graph(self,node_type):
+ col = 1
+ figure, axis = plt.subplots(len(self.d[node_type]), col ,figsize=(10, 10))
+ i=0
+ for metric in self.d[node_type]:
+ major_ticks = np.arange(0, len(self.d[node_type][metric])+1, 1)
+ axis[i].set_xticks(major_ticks)
+ axis[i].set_xticklabels([])
+ axis[i].plot(self.d[node_type][metric],marker='o')
+ axis[i].set_xlabel('time')
+ axis[i].set_ylabel(metric)
+ axis[i].set_title(metric)
+ i+=1
+
+ plt.tight_layout()
+ # Combine all the operations and display
+ plt.savefig(node_type+'_stats_monitor.png')
+ plt.show()
+
+
+if __name__ == "__main__":
+
+ node = sys.argv[1]#enb or gnb
+ mon=StatMonitor()
+
+ #collecting stats when modem process is stopped
+ CMD='ps aux | grep mode | grep -v grep'
+ process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ while len(output)!=0 :
+ mon.collect(node)
+ process=subprocess.Popen(CMD, shell=True, stdout=subprocess.PIPE)
+ output = process.stdout.readlines()
+ time.sleep(1)
+ print('Process stopped')
+ with open(node+'_stats_monitor.pickle', 'wb') as handle:
+ pickle.dump(mon.d, handle, protocol=pickle.HIGHEST_PROTOCOL)
+ mon.graph(node)
diff --git a/ci-scripts/xml_files/fr1_enb_build.xml b/ci-scripts/xml_files/fr1_enb_build.xml
new file mode 100644
index 0000000000..084f58a591
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_enb_build.xml
@@ -0,0 +1,50 @@
+
+
+ build-tab
+ Build
+ wrench
+
+ 000001
+ 000002
+
+
+
+
+ Build_eNB
+ Build eNB
+ -w USRP -c --eNB --ninja
+ 0
+ 0
+ True
+ True
+
+
+
+ WaitEndBuild_eNB
+ Wait for end of Build eNB
+ 0
+ 0
+
+
+
diff --git a/ci-scripts/xml_files/fr1_gnb_build.xml b/ci-scripts/xml_files/fr1_gnb_build.xml
index d0c91f407d..43cff75620 100644
--- a/ci-scripts/xml_files/fr1_gnb_build.xml
+++ b/ci-scripts/xml_files/fr1_gnb_build.xml
@@ -26,7 +26,6 @@
wrench
000001
- 000002
@@ -36,7 +35,6 @@
-w USRP -c --gNB --ninja
0
0
- True
True
diff --git a/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml
new file mode 100644
index 0000000000..03d474aef0
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_lte_2x2_quectel.xml
@@ -0,0 +1,141 @@
+
+
+ TEST-LTE-TM2
+ LTE 2x2 Ping DL UL with QUECTEL
+ tasks
+ 1
+
+ 030000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000002
+ 070000
+ 070001
+ 000001
+ 010002
+ 080000
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ nrmodule2_quectel
+ yes
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ nrmodule2_quectel
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/enb.band38.lte_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
+ 0
+ 0
+ lte
+ yes
+ yes
+ 192.168.18.241
+
+
+
+
+ IdleSleep
+ Sleep
+ 5
+
+
+
+ IdleSleep
+ Sleep
+ 20
+
+
+
+
+ Ping
+ Ping: 20 pings
+ nrmodule2_quectel
+ -c 20
+ 5
+
+
+ Ping
+ Ping: 100 pings, size 1024
+ nrmodule2_quectel
+ -c 100 -s 1024 -i 0,2
+ 5
+
+
+
+
+ Iperf
+ iperf (DL/26Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 26M -t 60
+ DL
+ nrmodule2_quectel
+ 5
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/7Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 7M -t 60
+ UL
+ nrmodule2_quectel
+ 5
+ single-ue
+
+
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/fr1_multi_node_build.xml b/ci-scripts/xml_files/fr1_multi_node_build.xml
index 57c4685341..60bc734e65 100644
--- a/ci-scripts/xml_files/fr1_multi_node_build.xml
+++ b/ci-scripts/xml_files/fr1_multi_node_build.xml
@@ -26,7 +26,7 @@
wrench
000001 000002
- 000003 000004
+ 000004 000005 000003
@@ -64,5 +64,10 @@
1
+
+ IdleSleep
+ Sleep
+ 120
+
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
index a8e385b854..16dfd1e377 100644
--- a/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
+++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel.xml
@@ -21,10 +21,10 @@
-->
- TEST-NSA-FR1-TM1
- NSA Ping DL UL with QUECTEL
+ TEST-NSA-FR1-TM2-Tab1
+ NSA 2x2 Ping DL UL with QUECTEL
tasks
- 1
+ 5
030000
040000
@@ -32,6 +32,10 @@
010000
000001
050000
+ 050001
+ 000002
+ 070000
+ 070001
000001
010002
080001
@@ -57,11 +61,12 @@
Initialize_eNB
Initialize eNB
- -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf
+ -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
0
0
lte
yes
+ yes
192.168.18.241
@@ -69,17 +74,18 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q
+ -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
1
1
nr
+ yes
192.168.18.240
IdleSleep
Sleep
- 5
+ 60
@@ -94,15 +100,15 @@
Ping: 20pings in 20sec
nrmodule2_quectel
-c 20
- 50
+ 5
Ping
Ping: 100pings in 20sec
nrmodule2_quectel
- -c 100 -i 0.2
- 50
+ -c 100 -i 0,2
+ 5
@@ -111,17 +117,17 @@
-u -b 20M -t 60
DL
nrmodule2_quectel
- 50
+ 5
single-ue
Iperf
- iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ iperf (UL/1Mbps/UDP)(20 sec)(single-ue profile)
-u -b 3M -t 60
UL
nrmodule2_quectel
- 50
+ 5
single-ue
diff --git a/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml
new file mode 100644
index 0000000000..ebb5c880d5
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_nsa_2x2_quectel_attach_detach.xml
@@ -0,0 +1,145 @@
+
+
+ TEST-NSA-FR1-TM2-Tab2
+ NSA 2x2 Attach-Detach with QUECTEL
+ tasks
+ 5
+
+ 031000
+ 041000
+ 000002
+ 010000
+ 000001
+ 050000
+ 000002
+ 010004
+ 000002
+ 010003
+ 000001
+ 050000
+ 000002
+ 010004
+ 000002
+ 010003
+ 000001
+ 050000
+ 000002
+ 010002
+ 080001
+ 080000
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ nrmodule2_quectel
+ yes
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ nrmodule2_quectel
+
+
+
+ Attach_UE
+ Attach Quectel
+ nrmodule2_quectel
+
+
+
+ Detach_UE
+ Detach Quectel
+ nrmodule2_quectel
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/enb.band38.nsa_2x2.100PRB.usrpn310.conf --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
+ 0
+ 0
+ lte
+ yes
+ yes
+ 192.168.18.241
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
+ 1
+ 1
+ nr
+ yes
+ 192.168.18.240
+
+
+
+ IdleSleep
+ Sleep
+ 60
+
+
+
+ IdleSleep
+ Sleep
+ 20
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ nrmodule2_quectel
+ -c 20
+ 5
+
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/fr1_oai_cn_deploy.xml b/ci-scripts/xml_files/fr1_oai_cn_deploy.xml
index 919def7aa3..26dbebc329 100644
--- a/ci-scripts/xml_files/fr1_oai_cn_deploy.xml
+++ b/ci-scripts/xml_files/fr1_oai_cn_deploy.xml
@@ -33,7 +33,7 @@
Deploy_EPC
Deploy all EPC containers
- yaml_files/fr1_epc_tim
+ yaml_files/magma_nsa_20897
diff --git a/ci-scripts/xml_files/fr1_sa_quectel.xml b/ci-scripts/xml_files/fr1_sa_quectel.xml
index 4c8fba0611..b401465f80 100644
--- a/ci-scripts/xml_files/fr1_sa_quectel.xml
+++ b/ci-scripts/xml_files/fr1_sa_quectel.xml
@@ -31,6 +31,9 @@
010000
000001
050000
+ 050001
+ 070000
+ 070001
000001
010002
080000
@@ -55,11 +58,12 @@
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.usrpn310.conf --sa -q
+ -O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --thread-pool 0,2,4,6
0
0
nr
yes
+ yes
192.168.18.240
@@ -81,15 +85,15 @@
Ping: 20pings in 20sec
nrmodule2_quectel
-c 20
- 50
+ 5
Ping
Ping: 100pings in 20sec
nrmodule2_quectel
- -c 100 -i 0.2
- 50
+ -c 100 -i 0,2
+ 5
@@ -98,7 +102,7 @@
-u -b 20M -t 60
DL
nrmodule2_quectel
- 50
+ 5
single-ue
@@ -108,7 +112,7 @@
-u -b 3M -t 60
UL
nrmodule2_quectel
- 50
+ 5
single-ue
diff --git a/ci-scripts/yaml_files/fr1_epc_tim/docker-compose.yml b/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml
similarity index 95%
rename from ci-scripts/yaml_files/fr1_epc_tim/docker-compose.yml
rename to ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml
index 73a6b3a1ff..0005ce8844 100644
--- a/ci-scripts/yaml_files/fr1_epc_tim/docker-compose.yml
+++ b/ci-scripts/yaml_files/fr1_epc_20897/docker-compose.yml
@@ -51,7 +51,7 @@ services:
LTE_K: FEC86BA6EB707ED08905757B1BB44B8F
APN1: oai.ipv4
APN2: oai2.ipv4
- FIRST_IMSI: 208990100001127
+ FIRST_IMSI: 208970100001127
NB_USERS: 5
healthcheck:
test: /bin/bash -c "pgrep oai_hss"
@@ -78,7 +78,7 @@ services:
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
MCC: '208'
- MNC: '99'
+ MNC: '97'
MME_GID: 32768
MME_CODE: 3
TAC_0: 1
@@ -97,15 +97,15 @@ services:
PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
MCC_SGW_0: '208'
- MNC3_SGW_0: '099'
+ MNC3_SGW_0: '097'
TAC_LB_SGW_0: '01'
TAC_HB_SGW_0: '00'
MCC_MME_0: '208'
- MNC3_MME_0: '099'
+ MNC3_MME_0: '097'
TAC_LB_MME_0: '02'
TAC_HB_MME_0: '00'
MCC_MME_1: '208'
- MNC3_MME_1: '099'
+ MNC3_MME_1: '097'
TAC_LB_MME_1: '03'
TAC_HB_MME_1: '00'
TAC_LB_SGW_TEST_0: '03'
@@ -138,11 +138,12 @@ services:
UE_IP_ADDRESS_POOL_1: '12.1.1.2 - 12.1.1.254'
UE_IP_ADDRESS_POOL_2: '12.0.0.2 - 12.0.0.254'
MCC: '208'
- MNC: '99'
- MNC03: '099'
+ MNC: '97'
+ MNC03: '097'
TAC: 1
GW_ID: 1
REALM: openairinterface.org
+ UE_MTU_IPV4: 1500
healthcheck:
test: /bin/bash -c "pgrep oai_spgwc"
interval: 10s
@@ -168,8 +169,8 @@ services:
NETWORK_UE_IP: '12.1.1.0/24'
NETWORK_UE_NAT_OPTION: 'yes'
MCC: '208'
- MNC: '99'
- MNC03: '099'
+ MNC: '97'
+ MNC03: '097'
TAC: 1
GW_ID: 1
REALM: openairinterface.org
diff --git a/ci-scripts/yaml_files/fr1_epc_tim/docker-compose.yml.orig b/ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml
similarity index 62%
rename from ci-scripts/yaml_files/fr1_epc_tim/docker-compose.yml.orig
rename to ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml
index 28ae154838..df14e900e7 100644
--- a/ci-scripts/yaml_files/fr1_epc_tim/docker-compose.yml.orig
+++ b/ci-scripts/yaml_files/magma_nsa_20897/docker-compose.yml
@@ -40,17 +40,18 @@ services:
private_net:
ipv4_address: 192.168.68.3
public_net:
- ipv4_address: 192.168.61.2
+ ipv4_address: 192.168.61.194
environment:
+ TZ: Europe/Paris
REALM: openairinterface.org
HSS_FQDN: hss.openairinterface.org
PREFIX: /openair-hss/etc
cassandra_Server_IP: 192.168.68.2
OP_KEY: 1006020f0a478bf6b699f15c062e42b3
- LTE_K: fec86ba6eb707ed08905757b1bb44b8f
+ LTE_K: FEC86BA6EB707ED08905757B1BB44B8F
APN1: oai.ipv4
- APN2: internet
- FIRST_IMSI: 222010100001120
+ APN2: oai2.ipv4
+ FIRST_IMSI: 208970100001127
NB_USERS: 10
healthcheck:
test: /bin/bash -c "pgrep oai_hss"
@@ -58,57 +59,45 @@ services:
timeout: 5s
retries: 5
- oai_mme:
- image: oai-mme:production
- container_name: prod-oai-mme
+ redis:
+ image: redis:6.0.5
+ container_name: prod-redis
privileged: true
- depends_on: [oai_hss]
networks:
public_net:
- ipv4_address: 192.168.61.3
+ ipv4_address: 192.168.61.198
+ volumes:
+ - ./redis_extern.conf:/usr/local/etc/redis/redis.conf
+ entrypoint: /bin/bash -c "redis-server /usr/local/etc/redis/redis.conf"
+ healthcheck:
+ test: /bin/bash -c "redis-cli -h 192.168.61.198 -p 6380 ping"
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+ magma_mme:
+ image: magma-mme:production
+ container_name: prod-magma-mme
+ hostname: mme
+ privileged: true
+ depends_on: [oai_hss, redis]
+ networks:
+ public_net:
+ ipv4_address: 192.168.61.195
environment:
+ TZ: Europe/Paris
REALM: openairinterface.org
PREFIX: /openair-mme/etc
- INSTANCE: 1
- PID_DIRECTORY: /var/run
- HSS_IP_ADDR: 192.168.61.2
HSS_HOSTNAME: hss
HSS_FQDN: hss.openairinterface.org
HSS_REALM: openairinterface.org
- MCC: '222'
- MNC: '01'
- MME_GID: 32768
- MME_CODE: 3
- TAC_0: 1
- TAC_1: 2
- TAC_2: 3
MME_FQDN: mme.openairinterface.org
- MME_S6A_IP_ADDR: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S1_MME: eth0
- MME_IPV4_ADDRESS_FOR_S1_MME: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S11: eth0
- MME_IPV4_ADDRESS_FOR_S11: 192.168.61.3
- MME_INTERFACE_NAME_FOR_S10: lo
- MME_IPV4_ADDRESS_FOR_S10: 127.0.0.10
- OUTPUT: CONSOLE
- SGW_IPV4_ADDRESS_FOR_S11_0: 192.168.61.4
- PEER_MME_IPV4_ADDRESS_FOR_S10_0: 0.0.0.0
- PEER_MME_IPV4_ADDRESS_FOR_S10_1: 0.0.0.0
- MCC_SGW_0: '222'
- MNC3_SGW_0: '001'
- TAC_LB_SGW_0: '01'
- TAC_HB_SGW_0: '00'
- MCC_MME_0: '222'
- MNC3_MME_0: '001'
- TAC_LB_MME_0: '02'
- TAC_HB_MME_0: '00'
- MCC_MME_1: '222'
- MNC3_MME_1: '001'
- TAC_LB_MME_1: '03'
- TAC_HB_MME_1: '00'
- TAC_LB_SGW_TEST_0: '03'
- TAC_HB_SGW_TEST_0: '00'
- SGW_IPV4_ADDRESS_FOR_S11_TEST_0: 0.0.0.0
+ FEATURES: mme_oai
+ volumes:
+ - ./mme_fd.sprint.conf:/magma-mme/etc/mme_fd.conf.tmplt
+ - ./mme.conf:/magma-mme/etc/mme.conf
+ - ./entrypoint.sh:/magma-mme/bin/entrypoint.sh
+ entrypoint: /bin/bash -c "/magma-mme/bin/entrypoint.sh"
healthcheck:
test: /bin/bash -c "pgrep oai_mme"
interval: 10s
@@ -118,22 +107,30 @@ services:
oai_spgwc:
image: oai-spgwc:production
privileged: true
- depends_on: [oai_mme]
+ depends_on: [magma_mme]
container_name: prod-oai-spgwc
networks:
public_net:
- ipv4_address: 192.168.61.4
+ ipv4_address: 192.168.61.196
environment:
- PID_DIRECTORY: /var/run
+ TZ: Europe/Paris
SGW_INTERFACE_NAME_FOR_S11: eth0
- SGW_IP_FOR_S5_S8_CP: 127.0.0.11/8
- PGW_IP_FOR_S5_S8_CP: 127.0.0.12/8
PGW_INTERFACE_NAME_FOR_SX: eth0
- DEFAULT_APN: oai.ipv4
DEFAULT_DNS_IPV4_ADDRESS: 192.168.18.129
DEFAULT_DNS_SEC_IPV4_ADDRESS: 8.8.4.4
- UE_IP_ADDRESS_POOL: '12.1.1.2 - 12.1.1.254'
- PUSH_PROTOCOL_OPTION: 'yes'
+ PUSH_PROTOCOL_OPTION: 'true'
+ APN_NI_1: oai.ipv4
+ APN_NI_2: oai2.ipv4
+ DEFAULT_APN_NI_1: oai.ipv4
+ UE_IP_ADDRESS_POOL_1: '12.1.1.2 - 12.1.1.254'
+ UE_IP_ADDRESS_POOL_2: '12.0.0.2 - 12.0.0.254'
+ MCC: '208'
+ MNC: '97'
+ MNC03: '097'
+ TAC: 1
+ GW_ID: 1
+ REALM: openairinterface.org
+ UE_MTU_IPV4: 1500
healthcheck:
test: /bin/bash -c "pgrep oai_spgwc"
interval: 10s
@@ -147,45 +144,39 @@ services:
depends_on: [oai_spgwc]
networks:
public_net:
- ipv4_address: 192.168.61.5
+ ipv4_address: 192.168.61.197
environment:
+ TZ: Europe/Paris
PID_DIRECTORY: /var/run
INSTANCE: 1
SGW_INTERFACE_NAME_FOR_S1U_S12_S4_UP: eth0
PGW_INTERFACE_NAME_FOR_SGI: eth0
SGW_INTERFACE_NAME_FOR_SX: eth0
- SPGWC0_IP_ADDRESS: 192.168.61.4
+ SPGWC0_IP_ADDRESS: 192.168.61.196
NETWORK_UE_IP: '12.1.1.0/24'
NETWORK_UE_NAT_OPTION: 'yes'
+ MCC: '208'
+ MNC: '97'
+ MNC03: '097'
+ TAC: 1
+ GW_ID: 1
+ REALM: openairinterface.org
healthcheck:
test: /bin/bash -c "pgrep oai_spgwu"
interval: 10s
timeout: 5s
retries: 5
- flexran_rtc:
- image: flexran-rtc:production
- privileged: true
- container_name: prod-flexran-rtc
- networks:
- public_net:
- ipv4_address: 192.168.61.10
- healthcheck:
- test: /bin/bash -c "pgrep rt_controller"
- interval: 10s
- timeout: 5s
- retries: 5
-
trf_gen:
image: trf-gen:production
privileged: true
container_name: prod-trf-gen
networks:
public_net:
- ipv4_address: 192.168.61.11
- entrypoint: /bin/bash -c "ip route add 12.1.1.0/24 via 192.168.61.5 dev eth0; sleep infinity"
+ ipv4_address: 192.168.61.200
+ entrypoint: /bin/bash -c "ip route add 12.1.1.0/24 via 192.168.61.197 dev eth0; sleep infinity"
healthcheck:
- test: /bin/bash -c "ping -c 2 192.168.61.5"
+ test: /bin/bash -c "ip route | grep '12.1.1.0'"
interval: 10s
timeout: 5s
retries: 5
@@ -196,8 +187,12 @@ networks:
ipam:
config:
- subnet: 192.168.68.0/26
+ driver_opts:
+ com.docker.network.bridge.name: "oai-priv-net"
public_net:
name: prod-oai-public-net
ipam:
config:
- - subnet: 192.168.61.0/26
+ - subnet: 192.168.61.192/26
+ driver_opts:
+ com.docker.network.bridge.name: "oai-pub-net"
diff --git a/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh b/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh
new file mode 100755
index 0000000000..859ff7d98f
--- /dev/null
+++ b/ci-scripts/yaml_files/magma_nsa_20897/entrypoint.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+INSTANCE=1
+PREFIX='/magma-mme/etc'
+MY_REALM='openairinterface.org'
+
+declare -A MME_CONF
+
+pushd $PREFIX
+MME_CONF[@MME_S6A_IP_ADDR@]="192.168.61.195"
+MME_CONF[@INSTANCE@]=$INSTANCE
+MME_CONF[@PREFIX@]=$PREFIX
+MME_CONF[@REALM@]=$MY_REALM
+MME_CONF[@MME_FQDN@]="mme.${MME_CONF[@REALM@]}"
+MME_CONF[@HSS_HOSTNAME@]='hss'
+MME_CONF[@HSS_FQDN@]="${MME_CONF[@HSS_HOSTNAME@]}.${MME_CONF[@REALM@]}"
+MME_CONF[@HSS_IP_ADDR@]="192.168.61.194"
+
+cp mme_fd.conf.tmplt $PREFIX/mme_fd.conf
+
+for K in "${!MME_CONF[@]}"; do
+ egrep -lRZ "$K" $PREFIX/mme_fd.conf | xargs -0 -l sed -i -e "s|$K|${MME_CONF[$K]}|g"
+ ret=$?;[[ ret -ne 0 ]] && echo "Tried to replace $K with ${MME_CONF[$K]}"
+done
+
+sed -i -e "s@etc/freeDiameter@etc@" /magma-mme/etc/mme_fd.conf
+sed -i -e "s@bind: 127.0.0.1@bind: 192.168.61.198@" /etc/magma/redis.yml
+# Generate freeDiameter certificate
+popd
+cd /magma-mme/scripts
+./check_mme_s6a_certificate $PREFIX mme.${MME_CONF[@REALM@]}
+
+cd /magma-mme
+nohup /magma-mme/bin/sctpd > /var/log/sctpd.log 2>&1 &
+sleep 5
+/magma-mme/bin/oai_mme -c /magma-mme/etc/mme.conf
diff --git a/ci-scripts/yaml_files/magma_nsa_20897/mme.conf b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf
new file mode 100644
index 0000000000..e41fbe6304
--- /dev/null
+++ b/ci-scripts/yaml_files/magma_nsa_20897/mme.conf
@@ -0,0 +1,136 @@
+# generated by generate_mme_config_script.py
+MME :
+{
+ REALM = "openairinterface.org"
+ PID_DIRECTORY = "/var/run";
+ MAXENB = 8; # power of 2
+ MAXUE = 16; # power of 2
+ RELATIVE_CAPACITY = 10;
+
+ EMERGENCY_ATTACH_SUPPORTED = "no";
+ UNAUTHENTICATED_IMSI_SUPPORTED = "no";
+
+ # EPS network feature support
+ EPS_NETWORK_FEATURE_SUPPORT_IMS_VOICE_OVER_PS_SESSION_IN_S1 = "no"; # DO NOT CHANGE
+ EPS_NETWORK_FEATURE_SUPPORT_EMERGENCY_BEARER_SERVICES_IN_S1_MODE = "no"; # DO NOT CHANGE
+ EPS_NETWORK_FEATURE_SUPPORT_LOCATION_SERVICES_VIA_EPC = "no"; # DO NOT CHANGE
+ EPS_NETWORK_FEATURE_SUPPORT_EXTENDED_SERVICE_REQUEST = "no"; # DO NOT CHANGE
+
+ # Display statistics about whole system (expressed in seconds)
+ MME_STATISTIC_TIMER = 10;
+ IP_CAPABILITY = "IPV4"; # UE PDN_TYPE
+ USE_STATELESS = "";
+
+ INTERTASK_INTERFACE :
+ {
+ # max queue size per task
+ ITTI_QUEUE_SIZE = 2000000;
+ };
+
+ S6A :
+ {
+ S6A_CONF = "/magma-mme/etc/mme_fd.conf"; # YOUR MME freeDiameter config file path
+ HSS_HOSTNAME = "hss.openairinterface.org";
+ HSS_REALM = "openairinterface.org";
+ };
+
+ # ------- SCTP definitions
+ SCTP :
+ {
+ # Number of streams to use in input/output
+ SCTP_INSTREAMS = 8;
+ SCTP_OUTSTREAMS = 8;
+ };
+
+ # ------- S1AP definitions
+ S1AP :
+ {
+ # outcome drop timer value (seconds)
+ S1AP_OUTCOME_TIMER = 10;
+ };
+
+ # ------- MME served GUMMEIs
+ GUMMEI_LIST = (
+ { MCC="208" ; MNC="97"; MME_GID="32768" ; MME_CODE="3"; }
+ );
+
+ # ------- MME served TAIs
+ TAI_LIST = (
+ {MCC="208" ; MNC="97"; TAC = "1"; },
+ {MCC="208" ; MNC="97"; TAC = "2"; },
+ {MCC="208" ; MNC="97"; TAC = "3"; }
+ );
+
+ TAC_LIST = (
+ {MCC="208" ; MNC="97"; TAC = "1"; }
+ );
+
+ CSFB :
+ {
+ NON_EPS_SERVICE_CONTROL = "OFF";
+ CSFB_MCC = "208";
+ CSFB_MNC = "97";
+ LAC = "1";
+ };
+ NAS :
+ {
+ ORDERED_SUPPORTED_INTEGRITY_ALGORITHM_LIST = [ "EIA2" , "EIA1" , "EIA0" ];
+ ORDERED_SUPPORTED_CIPHERING_ALGORITHM_LIST = [ "EEA0" , "EEA1" , "EEA2" ];
+ T3402 = 1 # in minutes (default is 12 minutes)
+ T3412 = 54 # in minutes (default is 54 minutes, network dependent)
+ T3422 = 6 # in seconds (default is 6s)
+ T3450 = 6 # in seconds (default is 6s)
+ T3460 = 6 # in seconds (default is 6s)
+ T3470 = 6 # in seconds (default is 6s)
+ T3485 = 8 # UNUSED in seconds (default is 8s)
+ T3486 = 8 # UNUSED in seconds (default is 8s)
+ T3489 = 4 # UNUSED in seconds (default is 4s)
+ T3495 = 8 # UNUSED in seconds (default is 8s)
+ };
+
+ SGS :
+ {
+ TS6_1 = 10 # in seconds (default is 10s)
+ TS8 = 4 # in seconds (default is 4s)
+ TS9 = 2 # in seconds (default is 4s)
+ TS10 = 4 # in seconds (default is 4s)
+ TS13 = 4 # in seconds (default is 4s)
+ };
+
+ NETWORK_INTERFACES :
+ {
+ MME_INTERFACE_NAME_FOR_S1_MME = "eth0";
+ MME_IPV4_ADDRESS_FOR_S1_MME = "192.168.61.195/24";
+ MME_INTERFACE_NAME_FOR_S11_MME = "eth0";
+ MME_IPV4_ADDRESS_FOR_S11_MME = "192.168.61.195/24";
+ MME_PORT_FOR_S11_MME = 2123;
+ };
+
+ LOGGING :
+ {
+ OUTPUT = "CONSOLE";
+ THREAD_SAFE = "no";
+ COLOR = "no";
+
+ SCTP_LOG_LEVEL = "ERROR";
+ GTPV1U_LOG_LEVEL = "INFO";
+ SPGW_APP_LOG_LEVEL = "INFO";
+ UDP_LOG_LEVEL = "INFO";
+ S1AP_LOG_LEVEL = "DEBUG";
+ NAS_LOG_LEVEL = "INFO";
+ MME_APP_LOG_LEVEL = "DEBUG";
+ GTPV2C_LOG_LEVEL = "INFO";
+ S11_LOG_LEVEL = "DEBUG";
+ S6A_LOG_LEVEL = "DEBUG";
+ UTIL_LOG_LEVEL = "INFO";
+ MSC_LOG_LEVEL = "ERROR";
+ ITTI_LOG_LEVEL = "ERROR";
+ MME_SCENARIO_PLAYER_LOG_LEVEL = "ERROR";
+ ASN1_VERBOSITY = "INFO";
+ };
+
+ S-GW :
+ {
+ SGW_IPV4_ADDRESS_FOR_S11 = "192.168.61.196";
+ };
+};
diff --git a/ci-scripts/yaml_files/magma_nsa_20897/mme_fd.sprint.conf b/ci-scripts/yaml_files/magma_nsa_20897/mme_fd.sprint.conf
new file mode 100644
index 0000000000..6f87ed8c2b
--- /dev/null
+++ b/ci-scripts/yaml_files/magma_nsa_20897/mme_fd.sprint.conf
@@ -0,0 +1,169 @@
+# -------- Local ---------
+
+# Uncomment if the framework cannot resolv it.
+Identity = "@MME_FQDN@";
+Realm = "@REALM@";
+
+# TLS configuration (see previous section)
+TLS_Cred = "@PREFIX@/freeDiameter/mme.cert.pem",
+ "@PREFIX@/freeDiameter/mme.key.pem";
+TLS_CA = "@PREFIX@/freeDiameter/mme.cacert.pem";
+
+# Disable use of TCP protocol (only listen and connect in SCTP)
+# Default : TCP enabled
+No_SCTP;
+
+# This option is ignored if freeDiameter is compiled with DISABLE_SCTP option.
+# Prefer TCP instead of SCTP for establishing new connections.
+# This setting may be overwritten per peer in peer configuration blocs.
+# Default : SCTP is attempted first.
+Prefer_TCP;
+
+
+No_IPv6;
+
+# Overwrite the number of SCTP streams. This value should be kept low,
+# especially if you are using TLS over SCTP, because it consumes a lot of
+# resources in that case. See tickets 19 and 27 for some additional details on
+# this.
+# Limit the number of SCTP streams
+SCTP_streams = 3;
+
+
+# By default, freeDiameter acts as a Diameter Relay Agent by forwarding all
+# messages it cannot handle locally. This parameter disables this behavior.
+NoRelay;
+
+# Use RFC3588 method for TLS protection, where TLS is negociated after CER/CEA exchange is completed
+# on the unsecure connection. The alternative is RFC6733 mechanism, where TLS protects also the
+# CER/CEA exchange on a dedicated secure port.
+# This parameter only affects outgoing connections.
+# The setting can be also defined per-peer (see Peers configuration section).
+# Default: use RFC6733 method with separate port for TLS.
+
+#TLS_old_method;
+
+AppServThreads = 4;
+
+# Specify the addresses on which to bind the listening server. This must be
+# specified if the framework is unable to auto-detect these addresses, or if the
+# auto-detected values are incorrect. Note that the list of addresses is sent
+# in CER or CEA message, so one should pay attention to this parameter if some
+# adresses should be kept hidden.
+ListenOn = "@MME_S6A_IP_ADDR@";
+
+Port = 3870;
+SecPort = 5870;
+
+# -------- Extensions ---------
+
+# Uncomment (and create rtd.conf) to specify routing table for this peer.
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx" : "rtd.conf";
+
+#LoadExtension = "/usr/local/lib/freeDiameter/_sample.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_acct.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_diameap.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_radgw.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_redirect.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/app_sip.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_interactive.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_monitor.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_dumps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_msg_timings.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dbg_rt.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_3gpp2_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_CreditControl.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_CxDx.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Gx.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_NAS.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Ro.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rx.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_S6mS6n.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_SGd.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_SLh.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sd.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Sh.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_T4.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_T6aT6bT7.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Tsp.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_3gpp.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_dcca_starent.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_draftload_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_eap.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_etsi283034_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_legacy_xml.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6a.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_mip6i.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_nas_mipv6.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_nasreq.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4004_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4006bis_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4072_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc4590_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5447_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5580_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5777_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc5778_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6734_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc6942_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7155_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7683_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_rfc7944_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_sip.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29061_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29128_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29154_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29173_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29212_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29214_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29215_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29217_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29229_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29272_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29273_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29329_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29336_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29337_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29338_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29343_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29344_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29345_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29368_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts29468_avps.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_ts32299_avps.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_busypeers.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_default.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_ereg.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_ignore_dh.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_load_balance.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_randomize.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/rt_redirect.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_acct.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_app.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_hss.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_netemul.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_rt_any.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/test_sip.fdx";
+#LoadExtension = "/usr/local/lib/freeDiameter/dict_Rf.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_S6as6d.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_S6t.fdx";
+LoadExtension = "/usr/local/lib/freeDiameter/dict_S6c.fdx";
+
+
+# -------- Peers ---------
+
+# The framework will actively attempt to establish and maintain a connection
+# with the peers listed here.
+# For only accepting incoming connections, see the acl_wl.fx extension.
+
+# ConnectPeer
+# Declare a remote peer to which this peer must maintain a connection.
+# In addition, this allows specifying non-default parameters for this peer only
+# (for example disable SCTP with this peer, or use RFC3588-flavour TLS).
+# Note that by default, if a peer is not listed as a ConnectPeer entry, an
+# incoming connection from this peer will be rejected. If you want to accept
+# incoming connections from other peers, see the acl_wl.fdx? extension which
+# allows exactly this.
+
+ConnectPeer= "@HSS_FQDN@" { ConnectTo = "@HSS_IP_ADDR@"; No_SCTP ; No_IPv6; Prefer_TCP; No_TLS; port = 3868;};
diff --git a/ci-scripts/yaml_files/magma_nsa_20897/redis_extern.conf b/ci-scripts/yaml_files/magma_nsa_20897/redis_extern.conf
new file mode 100644
index 0000000000..565524080a
--- /dev/null
+++ b/ci-scripts/yaml_files/magma_nsa_20897/redis_extern.conf
@@ -0,0 +1,33 @@
+#
+# Copyright (c) 2016-present, Facebook, Inc.
+# All rights reserved.
+#
+# This source code is licensed under the BSD-style license found in the
+# LICENSE file in the root directory of this source tree. An additional grant
+# of patent rights can be found in the PATENTS file in the same directory.
+
+# Jinja template for Redis configuration
+# See the default config file for options and explanations:
+# https://github.com/antirez/redis/blob/unstable/redis.conf
+
+# TODO: make sensible, production-aware config decisions
+
+bind 192.168.61.198
+port 6380
+
+daemonize no
+loglevel notice
+
+timeout 0
+databases 1
+
+dbfilename redis_dump.rdb
+dir /data
+
+# Save the DB on disk
+
+save 900 1
+
+save 300 10
+
+save 60 1000
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index cad45fd7ef..8ad515625d 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -309,6 +309,7 @@ endif()
#
# add autotools definitions that were maybe used!
+
add_definitions("-DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP")
set(commonOpts "-pipe -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic")
@@ -318,11 +319,7 @@ set(CMAKE_C_FLAGS
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} ${commonOpts} -std=c++11")
-# cuda compiler bug (limitation) on complex macro definition
-if (CUDA_FOUND)
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DCUDA_FLAG")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DCUDA_FLAG")
-endif()
+
if (SANITIZE_ADDRESS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common")
@@ -1588,6 +1585,16 @@ set(PHY_LDPC_OPTIM8SEGMULTI_SRC
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
)
+set(PHY_LDPC_CUDA_SRC
+ ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
+ ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
+)
+
+set(PHY_LDPC_CL_SRC
+ ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c
+ ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_encoder/ldpc_encoder_optim8segmulti.c
+)
+
set(PHY_NR_CODINGIF
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_load.c;
)
@@ -1595,8 +1602,18 @@ set(PHY_NR_CODINGIF
add_library(ldpc_orig MODULE ${PHY_LDPC_ORIG_SRC} )
add_library(ldpc_optim MODULE ${PHY_LDPC_OPTIM_SRC} )
add_library(ldpc_optim8seg MODULE ${PHY_LDPC_OPTIM8SEG_SRC} )
+add_library(ldpc_cl MODULE ${PHY_LDPC_CL_SRC} )
+target_link_libraries(ldpc_cl OpenCL)
+
+if (CUDA_FOUND)
+ cuda_add_library(ldpc_cuda MODULE ${PHY_LDPC_CUDA_SRC} )
+ set_target_properties(ldpc_cuda PROPERTIES CUDA_SEPARABLE_COMPILATION ON)
+# CUDA_ADD_CUFFT_TO_TARGET(ldpc_cuda)
+endif (CUDA_FOUND)
+
add_library(ldpc MODULE ${PHY_LDPC_OPTIM8SEGMULTI_SRC} )
+
add_library(coding MODULE ${PHY_TURBOSRC} )
add_library(dfts MODULE ${OPENAIR1_DIR}/PHY/TOOLS/oai_dfts.c )
@@ -1742,7 +1759,6 @@ set(PHY_SRC_UE
set(PHY_NR_SRC_COMMON
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_prach_common.c
- ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_dci_tools_common.c
)
set(PHY_NR_SRC
@@ -1981,6 +1997,10 @@ set(NR_PDCP_SRC
${OPENAIR2_DIR}/LAYER2/nr_pdcp/asn1_utils.c
)
+set(NR_SDAP_SRC
+ ${OPENAIR2_DIR}/SDAP/nr_sdap/nr_sdap_gnb.c
+ )
+
set(L2_SRC
${PDCP_DIR}/pdcp.c
${PDCP_DIR}/pdcp_fifo.c
@@ -2024,6 +2044,7 @@ set(L2_LTE_SRC
set(L2_NR_SRC
${NR_RLC_SRC}
${NR_PDCP_SRC}
+ ${NR_SDAP_SRC}
${NR_RRC_DIR}/rrc_gNB.c
${NR_RRC_DIR}/nr_rrc_common.c
${NR_RRC_DIR}/L2_nr_interface.c
@@ -2059,6 +2080,7 @@ set(L2_RRC_SRC_UE
set(NR_L2_SRC_UE
${NR_RLC_SRC}
${NR_PDCP_SRC}
+ ${NR_SDAP_SRC}
${NR_UE_RRC_DIR}/L2_interface_ue.c
${NR_UE_RRC_DIR}/main_ue.c
${NR_UE_RRC_DIR}/rrc_UE.c
@@ -3110,7 +3132,11 @@ target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-uesoftmodem ${T_LIB})
add_dependencies( nr-uesoftmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
-
+if (CUDA_FOUND)
+ add_dependencies( nr-uesoftmodem ldpc_cuda)
+ add_dependencies( nr-softmodem ldpc_cuda)
+ add_dependencies( ocp-gnb ldpc_cuda)
+endif (CUDA_FOUND)
###################################"
# Addexecutables for tests
####################################
@@ -3170,46 +3196,18 @@ target_link_libraries(smallblocktest
m pthread ${ATLAS_LIBRARIES} dl
)
-if (CUDA_FOUND)
-###################################################
-# For CUDA library
-###################################################
- CUDA_ADD_LIBRARY(LDPC_CU
- ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
- )
- CUDA_ADD_CUFFT_TO_TARGET(LDPC_CU)
- cuda_add_executable(ldpctest
- ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
- ${T_SOURCE}
- ${SHLIB_LOADER_SOURCES}
- )
- target_link_libraries(ldpctest -ldl
- -Wl,--start-group
- LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
- -Wl,--end-group
- m pthread ${ATLAS_LIBRARIES} dl
- )
+add_executable(ldpctest
+ ${PHY_NR_CODINGIF}
+ ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
+ ${T_SOURCE}
+ ${SHLIB_LOADER_SOURCES}
+ )
-else (CUDA_FOUND)
- add_executable(ldpctest
- ${PHY_NR_CODINGIF}
- ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
- ${T_SOURCE}
- ${SHLIB_LOADER_SOURCES}
- )
-
-endif ()
-
-
-# add_executable(ldpctest
- # ${PHY_NR_CODINGIF}
- # ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
- # ${T_SOURCE}
- # ${SHLIB_LOADER_SOURCES}
- # )
add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
-
+if (CUDA_FOUND)
+ add_dependencies( ldpctest ldpc_cuda)
+endif (CUDA_FOUND)
target_link_libraries(ldpctest
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} dl
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index c9390d67ce..c68ca8a553 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -551,7 +551,7 @@ function main() {
if [ "$HW" == "OAI_USRP" ] ; then
echo_info "installing packages for USRP support"
check_install_usrp_uhd_driver
- if [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
+ if [ ! -v BUILD_UHD_FROM_SOURCE ] && [ ! "$DISABLE_HARDWARE_DEPENDENCY" == "True" ]; then
install_usrp_uhd_driver $UHD_IMAGES_DIR
fi
fi
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index d3fcf615e2..c5cc9d054d 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -317,19 +317,30 @@ install_usrp_uhd_driver_from_source(){
echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log "
(
pushd /tmp
- echo "Downloading UHD driver"
+ echo "Cloning UHD driver repository"
rm -rf /tmp/uhd
git clone https://github.com/EttusResearch/uhd.git
cd uhd
- git checkout tags/v4.0.0.0
+ if [[ -v UHD_VERSION ]]; then
+ git checkout tags/v${UHD_VERSION}
+ else
+ git checkout tags/v4.0.0.0
+ fi
mkdir -p host/build
- cd host/build
- $CMAKE ../
+ cd host/build || true
+ $CMAKE ../ -GNinja
echo "Compiling UHD"
- make -j`nproc`
- make test
- $SUDO make install
+ ninja
+ $SUDO ninja install
$SUDO ldconfig -v
+ if [ $IS_CONTAINER -eq 0 ]; then
+ if [[ "$OS_DISTRO" == "ubuntu" ]]; then
+ $SUDO /usr/local/lib/uhd/utils/uhd_images_downloader.py
+ fi
+ if [[ "$OS_DISTRO" == "rhel" ]]; then
+ $SUDO /usr/local/lib64/uhd/utils/uhd_images_downloader.py
+ fi
+ fi
popd
rm -rf /tmp/uhd
) >& $uhd_install_log
@@ -338,10 +349,26 @@ install_usrp_uhd_driver_from_source(){
check_install_usrp_uhd_driver(){
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
#first we remove old installation
- $SUDO apt-get remove -y uhd || true
- $SUDO apt-get remove libuhd-dev libuhd003 uhd-host -y || true
+ $SUDO apt-get remove uhd -y || true
+ $SUDO apt-get remove uhd-host -y || true
+ $SUDO apt-get remove libuhd-dev -y || true
+ $SUDO apt-get remove libuhd003 -y || true
+ $SUDO apt-get remove libuhd3.13.1 -y || true
+ $SUDO apt-get remove libuhd3.14.0 -y || true
+ $SUDO apt-get remove libuhd3.14.1 -y || true
+ $SUDO apt-get remove libuhd3.15.0 -y || true
+ local distribution=$(get_distribution_release)
+ if [[ "$distribution" == "ubuntu18.04" ]]; then
+ $SUDO apt-get remove libuhd4.0.0 -y || true
+ $SUDO apt-get remove libuhd4.1.0 -y || true
+ fi
v=$(lsb_release -cs)
$SUDO apt-add-repository --remove "deb http://files.ettus.com/binaries/uhd/repo/uhd/ubuntu/$v $v main"
+ if [[ -v BUILD_UHD_FROM_SOURCE ]]; then
+ $SUDO apt-get install -y libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-setuptools ninja-build
+ install_usrp_uhd_driver_from_source
+ return
+ fi
# The new USRP repository
# Raphael Defosseux: Adding a loop on adding PPA because in CI the gpg key retrieve may
# timeout due to proxy / network latencies in Eurecom on VM
@@ -361,7 +388,12 @@ check_install_usrp_uhd_driver(){
done
$SUDO apt-get update
$SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev
- $SUDO apt-get -y install libuhd-dev libuhd003 uhd-host
+ if [[ "$distribution" == "ubuntu16.04" ]]; then
+ $SUDO apt-get -y install libuhd-dev libuhd3.15.0 uhd-host
+ fi
+ if [[ "$distribution" == "ubuntu18.04" ]]; then
+ $SUDO apt-get -y install libuhd-dev libuhd4.1.0 uhd-host
+ fi
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
if [ $IS_CONTAINER -eq 0 ]
then
@@ -692,6 +724,7 @@ check_install_oai_software() {
build-essential \
$CMAKE \
cmake-curses-gui \
+ curl \
ninja-build \
doxygen \
doxygen-gui \
diff --git a/common/utils/DOC/loader/devusage/api.md b/common/utils/DOC/loader/devusage/api.md
index a6e59c5938..41a0807a24 100644
--- a/common/utils/DOC/loader/devusage/api.md
+++ b/common/utils/DOC/loader/devusage/api.md
@@ -10,6 +10,10 @@ int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf)
* If the farray pointer is null, looks for `< modname >_getfarray` symbol, calls the corresponding function when the symbol is found. `< modname >_getfarray` takes one argument, a pointer to a `loader_shlibfunc_t` array, and returns the number of items in this array, as defined by the `getfarrayfunc_t` type. The `loader_shlibfunc_t` array returned by the shared library must be fully filled (both `fname` and `fptr` fields).
* looks for the `numf` function symbols listed in the `farray[i].fname` arguments and set the corresponding `farray[i].fptr`function pointers
+```c
+int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *farray, int numf)
+```
+Allows loading a specific library version, as specified by the `version` parameter. When version is not NULL the version that is possibly specified as a config module parameter is ignored. This call has been introduced for phy simulators executables which do not use the config module. It is used, for example, by the ldcp initialization (`load_nrLDPClib` function in [nrLDPC_load.c](../../../../../openair1/PHY/CODING/nrLDPC_load.c) to allow the `ldpctest` simulator to select the cuda accelerated ldcp implementation. `load_module_shlib` is just a define macro to switch to a `load_module_version_shlib` call, adding a NULL pointer for the version parameter.
```c
void * get_shlibmodule_fptr(char *modname, char *fname)
diff --git a/common/utils/load_module_shlib.c b/common/utils/load_module_shlib.c
index a4b4742c94..2b0d339358 100644
--- a/common/utils/load_module_shlib.c
+++ b/common/utils/load_module_shlib.c
@@ -63,7 +63,7 @@ void loader_init(void) {
}
/* build the full shared lib name from the module name */
-char *loader_format_shlibpath(char *modname)
+char *loader_format_shlibpath(char *modname, char *version)
{
char *tmpstr;
@@ -97,7 +97,10 @@ int ret;
shlibpath = loader_data.shlibpath ;
}
/* no specific shared lib version */
- if (shlibversion == NULL) {
+ if (version != NULL) { // version specified as a function parameter
+ shlibversion=version;
+ }
+ if (shlibversion == NULL) { // no specific version specified, neither as a config param or as a function param
shlibversion = "" ;
}
/* alloc memory for full module shared lib file name */
@@ -118,7 +121,7 @@ int ret;
return tmpstr;
}
-int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf, void *autoinit_arg)
+int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *farray, int numf, void *autoinit_arg)
{
void *lib_handle = NULL;
initfunc_t fpi;
@@ -138,7 +141,7 @@ int load_module_shlib(char *modname,loader_shlibfunc_t *farray, int numf, void *
loader_init();
}
- shlib_path = loader_format_shlibpath(modname);
+ shlib_path = loader_format_shlibpath(modname, version);
for (int i = 0; i < loader_data.numshlibs; i++) {
if (strcmp(loader_data.shlibs[i].name, modname) == 0) {
diff --git a/common/utils/load_module_shlib.h b/common/utils/load_module_shlib.h
index 685b3d1b65..0e80a5353c 100644
--- a/common/utils/load_module_shlib.h
+++ b/common/utils/load_module_shlib.h
@@ -84,10 +84,11 @@ loader_data_t loader_data;
/*-------------------------------------------------------------------------------------------------------------*/
#else /* LOAD_MODULE_SHLIB_MAIN */
-extern int load_module_shlib(char *modname, loader_shlibfunc_t *farray, int numf, void *initfunc_arg);
+
+extern int load_module_version_shlib(char *modname, char *version, loader_shlibfunc_t *farray, int numf, void *initfunc_arg);
extern void * get_shlibmodule_fptr(char *modname, char *fname);
extern loader_data_t loader_data;
#endif /* LOAD_MODULE_SHLIB_MAIN */
-
+#define load_module_shlib(M, F, N, I) load_module_version_shlib(M, NULL, F, N, I)
#endif
diff --git a/common/utils/nr/nr_common.c b/common/utils/nr/nr_common.c
index 8ba4633604..0a532c346b 100644
--- a/common/utils/nr/nr_common.c
+++ b/common/utils/nr/nr_common.c
@@ -34,6 +34,8 @@
#include "assertions.h"
#include "nr_common.h"
+const char *duplex_mode[]={"FDD","TDD"};
+
// Table 5.2-1 NR operating bands in FR1 & FR2 (3GPP TS 38.101)
// Table 5.4.2.3-1 Applicable NR-ARFCN per operating band in FR1 & FR2 (3GPP TS 38.101)
// Notes:
@@ -231,6 +233,30 @@ uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) {
}
+void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) {
+
+ uint8_t count=0, start=0, start_set=0;
+
+ uint64_t bitmap = (((uint64_t)FreqDomainResource[0])<<37)|
+ (((uint64_t)FreqDomainResource[1])<<29)|
+ (((uint64_t)FreqDomainResource[2])<<21)|
+ (((uint64_t)FreqDomainResource[3])<<13)|
+ (((uint64_t)FreqDomainResource[4])<<5)|
+ (((uint64_t)FreqDomainResource[5])>>3);
+
+ for (int i=0; i<45; i++)
+ if ((bitmap>>(44-i))&1) {
+ count++;
+ if (!start_set) {
+ start = i;
+ start_set = 1;
+ }
+ }
+ *rb_offset = 6*start;
+ *n_rb = 6*count;
+}
+
+
int get_dmrs_port(int nl, uint16_t dmrs_ports) {
if (dmrs_ports == 0) return 0; // dci 1_0
@@ -249,6 +275,176 @@ int get_dmrs_port(int nl, uint16_t dmrs_ports) {
return p;
}
+int get_num_dmrs(uint16_t dmrs_mask ) {
+
+ int num_dmrs=0;
+
+ for (int i=0;i<16;i++) num_dmrs+=((dmrs_mask>>i)&1);
+ return(num_dmrs);
+}
+
+lte_frame_type_t get_frame_type(uint16_t current_band, uint8_t scs_index)
+{
+ lte_frame_type_t current_type;
+ int32_t delta_duplex = get_delta_duplex(current_band, scs_index);
+
+ if (delta_duplex == 0)
+ current_type = TDD;
+ else
+ current_type = FDD;
+
+ LOG_I(NR_MAC, "NR band %d, duplex mode %s, duplex spacing = %d KHz\n", current_band, duplex_mode[current_type], delta_duplex);
+
+ return current_type;
+}
+
+// Computes the duplex spacing (either positive or negative) in KHz
+int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index)
+{
+ int nr_table_idx = get_nr_table_idx(nr_bandP, scs_index);
+
+ int32_t delta_duplex = (nr_bandtable[nr_table_idx].ul_min - nr_bandtable[nr_table_idx].dl_min);
+
+ LOG_I(NR_MAC, "NR band duplex spacing is %d KHz (nr_bandtable[%d].band = %d)\n", delta_duplex, nr_table_idx, nr_bandtable[nr_table_idx].band);
+
+ return delta_duplex;
+}
+
+uint16_t config_bandwidth(int mu, int nb_rb, int nr_band)
+{
+
+ if (nr_band < 100) { //FR1
+ switch(mu) {
+ case 0 :
+ if (nb_rb<=25)
+ return 5;
+ if (nb_rb<=52)
+ return 10;
+ if (nb_rb<=79)
+ return 15;
+ if (nb_rb<=106)
+ return 20;
+ if (nb_rb<=133)
+ return 25;
+ if (nb_rb<=160)
+ return 30;
+ if (nb_rb<=216)
+ return 40;
+ if (nb_rb<=270)
+ return 50;
+ AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
+ break;
+ case 1 :
+ if (nb_rb<=11)
+ return 5;
+ if (nb_rb<=24)
+ return 10;
+ if (nb_rb<=38)
+ return 15;
+ if (nb_rb<=51)
+ return 20;
+ if (nb_rb<=65)
+ return 25;
+ if (nb_rb<=78)
+ return 30;
+ if (nb_rb<=106)
+ return 40;
+ if (nb_rb<=133)
+ return 50;
+ if (nb_rb<=162)
+ return 60;
+ if (nb_rb<=189)
+ return 70;
+ if (nb_rb<=217)
+ return 80;
+ if (nb_rb<=245)
+ return 90;
+ if (nb_rb<=273)
+ return 100;
+ AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
+ break;
+ case 2 :
+ if (nb_rb<=11)
+ return 10;
+ if (nb_rb<=18)
+ return 15;
+ if (nb_rb<=24)
+ return 20;
+ if (nb_rb<=31)
+ return 25;
+ if (nb_rb<=38)
+ return 30;
+ if (nb_rb<=51)
+ return 40;
+ if (nb_rb<=65)
+ return 50;
+ if (nb_rb<=79)
+ return 60;
+ if (nb_rb<=93)
+ return 70;
+ if (nb_rb<=107)
+ return 80;
+ if (nb_rb<=121)
+ return 90;
+ if (nb_rb<=135)
+ return 100;
+ AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
+ break;
+ default:
+ AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
+ }
+ }
+ else {
+ switch(mu) {
+ case 2 :
+ if (nb_rb<=66)
+ return 50;
+ if (nb_rb<=132)
+ return 100;
+ if (nb_rb<=264)
+ return 200;
+ AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
+ break;
+ case 3 :
+ if (nb_rb<=32)
+ return 50;
+ if (nb_rb<=66)
+ return 100;
+ if (nb_rb<=132)
+ return 200;
+ if (nb_rb<=264)
+ return 400;
+ AssertFatal(1==0,"Number of DL resource blocks %d undefined for mu %d and band %d\n", nb_rb, mu, nr_band);
+ break;
+ default:
+ AssertFatal(1==0,"Numerology %d undefined for band %d in FR1\n", mu,nr_band);
+ }
+ }
+}
+
+// Returns the corresponding row index of the NR table
+int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
+ int i, j;
+ int scs_khz = 15 << scs_index;
+ int supplementary_bands[] = {29,75,76,80,81,82,83,84,86,89,95};
+ size_t s = sizeof(supplementary_bands)/sizeof(supplementary_bands[0]);
+
+ for(j = 0; j < s; j++){
+ if (nr_bandP == supplementary_bands[j])
+ AssertFatal(0 == 1, "Band %d is a supplementary band (%d). This is not supported yet.\n", nr_bandP, supplementary_bands[j]);
+ }
+
+ AssertFatal(nr_bandP <= nr_bandtable[nr_bandtable_size-1].band, "NR band %d exceeds NR bands table maximum limit %d\n", nr_bandP, nr_bandtable[nr_bandtable_size-1].band);
+ for (i = 0; i < nr_bandtable_size && nr_bandtable[i].band != nr_bandP; i++);
+
+ // selection of correct Deltaf raster according to SCS
+ if ((nr_bandtable[i].deltaf_raster != 100) && (nr_bandtable[i].deltaf_raster != scs_khz))
+ i++;
+
+ LOG_D(PHY, "NR band table index %d (Band %d, dl_min %lu, ul_min %lu)\n", i, nr_bandtable[i].band, nr_bandtable[i].dl_min,nr_bandtable[i].ul_min);
+
+ return i;
+}
int get_subband_size(int NPRB,int size) {
// implements table 5.2.1.4-2 from 36.214
diff --git a/common/utils/nr/nr_common.h b/common/utils/nr/nr_common.h
index b3d2469a12..d9f2b0c03a 100644
--- a/common/utils/nr/nr_common.h
+++ b/common/utils/nr/nr_common.h
@@ -35,6 +35,7 @@
#include
#include "assertions.h"
+#include "PHY/defs_common.h"
typedef struct nr_bandentry_s {
int16_t band;
@@ -50,6 +51,12 @@ typedef struct nr_bandentry_s {
extern const size_t nr_bandtable_size;
extern nr_bandentry_t nr_bandtable[];
+void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset);
+int get_num_dmrs(uint16_t dmrs_mask);
+uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
+int get_nr_table_idx(int nr_bandP, uint8_t scs_index);
+int32_t get_delta_duplex(int nr_bandP, uint8_t scs_index);
+lte_frame_type_t get_frame_type(uint16_t nr_bandP, uint8_t scs_index);
uint16_t get_band(uint64_t downlink_frequency, int32_t delta_duplex);
int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
diff --git a/common/utils/telnetsrv/telnetsrv.c b/common/utils/telnetsrv/telnetsrv.c
index 734126721a..9e4eeca205 100644
--- a/common/utils/telnetsrv/telnetsrv.c
+++ b/common/utils/telnetsrv/telnetsrv.c
@@ -51,6 +51,7 @@
#include
#include
#include
+#include
#include "common/utils/load_module_shlib.h"
#include "common/config/config_userapi.h"
#include "common/utils/threadPool/thread-pool.h"
@@ -62,34 +63,27 @@
#include "telnetsrv_proccmd.h"
static char *telnet_defstatmod[] = {"softmodem","phy","loader","measur"};
static telnetsrv_params_t telnetparams;
-#define TELNETSRV_LISTENADDR 0
-#define TELNETSRV_LISTENPORT 1
-#define TELNETSRV_PRIORITY 2
-#define TELNETSRV_DEBUG 3
-#define TELNETSRV_LOOPC 4
-#define TELNETSRV_LOOPD 5
-#define TELNETSRV_HISFILE 6
-#define TELNETSRV_HISSIZE 7
-#define TELNETSRV_PHYBSIZE 8
-#define TELNETSRV_STATICMOD 9
-#define TELNETSRV_SHRMOD 10
+
+#define TELNETSRV_OPTNAME_STATICMOD "staticmod"
+#define TELNETSRV_OPTNAME_SHRMOD "shrmod"
paramdef_t telnetoptions[] = {
- /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
- /* configuration parameters for telnet utility */
- /* optname helpstr paramflags XXXptr defXXXval type numelt */
- /*--------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
- {"listenaddr", "\n", 0, uptr:&telnetparams.listenaddr, defstrval:"0.0.0.0", TYPE_IPV4ADDR, 0 },
- {"listenport", "\n", 0, uptr:&(telnetparams.listenport), defuintval:9090, TYPE_UINT, 0 },
- {"priority", "\n", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0 },
- {"loopcount", "\n", 0, uptr:&(telnetparams.loopcount), defuintval:10, TYPE_UINT, 0 },
- {"loopdelay", "\n", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 },
- {"histfile", "\n", PARAMFLAG_NOFREE, strptr:&(telnetparams.histfile), defstrval:"oaitelnet.history", TYPE_STRING, 0 },
- {"histsize", "\n", 0, iptr:&(telnetparams.histsize), defuintval:50, TYPE_INT, 0 },
- {"phypbsize", "\n",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 },
- {"staticmod", "\n", 0, strlistptr:NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,(sizeof(telnet_defstatmod)/sizeof(char *))},
- {"shrmod", "\n", 0, strlistptr:NULL, defstrlistval:NULL,TYPE_STRINGLIST,0 }
+ /*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+ /* configuration parameters for telnet utility */
+ /* optname helpstr paramflags XXXptr defXXXval type numelt */
+ /*-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
+ {"listenaddr", "\n", 0, uptr:&telnetparams.listenaddr, defstrval:"0.0.0.0", TYPE_IPV4ADDR, 0 },
+ {"listenport", "\n", 0, uptr:&(telnetparams.listenport), defuintval:9090, TYPE_UINT, 0 },
+ {"listenstdin", "enable input from stdin\n", PARAMFLAG_BOOL, uptr:&(telnetparams.listenstdin), defuintval:0, TYPE_UINT, 0 },
+ {"priority", "\n", 0, uptr:NULL, defuintval:0, TYPE_UINT, 0 },
+ {"loopcount", "\n", 0, uptr:&(telnetparams.loopcount), defuintval:10, TYPE_UINT, 0 },
+ {"loopdelay", "\n", 0, uptr:&(telnetparams.loopdelay), defuintval:5000, TYPE_UINT, 0 },
+ {"histfile", "\n", PARAMFLAG_NOFREE, strptr:&(telnetparams.histfile), defstrval:"oaitelnet.history", TYPE_STRING, 0 },
+ {"histsize", "\n", 0, iptr:&(telnetparams.histsize), defuintval:50, TYPE_INT, 0 },
+ {"phypbsize", "\n",0, uptr:&(telnetparams.phyprntbuff_size),defuintval:65000, TYPE_UINT, 0 },
+ {TELNETSRV_OPTNAME_STATICMOD, "\n", 0, strlistptr:NULL, defstrlistval:telnet_defstatmod,TYPE_STRINGLIST,(sizeof(telnet_defstatmod)/sizeof(char *))},
+ {TELNETSRV_OPTNAME_SHRMOD, "\n", 0, strlistptr:NULL, defstrlistval:NULL,TYPE_STRINGLIST,0 }
};
int get_phybsize(void) {
@@ -682,6 +676,77 @@ void run_telnetsrv(void) {
return;
}
+void run_telnetclt(void) {
+ int sock;
+ struct sockaddr_in name;
+ pthread_setname_np(pthread_self(), "telnetclt");
+ set_sched(pthread_self(),0,telnetparams.priority);
+ char prompt[sizeof(TELNET_PROMPT_PREFIX)+10];
+ sprintf(prompt,"%s_%s> ",TELNET_PROMPT_PREFIX,get_softmodem_function(NULL));
+ name.sin_family = AF_INET;
+ struct in_addr addr;
+ inet_aton("127.0.0.1", &addr) ;
+ name.sin_addr.s_addr = addr.s_addr;
+ name.sin_port = htons((unsigned short)(telnetparams.listenport));
+ while (1) {
+ sock = socket(AF_INET, SOCK_STREAM, 0);
+ if (sock < 0)
+ fprintf(stderr,"[TELNETSRV] Error %s on socket call\n",strerror(errno));
+
+ if(connect(sock, (void *) &name, sizeof(name)))
+ fprintf(stderr,"[TELNETSRV] Error %s on connect call\n",strerror(errno));
+
+ struct timeval ts;
+ ts.tv_sec = 1; // 1 second
+ ts.tv_usec = 0;
+ while (1) {
+ fd_set fds;
+ FD_ZERO(&fds);
+ FD_SET(sock, &fds);
+ FD_SET(STDIN_FILENO , &fds);
+ // wait for data
+ int nready = select(sock + 1, &fds, (fd_set *) 0, (fd_set *) 0, &ts);
+ if (nready < 0) {
+ perror("select. Error");
+ break;
+ }
+ else if (nready == 0) {
+ ts.tv_sec = 1; // 1 second
+ ts.tv_usec = 0;
+ }
+ else if ( FD_ISSET(sock, &fds)) {
+ int rv;
+ char inbuf[TELNET_MAX_MSGLENGTH*2];
+ memset(inbuf,0,sizeof(inbuf));
+ rv = recv(sock , inbuf , sizeof(inbuf)-1 , 0);
+ if (rv > 0) {
+ printf("%s",inbuf);
+ }
+ else if (rv == 0) {
+ printf("Connection closed by the remote end\n\r");
+ break;
+ }
+ else {
+ perror("recv error");
+ break;
+ }
+ }
+ else if (FD_ISSET(STDIN_FILENO , &fds)) {
+ char *inbuf=NULL;
+ size_t inlen=0;
+ inlen = getline( &inbuf,&inlen, stdin);
+ if ( inlen > 0 ) {
+ if ( send(sock, inbuf,inlen, 0) < 0)
+ break;
+ }
+ free(inbuf);
+ }
+ }
+ close(sock);
+ }
+ return;
+} /* run_telnetclt */
+
void poll_telnetcmdq(void *qid, void *arg) {
notifiedFIFO_elt_t *msg = pollNotifiedFIFO((notifiedFIFO_t *)qid);
@@ -720,10 +785,10 @@ void exec_moduleinit(char *modname) {
int add_embeddedmodules(void) {
int ret=0;
-
- for(int i=0; i
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+
+
+#define TELNETSERVERCODE
+#include "telnetsrv.h"
+
+#include "common/utils/LOG/log.h"
+#include "common/config/config_userapi.h"
+#include "telnetsrv_measurements.h"
+#include "telnetsrv_ltemeasur_def.h"
+#include "telnetsrv_cpumeasur_def.h"
+#include "openair2/LAYER2/NR_MAC_UE/mac_defs.h"
+#include "openair1/PHY/phy_extern_nr_ue.h"
+
+void measurcmd_display_macstats(telnet_printfunc_t prnt);
+void measurcmd_display_macstats_ue(telnet_printfunc_t prnt);
+void measurcmd_display_rlcstats(telnet_printfunc_t prnt);
+void measurcmd_display_phycpu(telnet_printfunc_t prnt);
+void measurcmd_display_maccpu(telnet_printfunc_t prnt);
+void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt);
+
+
+static telnet_measurgroupdef_t nrUEmeasurgroups[] = {
+// {"ue", GROUP_LTESTATS,0, measurcmd_display_macstats, {NULL}},
+// {"rlc", GROUP_LTESTATS,0, measurcmd_display_rlcstats, {NULL}},
+ {"phycpu",GROUP_CPUSTATS,0, measurcmd_display_phycpu, {NULL}},
+// {"maccpu",GROUP_CPUSTATS,0, measurcmd_display_maccpu, {NULL}},
+// {"pdcpcpu",GROUP_CPUSTATS,0, measurcmd_display_pdcpcpu, {NULL}},
+};
+#define TELNET_NUM_NRUEMEASURGROUPS (sizeof(nrUEmeasurgroups)/sizeof(telnet_measurgroupdef_t))
+
+
+static double cpufreq;
+
+
+#define HDR "---------------------------------"
+
+
+int get_measurgroups(telnet_measurgroupdef_t **measurgroups) {
+ *measurgroups = nrUEmeasurgroups;
+ return TELNET_NUM_NRUEMEASURGROUPS;
+}
+
+
+void measurcmd_display_phycpu(telnet_printfunc_t prnt) {
+ PHY_VARS_NR_UE *UE = PHY_vars_UE_g[0][0];
+ telnet_cpumeasurdef_t cpumeasur[]=CPU_PHYNRUE_MEASURE;
+ prnt("%s cpu (%1.1g GHz) measurements: PHY (cpustats %s) %s\n",HDR,cpufreq,
+ PRINT_CPUMEAS_STATE,HDR);
+ measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
+}
+/*
+void measurcmd_display_maccpu(telnet_printfunc_t prnt) {
+ eNB_MAC_INST *macvars = RC.mac[eNB_id];
+ telnet_cpumeasurdef_t cpumeasur[]=CPU_MACENB_MEASURE;
+ prnt("%s cpu (%1.1g GHz) measurements: MAC (cpustats %s) %s\n",HDR,cpufreq,
+ PRINT_CPUMEAS_STATE,HDR);
+ measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
+}
+
+void measurcmd_display_pdcpcpu(telnet_printfunc_t prnt) {
+ pdcp_stats_t *pdcpvars = &(eNB_pdcp_stats[eNB_id]);
+ telnet_cpumeasurdef_t cpumeasur[]=CPU_PDCPENB_MEASURE;
+ prnt("%s cpu (%1.1g GHz) measurements: PDCP (cpustats %s) %s \n",HDR,cpufreq,
+ PRINT_CPUMEAS_STATE,HDR);
+ measurcmd_display_cpumeasures(prnt, cpumeasur, sizeof(cpumeasur)/sizeof(telnet_cpumeasurdef_t));
+}
+//----------------------------------------------------------------------------------------------------
+
+
+void measurcmd_display_macstats_ue(telnet_printfunc_t prnt) {
+ UE_info_t *UE_info = &(RC.mac[eNB_id]->UE_info);
+
+ for (int UE_id=UE_info->list.head; UE_id>=0; UE_id=UE_info->list.next[UE_id]) {
+ for (int i=0; inumactiveCCs[UE_id]; i++) {
+ int CC_id = UE_info->ordered_CCids[i][UE_id];
+ prnt("%s UE %i Id %i CCid %i %s\n",HDR,i,UE_id,CC_id,HDR);
+ eNB_UE_STATS *macuestatptr = &(UE_info->eNB_UE_stats[CC_id][UE_id]);
+ telnet_ltemeasurdef_t statsptr[]=LTEMAC_UEMEASURE;
+ measurcmd_display_measures(prnt, statsptr, sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
+ }
+ }
+} // measurcmd_display_macstats_ue
+
+void measurcmd_display_macstats(telnet_printfunc_t prnt) {
+ for (int CC_id=0 ; CC_id < MAX_NUM_CCs; CC_id++) {
+ eNB_STATS *macstatptr=&(RC.mac[eNB_id]->eNB_stats[CC_id]);
+ telnet_ltemeasurdef_t statsptr[]=LTEMAC_MEASURE;
+ prnt("%s eNB %i mac stats CC %i frame %u %s\n",
+ HDR, eNB_id, CC_id, RC.mac[eNB_id]->frame,HDR);
+ measurcmd_display_measures(prnt,statsptr,sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t));
+ }
+} // measurcmd_display_macstats
+
+
+void measurcmd_display_one_rlcstat(telnet_printfunc_t prnt, int UE_id, telnet_ltemeasurdef_t *statsptr, int num_rlcmeasure, unsigned int *rlcstats,
+ char *rbid_str, protocol_ctxt_t *ctxt, const srb_flag_t srb_flagP, const rb_id_t rb_idP)
+
+{
+ int rlc_status = rlc_stat_req(ctxt,srb_flagP,rb_idP,
+ rlcstats, rlcstats+1, rlcstats+2, rlcstats+3, rlcstats+4, rlcstats+5,
+ rlcstats+6, rlcstats+7, rlcstats+8, rlcstats+9, rlcstats+10, rlcstats+11,
+ rlcstats+12, rlcstats+13, rlcstats+14, rlcstats+15, rlcstats+16, rlcstats+17,
+ rlcstats+18, rlcstats+19, rlcstats+20, rlcstats+21, rlcstats+22, rlcstats+23,
+ rlcstats+24, rlcstats+25, rlcstats+26, rlcstats+27);
+
+ if (rlc_status == RLC_OP_STATUS_OK) {
+ prnt("%s UE %i RLC %s mode %s %s\n",HDR,UE_id, rbid_str,
+ (rlcstats[0]==RLC_MODE_AM)? "AM": (rlcstats[0]==RLC_MODE_UM)?"UM":"NONE",HDR);
+ measurcmd_display_measures(prnt, statsptr, num_rlcmeasure);
+ }
+} // status measurcmd_rlc_stat_req
+
+
+void measurcmd_display_rlcstats(telnet_printfunc_t prnt) {
+ protocol_ctxt_t ctxt;
+ UE_info_t *UE_info = &(RC.mac[eNB_id]->UE_info);
+ telnet_ltemeasurdef_t statsptr[]=LTE_RLCMEASURE;
+ int num_rlcmeasure = sizeof(statsptr)/sizeof(telnet_ltemeasurdef_t );
+ unsigned int *rlcstats = malloc(num_rlcmeasure*sizeof(unsigned int));
+ eNB_MAC_INST *eNB = RC.mac[eNB_id];
+
+ for(int i=0; i list.head; UE_id>=0; UE_id=UE_info->list.next[UE_id]) {
+#define NB_eNB_INST 1
+ PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,eNB_id, ENB_FLAG_YES,UE_info->eNB_UE_stats[0][UE_id].crnti,
+ eNB->frame,eNB->subframe,eNB_id);
+ measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DCCH", &ctxt, SRB_FLAG_YES, DCCH);
+ measurcmd_display_one_rlcstat(prnt, UE_id, statsptr, num_rlcmeasure, rlcstats, "DTCH", &ctxt, SRB_FLAG_NO, DTCH-2);
+ }
+} // measurcmd_display_macstats_ue
+
+*/
+
+
diff --git a/common/utils/telnetsrv/telnetsrv_CMakeLists.txt b/common/utils/telnetsrv/telnetsrv_CMakeLists.txt
index 519a1a72ff..2713c71cc0 100644
--- a/common/utils/telnetsrv/telnetsrv_CMakeLists.txt
+++ b/common/utils/telnetsrv/telnetsrv_CMakeLists.txt
@@ -8,9 +8,9 @@ set(TELNETSRV_SOURCE
)
add_library(telnetsrv MODULE ${TELNETSRV_SOURCE} )
-target_link_libraries(telnetsrv PRIVATE history)
+target_link_libraries(telnetsrv PRIVATE history ncurses form )
-foreach(TELNETLIB enb gnb 4gUE 5gUE)
+foreach(TELNETLIB enb gnb 4Gue 5Gue)
set(TELNETLIB_SRCS "")
foreach(TELNETLIB_ASRC measurements phycmd)
set(TELNETLIB_SRC ${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_${TELNETLIB}_${TELNETLIB_ASRC}.c)
@@ -32,4 +32,4 @@ install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_BUILD_DIR}/ran_build/build)
-endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
\ No newline at end of file
+endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
diff --git a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h
index 7a45b351f3..a275272e80 100644
--- a/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h
+++ b/common/utils/telnetsrv/telnetsrv_cpumeasur_def.h
@@ -24,8 +24,8 @@
* \ strucures arrays which are then used by the display functions
* \ in telnetsrv_measurements.c.
* \author Francois TABURET
- * \date 2019
- * \version 0.1
+ * \date 2021
+ * \version 0.2
* \company NOKIA BellLabs France
* \email: francois.taburet@nokia-bell-labs.com
* \note
@@ -37,67 +37,119 @@
#define CPU_PHYENB_MEASURE \
{ \
- {"phy_proc_tx", &(phyvars->phy_proc_tx),0},\
- {"phy_proc_rx", &(phyvars->phy_proc_rx),0},\
- {"rx_prach", &(phyvars->rx_prach),0},\
- {"ofdm_mod", &(phyvars->ofdm_mod_stats),0},\
- {"dlsch_common_and_dci", &(phyvars->dlsch_common_and_dci),0},\
- {"dlsch_ue_specific", &(phyvars->dlsch_ue_specific),0},\
- {"dlsch_encoding", &(phyvars->dlsch_encoding_stats),0},\
- {"dlsch_modulation", &(phyvars->dlsch_modulation_stats),0},\
- {"dlsch_scrambling", &(phyvars->dlsch_scrambling_stats),0},\
- {"dlsch_rate_matching", &(phyvars->dlsch_rate_matching_stats),0},\
- {"dlsch_turbo_encod_prep", &(phyvars->dlsch_turbo_encoding_preperation_stats),0},\
- {"dlsch_turbo_encod_segm", &(phyvars->dlsch_turbo_encoding_segmentation_stats),0},\
- {"dlsch_turbo_encod", &(phyvars->dlsch_turbo_encoding_stats),0},\
- {"dlsch_turbo_encod_waiting", &(phyvars->dlsch_turbo_encoding_waiting_stats),0},\
- {"dlsch_turbo_encod_signal", &(phyvars->dlsch_turbo_encoding_signal_stats),0},\
- {"dlsch_turbo_encod_main", &(phyvars->dlsch_turbo_encoding_main_stats),0},\
- {"dlsch_turbo_encod_wakeup0", &(phyvars->dlsch_turbo_encoding_wakeup_stats0),0},\
- {"dlsch_turbo_encod_wakeup1", &(phyvars->dlsch_turbo_encoding_wakeup_stats1),0},\
- {"dlsch_interleaving", &(phyvars->dlsch_interleaving_stats),0},\
- {"rx_dft", &(phyvars->rx_dft_stats),0},\
- {"ulsch_channel_estimation", &(phyvars->ulsch_channel_estimation_stats),0},\
- {"ulsch_freq_offset_estimation", &(phyvars->ulsch_freq_offset_estimation_stats),0},\
- {"ulsch_decoding", &(phyvars->ulsch_decoding_stats),0},\
- {"ulsch_demodulation", &(phyvars->ulsch_demodulation_stats),0},\
- {"ulsch_rate_unmatching", &(phyvars->ulsch_rate_unmatching_stats),0},\
- {"ulsch_turbo_decoding", &(phyvars->ulsch_turbo_decoding_stats),0},\
- {"ulsch_deinterleaving", &(phyvars->ulsch_deinterleaving_stats),0},\
- {"ulsch_demultiplexing", &(phyvars->ulsch_demultiplexing_stats),0},\
- {"ulsch_llr", &(phyvars->ulsch_llr_stats),0},\
- {"ulsch_tc_init", &(phyvars->ulsch_tc_init_stats),0},\
- {"ulsch_tc_alpha", &(phyvars->ulsch_tc_alpha_stats),0},\
- {"ulsch_tc_beta", &(phyvars->ulsch_tc_beta_stats),0},\
- {"ulsch_tc_gamma", &(phyvars->ulsch_tc_gamma_stats),0},\
- {"ulsch_tc_ext", &(phyvars->ulsch_tc_ext_stats),0},\
- {"ulsch_tc_intl1", &(phyvars->ulsch_tc_intl1_stats),0},\
- {"ulsch_tc_intl2", &(phyvars->ulsch_tc_intl2_stats),0},\
+ {"phy_proc_tx", &(phyvars->phy_proc_tx),0,1},\
+ {"phy_proc_rx", &(phyvars->phy_proc_rx),0,1},\
+ {"rx_prach", &(phyvars->rx_prach),0,1},\
+ {"ofdm_mod", &(phyvars->ofdm_mod_stats),0,1},\
+ {"dlsch_common_and_dci", &(phyvars->dlsch_common_and_dci),0,1},\
+ {"dlsch_ue_specific", &(phyvars->dlsch_ue_specific),0,1},\
+ {"dlsch_encoding", &(phyvars->dlsch_encoding_stats),0,1},\
+ {"dlsch_modulation", &(phyvars->dlsch_modulation_stats),0,1},\
+ {"dlsch_scrambling", &(phyvars->dlsch_scrambling_stats),0,1},\
+ {"dlsch_rate_matching", &(phyvars->dlsch_rate_matching_stats),0,1},\
+ {"dlsch_turbo_encod_prep", &(phyvars->dlsch_turbo_encoding_preperation_stats),0,1},\
+ {"dlsch_turbo_encod_segm", &(phyvars->dlsch_turbo_encoding_segmentation_stats),0,1},\
+ {"dlsch_turbo_encod", &(phyvars->dlsch_turbo_encoding_stats),0,1},\
+ {"dlsch_turbo_encod_waiting", &(phyvars->dlsch_turbo_encoding_waiting_stats),0,1},\
+ {"dlsch_turbo_encod_signal", &(phyvars->dlsch_turbo_encoding_signal_stats),0,1},\
+ {"dlsch_turbo_encod_main", &(phyvars->dlsch_turbo_encoding_main_stats),0,1},\
+ {"dlsch_turbo_encod_wakeup0", &(phyvars->dlsch_turbo_encoding_wakeup_stats0),0,1},\
+ {"dlsch_turbo_encod_wakeup1", &(phyvars->dlsch_turbo_encoding_wakeup_stats1),0,1},\
+ {"dlsch_interleaving", &(phyvars->dlsch_interleaving_stats),0,1},\
+ {"rx_dft", &(phyvars->rx_dft_stats),0,1},\
+ {"ulsch_channel_estimation", &(phyvars->ulsch_channel_estimation_stats),0,1},\
+ {"ulsch_freq_offset_estimation", &(phyvars->ulsch_freq_offset_estimation_stats),0,1},\
+ {"ulsch_decoding", &(phyvars->ulsch_decoding_stats),0,1},\
+ {"ulsch_demodulation", &(phyvars->ulsch_demodulation_stats),0,1},\
+ {"ulsch_rate_unmatching", &(phyvars->ulsch_rate_unmatching_stats),0,1},\
+ {"ulsch_turbo_decoding", &(phyvars->ulsch_turbo_decoding_stats),0,1},\
+ {"ulsch_deinterleaving", &(phyvars->ulsch_deinterleaving_stats),0,1},\
+ {"ulsch_demultiplexing", &(phyvars->ulsch_demultiplexing_stats),0,1},\
+ {"ulsch_llr", &(phyvars->ulsch_llr_stats),0,1},\
+ {"ulsch_tc_init", &(phyvars->ulsch_tc_init_stats),0,1},\
+ {"ulsch_tc_alpha", &(phyvars->ulsch_tc_alpha_stats),0,1},\
+ {"ulsch_tc_beta", &(phyvars->ulsch_tc_beta_stats),0,1},\
+ {"ulsch_tc_gamma", &(phyvars->ulsch_tc_gamma_stats),0,1},\
+ {"ulsch_tc_ext", &(phyvars->ulsch_tc_ext_stats),0,1},\
+ {"ulsch_tc_intl1", &(phyvars->ulsch_tc_intl1_stats),0,1},\
+ {"ulsch_tc_intl2", &(phyvars->ulsch_tc_intl2_stats),0,1},\
}
#define CPU_MACENB_MEASURE \
{ \
- {"eNB_scheduler", &(macvars->eNB_scheduler),0},\
- {"schedule_si", &(macvars->schedule_si),0},\
- {"schedule_ra", &(macvars->schedule_ra),0},\
- {"schedule_ulsch", &(macvars->schedule_ulsch),0},\
- {"fill_DLSCH_dci", &(macvars->fill_DLSCH_dci),0},\
- {"schedule_dlsch_pre", &(macvars->schedule_dlsch_preprocessor),0},\
- {"schedule_dlsch", &(macvars->schedule_dlsch),0},\
- {"schedule_mch", &(macvars->schedule_mch),0},\
- {"rx_ulsch_sdu", &(macvars->rx_ulsch_sdu),0},\
- {"schedule_pch", &(macvars->schedule_pch),0},\
+ {"eNB_scheduler", &(macvars->eNB_scheduler),0,1},\
+ {"schedule_si", &(macvars->schedule_si),0,1},\
+ {"schedule_ra", &(macvars->schedule_ra),0,1},\
+ {"schedule_ulsch", &(macvars->schedule_ulsch),0,1},\
+ {"fill_DLSCH_dci", &(macvars->fill_DLSCH_dci),0,1},\
+ {"schedule_dlsch_pre", &(macvars->schedule_dlsch_preprocessor),0,1},\
+ {"schedule_dlsch", &(macvars->schedule_dlsch),0,1},\
+ {"schedule_mch", &(macvars->schedule_mch),0,1},\
+ {"rx_ulsch_sdu", &(macvars->rx_ulsch_sdu),0,1},\
+ {"schedule_pch", &(macvars->schedule_pch),0,1},\
}
#define CPU_PDCPENB_MEASURE \
{ \
- {"pdcp_run", &(pdcpvars->pdcp_run),0},\
- {"data_req", &(pdcpvars->data_req),0},\
- {"data_ind", &(pdcpvars->data_ind),0},\
- {"apply_security", &(pdcpvars->apply_security),0},\
- {"validate_security", &(pdcpvars->validate_security),0},\
- {"pdcp_ip", &(pdcpvars->pdcp_ip),0},\
- {"ip_pdcp", &(pdcpvars->ip_pdcp),0},\
+ {"pdcp_run", &(pdcpvars->pdcp_run),0,1},\
+ {"data_req", &(pdcpvars->data_req),0,1},\
+ {"data_ind", &(pdcpvars->data_ind),0,1},\
+ {"apply_security", &(pdcpvars->apply_security),0,1},\
+ {"validate_security", &(pdcpvars->validate_security),0,1},\
+ {"pdcp_ip", &(pdcpvars->pdcp_ip),0,1},\
+ {"ip_pdcp", &(pdcpvars->ip_pdcp),0,1},\
}
+/* from openair1/PHY/defs_nr_UE.h */
+#define CPU_PHYNRUE_MEASURE \
+{ \
+ {"phy_proc", &(UE->phy_proc[0]),0,RX_NB_TH},\
+ {"phy_proc_rx", &(UE-> phy_proc_rx[0]),0,RX_NB_TH},\
+ {"phy_proc_tx", &(UE->phy_proc_tx),0,1},\
+ {"ofdm_mod_stats", &(UE->ofdm_mod_stats),0,1},\
+ {"ulsch_encoding_stats", &(UE->ulsch_encoding_stats),0,1},\
+ {"ulsch_modulation_stats", &(UE->ulsch_modulation_stats),0,1},\
+ {"ulsch_segmentation_stats", &(UE->ulsch_segmentation_stats),0,1},\
+ {"ulsch_rate_matching_stats", &(UE->ulsch_rate_matching_stats),0,1},\
+ {"ulsch_turbo_encoding_stats", &(UE->ulsch_turbo_encoding_stats),0,1},\
+ {"ulsch_interleaving_stats", &(UE->ulsch_interleaving_stats),0,1},\
+ {"ulsch_multiplexing_stats", &(UE->ulsch_multiplexing_stats),0,1},\
+ {"generic_stat", &(UE->generic_stat),0,1},\
+ {"generic_stat_bis", &(UE->generic_stat_bis[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\
+ {"ofdm_demod_stats", &(UE->ofdm_demod_stats),0,1},\
+ {"dlsch_rx_pdcch_stats", &(UE->dlsch_rx_pdcch_stats),0,1},\
+ {"rx_dft_stats", &(UE->rx_dft_stats),0,1},\
+ {"dlsch_c...timation_stats", &(UE->dlsch_channel_estimation_stats),0,1},\
+ {"dlsch_f...timation_stats", &(UE->dlsch_freq_offset_estimation_stats),0,1},\
+ {"dlsch_demodulation_stats", &(UE->dlsch_demodulation_stats),0,1},\
+ {"dlsch_rate_unmatching_stats", &(UE->dlsch_rate_unmatching_stats),0,1},\
+ {"dlsch_turbo_decoding_stats", &(UE->dlsch_turbo_decoding_stats),0,1},\
+ {"dlsch_deinterleaving_stats", &(UE->dlsch_deinterleaving_stats),0,1},\
+ {"dlsch_llr_stats", &(UE->dlsch_llr_stats),0,1},\
+ {"dlsch_unscrambling_stats", &(UE->dlsch_unscrambling_stats),0,1},\
+ {"dlsch_rate_matching_stats", &(UE->dlsch_rate_matching_stats),0,1},\
+ {"dlsch_turbo_encoding_stats", &(UE->dlsch_turbo_encoding_stats),0,1},\
+ {"dlsch_interleaving_stats", &(UE->dlsch_interleaving_stats),0,1},\
+ {"dlsch_tc_init_stats", &(UE->dlsch_tc_init_stats),0,1},\
+ {"dlsch_tc_alpha_stats", &(UE->dlsch_tc_alpha_stats),0,1},\
+ {"dlsch_tc_beta_stats", &(UE->dlsch_tc_beta_stats),0,1},\
+ {"dlsch_tc_gamma_stats", &(UE->dlsch_tc_gamma_stats),0,1},\
+ {"dlsch_tc_ext_stats", &(UE->dlsch_tc_ext_stats),0,1},\
+ {"dlsch_tc_intl1_stats", &(UE->dlsch_tc_intl1_stats),0,1},\
+ {"dlsch_tc_intl2_stats", &(UE->dlsch_tc_intl2_stats),0,1},\
+ {"tx_prach", &(UE->tx_prach),0,1},\
+ {"dlsch_encoding_SIC_stats", &(UE->dlsch_encoding_SIC_stats),0,1},\
+ {"dlsch_scrambling_SIC_stats", &(UE->dlsch_scrambling_SIC_stats),0,1},\
+ {"dlsch_modulation_SIC_stats", &(UE->dlsch_modulation_SIC_stats),0,1},\
+ {"dlsch...ping_unit_SIC_stats", &(UE->dlsch_llr_stripping_unit_SIC_stats),0,1},\
+ {"dlsch_unscrambling_SIC_stats", &(UE->dlsch_unscrambling_SIC_stats),0,1},\
+ {"ue_front_end_stat", &(UE->ue_front_end_stat[0]),0,RX_NB_TH},\
+ {"ue_front_end_per_slot_stat", &(UE->ue_front_end_per_slot_stat[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\
+ {"pdcch_procedures_stat", &(UE->pdcch_procedures_stat[0]),0,RX_NB_TH},\
+ {"pdsch_procedures_stat", &(UE->pdsch_procedures_stat[0]),0,RX_NB_TH},\
+ {"pdsch_procedures_per_slot_stat", &(UE->pdsch_procedures_per_slot_stat[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\
+ {"dlsch_procedures_stat", &(UE->dlsch_procedures_stat[0]),0,RX_NB_TH},\
+ {"dlsch_decoding_stats", &(UE->dlsch_decoding_stats[0]),0,RX_NB_TH},\
+ {"dlsch_llr_stats_para", &(UE->dlsch_llr_stats_parallelization[0][0]),0,RX_NB_TH,LTE_SLOTS_PER_SUBFRAME},\
+}
#endif
diff --git a/common/utils/telnetsrv/telnetsrv_measurements.c b/common/utils/telnetsrv/telnetsrv_measurements.c
index 4a11e7c2dd..786cbd094c 100644
--- a/common/utils/telnetsrv/telnetsrv_measurements.c
+++ b/common/utils/telnetsrv/telnetsrv_measurements.c
@@ -64,13 +64,30 @@ void measurcmd_display_groups(telnet_printfunc_t prnt,telnet_measurgroupdef_t *m
} /* measurcmd_display_groups */
/*----------------------------------------------------------------------------------------------------*/
/* cpu measurements functions */
-void measurcmd_display_cpumeasures(telnet_printfunc_t prnt, telnet_cpumeasurdef_t *cpumeasure, int cpumeasure_size) {
- for (int i=0; istatname,
- ((cpumeasure+i)->astatptr->trials!=0)?(((cpumeasure+i)->astatptr->diff)/((cpumeasure+i)->astatptr->trials))/cpufreq/1000:0,
- (cpumeasure+i)->astatptr->trials, ((i%2)==1)?"|\n":" | " );
- }
+
+static char *stridx(int max,int i, char *buff) {
+ if (max>1)
+ sprintf(buff,"[%d]",i);
+ else
+ sprintf(buff," ");
+ return buff;
+
+}
+void measurcmd_display_cpumeasures(telnet_printfunc_t prnt, telnet_cpumeasurdef_t *cpumeasure, int cpumeasure_size) {
+ int p=0;
+ char stridx1[16];
+ char stridx2[16];
+ for (int i=0; istatname,
+ stridx(cpumeasure[i].num_occur1,o1,stridx1),stridx(cpumeasure[i].num_occur2,o2,stridx2),
+ ((cpumeasure+i+o1+o2)->astatptr->trials!=0)?(((cpumeasure+i+o1+o2)->astatptr->diff)/((cpumeasure+i+o1+o2)->astatptr->trials))/cpufreq/1000:0,
+ (cpumeasure+i+o1+o2)->astatptr->trials, ((p%2)==1)?"|\n":" | " );
+ p++;
+ }
prnt("\n\n");
} /* measurcmd_display_measures */
@@ -137,11 +154,17 @@ int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt) {
}
telnet_measurgroupdef_t *measurgroups;
int num_measurgroups = fptr( &measurgroups);
-
+
int s = sscanf(buf,"%ms %i-%i\n",&subcmd, &idx1,&idx2);
if (s>0) {
- if ( strcmp(subcmd,"groups") == 0) {
+ if ( strcmp(subcmd,"inq") == 0) {
+ notifiedFIFO_elt_t *msg =newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL);
+ time_stats_msg_t *msgdata=NotifiedFifoData(msg);
+ msgdata->msgid = TIMESTAT_MSGID_DISPLAY;
+ msgdata->displayFunc = prnt;
+ pushNotifiedFIFO(&measur_fifo, msg);
+ } else if ( strcmp(subcmd,"groups") == 0){
measurcmd_display_groups(prnt,measurgroups,num_measurgroups);
badcmd=0;
} else {
@@ -182,13 +205,13 @@ int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt) {
int badcmd=1;
if (debug > 0)
- prnt(" measurcmd_show received %s\n",buf);
+ prnt(" measurcmd_cpustats received %s\n",buf);
int s = sscanf(buf,"%ms %i-%i\n",&subcmd, &idx1,&idx2);
if (s>0) {
if ( strcmp(subcmd,"enable") == 0) {
- cpumeas(CPUMEAS_ENABLE);
+
badcmd=0;
} else if ( strcmp(subcmd,"disable") == 0) {
cpumeas(CPUMEAS_DISABLE);
@@ -203,6 +226,64 @@ int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt) {
free(subcmd);
return CMDSTATUS_FOUND;
}
+
+void measurcmd_async_help(telnet_printfunc_t prnt) {
+}
+
+int measurcmd_async(char *buf, int debug, telnet_printfunc_t prnt) {
+ char *subcmd=NULL;
+ int idx1, idx2;
+ int okcmd=0;
+
+ if (buf == NULL) {
+ measurcmd_async_help(prnt);
+ return CMDSTATUS_FOUND;
+ }
+ if (debug > 0)
+ prnt(" measurcmd_async received %s\n",buf);
+
+
+ int s = sscanf(buf,"%ms %i-%i\n",&subcmd, &idx1,&idx2);
+
+ if (s==1) {
+ if ( strcmp(subcmd,"enable") == 0) {
+ init_meas();
+ okcmd=1;
+ } else if ( strcmp(subcmd,"disable") == 0) {
+ end_meas();
+ okcmd=1;
+ }
+ } else if ( s == 3 ) {
+ int msgid;
+ if ( strcmp(subcmd,"enable") == 0) {
+ msgid = TIMESTAT_MSGID_ENABLE;
+ okcmd=1;
+ } else if ( strcmp(subcmd,"disable") == 0) {
+ msgid = TIMESTAT_MSGID_DISABLE;
+ okcmd=1;
+ } else if ( strcmp(subcmd,"display") == 0) {
+ msgid = TIMESTAT_MSGID_DISPLAY;
+ okcmd=1;
+ }
+ if (okcmd) {
+ notifiedFIFO_elt_t *nfe = newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL);
+ time_stats_msg_t *msg = (time_stats_msg_t *)NotifiedFifoData(nfe);
+ msg->msgid = msgid ;
+ msg->displayFunc = prnt;
+ for(int i=idx1; itimestat_id =i;
+ pushNotifiedFIFO(&measur_fifo, nfe);
+ }
+ }
+ }
+
+ if (!(okcmd)) {
+ prnt("Unknown command: %s\n",buf);
+ }
+
+ free(subcmd);
+ return CMDSTATUS_FOUND;
+}
/*-------------------------------------------------------------------------------------*/
/* function called at telnet server init to add the measur command */
diff --git a/common/utils/telnetsrv/telnetsrv_measurements.h b/common/utils/telnetsrv/telnetsrv_measurements.h
index 08136df0fd..99ae695f41 100644
--- a/common/utils/telnetsrv/telnetsrv_measurements.h
+++ b/common/utils/telnetsrv/telnetsrv_measurements.h
@@ -49,6 +49,9 @@ typedef struct cpumeasurdef {
char statname[TELNET_MAXMEASURNAME_LEN];
time_stats_t *astatptr;
unsigned int statemask;
+ uint8_t num_occur1;
+ uint8_t num_occur2;
+ uint8_t num_occur3;
} telnet_cpumeasurdef_t;
typedef struct ltemeasurdef {
@@ -60,6 +63,7 @@ typedef struct ltemeasurdef {
#define GROUP_LTESTATS 0
#define GROUP_CPUSTATS 1
+
typedef void(*measur_dislayfunc_t)(telnet_printfunc_t prnt);
typedef struct mesurgroupdef {
char groupname[TELNET_MAXMEASURNAME_LEN];
@@ -79,9 +83,11 @@ typedef struct mesurgroupdef {
#ifdef TELNETSRV_MEASURMENTS_MAIN
int measurcmd_show(char *buf, int debug, telnet_printfunc_t prnt);
int measurcmd_cpustats(char *buf, int debug, telnet_printfunc_t prnt);
+int measurcmd_async(char *buf, int debug, telnet_printfunc_t prnt);
telnetshell_cmddef_t measur_cmdarray[] = {
- {"show", "groups | " , measurcmd_show},
+ {"show", "groups | | inq" , measurcmd_show},
{"cpustats","[enable | disable]",measurcmd_cpustats},
+ {"async","[enable | disable]",measurcmd_async},
{"","",NULL}
};
diff --git a/doc/BUILD.md b/doc/BUILD.md
index 166563877e..40b63ac697 100644
--- a/doc/BUILD.md
+++ b/doc/BUILD.md
@@ -88,6 +88,21 @@ You can build any oai softmodem executable separately, you may not need all of t
After completing the build, the binaries are available in the `cmake_targets/ran_build/build` directory. A copy is also available in the `target/bin` directory, with all binaries suffixed by the 3GPP release number, today .Rel15.
+When installing the pre-requisites, especially the `UHD` driver, you can now specify if you want to install from source or not.
+
+- For `fedora`-based OS, it was already the case all the time. But now you can specify which version to install.
+- For `ubuntu` OS, the Ettus PPA currently installs the following versions:
+ * `Ubuntu16.04`: --> version `3.15.0.0`
+ * `Ubuntu18.04`: --> version `4.1.0.0`
+
+```bash
+export BUILD_UHD_FROM_SOURCE=True
+export UHD_VERSION=3.15.0.0
+./build_oai -I -w USRP
+```
+
+The `UHD_VERSION` env variable `SHALL` be a valid tag (minus `v`) from the `https://github.com/EttusResearch/uhd.git` repository.
+
## Issue when building `nasmeh` module ##
A lot of users and contributors have faced the issue: `nasmesh` module does not build.
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index dc7a982310..d063afd5d9 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -203,10 +203,7 @@ UE on machine 2:
-
-
-
-
+[Selecting an alternative ldpc implementation at run time](../openair1/PHY/CODING/DOC/LDPCImplementation.md)
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/doc/testing_gnb_w_cots_ue_resources/gnb.conf b/doc/testing_gnb_w_cots_ue_resources/gnb.conf
index c4a8d512b8..97935f92ee 100755
--- a/doc/testing_gnb_w_cots_ue_resources/gnb.conf
+++ b/doc/testing_gnb_w_cots_ue_resources/gnb.conf
@@ -275,6 +275,23 @@ THREAD_STRUCT = (
}
);
+security = {
+ # preferred ciphering algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nea0, nea1, nea2, nea3
+ ciphering_algorithms = ( "nea0" );
+
+ # preferred integrity algorithms
+ # the first one of the list that an UE supports in chosen
+ # valid values: nia0, nia1, nia2, nia3
+ integrity_algorithms = ( "nia2", "nia0" );
+
+ # setting 'drb_ciphering' to "no" disables ciphering for DRBs, no matter
+ # what 'ciphering_algorithms' configures; same thing for 'drb_integrity'
+ drb_ciphering = "yes";
+ drb_integrity = "no";
+};
+
log_config :
{
global_log_level ="info";
diff --git a/docker/Dockerfile.eNB.rhel8.2 b/docker/Dockerfile.eNB.rhel8.2
index 90c807fc0e..0522271df0 100644
--- a/docker/Dockerfile.eNB.rhel8.2
+++ b/docker/Dockerfile.eNB.rhel8.2
@@ -41,17 +41,23 @@ RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-enb
+ENV TZ=Europe/Paris
RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \
lksctp-tools \
nettle \
+ tzdata \
procps-ng \
atlas \
+ python3 \
+ python3-pip \
net-tools \
iputils \
iproute \
libyaml && \
+ pip3 install six && \
+ pip3 install requests && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
@@ -78,6 +84,8 @@ COPY --from=enb-build /lib64/libconfig.so.9 /lib64
COPY --from=enb-build /lib64/libblas.so.3 /lib64
COPY --from=enb-build /lib64/liblapack.so.3 /lib64
COPY --from=enb-build /lib64/liblapacke.so.3 /lib64
+
+# Now we are copying from builder-image the UHD files.
COPY --from=enb-build /lib64/libboost_chrono.so.1.66.0 /lib64
COPY --from=enb-build /lib64/libboost_date_time.so.1.66.0 /lib64
COPY --from=enb-build /lib64/libboost_filesystem.so.1.66.0 /lib64
@@ -88,7 +96,14 @@ COPY --from=enb-build /lib64/libboost_system.so.1.66.0 /lib64
COPY --from=enb-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
COPY --from=enb-build /lib64/libboost_atomic.so.1.66.0 /lib64
COPY --from=enb-build /lib64/libboost_timer.so.1.66.0 /lib64
-COPY --from=enb-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+COPY --from=enb-build /lib64/libboost_regex.so.1.66.0 /lib64
+
+COPY --from=enb-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=enb-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
+COPY --from=enb-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
+
+WORKDIR /usr/local/share/uhd/rfnoc
+COPY --from=enb-build /usr/local/share/uhd/rfnoc/ .
RUN ldconfig
diff --git a/docker/Dockerfile.eNB.ubuntu18 b/docker/Dockerfile.eNB.ubuntu18
index c4393dc78e..cf748784e5 100644
--- a/docker/Dockerfile.eNB.ubuntu18
+++ b/docker/Dockerfile.eNB.ubuntu18
@@ -25,7 +25,7 @@
#
#---------------------------------------------------------------------
-FROM ran-build:latest AS enb-build
+FROM ran-build:latest AS enb-build
RUN rm -Rf /oai-ran
WORKDIR /oai-ran
@@ -42,8 +42,7 @@ RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters
#start from scratch for target executable
FROM ubuntu:bionic as oai-enb
ENV DEBIAN_FRONTEND=noninteractive
-ENV TZ=Europe
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+ENV TZ=Europe/Paris
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
@@ -60,16 +59,12 @@ RUN apt-get update && \
iputils-ping \
iproute2 \
iperf \
- libyaml-0-2 && \
- # Install UHD driver from ettus ppa
- # At time of writing, it is 3.14
- add-apt-repository ppa:ettusresearch/uhd --yes && \
- apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install --yes \
python \
+ python3 \
+ python3-six \
+ python3-requests \
libusb-1.0-0 \
- libuhd003 \
- uhd-host && \
+ libyaml-0-2 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-enb/bin
@@ -90,6 +85,17 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/
RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so"
COPY --from=enb-build /usr/local/lib/libprotobuf-c.so.1 .
+# Now we are copying from builder-image the UHD files.
+COPY --from=enb-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=enb-build /usr/local/lib/libuhd.so.3.15.0 /usr/local/lib
+COPY --from=enb-build /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-enb/bin
+WORKDIR /usr/lib/x86_64-linux-gnu
+COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 .
+COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 .
+COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 .
+COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.65.1 .
+COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 .
+COPY --from=enb-build /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 .
RUN ldconfig
diff --git a/docker/Dockerfile.gNB.rhel8.2 b/docker/Dockerfile.gNB.rhel8.2
index 9ee0bf9ae9..b34a9d242d 100644
--- a/docker/Dockerfile.gNB.rhel8.2
+++ b/docker/Dockerfile.gNB.rhel8.2
@@ -41,6 +41,7 @@ RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/gnb_parameters
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-gnb
+ENV TZ=Europe/Paris
RUN yum repolist --disablerepo=* && \
yum update -y && \
@@ -51,9 +52,14 @@ RUN yum repolist --disablerepo=* && \
atlas \
lksctp-tools \
nettle \
+ tzdata \
+ python3 \
+ python3-pip \
net-tools \
iputils \
libyaml && \
+ pip3 install six && \
+ pip3 install requests && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
@@ -84,6 +90,8 @@ COPY --from=gnb-build /lib64/libforms.so.2 /lib64
COPY --from=gnb-build /lib64/libblas.so.3 /lib64
COPY --from=gnb-build /lib64/liblapack.so.3 /lib64
COPY --from=gnb-build /lib64/liblapacke.so.3 /lib64
+
+# Now we are copying from builder-image the UHD files.
COPY --from=gnb-build /lib64/libboost_chrono.so.1.66.0 /lib64
COPY --from=gnb-build /lib64/libboost_date_time.so.1.66.0 /lib64
COPY --from=gnb-build /lib64/libboost_filesystem.so.1.66.0 /lib64
@@ -94,7 +102,14 @@ COPY --from=gnb-build /lib64/libboost_system.so.1.66.0 /lib64
COPY --from=gnb-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
COPY --from=gnb-build /lib64/libboost_atomic.so.1.66.0 /lib64
COPY --from=gnb-build /lib64/libboost_timer.so.1.66.0 /lib64
-COPY --from=gnb-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+COPY --from=gnb-build /lib64/libboost_regex.so.1.66.0 /lib64
+
+COPY --from=gnb-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=gnb-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
+COPY --from=gnb-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
+
+WORKDIR /usr/local/share/uhd/rfnoc
+COPY --from=gnb-build /usr/local/share/uhd/rfnoc/ .
RUN ldconfig
diff --git a/docker/Dockerfile.gNB.ubuntu18 b/docker/Dockerfile.gNB.ubuntu18
index 990c4363e5..cfd9d82144 100644
--- a/docker/Dockerfile.gNB.ubuntu18
+++ b/docker/Dockerfile.gNB.ubuntu18
@@ -59,16 +59,12 @@ RUN apt-get update && \
net-tools \
iproute2 \
iputils-ping \
- libyaml-0-2 && \
- # Install UHD driver from ettus ppa
- # At time of writing, it is 3.14
- add-apt-repository ppa:ettusresearch/uhd --yes && \
- apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install --yes \
python \
+ python3 \
+ python3-six \
+ python3-requests \
libusb-1.0-0 \
- libuhd003 \
- uhd-host && \
+ libyaml-0-2 && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-gnb/bin
@@ -93,6 +89,18 @@ RUN /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/
RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so"
COPY --from=gnb-build /usr/local/lib/libprotobuf-c.so.1 .
+# Now we are copying from builder-image the UHD files.
+COPY --from=gnb-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=gnb-build /usr/local/lib/libuhd.so.3.15.0 /usr/local/lib
+COPY --from=gnb-build /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-gnb/bin
+WORKDIR /usr/lib/x86_64-linux-gnu
+COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 .
+COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 .
+COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 .
+COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.65.1 .
+COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 .
+COPY --from=gnb-build /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 .
+
RUN ldconfig
# Copy the relevant configuration files for gNB
diff --git a/docker/Dockerfile.lteRU.rhel8.2 b/docker/Dockerfile.lteRU.rhel8.2
index 314c01dff3..7e2a054a12 100644
--- a/docker/Dockerfile.lteRU.rhel8.2
+++ b/docker/Dockerfile.lteRU.rhel8.2
@@ -48,9 +48,13 @@ RUN yum update -y && \
tzdata \
procps-ng \
atlas \
+ python3 \
+ python3-pip \
net-tools \
iputils \
iproute && \
+ pip3 install six && \
+ pip3 install requests && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
@@ -66,11 +70,12 @@ COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so .
COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
-# Copying from the ran-build image the USRP needed packages
COPY --from=ru-build /lib64/libconfig.so.9 /lib64
COPY --from=ru-build /lib64/libblas.so.3 /lib64
COPY --from=ru-build /lib64/liblapack.so.3 /lib64
COPY --from=ru-build /lib64/liblapacke.so.3 /lib64
+
+# Copying from the ran-build image the USRP needed packages
COPY --from=ru-build /lib64/libboost_chrono.so.1.66.0 /lib64
COPY --from=ru-build /lib64/libboost_date_time.so.1.66.0 /lib64
COPY --from=ru-build /lib64/libboost_filesystem.so.1.66.0 /lib64
@@ -81,7 +86,14 @@ COPY --from=ru-build /lib64/libboost_system.so.1.66.0 /lib64
COPY --from=ru-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
COPY --from=ru-build /lib64/libboost_atomic.so.1.66.0 /lib64
COPY --from=ru-build /lib64/libboost_timer.so.1.66.0 /lib64
-COPY --from=ru-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+COPY --from=ru-build /lib64/libboost_regex.so.1.66.0 /lib64
+
+COPY --from=ru-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=ru-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
+COPY --from=ru-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ru/bin
+
+WORKDIR /usr/local/share/uhd/rfnoc
+COPY --from=ru-build /usr/local/share/uhd/rfnoc/ .
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
diff --git a/docker/Dockerfile.lteRU.ubuntu18 b/docker/Dockerfile.lteRU.ubuntu18
index fa99827d94..eafb8fa8af 100644
--- a/docker/Dockerfile.lteRU.ubuntu18
+++ b/docker/Dockerfile.lteRU.ubuntu18
@@ -54,17 +54,13 @@ RUN apt-get update && \
libatlas3-base \
libconfig9 \
net-tools \
+ python \
+ python3 \
+ python3-six \
+ python3-requests \
+ libusb-1.0-0 \
iputils-ping \
iproute2 && \
- # Install UHD driver from ettus ppa
- # At time of writing, it is 3.14
- add-apt-repository ppa:ettusresearch/uhd --yes && \
- apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install --yes \
- python \
- libusb-1.0-0 \
- libuhd003 \
- uhd-host && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-lte-ru/bin
@@ -78,6 +74,19 @@ COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so .
COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
+
+# Now we are copying from builder-image the UHD files.
+COPY --from=ru-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=ru-build /usr/local/lib/libuhd.so.3.15.0 /usr/local/lib
+COPY --from=ru-build /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ru/bin
+WORKDIR /usr/lib/x86_64-linux-gnu
+COPY --from=ru-build /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 .
+COPY --from=ru-build /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 .
+COPY --from=ru-build /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 .
+COPY --from=ru-build /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.65.1 .
+COPY --from=ru-build /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 .
+COPY --from=ru-build /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 .
+
RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
/bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
/bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \
diff --git a/docker/Dockerfile.lteUE.rhel8.2 b/docker/Dockerfile.lteUE.rhel8.2
index 936780297a..a6814be136 100644
--- a/docker/Dockerfile.lteUE.rhel8.2
+++ b/docker/Dockerfile.lteUE.rhel8.2
@@ -42,17 +42,23 @@ RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_paramet
#start from scratch for target executable
FROM registry.access.redhat.com/ubi8/ubi:latest as oai-lte-ue
+ENV TZ=Europe/Paris
RUN yum update -y && \
yum install -y --enablerepo="ubi-8-codeready-builder" \
lksctp-tools \
procps-ng \
nettle \
+ tzdata \
atlas \
+ python3 \
+ python3-pip \
iproute \
net-tools \
iputils \
libyaml && \
+ pip3 install six && \
+ pip3 install requests && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
@@ -82,6 +88,8 @@ COPY --from=lte-ue-build /lib64/libconfig.so.9 /lib64
COPY --from=lte-ue-build /lib64/libblas.so.3 /lib64
COPY --from=lte-ue-build /lib64/liblapack.so.3 /lib64
COPY --from=lte-ue-build /lib64/liblapacke.so.3 /lib64
+
+# Now we are copying from builder-image the UHD files.
COPY --from=lte-ue-build /lib64/libboost_chrono.so.1.66.0 /lib64
COPY --from=lte-ue-build /lib64/libboost_date_time.so.1.66.0 /lib64
COPY --from=lte-ue-build /lib64/libboost_filesystem.so.1.66.0 /lib64
@@ -92,7 +100,14 @@ COPY --from=lte-ue-build /lib64/libboost_system.so.1.66.0 /lib64
COPY --from=lte-ue-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
COPY --from=lte-ue-build /lib64/libboost_atomic.so.1.66.0 /lib64
COPY --from=lte-ue-build /lib64/libboost_timer.so.1.66.0 /lib64
-COPY --from=lte-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+COPY --from=lte-ue-build /lib64/libboost_regex.so.1.66.0 /lib64
+
+COPY --from=lte-ue-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=lte-ue-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
+COPY --from=lte-ue-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
+
+WORKDIR /usr/local/share/uhd/rfnoc
+COPY --from=lte-ue-build /usr/local/share/uhd/rfnoc/ .
RUN ldconfig
diff --git a/docker/Dockerfile.lteUE.ubuntu18 b/docker/Dockerfile.lteUE.ubuntu18
index 34cbe651ad..6d54ab08fc 100644
--- a/docker/Dockerfile.lteUE.ubuntu18
+++ b/docker/Dockerfile.lteUE.ubuntu18
@@ -43,8 +43,7 @@ RUN python3 ./docker/scripts/generateTemplate.py ./docker/scripts/lte_ue_paramet
#start from scratch for target executable
FROM ubuntu:bionic as oai-lte-ue
ENV DEBIAN_FRONTEND=noninteractive
-ENV TZ=Europe
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+ENV TZ=Europe/Paris
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
@@ -58,19 +57,15 @@ RUN apt-get update && \
libconfig9 \
openssl \
net-tools \
+ python \
+ python3 \
+ python3-six \
+ python3-requests \
+ libusb-1.0-0 \
iputils-ping \
iproute2 \
iperf \
libyaml-0-2 && \
- # Install UHD driver from ettus ppa
- # At time of writing, it is 3.14
- add-apt-repository ppa:ettusresearch/uhd --yes && \
- apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install --yes \
- python \
- libusb-1.0-0 \
- libuhd003 \
- uhd-host && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-lte-ue/bin
@@ -95,6 +90,18 @@ RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/li
COPY --from=lte-ue-build /usr/local/lib/libprotobuf-c.so.1 .
+# Now we are copying from builder-image the UHD files.
+COPY --from=lte-ue-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=lte-ue-build /usr/local/lib/libuhd.so.3.15.0 /usr/local/lib
+COPY --from=lte-ue-build /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-lte-ue/bin
+WORKDIR /usr/lib/x86_64-linux-gnu
+COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 .
+COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 .
+COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 .
+COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.65.1 .
+COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 .
+COPY --from=lte-ue-build /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 .
+
RUN ldconfig
# Copy the relevant configuration files for UE
diff --git a/docker/Dockerfile.nrUE.rhel8.2 b/docker/Dockerfile.nrUE.rhel8.2
index 56fc746ade..ec74d11940 100644
--- a/docker/Dockerfile.nrUE.rhel8.2
+++ b/docker/Dockerfile.nrUE.rhel8.2
@@ -51,9 +51,13 @@ RUN yum update -y && \
iputils \
iproute \
atlas \
+ python3 \
+ python3-pip \
libXpm \
libX11 \
libyaml && \
+ pip3 install six && \
+ pip3 install requests && \
echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
@@ -87,6 +91,8 @@ COPY --from=nr-ue-build /lib64/libblas.so.3 /lib64
COPY --from=nr-ue-build /lib64/liblapack.so.3 /lib64
COPY --from=nr-ue-build /lib64/liblapacke.so.3 /lib64
COPY --from=nr-ue-build /lib64/libforms.so.2 /lib64
+
+# Now we are copying from builder-image the UHD files.
COPY --from=nr-ue-build /lib64/libboost_chrono.so.1.66.0 /lib64
COPY --from=nr-ue-build /lib64/libboost_date_time.so.1.66.0 /lib64
COPY --from=nr-ue-build /lib64/libboost_filesystem.so.1.66.0 /lib64
@@ -97,7 +103,15 @@ COPY --from=nr-ue-build /lib64/libboost_system.so.1.66.0 /lib64
COPY --from=nr-ue-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
COPY --from=nr-ue-build /lib64/libboost_atomic.so.1.66.0 /lib64
COPY --from=nr-ue-build /lib64/libboost_timer.so.1.66.0 /lib64
-COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+COPY --from=nr-ue-build /lib64/libboost_regex.so.1.66.0 /lib64
+
+COPY --from=nr-ue-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.3.15.0 /usr/local/lib64
+COPY --from=nr-ue-build /usr/local/lib64/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
+
+WORKDIR /usr/local/share/uhd/rfnoc
+COPY --from=nr-ue-build /usr/local/share/uhd/rfnoc/ .
+
RUN ldconfig
diff --git a/docker/Dockerfile.nrUE.ubuntu18 b/docker/Dockerfile.nrUE.ubuntu18
index fc30af7286..49e3f3213b 100644
--- a/docker/Dockerfile.nrUE.ubuntu18
+++ b/docker/Dockerfile.nrUE.ubuntu18
@@ -55,19 +55,15 @@ RUN apt-get update && \
libconfig9 \
openssl \
net-tools \
+ python \
+ python3 \
+ python3-six \
+ python3-requests \
+ libusb-1.0-0 \
iputils-ping \
iproute2 \
iperf \
libyaml-0-2 && \
- # Install UHD driver from ettus ppa
- # At time of writing, it is 3.14
- add-apt-repository ppa:ettusresearch/uhd --yes && \
- apt-get update && \
- DEBIAN_FRONTEND=noninteractive apt-get install --yes \
- python \
- libusb-1.0-0 \
- libuhd003 \
- uhd-host && \
rm -rf /var/lib/apt/lists/*
WORKDIR /opt/oai-nr-ue/bin
@@ -95,6 +91,18 @@ RUN /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/li
COPY --from=nr-ue-build /usr/local/lib/libprotobuf-c.so.1 .
+# Now we are copying from builder-image the UHD files.
+COPY --from=nr-ue-build /usr/local/bin/uhd_find_devices /usr/local/bin
+COPY --from=nr-ue-build /usr/local/lib/libuhd.so.3.15.0 /usr/local/lib
+COPY --from=nr-ue-build /usr/local/lib/uhd/utils/uhd_images_downloader.py /opt/oai-nr-ue/bin
+WORKDIR /usr/lib/x86_64-linux-gnu
+COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libboost_date_time.so.1.65.1 .
+COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.65.1 .
+COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.65.1 .
+COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libboost_serialization.so.1.65.1 .
+COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.65.1 .
+COPY --from=nr-ue-build /usr/lib/x86_64-linux-gnu/libboost_system.so.1.65.1 .
+
RUN ldconfig
WORKDIR /opt/oai-nr-ue
diff --git a/docker/Dockerfile.ran.rhel8.2 b/docker/Dockerfile.ran.rhel8.2
index 3972fd0c35..4d15220ca8 100644
--- a/docker/Dockerfile.ran.rhel8.2
+++ b/docker/Dockerfile.ran.rhel8.2
@@ -28,6 +28,9 @@
FROM registry.access.redhat.com/ubi8/ubi:latest AS ran-build
ARG NEEDED_GIT_PROXY
+ENV TZ=Europe/Paris
+ENV BUILD_UHD_FROM_SOURCE=True
+ENV UHD_VERSION=3.15.0.0
COPY tmp/ca/redhat-uep.pem /etc/rhsm/ca
COPY tmp/entitlement/*.pem /etc/pki/entitlement
diff --git a/docker/Dockerfile.ran.ubuntu18 b/docker/Dockerfile.ran.ubuntu18
index 4b296408fd..3ef81ec030 100644
--- a/docker/Dockerfile.ran.ubuntu18
+++ b/docker/Dockerfile.ran.ubuntu18
@@ -29,8 +29,9 @@
FROM ubuntu:bionic AS ran-build
ARG NEEDED_GIT_PROXY
ENV DEBIAN_FRONTEND=noninteractive
-ENV TZ=Europe
-RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+ENV TZ=Europe/Paris
+ENV BUILD_UHD_FROM_SOURCE=True
+ENV UHD_VERSION=3.15.0.0
#install developers pkg/repo
RUN apt-get update && \
diff --git a/docker/scripts/enb_entrypoint.sh b/docker/scripts/enb_entrypoint.sh
index 2e8886e855..ff92e3c86f 100755
--- a/docker/scripts/enb_entrypoint.sh
+++ b/docker/scripts/enb_entrypoint.sh
@@ -46,11 +46,11 @@ done
# Load the USRP binaries
if [[ -v USE_B2XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+ $PREFIX/bin/uhd_images_downloader.py -t b2xx
elif [[ -v USE_X3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+ $PREFIX/bin/uhd_images_downloader.py -t x3xx
elif [[ -v USE_N3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+ $PREFIX/bin/uhd_images_downloader.py -t n3xx
fi
echo "=================================="
diff --git a/docker/scripts/gnb_entrypoint.sh b/docker/scripts/gnb_entrypoint.sh
index d59018b56f..36160b136b 100755
--- a/docker/scripts/gnb_entrypoint.sh
+++ b/docker/scripts/gnb_entrypoint.sh
@@ -39,11 +39,11 @@ done
# Load the USRP binaries
if [[ -v USE_B2XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+ $PREFIX/bin/uhd_images_downloader.py -t b2xx
elif [[ -v USE_X3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+ $PREFIX/bin/uhd_images_downloader.py -t x3xx
elif [[ -v USE_N3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+ $PREFIX/bin/uhd_images_downloader.py -t n3xx
fi
echo "=================================="
diff --git a/docker/scripts/lte_ru_entrypoint.sh b/docker/scripts/lte_ru_entrypoint.sh
index f466e25ec2..93122b0d02 100755
--- a/docker/scripts/lte_ru_entrypoint.sh
+++ b/docker/scripts/lte_ru_entrypoint.sh
@@ -35,11 +35,11 @@ done
# Load the USRP binaries
if [[ -v USE_B2XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+ $PREFIX/bin/uhd_images_downloader.py -t b2xx
elif [[ -v USE_X3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+ $PREFIX/bin/uhd_images_downloader.py -t x3xx
elif [[ -v USE_N3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+ $PREFIX/bin/uhd_images_downloader.py -t n3xx
fi
echo "=================================="
diff --git a/docker/scripts/lte_ue_entrypoint.sh b/docker/scripts/lte_ue_entrypoint.sh
index 235128f738..de7ae8b496 100755
--- a/docker/scripts/lte_ue_entrypoint.sh
+++ b/docker/scripts/lte_ue_entrypoint.sh
@@ -39,11 +39,11 @@ $PREFIX/bin/conf2uedata -c $PREFIX/etc/ue_usim.conf -o $PREFIX
# Load the USRP binaries
if [[ -v USE_B2XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+ $PREFIX/bin/uhd_images_downloader.py -t b2xx
elif [[ -v USE_X3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+ $PREFIX/bin/uhd_images_downloader.py -t x3xx
elif [[ -v USE_N3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+ $PREFIX/bin/uhd_images_downloader.py -t n3xx
fi
# in case we have conf file, append
diff --git a/docker/scripts/nr_ue_entrypoint.sh b/docker/scripts/nr_ue_entrypoint.sh
index 691258b8fa..91d25c9e1e 100755
--- a/docker/scripts/nr_ue_entrypoint.sh
+++ b/docker/scripts/nr_ue_entrypoint.sh
@@ -34,11 +34,11 @@ done
# Load the USRP binaries
if [[ -v USE_B2XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+ $PREFIX/bin/uhd_images_downloader.py -t b2xx
elif [[ -v USE_X3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+ $PREFIX/bin/uhd_images_downloader.py -t x3xx
elif [[ -v USE_N3XX ]]; then
- /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+ $PREFIX/bin/uhd_images_downloader.py -t n3xx
fi
# in case we have conf file, append
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index ce09531e78..95b983190e 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -49,6 +49,7 @@
#include "SCHED_NR/fapi_nr_l1.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/MODULATION/nr_modulation.h"
+#include "PHY/NR_TRANSPORT/nr_dlsch.h"
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
@@ -88,6 +89,7 @@
#include "executables/softmodem-common.h"
#include
#include
+#include
#include
//#define DEBUG_THREADS 1
@@ -114,19 +116,36 @@ time_stats_t softmodem_stats_rx_sf; // total rx time
void tx_func(void *param) {
- processingData_L1_t *info = (processingData_L1_t *) param;
+ processingData_L1tx_t *info = (processingData_L1tx_t *) param;
PHY_VARS_gNB *gNB = info->gNB;
- int frame_tx = info->frame_tx;
- int slot_tx = info->slot_tx;
+ int frame_tx = info->frame;
+ int slot_tx = info->slot;
- phy_procedures_gNB_TX(gNB, frame_tx,slot_tx, 1);
+ phy_procedures_gNB_TX(info,
+ frame_tx,
+ slot_tx,
+ 1);
+ info->slot = -1;
+ //if ((frame_tx&127) == 0) dump_pdsch_stats(fd,gNB);
- // start FH TX processing
- notifiedFIFO_elt_t *res;
+ // If the later of the 2 L1 tx thread finishes first,
+ // we wait for the earlier one to finish and start the RU thread
+ // to avoid realtime issues with USRP
+
+ // Start RU TX processing.
+ notifiedFIFO_elt_t *res;
res = pullTpool(gNB->resp_RU_tx, gNB->threadPool);
processingData_RU_t *syncMsg = (processingData_RU_t *)NotifiedFifoData(res);
+ LOG_D(PHY,"waiting for previous tx to finish, next slot %d,%d\n",syncMsg->next_slot,slot_tx);
+ while (syncMsg->next_slot != slot_tx) {
+ pushNotifiedFIFO(gNB->resp_RU_tx, res);
+ res = pullTpool(gNB->resp_RU_tx, gNB->threadPool);
+ syncMsg = (processingData_RU_t *)NotifiedFifoData(res);
+ }
+ LOG_D(PHY,"previous tx finished, next slot %d,%d\n",syncMsg->next_slot,slot_tx);
syncMsg->frame_tx = frame_tx;
syncMsg->slot_tx = slot_tx;
+ syncMsg->next_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, frame_tx, slot_tx);
syncMsg->timestamp_tx = info->timestamp_tx;
syncMsg->ru = gNB->RU_list[0];
res->key = slot_tx;
@@ -184,7 +203,7 @@ void rx_func(void *param) {
int down_removed = 0;
int pucch_removed = 0;
for (int i = 0; i < rnti_to_remove_count; i++) {
- LOG_W(PHY, "to remove rnti %d\n", rnti_to_remove[i]);
+ LOG_W(NR_PHY, "to remove rnti %d\n", rnti_to_remove[i]);
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
int j;
@@ -201,13 +220,6 @@ void rx_func(void *param) {
}
up_removed++;
}
- for (j = 0; j < NUMBER_OF_NR_DLSCH_MAX; j++)
- if (gNB->dlsch[j][0]->rnti == rnti_to_remove[i]) {
- gNB->dlsch[j][0]->rnti = 0;
- gNB->dlsch[j][0]->harq_mask = 0;
- //clean_gNB_dlsch(gNB->dlsch[j][0]);
- down_removed++;
- }
for (j = 0; j < NUMBER_OF_NR_PUCCH_MAX; j++)
if (gNB->pucch[j]->active > 0 &&
gNB->pucch[j]->pucch_pdu.rnti == rnti_to_remove[i]) {
@@ -224,7 +236,7 @@ void rx_func(void *param) {
gNB->prach_vars.list[j].frame = -1;
#endif
}
- if (rnti_to_remove_count) LOG_W(PHY, "to remove rnti_to_remove_count=%d, up_removed=%d down_removed=%d pucch_removed=%d\n", rnti_to_remove_count, up_removed, down_removed, pucch_removed);
+ if (rnti_to_remove_count) LOG_W(NR_PHY, "to remove rnti_to_remove_count=%d, up_removed=%d down_removed=%d pucch_removed=%d\n", rnti_to_remove_count, up_removed, down_removed, pucch_removed);
rnti_to_remove_count = 0;
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
@@ -255,7 +267,6 @@ void rx_func(void *param) {
LOG_D(PHY,"%s() Exit proc[rx:%d%d tx:%d%d]\n", __FUNCTION__, frame_rx, slot_rx, frame_tx, slot_tx);
// Call the scheduler
-
start_meas(&gNB->ul_indication_stats);
pthread_mutex_lock(&gNB->UL_INFO_mutex);
gNB->UL_INFO.frame = frame_rx;
@@ -266,16 +277,17 @@ void rx_func(void *param) {
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
stop_meas(&gNB->ul_indication_stats);
- notifiedFIFO_elt_t *res;
-
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
+ notifiedFIFO_elt_t *res;
res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
- processingData_L1_t *syncMsg = (processingData_L1_t *)NotifiedFifoData(res);
+ processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
+ while (syncMsg->slot != slot_tx) {
+ pushNotifiedFIFO(gNB->resp_L1_tx, res);
+ res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
+ syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
+ }
syncMsg->gNB = gNB;
- syncMsg->frame_rx = frame_rx;
- syncMsg->slot_rx = slot_rx;
- syncMsg->frame_tx = frame_tx;
- syncMsg->slot_tx = slot_tx;
+ AssertFatal(syncMsg->slot == slot_tx, "Thread message slot and logical slot number do not match\n");
syncMsg->timestamp_tx = info->timestamp_tx;
res->key = slot_tx;
pushTpool(gNB->threadPool, res);
@@ -325,7 +337,6 @@ static void *process_stats_thread(void *param) {
PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param;
- reset_meas(&gNB->phy_proc_tx);
reset_meas(&gNB->dlsch_encoding_stats);
reset_meas(&gNB->phy_proc_rx);
reset_meas(&gNB->ul_indication_stats);
@@ -337,7 +348,8 @@ static void *process_stats_thread(void *param) {
while(!oai_exit)
{
sleep(1);
- print_meas(&gNB->phy_proc_tx, "L1 Tx processing", NULL, NULL);
+ print_meas(gNB->phy_proc_tx_0, "L1 Tx processing thread 0", NULL, NULL);
+ print_meas(gNB->phy_proc_tx_1, "L1 Tx processing thread 1", NULL, NULL);
print_meas(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL);
print_meas(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL);
print_meas(&gNB->ul_indication_stats, "UL Indication", NULL, NULL);
@@ -356,6 +368,7 @@ void *nrL1_stats_thread(void *param) {
fd=fopen("nrL1_stats.log","w");
AssertFatal(fd!=NULL,"Cannot open nrL1_stats.log\n");
dump_nr_I0_stats(fd,gNB);
+ dump_pdsch_stats(fd,gNB);
dump_pusch_stats(fd,gNB);
// nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
fclose(fd);
@@ -390,14 +403,38 @@ void init_gNB_Tpool(int inst) {
// L1 RX result FIFO
gNB->resp_L1 = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(gNB->resp_L1);
+ notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_L1,rx_func);
+ pushNotifiedFIFO(gNB->resp_L1,msg); // to unblock the process in the beginning
// L1 TX result FIFO
gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(gNB->resp_L1_tx);
+ // we create 2 threads for L1 tx processing
+ notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,tx_func);
+ processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
+ init_DLSCH_struct(gNB, msgDataTx);
+ msgDataTx->slot = -1;
+ memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
+ reset_meas(&msgDataTx->phy_proc_tx);
+ gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx;
+ pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning
+
+ msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,tx_func);
+ msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
+ init_DLSCH_struct(gNB, msgDataTx);
+ msgDataTx->slot = -1;
+ memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
+ reset_meas(&msgDataTx->phy_proc_tx);
+ gNB->phy_proc_tx_1 = &msgDataTx->phy_proc_tx;
+ pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning
// RU TX result FIFO
gNB->resp_RU_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
initNotifiedFIFO(gNB->resp_RU_tx);
+ notifiedFIFO_elt_t *msgRUTx = newNotifiedFIFO_elt(sizeof(processingData_RU_t),0,gNB->resp_RU_tx,ru_tx_func);
+ processingData_RU_t *msgData = (processingData_RU_t*)msgRUTx->msgData;
+ msgData->next_slot = sf_ahead*gNB->frame_parms.slots_per_subframe; // first Tx slot
+ pushNotifiedFIFO(gNB->resp_RU_tx,msgRUTx); // to unblock the process in the beginning
// Stats measurement thread
if(opp_enabled == 1) threadCreate(&proc->process_stats_thread, process_stats_thread,(void *)gNB, "time_meas", -1, OAI_PRIORITY_RT_LOW);
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index 2de04f4e7f..336b7bec12 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -33,6 +33,7 @@
#include "common/utils/assertions.h"
#include "common/utils/system.h"
+#include "common/ran_context.h"
#include "../../ARCH/COMMON/common_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
@@ -47,8 +48,6 @@
#include "PHY/INIT/phy_init.h"
#include "SCHED_NR/sched_nr.h"
-#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
-
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
@@ -301,15 +300,20 @@ void fh_if4p5_south_out(RU_t *ru, int frame, int slot, uint64_t timestamp) {
/* Input Fronthaul from south RCC/RAU */
// Synchronous if5 from south
+
+uint64_t ts_rx[20];
void fh_if5_south_in(RU_t *ru,
int *frame,
int *tti) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
RU_proc_t *proc = &ru->proc;
recv_IF5(ru, &proc->timestamp_rx, *tti, IF5_RRH_GW_UL);
- 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);
+ if (proc->first_rx == 1) ru->ts_offset = proc->timestamp_rx;
+ proc->frame_rx = ((proc->timestamp_rx-ru->ts_offset) / (fp->samples_per_subframe*10))&1023;
+ proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx-ru->ts_offset,fp);
+//(idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
+ ts_rx[*tti] = proc->timestamp_rx;
+ LOG_D(PHY,"IF5 %d.%d => RX %d.%d first_rx %d\n",*frame,*tti,proc->frame_rx,proc->tti_rx,proc->first_rx);
if (proc->first_rx == 0) {
if (proc->tti_rx != *tti) {
@@ -318,7 +322,7 @@ void fh_if5_south_in(RU_t *ru,
}
if (proc->frame_rx != *frame) {
- LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",proc->frame_rx,*frame);
+ LOG_E(PHY,"Received Timestamp doesn't correspond to the time we think it is (proc->frame_rx %d frame %d proc->tti_rx %d tti %d)\n",proc->frame_rx,*frame,proc->tti_rx,*tti);
exit_fun("Exiting");
}
} else {
@@ -610,6 +614,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
openair0_timestamp ts,old_ts;
AssertFatal(*slotslots_per_frame && *slot>=0, "slot %d is illegal (%d)\n",*slot,fp->slots_per_frame);
+ start_meas(&ru->rx_fhaul);
for (i=0; inb_rx; i++)
rxp[i] = (void *)&ru->common.rxdata[i][fp->get_samples_slot_timestamp(*slot,fp,0)];
@@ -653,11 +658,11 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
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",
+ LOG_D(PHY,"RU %d/%d TS %llu , frame %d, slot %d.%d / %d\n",
ru->idx,
0,
- (unsigned long long int)proc->timestamp_rx,
- (int)ru->ts_offset,proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame);
+ (unsigned long long int)(proc->timestamp_rx+ru->ts_offset),
+ proc->frame_rx,proc->tti_rx,proc->tti_tx,fp->slots_per_frame);
// dump VCD output for first RU in list
if (ru == RC.ru[0]) {
@@ -683,12 +688,14 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
}
//printf("timestamp_rx %lu, frame %d(%d), subframe %d(%d)\n",ru->timestamp_rx,proc->frame_rx,frame,proc->tti_rx,subframe);
- VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, proc->timestamp_rx&0xffffffff );
+ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TS, (proc->timestamp_rx+ru->ts_offset)&0xffffffff );
if (rxs != samples_per_slot) {
//exit_fun( "problem receiving samples" );
LOG_E(PHY, "problem receiving samples\n");
}
+
+ stop_meas(&ru->rx_fhaul);
}
@@ -698,13 +705,13 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
nfapi_nr_config_request_scf_t *cfg = &ru->config;
void *txp[ru->nb_tx];
unsigned int txs;
- int i,txsymb;
+ int i,txsymb=fp->symbols_per_slot;
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot),
T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4));
int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
- int sf_extension = 0; //sf_extension = ru->sf_extension;
+ int sf_extension = 0;
int siglen=fp->get_samples_per_slot(slot,fp);
int flags=1;
@@ -730,9 +737,10 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
flags = 3; // end of burst
}
- if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT)
+ if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT) {
flags = 2; // start of burst
-
+ sf_extension = ru->sf_extension;
+ }
if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT)
flags = 3; // end of burst
}
@@ -758,27 +766,28 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
flags |= beam<<8;
LOG_D(HW,"slot %d, beam %d\n",slot,ru->common.beam_id[0][slot*fp->symbols_per_slot]);
}
+ if (proc->first_tx == 1) proc->first_tx = 0;
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 );
for (i=0; inb_tx; i++)
- txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)-sf_extension];
-
- VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
+ txp[i] = (void *)&ru->common.txdata[i][fp->get_samples_slot_timestamp(slot,fp,0)]-sf_extension*sizeof(int32_t);
+
+ VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, (timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance)&0xffffffff );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 1 );
- // prepare tx buffer pointers
+ // prepare tx buffer pointers
txs = ru->rfdevice.trx_write_func(&ru->rfdevice,
timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension,
txp,
siglen+sf_extension,
ru->nb_tx,
flags);
- LOG_D(PHY,"[TXPATH] RU %d tx_rf, writing to TS %llu, frame %d, unwrapped_frame %d, slot %di, returned %d\n",ru->idx,
- (long long unsigned int)timestamp,frame,proc->frame_tx_unwrap,slot, txs);
+ LOG_D(PHY,"[TXPATH] RU %d aa %d tx_rf, writing to TS %llu, %d.%d, unwrapped_frame %d, slot %d, flags %d, siglen+sf_extension %d, returned %d, E %f\n",ru->idx,i,
+ (long long unsigned int)(timestamp+ru->ts_offset-ru->openair0_cfg.tx_sample_advance-sf_extension),frame,slot,proc->frame_tx_unwrap,slot, flags, siglen+sf_extension, txs,10*log10((double)signal_energy(txp[0],siglen+sf_extension)));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE, 0 );
- //AssertFatal(txs == 0,"trx write function error %d\n", txs);
+ //AssertFatal(txs == 0,"trx write function error %d\n", txs);
}
}
@@ -793,79 +802,86 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
if (mu == NR_MU_0) {
switch(N_RB) {
- case 270:
- if (fp->threequarter_fs) {
- cfg->sample_rate=92.16e6;
- cfg->samples_per_frame = 921600;
- cfg->tx_bw = 50e6;
- cfg->rx_bw = 50e6;
- } else {
- cfg->sample_rate=61.44e6;
- cfg->samples_per_frame = 614400;
- cfg->tx_bw = 50e6;
- cfg->rx_bw = 50e6;
- }
-
- case 216:
- if (fp->threequarter_fs) {
- cfg->sample_rate=46.08e6;
- cfg->samples_per_frame = 460800;
- cfg->tx_bw = 40e6;
- cfg->rx_bw = 40e6;
- } else {
- cfg->sample_rate=61.44e6;
- cfg->samples_per_frame = 614400;
- cfg->tx_bw = 40e6;
- cfg->rx_bw = 40e6;
- }
-
- break;
-
- case 106:
- if (fp->threequarter_fs) {
- cfg->sample_rate=23.04e6;
- cfg->samples_per_frame = 230400;
- cfg->tx_bw = 20e6;
- cfg->rx_bw = 20e6;
- } else {
- cfg->sample_rate=30.72e6;
- cfg->samples_per_frame = 307200;
- cfg->tx_bw = 20e6;
- cfg->rx_bw = 20e6;
- }
-
- break;
-
- case 52:
- if (fp->threequarter_fs) {
- cfg->sample_rate=11.52e6;
- cfg->samples_per_frame = 115200;
- cfg->tx_bw = 10e6;
- cfg->rx_bw = 10e6;
- } else {
- cfg->sample_rate=15.36e6;
- cfg->samples_per_frame = 153600;
- cfg->tx_bw = 10e6;
- cfg->rx_bw = 10e6;
- }
-
- case 25:
- if (fp->threequarter_fs) {
- cfg->sample_rate=5.76e6;
- cfg->samples_per_frame = 57600;
- cfg->tx_bw = 5e6;
- cfg->rx_bw = 5e6;
- } else {
- cfg->sample_rate=7.68e6;
- cfg->samples_per_frame = 76800;
- cfg->tx_bw = 5e6;
- cfg->rx_bw = 5e6;
- }
-
- break;
-
- default:
- AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
+ case 270:
+ if (fp->threequarter_fs) {
+ cfg->sample_rate=92.16e6;
+ cfg->samples_per_frame = 921600;
+ cfg->tx_bw = 50e6;
+ cfg->rx_bw = 50e6;
+ } else {
+ cfg->sample_rate=61.44e6;
+ cfg->samples_per_frame = 614400;
+ cfg->tx_bw = 50e6;
+ cfg->rx_bw = 50e6;
+ }
+ case 216:
+ if (fp->threequarter_fs) {
+ cfg->sample_rate=46.08e6;
+ cfg->samples_per_frame = 460800;
+ cfg->tx_bw = 40e6;
+ cfg->rx_bw = 40e6;
+ }
+ else {
+ cfg->sample_rate=61.44e6;
+ cfg->samples_per_frame = 614400;
+ cfg->tx_bw = 40e6;
+ cfg->rx_bw = 40e6;
+ }
+ break;
+ case 160: //30 MHz
+ case 133: //25 MHz
+ if (fp->threequarter_fs) {
+ AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
+ }
+ else {
+ cfg->sample_rate=30.72e6;
+ cfg->samples_per_frame = 307200;
+ cfg->tx_bw = 20e6;
+ cfg->rx_bw = 20e6;
+ }
+ case 106:
+ if (fp->threequarter_fs) {
+ cfg->sample_rate=23.04e6;
+ cfg->samples_per_frame = 230400;
+ cfg->tx_bw = 20e6;
+ cfg->rx_bw = 20e6;
+ }
+ else {
+ cfg->sample_rate=30.72e6;
+ cfg->samples_per_frame = 307200;
+ cfg->tx_bw = 20e6;
+ cfg->rx_bw = 20e6;
+ }
+ break;
+ case 52:
+ if (fp->threequarter_fs) {
+ cfg->sample_rate=11.52e6;
+ cfg->samples_per_frame = 115200;
+ cfg->tx_bw = 10e6;
+ cfg->rx_bw = 10e6;
+ }
+ else {
+ cfg->sample_rate=15.36e6;
+ cfg->samples_per_frame = 153600;
+ cfg->tx_bw = 10e6;
+ cfg->rx_bw = 10e6;
+ }
+ case 25:
+ if (fp->threequarter_fs) {
+ cfg->sample_rate=5.76e6;
+ cfg->samples_per_frame = 57600;
+ cfg->tx_bw = 5e6;
+ cfg->rx_bw = 5e6;
+ }
+ else {
+ cfg->sample_rate=7.68e6;
+ cfg->samples_per_frame = 76800;
+ cfg->tx_bw = 5e6;
+ cfg->rx_bw = 5e6;
+ }
+ break;
+ default:
+ AssertFatal(0==1,"N_RB %d not yet supported for numerology %d\n",N_RB,mu);
}
} else if (mu == NR_MU_1) {
switch(N_RB) {
@@ -896,6 +912,19 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->rx_bw = 80e6;
}
break;
+ case 162 :
+ if (fp->threequarter_fs) {
+ AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
+ }
+ else {
+ cfg->sample_rate=61.44e6;
+ cfg->samples_per_frame = 614400;
+ cfg->tx_bw = 60e6;
+ cfg->rx_bw = 60e6;
+ }
+
+ break;
+
case 133 :
if (fp->threequarter_fs) {
AssertFatal(1==0,"N_RB %d cannot use 3/4 sampling\n",N_RB);
@@ -1139,8 +1168,7 @@ void *ru_stats_thread(void *param) {
print_meas(&ru->ofdm_total_stats,"feptx_total",NULL,NULL);
}
- if (ru->fh_north_asynch_in) print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
-
+ print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
print_meas(&ru->tx_fhaul,"tx_fhaul",NULL,NULL);
if (ru->fh_north_out) {
@@ -1216,7 +1244,9 @@ void *ru_thread( void *param ) {
int slot = fp->slots_per_frame-1;
int frame = 1023;
char threadname[40];
- int aa;
+ int initial_wait=0;
+ int opp_enabled0 = opp_enabled;
+
nfapi_nr_config_request_scf_t *cfg = &ru->config;
// set default return value
ru_thread_status = 0;
@@ -1236,22 +1266,25 @@ void *ru_thread( void *param ) {
exit(-1);
}
} else {
+ nr_init_frame_parms(&ru->config, fp);
+ nr_dump_frame_parms(fp);
+ fill_rf_config(ru,ru->rf_config_file);
+ nr_phy_init_RU(ru);
+
// Start IF device if any
if (ru->nr_start_if) {
LOG_I(PHY,"Starting IF interface for RU %d\n",ru->idx);
AssertFatal(ru->nr_start_if(ru,NULL) == 0, "Could not start the IF device\n");
- if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
- else ret = attach_rru(ru);
+ if (ru->has_ctrl_prt > 0) {
+ if (ru->if_south == LOCAL_RF) ret = connect_rau(ru);
+ else ret = attach_rru(ru);
+
+ AssertFatal(ret==0,"Cannot connect to remote radio\n");
+ }
- AssertFatal(ret==0,"Cannot connect to remote radio\n");
}
-
- if (ru->if_south == LOCAL_RF) { // configure RF parameters only
- nr_init_frame_parms(&ru->config, fp);
- nr_dump_frame_parms(fp);
- fill_rf_config(ru,ru->rf_config_file);
- nr_phy_init_RU(ru);
+ else if (ru->if_south == LOCAL_RF) { // configure RF parameters only
ret = openair0_device_load(&ru->rfdevice,&ru->openair0_cfg);
AssertFatal(ret==0,"Cannot connect to local radio\n");
}
@@ -1263,20 +1296,15 @@ void *ru_thread( void *param ) {
}
sf_ahead = (uint16_t) ceil((float)6/(0x01<numerology_index));
- LOG_I(PHY, "Signaling main thread that RU %d is ready\n",ru->idx);
+ LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,sf_ahead);
pthread_mutex_lock(&RC.ru_mutex);
RC.ru_mask &= ~(1<idx);
pthread_cond_signal(&RC.ru_cond);
pthread_mutex_unlock(&RC.ru_mutex);
wait_sync("ru_thread");
- notifiedFIFO_elt_t *msg = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_L1,rx_func);
- notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_L1_tx,tx_func);
- notifiedFIFO_elt_t *msgRUTx = newNotifiedFIFO_elt(sizeof(processingData_L1_t),0,gNB->resp_RU_tx,ru_tx_func);
+
processingData_L1_t *syncMsg;
notifiedFIFO_elt_t *res;
- pushNotifiedFIFO(gNB->resp_L1,msg); // to unblock the process in the beginning
- pushNotifiedFIFO(gNB->resp_L1_tx,msgL1Tx); // to unblock the process in the beginning
- pushNotifiedFIFO(gNB->resp_RU_tx,msgRUTx); // to unblock the process in the beginning
if(!emulate_rf) {
// Start RF device if any
@@ -1316,6 +1344,19 @@ void *ru_thread( void *param ) {
if (ru->fh_south_in) ru->fh_south_in(ru,&frame,&slot);
else AssertFatal(1==0, "No fronthaul interface at south port");
+ if (initial_wait == 1 && proc->frame_rx < 300 && ru->fh_south_in == rx_rf) {
+ if (proc->frame_rx>0 && ((proc->frame_rx % 100) == 0) && proc->tti_rx==0) {
+ LOG_I(PHY,"delay processing to let RX stream settle, frame %d (trials %d)\n",proc->frame_rx,ru->rx_fhaul.trials);
+ print_meas(&ru->rx_fhaul,"rx_fhaul",NULL,NULL);
+ reset_meas(&ru->rx_fhaul);
+ }
+ continue;
+ }
+ if (proc->frame_rx>=300) {
+ initial_wait=0;
+ opp_enabled = opp_enabled0;
+ }
+ if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul);
proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe);
proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame;
@@ -1336,12 +1377,13 @@ void *ru_thread( void *param ) {
ru->feprx(ru,proc->tti_rx);
//LOG_M("rxdata.m","rxs",ru->common.rxdata[0],1228800,1,1);
LOG_D(PHY,"RU proc: frame_rx = %d, tti_rx = %d\n", proc->frame_rx, proc->tti_rx);
+/*
LOG_D(PHY,"Copying rxdataF from RU to gNB\n");
- for (aa=0; aanb_rx; aa++)
+ for (int aa=0; aanb_rx; aa++)
memcpy((void *)RC.gNB[0]->common_vars.rxdataF[aa],
(void *)ru->common.rxdataF[aa], fp->symbols_per_slot*fp->ofdm_symbol_size*sizeof(int32_t));
-
+*/
if (IS_SOFTMODEM_DOSCOPE && RC.gNB[0]->scopeData)
((scopeData_t *)RC.gNB[0]->scopeData)->slotFunc(ru->common.rxdataF[0],proc->tti_rx, RC.gNB[0]->scopeData);
@@ -1405,13 +1447,24 @@ void *ru_thread( void *param ) {
else LOG_I(PHY,"RU %d rf device stopped\n",ru->idx);
}
- delNotifiedFIFO_elt(msg);
- delNotifiedFIFO_elt(msgL1Tx);
- delNotifiedFIFO_elt(msgRUTx);
+ res = pullNotifiedFIFO(gNB->resp_L1);
+ delNotifiedFIFO_elt(res);
+ res = pullNotifiedFIFO(gNB->resp_L1_tx);
+ delNotifiedFIFO_elt(res);
+ res = pullNotifiedFIFO(gNB->resp_L1_tx);
+ delNotifiedFIFO_elt(res);
+ res = pullNotifiedFIFO(gNB->resp_RU_tx);
+ delNotifiedFIFO_elt(res);
+
ru_thread_status = 0;
return &ru_thread_status;
}
+int start_streaming(RU_t *ru) {
+ LOG_I(PHY,"Starting streaming on third-party RRU\n");
+ return(ru->ifdevice.thirdparty_startstreaming(&ru->ifdevice));
+}
+
int nr_start_if(struct RU_t_s *ru, struct PHY_VARS_gNB_s *gNB) {
return(ru->ifdevice.trx_start_func(&ru->ifdevice));
}
@@ -1668,6 +1721,7 @@ void set_function_spec_param(RU_t *ru) {
switch (ru->if_south) {
case LOCAL_RF: // this is an RU with integrated RF (RRU, gNB)
+ reset_meas(&ru->rx_fhaul);
if (ru->function == NGFI_RRU_IF5) { // IF5 RRU
ru->do_prach = 0; // no prach processing in RU
ru->fh_north_in = NULL; // no shynchronous incoming fronthaul from north
@@ -1705,7 +1759,6 @@ void set_function_spec_param(RU_t *ru) {
ru->ifdevice.host_type = RRU_HOST;
ru->rfdevice.host_type = RRU_HOST;
ru->ifdevice.eth_params = &ru->eth_params;
- reset_meas(&ru->rx_fhaul);
reset_meas(&ru->tx_fhaul);
reset_meas(&ru->compression);
reset_meas(&ru->transport);
@@ -1757,7 +1810,7 @@ void set_function_spec_param(RU_t *ru) {
ru->fh_south_in = fh_if5_south_in; // synchronous IF5 reception
ru->fh_south_out = fh_if5_south_out; // synchronous IF5 transmission
ru->fh_south_asynch_in = NULL; // no asynchronous UL
- ru->start_rf = NULL; // no local RF
+ ru->start_rf = ru->eth_params.transp_preference == ETH_UDP_IF5_ECPRI_MODE ? start_streaming : NULL;
ru->stop_rf = NULL;
ru->start_write_thread = NULL;
ru->nr_start_if = nr_start_if; // need to start if interface for IF5
@@ -2013,7 +2066,7 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
-
+ RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
for (i=0; inum_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
} //strcmp(local_rf, "yes") == 0
else {
@@ -2030,6 +2083,12 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
+ RC.ru[j]->if_south = REMOTE_IF5;
+ RC.ru[j]->function = NGFI_RAU_IF5;
+ RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
+ RC.ru[j]->if_south = REMOTE_IF5;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5;
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index c38c5217ae..3a6a795bb0 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -321,8 +321,8 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
UE->rf_map.card = card_offset;
UE->rf_map.chain = CC_id + chain_offset;
- LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, do_prb_interpolation %d\n",
- UE->mode, UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->prb_interpolation);
+ LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan_carrier %d, UE_no_timing_correction %d \n, do_prb_interpolation %d\n",
+ UE->mode, UE->UE_fo_compensation, UE->UE_scan_carrier, UE->no_timing_correction, UE->prb_interpolation);
// Set FP variables
@@ -331,7 +331,7 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
}
- LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs);
+ LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d, ssb_start_subcarrier %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs, fp->ssb_start_subcarrier);
fp->ofdm_offset_divisor = nrUE_params.ofdm_offset_divisor;
@@ -438,7 +438,7 @@ int main( int argc, char **argv ) {
itti_init(TASK_MAX, tasks_info);
init_opt() ;
- load_nrLDPClib();
+ load_nrLDPClib(NULL);
if (ouput_vcd) {
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h
index 8469ffe790..7f47ed5eb3 100644
--- a/executables/nr-uesoftmodem.h
+++ b/executables/nr-uesoftmodem.h
@@ -50,7 +50,7 @@
{ NOL2CONNECT_OPT, CONFIG_HLP_NOL2CN, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \
{ CALIBPRACH_OPT, CONFIG_HLP_CALPRACH, PARAMFLAG_BOOL, uptr:NULL, defuintval:1, TYPE_INT, 0}, \
{ DUMPFRAME_OPT, CONFIG_HLP_DUMPFRAME, PARAMFLAG_BOOL, iptr:&dumpframe, defintval:0, TYPE_INT, 0}, \
- {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:0, TYPE_DOUBLE,0}, \
+ {"ue-rxgain", CONFIG_HLP_UERXG, 0, dblptr:&(rx_gain[0][0]), defdblval:110, TYPE_DOUBLE,0}, \
{"ue-rxgain-off", CONFIG_HLP_UERXGOFF, 0, dblptr:&rx_gain_off, defdblval:0, TYPE_DOUBLE,0}, \
{"ue-txgain", CONFIG_HLP_UETXG, 0, dblptr:&(tx_gain[0][0]), defdblval:0, TYPE_DOUBLE,0}, \
{"ue-nb-ant-rx", CONFIG_HLP_UENANTR, 0, u8ptr:&(fp->nb_antennas_rx), defuintval:1, TYPE_UINT8, 0}, \
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index c6a1eb44e4..3a7022a502 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -155,10 +155,10 @@ extern int usrp_tx_thread;
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
{"use-256qam-table", CONFIG_HLP_256QAM, PARAMFLAG_BOOL, iptr:&USE_256QAM_TABLE, defintval:0, TYPE_INT, 0}, \
- {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \
- {"usrp-tx-thread-config",CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
- {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
- {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
+ {"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \
+ {"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
+ {"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
+ {"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
}
diff --git a/nfapi/oai_integration/nfapi_pnf.c b/nfapi/oai_integration/nfapi_pnf.c
index 2b1900200a..4edbeee342 100644
--- a/nfapi/oai_integration/nfapi_pnf.c
+++ b/nfapi/oai_integration/nfapi_pnf.c
@@ -1104,25 +1104,70 @@ void pnf_phy_deallocate_p7_vendor_ext(nfapi_p7_message_header_t *header) {
free(header);
}
+notifiedFIFO_elt_t *l1tx_message_extract(PHY_VARS_gNB *gNB, int frame, int slot) {
+ notifiedFIFO_elt_t *res;
+ notifiedFIFO_elt_t *freeRes = NULL;
+
+ // check first message
+ res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
+ processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
+ if (msgTx->slot == slot) {
+ return res;
+ }
+ if (msgTx->slot == -1) {
+ freeRes = res;
+ }
+
+ // check second message
+ pushNotifiedFIFO(gNB->resp_L1_tx,res);
+ res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
+ msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
+ if (msgTx->slot == slot) {
+ return res;
+ }
+ if (msgTx->slot == -1) {
+ freeRes = res;
+ }
+
+ if (freeRes) {
+ msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
+ msgTx->num_pdsch_slot=0;
+ msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0;
+ msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0;
+ msgTx->slot = slot;
+ msgTx->frame = frame;
+ return freeRes;
+ }
+ pushNotifiedFIFO(gNB->resp_L1_tx,res);
+ AssertFatal(1==0, "It means both L1 Tx messages are still waiting to be processed. This happens when L1 Tx processing is too slow. Message slot %d, scheduled slot %d\n",
+ msgTx->slot, slot);
+}
int pnf_phy_ul_dci_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_nr_ul_dci_request_t *req) {
// LOG_D(PHY,"[PNF] HI_DCI0_REQUEST SFN/SF:%05d dci:%d hi:%d\n", NFAPI_SFNSF2DEC(req->sfn_sf), req->hi_dci0_request_body.number_of_dci, req->hi_dci0_request_body.number_of_hi);
struct PHY_VARS_gNB_s *gNB = RC.gNB[0];
+
+ // extract the next available thread message (priority to message with current slot, then free message)
+ notifiedFIFO_elt_t *res;
+ res = l1tx_message_extract(gNB, req->SFN, req->Slot);
+ processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
+
if (proc ==NULL)
proc = &gNB->proc.L1_proc;
- for (int i=0; inumPdus; i++) {
- if (req->ul_dci_pdu_list[i].PDUType == 0) {
- nfapi_nr_ul_dci_request_pdus_t *ul_dci_req_pdu = &req->ul_dci_pdu_list[i];
- handle_nfapi_nr_ul_dci_pdu(gNB, req->SFN, req->Slot, ul_dci_req_pdu);
+ if (req->numPdus > 0) {
+ if (req->ul_dci_pdu_list[req->numPdus-1].PDUType == 0) { // copy only the last PDU (PHY can have only one UL PDCCH pdu)
+ msgTx->ul_pdcch_pdu = req->ul_dci_pdu_list[req->numPdus-1]; // copy the last pdu
}
else {
- LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), i, req->ul_dci_pdu_list[i].PDUType);
+ LOG_E(PHY,"[PNF] UL_DCI_REQ sfn_slot:%d PDU[%d] - unknown pdu type:%d\n", NFAPI_SFNSLOT2DEC(req->SFN, req->Slot), req->numPdus-1, req->ul_dci_pdu_list[req->numPdus-1].PDUType);
}
}
+ pushNotifiedFIFO(gNB->resp_L1_tx,res);
+
return 0;
}
@@ -1193,14 +1238,17 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
for (int i=0; idl_tti_request_body.nPDUs; i++) {
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d pdcch_vars->num_dci:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size,pdcch_vars->num_dci);
+ notifiedFIFO_elt_t *res;
+ res = l1tx_message_extract(gNB, sfn, slot);
+ processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE) {
- nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu=&dl_tti_pdu_list[i];
- handle_nfapi_nr_pdcch_pdu(gNB, sfn, slot, &dl_tti_pdu->pdcch_pdu);
+ // we trust the scheduler sends only one PDCCH PDU per slot
+ msgTx->pdcch_pdu = dl_tti_pdu_list[i].pdcch_pdu; // fills the last received PDCCH PDU
}
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_SSB_PDU_TYPE) {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() PDU:%d BCH: pdu_index:%u pdu_length:%d sdu_length:%d BCH_SDU:%x,%x,%x\n", __FUNCTION__, i, pdu_index, bch_pdu->bch_pdu_rel8.length, tx_request_pdu[sfn][sf][pdu_index]->segments[0].segment_length, sdu[0], sdu[1], sdu[2]);
- handle_nr_nfapi_ssb_pdu(gNB, sfn, slot, &dl_tti_pdu_list[i]);
+ handle_nr_nfapi_ssb_pdu(msgTx, sfn, slot, &dl_tti_pdu_list[i]);
gNB->pbch_configured=1;
}
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_PDSCH_PDU_TYPE) {
@@ -1209,21 +1257,11 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
nfapi_nr_pdu_t *tx_data = tx_data_request[sfn][slot][rel15_pdu->pduIndex];
if (tx_data != NULL) {
- int UE_id = find_nr_dlsch(rel15_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
- AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
- NR_gNB_DLSCH_t *dlsch0 = gNB->dlsch[UE_id][0];
- int harq_pid = dlsch0->harq_ids[sfn%2][slot];
-
- if(harq_pid >= dlsch0->Mdlharq) {
- LOG_E(PHY,"pnf_phy_dl_config_req illegal harq_pid %d\n", harq_pid);
- return(-1);
- }
-
- uint8_t *dlsch_sdu = nr_tx_pdus[UE_id][harq_pid];
- memcpy(dlsch_sdu, tx_data->TLVs[0].value.direct,tx_data->PDU_length);
+ uint8_t *dlsch_sdu = (uint8_t *)tx_data->TLVs[0].value.direct;
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() DLSCH:pdu_index:%d handle_nfapi_dlsch_pdu(eNB, proc_rxtx, dlsch_pdu, transport_blocks:%d sdu:%p) eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols:%d\n", __FUNCTION__, rel8_pdu->pdu_index, rel8_pdu->transport_blocks, dlsch_sdu, eNB->pdcch_vars[proc->subframe_tx & 1].num_pdcch_symbols);
- handle_nr_nfapi_pdsch_pdu(gNB, sfn, slot,pdsch_pdu, dlsch_sdu);
+ AssertFatal(msgTx->num_pdsch_slot < gNB->number_of_nr_dlsch_max,"Number of PDSCH PDUs %d exceeded the limit %d\n",
+ msgTx->num_pdsch_slot,gNB->number_of_nr_dlsch_max);
+ handle_nr_nfapi_pdsch_pdu(msgTx, pdsch_pdu, dlsch_sdu);
}
else {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() DLSCH NULL TX PDU SFN/SF:%d PDU_INDEX:%d\n", __FUNCTION__, NFAPI_SFNSLOT2DEC(sfn,slot), rel15_pdu->pduIndex);
@@ -1231,11 +1269,12 @@ int pnf_phy_dl_tti_req(gNB_L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7,
}
else if (dl_tti_pdu_list[i].PDUType == NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE) {
nfapi_nr_dl_tti_csi_rs_pdu *csi_rs_pdu = &dl_tti_pdu_list[i].csi_rs_pdu;
- handle_nfapi_nr_csirs_pdu(gNB, sfn, slot, csi_rs_pdu);
+ handle_nfapi_nr_csirs_pdu(msgTx, sfn, slot, csi_rs_pdu);
}
else {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_tti_pdu_list[i].PDUType);
}
+ pushNotifiedFIFO(gNB->resp_L1_tx,res);
}
if(req->vendor_extension)
diff --git a/openair1/PHY/CODING/DOC/LDPCImplementation.md b/openair1/PHY/CODING/DOC/LDPCImplementation.md
index 89ae6b4dbb..c5411540b6 100644
--- a/openair1/PHY/CODING/DOC/LDPCImplementation.md
+++ b/openair1/PHY/CODING/DOC/LDPCImplementation.md
@@ -1,11 +1,13 @@
-#LDPC coder/decoder implementation
+# LDPC coder/decoder implementation
The LDPC coder and decoder are implemented in a shared library, dynamically loaded at run-time using the [oai shared library loader](file://../../../../common/utils/DOC/loader.md). The code loading the LDPC library is in [nrLDPC_load.c](file://../nrLDPC_load.c), in function `load_nrLDPClib`, which must be called at init time.
## Selecting the LDPC library at run time
By default the function `int load_nrLDPClib(void)` looks for `libldpc.so`, this default behavior can be changed using the oai loader configuration options in the configuration file or from the command line as shown below:
->loading `libldpc_optim8seg.so` instead of `libldpc.so`
+#### Examples of ldpc shared lib selection when running nr softmodem's:
+
+loading `libldpc_optim8seg.so` instead of `libldpc.so`:
```
./nr-softmodem -O libconfig:gnb.band78.tm1.106PRB.usrpx300.conf:dbgl5 --loader.ldpc.shlibversion _optim8seg
@@ -18,9 +20,160 @@ By default the function `int load_nrLDPClib(void)` looks for `libldpc.so`, this
........................
```
-Today, this mechanism is not available in the `ldpctest` phy simulator which doesn't initialize the [configuration module](file://../../../../common/config/DOC/config.md). loads `libldpc.so` and `libldpc_orig.so` to compare the performance of the two implementations.
+loading `libldpc_cl.so` instead of `libldpc.so`:
-###LDPC libraries
-Libraries implementing the LDPC algorithms must be named `libldpc<_version>.so`, they must implement two functions: `nrLDPC_decod` and `nrLDPC_encod`. The prototypes for these functions is defined in [nrLDPC_defs.h](file://nrLDPC_defs.h).
+`make ldpc_cl`
+
+`cp ../../../openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl`
+
+`./nr-softmodem -O libconfig:gnb.band78.sa.fr1.106PRB.usrpb210.conf:dbgl5 --rfsim --rfsimulator.serveraddr server --sa --log_config.gtpu_log_level info --loader.ldpc.shlibversion _cl`
+
+``` [LOADER] library libldpc_cl.so successfully loaded
+------------------------------------------------
+[HW] Platform 0, OpenCL profile FULL_PROFILE
+[HW] Platform 0, OpenCL version OpenCL 2.1 LINUX
+[HW] Device 0 is available
+[HW] Device 0, type 2 = 0x00000002: cpu
+[HW] Device 0, number of Compute Units: 8
+[HW] Device 0, max Work Items dimension: 3
+[HW] Device 0, max Work Items size for dimension: 0 8192
+[HW] Device 0, max Work Items size for dimension: 1 8192
+[HW] Device 0, max Work Items size for dimension: 2 8192
+[New Thread 0x7fffcc258700 (LWP 3945123)]
+[New Thread 0x7fffc3e57700 (LWP 3945124)]
+[New Thread 0x7fffcbe57700 (LWP 3945125)]
+[New Thread 0x7fffcba56700 (LWP 3945126)]
+[New Thread 0x7fffcb254700 (LWP 3945128)]
+[New Thread 0x7fffcb655700 (LWP 3945127)]
+[New Thread 0x7fffcae53700 (LWP 3945129)]
+[HW] Platform 1, OpenCL profile FULL_PROFILE
+[HW] Platform 1, OpenCL version OpenCL 2.0 beignet 1.3
+[New Thread 0x7fffc965a700 (LWP 3945130)]
+[Thread 0x7fffc965a700 (LWP 3945130) exited]
+[HW] Device 0 is available
+[HW] Device 0, type 4 = 0x00000004: gpu
+[HW] Device 0, number of Compute Units: 20
+[HW] Device 0, max Work Items dimension: 3
+[HW] Device 0, max Work Items size for dimension: 0 512
+[HW] Device 0, max Work Items size for dimension: 1 512
+[HW] Device 0, max Work Items size for dimension: 2 512
+-----------------------------------------------------------------
+```
+
+`./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa -O libconfig:/usr/local/oai/conf/nrue_sim.conf:dbgl5 --nokrnmod --loader.ldpc.shlibversion _cl --log_config.hw_log_level info`
+
+```[CONFIG] shlibversion set to _cl from command line
+............................................................
+[CONFIG] loader.ldpc 1 options set from command line
+[LOADER] library libldpc_cl.so successfully loaded
+[HW] Platform 0, OpenCL profile FULL_PROFILE
+[HW] Platform 0, OpenCL version OpenCL 2.1 LINUX
+[HW] Device 0 is available
+[HW] Device 0, type 2 = 0x00000002: cpu
+[HW] Device 0, number of Compute Units: 8
+[HW] Device 0, max Work Items dimension: 3
+[HW] Device 0, max Work Items size for dimension: 0 8192
+[HW] Device 0, max Work Items size for dimension: 1 8192
+[HW] Device 0, max Work Items size for dimension: 2 8192
+[New Thread 0x7fffecccc700 (LWP 3945413)]
+[New Thread 0x7fffec8cb700 (LWP 3945415)]
+[New Thread 0x7fffec4ca700 (LWP 3945414)]
+[New Thread 0x7fffdf7fd700 (LWP 3945417)]
+[New Thread 0x7fffdfbfe700 (LWP 3945418)]
+[New Thread 0x7fffdffff700 (LWP 3945416)]
+[New Thread 0x7fffd73fc700 (LWP 3945419)]
+[HW] Platform 1, OpenCL profile FULL_PROFILE
+[HW] Platform 1, OpenCL version OpenCL 2.0 beignet 1.3
+[New Thread 0x7fffde105700 (LWP 3945420)]
+[Thread 0x7fffde105700 (LWP 3945420) exited]
+[HW] Device 0 is available
+[HW] Device 0, type 4 = 0x00000004: gpu
+[HW] Device 0, number of Compute Units: 20
+[HW] Device 0, max Work Items dimension: 3
+[HW] Device 0, max Work Items size for dimension: 0 512
+[HW] Device 0, max Work Items size for dimension: 1 512
+[HW] Device 0, max Work Items size for dimension: 2 512
+------------------------------------------------------------
+​```
+```
+
+A mechanism to select ldpc implementation is also available in the `ldpctest` phy simulator via the `-v`option, which can be used to specify the version of the ldpc shared library to be used.
+
+#### Examples of ldpc shared lib selection when running ldpctest:
+
+Loading libldpc_cuda.so, the cuda implementation of the ldpc decoder:
+
+```$ ./ldpctest -v _cuda
+Initializing random number generator, seed 0
+block length 8448:
+n_trials 1:
+SNR0 -2.000000:
+[CONFIG] get parameters from cmdline , debug flags: 0x00400000
+[CONFIG] log_config: 2/3 parameters successfully set
+[CONFIG] log_config: 53/53 parameters successfully set
+[CONFIG] log_config: 53/53 parameters successfully set
+[CONFIG] log_config: 16/16 parameters successfully set
+[CONFIG] log_config: 16/16 parameters successfully set
+log init done
+[CONFIG] loader: 2/2 parameters successfully set
+[CONFIG] loader.ldpc: 1/2 parameters successfully set
+[LOADER] library libldpc_cuda.so successfully loaded
+...................................
+​```
+```
+
+Loading libldpc_cl.so, the opencl implementation of the ldpc decoder:
+
+`make ldpc_cl`
+
+`cp ../../../openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl`
+
+`./ldpctest -v _cl`
+
+```$ ./ldpctest -v _cl
+Initializing random number generator, seed 0
+block length 8448:
+n_trials 1:
+SNR0 -2.000000:
+[CONFIG] get parameters from cmdline , debug flags: 0x00400000
+[CONFIG] log_config: 2/3 parameters successfully set
+[CONFIG] log_config: 53/53 parameters successfully set
+[CONFIG] log_config: 53/53 parameters successfully set
+[CONFIG] log_config: 16/16 parameters successfully set
+[CONFIG] log_config: 16/16 parameters successfully set
+log init done
+[CONFIG] loader: 2/2 parameters successfully set
+[CONFIG] loader.ldpc: 1/2 parameters successfully set
+[LOADER] library libldpc_cl.so successfully loaded
+[HW] Platform 0, OpenCL profile FULL_PROFILE
+[HW] Platform 0, OpenCL version OpenCL 2.1 LINUX
+[HW] Device 0 is available
+[HW] Device 0, type 2 = 0x00000002: cpu
+[HW] Device 0, number of Compute Units: 8
+[HW] Device 0, max Work Items dimension: 3
+[HW] Device 0, max Work Items size for dimension: 0 8192
+[HW] Device 0, max Work Items size for dimension: 1 8192
+[HW] Device 0, max Work Items size for dimension: 2 8192
+[HW] Platform 1, OpenCL profile FULL_PROFILE
+[HW] Platform 1, OpenCL version OpenCL 2.0 beignet 1.3
+[HW] Device 0 is available
+[HW] Device 0, type 4 = 0x00000004: gpu
+[HW] Device 0, number of Compute Units: 20
+[HW] Device 0, max Work Items dimension: 3
+[HW] Device 0, max Work Items size for dimension: 0 512
+[HW] Device 0, max Work Items size for dimension: 1 512
+[HW] Device 0, max Work Items size for dimension: 2 512
+................................
+​```
+```
+
+
+
+### LDPC libraries
+Libraries implementing the LDPC algorithms must be named `libldpc<_version>.so`, they must implement three functions: `nrLDPC_initcall` `nrLDPC_decod` and `nrLDPC_encod`. The prototypes for these functions is defined in [nrLDPC_defs.h](file://nrLDPC_defs.h).
+
+`libldpc_cuda.so`has been tested with the `ldpctest` executable, usage from the softmodem's has to be tested.
+
+`libldpc_cl`is under development.
[oai Wikis home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index 91c5d59611..aff707a1d5 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -101,8 +101,8 @@ int test_ldpc(short No_iteration,
unsigned int *crc_misses,
time_stats_t *time_optim,
time_stats_t *time_decoder,
- n_iter_stats_t *dec_iter,
- short run_cuda)
+ n_iter_stats_t *dec_iter
+ )
{
//clock initiate
//time_stats_t time,time_optim,tinput,tprep,tparity,toutput, time_decoder;
@@ -393,28 +393,13 @@ int test_ldpc(short No_iteration,
decParams.R=code_rate_vec[R_ind];//13;
decParams.numMaxIter=No_iteration;
decParams.outMode = nrLDPC_outMode_BIT;
+ decParams.block_length=block_length;
//decParams.outMode =nrLDPC_outMode_LLRINT8;
-#ifdef CUDA_FLAG
- set_compact_BG(Zc,BG);
- init_LLR_DMA_for_CUDA(&decParams, (int8_t*)channel_output_fixed[j], (int8_t*)estimated_output[j], block_length);
-#endif
+ nrLDPC_initcall(&decParams, (int8_t*)channel_output_fixed[j], (int8_t*)estimated_output[j]);
for(j=0;j 1280, 2401 -> 2560
-
+ char *ldpc_version=NULL; /* version of the ldpc decoder library to use (XXX suffix to use when loading libldpc_XXX.so */
short No_iteration=5;
int n_segments=1;
//double rate=0.333;
- short run_cuda = 0;
int nom_rate=1;
int denom_rate=3;
@@ -544,7 +526,7 @@ int main(int argc, char *argv[])
short BG=0,Zc,Kb=0;
- while ((c = getopt (argc, argv, "q:r:s:S:l:G:n:d:i:t:u:h")) != -1)
+ while ((c = getopt (argc, argv, "q:r:s:S:l:G:n:d:i:t:u:hv:")) != -1)
switch (c)
{
case 'q':
@@ -564,7 +546,7 @@ int main(int argc, char *argv[])
break;
case 'G':
- run_cuda = atoi(optarg);
+ ldpc_version="_cuda";
break;
case 'n':
@@ -590,9 +572,11 @@ int main(int argc, char *argv[])
case 'u':
test_uncoded = atoi(optarg);
break;
-
+ case 'v':
+ ldpc_version=strdup(optarg);
+ break;
case 'h':
- default:
+ default:
printf("CURRENTLY SUPPORTED CODE RATES: \n");
printf("BG1 (blocklength > 3840): 1/3, 2/3, 22/25 (8/9) \n");
printf("BG2 (blocklength <= 3840): 1/5, 1/3, 2/3 \n\n");
@@ -609,6 +593,7 @@ int main(int argc, char *argv[])
printf("-t SNR simulation step, Default: 0.1\n");
printf("-i Max decoder iterations, Default: 5\n");
printf("-u Set SNR per coded bit, Default: 0\n");
+ printf("-v XXX Set ldpc shared library version. libldpc_XXX.so will be used \n");
exit(1);
break;
}
@@ -619,7 +604,10 @@ int main(int argc, char *argv[])
printf("SNR0 %f: \n", SNR0);
- load_nrLDPClib();
+ if (ldpc_version != NULL)
+ load_nrLDPClib(ldpc_version);
+ else
+ load_nrLDPClib(NULL);
load_nrLDPClib_ref("_orig", &encoder_orig);
//for (block_length=8;block_length<=MAX_BLOCK_LENGTH;block_length+=8)
@@ -691,8 +679,7 @@ int main(int argc, char *argv[])
&crc_misses,
time_optim,
time_decoder,
- dec_iter,
- run_cuda);
+ dec_iter);
printf("SNR %f, BLER %f (%u/%d)\n", SNR, (float)decoded_errors[i]/(float)n_trials, decoded_errors[i], n_trials);
printf("SNR %f, BER %f (%u/%d)\n", SNR, (float)errors_bit/(float)n_trials/(float)block_length/(double)n_segments, decoded_errors[i], n_trials);
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
index 3226c97f87..166cd9a5a3 100644
--- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder.c
@@ -46,7 +46,8 @@
#endif
static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDPC_procBuf* p_procBuf, uint32_t numLLR, t_nrLDPC_lut* p_lut, t_nrLDPC_dec_params* p_decParams, t_nrLDPC_time_stats* p_profiler);
-
+void nrLDPC_initcall(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out) {
+}
int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out, t_nrLDPC_procBuf* p_procBuf, t_nrLDPC_time_stats* p_profiler)
{
uint32_t numLLR;
@@ -55,7 +56,6 @@ int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_
t_nrLDPC_lut* p_lut = &lut;
//printf("p_procBuf->cnProcBuf = %p\n", p_procBuf->cnProcBuf);
-
// Initialize decoder core(s) with correct LUTs
numLLR = nrLDPC_init(p_decParams, p_lut);
@@ -231,7 +231,7 @@ static inline uint32_t nrLDPC_decoder_core(int8_t* p_llr, int8_t* p_out, t_nrLDP
// First iteration finished
- while ( (i < (numMaxIter-1)) && (pcRes != 0) )
+ while ( (i < numMaxIter) && (pcRes != 0) )
{
// Increase iteration counter
i++;
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c
new file mode 100644
index 0000000000..58e6b507af
--- /dev/null
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_CL.c
@@ -0,0 +1,436 @@
+/*
+ * 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.0 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+ /*! \file nrLDPC_decoder_CL.c
+* \brief ldpc decoder, openCL implementaion
+* \author Francois TABURET
+* \date 2021
+* \version 1.0
+* \note initial implem - translation of cuda version
+*/
+/* uses HW component id for log messages ( --log_config.hw_log_level ) */
+#include
+#include
+#include
+#include
+#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
+#include "PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h"
+#include "assertions.h"
+#include "common/utils/LOG/log.h"
+
+#define MAX_ITERATION 2
+#define MC 1
+
+#define MAX_OCLDEV 10
+#define MAX_OCLRUNTIME 5
+
+
+#define CLSETKERNELARG(A,B,C,D) \
+rt=clSetKernelArg(A,B,C,D) ;\
+AssertFatal(rt == CL_SUCCESS, "Error %d setting kernel argument index %d\n" , (int)rt, B);
+
+typedef struct{
+ char x;
+ char y;
+ short value;
+} h_element;
+#include "../nrLDPC_decoder_LYC/bgs/BG1_compact_in_C.h"
+
+typedef struct{
+ cl_uint max_CU;
+ cl_uint max_WID;
+ size_t *max_WIS;
+} ocldev_t;
+
+typedef struct {
+ cl_kernel cnp_kernel_1st;
+ cl_kernel cnp_kernel;
+ cl_kernel vnp_kernel_normal;
+ cl_kernel pack_decoded_bit;
+} oclkernels_t;
+
+typedef struct{
+ cl_uint num_devices;
+ cl_device_id devices[MAX_OCLDEV];
+ ocldev_t ocldev[MAX_OCLDEV];
+ cl_context context;
+ cl_program program;
+ cl_mem dev_h_compact1;
+ cl_mem dev_h_compact2;
+ cl_mem dev_const_llr;
+ cl_mem dev_llr;
+ cl_mem dev_dt;
+ cl_mem dev_tmp;
+ oclkernels_t kernels[MAX_OCLDEV];
+ cl_command_queue queue[MAX_OCLDEV];
+} oclruntime_t;
+
+typedef struct{
+ oclruntime_t runtime[MAX_OCLRUNTIME];
+} ocl_t;
+
+
+
+ocl_t ocl;
+
+
+void set_compact_BG(int Zc,short BG){
+ cl_uint rt;
+ int row,col;
+ if(BG == 1){
+ row = 46;
+ col = 68;
+ }
+ else{
+ row = 42;
+ col = 52;
+ }
+ int compact_row = 30;
+ int compact_col = 19;
+ if(BG==2){compact_row = 10, compact_col = 23;}
+ int memorySize_h_compact1 = row * compact_col * sizeof(h_element);
+ int memorySize_h_compact2 = compact_row * col * sizeof(h_element);
+ int lift_index = 0;
+ short lift_set[][9] = {
+ {2,4,8,16,32,64,128,256},
+ {3,6,12,24,48,96,192,384},
+ {5,10,20,40,80,160,320},
+ {7,14,28,56,112,224},
+ {9,18,36,72,144,288},
+ {11,22,44,88,176,352},
+ {13,26,52,104,208},
+ {15,30,60,120,240},
+ {0}
+ };
+
+ for(int i = 0; lift_set[i][0] != 0; i++){
+ for(int j = 0; lift_set[i][j] != 0; j++){
+ if(Zc == lift_set[i][j]){
+ lift_index = i;
+ break;
+ }
+ }
+ }
+ printf("\nZc = %d BG = %d\n",Zc,BG);
+ ocl.runtime[0].dev_h_compact1 = clCreateBuffer(ocl.runtime[0].context, CL_MEM_READ_ONLY|CL_MEM_HOST_WRITE_ONLY, memorySize_h_compact1, NULL, (cl_int *)&rt);
+ AssertFatal(rt == CL_SUCCESS, "Error %d creating buffer dev_h_compact1 for platform %i \n" , (int)rt, 0);
+ ocl.runtime[0].dev_h_compact2 = clCreateBuffer(ocl.runtime[0].context, CL_MEM_READ_ONLY|CL_MEM_HOST_WRITE_ONLY, memorySize_h_compact2, NULL, (cl_int *)&rt);
+ AssertFatal(rt == CL_SUCCESS, "Error %d creating buffer dev_h_compact2 for platform %i \n" , (int)rt, 0);
+ h_element *h1;
+ h_element *h2;
+ switch(lift_index){
+ case 0:
+ h1 = host_h_compact1_I0;
+ h2 = host_h_compact2_I0;
+ break;
+ case 1:
+ h1 = host_h_compact1_I1;
+ h2 = host_h_compact2_I1;
+ break;
+ case 2:
+ h1 = host_h_compact1_I2;
+ h2 = host_h_compact2_I2;
+ break;
+ case 3:
+ h1 = host_h_compact1_I3;
+ h2 = host_h_compact2_I3;
+ break;
+ case 4:
+ h1 = host_h_compact1_I4;
+ h2 = host_h_compact2_I4;
+ break;
+ case 5:
+ h1 = host_h_compact1_I5;
+ h2 = host_h_compact2_I5;
+ break;
+ case 6:
+ h1 = host_h_compact1_I6;
+ h2 = host_h_compact2_I6;
+ break;
+ case 7:
+ h1 = host_h_compact1_I7;
+ h2 = host_h_compact2_I7;
+ break;
+ default:
+ AssertFatal(0, "Invalid lift_index value %i\n" , lift_index);
+ break;
+ }
+ rt = clEnqueueWriteBuffer(ocl.runtime[0].queue[0], ocl.runtime[0].dev_h_compact1, CL_TRUE, 0,memorySize_h_compact1, h1, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d moving h_compact1 memory to pltf %i dev %i\n" , (int)rt, 0,0);
+ rt = clEnqueueWriteBuffer(ocl.runtime[0].queue[0], ocl.runtime[0].dev_h_compact2, CL_TRUE, 0,memorySize_h_compact2, h2, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d moving h_compact2 memory to pltf %i dev %i\n" , (int)rt, 0,0);
+ // return 0;
+}
+void cl_error_callback(const char* errinfo, const void* private_info, size_t cb, void* user_data) {
+ oclruntime_t *runtime = (oclruntime_t *)user_data;
+ LOG_E(HW,"OpenCL accelerator error %s\n", errinfo );
+}
+
+char *clutil_getstrdev(int intdev) {
+ static char retstring[255]="";
+ char *retptr=retstring;
+ retptr+=sprintf(retptr,"0x%08x: ",(uint32_t)intdev);
+ if (intdev & CL_DEVICE_TYPE_CPU)
+ retptr+=sprintf(retptr,"%s","cpu ");
+ if (intdev & CL_DEVICE_TYPE_GPU)
+ retptr+=sprintf(retptr,"%s","gpu ");
+ if (intdev & CL_DEVICE_TYPE_ACCELERATOR)
+ retptr+=sprintf(retptr,"%s","acc ");
+ return retstring;
+}
+
+void get_CompilErr(cl_program program, int pltf) {
+
+ // Determine the size of the log
+ size_t log_size;
+ for(int i=0; i0 , "clGetPlatformIDs: no cl compatible platform found\n");
+ for (int i=0 ; i<(int)num_platforms_found ; i++) {
+ char stringval[255];
+ rt = clGetPlatformInfo(platforms[i],CL_PLATFORM_PROFILE, sizeof(stringval),stringval,NULL);
+ AssertFatal(rt == CL_SUCCESS, "clGetPlatformInfo PROFILE error %d\n" , (int)rt);
+ LOG_I(HW,"Platform %i, OpenCL profile %s\n", i,stringval );
+ rt = clGetPlatformInfo(platforms[i],CL_PLATFORM_VERSION, sizeof(stringval),stringval,NULL);
+ AssertFatal(rt == CL_SUCCESS, "clGetPlatformInfo VERSION error %d\n" , (int)rt);
+ LOG_I(HW,"Platform %i, OpenCL version %s\n", i,stringval );
+ rt = clGetDeviceIDs(platforms[i],CL_DEVICE_TYPE_ALL, sizeof(ocl.runtime[i].devices)/sizeof(cl_device_id),ocl.runtime[i].devices,&(ocl.runtime[i].num_devices));
+ AssertFatal(rt == CL_SUCCESS, "clGetDeviceIDs error %d\n" , (int)rt);
+ int devok=0;
+ for (int j=0; j0) {
+ ocl.runtime[i].context = clCreateContext(NULL, ocl.runtime[i].num_devices, ocl.runtime[i].devices, cl_error_callback, &(ocl.runtime[i]), (cl_int *)&rt);
+ AssertFatal(rt == CL_SUCCESS, "Error %d creating context for platform %i\n" , (int)rt, i);
+ for(int dev=0; dev0, "No openCL device available to accelerate ldpc\n");
+ return 0;
+}
+
+
+void nrLDPC_initcall(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out) {
+ set_compact_BG(p_decParams->Z,p_decParams->BG);
+// init_LLR_DMA(p_decParams, p_llr, p_out);
+}
+
+
+int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out,t_nrLDPC_procBuf* p_procBuf, t_nrLDPC_time_stats *time_decoder)
+{
+ uint16_t Zc = p_decParams->Z;
+ uint8_t BG = p_decParams->BG;
+// uint8_t numMaxIter = p_decParams->numMaxIter;
+ int block_length = p_decParams->block_length;
+// e_nrLDPC_outMode outMode = p_decParams->outMode;
+ uint8_t row,col;
+ if(BG == 1){
+ row = 46;
+ col = 68;
+ }
+ else{
+ row = 42;
+ col = 52;
+ }
+
+// alloc memory
+// unsigned char *hard_decision = (unsigned char*)p_out;
+// gpu
+ int memorySize_llr = col * Zc * sizeof(char) * MC;
+// cudaCheck( cudaMemcpyToSymbol(dev_const_llr, p_llr, memorySize_llr_cuda) );
+// cudaCheck( cudaMemcpyToSymbol(dev_llr, p_llr, memorySize_llr_cuda) );
+ int rt = clEnqueueWriteBuffer(ocl.runtime[0].queue[0], ocl.runtime[0].dev_const_llr, CL_TRUE, 0,
+ memorySize_llr, p_llr, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d moving p_llr data to read only memory in pltf %i dev %i\n" , (int)rt, 0,0);
+ rt = clEnqueueWriteBuffer(ocl.runtime[0].queue[0], ocl.runtime[0].dev_llr, CL_TRUE, 0,
+ memorySize_llr, p_llr, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d moving p_llr data to read-write memory in pltf %i dev %i\n" , (int)rt, 0,0);
+// Define CUDA kernel dimension
+// int blockSizeX = Zc;
+// dim3 dimGridKernel1(row, MC, 1); // dim of the thread blocks
+// dim3 dimBlockKernel1(blockSizeX, 1, 1);
+
+// dim3 dimGridKernel2(col, MC, 1);
+// dim3 dimBlockKernel2(blockSizeX, 1, 1);
+// cudaDeviceSynchronize();
+
+// lauch kernel
+ size_t global_item_sizek0[2] = {row*Zc,MC}; // Process the entire lists
+ size_t global_item_sizek1[2] = {col*Zc,MC}; // Process the entire lists
+ size_t local_item_sizek[2] = {128,1}; // Divide work items into groups of 128
+
+ for(int ii = 0; ii < MAX_ITERATION; ii++){
+ // first kernel
+ if(ii == 0){
+// ldpc_cnp_kernel_1st_iter
+// <<>>
+// ( BG, row, col, Zc);
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 0, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_llr));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 1, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_dt));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 2, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_h_compact1));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 3, sizeof(int), (void *)&(BG));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 4, sizeof(int), (void *)&(row));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 5, sizeof(int), (void *)&(col));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel_1st, 6, sizeof(int), (void *)&(Zc));
+ rt = clEnqueueNDRangeKernel(ocl.runtime[0].queue[0], ocl.runtime[0].kernels[0].cnp_kernel_1st, 2, NULL,
+ global_item_sizek0, local_item_sizek, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d enqueing cnp_kernel_1st \n" , (int)rt);
+ }else{
+// ldpc_cnp_kernel
+// <<>>
+// ( BG, row, col, Zc);
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 0, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_llr));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 1, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_dt));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 2, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_h_compact1));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 3, sizeof(int), (void *)&(BG));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 4, sizeof(int), (void *)&(row));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 5, sizeof(int), (void *)&(col));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].cnp_kernel, 6, sizeof(int), (void *)&(Zc));
+ rt = clEnqueueNDRangeKernel(ocl.runtime[0].queue[0], ocl.runtime[0].kernels[0].cnp_kernel, 2, NULL,
+ global_item_sizek0, local_item_sizek, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d enqueing cnp_kernel\n" , (int)rt);
+ }
+ // second kernel
+// ldpc_vnp_kernel_normal
+// <<>>
+// // (dev_llr, dev_const_llr,BG, row, col, Zc);
+// (BG, row, col, Zc);
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 0, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_llr));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 1, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_dt));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 2, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_const_llr));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 3, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_h_compact2));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 4, sizeof(int), (void *)&(BG));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 5, sizeof(int), (void *)&(row));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 6, sizeof(int), (void *)&(col));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].vnp_kernel_normal, 7, sizeof(int), (void *)&(Zc));
+ rt = clEnqueueNDRangeKernel(ocl.runtime[0].queue[0], ocl.runtime[0].kernels[0].vnp_kernel_normal, 2, NULL,
+ global_item_sizek1, local_item_sizek, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d enqueing vnp_kernel_normal \n" , (int)rt);
+ }
+
+// int pack = (block_length/128)+1;
+// dim3 pack_block(pack, MC, 1);
+// pack_decoded_bit<<>>( col, Zc);
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].pack_decoded_bit, 0, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_llr));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].pack_decoded_bit, 1, sizeof(cl_mem), (void *)&(ocl.runtime[0].dev_tmp));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].pack_decoded_bit, 2, sizeof(int), (void *)&(col));
+ CLSETKERNELARG(ocl.runtime[0].kernels[0].pack_decoded_bit, 3, sizeof(int), (void *)&(Zc));
+
+ // Execute the OpenCL kernel on the list
+ size_t global_item_size[2] = {block_length,MC}; // Process the entire lists
+ size_t local_item_size[2] = {128,1}; // Divide work items into groups of 128
+ rt = clEnqueueNDRangeKernel(ocl.runtime[0].queue[0], ocl.runtime[0].kernels[0].pack_decoded_bit, 2, NULL,
+ global_item_size, local_item_size, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d enqueing pack_decoded_bit \n" , (int)rt);
+// cudaCheck( cudaMemcpyFromSymbol((void*)hard_decision, (const void*)dev_tmp, (block_length/8)*sizeof(unsigned char)) );
+// cudaDeviceSynchronize();
+
+ rt = clEnqueueReadBuffer(ocl.runtime[0].queue[0], ocl.runtime[0].dev_tmp, CL_TRUE, 0,
+ (block_length/8)*sizeof(unsigned char) , p_llr, 0, NULL, NULL);
+ AssertFatal(rt == CL_SUCCESS, "Error %d moving p_llr data to pltf %i dev %i\n" , (int)rt, 0,0);
+ return MAX_ITERATION;
+
+}
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl
new file mode 100644
index 0000000000..d5e2fa5695
--- /dev/null
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_kernels_CL.cl
@@ -0,0 +1,302 @@
+/*
+ * 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.0 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+/*! \file PHY/CODING/nrLDPC_decoder_kernels_CL.cl
+* \brief kernel functions for ldpc decoder accelerated via openCL
+* \author Francois TABURET
+* \date 2021
+* \version 1.0
+* \company Nokia BellLabs France
+* \email: francois.taburet@nokia-bell-labs.com
+* \note initial implem - translation of cuda version
+* \warning
+*/
+#define define MAX_ITERATION 2
+#define MC 1
+
+#define INT32_MAX 2147483647
+
+typedef struct{
+ char x;
+ char y;
+ short value;
+} h_element;
+
+//__global char dev_dt [46*68*384];
+//__local char *dev_t;
+//__global char dev_llr[68*384];
+//__global unsigned char dev_tmp[68*384];
+
+
+
+
+//__constant h_element dev_h_compact1[46*19] = {}; // used in kernel 1
+//__constant h_element dev_h_compact2[68*30] = {}; // used in kernel 2
+
+// __device__ __constantant__ h_element dev_h_compact1[46*19]; // used in kernel 1
+// __device__ __constantant__ h_element dev_h_compact2[68*30]; // used in kernel 2
+
+// row and col element count
+__constant char h_ele_row_bg1_count[46] = {
+ 19, 19, 19, 19, 3, 8, 9, 7, 10, 9,
+ 7, 8, 7, 6, 7, 7, 6, 6, 6, 6,
+ 6, 6, 5, 5, 6, 5, 5, 4, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 4, 5, 5,
+ 4, 5, 4, 5, 5, 4};
+__constant char h_ele_col_bg1_count[68] = {
+ 30, 28, 7, 11, 9, 4, 8, 12, 8, 7,
+ 12, 10, 12, 11, 10, 7, 10, 10, 13, 7,
+ 8, 11, 12, 5, 6, 6, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1};
+__constant char h_ele_row_bg2_count[42] = {
+ 8, 10, 8, 10, 4, 6, 6, 6, 4, 5,
+ 5, 5, 4, 5, 5, 4, 5, 5, 4, 4,
+ 4, 4, 3, 4, 4, 3, 5, 3, 4, 3,
+ 5, 3, 4, 4, 4, 4, 4, 3, 4, 4,
+ 4, 4};
+__constant char h_ele_col_bg2_count[52] = {
+ 22, 23, 10, 5, 5, 14, 7, 13, 6, 8,
+ 9, 16, 9, 12, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1};
+
+
+
+// Kernel 1
+__kernel void ldpc_cnp_kernel_1st_iter( __global char * dev_llr, __global char * dev_dt, __local h_element *dev_h_compact1, int BG, int row, int col, int Zc)
+{
+// int iMCW = blockIdx.y; // codeword id
+// int iBlkRow = blockIdx.x; // block row in h_base
+// int iSubRow = threadIdx.x; // row index in sub_block of h_base
+// if(blockIdx.x == 0 && threadIdx.x == 1) printf("cnp %d\n", threadIdx.x);
+ int iMCW = get_group_id(1); // codeword id
+ int iBlkRow = get_group_id(0); // block row in h_base
+ int iBlkCol; // block col in h_base
+ int iSubRow = get_local_id(0);; // row index in sub_block of h_base
+ int iCol; // overall col index in h_base
+ int offsetR;
+ int shift_t;
+
+// For 2-min algorithm.
+ int Q_sign = 0;
+ int sq;
+ int Q, Q_abs;
+ int R_temp;
+
+ int sign = 1;
+ int rmin1 = INT32_MAX;
+ int rmin2 = INT32_MAX;
+ char idx_min = 0;
+
+ h_element h_element_t;
+ int s = (BG==1)? h_ele_row_bg1_count[iBlkRow]:h_ele_row_bg2_count[iBlkRow];
+ offsetR = (iMCW * row*col*Zc) + iBlkRow * Zc + iSubRow; // row*col*Zc = size of dev_dt
+// if(blockIdx.x == 0 && threadIdx.x == 1) printf("s: %d, offset %d\n", s, offsetR);
+// The 1st recursion
+ for(int i = 0; i < s; i++) // loop through all the ZxZ sub-blocks in a row
+ {
+ h_element_t = dev_h_compact1[i*row+iBlkRow]; // compact_col == row
+
+ iBlkCol = h_element_t.y;
+ shift_t = h_element_t.value;
+
+ shift_t = (iSubRow + shift_t) % Zc;
+ iCol = (iMCW * col*Zc) + iBlkCol * Zc + shift_t; // col*Zc = size of llr
+ Q = dev_llr[iCol];
+ Q_abs = (Q>0)? Q : -Q;
+ sq = Q < 0;
+// if(blockIdx.x == 0 && threadIdx.x == 1) printf("i %d, icol %d, Q: %d\n", i, iCol, Q);
+ // quick version
+ sign = sign * (1 - sq * 2);
+ Q_sign |= sq << i;
+
+ if (Q_abs < rmin1){
+ rmin2 = rmin1;
+ rmin1 = Q_abs;
+ idx_min = i;
+ } else if (Q_abs < rmin2){
+ rmin2 = Q_abs;
+ }
+ }
+
+// if(blockIdx.x == 0 && threadIdx.x == 1)printf("min1 %d, min2 %d, min1_idx %d\n", rmin1, rmin2, idx_min);
+
+// The 2nd recursion
+ for(int i = 0; i < s; i++){
+ // v0: Best performance so far. 0.75f is the value of alpha.
+ sq = 1 - 2 * ((Q_sign >> i) & 0x01);
+ R_temp = 0.75f * sign * sq * (i != idx_min ? rmin1 : rmin2);
+ // write results to global memory
+ h_element_t = dev_h_compact1[i*row+iBlkRow];
+ int addr_temp = offsetR + h_element_t.y * row * Zc;
+ dev_dt[addr_temp] = R_temp;
+// if(blockIdx.x == 0 && threadIdx.x == 1)printf("R_temp %d, temp_addr %d\n", R_temp, addr_temp);
+ }
+}
+
+// Kernel_1
+__kernel void ldpc_cnp_kernel( __global char * dev_llr, __global char * dev_dt, __local h_element *dev_h_compact1, int BG, int row, int col, int Zc)
+{
+// if(blockIdx.x == 0 && threadIdx.x == 1) printf("cnp\n");
+// int iMCW = blockIdx.y;
+// int iBlkRow = blockIdx.x; // block row in h_base // block col in h_base
+// int iSubRow = threadIdx.x; // row index in sub_block of h_base
+ int iMCW = get_group_id(1);
+ int iBlkRow = get_group_id(0); // block row in h_base
+ int iBlkCol; // block col in h_base
+ int iSubRow = get_local_id(0);; // row index in sub_block of h_base
+ int iCol; // overall col index in h_base
+ int offsetR;
+ int shift_t;
+
+// For 2-min algorithm.
+ int Q_sign = 0;
+ int sq;
+ int Q, Q_abs;
+ int R_temp;
+
+ int sign = 1;
+ int rmin1 = INT32_MAX;
+ int rmin2 = INT32_MAX;
+ char idx_min = 0;
+
+ h_element h_element_t;
+ int s = (BG==1)? h_ele_row_bg1_count[iBlkRow]: h_ele_row_bg2_count[iBlkRow];
+ offsetR = (iMCW *row*col*Zc) + iBlkRow * Zc + iSubRow; // row * col * Zc = size of dev_dt
+// if(blockIdx.x == 0 && threadIdx.x == 1) printf("s: %d, offset %d\n", s, offsetR);
+// The 1st recursion
+ for(int i = 0; i < s; i++) // loop through all the ZxZ sub-blocks in a row
+ {
+ h_element_t = dev_h_compact1[i*row+iBlkRow];
+
+ iBlkCol = h_element_t.y;
+ shift_t = h_element_t.value;
+ shift_t = (iSubRow + shift_t) % Zc;
+ iCol = iBlkCol * Zc + shift_t;
+
+ R_temp = dev_dt[offsetR + iBlkCol * row * Zc];
+
+ Q = dev_llr[iMCW * (col*Zc) + iCol] - R_temp;
+ Q_abs = (Q>0)? Q : -Q;
+// if(blockIdx.x == 0 && threadIdx.x == 1) printf("i %d, icol %d, Q: %d\n", i, iCol, Q);
+ sq = Q < 0;
+ sign = sign * (1 - sq * 2);
+ Q_sign |= sq << i;
+
+ if (Q_abs < rmin1){
+ rmin2 = rmin1;
+ rmin1 = Q_abs;
+ idx_min = i;
+ } else if (Q_abs < rmin2){
+ rmin2 = Q_abs;
+ }
+
+ }
+
+// if(blockIdx.x == 0 && threadIdx.x == 1)printf("min1 %d, min2 %d, min1_idx %d\n", rmin1, rmin2, idx_min);
+
+// The 2nd recursion
+ for(int i = 0; i < s; i ++){
+ sq = 1 - 2 * ((Q_sign >> i) & 0x01);
+ R_temp = 0.75f * sign * sq * (i != idx_min ? rmin1 : rmin2);
+
+
+ // write results to global memory
+ h_element_t = dev_h_compact1[i*row+iBlkRow];
+ int addr_temp = h_element_t.y * row * Zc + offsetR;
+ dev_dt[addr_temp] = R_temp;
+// if(blockIdx.x == 0 && threadIdx.x == 1)printf("R_temp %d, temp_addr %d\n", R_temp, addr_temp);
+ }
+}
+
+// Kernel 2: VNP processing
+__kernel void
+ldpc_vnp_kernel_normal(__global char * dev_llr, __global char * dev_dt, __global char * dev_const_llr, __local h_element *dev_h_compact2, int BG, int row, int col, int Zc)
+{
+// int iMCW = blockIdx.y;
+// int iBlkCol = blockIdx.x;
+// int iSubCol = threadIdx.x;
+ int iMCW = get_group_id(1);
+ int iBlkCol = get_group_id(0);
+ int iBlkRow;
+ int iSubCol = get_local_id(0);
+ int iRow;
+ int iCol;
+
+ int shift_t, sf;
+ int APP;
+
+ h_element h_element_t;
+
+ // update all the llr values
+ iCol = iBlkCol * Zc + iSubCol;
+ APP = dev_const_llr[iMCW *col*Zc + iCol];
+ int offsetDt = iMCW *row*col*Zc + iBlkCol * row * Zc;
+ int s = (BG==1)? h_ele_col_bg1_count[iBlkCol]:h_ele_col_bg2_count[iBlkCol];
+
+ for(int i = 0; i < s; i++)
+ {
+ h_element_t = dev_h_compact2[i*col+iBlkCol];
+
+ shift_t = h_element_t.value%Zc;
+ iBlkRow = h_element_t.x;
+
+ sf = iSubCol - shift_t;
+ sf = (sf + Zc) % Zc;
+
+ iRow = iBlkRow * Zc + sf;
+ APP = APP + dev_dt[offsetDt + iRow];
+ }
+ if(APP > SCHAR_MAX) APP = SCHAR_MAX;
+ if(APP < SCHAR_MIN) APP = SCHAR_MIN;
+ // write back to device global memory
+ dev_llr[iMCW *col*Zc + iCol] = APP;
+}
+
+
+__kernel void pack_decoded_bit(__global unsigned char * dev_llr, __global unsigned char * dev_tmp, int col, int Zc)
+{
+// int iMCW = blockIdx.y;
+// int btid = threadIdx.x;
+ unsigned char tmp[128];
+ int iMCW = get_group_id(1);
+ int btid = get_local_id(0);
+ int tid = iMCW * col*Zc + get_group_id(0)*128 + btid;
+ tmp[btid] = 0;
+
+ if(dev_llr[tid] < 0){
+ tmp[btid] = 1 << (7-(btid&7));
+ }
+// __syncthreads();
+
+ if(btid < 16){
+ dev_tmp[iMCW * col*Zc + get_group_id(0)*16+btid] = 0;
+ for(int i = 0; i < 8; i++){
+ dev_tmp[iMCW * col*Zc + get_group_id(0)*16+btid] += tmp[btid*8+i];
+ }
+ }
+}
+
diff --git a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
index e5b99246d5..99b6f75f93 100644
--- a/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
+++ b/openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h
@@ -70,6 +70,7 @@ typedef struct nrLDPC_dec_params {
uint16_t Z; /**< Lifting size */
uint8_t R; /**< Decoding rate: Format 15,13,... for code rates 1/5, 1/3,... */
uint8_t numMaxIter; /**< Maximum number of iterations */
+ int block_length;
e_nrLDPC_outMode outMode; /**< Output format */
} t_nrLDPC_dec_params;
diff --git a/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu b/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
index 931d500338..72517edcdd 100644
--- a/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
+++ b/openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
@@ -7,14 +7,14 @@
* \note
* \warning
*/
-
+#include
#include
#include
#include
#include
#include "PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
#include "PHY/CODING/nrLDPC_decoder/nrLDPCdecoder_defs.h"
-
+#include "assertions.h"
#include "bgs/BG1_I0"
#include "bgs/BG1_I1"
#include "bgs/BG1_I2"
@@ -462,10 +462,11 @@ void read_BG(int BG, int *h, int row, int col)
}
extern "C"
-void init_LLR_DMA_for_CUDA(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out, int block_length){
+void init_LLR_DMA(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out){
uint16_t Zc = p_decParams->Z;
uint8_t BG = p_decParams->BG;
+ int block_length = p_decParams->block_length;
uint8_t row,col;
if(BG == 1){
row = 46;
@@ -483,14 +484,60 @@ void init_LLR_DMA_for_CUDA(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8
}
+using namespace std ;
+
+/* from here: entry points in decoder shared lib */
extern "C"
-int32_t nrLDPC_decoder_LYC(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out, int block_length, time_stats_t *time_decoder)
+int ldpc_autoinit(void) { // called by the library loader
+/*int devices = 0;
+
+ cudaError_t err = cudaGetDeviceCount(&devices);
+ AssertFatal(devices>0,"\nNo cuda GPU found\n\n");
+
+ const int kb = 1024;
+ const int mb = kb * kb;
+ wcout << "NBody.GPU" << endl << "=========" << endl << endl;
+
+ wcout << "CUDA version: v" << CUDART_VERSION << endl;
+
+
+ wcout << "CUDA Devices: " << endl << endl;
+
+ for(int i = 0; i < devices; ++i)
+ {
+ cudaDeviceProp props;
+ cudaGetDeviceProperties(&props, i);
+ wcout << i << ": " << props.name << ": " << props.major << "." << props.minor << endl;
+ wcout << " Global memory: " << props.totalGlobalMem / mb << "mb" << endl;
+ wcout << " Shared memory: " << props.sharedMemPerBlock / kb << "kb" << endl;
+ wcout << " Constant memory: " << props.totalConstMem / kb << "kb" << endl;
+ wcout << " Block registers: " << props.regsPerBlock << endl << endl;
+
+ wcout << " Warp size: " << props.warpSize << endl;
+ wcout << " Threads per block: " << props.maxThreadsPerBlock << endl;
+ wcout << " Max block dimensions: [ " << props.maxThreadsDim[0] << ", " << props.maxThreadsDim[1] << ", " << props.maxThreadsDim[2] << " ]" << endl;
+ wcout << " Max grid dimensions: [ " << props.maxGridSize[0] << ", " << props.maxGridSize[1] << ", " << props.maxGridSize[2] << " ]" << endl;
+ wcout << endl;
+ }
+*/
+ warmup_for_GPU();
+ return 0;
+}
+
+extern "C"
+void nrLDPC_initcall(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out) {
+ set_compact_BG(p_decParams->Z,p_decParams->BG);
+ init_LLR_DMA(p_decParams, p_llr, p_out);
+}
+
+
+extern "C"
+int32_t nrLDPC_decod(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out,t_nrLDPC_procBuf* p_procBuf, t_nrLDPC_time_stats *time_decoder)
{
-
-
uint16_t Zc = p_decParams->Z;
uint8_t BG = p_decParams->BG;
uint8_t numMaxIter = p_decParams->numMaxIter;
+ int block_length = p_decParams->block_length;
e_nrLDPC_outMode outMode = p_decParams->outMode;
cudaError_t cudaStatus;
uint8_t row,col;
diff --git a/openair1/PHY/CODING/nrLDPC_defs.h b/openair1/PHY/CODING/nrLDPC_defs.h
index b96067f4b6..321ecaab7d 100644
--- a/openair1/PHY/CODING/nrLDPC_defs.h
+++ b/openair1/PHY/CODING/nrLDPC_defs.h
@@ -45,6 +45,7 @@ typedef struct {
time_stats_t *toutput;
}encoder_implemparams_t;
#define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL}
+typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params* p_decParams, int8_t* p_llr, int8_t* p_out);
typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,short, short, encoder_implemparams_t*);
//============================================================================================================================
// decoder interface
@@ -56,4 +57,4 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho
\param p_profiler LDPC profiler statistics
*/
typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_procBuf* , t_nrLDPC_time_stats* );
-#endif
\ No newline at end of file
+#endif
diff --git a/openair1/PHY/CODING/nrLDPC_extern.h b/openair1/PHY/CODING/nrLDPC_extern.h
index c0bfa0fdd8..b75b38fc76 100644
--- a/openair1/PHY/CODING/nrLDPC_extern.h
+++ b/openair1/PHY/CODING/nrLDPC_extern.h
@@ -23,13 +23,16 @@
#ifdef LDPC_LOADER
nrLDPC_decoderfunc_t nrLDPC_decoder;
nrLDPC_encoderfunc_t nrLDPC_encoder;
+nrLDPC_initcallfunc_t nrLDPC_initcall;
#else
/* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */
-extern int load_nrLDPClib(void) ;
+extern int load_nrLDPClib(char *version) ;
extern int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr); // for ldpctest
/* ldpc coder/decoder functions, as loaded by load_nrLDPClib(). */
+extern nrLDPC_initcallfunc_t nrLDPC_initcall;
+
extern nrLDPC_decoderfunc_t nrLDPC_decoder;
extern nrLDPC_encoderfunc_t nrLDPC_encoder;
// inline functions:
#include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_init_mem.h"
-#endif
\ No newline at end of file
+#endif
diff --git a/openair1/PHY/CODING/nrLDPC_load.c b/openair1/PHY/CODING/nrLDPC_load.c
index a74bdf7bd1..23e5032bad 100644
--- a/openair1/PHY/CODING/nrLDPC_load.c
+++ b/openair1/PHY/CODING/nrLDPC_load.c
@@ -42,22 +42,32 @@
/* function description array, to be used when loading the encoding/decoding shared lib */
-static loader_shlibfunc_t shlib_fdesc[2];
+static loader_shlibfunc_t shlib_fdesc[3];
-char *arg[64]={"ldpctest","-O","cmdlineonly::dbgl0"};
+/* arguments used when called from phy simulators exec's which do not use the config module */
+/* arg is used to initialize the config module so that the loader works as expected */
+char *arg[64]={"ldpctest","-O","cmdlineonly::dbgl0",NULL,NULL};
-int load_nrLDPClib(void) {
+int load_nrLDPClib(char *version) {
char *ptr = (char*)config_get_if();
+ char libname[64]="ldpc";
+
if ( ptr==NULL ) {// phy simulators, config module possibly not loaded
- load_configmodule(3,(char **)arg,CONFIG_ENABLECMDLINEONLY) ;
+ load_configmodule(0,(char **)NULL,CONFIG_ENABLECMDLINEONLY) ;
logInit();
}
shlib_fdesc[0].fname = "nrLDPC_decod";
shlib_fdesc[1].fname = "nrLDPC_encod";
- int ret=load_module_shlib("ldpc",shlib_fdesc,sizeof(shlib_fdesc)/sizeof(loader_shlibfunc_t),NULL);
+ shlib_fdesc[2].fname = "nrLDPC_initcall";
+ int ret;
+ if (version)
+ ret=load_module_version_shlib(libname,version,shlib_fdesc,sizeof(shlib_fdesc)/sizeof(loader_shlibfunc_t),NULL);
+ else
+ ret=load_module_shlib(libname,shlib_fdesc,sizeof(shlib_fdesc)/sizeof(loader_shlibfunc_t),NULL);
AssertFatal( (ret >= 0),"Error loading ldpc decoder");
nrLDPC_decoder = (nrLDPC_decoderfunc_t)shlib_fdesc[0].fptr;
nrLDPC_encoder = (nrLDPC_encoderfunc_t)shlib_fdesc[1].fptr;
+ nrLDPC_initcall = (nrLDPC_initcallfunc_t)shlib_fdesc[2].fptr;
return 0;
}
@@ -65,10 +75,8 @@ int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_p
loader_shlibfunc_t shlib_encoder_fdesc;
shlib_encoder_fdesc.fname = "nrLDPC_encod";
- char libpath[64];
- sprintf(libpath,"ldpc%s",libversion);
- int ret=load_module_shlib(libpath,&shlib_encoder_fdesc,1,NULL);
- AssertFatal( (ret >= 0),"Error loading ldpc encoder %s\n",libpath);
+ int ret=load_module_version_shlib("ldpc",libversion,&shlib_encoder_fdesc,1,NULL);
+ AssertFatal( (ret >= 0),"Error loading ldpc encoder %s\n",(libversion==NULL)?"":libversion);
*nrLDPC_encoder_ptr = (nrLDPC_encoderfunc_t)shlib_encoder_fdesc.fptr;
return 0;
}
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
index e61b3dff9b..1dfaed8b94 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
@@ -258,10 +258,11 @@ static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void
// handle rate matching with a single 128 bit word using bit shuffling
// can be done with SIMD intrisics if needed
if (polarParams->groupsize < 8) {
- AssertFatal(polarParams->encoderLength<=128,"Need to handle groupsize<8 and N>128\n");
+ AssertFatal(polarParams->encoderLength<=512,"Need to handle groupsize(%d)<8 and N(%d)>512\n",polarParams->groupsize,polarParams->encoderLength);
uint128_t *out128=(uint128_t*)out;
uint128_t *in128=(uint128_t*)in;
- *out128=0;
+ for (int i=0;iencoderLength>>7;i++)
+ out128[i]=0;
uint128_t tmp0;
#ifdef DEBUG_POLAR_ENCODER
uint128_t tmp1;
@@ -270,15 +271,21 @@ static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void
#ifdef DEBUG_POLAR_ENCODER
printf("%d<-%u : %llx.%llx =>",i,polarParams->rate_matching_pattern[i],((uint64_t *)out)[1],((uint64_t *)out)[0]);
#endif
- tmp0 = (*in128&(((uint128_t)1)<rate_matching_pattern[i]));
+ uint8_t pi=polarParams->rate_matching_pattern[i];
+ uint8_t pi7=pi>>7;
+ uint8_t pimod128=pi&127;
+ uint8_t imod128=i&127;
+ uint8_t i7=i>>7;
+
+ tmp0 = (in128[pi7]&(((uint128_t)1)<<(pimod128)));
+
if (tmp0!=0) {
- *out128 = *out128 | ((uint128_t)1)<%llx.%llx => %llx.%llx\n",
- ((uint64_t *)&tmp0)[1],((uint64_t *)&tmp0)[0],
- ((uint64_t *)&tmp1)[1],((uint64_t *)&tmp1)[0],
- ((uint64_t *)out)[1],((uint64_t *)out)[0]);
+ printf("%llx.%llx<->%llx.%llx => %llx.%llx\n",
+ ((uint64_t *)&tmp0)[1],((uint64_t *)&tmp0)[0],
+ ((uint64_t *)&tmp1)[1],((uint64_t *)&tmp1)[0],
+ ((uint64_t *)out)[1],((uint64_t *)out)[0]);
#endif
}
}
diff --git a/openair1/PHY/CODING/nr_segmentation.c b/openair1/PHY/CODING/nr_segmentation.c
index 1d80a83131..0eede23766 100644
--- a/openair1/PHY/CODING/nr_segmentation.c
+++ b/openair1/PHY/CODING/nr_segmentation.c
@@ -92,9 +92,7 @@ if ((Kprime%Kb) > 0)
else
Z = (Kprime/Kb);
-#ifdef DEBUG_SEGMENTATION
- printf("nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
-#endif
+ LOG_D(PHY,"nr segmetation B %u Bprime %u Kprime %u z %u \n", B, Bprime, Kprime, Z);
if (Z <= 2) {
*K = 2;
@@ -148,10 +146,8 @@ else
*F = ((*K) - Kprime);
-#ifdef DEBUG_SEGMENTATION
- printf("final nr seg output Z %u K %u F %u \n", *Zout, *K, *F);
- printf("C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F);
-#endif
+ LOG_D(PHY,"final nr seg output Z %u K %u F %u \n", *Zout, *K, *F);
+ LOG_D(PHY,"C %u, K %u, Bprime_bytes %u, Bprime %u, F %u\n",*C,*K,Bprime>>3,Bprime,*F);
if ((input_buffer) && (output_buffers)) {
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index 32e190679d..cd4848ea8c 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -21,6 +21,7 @@
#include "executables/nr-softmodem-common.h"
#include "common/utils/nr/nr_common.h"
+#include "common/ran_context.h"
#include "PHY/defs_gNB.h"
#include "PHY/phy_extern.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
@@ -35,7 +36,6 @@
#include "MBSFN-SubframeConfigList.h"*/
#include "openair1/PHY/defs_RU.h"
#include "openair1/PHY/CODING/nrLDPC_extern.h"
-#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include "assertions.h"
#include
@@ -108,7 +108,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
crcTableInit();
init_scrambling_luts();
init_pucch2_luts();
- load_nrLDPClib();
+ load_nrLDPClib(NULL);
// PBCH DMRS gold sequences generation
nr_init_pbch_dmrs(gNB);
//PDCCH DMRS init
@@ -124,6 +124,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
for (int symb=0; symbsymbols_per_slot; symb++) {
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
+ LOG_D(PHY,"pdcch_dmrs[%d][%d] %p\n",slot,symb,pdcch_dmrs[slot][symb]);
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
}
}
@@ -518,45 +519,38 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
LOG_I(PHY,"gNB %d configured\n",Mod_id);
}
-
-void init_nr_transport(PHY_VARS_gNB *gNB) {
- int i;
- int j;
+void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) {
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
- LOG_I(PHY, "Initialise nr transport\n");
uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
+ msg->num_pdsch_slot = 0;
+
+ for (int i=0; inumber_of_nr_dlsch_max; i++) {
+ LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max);
+ for (int j=0; j<2; j++) {
+ msg->dlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size);
+ AssertFatal(msg->dlsch[i][j]!=NULL,"Can't initialize dlsch %d \n", i);
+ }
+ }
+}
+
+void init_nr_transport(PHY_VARS_gNB *gNB) {
+ NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
+ LOG_I(PHY, "Initialise nr transport\n");
memset(gNB->num_pdsch_rnti, 0, sizeof(uint16_t)*80);
- for (i=0; i pdcch_pdu[i].frame=-1;
- LOG_I(PHY,"Initializing UL PDCCH list for UL PDCCH %d/%d\n",i,NUMBER_OF_NR_PDCCH_MAX);
- gNB->ul_pdcch_pdu[i].frame=-1;
- }
-
- for (i=0; ipucch[i] = new_gNB_pucch();
AssertFatal(gNB->pucch[i]!=NULL,"Can't initialize pucch %d \n", i);
}
- for (i=0; inumber_of_nr_dlsch_max; i++) {
-
- LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max);
-
- for (j=0; j<2; j++) {
- gNB->dlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size);
- AssertFatal(gNB->dlsch[i][j]!=NULL,"Can't initialize dlsch %d \n", i);
- }
- }
-
- for (i=0; inumber_of_nr_ulsch_max; i++) {
+ for (int i=0; inumber_of_nr_ulsch_max; i++) {
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
- for (j=0; j<2; j++) {
+ for (int j=0; j<2; j++) {
// ULSCH for data
gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL, 0);
diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c
index 097c2b3ad2..4024ed1617 100644
--- a/openair1/PHY/INIT/nr_init_ru.c
+++ b/openair1/PHY/INIT/nr_init_ru.c
@@ -60,10 +60,12 @@ int nr_phy_init_RU(RU_t *ru) {
for (i=0; inb_tx; i++) {
// Allocate 10 subframes of I/Q TX signal data (time) if not
- ru->common.txdata[i] = (int32_t*)malloc16_clear( fp->samples_per_frame*sizeof(int32_t) );
+ ru->common.txdata[i] = (int32_t*)malloc16_clear( ru->sf_extension + (fp->samples_per_frame*sizeof(int32_t) ));
+ LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes,sf_extension %d)\n",i,ru->common.txdata[i],
+ (ru->sf_extension + fp->samples_per_frame)*sizeof(int32_t),ru->sf_extension);
+ ru->common.txdata[i] = &ru->common.txdata[i][ru->sf_extension];
- LOG_I(PHY,"[INIT] common.txdata[%d] = %p (%lu bytes)\n",i,ru->common.txdata[i],
- fp->samples_per_frame*sizeof(int32_t));
+ LOG_I(PHY,"[INIT] common.txdata[%d] = %p \n",i,ru->common.txdata[i]);
}
for (i=0;inb_rx;i++) {
@@ -100,8 +102,8 @@ int nr_phy_init_RU(RU_t *ru) {
// allocate FFT output buffers (RX)
ru->common.rxdataF = (int32_t**)malloc16(ru->nb_rx*sizeof(int32_t*) );
for (i=0; inb_rx; i++) {
- // allocate 2 subframes of I/Q signal data (frequency)
- ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(2*fp->samples_per_subframe_wCP) );
+ // allocate 4 slots of I/Q signal data (frequency)
+ ru->common.rxdataF[i] = (int32_t*)malloc16_clear(sizeof(int32_t)*(4*fp->symbols_per_slot*fp->ofdm_symbol_size) );
LOG_I(PHY,"rxdataF[%d] %p for RU %d\n",i,ru->common.rxdataF[i],ru->idx);
}
@@ -176,7 +178,11 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->frame_parms);
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so free memory for time-domain signals
- for (i = 0; i < ru->nb_tx; i++) free_and_zero(ru->common.txdata[i]);
+ int32_t *ptr;
+ for (i = 0; i < ru->nb_tx; i++) {
+ ptr=&ru->common.txdata[i][-ru->sf_extension];
+ free_and_zero(ptr);
+ }
for (i = 0; i < ru->nb_rx; i++) free_and_zero(ru->common.rxdata[i]);
free_and_zero(ru->common.txdata);
free_and_zero(ru->common.rxdata);
diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c
index 98e3c5a1a3..0920da667d 100644
--- a/openair1/PHY/INIT/nr_parms.c
+++ b/openair1/PHY/INIT/nr_parms.c
@@ -22,7 +22,6 @@
#include "phy_init.h"
#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log.h"
-#include "LAYER2/NR_MAC_gNB/mac_proto.h"
/// Subcarrier spacings in Hz indexed by numerology index
uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
@@ -102,7 +101,7 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
if (fp->nr_band == 5 || fp->nr_band == 66)
fp->ssb_type = nr_ssb_type_B;
else{
- if (fp->nr_band == 41 || ( fp->nr_band > 76 && fp->nr_band < 80) )
+ if (fp->nr_band == 41 || fp->nr_band == 38 || ( fp->nr_band > 76 && fp->nr_band < 80) )
fp->ssb_type = nr_ssb_type_C;
else
AssertFatal(1==0,"NR Operating Band n%d not available for SS block SCS with mu=%d\n", fp->nr_band, mu);
@@ -141,6 +140,8 @@ void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, int N_RB_DL)
fp->first_carrier_offset = fp->ofdm_symbol_size - (N_RB_DL * 12 / 2);
fp->nb_prefix_samples = fp->ofdm_symbol_size / 128 * 9;
fp->nb_prefix_samples0 = fp->ofdm_symbol_size / 128 * (9 + (1 << mu));
+ LOG_I(PHY,"Init: N_RB_DL %d, first_carrier_offset %d, nb_prefix_samples %d,nb_prefix_samples0 %d\n",
+ N_RB_DL,fp->first_carrier_offset,fp->nb_prefix_samples,fp->nb_prefix_samples0);
}
uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp)
diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h
index 85101a3080..dd9232de83 100644
--- a/openair1/PHY/INIT/phy_init.h
+++ b/openair1/PHY/INIT/phy_init.h
@@ -409,6 +409,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB);
void init_dfts(void);
void fill_subframe_mask(PHY_VARS_eNB *eNB);
+void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg);
/** @} */
#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c
index e2bec337aa..86723d0fed 100644
--- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c
@@ -31,15 +31,14 @@
*/
#include
+#include "PHY/defs_eNB.h"
+#include "PHY/defs_gNB.h"
#include
#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-//#define DEBUG_DL_MOBIPASS
-//#define DEBUG_UL_MOBIPASS
-#define SUBFRAME_SKIP_NUM_MOBIPASS 8
const uint8_t lin2alaw_if5[65536] = {213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 213, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 214, 214, 214, 214,
214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, 211,
@@ -1050,18 +1049,12 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e
return temp_ns;
}
-void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t *seqno, uint16_t packet_type) {
+void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seqno, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx];
int32_t *tx_buffer=NULL;
-#ifdef DEBUG_DL_MOBIPASS
- int8_t dummy_buffer[fp->samples_per_tti*2];
-#endif
- void *alaw_buffer = ru->ifbuffer.tx[subframe&1];
- uint16_t *data_block = NULL;
- uint16_t *j = NULL;
- uint16_t packet_id=0, i=0, element_id=0;
+ uint16_t packet_id=0, i=0;
uint32_t spp_eth = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_packet;
uint32_t spsf = (uint32_t) ru->ifdevice.openair0_cfg->samples_per_frame/10;
@@ -1072,6 +1065,12 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
if (eth->compression == ALAW_COMPRESS) {
AssertFatal(1==0,"IF5 compression needs reworking\n");
/*
+ void *alaw_buffer = ru->ifbuffer.tx[subframe&1];
+ int element_id=0;
+
+ uint16_t *data_block = NULL;
+ uint16_t *j = NULL;
+
if (eth->flags == ETH_RAW_MODE) {
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES);
} else {
@@ -1105,10 +1104,22 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
*/
} else if (eth->compression == NO_COMPRESS) {
+ NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
+
+ int offset,siglen;
+ if (nrfp) {
+ offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
+ siglen = nrfp->get_samples_per_slot(tti,nrfp);
+ }
+ else {
+ offset = tti*fp->samples_per_subframe;
+ siglen = spsf;
+ }
+
for (i=0; i < ru->nb_tx; i++)
- txp[i] = (int32_t*)&ru->common.txdata[i][subframe*fp->samples_per_tti];
+ txp[i] = (int32_t*)&ru->common.txdata[i][offset];
- for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
+ for (packet_id=0; packet_id < siglen / spp_eth; packet_id++) {
for (int aid=0; aidnb_tx;aid++) {
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
@@ -1119,9 +1130,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
spp_eth,
aid,
0);
- LOG_D(HW,"SF %d : packet %d, TS %llu\n",subframe,packet_id,(unsigned long long)(proc_timestamp+packet_id*spp_eth));
+ LOG_D(HW,"TTI %d : packet %d, TS %llu\n",tti,packet_id,(unsigned long long)(proc_timestamp-ru->ts_offset+packet_id*spp_eth));
clock_gettime( CLOCK_MONOTONIC, &end_comp);
- LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
+ LOG_D(HW,"[TTI %d] IF_Write_Time: %"PRId64"\n",tti,clock_difftime_ns(start_comp, end_comp));
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
txp[aid] += spp_eth;
@@ -1130,7 +1141,8 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
}
} else if (packet_type == IF5_RRH_GW_UL) {
if (eth->compression == ALAW_COMPRESS) {
- if (eth->flags == ETH_RAW_MODE) {
+ AssertFatal(1==0,"ALAW IF5 requires work\n");
+ /* if (eth->flags == ETH_RAW_MODE) {
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES + MAC_HEADER_SIZE_BYTES);
} else {
data_block = (uint16_t*)(alaw_buffer + APP_HEADER_SIZE_BYTES);
@@ -1160,9 +1172,10 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
}
+*/
} else if (eth->compression == NO_COMPRESS) {
for (i=0; i < fp->nb_antennas_rx; i++)
- rxp[i] = (void*)&ru->common.rxdata[i][subframe*fp->samples_per_tti];
+ rxp[i] = (void*)&ru->common.rxdata[i][tti*fp->samples_per_tti];
for (packet_id=0; packet_id < spsf / spp_eth; packet_id++) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
@@ -1175,153 +1188,28 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int subframe, uint8_t
fp->nb_antennas_rx,
0);
clock_gettime( CLOCK_MONOTONIC, &end_comp);
- LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_comp, end_comp));
+ LOG_D(HW,"[SF %d] IF_Write_Time: %"PRId64"\n",tti,clock_difftime_ns(start_comp, end_comp));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 0 );
for (i=0; i < fp->nb_antennas_rx; i++)
rxp[i] += spp_eth;
}
}
- } else if (packet_type == IF5_MOBIPASS) {
- /* the only difference between mobipass standalone and the other one
- * is the timestamp in trx_write_func, but let's duplicate anyway
- * (plus we don't call malloc for the standalone case)
- */
- if (ru->if_timing == synch_to_mobipass_standalone) {
- uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
-
- __m128i *data_block=NULL, *data_block_head=NULL;
- __m128i *txp128;
- __m128i t0, t1;
-
- unsigned char _tx_buffer[MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t)];
- tx_buffer=(int32_t *)_tx_buffer;
-
- IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
- data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
-
- header->flags = 0;
- header->fifo_status = 0;
- header->seqno = *seqno;
- header->ack = 0;
- header->word0 = 0;
-
- txp[0] = (void*)&ru->common.txdata[0][subframe*ru->frame_parms->samples_per_tti];
- txp128 = (__m128i *) txp[0];
-
- for (packet_id=0; packet_idsamples_per_tti/db_fulllength; packet_id++) {
- header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
- data_block = data_block_head;
-
- for (i=0; i>2; i+=2) {
- t0 = _mm_srai_epi16(*txp128++, 4);
- t1 = _mm_srai_epi16(*txp128++, 4);
- _mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
- }
-
- // Write the packet to the fronthaul
- if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
- proc_timestamp + packet_id*db_fulllength,
- (void**)&tx_buffer,
- db_fulllength,
- 1,
- IF5_MOBIPASS)) < 0) {
- perror("ETHERNET write for IF5_MOBIPASS\n");
- }
- header->seqno += 1;
- }
- *seqno = header->seqno;
- tx_buffer = NULL;
- } else {
- uint16_t db_fulllength = PAYLOAD_MOBIPASS_NUM_SAMPLES;
-
- __m128i *data_block=NULL, *data_block_head=NULL;
-
- __m128i *txp128;
- __m128i t0, t1;
-
- // tx_buffer = memalign(16, MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
- tx_buffer = malloc(MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t + db_fulllength*sizeof(int16_t));
- IF5_mobipass_header_t *header = (IF5_mobipass_header_t *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES);
- data_block_head = (__m128i *)((uint8_t *)tx_buffer + MAC_HEADER_SIZE_BYTES + sizeof_IF5_mobipass_header_t);
-
- header->flags = 0;
- header->fifo_status = 0;
- header->seqno = *seqno;
- header->ack = 0;
- header->word0 = 0;
-
- txp[0] = (void*)&ru->common.txdata[0][subframe*ru->frame_parms->samples_per_tti];
- txp128 = (__m128i *) txp[0];
-
- for (packet_id=0; packet_idsamples_per_tti/db_fulllength; packet_id++) {
- header->time_stamp = htonl((uint32_t)(proc_timestamp + packet_id*db_fulllength));
- data_block = data_block_head;
-
- for (i=0; i>2; i+=2) {
- t0 = _mm_srai_epi16(*txp128++, 4);
- t1 = _mm_srai_epi16(*txp128++, 4);
-// *data_block++ = _mm_packs_epi16(t0, t1);
- _mm_storeu_si128(data_block++, _mm_packs_epi16(t0, t1));
- }
-
- // Write the packet to the fronthaul
- if ((ru->ifdevice.trx_write_func(&ru->ifdevice,
- packet_id,
- (void**)&tx_buffer,
- db_fulllength,
- 1,
- IF5_MOBIPASS)) < 0) {
- perror("ETHERNET write for IF5_MOBIPASS\n");
- }
-
-#ifdef DEBUG_DL_MOBIPASS
- if ((subframe==0)&&(dummy_cnt == 100)) {
- memcpy((void*)&dummy_buffer[packet_id*db_fulllength*2],(void*)data_block_head,db_fulllength*2);
- }
-#endif
- header->seqno += 1;
- }
- *seqno = header->seqno;
-
-#ifdef DEBUG_DL_MOBIPASS
- uint8_t txe;
- txe = dB_fixed(signal_energy(txp[0],fp->samples_per_tti));
- if (txe > 0){
- LOG_D(PHY,"[Mobipass] frame:%d, subframe:%d, energy %d\n", (proc_timestamp/(10*fp->samples_per_tti))&1023,subframe, txe);
- }
-#endif
- }
} else {
AssertFatal(1==0, "send_IF5 - Unknown packet_type %x", packet_type);
}
free(tx_buffer);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF5, 0 );
-#ifdef DEBUG_DL_MOBIPASS
- if(subframe==0) {
- if (dummy_cnt==100) {
- LOG_M("txsigmb.m","txs",(void*)dummy_buffer, fp->samples_per_tti,1, 5);
- exit(-1);
- } else {
- dummy_cnt++;
- }
- }
-#endif
return;
}
-
-void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16_t packet_type) {
+void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
int32_t *txp[ru->nb_tx], *rxp[ru->nb_rx];
uint16_t packet_id=0, i=0;
-#ifdef DEBUG_UL_MOBIPASS
- //int8_t dummy_buffer_rx[fp->samples_per_tti*2];
- uint8_t rxe;
-#endif
int32_t spp_eth = (int32_t) ru->ifdevice.openair0_cfg->samples_per_packet;
@@ -1375,6 +1263,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
}
*/
} else if (eth->compression == NO_COMPRESS) {
+ int subframe = tti;
for (i=0; i < fp->nb_antennas_tx; i++)
txp[i] = (void*)&ru->common.txdata[i][subframe*fp->samples_per_tti];
@@ -1433,14 +1322,25 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
}
*/
} else if (eth->compression == NO_COMPRESS) {
- int16_t temp_rx[spp_eth*2] __attribute__((aligned(32)));
+ int16_t temp_rx[spp_eth*2] __attribute__((aligned(32)));
+ NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
+
+ int offset,siglen;
+ if (nrfp) {
+ offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
+ siglen = nrfp->get_samples_per_slot(tti,nrfp);
+ }
+ else {
+ offset = tti*fp->samples_per_subframe;
+ siglen = spsf;
+ }
for (i=0; i < ru->nb_rx; i++)
- rxp[i] = &ru->common.rxdata[i][subframe*fp->samples_per_tti];
+ rxp[i] = &ru->common.rxdata[i][offset];
int aid;
int firstTS=1;
openair0_timestamp oldTS=0;
- for (packet_id=0; packet_id < ru->nb_rx*spsf / spp_eth; packet_id++) {
+ for (packet_id=0; packet_id < ru->nb_rx*siglen / spp_eth; packet_id++) {
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 1 );
clock_gettime( CLOCK_MONOTONIC, &if_time);
@@ -1453,7 +1353,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
clock_gettime( CLOCK_MONOTONIC, &if_time);
timeout[packet_id] = if_time.tv_nsec;
timestamp[packet_id] /= (30720/spsf);
- LOG_D(PHY,"subframe %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",subframe,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0]));
+ LOG_D(PHY,"TTI %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0]));
+
if (aid==0) {
if (firstTS==1) firstTS=0;
else if (oldTS + 256 != timestamp[packet_id]) {
@@ -1474,7 +1375,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
(void*)temp_rx,
spp_eth<<2);
clock_gettime( CLOCK_MONOTONIC, &end_decomp);
- LOG_D(HW,"[SF %d] IF_Read_Time: %"PRId64"\n",subframe,clock_difftime_ns(start_decomp, end_decomp));
+ LOG_D(HW,"[TTI %d] IF_Read_Time: %"PRId64"\n",tti,clock_difftime_ns(start_decomp, end_decomp));
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF0, 0 );
}
diff --git a/openair1/PHY/MODULATION/slot_fep_nr.c b/openair1/PHY/MODULATION/slot_fep_nr.c
index f3c8c108dc..eb26dfc02b 100644
--- a/openair1/PHY/MODULATION/slot_fep_nr.c
+++ b/openair1/PHY/MODULATION/slot_fep_nr.c
@@ -109,11 +109,11 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
// use OFDM symbol from within 1/8th of the CP to avoid ISI
rx_offset -= (nb_prefix_samples / frame_parms->ofdm_offset_divisor);
-#ifdef DEBUG_FEP
+//#ifdef DEBUG_FEP
// if (ue->frame <100)
- printf("slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u\n",
- Ns, symbol, nb_prefix_samples, nb_prefix_samples0, rx_offset);
-#endif
+ LOG_D(PHY,"slot_fep: slot %d, symbol %d, nb_prefix_samples %u, nb_prefix_samples0 %u, rx_offset %u energy %d\n",
+ Ns, symbol, nb_prefix_samples, nb_prefix_samples0, rx_offset, dB_fixed(signal_energy(&common_vars->rxdata[0][rx_offset],frame_parms->ofdm_symbol_size)));
+ //#endif
for (unsigned char aa=0; aanb_antennas_rx; aa++) {
memset(&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],0,frame_parms->ofdm_symbol_size*sizeof(int32_t));
@@ -129,18 +129,14 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
rxdata_ptr = (int16_t *)tmp_dft_in;
}
-#if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats);
-#endif
dft(dftsize,
rxdata_ptr,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1);
-#if UE_TIMING_TRACE
stop_meas(&ue->rx_dft_stats);
-#endif
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol+symb_offset];
@@ -249,18 +245,14 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
}
-#if UE_TIMING_TRACE
start_meas(&ue->rx_dft_stats);
-#endif
dft(dftsize,
rxdata_ptr,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1);
-#if UE_TIMING_TRACE
stop_meas(&ue->rx_dft_stats);
-#endif
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation[0])[symbol + symb_offset];
@@ -355,23 +347,24 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
+ int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
for (int symbol=first_symbol;symbolsymbol_rotation[1])[symbol + symb_offset];
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
- rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
+ rotate_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(int16_t*)&rot2,
- (int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
+ (int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
length,
15);
int16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
- multadd_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
+ multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
shift_rot,
- (int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
+ (int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1,
length,
15);
diff --git a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
index 57470cf988..cfb5a2e56e 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
+++ b/openair1/PHY/NR_ESTIMATION/nr_measurements_gNB.c
@@ -73,8 +73,9 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) {
int min_I0=1000,max_I0=0;
int amin=0,amax=0;
+ fprintf(fd,"Blacklisted PRBs %d/%d\n",gNB->num_ulprbbl,gNB->frame_parms.N_RB_UL);
for (int i=0; iframe_parms.N_RB_UL; i++) {
- if (i==(gNB->frame_parms.N_RB_UL>>1) - 1) i+=2;
+ if (gNB->ulprbbl[i] > 0) continue;
if (gNB->measurements.n0_subband_power_tot_dB[i]measurements.n0_subband_power_tot_dB[i]; amin=i;}
@@ -82,64 +83,88 @@ void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB) {
}
for (int i=0; iframe_parms.N_RB_UL; i++) {
- fprintf(fd,"%2d.",gNB->measurements.n0_subband_power_tot_dB[i]-gNB->measurements.n0_subband_power_avg_dB);
+ if (gNB->ulprbbl[i] ==0) fprintf(fd,"%2d.",gNB->measurements.n0_subband_power_tot_dB[i]-gNB->measurements.n0_subband_power_avg_dB);
+ else fprintf(fd," X.");
if (i%25 == 24) fprintf(fd,"\n");
}
-
- fprintf(fd,"\nmax_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, gNB->measurements.n0_subband_power_avg_dB);
-
- fprintf(fd,"PRACH I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
+ fprintf(fd,"\n");
+ fprintf(fd,"max_IO = %d (%d), min_I0 = %d (%d), avg_I0 = %d dB",max_I0,amax,min_I0,amin,gNB->measurements.n0_subband_power_avg_dB);
+ if (gNB->frame_parms.nb_antennas_rx>1) {
+ fprintf(fd,"(");
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++)
+ fprintf(fd,"%d.",gNB->measurements.n0_subband_power_avg_perANT_dB[aarx]);
+ fprintf(fd,")");
+ }
+ fprintf(fd,"\nPRACH I0 = %d.%d dB\n",gNB->measurements.prach_I0/10,gNB->measurements.prach_I0%10);
}
-void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb) {
+void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb) {
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
NR_gNB_COMMON *common_vars = &gNB->common_vars;
PHY_MEASUREMENTS_gNB *measurements = &gNB->measurements;
- uint32_t *rb_mask = gNB->rb_mask_ul;
- int rb, offset, offset0, nb_rb, len;
+ int rb, offset, offset0, nb_symb[275], len;
int32_t *ul_ch;
- int32_t n0_power_tot;
- int64_t n0_power_tot2;
- nb_rb = 0;
- n0_power_tot2=0;
- for (rb=0; rbN_RB_UL; rb++) {
- n0_power_tot=0;
- offset0 = (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
- if ((rb_mask[rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
- nb_rb++;
- for (int aarx=0; aarxnb_antennas_rx; aarx++) {
- measurements->n0_subband_power[aarx][rb]=0;
- for (int s=first_symb;s<(first_symb+num_symb);s++) {
+ LOG_D(PHY,"slot %d Doing I0 for first_symb %d, num_symb %d\n",slot,first_symb,num_symb);
+ for (int s=first_symb;s<(first_symb+num_symb);s++) {
+ for (rb=0; rbN_RB_UL; rb++) {
- offset = offset0 + (s*frame_parms->ofdm_symbol_size);
- ul_ch = &common_vars->rxdataF[aarx][offset];
- len = 12;
- if (((frame_parms->N_RB_UL&1) == 1) &&
- (rb==(frame_parms->N_RB_UL>>1))) {
- len=6;
- }
- AssertFatal(ul_ch, "RX signal buffer (freq) problem\n");
- measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
- } // symbol
- measurements->n0_subband_power[aarx][rb]/=num_symb;
- measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]);
- n0_power_tot += measurements->n0_subband_power[aarx][rb];
- } //antenna
- n0_power_tot/=frame_parms->nb_antennas_rx;
- n0_power_tot2 += n0_power_tot;
- measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
+ if (s==first_symb) {
+ nb_symb[rb]=0;
+ for (int aarx=0; aarxnb_antennas_rx;aarx++)
+ measurements->n0_subband_power[aarx][rb]=0;
+ }
+ offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
+ if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
+ nb_symb[rb]++;
+ for (int aarx=0; aarxnb_antennas_rx; aarx++) {
+ offset = offset0 + (s*frame_parms->ofdm_symbol_size);
+ ul_ch = &common_vars->rxdataF[aarx][offset];
+ len = 12;
+ if (((frame_parms->N_RB_UL&1) == 1) &&
+ (rb==(frame_parms->N_RB_UL>>1))) {
+ len=6;
+ }
+ AssertFatal(ul_ch, "RX signal buffer (freq) problem\n");
+ measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
+ } //antenna
+ }
+ } //rb
+ } // symb
+ int nb_rb=0;
+ int32_t n0_subband_tot=0;
+ int32_t n0_subband_tot_perPRB=0;
+ int32_t n0_subband_tot_perANT[1+frame_parms->nb_antennas_rx];
+
+ for (int rb = 0 ; rbN_RB_UL;rb++) {
+ n0_subband_tot_perPRB=0;
+ if (nb_symb[rb] > 0) {
+ for (int aarx=0;aarxnb_antennas_rx;aarx++) {
+ measurements->n0_subband_power[aarx][rb]/=nb_symb[rb];
+ measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]);
+ n0_subband_tot_perPRB+=measurements->n0_subband_power[aarx][rb];
+ if (rb==0) n0_subband_tot_perANT[aarx]=measurements->n0_subband_power[aarx][rb];
+ else n0_subband_tot_perANT[aarx]+=measurements->n0_subband_power[aarx][rb];
+ }
+ n0_subband_tot_perPRB/=frame_parms->nb_antennas_rx;
+ measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_subband_tot_perPRB);
measurements->n0_subband_power_tot_dBm[rb] = measurements->n0_subband_power_tot_dB[rb] - gNB->rx_total_gain_dB - dB_fixed(frame_parms->N_RB_UL);
+ LOG_D(PHY,"n0_subband_power_tot_dB[%d] => %d, over %d symbols\n",rb,measurements->n0_subband_power_tot_dB[rb],nb_symb[rb]);
+ n0_subband_tot += n0_subband_tot_perPRB;
+ nb_rb++;
}
- } //rb
-
- if (nb_rb>0) measurements->n0_subband_power_avg_dB = dB_fixed(n0_power_tot2/nb_rb);
-
+ }
+ if (nb_rb>0) {
+ measurements->n0_subband_power_avg_dB = dB_fixed(n0_subband_tot/nb_rb);
+ for (int aarx=0;aarxnb_antennas_rx;aarx++) {
+ measurements->n0_subband_power_avg_perANT_dB[aarx] = dB_fixed(n0_subband_tot_perANT[aarx]/nb_rb);
+ }
+ }
}
@@ -179,6 +204,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
rx_power[ulsch_id][aarx] += meas->rx_spatial_power[ulsch_id][aatx][aarx];
}
+ LOG_D(PHY, "[ULSCH ID %d] RX power in antenna %d = %d\n", ulsch_id, aarx, rx_power[ulsch_id][aarx]);
rx_power_tot[ulsch_id] += rx_power[ulsch_id][aarx];
@@ -190,12 +216,13 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
meas->wideband_cqi_tot[ulsch_id] = dB_fixed2(rx_power_tot[ulsch_id], meas->n0_power_tot);
meas->rx_rssi_dBm[ulsch_id] = rx_power_avg_dB[ulsch_id] + 30 - 10 * log10(pow(2, 30)) - (rx_gain - rx_gain_offset) - dB_fixed(fp->ofdm_symbol_size);
- LOG_D(PHY, "[ULSCH %d] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d\n",
+ LOG_D(PHY, "[ULSCH %d] RSSI %d dBm/RE, RSSI (digital) %d dB (N_RB_UL %d), WBand CQI tot %d dB, N0 Power tot %d, RX Power tot %d\n",
ulsch_id,
meas->rx_rssi_dBm[ulsch_id],
rx_power_avg_dB[ulsch_id],
N_RB_UL,
meas->wideband_cqi_tot[ulsch_id],
- meas->n0_power_tot);
+ meas->n0_power_tot,
+ rx_power_tot[ulsch_id]);
}
diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
index 960ad82696..1f164748bf 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
+++ b/openair1/PHY/NR_ESTIMATION/nr_ul_channel_estimation.c
@@ -68,7 +68,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
uint8_t nushift;
int **ul_ch_estimates = gNB->pusch_vars[ul_id]->ul_ch_estimates;
int **rxdataF = gNB->common_vars.rxdataF;
-
+ int soffset = (Ns&3)*gNB->frame_parms.symbols_per_slot*gNB->frame_parms.ofdm_symbol_size;
nushift = (p>>1)&1;
gNB->frame_parms.nushift = nushift;
@@ -81,16 +81,14 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
uint16_t nb_rb_pusch = pusch_pdu->rb_size;
-#ifdef DEBUG_CH
- LOG_I(PHY, "In %s: ch_offset %d, symbol_offset %d OFDM size %d, Ns = %d, k = %d symbol %d\n",
+ LOG_D(PHY, "In %s: ch_offset %d, soffset %d, symbol_offset %d OFDM size %d, Ns = %d, k = %d symbol %d\n",
__FUNCTION__,
- ch_offset,
+ ch_offset, soffset,
symbol_offset,
gNB->frame_parms.ofdm_symbol_size,
Ns,
k,
symbol);
-#endif
switch (nushift) {
case 0:
@@ -174,7 +172,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
re_offset = k; /* Initializing the Resource element offset for each Rx antenna */
pil = (int16_t *)&pilot[0];
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+nushift)];
+ rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+k+nushift)];
ul_ch = (int16_t *)&ul_ch_estimates[p*gNB->frame_parms.nb_antennas_rx+aarx][ch_offset];
re_offset = k;
@@ -216,7 +214,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
8);
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
//for (int i= 0; i<8; i++)
//printf("ul_ch addr %p %d\n", ul_ch+i, *(ul_ch+i));
@@ -247,7 +245,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
8);
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
//printf("ul_ch addr %p\n",ul_ch);
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
@@ -281,8 +279,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
- ul_ch += 8;
+ rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
+ ul_ch+=8;
for (pilot_cnt=3; pilot_cnt<(6*nb_rb_pusch-3); pilot_cnt += 2) {
@@ -299,7 +297,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
8);
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][(soffset+symbol_offset+nushift+re_offset)];
//printf("ul_ch addr %p\n",ul_ch);
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
@@ -319,9 +317,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
- ul_ch += 8;
-
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
+ ul_ch+=8;
}
// Treat first 2 pilots specially (right edge)
@@ -341,7 +338,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -357,8 +354,8 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil += 2;
re_offset = (re_offset+2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
- ul_ch += 8;
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
+ ul_ch+=8;
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -383,7 +380,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
ul_ch += (idxDC-4);
ul_ch = memset(ul_ch, 0, sizeof(int16_t)*10);
re_offset = (re_offset+idxDC/2-2) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -414,7 +411,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
pil += 4;
re_offset = (re_offset+4) % gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -438,7 +435,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
LOG_D(PHY,"PUSCH estimation DMRS type 2, Freq-domain interpolation");
// Treat first DMRS specially (left edge)
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
ul_ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ul_ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -450,7 +447,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
for (re_cnt = 1; re_cnt < (nb_rb_pusch*NR_NB_SC_PER_RB) - 5; re_cnt += 6){
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -468,7 +465,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
re_offset = (re_offset+5)%gNB->frame_parms.ofdm_symbol_size;
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+symbol_offset+nushift+re_offset];
ch_r[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch_r[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
@@ -496,7 +493,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
// Treat last pilot specially (right edge)
- rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+nushift+re_offset)];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol_offset+nushift+re_offset)];
ch_l[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
ch_l[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
diff --git a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
index c8e02fd13d..fd3403236e 100644
--- a/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
+++ b/openair1/PHY/NR_ESTIMATION/nr_ul_estimation.h
@@ -49,7 +49,7 @@ int nr_pusch_channel_estimation(PHY_VARS_gNB *gNB,
void dump_nr_I0_stats(FILE *fd,PHY_VARS_gNB *gNB);
-void gNB_I0_measurements(PHY_VARS_gNB *gNB,int first_symb,int num_symb);
+void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot,int first_symb,int num_symb);
void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq_pid, unsigned char symbol, uint8_t nrOfLayers);
diff --git a/openair1/PHY/NR_REFSIG/nr_gold.c b/openair1/PHY/NR_REFSIG/nr_gold.c
index 11e28a3046..7930839832 100644
--- a/openair1/PHY/NR_REFSIG/nr_gold.c
+++ b/openair1/PHY/NR_REFSIG/nr_gold.c
@@ -66,7 +66,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
reset = 1;
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1));
-
+ LOG_D(PHY,"PDCCH DMRS slot %d, symb %d, Nid %d, x2 %x\n",slot,symb,Nid,x2);
for (uint32_t n=0; nsymbols_per_slot; symb++) {
reset = 1;
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
- LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",slot,symb,x2);
+ LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid);
for (uint32_t n=0; nFreqDomainResource,&n_rb,&rb_offset);
@@ -102,7 +103,9 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
// DMRS length is per OFDM symbol
uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE)
- LOG_D(PHY, "DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d)\n", dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType);
+ LOG_D(PHY, "DL_DCI : rb_offset %d, nb_rb %d, DMRS length per symbol %d\t DCI encoded length %d (precoder_granularity %d,reg_mapping %d),Scrambling_Id %d,ScramblingRNTI %x,PayloadSizeBits %d\n",
+ rb_offset, n_rb,dmrs_length, encoded_length,pdcch_pdu_rel15->precoderGranularity,pdcch_pdu_rel15->CceRegMappingType,
+ dci_pdu->ScramblingId,dci_pdu->ScramblingRNTI,dci_pdu->PayloadSizeBits);
dmrs_length += rb_offset*6; // To accommodate more DMRS symbols in case of rb offset
/// DMRS QPSK modulation
@@ -111,11 +114,11 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
nr_modulation(gold_pdcch_dmrs[symb], dmrs_length, DMRS_MOD_ORDER, mod_dmrs[symb]); //Qm = 2 as DMRS is QPSK modulated
#ifdef DEBUG_PDCCH_DMRS
-
+ if(dci_pdu->RNTI!=0xFFFF) {
for (int i=0; i>1; i++)
- printf("symb %d i %d gold seq 0x%08x mod_dmrs %d %d\n", symb, i,
- gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] );
-
+ printf("symb %d i %d %p gold seq 0x%08x mod_dmrs %d %d\n", symb, i,
+ &gold_pdcch_dmrs[symb][i>>5],gold_pdcch_dmrs[symb][i>>5], mod_dmrs[symb][i<<1], mod_dmrs[symb][(i<<1)+1] );
+ }
#endif
}
@@ -132,8 +135,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
dci_pdu->AggregationLevel,
0,NULL);
polar_encoder_fast((uint64_t*)dci_pdu->Payload, (void*)encoder_output, n_RNTI,1,currentPtr);
-#ifdef DEBUG_CHANNEL_CODING
- printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,pdcch_pdu_rel15->dci_pdu.AggregationLevel[d]);
+#if DEBUG_CHANNEL_CODING
+ printf("polar rnti %x,length %d, L %d\n",n_RNTI, dci_pdu->PayloadSizeBits,dci_pdu->AggregationLevel);
printf("DCI PDU: [0]->0x%lx \t [1]->0x%lx\n",
((uint64_t*)dci_pdu->Payload)[0], ((uint64_t*)dci_pdu->Payload)[1]);
printf("Encoded Payload (length:%d dwords):\n", encoded_length>>5);
@@ -211,7 +214,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
(amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
#ifdef DEBUG_PDCCH_DMRS
- printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
+ LOG_D(PHY,"PDCCH DMRS %d: l %d position %d => (%d,%d)\n",dmrs_idx,l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
#endif
@@ -223,7 +226,7 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
((int16_t *) txdataF)[((l * frame_parms->ofdm_symbol_size + k) << 1) + 1] =
(amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
#ifdef DEBUG_DCI
- printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
+ LOG_D(PHY,"PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms->ofdm_symbol_size + k)<<1],
((int16_t *)txdataF)[((l*frame_parms->ofdm_symbol_size + k)<<1)+1]);
#endif
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.h b/openair1/PHY/NR_TRANSPORT/nr_dci.h
index e3b53f9cf9..07baaf2728 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.h
@@ -59,6 +59,4 @@ void nr_fill_ul_dci(PHY_VARS_gNB *gNB,
void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m,nfapi_nr_dl_tti_pdcch_pdu_rel15_t *);
-void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset);
-
#endif //__PHY_NR_TRANSPORT_DCI__H
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
index c562dfaa41..1675045443 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
@@ -31,6 +31,7 @@
*/
#include "nr_dci.h"
+#include "common/utils/nr/nr_common.h"
//#define DEBUG_FILL_DCI
@@ -153,7 +154,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
C = N_reg/(bsize*R);
}
- LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex);
+ if (pdcch_pdu_rel15->dci_pdu[d].RNTI != 0xFFFF) LOG_D(PHY, "CCE list generation for candidate %d: bundle size %d ilv size %d CceIndex %d\n", m, bsize, R, pdcch_pdu_rel15->dci_pdu[d].CceIndex);
for (uint8_t cce_idx=0; cce_idxcce_list[d][cce_idx];
cce->cce_idx = pdcch_pdu_rel15->dci_pdu[d].CceIndex + cce_idx;
@@ -202,107 +203,3 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
ret |= ((field>>i)&1)<<(size-i-1);
return ret;
}*/
-int16_t find_nr_pdcch(int frame,int slot, PHY_VARS_gNB *gNB,find_type_t type) {
-
- uint16_t i;
- int16_t first_free_index=-1;
-
- AssertFatal(gNB!=NULL,"gNB is null\n");
- for (i=0; ipdcch_pdu[i].frame,gNB->pdcch_pdu[i].slot,first_free_index);
- if ((gNB->pdcch_pdu[i].frame == frame) &&
- (gNB->pdcch_pdu[i].slot==slot)) return i;
- else if ( gNB->pdcch_pdu[i].frame==-1 && first_free_index==-1) first_free_index=i;
- }
- if (type == SEARCH_EXIST) return -1;
-
- return first_free_index;
-}
-
-
-void nr_fill_dci(PHY_VARS_gNB *gNB,
- int frame,
- int slot,
- nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu) {
-
- nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &pdcch_pdu->pdcch_pdu_rel15;
- NR_gNB_DLSCH_t *dlsch;
-
- int pdcch_id = find_nr_pdcch(frame,slot,gNB,SEARCH_EXIST_OR_FREE);
- AssertFatal(pdcch_id>=0 && pdcch_idpdcch_pdu[pdcch_id].pdcch_pdu,(void*)pdcch_pdu,sizeof(*pdcch_pdu));
- gNB->pdcch_pdu[pdcch_id].frame = frame;
- gNB->pdcch_pdu[pdcch_id].slot = slot;
-
- for (int i=0;inumDlDci;i++) {
-
- //uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu[i].Payload;
-
- int dlsch_id = find_nr_dlsch(pdcch_pdu_rel15->dci_pdu[i].RNTI,gNB,SEARCH_EXIST_OR_FREE);
- if( (dlsch_id<0) || (dlsch_id>=gNB->number_of_nr_dlsch_max) ){
- LOG_E(PHY,"illegal dlsch_id found!!! rnti %04x dlsch_id %d\n",(unsigned int)pdcch_pdu_rel15->dci_pdu[i].RNTI,dlsch_id);
- return;
- }
-
- dlsch = gNB->dlsch[dlsch_id][0];
- int harq_pid = 0;
-
- dlsch->slot_tx[slot] = 1;
- dlsch->harq_ids[frame % 2][slot] = 0;
- AssertFatal(harq_pid < 8 && harq_pid >= 0,
- "illegal harq_pid %d\n",harq_pid);
-
- dlsch->harq_mask |= (1<rnti = pdcch_pdu_rel15->dci_pdu[i].RNTI;
-
- // nr_fill_cce_list(gNB,0);
- }
-
-}
-
-
-int16_t find_nr_ul_dci(int frame,int slot, PHY_VARS_gNB *gNB,find_type_t type) {
-
- uint16_t i;
- int16_t first_free_index=-1;
-
- AssertFatal(gNB!=NULL,"gNB is null\n");
- for (i=0; iul_pdcch_pdu[i].frame,gNB->ul_pdcch_pdu[i].slot,first_free_index);
- if ((gNB->ul_pdcch_pdu[i].frame == frame) &&
- (gNB->ul_pdcch_pdu[i].slot==slot)) return i;
- else if (gNB->ul_pdcch_pdu[i].frame==-1 && first_free_index==-1) first_free_index=i;
- }
- if (type == SEARCH_EXIST) return -1;
-
- return first_free_index;
-}
-
-
-void nr_fill_ul_dci(PHY_VARS_gNB *gNB,
- int frame,
- int slot,
- nfapi_nr_ul_dci_request_pdus_t *pdcch_pdu) {
-
- nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu_rel15 = &pdcch_pdu->pdcch_pdu.pdcch_pdu_rel15;
-
- int pdcch_id = find_nr_ul_dci(frame,slot,gNB,SEARCH_EXIST_OR_FREE);
- AssertFatal(pdcch_id>=0 && pdcch_idul_pdcch_pdu[pdcch_id].pdcch_pdu,(void*)pdcch_pdu,sizeof(*pdcch_pdu));
- gNB->ul_pdcch_pdu[pdcch_id].frame = frame;
- gNB->ul_pdcch_pdu[pdcch_id].slot = slot;
-
- for (int i=0;inumDlDci;i++) {
-
- //uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu[i].Payload;
-
- // if there's no DL DCI then generate CCE list
- // nr_fill_cce_list(gNB,0);
- /*
- LOG_D(PHY, "DCI PDU: [0]->0x%lx \t [1]->0x%lx \n",dci_pdu[0], dci_pdu[1]);
- LOG_D(PHY, "DCI type %d payload (size %d) generated on candidate %d\n", dci_alloc->pdcch_params.dci_format, dci_alloc->size, cand_idx);
- */
-
- }
-
-}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools_common.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools_common.c
deleted file mode 100644
index d26a52f157..0000000000
--- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools_common.c
+++ /dev/null
@@ -1,62 +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
- */
-
-/*! \file PHY/NR_TRANSPORT/nr_dci_tools_common.c
- * \brief
- * \author
- * \date 2018
- * \version 0.1
- * \company Eurecom
- * \email:
- * \note
- * \warning
- */
-
-#include "nr_dci.h"
-
-//#define DEBUG_FILL_DCI
-
-#include "nr_dlsch.h"
-
-
-void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) {
-
- uint8_t count=0, start=0, start_set=0;
-
- uint64_t bitmap = (((uint64_t)FreqDomainResource[0])<<37)|
- (((uint64_t)FreqDomainResource[1])<<29)|
- (((uint64_t)FreqDomainResource[2])<<21)|
- (((uint64_t)FreqDomainResource[3])<<13)|
- (((uint64_t)FreqDomainResource[4])<<5)|
- (((uint64_t)FreqDomainResource[5])>>3);
-
- for (int i=0; i<45; i++)
- if ((bitmap>>(44-i))&1) {
- count++;
- if (!start_set) {
- start = i;
- start_set = 1;
- }
- }
- *rb_offset = 6*start;
- *n_rb = 6*count;
-}
-
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index ce056b5aa5..d75f97aa53 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -37,7 +37,7 @@
#include "PHY/NR_REFSIG/dmrs_nr.h"
#include "PHY/NR_REFSIG/ptrs_nr.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "LAYER2/NR_MAC_gNB/mac_proto.h"
+#include "common/utils/nr/nr_common.h"
//#define DEBUG_DLSCH
//#define DEBUG_DLSCH_MAPPING
@@ -111,10 +111,11 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in,
}
-uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
+uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
int frame,
int slot) {
+ PHY_VARS_gNB *gNB = msgTx->gNB;
NR_gNB_DLSCH_t *dlsch;
uint32_t ***pdsch_dmrs = gNB->nr_gold_pdsch_dmrs[slot];
int32_t** txdataF = gNB->common_vars.txdataF;
@@ -132,9 +133,8 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
time_stats_t *dlsch_interleaving_stats=&gNB->dlsch_interleaving_stats;
time_stats_t *dlsch_segmentation_stats=&gNB->dlsch_segmentation_stats;
- for (int dlsch_id=0;dlsch_idnumber_of_nr_dlsch_max;dlsch_id++) {
- dlsch = gNB->dlsch[dlsch_id][0];
- if (dlsch->slot_tx[slot] == 0) continue;
+ for (int dlsch_id=0; dlsch_idnum_pdsch_slot; dlsch_id++) {
+ dlsch = msgTx->dlsch[dlsch_id][0];
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15;
@@ -527,15 +527,17 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
return 0;
}
-void dump_pdsch_stats(PHY_VARS_gNB *gNB) {
+void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
for (int i=0;idlsch_stats[i].rnti > 0)
- LOG_D(PHY,"DLSCH RNTI %x: current_Qm %d, current_RI %d, total_bytes TX %d\n",
+ if (gNB->dlsch_stats[i].rnti > 0 && gNB->dlsch_stats[i].frame != gNB->dlsch_stats[i].dump_frame) {
+ gNB->dlsch_stats[i].dump_frame = gNB->dlsch_stats[i].frame;
+ fprintf(fd,"DLSCH RNTI %x: current_Qm %d, current_RI %d, total_bytes TX %d\n",
gNB->dlsch_stats[i].rnti,
gNB->dlsch_stats[i].current_Qm,
gNB->dlsch_stats[i].current_RI,
gNB->dlsch_stats[i].total_bytes_tx);
+ }
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
index 6af8f28eac..4b6ecfe412 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.h
@@ -63,13 +63,11 @@ void nr_pdsch_codeword_scrambling(uint8_t *in,
uint32_t n_RNTI,
uint32_t* out);
-void nr_fill_dlsch(PHY_VARS_gNB *gNB,
- int frame,
- int slot,
+void nr_fill_dlsch(processingData_L1tx_t *msgTx,
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
unsigned char *sdu);
-uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
+uint8_t nr_generate_pdsch(processingData_L1tx_t *msgTx,
int frame,
int slot);
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
@@ -98,7 +96,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
void init_dlsch_tpool(uint8_t nun_dlsch_threads);
void nr_emulate_dlsch_payload(uint8_t* payload, uint16_t size);
-void dump_pdsch_stats(PHY_VARS_gNB *gNB);
+void dump_pdsch_stats(FILE *fd,PHY_VARS_gNB *gNB);
void clear_pdsch_stats(PHY_VARS_gNB *gNB);
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index 9956e14701..acb59b0e40 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -39,10 +39,10 @@
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
-#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
#include "SCHED_NR/sched_nr.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/LOG/log.h"
+#include "common/utils/nr/nr_common.h"
#include
#include
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
index 543002827d..3ba13d2f44 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
@@ -254,48 +254,16 @@ void nr_emulate_dlsch_payload(uint8_t* pdu, uint16_t size) {
*(pdu+i) = (uint8_t)rand();
}
-int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
-
- uint16_t i;
- int16_t first_free_index=-1;
-
- AssertFatal(gNB!=NULL,"gNB is null\n");
- for (i=0; inumber_of_nr_dlsch_max; i++) {
- AssertFatal(gNB->dlsch[i]!=NULL,"gNB->dlsch[%d] is null\n",i);
- AssertFatal(gNB->dlsch[i][0]!=NULL,"gNB->dlsch[%d][0] is null\n",i);
- LOG_D(PHY,"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,
- gNB->dlsch[i][0]->harq_mask,gNB->dlsch[i][0]->rnti,first_free_index);
- if ((gNB->dlsch[i][0]->harq_mask >0) &&
- (gNB->dlsch[i][0]->rnti==rnti)) return i;
- else if ((gNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
- }
- if (type == SEARCH_EXIST) return -1;
- if (first_free_index != -1)
- gNB->dlsch[first_free_index][0]->rnti = 0;
- return first_free_index;
-
-}
-
-
-void nr_fill_dlsch(PHY_VARS_gNB *gNB,
- int frame,
- int slot,
+void nr_fill_dlsch(processingData_L1tx_t *msgTx,
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
uint8_t *sdu) {
- nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &pdsch_pdu->pdsch_pdu_rel15;
-
- int dlsch_id = find_nr_dlsch(rel15->rnti,gNB,SEARCH_EXIST);
- AssertFatal( (dlsch_id>=0) && (dlsch_idnumber_of_nr_dlsch_max),
- "illegal or no dlsch_id found!!! rnti %04x dlsch_id %d\n",rel15->rnti,dlsch_id);
- NR_gNB_DLSCH_t *dlsch = gNB->dlsch[dlsch_id][0];
+ NR_gNB_DLSCH_t *dlsch = msgTx->dlsch[msgTx->num_pdsch_slot][0];
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
/// DLSCH struct
memcpy((void*)&harq->pdsch_pdu, (void*)pdsch_pdu, sizeof(nfapi_nr_dl_tti_pdsch_pdu));
- gNB->num_pdsch_rnti[slot]++;
+ msgTx->num_pdsch_slot++;
AssertFatal(sdu!=NULL,"sdu is null\n");
harq->pdu = sdu;
-
-
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_prach_common.c b/openair1/PHY/NR_TRANSPORT/nr_prach_common.c
index a95c519d43..84118e8267 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_prach_common.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_prach_common.c
@@ -37,7 +37,6 @@
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h"
#include "T.h"
diff --git a/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c b/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
index e535286084..aa51f23cb6 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_tbs_tools.c
@@ -46,11 +46,11 @@ uint32_t nr_get_E(uint32_t G, uint8_t C, uint8_t Qm, uint8_t Nl, uint8_t r) {
AssertFatal(Nl>0,"Nl is 0\n");
AssertFatal(Qm>0,"Qm is 0\n");
- LOG_D(PHY,"nr_get_E : (G %d, C %d, Qm %d, Nl %d, r %d)\n",G, C, Qm, Nl, r);
if (r <= Cprime - ((G/(Nl*Qm))%Cprime) - 1)
E = Nl*Qm*(G/(Nl*Qm*Cprime));
else
E = Nl*Qm*((G/(Nl*Qm*Cprime))+1);
+ LOG_D(PHY,"nr_get_E : (G %d, C %d, Qm %d, Nl %d, r %d), E %d\n",G, C, Qm, Nl, r, E);
return E;
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
index 54188d22c0..4fed3a468f 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
@@ -35,7 +35,6 @@
#include "PHY/defs_nr_common.h"
#include "PHY/defs_gNB.h"
-#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#define NR_PBCH_PDU_BITS 24
@@ -140,6 +139,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
*/
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
NR_gNB_PUSCH *pusch_vars,
+ int slot,
unsigned char symbol,
uint8_t is_dmrs_symbol,
nfapi_nr_pusch_pdu_t *pusch_pdu,
@@ -314,6 +314,7 @@ int nr_find_pucch(uint16_t rnti,
void init_prach_list(PHY_VARS_gNB *gNB);
void init_prach_ru_list(RU_t *ru);
void free_nr_ru_prach_entry(RU_t *ru, int prach_id);
+uint8_t get_nr_prach_duration(uint8_t prach_format);
void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
int16_t amp,
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
index 53ff90404b..4278338dbc 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
@@ -137,27 +137,24 @@ void nr_ulsch_unscrambling_optim(int16_t* llr,
#endif
}
-#define STATSTRLEN 16384
void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
- char output[16384];
- int stroff=0;
-
for (int i=0;inumber_of_nr_ulsch_max;i++) {
- if (gNB->ulsch_stats[i].rnti>0) {
+
+ if (gNB->ulsch_stats[i].rnti>0 && gNB->ulsch_stats[i].frame != gNB->ulsch_stats[i].dump_frame) {
+ gNB->ulsch_stats[i].dump_frame = gNB->ulsch_stats[i].frame;
for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
- if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
- gNB->ulsch_stats[i].rnti,
+ if (aa==0) fprintf(fd,"ULSCH RNTI %4x, %d.%d: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d, sync_pos %d\n",
+ gNB->ulsch_stats[i].rnti,gNB->ulsch_stats[i].frame,gNB->ulsch_stats[i].dump_frame,
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
- aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
- else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
+ aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10,
+ gNB->ulsch_stats[i].sync_pos);
+ else fprintf(fd," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
- AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
-
- stroff+=sprintf(output+stroff," round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d\n",
+ fprintf(fd," round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d, DTX %d, current_Qm %d, current_RI %d, total_bytes RX/SCHED %d/%d\n",
gNB->ulsch_stats[i].round_trials[0],
(double)gNB->ulsch_stats[i].round_trials[1]/gNB->ulsch_stats[i].round_trials[0],
gNB->ulsch_stats[i].round_trials[1],
@@ -165,14 +162,13 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
gNB->ulsch_stats[i].round_trials[2],
(double)gNB->ulsch_stats[i].round_trials[3]/gNB->ulsch_stats[i].round_trials[0],
gNB->ulsch_stats[i].round_trials[3],
- gNB->ulsch_stats[i].DTX,
+ gNB->ulsch_stats[i].DTX,
gNB->ulsch_stats[i].current_Qm,
gNB->ulsch_stats[i].current_RI,
gNB->ulsch_stats[i].total_bytes_rx,
gNB->ulsch_stats[i].total_bytes_tx);
}
}
- fprintf(fd,"%s",output);
}
void clear_pusch_stats(PHY_VARS_gNB *gNB) {
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
index 7f51c3e488..5286fe8780 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_decoding.c
@@ -178,8 +178,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
ulsch->harq_processes[i]->rar_alloc=0;
ulsch->harq_processes[i]->status=NR_SCH_IDLE;
ulsch->harq_processes[i]->subframe_scheduling_flag=0;
- ulsch->harq_processes[i]->phich_active=0;
- ulsch->harq_processes[i]->phich_ACK=0;
ulsch->harq_processes[i]->previous_first_rb=0;
ulsch->harq_processes[i]->handled=0;
ulsch->harq_processes[i]->delta_TF=0;
@@ -266,8 +264,8 @@ void nr_processULSegment(void* arg) {
int max_ldpc_iterations = p_decoderParms->numMaxIter;
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
- int16_t z [68*384];
- int8_t l [68*384];
+ int16_t z [68*384 + 16] __attribute__ ((aligned(16)));
+ int8_t l [68*384 + 16] __attribute__ ((aligned(16)));
__m128i *pv = (__m128i*)&z;
__m128i *pl = (__m128i*)&l;
@@ -328,7 +326,7 @@ void nr_processULSegment(void* arg) {
ulsch_harq->e[r],
ulsch_harq->C,
rv_index,
- (ulsch_harq->round==0)?1:0,
+ ulsch_harq->new_rx,
E,
ulsch_harq->F,
Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) {
@@ -389,9 +387,10 @@ void nr_processULSegment(void* arg) {
if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) {
#ifdef PRINT_CRC_CHECK
- LOG_I(PHY, "Segment %d CRC OK\n",r);
+ LOG_I(PHY, "Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations);
#endif
rdata->decodeIterations = no_iteration_ldpc;
+ if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--;
} else {
#ifdef PRINT_CRC_CHECK
LOG_I(PHY, "CRC NOK\n");
@@ -466,9 +465,22 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
harq_process->TBS = pusch_pdu->pusch_data.tb_size;
harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index];
+ harq_process->new_rx = false; // flag to indicate if this is a new reception for this harq (initialized to false)
+ if (harq_process->round == 0) {
+ harq_process->new_rx = true;
+ harq_process->ndi = pusch_pdu->pusch_data.new_data_indicator;
+ }
+
+ // this happens if there was a DTX in round 0
+ if (harq_process->ndi != pusch_pdu->pusch_data.new_data_indicator) {
+ harq_process->new_rx = true;
+ harq_process->ndi = pusch_pdu->pusch_data.new_data_indicator;
+ LOG_E(PHY,"Missed ULSCH detection. NDI toggled but rv %d does not correspond to first reception\n",pusch_pdu->pusch_data.rv_index);
+ }
+
A = (harq_process->TBS)<<3;
- LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers);
+ LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers, R);
if (R<1024)
Coderate = (float) R /(float) 1024;
@@ -514,13 +526,14 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
}
}
if (stats) {
+ stats->frame = frame;
stats->rnti = ulsch->rnti;
stats->round_trials[harq_process->round]++;
for (int aarx=0;aarxnb_antennas_rx;aarx++) {
stats->power[aarx]=dB_fixed_x10(pusch->ulsch_power[aarx]);
stats->noise_power[aarx]=dB_fixed_x10(pusch->ulsch_noise_power[aarx]);
}
- if (harq_process->round == 0) {
+ if (harq_process->new_rx == 0) {
stats->current_Qm = Qm;
stats->current_RI = n_layers;
stats->total_bytes_tx += harq_process->TBS;
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
index 0531a8b98f..28dd5ab219 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
@@ -304,6 +304,7 @@ void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
NR_gNB_PUSCH *pusch_vars,
+ int slot,
unsigned char symbol,
uint8_t is_dmrs_symbol,
nfapi_nr_pusch_pdu_t *pusch_pdu,
@@ -320,7 +321,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
int16_t *rxF,*rxF_ext;
int *ul_ch0,*ul_ch0_ext;
uint8_t delta = 0;
-
+ int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
#ifdef DEBUG_RB_EXT
printf("--------------------symbol = %d-----------------------\n", symbol);
@@ -339,7 +340,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
- rxF = (int16_t *)&rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size];
+ rxF = (int16_t *)&rxdataF[aarx][soffset+(symbol * frame_parms->ofdm_symbol_size)];
rxF_ext = (int16_t *)&pusch_vars->rxdataF_ext[aarx][symbol * nb_re_pusch2]; // [hna] rxdataF_ext isn't contiguous in order to solve an alignment problem ib llr computation in case of mod_order = 4, 6
ul_ch0 = &pusch_vars->ul_ch_estimates[aarx][pusch_vars->dmrs_symbol*frame_parms->ofdm_symbol_size]; // update channel estimates if new dmrs symbol are available
@@ -581,22 +582,29 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
unsigned short nb_rb,
unsigned char output_shift) {
+#ifdef __AVX2__
+ int off = ((nb_rb&1) == 1)? 4:0;
+#else
+ int off = 0;
+#endif
#ifdef DEBUG_CH_COMP
int16_t *rxF, *ul_ch;
int prnt_idx;
- rxF = (int16_t *)&rxdataF_ext[0][symbol*(off+(nb_rb*12))];
- ul_ch = (int16_t *)&ul_ch_estimates_ext[0][symbol*(off+(nb_rb*1))2];
+ for (int ant=0; antnb_antennas_rx; ant++) {
+ rxF = (int16_t *)&rxdataF_ext[ant][symbol*(off+(nb_rb*12))];
+ ul_ch = (int16_t *)&ul_ch_estimates_ext[ant][symbol*(off+(nb_rb*12))];
- printf("--------------------symbol = %d, mod_order = %d, output_shift = %d-----------------------\n", symbol, mod_order, output_shift);
- printf("----------------Before compensation------------------\n");
+ printf("--------------------symbol = %d, mod_order = %d, output_shift = %d-----------------------\n", symbol, mod_order, output_shift);
+ printf("----------------Before compensation------------------\n");
- for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx+=2){
+ for (prnt_idx=0;prnt_idx<12*5*2;prnt_idx+=2){
- printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
- printf("ul_ch[%d] = (%d,%d)\n", prnt_idx>>1, ul_ch[prnt_idx],ul_ch[prnt_idx+1]);
+ printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
+ printf("ul_ch[%d] = (%d,%d)\n", prnt_idx>>1, ul_ch[prnt_idx],ul_ch[prnt_idx+1]);
+ }
}
#endif
@@ -606,25 +614,21 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
int print_idx;
- ch_mag = (int16_t *)&ul_ch_mag[0][symbol*(off+(nb_rb*12))];
+ for (int ant=0; antnb_antennas_rx; ant++) {
+ ch_mag = (int16_t *)&ul_ch_mag[ant][symbol*(off+(nb_rb*12))];
- printf("--------------------symbol = %d, mod_order = %d-----------------------\n", symbol, mod_order);
- printf("----------------Before computation------------------\n");
+ printf("--------------------symbol = %d, mod_order = %d-----------------------\n", symbol, mod_order);
+ printf("----------------Before computation------------------\n");
- for (print_idx=0;print_idx<50;print_idx++){
+ for (print_idx=0;print_idx<5;print_idx++){
- printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
+ printf("ch_mag[%d] = %d\n", print_idx, ch_mag[print_idx]);
+ }
}
#endif
-#ifdef __AVX2__
- int off = ((nb_rb&1) == 1)? 4:0;
-#else
- int off = 0;
-#endif
-
#if defined(__i386) || defined(__x86_64__)
unsigned short rb;
@@ -1067,14 +1071,16 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
#ifdef DEBUG_CH_COMP
- rxF = (int16_t *)&rxdataF_comp[0][(symbol*(off+(nb_rb*12)))];
+ for (int ant=0; antnb_antennas_rx; ant++) {
+ rxF = (int16_t *)&rxdataF_comp[ant][(symbol*(off+(nb_rb*12)))];
- printf("----------------After compansation------------------\n");
+ printf("----------------After compansation------------------\n");
- for (prnt_idx=0;prnt_idx<12*nb_rb*2;prnt_idx+=2){
+ for (prnt_idx=0;prnt_idx<12*5*2;prnt_idx+=2){
- printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
+ printf("rxF[%d] = (%d,%d)\n", prnt_idx>>1, rxF[prnt_idx],rxF[prnt_idx+1]);
+ }
}
#endif
@@ -1082,14 +1088,16 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
#ifdef DEBUG_CH_MAG
- ch_mag = (int16_t *)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))];
+ for (int ant=0; antnb_antennas_rx; ant++) {
+ ch_mag = (int16_t *)&ul_ch_mag[ant][(symbol*(off+(nb_rb*12)))];
- printf("----------------After computation------------------\n");
+ printf("----------------After computation------------------\n");
- for (print_idx=0;print_idx<12*nb_rb*2;print_idx+=2){
+ for (print_idx=0;print_idx<12*5*2;print_idx+=2){
- printf("ch_mag[%d] = (%d,%d)\n", print_idx>>1, ch_mag[print_idx],ch_mag[print_idx+1]);
+ printf("ch_mag[%d] = (%d,%d)\n", print_idx>>1, ch_mag[print_idx],ch_mag[print_idx+1]);
+ }
}
#endif
@@ -1124,13 +1132,13 @@ void nr_ulsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
rxdataF_comp128[aa] = (__m128i *)&rxdataF_comp[aa][(symbol*(nb_re + off))];
ul_ch_mag128[aa] = (__m128i *)&ul_ch_mag[aa][(symbol*(nb_re + off))];
ul_ch_mag128b[aa] = (__m128i *)&ul_ch_magb[aa][(symbol*(nb_re + off))];
-
+ }
+ for (int aa=1;aanb_antennas_rx;aa++) {
// MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
for (i=0; ipusch_vars[ulsch_id]->cl_done = 0;
bwp_start_subcarrier = ((rel15_ul->rb_start + rel15_ul->bwp_start)*NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
- LOG_D(PHY,"bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
- LOG_D(PHY,"ul_dmrs_symb_pos %x\n",rel15_ul->ul_dmrs_symb_pos);
+ LOG_D(PHY,"pusch %d.%d : bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", frame,slot,bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
+ LOG_D(PHY,"pusch %d.%d : ul_dmrs_symb_pos %x\n",frame,slot,rel15_ul->ul_dmrs_symb_pos);
//----------------------------------------------------------
//--------------------- Channel estimation ---------------------
@@ -1257,6 +1265,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
start_meas(&gNB->ulsch_rbs_extraction_stats);
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
gNB->pusch_vars[ulsch_id],
+ slot,
symbol,
dmrs_symbol_flag,
rel15_ul,
@@ -1289,7 +1298,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
for (aarx=0;aarxnb_antennas_rx;aarx++)
avgs = cmax(avgs,avg[aatx*frame_parms->nb_antennas_rx+aarx]);
- gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
+ gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+2;
gNB->pusch_vars[ulsch_id]->cl_done = 1;
}
@@ -1297,6 +1306,7 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
//--------------------- Channel Compensation ---------------
//----------------------------------------------------------
start_meas(&gNB->ulsch_channel_compensation_stats);
+ LOG_D(PHY,"Doing channel compensations log2_maxh %d, avgs %d (%d,%d)\n",gNB->pusch_vars[ulsch_id]->log2_maxh,avgs,avg[0],avg[1]);
nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
@@ -1315,8 +1325,8 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
start_meas(&gNB->ulsch_mrc_stats);
nr_ulsch_detection_mrc(frame_parms,
gNB->pusch_vars[ulsch_id]->rxdataF_comp,
- gNB->pusch_vars[ulsch_id]->ul_ch_mag,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb,
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
symbol,
rel15_ul->rb_size);
stop_meas(&gNB->ulsch_mrc_stats);
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index e3b87ff233..cdc6825d4c 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -170,7 +170,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
int32_t **rxdataF = gNB->common_vars.rxdataF;
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
-
+ int soffset=(slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
int nr_sequences;
const uint8_t *mcs;
@@ -206,7 +206,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
nr_sequences=8>>(1-pucch_pdu->sr_flag);
}
- LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, O_ACK %d, O_SR %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,mcs[0]);
+ LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, O_ACK %d, O_SR %d, mcs %d initial_cyclic_shift %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,mcs[0],pucch_pdu->initial_cyclic_shift);
int cs_ind = get_pucch0_cs_lut_index(gNB,pucch_pdu);
/*
@@ -238,7 +238,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
// x_n contains the sequence r_u_v_alpha_delta(n)
- int n,i,l;
+ int n,i;
int prb_offset[2] = {pucch_pdu->bwp_start+pucch_pdu->prb_start, pucch_pdu->bwp_start+pucch_pdu->prb_start};
nr_group_sequence_hopping(pucch_GroupHopping,pucch_pdu->hopping_id,0,slot,&u[0],&v[0]); // calculating u and v value first hop
@@ -251,6 +251,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
prb_offset[1] = pucch_pdu->bwp_start+pucch_pdu->second_hop_prb;
}
+
AssertFatal(pucch_pdu->nr_of_symbols < 3,"nr_of_symbols %d not allowed\n",pucch_pdu->nr_of_symbols);
uint32_t re_offset[2]={0,0};
uint8_t l2;
@@ -261,106 +262,143 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
x_re[1] = table_5_2_2_2_2_Re[u[1]];
x_im[1] = table_5_2_2_2_2_Im[u[1]];
- int16_t xr[2][24] __attribute__((aligned(32)));
- int64_t xrtmag=0;
+ int16_t xr[1+frame_parms->nb_antennas_rx][1+pucch_pdu->nr_of_symbols][24] __attribute__((aligned(32)));
+ int64_t xrtmag=0,xrtmag_next=0;
uint8_t maxpos=0;
uint8_t index=0;
- memset((void*)xr[0],0,24*sizeof(int16_t));
- memset((void*)xr[1],0,24*sizeof(int16_t));
+ for (int l=0; lnr_of_symbols; l++) {
+ for (int aarx=0;aarxnb_antennas_rx;aarx++) {
+ memset((void*)xr[aarx][l],0,24*sizeof(int16_t));
+ }
+ }
int n2;
- for (l=0; lnr_of_symbols; l++) {
+ for (int l=0; lnr_of_symbols; l++) {
l2 = l+pucch_pdu->start_symbol_index;
re_offset[l] = (12*prb_offset[l]) + frame_parms->first_carrier_offset;
if (re_offset[l]>= frame_parms->ofdm_symbol_size)
re_offset[l]-=frame_parms->ofdm_symbol_size;
AssertFatal(re_offset[l]+12 < frame_parms->ofdm_symbol_size,"pucch straddles DC carrier, handle this!\n");
-
- int16_t *r=(int16_t*)&rxdataF[0][(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
- n2=0;
- for (n=0;n<12;n++,n2+=2) {
- xr[l][n2] =(int16_t)(((int32_t)x_re[l][n]*r[n2]+(int32_t)x_im[l][n]*r[n2+1])>>15);
- xr[l][n2+1]=(int16_t)(((int32_t)x_re[l][n]*r[n2+1]-(int32_t)x_im[l][n]*r[n2])>>15);
+ int16_t *r;
+ for (int aa=0;aanb_antennas_rx;aa++) {
+ r=(int16_t*)&rxdataF[aa][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[l]];
+ n2=0;
+ for (n=0;n<12;n++,n2+=2) {
+ xr[aa][l][n2] +=(int16_t)(((int32_t)x_re[l][n]*r[n2]+(int32_t)x_im[l][n]*r[n2+1])>>15);
+ xr[aa][l][n2+1]+=(int16_t)(((int32_t)x_re[l][n]*r[n2+1]-(int32_t)x_im[l][n]*r[n2])>>15);
#ifdef DEBUG_NR_PUCCH_RX
- printf("x (%d,%d), r%d.%d (%d,%d), xr (%d,%d)\n",
- x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[l][n2],xr[l][n2+1]);
+ printf("x (%d,%d), r%d.%d (%d,%d), xr (%d,%d)\n",
+ x_re[l][n],x_im[l][n],l2,re_offset[l],r[n2],r[n2+1],xr[aa][l][n2],xr[aa][l][n2+1]);
#endif
+ }
}
}
- int32_t corr_re[2];
- int32_t corr_im[2];
-
+ int32_t corr_re[1+frame_parms->nb_antennas_rx][2];
+ int32_t corr_im[1+frame_parms->nb_antennas_rx][2];
+ //int32_t no_corr = 0;
int seq_index;
int64_t temp;
- int64_t av_corr=0;
for(i=0;inr_of_symbols;l++) {
- corr_re[l]=0;
- corr_im[l]=0;
+
+ for (int l=0;lnr_of_symbols;l++) {
seq_index = (pucch_pdu->initial_cyclic_shift+
mcs[i]+
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
#ifdef DEBUG_NR_PUCCH_RX
printf("PUCCH symbol %d seq %d, seq_index %d, mcs %d\n",l,i,seq_index,mcs[i]);
#endif
- n2=0;
- for (n=0;n<12;n++,n2+=2) {
- corr_re[l]+=(xr[l][n2]*idft12_re[seq_index][n]+xr[l][n2+1]*idft12_im[seq_index][n])>>15;
- corr_im[l]+=(xr[l][n2]*idft12_im[seq_index][n]-xr[l][n2+1]*idft12_re[seq_index][n])>>15;
+ for (int aa=0;aanb_antennas_rx;aa++) {
+ corr_re[aa][l]=0;
+ corr_im[aa][l]=0;
+
+ n2=0;
+ for (n=0;n<12;n++,n2+=2) {
+ corr_re[aa][l]+=(xr[aa][l][n2]*idft12_re[seq_index][n]+xr[aa][l][n2+1]*idft12_im[seq_index][n])>>15;
+ corr_im[aa][l]+=(xr[aa][l][n2]*idft12_im[seq_index][n]-xr[aa][l][n2+1]*idft12_re[seq_index][n])>>15;
+ }
}
}
-
-#ifdef DEBUG_NR_PUCCH_RX
- LOG_I(PHY,"PUCCH IDFT = (%d,%d)=>%f\n",corr_re[0],corr_im[0],10*log10((double)corr_re[0]*corr_re[0] + (double)corr_im[0]*corr_im[0]));
- if (l>1) LOG_I(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",mcs[i],seq_index,corr_re[1],corr_im[1],10*log10((double)corr_re[1]*corr_re[1] + (double)corr_im[1]*corr_im[1]));
-#endif
- if (pucch_pdu->freq_hop_flag == 0 && l==1) // non-coherent correlation
- temp=(int64_t)corr_re[0]*corr_re[0] + (int64_t)corr_im[0]*corr_im[0];
- else if (pucch_pdu->freq_hop_flag == 0 && l==2) {
- int64_t corr_re2 = (int64_t)corr_re[0]+corr_re[1];
- int64_t corr_im2 = (int64_t)corr_im[0]+corr_im[1];
- // coherent combining of 2 symbols and then complex modulus for single-frequency case
- temp=corr_re2*corr_re2 + corr_im2*corr_im2;
- }
- else if (pucch_pdu->freq_hop_flag == 1)
+ LOG_D(PHY,"PUCCH IDFT[%d/%d] = (%d,%d)=>%f\n",
+ mcs[i],seq_index,corr_re[0][0],corr_im[0][0],
+ 10*log10((double)corr_re[0][0]*corr_re[0][0] + (double)corr_im[0][0]*corr_im[0][0]));
+ if (pucch_pdu->nr_of_symbols==2)
+ LOG_D(PHY,"PUCCH 2nd symbol IDFT[%d/%d] = (%d,%d)=>%f\n",
+ mcs[i],seq_index,corr_re[0][1],corr_im[0][1],
+ 10*log10((double)corr_re[0][1]*corr_re[0][1] + (double)corr_im[0][1]*corr_im[0][1]));
+ if (pucch_pdu->freq_hop_flag == 0) {
+ if (pucch_pdu->nr_of_symbols==1) {// non-coherent correlation
+ temp=0;
+ for (int aa=0;aanb_antennas_rx;aa++)
+ temp+=(int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0];
+ } else {
+ int64_t corr_re2=0;
+ int64_t corr_im2=0;
+ temp=0;
+ for (int aa=0;aanb_antennas_rx;aa++) {
+ corr_re2 = (int64_t)corr_re[aa][0]+corr_re[aa][1];
+ corr_im2 = (int64_t)corr_im[aa][0]+corr_im[aa][1];
+ // coherent combining of 2 symbols and then complex modulus for single-frequency case
+ temp+=corr_re2*corr_re2 + corr_im2*corr_im2;
+ }
+ }
+ } else if (pucch_pdu->freq_hop_flag == 1) {
// full non-coherent combining of 2 symbols for frequency-hopping case
- temp = (int64_t)corr_re[0]*corr_re[0] + (int64_t)corr_im[0]*corr_im[0] + (int64_t)corr_re[1]*corr_re[1] + (int64_t)corr_im[1]*corr_im[1];
+ temp=0;
+ for (int aa=0;aanb_antennas_rx;aa++)
+ temp += (int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0] + (int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1];
+ }
else AssertFatal(1==0,"shouldn't happen\n");
- av_corr+=temp;
if (temp>xrtmag) {
+ xrtmag_next = xrtmag;
xrtmag=temp;
+ LOG_D(PHY,"Sequence %d xrtmag %ld xrtmag_next %ld\n", i, xrtmag, xrtmag_next);
maxpos=i;
- uci_stats->current_pucch0_stat0 = dB_fixed64((int64_t)corr_re[0]*corr_re[0] + (int64_t)corr_im[0]*corr_im[0]);
- if (l==2) uci_stats->current_pucch0_stat1 = dB_fixed64((int64_t)corr_re[1]*corr_re[1] + (int64_t)corr_im[1]*corr_im[1]);
+ uci_stats->current_pucch0_stat0 = 0;
+ int64_t temp2=0,temp3=0;;
+ for (int aa=0;aanb_antennas_rx;aa++) {
+ temp2 += ((int64_t)corr_re[aa][0]*corr_re[aa][0] + (int64_t)corr_im[aa][0]*corr_im[aa][0]);
+ if (pucch_pdu->nr_of_symbols==2)
+ temp3 += ((int64_t)corr_re[aa][1]*corr_re[aa][1] + (int64_t)corr_im[aa][1]*corr_im[aa][1]);
+ }
+ uci_stats->current_pucch0_stat0= dB_fixed64(temp2);
+ if ( pucch_pdu->nr_of_symbols==2)
+ uci_stats->current_pucch0_stat1= dB_fixed64(temp3);
}
+ else if (temp>xrtmag_next)
+ xrtmag_next = temp;
}
- av_corr/=nr_sequences/l;
-
- uint8_t xrtmag_dB = dB_fixed64(xrtmag);
-
+ int xrtmag_dBtimes10 = 10*(int)dB_fixed64(xrtmag/(12*pucch_pdu->nr_of_symbols));
+ int xrtmag_next_dBtimes10 = 10*(int)dB_fixed64(xrtmag_next/(12*pucch_pdu->nr_of_symbols));
#ifdef DEBUG_NR_PUCCH_RX
printf("PUCCH 0 : maxpos %d\n",maxpos);
#endif
index=maxpos;
-
+ uci_stats->pucch0_n00 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]];
+ uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]];
+ LOG_D(PHY,"n00[%d] = %d, n01[%d] = %d\n",prb_offset[0],uci_stats->pucch0_n00,prb_offset[1],uci_stats->pucch0_n01);
// estimate CQI for MAC (from antenna port 0 only)
int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01;
- int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset[0]],12)) - (10*max_n0);
+ int SNRtimes10,sigenergy=0;
+ for (int aa=0;aanb_antennas_rx;aa++)
+ sigenergy += signal_energy_nodc(&rxdataF[aa][soffset+
+ (pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size)+
+ re_offset[0]],12);
+ SNRtimes10 = xrtmag_dBtimes10-(10*max_n0);
int cqi;
if (SNRtimes10 < -640) cqi=0;
else if (SNRtimes10 > 635) cqi=255;
else cqi=(640+SNRtimes10)/5;
- uci_stats->pucch0_thres = gNB->pucch0_thres + (10*max_n0);
+ uci_stats->pucch0_thres = gNB->pucch0_thres; /* + (10*max_n0);*/
bool no_conf=false;
if (nr_sequences>1) {
- if (10*xrtmag_dB < uci_stats->pucch0_thres)
+ if (xrtmag_dBtimes10 < (50+xrtmag_next_dBtimes10) || SNRtimes10 < uci_stats->pucch0_thres)
no_conf=true;
}
gNB->bad_pucch += no_conf;
@@ -370,16 +408,14 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu->rnti = pucch_pdu->rnti;
uci_pdu->ul_cqi = cqi;
uci_pdu->timing_advance = 0xffff; // currently not valid
- uci_pdu->rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset[0]],12)));
+ uci_pdu->rssi = 1280 - (10*dB_fixed(32767*32767))-dB_fixed_times10(sigenergy);
- uci_stats->pucch0_n00 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[0]];
- uci_stats->pucch0_n01 = gNB->measurements.n0_subband_power_tot_dB[prb_offset[1]];
if (pucch_pdu->bit_len_harq==0) {
uci_pdu->harq = NULL;
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_confidence_level = no_conf ? 1 : 0;
uci_stats->pucch0_sr_trials++;
- if (xrtmag_dB>(gNB->measurements.n0_power_tot_dB)) {
+ if (xrtmag_dBtimes10>(10*gNB->measurements.n0_power_tot_dB)) {
uci_pdu->sr->sr_indication = 1;
uci_stats->pucch0_positive_SR++;
} else {
@@ -392,8 +428,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu->harq->harq_confidence_level = no_conf ? 1 : 0;
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
uci_pdu->harq->harq_list[0].harq_value = index&0x01;
- LOG_D(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d n0 %d pucch0_thres %d\n",
- slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dB,max_n0,uci_stats->pucch0_thres);
+ LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ value %d with confidence level (0 is good, 1 is bad) %d xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d, energy %f, sync_pos %d\n",
+ frame,slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,10*log10((double)sigenergy),gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_indication = (index>1) ? 1 : 0;
@@ -409,8 +445,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
uci_pdu->harq->harq_list[1].harq_value = index&0x01;
uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01;
- LOG_D(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d\n",
- slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dB);
+ LOG_D(PHY, "[DLSCH/PDSCH/PUCCH] %d.%d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d, xrt_mag %d xrt_mag_next %d n0 %d (%d,%d) pucch0_thres %d, cqi %d, SNRtimes10 %d,sync_pos %d\n",
+ frame,slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level,xrtmag_dBtimes10,xrtmag_next_dBtimes10,max_n0,uci_stats->pucch0_n00,uci_stats->pucch0_n01,uci_stats->pucch0_thres,cqi,SNRtimes10,gNB->ulsch_stats[0].sync_pos);
if (pucch_pdu->sr_flag == 1) {
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
uci_pdu->sr->sr_indication = (index>3) ? 1 : 0;
@@ -445,6 +481,7 @@ void nr_decode_pucch1( int32_t **rxdataF,
* Implement TS 38.211 Subclause 6.3.2.4.1 Sequence modulation
*
*/
+ int soffset = (nr_tti_tx&3)*frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size;
// complex-valued symbol d_re, d_im containing complex-valued symbol d(0):
int16_t d_re=0, d_im=0,d1_re=0,d1_im=0;
#ifdef DEBUG_NR_PUCCH_RX
@@ -539,23 +576,23 @@ void nr_decode_pucch1( int32_t **rxdataF,
}
if (l%2 == 1) { // mapping PUCCH according to TS38.211 subclause 6.4.1.3.1
- z_re_rx[i+n] = ((int16_t *)&rxdataF[0][re_offset])[0];
- z_im_rx[i+n] = ((int16_t *)&rxdataF[0][re_offset])[1];
+ z_re_rx[i+n] = ((int16_t *)&rxdataF[0][soffset+re_offset])[0];
+ z_im_rx[i+n] = ((int16_t *)&rxdataF[0][soffset+re_offset])[1];
#ifdef DEBUG_NR_PUCCH_RX
printf("\t [nr_generate_pucch1] mapping PUCCH to RE \t amp=%d \tofdm_symbol_size=%d \tN_RB_DL=%d \tfirst_carrier_offset=%d \tz_pucch[%d]=txptr(%u)=(x_n(l=%d,n=%d)=(%d,%d))\n",
amp,frame_parms->ofdm_symbol_size,frame_parms->N_RB_DL,frame_parms->first_carrier_offset,i+n,re_offset,
- l,n,((int16_t *)&rxdataF[0][re_offset])[0],((int16_t *)&rxdataF[0][re_offset])[1]);
+ l,n,((int16_t *)&rxdataF[0][soffset+re_offset])[0],((int16_t *)&rxdataF[0][soffset+re_offset])[1]);
#endif
}
if (l%2 == 0) { // mapping DM-RS signal according to TS38.211 subclause 6.4.1.3.1
- z_dmrs_re_rx[i+n] = ((int16_t *)&rxdataF[0][re_offset])[0];
- z_dmrs_im_rx[i+n] = ((int16_t *)&rxdataF[0][re_offset])[1];
+ z_dmrs_re_rx[i+n] = ((int16_t *)&rxdataF[0][soffset+re_offset])[0];
+ z_dmrs_im_rx[i+n] = ((int16_t *)&rxdataF[0][soffset+re_offset])[1];
// printf("%d\t%d\t%d\n",l,z_dmrs_re_rx[i+n],z_dmrs_im_rx[i+n]);
#ifdef DEBUG_NR_PUCCH_RX
printf("\t [nr_generate_pucch1] mapping DM-RS to RE \t amp=%d \tofdm_symbol_size=%d \tN_RB_DL=%d \tfirst_carrier_offset=%d \tz_dm-rs[%d]=txptr(%u)=(x_n(l=%d,n=%d)=(%d,%d))\n",
amp,frame_parms->ofdm_symbol_size,frame_parms->N_RB_DL,frame_parms->first_carrier_offset,i+n,re_offset,
- l,n,((int16_t *)&rxdataF[0][re_offset])[0],((int16_t *)&rxdataF[0][re_offset])[1]);
+ l,n,((int16_t *)&rxdataF[0][soffset+re_offset])[0],((int16_t *)&rxdataF[0][soffset+re_offset])[1]);
#endif
// printf("l=%d\ti=%d\tre_offset=%d\treceived dmrs re=%d\tim=%d\n",l,i,re_offset,z_dmrs_re_rx[i+n],z_dmrs_im_rx[i+n]);
}
@@ -1081,85 +1118,109 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
//extract pucch and dmrs first
int l2=pucch_pdu->start_symbol_index;
- int re_offset = (12*pucch_pdu->prb_start) + (12*pucch_pdu->bwp_start) + frame_parms->first_carrier_offset;
- if (re_offset>= frame_parms->ofdm_symbol_size)
- re_offset-=frame_parms->ofdm_symbol_size;
-
+ int re_offset[2];
+ re_offset[0] = 12*(pucch_pdu->prb_start+pucch_pdu->bwp_start) + frame_parms->first_carrier_offset;
+ int soffset=(slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
+
+ if (re_offset[0]>= frame_parms->ofdm_symbol_size)
+ re_offset[0]-=frame_parms->ofdm_symbol_size;
+ if (pucch_pdu->freq_hop_flag == 0) re_offset[1] = re_offset[0];
+ else {
+ re_offset[1] = 12*(pucch_pdu->second_hop_prb+pucch_pdu->bwp_start) + frame_parms->first_carrier_offset;
+ if (re_offset[1]>= frame_parms->ofdm_symbol_size)
+ re_offset[1]-=frame_parms->ofdm_symbol_size;
+ }
AssertFatal(pucch_pdu->prb_size*pucch_pdu->nr_of_symbols > 1,"number of PRB*SYMB (%d,%d)< 2",
pucch_pdu->prb_size,pucch_pdu->nr_of_symbols);
int Prx = gNB->gNB_config.carrier_config.num_rx_ant.value;
int Prx2 = (Prx==1)?2:Prx;
// use 2 for Nb antennas in case of single antenna to allow the following allocations
- int16_t r_re_ext[Prx2][8*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
- int16_t r_im_ext[Prx2][8*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
- int16_t r_re_ext2[Prx2][8*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
- int16_t r_im_ext2[Prx2][8*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
- int16_t rd_re_ext[Prx2][4*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
- int16_t rd_im_ext[Prx2][4*pucch_pdu->nr_of_symbols*pucch_pdu->prb_size] __attribute__((aligned(32)));
+ int prb_size_ext = pucch_pdu->prb_size+(pucch_pdu->prb_size&1);
+ int16_t r_re_ext[Prx2][2][8*prb_size_ext] __attribute__((aligned(32)));
+ int16_t r_im_ext[Prx2][2][8*prb_size_ext] __attribute__((aligned(32)));
+ int16_t r_re_ext2[Prx2][2][8*prb_size_ext] __attribute__((aligned(32)));
+ int16_t r_im_ext2[Prx2][2][8*prb_size_ext] __attribute__((aligned(32)));
+ int16_t rd_re_ext[Prx2][2][4*prb_size_ext] __attribute__((aligned(32)));
+ int16_t rd_im_ext[Prx2][2][4*prb_size_ext] __attribute__((aligned(32)));
int16_t *r_re_ext_p,*r_im_ext_p,*rd_re_ext_p,*rd_im_ext_p;
int nb_re_pucch = 12*pucch_pdu->prb_size;
- int16_t rp[Prx2][nb_re_pucch*2],*tmp_rp;
+ int16_t rp[Prx2][2][nb_re_pucch*2],*tmp_rp;
__m64 dmrs_re,dmrs_im;
for (int aa=0;aaofdm_symbol_size]);
+ for (int symb=0;symbnr_of_symbols;symb++) {
+ tmp_rp = ((int16_t *)&rxdataF[aa][soffset + (l2+symb)*frame_parms->ofdm_symbol_size]);
- if (re_offset + nb_re_pucch < frame_parms->ofdm_symbol_size) {
- memcpy1((void*)rp[aa],(void*)&tmp_rp[re_offset*2],nb_re_pucch*sizeof(int32_t));
- }
- else {
- int neg_length = frame_parms->ofdm_symbol_size-re_offset;
- int pos_length = nb_re_pucch-neg_length;
- memcpy1((void*)rp[aa],(void*)&tmp_rp[re_offset*2],neg_length*sizeof(int32_t));
- memcpy1((void*)&rp[aa][neg_length*2],(void*)tmp_rp,pos_length*sizeof(int32_t));
+ if (re_offset[symb] + nb_re_pucch < frame_parms->ofdm_symbol_size) {
+ memcpy1((void*)rp[aa][symb],(void*)&tmp_rp[re_offset[symb]*2],nb_re_pucch*sizeof(int32_t));
+ }
+ else {
+ int neg_length = frame_parms->ofdm_symbol_size-re_offset[symb];
+ int pos_length = nb_re_pucch-neg_length;
+ memcpy1((void*)rp[aa][symb],(void*)&tmp_rp[re_offset[symb]*2],neg_length*sizeof(int32_t));
+ memcpy1((void*)&rp[aa][symb][neg_length*2],(void*)tmp_rp,pos_length*sizeof(int32_t));
+ }
}
}
-
#ifdef DEBUG_NR_PUCCH_RX
printf("Decoding pucch2 for %d symbols, %d PRB\n",pucch_pdu->nr_of_symbols,pucch_pdu->prb_size);
#endif
int nc_group_size=1; // 2 PRB
- int ngroup = pucch_pdu->prb_size/nc_group_size/2;
- int32_t corr32_re[ngroup][Prx2],corr32_im[ngroup][Prx2];
- for (int aa=0;aanr_of_symbols == 1) {
- AssertFatal((pucch_pdu->prb_size&1) == 0,"prb_size %d is not a multiple of 2\n",pucch_pdu->prb_size);
- // 24 PRBs contains 48x16-bit, so 6x8x16-bit
+ // AssertFatal((pucch_pdu->prb_size&1) == 0,"prb_size %d is not a multiple of 2\n",pucch_pdu->prb_size);
+ if ((pucch_pdu->prb_size&1) > 0) { // if the number of PRBs is odd
+ for (int symb=0; symbnr_of_symbols;symb++) {
+ for (int aa=0;aaprb_size],0,8*pucch_pdu->prb_size*sizeof(int16_t));
+ memset(&r_im_ext[aa][symb][8*pucch_pdu->prb_size],0,8*pucch_pdu->prb_size*sizeof(int16_t));
+ memset(&rd_re_ext[aa][symb][4*pucch_pdu->prb_size],0,8*pucch_pdu->prb_size*sizeof(int16_t));
+ memset(&rd_im_ext[aa][symb][4*pucch_pdu->prb_size],0,8*pucch_pdu->prb_size*sizeof(int16_t));
+ }
+ }
+ }
+ for (int symb=0; symbnr_of_symbols;symb++) {
+ // 24 REs contains 48x16-bit, so 6x8x16-bit
for (int prb=0;prbprb_size;prb+=2) {
for (int aa=0;aa (%d,%d)\n",aa,prb+(i>>2),i,rd_re_ext_p[i],rd_im_ext_p[i]);
- for (int i=0;i<16;i++) printf("Ant %d PRB %d data[%d] -> (%d,%d)\n",aa,prb+(i>>3),i,r_re_ext_p[i],r_im_ext_p[i]);
+ for (int i=0;i<8;i++) printf("Ant %d PRB %d dmrs[%d] -> (%d,%d)\n",aa,prb+(i>>2),i,rd_re_ext_p[i],rd_im_ext_p[i]);
+ for (int i=0;i<16;i++) printf("Ant %d PRB %d data[%d] -> (%d,%d)\n",aa,prb+(i>>3),i,r_re_ext_p[i],r_im_ext_p[i]);
#endif
} // aa
} // prb
-
// first compute DMRS component
+
uint32_t x1, x2, s=0;
- x2 = (((1<<17)*((14*slot) + (pucch_pdu->start_symbol_index) + 1)*((2*pucch_pdu->dmrs_scrambling_id) + 1)) + (2*pucch_pdu->dmrs_scrambling_id))%(1U<<31); // c_init calculation according to TS38.211 subclause
+ x2 = (((1<<17)*((14*slot) + (pucch_pdu->start_symbol_index+symb) + 1)*((2*pucch_pdu->dmrs_scrambling_id) + 1)) + (2*pucch_pdu->dmrs_scrambling_id))%(1U<<31); // c_init calculation according to TS38.211 subclause
#ifdef DEBUG_NR_PUCCH_RX
- printf("slot %d, start_symbol_index %d, dmrs_scrambling_id %d\n",
- slot,pucch_pdu->start_symbol_index,pucch_pdu->dmrs_scrambling_id);
+ printf("slot %d, start_symbol_index %d, symbol %d, dmrs_scrambling_id %d\n",
+ slot,pucch_pdu->start_symbol_index,symb,pucch_pdu->dmrs_scrambling_id);
#endif
int reset = 1;
for (int i=0; i<=(pucch_pdu->prb_start>>2); i++) {
@@ -1174,77 +1235,74 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
dmrs_im = byte2m64_im[((uint8_t*)&s)[(group&1)<<1]];
#ifdef DEBUG_NR_PUCCH_RX
printf("Group %d: s %x x2 %x ((%d,%d),(%d,%d),(%d,%d),(%d,%d))\n",
- group,
- ((uint16_t*)&s)[0],x2,
- ((int16_t*)&dmrs_re)[0],((int16_t*)&dmrs_im)[0],
- ((int16_t*)&dmrs_re)[1],((int16_t*)&dmrs_im)[1],
- ((int16_t*)&dmrs_re)[2],((int16_t*)&dmrs_im)[2],
- ((int16_t*)&dmrs_re)[3],((int16_t*)&dmrs_im)[3]);
+ group,
+ ((uint16_t*)&s)[0],x2,
+ ((int16_t*)&dmrs_re)[0],((int16_t*)&dmrs_im)[0],
+ ((int16_t*)&dmrs_re)[1],((int16_t*)&dmrs_im)[1],
+ ((int16_t*)&dmrs_re)[2],((int16_t*)&dmrs_im)[2],
+ ((int16_t*)&dmrs_re)[3],((int16_t*)&dmrs_im)[3]);
#endif
for (int aa=0;aa>=5;
- corr32_im[group][aa]>>=5;
+ corr32_re[symb][group][aa]+=(rd_re_ext_p[4]*((int16_t*)&dmrs_re)[0] + rd_im_ext_p[4]*((int16_t*)&dmrs_im)[0]);
+ corr32_im[symb][group][aa]+=(-rd_re_ext_p[4]*((int16_t*)&dmrs_im)[0] + rd_im_ext_p[4]*((int16_t*)&dmrs_re)[0]);
+ corr32_re[symb][group][aa]+=(rd_re_ext_p[5]*((int16_t*)&dmrs_re)[1] + rd_im_ext_p[5]*((int16_t*)&dmrs_im)[1]);
+ corr32_im[symb][group][aa]+=(-rd_re_ext_p[5]*((int16_t*)&dmrs_im)[1] + rd_im_ext_p[5]*((int16_t*)&dmrs_re)[1]);
+ corr32_re[symb][group][aa]+=(rd_re_ext_p[6]*((int16_t*)&dmrs_re)[2] + rd_im_ext_p[6]*((int16_t*)&dmrs_im)[2]);
+ corr32_im[symb][group][aa]+=(-rd_re_ext_p[6]*((int16_t*)&dmrs_im)[2] + rd_im_ext_p[6]*((int16_t*)&dmrs_re)[2]);
+ corr32_re[symb][group][aa]+=(rd_re_ext_p[7]*((int16_t*)&dmrs_re)[3] + rd_im_ext_p[7]*((int16_t*)&dmrs_im)[3]);
+ corr32_im[symb][group][aa]+=(-rd_re_ext_p[7]*((int16_t*)&dmrs_im)[3] + rd_im_ext_p[7]*((int16_t*)&dmrs_re)[3]);
+ /* corr32_re[group][aa]>>=5;
+ corr32_im[group][aa]>>=5;*/
#ifdef DEBUG_NR_PUCCH_RX
- printf("Group %d: corr32 (%d,%d)\n",group,corr32_re[group][aa],corr32_im[group][aa]);
+ printf("Group %d: corr32 (%d,%d)\n",group,corr32_re[symb][group][aa],corr32_im[symb][group][aa]);
#endif
} //aa
-
+
if ((group&1) == 1) s = lte_gold_generic(&x1, &x2, 0);
} // group
- }
- else { // 2 symbol case
- AssertFatal(1==0, "Fill in 2 symbol PUCCH2 case\n");
- }
+ } // symb
uint32_t x1, x2, s=0;
// unscrambling
@@ -1253,112 +1311,114 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
#ifdef DEBUG_NR_PUCCH_RX
printf("x2 %x, s %x\n",x2,s);
#endif
- __m64 c_re0,c_im0,c_re1,c_im1,c_re2,c_im2,c_re3,c_im3;
- re_offset=0;
- for (int prb=0;prbprb_size;prb+=2,re_offset+=16) {
- c_re0 = byte2m64_re[((uint8_t*)&s)[0]];
- c_im0 = byte2m64_im[((uint8_t*)&s)[0]];
- c_re1 = byte2m64_re[((uint8_t*)&s)[1]];
- c_im1 = byte2m64_im[((uint8_t*)&s)[1]];
- c_re2 = byte2m64_re[((uint8_t*)&s)[2]];
- c_im2 = byte2m64_im[((uint8_t*)&s)[2]];
- c_re3 = byte2m64_re[((uint8_t*)&s)[3]];
- c_im3 = byte2m64_im[((uint8_t*)&s)[3]];
+ for (int symb=0;symbnr_of_symbols;symb++) {
+ __m64 c_re0,c_im0,c_re1,c_im1,c_re2,c_im2,c_re3,c_im3;
+ int re_off=0;
+ for (int prb=0;prbbit_len_harq+pucch_pdu->sr_flag+pucch_pdu->bit_len_csi_part1+pucch_pdu->bit_len_csi_part2;
AssertFatal(nb_bit > 2 && nb_bit< 65,"illegal length (%d : %d,%d,%d,%d)\n",nb_bit,pucch_pdu->bit_len_harq,pucch_pdu->sr_flag,pucch_pdu->bit_len_csi_part1,pucch_pdu->bit_len_csi_part2);
@@ -1366,15 +1426,17 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
uint8_t corr_dB;
int decoderState=2;
if (nb_bit < 12) { // short blocklength case
- __m256i *rp_re[Prx2];
- __m256i *rp2_re[Prx2];
- __m256i *rp_im[Prx2];
- __m256i *rp2_im[Prx2];
+ __m256i *rp_re[Prx2][2];
+ __m256i *rp2_re[Prx2][2];
+ __m256i *rp_im[Prx2][2];
+ __m256i *rp2_im[Prx2][2];
for (int aa=0;aanr_of_symbols;symb++) {
+ rp_re[aa][symb] = (__m256i*)r_re_ext[aa][symb];
+ rp_im[aa][symb] = (__m256i*)r_im_ext[aa][symb];
+ rp2_re[aa][symb] = (__m256i*)r_re_ext2[aa][symb];
+ rp2_im[aa][symb] = (__m256i*)r_im_ext2[aa][symb];
+ }
}
__m256i prod_re[Prx2],prod_im[Prx2];
uint64_t corr=0;
@@ -1393,76 +1455,91 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
#endif
uint64_t corr_tmp = 0;
- for (int group=0;groupnr_of_symbols;symb++) {
+ for (int group=0;group (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",aa,
- ((int16_t*)&prod_re[aa])[0],((int16_t*)&prod_re[aa])[1],((int16_t*)&prod_re[aa])[2],((int16_t*)&prod_re[aa])[3],
- ((int16_t*)&prod_re[aa])[4],((int16_t*)&prod_re[aa])[5],((int16_t*)&prod_re[aa])[6],((int16_t*)&prod_re[aa])[7],
- ((int16_t*)&prod_re[aa])[8],((int16_t*)&prod_re[aa])[9],((int16_t*)&prod_re[aa])[10],((int16_t*)&prod_re[aa])[11],
- ((int16_t*)&prod_re[aa])[12],((int16_t*)&prod_re[aa])[13],((int16_t*)&prod_re[aa])[14],((int16_t*)&prod_re[aa])[15]);
- printf("prod_im[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)",aa,
- ((int16_t*)&prod_im[aa])[0],((int16_t*)&prod_im[aa])[1],((int16_t*)&prod_im[aa])[2],((int16_t*)&prod_im[aa])[3],
- ((int16_t*)&prod_im[aa])[4],((int16_t*)&prod_im[aa])[5],((int16_t*)&prod_im[aa])[6],((int16_t*)&prod_im[aa])[7],
- ((int16_t*)&prod_im[aa])[8],((int16_t*)&prod_im[aa])[9],((int16_t*)&prod_im[aa])[10],((int16_t*)&prod_im[aa])[11],
- ((int16_t*)&prod_im[aa])[12],((int16_t*)&prod_im[aa])[13],((int16_t*)&prod_im[aa])[14],((int16_t*)&prod_im[aa])[15]);
-
+ printf("prod_re[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\n",aa,
+ ((int16_t*)&prod_re[aa])[0],((int16_t*)&prod_re[aa])[1],((int16_t*)&prod_re[aa])[2],((int16_t*)&prod_re[aa])[3],
+ ((int16_t*)&prod_re[aa])[4],((int16_t*)&prod_re[aa])[5],((int16_t*)&prod_re[aa])[6],((int16_t*)&prod_re[aa])[7],
+ ((int16_t*)&prod_re[aa])[8],((int16_t*)&prod_re[aa])[9],((int16_t*)&prod_re[aa])[10],((int16_t*)&prod_re[aa])[11],
+ ((int16_t*)&prod_re[aa])[12],((int16_t*)&prod_re[aa])[13],((int16_t*)&prod_re[aa])[14],((int16_t*)&prod_re[aa])[15]);
+ printf("prod_im[%d] => (%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d)\n",aa,
+ ((int16_t*)&prod_im[aa])[0],((int16_t*)&prod_im[aa])[1],((int16_t*)&prod_im[aa])[2],((int16_t*)&prod_im[aa])[3],
+ ((int16_t*)&prod_im[aa])[4],((int16_t*)&prod_im[aa])[5],((int16_t*)&prod_im[aa])[6],((int16_t*)&prod_im[aa])[7],
+ ((int16_t*)&prod_im[aa])[8],((int16_t*)&prod_im[aa])[9],((int16_t*)&prod_im[aa])[10],((int16_t*)&prod_im[aa])[11],
+ ((int16_t*)&prod_im[aa])[12],((int16_t*)&prod_im[aa])[13],((int16_t*)&prod_im[aa])[14],((int16_t*)&prod_im[aa])[15]);
+
#endif
- prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1
- prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
- prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
- prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
- prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3+4+5+6+7
- prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
- prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15
- prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
- }
- int64_t corr_re=0,corr_im=0;
+ prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1
+ prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
+ prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
+ prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
+ prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3+4+5+6+7
+ prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
+ prod_re[aa] = _mm256_hadds_epi16(prod_re[aa],prod_re[aa]);// 0+1+2+3+4+5+6+7+8+9+10+11+12+13+14+15
+ prod_im[aa] = _mm256_hadds_epi16(prod_im[aa],prod_im[aa]);
+ }
+ int64_t corr_re=0,corr_im=0;
- for (int aa=0;aa corr) {
- corr = corr_tmp;
- cw_ML=cw;
+ corr = corr_tmp;
+ cw_ML=cw;
}
} // cw loop
corr_dB = dB_fixed64((uint64_t)corr);
+#ifdef DEBUG_NR_PUCCH_RX
+ printf("cw_ML %d, metric %d dB\n",cw_ML,corr_dB);
+#endif
LOG_D(PHY,"cw_ML %d, metric %d dB\n",cw_ML,corr_dB);
decodedPayload[0]=(uint64_t)cw_ML;
}
else { // polar coded case
t_nrPolar_params *currentPtr = nr_polar_params(2,nb_bit,pucch_pdu->prb_size,1,&gNB->uci_polarParams);
- __m64 *rp_re[Prx2];
- __m64 *rp2_re[Prx2];
- __m64 *rp_im[Prx2];
- __m64 *rp2_im[Prx2];
- __m128i llrs[pucch_pdu->prb_size*2];
+ __m64 *rp_re[Prx2][2];
+ __m64 *rp2_re[Prx2][2];
+ __m64 *rp_im[Prx2][2];
+ __m64 *rp2_im[Prx2][2];
+ __m128i llrs[pucch_pdu->prb_size*2*pucch_pdu->nr_of_symbols];
for (int aa=0;aanr_of_symbols;symb++) {
+ rp_re[aa][symb] = (__m64*)r_re_ext[aa][symb];
+ rp_im[aa][symb] = (__m64*)r_im_ext[aa][symb];
+ rp2_re[aa][symb] = (__m64*)r_re_ext2[aa][symb];
+ rp2_im[aa][symb] = (__m64*)r_im_ext2[aa][symb];
+ }
}
__m64 prod_re[Prx2],prod_im[Prx2];
@@ -1482,35 +1559,35 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
int32_t corr_re,corr_im,corr_tmp;
__m128i corr16,llr_num,llr_den;
uint64_t corr = 0;
+ for (int symb=0;symbnr_of_symbols;symb++) {
+ for (int half_prb=0;half_prb<(2*pucch_pdu->prb_size);half_prb++) {
+ llr_num=_mm_set1_epi16(0);llr_den=_mm_set1_epi16(0);
+ for (int cw=0;cw<256;cw++) {
+ corr_tmp=0;
+ for (int aa=0;aa>4],rp_im[aa][symb][half_prb])),5);
+ prod_im[aa] = _mm_srai_pi16(_mm_subs_pi16(_mm_mullo_pi16(pucch2_polar_4bit[cw&15],rp2_im[aa][symb][half_prb]),
+ _mm_mullo_pi16(pucch2_polar_4bit[cw>>4],rp2_re[aa][symb][half_prb])),5);
+ prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1
+ prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
+ prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
+ prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
- for (int half_prb=0;half_prb<(2*pucch_pdu->prb_size);half_prb++) {
- llr_num=_mm_set1_epi16(0);llr_den=_mm_set1_epi16(0);
- for (int cw=0;cw<256;cw++) {
- corr_tmp=0;
- for (int aa=0;aa>4],rp_im[aa][half_prb])),5);
- prod_im[aa] = _mm_srai_pi16(_mm_subs_pi16(_mm_mullo_pi16(pucch2_polar_4bit[cw&15],rp2_im[aa][half_prb]),
- _mm_mullo_pi16(pucch2_polar_4bit[cw>>4],rp2_re[aa][half_prb])),5);
- prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1
- prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
- prod_re[aa] = _mm_hadds_pi16(prod_re[aa],prod_re[aa]);// 0+1+2+3
- prod_im[aa] = _mm_hadds_pi16(prod_im[aa],prod_im[aa]);
-
- // this is for UL CQI measurement
- if (cw==0) corr += ((int64_t)corr32_re[half_prb>>2][aa]*corr32_re[half_prb>>2][aa])+
- ((int64_t)corr32_im[half_prb>>2][aa]*corr32_im[half_prb>>2][aa]);
+ // this is for UL CQI measurement
+ if (cw==0) corr += ((int64_t)corr32_re[symb][half_prb>>2][aa]*corr32_re[symb][half_prb>>2][aa])+
+ ((int64_t)corr32_im[symb][half_prb>>2][aa]*corr32_im[symb][half_prb>>2][aa]);
- corr_re = ( corr32_re[half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_re[aa]))[0]);
- corr_im = ( corr32_im[half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_im[aa]))[0]);
- corr_tmp += corr_re*corr_re + corr_im*corr_im;
-
- LOG_D(PHY,"pucch2 half_prb %d cw %d (%d,%d) aa %d: (%d,%d,%d,%d,%d,%d,%d,%d)x(%d,%d,%d,%d,%d,%d,%d,%d) (%d,%d)+(%d,%d) = (%d,%d) => %d\n",
- half_prb,cw,cw&15,cw>>4,aa,
- ((int16_t*)&pucch2_polar_4bit[cw&15])[0],((int16_t*)&pucch2_polar_4bit[cw>>4])[0],
- ((int16_t*)&pucch2_polar_4bit[cw&15])[1],((int16_t*)&pucch2_polar_4bit[cw>>4])[1],
- ((int16_t*)&pucch2_polar_4bit[cw&15])[2],((int16_t*)&pucch2_polar_4bit[cw>>4])[2],
+ corr_re = ( corr32_re[symb][half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_re[aa]))[0]);
+ corr_im = ( corr32_im[symb][half_prb>>2][aa]/(2*nc_group_size*4/2)+((int16_t*)(&prod_im[aa]))[0]);
+ corr_tmp += corr_re*corr_re + corr_im*corr_im;
+ /*
+ LOG_D(PHY,"pucch2 half_prb %d cw %d (%d,%d) aa %d: (%d,%d,%d,%d,%d,%d,%d,%d)x(%d,%d,%d,%d,%d,%d,%d,%d) (%d,%d)+(%d,%d) = (%d,%d) => %d\n",
+ half_prb,cw,cw&15,cw>>4,aa,
+ ((int16_t*)&pucch2_polar_4bit[cw&15])[0],((int16_t*)&pucch2_polar_4bit[cw>>4])[0],
+ ((int16_t*)&pucch2_polar_4bit[cw&15])[1],((int16_t*)&pucch2_polar_4bit[cw>>4])[1],
+ ((int16_t*)&pucch2_polar_4bit[cw&15])[2],((int16_t*)&pucch2_polar_4bit[cw>>4])[2],
((int16_t*)&pucch2_polar_4bit[cw&15])[3],((int16_t*)&pucch2_polar_4bit[cw>>4])[3],
((int16_t*)&rp_re[aa][half_prb])[0],((int16_t*)&rp_im[aa][half_prb])[0],
((int16_t*)&rp_re[aa][half_prb])[1],((int16_t*)&rp_im[aa][half_prb])[1],
@@ -1522,7 +1599,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
corr_re,
corr_im,
corr_tmp);
-
+*/
}
corr16 = _mm_set1_epi16((int16_t)(corr_tmp>>8));
@@ -1562,18 +1639,19 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
}
// compute llrs
- llrs[half_prb] = _mm_subs_epi16(llr_num,llr_den);
- LOG_D(PHY,"llrs[%d] : (%d,%d,%d,%d,%d,%d,%d,%d)\n",
- half_prb,
- ((int16_t*)&llrs[half_prb])[0],
- ((int16_t*)&llrs[half_prb])[1],
- ((int16_t*)&llrs[half_prb])[2],
- ((int16_t*)&llrs[half_prb])[3],
- ((int16_t*)&llrs[half_prb])[4],
- ((int16_t*)&llrs[half_prb])[5],
- ((int16_t*)&llrs[half_prb])[6],
- ((int16_t*)&llrs[half_prb])[7]);
- } // half_prb
+ llrs[half_prb + (symb*2*pucch_pdu->prb_size)] = _mm_subs_epi16(llr_num,llr_den);
+ LOG_D(PHY,"llrs[%d] : (%d,%d,%d,%d,%d,%d,%d,%d)\n",
+ half_prb,
+ ((int16_t*)&llrs[half_prb])[0],
+ ((int16_t*)&llrs[half_prb])[1],
+ ((int16_t*)&llrs[half_prb])[2],
+ ((int16_t*)&llrs[half_prb])[3],
+ ((int16_t*)&llrs[half_prb])[4],
+ ((int16_t*)&llrs[half_prb])[5],
+ ((int16_t*)&llrs[half_prb])[6],
+ ((int16_t*)&llrs[half_prb])[7]);
+ } // half_prb
+ } // symb
// run polar decoder on llrs
decoderState = polar_decoder_int16((int16_t*)llrs, decodedPayload, 0, currentPtr);
LOG_D(PHY,"UCI decoderState %d, payload[0] %llu\n",decoderState,(unsigned long long)decodedPayload[0]);
@@ -1582,9 +1660,10 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
LOG_D(PHY,"metric %d dB\n",corr_dB);
}
- re_offset = (12*pucch_pdu->prb_start) + (12*pucch_pdu->bwp_start) + frame_parms->first_carrier_offset;
- // estimate CQI for MAC (from antenna port 0 only)
- int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][(l2*frame_parms->ofdm_symbol_size)+re_offset],12*pucch_pdu->prb_size)) - (10*gNB->measurements.n0_power_tot_dB);
+ // estimate CQI for MAC (from antenna port 0 only)
+ int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[0]],
+ 12*pucch_pdu->prb_size)) -
+ (10*gNB->measurements.n0_power_tot_dB);
int cqi,bit_left;
if (SNRtimes10 < -640) cqi=0;
else if (SNRtimes10 > 635) cqi=255;
@@ -1597,7 +1676,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
uci_pdu->pucch_format=0;
uci_pdu->ul_cqi=cqi;
uci_pdu->timing_advance=0xffff; // currently not valid
- uci_pdu->rssi=1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(signal_energy_nodc(&rxdataF[0][(l2*frame_parms->ofdm_symbol_size)+re_offset],12*pucch_pdu->prb_size)));
+ uci_pdu->rssi=1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(signal_energy_nodc(&rxdataF[0][soffset+(l2*frame_parms->ofdm_symbol_size)+re_offset[0]],12*pucch_pdu->prb_size)));
if (pucch_pdu->bit_len_harq>0) {
int harq_bytes=pucch_pdu->bit_len_harq>>3;
if ((pucch_pdu->bit_len_harq&7) > 0) harq_bytes++;
diff --git a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
index 44f1844ae9..7f6f0e8ef9 100644
--- a/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
+++ b/openair1/PHY/NR_UE_ESTIMATION/nr_ue_measurements.c
@@ -36,7 +36,6 @@
#include "PHY/phy_extern_nr_ue.h"
#include "common/utils/LOG/log.h"
#include "PHY/sse_intrin.h"
-#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
//#define k1 1000
#define k1 ((long long int) 1000)
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index aa8588f106..3afe27310f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -36,16 +36,14 @@
#include
#endif
-#include
-#include
-#include "executables/softmodem-common.h"
+#include "executables/softmodem-common.h"
#include "nr_transport_proto_ue.h"
#include "PHY/CODING/nrPolar_tools/nr_polar_dci_defs.h"
#include "PHY/phy_extern_nr_ue.h"
#include "PHY/CODING/coding_extern.h"
#include "PHY/sse_intrin.h"
-#include "PHY/NR_TRANSPORT/nr_dci.h"
+#include "common/utils/nr/nr_common.h"
#include "assertions.h"
#include "T.h"
@@ -148,7 +146,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
}
- int f_bundle_j_list[NR_MAX_PDCCH_AGG_LEVEL] = {};
+ int f_bundle_j_list[(2*NR_MAX_PDCCH_AGG_LEVEL) - 1] = {};
for (int reg = 0; reg < coreset_nbr_rb; reg++) {
if ((reg % reg_bundle_size_L) == 0) {
@@ -170,12 +168,14 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
// Get cce_list indices by reg_idx in ascending order
int f_bundle_j_list_id = 0;
- int f_bundle_j_list_ord[NR_MAX_PDCCH_AGG_LEVEL] = {};
+ int f_bundle_j_list_ord[(2*NR_MAX_PDCCH_AGG_LEVEL)-1] = {};
for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
f_bundle_j_list_id = CCE[c_id];
for (int p = 0; p < NR_MAX_PDCCH_AGG_LEVEL; p++) {
for (int p2 = CCE[c_id]; p2 < CCE[c_id] + L[c_id]; p2++) {
+ AssertFatal(p2<2*NR_MAX_PDCCH_AGG_LEVEL,"number_of_candidates %d : p2 %d, CCE[%d] %d, L[%d] %d\n",number_of_candidates,p2,c_id,CCE[c_id],c_id,L[c_id]);
if (f_bundle_j_list[p2] == p) {
+ AssertFatal(f_bundle_j_list_id < 2*NR_MAX_PDCCH_AGG_LEVEL,"f_bundle_j_list_id %d\n",f_bundle_j_list_id);
f_bundle_j_list_ord[f_bundle_j_list_id] = p;
f_bundle_j_list_id++;
break;
@@ -413,7 +413,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
* we have to point the pointer at (1+c_rb-N_RB_DL/2) in rxdataF
*/
- LOG_DDD("n_BWP_start=%d, coreset_nbr_rb=%d\n",n_BWP_start,coreset_nbr_rb);
int c_rb_by6;
c_rb = 0;
for (int rb=0;rb>2; rb++) {
- //printf("rb %d\n",rb);
#if defined(__x86_64__) || defined(__i386__)
// multiply by conjugated channel
mmtmpP0 = _mm_madd_epi16(dl_ch128[0],rxdataF128[0]);
- // print_ints("re",&mmtmpP0);
+ //print_ints("re",&mmtmpP0);
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
mmtmpP1 = _mm_shufflelo_epi16(dl_ch128[0],_MM_SHUFFLE(2,3,0,1));
mmtmpP1 = _mm_shufflehi_epi16(mmtmpP1,_MM_SHUFFLE(2,3,0,1));
mmtmpP1 = _mm_sign_epi16(mmtmpP1,*(__m128i *)&conjugate[0]);
- // print_ints("im",&mmtmpP1);
+ //print_ints("im",&mmtmpP1);
mmtmpP1 = _mm_madd_epi16(mmtmpP1,rxdataF128[0]);
// mmtmpP1 contains imag part of 4 consecutive outputs (32-bit)
mmtmpP0 = _mm_srai_epi32(mmtmpP0,output_shift);
@@ -599,12 +597,12 @@ void nr_pdcch_channel_compensation(int32_t **rxdataF_ext,
// print_ints("im(shift)",&mmtmpP1);
mmtmpP2 = _mm_unpacklo_epi32(mmtmpP0,mmtmpP1);
mmtmpP3 = _mm_unpackhi_epi32(mmtmpP0,mmtmpP1);
- // print_ints("c0",&mmtmpP2);
- // print_ints("c1",&mmtmpP3);
+ //print_ints("c0",&mmtmpP2);
+ //print_ints("c1",&mmtmpP3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpP2,mmtmpP3);
- //print_shorts("rx:",rxdataF128);
- //print_shorts("ch:",dl_ch128);
- //print_shorts("pack:",rxdataF_comp128);
+// print_shorts("rx:",(int16_t*)rxdataF128);
+// print_shorts("ch:",(int16_t*)dl_ch128);
+// print_shorts("pack:",(int16_t*)rxdataF_comp128);
// multiply by conjugated channel
mmtmpP0 = _mm_madd_epi16(dl_ch128[1],rxdataF128[1]);
// mmtmpP0 contains real part of 4 consecutive outputs (32-bit)
@@ -800,7 +798,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
#endif
}
- LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving()\n");
+ LOG_D(PHY,"we enter nr_pdcch_demapping_deinterleaving(), number of candidates %d\n",rel15->number_of_candidates);
nr_pdcch_demapping_deinterleaving((uint32_t *) pdcch_vars->llr,
(uint32_t *) pdcch_vars->e_rx,
rel15->coreset.duration,
@@ -933,11 +931,22 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
// Loop over possible DCI lengths
for (int k = 0; k < rel15->num_dci_options; k++) {
+ // skip this candidate if we've already found one with the
+ // same rnti and format at a different aggregation level
+ int dci_found=0;
+ for (int ind=0;ind < dci_ind->number_of_dcis ; ind++) {
+ if (rel15->rnti== dci_ind->dci_list[ind].rnti &&
+ rel15->dci_format_options[k]==dci_ind->dci_list[ind].dci_format) {
+ dci_found=1;
+ break;
+ }
+ }
+ if (dci_found==1) continue;
int dci_length = rel15->dci_length_options[k];
uint64_t dci_estimation[2]= {0};
const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList);
- LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L);
+ LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
index fa09093306..8a4cafc6d7 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
@@ -45,11 +45,6 @@
//#define DEBUG_HARQ
-//#include "LAYER2/MAC/extern.h"
-//#include "LAYER2/MAC/defs.h"
-//#include "../openair2/LAYER2/MAC/extern.h"
-//#include "../openair2/LAYER2/MAC/defs.h"
-
//#define DEBUG_DCI
#define NR_PDCCH_DCI_TOOLS
//#define NR_PDCCH_DCI_TOOLS_DEBUG
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
index 95b04435eb..975d7077a0 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
@@ -43,7 +43,7 @@
#include "SIMULATION/TOOLS/sim.h"
#include "executables/nr-uesoftmodem.h"
#include "PHY/CODING/nrLDPC_extern.h"
-#include "LAYER2/NR_MAC_gNB/mac_proto.h"
+#include "common/utils/nr/nr_common.h"
//#define ENABLE_PHY_PAYLOAD_DEBUG 1
@@ -236,11 +236,10 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t harq_pid,
uint8_t is_crnti,
uint8_t llr8_flag) {
-#if UE_TIMING_TRACE
time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats;
time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats;
time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats;
-#endif
+
uint32_t A,E;
uint32_t G;
uint32_t ret,offset;
@@ -328,8 +327,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, dmrs_length, harq_process->Qm,harq_process->Nl);
G = harq_process->G;
- LOG_D(PHY,"DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",
- harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
+ LOG_D(PHY,"%d.%d DLSCH Decoding, harq_pid %d TBS %d (%d) G %d nb_re_dmrs %d length dmrs %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",
+ frame,nr_slot_rx,harq_pid,A,A/8,G, nb_re_dmrs, dmrs_length, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
if ((harq_process->R)<1024)
Coderate = (float) (harq_process->R) /(float) 1024;
@@ -411,21 +410,15 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
for (r=0; rC; r++) {
//printf("start rx segment %d\n",r);
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r);
-#if UE_TIMING_TRACE
start_meas(dlsch_deinterleaving_stats);
-#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_IN);
nr_deinterleaving_ldpc(E,
harq_process->Qm,
harq_process->w[r], // [hna] w is e
dlsch_llr+r_offset);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_DEINTERLEAVING, VCD_FUNCTION_OUT);
-#if UE_TIMING_TRACE
stop_meas(dlsch_deinterleaving_stats);
-#endif
-#if UE_TIMING_TRACE
start_meas(dlsch_rate_unmatching_stats);
-#endif
LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,E %d, F %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,E,harq_process->F,
Kr*3,
@@ -454,16 +447,12 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
E,
harq_process->F,
Kr-harq_process->F-2*(p_decParams->Z))==-1) {
- VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
-#if UE_TIMING_TRACE
- stop_meas(dlsch_rate_unmatching_stats);
-#endif
- LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
- return(dlsch->max_ldpc_iterations + 1);
+ VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_OUT);
+ stop_meas(dlsch_rate_unmatching_stats);
+ LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
+ return(dlsch->max_ldpc_iterations + 1);
} else {
-#if UE_TIMING_TRACE
- stop_meas(dlsch_rate_unmatching_stats);
-#endif
+ stop_meas(dlsch_rate_unmatching_stats);
}
r_offset += E;
@@ -492,9 +481,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
}
if (err_flag == 0) {
-#if UE_TIMING_TRACE
start_meas(dlsch_turbo_decoding_stats);
-#endif
//set first 2*Z_c bits to zeros
memset(&z[0],0,2*harq_process->Z*sizeof(int16_t));
//set Filler bits
@@ -510,6 +497,8 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_LDPC, VCD_FUNCTION_IN);
+ p_decParams->block_length=length_dec;
+ nrLDPC_initcall(p_decParams, (int8_t*)&pl[0], llrProcBuf);
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
(int8_t *)&pl[0],
llrProcBuf,
@@ -545,13 +534,10 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) {
for (int k=0; k>3; k++)
LOG_D(PHY,"output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
-
LOG_D(PHY,"no_iterations_ldpc %d (ret %u)\n",no_iteration_ldpc,ret);
}
-#if UE_TIMING_TRACE
stop_meas(dlsch_turbo_decoding_stats);
-#endif
}
if ((err_flag == 0) && (ret>=(1+dlsch->max_ldpc_iterations))) {// a Code segment is in error so break;
@@ -645,11 +631,10 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
uint8_t harq_pid,
uint8_t is_crnti,
uint8_t llr8_flag) {
-#if UE_TIMING_TRACE
+
time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats;
time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats;
time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats;
-#endif
uint32_t A,E;
uint32_t G;
uint32_t ret,offset;
@@ -812,7 +797,6 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
notifiedFIFO_elt_t *res_dl;
opp_enabled=1;
-
if (harq_process->C>1) {
for (int nb_seg =1 ; nb_segC; nb_seg++) {
if ( (res_dl=tryPullTpool(&nf, &pool_dl)) != NULL ) {
@@ -867,9 +851,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
dlsch_llr+r_offset,
&harq_process->w[r]);
*/
-#if UE_TIMING_TRACE
start_meas(dlsch_deinterleaving_stats);
-#endif
nr_deinterleaving_ldpc(E,
harq_process->Qm,
harq_process->w[r],
@@ -879,12 +861,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
for (int i =0; i<16; i++)
LOG_D(PHY,"rx output deinterleaving w[%d]= %d r_offset %u\n", i,harq_process->w[r][i], r_offset);
-#if UE_TIMING_TRACE
stop_meas(dlsch_deinterleaving_stats);
-#endif
-#if UE_TIMING_TRACE
start_meas(dlsch_rate_unmatching_stats);
-#endif
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD))
LOG_I(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
@@ -915,15 +893,11 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
E,
harq_process->F,
Kr-harq_process->F-2*(p_decParams->Z))==-1) {
-#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
-#endif
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
return(dlsch->max_ldpc_iterations);
} else {
-#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
-#endif
}
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD))
@@ -966,9 +940,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
Kr,r,harq_process->C,harq_process->nb_rb,crc_type,A,harq_process->TBS,
harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round,dlsch->max_ldpc_iterations);
*/
-#if UE_TIMING_TRACE
start_meas(dlsch_turbo_decoding_stats);
-#endif
LOG_D(PHY,"mthread AbsSubframe %d.%d Start LDPC segment %d/%d \n",frame%1024,nr_slot_rx,r,harq_process->C-1);
/*for (int cnt =0; cnt < (kc-2)*p_decParams->Z; cnt++){
inv_d[cnt] = (1)*harq_process->d[r][cnt];
@@ -986,7 +958,8 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) {
pl[j] = _mm_packs_epi16(pv[i],pv[i+1]);
}
-
+ p_decParams->block_length=length_dec;
+ nrLDPC_initcall(p_decParams, (int8_t*)&pl[0], llrProcBuf);
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
(int8_t *)&pl[0],
llrProcBuf,
@@ -1037,11 +1010,10 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
for (int k=0; k<32; k++)
LOG_D(PHY,"output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
-#if UE_TIMING_TRACE
stop_meas(dlsch_turbo_decoding_stats);
-#endif
}
+
if ((err_flag == 0) && (ret>=(1+dlsch->max_ldpc_iterations))) {// a Code segment is in error so break;
LOG_D(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,nr_slot_rx,r,harq_process->C-1);
err_flag = 1;
@@ -1135,7 +1107,6 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
}
-
void nr_dlsch_decoding_process(void *arg) {
nr_rxtx_thread_data_t *rxtxD= (nr_rxtx_thread_data_t *)arg;
UE_nr_rxtx_proc_t *proc = &rxtxD->proc;
@@ -1167,11 +1138,10 @@ void nr_dlsch_decoding_process(void *arg) {
proc->instance_cnt_dlsch_td=-1;
//proc->nr_slot_rx = proc->sub_frame_start * frame_parms->slots_per_subframe;
proc->decoder_thread_available = 1;
-#if UE_TIMING_TRACE
time_stats_t *dlsch_rate_unmatching_stats=&phy_vars_ue->dlsch_rate_unmatching_stats;
time_stats_t *dlsch_turbo_decoding_stats=&phy_vars_ue->dlsch_turbo_decoding_stats;
time_stats_t *dlsch_deinterleaving_stats=&phy_vars_ue->dlsch_deinterleaving_stats;
-#endif
+
uint32_t A,E;
uint32_t G;
uint32_t ret;
@@ -1200,7 +1170,8 @@ void nr_dlsch_decoding_process(void *arg) {
ret = dlsch->max_ldpc_iterations;
harq_process->G = nr_get_G(nb_rb, nb_symb_sch, nb_re_dmrs, length_dmrs, harq_process->Qm,harq_process->Nl);
G = harq_process->G;
- LOG_D(PHY,"DLSCH Decoding process, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb);
+
+ LOG_D(PHY,"DLSCH Decoding process, harq_pid %d TBS %d G %d mcs %d Nl %d nb_symb_sch %d nb_rb %d, Coderate %d\n",harq_pid,A,G, harq_process->mcs, harq_process->Nl, nb_symb_sch,nb_rb,harq_process->R);
if ((harq_process->R)<1024)
Coderate = (float) (harq_process->R) /(float) 1024;
@@ -1271,9 +1242,7 @@ void nr_dlsch_decoding_process(void *arg) {
Kr_bytes = Kr>>3;
K_bits_F = Kr-harq_process->F;
E = nr_get_E(G, harq_process->C, harq_process->Qm, harq_process->Nl, r);
-#if UE_TIMING_TRACE
start_meas(dlsch_deinterleaving_stats);
-#endif
nr_deinterleaving_ldpc(E,
harq_process->Qm,
harq_process->w[r],
@@ -1283,13 +1252,8 @@ void nr_dlsch_decoding_process(void *arg) {
for (int i =0; i<16; i++)
LOG_D(PHY,"rx output thread 0 deinterleaving w[%d]= %d r_offset %u\n", i,harq_process->w[r][i], r_offset);
-#if UE_TIMING_TRACE
stop_meas(dlsch_deinterleaving_stats);
-#endif
-#if UE_TIMING_TRACE
start_meas(dlsch_rate_unmatching_stats);
-#endif
-
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD))
LOG_I(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
harq_pid,r, G,
@@ -1318,15 +1282,11 @@ void nr_dlsch_decoding_process(void *arg) {
E,
harq_process->F,
Kr-harq_process->F-2*(p_decParams->Z))==-1) {
-#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
-#endif
LOG_E(PHY,"dlsch_decoding.c: Problem in rate_matching\n");
//return(dlsch->max_ldpc_iterations);
} else {
-#if UE_TIMING_TRACE
stop_meas(dlsch_rate_unmatching_stats);
-#endif
}
if (LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD)) {
@@ -1363,9 +1323,7 @@ void nr_dlsch_decoding_process(void *arg) {
Kr,r,harq_process->C,harq_process->nb_rb,A,harq_process->TBS,harq_process->B,harq_process->mcs,harq_process->Qm,harq_process->rvidx,harq_process->round);
}
-#if UE_TIMING_TRACE
start_meas(dlsch_turbo_decoding_stats);
-#endif
// LOG_D(PHY,"AbsSubframe %d.%d Start LDPC segment %d/%d \n",frame%1024,subframe,r,harq_process->C-1);
/*
for (int cnt =0; cnt < (kc-2)*p_decParams->Z; cnt++){
@@ -1385,7 +1343,8 @@ void nr_dlsch_decoding_process(void *arg) {
for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++) {
pl[j] = _mm_packs_epi16(pv[i],pv[i+1]);
}
-
+ p_decParams->block_length=length_dec;
+ nrLDPC_initcall(p_decParams, (int8_t*)&pl[0], llrProcBuf);
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
(int8_t *)&pl[0],
llrProcBuf,
@@ -1411,10 +1370,7 @@ void nr_dlsch_decoding_process(void *arg) {
if ( LOG_DEBUGFLAG(DEBUG_DLSCH_DECOD))
for (int k=0; k<2; k++)
LOG_D(PHY,"segment 1 output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
-
-#if UE_TIMING_TRACE
stop_meas(dlsch_turbo_decoding_stats);
-#endif
}
if ((err_flag == 0) && (ret>=(1+dlsch->max_ldpc_iterations))) {// a Code segment is in error so break;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
index fb6e7bf6b5..031c08a72d 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
@@ -41,6 +41,7 @@
#include "openair1/PHY/NR_TRANSPORT/nr_dlsch.h"
#include "PHY/NR_REFSIG/nr_refsig.h"
#include "PHY/NR_REFSIG/dmrs_nr.h"
+#include "common/utils/nr/nr_common.h"
#ifndef USER_MODE
#define NOCYGWIN_STATIC static
@@ -163,9 +164,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
// int avg_0[2];
// int avg_1[2];
-#if UE_TIMING_TRACE
uint8_t slot = 0;
-#endif
unsigned char aatx=0,aarx=0;
@@ -331,12 +330,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
DevAssert(dlsch1_harq);
}
-#if UE_TIMING_TRACE
if(symbol > ue->frame_parms.symbols_per_slot>>1)
{
slot = 1;
}
-#endif
#ifdef DEBUG_HARQ
printf("Demod dlsch0_harq->pmi_alloc %d\n", dlsch0_harq->pmi_alloc);
@@ -346,9 +343,7 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
uint8_t config_type = dlsch0_harq->dmrsConfigType;
if (beamforming_mode==0) {//No beamforming
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
-#endif
if (dlsch0_harq->Nl > 1)//More than or equal 2 layers
nb_rb = nr_dlsch_extract_rbs_multiple(common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF,
pdsch_vars[gNB_id]->dl_ch_estimates,
@@ -389,7 +384,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
len = (pilots==1)? ((config_type==NFAPI_NR_DMRS_TYPE1)?nb_rb*(12-6*dlsch0_harq->n_dmrs_cdm_groups): nb_rb*(12-4*dlsch0_harq->n_dmrs_cdm_groups)):(nb_rb*12);
-#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n",
@@ -398,11 +392,8 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d type %d: Pilot/Data extraction %5.2f \n",
frame,nr_slot_rx,slot,symbol,type,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
-#endif
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
-#endif
n_tx = dlsch0_harq->Nl;
n_rx = frame_parms->nb_antennas_rx;
@@ -416,18 +407,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
len,
nb_rb_pdsch);
-#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Scale %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
-#endif
-
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
-#endif
if (first_symbol_flag==1) {
if (beamforming_mode==0){
nr_dlsch_channel_level(pdsch_vars[gNB_id]->dl_ch_estimates_ext,
@@ -482,19 +468,14 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
}
#endif
-#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d first_symbol_flag %d: Channel Level %5.2f \n",frame,nr_slot_rx,slot,symbol,first_symbol_flag,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
-#endif
-
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
-#endif
// Now channel compensation
if (dlsch0_harq->mimo_moderxdataF_ext,
@@ -539,18 +520,13 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
0);
}
-#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d log2_maxh %d channel_level %d: Channel Comp %5.2f \n", frame, nr_slot_rx, slot, symbol, pdsch_vars[gNB_id]->log2_maxh, proc->channel_level, ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
-#endif
-// MRC
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
-#endif
if (frame_parms->nb_antennas_rx > 1) {
if (dlsch0_harq->mimo_modegeneric_stat_bis[proc->thread_id][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: Channel Combine %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
-#endif
-
-#if UE_TIMING_TRACE
-
start_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
-#endif
/* Store the valid DL RE's */
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] = len;
@@ -692,14 +662,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
}
-#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
#if DISABLE_LOG_X
printf("[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
#endif
-#endif
// Please keep it: useful for debugging
#ifdef DEBUG_PDSCH_RX
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
index 7dfd765b76..ffe21b1f6d 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
@@ -38,6 +38,7 @@
#include "PHY/NR_UE_ESTIMATION/nr_estimation.h"
#include "SCHED_NR_UE/defs.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
+#include "common/utils/nr/nr_common.h"
#include "common_lib.h"
#include
@@ -126,15 +127,11 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
// initialization of structure
current_ssb = create_ssb_node(l,hf);
-#if UE_TIMING_TRACE
start_meas(&ue->dlsch_channel_estimation_stats);
-#endif
// computing correlation between received DMRS symbols and transmitted sequence for current i_ssb and n_hf
for(int i=pbch_initial_symbol; idlsch_channel_estimation_stats);
-#endif
current_ssb->metric = current_ssb->c_re*current_ssb->c_re + current_ssb->c_im*current_ssb->c_im;
@@ -150,15 +147,11 @@ int nr_pbch_detection(UE_nr_rxtx_proc_t * proc, PHY_VARS_NR_UE *ue, int pbch_ini
NR_UE_SSB *temp_ptr=best_ssb;
while (ret!=0 && temp_ptr != NULL) {
-#if UE_TIMING_TRACE
start_meas(&ue->dlsch_channel_estimation_stats);
-#endif
// computing channel estimation for selected best ssb
for(int i=pbch_initial_symbol; ii_ssb,temp_ptr->n_hf);
-#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_channel_estimation_stats);
-#endif
ret = nr_rx_pbch(ue,
proc,
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
index d94ae2a61e..5487d30968 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
@@ -39,7 +39,6 @@
#include "PHY/CODING/nrLDPC_extern.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_ue.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "LAYER2/NR_MAC_gNB/mac_proto.h"
#include
//#define DEBUG_ULSCH_CODING
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index bcce28b390..98ebecb9c8 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -44,8 +44,6 @@
#include "PHY/TOOLS/tools_defs.h"
#include "executables/nr-softmodem.h"
#include "executables/softmodem-common.h"
-#include "LAYER2/NR_MAC_UE/mac_proto.h"
-
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
#include
@@ -144,7 +142,12 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
ulsch_ue->Nid_cell = Nid_cell;
- get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols);
+ for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
+ if((ul_dmrs_symb_pos >> i) & 0x01)
+ number_dmrs_symbols += 1;
+ }
+
+ nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data;
LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n",
rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb);
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
index 61bca6f409..68d8735411 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.c
@@ -34,7 +34,6 @@
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
//#include "PHY/extern.h"
-//#include "LAYER2/MAC/extern.h"
#include "PHY/NR_UE_TRANSPORT/pucch_nr.h"
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
#include "PHY/NR_TRANSPORT/nr_transport_common_proto.h"
@@ -91,7 +90,7 @@ void nr_generate_pucch0(PHY_VARS_NR_UE *ue,
// the value of u,v (delta always 0 for PUCCH) has to be calculated according to TS 38.211 Subclause 6.3.2.2.1
uint8_t u[2]={0,0},v[2]={0,0};
- LOG_D(PHY,"pucch0: nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
+ LOG_D(PHY,"pucch0: slot %d nr_symbols %d, start_symbol %d, prb_start %d, second_hop_prb %d, group_hop_flag %d, sequence_hop_flag %d, mcs %d\n",nr_slot_tx,pucch_pdu->nr_of_symbols,pucch_pdu->start_symbol_index,pucch_pdu->prb_start,pucch_pdu->second_hop_prb,pucch_pdu->group_hop_flag,pucch_pdu->sequence_hop_flag,pucch_pdu->mcs);
#ifdef DEBUG_NR_PUCCH_TX
diff --git a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h
index dcf7fb4a37..078a95605f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/pucch_nr.h
@@ -37,7 +37,6 @@
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
//#include "PHY/extern.h"
-//#include "LAYER2/MAC/extern.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
diff --git a/openair1/PHY/TOOLS/time_meas.c b/openair1/PHY/TOOLS/time_meas.c
index 001770c876..c62fbed106 100644
--- a/openair1/PHY/TOOLS/time_meas.c
+++ b/openair1/PHY/TOOLS/time_meas.c
@@ -18,17 +18,27 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
-
+#define _GNU_SOURCE
#include
#include "time_meas.h"
#include
#include
-
+#include
+#include "assertions.h"
+#ifndef PHYSIM
+ #include
+ #include "common/config/config_userapi.h"
+#endif
// global var for openair performance profiler
int opp_enabled = 0;
double cpu_freq_GHz __attribute__ ((aligned(32)));
double cpu_freq_GHz __attribute__ ((aligned(32)))=0.0;
+#ifndef PHYSIM
+static uint32_t max_cpumeasur;
+static time_stats_t **measur_table;
+notifiedFIFO_t measur_fifo;
+#endif
double get_cpu_freq_GHz(void)
{
if (cpu_freq_GHz <1 ) {
@@ -64,8 +74,8 @@ int cpumeas(int action)
}
void print_meas_now(time_stats_t *ts,
- const char *name,
- FILE *file_name)
+ const char *name,
+ FILE *file_name)
{
if (opp_enabled) {
//static double cpu_freq_GHz = 3.2;
@@ -80,9 +90,9 @@ void print_meas_now(time_stats_t *ts,
}
void print_meas(time_stats_t *ts,
- const char *name,
- time_stats_t *total_exec_time,
- time_stats_t *sf_exec_time)
+ const char *name,
+ time_stats_t *total_exec_time,
+ time_stats_t *sf_exec_time)
{
if (opp_enabled) {
static int first_time = 0;
@@ -133,3 +143,112 @@ double get_time_meas_us(time_stats_t *ts)
return 0;
}
+
+#ifndef PHYSIM
+/* function for the asynchronous measurment module: cpu stat are sent to a dedicated thread
+ * which is in charge of computing the cpu time spent in a given function/algorithm...
+ */
+
+time_stats_t *register_meas(char *name)
+{
+ for (int i=0; imeas_name = strdup(name);
+ measur_table[i]->meas_index = i;
+ measur_table[i]->tpoolmsg =newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL);
+ measur_table[i]->tstatptr = (time_stats_msg_t *)NotifiedFifoData(measur_table[i]->tpoolmsg);
+ return measur_table[i];
+ }
+ }
+ return NULL;
+}
+
+void free_measurtbl(void) {
+ for (int i=0; imeas_name);
+ delNotifiedFIFO_elt(measur_table[i]->tpoolmsg);
+ free(measur_table[i]);
+ }
+ }
+ //free the fifo...
+}
+
+void run_cpumeasur(void) {
+ struct sched_param schedp;
+ pthread_setname_np(pthread_self(), "measur");
+ schedp.sched_priority=0;
+ int rt=pthread_setschedparam(pthread_self(), SCHED_IDLE, &schedp);
+ AssertFatal(rt==0, "couldn't set measur thread priority: %s\n",strerror(errno));
+ initNotifiedFIFO(&measur_fifo);
+ while(1) {
+ notifiedFIFO_elt_t *msg = pullNotifiedFIFO(&measur_fifo);
+ time_stats_msg_t *tsm = (time_stats_msg_t *)NotifiedFifoData(msg);
+ switch(tsm->msgid) {
+ case TIMESTAT_MSGID_START:
+ measur_table[tsm->timestat_id]->in=tsm->ts;
+ (measur_table[tsm->timestat_id]->trials)++;
+ break;
+ case TIMESTAT_MSGID_STOP:
+ /// process duration is the difference between two clock points
+ measur_table[tsm->timestat_id]->p_time = (tsm->ts - measur_table[tsm->timestat_id]->in);
+ measur_table[tsm->timestat_id]->diff += measur_table[tsm->timestat_id]->p_time;
+ if ( measur_table[tsm->timestat_id]->p_time > measur_table[tsm->timestat_id]->max )
+ measur_table[tsm->timestat_id]->max = measur_table[tsm->timestat_id]->p_time;
+ break;
+ case TIMESTAT_MSGID_DISPLAY:
+ {
+ char aline[256];
+ int start, stop;
+ if (tsm->displayFunc != NULL) {
+ if(tsm->timestat_id >= 0) {
+ start=tsm->timestat_id ;
+ stop=start+1;
+ }
+ else {
+ start=0;
+ stop=max_cpumeasur ;
+ }
+ for (int i=start ; imeas_name, measur_table[i]->trials==0?0:( (measur_table[i]->trials/measur_table[i]->diff )/ cpu_freq_GHz /1000 ));
+ tsm->displayFunc(aline);
+ }
+ }
+ }
+ }
+ break;
+ case TIMESTAT_MSGID_END:
+ free_measurtbl();
+ delNotifiedFIFO_elt(msg);
+ pthread_exit(NULL);
+ break;
+ default:
+ break;
+ }
+ delNotifiedFIFO_elt(msg);
+ }
+}
+
+
+void init_meas(void) {
+ pthread_t thid;
+ paramdef_t cpumeasur_params[] = CPUMEASUR_PARAMS_DESC;
+ int numparams=sizeof(cpumeasur_params)/sizeof(paramdef_t);
+ int rt = config_get( cpumeasur_params,numparams,CPUMEASUR_SECTION);
+ AssertFatal(rt >= 0, "cpumeasur configuration couldn't be performed");
+ measur_table=calloc(max_cpumeasur,sizeof( time_stats_t *));
+ AssertFatal(measur_table!=NULL, "couldn't allocate %u cpu measurements entries\n",max_cpumeasur);
+ rt=pthread_create(&thid,NULL, (void *(*)(void *))run_cpumeasur, NULL);
+ AssertFatal(rt==0, "couldn't create cpu measurment thread: %s\n",strerror(errno));
+}
+
+void end_meas(void) {
+ notifiedFIFO_elt_t *nfe = newNotifiedFIFO_elt(sizeof(time_stats_msg_t),0,NULL,NULL);
+ time_stats_msg_t *msg = (time_stats_msg_t *)NotifiedFifoData(nfe);
+ msg->msgid = TIMESTAT_MSGID_END ;
+ pushNotifiedFIFO(&measur_fifo, nfe);
+}
+#endif
diff --git a/openair1/PHY/TOOLS/time_meas.h b/openair1/PHY/TOOLS/time_meas.h
index e2ceef8405..f78ea55530 100644
--- a/openair1/PHY/TOOLS/time_meas.h
+++ b/openair1/PHY/TOOLS/time_meas.h
@@ -31,31 +31,57 @@
#include
#include
#include
+#ifndef PHYSIM
+ #include "common/utils/threadPool/thread-pool.h"
+#endif
// global var to enable openair performance profiler
extern int opp_enabled;
extern double cpu_freq_GHz __attribute__ ((aligned(32)));;
-
+// structure to store data to compute cpu measurment
#if defined(__x86_64__) || defined(__i386__)
-typedef struct {
- long long in;
- long long diff;
- long long p_time; /*!< \brief absolute process duration */
- long long diff_square; /*!< \brief process duration square */
- long long max;
- int trials;
- int meas_flag;
-} time_stats_t;
+ #define OAI_CPUTIME_TYPE long long
#elif defined(__arm__)
-typedef struct {
- uint32_t in;
- uint32_t diff;
- uint32_t p_time; /*!< \brief absolute process duration */
- uint32_t diff_square; /*!< \brief process duration square */
- uint32_t max;
- int trials;
-} time_stats_t;
+ #define OAI_CPUTIME_TYPE uint32_t
+#else
+ #error "building on unsupported CPU architecture"
#endif
+#define TIMESTAT_MSGID_START 0 /*!< \brief send time at measure starting point */
+#define TIMESTAT_MSGID_STOP 1 /*!< \brief send time at measure end point */
+#define TIMESTAT_MSGID_ENABLE 2 /*!< \brief enable measure point */
+#define TIMESTAT_MSGID_DISABLE 3 /*!< \brief disable measure point */
+#define TIMESTAT_MSGID_DISPLAY 10 /*!< \brief display measure */
+#define TIMESTAT_MSGID_END 11 /*!< \brief stops the measure threads and free assocated resources */
+typedef void(*meas_printfunc_t)(const char* format, ...);
+typedef struct {
+ int msgid; /*!< \brief message id, as defined by TIMESTAT_MSGID_X macros */
+ int timestat_id; /*!< \brief points to the time_stats_t entry in cpumeas table */
+ OAI_CPUTIME_TYPE ts; /*!< \brief time stamp */
+ meas_printfunc_t displayFunc; /*!< \brief function to call when DISPLAY message is received*/
+} time_stats_msg_t;
+
+
+typedef struct {
+ OAI_CPUTIME_TYPE in; /*!< \brief time at measure starting point */
+ OAI_CPUTIME_TYPE diff; /*!< \brief average difference between time at starting point and time at endpoint*/
+ OAI_CPUTIME_TYPE p_time; /*!< \brief absolute process duration */
+ OAI_CPUTIME_TYPE diff_square; /*!< \brief process duration square */
+ OAI_CPUTIME_TYPE max; /*!< \brief maximum difference between time at starting point and time at endpoint*/
+ int trials; /*!< \brief number of start point - end point iterations */
+ int meas_flag; /*!< \brief 1: stop_meas not called (consecutive calls of start_meas) */
+ char *meas_name; /*!< \brief name to use when printing the measure (not used for PHY simulators)*/
+ int meas_index; /*!< \brief index of this measure in the measure array (not used for PHY simulators)*/
+ int meas_enabled; /*!< \brief per measure enablement flag. send_meas tests this flag, unused today in start_meas and stop_meas*/
+#ifndef PHYSIM
+ notifiedFIFO_elt_t *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */
+ time_stats_msg_t *tstatptr; /*!< \brief pointer to the time_stats_msg_t data in the tpoolmsg, stored here for perf considerations*/
+#endif
+} time_stats_t;
+#define MEASURE_ENABLED(X) (X->meas_enabled)
+
+
+
+
static inline void start_meas(time_stats_t *ts) __attribute__((always_inline));
static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
@@ -137,4 +163,28 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) {
dst_ts->max=src_ts->max;
}
}
+
+#ifndef PHYSIM
+extern notifiedFIFO_t measur_fifo;
+#define CPUMEASUR_SECTION "cpumeasur"
+
+#define CPUMEASUR_PARAMS_DESC { \
+ {"max_cpumeasur", "Max number of cpu measur entries", 0, uptr:&max_cpumeasur, defintval:100, TYPE_UINT, 0},\
+ }
+
+ void init_meas(void);
+ time_stats_t *register_meas(char *name);
+ #define START_MEAS(X) send_meas(X, TIMESTAT_MSGID_START)
+ #define STOP_MEAS(X) send_meas(X, TIMESTAT_MSGID_STOP)
+ static inline void send_meas(time_stats_t *ts, int msgid) {
+ if (MEASURE_ENABLED(ts) ) {
+ ts->tstatptr->timestat_id=ts->meas_index;
+ ts->tstatptr->msgid = msgid ;
+ ts->tstatptr->ts = rdtsc_oai();
+ pushNotifiedFIFO(&measur_fifo, ts->tpoolmsg);
+ }
+ }
+ void end_meas(void);
+
+#endif //ifndef PHYSIM
#endif
diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h
index 66cb51adc6..76dd92ef5d 100644
--- a/openair1/PHY/defs_RU.h
+++ b/openair1/PHY/defs_RU.h
@@ -762,6 +762,7 @@ typedef struct RRU_config_s {
typedef struct processingData_RU {
int frame_tx;
int slot_tx;
+ int next_slot;
openair0_timestamp timestamp_tx;
RU_t *ru;
} processingData_RU_t;
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 778724218f..11b5112a6c 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -122,8 +122,6 @@ typedef struct {
typedef struct {
uint8_t active;
- int frame;
- int slot;
nfapi_nr_dl_tti_csi_rs_pdu csirs_pdu;
} NR_gNB_CSIRS_t;
@@ -134,6 +132,8 @@ typedef struct {
} NR_gNB_UL_PDCCH_t;
typedef struct {
+ int frame;
+ int dump_frame;
uint16_t rnti;
int round_trials[8];
int total_bytes_tx;
@@ -143,6 +143,7 @@ typedef struct {
int power[NB_ANTENNAS_RX];
int noise_power[NB_ANTENNAS_RX];
int DTX;
+ int sync_pos;
} NR_gNB_SCH_STATS_t;
typedef struct {
@@ -248,6 +249,8 @@ typedef struct {
uint32_t slot;
/// Index of current HARQ round for this DLSCH
uint8_t round;
+ uint8_t ndi;
+ bool new_rx;
/// Last TPC command
uint8_t TPC;
/// MIMO mode for this DLSCH
@@ -659,31 +662,33 @@ typedef struct {
//! estimated noise power (linear)
unsigned int n0_power[MAX_NUM_RU_PER_gNB];
//! estimated noise power (dB)
- unsigned short n0_power_dB[MAX_NUM_RU_PER_gNB];
+ unsigned int n0_power_dB[MAX_NUM_RU_PER_gNB];
//! total estimated noise power (linear)
unsigned int n0_power_tot;
//! estimated avg noise power (dB)
- unsigned short n0_power_tot_dB;
+ unsigned int n0_power_tot_dB;
//! estimated avg noise power (dB)
- short n0_power_tot_dBm;
+ int n0_power_tot_dBm;
//! estimated avg noise power per RB per RX ant (lin)
- unsigned short n0_subband_power[MAX_NUM_RU_PER_gNB][275];
+ unsigned int n0_subband_power[MAX_NUM_RU_PER_gNB][275];
//! estimated avg noise power per RB per RX ant (dB)
- unsigned short n0_subband_power_dB[MAX_NUM_RU_PER_gNB][275];
+ unsigned int n0_subband_power_dB[MAX_NUM_RU_PER_gNB][275];
//! estimated avg subband noise power (dB)
- unsigned short n0_subband_power_avg_dB;
+ unsigned int n0_subband_power_avg_dB;
+ //! estimated avg subband noise power per antenna (dB)
+ unsigned int n0_subband_power_avg_perANT_dB[NB_ANTENNAS_RX];
//! estimated avg noise power per RB (dB)
- short n0_subband_power_tot_dB[275];
+ int n0_subband_power_tot_dB[275];
//! estimated avg noise power per RB (dBm)
- short n0_subband_power_tot_dBm[275];
+ int n0_subband_power_tot_dBm[275];
// gNB measurements (per user)
//! estimated received spatial signal power (linear)
unsigned int rx_spatial_power[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_TX][NB_ANTENNAS_RX];
//! estimated received spatial signal power (dB)
- unsigned short rx_spatial_power_dB[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_TX][NB_ANTENNAS_RX];
+ unsigned int rx_spatial_power_dB[NUMBER_OF_NR_ULSCH_MAX][NB_ANTENNAS_TX][NB_ANTENNAS_RX];
//! estimated rssi (dBm)
- short rx_rssi_dBm[NUMBER_OF_NR_ULSCH_MAX];
+ int rx_rssi_dBm[NUMBER_OF_NR_ULSCH_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
int rx_correlation[NUMBER_OF_NR_ULSCH_MAX][2];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
@@ -759,7 +764,6 @@ typedef struct PHY_VARS_gNB_s {
// nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu;
// nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu;
uint16_t num_pdsch_rnti[80];
- NR_gNB_SSB_t ssb[64];
NR_gNB_PBCH pbch;
nr_cce_t cce_list[MAX_DCI_CORESET][NR_MAX_PDCCH_AGG_LEVEL];
NR_gNB_COMMON common_vars;
@@ -767,7 +771,6 @@ typedef struct PHY_VARS_gNB_s {
NR_gNB_PUSCH *pusch_vars[NUMBER_OF_NR_ULSCH_MAX];
NR_gNB_PUCCH_t *pucch[NUMBER_OF_NR_PUCCH_MAX];
NR_gNB_PDCCH_t pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX];
- NR_gNB_CSIRS_t csirs_pdu[NUMBER_OF_NR_CSIRS_MAX];
NR_gNB_UL_PDCCH_t ul_pdcch_pdu[NUMBER_OF_NR_PDCCH_MAX];
NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2]; // Nusers times two spatial streams
NR_gNB_ULSCH_t *ulsch[NUMBER_OF_NR_ULSCH_MAX][2]; // [Nusers times][2 codewords]
@@ -804,9 +807,8 @@ typedef struct PHY_VARS_gNB_s {
/// PUSCH DMRS
uint32_t ****nr_gold_pusch_dmrs;
- // Mask of occupied RBs
- uint32_t rb_mask_ul[9];
- int ulmask_symb;
+ // Mask of occupied RBs, per symbol and PRB
+ uint32_t rb_mask_ul[14][9];
/// CSI RS sequence
uint32_t ***nr_gold_csi_rs;
@@ -851,10 +853,13 @@ typedef struct PHY_VARS_gNB_s {
int pusch_thres;
int prach_thres;
uint64_t bad_pucch;
+ int num_ulprbbl;
+ int ulprbbl[275];
/*
time_stats_t phy_proc;
*/
- time_stats_t phy_proc_tx;
+ time_stats_t *phy_proc_tx_0;
+ time_stats_t *phy_proc_tx_1;
time_stats_t phy_proc_rx;
time_stats_t rx_prach;
/*
@@ -946,4 +951,24 @@ typedef struct processingData_L1 {
PHY_VARS_gNB *gNB;
} processingData_L1_t;
+typedef enum {
+ FILLED,
+ FILLING,
+ NOT_FILLED
+} msgStatus_t;
+
+typedef struct processingData_L1tx {
+ int frame;
+ int slot;
+ openair0_timestamp timestamp_tx;
+ PHY_VARS_gNB *gNB;
+ nfapi_nr_dl_tti_pdcch_pdu pdcch_pdu;
+ nfapi_nr_ul_dci_request_pdus_t ul_pdcch_pdu;
+ NR_gNB_CSIRS_t csirs_pdu[NUMBER_OF_NR_CSIRS_MAX];
+ NR_gNB_DLSCH_t *dlsch[NUMBER_OF_NR_DLSCH_MAX][2];
+ NR_gNB_SSB_t ssb[64];
+ uint16_t num_pdsch_slot;
+ time_stats_t phy_proc_tx;
+} processingData_L1tx_t;
+
#endif
diff --git a/openair1/PHY/impl_defs_top.h b/openair1/PHY/impl_defs_top.h
index fa021ffe81..31b9899605 100644
--- a/openair1/PHY/impl_defs_top.h
+++ b/openair1/PHY/impl_defs_top.h
@@ -272,9 +272,14 @@
#define NB_NUMEROLOGIES_NR (5)
#define TDD_CONFIG_NB_FRAMES (2)
#define NR_MAX_SLOTS_PER_FRAME (160) /* number of slots per frame */
-#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (6) /* FFS_NR_TODO it defines ue capability which is the number of slots */
- /* - between reception of pdsch and tarnsmission of its acknowlegment */
- /* - between reception of un uplink grant and its related transmission */
+
+/* FFS_NR_TODO it defines ue capability which is the number of slots */
+/* - between reception of pdsch and tarnsmission of its acknowlegment */
+/* - between reception of un uplink grant and its related transmission */
+/* - FIXME temprarily set to 5 to avoid timing issues at OAI UE in rfsimulator */
+/* - issues caused by no rendez-vous point between TX and RX in the OAI UE */
+#define NR_UE_CAPABILITY_SLOT_RX_TO_TX (5)
+
#ifndef NO_RAT_NR
#define DURATION_RX_TO_TX (NR_UE_CAPABILITY_SLOT_RX_TO_TX) /* for NR this will certainly depends to such UE capability which is not yet defined */
#else
diff --git a/openair1/SCHED/nfapi_lte_dummy.c b/openair1/SCHED/nfapi_lte_dummy.c
index 7d1e7e7684..4e82c3ecb3 100644
--- a/openair1/SCHED/nfapi_lte_dummy.c
+++ b/openair1/SCHED/nfapi_lte_dummy.c
@@ -13,11 +13,11 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu){}
int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type){return 0;}
-void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
- nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
+void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
+ nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
uint8_t *sdu){
- }
-void handle_nfapi_nr_csirs_pdu(PHY_VARS_gNB *gNB,
+}
+void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
int frame, int slot,
nfapi_nr_dl_tti_csi_rs_pdu *csirs_pdu){
}
@@ -51,4 +51,5 @@ void nr_phy_config_request(NR_PHY_Config_t *gNB){}
void install_nr_schedule_handlers(NR_IF_Module_t *if_inst){}
-void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp){}
\ No newline at end of file
+void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp){}
+
diff --git a/openair1/SCHED/nfapi_nr_dummy.c b/openair1/SCHED/nfapi_nr_dummy.c
index 1286a4e48a..511911723f 100644
--- a/openair1/SCHED/nfapi_nr_dummy.c
+++ b/openair1/SCHED/nfapi_nr_dummy.c
@@ -13,11 +13,11 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu){}
int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type){return 0;}
-void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
- nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
+void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
+ nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
uint8_t *sdu){
- }
-void handle_nfapi_nr_csirs_pdu(PHY_VARS_gNB *gNB,
+}
+void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
int frame, int slot,
nfapi_nr_dl_tti_csi_rs_pdu *csirs_pdu){
}
@@ -53,4 +53,3 @@ void install_nr_schedule_handlers(NR_IF_Module_t *if_inst){}
//void nr_dump_frame_parms(NR_DL_FRAME_PARMS *fp){}
-
\ No newline at end of file
diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c
index fa762fa5b8..8f315ba214 100644
--- a/openair1/SCHED_NR/fapi_nr_l1.c
+++ b/openair1/SCHED_NR/fapi_nr_l1.c
@@ -30,6 +30,7 @@
* \warning
*/
#include "fapi_nr_l1.h"
+#include "common/ran_context.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
#include "PHY/NR_TRANSPORT/nr_dci.h"
@@ -43,7 +44,7 @@ extern int oai_nfapi_ul_tti_req(nfapi_nr_ul_tti_request_t *ul_tti_req);
extern uint8_t nfapi_mode;
-void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
+void handle_nr_nfapi_ssb_pdu(processingData_L1tx_t *msgTx,int frame,int slot,
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu)
{
@@ -53,11 +54,11 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
uint8_t i_ssb = dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.SsbBlockIndex;
LOG_D(PHY,"%d.%d : ssb index %d pbch_pdu: %x\n",frame,slot,i_ssb,dl_tti_pdu->ssb_pdu.ssb_pdu_rel15.bchPayload);
- if (gNB->ssb[i_ssb].active)
+ if (msgTx->ssb[i_ssb].active)
AssertFatal(1==0,"SSB PDU with index %d already active\n",i_ssb);
else {
- gNB->ssb[i_ssb].active = true;
- memcpy((void*)&gNB->ssb[i_ssb].ssb_pdu,&dl_tti_pdu->ssb_pdu,sizeof(dl_tti_pdu->ssb_pdu));
+ msgTx->ssb[i_ssb].active = true;
+ memcpy((void*)&msgTx->ssb[i_ssb].ssb_pdu,&dl_tti_pdu->ssb_pdu,sizeof(dl_tti_pdu->ssb_pdu));
}
}
@@ -100,46 +101,16 @@ void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
}*/
-void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
- int frame, int slot,
- nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu) {
-
- LOG_D(PHY,"Frame %d, Slot %d: DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, pdcch_pdu->pdcch_pdu_rel15.numDlDci);
-
- // copy dci configuration into gNB structure
- // gNB->pdcch_pdu = pdcch_pdu;
-
- nr_fill_dci(gNB,frame,slot,pdcch_pdu);
-
-}
-
-
-void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
- int frame, int slot,
- nfapi_nr_ul_dci_request_pdus_t *ul_dci_request_pdu) {
-
- LOG_D(PHY,"Frame %d, Slot %d: UL DCI processing - proc:slot_tx:%d pdcch_pdu_rel15->numDlDci:%d\n",frame,slot, slot, ul_dci_request_pdu->pdcch_pdu.pdcch_pdu_rel15.numDlDci);
-
- // copy dci configuration into gNB structure
- // gNB->ul_dci_pdu = ul_dci_request_pdu;
-
- nr_fill_ul_dci(gNB,frame,slot,ul_dci_request_pdu);
-
-}
-
-
-void handle_nfapi_nr_csirs_pdu(PHY_VARS_gNB *gNB,
- int frame, int slot,
+void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
+ int frame,int slot,
nfapi_nr_dl_tti_csi_rs_pdu *csirs_pdu) {
int found = 0;
for (int id=0; idcsirs_pdu[id];
+ NR_gNB_CSIRS_t *csirs = &msgTx->csirs_pdu[id];
if (csirs->active == 0) {
LOG_D(PHY,"Frame %d Slot %d CSI_RS with ID %d is now active\n",frame,slot,id);
- csirs->frame = frame;
- csirs->slot = slot;
csirs->active = 1;
memcpy((void*)&csirs->csirs_pdu, (void*)csirs_pdu, sizeof(nfapi_nr_dl_tti_csi_rs_pdu));
found = 1;
@@ -151,13 +122,13 @@ void handle_nfapi_nr_csirs_pdu(PHY_VARS_gNB *gNB,
}
-void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
+void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
uint8_t *sdu)
{
- nr_fill_dlsch(gNB,frame,slot,pdsch_pdu,sdu);
+ nr_fill_dlsch(msgTx,pdsch_pdu,sdu);
}
@@ -176,7 +147,11 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
AssertFatal(RC.gNB!=NULL,"RC.gNB is null\n");
AssertFatal(RC.gNB[Mod_id]!=NULL,"RC.gNB[%d] is null\n",Mod_id);
- gNB = RC.gNB[Mod_id];
+ gNB = RC.gNB[Mod_id];
+
+ notifiedFIFO_elt_t *res;
+ res = pullTpool(gNB->resp_L1_tx, gNB->threadPool);
+ processingData_L1tx_t *msgTx = (processingData_L1tx_t *)NotifiedFifoData(res);
uint8_t number_dl_pdu = (DL_req==NULL) ? 0 : DL_req->dl_tti_request_body.nPDUs;
uint8_t number_ul_dci_pdu = (UL_dci_req==NULL) ? 0 : UL_dci_req->numPdus;
@@ -184,7 +159,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
uint8_t number_tx_data_pdu = (TX_req == NULL) ? 0 : TX_req->Number_of_PDUs;
if (NFAPI_MODE == NFAPI_MONOLITHIC){
- if (DL_req != NULL && TX_req!=NULL)
+ if (DL_req != NULL && TX_req!=NULL && (number_dl_pdu > 0 || number_ul_dci_pdu > 0 || number_ul_tti_pdu > 0))
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SLOT:%04d/%d DL_req:SFN/SLO:%04d/%d:dl_pdu:%d tx_req:SFN/SLOT:%04d/%d:pdus:%d;ul_dci %d ul_tti %d\n",
frame,slot,
DL_req->SFN,DL_req->Slot,number_dl_pdu,
@@ -192,33 +167,31 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
number_ul_dci_pdu,number_ul_tti_pdu);
int pdcch_received=0;
- gNB->num_pdsch_rnti[slot]=0;
- for (int i=0; inumber_of_nr_dlsch_max; i++) {
- gNB->dlsch[i][0]->rnti=0;
- gNB->dlsch[i][0]->harq_mask=0;
- }
+ msgTx->num_pdsch_slot=0;
+ msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0;
+ msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci = 0;
+ msgTx->slot = slot;
+ msgTx->frame = frame;
for (int i=0;idl_tti_request_body.dl_tti_pdu_list[i];
LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_tti_pdu->PDUType);
switch (dl_tti_pdu->PDUType) {
case NFAPI_NR_DL_TTI_SSB_PDU_TYPE:
- handle_nr_nfapi_ssb_pdu(gNB,frame,slot,
+ handle_nr_nfapi_ssb_pdu(msgTx,frame,slot,
dl_tti_pdu);
break;
case NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE:
AssertFatal(pdcch_received == 0, "pdcch_received is not 0, we can only handle one PDCCH PDU per slot\n");
- handle_nfapi_nr_pdcch_pdu(gNB,
- frame, slot,
- &dl_tti_pdu->pdcch_pdu);
+ msgTx->pdcch_pdu = dl_tti_pdu->pdcch_pdu;
+
pdcch_received = 1;
break;
case NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE:
LOG_D(PHY,"frame %d, slot %d, Got NFAPI_NR_DL_TTI_CSI_RS_PDU_TYPE for %d.%d\n",frame,slot,DL_req->SFN,DL_req->Slot);
- handle_nfapi_nr_csirs_pdu(gNB,
- frame, slot,
+ handle_nfapi_nr_csirs_pdu(msgTx,frame,slot,
&dl_tti_pdu->csi_rs_pdu);
break;
@@ -229,16 +202,17 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
AssertFatal(TX_req->pdu_list[pduIndex].num_TLV == 1, "TX_req->pdu_list[%d].num_TLV %d != 1\n",
pduIndex,TX_req->pdu_list[pduIndex].num_TLV);
uint8_t *sdu = (uint8_t *)TX_req->pdu_list[pduIndex].TLVs[0].value.direct;
- handle_nr_nfapi_pdsch_pdu(gNB,frame,slot,&dl_tti_pdu->pdsch_pdu, sdu);
- break;
+ AssertFatal(msgTx->num_pdsch_slot < gNB->number_of_nr_dlsch_max,"Number of PDSCH PDUs %d exceeded the limit %d\n",
+ msgTx->num_pdsch_slot,gNB->number_of_nr_dlsch_max);
+ handle_nr_nfapi_pdsch_pdu(msgTx,&dl_tti_pdu->pdsch_pdu, sdu);
}
}
+ if (number_ul_dci_pdu > 0)
+ msgTx->ul_pdcch_pdu = UL_dci_req->ul_dci_pdu_list[number_ul_dci_pdu-1]; // copy the last pdu
+
+ pushNotifiedFIFO(gNB->resp_L1_tx,res);
- for (int i=0;iul_dci_pdu_list[i]);
- }
-
for (int i = 0; i < number_ul_tti_pdu; i++) {
switch (UL_tti_req->pdus_list[i].pdu_type) {
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
@@ -266,13 +240,13 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
if (number_ul_dci_pdu>0)
oai_nfapi_ul_dci_req(UL_dci_req);
-
+
if (number_dl_pdu>0)
oai_nfapi_dl_tti_req(DL_req);
if (number_tx_data_pdu>0)
oai_nfapi_tx_data_req(TX_req);
- }
-
+ }
+
}
diff --git a/openair1/SCHED_NR/fapi_nr_l1.h b/openair1/SCHED_NR/fapi_nr_l1.h
index 19c98e4ec0..f598b263c3 100644
--- a/openair1/SCHED_NR/fapi_nr_l1.h
+++ b/openair1/SCHED_NR/fapi_nr_l1.h
@@ -37,13 +37,13 @@
#include "nfapi_nr_interface_scf.h"
// added
-void handle_nr_nfapi_ssb_pdu(PHY_VARS_gNB *gNB,
+void handle_nr_nfapi_ssb_pdu(processingData_L1tx_t *msgTx,
int frame,int slot,
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdu);
void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO);
-void handle_nfapi_nr_csirs_pdu(PHY_VARS_gNB *gNB,
+void handle_nfapi_nr_csirs_pdu(processingData_L1tx_t *msgTx,
int frame, int slot,
nfapi_nr_dl_tti_csi_rs_pdu *csirs_pdu);
@@ -51,12 +51,12 @@ void handle_nfapi_nr_pdcch_pdu(PHY_VARS_gNB *gNB,
int frame, int subframe,
nfapi_nr_dl_tti_pdcch_pdu *dcl_dl_pdu);
-void handle_nr_nfapi_pdsch_pdu(PHY_VARS_gNB *gNB,int frame,int slot,
+void handle_nr_nfapi_pdsch_pdu(processingData_L1tx_t *msgTx,
nfapi_nr_dl_tti_pdsch_pdu *pdsch_pdu,
uint8_t *sdu);
-void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid, uint8_t crc_flag);
+void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int UE_id, uint8_t harq_pid, uint8_t crc_flag,int dtx_flag);
//added
void handle_nfapi_nr_ul_dci_pdu(PHY_VARS_gNB *gNB,
diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c
index cc51ce7fe3..1ea8dbdf3c 100644
--- a/openair1/SCHED_NR/nr_prach_procedures.c
+++ b/openair1/SCHED_NR/nr_prach_procedures.c
@@ -49,6 +49,59 @@
extern uint8_t nfapi_mode;
+uint8_t get_nr_prach_duration(uint8_t prach_format){
+
+ switch(prach_format){
+
+ case 0: // format 0
+ return 0;
+
+ case 1: // format 1
+ return 0;
+
+ case 2: // format 2
+ return 0;
+
+ case 3: // format 3
+ return 0;
+
+ case 4: // format A1
+ return 2;
+
+ case 5: // format A2
+ return 4;
+
+ case 6: // format A3
+ return 6;
+
+ case 7: // format B1
+ return 2;
+
+ case 8: // format B4
+ return 12;
+
+ case 9: // format C0
+ return 2;
+
+ case 10: // format C2
+ return 6;
+
+ case 11: // format A1/B1
+ return 2;
+
+ case 12: // format A2/B2
+ return 4;
+
+ case 13: // format A3/B3
+ return 6;
+
+ default :
+ AssertFatal(1==0,"Invalid Prach format\n");
+ break;
+
+ }
+}
+
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
uint16_t max_preamble[4]={0},max_preamble_energy[4]={0},max_preamble_delay[4]={0};
@@ -121,7 +174,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
- LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n",
+ LOG_I(NR_PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB (I0 %d, thres %d), delay %d start symbol %u freq index %u\n",
gNB->Mod_id,
frame,
slot,
diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c
index eb0a4f8cdc..d8fa11d157 100644
--- a/openair1/SCHED_NR/nr_ru_procedures.c
+++ b/openair1/SCHED_NR/nr_ru_procedures.c
@@ -531,12 +531,12 @@ void nr_fep0(RU_t *ru, int first_half) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX+proc->tti_rx, 1);
- // remove_7_5_kHz(ru,(slot&1)+(proc->tti_rx<<1));
+ int offset = (proc->tti_rx&3) * fp->symbols_per_slot * fp->ofdm_symbol_size;
for (l = start_symbol; l < end_symbol; l++) {
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
nr_slot_fep_ul(fp,
ru->common.rxdata[aa],
- ru->common.rxdataF[aa],
+ &ru->common.rxdataF[aa][offset],
l,
proc->tti_rx,
ru->N_TA_offset);
@@ -665,14 +665,15 @@ void nr_fep_full(RU_t *ru, int slot) {
start_meas(&ru->ofdm_demod_stats);
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
+
// remove_7_5_kHz(ru,proc->tti_rx<<1);
// remove_7_5_kHz(ru,1+(proc->tti_rx<<1));
-
+ int offset = (proc->tti_rx&3)*(fp->symbols_per_slot * fp->ofdm_symbol_size);
for (l = 0; l < fp->symbols_per_slot; l++) {
for (aa = 0; aa < fp->nb_antennas_rx; aa++) {
nr_slot_fep_ul(fp,
ru->common.rxdata[aa],
- ru->common.rxdataF[aa],
+ &ru->common.rxdataF[aa][offset],
l,
proc->tti_rx,
ru->N_TA_offset);
diff --git a/openair1/SCHED_NR/phy_frame_config_nr.c b/openair1/SCHED_NR/phy_frame_config_nr.c
index 9be6780597..25c39846fe 100644
--- a/openair1/SCHED_NR/phy_frame_config_nr.c
+++ b/openair1/SCHED_NR/phy_frame_config_nr.c
@@ -30,6 +30,7 @@
************************************************************************/
#include "PHY/defs_nr_common.h"
+#include "PHY/defs_gNB.h"
#include "PHY/defs_nr_UE.h"
#include "SCHED_NR/phy_frame_config_nr.h"
@@ -308,6 +309,21 @@ int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms) {
*
*********************************************************************/
+int get_next_downlink_slot(PHY_VARS_gNB *gNB, nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_slot) {
+
+ int slot = nr_slot;
+ int frame = nr_frame;
+ int slots_per_frame = gNB->frame_parms.slots_per_frame;
+ while (true) {
+ slot++;
+ if (slot/slots_per_frame) frame++;
+ slot %= slots_per_frame;
+ int slot_type = nr_slot_select(cfg, frame, slot);
+ if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT) return slot;
+ AssertFatal(frame < (nr_frame+2), "Something went worng. This shouldn't happen\n");
+ }
+}
+
int nr_slot_select(nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_slot) {
/* for FFD all slot can be considered as an uplink */
int mu = cfg->ssb_config.scs_common.value,check_slot=0;
diff --git a/openair1/SCHED_NR/phy_frame_config_nr.h b/openair1/SCHED_NR/phy_frame_config_nr.h
index 434dc41d1f..aba26283ed 100644
--- a/openair1/SCHED_NR/phy_frame_config_nr.h
+++ b/openair1/SCHED_NR/phy_frame_config_nr.h
@@ -92,5 +92,7 @@ void free_tdd_configuration_nr(NR_DL_FRAME_PARMS *frame_parms);
void free_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms);
+int get_next_downlink_slot(PHY_VARS_gNB *gNB, nfapi_nr_config_request_scf_t *cfg, int nr_frame, int nr_slot);
+
#endif /* PHY_FRAME_CONFIG_NR_H */
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 0a87a08a56..63cf6f2f2d 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -124,10 +124,12 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_
}
-void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
- int frame,int slot,
+void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
+ int frame,
+ int slot,
int do_meas) {
int aa;
+ PHY_VARS_gNB *gNB = msgTx->gNB;
NR_DL_FRAME_PARMS *fp=&gNB->frame_parms;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
int offset = gNB->CC_id;
@@ -138,7 +140,7 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,1);
- if (do_meas==1) start_meas(&gNB->phy_proc_tx);
+ if (do_meas==1) start_meas(&msgTx->phy_proc_tx);
// clear the transmit data array and beam index for the current slot
for (aa=0; aacarrier_config.num_tx_ant.value; aa++) {
@@ -147,58 +149,44 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,1);
-
for (int i=0; iLmax; i++) {
- if (gNB->ssb[i].active) {
- nr_common_signal_procedures(gNB,frame,slot,gNB->ssb[i].ssb_pdu);
- gNB->ssb[i].active = false;
+ if (msgTx->ssb[i].active) {
+ nr_common_signal_procedures(gNB,frame,slot,msgTx->ssb[i].ssb_pdu);
+ msgTx->ssb[i].active = false;
}
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_COMMON_TX,0);
- int pdcch_pdu_id=find_nr_pdcch(frame,slot,gNB,SEARCH_EXIST);
- int ul_pdcch_pdu_id=find_nr_ul_dci(frame,slot,gNB,SEARCH_EXIST);
+ int num_dl_dci = msgTx->pdcch_pdu.pdcch_pdu_rel15.numDlDci;
+ int num_ul_dci = msgTx->ul_pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci;
- LOG_D(PHY,"[gNB %d] Frame %d slot %d, pdcch_pdu_id %d, ul_pdcch_pdu_id %d\n",
- gNB->Mod_id,frame,slot,pdcch_pdu_id,ul_pdcch_pdu_id);
-
- if (pdcch_pdu_id >= 0 || ul_pdcch_pdu_id >= 0) {
+ if (num_dl_dci > 0 || num_ul_dci > 0) {
LOG_D(PHY, "[gNB %d] Frame %d slot %d Calling nr_generate_dci_top (number of UL/DL DCI %d/%d)\n",
- gNB->Mod_id, frame, slot,
- gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu.pdcch_pdu_rel15.numDlDci,
- gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu.pdcch_pdu_rel15.numDlDci);
+ gNB->Mod_id, frame, slot, num_ul_dci, num_dl_dci);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,1);
nr_generate_dci_top(gNB,
- pdcch_pdu_id>=0 ? &gNB->pdcch_pdu[pdcch_pdu_id].pdcch_pdu : NULL,
- ul_pdcch_pdu_id>=0 ? &gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].pdcch_pdu.pdcch_pdu : NULL,
+ num_dl_dci > 0 ? &msgTx->pdcch_pdu : NULL,
+ num_ul_dci > 0 ? &msgTx->ul_pdcch_pdu.pdcch_pdu : NULL,
gNB->nr_gold_pdcch_dmrs[slot],
&gNB->common_vars.txdataF[0][txdataF_offset],
AMP, fp);
- // free up entry in pdcch tables
- if (pdcch_pdu_id>=0) gNB->pdcch_pdu[pdcch_pdu_id].frame = -1;
- if (ul_pdcch_pdu_id>=0) gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].frame = -1;
-
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_PDCCH_TX,0);
- if (pdcch_pdu_id >= 0) gNB->pdcch_pdu[pdcch_pdu_id].frame = -1;
- if (ul_pdcch_pdu_id >= 0) gNB->ul_pdcch_pdu[ul_pdcch_pdu_id].frame = -1;
}
- for (int i=0; inum_pdsch_rnti[slot]; i++) {
+ if (msgTx->num_pdsch_slot > 0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,1);
- LOG_D(PHY, "PDSCH generation started (%d) in frame %d.%d\n", gNB->num_pdsch_rnti[slot],frame,slot);
- nr_generate_pdsch(gNB,frame, slot);
+ LOG_D(PHY, "PDSCH generation started (%d) in frame %d.%d\n", msgTx->num_pdsch_slot,frame,slot);
+ nr_generate_pdsch(msgTx, frame, slot);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
}
for (int i=0;icsirs_pdu[i];
- if ((csirs->active == 1) &&
- (csirs->frame == frame) &&
- (csirs->slot == slot) ) {
+ NR_gNB_CSIRS_t *csirs = &msgTx->csirs_pdu[i];
+ if ((csirs->active == 1)) {
LOG_D(PHY, "CSI-RS generation started in frame %d.%d\n",frame,slot);
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t csi_params = csirs->csirs_pdu.csi_rs_pdu_rel15;
nr_generate_csi_rs(gNB, AMP, csi_params, gNB->gNB_config.cell_config.phy_cell_id.value, slot);
@@ -206,9 +194,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
}
}
- if (do_meas==1) stop_meas(&gNB->phy_proc_tx);
+ if (do_meas==1) stop_meas(&msgTx->phy_proc_tx);
- if ((frame&127) == 0) dump_pdsch_stats(gNB);
+// if ((frame&127) == 0) dump_pdsch_stats(gNB);
//apply the OFDM symbol rotation here
for (aa=0; aacarrier_config.num_tx_ant.value; aa++) {
@@ -234,6 +222,7 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
NR_gNB_ULSCH_t *ulsch = rdata->ulsch;
int r = rdata->segment_r;
+ nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[rdata->ulsch_id][0]->harq_processes[rdata->harq_pid]->ulsch_pdu;
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
ulsch_harq->processedSegments++;
@@ -260,21 +249,30 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
}
}
- // if all segments are done
+ //int dumpsig=0;
+ // if all segments are done
if (rdata->nbSegments == ulsch_harq->processedSegments) {
if (decodeSuccess) {
- LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n",
- gNB->Mod_id,ulsch_harq->slot,ulsch_harq->TBS);
+ LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for SFN/SF %d.%d (pid %d, ndi %d, status %d, round %d, TBS %d, Max interation (all seg) %d)\n",
+ gNB->Mod_id,ulsch_harq->frame,ulsch_harq->slot,rdata->harq_pid,pusch_pdu->pusch_data.new_data_indicator,ulsch_harq->status,ulsch_harq->round,ulsch_harq->TBS,rdata->decodeIterations);
ulsch_harq->status = SCH_IDLE;
ulsch_harq->round = 0;
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
LOG_D(PHY, "ULSCH received ok \n");
- nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0);
+ nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0,0);
+ //dumpsig=1;
} else {
- LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d\n",
+ LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, ndi %d, status %d, round %d, RV %d, prb_start %d, prb_size %d, TBS %d) r %d\n",
gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot,
- rdata->harq_pid,ulsch_harq->status, ulsch_harq->round,ulsch_harq->TBS,r);
+ rdata->harq_pid, pusch_pdu->pusch_data.new_data_indicator, ulsch_harq->status,
+ ulsch_harq->round,
+ ulsch_harq->ulsch_pdu.pusch_data.rv_index,
+ ulsch_harq->ulsch_pdu.rb_start,
+ ulsch_harq->ulsch_pdu.rb_size,
+ ulsch_harq->TBS,
+ r);
+ ulsch_harq->round++;
if (ulsch_harq->round >= ulsch->Mlimit) {
ulsch_harq->status = SCH_IDLE;
ulsch_harq->round = 0;
@@ -284,8 +282,42 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
ulsch_harq->handled = 1;
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
- nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1);
+ nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1,0);
}
+/*
+ if (ulsch_harq->ulsch_pdu.mcs_index == 9 && dumpsig==1) {
+#ifdef __AVX2__
+ int off = ((ulsch_harq->ulsch_pdu.rb_size&1) == 1)? 4:0;
+#else
+ int off = 0;
+#endif
+
+ LOG_M("rxsigF0_ext.m","rxsF0_ext",
+ &gNB->pusch_vars[0]->rxdataF_ext[0][ulsch_harq->ulsch_pdu.start_symbol_index*NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
+ LOG_M("chestF0.m","chF0",
+ &gNB->pusch_vars[0]->ul_ch_estimates[0][ulsch_harq->ulsch_pdu.start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
+ LOG_M("chestF0_ext.m","chF0_ext",
+ &gNB->pusch_vars[0]->ul_ch_estimates_ext[0][(ulsch_harq->ulsch_pdu.start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],
+ (ulsch_harq->ulsch_pdu.nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
+ LOG_M("rxsigF0_comp.m","rxsF0_comp",
+ &gNB->pusch_vars[0]->rxdataF_comp[0][ulsch_harq->ulsch_pdu.start_symbol_index*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
+ LOG_M("rxsigF0_llr.m","rxsF0_llr",
+ &gNB->pusch_vars[0]->llr[0],(ulsch_harq->ulsch_pdu.nr_of_symbols-1)*NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size * ulsch_harq->ulsch_pdu.qam_mod_order,1,0);
+ if (gNB->frame_parms.nb_antennas_rx > 1) {
+
+ LOG_M("rxsigF1_ext.m","rxsF0_ext",
+ &gNB->pusch_vars[0]->rxdataF_ext[1][ulsch_harq->ulsch_pdu.start_symbol_index*NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
+ LOG_M("chestF1.m","chF1",
+ &gNB->pusch_vars[0]->ul_ch_estimates[1][ulsch_harq->ulsch_pdu.start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
+ LOG_M("chestF1_ext.m","chF1_ext",
+ &gNB->pusch_vars[0]->ul_ch_estimates_ext[1][(ulsch_harq->ulsch_pdu.start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],
+ (ulsch_harq->ulsch_pdu.nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
+ LOG_M("rxsigF1_comp.m","rxsF1_comp",
+ &gNB->pusch_vars[0]->rxdataF_comp[1][ulsch_harq->ulsch_pdu.start_symbol_index*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size))],ulsch_harq->ulsch_pdu.nr_of_symbols*(off+(NR_NB_SC_PER_RB * ulsch_harq->ulsch_pdu.rb_size)),1,1);
+ }
+ exit(-1);
+
+ } */
ulsch->last_iteration_cnt = rdata->decodeIterations;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0);
}
@@ -367,7 +399,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
}
- void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag) {
+void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag, int dtx_flag) {
pthread_mutex_lock(&gNB->UL_INFO_mutex);
@@ -375,6 +407,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
int sync_pos;
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
+ NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
nfapi_nr_pusch_pdu_t *pusch_pdu = &harq_process->ulsch_pdu;
@@ -389,6 +422,8 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
sync_pos_rounded = sync_pos + (bw_scaling / 2) - 1;
else
sync_pos_rounded = sync_pos - (bw_scaling / 2) - 1;
+ if (stats) stats->sync_pos = sync_pos;
+
timing_advance_update = sync_pos_rounded / bw_scaling;
// put timing advance command in 0..63 range
@@ -397,8 +432,16 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
if (timing_advance_update < 0) timing_advance_update = 0;
if (timing_advance_update > 63) timing_advance_update = 63;
- LOG_D(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update);
-
+ if (crc_flag == 0) LOG_D(PHY, "%d.%d : Received PUSCH : Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", frame,slot_rx,sync_pos,timing_advance_update);
+ else if (harq_process->round>0 || dtx_flag == 0) { // increment round if crc_flag == 1 and not(dtx_flag ==1 and round==0)
+ harq_process->round++;
+ if (harq_process->round >= ulsch->Mlimit) {
+ harq_process->status = SCH_IDLE;
+ harq_process->round = 0;
+ harq_process->handled = 0;
+ ulsch->harq_mask &= ~(1 << harq_pid);
+ }
+ }
// estimate UL_CQI for MAC
int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) -
@@ -410,6 +453,41 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
else if (SNRtimes10 > 635) cqi=255;
else cqi=(640+SNRtimes10)/5;
+
+ if (0/*pusch_pdu->mcs_index == 9*/) {
+#ifdef __AVX2__
+ int off = ((pusch_pdu->rb_size&1) == 1)? 4:0;
+#else
+ int off = 0;
+#endif
+ LOG_M("rxsigF0.m","rxsF0",&gNB->common_vars.rxdataF[0][(slot_rx&3)*gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot],gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot,1,1);
+ LOG_M("rxsigF0_ext.m","rxsF0_ext",
+ &gNB->pusch_vars[0]->rxdataF_ext[0][pusch_pdu->start_symbol_index*NR_NB_SC_PER_RB * pusch_pdu->rb_size],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
+ LOG_M("chestF0.m","chF0",
+ &gNB->pusch_vars[0]->ul_ch_estimates[0][pusch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
+ LOG_M("chestF0_ext.m","chF0_ext",
+ &gNB->pusch_vars[0]->ul_ch_estimates_ext[0][(pusch_pdu->start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
+ (pusch_pdu->nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
+ LOG_M("rxsigF0_comp.m","rxsF0_comp",
+ &gNB->pusch_vars[0]->rxdataF_comp[0][pusch_pdu->start_symbol_index*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
+ LOG_M("rxsigF0_llr.m","rxsF0_llr",
+ &gNB->pusch_vars[0]->llr[0],(pusch_pdu->nr_of_symbols-1)*NR_NB_SC_PER_RB *pusch_pdu->rb_size * pusch_pdu->qam_mod_order,1,0);
+ if (gNB->frame_parms.nb_antennas_rx > 1) {
+ LOG_M("rxsigF1.m","rxsF1",&gNB->common_vars.rxdataF[1][(slot_rx&3)*gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot],gNB->frame_parms.ofdm_symbol_size*gNB->frame_parms.symbols_per_slot,1,1);
+ LOG_M("rxsigF1_ext.m","rxsF1_ext",
+ &gNB->pusch_vars[0]->rxdataF_ext[1][pusch_pdu->start_symbol_index*NR_NB_SC_PER_RB * pusch_pdu->rb_size],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
+ LOG_M("chestF1.m","chF1",
+ &gNB->pusch_vars[0]->ul_ch_estimates[1][pusch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size],gNB->frame_parms.ofdm_symbol_size,1,1);
+ LOG_M("chestF1_ext.m","chF1_ext",
+ &gNB->pusch_vars[0]->ul_ch_estimates_ext[1][(pusch_pdu->start_symbol_index+1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],
+ (pusch_pdu->nr_of_symbols-1)*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
+ LOG_M("rxsigF1_comp.m","rxsF1_comp",
+ &gNB->pusch_vars[0]->rxdataF_comp[1][pusch_pdu->start_symbol_index*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size))],pusch_pdu->nr_of_symbols*(off+(NR_NB_SC_PER_RB * pusch_pdu->rb_size)),1,1);
+ }
+ exit(-1);
+
+ }
+
// crc indication
uint16_t num_crc = gNB->UL_INFO.crc_ind.number_crcs;
gNB->UL_INFO.crc_ind.crc_list = &gNB->crc_pdu_list[0];
@@ -424,7 +502,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
gNB->crc_pdu_list[num_crc].ul_cqi = cqi;
gNB->crc_pdu_list[num_crc].timing_advance = timing_advance_update;
// in terms of dBFS range -128 to 0 with 0.1 step
- gNB->crc_pdu_list[num_crc].rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]));
+ gNB->crc_pdu_list[num_crc].rssi = (dtx_flag==0) ? 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0])) : 0;
gNB->UL_INFO.crc_ind.number_crcs++;
@@ -438,7 +516,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
gNB->rx_pdu_list[num_rx].harq_id = harq_pid;
gNB->rx_pdu_list[num_rx].ul_cqi = cqi;
gNB->rx_pdu_list[num_rx].timing_advance = timing_advance_update;
- gNB->rx_pdu_list[num_rx].rssi = 1280 - (10*dB_fixed(32767*32767)-dB_fixed_times10(gNB->pusch_vars[ULSCH_id]->ulsch_power[0]));
+ gNB->rx_pdu_list[num_rx].rssi = gNB->crc_pdu_list[num_crc].rssi;
if (crc_flag)
gNB->rx_pdu_list[num_rx].pdu_length = 0;
else {
@@ -454,66 +532,74 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
// Function to fill UL RB mask to be used for N0 measurements
void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
- int rb2, rb, nb_rb;
+ int rb = 0;
+ int rb2 = 0;
+ int prbpos = 0;
+
for (int symbol=0;symbol<14;symbol++) {
- if (gNB->gNB_config.tdd_table.max_tdd_periodicity_list[slot_rx].max_num_of_symbol_per_slot_list[symbol].slot_config.value==1){
- nb_rb = 0;
- for (int m=0;m<9;m++) gNB->rb_mask_ul[m] = 0;
- gNB->ulmask_symb = -1;
-
- for (int i=0;ipucch[i];
- if (pucch) {
- if ((pucch->active == 1) &&
- (pucch->frame == frame_rx) &&
- (pucch->slot == slot_rx) ) {
- gNB->ulmask_symb = symbol;
- nfapi_nr_pucch_pdu_t *pucch_pdu = &pucch->pucch_pdu;
- if ((symbol>=pucch_pdu->start_symbol_index) &&
- (symbol<(pucch_pdu->start_symbol_index + pucch_pdu->nr_of_symbols))){
- for (rb=0; rbprb_size; rb++) {
- rb2 = rb+pucch_pdu->prb_start+pucch_pdu->bwp_start;
- gNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
- }
- nb_rb+=pucch_pdu->prb_size;
- }
- }
- }
+ for (int m=0;m<9;m++) {
+ gNB->rb_mask_ul[symbol][m] = 0;
+ for (int i=0;i<32;i++) {
+ prbpos = (m*32)+i;
+ if (prbpos>gNB->frame_parms.N_RB_UL) break;
+ gNB->rb_mask_ul[symbol][m] |= (gNB->ulprbbl[prbpos]>0 ? 1 : 0)<number_of_nr_ulsch_max;ULSCH_id++) {
- NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
- int harq_pid;
- NR_UL_gNB_HARQ_t *ulsch_harq;
-
- if ((ulsch) &&
- (ulsch->rnti > 0)) {
- for (harq_pid=0;harq_pidharq_processes[harq_pid];
- AssertFatal(ulsch_harq!=NULL,"harq_pid %d is not allocated\n",harq_pid);
- if ((ulsch_harq->status == NR_ACTIVE) &&
- (ulsch_harq->frame == frame_rx) &&
- (ulsch_harq->slot == slot_rx) &&
- (ulsch_harq->handled == 0)){
- uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
- uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
- gNB->ulmask_symb = symbol;
- if ((symbol>=symbol_start) &&
- (symbolulsch_pdu.rb_size; rb++) {
- rb2 = rb+ulsch_harq->ulsch_pdu.rb_start+ulsch_harq->ulsch_pdu.bwp_start;
- gNB->rb_mask_ul[rb2>>5] |= (1<<(rb2&31));
- }
- nb_rb+=ulsch_harq->ulsch_pdu.rb_size;
- }
- }
- }
- }
- //TODO Add check for PRACH as well?
- }
- if (nb_rbframe_parms.N_RB_UL)
- return;
}
}
+
+ for (int i=0;ipucch[i];
+ if (pucch) {
+ if ((pucch->active == 1) &&
+ (pucch->frame == frame_rx) &&
+ (pucch->slot == slot_rx) ) {
+ nfapi_nr_pucch_pdu_t *pucch_pdu = &pucch->pucch_pdu;
+ LOG_D(PHY,"%d.%d pucch %d : start_symbol %d, nb_symbols %d, prb_size %d\n",frame_rx,slot_rx,i,pucch_pdu->start_symbol_index,pucch_pdu->nr_of_symbols,pucch_pdu->prb_size);
+ for (int symbol=pucch_pdu->start_symbol_index ; symbol<(pucch_pdu->start_symbol_index+pucch_pdu->nr_of_symbols);symbol++) {
+ if(gNB->frame_parms.frame_type == FDD ||
+ (gNB->frame_parms.frame_type == TDD && gNB->gNB_config.tdd_table.max_tdd_periodicity_list[slot_rx].max_num_of_symbol_per_slot_list[symbol].slot_config.value==1)) {
+ for (rb=0; rbprb_size; rb++) {
+ rb2 = rb + pucch_pdu->bwp_start +
+ ((symbol < pucch_pdu->start_symbol_index+(pucch_pdu->nr_of_symbols>>1)) || (pucch_pdu->freq_hop_flag == 0) ?
+ pucch_pdu->prb_start : pucch_pdu->second_hop_prb);
+ gNB->rb_mask_ul[symbol][rb2>>5] |= (1<<(rb2&31));
+ }
+ }
+ }
+ }
+ }
+ }
+
+ for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) {
+ NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
+ int harq_pid;
+ NR_UL_gNB_HARQ_t *ulsch_harq;
+ if ((ulsch) &&
+ (ulsch->rnti > 0)) {
+ for (harq_pid=0;harq_pidharq_processes[harq_pid];
+ AssertFatal(ulsch_harq!=NULL,"harq_pid %d is not allocated\n",harq_pid);
+ if ((ulsch_harq->status == NR_ACTIVE) &&
+ (ulsch_harq->frame == frame_rx) &&
+ (ulsch_harq->slot == slot_rx) &&
+ (ulsch_harq->handled == 0)){
+ uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
+ uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
+ for (int symbol=symbol_start ; symbolframe_parms.frame_type == FDD ||
+ (gNB->frame_parms.frame_type == TDD && gNB->gNB_config.tdd_table.max_tdd_periodicity_list[slot_rx].max_num_of_symbol_per_slot_list[symbol].slot_config.value==1)) {
+ LOG_D(PHY,"symbol %d Filling rb_mask_ul rb_size %d\n",symbol,ulsch_harq->ulsch_pdu.rb_size);
+ for (rb=0; rbulsch_pdu.rb_size; rb++) {
+ rb2 = rb+ulsch_harq->ulsch_pdu.rb_start+ulsch_harq->ulsch_pdu.bwp_start;
+ gNB->rb_mask_ul[symbol][rb2>>5] |= (1<<(rb2&31));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
}
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
@@ -551,8 +637,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,1);
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
- if (gNB->frame_parms.frame_type == TDD)
- fill_ul_rb_mask(gNB, frame_rx, slot_rx);
+ fill_ul_rb_mask(gNB, frame_rx, slot_rx);
int first_symb=0,num_symb=0;
if (gNB->frame_parms.frame_type == TDD)
@@ -563,7 +648,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
}
}
else num_symb=NR_NUMBER_OF_SYMBOLS_PER_SLOT;
- gNB_I0_measurements(gNB,first_symb,num_symb);
+ gNB_I0_measurements(gNB,slot_rx,first_symb,num_symb);
int offset = 10*gNB->frame_parms.ofdm_symbol_size + gNB->frame_parms.first_carrier_offset;
int power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset+(47*12)],12*18);
@@ -683,7 +768,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, harq_pid);
if (no_sig) {
LOG_D(PHY, "PUSCH not detected in frame %d, slot %d\n", frame_rx, slot_rx);
- nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
+ nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
return 1;
}
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot=0;
@@ -702,7 +787,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot),
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres);
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot = gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot;
- nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
+ nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1,1);
gNB->pusch_vars[ULSCH_id]->DTX=1;
if (stats) stats->DTX++;
return 1;
@@ -723,7 +808,7 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
stop_meas(&gNB->phy_proc_rx);
// figure out a better way to choose slot_rx, 19 is ok for a particular TDD configuration with 30kHz SCS
if ((frame_rx&127) == 0 && slot_rx==19) {
- LOG_I(PHY, "Number of bad PUCCH received: %lu\n", gNB->bad_pucch);
+ LOG_I(NR_PHY, "Number of bad PUCCH received: %lu\n", gNB->bad_pucch);
}
if (pucch_decode_done || pusch_decode_done) {
diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h
index 5e31c08d38..d7e0332b85 100644
--- a/openair1/SCHED_NR/sched_nr.h
+++ b/openair1/SCHED_NR/sched_nr.h
@@ -36,7 +36,7 @@
void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME_PARMS *fp);
-void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int frame_tx, int slot_tx, int do_meas);
+void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx, int frame_tx, int slot_tx, int do_meas);
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot);
diff --git a/openair1/SCHED_NR_UE/defs.h b/openair1/SCHED_NR_UE/defs.h
index 5bde9502dc..b3527365a5 100644
--- a/openair1/SCHED_NR_UE/defs.h
+++ b/openair1/SCHED_NR_UE/defs.h
@@ -340,8 +340,6 @@ uint16_t nr_get_n1_pucch(PHY_VARS_NR_UE *phy_vars_ue,
*/
UE_MODE_t get_nrUE_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t gNB_index);
-uint8_t get_ra_PreambleIndex(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_id);
-
/*! \brief This function implements the power control mechanism for PUCCH from 36.213.
@param phy_vars_ue PHY variables
@param proc Pointer to proc descriptor
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index 63935124a6..c9d8222e4c 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -52,7 +52,8 @@
#endif
#include "executables/softmodem-common.h"
#include "executables/nr-uesoftmodem.h"
-#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
+#include "LAYER2/NR_MAC_UE/mac_proto.h"
+#include "LAYER2/NR_MAC_UE/nr_l1_helpers.h"
//#define DEBUG_PHY_PROC
#define NR_PDCCH_SCHED
@@ -64,8 +65,6 @@
#define PUCCH
#endif
-#include "LAYER2/NR_MAC_UE/mac_defs.h"
-#include "LAYER2/NR_MAC_UE/mac_proto.h"
#include "common/utils/LOG/log.h"
#ifdef EMOS
@@ -226,12 +225,6 @@ UE_MODE_t get_nrUE_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t gNB_id){
return(PHY_vars_UE_g[Mod_id][CC_id]->UE_mode[gNB_id]);
}
-uint8_t get_ra_PreambleIndex(uint8_t Mod_id, uint8_t CC_id, uint8_t gNB_id){
-
- return PHY_vars_UE_g[Mod_id][CC_id]->prach_resources[gNB_id]->ra_PreambleIndex;
-
-}
-
// convert time factor "16 * 64 * T_c / (2^mu)" in N_TA calculation in TS38.213 section 4.2 to samples by multiplying with samples per second
// 16 * 64 * T_c / (2^mu) * samples_per_second
// = 16 * T_s / (2^mu) * samples_per_second
@@ -263,7 +256,7 @@ void ue_ta_procedures(PHY_VARS_NR_UE *ue, int slot_tx, int frame_tx){
ue->timing_advance += (ul_time_alignment->ta_command - 31) * bw_scaling;
- LOG_I(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
+ LOG_D(PHY, "In %s: [UE %d] [%d.%d] Got timing advance command %u from MAC, new value is %d\n",
__FUNCTION__,
ue->Mod_id,
frame_tx,
@@ -293,9 +286,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
LOG_D(PHY,"****** start TX-Chain for AbsSubframe %d.%d ******\n", frame_tx, slot_tx);
-#if UE_TIMING_TRACE
+
start_meas(&ue->phy_proc_tx);
-#endif
if (ue->UE_mode[gNB_id] <= PUSCH){
@@ -307,9 +299,8 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX, VCD_FUNCTION_OUT);
-#if UE_TIMING_TRACE
stop_meas(&ue->phy_proc_tx);
-#endif
+
}
@@ -491,8 +482,8 @@ unsigned int nr_get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb
#ifdef NR_PDCCH_SCHED
int nr_ue_pdcch_procedures(uint8_t gNB_id,
- PHY_VARS_NR_UE *ue,
- UE_nr_rxtx_proc_t *proc,
+ PHY_VARS_NR_UE *ue,
+ UE_nr_rxtx_proc_t *proc,
int n_ss)
{
int frame_rx = proc->frame_rx;
@@ -658,9 +649,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_IN);
-#if UE_TIMING_TRACE
- start_meas(&ue->dlsch_rx_pdcch_stats);
-#endif
+ start_meas(&ue->dlsch_rx_pdcch_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_IN);
#ifdef NR_PDCCH_SCHED_DEBUG
@@ -760,9 +749,7 @@ int nr_ue_pdcch_procedures(uint8_t gNB_id,
// send to mac
ue->if_inst->dl_indication(&dl_indication, NULL);
-#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_rx_pdcch_stats);
-#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_PDCCH_PROCEDURES, VCD_FUNCTION_OUT);
return(dci_cnt);
@@ -844,12 +831,10 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
else
first_symbol_flag = 0;
-#if UE_TIMING_TRACE
uint8_t slot = 0;
if(m >= ue->frame_parms.symbols_per_slot>>1)
slot = 1;
start_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
-#endif
// process DLSCH received symbols in the slot
// symbol by symbol processing (if data/DMRS are multiplexed is checked inside the function)
if (pdsch == PDSCH || pdsch == SI_PDSCH || pdsch == RA_PDSCH) {
@@ -868,13 +853,11 @@ int nr_ue_pdsch_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, int gNB_
return -1;
} else AssertFatal(1==0,"Not RA_PDSCH, SI_PDSCH or PDSCH\n");
-#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_llr_stats_parallelization[proc->thread_id][slot]);
-#if DISABLE_LOG_X
+#if PHYSIM
printf("[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0));
#else
LOG_D(PHY, "[AbsSFN %d.%d] LLR Computation Symbol %d %5.2f \n",frame_rx,nr_slot_rx,m,ue->dlsch_llr_stats_parallelization[proc->thread_id][slot].p_time/(cpuf*1000.0));
-#endif
#endif
if(first_symbol_flag) {
@@ -982,19 +965,17 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
dmrs_len,
dlsch0->harq_processes[harq_pid]->Qm,
dlsch0->harq_processes[harq_pid]->Nl);
-#if UE_TIMING_TRACE
- start_meas(&ue->dlsch_unscrambling_stats);
-#endif
- nr_dlsch_unscrambling(pdsch_vars->llr[0],
- dlsch0->harq_processes[harq_pid]->G,
- 0,
- ue->frame_parms.Nid_cell,
- dlsch0->rnti);
+
+ start_meas(&ue->dlsch_unscrambling_stats);
+ nr_dlsch_unscrambling(pdsch_vars->llr[0],
+ dlsch0->harq_processes[harq_pid]->G,
+ 0,
+ ue->frame_parms.Nid_cell,
+ dlsch0->rnti);
-#if UE_TIMING_TRACE
- stop_meas(&ue->dlsch_unscrambling_stats);
-#endif
+ stop_meas(&ue->dlsch_unscrambling_stats);
+
#if 0
LOG_I(PHY," ------ start ldpc decoder for AbsSubframe %d.%d / %d ------ \n", frame_rx, nr_slot_rx, harq_pid);
@@ -1007,9 +988,8 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
LOG_I(PHY,"start ldpc decode for CW 0 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, nr_slot_rx, harq_pid, ue->pdcch_vars[proc->thread_id][gNB_id]->num_pdcch_symbols);
#endif
-#if UE_TIMING_TRACE
- start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
-#endif
+
+ start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
if( dlsch_parallel) {
ret = nr_dlsch_decoding_mthread(ue,
@@ -1070,9 +1050,9 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
-#if UE_TIMING_TRACE
- stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
-#if DISABLE_LOG_X
+
+ stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
+#if PHYSIM
printf(" --> Unscrambling for CW0 %5.3f\n",
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
printf("AbsSubframe %d.%d --> LDPC Decoding for CW0 %5.3f\n",
@@ -1084,7 +1064,6 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
#endif
-#endif
if(is_cw1_active) {
// start ldpc decode for CW 1
dlsch1->harq_processes[harq_pid]->G = nr_get_G(dlsch1->harq_processes[harq_pid]->nb_rb,
@@ -1093,17 +1072,13 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
dmrs_len,
dlsch1->harq_processes[harq_pid]->Qm,
dlsch1->harq_processes[harq_pid]->Nl);
-#if UE_TIMING_TRACE
start_meas(&ue->dlsch_unscrambling_stats);
-#endif
nr_dlsch_unscrambling(pdsch_vars->llr[1],
dlsch1->harq_processes[harq_pid]->G,
0,
ue->frame_parms.Nid_cell,
dlsch1->rnti);
-#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_unscrambling_stats);
-#endif
#if 0
LOG_I(PHY,"start ldpc decode for CW 1 for AbsSubframe %d.%d / %d --> nb_rb %d \n", frame_rx, nr_slot_rx, harq_pid, dlsch1->harq_processes[harq_pid]->nb_rb);
@@ -1115,9 +1090,8 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
LOG_I(PHY,"start ldpc decode for CW 1 for AbsSubframe %d.%d / %d --> Pdcch Sym %d \n", frame_rx, nr_slot_rx, harq_pid, ue->pdcch_vars[proc->thread_id][gNB_id]->num_pdcch_symbols);
#endif
-#if UE_TIMING_TRACE
start_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
-#endif
+
if(dlsch_parallel) {
ret1 = nr_dlsch_decoding_mthread(ue,
@@ -1152,9 +1126,9 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
LOG_T(PHY,"CWW sequential dlsch decoding, ret1 = %d\n", ret1);
}
-#if UE_TIMING_TRACE
- stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
-#if DISABLE_LOG_X
+
+ stop_meas(&ue->dlsch_decoding_stats[proc->thread_id]);
+#if PHYSIM
printf(" --> Unscrambling for CW1 %5.3f\n",
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
printf("AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
@@ -1166,7 +1140,7 @@ bool nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
#endif
-#endif
+
LOG_D(PHY,"AbsSubframe %d.%d --> ldpc Decoding for CW1 %5.3f\n",
frame_rx%1024, nr_slot_rx,(ue->dlsch_decoding_stats[proc->thread_id].p_time)/(cpuf*1000.0));
@@ -1383,9 +1357,9 @@ void *UE_thread_slot1_dl_processing(void *arg) {
}
/**** Slot1 FE Processing ****/
-#if UE_TIMING_TRACE
+
start_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]);
-#endif
+
// I- start dl slot1 processing
// do first symbol of next downlink nr_slot_rx for channel estimation
/*
@@ -1410,9 +1384,8 @@ void *UE_thread_slot1_dl_processing(void *arg) {
{
//if( (l != pilot0) && (l != pilot1))
{
-#if UE_TIMING_TRACE
+
start_meas(&ue->ofdm_demod_stats);
-#endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_IN);
//printf("AbsSubframe %d.%d FFT slot %d, symbol %d\n", frame_rx,nr_slot_rx,slot1,l);
front_end_fft(ue,
@@ -1421,9 +1394,7 @@ void *UE_thread_slot1_dl_processing(void *arg) {
0,
0);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_SLOT_FEP, VCD_FUNCTION_OUT);
-#if UE_TIMING_TRACE
stop_meas(&ue->ofdm_demod_stats);
-#endif
}
} // for l=1..l2
@@ -1476,14 +1447,13 @@ void *UE_thread_slot1_dl_processing(void *arg) {
//printf(" [slot1 dl processing] ==> Start LLR Comuptation slot1 for AbsSubframe %d.%d \n", proc->frame_rx, proc->nr_slot_rx);
-#if UE_TIMING_TRACE
+
stop_meas(&ue->ue_front_end_per_slot_stat[proc->thread_id][1]);
-#if DISABLE_LOG_X
+#if PHYSIM
printf("[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
#else
LOG_D(PHY, "[AbsSFN %d.%d] Slot1: FFT + Channel Estimate + Pdsch Proc Slot0 %5.2f \n",frame_rx,nr_slot_rx,ue->ue_front_end_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
#endif
-#endif
//wait until pdcch is decoded
@@ -1501,9 +1471,8 @@ void *UE_thread_slot1_dl_processing(void *arg) {
//printf("AbsSubframe %d.%d Pdsch Procedure (slot1)\n",frame_rx,nr_slot_rx);
-#if UE_TIMING_TRACE
start_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]);
-#endif
+
// start slave thread for Pdsch Procedure (slot1)
// do procedures for C-RNTI
uint8_t gNB_id = 0;
@@ -1573,13 +1542,11 @@ void *UE_thread_slot1_dl_processing(void *arg) {
proc->llr_slot1_available=1;
//printf("Set available LLR slot1 to 1 AbsSubframe %d.%d \n",frame_rx,nr_slot_rx);
-#if UE_TIMING_TRACE
stop_meas(&ue->pdsch_procedures_per_slot_stat[proc->thread_id][1]);
-#if DISABLE_LOG_X
+#if PHYSIM
printf("[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
#else
LOG_D(PHY, "[AbsSFN %d.%d] Slot1: LLR Computation %5.2f \n",frame_rx,nr_slot_rx,ue->pdsch_procedures_per_slot_stat[proc->thread_id][1].p_time/(cpuf*1000.0));
-#endif
#endif
if (pthread_mutex_lock(&proc->mutex_slot1_dl_processing) != 0) {
@@ -1693,7 +1660,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_IN);
- LOG_D(PHY," ****** start RX-Chain for Frame.Slot %d.%d ****** \n", frame_rx%1024, nr_slot_rx);
+ LOG_D(PHY," ****** start RX-Chain for Frame.Slot %d.%d (energy %d dB)****** \n",
+ frame_rx%1024, nr_slot_rx,
+ dB_fixed(signal_energy(ue->common_vars.common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0],2048*14)));
/*
uint8_t next1_thread_id = proc->thread_id== (RX_NB_TH-1) ? 0:(proc->thread_id+1);
@@ -1720,13 +1689,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
(ue->symbol_offset+i)%(fp->symbols_per_slot),
nr_slot_rx);
-#if UE_TIMING_TRACE
+
start_meas(&ue->dlsch_channel_estimation_stats);
-#endif
nr_pbch_channel_estimation(ue,proc,gNB_id,nr_slot_rx,(ue->symbol_offset+i)%(fp->symbols_per_slot),i-1,(fp->ssb_index)&7,fp->half_frame_bit);
-#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_channel_estimation_stats);
-#endif
}
nr_ue_rsrp_measurements(ue, gNB_id, proc, nr_slot_rx, 0);
@@ -1754,9 +1720,9 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
}
if ((frame_rx%64 == 0) && (nr_slot_rx==0)) {
- LOG_I(PHY,"============================================\n");
- LOG_I(PHY,"Harq round stats for Downlink: %d/%d/%d/%d DLSCH errors: %d\n",ue->dl_stats[0],ue->dl_stats[1],ue->dl_stats[2],ue->dl_stats[3],ue->dl_stats[4]);
- LOG_I(PHY,"============================================\n");
+ LOG_I(NR_PHY,"============================================\n");
+ LOG_I(NR_PHY,"Harq round stats for Downlink: %d/%d/%d/%d DLSCH errors: %d\n",ue->dl_stats[0],ue->dl_stats[1],ue->dl_stats[2],ue->dl_stats[3],ue->dl_stats[4]);
+ LOG_I(NR_PHY,"============================================\n");
}
#ifdef NR_PDCCH_SCHED
@@ -1766,9 +1732,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
for (uint16_t l=0; lofdm_demod_stats);
-#endif
nr_slot_fep(ue,
proc,
l,
@@ -1792,9 +1756,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
fp->first_carrier_offset+(pdcch_vars->pdcch_config[n_ss].BWPStart + coreset_start_rb)*12,
coreset_nb_rb);
-#if UE_TIMING_TRACE
stop_meas(&ue->ofdm_demod_stats);
-#endif
+
}
dci_cnt = dci_cnt + nr_ue_pdcch_procedures(gNB_id, ue, proc, n_ss);
}
@@ -1844,10 +1807,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
curMsg->UE = ue;
curMsg->ue_sched_mode = ONLY_PUSCH;
pushTpool(&(get_nrUE_params()->Tpool), newElt);
-
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat);
-#endif
// do procedures for C-RNTI
int ret_pdsch = 0;
if (ue->dlsch[proc->thread_id][gNB_id][0]->active == 1) {
@@ -1944,9 +1904,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
LOG_D(PHY, "DLSCH data reception at nr_slot_rx: %d \n \n", nr_slot_rx);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC, VCD_FUNCTION_IN);
-#if UE_TIMING_TRACE
start_meas(&ue->dlsch_procedures_stat[proc->thread_id]);
-#endif
if (ret_pdsch >= 0)
nr_ue_dlsch_procedures(ue,
@@ -1958,10 +1916,8 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
&ue->dlsch_errors[gNB_id],
dlsch_parallel);
-
-#if UE_TIMING_TRACE
stop_meas(&ue->dlsch_procedures_stat[proc->thread_id]);
-#if DISABLE_LOG_X
+#if PHYSIM
printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n",nr_slot_rx,ue->pdsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
#else
@@ -1969,7 +1925,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n",nr_slot_rx,ue->dlsch_procedures_stat[proc->thread_id].p_time/(cpuf*1000.0));
#endif
-#endif
+
// deactivate dlsch once dlsch proc is done
ue->dlsch[proc->thread_id][gNB_id][0]->active = 0;
@@ -1978,9 +1934,7 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
}
-#if UE_TIMING_TRACE
start_meas(&ue->generic_stat);
-#endif
#if 0
@@ -2045,8 +1999,8 @@ if (nr_slot_rx==9) {
}
-#if UE_TIMING_TRACE
stop_meas(&ue->generic_stat);
+#if PHYSIM
printf("after tubo until end of Rx %5.2f \n",ue->generic_stat.p_time/(cpuf*1000.0));
#endif
@@ -2057,14 +2011,12 @@ phy_procedures_emos_UE_RX(ue,slot,gNB_id);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_RX, VCD_FUNCTION_OUT);
-#if UE_TIMING_TRACE
stop_meas(&ue->phy_proc_rx[proc->thread_id]);
-#if DISABLE_LOG_X
+#if PHYSIM
printf("------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0));
#else
LOG_D(PHY, "------FULL RX PROC [SFN %d]: %5.2f ------\n",nr_slot_rx,ue->phy_proc_rx[proc->thread_id].p_time/(cpuf*1000.0));
#endif
-#endif
//#endif //pdsch
diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
index 2dbe6dcb9a..77ac105e14 100644
--- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
+++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
@@ -38,7 +38,6 @@
#include "PHY/defs_nr_UE.h"
#include
#include
-#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
#include "openair1/PHY/NR_UE_ESTIMATION/nr_estimation.h"
#include
#include
@@ -58,115 +57,6 @@
uint8_t nr_is_cqi_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t gNB_id);
uint8_t nr_is_ri_TXOp(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t gNB_id);
-/* TS 36.213 Table 9.2.5.2-1: Code rate corresponding to higher layer parameter PUCCH-F2-maximum-coderate, */
-/* or PUCCH-F3-maximum-coderate, or PUCCH-F4-maximum-coderate */
-/* add one additional element set to 0 for parsing the array until this end */
-/* stored values are code rates * 100 */
-//static const int code_rate_r_time_100[8] = { (0.08 * 100), (0.15 * 100), (0.25*100), (0.35*100), (0.45*100), (0.60*100), (0.80*100), 0 } ;
-
-static float RSRP_meas_mapping_nr[98]
-= {
- -140,
- -139,
- -138,
- -137,
- -136,
- -135,
- -134,
- -133,
- -132,
- -131,
- -130,
- -129,
- -128,
- -127,
- -126,
- -125,
- -124,
- -123,
- -122,
- -121,
- -120,
- -119,
- -118,
- -117,
- -116,
- -115,
- -114,
- -113,
- -112,
- -111,
- -110,
- -109,
- -108,
- -107,
- -106,
- -105,
- -104,
- -103,
- -102,
- -101,
- -100,
- -99,
- -98,
- -97,
- -96,
- -95,
- -94,
- -93,
- -92,
- -91,
- -90,
- -89,
- -88,
- -87,
- -86,
- -85,
- -84,
- -83,
- -82,
- -81,
- -80,
- -79,
- -78,
- -77,
- -76,
- -75,
- -74,
- -73,
- -72,
- -71,
- -70,
- -69,
- -68,
- -67,
- -66,
- -65,
- -64,
- -63,
- -62,
- -61,
- -60,
- -59,
- -58,
- -57,
- -56,
- -55,
- -54,
- -53,
- -52,
- -51,
- -50,
- -49,
- -48,
- -47,
- -46,
- -45,
- -44,
- -43
- }
- ;
-
long
binary_search_float_nr(
float elements[],
@@ -341,12 +231,14 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
int tx_amp;
+ /*
tx_amp = nr_get_tx_amp(pucch_tx_power,
ue->tx_power_max_dBm,
ue->frame_parms.N_RB_UL,
nb_of_prbs);
- if (tx_amp == 0)
- tx_amp = AMP;
+ if (tx_amp == 0)*/
+ // FIXME temporarly using fixed amplitude before pucch power control implementation revised
+ tx_amp = AMP;
LOG_D(PHY,"Generation of PUCCH format %d at frame.slot %d.%d\n",pucch_pdu->format_type,proc->frame_tx,nr_slot_tx);
@@ -392,187 +284,10 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
}
-/*******************************************************************
-*
-* NAME : check_pucch_format
-*
-* PARAMETERS : ue context
-* processing slots of reception/transmission
-* gNB_id identifier
-*
-* RETURN : harq process identifier
-*
-* DESCRIPTION : return tx harq process identifier for given transmission slot
-* YS 38.213 9.2.2 PUCCH Formats for UCI transmission
-*
-*********************************************************************/
-
-boolean_t check_pucch_format(NR_UE_MAC_INST_t *mac, uint8_t gNB_id, pucch_format_nr_t format_pucch, int nb_symbols_for_tx, int uci_size)
-{
- pucch_format_nr_t selected_pucch_format;
- pucch_format_nr_t selected_pucch_format_second;
- /*NR_SetupRelease_PUCCH_FormatConfig_t *identified_format = NULL;
-
- switch (format_pucch) {
- case pucch_format1_nr:
- if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format1 != NULL)
- identified_format = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format1;
- break;
-
- case pucch_format2_nr:
- if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format2 != NULL)
- identified_format = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format2;
- break;
-
- case pucch_format3_nr:
- if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format3 != NULL)
- identified_format = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format3;
- break;
-
- case pucch_format4_nr:
- if (mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format4 != NULL)
- identified_format = mac->ULbwp[bwp_id-1]->bwp_Dedicated->pucch_Config->choice.setup->format4;
- break;
-
- default:
- break;
- }*/
-
- /* if ((identified_format != NULL) && (identified_format->choice.setup->nrofSlots[0] != 1)) {
- LOG_E(PHY,"PUCCH not implemented multislots transmission : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
- return (FALSE);
- }*/
-
- if (nb_symbols_for_tx <= 2) {
- if (uci_size <= 2) {
- selected_pucch_format = pucch_format0_nr;
- selected_pucch_format_second = selected_pucch_format;
- }
- else {
- selected_pucch_format = pucch_format2_nr;
- selected_pucch_format_second = selected_pucch_format;
- }
- }
- else {
- if (nb_symbols_for_tx >= 4) {
- if (uci_size <= 2) {
- selected_pucch_format = pucch_format1_nr;
- selected_pucch_format_second = selected_pucch_format;
- }
- else {
- selected_pucch_format = pucch_format3_nr; /* in this case choice can be done between two formats */
- selected_pucch_format_second = pucch_format4_nr;
- }
- }
- else {
- LOG_D(PHY,"PUCCH Undefined PUCCH format : set PUCCH to format 4 : at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
- return (FALSE);
- }
- }
-
- NR_TST_PHY_PRINTF("PUCCH format %d nb symbols total %d uci size %d selected format %d \n", format_pucch, nb_symbols_for_tx, uci_size, selected_pucch_format);
-
- if (format_pucch != selected_pucch_format) {
- if (format_pucch != selected_pucch_format_second) {
- NR_TST_PHY_PRINTF("PUCCH mismatched of selected format: at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
- LOG_D(PHY,"PUCCH format mismatched of selected format: at line %d in function %s of file %s \n", LINE_FILE , __func__, FILE_NAME);
- return (FALSE);
- }
- else {
- return (TRUE);
- }
- }
- else {
- return (TRUE);
- }
-}
-
-
-
-/*******************************************************************
-*
-* NAME : get_csi_nr
-* PARAMETERS : ue context
-* processing slots of reception/transmission
-* gNB_id identifier
-*
-* RETURN : size of csi payload
-*
-* DESCRIPTION : CSI management is not already implemented
-* so it has been simulated thank to two functions:
-* - set_csi_nr
-* - get_csi_nr
-*
-*********************************************************************/
int dummy_csi_status = 0;
uint32_t dummy_csi_payload = 0;
-/* FFS TODO_NR code that should be developed */
-
-uint16_t get_nr_csi_bitlen(NR_UE_MAC_INST_t *mac) {
-
- uint16_t csi_bitlen =0;
- uint16_t rsrp_bitlen = 0;
- uint16_t diff_rsrp_bitlen = 0;
- uint16_t nb_ssbri_cri = 0;
- uint16_t cri_ssbri_bitlen = 0;
-
- NR_CSI_MeasConfig_t *csi_MeasConfig = mac->cg->spCellConfig->spCellConfigDedicated->csi_MeasConfig->choice.setup;
- struct NR_CSI_ResourceConfig__csi_RS_ResourceSetList__nzp_CSI_RS_SSB * nzp_CSI_RS_SSB = csi_MeasConfig->csi_ResourceConfigToAddModList->list.array[0]->csi_RS_ResourceSetList.choice.nzp_CSI_RS_SSB;
-
- uint16_t nb_csi_ssb_report = nzp_CSI_RS_SSB->csi_SSB_ResourceSetList!=NULL ? nzp_CSI_RS_SSB->csi_SSB_ResourceSetList->list.count:0;
-
- if (0 != nb_csi_ssb_report){
- uint8_t nb_ssb_resources =0;
-
- if (NULL != csi_MeasConfig->csi_ReportConfigToAddModList->list.array[0]->groupBasedBeamReporting.choice.disabled->nrofReportedRS)
- nb_ssbri_cri = *(csi_MeasConfig->csi_ReportConfigToAddModList->list.array[0]->groupBasedBeamReporting.choice.disabled->nrofReportedRS)+1;
- else
- nb_ssbri_cri = 1;
-
- nb_ssb_resources = csi_MeasConfig->csi_SSB_ResourceSetToAddModList->list.array[0]->csi_SSB_ResourceList.list.count;
-
- if (nb_ssb_resources){
- cri_ssbri_bitlen =ceil(log2 (nb_ssb_resources));
- rsrp_bitlen = 7;
- diff_rsrp_bitlen = 4;
- }
- else{
- cri_ssbri_bitlen =0;
- rsrp_bitlen = 0;
- diff_rsrp_bitlen = 0;
- }
-
- csi_bitlen = ((cri_ssbri_bitlen * nb_ssbri_cri) + rsrp_bitlen +(diff_rsrp_bitlen *(nb_ssbri_cri -1 ))) *nb_csi_ssb_report;
-
- //printf("get csi bitlen %d nb_ssbri_cri %d nb_csi_report %d nb_resources %d\n", csi_bitlen,nb_ssbri_cri ,nb_csi_ssb_report, nb_ssb_resources);
- }
- return csi_bitlen;
-}
-
-int get_csi_nr(NR_UE_MAC_INST_t *mac, PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint32_t *csi_payload)
-{
- VOID_PARAMETER ue;
- VOID_PARAMETER gNB_id;
- float rsrp_db[7];
- int nElem = 98;
- int rsrp_offset = 17;
- int csi_status = 0;
-
- csi_status = get_nr_csi_bitlen(mac);
- rsrp_db[0] = get_nr_RSRP(0,0,0);
-
-
- if (csi_status == 0) {
- *csi_payload = 0;
- }
- else {
- *csi_payload = binary_search_float_nr(RSRP_meas_mapping_nr,nElem, rsrp_db[0]) + rsrp_offset;
- }
-
- return (csi_status);
-}
/* FFS TODO_NR code that should be removed */
diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h
index 101b80fb8d..37e24f43bc 100644
--- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h
+++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.h
@@ -41,8 +41,6 @@
/************** INCLUDE *******************************************/
#include "PHY/defs_nr_UE.h"
-#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
-#include "openair2/LAYER2/NR_MAC_UE/mac_defs.h"
#include "RRC/NR_UE/rrc_proto.h"
#ifdef DEFINE_VARIABLES_PUCCH_UE_NR_H
@@ -65,31 +63,6 @@ void pucch_procedures_ue_nr(PHY_VARS_NR_UE *ue,
uint8_t gNB_id,
UE_nr_rxtx_proc_t *proc);
-/** \brief This function check pucch format
- @param ue context
- @param gNB_id identity
- @param format_pucch pucch format
- @param nb_symbols_for_tx number of symbols for pucch transmission
- @param uci size number of uci bits
- @returns TRUE pucch format matched uci size and constraints, FALSE invalid pucch format */
-
-boolean_t check_pucch_format(NR_UE_MAC_INST_t *mac, uint8_t gNB_id, pucch_format_nr_t format_pucch, int nb_symbols_for_tx,
- int uci_size);
-
-/** \brief This function reads current CSI
- @param ue context
- @param gNB_id identity
- @param csi_payload is updated with CSI
- @returns number of bits of CSI */
-
-int get_csi_nr(NR_UE_MAC_INST_t *mac, PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint32_t *csi_payload);
-
-/** \brief This dummy function sets current CSI for simulation
- @param csi_status
- @param csi_payload is updated with CSI
- @returns none */
-
-uint16_t get_nr_csi_bitlen(NR_UE_MAC_INST_t *mac);
void set_csi_nr(int csi_status, uint32_t csi_payload);
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index 3a34efbb93..833207a408 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -182,7 +182,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
if (UE->perfect_ce==1) {
// fill in perfect channel estimates
- freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
+ freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1, 15);
/*
LOG_M("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8);
LOG_M("channelF.m","chF",eNB2UE[round]->chF[0],12*UE->frame_parms.N_RB_DL + 1,1,8);
@@ -193,7 +193,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
if(abstx) {
if (trials==0 && round==0) {
// calculate freq domain representation to compute SINR
- freq_channel(eNB2UE[0], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
+ freq_channel(eNB2UE[0], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
// snr=pow(10.0,.1*SNR);
fprintf(csv_fd,"%f,",SNR);
@@ -208,7 +208,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
}
if(num_rounds>1) {
- freq_channel(eNB2UE[1], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
+ freq_channel(eNB2UE[1], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarxnb_rx; aarx++) {
@@ -220,7 +220,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
}
}
- freq_channel(eNB2UE[2], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
+ freq_channel(eNB2UE[2], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarxnb_rx; aarx++) {
@@ -232,7 +232,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
}
}
- freq_channel(eNB2UE[3], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1);
+ freq_channel(eNB2UE[3], ru->frame_parms->N_RB_DL,2*ru->frame_parms->N_RB_DL + 1, 15);
for (u=0; u<2*ru->frame_parms->N_RB_DL; u++) {
for (aarx=0; aarxnb_rx; aarx++) {
diff --git a/openair1/SIMULATION/LTE_PHY/mbmssim.c b/openair1/SIMULATION/LTE_PHY/mbmssim.c
index 78fd1a293e..53c15ccc89 100644
--- a/openair1/SIMULATION/LTE_PHY/mbmssim.c
+++ b/openair1/SIMULATION/LTE_PHY/mbmssim.c
@@ -181,7 +181,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
if (UE->perfect_ce==1) {
// fill in perfect channel estimates
- freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1);
+ freq_channel(eNB2UE[round],UE->frame_parms.N_RB_DL,12*UE->frame_parms.N_RB_DL + 1, 15);
/*
LOG_M("channel.m","ch",eNB2UE[round]->ch[0],eNB2UE[round]->channel_length,1,8);
LOG_M("channelF.m","chF",eNB2UE[round]->chF[0],12*UE->frame_parms.N_RB_DL + 1,1,8);
@@ -192,7 +192,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
if(abstx) {
if (trials==0 && round==0) {
// calculate freq domain representation to compute SINR
- freq_channel(eNB2UE[0], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
+ freq_channel(eNB2UE[0], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
// snr=pow(10.0,.1*SNR);
fprintf(csv_fd,"%f,",SNR);
@@ -207,7 +207,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
}
if(num_rounds>1) {
- freq_channel(eNB2UE[1], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
+ freq_channel(eNB2UE[1], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) {
for (aarx=0; aarxnb_rx; aarx++) {
@@ -219,7 +219,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
}
}
- freq_channel(eNB2UE[2], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
+ freq_channel(eNB2UE[2], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) {
for (aarx=0; aarxnb_rx; aarx++) {
@@ -231,7 +231,7 @@ void DL_channel(RU_t *ru,PHY_VARS_UE *UE,uint subframe,int awgn_flag,double SNR,
}
}
- freq_channel(eNB2UE[3], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1);
+ freq_channel(eNB2UE[3], ru->frame_parms.N_RB_DL,2*ru->frame_parms.N_RB_DL + 1, 15);
for (u=0; u<2*ru->frame_parms.N_RB_DL; u++) {
for (aarx=0; aarxnb_rx; aarx++) {
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index 20a348f6c3..39593a640c 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -1102,7 +1102,7 @@ int main(int argc, char **argv) {
if(saving_bler==0)
if (trials==0 && round==0) {
// calculate freq domain representation to compute SINR
- freq_channel(UE2eNB, N_RB_DL,12*N_RB_DL + 1);
+ freq_channel(UE2eNB, N_RB_DL,12*N_RB_DL + 1, 15);
// snr=pow(10.0,.1*SNR);
fprintf(csv_fdUL,"%f,%u,%u,%f,%f,%f,",SNR,tx_lev,tx_lev_dB,sigma2_dB,tx_gain,SNR2);
diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c
index 633a214699..a0e0183fd1 100644
--- a/openair1/SIMULATION/NR_PHY/dlschsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlschsim.c
@@ -426,7 +426,9 @@ int main(int argc, char **argv)
UE->dlsch_SI[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
UE->dlsch_ra[0] = new_nr_ue_dlsch(1, 1, Nsoft, 5, N_RB_DL, 0);
unsigned char harq_pid = 0; //dlsch->harq_ids[subframe];
- NR_gNB_DLSCH_t *dlsch = gNB->dlsch[0][0];
+ processingData_L1tx_t msgDataTx;
+ init_DLSCH_struct(gNB, &msgDataTx);
+ NR_gNB_DLSCH_t *dlsch = msgDataTx.dlsch[0][0];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
//time_stats_t *rm_stats, *te_stats, *i_stats;
uint8_t is_crnti = 0, llr8_flag = 0;
@@ -634,7 +636,7 @@ int main(int argc, char **argv)
for (i = 0; i < 2; i++) {
printf("gNB %d\n", i);
- free_gNB_dlsch(&(gNB->dlsch[0][i]),N_RB_DL);
+ free_gNB_dlsch(&(msgDataTx.dlsch[0][i]),N_RB_DL);
printf("UE %d\n", i);
free_nr_ue_dlsch(&(UE->dlsch[0][0][i]),N_RB_DL);
}
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index 9c81443e0f..16c6c94bbe 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -27,6 +27,7 @@
#include
#include "common/ran_context.h"
#include "common/config/config_userapi.h"
+#include "common/utils/nr/nr_common.h"
#include "common/utils/LOG/log.h"
#include "LAYER2/NR_MAC_gNB/nr_mac_gNB.h"
#include "LAYER2/NR_MAC_UE/mac_defs.h"
@@ -263,19 +264,23 @@ void nr_dlsim_preprocessor(module_id_t module_id,
uint8_t nr_of_candidates;
find_aggregation_candidates(&sched_ctrl->aggregation_level,
&nr_of_candidates,
- sched_ctrl->search_space);
- sched_ctrl->coreset = get_coreset(scc, sched_ctrl->active_bwp, sched_ctrl->search_space, target_ss);
+ sched_ctrl->search_space,4);
+ sched_ctrl->coreset = get_coreset(module_id, scc, sched_ctrl->active_bwp->bwp_Dedicated, sched_ctrl->search_space, target_ss);
sched_ctrl->cce_index = 0;
NR_pdsch_semi_static_t *ps = &sched_ctrl->pdsch_semi_static;
ps->nrOfLayers = g_nrOfLayers;
+ int dci_format = sched_ctrl->search_space && sched_ctrl->search_space->searchSpaceType->choice.ue_Specific->dci_Formats ?
+ NR_DL_DCI_FORMAT_1_1 : NR_DL_DCI_FORMAT_1_0;
+
nr_set_pdsch_semi_static(scc,
UE_info->CellGroup[0],
sched_ctrl->active_bwp,
+ NULL,
/* tda = */ 2,
- /* num_dmrs_cdm_grps_no_data = */ 1,
+ dci_format,
ps);
NR_sched_pdsch_t *sched_pdsch = &sched_ctrl->sched_pdsch;
@@ -427,7 +432,9 @@ int main(int argc, char **argv)
FILE *scg_fd=NULL;
- while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:d:e:m:w:T:U:q")) != -1) {
+
+ while ((c = getopt (argc, argv, "f:hA:pf:g:in:s:S:t:x:y:z:M:N:F:GR:dPIL:Ea:b:D:e:m:w:T:U:q")) != -1) {
+
switch (c) {
case 'f':
scg_fd = fopen(optarg,"r");
@@ -593,7 +600,7 @@ int main(int argc, char **argv)
case 'b':
g_rbSize = atoi(optarg);
break;
- case 'd':
+ case 'D':
dlsch_threads = atoi(optarg);
break;
case 'e':
@@ -666,7 +673,7 @@ int main(int argc, char **argv)
printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:2} DMRS ConfType{1:2}, e.g. -U 3 0 2 1 \n");
printf("-P Print DLSCH performances\n");
printf("-w Write txdata to binary file (one frame)\n");
- printf("-d number of dlsch threads, 0: no dlsch parallelization\n");
+ printf("-D number of dlsch threads, 0: no dlsch parallelization\n");
exit (-1);
break;
}
@@ -683,7 +690,7 @@ int main(int argc, char **argv)
if (snr1set==0)
snr1 = snr0+10;
- init_dlsch_tpool(dlsch_threads);
+
RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
@@ -782,9 +789,9 @@ int main(int argc, char **argv)
AssertFatal((gNB->if_inst = NR_IF_Module_init(0))!=NULL,"Cannot register interface");
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
// common configuration
- rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, 0, 0, NULL);
+ rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 0, 0, NULL);
// UE dedicated configuration
- rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
+ rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
// reset preprocessor to the one of DLSIM after it has been set during
// rrc_mac_config_req_gNB
gNB_mac->pre_processor_dl = nr_dlsim_preprocessor;
@@ -931,8 +938,6 @@ int main(int argc, char **argv)
// generate signal
AssertFatal(input_fd==NULL,"Not ready for input signal file\n");
gNB->pbch_configured = 1;
- gNB->ssb[0].ssb_pdu.ssb_pdu_rel15.bchPayload=0x001234;
- gNB->ssb[0].ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = 0;
//Configure UE
rrc.carrier.MIB = (uint8_t*) malloc(4);
@@ -962,11 +967,29 @@ int main(int argc, char **argv)
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
snrRun = 0;
-
+ gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
+ char tp_param[] = "n";
+ initTpool(tp_param, gNB->threadPool, true);
+ gNB->resp_L1_tx = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
+ initNotifiedFIFO(gNB->resp_L1_tx);
+ // we create 2 threads for L1 tx processing
+ notifiedFIFO_elt_t *msgL1Tx = newNotifiedFIFO_elt(sizeof(processingData_L1tx_t),0,gNB->resp_L1_tx,processSlotTX);
+ processingData_L1tx_t *msgDataTx = (processingData_L1tx_t *)NotifiedFifoData(msgL1Tx);
+ init_DLSCH_struct(gNB, msgDataTx);
+ msgDataTx->slot = slot;
+ msgDataTx->frame = frame;
+ memset(msgDataTx->ssb, 0, 64*sizeof(NR_gNB_SSB_t));
+ reset_meas(&msgDataTx->phy_proc_tx);
+ gNB->phy_proc_tx_0 = &msgDataTx->phy_proc_tx;
+ pushTpool(gNB->threadPool,msgL1Tx);
+ if (dlsch_threads ) {
+ init_dlsch_tpool(dlsch_threads);
+ pthread_t dlsch0_threads;
+ threadCreate(&dlsch0_threads, dlsch_thread, (void *)UE, "DLthread", -1, OAI_PRIORITY_RT_MAX-1);
+ }
for (SNR = snr0; SNR < snr1; SNR += .2) {
varArray_t *table_tx=initVarArray(1000,sizeof(double));
- reset_meas(&gNB->phy_proc_tx); // total gNB tx
reset_meas(&gNB->dlsch_scrambling_stats);
reset_meas(&gNB->dlsch_interleaving_stats);
reset_meas(&gNB->dlsch_rate_matching_stats);
@@ -1007,7 +1030,7 @@ int main(int argc, char **argv)
int harq_pid = slot;
NR_DL_UE_HARQ_t *UE_harq_process = dlsch0->harq_processes[harq_pid];
- NR_gNB_DLSCH_t *gNB_dlsch = gNB->dlsch[0][0];
+ NR_gNB_DLSCH_t *gNB_dlsch = msgDataTx->dlsch[0][0];
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &gNB_dlsch->harq_process.pdsch_pdu.pdsch_pdu_rel15;
UE_harq_process->ack = 0;
@@ -1058,10 +1081,14 @@ int main(int argc, char **argv)
ptrsRePerSymb = ((rel15->rbSize + rel15->PTRSFreqDensity - 1)/rel15->PTRSFreqDensity);
printf("[DLSIM] PTRS Symbols in a slot: %2u, RE per Symbol: %3u, RE in a slot %4d\n", ptrsSymbPerSlot,ptrsRePerSymb, ptrsSymbPerSlot*ptrsRePerSymb );
}
+
+ msgDataTx->ssb[0].ssb_pdu.ssb_pdu_rel15.bchPayload=0x001234;
+ msgDataTx->ssb[0].ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = 0;
+ msgDataTx->gNB = gNB;
if (run_initial_sync)
- nr_common_signal_procedures(gNB,frame,slot,gNB->ssb[0].ssb_pdu);
+ nr_common_signal_procedures(gNB,frame,slot,msgDataTx->ssb[0].ssb_pdu);
else
- phy_procedures_gNB_TX(gNB,frame,slot,1);
+ phy_procedures_gNB_TX(msgDataTx,frame,slot,1);
int txdataF_offset = (slot%2) * frame_parms->samples_per_slot_wCP;
@@ -1263,17 +1290,17 @@ int main(int argc, char **argv)
(float) n_errors / (float) n_trials);
printf("*****************************************\n");
printf("\n");
- dump_pdsch_stats(gNB);
+ dump_pdsch_stats(stdout,gNB);
printf("SNR %f : n_errors (negative CRC) = %d/%d, Avg round %.2f, Channel BER %e, BLER %.2f, Eff Rate %.4f bits/slot, Eff Throughput %.2f, TBS %u bits/slot\n", SNR, n_errors, n_trials,roundStats[snrRun],berStats[snrRun],blerStats[snrRun],effRate,effRate/TBS*100,TBS);
printf("\n");
if (print_perf==1) {
printf("\ngNB TX function statistics (per %d us slot, NPRB %d, mcs %d, TBS %d, Kr %d (Zc %d))\n",
1000>>*scc->ssbSubcarrierSpacing, g_rbSize, g_mcsIndex,
- gNB->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3,
- gNB->dlsch[0][0]->harq_process.K,
- gNB->dlsch[0][0]->harq_process.K/((gNB->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10));
- printDistribution(&gNB->phy_proc_tx,table_tx,"PHY proc tx");
+ msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3,
+ msgDataTx->dlsch[0][0]->harq_process.K,
+ msgDataTx->dlsch[0][0]->harq_process.K/((msgDataTx->dlsch[0][0]->harq_process.pdsch_pdu.pdsch_pdu_rel15.TBSize[0]<<3)>3824?22:10));
+ printDistribution(gNB->phy_proc_tx_0,table_tx,"PHY proc tx");
printStatIndent2(&gNB->dlsch_encoding_stats,"DLSCH encoding time");
printStatIndent3(&gNB->dlsch_segmentation_stats,"DLSCH segmentation time");
printStatIndent3(&gNB->tinput,"DLSCH LDPC input processing time");
@@ -1326,6 +1353,8 @@ int main(int argc, char **argv)
LOG_M("chestF0.m","chF0",&UE->pdsch_vars[0][0]->dl_ch_estimates_ext[0][0],g_rbSize*12*14,1,1);
write_output("rxF_comp.m","rxFc",&UE->pdsch_vars[0][0]->rxdataF_comp0[0][0],N_RB_DL*12*14,1,1);
LOG_M("rxF_llr.m","rxFllr",UE->pdsch_vars[UE_proc.thread_id][0]->llr[0],available_bits,1,0);
+ LOG_M("pdcch_rxFcomp.m","pdcch_rxFcomp",&UE->pdcch_vars[0][0]->rxdataF_comp[0][0],96*12,1,1);
+ LOG_M("pdcch_rxFllr.m","pdcch_rxFllr",UE->pdcch_vars[0][0]->llr,96*12,1,1);
break;
}
diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c
index 46b42666b5..1169b8ecd8 100644
--- a/openair1/SIMULATION/NR_PHY/pbchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pbchsim.c
@@ -28,6 +28,7 @@
#include "common/config/config_userapi.h"
#include "common/utils/LOG/log.h"
#include "common/ran_context.h"
+#include "common/utils/nr/nr_common.h"
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/defs_nr_UE.h"
@@ -565,14 +566,15 @@ int main(int argc, char **argv)
nr_gold_pbch(UE);
+ processingData_L1tx_t msgDataTx;
// generate signal
if (input_fd==NULL) {
for (i=0; iLmax; i++) {
if((SSB_positions >> i) & 0x01) {
- gNB->ssb[i].ssb_pdu.ssb_pdu_rel15.bchPayload = 0x55dd33;
- gNB->ssb[i].ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = i;
+ msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.bchPayload = 0x55dd33;
+ msgDataTx.ssb[i].ssb_pdu.ssb_pdu_rel15.SsbBlockIndex = i;
start_symbol = nr_get_ssb_start_symbol(frame_parms,i);
int slot = start_symbol/14;
@@ -580,7 +582,7 @@ int main(int argc, char **argv)
for (aa=0; aaframe_parms.nb_antennas_tx; aa++)
memset(gNB->common_vars.txdataF[aa],0,frame_parms->samples_per_slot_wCP*sizeof(int32_t));
- nr_common_signal_procedures (gNB,frame,slot,gNB->ssb[i].ssb_pdu);
+ nr_common_signal_procedures (gNB,frame,slot,msgDataTx.ssb[i].ssb_pdu);
for (aa=0; aaframe_parms.nb_antennas_tx; aa++) {
if (cyclic_prefix_type == 1) {
@@ -750,7 +752,7 @@ int main(int argc, char **argv)
payload_ret = (UE->pbch_vars[0]->xtra_byte == gNB_xtra_byte);
for (i=0;i<3;i++){
- payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((gNB->ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
+ payload_ret += (UE->pbch_vars[0]->decoded_output[i] == ((msgDataTx.ssb[ssb_index].ssb_pdu.ssb_pdu_rel15.bchPayload>>(8*i)) & 0xff));
}
//printf("xtra byte gNB: 0x%02x UE: 0x%02x\n",gNB_xtra_byte, UE->pbch_vars[0]->xtra_byte);
//printf("ret %d\n", payload_ret);
diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c
index 96f6fe4990..6b9512a38b 100644
--- a/openair1/SIMULATION/NR_PHY/prachsim.c
+++ b/openair1/SIMULATION/NR_PHY/prachsim.c
@@ -47,6 +47,7 @@
#include "nr_unitary_defs.h"
#include "OCG_vars.h"
#include
+#include
#include
#include
#include
diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c
index a3eb4452d7..0aed6d9780 100644
--- a/openair1/SIMULATION/NR_PHY/pucchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pucchsim.c
@@ -67,7 +67,7 @@ void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
int main(int argc, char **argv)
{
char c;
- int i,aa=0;//,l;
+ int i;//,l;
double sigma2, sigma2_dB=10,SNR,snr0=-2.0,snr1=2.0;
double cfo=0;
uint8_t snr1set=0;
@@ -104,7 +104,8 @@ int main(int argc, char **argv)
SCM_t channel_model=AWGN;//Rayleigh1_anticorr;
double DS_TDL = .03;
-
+
+ double delay_us = 0;
int N_RB_DL=273,mu=1;
float target_error_rate=0.001;
int frame_length_complex_samples;
@@ -113,7 +114,7 @@ int main(int argc, char **argv)
//unsigned char frame_type = 0;
int loglvl=OAILOG_WARNING;
int sr_flag = 0;
-
+ int pucch_DTX_thres = 50;
cpuf = get_cpu_freq_GHz();
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0) {
@@ -123,7 +124,7 @@ int main(int argc, char **argv)
randominit(0);
logInit();
- while ((c = getopt (argc, argv, "f:hA:f:g:i:I:P:B:b:T:m:n:r:o:s:S:x:y:z:N:F:GR:IL:q:c")) != -1) {
+ while ((c = getopt (argc, argv, "f:hA:f:g:i:I:P:B:b:t:T:m:n:r:o:s:S:x:y:z:N:F:GR:IL:q:cd:")) != -1) {
switch (c) {
case 'f':
//write_output_file=1;
@@ -207,11 +208,11 @@ int main(int argc, char **argv)
printf("Setting SNR1 to %f\n",snr1);
break;
- /*
+
case 't':
- Td= atof(optarg);
+ pucch_DTX_thres= atoi(optarg);
break;
-
+ /*
case 'p':
extended_prefix_flag=1;
break;
@@ -228,6 +229,9 @@ int main(int argc, char **argv)
}
break;
*/
+ case 'd':
+ delay_us=atof(optarg);
+ break;
case 'x':
transmission_mode=atoi(optarg);
@@ -251,7 +255,7 @@ int main(int argc, char **argv)
case 'z':
n_rx=atoi(optarg);
- if ((n_rx==0) || (n_rx>2)) {
+ if ((n_rx==0) || (n_rx>8)) {
printf("Unsupported number of rx antennas %d\n",n_rx);
exit(-1);
}
@@ -346,29 +350,33 @@ int main(int argc, char **argv)
}
}
+ double phase = (1<2)&&(nr_bit<65)),"illegal combination format %d, nr_bit %d\n",
format,nr_bit);
+ int do_DTX=0;
+ if ((format < 2) && (actual_payload == 4)) do_DTX=1;
actual_payload &= ((1<pucch0_thres = pucch_DTX_thres;
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
frame_parms->nb_antennas_tx = n_tx;
frame_parms->nb_antennas_rx = n_rx;
@@ -430,31 +438,28 @@ int main(int argc, char **argv)
frame_length_complex_samples = frame_parms->samples_per_subframe*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
//frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP;
- s_re = malloc(2*sizeof(double*));
- s_im = malloc(2*sizeof(double*));
- r_re = malloc(2*sizeof(double*));
- r_im = malloc(2*sizeof(double*));
- txdataF = malloc(2*sizeof(int*));
- rxdataF = malloc(2*sizeof(int*));
+ s_re = malloc(n_tx*sizeof(double*));
+ s_im = malloc(n_tx*sizeof(double*));
+ r_re = malloc(n_rx*sizeof(double*));
+ r_im = malloc(n_rx*sizeof(double*));
+ txdataF = malloc(n_tx*sizeof(int*));
+ rxdataF = malloc(n_rx*sizeof(int*));
gNB->common_vars.rxdataF=rxdataF;
memcpy((void*)&gNB->frame_parms,(void*)frame_parms,sizeof(frame_parms));
- for (i=0; i<2; i++) {
+ for (int aatx=0; aatxsymbols_per_slot*frame_parms->ofdm_symbol_size);
+ txdataF[aatx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
+ bzero(txdataF[aatx],14*frame_parms->ofdm_symbol_size*sizeof(int));
+ }
- s_re[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(s_re[i],frame_length_complex_samples*sizeof(double));
- s_im[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(s_im[i],frame_length_complex_samples*sizeof(double));
-
- r_re[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(r_re[i],frame_length_complex_samples*sizeof(double));
- r_im[i] = malloc(frame_length_complex_samples*sizeof(double));
- bzero(r_im[i],frame_length_complex_samples*sizeof(double));
-
- printf("Allocating %d samples for txdataF/rxdataF\n",14*frame_parms->ofdm_symbol_size);
- txdataF[i] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
- bzero(txdataF[i],14*frame_parms->ofdm_symbol_size*sizeof(int));
- rxdataF[i] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
- bzero(rxdataF[i],14*frame_parms->ofdm_symbol_size*sizeof(int));
+ for (int aarx=0; aarxsymbols_per_slot*frame_parms->ofdm_symbol_size);
+ rxdataF[aarx] = memalign(32,14*frame_parms->ofdm_symbol_size*sizeof(int));
+ bzero(rxdataF[aarx],14*frame_parms->ofdm_symbol_size*sizeof(int));
}
uint8_t mcs=0;
@@ -471,14 +476,26 @@ int main(int argc, char **argv)
else AssertFatal(1==0,"Either nr_bit %d or sr_flag %d must be non-zero\n", nr_bit, sr_flag);
}
else if (format == 2 && nr_bit > 11) gNB->uci_polarParams = nr_polar_params(2, nr_bit, nrofPRB, 1, NULL);
-
- startingPRB_intraSlotHopping=N_RB_DL-1;
- uint32_t hopping_id=Nid_cell;
- uint32_t dmrs_scrambling_id = 0, data_scrambling_id=0;
+
+ startingPRB_intraSlotHopping = N_RB_DL-1;
+ uint32_t hopping_id = Nid_cell;
+ uint32_t dmrs_scrambling_id = 0;
+ uint32_t data_scrambling_id = 0;
//configure UE
- UE = malloc(sizeof(PHY_VARS_NR_UE));
+ UE = calloc(1,sizeof(PHY_VARS_NR_UE));
memcpy(&UE->frame_parms,frame_parms,sizeof(NR_DL_FRAME_PARMS));
+ UE->frame_parms.nb_antennas_rx=1;
+ UE->perfect_ce = 0;
+
+ if(eps!=0.0)
+ UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
+
+ if (init_nr_ue_signal(UE, 1, 0) != 0)
+ {
+ printf("Error at UE NR initialisation\n");
+ exit(-1);
+ }
fapi_nr_ul_config_pucch_pdu pucch_tx_pdu;
if (format==0) {
@@ -514,80 +531,112 @@ int main(int argc, char **argv)
pucch_tx_pdu.second_hop_prb = startingPRB_intraSlotHopping;
}
- UE->perfect_ce = 0;
-
- if(eps!=0.0)
- UE->UE_fo_compensation = 1; // if a frequency offset is set then perform fo estimation and compensation
-
- if (init_nr_ue_signal(UE, 1, 0) != 0)
- {
- printf("Error at UE NR initialisation\n");
- exit(-1);
- }
-
pucch_GroupHopping_t PUCCH_GroupHopping = pucch_tx_pdu.group_hop_flag + (pucch_tx_pdu.sequence_hop_flag<<1);
- //t_nrPolar_params *currentPtr;
-
- for(SNR=snr0;SNR<=snr1;SNR=SNR+1){
+ for(SNR=snr0;SNR<=snr1;SNR+=1){
ack_nack_errors=0;
sr_errors=0;
n_errors = 0;
for (trial=0; trialofdm_symbol_size*sizeof(int));
- if(format==0){
- nr_generate_pucch0(UE,
- txdataF,
- frame_parms,
- amp,
- nr_slot_tx,
- &pucch_tx_pdu);
+ for (int aatx=0;aatx<1;aatx++)
+ bzero(txdataF[aatx],frame_parms->ofdm_symbol_size*sizeof(int));
+ if(format==0 && do_DTX==0){
+ nr_generate_pucch0(UE, txdataF, frame_parms, amp, nr_slot_tx, &pucch_tx_pdu);
+ } else if (format == 1 && do_DTX==0){
+ nr_generate_pucch1(UE, txdataF, frame_parms, amp, nr_slot_tx, &pucch_tx_pdu);
+ } else if (do_DTX == 0){
+ nr_generate_pucch2(UE, txdataF, frame_parms, amp, nr_slot_tx, &pucch_tx_pdu);
}
- else if (format == 1){
- nr_generate_pucch1(UE,
- txdataF,
- frame_parms,
- amp,
- nr_slot_tx,
- &pucch_tx_pdu);
- }
- else {
- nr_generate_pucch2(UE,
- txdataF,
- frame_parms,
- amp,
- nr_slot_tx,
- &pucch_tx_pdu);
- }
-
- int txlev = signal_energy(&txdataF[aa][startingSymbolIndex*frame_parms->ofdm_symbol_size],
- frame_parms->ofdm_symbol_size);
- // printf("txlev %d (%d dB), offset %d\n",txlev,dB_fixed(txlev),startingSymbolIndex*frame_parms->ofdm_symbol_size);
-
- // note : this scaling
- int nb_re = (format == 0 || format == 1)? 12 : 12*nrofPRB;
- sigma2_dB = 10*log10((double)txlev*UE->frame_parms.ofdm_symbol_size/nb_re)-SNR;
- sigma2 = pow(10,sigma2_dB/10);
-
- for(i=startingSymbolIndex*frame_parms->ofdm_symbol_size; i<(startingSymbolIndex+1)*frame_parms->ofdm_symbol_size; i++) {
- ((int16_t*)rxdataF[aa])[i<<1] = (int16_t)(100.0*((double)(((int16_t *)txdataF[aa])[(i<<1)]) + sqrt(sigma2/2)*gaussdouble(0.0,1.0))/sqrt((double)txlev));
- ((int16_t*)rxdataF[aa])[1+(i<<1)]=(int16_t)(100.0*((double)(((int16_t *)txdataF[aa])[(i<<1)+1])+ sqrt(sigma2/2)*gaussdouble(0.0,1.0))/sqrt((double)txlev));
- }
- int rxlev = signal_energy(&rxdataF[aa][startingSymbolIndex*frame_parms->ofdm_symbol_size],
- frame_parms->ofdm_symbol_size);
- // noise measurement
- gNB->ulmask_symb = startingSymbolIndex;
- for (int rb=0; rb