Merge remote-tracking branch 'origin/develop' into nr_gold_init_improv
This commit is contained in:
@@ -222,7 +222,7 @@ pipeline {
|
||||
when { expression {doMandatoryTests} }
|
||||
steps {
|
||||
script {
|
||||
triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-4G')
|
||||
triggerSlaveJob ('RAN-RF-Sim-Test-5G', 'Test-RF-Sim-Container-5G')
|
||||
}
|
||||
}
|
||||
post {
|
||||
|
||||
@@ -136,16 +136,6 @@ pipeline {
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh"
|
||||
}
|
||||
// With Mosaic 5G being part of OSA and making all it's repositories public
|
||||
// No need to pass credentials to clone flexran-rtc
|
||||
if (doMandatoryTests) {
|
||||
sh "mkdir flexran"
|
||||
dir ('flexran') {
|
||||
sh "git clone https://gitlab.eurecom.fr/flexran/flexran-rtc.git . > ../git_clone.log 2>&1"
|
||||
sh "git checkout develop >> ../git_clone.log 2>&1"
|
||||
sh "zip -r -qq flexran.zip ."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
@@ -159,16 +149,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- basic-sim") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
timeout (time: 5, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --daemon"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Start VM -- gnb-usrp") {
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
@@ -211,15 +191,6 @@ pipeline {
|
||||
|
||||
stage ("Variant Builds") {
|
||||
parallel {
|
||||
stage ("Build basic simulator") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build basic-sim") {
|
||||
timeout (time: 45, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build 5G gNB-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build gNB-USRP") {
|
||||
@@ -270,9 +241,9 @@ pipeline {
|
||||
script {
|
||||
dir ('archives') {
|
||||
if (fileExists('red_hat')) {
|
||||
sh "zip -r -qq vm_build_logs.zip basic_sim enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat"
|
||||
sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp red_hat"
|
||||
} else {
|
||||
sh "zip -r -qq vm_build_logs.zip basic_sim enb_eth ue_eth gnb_usrp nr_ue_usrp"
|
||||
sh "zip -r -qq vm_build_logs.zip enb_eth ue_eth gnb_usrp nr_ue_usrp"
|
||||
}
|
||||
}
|
||||
if(fileExists('archives/vm_build_logs.zip')) {
|
||||
@@ -306,44 +277,6 @@ pipeline {
|
||||
parallel {
|
||||
stage ("VM-based tests") {
|
||||
stages {
|
||||
stage ("Build Flexran Controller") {
|
||||
when {
|
||||
expression {doMandatoryTests}
|
||||
}
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
try {
|
||||
sh "./ci-scripts/oai-ci-vm-tool build --workspace $WORKSPACE --variant flexran-rtc --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test basic simulator") {
|
||||
when {
|
||||
expression {doMandatoryTests}
|
||||
}
|
||||
steps {
|
||||
lock (vmResource) {
|
||||
script {
|
||||
timeout (time: 30, unit: 'MINUTES') {
|
||||
try {
|
||||
gitlabCommitStatus(name: "Test basic-sim") {
|
||||
sh "./ci-scripts/oai-ci-vm-tool test --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
} catch (Exception e) {
|
||||
currentBuild.result = 'FAILURE'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Test L1 simulator") {
|
||||
when {
|
||||
expression {doMandatoryTests}
|
||||
@@ -581,7 +514,7 @@ pipeline {
|
||||
script {
|
||||
if (doMandatoryTests) {
|
||||
dir ('archives') {
|
||||
sh "if [ -d basic_sim/test ] || [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi"
|
||||
sh "if [ -d rf_sim/test ] || [ -d l2_sim/test ]; then zip -r -qq vm_tests_logs.zip */test ; fi"
|
||||
}
|
||||
if(fileExists('archives/vm_tests_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_tests_logs.zip'
|
||||
|
||||
@@ -55,7 +55,9 @@ pipeline {
|
||||
stage ("Push to DockerHub") {
|
||||
steps {
|
||||
script {
|
||||
WEEK_TAG = sh returnStdout: true, script: 'date +"%Y.w%U"'
|
||||
WEEK_REF = sh returnStdout: true, script: 'date +"%Y.w%V"'
|
||||
WEEK_REF = WEEK_REF.trim()
|
||||
WEEK_TAG = sh returnStdout: true, script: 'python3 ./ci-scripts/provideUniqueImageTag.py --start_tag ' + WEEK_REF
|
||||
WEEK_TAG = WEEK_TAG.trim()
|
||||
|
||||
withCredentials([
|
||||
|
||||
@@ -62,7 +62,7 @@ function build_on_vm {
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
||||
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
|
||||
@@ -27,11 +27,11 @@ nrmodule2_quectel:
|
||||
Apn :
|
||||
OAICN5G : oai
|
||||
OAI-Rel14-Docker : oai.ipv4
|
||||
WakeupScript : ci_ctl_qtel.py /dev/ttyUSB7 wup
|
||||
DetachScript : ci_ctl_qtel.py /dev/ttyUSB7 detach
|
||||
WakeupScript : ci_ctl_qtel.py /dev/ttyUSB2 wup
|
||||
DetachScript : ci_ctl_qtel.py /dev/ttyUSB2 detach
|
||||
LogStore : /media/ci_qlogs
|
||||
PLMN : 20897
|
||||
UENetwork : wwan1
|
||||
UENetwork : wwan0
|
||||
HostIPAddress : 192.168.18.189
|
||||
HostUsername : nrmodule2
|
||||
HostPassword : linux
|
||||
|
||||
@@ -606,6 +606,8 @@ class Containerize():
|
||||
if containerToKill:
|
||||
mySSH.command('docker kill --signal INT ' + containerName, '\$', 30)
|
||||
time.sleep(5)
|
||||
mySSH.command('docker kill --signal KILL ' + containerName, '\$', 30)
|
||||
time.sleep(5)
|
||||
mySSH.command('docker logs ' + containerName + ' > ' + lSourcePath + '/cmake_targets/' + self.eNB_logFile[self.eNB_instance], '\$', 30)
|
||||
mySSH.command('docker rm -f ' + containerName, '\$', 30)
|
||||
# Forcing the down now to remove the networks and any artifacts
|
||||
|
||||
@@ -76,7 +76,8 @@ 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'] + ' ' + self.Process['Apn'][CNType] + ' > /dev/null 2>&1 &','\$',5)
|
||||
mySSH.command('echo ' + self.HostPassword + ' | sudo -S rm -f /tmp/quectel-cm.log','\$',5)
|
||||
mySSH.command('echo $USER; echo ' + self.HostPassword + ' | nohup sudo -S stdbuf -o0 ' + self.Process['Cmd'] + ' ' + self.Process['Apn'][CNType] + ' > /tmp/quectel-cm.log 2>&1 &','\$',5)
|
||||
mySSH.close()
|
||||
#checking the process
|
||||
time.sleep(5)
|
||||
|
||||
+31
-31
@@ -122,6 +122,7 @@ def GetPingTimeAnalysis(RAN,ping_log_file,ping_rttavg_threshold):
|
||||
try:
|
||||
mySSH = sshconnection.SSHConnection()
|
||||
mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file+'.png', RAN.eNBSourceCodePath + '/cmake_targets/')
|
||||
mySSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, ping_log_file, RAN.eNBSourceCodePath + '/cmake_targets/')
|
||||
except:
|
||||
logging.debug('\u001B[1;37;41m Ping PNG SCP to eNB FAILED\u001B[0m')
|
||||
|
||||
@@ -1598,7 +1599,7 @@ class OaiCiTest():
|
||||
else:
|
||||
if launchfromModule == False:
|
||||
#ping log file is on the python executor
|
||||
cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' 2>&1 > ping_' + self.testCase_id + '_' + device_id + '.log'
|
||||
cmd = 'ping ' + self.ping_args + ' ' + UE_IPAddress + ' > ping_' + self.testCase_id + '_' + device_id + '.log 2>&1'
|
||||
message = cmd + '\n'
|
||||
logging.debug(cmd)
|
||||
ret = subprocess.run(cmd, shell=True)
|
||||
@@ -1623,7 +1624,7 @@ class OaiCiTest():
|
||||
else:
|
||||
Target = EPC.IPAddress
|
||||
#ping from module NIC rather than IP address to make sure round trip is over the air
|
||||
cmd = 'ping -I ' + Module_UE.UENetwork + ' ' + self.ping_args + ' ' + Target + ' 2>&1 > ping_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
cmd = 'ping -I ' + Module_UE.UENetwork + ' ' + self.ping_args + ' ' + Target + ' > ping_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1'
|
||||
SSH.command(cmd,'\$',int(ping_time[0])*1.5)
|
||||
#copy the ping log file to have it locally for analysis (ping stats)
|
||||
SSH.copyin(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword, 'ping_' + self.testCase_id + '_' + self.ue_id + '.log', '.')
|
||||
@@ -2084,7 +2085,8 @@ class OaiCiTest():
|
||||
statusQueue.put(UE_IPAddress)
|
||||
statusQueue.put(report_msg)
|
||||
logging.debug('\u001B[1;37;45m TCP Bidir Iperf Result (' + UE_IPAddress + ') \u001B[0m')
|
||||
logging.debug('\u001B[1;35m ' + report_msg + '\u001B[0m')
|
||||
for rLine in report_msg.split('\n'):
|
||||
logging.debug('\u001B[1;35m ' + rLine + '\u001B[0m')
|
||||
lock.release()
|
||||
else:
|
||||
self.ping_iperf_wrong_exit(lock, UE_IPAddress, device_id, statusQueue, 'Bidir TCP : Could not analyze from Log file')
|
||||
@@ -2379,10 +2381,12 @@ class OaiCiTest():
|
||||
SSH.copyout(EPC.IPAddress, EPC.UserName, EPC.Password, 'iperf_' + self.testCase_id + '_' + device_id + '.log', EPC.SourceCodePath + '/scripts')
|
||||
|
||||
|
||||
def Iperf_Module(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC, Module_UE):
|
||||
def Iperf_Module(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC, Module_UE, RAN):
|
||||
SSH = sshconnection.SSHConnection()
|
||||
server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
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)
|
||||
SSH.command('docker inspect --format="TRF_IP_ADDR = {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}" prod-trf-gen', '\$', 5)
|
||||
result = re.search('TRF_IP_ADDR = (?P<trf_ip_addr>[0-9\.]+)', SSH.getBefore())
|
||||
@@ -2404,20 +2408,18 @@ class OaiCiTest():
|
||||
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 + ' &'
|
||||
cmd = 'echo $USER; nohup iperf -s -B ' + UE_IPAddress + ' -u -i 1 > ' + server_filename + ' 2>&1 &'
|
||||
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'
|
||||
#remove old client file in EPC.SourceCodePath
|
||||
cmd = 'rm ' + EPC.SourceCodePath + '/' + client_filename
|
||||
SSH.command(cmd,'\$',5)
|
||||
iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename
|
||||
iperf_cmd = 'bin/iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' > ' + client_filename + ' 2>&1'
|
||||
cmd = 'docker exec -w /iperf-2.0.13 -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)
|
||||
@@ -2433,19 +2435,17 @@ class OaiCiTest():
|
||||
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'
|
||||
|
||||
iperf_cmd = 'echo $USER; nohup bin/iperf -s -u 2>&1 > ' + server_filename
|
||||
iperf_cmd = 'echo $USER; nohup bin/iperf -s -u -i 1 > ' + server_filename + ' 2>&1'
|
||||
cmd = 'docker exec -d -w /iperf-2.0.13 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.command('iperf -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' > ' + client_filename + ' 2>&1', '\$', int(iperf_time)*5.0)
|
||||
SSH.close()
|
||||
|
||||
#once client is done, retrieve the server file from container to EPC Host
|
||||
@@ -2461,12 +2461,10 @@ class OaiCiTest():
|
||||
|
||||
elif self.iperf_direction=="BIDIR":
|
||||
logging.debug("Iperf for Module in BIDIR mode detected")
|
||||
server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
|
||||
#server side EPC
|
||||
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
|
||||
iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s 2>&1 > ' + server_filename
|
||||
iperf_cmd = 'echo $USER; nohup /usr/local/bin/iperf3 -s -i 1 > ' + server_filename + ' 2>&1'
|
||||
cmd = 'docker exec -d -w /iperf-2.0.13 prod-trf-gen /bin/bash -c \"' + iperf_cmd + '\"'
|
||||
SSH.command(cmd,'\$',5)
|
||||
SSH.close()
|
||||
@@ -2475,7 +2473,7 @@ class OaiCiTest():
|
||||
SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
|
||||
cmd = 'rm '+ client_filename
|
||||
SSH.command(cmd,'\$',5)
|
||||
SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' 2>&1 > ' + client_filename, '\$', int(iperf_time)*5.0)
|
||||
SSH.command('iperf3 -B ' + UE_IPAddress + ' -c ' + trf_gen_IP + ' ' + self.iperf_args + ' > ' + client_filename + ' 2>&1', '\$', int(iperf_time)*5.0)
|
||||
SSH.close()
|
||||
|
||||
#once client is done, retrieve the server file from container to EPC Host
|
||||
@@ -2499,8 +2497,6 @@ class OaiCiTest():
|
||||
|
||||
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'
|
||||
@@ -2524,14 +2520,14 @@ class OaiCiTest():
|
||||
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 &'
|
||||
cmd = 'echo $USER; nohup /opt/iperf-2.0.10/iperf -s -B ' + UE_IPAddress + ' -u -i 1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1 &'
|
||||
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'
|
||||
cmd = 'iperf -c ' + UE_IPAddress + ' ' + self.iperf_args + ' > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1'
|
||||
SSH.command(cmd,'\$',int(iperf_time)*5.0)
|
||||
SSH.close()
|
||||
#copy the 2 resulting files locally
|
||||
@@ -2547,7 +2543,7 @@ class OaiCiTest():
|
||||
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 &'
|
||||
cmd = 'echo $USER; nohup iperf -s -u -i 1 > iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1 &'
|
||||
SSH.command(cmd,'\$',5)
|
||||
SSH.close()
|
||||
|
||||
@@ -2555,7 +2551,7 @@ class OaiCiTest():
|
||||
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.command('/opt/iperf-2.0.10/iperf -c 192.172.0.1 ' + self.iperf_args + ' > iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log 2>&1', '\$', int(iperf_time)*5.0)
|
||||
SSH.close()
|
||||
|
||||
#copy the 2 resulting files locally
|
||||
@@ -2566,15 +2562,13 @@ class OaiCiTest():
|
||||
self.Iperf_analyzeV2Server(lock, UE_IPAddress, device_id, statusQueue, self.iperf_args,filename,1)
|
||||
elif self.iperf_direction=="BIDIR":
|
||||
logging.debug("Iperf for Module in BIDIR mode detected")
|
||||
server_filename = 'iperf_server_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
client_filename = 'iperf_client_' + self.testCase_id + '_' + self.ue_id + '.log'
|
||||
|
||||
|
||||
#server side EPC
|
||||
SSH.open(EPC.IPAddress, EPC.UserName, EPC.Password)
|
||||
cmd = 'rm ' + server_filename
|
||||
SSH.command(cmd,'\$',5)
|
||||
cmd = 'echo $USER; nohup iperf3 -s 2>&1 > '+server_filename+' &'
|
||||
cmd = 'echo $USER; nohup iperf3 -s -i 1 > '+server_filename+' 2>&1 &'
|
||||
SSH.command(cmd,'\$',5)
|
||||
SSH.close()
|
||||
|
||||
@@ -2582,7 +2576,7 @@ class OaiCiTest():
|
||||
SSH.open(Module_UE.HostIPAddress, Module_UE.HostUsername, Module_UE.HostPassword)
|
||||
cmd = 'rm ' + client_filename
|
||||
SSH.command(cmd,'\$',5)
|
||||
SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' 2>&1 > '+client_filename, '\$', int(iperf_time)*5.0)
|
||||
SSH.command('iperf3 -c 192.172.0.1 ' + self.iperf_args + ' > '+client_filename + ' 2>&1', '\$', int(iperf_time)*5.0)
|
||||
SSH.close()
|
||||
|
||||
#copy the 2 resulting files locally
|
||||
@@ -2593,6 +2587,7 @@ class OaiCiTest():
|
||||
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'
|
||||
@@ -2606,7 +2601,12 @@ class OaiCiTest():
|
||||
cmd = 'killall --signal=SIGKILL iperf3'
|
||||
SSH.command(cmd,'\$',5)
|
||||
SSH.close()
|
||||
return
|
||||
|
||||
# Copying to xNB server for Jenkins artifacting
|
||||
if (os.path.isfile(server_filename)):
|
||||
SSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, server_filename, RAN.eNBSourceCodePath + '/cmake_targets/')
|
||||
if (os.path.isfile(client_filename)):
|
||||
SSH.copyout(RAN.eNBIPAddress, RAN.eNBUserName, RAN.eNBPassword, client_filename, RAN.eNBSourceCodePath + '/cmake_targets/')
|
||||
|
||||
def Iperf_common(self, lock, UE_IPAddress, device_id, idx, ue_num, statusQueue,EPC):
|
||||
try:
|
||||
@@ -2804,12 +2804,12 @@ class OaiCiTest():
|
||||
else:
|
||||
SSH.copyin(self.ADBIPAddress, self.ADBUserName, self.ADBPassword, EPC.SourceCodePath + '/scripts/iperf_server_' + self.testCase_id + '_' + device_id + '.log', '.')
|
||||
# fromdos has to be called on the python executor not on ADB server
|
||||
cmd = 'fromdos -o iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 > /dev/null'
|
||||
cmd = 'fromdos -o iperf_server_' + self.testCase_id + '_' + device_id + '.log > /dev/null 2>&1'
|
||||
try:
|
||||
subprocess.run(cmd, shell=True)
|
||||
except:
|
||||
pass
|
||||
cmd = 'dos2unix -o iperf_server_' + self.testCase_id + '_' + device_id + '.log 2>&1 > /dev/null'
|
||||
cmd = 'dos2unix -o iperf_server_' + self.testCase_id + '_' + device_id + '.log > /dev/null 2>&1'
|
||||
try:
|
||||
subprocess.run(cmd, shell=True)
|
||||
except:
|
||||
@@ -2995,7 +2995,7 @@ class OaiCiTest():
|
||||
#special quick and dirty treatment for modules, iperf to be restructured
|
||||
if self.ue_id!="": #is module
|
||||
device_id = Module_UE.ID + "-" + Module_UE.Kind
|
||||
p = Process(target = self.Iperf_Module ,args = (lock, UE_IPAddress, device_id, i, ue_num, status_queue, EPC, Module_UE,))
|
||||
p = Process(target = self.Iperf_Module ,args = (lock, UE_IPAddress, device_id, i, ue_num, status_queue, EPC, Module_UE, RAN, ))
|
||||
else: #legacy code
|
||||
p = Process(target = self.Iperf_common, args = (lock, UE_IPAddress, device_id, i, ue_num, status_queue, EPC, ))
|
||||
p.daemon = True
|
||||
|
||||
@@ -35,6 +35,7 @@ import sys # arg
|
||||
import re # reg
|
||||
import logging
|
||||
import os
|
||||
from pathlib import Path
|
||||
import time
|
||||
|
||||
#-----------------------------------------------------------
|
||||
@@ -51,7 +52,7 @@ class CppCheckResults():
|
||||
|
||||
def __init__(self):
|
||||
|
||||
self.variants = ['xenial', 'bionic']
|
||||
self.variants = ['bionic', 'focal']
|
||||
self.versions = ['','']
|
||||
self.nbErrors = [0,0]
|
||||
self.nbWarnings = [0,0]
|
||||
@@ -116,12 +117,22 @@ class StaticCodeAnalysis():
|
||||
# if the commit ID is provided use it to point to it
|
||||
if self.ranCommitID != '':
|
||||
mySSH.command('git checkout -f ' + self.ranCommitID, '\$', 30)
|
||||
# if the branch is not develop, then it is a merge request and we need to do
|
||||
# the potential merge. Note that merge conflicts should already been checked earlier
|
||||
if (self.ranAllowMerge):
|
||||
if self.ranTargetBranch == '':
|
||||
if (self.ranBranch != 'develop') and (self.ranBranch != 'origin/develop'):
|
||||
mySSH.command('git merge --ff origin/develop -m "Temporary merge for CI"', '\$', 5)
|
||||
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('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 60)
|
||||
mySSH.command('docker build --tag oai-cppcheck:xenial --file ci-scripts/docker/Dockerfile.cppcheck.xenial . > cmake_targets/log/cppcheck-xenial.txt 2>&1', '\$', 600)
|
||||
mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:focal || true', '\$', 60)
|
||||
mySSH.command('sed -e "s@xenial@bionic@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.bionic', '\$', 6)
|
||||
mySSH.command('docker build --tag oai-cppcheck:bionic --file ci-scripts/docker/Dockerfile.cppcheck.bionic . > cmake_targets/log/cppcheck-bionic.txt 2>&1', '\$', 600)
|
||||
mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:xenial || true', '\$', 30)
|
||||
mySSH.command('sed -e "s@xenial@focal@" ci-scripts/docker/Dockerfile.cppcheck.xenial > ci-scripts/docker/Dockerfile.cppcheck.focal', '\$', 6)
|
||||
mySSH.command('docker build --tag oai-cppcheck:focal --file ci-scripts/docker/Dockerfile.cppcheck.focal . > cmake_targets/log/cppcheck-focal.txt 2>&1', '\$', 600)
|
||||
mySSH.command('docker image rm oai-cppcheck:bionic oai-cppcheck:focal || true', '\$', 30)
|
||||
|
||||
# Analyzing the logs
|
||||
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
|
||||
@@ -131,8 +142,22 @@ class StaticCodeAnalysis():
|
||||
|
||||
mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/build_log_' + self.testCase_id + '/*', '.')
|
||||
CCR = CppCheckResults()
|
||||
CCR_ref = CppCheckResults()
|
||||
vId = 0
|
||||
for variant in CCR.variants:
|
||||
refAvailable = False
|
||||
if self.ranAllowMerge:
|
||||
refFolder = str(Path.home()) + '/cppcheck-references'
|
||||
if (os.path.isfile(refFolder + '/cppcheck-'+ variant + '.txt')):
|
||||
refAvailable = True
|
||||
with open(refFolder + '/cppcheck-'+ variant + '.txt', 'r') as refFile:
|
||||
for line in refFile:
|
||||
ret = re.search(' (?P<nb_errors>[0-9\.]+) errors', str(line))
|
||||
if ret is not None:
|
||||
CCR_ref.nbErrors[vId] = int(ret.group('nb_errors'))
|
||||
ret = re.search(' (?P<nb_warnings>[0-9\.]+) warnings', str(line))
|
||||
if ret is not None:
|
||||
CCR_ref.nbWarnings[vId] = int(ret.group('nb_warnings'))
|
||||
if (os.path.isfile('./cppcheck-'+ variant + '.txt')):
|
||||
xmlStart = False
|
||||
with open('./cppcheck-'+ variant + '.txt', 'r') as logfile:
|
||||
@@ -167,21 +192,43 @@ class StaticCodeAnalysis():
|
||||
CCR.nbPtrAddNotNull[vId] += 1
|
||||
if re.search('id="oppositeInnerCondition"', str(line)) is not None:
|
||||
CCR.nbOppoInnerCondition[vId] += 1
|
||||
logging.debug('======== Variant ' + variant + ' - ' + CCR.versions[vId] + ' ========')
|
||||
logging.debug(' ' + str(CCR.nbErrors[vId]) + ' errors')
|
||||
logging.debug(' ' + str(CCR.nbWarnings[vId]) + ' warnings')
|
||||
logging.debug(' -- Details --')
|
||||
logging.debug(' Memory leak: ' + str(CCR.nbMemLeaks[vId]))
|
||||
logging.debug(' Possible null pointer deference: ' + str(CCR.nbNullPtrs[vId]))
|
||||
logging.debug(' Uninitialized variable: ' + str(CCR.nbUninitVars[vId]))
|
||||
logging.debug(' Undefined behaviour shifting: ' + str(CCR.nbTooManyBitsShift[vId]))
|
||||
logging.debug(' Signed integer overflow: ' + str(CCR.nbIntegerOverflow[vId]))
|
||||
logging.debug('')
|
||||
logging.debug(' Printf formatting issue: ' + str(CCR.nbInvalidPrintf[vId]))
|
||||
logging.debug(' Modulo result is predetermined: ' + str(CCR.nbModuloAlways[vId]))
|
||||
logging.debug(' Opposite Condition -> dead code: ' + str(CCR.nbOppoInnerCondition[vId]))
|
||||
logging.debug(' Wrong Scanf Nb Args: ' + str(CCR.nbWrongScanfArg[vId]))
|
||||
logging.debug('')
|
||||
vMsg = ''
|
||||
vMsg += '======== Variant ' + variant + ' - ' + CCR.versions[vId] + ' ========\n'
|
||||
vMsg += ' ' + str(CCR.nbErrors[vId]) + ' errors\n'
|
||||
vMsg += ' ' + str(CCR.nbWarnings[vId]) + ' warnings\n'
|
||||
vMsg += ' -- Details --\n'
|
||||
vMsg += ' Memory leak: ' + str(CCR.nbMemLeaks[vId]) + '\n'
|
||||
vMsg += ' Possible null pointer deference: ' + str(CCR.nbNullPtrs[vId]) + '\n'
|
||||
vMsg += ' Uninitialized variable: ' + str(CCR.nbUninitVars[vId]) + '\n'
|
||||
vMsg += ' Undefined behaviour shifting: ' + str(CCR.nbTooManyBitsShift[vId]) + '\n'
|
||||
vMsg += ' Signed integer overflow: ' + str(CCR.nbIntegerOverflow[vId]) + '\n'
|
||||
vMsg += '\n'
|
||||
vMsg += ' Printf formatting issue: ' + str(CCR.nbInvalidPrintf[vId]) + '\n'
|
||||
vMsg += ' Modulo result is predetermined: ' + str(CCR.nbModuloAlways[vId]) + '\n'
|
||||
vMsg += ' Opposite Condition -> dead code: ' + str(CCR.nbOppoInnerCondition[vId]) + '\n'
|
||||
vMsg += ' Wrong Scanf Nb Args: ' + str(CCR.nbWrongScanfArg[vId]) + '\n'
|
||||
for vLine in vMsg.split('\n'):
|
||||
logging.debug(vLine)
|
||||
if self.ranAllowMerge and refAvailable:
|
||||
if CCR_ref.nbErrors[vId] == CCR.nbErrors[vId]:
|
||||
logging.debug(' No change in number of errors')
|
||||
elif CCR_ref.nbErrors[vId] > CCR.nbErrors[vId]:
|
||||
logging.debug(' Good! Decrease in number of errors')
|
||||
else:
|
||||
logging.debug(' Bad! increase in number of errors')
|
||||
if CCR_ref.nbWarnings[vId] == CCR.nbWarnings[vId]:
|
||||
logging.debug(' No change in number of warnings')
|
||||
elif CCR_ref.nbWarnings[vId] > CCR.nbWarnings[vId]:
|
||||
logging.debug(' Good! Decrease in number of warnings')
|
||||
else:
|
||||
logging.debug(' Bad! increase in number of warnings')
|
||||
# Create new reference file
|
||||
if not self.ranAllowMerge:
|
||||
refFolder = str(Path.home()) + '/cppcheck-references'
|
||||
if not os.path.isdir(refFolder):
|
||||
os.mkdir(refFolder)
|
||||
with open(refFolder + '/cppcheck-'+ variant + '.txt', 'w') as refFile:
|
||||
refFile.write(vMsg)
|
||||
vId += 1
|
||||
|
||||
HTML.CreateHtmlTestRow('N/A', 'OK', CONST.ALL_PROCESSES_OK)
|
||||
|
||||
@@ -22,9 +22,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
#spCellConfigCommon
|
||||
|
||||
@@ -37,8 +37,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
sib1_tda = 0;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -39,7 +39,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
|
||||
@@ -22,8 +22,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -22,8 +22,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -20,7 +20,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
pusch_TargetSNRx10 = 200;
|
||||
pucch_TargetSNRx10 = 200;
|
||||
|
||||
@@ -38,7 +38,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
do_SRS = 1;
|
||||
|
||||
@@ -38,8 +38,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
#pusch_TargetSNRx10 = 200;
|
||||
#pucch_TargetSNRx10 = 200;
|
||||
ul_prbblacklist = "51,52,53,54"
|
||||
|
||||
@@ -38,8 +38,10 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
#pusch_TargetSNRx10 = 200;
|
||||
#pucch_TargetSNRx10 = 200;
|
||||
ul_prbblacklist = "79,80,81,82"
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
@@ -83,7 +85,7 @@ gNBs =
|
||||
#initialDownlinkBWP
|
||||
#genericParameters
|
||||
# this is RBstart=0,L=106 (275*(L-1))+RBstart
|
||||
initialDLBWPlocationAndBandwidth = 31899;
|
||||
initialDLBWPlocationAndBandwidth = 31624;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
@@ -103,7 +105,7 @@ gNBs =
|
||||
pMax = 20;
|
||||
#initialUplinkBWP
|
||||
#genericParameters
|
||||
initialULBWPlocationAndBandwidth = 31899;
|
||||
initialULBWPlocationAndBandwidth = 31624;
|
||||
# subcarrierSpacing
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialULBWPsubcarrierSpacing = 1;
|
||||
|
||||
@@ -22,8 +22,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
@@ -221,8 +219,7 @@ RUs = (
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
|
||||
sdr_addrs = "addr=192.168.30.2,mgmt_addr=192.168.30.2,second_addr=192.168.50.2";
|
||||
clock_src = "external";
|
||||
sdr_addrs = "addr=192.168.20.2";
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -20,8 +20,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
{
|
||||
|
||||
@@ -21,8 +21,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 31; //0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
servingCellConfigCommon = (
|
||||
|
||||
@@ -52,7 +52,6 @@ Options:
|
||||
--------
|
||||
# OpenAirInterface Build Variants
|
||||
--variant enb-usrp OR -v1 ( build and test )
|
||||
--variant basic-sim OR -v2 ( build and test )
|
||||
--variant phy-sim OR -v3 ( build and test )
|
||||
--variant cppcheck OR -v4 ( build and test )
|
||||
--variant gnb-usrp OR -v5 ( build and test )
|
||||
|
||||
@@ -45,7 +45,6 @@ Mandatory Options:
|
||||
|
||||
# OpenAirInterface Build Variants
|
||||
--variant enb-usrp OR -v1 ( build and test )
|
||||
--variant basic-sim OR -v2 ( build and test )
|
||||
--variant phy-sim OR -v3 ( build and test )
|
||||
--variant cppcheck OR -v4 ( build and test )
|
||||
--variant gnb-usrp OR -v5 ( build and test )
|
||||
|
||||
@@ -109,12 +109,6 @@ You can get the list of variant specific variables specifying the variant argume
|
||||
NB_PATTERN_FILES=9 BUILD_OPTIONS=""
|
||||
LOG_PATTERN=.Rel15.txt
|
||||
|
||||
--variant basic-sim OR -v2 ( build and test )
|
||||
VM_NAME=ci-basic-sim ARCHIVES_LOC=basic_sim
|
||||
VM_MEMORY=8192 VM_CPU=4
|
||||
NB_PATTERN_FILES=13 BUILD_OPTIONS="--eNB --UE"
|
||||
LOG_PATTERN=.Rel15.txt
|
||||
|
||||
--variant phy-sim OR -v3 ( build and test )
|
||||
VM_NAME=ci-phy-sim ARCHIVES_LOC=phy_sim
|
||||
VM_MEMORY=2048 VM_CPU=4
|
||||
|
||||
@@ -18,16 +18,14 @@
|
||||
2. [Detailed Description](#2-detailed-description)
|
||||
3. [Typical Usage](#3-typical-usage)
|
||||
1. [Testing the physical simulators](#31-testing-the-physicals-simulators)
|
||||
2. [Testing the basic simulator](#32-testing-the-basic-simulator)
|
||||
3. [Testing the RF simulator](#33-testing-the-rf-simulator)
|
||||
4. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator)
|
||||
2. [Testing the RF simulator](#33-testing-the-rf-simulator)
|
||||
3. [Testing the L2-nFAPI simulator](#33-testing-the-l2-nfapi-simulator)
|
||||
|
||||
# 1. Introduction #
|
||||
|
||||
Currently 2 build variants can be directly tested:
|
||||
Currently 1 build variant can be directly tested:
|
||||
|
||||
* Physical Simulators
|
||||
* Basic Simulator
|
||||
|
||||
In addition, 2 build variants are used:
|
||||
|
||||
@@ -73,7 +71,6 @@ Options:
|
||||
|
||||
# OpenAirInterface Build Variants
|
||||
--variant enb-usrp OR -v1 ( build and test )
|
||||
--variant basic-sim OR -v2 ( build and test )
|
||||
--variant phy-sim OR -v3 ( build and test )
|
||||
--variant cppcheck OR -v4 ( build and test )
|
||||
--variant gnb-usrp OR -v5 ( build and test )
|
||||
@@ -143,64 +140,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev
|
||||
|
||||
Note that the VM instance is destroyed. You do that when you are sure your test is passing.
|
||||
|
||||
## 3.2. Testing the basic simulator ##
|
||||
|
||||
```bash
|
||||
$ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant basic-sim --job-name RAN-CI-develop --build-id 48
|
||||
15:11:13 ############################################################
|
||||
15:11:13 OAI CI VM script
|
||||
15:11:13 ############################################################
|
||||
15:11:13 VM_NAME = RAN-CI-develop-b48-basic-sim
|
||||
15:11:13 VM_CMD_FILE = RAN-CI-develop-b48-basic-sim_cmds.txt
|
||||
15:11:13 JENKINS_WKSP = /var/jenkins/workspace/RAN-CI-develop
|
||||
15:11:13 ARCHIVES_LOC = /var/jenkins/workspace/RAN-CI-develop/archives/basic_sim/test
|
||||
15:11:13 ############################################################
|
||||
15:11:13 Waiting for VM to be started
|
||||
15:11:13 ############################################################
|
||||
15:11:14 Warning: Permanently added '192.168.122.29' (ECDSA) to the list of known hosts.
|
||||
15:11:15 RAN-CI-develop-b48-basic-sim has for IP addr = 192.168.122.29
|
||||
15:11:15 ############################################################
|
||||
15:11:15 Test EPC on VM (RAN-CI-develop-b48-epc) will be using ltebox
|
||||
15:11:15 ############################################################
|
||||
15:11:15 EPC_VM_CMD_FILE = RAN-CI-develop-b48-epc_cmds.txt
|
||||
15:11:15 ############################################################
|
||||
15:11:15 Creating test EPC VM (RAN-CI-develop-b48-epc) on Ubuntu Cloud Image base
|
||||
15:11:15 ############################################################
|
||||
15:11:18 Waiting for VM to be started
|
||||
15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts.
|
||||
15:13:25 RAN-CI-develop-b48-epc has for IP addr = 192.168.122.156
|
||||
15:13:25 Warning: Permanently added '192.168.122.156' (ECDSA) to the list of known hosts.
|
||||
15:13:25 ls: cannot access '/opt/ltebox/tools/start_ltebox': No such file or directory
|
||||
15:13:25 ############################################################
|
||||
15:13:25 Copying ltebox archives into EPC VM (RAN-CI-develop-b48-epc)
|
||||
15:13:25 ############################################################
|
||||
15:13:25 ############################################################
|
||||
15:13:25 Install EPC on EPC VM (RAN-CI-develop-b48-epc)
|
||||
15:13:25 ############################################################
|
||||
....
|
||||
15:24:39 ############################################################
|
||||
15:24:39 Terminate EPC
|
||||
15:24:39 ############################################################
|
||||
15:24:39 cd /opt/ltebox/tools
|
||||
15:24:39 sudo ./stop_ltebox
|
||||
15:24:40 sudo daemon --name=simulated_hss --stop
|
||||
15:24:40 sudo killall --signal SIGKILL hss_sim
|
||||
15:24:40 ############################################################
|
||||
15:24:40 Destroying VMs
|
||||
15:24:40 ############################################################
|
||||
15:24:41 # Host 192.168.122.29 found: line 18
|
||||
15:24:41 /home/eurecom/.ssh/known_hosts updated.
|
||||
15:24:41 Original contents retained as /home/eurecom/.ssh/known_hosts.old
|
||||
15:24:43 # Host 192.168.122.60 found: line 20
|
||||
15:24:43 /home/eurecom/.ssh/known_hosts updated.
|
||||
15:24:43 Original contents retained as /home/eurecom/.ssh/known_hosts.old
|
||||
15:24:43 ############################################################
|
||||
15:24:43 Checking run status
|
||||
15:24:43 ############################################################
|
||||
15:24:43 STATUS seems OK
|
||||
```
|
||||
|
||||
## 3.3. Test the RF simulator ##
|
||||
## 3.2. Test the RF simulator ##
|
||||
|
||||
```bash
|
||||
./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant rf-sim --job-name RAN-CI-develop --build-id 48 --keep-vm-alive
|
||||
@@ -209,7 +149,7 @@ $ ./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-dev
|
||||
15:24:45 STATUS seems OK
|
||||
```
|
||||
|
||||
## 3.4. Testing the L2-nFAPI simulator
|
||||
## 3.3. Testing the L2-nFAPI simulator
|
||||
|
||||
```bash
|
||||
./ci-scripts/oai-ci-vm-tool test --workspace /var/jenkins/workspace/RAN-CI-develop --variant l2-sim --job-name RAN-CI-develop --build-id 48
|
||||
|
||||
@@ -174,7 +174,7 @@ function variant__v1__enb_usrp {
|
||||
BUILD_OPTIONS="--eNB -w USRP --mu"
|
||||
VM_MEMORY=3072
|
||||
}
|
||||
|
||||
|
||||
function variant__v2__basic_sim {
|
||||
NB_PATTERN_FILES=11
|
||||
BUILD_OPTIONS="--eNB --UE"
|
||||
@@ -200,28 +200,28 @@ function variant__v4__cppcheck {
|
||||
function variant__v5__gnb_usrp {
|
||||
VM_MEMORY=10240
|
||||
VM_CPU=8
|
||||
NB_PATTERN_FILES=7
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--gNB -w USRP"
|
||||
}
|
||||
|
||||
function variant__v6__nr_ue_usrp {
|
||||
VM_MEMORY=4096
|
||||
VM_CPU=4
|
||||
NB_PATTERN_FILES=7
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--nrUE -w USRP"
|
||||
}
|
||||
|
||||
function variant__v7__enb_ethernet {
|
||||
VM_MEMORY=4096
|
||||
ARCHIVES_LOC=enb_eth
|
||||
NB_PATTERN_FILES=7
|
||||
NB_PATTERN_FILES=6
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
}
|
||||
|
||||
function variant__v8__ue_ethernet {
|
||||
VM_MEMORY=4096
|
||||
ARCHIVES_LOC=ue_eth
|
||||
NB_PATTERN_FILES=11
|
||||
NB_PATTERN_FILES=10
|
||||
BUILD_OPTIONS="--UE -w USRP"
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
AUTH_SERVICE = 'registry.docker.io'
|
||||
AUTH_SCOPE = 'repository:rdefosseoai/oai-enb:pull'
|
||||
|
||||
def main() -> None:
|
||||
args = _parse_args()
|
||||
|
||||
cmd = 'curl -fsSL "https://auth.docker.io/token?service=' + AUTH_SERVICE + '&scope=' + AUTH_SCOPE + '" | jq --raw-output ".token"'
|
||||
token = subprocess.check_output(cmd, shell=True, universal_newlines=True)
|
||||
token = str(token).strip()
|
||||
cmd = 'curl -fsSL -H "Authorization: Bearer ' + token + '" "https://index.docker.io/v2/rdefosseoai/oai-enb/tags/list" | jq .'
|
||||
listOfTags = subprocess.check_output(cmd, shell=True, universal_newlines=True)
|
||||
|
||||
foundTag = False
|
||||
for tag in listOfTags.split('\n'):
|
||||
if re.search('"' + args.start_tag + '"', tag) is not None:
|
||||
foundTag = True
|
||||
|
||||
if not foundTag:
|
||||
print (args.start_tag)
|
||||
sys.exit(0)
|
||||
|
||||
proposedVariants = ['a', 'b', 'c', 'd']
|
||||
for variant in proposedVariants:
|
||||
foundTag = False
|
||||
currentVariant = variant
|
||||
for tag in listOfTags.split('\n'):
|
||||
if re.search('"' + args.start_tag + variant + '"', tag) is not None:
|
||||
foundTag = True
|
||||
break
|
||||
if not foundTag:
|
||||
break
|
||||
|
||||
if not foundTag:
|
||||
print (args.start_tag + currentVariant)
|
||||
|
||||
def _parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description='Provides an unique new image tag for DockerHub')
|
||||
|
||||
parser.add_argument(
|
||||
'--start_tag', '-st',
|
||||
action='store',
|
||||
required=True,
|
||||
help='Proposed Starting Tag',
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
+10
-6
@@ -677,13 +677,13 @@ class RANManagement():
|
||||
# if T tracer was run with option 0 (no logs), analyze logs
|
||||
# from textlog, otherwise do normal analysis (e.g., option 2)
|
||||
result = re.search('T_stdout 0', str(self.Initialize_eNB_args))
|
||||
enbLogFile = self.eNBLogFiles[int(self.eNB_instance)]
|
||||
raw_record_file = enbLogFile.replace('.log', '_record.raw')
|
||||
replay_log_file = enbLogFile.replace('.log', '_replay.log')
|
||||
if (result is not None):
|
||||
logging.debug('\u001B[1m Replaying RAW record file\u001B[0m')
|
||||
mySSH.open(lIpAddr, lUserName, lPassWord)
|
||||
mySSH.command('cd ' + lSourcePath + '/common/utils/T/tracer/', '\$', 5)
|
||||
enbLogFile = self.eNBLogFiles[int(self.eNB_instance)]
|
||||
raw_record_file = enbLogFile.replace('.log', '_record.raw')
|
||||
replay_log_file = enbLogFile.replace('.log', '_replay.log')
|
||||
extracted_txt_file = enbLogFile.replace('.log', '_extracted_messages.txt')
|
||||
extracted_log_file = enbLogFile.replace('.log', '_extracted_messages.log')
|
||||
mySSH.command('./extract_config -i ' + lSourcePath + '/cmake_targets/' + raw_record_file + ' > ' + lSourcePath + '/cmake_targets/' + extracted_txt_file, '\$', 5)
|
||||
@@ -706,6 +706,8 @@ class RANManagement():
|
||||
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', '.')
|
||||
mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+raw_record_file, '.')
|
||||
mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/'+replay_log_file, '.')
|
||||
#
|
||||
copyin_res = mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/' + fileToAnalyze, '.')
|
||||
if (copyin_res == -1):
|
||||
@@ -721,7 +723,9 @@ class RANManagement():
|
||||
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, './gnb_stats_monitor.png', self.eNBSourceCodePath + '/cmake_targets/')#RH 21/02/2002 this does not work, there are more than 1 png file
|
||||
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+raw_record_file, self.eNBSourceCodePath + '/cmake_targets/')
|
||||
mySSH.copyout(self.eNBIPAddress, self.eNBUserName, self.eNBPassword,'./'+replay_log_file, 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)
|
||||
@@ -752,11 +756,11 @@ 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 enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 60)
|
||||
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip enb*.log enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log* iperf*.log log/*/*.log log/*/*.pcap', '\$', 60)
|
||||
result = re.search('core.\d+', mySSH.getBefore())
|
||||
if result is not None:
|
||||
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S zip enb.log.zip core* ran_build/build/{lte,nr}-softmodem', '\$', 60) # add core and executable to zip
|
||||
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log.png log/*/*.log log/*/*.pcap', '\$', 15)
|
||||
mySSH.command('echo ' + self.eNBPassword + ' | sudo -S rm enb*.log core* enb_*record.raw enb_*.pcap gnb_*.pcap enb_*txt physim_*.log *stats.log *monitor.pickle *monitor*.png ping*.log* iperf*.log log/*/*.log log/*/*.pcap', '\$', 15)
|
||||
mySSH.close()
|
||||
|
||||
def AnalyzeLogFile_eNB(self, eNBlogFile, HTML, checkers={}):
|
||||
|
||||
@@ -574,7 +574,6 @@ function report_build {
|
||||
summary_table_row "OAI ETHERNET transport - Release 15" ./archives/enb_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./enb_eth_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 15" ./archives/enb_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./enb_eth_row4.html
|
||||
summary_table_row "RF Simulator - Release 15" ./archives/enb_eth/rfsimulator.Rel15.txt "Built target rfsimulator" ./enb_eth_row5.html
|
||||
summary_table_row "TCP OAI Bridge - Release 15" ./archives/enb_eth/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./enb_eth_row6.html
|
||||
summary_table_row "OAI USRP device if - Release 15" ./archives/enb_eth/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./enb_eth_row7.html
|
||||
summary_table_footer
|
||||
|
||||
@@ -584,7 +583,6 @@ function report_build {
|
||||
summary_table_row "OAI ETHERNET transport - Release 15" ./archives/ue_eth/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./ue_eth_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 15" ./archives/ue_eth/params_libconfig.Rel15.txt "Built target params_libconfig" ./ue_eth_row4.html
|
||||
summary_table_row "RF Simulator - Release 15" ./archives/ue_eth/rfsimulator.Rel15.txt "Built target rfsimulator" ./ue_eth_row5.html
|
||||
summary_table_row "TCP OAI Bridge - Release 15" ./archives/ue_eth/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./ue_eth_row6.html
|
||||
summary_table_row "Conf 2 UE Data - Release 15" ./archives/ue_eth/conf2uedata.Rel15.txt "Built target conf2uedata" ./ue_eth_row7.html
|
||||
summary_table_row "NVRAM - Release 15" ./archives/ue_eth/nvram.Rel15.txt "Built target nvram" ./ue_eth_row8.html
|
||||
summary_table_row "UE IP - Release 15" ./archives/ue_eth/ue_ip.Rel15.txt "Built target ue_ip" ./ue_eth_row9.html
|
||||
@@ -592,20 +590,6 @@ function report_build {
|
||||
summary_table_row "OAI USRP device if - Release 15" ./archives/ue_eth/oai_usrpdevif.Rel15.txt "Built target oai_usrpdevif" ./ue_eth_row9b.html
|
||||
summary_table_footer
|
||||
|
||||
summary_table_header "OAI Build: 4G LTE basic simulator option" ./archives/basic_sim
|
||||
summary_table_row "LTE SoftModem - Release 15" ./archives/basic_sim/lte-softmodem.Rel15.txt "Built target lte-softmodem" ./basic_sim_row1.html
|
||||
summary_table_row "LTE UE SoftModem - Release 15" ./archives/basic_sim/lte-uesoftmodem.Rel15.txt "Built target lte-uesoftmodem" ./basic_sim_row2.htm
|
||||
summary_table_row "Coding - Release 15" ./archives/basic_sim/coding.Rel15.txt "Built target coding" ./basic_sim_row3.html
|
||||
summary_table_row "Conf 2 UE data - Release 15" ./archives/basic_sim/conf2uedata.Rel15.txt "Built target conf2uedata" ./basic_sim_row4.html
|
||||
summary_table_row "OAI ETHERNET transport - Release 15" ./archives/basic_sim/oai_eth_transpro.Rel15.txt "Built target oai_eth_transpro" ./basic_sim_row5.html
|
||||
summary_table_row "Parameters Lib Config - Release 15" ./archives/basic_sim/params_libconfig.Rel15.txt "Built target params_libconfig" ./basic_sim_row7.html
|
||||
summary_table_row "RF Simulator - Release 15" ./archives/basic_sim/rfsimulator.Rel15.txt "Built target rfsimulator" ./basic_sim_row9.html
|
||||
summary_table_row "TCP Bridge - Release 15" ./archives/basic_sim/tcp_bridge_oai.Rel15.txt "Built target tcp_bridge_oai" ./basic_sim_row10.html
|
||||
summary_table_row "UE IP - Release 15" ./archives/basic_sim/ue_ip.Rel15.txt "Built target ue_ip" ./basic_sim_row11.html
|
||||
summary_table_row "USIM - Release 15" ./archives/basic_sim/usim.Rel15.txt "Built target usim" ./basic_sim_row12.html
|
||||
summary_table_row "NVRAM - Release 15" ./archives/basic_sim/nvram.Rel15.txt "Built target nvram" ./basic_sim_row13.html
|
||||
summary_table_footer
|
||||
|
||||
if [ -f archives/gnb_usrp/nr-softmodem.Rel15.txt ]
|
||||
then
|
||||
summary_table_header "OAI Build: 5G NR gNB -- USRP option" ./archives/gnb_usrp
|
||||
@@ -658,13 +642,6 @@ function report_build {
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./basic_sim_row1.html ] || [ -f ./basic_sim_row2.html ] || [ -f ./basic_sim_row3.html ] || [ -f ./basic_sim_row4.html ] || [ -f ./basic_sim_row5.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./basic_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
fi
|
||||
if [ -f ./gnb_usrp_row1.html ] || [ -f ./gnb_usrp_row2.html ] || [ -f ./gnb_usrp_row3.html ] || [ -f ./gnb_usrp_row4.html ]
|
||||
then
|
||||
for DETAILS_TABLE in `ls ./gnb_usrp_row*.html`
|
||||
|
||||
@@ -250,156 +250,6 @@ function report_test {
|
||||
echo " </table>" >> ./test_simulator_results.html
|
||||
echo " <h2>Test Summary</h2>" >> ./test_simulator_results.html
|
||||
|
||||
ARCHIVES_LOC=archives/basic_sim/test
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
echo " <h3>4G LTE Basic Simulator Check</h3>" >> ./test_simulator_results.html
|
||||
|
||||
if [ -f $ARCHIVES_LOC/test_final_status.log ]
|
||||
then
|
||||
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
|
||||
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-basic-sim-test-details\">More details on Basic Simulator test results</button>" >> ./test_simulator_results.html
|
||||
echo " <div id=\"oai-basic-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
|
||||
echo " <table border = \"1\">" >> ./test_simulator_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
|
||||
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Command</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Status</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Statistics</th>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
|
||||
TRANS_MODES=("fdd" "tdd")
|
||||
BW_CASES=(05 10 20)
|
||||
for TMODE in ${TRANS_MODES[@]}
|
||||
do
|
||||
echo " <tr bgcolor = \"#8FBC8F\" >" >> ./test_simulator_results.html
|
||||
if [[ $TMODE =~ .*fdd.* ]]
|
||||
then
|
||||
echo " <td align = \"center\" colspan = 4 >Test in FDD</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td align = \"center\" colspan = 4 >Test in TDD</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
for BW in ${BW_CASES[@]}
|
||||
do
|
||||
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}MHz_enb.log
|
||||
UE_LOG=`echo $ENB_LOG | sed -e "s#enb#ue#"`
|
||||
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
|
||||
then
|
||||
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
|
||||
echo " <td>N/A</td>" >> ./test_simulator_results.html
|
||||
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
|
||||
NB_UE_GOT_SYNC=`egrep -c "got sync" $UE_LOG`
|
||||
NB_ENB_SYNCED_WITH_UE=`egrep -c "got UE capabilities for UE" $ENB_LOG`
|
||||
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -eq 2 ] && [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " <td><pre>" >> ./test_simulator_results.html
|
||||
if [ $NB_ENB_GOT_SYNC -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- eNB --> got sync</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- eNB NEVER got sync</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_UE_GOT_SYNC -eq 2 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- UE --> got sync</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- UE NEVER got sync</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_ENB_SYNCED_WITH_UE -eq 1 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- UE attached to eNB</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- UE NEVER attached to eNB</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
NB_SEGFAULT_ENB=`egrep -i -c "Segmentation Fault" $ENB_LOG`
|
||||
if [ $NB_SEGFAULT_ENB -ne 0 ]
|
||||
then
|
||||
echo "<font color = \"red\"><b>- eNB --> Segmentation Fault</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
NB_SEGFAULT_UE=`egrep -i -c "Segmentation Fault" $UE_LOG`
|
||||
if [ $NB_SEGFAULT_UE -ne 0 ]
|
||||
then
|
||||
echo "<font color = \"red\"><b>- UE --> Segmentation Fault</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
NB_ASSERTION_ENB=`egrep -i -c "Assertion" $ENB_LOG`
|
||||
if [ $NB_ASSERTION_ENB -ne 0 ]
|
||||
then
|
||||
echo "<font color = \"red\"><b>- eNB --> Assertion</b></font>" >> ./test_simulator_results.html
|
||||
awk 'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}' $ENB_LOG >> ./test_simulator_results.html
|
||||
fi
|
||||
NB_ASSERTION_UE=`egrep -i -c "Assertion" $UE_LOG`
|
||||
if [ $NB_ASSERTION_UE -ne 0 ]
|
||||
then
|
||||
echo "<font color = \"red\"><b>- eNB --> Assertion</b></font>" >> ./test_simulator_results.html
|
||||
awk 'BEGIN{assertion=10}{if(assertion < 3){print " " $0; assertion++};if ($0 ~/Assertion/){print " " $0;assertion=1}}END{}' $UE_LOG >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </pre></td>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
fi
|
||||
PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_ping_ue.txt 2> /dev/null`
|
||||
analyzePingFiles
|
||||
|
||||
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}*iperf*client*txt 2> /dev/null`
|
||||
analyzeIperfFiles
|
||||
done
|
||||
done
|
||||
|
||||
echo " </table>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
|
||||
then
|
||||
echo " <h3>4G LTE Basic Simulator + FlexRan Controller Check</h3>" >> ./test_simulator_results.html
|
||||
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-flexran-test-details\">More details on Basic Simulator + Fleran Controller test results</button>" >> ./test_simulator_results.html
|
||||
echo " <div id=\"oai-flexran-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
|
||||
echo " <table border = \"1\">" >> ./test_simulator_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
|
||||
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
|
||||
echo " <th>JSON Query Response</th>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
|
||||
FLEXRAN_QUERIES=`ls $ARCHIVES_LOC/flexran_ctl_query_*log`
|
||||
for QUERY in $FLEXRAN_QUERIES
|
||||
do
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
NAME=`echo $QUERY | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <td>$NAME</td>" >> ./test_simulator_results.html
|
||||
echo " <td><pre><code>" >> ./test_simulator_results.html
|
||||
egrep -v "LOG_NAME|\-\-\-\-\-" $QUERY >> ./test_simulator_results.html
|
||||
echo " </code></pre></td>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
done
|
||||
echo " </table>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
ARCHIVES_LOC=archives/rf_sim/test
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
|
||||
+14
-425
@@ -36,137 +36,6 @@ function test_usage {
|
||||
command_options_usage
|
||||
}
|
||||
|
||||
function start_basic_sim_enb {
|
||||
local LOC_VM_IP_ADDR=$2
|
||||
local LOC_EPC_IP_ADDR=$3
|
||||
local LOC_LOG_FILE=$4
|
||||
local LOC_NB_RBS=$5
|
||||
local LOC_CONF_FILE=$6
|
||||
local LOC_FLEXRAN_CTL_IP_ADRR=$7
|
||||
echo "cd /home/ubuntu/tmp" > $1
|
||||
echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"export ENODEB=1\"" >> $1
|
||||
echo "export ENODEB=1" >> $1
|
||||
echo "echo \"source oaienv\"" >> $1
|
||||
echo "source oaienv" >> $1
|
||||
echo "cd ci-scripts/conf_files/" >> $1
|
||||
echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1
|
||||
echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1
|
||||
if [[ $LOC_FLEXRAN_CTL_IP_ADRR =~ .*none.* ]]
|
||||
then
|
||||
echo "sed -i -e 's#CI_FLEXRAN_CTL_IP_ADDR#127.0.0.1#' ci-$LOC_CONF_FILE" >> $1
|
||||
else
|
||||
echo "sed -i -e 's#FLEXRAN_ENABLED = .*no.*;#FLEXRAN_ENABLED = \"yes\";#' -e 's#CI_FLEXRAN_CTL_IP_ADDR#$LOC_FLEXRAN_CTL_IP_ADRR#' ci-$LOC_CONF_FILE" >> $1
|
||||
fi
|
||||
echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1
|
||||
echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1
|
||||
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/" >> $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "echo \"ulimit -c unlimited && ./lte-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor,time --basicsim\" > ./my-lte-softmodem-run.sh " >> $1
|
||||
echo "chmod 775 ./my-lte-softmodem-run.sh" >> $1
|
||||
echo "cat ./my-lte-softmodem-run.sh" >> $1
|
||||
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
|
||||
echo "sudo -E daemon --inherit --unsafe --name=enb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-lte-softmodem-run.sh" >> $1
|
||||
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
sleep 5
|
||||
|
||||
local i="0"
|
||||
echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -ne 0 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
sleep 5
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
ENB_SYNC=0
|
||||
echo "echo \"free -m\"" > $1
|
||||
echo "free -m" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
ENB_SYNC=0
|
||||
echo "Basic-Sim eNB: eNB did NOT got sync"
|
||||
else
|
||||
echo "Basic-Sim eNB: eNB GOT SYNC --> waiting for UE to connect"
|
||||
fi
|
||||
sleep 5
|
||||
}
|
||||
|
||||
function start_basic_sim_ue {
|
||||
local LOC_UE_LOG_FILE=$3
|
||||
local LOC_NB_RBS=$4
|
||||
local LOC_FREQUENCY=$5
|
||||
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" > $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build" >> $1
|
||||
echo "echo \"./lte-uesoftmodem -C ${LOC_FREQUENCY}000000 -r $LOC_NB_RBS --log_config.global_log_options nocolor,line_num,level --basicsim\" > ./my-lte-uesoftmodem-run.sh" >> $1
|
||||
echo "chmod 775 ./my-lte-uesoftmodem-run.sh" >> $1
|
||||
echo "cat ./my-lte-uesoftmodem-run.sh" >> $1
|
||||
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE; fi" >> $1
|
||||
echo "sudo -E daemon --inherit --unsafe --name=ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build -o /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE ./my-lte-uesoftmodem-run.sh" >> $1
|
||||
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm $1
|
||||
|
||||
local i="0"
|
||||
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1`
|
||||
if [ $CONNECTED -eq 1 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
UE_SYNC=1
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
UE_SYNC=0
|
||||
echo "Basic-Sim UE: oaitun_ue1 is DOWN and/or NOT CONFIGURED"
|
||||
else
|
||||
echo "Basic-Sim UE: oaitun_ue1 is UP and CONFIGURED"
|
||||
fi
|
||||
i="0"
|
||||
echo "egrep -c \"Generating RRCConnectionReconfigurationComplete\" /home/ubuntu/tmp/cmake_targets/log/$LOC_UE_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1`
|
||||
if [ $CONNECTED -ne 0 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
sleep 5
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
echo "echo \"free -m\"" > $1
|
||||
echo "free -m" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
UE_SYNC=0
|
||||
echo "Basic-Sim UE: UE did NOT complete RRC Connection"
|
||||
else
|
||||
echo "Basic-Sim UE: UE did COMPLETE RRC Connection"
|
||||
fi
|
||||
}
|
||||
|
||||
function get_ue_ip_addr {
|
||||
local LOC_IF_ID=$3
|
||||
echo "ifconfig oaitun_ue${LOC_IF_ID} | egrep \"inet addr\" | sed -e 's#^.*inet addr:##' -e 's# P-t-P:.*\$##'" > $1
|
||||
@@ -417,7 +286,6 @@ function check_iperf {
|
||||
local LOC_REQ_BW_MINUS_TWO=`echo "$LOC_REQ_BW - 2" | bc -l`
|
||||
local LOC_REQ_BW_MINUS_THREE=`echo "$LOC_REQ_BW - 3" | bc -l`
|
||||
local LOC_IS_DL=`echo $LOC_BASE_LOG | grep -c _dl`
|
||||
local LOC_IS_BASIC_SIM=`echo $LOC_BASE_LOG | grep -c basic_sim`
|
||||
local LOC_IS_RF_SIM=`echo $LOC_BASE_LOG | grep -c rf_sim`
|
||||
local LOC_IS_NR=`echo $LOC_BASE_LOG | grep -c _106prb`
|
||||
if [ -f ${LOC_BASE_LOG}_client.txt ]
|
||||
@@ -438,28 +306,17 @@ function check_iperf {
|
||||
local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Kbits/sec" | sed -e "s#^.*KBytes *##" -e "s#sec.*#sec#"`
|
||||
local BW_PREFIX="K"
|
||||
fi
|
||||
if [ $LOC_IS_DL -eq 1 ] && [ $LOC_IS_BASIC_SIM -eq 1 ]
|
||||
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]]
|
||||
then
|
||||
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_TWO}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_THREE}.*${BW_PREFIX}bits.* ]]
|
||||
if [ $LOC_IS_DL -eq 1 ]
|
||||
then
|
||||
echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
else
|
||||
echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
IPERF_STATUS=-1
|
||||
echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
fi
|
||||
else
|
||||
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_PREFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_PREFIX}bits.* ]]
|
||||
then
|
||||
if [ $LOC_IS_DL -eq 1 ]
|
||||
then
|
||||
echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
else
|
||||
echo "got requested UL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
fi
|
||||
else
|
||||
echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
IPERF_STATUS=-1
|
||||
fi
|
||||
echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
IPERF_STATUS=-1
|
||||
fi
|
||||
fi
|
||||
else
|
||||
@@ -526,22 +383,6 @@ function full_terminate {
|
||||
sleep 10
|
||||
}
|
||||
|
||||
function full_basic_sim_destroy {
|
||||
if [ $KEEP_VM_ALIVE -eq 0 ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Destroying VMs"
|
||||
echo "############################################################"
|
||||
uvt-kvm destroy $VM_NAME
|
||||
ssh-keygen -R $VM_IP_ADDR
|
||||
if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
|
||||
then
|
||||
uvt-kvm destroy $FLEXRAN_CTL_VM_NAME
|
||||
ssh-keygen -R $FLEXRAN_CTL_VM_IP_ADDR
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
function install_epc_on_vm {
|
||||
local LOC_EPC_VM_NAME=$1
|
||||
local LOC_EPC_VM_CMDS=$2
|
||||
@@ -744,35 +585,6 @@ function terminate_epc {
|
||||
fi
|
||||
}
|
||||
|
||||
function start_flexran_ctrl {
|
||||
echo "cd /home/ubuntu/tmp" > $1
|
||||
echo "if [ -f cmake_targets/log/flexran_ctl_run.log ]; then rm -f cmake_targets/log/flexran_ctl_run.log cmake_targets/log/flexran_ctl_query*.log; fi" >> $1
|
||||
echo "echo \" sudo build/rt_controller -c log_config/basic_log\"" >> $1
|
||||
echo "nohup sudo build/rt_controller -c log_config/basic_log > cmake_targets/log/flexran_ctl_run.log 2>&1 &" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm $1
|
||||
sleep 10
|
||||
}
|
||||
|
||||
function stop_flexran_ctrl {
|
||||
echo "echo \"sudo killall --signal SIGKILL rt_controller\"" > $1
|
||||
echo "sudo killall --signal SIGKILL rt_controller" > $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm $1
|
||||
sleep 2
|
||||
}
|
||||
|
||||
function query_flexran_ctrl_status {
|
||||
local LOC_MESSAGE=$3
|
||||
echo "cd /home/ubuntu/tmp" > $1
|
||||
echo "echo \"------------------------------------------------------------\" > cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1
|
||||
echo "echo \"LOG_NAME: $LOC_MESSAGE\" >> cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1
|
||||
echo "echo \"------------------------------------------------------------\" >> cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1
|
||||
echo "curl http://localhost:9999/stats | jq '.' | tee -a cmake_targets/log/flexran_ctl_query_${LOC_MESSAGE}.log" >> $1
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$2 < $1
|
||||
rm $1
|
||||
}
|
||||
|
||||
function build_ue_on_separate_folder {
|
||||
echo "mkdir tmp-ue" > $1
|
||||
echo "cd tmp-ue" >> $1
|
||||
@@ -1480,6 +1292,11 @@ function run_test_on_vm {
|
||||
echo "This VM test type is no longer supported in the pipeline framework"
|
||||
return
|
||||
fi
|
||||
if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-basic-sim.* )) ]]
|
||||
then
|
||||
echo "This VM test type is no longer supported in the pipeline framework"
|
||||
return
|
||||
fi
|
||||
if [[ (( "$RUN_OPTIONS" == "complex" ) && ( $VM_NAME =~ .*-rf-sim.* )) ]]
|
||||
then
|
||||
ENB_VM_NAME=`echo $VM_NAME | sed -e "s#rf-sim#enb-ethernet#"`
|
||||
@@ -1667,234 +1484,6 @@ function run_test_on_vm {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-basic-sim.* ]]
|
||||
then
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
rm -Rf $ARCHIVES_LOC
|
||||
fi
|
||||
mkdir --parents $ARCHIVES_LOC
|
||||
|
||||
# Creating a VM for EPC and installing SW
|
||||
EPC_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#epc#"`
|
||||
EPC_VM_CMDS=${EPC_VM_NAME}_cmds.txt
|
||||
LTEBOX=0
|
||||
if [[ "$EPC_IPADDR" == "" ]]
|
||||
then
|
||||
# Creating a VM for EPC and installing SW
|
||||
install_epc_on_vm $EPC_VM_NAME $EPC_VM_CMDS
|
||||
EPC_VM_IP_ADDR=`uvt-kvm ip $EPC_VM_NAME`
|
||||
|
||||
# Starting EPC
|
||||
start_epc $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
else
|
||||
echo "We will use EPC on $EPC_IPADDR"
|
||||
EPC_VM_IP_ADDR=$EPC_IPADDR
|
||||
fi
|
||||
|
||||
# Retrieve EPC real IP address
|
||||
retrieve_real_epc_ip_addr $EPC_VM_NAME $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
|
||||
TRANS_MODES=("fdd" "tdd")
|
||||
BW_CASES=(05 10 20)
|
||||
|
||||
for TMODE in ${TRANS_MODES[@]}
|
||||
do
|
||||
for BW in ${BW_CASES[@]}
|
||||
do
|
||||
# Not Running in TDD-20MHz : too unstable
|
||||
if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then continue; fi
|
||||
|
||||
if [[ $BW =~ .*05.* ]]; then PRB=25; fi
|
||||
if [[ $BW =~ .*10.* ]]; then PRB=50; fi
|
||||
if [[ $BW =~ .*20.* ]]; then PRB=100; fi
|
||||
if [[ $TMODE =~ .*fdd.* ]]; then FREQUENCY=2680; else FREQUENCY=2350; fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "Starting the eNB in ${TMODE}-${BW}MHz mode"
|
||||
echo "############################################################"
|
||||
CURRENT_ENB_LOG_FILE=${TMODE}_${BW}MHz_enb.log
|
||||
start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE $PRB lte-${TMODE}-basic-sim.conf none
|
||||
|
||||
echo "############################################################"
|
||||
echo "Starting the UE in ${TMODE}-${BW}MHz mode"
|
||||
echo "############################################################"
|
||||
CURRENT_UE_LOG_FILE=${TMODE}_${BW}MHz_ue.log
|
||||
start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE $PRB $FREQUENCY
|
||||
if [ $UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ eNB and UE not syncing"
|
||||
full_terminate
|
||||
STATUS=-1
|
||||
continue
|
||||
fi
|
||||
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1
|
||||
|
||||
echo "############################################################"
|
||||
echo "Pinging the UE"
|
||||
echo "############################################################"
|
||||
PING_LOG_FILE=${TMODE}_${BW}MHz_ping_ue.txt
|
||||
ping_ue_ip_addr $EPC_VM_CMDS $EPC_VM_IP_ADDR $UE_IP_ADDR $PING_LOG_FILE 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/$PING_LOG_FILE $ARCHIVES_LOC
|
||||
check_ping_result $ARCHIVES_LOC/$PING_LOG_FILE 20
|
||||
|
||||
# Not more testing in any TDD : too unstable
|
||||
if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*05.* ]]; then full_terminate; continue; fi
|
||||
if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*10.* ]]; then full_terminate; continue; fi
|
||||
if [[ $TMODE =~ .*tdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi
|
||||
echo "############################################################"
|
||||
echo "Iperf DL"
|
||||
echo "############################################################"
|
||||
if [[ $TMODE =~ .*fdd.* ]]
|
||||
then
|
||||
if [[ $BW =~ .*20.* ]]; then THROUGHPUT=12; else THROUGHPUT=10; fi
|
||||
else
|
||||
THROUGHPUT=6
|
||||
fi
|
||||
CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_dl
|
||||
generic_iperf $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
|
||||
# Not more testing in FDD-20MHz : too unstable
|
||||
if [[ $TMODE =~ .*fdd.* ]] && [[ $BW =~ .*20.* ]]; then full_terminate; continue; fi
|
||||
echo "############################################################"
|
||||
echo "Iperf UL"
|
||||
echo "############################################################"
|
||||
THROUGHPUT=2
|
||||
CURR_IPERF_LOG_BASE=${TMODE}_${BW}MHz_iperf_ul
|
||||
generic_iperf $EPC_VM_CMDS $EPC_VM_IP_ADDR $REAL_EPC_IP_ADDR $VM_CMDS $VM_IP_ADDR $UE_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 0 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$EPC_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
|
||||
full_terminate
|
||||
|
||||
done
|
||||
done
|
||||
|
||||
if [ -d $JENKINS_WKSP/flexran ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Flexran testing is possible"
|
||||
echo "############################################################"
|
||||
local j="0"
|
||||
while [ $j -lt 20 ]
|
||||
do
|
||||
if [ -e $JENKINS_WKSP/flexran/flexran_build_complete.txt ]
|
||||
then
|
||||
echo "Found an proper flexran controller vm build"
|
||||
j="100"
|
||||
else
|
||||
j=$[$j+1]
|
||||
sleep 30
|
||||
fi
|
||||
done
|
||||
if [ $j -lt 50 ]
|
||||
then
|
||||
echo "ERROR: compiling flexran controller on vm went wrong"
|
||||
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
STATUS=-1
|
||||
return
|
||||
fi
|
||||
FLEXRAN_CTL_VM_NAME=`echo $VM_NAME | sed -e "s#basic-sim#flexran-rtc#"`
|
||||
FLEXRAN_CTL_VM_CMDS=`echo $VM_CMDS | sed -e "s#cmds#flexran-rtc-cmds#"`
|
||||
IS_FLEXRAN_VM_ALIVE=`uvt-kvm list | grep -c $FLEXRAN_CTL_VM_NAME`
|
||||
if [ $IS_FLEXRAN_VM_ALIVE -eq 0 ]
|
||||
then
|
||||
echo "ERROR: Flexran Ctl VM is not alive"
|
||||
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
full_basic_sim_destroy
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
STATUS=-1
|
||||
return
|
||||
fi
|
||||
uvt-kvm wait $FLEXRAN_CTL_VM_NAME --insecure
|
||||
FLEXRAN_CTL_VM_IP_ADDR=`uvt-kvm ip $FLEXRAN_CTL_VM_NAME`
|
||||
|
||||
echo "$FLEXRAN_CTL_VM_NAME has for IP addr = $FLEXRAN_CTL_VM_IP_ADDR"
|
||||
echo "FLEXRAN_CTL_VM_CMDS = $FLEXRAN_CTL_VM_CMDS"
|
||||
echo "############################################################"
|
||||
echo "Starting the FLEXRAN CONTROLLER"
|
||||
echo "############################################################"
|
||||
start_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
|
||||
query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 01_no_enb_connected
|
||||
|
||||
echo "############################################################"
|
||||
echo "Starting the eNB in FDD-5MHz mode with Flexran ON"
|
||||
echo "############################################################"
|
||||
CURRENT_ENB_LOG_FILE=fdd_05fMHz_enb.log
|
||||
start_basic_sim_enb $VM_CMDS $VM_IP_ADDR $EPC_VM_IP_ADDR $CURRENT_ENB_LOG_FILE 25 lte-fdd-basic-sim.conf $FLEXRAN_CTL_VM_IP_ADDR
|
||||
query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 02_enb_connected
|
||||
|
||||
echo "############################################################"
|
||||
echo "Starting the UE in FDD-5MHz mode"
|
||||
echo "############################################################"
|
||||
CURRENT_UE_LOG_FILE=fdd_05fMHz_ue.log
|
||||
start_basic_sim_ue $VM_CMDS $VM_IP_ADDR $CURRENT_UE_LOG_FILE 25 2680
|
||||
if [ $UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ eNB and UE not syncing"
|
||||
terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
STATUS=-1
|
||||
return
|
||||
fi
|
||||
query_flexran_ctrl_status $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR 03_enb_ue_connected
|
||||
get_ue_ip_addr $VM_CMDS $VM_IP_ADDR 1
|
||||
|
||||
sleep 30
|
||||
echo "############################################################"
|
||||
echo "Terminate enb/ue simulators"
|
||||
echo "############################################################"
|
||||
terminate_enb_ue_basic_sim $VM_CMDS $VM_IP_ADDR 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_UE_LOG_FILE $ARCHIVES_LOC
|
||||
recover_core_dump $VM_CMDS $VM_IP_ADDR $ARCHIVES_LOC/$CURRENT_ENB_LOG_FILE $ARCHIVES_LOC
|
||||
sleep 10
|
||||
|
||||
echo "############################################################"
|
||||
echo "Stopping the FLEXRAN CONTROLLER"
|
||||
echo "############################################################"
|
||||
stop_flexran_ctrl $FLEXRAN_CTL_VM_CMDS $FLEXRAN_CTL_VM_IP_ADDR
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$FLEXRAN_CTL_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/flexran_ctl_*.log $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "Terminate EPC"
|
||||
echo "############################################################"
|
||||
|
||||
if [[ "$EPC_IPADDR" == "" ]]
|
||||
then
|
||||
terminate_epc $EPC_VM_CMDS $EPC_VM_IP_ADDR
|
||||
fi
|
||||
|
||||
full_basic_sim_destroy
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking run status"
|
||||
echo "############################################################"
|
||||
|
||||
if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log
|
||||
else
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
|
||||
then
|
||||
PING_STATUS=0
|
||||
@@ -2343,11 +1932,11 @@ function run_test_on_vm {
|
||||
echo "SA test NOT OK"
|
||||
echo "try_cnt = " $try_cnt
|
||||
try_cnt=$((try_cnt+1))
|
||||
SA_106PRB_STATUS = -1
|
||||
SA_106PRB_STATUS=-1
|
||||
else
|
||||
echo "SA test OK"
|
||||
try_cnt=$((try_cnt+10))
|
||||
SA_106PRB_STATUS = 0
|
||||
SA_106PRB_STATUS=0
|
||||
fi
|
||||
done
|
||||
########### end SA test
|
||||
@@ -2426,11 +2015,11 @@ function run_test_on_vm {
|
||||
echo "SA test NOT OK"
|
||||
echo "try_cnt = " $try_cnt
|
||||
try_cnt=$((try_cnt+1))
|
||||
SA_24PRB_STATUS = -1
|
||||
SA_24PRB_STATUS=-1
|
||||
else
|
||||
echo "SA test OK"
|
||||
try_cnt=$((try_cnt+10))
|
||||
SA_24PRB_STATUS = 0
|
||||
SA_24PRB_STATUS=0
|
||||
fi
|
||||
done
|
||||
########### end SA test
|
||||
|
||||
@@ -47,7 +47,7 @@ function wait_on_vm_build {
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
||||
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
@@ -93,7 +93,7 @@ function wait_on_vm_build {
|
||||
}
|
||||
|
||||
function check_on_vm_build {
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]]
|
||||
if [[ "$VM_NAME" == *"-enb-usrp"* ]] || [[ "$VM_NAME" == *"-cppcheck"* ]] || [[ "$VM_NAME" == *"-phy-sim"* ]] || [[ "$VM_NAME" == *"-basic-sim"* ]] || [[ "$VM_NAME" == *"-flexran-rtc"* ]]
|
||||
then
|
||||
echo "This VM type is no longer supported in the pipeline framework"
|
||||
return
|
||||
@@ -174,13 +174,13 @@ function check_on_vm_build {
|
||||
fi
|
||||
|
||||
# If we were building the FlexRan Controller, flag-touch for basic-simulator to continue
|
||||
if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
|
||||
then
|
||||
if [[ $STATUS -eq 0 ]]
|
||||
then
|
||||
touch $JENKINS_WKSP/flexran/flexran_build_complete.txt
|
||||
fi
|
||||
fi
|
||||
#if [[ "$VM_NAME" == *"-flexran-rtc"* ]]
|
||||
#then
|
||||
# if [[ $STATUS -eq 0 ]]
|
||||
# then
|
||||
# touch $JENKINS_WKSP/flexran/flexran_build_complete.txt
|
||||
# fi
|
||||
#fi
|
||||
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
|
||||
@@ -39,8 +39,9 @@
|
||||
050001
|
||||
070001
|
||||
070000
|
||||
050000
|
||||
050001
|
||||
070002
|
||||
050002
|
||||
050003
|
||||
010002
|
||||
000001
|
||||
030202
|
||||
@@ -117,10 +118,28 @@
|
||||
<ping_rttavg_threshold>15</ping_rttavg_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050002">
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings in 20sec</desc>
|
||||
<id>idefix</id>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>1</ping_packetloss_threshold>
|
||||
<ping_rttavg_threshold>15</ping_rttavg_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050003">
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 100pings in 20sec</desc>
|
||||
<id>idefix</id>
|
||||
<ping_args>-c 100 -i 0.2</ping_args>
|
||||
<ping_packetloss_threshold>1</ping_packetloss_threshold>
|
||||
<ping_rttavg_threshold>15</ping_rttavg_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070000">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (DL/40Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 40M -t 60</iperf_args>
|
||||
<iperf_args>-u -b 40M -t 60 -i 1 -fm</iperf_args>
|
||||
<direction>DL</direction>
|
||||
<id>idefix</id>
|
||||
<iperf_packetloss_threshold>20</iperf_packetloss_threshold>
|
||||
@@ -131,7 +150,7 @@
|
||||
<testCase id="070001">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-u -b 3M -t 60</iperf_args>
|
||||
<iperf_args>-u -b 3M -t 60 -i 1 -fm</iperf_args>
|
||||
<direction>UL</direction>
|
||||
<id>idefix</id>
|
||||
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
|
||||
@@ -139,6 +158,15 @@
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070002">
|
||||
<class>Iperf</class>
|
||||
<desc>iperf (BIDIR TCP)(10 sec)(single-ue profile)</desc>
|
||||
<iperf_args>-t 10 --bidir</iperf_args>
|
||||
<direction>BIDIR</direction>
|
||||
<id>idefix</id>
|
||||
<iperf_profile>single-ue</iperf_profile>
|
||||
</testCase>
|
||||
|
||||
<testCase id="030201">
|
||||
<class>Undeploy_Object</class>
|
||||
<desc>Undeploy eNB</desc>
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<testCase id="040000">
|
||||
<class>Initialize_eNB</class>
|
||||
<desc>Initialize gNB</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time,line_num,function</Initialize_eNB_args>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.nsa_2x2.106PRB.usrpn310.conf -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time,line_num,function</Initialize_eNB_args>
|
||||
<eNB_instance>1</eNB_instance>
|
||||
<eNB_serverId>1</eNB_serverId>
|
||||
<air_interface>nr</air_interface>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<desc>Initialize gNB USRP</desc>
|
||||
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.tm1.106PRB.usrpn300.conf --phy-test -q -U 787200 -T 106 -t 28 -D 130175 -m 28 -M 106 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
|
||||
<air_interface>NR</air_interface>
|
||||
<USRP_IPAddress>192.168.30.2</USRP_IPAddress>
|
||||
<USRP_IPAddress>192.168.20.2</USRP_IPAddress>
|
||||
</testCase>
|
||||
|
||||
<testCase id="000001">
|
||||
|
||||
@@ -23,6 +23,7 @@ This page is only valid for an `Ubuntu18` host.
|
||||
1. [Deploy OAI 5G Core Network](#21-deploy-oai-5g-core-network)
|
||||
2. [Deploy OAI gNB in RF simulator mode and in Standalone Mode](#22-deploy-oai-gnb-in-rf-simulator-mode-and-in-standalone-mode)
|
||||
3. [Deploy OAI NR-UE in RF simulator mode and in Standalone Mode](#23-deploy-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode)
|
||||
4. [Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode](#24-deploy-second-oai-nr-ue-in-rf-simulator-mode-and-in-standalone-mode)
|
||||
3. [Check traffic](#3-check-traffic)
|
||||
1. [Check your Internet connectivity](#31-check-your-internet-connectivity)
|
||||
2. [Start the iperf server inside the NR-UE container](#32-start-the-iperf-server-inside-the-nr-ue-container)
|
||||
@@ -203,6 +204,8 @@ $ docker logs rfsim5g-oai-amf
|
||||
$ docker-compose up -d oai-nr-ue
|
||||
rfsim5g-mysql is up-to-date
|
||||
rfsim5g-oai-nrf is up-to-date
|
||||
rfsim5g-oai-amf is up-to-date
|
||||
rfsim5g-oai-smf is up-to-date
|
||||
rfsim5g-oai-spgwu is up-to-date
|
||||
rfsim5g-oai-ext-dn is up-to-date
|
||||
rfsim5g-oai-gnb is up-to-date
|
||||
@@ -231,7 +234,7 @@ Making sure the OAI UE is connected:
|
||||
$ docker exec -it rfsim5g-oai-nr-ue /bin/bash
|
||||
root@bb4d400a832d:/opt/oai-nr-ue# ifconfig
|
||||
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
||||
inet 192.168.71.137 netmask 255.255.255.192 broadcast 192.168.71.191
|
||||
inet 192.168.71.150 netmask 255.255.255.192 broadcast 192.168.71.191
|
||||
ether 02:42:c0:a8:47:89 txqueuelen 0 (Ethernet)
|
||||
RX packets 224259 bytes 5821372018 (5.8 GB)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
@@ -255,6 +258,98 @@ oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
```
|
||||
|
||||
## 2.4. Deploy Second OAI NR-UE in RF simulator mode and in Standalone Mode ##
|
||||
|
||||
```bash
|
||||
Create a entry for new IMSI (208990100001101) in oai_db.sql file
|
||||
Refer Section - [Making the NR-UE connect to the core network](#51-making-the-nr-ue-connect-to-the-core-network)
|
||||
|
||||
Create entry for Second UE in docker-compose.yaml file as follows:
|
||||
oai-nr-ue2:
|
||||
image: oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue2
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.140
|
||||
FULL_IMSI: '208990100001101'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
NSSAI_SD: 1
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.151
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
```
|
||||
|
||||
|
||||
```bash
|
||||
$ docker-compose up -d oai-nr-ue2
|
||||
rfsim5g-mysql is up-to-date
|
||||
rfsim5g-oai-nrf is up-to-date
|
||||
rfsim5g-oai-amf is up-to-date
|
||||
rfsim5g-oai-smf is up-to-date
|
||||
rfsim5g-oai-spgwu is up-to-date
|
||||
rfsim5g-oai-ext-dn is up-to-date
|
||||
rfsim5g-oai-gnb is up-to-date
|
||||
Creating rfsim5g-oai-nr-ue2 ... done
|
||||
```
|
||||
|
||||
Wait for a bit.
|
||||
|
||||
```bash
|
||||
$ docker-compose ps -a
|
||||
Name Command State Ports
|
||||
-------------------------------------------------------------------------------------------------
|
||||
rfsim5g-mysql docker-entrypoint.sh mysqld Up (healthy) 3306/tcp, 33060/tcp
|
||||
rfsim5g-oai-amf /bin/bash /openair-amf/bin ... Up (healthy) 38412/sctp, 80/tcp, 9090/tcp
|
||||
rfsim5g-oai-ext-dn /bin/bash -c apt update; ... Up (healthy)
|
||||
rfsim5g-oai-gnb /opt/oai-gnb/bin/entrypoin ... Up (healthy)
|
||||
rfsim5g-oai-nr-ue /opt/oai-nr-ue/bin/entrypo ... Up (healthy)
|
||||
rfsim5g-oai-nr-ue2 /opt/oai-nr-ue/bin/entrypo ... Up (healthy)
|
||||
rfsim5g-oai-nrf /bin/bash /openair-nrf/bin ... Up (healthy) 80/tcp, 9090/tcp
|
||||
rfsim5g-oai-smf /bin/bash /openair-smf/bin ... Up (healthy) 80/tcp, 8805/udp, 9090/tcp
|
||||
rfsim5g-oai-spgwu /openair-spgwu-tiny/bin/en ... Up (healthy) 2152/udp, 8805/udp
|
||||
```
|
||||
|
||||
Making sure the Second OAI UE is connected:
|
||||
|
||||
```bash
|
||||
$ docker exec -it rfsim5g-oai-nr-ue2 /bin/bash
|
||||
root@bb4d400a832d:/opt/oai-nr-ue# ifconfig
|
||||
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
||||
inet 192.168.71.151 netmask 255.255.255.192 broadcast 192.168.71.191
|
||||
ether 02:42:c0:a8:47:8a txqueuelen 0 (Ethernet)
|
||||
RX packets 3192021 bytes 67784900946 (67.7 GB)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 3397743 bytes 91320004542 (91.3 GB)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
|
||||
inet 127.0.0.1 netmask 255.0.0.0
|
||||
loop txqueuelen 1000 (Local Loopback)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
|
||||
oaitun_ue1: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
|
||||
inet 12.1.1.3 netmask 255.255.255.0 destination 12.1.1.3
|
||||
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 500 (UNSPEC)
|
||||
RX packets 0 bytes 0 (0.0 B)
|
||||
RX errors 0 dropped 0 overruns 0 frame 0
|
||||
TX packets 0 bytes 0 (0.0 B)
|
||||
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
|
||||
```
|
||||
|
||||
# 3. Check traffic #
|
||||
|
||||
## 3.1. Check your Internet connectivity ##
|
||||
@@ -299,6 +394,9 @@ Let now try to check UDP traffic in Downlink.
|
||||
|
||||
You will need 2 terminals: one in the NR-UE container, one in the ext-dn container.
|
||||
|
||||
Note:
|
||||
Similarly, Second OAI UE Internet connectivity can be checked.
|
||||
|
||||
## 3.2. Start the `iperf` server inside the NR-UE container ##
|
||||
|
||||
```bash
|
||||
@@ -384,24 +482,26 @@ The `500 Kbits/sec` value may change depending on your CPU power!
|
||||
|
||||
```bash
|
||||
$ docker-compose down
|
||||
Stopping rfsim5g-oai-nr-ue2 ... done
|
||||
Stopping rfsim5g-oai-nr-ue ... done
|
||||
Stopping rfsim5g-oai-gnb ... done
|
||||
Stopping rfsim5g-oai-ext-dn ... done
|
||||
Stopping rfsim5g-oai-spgwu ... done
|
||||
Stopping rfsim5g-oai-smf ... done
|
||||
Stopping rfsim5g-oai-amf ... done
|
||||
Stopping rfsim5g-oai-spgwu ... done
|
||||
Stopping rfsim5g-oai-nrf ... done
|
||||
Stopping rfsim5g-mysql ... done
|
||||
Removing rfsim5g-oai-nr-ue2 ... done
|
||||
Removing rfsim5g-oai-nr-ue ... done
|
||||
Removing rfsim5g-oai-gnb ... done
|
||||
Removing rfsim5g-oai-ext-dn ... done
|
||||
Removing rfsim5g-oai-spgwu ... done
|
||||
Removing rfsim5g-oai-smf ... done
|
||||
Removing rfsim5g-oai-amf ... done
|
||||
Removing rfsim5g-oai-spgwu ... done
|
||||
Removing rfsim5g-oai-nrf ... done
|
||||
Removing rfsim5g-mysql ... done
|
||||
Removing network rfsim5g-oai-public-net
|
||||
Removing network rfsim5g-oai-traffic_net-net
|
||||
Removing network rfsim5g-oai-traffic-net
|
||||
```
|
||||
|
||||
# 5. Explanations on the configuration in the `docker-compose.yaml` #
|
||||
@@ -419,13 +519,19 @@ This value is also present in the `oai_db.sql` file:
|
||||
|
||||
```bash
|
||||
INSERT INTO `users` VALUES ('208990100001100','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1);
|
||||
INSERT INTO `users` VALUES ('208990100001101','1','55000000000000',NULL,'PURGED',50,40000000,100000000,47,0000000000,1,0xfec86ba6eb707ed08905757b1bb44b8f,0,0,0x40,'ebd07771ace8677a',0xc42449363bbad02b66d16bc975d77cc1);
|
||||
```
|
||||
|
||||
As you can see, 2 other values shall match in the NR-UE section of `docker-compose.yaml`:
|
||||
|
||||
OAI UE - 1
|
||||
* `FULL_IMSI: '208990100001100'`
|
||||
* `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'`
|
||||
|
||||
OAI UE - 2
|
||||
* `FULL_IMSI: '208990100001101'`
|
||||
* `FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'`
|
||||
|
||||
We are also using a dedicated `oai-smf.conf` for the `SMF` container: the `oai` DNN shall match the one in the NR-UE section of `docker-compose.yaml` (`DNN: oai`).
|
||||
|
||||
## 5.2. Making the gNB connect to the core network ##
|
||||
|
||||
@@ -279,6 +279,30 @@ services:
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
oai-nr-ue2:
|
||||
image: oai-nr-ue:develop
|
||||
privileged: true
|
||||
container_name: rfsim5g-oai-nr-ue2
|
||||
environment:
|
||||
RFSIMULATOR: 192.168.71.140
|
||||
FULL_IMSI: '208990100001101'
|
||||
FULL_KEY: 'fec86ba6eb707ed08905757b1bb44b8f'
|
||||
OPC: 'C42449363BBAD02B66D16BC975D77CC1'
|
||||
DNN: oai
|
||||
NSSAI_SST: 1
|
||||
NSSAI_SD: 1
|
||||
USE_ADDITIONAL_OPTIONS: -E --sa --rfsim -r 106 --numerology 1 -C 3619200000 --nokrnmod --log_config.global_log_options level,nocolor,time
|
||||
depends_on:
|
||||
- oai-gnb
|
||||
networks:
|
||||
public_net:
|
||||
ipv4_address: 192.168.71.151
|
||||
healthcheck:
|
||||
test: /bin/bash -c "pgrep nr-uesoftmodem"
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
networks:
|
||||
public_net:
|
||||
driver: bridge
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -755,27 +755,6 @@ add_library(oai_irisdevif MODULE ${HWLIB_IRIS_SOURCE})
|
||||
target_include_directories(oai_irisdevif PRIVATE /usr/local/lib/SoapySDR/modules0.7/)
|
||||
target_link_libraries(oai_irisdevif SoapySDR)
|
||||
|
||||
# TCP bridge libraries
|
||||
######################################################################
|
||||
|
||||
# this one is for internal use at Eurecom and is not documented
|
||||
set(HWLIB_TCP_BRIDGE_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge.c
|
||||
)
|
||||
add_library(tcp_bridge MODULE ${HWLIB_TCP_BRIDGE_SOURCE} )
|
||||
|
||||
#get_target_property(tcp_bridge_cflags tcp_bridge COMPILE_FLAGS)
|
||||
#set_target_properties(tcp_bridge PROPERTIES COMPILE_FLAGS "${tcp_bridge_cflags} -fvisibility=hidden")
|
||||
set_target_properties(tcp_bridge PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
|
||||
|
||||
# this one is to connect OAI eNB and OAI UE in the basic simulator
|
||||
# see targets/ARCH/tcp_bridge/README.tcp_bridge_oai for usage
|
||||
set(HWLIB_TCP_BRIDGE_OAI_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/tcp_bridge/tcp_bridge_oai.c
|
||||
)
|
||||
add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} )
|
||||
set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
|
||||
|
||||
# Benetel 4G library
|
||||
######################################################################
|
||||
|
||||
@@ -3008,8 +2987,7 @@ if (${T_TRACER})
|
||||
#all "add_library" definitions
|
||||
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
|
||||
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
|
||||
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
|
||||
coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO
|
||||
oai_eth_transpro oai_mobipass coding FLPT_MSG FLEXRAN_AGENT HASHTABLE UTIL OMG_SUMO
|
||||
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
|
||||
|
||||
@@ -894,11 +894,6 @@ function main() {
|
||||
compilations \
|
||||
$BUILD_DIR rfsimulator \
|
||||
librfsimulator.so $dbin/librfsimulator.so.$REL
|
||||
|
||||
echo_info "Compiling tcp_bridge_oai"
|
||||
compilations \
|
||||
$BUILD_DIR tcp_bridge_oai \
|
||||
libtcp_bridge_oai.so $dbin/libtcp_bridge_oai.so.$REL
|
||||
fi
|
||||
|
||||
#build transport protocol libraries (currently only ETHERNET is available)
|
||||
|
||||
@@ -33,12 +33,6 @@ volatile int _T_freelist_head;
|
||||
volatile int *T_freelist_head = &_T_freelist_head;
|
||||
T_cache_t *T_cache;
|
||||
|
||||
#if BASIC_SIMULATOR
|
||||
/* global variables used by T_GET_SLOT, see in T.h */
|
||||
volatile uint64_t T_next_id;
|
||||
volatile uint64_t T_active_id;
|
||||
#endif
|
||||
|
||||
static void get_message(int s) {
|
||||
char t;
|
||||
int l;
|
||||
|
||||
+1
-32
@@ -111,39 +111,8 @@ typedef struct {
|
||||
extern volatile int *T_freelist_head;
|
||||
extern T_cache_t *T_cache;
|
||||
extern int *T_active;
|
||||
/* When running the basic simulator, we may fill the T cache too fast.
|
||||
* Let's serialize write accesses to the T cache. For that, we use a
|
||||
* 'ticket' mechanism. To acquire a T slot the caller needs to own the
|
||||
* current active ticket. We also wait for the slot to be free if
|
||||
* it is already in use.
|
||||
*/
|
||||
#if BASIC_SIMULATOR
|
||||
# define T_GET_SLOT \
|
||||
do { \
|
||||
extern volatile uint64_t T_next_id; \
|
||||
extern volatile uint64_t T_active_id; \
|
||||
uint64_t id; \
|
||||
/* get a ticket */ \
|
||||
id = __sync_fetch_and_add(&T_next_id, 1); \
|
||||
/* wait for our turn */ \
|
||||
while (id != __sync_fetch_and_add(&T_active_id, 0)) /* busy wait */; \
|
||||
/* this is our turn, try to acquire the slot until it's free */ \
|
||||
do { \
|
||||
T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01); \
|
||||
if (T_LOCAL_busy & 0x01) usleep(100); \
|
||||
} while (T_LOCAL_busy & 0x01); \
|
||||
/* check that there are still some tickets */ \
|
||||
if (__sync_fetch_and_add(&T_active_id, 0) == 0xffffffffffffffff) { \
|
||||
printf("T: reached the end of times, bye...\n"); \
|
||||
abort(); \
|
||||
} \
|
||||
/* free our ticket, which signals the next waiter that it's its turn */ \
|
||||
(void)__sync_fetch_and_add(&T_active_id, 1); \
|
||||
} while (0)
|
||||
#else
|
||||
# define T_GET_SLOT \
|
||||
#define T_GET_SLOT \
|
||||
T_LOCAL_busy = __sync_fetch_and_or(&T_cache[T_LOCAL_slot].busy, 0x01);
|
||||
#endif
|
||||
|
||||
/* used at header of Tn, allocates buffer */
|
||||
#define T_LOCAL_DATA \
|
||||
|
||||
+2
-12
@@ -40,20 +40,10 @@
|
||||
#define T_MAX_ARGS 16
|
||||
|
||||
/* maximum size of a message - increase if needed */
|
||||
#if BASIC_SIMULATOR
|
||||
/* let's have 100 RBs functional for the basic simulator */
|
||||
# define T_BUFFER_MAX (1024*64*4)
|
||||
#else
|
||||
# define T_BUFFER_MAX (1024*64*4)
|
||||
#endif
|
||||
#define T_BUFFER_MAX (1024*64*4)
|
||||
|
||||
/* size of the local cache for messages (must be pow(2,something)) */
|
||||
#if BASIC_SIMULATOR
|
||||
/* we don't need much space for the basic simulator */
|
||||
# define T_CACHE_SIZE 1024
|
||||
#else
|
||||
# define T_CACHE_SIZE (8192)
|
||||
#endif
|
||||
#define T_CACHE_SIZE (8192)
|
||||
|
||||
/* maximum number of bytes a message can contain */
|
||||
#ifdef T_SEND_TIME
|
||||
|
||||
@@ -357,22 +357,6 @@ static void forward(void *_forwarder, char *buf, int size) {
|
||||
if (f->tail != NULL) f->tail->next = new;
|
||||
|
||||
f->tail = new;
|
||||
#if BASIC_SIMULATOR
|
||||
/* When runnng the basic simulator, the tracer may be too slow.
|
||||
* Let's not take too much memory in the tracee and
|
||||
* wait if there is too much data to send. 200MB is
|
||||
* arbitrary.
|
||||
*/
|
||||
while (f->memusage > 200 * 1024 * 1024) {
|
||||
if (pthread_cond_signal(&f->cond)) abort();
|
||||
|
||||
if (pthread_mutex_unlock(&f->lock)) abort();
|
||||
|
||||
usleep(1000);
|
||||
|
||||
if (pthread_mutex_lock(&f->lock)) abort();
|
||||
}
|
||||
#endif
|
||||
f->memusage += size+4;
|
||||
|
||||
/* warn every 100MB */
|
||||
|
||||
@@ -1,191 +0,0 @@
|
||||
<table style="border-collapse: collapse; border: none;">
|
||||
<tr style="border-collapse: collapse; border: none;">
|
||||
<td style="border-collapse: collapse; border: none;">
|
||||
<a href="http://www.openairinterface.org/">
|
||||
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
|
||||
</img>
|
||||
</a>
|
||||
</td>
|
||||
<td style="border-collapse: collapse; border: none; vertical-align: center;">
|
||||
<b><font size = "5">Running OAI Basic Simulator</font></b>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
This page is valid on the following branches:
|
||||
|
||||
- `master` starting from tag `v1.1.0`
|
||||
- `develop` starting from tag `2019.w11`
|
||||
|
||||
# 1. Building the basic-simulator.
|
||||
|
||||
After the build simplification, the basic simulator is available directly from the standard build.
|
||||
|
||||
```bash
|
||||
$ source oaienv
|
||||
$ cd cmake_targets
|
||||
$ ./build_oai --eNB --UE
|
||||
```
|
||||
|
||||
Both eNB (lte-softmodem) and UE (lte-uesoftmodem) are present on `cmake_targets/ran_build/build` folder.
|
||||
|
||||
More details are available on the [build page](BUILD.md).
|
||||
|
||||
# 2. Running the basic simulator.
|
||||
|
||||
The basic simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE and the oai eNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations.
|
||||
|
||||
This is the ideal tool to check signal processing algorithms and protocols implementation and having debug sessions without any HW radio equipment.
|
||||
|
||||
The main limitations are:
|
||||
|
||||
- A single OAI UE will connect to the OAI eNB
|
||||
- No channel noise
|
||||
|
||||
## 2.1. Starting eNB
|
||||
|
||||
The basic simulator is able to run with a connected EPC or without any (the so-called "noS1" mode).
|
||||
|
||||
Example 1: running in FDD mode with EPC.
|
||||
|
||||
```bash
|
||||
$ source oaienv
|
||||
$ cd cmake_targets/ran_build/build
|
||||
$ ENODEB=1 sudo -E ./lte-softmodem -O $OPENAIR_HOME/ci-scripts/conf_files/lte-fdd-basic-sim.conf --basicsim
|
||||
```
|
||||
|
||||
Edit previously the `ci-scripts/conf_files/lte-fdd-basic-sim.conf` file to modify:
|
||||
|
||||
- `N_RB_DL` field to change the Bandwidth (25, 50, 100)
|
||||
- `CI_MME_IP_ADDR` with the EPC IP address
|
||||
- `CI_ENB_IP_ADDR` with the container (physical server, virtual machine, ...) on which you are executing the eNB soft-modem
|
||||
|
||||
Example 2: running in TDD mode without any EPC.
|
||||
|
||||
```bash
|
||||
$ source oaienv
|
||||
$ cd cmake_targets/ran_build/build
|
||||
$ ENODEB=1 sudo -E ./lte-softmodem -O $OPENAIR_HOME/ci-scripts/conf_files/lte-tdd-basic-sim.conf --basicsim --noS1
|
||||
```
|
||||
|
||||
## 2.2. Starting UE
|
||||
|
||||
Before starting the UE, you may need to edit the SIM parameters to adapt to your eNB configuration and HSS database.
|
||||
|
||||
The <conf> file to use for conf2uedate is `openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf`
|
||||
|
||||
You need to set the correct OPC, USIM_API_K, MSIN (this is the end par of the IMSI), HPLMN (the front part of IMSI) to match values from HSS.
|
||||
|
||||
```bash
|
||||
$ source oaienv
|
||||
# Edit openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf
|
||||
$ cd cmake_targets/ran_build/build
|
||||
$ ../../nas_sim_tools/build/conf2uedata -c $OPENAIR_HOME/openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf -o .
|
||||
$ sudo -E ./lte-uesoftmodem -C 2625000000 -r 25 --ue-rxgain 140 --basicsim [--noS1]
|
||||
```
|
||||
|
||||
The `-r 25` is to use if in the conf file of the eNB you use N_RB_DL=25. Use 50 if you have N_RB_DL=50 and 100 if you have N_RB_DL=100.
|
||||
|
||||
The `-C 2625000000` is the downlink frequency. Use the same value as `downlink_frequency` in the eNB configuration file.
|
||||
|
||||
The `--noS1` is mandatory if you started the eNB in that mode.
|
||||
|
||||
# 3. Testing the data plane
|
||||
|
||||
# 3.1. In S1 mode
|
||||
|
||||
First we need to retrieve the IP address allocated to the OAI UE.
|
||||
|
||||
On the server that runs the UE:
|
||||
|
||||
```bash
|
||||
$ ifconfig oaitun_ue1
|
||||
oaitun_ue1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
|
||||
inet addr:192.172.0.2 P-t-P:192.172.0.2 Mask:255.255.255.0
|
||||
...
|
||||
```
|
||||
|
||||
`192.172.0.2` is the IP address that has been allocated by the SPGW in the EPC.
|
||||
|
||||
On the server that runs the EPC:
|
||||
|
||||
```bash
|
||||
$ ping -c 20 192.172.0.2
|
||||
--- 192.172.0.2 ping statistics ---
|
||||
20 packets transmitted, 20 received, 0% packet loss, time 19020ms
|
||||
rtt min/avg/max/mdev = 13.241/18.999/24.208/2.840 ms
|
||||
```
|
||||
|
||||
You can ping the EPC from the UE:
|
||||
|
||||
```bash
|
||||
$ ping -I oaitun_ue1 -c 20 192.172.0.1
|
||||
--- 192.172.0.1 ping statistics ---
|
||||
...
|
||||
20 packets transmitted, 20 received, 0% packet loss, time 19019ms
|
||||
rtt min/avg/max/mdev = 13.015/18.674/23.738/2.917 ms
|
||||
```
|
||||
|
||||
For DL iperf testing:
|
||||
|
||||
On the server that runs the UE.
|
||||
|
||||
```bash
|
||||
$ iperf -B 192.172.0.2 -u -s -i 1 -fm -p 5001
|
||||
```
|
||||
|
||||
On the server that runs the EPC.
|
||||
|
||||
```bash
|
||||
$ iperf -c 192.172.0.2 -u -t 30 -b 10M -i 1 -fm -B 192.172.0.1 -p 5001
|
||||
```
|
||||
|
||||
For UL iperf testing:
|
||||
|
||||
On the server that runs the EPC.
|
||||
|
||||
```bash
|
||||
$ iperf -B 192.172.0.1 -u -s -i 1 -fm -p 5001
|
||||
```
|
||||
|
||||
On the server that runs the UE.
|
||||
|
||||
```bash
|
||||
$ iperf -c 192.172.0.1 -u -t 30 -b 2M -i 1 -fm -B 192.172.0.2 -p 5001
|
||||
```
|
||||
|
||||
# 3.2. In noS1 mode
|
||||
|
||||
The IP addresses are fixed. But we can still retrieve them programmatically.
|
||||
|
||||
For the UE it is quite the same:
|
||||
|
||||
```bash
|
||||
$ ifconfig oaitun_ue1
|
||||
oaitun_ue1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
|
||||
inet addr:10.0.1.2 P-t-P:10.0.1.2 Mask:255.255.255.0
|
||||
...
|
||||
```
|
||||
|
||||
For the eNB:
|
||||
|
||||
```bash
|
||||
$ ifconfig oaitun_enb1
|
||||
oaitun_enb1 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
|
||||
inet addr:10.0.1.1 P-t-P:10.0.1.1 Mask:255.255.255.0
|
||||
...
|
||||
```
|
||||
|
||||
Pinging like this:
|
||||
|
||||
```bash
|
||||
$ ping -I oaitun_ue1 -c 20 10.0.1.1
|
||||
$ ping -I oaitun_enb1 -c 20 10.0.1.2
|
||||
```
|
||||
|
||||
And the same for iperf:
|
||||
|
||||
```bash
|
||||
$ iperf -B 10.0.1.2 -u -s -i 1 -fm
|
||||
$ iperf -c 10.0.1.2 -u -b 1.00M -t 30 -i 1 -fm -B 10.0.1.1
|
||||
```
|
||||
@@ -14,10 +14,6 @@
|
||||
|
||||
After you have [built the softmodem executables](BUILD.md) you can set your default directory to the build directory `cmake_targets/ran_build/build/` and start testing some use cases. Below, the description of the different oai functionalities should help you choose the oai configuration that suits your need.
|
||||
|
||||
# Basic Simulator
|
||||
|
||||
See the [dedicated page](BASIC_SIM.md).
|
||||
|
||||
# RF Simulator
|
||||
|
||||
The rf simulator is a oai device replacing the radio heads (for example the USRP device). It allows connecting the oai UE (LTE or 5G) and respectively the oai eNodeB or gNodeB through a network interface carrying the time-domain samples, getting rid of over the air unpredictable perturbations. This is the ideal tool to check signal processing algorithms and protocols implementation. The rf simulator has some preliminary support for channel modeling.
|
||||
|
||||
@@ -62,7 +62,6 @@ COPY --from=enb-build \
|
||||
|
||||
COPY --from=enb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -62,7 +62,6 @@ COPY --from=enb-build /oai-ran/targets/bin/lte-softmodem.Rel15 .
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=enb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
COPY --from=enb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
|
||||
COPY --from=enb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
|
||||
COPY --from=enb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
|
||||
COPY --from=enb-build /oai-ran/targets/bin/libcoding.so .
|
||||
@@ -95,7 +94,6 @@ RUN ldconfig
|
||||
|
||||
#debug
|
||||
RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
RUN ldd /usr/local/lib/libcoding.so
|
||||
|
||||
@@ -69,7 +69,6 @@ COPY --from=enb-build \
|
||||
|
||||
COPY --from=enb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -64,7 +64,6 @@ COPY --from=gnb-build \
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -65,7 +65,6 @@ COPY --from=gnb-build /oai-ran/targets/bin/nr-softmodem.Rel15 .
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
|
||||
COPY --from=gnb-build /oai-ran/targets/bin/libcoding.so .
|
||||
@@ -102,7 +101,6 @@ RUN ldconfig
|
||||
#debug
|
||||
RUN ldd /opt/oai-gnb/bin/nr-softmodem.Rel15
|
||||
RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
RUN ldd /usr/local/lib/libcoding.so
|
||||
|
||||
@@ -68,7 +68,6 @@ COPY --from=gnb-build \
|
||||
|
||||
COPY --from=gnb-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -59,7 +59,6 @@ COPY --from=ru-build \
|
||||
|
||||
COPY --from=ru-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \
|
||||
|
||||
@@ -64,7 +64,6 @@ COPY --from=ru-build \
|
||||
|
||||
COPY --from=ru-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libparams_libconfig.so \
|
||||
|
||||
@@ -66,7 +66,6 @@ COPY --from=lte-ue-build \
|
||||
|
||||
COPY --from=lte-ue-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -68,7 +68,6 @@ COPY --from=lte-ue-build /oai-ran/targets/bin/.usim.nvram0 .
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
COPY --from=lte-ue-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
|
||||
COPY --from=lte-ue-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
|
||||
COPY --from=lte-ue-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
|
||||
COPY --from=lte-ue-build /oai-ran/targets/bin/libcoding.so .
|
||||
@@ -105,7 +104,6 @@ RUN ldd /opt/oai-lte-ue/bin/conf2uedata
|
||||
RUN ldd /opt/oai-lte-ue/bin/nvram
|
||||
RUN ldd /opt/oai-lte-ue/bin/usim
|
||||
RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
RUN ldd /usr/local/lib/libcoding.so
|
||||
|
||||
@@ -73,7 +73,6 @@ COPY --from=lte-ue-build \
|
||||
|
||||
COPY --from=lte-ue-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -66,7 +66,6 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf .
|
||||
|
||||
COPY --from=nr-ue-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -64,7 +64,6 @@ COPY --from=nr-ue-build /oai-ran/targets/bin/nr-uesoftmodem.Rel15 .
|
||||
|
||||
WORKDIR /usr/local/lib/
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
|
||||
COPY --from=nr-ue-build /oai-ran/targets/bin/libcoding.so .
|
||||
@@ -100,7 +99,6 @@ COPY --from=nr-ue-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
|
||||
RUN ldconfig
|
||||
RUN ldd /opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15
|
||||
RUN ldd /usr/local/lib/liboai_eth_transpro.so.Rel15
|
||||
RUN ldd /usr/local/lib/libtcp_bridge_oai.so.Rel15
|
||||
RUN ldd /usr/local/lib/librfsimulator.so.Rel15
|
||||
RUN ldd /usr/local/lib/liboai_usrpdevif.so.Rel15
|
||||
RUN ldd /usr/local/lib/libcoding.so
|
||||
|
||||
@@ -71,7 +71,6 @@ COPY --from=nr-ue-build /oai-ran/ci-scripts/conf_files/nr-ue-sim.conf .
|
||||
|
||||
COPY --from=nr-ue-build \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_eth_transpro.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libtcp_bridge_oai.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/librfsimulator.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/liboai_usrpdevif.so \
|
||||
/oai-ran/cmake_targets/ran_build/build/libcoding.so \
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
|
||||
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
|
||||
#include "common/ran_context.h"
|
||||
#include "RRC/LTE/rrc_extern.h"
|
||||
#include "PHY_INTERFACE/phy_interface.h"
|
||||
#include "common/utils/LOG/log_extern.h"
|
||||
@@ -75,7 +75,6 @@
|
||||
#include "enb_config.h"
|
||||
#include "gnb_paramdef.h"
|
||||
|
||||
|
||||
#include "s1ap_eNB.h"
|
||||
#include "SIMULATION/ETH_TRANSPORT/proto.h"
|
||||
#include <executables/softmodem-common.h>
|
||||
@@ -518,7 +517,8 @@ void init_eNB_afterRU(void) {
|
||||
RC.nb_nr_inst = 1;
|
||||
for (inst=0; inst<RC.nb_nr_inst; inst++) {
|
||||
LOG_I(PHY,"RC.nb_nr_CC[inst:%d]:%p\n", inst, RC.gNB[inst]);
|
||||
gNB = RC.gNB[inst];
|
||||
gNB = RC.gNB[inst];
|
||||
|
||||
phy_init_nr_gNB(gNB,0,0);
|
||||
|
||||
// map antennas and PRACH signals to gNB RX
|
||||
|
||||
@@ -373,7 +373,7 @@ void init_openair0(void) {
|
||||
static void init_pdcp(int ue_id) {
|
||||
uint32_t pdcp_initmask = (!IS_SOFTMODEM_NOS1) ? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
|
||||
|
||||
/*if (IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
|
||||
/*if (IS_SOFTMODEM_RFSIM || (nfapi_getmode()==NFAPI_UE_STUB_PNF)) {
|
||||
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
|
||||
}*/
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ void get_common_options(uint32_t execmask) {
|
||||
uint32_t glog_level=0 ;
|
||||
uint32_t start_telnetsrv = 0, start_telnetclt = 0;
|
||||
uint32_t noS1 = 0, nokrnmod = 1, nonbiot = 0;
|
||||
uint32_t rfsim = 0, basicsim = 0, do_forms = 0;
|
||||
uint32_t rfsim = 0, do_forms = 0;
|
||||
char *logmem_filename = NULL;
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
|
||||
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
|
||||
@@ -141,10 +141,6 @@ void get_common_options(uint32_t execmask) {
|
||||
set_softmodem_optmask(SOFTMODEM_RFSIM_BIT);
|
||||
}
|
||||
|
||||
if (basicsim) {
|
||||
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT);
|
||||
}
|
||||
|
||||
if (do_forms) {
|
||||
set_softmodem_optmask(SOFTMODEM_DOSCOPE_BIT);
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ extern "C"
|
||||
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
|
||||
|
||||
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
|
||||
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
|
||||
#define CONFIG_HLP_RFSIM "Run in rf simulator mode\n"
|
||||
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
|
||||
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
|
||||
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
|
||||
@@ -156,7 +156,6 @@ extern int usrp_tx_thread;
|
||||
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
|
||||
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \
|
||||
{"rfsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&rfsim, defintval:0, TYPE_INT, 0}, \
|
||||
{"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \
|
||||
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
|
||||
{"nsa", CONFIG_HLP_NSA, PARAMFLAG_BOOL, iptr:&NSA, defintval:0, TYPE_INT, 0}, \
|
||||
@@ -204,7 +203,6 @@ extern int usrp_tx_thread;
|
||||
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
|
||||
#define SOFTMODEM_NONBIOT_BIT (1<<2)
|
||||
#define SOFTMODEM_RFSIM_BIT (1<<10)
|
||||
#define SOFTMODEM_BASICSIM_BIT (1<<11)
|
||||
#define SOFTMODEM_SIML1_BIT (1<<12)
|
||||
#define SOFTMODEM_DOSCOPE_BIT (1<<15)
|
||||
#define SOFTMODEM_RECPLAY_BIT (1<<16)
|
||||
@@ -221,7 +219,6 @@ extern int usrp_tx_thread;
|
||||
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
|
||||
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT)
|
||||
#define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT)
|
||||
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
|
||||
#define IS_SOFTMODEM_SIML1 ( get_softmodem_optmask() & SOFTMODEM_SIML1_BIT)
|
||||
#define IS_SOFTMODEM_DOSCOPE ( get_softmodem_optmask() & SOFTMODEM_DOSCOPE_BIT)
|
||||
#define IS_SOFTMODEM_IQPLAYER ( get_softmodem_optmask() & SOFTMODEM_RECPLAY_BIT)
|
||||
|
||||
@@ -151,11 +151,5 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
|
||||
else if (eNB->frame_parms.N_RB_DL == 25) ru->N_TA_offset = 624/4;
|
||||
} else ru->N_TA_offset=0;
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM)
|
||||
/* this is required for the basic simulator in TDD mode
|
||||
* TODO: find a proper cleaner solution
|
||||
*/
|
||||
UE->N_TA_offset = 0;
|
||||
|
||||
printf("Done lte_param_init\n");
|
||||
}
|
||||
|
||||
+415
-1
@@ -38,7 +38,7 @@
|
||||
#include "openair1/PHY/CODING/nrLDPC_extern.h"
|
||||
#include "assertions.h"
|
||||
#include <math.h>
|
||||
|
||||
#include <complex.h>
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_REFSIG/nr_refsig.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
@@ -71,6 +71,407 @@ int l1_north_init_gNB() {
|
||||
return(0);
|
||||
}
|
||||
|
||||
int init_codebook_gNB(PHY_VARS_gNB *gNB) {
|
||||
|
||||
if(gNB->frame_parms.nb_antennas_tx>1){
|
||||
int CSI_RS_antenna_ports = gNB->frame_parms.nb_antennas_tx;
|
||||
//NR Codebook Generation for codebook type1 SinglePanel
|
||||
int N1 = gNB->ap_N1;
|
||||
int N2 = gNB->ap_N2;
|
||||
//Uniform Planner Array: UPA
|
||||
// X X X X ... X
|
||||
// X X X X ... X
|
||||
// N2 . . . . ... .
|
||||
// X X X X ... X
|
||||
// |<-----N1---->|
|
||||
int x_polarization = gNB->ap_XP;
|
||||
//Get the uniform planar array parameters
|
||||
// To be confirmed
|
||||
int O2 = N2 > 1? 4 : 1; //Vertical beam oversampling (1 or 4)
|
||||
int O1 = CSI_RS_antenna_ports > 2 ? 4 : 1; //Horizontal beam oversampling (1 or 4)
|
||||
AssertFatal(CSI_RS_antenna_ports == N1*N2*x_polarization,
|
||||
"Nb of antenna ports at PHY %d does not correspond to what passed down with fapi %d\n",
|
||||
N1*N2*x_polarization, CSI_RS_antenna_ports);
|
||||
|
||||
// Generation of codebook Type1 with codebookMode 1 (CSI_RS_antenna_ports < 16)
|
||||
if (CSI_RS_antenna_ports < 16) {
|
||||
//Generate DFT vertical beams
|
||||
//ll: index of a vertical beams vector (represented by i1_1 in TS 38.214)
|
||||
double complex v[N1*O1][N1];
|
||||
for (int ll=0; ll<N1*O1; ll++) { //i1_1
|
||||
for (int nn=0; nn<N1; nn++) {
|
||||
v[ll][nn] = cexp(I*(2*M_PI*nn*ll)/(N1*O1));
|
||||
//printf("v[%d][%d] = %f +j %f\n", ll,nn, creal(v[ll][nn]),cimag(v[ll][nn]));
|
||||
}
|
||||
}
|
||||
//Generate DFT Horizontal beams
|
||||
//mm: index of a Horizontal beams vector (represented by i1_2 in TS 38.214)
|
||||
double complex u[N2*O2][N2];
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i1_2
|
||||
for (int nn=0; nn<N2; nn++) {
|
||||
u[mm][nn] = cexp(I*(2*M_PI*nn*mm)/(N2*O2));
|
||||
//printf("u[%d][%d] = %f +j %f\n", mm,nn, creal(u[mm][nn]),cimag(u[mm][nn]));
|
||||
}
|
||||
}
|
||||
//Generate co-phasing angles
|
||||
//i_2: index of a co-phasing vector
|
||||
//i1_1, i1_2, and i_2 are reported from UEs
|
||||
double complex theta_n[4];
|
||||
for (int nn=0; nn<4; nn++) {
|
||||
theta_n[nn] = cexp(I*M_PI*nn/2);
|
||||
//printf("theta_n[%d] = %f +j %f\n", nn, creal(theta_n[nn]),cimag(theta_n[nn]));
|
||||
}
|
||||
//Kronecker product v_lm
|
||||
double complex v_lm[N1*O1][N2*O2][N2*N1];
|
||||
//v_ll_mm_codebook denotes the elements of a precoding matrix W_i1,1_i_1,2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn1=0; nn1<N1; nn1++) {
|
||||
for (int nn2=0; nn2<N2; nn2++) {
|
||||
//printf("indx %d \n",nn1*N2+nn2);
|
||||
v_lm[ll][mm][nn1*N2+nn2] = v[ll][nn1]*u[mm][nn2];
|
||||
//printf("v_lm[%d][%d][%d] = %f +j %f\n",ll,mm, nn1*N2+nn2, creal(v_lm[ll][mm][nn1*N2+nn2]),cimag(v_lm[ll][mm][nn1*N2+nn2]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int max_mimo_layers =(CSI_RS_antenna_ports<NR_MAX_NB_LAYERS) ? CSI_RS_antenna_ports : NR_MAX_NB_LAYERS;
|
||||
|
||||
gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(max_mimo_layers* sizeof(int32_t **));
|
||||
int32_t ***mat = gNB->nr_mimo_precoding_matrix;
|
||||
double complex res_code;
|
||||
|
||||
//Table 5.2.2.2.1-5:
|
||||
//Codebook for 1-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
gNB->pmiq_size[0] = N1*O1*N2*O2*4+1;
|
||||
mat[0] = (int32_t **)malloc16(gNB->pmiq_size[0]*sizeof(int32_t *));
|
||||
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[0][0] = (int32_t *)calloc(2*N1*N2,sizeof(int32_t));
|
||||
for(int j_col=0; j_col<1; j_col++) { //1 layer
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[0][0][i_rows+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<4; nn++) {
|
||||
int pmiq = 1+ll*N2*O2*4+mm*4+nn;
|
||||
mat[0][pmiq] = (int32_t *)malloc16((2*N1*N2)*1*sizeof(int32_t));
|
||||
LOG_D(PHY, "layer 1 Codebook pmiq = %d\n",pmiq);
|
||||
for (int len=0; len<N1*N2; len++) {
|
||||
res_code=sqrt(1/(double)CSI_RS_antenna_ports)*v_lm[ll][mm][len];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]);
|
||||
}
|
||||
|
||||
for(int len=N1*N2; len<2*N1*N2; len++) {
|
||||
res_code=sqrt(1/(double)CSI_RS_antenna_ports)*theta_n[nn]*v_lm[ll][mm][len-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[0][pmiq][len])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "1 Layer Precoding Matrix[0][pmi %d][antPort %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq, len, creal(res_code), cimag(res_code),((short*) &mat[0][pmiq][len])[0],((short*) &mat[0][pmiq][len])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int llc;
|
||||
int mmc;
|
||||
double complex phase_sign;
|
||||
//Table 5.2.2.2.1-6:
|
||||
//Codebook for 2-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
//Compute the code book size for generating 2 layers out of Tx antenna ports
|
||||
|
||||
//pmi_size is computed as follows
|
||||
gNB->pmiq_size[1] = 1;//1 for unity matrix
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm) || ((N1 == 1) && (N2 == 1))) gNB->pmiq_size[1] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mat[1] = (int32_t **)malloc16(gNB->pmiq_size[1]*sizeof(int32_t *));
|
||||
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[1][0] = (int32_t *)calloc((2*N1*N2)*(2),sizeof(int32_t));
|
||||
for(int j_col=0; j_col<2; j_col++) { //2 layers
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[1][0][i_rows*2+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//pmi=1,...,pmi_size, we construct
|
||||
int pmiq = 0;
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm) || ((N1 == 1) && (N2 == 1))){
|
||||
pmiq += 1;
|
||||
mat[1][pmiq] = (int32_t *)malloc16((2*N1*N2)*(2)*sizeof(int32_t));
|
||||
LOG_I(PHY, "layer 2 Codebook pmiq = %d\n",pmiq);
|
||||
for(int j_col=0; j_col<2; j_col++) {
|
||||
if (j_col==0) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==1) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = -1;
|
||||
}
|
||||
for (int i_rows=0; i_rows<N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*v_lm[llc][mmc][i_rows];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]);
|
||||
}
|
||||
for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(2*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[1][pmiq][i_rows*2+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "2 Layer Precoding Matrix[1][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[1][pmiq][i_rows*2+j_col])[0],((short*) &mat[1][pmiq][i_rows*2+j_col])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Table 5.2.2.2.1-7:
|
||||
//Codebook for 3-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
if(max_mimo_layers>=3) {
|
||||
|
||||
//pmi_size is computed as follows
|
||||
gNB->pmiq_size[2] = 1;//unity matrix
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm)) gNB->pmiq_size[2] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
mat[2] = (int32_t **)malloc16(gNB->pmiq_size[2]*sizeof(int32_t *));
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[2][0] = (int32_t *)calloc((2*N1*N2)*(3),sizeof(int32_t));
|
||||
for(int j_col=0; j_col<3; j_col++) { //3 layers
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[2][0][i_rows*3+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pmiq = 0;
|
||||
//pmi=1,...,pmi_size are computed as follows
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm)){
|
||||
pmiq += 1;
|
||||
mat[2][pmiq] = (int32_t *)malloc16((2*N1*N2)*(3)*sizeof(int32_t));
|
||||
LOG_I(PHY, "layer 3 Codebook pmiq = %d\n",pmiq);
|
||||
for(int j_col=0; j_col<3; j_col++) {
|
||||
if (j_col==0) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==1) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==2) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = -1;
|
||||
}
|
||||
for (int i_rows=0; i_rows<N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*v_lm[llc][mmc][i_rows];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]);
|
||||
}
|
||||
for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(3*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[2][pmiq][i_rows*3+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "3 Layer Precoding Matrix[2][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[2][pmiq][i_rows*3+j_col])[0],((short*) &mat[2][pmiq][i_rows*3+j_col])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Table 5.2.2.2.1-8:
|
||||
//Codebook for 4-layer CSI reporting using antenna ports 3000 to 2999+PCSI-RS
|
||||
if(max_mimo_layers>=4) {
|
||||
//pmi_size is computed as follows
|
||||
gNB->pmiq_size[3] = 1;//unity matrix
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
if((llb != ll) || (mmb != mm)) gNB->pmiq_size[3] += 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
mat[3] = (int32_t **)malloc16(gNB->pmiq_size[3]*sizeof(int32_t *));
|
||||
//pmi=0 corresponds to unit matrix
|
||||
mat[3][0] = (int32_t *)calloc((2*N1*N2)*(4),sizeof(int32_t));
|
||||
for(int j_col=0; j_col<4; j_col++) { //4 layers
|
||||
for (int i_rows=0; i_rows<2*N1*N2; i_rows++) { //2-x polarized antenna
|
||||
if(j_col==i_rows) {
|
||||
mat[3][0][i_rows*4+j_col] = 0x7fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pmiq = 0;
|
||||
//pmi=1,...,pmi_size are computed as follows
|
||||
for(int llb=0; llb<N1*O1; llb++) { //i_1_1
|
||||
for (int mmb=0; mmb<N2*O2; mmb++) { //i_1_2
|
||||
for(int ll=0; ll<N1*O1; ll++) { //i_1_1
|
||||
for (int mm=0; mm<N2*O2; mm++) { //i_1_2
|
||||
for (int nn=0; nn<2; nn++) {
|
||||
|
||||
if((llb != ll) || (mmb != mm)){
|
||||
pmiq += 1;
|
||||
mat[3][pmiq] = (int32_t *)malloc16((2*N1*N2)*4*sizeof(int32_t));
|
||||
LOG_I(PHY, "layer 4 pmiq = %d\n",pmiq);
|
||||
for(int j_col=0; j_col<4; j_col++) {
|
||||
if (j_col==0) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==1) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = 1;
|
||||
}
|
||||
if (j_col==2) {
|
||||
llc = llb;
|
||||
mmc = mmb;
|
||||
phase_sign = -1;
|
||||
}
|
||||
if (j_col==3) {
|
||||
llc = ll;
|
||||
mmc = mm;
|
||||
phase_sign = -1;
|
||||
}
|
||||
for (int i_rows=0; i_rows<N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*v_lm[llc][mmc][i_rows];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]);
|
||||
}
|
||||
|
||||
for (int i_rows=N1*N2; i_rows<2*N1*N2; i_rows++) {
|
||||
res_code=sqrt(1/(double)(4*CSI_RS_antenna_ports))*(phase_sign)*theta_n[nn]*v_lm[llc][mmc][i_rows-N1*N2];
|
||||
if (creal(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[0] = (short) ((creal(res_code)*32768)-0.5);//convert to Q15
|
||||
if (cimag(res_code)>0)
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)+0.5);//convert to Q15
|
||||
else
|
||||
((short*) &mat[3][pmiq][i_rows*4+j_col])[1] = (short) ((cimag(res_code)*32768)-0.5);//convert to Q15
|
||||
LOG_D(PHY, "4 Layer Precoding Matrix[3][pmi %d][antPort %d][layerIdx %d]= %f+j %f -> Fixed Point %d+j %d \n",
|
||||
pmiq,i_rows,j_col, creal(res_code), cimag(res_code),((short*) &mat[3][pmiq][i_rows*4+j_col])[0],((short*) &mat[3][pmiq][i_rows*4+j_col])[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
unsigned char is_secondary_gNB,
|
||||
@@ -108,6 +509,9 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
init_scrambling_luts();
|
||||
init_pucch2_luts();
|
||||
load_nrLDPClib(NULL);
|
||||
|
||||
init_codebook_gNB(gNB);
|
||||
|
||||
// PBCH DMRS gold sequences generation
|
||||
nr_init_pbch_dmrs(gNB);
|
||||
//PDCCH DMRS init
|
||||
@@ -322,6 +726,16 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
const int max_ul_mimo_layers = 4; // taken from phy_init_nr_gNB()
|
||||
const int n_buf = Prx * max_ul_mimo_layers;
|
||||
|
||||
int max_dl_mimo_layers =(fp->nb_antennas_tx<NR_MAX_NB_LAYERS) ? fp->nb_antennas_tx : NR_MAX_NB_LAYERS;
|
||||
if (fp->nb_antennas_tx>1) {
|
||||
for (int nl = 0; nl < max_dl_mimo_layers; nl++) {
|
||||
for(int size = 0; size < gNB->pmiq_size[nl]; size++)
|
||||
free_and_zero(gNB->nr_mimo_precoding_matrix[nl][size]);
|
||||
free_and_zero(gNB->nr_mimo_precoding_matrix[nl]);
|
||||
}
|
||||
free_and_zero(gNB->nr_mimo_precoding_matrix);
|
||||
}
|
||||
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
||||
for (int symb = 0; symb < fp->symbols_per_slot; symb++)
|
||||
|
||||
+14
-102
@@ -55,13 +55,11 @@ extern uint16_t beta_cqi[16];
|
||||
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
|
||||
* \note This function is optimistic in that it expects malloc() to succeed.
|
||||
*/
|
||||
void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
const NR_DL_FRAME_PARMS *const fp) {
|
||||
|
||||
AssertFatal( pdsch, "pdsch==0" );
|
||||
pdsch->pmi_ext = (uint8_t *)malloc16_clear( fp->N_RB_DL );
|
||||
pdsch->llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) );
|
||||
pdsch->layer_llr[0] = (int16_t *)malloc16_clear( (8*(3*8*6144))*sizeof(int16_t) );
|
||||
|
||||
pdsch->llr128 = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
||||
// FIXME! no further allocation for (int16_t*)pdsch->llr128 !!! expect SIGSEGV
|
||||
// FK, 11-3-2015: this is only as a temporary pointer, no memory is stored there
|
||||
@@ -73,8 +71,6 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
pdsch->dl_ch_estimates_ext = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_bf_ch_estimates = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_bf_ch_estimates_ext = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
//pdsch->dl_ch_rho_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
//pdsch->dl_ch_rho2_ext = (int32_t**)malloc16_clear( 8*sizeof(int32_t*) );
|
||||
pdsch->dl_ch_mag0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_ch_magb0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pdsch->dl_ch_magr0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
@@ -103,8 +99,6 @@ void phy_init_nr_ue__PDSCH(NR_UE_PDSCH *const pdsch,
|
||||
pdsch->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_bf_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * fp->ofdm_symbol_size*7*2);
|
||||
pdsch->dl_bf_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
//pdsch->dl_ch_rho_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
//pdsch->dl_ch_rho2_ext[idx] = (int32_t*)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_mag0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_magb0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
pdsch->dl_ch_magr0[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
@@ -136,8 +130,11 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp
|
||||
free_and_zero(pdsch->rho[i]);
|
||||
}
|
||||
free_and_zero(pdsch->pmi_ext);
|
||||
free_and_zero(pdsch->llr[0]);
|
||||
free_and_zero(pdsch->layer_llr[0]);
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int i=0; i<nb_codewords; i++)
|
||||
free_and_zero(pdsch->llr[i]);
|
||||
for (int i=0; i<NR_MAX_NB_LAYERS; i++)
|
||||
free_and_zero(pdsch->layer_llr[i]);
|
||||
free_and_zero(pdsch->llr128);
|
||||
free_and_zero(pdsch->rxdataF_ext);
|
||||
free_and_zero(pdsch->rxdataF_uespec_pilots);
|
||||
@@ -162,13 +159,10 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
NR_UE_COMMON *const common_vars = &ue->common_vars;
|
||||
NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
|
||||
NR_UE_PRACH **const prach_vars = ue->prach_vars;
|
||||
int i,j,k,l,slot,symb;
|
||||
int i,j,slot,symb, gNB_id, th_id;
|
||||
|
||||
NR_UE_SRS **const srs_vars = ue->srs_vars;
|
||||
|
||||
int gNB_id;
|
||||
int th_id;
|
||||
|
||||
LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx);
|
||||
|
||||
phy_init_nr_top(ue);
|
||||
@@ -350,54 +344,18 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
ue->nr_srs_info->srs_estimated_channel_time_shifted[i] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
phy_init_nr_ue__PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
||||
}
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr_shifts = (uint8_t *)malloc16_clear(7*2*fp->N_RB_DL*12);
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr_shifts_p = ue->pdsch_vars[0][gNB_id]->llr_shifts;
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream = (int16_t **)malloc16_clear( sizeof(int16_t *) );
|
||||
phy_init_nr_ue_PDSCH( ue->pdsch_vars[th_id][gNB_id], fp );
|
||||
}
|
||||
|
||||
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
}
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (j=0; j<4; j++) {
|
||||
const int idx = (j*fp->nb_antennas_rx)+i;
|
||||
const size_t num = 7*2*fp->N_RB_DL*12+4;
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t) * num );
|
||||
}
|
||||
for (i=0; i<nb_codewords; i++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
|
||||
}
|
||||
|
||||
//const size_t num = 7*2*fp->N_RB_DL*12+4;
|
||||
for (k=0; k<8; k++) { //harq_pid
|
||||
for (l=0; l<8; l++) { //round
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l] = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
}
|
||||
|
||||
for (int i=0; i<fp->nb_antennas_rx; i++)
|
||||
for (int j=0; j<4; j++) { //frame_parms->nb_antennas_tx; j++)
|
||||
const int idx = (j*fp->nb_antennas_rx)+i;
|
||||
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx] = (int32_t *)malloc16_clear(7*2*sizeof(int32_t)*(fp->N_RB_DL*12));
|
||||
}
|
||||
}
|
||||
for (i=0; i<NR_MAX_NB_LAYERS; i++) {
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[i] = (int16_t *)malloc16_clear( (8*(3*8*8448))*sizeof(int16_t) );//Q_m = 8 bits/Sym, Code_Rate=3, Number of Segments =8, Circular Buffer K_cb = 8448
|
||||
}
|
||||
}
|
||||
|
||||
@@ -408,7 +366,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
ue->pdcch_vars[th_id][gNB_id]->wbar = (int16_t *)malloc16_clear( 2*4*100*12*sizeof(uint16_t) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->e_rx = (int16_t *)malloc16_clear( 4*2*100*12 );
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->rho = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
@@ -426,7 +383,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
// size_t num = 7*2*fp->N_RB_DL*12;
|
||||
size_t num = 4*273*12; // 4 symbols, 100 PRBs, 12 REs per PRB
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear(sizeof(int32_t) * num);
|
||||
}
|
||||
@@ -439,13 +395,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
}
|
||||
|
||||
// initialization for the last instance of pdsch_vars (used for MU-MIMO)
|
||||
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
|
||||
ue->pdsch_vars[th_id][gNB_id] = malloc16_clear(sizeof(NR_UE_PDSCH));
|
||||
ue->pdsch_vars[th_id][gNB_id]->llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
||||
ue->pdsch_vars[th_id][gNB_id]->layer_llr[1] = malloc16_clear((8*(3*8*8448))*sizeof(int16_t));
|
||||
}
|
||||
|
||||
ue->sinr_CQI_dB = (double *) malloc16_clear( fp->N_RB_DL*12*sizeof(double) );
|
||||
ue->init_averaging = 1;
|
||||
|
||||
@@ -526,37 +475,9 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
// PDSCH
|
||||
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
for (int k = 0; k < 8; k++) { //harq_pid
|
||||
for (int l = 0; l < 8; l++) { //round
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
for (int j = 0; j < 4; j++) { //frame_parms->nb_antennas_tx; j++)
|
||||
const int idx = j * fp->nb_antennas_rx + i;
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l][idx]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l][idx]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l][idx]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l][idx]);
|
||||
}
|
||||
}
|
||||
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->rxdataF_comp1[k][l]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho_ext[k][l]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_mag1[k][l]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_magb1[k][l]);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
for (int j = 0; j < 4; j++) {
|
||||
const int idx = (j*fp->nb_antennas_rx)+i;
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext[idx]);
|
||||
}
|
||||
}
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr_shifts);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr128_2ndstream);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->dl_ch_rho2_ext);
|
||||
|
||||
phy_term_nr_ue__PDSCH(ue->pdsch_vars[th_id][gNB_id], fp);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
|
||||
}
|
||||
@@ -568,7 +489,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_time[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext[idx]);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext[idx]);
|
||||
}
|
||||
@@ -579,7 +499,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->wbar);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->e_rx);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_comp);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_rho_ext);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rho);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->rxdataF_ext);
|
||||
free_and_zero(ue->pdcch_vars[th_id][gNB_id]->dl_ch_estimates_ext);
|
||||
@@ -615,13 +534,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->prach_vars[gNB_id]);
|
||||
}
|
||||
|
||||
const int gNB_id = ue->n_connected_gNB;
|
||||
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]->layer_llr[1]);
|
||||
free_and_zero(ue->pdsch_vars[th_id][gNB_id]);
|
||||
}
|
||||
|
||||
free_and_zero(ue->sinr_CQI_dB);
|
||||
}
|
||||
|
||||
|
||||
@@ -402,6 +402,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue);
|
||||
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
|
||||
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
|
||||
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag);
|
||||
int init_codebook_gNB(PHY_VARS_gNB *gNB);
|
||||
void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
||||
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst);
|
||||
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
|
||||
|
||||
@@ -72,10 +72,6 @@ int generate_pss(int32_t **txdataF,
|
||||
a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
//printf("[PSS] amp=%d, a=%d\n",amp,a);
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM)
|
||||
/* a hack to remove at some point (the UE doesn't synch with 100 RBs) */
|
||||
a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
|
||||
|
||||
Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
|
||||
@@ -557,11 +557,6 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) {
|
||||
ue->measurements.rx_power_avg_dB[0] = dB_fixed(ue->measurements.rx_power_avg[0]);
|
||||
LOG_I(PHY,"[UE%d] Initial sync : Estimated power: %d dB\n",ue->Mod_id,ue->measurements.rx_power_avg_dB[0] );
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM )
|
||||
phy_adjust_gain(ue,ue->measurements.rx_power_avg_dB[0],0);
|
||||
} else {
|
||||
if (IS_SOFTMODEM_BASICSIM )
|
||||
phy_adjust_gain(ue,dB_fixed(ue->measurements.rssi),0);
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
||||
@@ -81,29 +81,20 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
int i, prach_len;
|
||||
uint16_t first_nonzero_root_idx=0;
|
||||
|
||||
if ( !(IS_SOFTMODEM_BASICSIM ) ) {
|
||||
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
|
||||
prach_start = (ue->rx_offset+subframe*ue->frame_parms.samples_per_tti-ue->hw_timing_advance-ue->N_TA_offset);
|
||||
#ifdef PRACH_DEBUG
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->N_TA_offset);
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->N_TA_offset);
|
||||
#endif
|
||||
|
||||
if (prach_start<0)
|
||||
prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
if (prach_start<0)
|
||||
prach_start+=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
} else { //normal case (simulation)
|
||||
prach_start = subframe*ue->frame_parms.samples_per_tti-ue->N_TA_offset;
|
||||
LOG_I(PHY,"[UE %d] prach_start %d, rx_offset %d, hw_timing_advance %d, N_TA_offset %d\n", ue->Mod_id,
|
||||
prach_start,
|
||||
ue->rx_offset,
|
||||
ue->hw_timing_advance,
|
||||
ue->N_TA_offset);
|
||||
}
|
||||
if (prach_start>=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
prach_start-=(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME);
|
||||
|
||||
// First compute physical root sequence
|
||||
if (restricted_set == 0) {
|
||||
@@ -476,40 +467,32 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
|
||||
AssertFatal(prach_fmt<4,
|
||||
"prach_fmt4 not fully implemented" );
|
||||
|
||||
if (!(IS_SOFTMODEM_BASICSIM ) ) {
|
||||
int j;
|
||||
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
|
||||
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
|
||||
int j;
|
||||
int overflow = prach_start + prach_len - LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*ue->frame_parms.samples_per_tti;
|
||||
LOG_I( PHY, "prach_start=%d, overflow=%d\n", prach_start, overflow );
|
||||
|
||||
for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
for (i=prach_start,j=0; i<min(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,prach_start+prach_len); i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
|
||||
for (i=0; i<overflow; i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
for (i=0; i<overflow; i++,j++) {
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i] = prach[2*j];
|
||||
((int16_t *)ue->common_vars.txdata[0])[2*i+1] = prach[2*j+1];
|
||||
}
|
||||
|
||||
#if defined(EXMIMO)
|
||||
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
|
||||
#endif
|
||||
} else { // simulators
|
||||
for (i=0; i<prach_len; i++) {
|
||||
((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i] = prach[2*i];
|
||||
((int16_t *)(&ue->common_vars.txdata[0][prach_start]))[2*i+1] = prach[2*i+1];
|
||||
}
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=prach_start - (ue->frame_parms.samples_per_tti>>1) ; k<prach_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[0][k+ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[0][k-ue->frame_parms.samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[0][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(PRACH_WRITE_OUTPUT_DEBUG)
|
||||
LOG_M("prach_txF0.m","prachtxF0",prachF,prach_len-Ncp,1,1);
|
||||
|
||||
@@ -719,3 +719,18 @@ int nr_layer_precoder(int16_t **datatx_F_precoding, char *prec_matrix, uint8_t n
|
||||
/* ((int16_t *)precodatatx_F)[0] = (int16_t)((((int16_t *)precodatatx_F)[0]*ONE_OVER_SQRT2_Q15)>>15);
|
||||
((int16_t *)precodatatx_F)[1] = (int16_t)((((int16_t *)precodatatx_F)[1]*ONE_OVER_SQRT2_Q15)>>15);*/
|
||||
}
|
||||
|
||||
int nr_layer_precoder_cm(int16_t **datatx_F_precoding, int *prec_matrix, uint8_t n_layers, int32_t re_offset)
|
||||
{
|
||||
int32_t precodatatx_F = 0;
|
||||
for (int al = 0; al<n_layers; al++) {
|
||||
int16_t antenna_re = datatx_F_precoding[al][re_offset<<1];
|
||||
int16_t antenna_im = datatx_F_precoding[al][(re_offset<<1) +1];
|
||||
//printf("antenna precoding: %d %d\n",((int16_t *)&prec_matrix[al])[0],((int16_t *)&prec_matrix[al])[1]);
|
||||
((int16_t *) &precodatatx_F)[0] += (int16_t)(((int32_t)(antenna_re*(((int16_t *)&prec_matrix[al])[0])) - (int32_t)(antenna_im* (((int16_t *)&prec_matrix[al])[1])))>>15);
|
||||
((int16_t *) &precodatatx_F)[1] += (int16_t)(((int32_t)(antenna_re*(((int16_t *)&prec_matrix[al])[1])) + (int32_t)(antenna_im* (((int16_t *)&prec_matrix[al])[0])))>>15);
|
||||
}
|
||||
|
||||
return precodatatx_F;
|
||||
}
|
||||
|
||||
|
||||
@@ -135,4 +135,9 @@ int nr_layer_precoder(int16_t **datatx_F_precoding,
|
||||
char *prec_matrix,
|
||||
uint8_t n_layers,
|
||||
int32_t re_offset);
|
||||
|
||||
int nr_layer_precoder_cm(int16_t **datatx_F_precoding,
|
||||
int *prec_matrix,
|
||||
uint8_t n_layers,
|
||||
int32_t re_offset);
|
||||
#endif
|
||||
|
||||
@@ -444,8 +444,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
// The same precoding matrix is applied on prg_size RBs, Thus
|
||||
// pmi = prgs_list[rbidx/prg_size].pm_idx, rbidx =0,...,rbSize-1
|
||||
// The Precoding matrix:
|
||||
// The Codebook Type I and Type II are not supported yet.
|
||||
// We`adopt the precoding matrices of PUSCH for 4 layers.
|
||||
// The Codebook Type I
|
||||
start_meas(&gNB->dlsch_precoding_stats);
|
||||
|
||||
for (int ap=0; ap<frame_parms->nb_antennas_tx; ap++) {
|
||||
@@ -462,61 +461,72 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
pmi = 0;//no precoding
|
||||
|
||||
if (pmi == 0) {//unitary Precoding
|
||||
if(ap<rel15->nrOfLayers)
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
else
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
0,
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
if (k + NR_NB_SC_PER_RB <= frame_parms->ofdm_symbol_size) { // RB does not cross DC
|
||||
if(ap<rel15->nrOfLayers)
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
else
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
0,
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
} else { // RB does cross DC
|
||||
int neg_length = frame_parms->ofdm_symbol_size - k;
|
||||
int pos_length = NR_NB_SC_PER_RB - neg_length;
|
||||
if (ap<rel15->nrOfLayers) {
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
neg_length*sizeof(int32_t));
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size)],
|
||||
pos_length*sizeof(int32_t));
|
||||
} else {
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
0,
|
||||
neg_length*sizeof(int32_t));
|
||||
memset((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset],
|
||||
0,
|
||||
pos_length*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
k += NR_NB_SC_PER_RB;
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//get the precoding matrix weights:
|
||||
char *W_prec;
|
||||
switch (frame_parms->nb_antennas_tx) {
|
||||
case 1://1 antenna port
|
||||
W_prec = nr_W_1l_2p[pmi][ap];
|
||||
break;
|
||||
case 2://2 antenna ports
|
||||
if (rel15->nrOfLayers == 1)//1 layer
|
||||
W_prec = nr_W_1l_2p[pmi][ap];
|
||||
else//2 layers
|
||||
W_prec = nr_W_2l_2p[pmi][ap];
|
||||
break;
|
||||
case 4://4 antenna ports
|
||||
if (rel15->nrOfLayers == 1)//1 layer
|
||||
W_prec = nr_W_1l_4p[pmi][ap];
|
||||
else if (rel15->nrOfLayers == 2)//2 layers
|
||||
W_prec = nr_W_2l_4p[pmi][ap];
|
||||
else if (rel15->nrOfLayers == 3)//3 layers
|
||||
W_prec = nr_W_3l_4p[pmi][ap];
|
||||
else//4 layers
|
||||
W_prec = nr_W_4l_4p[pmi][ap];
|
||||
break;
|
||||
default:
|
||||
LOG_D(PHY,"Precoding 1,2, or 4 antenna ports are currently supported\n");
|
||||
W_prec = nr_W_1l_2p[pmi][ap];
|
||||
break;
|
||||
}
|
||||
for (int i=0; i<NR_NB_SC_PER_RB; i++) {
|
||||
int32_t re_offset = l*frame_parms->ofdm_symbol_size + k;
|
||||
int32_t precodatatx_F = nr_layer_precoder(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset);
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0];
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1];
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("antenna %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
ap, l, k, ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)],
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)]);
|
||||
#endif
|
||||
if (++k >= frame_parms->ofdm_symbol_size) {
|
||||
if(frame_parms->nb_antennas_tx==1){//no precoding matrix defined
|
||||
memcpy((void*)&txdataF[ap][l*frame_parms->ofdm_symbol_size + txdataF_offset + k],
|
||||
(void*)&txdataF_precoding[ap][2*(l*frame_parms->ofdm_symbol_size + k)],
|
||||
NR_NB_SC_PER_RB*sizeof(int32_t));
|
||||
k += NR_NB_SC_PER_RB;
|
||||
if (k >= frame_parms->ofdm_symbol_size) {
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
else {
|
||||
//get the precoding matrix weights:
|
||||
int32_t **mat = gNB->nr_mimo_precoding_matrix[rel15->nrOfLayers-1];
|
||||
//i_row =0,...,dl_antenna_port
|
||||
//j_col =0,...,nrOfLayers
|
||||
//mat[pmi][i_rows*2+j_col]
|
||||
int *W_prec;
|
||||
W_prec = (int32_t *)&mat[pmi][ap*rel15->nrOfLayers];
|
||||
for (int i=0; i<NR_NB_SC_PER_RB; i++) {
|
||||
int32_t re_offset = l*frame_parms->ofdm_symbol_size + k;
|
||||
int32_t precodatatx_F = nr_layer_precoder_cm(txdataF_precoding, W_prec, rel15->nrOfLayers, re_offset);
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[0];
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)] = ((int16_t *) &precodatatx_F)[1];
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("antenna %d\t l %d \t k %d \t txdataF: %d %d\n",
|
||||
ap, l, k, ((int16_t*)txdataF[ap])[(re_offset<<1) + (2*txdataF_offset)],
|
||||
((int16_t*)txdataF[ap])[(re_offset<<1) + 1 + (2*txdataF_offset)]);
|
||||
#endif
|
||||
if (++k >= frame_parms->ofdm_symbol_size) {
|
||||
k -= frame_parms->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} //RB loop
|
||||
} // symbol loop
|
||||
|
||||
@@ -356,7 +356,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
if (is_dmrs_symbol == 0) {
|
||||
//
|
||||
//rxF[ ((start_re + re)*2) % (frame_parms->ofdm_symbol_size*2)]);
|
||||
if (start_re + nb_re_pusch < frame_parms->ofdm_symbol_size) {
|
||||
if (start_re + nb_re_pusch <= frame_parms->ofdm_symbol_size) {
|
||||
memcpy1((void*)rxF_ext,
|
||||
(void*)&rxF[start_re*2],
|
||||
nb_re_pusch*sizeof(int32_t));
|
||||
|
||||
@@ -533,8 +533,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
16);
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
//for (int i= 0; i<8; i++)
|
||||
//printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i));
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -547,6 +551,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
16);
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -559,23 +569,22 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
|
||||
#ifdef DEBUG_PDCCH
|
||||
#ifdef DEBUG_PDCCH
|
||||
for (int m =0; m<12; m++)
|
||||
printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]);
|
||||
#endif
|
||||
#endif
|
||||
dl_ch += 24;
|
||||
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
dl_ch += 24;
|
||||
k += 12;
|
||||
|
||||
|
||||
k += 4;
|
||||
|
||||
for (pilot_cnt=3; pilot_cnt<(3*nb_rb_coreset); pilot_cnt += 3) {
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size){
|
||||
k-=ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];}
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -592,6 +601,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -604,6 +619,12 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
16);
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
k += 4;
|
||||
|
||||
if (k >= ue->frame_parms.ofdm_symbol_size) {
|
||||
k -= ue->frame_parms.ofdm_symbol_size;
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+1)];
|
||||
}
|
||||
|
||||
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);
|
||||
@@ -616,11 +637,15 @@ int nr_pdcch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
#ifdef DEBUG_PDCCH
|
||||
for (int m =0; m<12; m++)
|
||||
printf("data : dl_ch -> (%d,%d)\n",dl_ch[0+2*m],dl_ch[1+2*m]);
|
||||
#endif
|
||||
dl_ch += 24;
|
||||
|
||||
pil += 2;
|
||||
rxF += 8;
|
||||
dl_ch += 24;
|
||||
k += 12;
|
||||
|
||||
k += 4;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -61,12 +61,8 @@ char nr_dci_format_string[8][30] = {
|
||||
//#define NR_LTE_PDCCH_DCI_SWITCH
|
||||
//#define NR_PDCCH_DCI_DEBUG // activates NR_PDCCH_DCI_DEBUG logs
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
#define LOG_DNL(a, ...) printf("\n\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#define LOG_DD(a, ...) printf("\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#define LOG_DDD(a, ...) printf("\t\t<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#define LOG_DDD(a, ...) printf("<-NR_PDCCH_DCI_DEBUG (%s)-> " a, __func__, ##__VA_ARGS__ )
|
||||
#else
|
||||
#define LOG_DNL(a...)
|
||||
#define LOG_DD(a...)
|
||||
#define LOG_DDD(a...)
|
||||
#endif
|
||||
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
|
||||
@@ -371,11 +367,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
uint8_t i, j, aarx;
|
||||
int32_t *dl_ch0, *dl_ch0_ext, *rxF, *rxF_ext;
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
uint8_t symbol_mod = (symbol >= (7 - frame_parms->Ncp)) ? symbol - (7 - frame_parms->Ncp) : symbol;
|
||||
LOG_I(PHY, "extract_rbs_single: symbol_mod %d\n",symbol_mod);
|
||||
#endif
|
||||
|
||||
for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
|
||||
dl_ch0 = &dl_ch_estimates[aarx][frame_parms->ofdm_symbol_size*symbol];
|
||||
LOG_DDD("dl_ch0 = &dl_ch_estimates[aarx = (%d)][0]\n",aarx);
|
||||
@@ -397,9 +388,9 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
* 1.2 The RB is >= than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0)
|
||||
* 2. Number of RBs in the system bandwidth is odd
|
||||
* (particular case when the RB with DC as it is treated differently: it is situated in symbol borders of rxdataF)
|
||||
* 2.1 The RB is <= than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset)
|
||||
* 2.2 The RB is > than the N_RB_DL/2+1 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC)
|
||||
* 2.3 The RB is == N_RB_DL/2+1 -> IQ symbols are in the lower border of the rxdataF for first 6 IQ element and the upper border of the rxdataF for the last 6 IQ elements
|
||||
* 2.1 The RB is < than the N_RB_DL/2 -> IQ symbols are in the second half of the rxdataF (from first_carrier_offset)
|
||||
* 2.2 The RB is > than the N_RB_DL/2 -> IQ symbols are in the first half of the rxdataF (from element 0 + 2nd half RB containing DC)
|
||||
* 2.3 The RB is == N_RB_DL/2 -> IQ symbols are in the upper border of the rxdataF for first 6 IQ element and the lower border of the rxdataF for the last 6 IQ elements
|
||||
* If the first RB containing PDCCH within the UE BWP and within the CORESET is higher than half of the system bandwidth (N_RB_DL),
|
||||
* then the IQ symbol is going to be found at the position 0+c_rb-N_RB_DL/2 in rxdataF and
|
||||
* we have to point the pointer at (1+c_rb-N_RB_DL/2) in rxdataF
|
||||
@@ -429,64 +420,65 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
if (((c_rb + n_BWP_start) >= (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) == 0)) {
|
||||
// number of RBs is even and c_rb is higher than half system bandwidth (we don't skip DC)
|
||||
// if these conditions are true the pointer has to be situated at the 1st part of the rxdataF
|
||||
rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
//rxF = &rxdataF[aarx][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol
|
||||
//#ifdef NR_PDCCH_DCI_DEBUG
|
||||
// LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
// c_rb,aarx,(1 + 12*(c_rb - (frame_parms->N_RB_DL>>1)) + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
//#endif
|
||||
rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in even case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) + symbol * frame_parms->ofdm_symbol_size));
|
||||
}
|
||||
|
||||
if (((c_rb + n_BWP_start) < (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) {
|
||||
//if RB to be treated is lower than middle system bandwidth then rxdataF pointed at (offset + c_br + symbol * ofdm_symbol_size): odd case
|
||||
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size];
|
||||
LOG_DDD("in odd case c_rb (%d) is lower or equal than half N_RB_DL -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size));
|
||||
}
|
||||
|
||||
if (((c_rb + n_BWP_start) > (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) {
|
||||
// number of RBs is odd and c_rb is higher than half system bandwidth + 1
|
||||
// if these conditions are true the pointer has to be situated at the 1st part of the rxdataF just after the first IQ symbols of the RB containing DC
|
||||
rxF = &rxdataF[aarx][(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12]; // we point at the 1st part of the rxdataF in symbol
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][(12*(c_rb - frame_parms->N_RB_DL) - 5 + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb - (frame_parms->N_RB_DL>>1)) - 6 + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in odd case c_rb (%d) is higher than half N_RB_DL (not DC) -> rxF = &rxdataF[aarx = (%d)][12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(12*(c_rb + n_BWP_start - (frame_parms->N_RB_DL>>1)) - 6 + symbol * frame_parms->ofdm_symbol_size));
|
||||
}
|
||||
|
||||
if (((c_rb + n_BWP_start) == (frame_parms->N_RB_DL >> 1)) && ((frame_parms->N_RB_DL & 1) != 0)) { // treatment of RB containing the DC
|
||||
// if odd number RBs in system bandwidth and first RB to be treated is higher than middle system bandwidth (around DC)
|
||||
// we have to treat the RB in two parts: first part from i=0 to 5, the data is at the end of rxdataF (pointing at the end of the table)
|
||||
rxF = &rxdataF[aarx][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size)))+n_BWP_start*12];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))) = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * c_rb + (symbol * (frame_parms->ofdm_symbol_size))));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size];
|
||||
LOG_DDD("in odd case c_rb (%d) is half N_RB_DL + 1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(frame_parms->first_carrier_offset + 12 * (c_rb + n_BWP_start) + symbol * frame_parms->ofdm_symbol_size));
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < 6; i++) { //treating first part of the RB note that i=5 would correspond to DC. We treat it in NR
|
||||
if ((i != 1) && (i != 5)) {
|
||||
dl_ch0_ext[j] = dl_ch0[i];
|
||||
rxF_ext[j++] = rxF[i];
|
||||
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
rxF_ext[j] = rxF[i];
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
j++;
|
||||
} else {
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
}
|
||||
}
|
||||
|
||||
// then we point at the begining of the symbol part of rxdataF do process second part of RB
|
||||
rxF = &rxdataF[aarx][((symbol * (frame_parms->ofdm_symbol_size)))]; // we point at the 1st part of the rxdataF in symbol
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][(symbol * (frame_parms->ofdm_symbol_size)) = (%d)]\n",
|
||||
c_rb,aarx,(symbol * (frame_parms->ofdm_symbol_size)));
|
||||
#endif
|
||||
rxF = &rxdataF[aarx][symbol * frame_parms->ofdm_symbol_size]; // we point at the 1st part of the rxdataF in symbol
|
||||
LOG_DDD("in odd case c_rb (%d) is half N_RB_DL +1 we treat DC case -> rxF = &rxdataF[aarx = (%d)][symbol * frame_parms->ofdm_symbol_size = (%d)]\n",
|
||||
c_rb,aarx,(symbol * frame_parms->ofdm_symbol_size));
|
||||
for (; i < 12; i++) {
|
||||
if ((i != 9)) {
|
||||
dl_ch0_ext[j] = dl_ch0[i];
|
||||
rxF_ext[j++] = rxF[(1 + i - 6)];
|
||||
// printf("**extract rb %d, re %d => (%d,%d)\n",rb,i,*(short *)&rxF_ext[j-1],*(1+(short*)&rxF_ext[j-1]));
|
||||
rxF_ext[j] = rxF[i - 6];
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6]));
|
||||
j++;
|
||||
} else {
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i-6], *(1 + (short *) &rxF[i-6]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -494,32 +486,21 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
dl_ch0 += 12;
|
||||
//rxF += 7;
|
||||
//c_rb++;
|
||||
//n_BWP_start++; // We have to increment this variable here to be consequent in the for loop afterwards
|
||||
//}
|
||||
} else { // treatment of any RB that does not contain the DC
|
||||
j = 0;
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
if ((i != 1) && (i != 5) && (i != 9)) {
|
||||
rxF_ext[j] = rxF[i];
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d)\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j],*(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
#endif
|
||||
dl_ch0_ext[j] = dl_ch0[i];
|
||||
|
||||
//LOG_DDD("ch %d => dl_ch0(%d,%d)\n", i, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i]));
|
||||
//printf("\t-> dl_ch0[%d] => dl_ch0_ext[%d](%d,%d)\n", i,j, *(short *) &dl_ch0[i], *(1 + (short*) &dl_ch0[i]));
|
||||
j++;
|
||||
} else {
|
||||
#ifdef NR_PDCCH_DCI_DEBUG
|
||||
LOG_D(PHY,"RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
LOG_DDD("RB[c_rb %d] \t RE[re %d] => rxF_ext[%d]=(%d,%d)\t rxF[%d]=(%d,%d) \t\t <==> DM-RS PDCCH, this is a pilot symbol\n",
|
||||
c_rb, i, j, *(short *) &rxF_ext[j], *(1 + (short *) &rxF_ext[j]), i,
|
||||
*(short *) &rxF[i], *(1 + (short *) &rxF[i]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -527,8 +508,6 @@ void nr_pdcch_extract_rbs_single(int32_t **rxdataF,
|
||||
dl_ch0_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
rxF_ext += NBR_RE_PER_RB_WITHOUT_DMRS;
|
||||
dl_ch0 += 12;
|
||||
//rxF += 12;
|
||||
//}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -783,7 +762,7 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
|
||||
rel15->CCE,
|
||||
rel15->L);
|
||||
|
||||
LOG_D(PHY,"we end nr_pdcch_unscrambling()\n");
|
||||
LOG_D(PHY,"we end nr_pdcch_demapping_deinterleaving()\n");
|
||||
LOG_D(PHY,"Ending nr_rx_pdcch() function\n");
|
||||
|
||||
return (0);
|
||||
@@ -883,8 +862,8 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
int dci_length = rel15->dci_length_options[k];
|
||||
uint64_t dci_estimation[2]= {0};
|
||||
|
||||
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, e_rx_cand_idx, L, dci_length,nr_dci_format_string[rel15->dci_format_options[k]]);
|
||||
LOG_D(PHY, "(%i.%i) Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d, length %d, format %s\n",
|
||||
proc->frame_rx, proc->nr_slot_rx, j, rel15->number_of_candidates, CCEind, e_rx_cand_idx, L, dci_length, nr_dci_format_string[rel15->dci_format_options[k]]);
|
||||
|
||||
nr_pdcch_unscrambling(&pdcch_vars->e_rx[e_rx_cand_idx], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
|
||||
|
||||
@@ -892,7 +871,7 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
uint32_t *z = (uint32_t *) &pdcch_vars->e_rx[e_rx_cand_idx];
|
||||
for (int index_z = 0; index_z < L*6; index_z++){
|
||||
for (int i=0; i<9; i++) {
|
||||
LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]));
|
||||
LOG_I(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[9*index_z + i],*(1 + (int16_t *) &z[9*index_z + i]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -402,7 +402,7 @@ void nr_processDLSegment(void* arg) {
|
||||
|
||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||
if (check_crc((uint8_t *)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
LOG_D(PHY,"Segment %u CRC OK\n\033[0m",r);
|
||||
LOG_D(PHY,"Segment %u CRC OK\n",r);
|
||||
|
||||
if (r==0) {
|
||||
for (int i=0; i<10; i++) LOG_D(PHY,"byte %d : %x\n",i,((uint8_t *)llrProcBuf)[i]);
|
||||
@@ -412,7 +412,7 @@ void nr_processDLSegment(void* arg) {
|
||||
no_iteration_ldpc = dlsch->max_ldpc_iterations;
|
||||
rdata->decodeIterations = no_iteration_ldpc;
|
||||
} else {
|
||||
LOG_D(PHY,"CRC NOT OK\n\033[0m");
|
||||
LOG_D(PHY,"CRC NOT OK\n");
|
||||
}
|
||||
|
||||
nb_total_decod++;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -733,7 +733,7 @@ unsigned short nr_dlsch_extract_rbs_single(int **rxdataF,
|
||||
@param n_dmrs_cdm_groups
|
||||
@param frame_parms Pointer to frame descriptor
|
||||
*/
|
||||
unsigned short nr_dlsch_extract_rbs_multiple(int **rxdataF,
|
||||
void nr_dlsch_extract_rbs(int **rxdataF,
|
||||
int **dl_ch_estimates,
|
||||
int **rxdataF_ext,
|
||||
int **dl_ch_estimates_ext,
|
||||
@@ -824,28 +824,12 @@ void nr_dlsch_channel_compensation_core(int **rxdataF_ext,
|
||||
int start_point);
|
||||
|
||||
void nr_dlsch_deinterleaving(uint8_t symbol,
|
||||
uint8_t start_symbol,
|
||||
uint16_t L,
|
||||
uint16_t *llr,
|
||||
uint16_t *llr_deint,
|
||||
uint16_t nb_rb_pdsch);
|
||||
uint8_t start_symbol,
|
||||
uint16_t L,
|
||||
uint16_t *llr,
|
||||
uint16_t *llr_deint,
|
||||
uint16_t nb_rb_pdsch);
|
||||
|
||||
void dlsch_dual_stream_correlation(NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_estimates_ext_i,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift);
|
||||
|
||||
void dlsch_dual_stream_correlationTM34(NR_DL_FRAME_PARMS *frame_parms,
|
||||
unsigned char symbol,
|
||||
unsigned short nb_rb,
|
||||
int **dl_ch_estimates_ext,
|
||||
int **dl_ch_estimates_ext_i,
|
||||
int **dl_ch_rho_ext,
|
||||
unsigned char output_shift0,
|
||||
unsigned char output_shift1);
|
||||
//This function is used to compute multiplications in Hhermitian * H matrix
|
||||
void conjch0_mult_ch1(int *ch0,
|
||||
int *ch1,
|
||||
@@ -897,19 +881,6 @@ void nr_dlsch_detection_mrc(int **rxdataF_comp,
|
||||
unsigned short nb_rb,
|
||||
int length);
|
||||
|
||||
void nr_dlsch_detection_mrc_core(int **rxdataF_comp,
|
||||
int **rxdataF_comp_i,
|
||||
int **rho,
|
||||
int **rho_i,
|
||||
int **dl_ch_mag,
|
||||
int **dl_ch_magb,
|
||||
int **dl_ch_mag_i,
|
||||
int **dl_ch_magb_i,
|
||||
unsigned char n_tx,
|
||||
unsigned char n_rx,
|
||||
int length,
|
||||
int start_point);
|
||||
|
||||
void det_HhH(int32_t *after_mf_00,
|
||||
int32_t *after_mf_01,
|
||||
int32_t *after_mf_10,
|
||||
|
||||
@@ -458,8 +458,6 @@ typedef struct RU_t_s {
|
||||
int emulate_rf;
|
||||
/// numerology index
|
||||
int numerology;
|
||||
/// flag to indicate basicsim operation
|
||||
int basicsim;
|
||||
/// flag to indicate the RU is in sync with a master reference
|
||||
int in_synch;
|
||||
/// timing offset
|
||||
|
||||
@@ -800,6 +800,13 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// PDSCH DMRS sequence
|
||||
uint32_t ****nr_gold_pdsch_dmrs;
|
||||
|
||||
/// PDSCH codebook I precoding LUTs
|
||||
/// first dimension: Rank number [0,...,noOfLayers-1[
|
||||
/// second dimension: PMI [0,...,CodeSize-1[
|
||||
/// third dimension: [i_rows*noOfLayers+j_col], i_rows=0,...pdsch_AntennaPorts-1 and j_col=0,...,noOfLayers-1
|
||||
int32_t ***nr_mimo_precoding_matrix;
|
||||
int pmiq_size[NR_MAX_NB_LAYERS];
|
||||
|
||||
/// PUSCH DMRS
|
||||
uint32_t ****nr_gold_pusch_dmrs;
|
||||
|
||||
@@ -850,6 +857,10 @@ typedef struct PHY_VARS_gNB_s {
|
||||
int pdsch_gold_init[2];
|
||||
int pusch_gold_init[2];
|
||||
|
||||
int ap_N1;
|
||||
int ap_N2;
|
||||
int ap_XP;
|
||||
|
||||
int pucch0_thres;
|
||||
int pusch_thres;
|
||||
int prach_thres;
|
||||
|
||||
@@ -183,7 +183,7 @@ typedef struct {
|
||||
//! estimated rssi (dBm)
|
||||
short rx_rssi_dBm[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][4][4];
|
||||
int rx_correlation[NUMBER_OF_CONNECTED_gNB_MAX][NB_ANTENNAS_RX][NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS];//
|
||||
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
|
||||
int rx_correlation_dB[NUMBER_OF_CONNECTED_gNB_MAX][2];
|
||||
|
||||
@@ -271,12 +271,6 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp0;
|
||||
/// \brief Received frequency-domain signal after extraction and channel compensation for the second stream. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **rxdataF_comp1[8][8];
|
||||
/// \brief Hold the channel estimates in frequency domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
@@ -289,12 +283,6 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_ptrs_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS. For the SIC receiver we need to store the history of this for each harq process and round
|
||||
/// - first index: ? [0..7] (hard coded) accessed via \c harq_pid
|
||||
/// - second index: ? [0..7] (hard coded) accessed via \c round
|
||||
/// - third index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - fourth index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext[8][8];
|
||||
/// \brief Downlink beamforming channel estimates in frequency domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: samples? [0..symbols_per_tti*(ofdm_symbol_size+LTE_CE_FILTER_LENGTH)[
|
||||
@@ -303,10 +291,6 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_bf_ch_estimates_ext;
|
||||
/// \brief Downlink cross-correlation of MIMO channel estimates (unquantized PMI) extracted in PRBS.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho2_ext;
|
||||
/// \brief Downlink PMIs extracted in PRBS and grouped in subbands.
|
||||
/// - first index: ressource block [0..N_RB_DL[
|
||||
uint8_t *pmi_ext;
|
||||
@@ -314,18 +298,10 @@ typedef struct {
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag0;
|
||||
/// \brief Magnitude of Downlink Channel second layer (16QAM level/First 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_mag1[8][8];
|
||||
/// \brief Magnitude of Downlink Channel, first layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb0;
|
||||
/// \brief Magnitude of Downlink Channel second layer (2nd 64QAM level).
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_magb1[8][8];
|
||||
/// \brief Magnitude of Downlink Channel, first layer (256QAM level).
|
||||
int32_t **dl_ch_magr0;
|
||||
/// \brief Cross-correlation Matrix of the gNB Tx channel signals.
|
||||
@@ -595,10 +571,6 @@ typedef struct {
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_estimates_ext;
|
||||
/// \brief Pointers to channel cross-correlation vectors for multi-gNB detection.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
/// - second index: ? [0..168*N_RB_DL[
|
||||
int32_t **dl_ch_rho_ext;
|
||||
/// \brief Pointers to channel cross-correlation vectors for multi-gNB detection.
|
||||
/// - first index: rx antenna [0..nb_antennas_rx[
|
||||
/// - second index: ? [0..]
|
||||
int32_t **rho;
|
||||
|
||||
@@ -324,7 +324,7 @@ struct NR_DL_FRAME_PARMS {
|
||||
uint32_t samples_per_frame_wCP;
|
||||
/// NR numerology index [0..5] as specified in 38.211 Section 4 (mu). 0=15khZ SCS, 1=30khZ, 2=60kHz, etc
|
||||
uint8_t numerology_index;
|
||||
/// Number of Physical transmit antennas in node
|
||||
/// Number of Physical transmit antennas in node (corresponds to nrOfAntennaPorts)
|
||||
uint8_t nb_antennas_tx;
|
||||
/// Number of Receive antennas in node
|
||||
uint8_t nb_antennas_rx;
|
||||
|
||||
@@ -1150,20 +1150,14 @@ void ulsch_common_procedures(PHY_VARS_UE *ue,
|
||||
|
||||
nsymb = (frame_parms->Ncp == 0) ? 14 : 12;
|
||||
|
||||
if (!IS_SOFTMODEM_BASICSIM) {
|
||||
ulsch_start = (ue->rx_offset+subframe_tx*frame_parms->samples_per_tti-
|
||||
ue->hw_timing_advance-
|
||||
ue->timing_advance-
|
||||
ue->N_TA_offset+5);
|
||||
ulsch_start = ue->rx_offset + subframe_tx * frame_parms->samples_per_tti
|
||||
- ue->hw_timing_advance - ue->timing_advance - ue->N_TA_offset + 5;
|
||||
|
||||
if(ulsch_start < 0)
|
||||
ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
|
||||
if(ulsch_start < 0)
|
||||
ulsch_start = ulsch_start + (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
|
||||
|
||||
if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti))
|
||||
ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
|
||||
} else { //this is the simulators case
|
||||
ulsch_start = (frame_parms->samples_per_tti*subframe_tx)-ue->N_TA_offset; //-ue->timing_advance;
|
||||
}
|
||||
if (ulsch_start > (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti))
|
||||
ulsch_start = ulsch_start % (LTE_NUMBER_OF_SUBFRAMES_PER_FRAME*frame_parms->samples_per_tti);
|
||||
|
||||
if (empty_subframe) {
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
@@ -1181,8 +1175,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue,
|
||||
}
|
||||
|
||||
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
|
||||
int *Buff = IS_SOFTMODEM_BASICSIM ? &ue->common_vars.txdata[aa][ulsch_start] :dummy_tx_buffer;
|
||||
|
||||
int *Buff = dummy_tx_buffer;
|
||||
if (frame_parms->Ncp == 1) {
|
||||
PHY_ofdm_mod(&ue->common_vars.txdataF[aa][subframe_tx*nsymb*frame_parms->ofdm_symbol_size],
|
||||
Buff,
|
||||
@@ -1202,41 +1195,33 @@ void ulsch_common_procedures(PHY_VARS_UE *ue,
|
||||
&ue->frame_parms);
|
||||
}
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM) {
|
||||
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],0);
|
||||
apply_7_5_kHz(ue,&ue->common_vars.txdata[aa][ulsch_start],1);
|
||||
} else {
|
||||
apply_7_5_kHz(ue,dummy_tx_buffer,0);
|
||||
apply_7_5_kHz(ue,dummy_tx_buffer,1);
|
||||
apply_7_5_kHz(ue,dummy_tx_buffer,0);
|
||||
apply_7_5_kHz(ue,dummy_tx_buffer,1);
|
||||
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
|
||||
for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) {
|
||||
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
|
||||
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
|
||||
}
|
||||
|
||||
if (!(IS_SOFTMODEM_BASICSIM) ) {
|
||||
overflow = ulsch_start - 9*frame_parms->samples_per_tti;
|
||||
|
||||
for (k=ulsch_start,l=0; k<cmin(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME,ulsch_start+frame_parms->samples_per_tti); k++,l++) {
|
||||
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
|
||||
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
|
||||
}
|
||||
|
||||
for (k=0; k<overflow; k++,l++) {
|
||||
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
|
||||
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
|
||||
}
|
||||
for (k=0; k<overflow; k++,l++) {
|
||||
((short *)ue->common_vars.txdata[aa])[2*k] = ((short *)dummy_tx_buffer)[2*l];
|
||||
((short *)ue->common_vars.txdata[aa])[2*k+1] = ((short *)dummy_tx_buffer)[2*l+1];
|
||||
}
|
||||
|
||||
#if defined(EXMIMO)
|
||||
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
|
||||
#endif
|
||||
// handle switch before 1st TX subframe, guarantee that the slot prior to transmission is switch on
|
||||
for (k=ulsch_start - (frame_parms->samples_per_tti>>1) ; k<ulsch_start ; k++) {
|
||||
if (k<0)
|
||||
ue->common_vars.txdata[aa][k+frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else if (k>(frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME))
|
||||
ue->common_vars.txdata[aa][k-frame_parms->samples_per_tti*LTE_NUMBER_OF_SUBFRAMES_PER_FRAME] &= 0xFFFEFFFE;
|
||||
else
|
||||
ue->common_vars.txdata[aa][k] &= 0xFFFEFFFE;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
only for debug
|
||||
@@ -1314,14 +1299,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,
|
||||
ue->prach_resources[eNB_id]->ra_RNTI);
|
||||
ue->tx_total_RE[subframe_tx] = 96;
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM) {
|
||||
ue->prach_vars[eNB_id]->amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
6);
|
||||
} else {
|
||||
ue->prach_vars[eNB_id]->amp = AMP;
|
||||
}
|
||||
ue->prach_vars[eNB_id]->amp = AMP;
|
||||
|
||||
if ((mode == calib_prach_tx) && (((proc->frame_tx&0xfffe)%100)==0))
|
||||
LOG_D(PHY,"[UE %d][RAPROC] Frame %d, Subframe %d : PRACH TX power %d dBm, amp %d\n",
|
||||
@@ -1688,14 +1666,10 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,
|
||||
|
||||
ue->tx_total_RE[subframe_tx] = nb_rb*12;
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM) {
|
||||
tx_amp = AMP;
|
||||
} else {
|
||||
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
nb_rb);
|
||||
}
|
||||
tx_amp = get_tx_amp(ue->tx_power_dBm[subframe_tx],
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
nb_rb);
|
||||
|
||||
T(T_UE_PHY_PUSCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||
T_INT(tx_amp),T_INT(ue->ulsch[eNB_id]->f_pusch),T_INT(get_PL(Mod_id,0,eNB_id)),T_INT(nb_rb));
|
||||
@@ -1765,17 +1739,13 @@ void ue_srs_procedures(PHY_VARS_UE *ue,
|
||||
Po_SRS = ue->tx_power_max_dBm;
|
||||
}
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM) {
|
||||
tx_amp = AMP;
|
||||
if (ue->mac_enabled==1) {
|
||||
tx_amp = get_tx_amp(Po_SRS,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
nb_rb_srs);
|
||||
} else {
|
||||
if (ue->mac_enabled==1) {
|
||||
tx_amp = get_tx_amp(Po_SRS,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
nb_rb_srs);
|
||||
} else {
|
||||
tx_amp = AMP;
|
||||
}
|
||||
tx_amp = AMP;
|
||||
}
|
||||
|
||||
LOG_D(PHY,"SRS PROC; TX_MAX_POWER %d, Po_SRS %d, NB_RB_UL %d, NB_RB_SRS %d TX_AMPL %d\n",ue->tx_power_max_dBm,
|
||||
@@ -2008,14 +1978,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,
|
||||
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
|
||||
ue->tx_total_RE[subframe_tx] = 12;
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM) {
|
||||
tx_amp = AMP;
|
||||
} else {
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
1);
|
||||
}
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
1);
|
||||
|
||||
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||
@@ -2089,14 +2055,10 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,
|
||||
ue->tx_power_dBm[subframe_tx] = Po_PUCCH;
|
||||
ue->tx_total_RE[subframe_tx] = 12;
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM) {
|
||||
tx_amp = AMP;
|
||||
} else {
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
1);
|
||||
}
|
||||
tx_amp = get_tx_amp(Po_PUCCH,
|
||||
ue->tx_power_max_dBm,
|
||||
ue->frame_parms.N_RB_UL,
|
||||
1);
|
||||
|
||||
T(T_UE_PHY_PUCCH_TX_POWER, T_INT(eNB_id), T_INT(frame_tx%1024), T_INT(subframe_tx),T_INT(ue->tx_power_dBm[subframe_tx]),
|
||||
T_INT(tx_amp),T_INT(ue->dlsch[ue->current_thread_id[proc->subframe_rx]][eNB_id][0]->g_pucch),T_INT(get_PL(ue->Mod_id,ue->CC_id,eNB_id)));
|
||||
@@ -2344,9 +2306,6 @@ void ue_measurement_procedures(uint16_t l, // symbol index of each slot [0..6
|
||||
// AGC
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_IN);
|
||||
|
||||
if (IS_SOFTMODEM_BASICSIM)
|
||||
phy_adjust_gain (ue,dB_fixed(ue->measurements.rssi),0);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_UE_GAIN_CONTROL, VCD_FUNCTION_OUT);
|
||||
eNB_id = 0;
|
||||
|
||||
|
||||
@@ -207,7 +207,7 @@ int nr_derive_key(int alg_type, uint8_t alg_id,
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc
|
||||
);
|
||||
@@ -537,8 +537,8 @@ int main(int argc, char **argv)
|
||||
case 'x':
|
||||
g_nrOfLayers=atoi(optarg);
|
||||
|
||||
if ((g_nrOfLayers!=1) &&
|
||||
(g_nrOfLayers!=2)) {
|
||||
if ((g_nrOfLayers==0) ||
|
||||
(g_nrOfLayers>4)) {
|
||||
printf("Unsupported nr Of Layers %d\n",g_nrOfLayers);
|
||||
exit(-1);
|
||||
}
|
||||
@@ -784,12 +784,27 @@ int main(int argc, char **argv)
|
||||
fix_scc(scc,ssb_bitmap);
|
||||
prepare_scd(scd);
|
||||
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts;
|
||||
pdsch_AntennaPorts.N1 = n_tx>1 ? n_tx>>1 : 1;
|
||||
pdsch_AntennaPorts.N2 = 1;
|
||||
pdsch_AntennaPorts.XP = n_tx>1 ? 2 : 1;
|
||||
gNB->ap_N1 = pdsch_AntennaPorts.N1;
|
||||
gNB->ap_N2 = pdsch_AntennaPorts.N2;
|
||||
gNB->ap_XP = pdsch_AntennaPorts.XP;
|
||||
|
||||
NR_UE_NR_Capability_t* UE_Capability_nr = CALLOC(1,sizeof(NR_UE_NR_Capability_t));
|
||||
prepare_sim_uecap(UE_Capability_nr,scc,mu,
|
||||
N_RB_DL,g_mcsTableIdx);
|
||||
|
||||
// TODO do a UECAP for phy-sim
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, n_tx, 6, 0, 0, 0);
|
||||
const gNB_RrcConfigurationReq conf = {
|
||||
.pdsch_AntennaPorts = pdsch_AntennaPorts,
|
||||
.minRXTXTIME = 6,
|
||||
.do_CSIRS = 0,
|
||||
.do_SRS = 0,
|
||||
.force_256qam_off = false
|
||||
};
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, UE_Capability_nr, 0, 1, &conf, 0);
|
||||
|
||||
/* RRC parameter validation for secondaryCellGroup */
|
||||
fix_scd(scd);
|
||||
@@ -807,10 +822,11 @@ 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, 6, scc, NULL, 0, 0, NULL);
|
||||
rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_tx, 0, 6, scc, NULL, 0, 0, NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, 0, 6, scc, NULL, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
rrc_mac_config_req_gNB(0,0, pdsch_AntennaPorts, n_tx, 0, 6, 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;
|
||||
@@ -1202,10 +1218,10 @@ int main(int argc, char **argv)
|
||||
frame_length_complex_samples,
|
||||
0);
|
||||
|
||||
double H_awgn_mimo[4][4] ={{1.0, 0.5, 0.25, 0.125},//rx 0
|
||||
{0.5, 1.0, 0.5, 0.25}, //rx 1
|
||||
{0.25, 0.5, 1.0, 0.5}, //rx 2
|
||||
{0.125, 0.25, 0.5, 1.0}};//rx 3
|
||||
double H_awgn_mimo[4][4] ={{1.0, 0.2, 0.1, 0.05}, //rx 0
|
||||
{0.2, 1.0, 0.2, 0.1}, //rx 1
|
||||
{0.1, 0.2, 1.0, 0.2}, //rx 2
|
||||
{0.05, 0.1, 0.2, 1.0}};//rx 3
|
||||
|
||||
for (i=frame_parms->get_samples_slot_timestamp(slot,frame_parms,0);
|
||||
i<frame_parms->get_samples_slot_timestamp(slot+1,frame_parms,0);
|
||||
@@ -1260,7 +1276,7 @@ int main(int argc, char **argv)
|
||||
TBS = UE_harq_process->TBS;//rel15->TBSize[0];
|
||||
uint16_t length_dmrs = get_num_dmrs(rel15->dlDmrsSymbPos);
|
||||
uint16_t nb_rb = rel15->rbSize;
|
||||
uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6 : 4;
|
||||
uint8_t nb_re_dmrs = rel15->dmrsConfigType == NFAPI_NR_DMRS_TYPE1 ? 6*UE_harq_process->n_dmrs_cdm_groups : 4*UE_harq_process->n_dmrs_cdm_groups;
|
||||
uint8_t mod_order = rel15->qamModOrder[0];
|
||||
uint8_t nb_symb_sch = rel15->NrOfSymbols;
|
||||
|
||||
|
||||
@@ -731,7 +731,14 @@ int main(int argc, char **argv)
|
||||
prepare_scd(scd);
|
||||
|
||||
// TODO do a UECAP for phy-sim
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, n_tx, 0, 0, 0, 0);
|
||||
const gNB_RrcConfigurationReq conf = {
|
||||
.pdsch_AntennaPorts = { .N1 = n_tx, .N2 = 1, .XP = 1 },
|
||||
.minRXTXTIME = 0,
|
||||
.do_CSIRS = 0,
|
||||
.do_SRS = 0,
|
||||
.force_256qam_off = false
|
||||
};
|
||||
fill_default_secondaryCellGroup(scc, scd, secondaryCellGroup, NULL, 0, 1, &conf, 0);
|
||||
|
||||
// xer_fprint(stdout, &asn_DEF_NR_CellGroupConfig, (const void*)secondaryCellGroup);
|
||||
|
||||
@@ -742,9 +749,9 @@ int main(int argc, char **argv)
|
||||
|
||||
gNB->if_inst->NR_PHY_config_req = nr_phy_config_request;
|
||||
// common configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL);
|
||||
rrc_mac_config_req_gNB(0,0, conf.pdsch_AntennaPorts, n_rx, 0, 6, scc, &rrc.carrier.mib,0, 0, NULL);
|
||||
// UE dedicated configuration
|
||||
rrc_mac_config_req_gNB(0,0, n_tx, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
rrc_mac_config_req_gNB(0,0, conf.pdsch_AntennaPorts, n_rx, 0, 6, scc, &rrc.carrier.mib,1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||
|
||||
@@ -401,6 +401,12 @@ typedef struct NbIoTRrcConfigurationReq_s {
|
||||
long ue_TimersAndConstants_n311_NB;
|
||||
} NbIoTRrcConfigurationReq;
|
||||
|
||||
typedef struct {
|
||||
int N1;
|
||||
int N2;
|
||||
int XP;
|
||||
} rrc_pdsch_AntennaPorts_t;
|
||||
|
||||
// gNB: GNB_APP -> RRC messages
|
||||
typedef struct NRRrcConfigurationReq_s {
|
||||
uint64_t cell_identity;
|
||||
@@ -413,11 +419,12 @@ typedef struct NRRrcConfigurationReq_s {
|
||||
NR_ServingCellConfig_t *scd;
|
||||
int ssb_SubcarrierOffset;
|
||||
int sib1_tda;
|
||||
int pdsch_AntennaPorts;
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts;
|
||||
int pusch_AntennaPorts;
|
||||
int minRXTXTIME;
|
||||
int do_CSIRS;
|
||||
int do_SRS;
|
||||
bool force_256qam_off;
|
||||
int pusch_TargetSNRx10;
|
||||
int pucch_TargetSNRx10;
|
||||
} gNB_RrcConfigurationReq;
|
||||
|
||||
@@ -621,8 +621,11 @@ void RCconfig_NR_L1(void) {
|
||||
int num_gnbs = GNBSParams[GNB_ACTIVE_GNBS_IDX].numelt;
|
||||
AssertFatal (num_gnbs > 0,"Failed to parse config file no gnbs %s \n",GNB_CONFIG_STRING_ACTIVE_GNBS);
|
||||
|
||||
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
|
||||
char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr;
|
||||
config_getlist( &GNBParamList,GNBParams,sizeof(GNBParams)/sizeof(paramdef_t),NULL);
|
||||
int N1 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr;
|
||||
int N2 = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr;
|
||||
int XP = *GNBParamList.paramarray[0][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
|
||||
char *ulprbbl = *GNBParamList.paramarray[0][GNB_ULPRBBLACKLIST_IDX].strptr;
|
||||
if (ulprbbl) LOG_I(NR_PHY,"PRB blacklist %s\n",ulprbbl);
|
||||
char *save = NULL;
|
||||
char *pt = strtok_r(ulprbbl, ",", &save);
|
||||
@@ -669,6 +672,9 @@ void RCconfig_NR_L1(void) {
|
||||
RC.gNB[j]->prach_thres = *(L1_ParamList.paramarray[j][L1_PRACH_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->pusch_thres = *(L1_ParamList.paramarray[j][L1_PUSCH_DTX_THRESHOLD].uptr);
|
||||
RC.gNB[j]->num_ulprbbl = num_prbbl;
|
||||
RC.gNB[j]->ap_N1 = N1;
|
||||
RC.gNB[j]->ap_N2 = N2;
|
||||
RC.gNB[j]->ap_XP = XP;
|
||||
LOG_I(NR_PHY,"Copying %d blacklisted PRB to L1 context\n",num_prbbl);
|
||||
memcpy(RC.gNB[j]->ulprbbl,prbbl,275*sizeof(int));
|
||||
if(strcmp(*(L1_ParamList.paramarray[j][L1_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_mac") == 0) {
|
||||
@@ -1166,8 +1172,12 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
}
|
||||
LOG_I(RRC,"SSB SCO %d\n",*GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).ssb_SubcarrierOffset = *GNBParamList.paramarray[i][GNB_SSB_SUBCARRIEROFFSET_IDX].iptr;
|
||||
LOG_I(RRC,"pdsch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_IDX].iptr;
|
||||
LOG_I(RRC,"pdsch_AntennaPorts N1 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts.N1 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N1_IDX].iptr;
|
||||
LOG_I(RRC,"pdsch_AntennaPorts N2 %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts.N2 = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_N2_IDX].iptr;
|
||||
LOG_I(RRC,"pdsch_AntennaPorts XP %d\n",*GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pdsch_AntennaPorts.XP = *GNBParamList.paramarray[i][GNB_PDSCH_ANTENNAPORTS_XP_IDX].iptr;
|
||||
LOG_I(RRC,"pusch_AntennaPorts %d\n",*GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).pusch_AntennaPorts = *GNBParamList.paramarray[i][GNB_PUSCH_ANTENNAPORTS_IDX].iptr;
|
||||
LOG_I(RRC,"minTXRXTIME %d\n",*GNBParamList.paramarray[i][GNB_MINRXTXTIME_IDX].iptr);
|
||||
@@ -1176,8 +1186,10 @@ void RCconfig_NRRRC(MessageDef *msg_p, uint32_t i, gNB_RRC_INST *rrc) {
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).sib1_tda = *GNBParamList.paramarray[i][GNB_SIB1_TDA_IDX].iptr;
|
||||
LOG_I(RRC,"Do CSI-RS %d\n",*GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).do_CSIRS = *GNBParamList.paramarray[i][GNB_DO_CSIRS_IDX].iptr;
|
||||
printf("Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr);
|
||||
LOG_I(RRC, "Do SRS %d\n",*GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr);
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).do_SRS = *GNBParamList.paramarray[i][GNB_DO_SRS_IDX].iptr;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).force_256qam_off = *GNBParamList.paramarray[i][GNB_FORCE256QAMOFF_IDX].iptr;
|
||||
LOG_I(RRC, "256 QAM: %s\n", NRRRC_CONFIGURATION_REQ (msg_p).force_256qam_off ? "force off" : "may be on");
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scc = scc;
|
||||
NRRRC_CONFIGURATION_REQ (msg_p).scd = scd;
|
||||
|
||||
|
||||
@@ -114,7 +114,9 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_LOCAL_S_PORTD "local_s_portd"
|
||||
#define GNB_CONFIG_STRING_REMOTE_S_PORTD "remote_s_portd"
|
||||
#define GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET "ssb_SubcarrierOffset"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS "pdsch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1 "pdsch_AntennaPorts_N1"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2 "pdsch_AntennaPorts_N2"
|
||||
#define GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP "pdsch_AntennaPorts_XP"
|
||||
#define GNB_CONFIG_STRING_PUSCHANTENNAPORTS "pusch_AntennaPorts"
|
||||
#define GNB_CONFIG_STRING_SIB1TDA "sib1_tda"
|
||||
#define GNB_CONFIG_STRING_DOCSIRS "do_CSIRS"
|
||||
@@ -122,8 +124,11 @@ typedef enum {
|
||||
#define GNB_CONFIG_STRING_NRCELLID "nr_cellid"
|
||||
#define GNB_CONFIG_STRING_MINRXTXTIME "min_rxtxtime"
|
||||
#define GNB_CONFIG_STRING_ULPRBBLACKLIST "ul_prbblacklist"
|
||||
#define GNB_CONFIG_STRING_FORCE256QAMOFF "force_256qam_off"
|
||||
|
||||
|
||||
#define GNB_CONFIG_HLP_FORCE256QAMOFF "suppress activation of 256 QAM despite UE support"
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* cell configuration parameters */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
@@ -144,14 +149,17 @@ typedef enum {
|
||||
{GNB_CONFIG_STRING_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defuintval:50001, TYPE_UINT, 0}, \
|
||||
{GNB_CONFIG_STRING_SSBSUBCARRIEROFFSET, NULL, 0, iptr:NULL, defintval:31, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N1, "horiz. log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_N2, "vert. log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PDSCHANTENNAPORTS_XP, "XP log. antenna ports", 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_PUSCHANTENNAPORTS, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_SIB1TDA, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_DOCSIRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_DOSRS, NULL, 0, iptr:NULL, defintval:0, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_NRCELLID, NULL, 0, u64ptr:NULL, defint64val:1, TYPE_UINT64, 0}, \
|
||||
{GNB_CONFIG_STRING_MINRXTXTIME, NULL, 0, iptr:NULL, defintval:2, TYPE_INT, 0}, \
|
||||
{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0} \
|
||||
{GNB_CONFIG_STRING_ULPRBBLACKLIST, NULL, 0, strptr:NULL, defstrval:"", TYPE_STRING, 0}, \
|
||||
{GNB_CONFIG_STRING_FORCE256QAMOFF, GNB_CONFIG_HLP_FORCE256QAMOFF, PARAMFLAG_BOOL, iptr:NULL, defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
#define GNB_GNB_ID_IDX 0
|
||||
@@ -169,14 +177,17 @@ typedef enum {
|
||||
#define GNB_LOCAL_S_PORTD_IDX 12
|
||||
#define GNB_REMOTE_S_PORTD_IDX 13
|
||||
#define GNB_SSB_SUBCARRIEROFFSET_IDX 14
|
||||
#define GNB_PDSCH_ANTENNAPORTS_IDX 15
|
||||
#define GNB_PUSCH_ANTENNAPORTS_IDX 16
|
||||
#define GNB_SIB1_TDA_IDX 17
|
||||
#define GNB_DO_CSIRS_IDX 18
|
||||
#define GNB_DO_SRS_IDX 19
|
||||
#define GNB_NRCELLID_IDX 20
|
||||
#define GNB_MINRXTXTIME_IDX 21
|
||||
#define GNB_ULPRBBLACKLIST_IDX 22
|
||||
#define GNB_PDSCH_ANTENNAPORTS_N1_IDX 15
|
||||
#define GNB_PDSCH_ANTENNAPORTS_N2_IDX 16
|
||||
#define GNB_PDSCH_ANTENNAPORTS_XP_IDX 17
|
||||
#define GNB_PUSCH_ANTENNAPORTS_IDX 18
|
||||
#define GNB_SIB1_TDA_IDX 19
|
||||
#define GNB_DO_CSIRS_IDX 20
|
||||
#define GNB_DO_SRS_IDX 21
|
||||
#define GNB_NRCELLID_IDX 22
|
||||
#define GNB_MINRXTXTIME_IDX 23
|
||||
#define GNB_ULPRBBLACKLIST_IDX 24
|
||||
#define GNB_FORCE256QAMOFF_IDX 25
|
||||
|
||||
#define TRACKING_AREA_CODE_OKRANGE {0x0001,0xFFFD}
|
||||
#define GNBPARAMS_CHECK { \
|
||||
|
||||
@@ -58,19 +58,42 @@ void process_rlcBearerConfig(struct NR_CellGroupConfig__rlc_BearerToAddModList *
|
||||
struct NR_CellGroupConfig__rlc_BearerToReleaseList *rlc_bearer2release_list,
|
||||
NR_UE_sched_ctrl_t *sched_ctrl) {
|
||||
|
||||
|
||||
if (rlc_bearer2add_list)
|
||||
// keep lcids
|
||||
for (int i=0;i<rlc_bearer2add_list->list.count;i++) {
|
||||
sched_ctrl->lcid_mask |= (1<<rlc_bearer2add_list->list.array[i]->logicalChannelIdentity);
|
||||
LOG_I(NR_MAC,"Adding LCID %d (%s %d)\n",
|
||||
(int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity,
|
||||
rlc_bearer2add_list->list.array[i]->logicalChannelIdentity<4 ? "SRB" : "DRB",
|
||||
(int)rlc_bearer2add_list->list.array[i]->logicalChannelIdentity);
|
||||
if (rlc_bearer2release_list) {
|
||||
for (int i = 0; i < rlc_bearer2release_list->list.count; i++) {
|
||||
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) {
|
||||
if (sched_ctrl->dl_lc_ids[idx] == *rlc_bearer2release_list->list.array[i]) {
|
||||
const int remaining_lcs = sched_ctrl->dl_lc_num - idx - 1;
|
||||
memmove(&sched_ctrl->dl_lc_ids[idx], &sched_ctrl->dl_lc_ids[idx + 1], sizeof(sched_ctrl->dl_lc_ids[idx]) * remaining_lcs);
|
||||
sched_ctrl->dl_lc_num--;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rlc_bearer2release_list)
|
||||
for (int i=0;i<rlc_bearer2release_list->list.count;i++)
|
||||
sched_ctrl->lcid_mask |= (1<<*rlc_bearer2release_list->list.array[i]);
|
||||
}
|
||||
|
||||
if (rlc_bearer2add_list) {
|
||||
// keep lcids
|
||||
for (int i = 0; i < rlc_bearer2add_list->list.count; i++) {
|
||||
const int lcid = rlc_bearer2add_list->list.array[i]->logicalChannelIdentity;
|
||||
bool found = false;
|
||||
for (int idx = 0; idx < sched_ctrl->dl_lc_num; idx++) {
|
||||
if (sched_ctrl->dl_lc_ids[idx] == lcid) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
sched_ctrl->dl_lc_num++;
|
||||
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid;
|
||||
LOG_D(NR_MAC, "Adding LCID %d (%s %d)\n", lcid, lcid < 4 ? "SRB" : "DRB", lcid);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC, "In %s: total num of active bearers %d) \n",
|
||||
__FUNCTION__,
|
||||
sched_ctrl->dl_lc_num);
|
||||
|
||||
}
|
||||
|
||||
@@ -137,11 +160,11 @@ void process_CellGroup(NR_CellGroupConfig_t *CellGroup, NR_UE_sched_ctrl_t *sche
|
||||
|
||||
}
|
||||
|
||||
void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
void config_common(int Mod_idP, int ssb_SubcarrierOffset, rrc_pdsch_AntennaPorts_t dl_antenna_ports_struct, int pusch_AntennaPorts, NR_ServingCellConfigCommon_t *scc) {
|
||||
|
||||
nfapi_nr_config_request_scf_t *cfg = &RC.nrmac[Mod_idP]->config[0];
|
||||
RC.nrmac[Mod_idP]->common_channels[0].ServingCellConfigCommon = scc;
|
||||
int i;
|
||||
int pdsch_AntennaPorts = dl_antenna_ports_struct.N1 * dl_antenna_ports_struct.N2 * dl_antenna_ports_struct.XP;
|
||||
|
||||
// Carrier configuration
|
||||
|
||||
@@ -158,7 +181,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
cfg->carrier_config.dl_frequency.tl.tag = NFAPI_NR_CONFIG_DL_FREQUENCY_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
if (i==scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.dl_grid_size[i].value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.dl_k0[i].value = scc->downlinkConfigCommon->frequencyInfoDL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
@@ -192,7 +215,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
cfg->carrier_config.uplink_frequency.tl.tag = NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG;
|
||||
cfg->num_tlv++;
|
||||
|
||||
for (i=0; i<5; i++) {
|
||||
for (int i=0; i<5; i++) {
|
||||
if (i==scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->subcarrierSpacing) {
|
||||
cfg->carrier_config.ul_grid_size[i].value = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->carrierBandwidth;
|
||||
cfg->carrier_config.ul_k0[i].value = scc->uplinkConfigCommon->frequencyInfoUL->scs_SpecificCarrierList.list.array[0]->offsetToCarrier;
|
||||
@@ -283,7 +306,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
cfg->num_tlv++;
|
||||
|
||||
cfg->prach_config.num_prach_fd_occasions_list = (nfapi_nr_num_prach_fd_occasions_t *) malloc(cfg->prach_config.num_prach_fd_occasions.value*sizeof(nfapi_nr_num_prach_fd_occasions_t));
|
||||
for (i=0; i<cfg->prach_config.num_prach_fd_occasions.value; i++) {
|
||||
for (int i=0; i<cfg->prach_config.num_prach_fd_occasions.value; i++) {
|
||||
// cfg->prach_config.num_prach_fd_occasions_list[i].num_prach_fd_occasions = i;
|
||||
if (cfg->prach_config.prach_sequence_length.value)
|
||||
cfg->prach_config.num_prach_fd_occasions_list[i].prach_root_sequence_index.value = scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup->prach_RootSequenceIndex.choice.l139;
|
||||
@@ -352,7 +375,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
case 3 :
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.value = 0;
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.value = 0;
|
||||
for (i=0; i<4; i++) {
|
||||
for (int i=0; i<4; i++) {
|
||||
cfg->ssb_table.ssb_mask_list[0].ssb_mask.value += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[3-i]<<i*8);
|
||||
cfg->ssb_table.ssb_mask_list[1].ssb_mask.value += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[7-i]<<i*8);
|
||||
}
|
||||
@@ -391,7 +414,8 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
cfg->carrier_config.num_rx_ant.value = pusch_AntennaPorts;
|
||||
AssertFatal(pusch_AntennaPorts > 0 && pusch_AntennaPorts < 13, "pusch_AntennaPorts in 1...12\n");
|
||||
cfg->carrier_config.num_rx_ant.tl.tag = NFAPI_NR_CONFIG_NUM_RX_ANT_TAG;
|
||||
LOG_I(NR_MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n",cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value);
|
||||
LOG_I(NR_MAC,"Set TX/RX antenna number to %d (num ssb %d: %x,%x)\n",
|
||||
cfg->carrier_config.num_tx_ant.value,num_ssb,cfg->ssb_table.ssb_mask_list[0].ssb_mask.value,cfg->ssb_table.ssb_mask_list[1].ssb_mask.value);
|
||||
AssertFatal(cfg->carrier_config.num_tx_ant.value > 0,"carrier_config.num_tx_ant.value %d !\n",cfg->carrier_config.num_tx_ant.value );
|
||||
cfg->num_tlv++;
|
||||
cfg->num_tlv++;
|
||||
@@ -428,7 +452,7 @@ void config_common(int Mod_idP, int ssb_SubcarrierOffset, int pdsch_AntennaPorts
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
int sib1_tda,
|
||||
int minRXTXTIMEpdsch,
|
||||
|
||||
@@ -471,76 +471,49 @@ void nr_store_dlsch_buffer(module_id_t module_id,
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[module_id]->UE_info;
|
||||
|
||||
for (int UE_id = UE_info->list.head; UE_id >= 0; UE_id = UE_info->list.next[UE_id]) {
|
||||
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
|
||||
sched_ctrl->num_total_bytes = 0;
|
||||
sched_ctrl->dl_pdus_total = 0;
|
||||
|
||||
int lcid;
|
||||
const uint16_t rnti = UE_info->rnti[UE_id];
|
||||
LOG_D(NR_MAC,"UE %d/%x : lcid_mask %x\n",UE_id,rnti,sched_ctrl->lcid_mask);
|
||||
if ((sched_ctrl->lcid_mask&(1<<2)) > 0)
|
||||
sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1] = mac_rlc_status_ind(module_id,
|
||||
/* loop over all activated logical channels */
|
||||
// Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH
|
||||
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) {
|
||||
|
||||
const int lcid = sched_ctrl->dl_lc_ids[i];
|
||||
const uint16_t rnti = UE_info->rnti[UE_id];
|
||||
LOG_D(NR_MAC, "In %s: UE %d/%x: LCID %d\n", __FUNCTION__, UE_id, rnti, lcid);
|
||||
start_meas(&RC.nrmac[module_id]->rlc_status_ind);
|
||||
sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DL_SCH_LCID_DCCH1,
|
||||
lcid,
|
||||
0,
|
||||
0);
|
||||
if ((sched_ctrl->lcid_mask&(1<<1)) > 0)
|
||||
sched_ctrl->rlc_status[DL_SCH_LCID_DCCH] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DL_SCH_LCID_DCCH,
|
||||
0,
|
||||
0);
|
||||
if ((sched_ctrl->lcid_mask&(1<<4)) > 0) {
|
||||
start_meas(&RC.nrmac[module_id]->rlc_status_ind);
|
||||
sched_ctrl->rlc_status[DL_SCH_LCID_DTCH] = mac_rlc_status_ind(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
DL_SCH_LCID_DTCH,
|
||||
0,
|
||||
0);
|
||||
stop_meas(&RC.nrmac[module_id]->rlc_status_ind);
|
||||
}
|
||||
if(sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0){
|
||||
lcid = DL_SCH_LCID_DCCH;
|
||||
}
|
||||
else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0)
|
||||
{
|
||||
lcid = DL_SCH_LCID_DCCH1;
|
||||
}else{
|
||||
lcid = DL_SCH_LCID_DTCH;
|
||||
}
|
||||
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
//later multiplex here. Just select DCCH/SRB before DTCH/DRB
|
||||
sched_ctrl->lcid_to_schedule = lcid;
|
||||
stop_meas(&RC.nrmac[module_id]->rlc_status_ind);
|
||||
|
||||
if (sched_ctrl->num_total_bytes == 0
|
||||
&& !sched_ctrl->ta_apply) /* If TA should be applied, give at least one RB */
|
||||
continue;
|
||||
if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0)
|
||||
continue;
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"[%s][%d.%d], %s%d->DLSCH, RLC status %d bytes TA %d\n",
|
||||
__func__,
|
||||
frame,
|
||||
slot,
|
||||
lcid<4?"DCCH":"DTCH",
|
||||
lcid,
|
||||
sched_ctrl->rlc_status[lcid].bytes_in_buffer,
|
||||
sched_ctrl->ta_apply);
|
||||
sched_ctrl->dl_pdus_total += sched_ctrl->rlc_status[lcid].pdus_in_buffer;
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
LOG_D(MAC,
|
||||
"[gNB %d][%4d.%2d] %s%d->DLSCH, RLC status for UE %d: %d bytes in buffer, total DL buffer size = %d bytes, %d total PDU bytes, %s TA command\n",
|
||||
module_id,
|
||||
frame,
|
||||
slot,
|
||||
lcid < 4 ? "DCCH":"DTCH",
|
||||
lcid,
|
||||
UE_id,
|
||||
sched_ctrl->rlc_status[lcid].bytes_in_buffer,
|
||||
sched_ctrl->num_total_bytes,
|
||||
sched_ctrl->dl_pdus_total,
|
||||
sched_ctrl->ta_apply ? "send":"do not send");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -862,6 +835,10 @@ void pf_dl(module_id_t module_id,
|
||||
CCEIndex,
|
||||
sched_ctrl->aggregation_level);
|
||||
|
||||
/* reduce max_num_ue once we are sure UE can be allocated, i.e., has CCE */
|
||||
max_num_ue--;
|
||||
if (max_num_ue < 0) return;
|
||||
|
||||
/* MCS has been set above */
|
||||
|
||||
const int tda = RC.nrmac[module_id]->preferred_dl_tda[sched_ctrl->active_bwp ? sched_ctrl->active_bwp->bwp_Id : 0][slot];
|
||||
@@ -892,7 +869,12 @@ void pf_dl(module_id_t module_id,
|
||||
sched_pdsch->pucch_allocation = alloc;
|
||||
uint32_t TBS = 0;
|
||||
uint16_t rbSize;
|
||||
const int oh = 3 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
|
||||
// Fix me: currently, the RLC does not give us the total number of PDUs
|
||||
// awaiting. Therefore, for the time being, we put a fixed overhead of 12
|
||||
// (for 4 PDUs) and optionally + 2 for TA. Once RLC gives the number of
|
||||
// PDUs, we replace with 3 * numPDUs
|
||||
const int oh = 3 * 4 + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
|
||||
//const int oh = 3 * sched_ctrl->dl_pdus_total + 2 * (frame == (sched_ctrl->ta_frame + 10) % 1024);
|
||||
nr_find_nb_rb(sched_pdsch->Qm,
|
||||
sched_pdsch->R,
|
||||
ps->nrOfLayers,
|
||||
@@ -1336,68 +1318,72 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
buf += written;
|
||||
int size = TBS - written;
|
||||
DevAssert(size >= 0);
|
||||
|
||||
/* next, get RLC data */
|
||||
|
||||
// const int lcid = DL_SCH_LCID_DTCH;
|
||||
const int lcid = sched_ctrl->lcid_to_schedule;
|
||||
int dlsch_total_bytes = 0;
|
||||
start_meas(&gNB_mac->rlc_data_req);
|
||||
if (sched_ctrl->num_total_bytes > 0) {
|
||||
tbs_size_t len = 0;
|
||||
while (size > 3) {
|
||||
// we do not know how much data we will get from RLC, i.e., whether it
|
||||
// will be longer than 256B or not. Therefore, reserve space for long header, then
|
||||
// fetch data, then fill real length
|
||||
NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf;
|
||||
buf += 3;
|
||||
size -= 3;
|
||||
|
||||
/* limit requested number of bytes to what preprocessor specified, or
|
||||
* such that TBS is full */
|
||||
const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size);
|
||||
/* loop over all activated logical channels */
|
||||
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) {
|
||||
|
||||
len = mac_rlc_data_req(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
ndata,
|
||||
(char *)buf,
|
||||
0,
|
||||
0);
|
||||
const int lcid = sched_ctrl->dl_lc_ids[i];
|
||||
if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0)
|
||||
continue; // no data for this LC
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n",
|
||||
frame,
|
||||
slot,
|
||||
rnti,
|
||||
len,
|
||||
lcid < 4 ? "DCCH" : "DTCH",
|
||||
lcid,
|
||||
ndata,
|
||||
size);
|
||||
if (len == 0)
|
||||
break;
|
||||
int dlsch_total_bytes = 0;
|
||||
while (size > 3) {
|
||||
// we do not know how much data we will get from RLC, i.e., whether it
|
||||
// will be longer than 256B or not. Therefore, reserve space for long header, then
|
||||
// fetch data, then fill real length
|
||||
NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf;
|
||||
buf += 3;
|
||||
size -= 3;
|
||||
|
||||
header->R = 0;
|
||||
header->F = 1;
|
||||
header->LCID = lcid;
|
||||
header->L1 = (len >> 8) & 0xff;
|
||||
header->L2 = len & 0xff;
|
||||
size -= len;
|
||||
buf += len;
|
||||
dlsch_total_bytes += len;
|
||||
/* limit requested number of bytes to what preprocessor specified, or
|
||||
* such that TBS is full */
|
||||
const rlc_buffer_occupancy_t ndata = min(sched_ctrl->rlc_status[lcid].bytes_in_buffer, size);
|
||||
tbs_size_t len = mac_rlc_data_req(module_id,
|
||||
rnti,
|
||||
module_id,
|
||||
frame,
|
||||
ENB_FLAG_YES,
|
||||
MBMS_FLAG_NO,
|
||||
lcid,
|
||||
ndata,
|
||||
(char *)buf,
|
||||
0,
|
||||
0);
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d RNTI %04x: %d bytes from %s %d (ndata %d, remaining size %d)\n",
|
||||
frame,
|
||||
slot,
|
||||
rnti,
|
||||
len,
|
||||
lcid < 4 ? "DCCH" : "DTCH",
|
||||
lcid,
|
||||
ndata,
|
||||
size);
|
||||
if (len == 0) {
|
||||
/* RLC did not have data anymore, mark buffer as unused */
|
||||
buf -= 3;
|
||||
size += 3;
|
||||
break;
|
||||
}
|
||||
|
||||
header->R = 0;
|
||||
header->F = 1;
|
||||
header->LCID = lcid;
|
||||
header->L1 = (len >> 8) & 0xff;
|
||||
header->L2 = len & 0xff;
|
||||
size -= len;
|
||||
buf += len;
|
||||
dlsch_total_bytes += len;
|
||||
}
|
||||
|
||||
UE_info->mac_stats[UE_id].lc_bytes_tx[lcid] += dlsch_total_bytes;
|
||||
}
|
||||
if (len == 0) {
|
||||
/* RLC did not have data anymore, mark buffer as unused */
|
||||
buf -= 3;
|
||||
size += 3;
|
||||
}
|
||||
}
|
||||
else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra || get_softmodem_params()->sa) {
|
||||
} else if (get_softmodem_params()->phy_test || get_softmodem_params()->do_ra) {
|
||||
/* we will need the large header, phy-test typically allocates all
|
||||
* resources and fills to the last byte below */
|
||||
NR_MAC_SUBHEADER_LONG *header = (NR_MAC_SUBHEADER_LONG *) buf;
|
||||
@@ -1415,7 +1401,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
header->L2 = size & 0xff;
|
||||
size -= size;
|
||||
buf += size;
|
||||
dlsch_total_bytes += size;
|
||||
}
|
||||
stop_meas(&gNB_mac->rlc_data_req);
|
||||
|
||||
@@ -1435,7 +1420,6 @@ void nr_schedule_ue_spec(module_id_t module_id,
|
||||
|
||||
UE_info->mac_stats[UE_id].dlsch_total_bytes += TBS;
|
||||
UE_info->mac_stats[UE_id].dlsch_current_bytes = TBS;
|
||||
UE_info->mac_stats[UE_id].lc_bytes_tx[lcid] += dlsch_total_bytes;
|
||||
|
||||
/* save retransmission information */
|
||||
harq->sched_pdsch = *sched_pdsch;
|
||||
|
||||
@@ -312,7 +312,9 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
}
|
||||
|
||||
sched_ctrl->num_total_bytes = 0;
|
||||
sched_ctrl->dl_lc_num = 1;
|
||||
const int lcid = DL_SCH_LCID_DTCH;
|
||||
sched_ctrl->dl_lc_ids[sched_ctrl->dl_lc_num - 1] = lcid;
|
||||
const uint16_t rnti = UE_info->rnti[UE_id];
|
||||
/* update sched_ctrl->num_total_bytes so that postprocessor schedules data,
|
||||
* if available */
|
||||
@@ -327,7 +329,6 @@ void nr_preprocessor_phytest(module_id_t module_id,
|
||||
0,
|
||||
0);
|
||||
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
|
||||
sched_ctrl->lcid_to_schedule = lcid;
|
||||
|
||||
uint8_t nr_of_candidates;
|
||||
for (int i=0; i<5; i++) {
|
||||
|
||||
@@ -2209,10 +2209,6 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
memset(sched_ctrl, 0, sizeof(*sched_ctrl));
|
||||
sched_ctrl->set_mcs = TRUE;
|
||||
sched_ctrl->lcid_mask = 0;
|
||||
if (!get_softmodem_params()->phy_test && !get_softmodem_params()->do_ra && !get_softmodem_params()->sa) {
|
||||
sched_ctrl->lcid_mask = 1<<DL_SCH_LCID_DTCH;
|
||||
}
|
||||
sched_ctrl->ta_frame = 0;
|
||||
sched_ctrl->ta_update = 31;
|
||||
sched_ctrl->ta_apply = false;
|
||||
|
||||
@@ -818,6 +818,8 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
|
||||
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
|
||||
UE_info->active[UE_id] = true;
|
||||
|
||||
process_CellGroup(ra->CellGroup, UE_scheduling_control);
|
||||
|
||||
} else {
|
||||
|
||||
LOG_A(NR_MAC,"[RAPROC] RA-Msg3 received (sdu_lenP %d)\n",sdu_lenP);
|
||||
@@ -956,7 +958,7 @@ int next_list_entry_looped(NR_list_t *list, int UE_id)
|
||||
bool allocate_ul_retransmission(module_id_t module_id,
|
||||
frame_t frame,
|
||||
sub_frame_t slot,
|
||||
uint8_t *rballoc_mask,
|
||||
uint16_t *rballoc_mask,
|
||||
int *n_rb_sched,
|
||||
int UE_id,
|
||||
int harq_pid)
|
||||
@@ -1119,7 +1121,7 @@ void pf_ul(module_id_t module_id,
|
||||
NR_list_t *UE_list,
|
||||
int max_num_ue,
|
||||
int n_rb_sched,
|
||||
uint8_t *rballoc_mask) {
|
||||
uint16_t *rballoc_mask) {
|
||||
|
||||
const int CC_id = 0;
|
||||
gNB_MAC_INST *nrmac = RC.nrmac[module_id];
|
||||
@@ -1503,7 +1505,7 @@ bool nr_fr1_ulsch_preprocessor(module_id_t module_id, frame_t frame, sub_frame_t
|
||||
|
||||
LOG_D(NR_MAC,"UL %d.%d : start_prb %d, end PRB %d\n",frame,slot,st,e);
|
||||
|
||||
uint8_t rballoc_mask[bwpSize];
|
||||
uint16_t rballoc_mask[bwpSize];
|
||||
|
||||
/* Calculate mask: if any RB in vrb_map_UL is blocked (1), the current RB will be 0 */
|
||||
for (int i = 0; i < bwpSize; i++)
|
||||
|
||||
@@ -40,14 +40,14 @@ void mac_top_init_gNB(void);
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
NR_ServingCellConfigCommon_t *scc
|
||||
);
|
||||
|
||||
int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
int ssb_SubcarrierOffset,
|
||||
int pdsch_AntennaPorts,
|
||||
rrc_pdsch_AntennaPorts_t pdsch_AntennaPorts,
|
||||
int pusch_AntennaPorts,
|
||||
int sib1_tda,
|
||||
int minRXTXTIMEpdsch,
|
||||
|
||||
@@ -603,14 +603,13 @@ typedef struct {
|
||||
|
||||
/// total amount of data awaiting for this UE
|
||||
uint32_t num_total_bytes;
|
||||
uint16_t dl_pdus_total;
|
||||
/// per-LC status data
|
||||
mac_rlc_status_resp_t rlc_status[MAX_NUM_LCID];
|
||||
mac_rlc_status_resp_t rlc_status[NR_MAX_NUM_LCID];
|
||||
|
||||
/// Estimation of HARQ from BLER
|
||||
NR_DL_bler_stats_t dl_bler_stats;
|
||||
|
||||
int lcid_mask;
|
||||
int lcid_to_schedule;
|
||||
uint16_t ta_frame;
|
||||
int16_t ta_update;
|
||||
bool ta_apply;
|
||||
@@ -646,6 +645,12 @@ typedef struct {
|
||||
/// UL HARQ processes that await retransmission
|
||||
NR_list_t retrans_ul_harq;
|
||||
NR_UE_mac_ce_ctrl_t UE_mac_ce_ctrl;// MAC CE related information
|
||||
|
||||
/// number of active DL LCs
|
||||
uint8_t dl_lc_num;
|
||||
/// order in which DLSCH scheduler should allocate LCs
|
||||
uint8_t dl_lc_ids[NR_MAX_NUM_LCID];
|
||||
|
||||
} NR_UE_sched_ctrl_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -1149,9 +1149,9 @@ void nr_DRB_preconfiguration(uint16_t crnti)
|
||||
drb_ToAddMod->pdcp_Config->drb->discardTimer = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->discardTimer));
|
||||
*drb_ToAddMod->pdcp_Config->drb->discardTimer=NR_PDCP_Config__drb__discardTimer_infinity;
|
||||
drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL));
|
||||
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len12bits;
|
||||
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeUL = NR_PDCP_Config__drb__pdcp_SN_SizeUL_len18bits;
|
||||
drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = calloc(1,sizeof(*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL));
|
||||
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len12bits;
|
||||
*drb_ToAddMod->pdcp_Config->drb->pdcp_SN_SizeDL = NR_PDCP_Config__drb__pdcp_SN_SizeDL_len18bits;
|
||||
drb_ToAddMod->pdcp_Config->drb->headerCompression.present = NR_PDCP_Config__drb__headerCompression_PR_notUsed;
|
||||
drb_ToAddMod->pdcp_Config->drb->headerCompression.choice.notUsed = 0;
|
||||
|
||||
@@ -1181,7 +1181,8 @@ void nr_DRB_preconfiguration(uint16_t crnti)
|
||||
|
||||
NR_RLC_BearerConfig_t *RLC_BearerConfig = calloc(1,sizeof(*RLC_BearerConfig));
|
||||
nr_rlc_bearer_init(RLC_BearerConfig,NR_RLC_BearerConfig__servedRadioBearer_PR_drb_Identity);
|
||||
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
|
||||
nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_um_Bi_Directional);
|
||||
//nr_drb_config(RLC_BearerConfig->rlc_Config, NR_RLC_Config_PR_am);
|
||||
nr_rlc_bearer_init_ul_spec(RLC_BearerConfig->mac_LogicalChannelConfig);
|
||||
|
||||
Rlc_Bearer_ToAdd_list = calloc(1,sizeof(*Rlc_Bearer_ToAdd_list));
|
||||
|
||||
@@ -24,7 +24,8 @@
|
||||
}
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __OPENAIR2_PHY_INTERFACE_QUEUE_T__H__
|
||||
#define __OPENAIR2_PHY_INTERFACE_QUEUE_T__H__
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
@@ -62,3 +63,5 @@ typedef bool queue_matcher_t(void *wanted, void *candidate);
|
||||
Look only at the last `max_depth` items on the queue, at most.
|
||||
Returns the candidate item, or NULL if none matches */
|
||||
void *unqueue_matching(queue_t *q, size_t max_depth, queue_matcher_t *matcher, void *wanted);
|
||||
|
||||
#endif /* __OPENAIR2_PHY_INTERFACE_QUEUE_T__H__ */
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user