Merge remote-tracking branch 'origin/develop' into nr_csirs_rrc_harmonization
This commit is contained in:
@@ -21,28 +21,14 @@
|
||||
|
||||
# OpenAirInterface License #
|
||||
|
||||
### Included Fixes: ###
|
||||
- Ease of use of gprof and address sanitizer for debugging purposes
|
||||
- Updated json files to allow for GDB, real-time debugging capabilities
|
||||
- Updated logging features to minimally log only key connection milestones. This imroves scalability of multiple UEs.
|
||||
- Updated logging to include time stamp for timing analysis
|
||||
- Updated memory allocation procedures to correct size requirements
|
||||
- Added debugging features to handle signal terminations
|
||||
- nfapi.c pullarray8 fix invalid pointer math
|
||||
- Overlapping destination and source memory in memcpy, so updated to memmove to check for this bug
|
||||
- Advanced error checking mechanisms in critical pack and unpack functions
|
||||
- Created option for CPU assignment to UE to improve scalability
|
||||
- Added EPC integration to allow multiple individual UE entities to each have their USIM information parced by the executables
|
||||
- Updated random value seeds to minimize probability of error in generation of random values
|
||||
- Enables capability round robin scheduler if desired
|
||||
- Enables capability real time scheduler if desired
|
||||
- Added new standalone functions to the UE phy-layer (phy_stub_ue.c) to incorporate individual UE entities
|
||||
- Updated sending and packing functions in UE (lte_ue.c) to incorporate new standalone changes
|
||||
- Incorporated semaphores to control timing of incoming downlink packets
|
||||
- Implemented new queuing system to handle message exchange from UE to eNB and vice versa
|
||||
- Updated global value in nFAPI for size of subframe
|
||||
- Updated global value to increase scalability in system
|
||||
* [OAI License Model](http://www.openairinterface.org/?page_id=101)
|
||||
* [OAI License v1.1 on our website](http://www.openairinterface.org/?page_id=698)
|
||||
|
||||
It is distributed under **OAI Public License V1.1**.
|
||||
|
||||
The license information is distributed under [LICENSE](LICENSE) file in the same directory.
|
||||
|
||||
Please see [NOTICE](NOTICE.md) file for third party software that is included in the sources.
|
||||
|
||||
# Where to Start #
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -83,17 +83,8 @@ gNBs =
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 11;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -148,19 +139,6 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
|
||||
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
|
||||
@@ -37,8 +37,6 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pusch_AntennaPorts = 1;
|
||||
min_rxtxtime = 6;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
@@ -75,17 +73,8 @@ gNBs =
|
||||
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
|
||||
initialDLBWPsubcarrierSpacing = 1;
|
||||
#pdcch-ConfigCommon
|
||||
initialDLBWPcontrolResourceSetZero = 12;
|
||||
initialDLBWPcontrolResourceSetZero = 11;
|
||||
initialDLBWPsearchSpaceZero = 0;
|
||||
#pdsch-ConfigCommon
|
||||
#pdschTimeDomainAllocationList (up to 16 entries)
|
||||
initialDLBWPk0_0 = 0; #for DL slot
|
||||
initialDLBWPmappingType_0 = 0; #0=typeA,1=typeB
|
||||
initialDLBWPstartSymbolAndLength_0 = 40; #this is SS=1,L=13
|
||||
|
||||
initialDLBWPk0_1 = 0; #for mixed slot
|
||||
initialDLBWPmappingType_1 = 0;
|
||||
initialDLBWPstartSymbolAndLength_1 = 57; #this is SS=1,L=5
|
||||
|
||||
#uplinkConfigCommon
|
||||
#frequencyInfoUL
|
||||
@@ -140,19 +129,6 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6; # used for UL slot
|
||||
initialULBWPmappingType_0 = 1
|
||||
initialULBWPstartSymbolAndLength_0 = 41; # this is SS=0 L=13
|
||||
|
||||
initialULBWPk2_1 = 6; # used for mixed slot
|
||||
initialULBWPmappingType_1 = 1;
|
||||
initialULBWPstartSymbolAndLength_1 = 52; # this is SS=10 L=4
|
||||
|
||||
initialULBWPk2_2 = 7; # used for Msg.3 during RA
|
||||
initialULBWPmappingType_2 = 1;
|
||||
initialULBWPstartSymbolAndLength_2 = 52; # this is SS=10 L=4
|
||||
|
||||
msg3_DeltaPreamble = 1;
|
||||
p0_NominalWithGrant =-90;
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
@@ -258,7 +258,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 = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ gNBs =
|
||||
////////// Physical parameters:
|
||||
|
||||
ssb_SubcarrierOffset = 0;
|
||||
pdsch_AntennaPorts = 1;
|
||||
pdsch_AntennaPorts_N1 = 2;
|
||||
pusch_AntennaPorts = 2;
|
||||
|
||||
pdcch_ConfigSIB1 = (
|
||||
@@ -254,7 +254,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 = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -232,7 +232,7 @@ RUs = (
|
||||
bf_weights = [0x00007fff, 0x00007fff];
|
||||
#clock_src = "external";
|
||||
sf_extension = 0
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -261,7 +261,7 @@ RUs = (
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
sf_extension = 0
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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"
|
||||
@@ -265,7 +263,7 @@ RUs = (
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
sf_extension = 0
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
@@ -260,7 +262,7 @@ RUs = (
|
||||
## beamforming 4x4 matrix:
|
||||
#bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000, 0x00000000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x00007fff];
|
||||
sf_extension = 0
|
||||
sdr_addrs = "mgmt_addr=192.168.18.240,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
sdr_addrs = "mgmt_addr=192.168.18.252,addr=192.168.10.2,second_addr=192.168.20.2,clock_source=internal,time_source=internal"
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -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
|
||||
######################################################################
|
||||
|
||||
@@ -997,8 +976,6 @@ include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/RRC")
|
||||
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/PDCP")
|
||||
include_directories("${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/S1AP")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/OSA")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/inc")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/MEM")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/LISTS")
|
||||
include_directories("${OPENAIR2_DIR}/UTIL/FIFO")
|
||||
@@ -1013,8 +990,29 @@ include_directories("${OPENAIR2_DIR}/UTIL/OMV")
|
||||
include_directories("${OPENAIR2_DIR}/RRC/LTE/MESSAGES")
|
||||
include_directories("${OPENAIR_DIR}")
|
||||
|
||||
# Utilities Library
|
||||
# flexran
|
||||
################
|
||||
# Make lfds as a own source code (even if it is a outside library)
|
||||
# only user: Flexran, please don't use lfds in any other component
|
||||
###################################################################
|
||||
|
||||
set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/)
|
||||
file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c)
|
||||
file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c)
|
||||
file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c)
|
||||
file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c)
|
||||
file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c)
|
||||
file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c)
|
||||
file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c)
|
||||
file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c)
|
||||
file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c)
|
||||
file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c)
|
||||
|
||||
add_library(LFDS7
|
||||
${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc}
|
||||
)
|
||||
|
||||
target_include_directories(LFDS7 PRIVATE "${lfds7}")
|
||||
# set the version of protobuf messages, V3 not supported yet
|
||||
add_list1_option(FLPT_VERSION V2 "FLPT MSG protobuf grammar version" V2 V3)
|
||||
|
||||
@@ -1062,6 +1060,9 @@ add_library(FLPT_MSG
|
||||
${FLPT_OAI_generated}
|
||||
${FLPT_source}
|
||||
)
|
||||
target_link_libraries(FLPT_MSG LFDS7)
|
||||
add_dependencies(FLPT_MSG LFDS7)
|
||||
|
||||
set(FLPT_MSG_LIB FLPT_MSG)
|
||||
#message("prpt c dir is : ${FLPT_C_DIR}")
|
||||
include_directories (${FLPT_C_DIR})
|
||||
@@ -1073,6 +1074,7 @@ add_library(ASYNC_IF
|
||||
${OPENAIR2_DIR}/UTIL/ASYNC_IF/ringbuffer_queue.c
|
||||
)
|
||||
set(ASYNC_IF_LIB ASYNC_IF)
|
||||
target_include_directories(ASYNC_IF PRIVATE "${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
|
||||
include_directories(${OPENAIR2_DIR}/UTIL/ASYNC_IF)
|
||||
|
||||
add_library(FLEXRAN_AGENT
|
||||
@@ -1095,7 +1097,9 @@ add_library(FLEXRAN_AGENT
|
||||
${OPENAIR2_DIR}/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_slice_verification.c
|
||||
${OPENAIR2_DIR}/ENB_APP/flexran_agent_app.c
|
||||
)
|
||||
add_dependencies(FLEXRAN_AGENT rrc_flag)
|
||||
add_dependencies(FLEXRAN_AGENT rrc_flag ASYNC_IF)
|
||||
target_link_libraries(FLEXRAN_AGENT ASYNC_IF LFDS7)
|
||||
target_include_directories(FLEXRAN_AGENT PRIVATE "${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/inc")
|
||||
set(FLEXRAN_AGENT_LIB FLEXRAN_AGENT)
|
||||
add_library(flapp_sample SHARED
|
||||
${OPENAIR2_DIR}/ENB_APP/flexran_apps/sample.c
|
||||
@@ -1159,6 +1163,10 @@ set(PROTOBUF_LIB "protobuf-c")
|
||||
|
||||
#set(PROTOBUF_LIB "protobuf") #for Cpp
|
||||
|
||||
###########
|
||||
# Utilities
|
||||
###############
|
||||
|
||||
add_library(HASHTABLE
|
||||
${OPENAIR_DIR}/common/utils/hashtable/hashtable.c
|
||||
${OPENAIR_DIR}/common/utils/hashtable/obj_hashtable.c
|
||||
@@ -1781,7 +1789,6 @@ set(L2_SRC
|
||||
${PDCP_DIR}/pdcp_primitives.c
|
||||
${PDCP_DIR}/pdcp_util.c
|
||||
${PDCP_DIR}/pdcp_security.c
|
||||
${PDCP_DIR}/pdcp_netlink.c
|
||||
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
|
||||
# ${RRC_DIR}/rrc_UE.c
|
||||
${RRC_DIR}/rrc_eNB.c
|
||||
@@ -1836,7 +1843,6 @@ set(L2_SRC_UE
|
||||
${PDCP_DIR}/pdcp_primitives.c
|
||||
${PDCP_DIR}/pdcp_util.c
|
||||
${PDCP_DIR}/pdcp_security.c
|
||||
${PDCP_DIR}/pdcp_netlink.c
|
||||
${RRC_DIR}/rrc_UE.c
|
||||
${RRC_DIR}/rrc_common.c
|
||||
${RRC_DIR}/L2_interface_common.c
|
||||
@@ -2378,43 +2384,6 @@ add_library(LIB_5GNAS_GNB
|
||||
)
|
||||
target_link_libraries(LIB_5GNAS_GNB SECU_CN ${CRYPTO_LIBRARIES})
|
||||
|
||||
# Make lfds as a own source code (even if it is a outside library)
|
||||
# For better intergration with compilation flags & structure of cmake
|
||||
###################################################################
|
||||
set(lfds ${OPENAIR2_DIR}/UTIL/LFDS/liblfds6.1.1/liblfds611/src/)
|
||||
file(GLOB lfds_queue ${lfds}/lfds611_queue/*.c)
|
||||
file(GLOB lfds_ring ${lfds}/lfds611_ringbuffer/*.c)
|
||||
file(GLOB lfds_slist ${lfds}/lfds611_slist/*.c)
|
||||
file(GLOB lfds_stack ${lfds}/lfds611_stack/*.c)
|
||||
file(GLOB lfds_freelist ${lfds}/lfds611_freelist/*.c)
|
||||
|
||||
include_directories(${lfds})
|
||||
add_library(LFDS
|
||||
${lfds_queue} ${lfds_ring} ${lfds_slist} ${lfds_stack} ${lfds_freelist}
|
||||
${lfds}/lfds611_liblfds/lfds611_liblfds_abstraction_test_helpers.c
|
||||
${lfds}/lfds611_liblfds/lfds611_liblfds_aligned_free.c
|
||||
${lfds}/lfds611_liblfds/lfds611_liblfds_aligned_malloc.c
|
||||
${lfds}/lfds611_abstraction/lfds611_abstraction_free.c
|
||||
${lfds}/lfds611_abstraction/lfds611_abstraction_malloc.c
|
||||
)
|
||||
|
||||
set(lfds7 ${OPENAIR2_DIR}/UTIL/LFDS/liblfds7.0.0/liblfds700/src/)
|
||||
file(GLOB lfds7_queue ${lfds7}/lfds700_queue/*.c)
|
||||
file(GLOB lfds7_ring ${lfds7}/lfds700_ringbuffer/*.c)
|
||||
file(GLOB lfds7_qbss ${lfds7}/lfds700_queue_bounded_singleconsumer_singleproducer/*.c)
|
||||
file(GLOB lfds7_stack ${lfds7}/lfds700_stack/*.c)
|
||||
file(GLOB lfds7_freelist ${lfds7}/lfds700_freelist/*.c)
|
||||
file(GLOB lfds7_btree ${lfds7}/lfds700_btree_addonly_unbalanced/*.c)
|
||||
file(GLOB lfds7_hash ${lfds7}/lfds700_hash_addonly/*.c)
|
||||
file(GLOB lfds7_ordered_list ${lfds7}/lfds700_list_addonly_ordered_singlylinked/*.c)
|
||||
file(GLOB lfds7_unordered_list ${lfds7}/lfds700_list_addonly_singlylinked_unordered/*.c)
|
||||
file(GLOB lfds7_misc ${lfds7}/lfds700_misc/*.c)
|
||||
|
||||
include_directories(${lfds7})
|
||||
add_library(LFDS7
|
||||
${lfds7_queue} ${lfds7_ring} ${lfds7_qbss} ${lfds7_stack} ${lfds7_freelist} ${lfds7_btree} ${lfds7_hash} ${lfds7_ordered_list} ${lfds7_unordered_list} ${lfds7_misc}
|
||||
)
|
||||
|
||||
add_library(SIMU_COMMON
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/random_channel.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/rangen_double.c
|
||||
@@ -2604,8 +2573,8 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
|
||||
target_link_libraries (lte-softmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U F1AP_LIB F1AP SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -2644,8 +2613,8 @@ target_link_libraries (ocp-enb
|
||||
-Wl,--start-group
|
||||
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
|
||||
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU_COMMON
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
|
||||
@@ -2702,8 +2671,8 @@ target_link_libraries (lte-uesoftmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
|
||||
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
|
||||
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
|
||||
PHY_UE PHY_RU L2_UE L2_LTE SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -2741,8 +2710,8 @@ add_executable(nr-softmodem
|
||||
|
||||
target_link_libraries (nr-softmodem
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
|
||||
ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
@@ -2781,11 +2750,11 @@ add_executable(nr-uesoftmodem
|
||||
target_link_libraries (nr-uesoftmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES}
|
||||
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
|
||||
${RAL_LIB} ${NAS_UE_LIB} ITTI ${FLPT_MSG_LIB} ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
@@ -2813,7 +2782,7 @@ add_executable(dlsim_tm4
|
||||
${T_SOURCE}
|
||||
)
|
||||
target_link_libraries (dlsim_tm4
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY LFDS ITTI -Wl,--end-group
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB PHY ITTI -Wl,--end-group
|
||||
pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${T_LIB}
|
||||
)
|
||||
|
||||
@@ -2977,7 +2946,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
)
|
||||
target_link_libraries (${myExe}
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ITTI LFDS7 -Wl,--end-group
|
||||
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU ITTI -Wl,--end-group
|
||||
pthread m rt CONFIG_LIB ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
|
||||
)
|
||||
|
||||
@@ -2999,7 +2968,7 @@ foreach(myExe s1ap
|
||||
${OPENAIR3_DIR}/TEST/test_${myExe}.c
|
||||
)
|
||||
target_link_libraries (test_${myExe}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB
|
||||
-Wl,--start-group SECU_CN UTIL -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} CONFIG_LIB
|
||||
)
|
||||
endforeach(myExe)
|
||||
|
||||
@@ -3019,13 +2988,12 @@ 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 ASYNC_IF 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
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
|
||||
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
|
||||
CN_UTILS GTPV1U SCTP_CLIENT MME_APP LIB_NAS_UE NB_IoT SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
|
||||
ldpc_orig ldpc_optim ldpc_optim8seg ldpc dfts)
|
||||
if (TARGET ${i})
|
||||
add_dependencies(${i} generate_T)
|
||||
@@ -3129,8 +3097,8 @@ add_executable(nr-ittisim
|
||||
|
||||
target_link_libraries (nr-ittisim
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
ITTI ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
|
||||
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
|
||||
ITTI ${FLPT_MSG_LIB} ${FLEXRAN_AGENT_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
|
||||
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${FSPT_MSG_LIB}
|
||||
PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE
|
||||
|
||||
@@ -1093,10 +1093,10 @@
|
||||
(Test8: 217 PRB 100 PDSCH-PRBs 110 PDSCH-Offset),
|
||||
(Test9: 106 PRBs 50 PDSCH-PRBs MCS Index 27),
|
||||
(Test10: 106 PRBs 50 PDSCH-PRBs MCS Index 16),
|
||||
(Test11: 106 MCS-TABLE 256 QAM MCS Index 26),
|
||||
(Test12: HARQ test 25% TP (4 rounds),
|
||||
(Test13: HARQ test 33% TP (3 rounds),
|
||||
(Test14: HARQ test 50% TP (2 rounds),
|
||||
(Test11: 106 MCS-TABLE 256 QAM MCS Index 27),
|
||||
(Test12: HARQ test 25% TP 4 rounds),
|
||||
(Test13: HARQ test 33% TP 3 rounds),
|
||||
(Test14: HARQ test 50% TP 2 rounds),
|
||||
(Test15: 3 PTRS, 8 Interpolated Symbols),
|
||||
(Test16: 6 PTRS, 5 Interpolated Symbols),
|
||||
(Test17: 11 PTRS, 0 Interpolated Symbols),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -346,7 +346,7 @@ typedef struct {
|
||||
@param format data format (0 = real 16-bit, 1 = complex 16-bit,2 real 32-bit, 3 complex 32-bit,4 = real 8-bit, 5 = complex 8-bit)
|
||||
@param multiVec create new file or append to existing (useful for writing multiple vectors to same file. Just call the function multiple times with same file name and with this parameter set to 1)
|
||||
*/
|
||||
#define MATLAB_RAW (1<<31)
|
||||
#define MATLAB_RAW (1U<<31)
|
||||
#define MATLAB_SHORT 0
|
||||
#define MATLAB_CSHORT 1
|
||||
#define MATLAB_INT 2
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -521,7 +521,6 @@ int get_subband_size(int NPRB,int size) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
// from start symbol index and nb or symbols to symbol occupation bitmap in a slot
|
||||
uint16_t SL_to_bitmap(int startSymbolIndex, int nrOfSymbols) {
|
||||
return ((1<<nrOfSymbols)-1)<<startSymbolIndex;
|
||||
@@ -543,5 +542,4 @@ void SLIV2SL(int SLIV,int *S,int *L) {
|
||||
*L=15-SLIVdiv14;
|
||||
*S=13-SLIVmod14;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
```
|
||||
@@ -18,6 +18,10 @@ The UE executable is able to "simulate" multiple UEs in order to stimulate the s
|
||||
|
||||
**This simulator is available starting the `v1.0.0` release on the `master` branch.**
|
||||
|
||||
**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.**
|
||||
|
||||
**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.**
|
||||
|
||||
Currently the Continuous Integration process is validating this simulator the following way:
|
||||
|
||||
* the LTE modem executable is run on one host (in our CI deployment it is a **Xenial Virtual Machine**)
|
||||
@@ -31,6 +35,17 @@ Normally it should be fine to run both executables on the same host using the `l
|
||||
1. [With S1 -- eNB and UE on 2 hosts](L2NFAPI_S1.md)
|
||||
2. [No S1 -- eNB and UE on 2 hosts](L2NFAPI_NOS1.md)
|
||||
|
||||
|
||||
**2022/03/08: Starting the `2022.w01` tag on the `develop` branch, the L2 nFAPI simulation is using a proxy.**
|
||||
|
||||
A tutorial is available on the [EpiSci GitHub Repository](https://github.com/EpiSci/oai-lte-5g-multi-ue-proxy#readme).
|
||||
|
||||
This proxy allows to perform L2 nFAPI simulator for:
|
||||
|
||||
* LTE
|
||||
* 5G-NSA
|
||||
* 5G-SA
|
||||
|
||||
----
|
||||
|
||||
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.**
|
||||
|
||||
**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.**
|
||||
|
||||
## Table of Contents ##
|
||||
|
||||
1. [Environment](#1-environment)
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
**2022/03/08: CAUTION, THIS TUTORIAL IS NO LONGER VALID on the `develop` branch after the `2022.w01` tag.**
|
||||
|
||||
**2022/03/08: CAUTION, THE LAST VALID TAG on `develop` branch is `2021.w51_c`.**
|
||||
|
||||
## Table of Contents ##
|
||||
|
||||
1. [Environment](#1-environment)
|
||||
|
||||
+1
-5
@@ -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.
|
||||
@@ -33,7 +29,7 @@ It is planned to enhance this simulator with the following functionalities:
|
||||
|
||||
This simulator connects a eNodeB and UEs through a nfapi interface, short-cutting the L1 layer. The objective of this simulator is to allow multi UEs simulation, with a large number of UEs (ideally up to 255 ) .Here to ease the platform setup, UEs are simulated via a single `lte-uesoftmodem` instance. Today the CI tests just with one UE and architecture has to be reviewed to allow a number of UE above about 16. This work is on-going.
|
||||
|
||||
As for the rf simulator, no specific hardware is required. The [L2 nfapi simlator page](L2NFAPI.md) contains the detailed documentation.
|
||||
As for the rf simulator, no specific hardware is required. The [L2 nfapi simulator page](L2NFAPI.md) contains the detailed documentation.
|
||||
|
||||
# L1 Simulator
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
+26
-14
@@ -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>
|
||||
@@ -177,15 +176,14 @@ void rx_func(void *param) {
|
||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||
int j;
|
||||
for (j = 0; j < NUMBER_OF_NR_ULSCH_MAX; j++)
|
||||
if (gNB->ulsch[j][0]->rnti == rnti_to_remove[i]) {
|
||||
gNB->ulsch[j][0]->rnti = 0;
|
||||
gNB->ulsch[j][0]->harq_mask = 0;
|
||||
//clean_gNB_ulsch(gNB->ulsch[j][0]);
|
||||
if (gNB->ulsch[j]->rnti == rnti_to_remove[i]) {
|
||||
gNB->ulsch[j]->rnti = 0;
|
||||
gNB->ulsch[j]->harq_mask = 0;
|
||||
int h;
|
||||
for (h = 0; h < NR_MAX_ULSCH_HARQ_PROCESSES; h++) {
|
||||
gNB->ulsch[j][0]->harq_processes[h]->status = SCH_IDLE;
|
||||
gNB->ulsch[j][0]->harq_processes[h]->round = 0;
|
||||
gNB->ulsch[j][0]->harq_processes[h]->handled = 0;
|
||||
gNB->ulsch[j]->harq_processes[h]->status = SCH_IDLE;
|
||||
gNB->ulsch[j]->harq_processes[h]->round = 0;
|
||||
gNB->ulsch[j]->harq_processes[h]->handled = 0;
|
||||
}
|
||||
up_removed++;
|
||||
}
|
||||
@@ -210,7 +208,6 @@ void rx_func(void *param) {
|
||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||
|
||||
// RX processing
|
||||
int tx_slot_type = nr_slot_select(cfg,frame_tx,slot_tx);
|
||||
int rx_slot_type = nr_slot_select(cfg,frame_rx,slot_rx);
|
||||
if (rx_slot_type == NR_UPLINK_SLOT || rx_slot_type == NR_MIXED_SLOT) {
|
||||
// UE-specific RX processing for subframe n
|
||||
@@ -244,7 +241,8 @@ void rx_func(void *param) {
|
||||
gNB->if_inst->NR_UL_indication(&gNB->UL_INFO);
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
stop_meas(&gNB->ul_indication_stats);
|
||||
|
||||
|
||||
int tx_slot_type = nr_slot_select(cfg,frame_rx,slot_tx);
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
|
||||
notifiedFIFO_elt_t *res;
|
||||
processingData_L1tx_t *syncMsg;
|
||||
@@ -256,8 +254,17 @@ void rx_func(void *param) {
|
||||
syncMsg->timestamp_tx = info->timestamp_tx;
|
||||
res->key = slot_tx;
|
||||
pushTpool(gNB->threadPool, res);
|
||||
} else if (get_softmodem_params()->continuous_tx) {
|
||||
notifiedFIFO_elt_t *res = pullTpool(gNB->L1_tx_free, gNB->threadPool);
|
||||
processingData_L1tx_t *syncMsg = (processingData_L1tx_t *)NotifiedFifoData(res);
|
||||
syncMsg->gNB = gNB;
|
||||
syncMsg->timestamp_tx = info->timestamp_tx;
|
||||
syncMsg->frame = frame_tx;
|
||||
syncMsg->slot = slot_tx;
|
||||
res->key = slot_tx;
|
||||
pushNotifiedFIFO(gNB->L1_tx_out, res);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
LOG_D(PHY, "rxtx:%lld nfapi:%lld phy:%lld tx:%lld rx:%lld prach:%lld ofdm:%lld ",
|
||||
softmodem_stats_rxtx_sf.diff_now, nfapi_meas.diff_now,
|
||||
@@ -395,7 +402,11 @@ void *tx_reorder_thread(void* param) {
|
||||
syncMsgRU.slot_tx = syncMsgL1->slot;
|
||||
syncMsgRU.timestamp_tx = syncMsgL1->timestamp_tx;
|
||||
syncMsgRU.ru = gNB->RU_list[0];
|
||||
next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx);
|
||||
if (get_softmodem_params()->continuous_tx) {
|
||||
int slots_per_frame = gNB->frame_parms.slots_per_frame;
|
||||
next_tx_slot = (syncMsgRU.slot_tx + 1) % slots_per_frame;
|
||||
} else
|
||||
next_tx_slot = get_next_downlink_slot(gNB, &gNB->gNB_config, syncMsgRU.frame_tx, syncMsgRU.slot_tx);
|
||||
pushNotifiedFIFO(gNB->L1_tx_free, resL1);
|
||||
if (resL1==resL1Reserve)
|
||||
resL1Reserve=NULL;
|
||||
@@ -506,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
|
||||
|
||||
+34
-27
@@ -703,46 +703,53 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
nfapi_nr_config_request_scf_t *cfg = &ru->config;
|
||||
void *txp[ru->nb_tx];
|
||||
unsigned int txs;
|
||||
int i,txsymb=fp->symbols_per_slot;
|
||||
int i;
|
||||
T(T_ENB_PHY_OUTPUT_SIGNAL, T_INT(0), T_INT(0), T_INT(frame), T_INT(slot),
|
||||
T_INT(0), T_BUFFER(&ru->common.txdata[0][fp->get_samples_slot_timestamp(slot,fp,0)], fp->samples_per_subframe * 4));
|
||||
int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
|
||||
int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
|
||||
int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
|
||||
int sf_extension = 0;
|
||||
int siglen=fp->get_samples_per_slot(slot,fp);
|
||||
int flags=1;
|
||||
int flags = 0;
|
||||
|
||||
//nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
|
||||
if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) {
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD) {
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
txsymb = 0;
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD && !get_softmodem_params()->continuous_tx) {
|
||||
int slot_type = nr_slot_select(cfg,frame,slot%fp->slots_per_frame);
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
int txsymb = 0;
|
||||
|
||||
for(int symbol_count = 0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
|
||||
txsymb++;
|
||||
}
|
||||
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags = 3; // end of burst
|
||||
for(int symbol_count = 0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
|
||||
txsymb++;
|
||||
}
|
||||
|
||||
if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT) {
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags = 3; // end of burst
|
||||
} else if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
int prevslot_type = nr_slot_select(cfg,frame,(slot+(fp->slots_per_frame-1))%fp->slots_per_frame);
|
||||
int nextslot_type = nr_slot_select(cfg,frame,(slot+1)%fp->slots_per_frame);
|
||||
if (prevslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 2; // start of burst
|
||||
sf_extension = ru->sf_extension;
|
||||
}
|
||||
if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT)
|
||||
} else if (nextslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 3; // end of burst
|
||||
} else {
|
||||
flags = 1; // middle of burst
|
||||
}
|
||||
}
|
||||
} else { // FDD
|
||||
if (proc->first_tx == 1) {
|
||||
flags = 2; // start of burst
|
||||
} else {
|
||||
flags = 1; // middle of burst
|
||||
}
|
||||
}
|
||||
|
||||
if (flags) {
|
||||
if (fp->freq_range==nr_FR2) {
|
||||
// the beam index is written in bits 8-10 of the flags
|
||||
// bit 11 enables the gpio programming
|
||||
|
||||
+5
-4
@@ -18,7 +18,8 @@
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include <pthread.h>
|
||||
#include <openair1/PHY/impl_defs_top.h>
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
@@ -1125,9 +1126,8 @@ void *UE_thread(void *arg) {
|
||||
}
|
||||
|
||||
int flags = 0;
|
||||
int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH;
|
||||
|
||||
if (openair0_cfg[0].duplex_mode == duplex_mode_TDD) {
|
||||
if (openair0_cfg[0].duplex_mode == duplex_mode_TDD && !get_softmodem_params()->continuous_tx) {
|
||||
|
||||
uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots;
|
||||
int nrofUplinkSlots, nrofUplinkSymbols;
|
||||
@@ -1139,8 +1139,9 @@ void *UE_thread(void *arg) {
|
||||
nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
|
||||
nrofUplinkSymbols = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSymbols;
|
||||
}
|
||||
uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0);
|
||||
|
||||
int slot_tx_usrp = slot_nr + DURATION_RX_TO_TX - NR_RX_NB_TH;
|
||||
uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSymbols != 0);
|
||||
uint8_t first_tx_slot = tdd_period - num_UL_slots;
|
||||
|
||||
if (slot_tx_usrp % tdd_period == first_tx_slot)
|
||||
|
||||
@@ -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,12 +93,13 @@ 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"
|
||||
#define CONFIG_HLP_NFAPI "Change the nFAPI mode for NR\n"
|
||||
#define CONFIG_L1_EMULATOR "Run in L1 emulated mode (disable PHY layer)\n"
|
||||
#define CONFIG_HLP_CONTINUOUS_TX "perform continuous transmission, even in TDD mode (to work around USRP issues)\n"
|
||||
|
||||
/*-----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
@@ -126,6 +127,7 @@ extern "C"
|
||||
#define NODE_NUMBER softmodem_params.node_number
|
||||
#define NON_STOP softmodem_params.non_stop
|
||||
#define EMULATE_L1 softmodem_params.emulate_l1
|
||||
#define CONTINUOUS_TX softmodem_params.continuous_tx
|
||||
|
||||
#define DEFAULT_RFCONFIG_FILE "/usr/local/etc/syriq/ue.band7.tm1.PRB100.NR40.dat";
|
||||
|
||||
@@ -154,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}, \
|
||||
@@ -163,7 +164,8 @@ extern int usrp_tx_thread;
|
||||
{"do-prb-interpolation", CONFIG_HLP_PRBINTER, PARAMFLAG_BOOL, iptr:&PRB_INTERPOLATION, defintval:0, TYPE_INT, 0}, \
|
||||
{"nfapi", CONFIG_HLP_NFAPI, 0, u8ptr:&nfapi_mode, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"non-stop", CONFIG_HLP_NONSTOP, PARAMFLAG_BOOL, iptr:&NON_STOP, defintval:0, TYPE_INT, 0}, \
|
||||
{"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0} \
|
||||
{"emulate-l1", CONFIG_L1_EMULATOR, PARAMFLAG_BOOL, iptr:&EMULATE_L1, defintval:0, TYPE_INT, 0}, \
|
||||
{"continuous-tx", CONFIG_HLP_CONTINUOUS_TX,PARAMFLAG_BOOL, iptr:&CONTINUOUS_TX, defintval:0, TYPE_INT, 0}, \
|
||||
}
|
||||
|
||||
#define CONFIG_HLP_NSA "Enable NSA mode \n"
|
||||
@@ -201,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)
|
||||
@@ -218,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)
|
||||
@@ -254,6 +254,7 @@ typedef struct {
|
||||
uint16_t node_number;
|
||||
int non_stop;
|
||||
int emulate_l1;
|
||||
int continuous_tx;
|
||||
} softmodem_params_t;
|
||||
|
||||
extern uint64_t get_softmodem_optmask(void);
|
||||
|
||||
@@ -117,7 +117,7 @@ int test_ldpc(short No_iteration,
|
||||
sigma = 1.0/sqrt(2*SNR);
|
||||
opp_enabled=1;
|
||||
//short test_input[block_length];
|
||||
unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
|
||||
unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
|
||||
//short *c; //padded codeword
|
||||
unsigned char estimated_output[MAX_NUM_DLSCH_SEGMENTS][block_length];
|
||||
memset(estimated_output, 0, sizeof(estimated_output));
|
||||
|
||||
@@ -72,10 +72,10 @@ unsigned int crcbit (unsigned char * inputptr,
|
||||
unsigned int i, crc = 0, c;
|
||||
|
||||
while (octetlen-- > 0) {
|
||||
c = (*inputptr++) << 24;
|
||||
c = ((unsigned int)(*inputptr++)) << 24;
|
||||
|
||||
for (i = 8; i != 0; i--) {
|
||||
if ((1 << 31) & (c ^ crc))
|
||||
if ((1U << 31) & (c ^ crc))
|
||||
crc = (crc << 1) ^ poly;
|
||||
else
|
||||
crc <<= 1;
|
||||
|
||||
@@ -57,7 +57,7 @@ typedef struct {
|
||||
/// Number of "Filler" bits
|
||||
uint32_t F;
|
||||
/// LDPC-code outputs
|
||||
uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS];
|
||||
uint8_t *d[MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS];
|
||||
} encoder_implemparams_t;
|
||||
#define INIT0_LDPCIMPLEMPARAMS {0,0,0,NULL,NULL,NULL,NULL}
|
||||
typedef void(*nrLDPC_initcallfunc_t)(t_nrLDPC_dec_params *p_decParams, int8_t *p_llr, int8_t *p_out);
|
||||
|
||||
@@ -63,11 +63,6 @@ int32_t nr_segmentation(unsigned char *input_buffer,
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((*C)>MAX_NUM_NR_DLSCH_SEGMENTS) {
|
||||
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
// Find K+
|
||||
Kprime = Bprime/(*C);
|
||||
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
|
||||
+446
-23
@@ -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
|
||||
@@ -117,12 +521,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
gNB->bad_pucch = 0;
|
||||
|
||||
// ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK)
|
||||
int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1;
|
||||
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
pdcch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot);
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(pdcch_dmrs_init_length*sizeof(uint32_t));
|
||||
LOG_D(PHY,"pdcch_dmrs[%d][%d] %p\n",slot,symb,pdcch_dmrs[slot][symb]);
|
||||
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
@@ -136,16 +543,19 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
gNB->nr_gold_pdsch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
|
||||
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
|
||||
|
||||
// ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
|
||||
int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
|
||||
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
|
||||
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *));
|
||||
pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *));
|
||||
AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
|
||||
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++) {
|
||||
pdsch_dmrs[slot][symb][q] = (uint32_t *)malloc16(NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
for (int q=0; q<nb_codewords; q++) {
|
||||
pdsch_dmrs[slot][symb][q] = (uint32_t *)malloc16(pdsch_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(pdsch_dmrs[slot][symb][q]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d codeword %d - malloc failed\n", slot, symb, q);
|
||||
}
|
||||
}
|
||||
@@ -158,6 +568,8 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
uint32_t ****pusch_dmrs = gNB->nr_gold_pusch_dmrs;
|
||||
|
||||
// ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
|
||||
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
|
||||
for(int nscid=0; nscid<2; nscid++) {
|
||||
pusch_dmrs[nscid] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
AssertFatal(pusch_dmrs[nscid]!=NULL, "NR init: pusch_dmrs for nscid %d - malloc failed\n", nscid);
|
||||
@@ -167,7 +579,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
AssertFatal(pusch_dmrs[nscid][slot]!=NULL, "NR init: pusch_dmrs for slot %d - malloc failed\n", slot);
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pusch_dmrs[nscid][slot][symb] = (uint32_t *)malloc16(NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
pusch_dmrs[nscid][slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(pusch_dmrs[nscid][slot][symb]!=NULL, "NR init: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
@@ -182,12 +594,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
|
||||
AssertFatal(csi_rs!=NULL, "NR init: csi reference signal malloc failed\n");
|
||||
|
||||
// ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32)
|
||||
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
|
||||
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
csi_rs[slot][symb] = (uint32_t *)malloc16(NR_MAX_CSI_RS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
@@ -196,6 +611,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
|
||||
for (int id=0; id<NUMBER_OF_NR_SRS_MAX; id++) {
|
||||
gNB->nr_srs_info[id] = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
|
||||
gNB->nr_srs_info[id]->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
|
||||
gNB->nr_srs_info[id]->srs_generated_signal = (int32_t*)malloc16_clear(fp->ofdm_symbol_size*MAX_NUM_NR_SRS_SYMBOLS*sizeof(int32_t));
|
||||
gNB->nr_srs_info[id]->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||
gNB->nr_srs_info[id]->srs_received_signal = (int32_t **)malloc16(Prx*sizeof(int32_t*));
|
||||
@@ -305,6 +721,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++)
|
||||
@@ -314,9 +740,10 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(pdcch_dmrs);
|
||||
|
||||
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
||||
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
|
||||
for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
|
||||
for (int q = 0; q < nb_codewords; q++)
|
||||
free_and_zero(pdsch_dmrs[slot][symb][q]);
|
||||
free_and_zero(pdsch_dmrs[slot][symb]);
|
||||
}
|
||||
@@ -351,6 +778,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time[i]);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_estimated_channel_time_shifted[i]);
|
||||
}
|
||||
free_and_zero(gNB->nr_srs_info[id]->sc_list);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_generated_signal);
|
||||
free_and_zero(gNB->nr_srs_info[id]->noise_power);
|
||||
free_and_zero(gNB->nr_srs_info[id]->srs_received_signal);
|
||||
@@ -559,9 +987,10 @@ void init_DLSCH_struct(PHY_VARS_gNB *gNB, processingData_L1tx_t *msg) {
|
||||
uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
|
||||
msg->num_pdsch_slot = 0;
|
||||
|
||||
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
|
||||
for (int i=0; i<gNB->number_of_nr_dlsch_max; i++) {
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max);
|
||||
for (int j=0; j<2; j++) {
|
||||
for (int j=0; j<num_cw; j++) {
|
||||
msg->dlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size);
|
||||
AssertFatal(msg->dlsch[i][j]!=NULL,"Can't initialize dlsch %d \n", i);
|
||||
}
|
||||
@@ -573,9 +1002,10 @@ void reset_DLSCH_struct(const PHY_VARS_gNB *gNB, processingData_L1tx_t *msg)
|
||||
const NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
const nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
|
||||
const uint16_t grid_size = cfg->carrier_config.dl_grid_size[fp->numerology_index].value;
|
||||
int num_cw = NR_MAX_NB_LAYERS > 4? 2:1;
|
||||
for (int i=0; i<gNB->number_of_nr_dlsch_max; i++)
|
||||
for (int j=0; j<2; j++)
|
||||
free_gNB_dlsch(&msg->dlsch[i][j], grid_size);
|
||||
for (int j=0; j<num_cw; j++)
|
||||
free_gNB_dlsch(&msg->dlsch[i][j], grid_size, fp);
|
||||
}
|
||||
|
||||
void init_nr_transport(PHY_VARS_gNB *gNB) {
|
||||
@@ -600,22 +1030,16 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
|
||||
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
|
||||
|
||||
for (int j=0; j<2; j++) {
|
||||
// ULSCH for data
|
||||
gNB->ulsch[i][j] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL);
|
||||
|
||||
if (!gNB->ulsch[i][j]) {
|
||||
LOG_E(PHY,"Can't get gNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
gNB->ulsch[i] = new_gNB_ulsch(MAX_LDPC_ITERATIONS, fp->N_RB_UL);
|
||||
|
||||
if (!gNB->ulsch[i]) {
|
||||
LOG_E(PHY,"Can't get gNB ulsch structures\n");
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gNB->rx_total_gain_dB=130;
|
||||
|
||||
|
||||
//fp->pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
}
|
||||
|
||||
@@ -630,6 +1054,5 @@ void reset_nr_transport(PHY_VARS_gNB *gNB)
|
||||
free_gNB_srs(gNB->srs[i]);
|
||||
|
||||
for (int i=0; i<gNB->number_of_nr_ulsch_max; i++)
|
||||
for (int j=0; j<2; j++)
|
||||
free_gNB_ulsch(&gNB->ulsch[i][j], fp->N_RB_UL);
|
||||
free_gNB_ulsch(&gNB->ulsch[i], fp->N_RB_UL);
|
||||
}
|
||||
|
||||
+51
-188
@@ -55,12 +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
|
||||
@@ -72,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 *) );
|
||||
@@ -102,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 );
|
||||
@@ -135,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);
|
||||
@@ -154,21 +152,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp
|
||||
free_and_zero(pdsch->dl_ch_ptrs_estimates_ext);
|
||||
}
|
||||
|
||||
void phy_init_nr_ue_PUSCH(NR_UE_PUSCH *const pusch,
|
||||
const NR_DL_FRAME_PARMS *const fp) {
|
||||
AssertFatal( pusch, "pusch==0" );
|
||||
|
||||
for (int i=0; i<NR_MAX_NB_LAYERS; i++) {
|
||||
pusch->txdataF_layers[i] = (int32_t *)malloc16_clear(NR_MAX_PUSCH_ENCODED_LENGTH*sizeof(int32_t));
|
||||
}
|
||||
}
|
||||
|
||||
void phy_term_nr_ue_PUSCH(NR_UE_PUSCH *pusch)
|
||||
{
|
||||
for (int i = 0; i < NR_MAX_NB_LAYERS; i++)
|
||||
free_and_zero(pusch->txdataF_layers[i]);
|
||||
}
|
||||
|
||||
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
{
|
||||
// create shortcuts
|
||||
@@ -176,13 +159,12 @@ 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,slot,symb, gNB_id, th_id;
|
||||
|
||||
NR_UE_SRS **const srs_vars = ue->srs_vars;
|
||||
|
||||
int i,j,k,l,slot,symb,q;
|
||||
int gNB_id;
|
||||
int th_id;
|
||||
uint32_t ****pusch_dmrs;
|
||||
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);
|
||||
// many memory allocation sizes are hard coded
|
||||
AssertFatal( fp->nb_antennas_rx <= 4, "hard coded allocation for ue_common_vars->dl_ch_estimates[gNB_id]" );
|
||||
@@ -210,15 +192,6 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
// init NR modulation lookup tables
|
||||
nr_generate_modulation_table();
|
||||
|
||||
/////////////////////////PUSCH init/////////////////////////
|
||||
///////////
|
||||
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
for (gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
||||
ue->pusch_vars[th_id][gNB_id] = (NR_UE_PUSCH *)malloc16(sizeof(NR_UE_PUSCH));
|
||||
phy_init_nr_ue_PUSCH( ue->pusch_vars[th_id][gNB_id], fp );
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////PUCCH init/////////////////////////
|
||||
///////////
|
||||
for (th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
@@ -234,21 +207,21 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
/////////////////////////PUSCH DMRS init/////////////////////////
|
||||
///////////
|
||||
ue->nr_gold_pusch_dmrs = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
|
||||
pusch_dmrs = ue->nr_gold_pusch_dmrs;
|
||||
|
||||
// ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
|
||||
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
|
||||
|
||||
ue->nr_gold_pusch_dmrs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs;
|
||||
|
||||
for (slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
pusch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
|
||||
pusch_dmrs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
|
||||
AssertFatal(pusch_dmrs[slot]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d - malloc failed\n", slot);
|
||||
|
||||
for (symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pusch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *));
|
||||
pusch_dmrs[slot][symb] = (uint32_t *)malloc16(pusch_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(pusch_dmrs[slot][symb]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
|
||||
for (q=0; q<NR_MAX_NB_CODEWORDS; q++) {
|
||||
pusch_dmrs[slot][symb][q] = (uint32_t *)malloc16(NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
AssertFatal(pusch_dmrs[slot][symb][q]!=NULL, "init_nr_ue_signal: pusch_dmrs for slot %d symbol %d codeword %d - malloc failed\n", slot, symb, q);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -297,6 +270,8 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
}
|
||||
}
|
||||
|
||||
// ceil(((NB_RB<<1)*3)/32) // 3 RE *2(QPSK)
|
||||
int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1;
|
||||
//PDCCH DMRS init (gNB offset = 0)
|
||||
ue->nr_gold_pdcch[0] = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
|
||||
uint32_t ***pdcch_dmrs = ue->nr_gold_pdcch[0];
|
||||
@@ -307,11 +282,14 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
AssertFatal(pdcch_dmrs[slot]!=NULL, "NR init: pdcch_dmrs for slot %d - malloc failed\n", slot);
|
||||
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
pdcch_dmrs[slot][symb] = (uint32_t *)malloc16(pdcch_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(pdcch_dmrs[slot][symb]!=NULL, "NR init: pdcch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
}
|
||||
}
|
||||
|
||||
// ceil(((NB_RB*6(k)*2(QPSK)/32) // 3 RE *2(QPSK)
|
||||
int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
|
||||
|
||||
//PDSCH DMRS init (eNB offset = 0)
|
||||
ue->nr_gold_pdsch[0] = (uint32_t ****)malloc16(fp->slots_per_frame*sizeof(uint32_t ***));
|
||||
uint32_t ****pdsch_dmrs = ue->nr_gold_pdsch[0];
|
||||
@@ -320,12 +298,13 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
pdsch_dmrs[slot] = (uint32_t ***)malloc16(fp->symbols_per_slot*sizeof(uint32_t **));
|
||||
AssertFatal(pdsch_dmrs[slot]!=NULL, "NR init: pdsch_dmrs for slot %d - malloc failed\n", slot);
|
||||
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(NR_MAX_NB_CODEWORDS*sizeof(uint32_t *));
|
||||
pdsch_dmrs[slot][symb] = (uint32_t **)malloc16(nb_codewords*sizeof(uint32_t *));
|
||||
AssertFatal(pdsch_dmrs[slot][symb]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d - malloc failed\n", slot, symb);
|
||||
|
||||
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++) {
|
||||
pdsch_dmrs[slot][symb][q] = (uint32_t *)malloc16(NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD*sizeof(uint32_t));
|
||||
for (int q=0; q<nb_codewords; q++) {
|
||||
pdsch_dmrs[slot][symb][q] = (uint32_t *)malloc16(pdsch_dmrs_init_length*sizeof(uint32_t));
|
||||
AssertFatal(pdsch_dmrs[slot][symb][q]!=NULL, "NR init: pdsch_dmrs for slot %d symbol %d codeword %d - malloc failed\n", slot, symb, q);
|
||||
}
|
||||
}
|
||||
@@ -347,6 +326,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
srs_vars[gNB_id]->active = false;
|
||||
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
|
||||
ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
|
||||
ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
|
||||
ue->nr_srs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
|
||||
ue->nr_srs_info->srs_received_signal = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
@@ -362,54 +342,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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,7 +364,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 *) );
|
||||
@@ -438,43 +381,16 @@ 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// PBCH
|
||||
pbch_vars[gNB_id]->rxdataF_ext = (int32_t **)malloc16( fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pbch_vars[gNB_id]->rxdataF_comp = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pbch_vars[gNB_id]->dl_ch_estimates = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pbch_vars[gNB_id]->dl_ch_estimates_ext = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pbch_vars[gNB_id]->dl_ch_estimates_time = (int32_t **)malloc16_clear( 4*fp->nb_antennas_rx*sizeof(int32_t *) );
|
||||
pbch_vars[gNB_id]->llr = (int16_t *)malloc16_clear( 1920 ); //
|
||||
// RACH
|
||||
prach_vars[gNB_id]->prachF = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
||||
prach_vars[gNB_id]->prach = (int16_t *)malloc16_clear( sizeof(int)*(7*2*sizeof(int)*(fp->ofdm_symbol_size*12)) );
|
||||
|
||||
for (i=0; i<fp->nb_antennas_rx; i++) {
|
||||
pbch_vars[gNB_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
||||
|
||||
for (j=0; j<4; j++) {//fp->nb_antennas_tx;j++) {
|
||||
int idx = (j*fp->nb_antennas_rx)+i;
|
||||
pbch_vars[gNB_id]->rxdataF_comp[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
||||
pbch_vars[gNB_id]->dl_ch_estimates[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
|
||||
pbch_vars[gNB_id]->dl_ch_estimates_time[idx]= (int32_t *)malloc16_clear( sizeof(int32_t)*7*2*sizeof(int)*(fp->ofdm_symbol_size) );
|
||||
pbch_vars[gNB_id]->dl_ch_estimates_ext[idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*20*12*4 );
|
||||
}
|
||||
}
|
||||
|
||||
pbch_vars[gNB_id]->decoded_output = (uint8_t *)malloc16_clear(64);
|
||||
}
|
||||
|
||||
// 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) );
|
||||
@@ -502,16 +418,12 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
for (int th_id = 0; th_id < RX_NB_TH_MAX; th_id++) {
|
||||
for (int gNB_id = 0; gNB_id < ue->n_connected_gNB; gNB_id++) {
|
||||
phy_term_nr_ue_PUSCH(ue->pusch_vars[th_id][gNB_id]);
|
||||
free_and_zero(ue->pusch_vars[th_id][gNB_id]);
|
||||
free_and_zero(ue->pucch_vars[th_id][gNB_id]);
|
||||
}
|
||||
}
|
||||
|
||||
for (int slot = 0; slot < fp->slots_per_frame; slot++) {
|
||||
for (int symb = 0; symb < fp->symbols_per_slot; symb++) {
|
||||
for (int q = 0; q < NR_MAX_NB_CODEWORDS; q++)
|
||||
free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb][q]);
|
||||
free_and_zero(ue->nr_gold_pusch_dmrs[slot][symb]);
|
||||
}
|
||||
free_and_zero(ue->nr_gold_pusch_dmrs[slot]);
|
||||
@@ -545,9 +457,10 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
}
|
||||
free_and_zero(ue->nr_gold_pdcch[0]);
|
||||
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++)
|
||||
for (int q=0; q<nb_codewords; q++)
|
||||
free_and_zero(ue->nr_gold_pdsch[0][slot][symb][q]);
|
||||
free_and_zero(ue->nr_gold_pdsch[0][slot][symb]);
|
||||
}
|
||||
@@ -559,37 +472,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]);
|
||||
}
|
||||
@@ -601,7 +486,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]);
|
||||
}
|
||||
@@ -612,7 +496,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);
|
||||
@@ -629,6 +512,7 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time[i]);
|
||||
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted[i]);
|
||||
}
|
||||
free_and_zero(ue->nr_srs_info->sc_list);
|
||||
free_and_zero(ue->nr_srs_info->srs_generated_signal);
|
||||
free_and_zero(ue->nr_srs_info->noise_power);
|
||||
free_and_zero(ue->nr_srs_info->srs_received_signal);
|
||||
@@ -640,25 +524,6 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
|
||||
|
||||
free_and_zero(ue->srs_vars[gNB_id]);
|
||||
|
||||
for (int i = 0; i < fp->nb_antennas_rx; i++) {
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext[i]);
|
||||
|
||||
for (int j = 0; j < 4; j++) {
|
||||
int idx = (j*fp->nb_antennas_rx)+i;
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp[idx]);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates[idx]);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time[idx]);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext[idx]);
|
||||
}
|
||||
}
|
||||
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_ext);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->rxdataF_comp);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_ext);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->dl_ch_estimates_time);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->llr);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]->decoded_output);
|
||||
free_and_zero(ue->pbch_vars[gNB_id]);
|
||||
|
||||
free_and_zero(ue->prach_vars[gNB_id]->prachF);
|
||||
@@ -666,13 +531,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);
|
||||
}
|
||||
|
||||
@@ -683,7 +541,8 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
|
||||
for (int j = 0; j < 2; j++) {
|
||||
for (int k = 0; k < RX_NB_TH_MAX; k++) {
|
||||
free_nr_ue_dlsch(&ue->dlsch[k][i][j], N_RB_DL);
|
||||
free_nr_ue_ulsch(&ue->ulsch[k][i][j], N_RB_DL);
|
||||
if (j==0)
|
||||
free_nr_ue_ulsch(&ue->ulsch[k][i], N_RB_DL);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -694,15 +553,19 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
|
||||
free_nr_ue_dlsch(&ue->dlsch_MCH[0], N_RB_DL);
|
||||
}
|
||||
|
||||
void init_nr_ue_transport(PHY_VARS_NR_UE *ue)
|
||||
{
|
||||
void init_nr_ue_transport(PHY_VARS_NR_UE *ue) {
|
||||
|
||||
int num_codeword = NR_MAX_NB_LAYERS > 4? 2:1;
|
||||
|
||||
for (int i = 0; i < NUMBER_OF_CONNECTED_gNB_MAX; i++) {
|
||||
for (int j=0; j<2; j++) {
|
||||
for (int j=0; j<num_codeword; j++) {
|
||||
for (int k=0; k<RX_NB_TH_MAX; k++) {
|
||||
AssertFatal((ue->dlsch[k][i][j] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS,ue->frame_parms.N_RB_DL))!=NULL,"Can't get ue dlsch structures\n");
|
||||
LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]);
|
||||
AssertFatal((ue->ulsch[k][i][j] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n");
|
||||
LOG_D(PHY,"ulsch[%d][%d][%d] => %p\n",k,i,j,ue->ulsch[k][i][j]);
|
||||
if (j==0) {
|
||||
AssertFatal((ue->ulsch[k][i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES))!=NULL,"Can't get ue ulsch structures\n");
|
||||
LOG_D(PHY,"ulsch[%d][%d] => %p\n",k,i,ue->ulsch[k][i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -253,7 +253,6 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
|
||||
LOG_I(PHY,"Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp);
|
||||
|
||||
|
||||
if (Ncp == NFAPI_CP_EXTENDED)
|
||||
AssertFatal(mu == NR_MU_2,"Invalid cyclic prefix %d for numerology index %d\n", Ncp, mu);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -320,98 +320,16 @@ void nr_layer_mapping(int16_t **mod_symbs,
|
||||
}
|
||||
}
|
||||
|
||||
void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
|
||||
void nr_ue_layer_mapping(int16_t *mod_symbs,
|
||||
uint8_t n_layers,
|
||||
uint16_t n_symbs,
|
||||
int16_t **tx_layers)
|
||||
{
|
||||
int16_t *mod_symbs;
|
||||
int16_t **tx_layers) {
|
||||
|
||||
switch (n_layers) {
|
||||
|
||||
case 1:
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
for (int i=0; i<n_symbs; i++) {
|
||||
tx_layers[0][i<<1] = (mod_symbs[i<<1]*AMP)>>15;
|
||||
tx_layers[0][(i<<1)+1] = (mod_symbs[(i<<1)+1]*AMP)>>15;
|
||||
}
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/n_layers; i++) {
|
||||
for (int l=0; l<n_layers; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(n_layers*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((n_layers*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs>>1; i++)
|
||||
for (int l=0; l<2; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[((i<<1)+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<1)+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
|
||||
mod_symbs = (int16_t *)ulsch_ue[1]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/3; i++)
|
||||
for (int l=2; l<5; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(3*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
for (int q=0; q<2; q++) {
|
||||
mod_symbs = (int16_t *)ulsch_ue[q]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/3; i++)
|
||||
for (int l=0; l<3; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(3*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 7:
|
||||
mod_symbs = (int16_t *)ulsch_ue[1]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/3; i++)
|
||||
for (int l=0; l<3; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(3*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((3*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
|
||||
mod_symbs = (int16_t *)ulsch_ue[0]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs/4; i++)
|
||||
for (int l=3; l<7; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[((i<<2)+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<2)+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
break;
|
||||
|
||||
case 8:
|
||||
for (int q=0; q<2; q++) {
|
||||
mod_symbs = (int16_t *)ulsch_ue[q]->d_mod;
|
||||
|
||||
for (int i=0; i<n_symbs>>2; i++)
|
||||
for (int l=0; l<3; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[((i<<2)+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[(((i<<2)+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(0, "Invalid number of layers %d\n", n_layers);
|
||||
for (int i=0; i<n_symbs/n_layers; i++) {
|
||||
for (int l=0; l<n_layers; l++) {
|
||||
tx_layers[l][i<<1] = (mod_symbs[(n_layers*i+l)<<1]*AMP)>>15;
|
||||
tx_layers[l][(i<<1)+1] = (mod_symbs[((n_layers*i+l)<<1)+1]*AMP)>>15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -801,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void nr_layer_mapping(int16_t **mod_symbs,
|
||||
@param[out] tx_layers, modulated symbols for each layer
|
||||
*/
|
||||
|
||||
void nr_ue_layer_mapping(NR_UE_ULSCH_t **ulsch_ue,
|
||||
void nr_ue_layer_mapping(int16_t *mod_symbs,
|
||||
uint8_t n_layers,
|
||||
uint16_t n_symbs,
|
||||
int16_t **tx_layers);
|
||||
@@ -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
|
||||
|
||||
@@ -184,7 +184,7 @@ void nr_gnb_measurements(PHY_VARS_gNB *gNB, uint8_t ulsch_id, unsigned char harq
|
||||
PHY_MEASUREMENTS_gNB *meas = &gNB->measurements;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
int ch_offset = fp->ofdm_symbol_size * symbol;
|
||||
int N_RB_UL = gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu.rb_size;
|
||||
int N_RB_UL = gNB->ulsch[ulsch_id]->harq_processes[harq_pid]->ulsch_pdu.rb_size;
|
||||
|
||||
rx_power_tot[ulsch_id] = 0;
|
||||
|
||||
|
||||
@@ -60,6 +60,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
uint8_t reset;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
uint32_t ***pdcch_dmrs = gNB->nr_gold_pdcch_dmrs;
|
||||
int pdcch_dmrs_init_length = (((fp->N_RB_DL<<1)*3)>>5)+1;
|
||||
|
||||
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
@@ -67,7 +68,7 @@ void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
reset = 1;
|
||||
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid<<1));
|
||||
LOG_D(PHY,"PDCCH DMRS slot %d, symb %d, Nid %d, x2 %x\n",slot,symb,Nid,x2);
|
||||
for (uint32_t n=0; n<NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
for (uint32_t n=0; n<pdcch_dmrs_init_length; n++) {
|
||||
pdcch_dmrs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
@@ -81,11 +82,12 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
{
|
||||
|
||||
uint32_t x1, x2;
|
||||
uint8_t reset, q;
|
||||
uint8_t reset;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
uint32_t ****pdsch_dmrs = gNB->nr_gold_pdsch_dmrs;
|
||||
|
||||
uint16_t N_n_scid[NR_MAX_NB_CODEWORDS]={Nid, Nid}; // Not correct, appropriate scrambling IDs have to be updated to support DCI 1_1
|
||||
int pdsch_dmrs_init_length = ((fp->N_RB_DL*12)>>5)+1;
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
uint16_t N_n_scid[2]={Nid, Nid};
|
||||
uint8_t n_scid=0; // again works only for 1_0
|
||||
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
|
||||
@@ -93,13 +95,13 @@ void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
reset = 1;
|
||||
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
|
||||
LOG_D(PHY,"PDSCH DMRS slot %d, symb %d x2 %x, N_n_scid %d,n_scid %d\n",slot,symb,x2,N_n_scid[n_scid],n_scid);
|
||||
for (uint32_t n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
for (uint32_t n=0; n<pdsch_dmrs_init_length; n++) {
|
||||
pdsch_dmrs[slot][symb][0][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
for (q = 1; q < NR_MAX_NB_CODEWORDS; q++)
|
||||
memcpy(pdsch_dmrs[slot][symb][q],pdsch_dmrs[slot][symb][0],sizeof(uint32_t)*NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD);
|
||||
if(nb_codewords>1)
|
||||
memcpy(pdsch_dmrs[slot][symb][1],pdsch_dmrs[slot][symb][0],sizeof(uint32_t)*pdsch_dmrs_init_length);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,6 +115,7 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) {
|
||||
unsigned int nid;
|
||||
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
|
||||
unsigned short l;
|
||||
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
|
||||
|
||||
for (nscid=0; nscid<2; nscid++) {
|
||||
nid = Nid[nscid];
|
||||
@@ -122,7 +125,7 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, uint32_t *Nid) {
|
||||
x2 = ((1<<17) * (fp->symbols_per_slot*ns+l+1) * ((nid<<1)+1) +((nid<<1)+nscid));
|
||||
LOG_D(PHY,"DMRS slot %d, symb %d x2 %x\n",ns,l,x2);
|
||||
|
||||
for (n=0; n<NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
for (n=0; n<pusch_dmrs_init_length; n++) {
|
||||
gNB->nr_gold_pusch_dmrs[nscid][ns][l][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
@@ -138,6 +141,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
|
||||
uint32_t x1, x2;
|
||||
uint8_t reset;
|
||||
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
|
||||
|
||||
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
|
||||
@@ -145,7 +149,7 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid)
|
||||
reset = 1;
|
||||
x2 = ((1<<10) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
|
||||
|
||||
for (uint32_t n=0; n<NR_MAX_CSI_RS_INIT_LENGTH_DWORD; n++) {
|
||||
for (uint32_t n=0; n<csi_dmrs_init_length; n++) {
|
||||
csi_rs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
|
||||
unsigned char ns,l;
|
||||
unsigned int n,x1,x2,x2tmp0;
|
||||
uint8_t reset;
|
||||
int pdcch_dmrs_init_length = (((ue->frame_parms.N_RB_DL<<1)*3)>>5)+1;
|
||||
|
||||
for (ns=0; ns<ue->frame_parms.slots_per_frame; ns++) {
|
||||
|
||||
@@ -64,9 +65,9 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
|
||||
|
||||
reset = 1;
|
||||
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
|
||||
x2 = (x2tmp0+(nid<<1))%(1<<31); //cinit
|
||||
x2 = (x2tmp0+(nid<<1))%(1U<<31); //cinit
|
||||
|
||||
for (n=0; n<NR_MAX_PDCCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
for (n=0; n<pdcch_dmrs_init_length; n++) {
|
||||
ue->nr_gold_pdcch[0][ns][l][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
@@ -77,28 +78,28 @@ void nr_gold_pdcch(PHY_VARS_NR_UE* ue,
|
||||
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
|
||||
unsigned short *n_idDMRS)
|
||||
{
|
||||
unsigned char l;
|
||||
unsigned int n,x1,x2,x2tmp0,ns;
|
||||
int nscid;
|
||||
|
||||
unsigned int x1,x2,x2tmp0;
|
||||
unsigned int nid;
|
||||
uint8_t reset;
|
||||
|
||||
int pdsch_dmrs_init_length = ((ue->frame_parms.N_RB_DL*12)>>5)+1;
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
/// to be updated from higher layer
|
||||
//unsigned short lbar = 0;
|
||||
|
||||
for (nscid=0; nscid<2; nscid++) {
|
||||
for (ns=0; ns<ue->frame_parms.slots_per_frame; ns++) {
|
||||
for (int nscid=0; nscid<nb_codewords; nscid++) {
|
||||
for (int ns=0; ns<ue->frame_parms.slots_per_frame; ns++) {
|
||||
|
||||
nid = n_idDMRS[nscid];
|
||||
|
||||
for (l=0; l<ue->frame_parms.symbols_per_slot; l++) {
|
||||
for (int l=0; l<ue->frame_parms.symbols_per_slot; l++) {
|
||||
|
||||
reset = 1;
|
||||
x2tmp0 = ((ue->frame_parms.symbols_per_slot*ns+l+1)*((nid<<1)+1))<<17;
|
||||
x2 = (x2tmp0+(nid<<1)+nscid)%(1<<31); //cinit
|
||||
x2 = (x2tmp0+(nid<<1)+nscid)%(1U<<31); //cinit
|
||||
LOG_D(PHY,"UE DMRS slot %d, symb %d, x2 %x, nscid %d\n",ns,l,x2,nscid);
|
||||
|
||||
for (n=0; n<NR_MAX_PDSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
for (int n=0; n<pdsch_dmrs_init_length; n++) {
|
||||
ue->nr_gold_pdsch[0][ns][l][nscid][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
@@ -112,9 +113,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
|
||||
uint8_t n_scid)
|
||||
{
|
||||
uint32_t x1, x2, n;
|
||||
uint8_t reset, slot, symb, q;
|
||||
uint8_t reset, slot, symb;
|
||||
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
uint32_t ****pusch_dmrs = ue->nr_gold_pusch_dmrs;
|
||||
uint32_t ***pusch_dmrs = ue->nr_gold_pusch_dmrs;
|
||||
int pusch_dmrs_init_length = ((fp->N_RB_UL*12)>>5)+1;
|
||||
|
||||
for (slot=0; slot<fp->slots_per_frame; slot++) {
|
||||
|
||||
@@ -123,13 +125,10 @@ void nr_init_pusch_dmrs(PHY_VARS_NR_UE* ue,
|
||||
reset = 1;
|
||||
x2 = ((1<<17) * (fp->symbols_per_slot*slot+symb+1) * ((N_n_scid[n_scid]<<1)+1) +((N_n_scid[n_scid]<<1)+n_scid));
|
||||
|
||||
for (n=0; n<NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD; n++) {
|
||||
pusch_dmrs[slot][symb][0][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
for (n=0; n<pusch_dmrs_init_length; n++) {
|
||||
pusch_dmrs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
for (q = 1; q < NR_MAX_NB_CODEWORDS; q++)
|
||||
memcpy(pusch_dmrs[slot][symb][q],pusch_dmrs[slot][symb][0],sizeof(uint32_t)*NR_MAX_PUSCH_DMRS_INIT_LENGTH_DWORD);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,9 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
int32_t **txdataF = gNB->common_vars.txdataF;
|
||||
int txdataF_offset = slot*frame_parms.samples_per_slot_wCP;
|
||||
uint32_t **gold_csi_rs = gNB->nr_gold_csi_rs[slot];
|
||||
int16_t mod_csi[frame_parms.symbols_per_slot][NR_MAX_CSI_RS_LENGTH>>1] __attribute__((aligned(16)));;
|
||||
//*8(max allocation per RB)*2(QPSK))
|
||||
int csi_rs_length = frame_parms.N_RB_DL<<4;
|
||||
int16_t mod_csi[frame_parms.symbols_per_slot][csi_rs_length>>1] __attribute__((aligned(16)));;
|
||||
uint16_t b = csi_params.freq_domain;
|
||||
uint16_t n, csi_bw, csi_start, p, k, l, mprime, na, kpn, csi_length;
|
||||
uint8_t size, ports, kprime, lprime, i, gs;
|
||||
@@ -59,7 +61,7 @@ void nr_generate_csi_rs(PHY_VARS_gNB *gNB,
|
||||
for (uint8_t symb=0; symb<frame_parms.symbols_per_slot; symb++) {
|
||||
reset = 1;
|
||||
x2 = ((1<<10) * (frame_parms.symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
|
||||
for (uint32_t n=0; n<NR_MAX_CSI_RS_INIT_LENGTH_DWORD; n++) {
|
||||
for (uint32_t n=0; n<(csi_rs_length>>5)+1; n++) {
|
||||
gold_csi_rs[symb][n] = lte_gold_generic(&x1, &x2, reset);
|
||||
reset = 0;
|
||||
}
|
||||
|
||||
@@ -79,10 +79,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
|
||||
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &harq->pdsch_pdu.pdsch_pdu_rel15;
|
||||
uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
|
||||
int16_t **mod_symbs = (int16_t**)dlsch->mod_symbs;
|
||||
int16_t **tx_layers = (int16_t**)dlsch->txdataF;
|
||||
int16_t **txdataF_precoding = (int16_t**)dlsch->txdataF_precoding;
|
||||
int8_t Wf[2], Wt[2], l0, l_prime, l_overline, delta;
|
||||
uint8_t dmrs_Type = rel15->dmrsConfigType;
|
||||
int nb_re_dmrs;
|
||||
@@ -100,6 +98,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers;
|
||||
uint8_t Qm = rel15->qamModOrder[0];
|
||||
uint32_t encoded_length = nb_re*Qm;
|
||||
uint32_t scrambled_output[rel15->NrOfCodewords][(encoded_length>>5)+1];
|
||||
int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
|
||||
|
||||
/* PTRS */
|
||||
@@ -121,8 +120,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
|
||||
/// CRC, coding, interleaving and rate matching
|
||||
AssertFatal(harq->pdu!=NULL,"harq->pdu is null\n");
|
||||
unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS] __attribute__((aligned(32)));
|
||||
bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * 8 * NR_MAX_NB_LAYERS);
|
||||
unsigned char output[rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers] __attribute__((aligned(32)));
|
||||
bzero(output,rel15->rbSize * NR_SYMBOLS_PER_SLOT * NR_NB_SC_PER_RB * Qm * rel15->nrOfLayers);
|
||||
start_meas(dlsch_encoding_stats);
|
||||
|
||||
if (nr_dlsch_encoding(gNB,
|
||||
@@ -147,20 +146,18 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
}
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
/// scrambling
|
||||
start_meas(dlsch_scrambling_stats);
|
||||
for (int q=0; q<rel15->NrOfCodewords; q++)
|
||||
memset((void*)scrambled_output[q], 0, (encoded_length>>5)*sizeof(uint32_t));
|
||||
for (int q=0; q<rel15->NrOfCodewords; q++)
|
||||
for (int q=0; q<rel15->NrOfCodewords; q++) {
|
||||
memset((void*)scrambled_output[q], 0, ((encoded_length>>5)+1)*sizeof(uint32_t));
|
||||
nr_pdsch_codeword_scrambling(output,
|
||||
encoded_length,
|
||||
q,
|
||||
rel15->dataScramblingId,
|
||||
rel15->rnti,
|
||||
scrambled_output[q]);
|
||||
}
|
||||
|
||||
stop_meas(dlsch_scrambling_stats);
|
||||
#ifdef DEBUG_DLSCH
|
||||
@@ -219,6 +216,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
start_sc -= frame_parms->ofdm_symbol_size;
|
||||
|
||||
int txdataF_offset = slot*frame_parms->samples_per_slot_wCP;
|
||||
int16_t **txdataF_precoding = (int16_t **)malloc16(rel15->nrOfLayers*sizeof(int16_t *));
|
||||
for (int layer = 0; layer<rel15->nrOfLayers; layer++)
|
||||
txdataF_precoding[layer] = (int16_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int16_t));
|
||||
|
||||
#ifdef DEBUG_DLSCH_MAPPING
|
||||
printf("PDSCH resource mapping started (start SC %d\tstart symbol %d\tN_PRB %d\tnb_re %d,nb_layers %d)\n",
|
||||
@@ -295,7 +295,7 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
ptrs_symbol = is_ptrs_symbol(l,dlPtrsSymPos);
|
||||
if(ptrs_symbol) {
|
||||
/* PTRS QPSK Modulation for each OFDM symbol in a slot */
|
||||
printf("Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs);
|
||||
LOG_D(PHY,"Doing ptrs modulation for symbol %d, n_ptrs %d\n",l,n_ptrs);
|
||||
nr_modulation(pdsch_dmrs[l][0], (n_ptrs<<1), DMRS_MOD_ORDER, mod_ptrs);
|
||||
}
|
||||
}
|
||||
@@ -439,8 +439,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++) {
|
||||
@@ -457,61 +456,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
|
||||
@@ -535,6 +545,9 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
else {
|
||||
LOG_D(PHY,"beam index for PDSCH allocation already taken\n");
|
||||
}
|
||||
for (int layer = 0; layer<rel15->nrOfLayers; layer++)
|
||||
free16(txdataF_precoding[layer],2*14*frame_parms->ofdm_symbol_size);
|
||||
free16(txdataF_precoding,rel15->nrOfLayers);
|
||||
}// dlsch loop
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,6 @@ void nr_fill_dlsch(processingData_L1tx_t *msgTx,
|
||||
void nr_generate_pdsch(processingData_L1tx_t *msgTx,
|
||||
int frame,
|
||||
int slot);
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
|
||||
|
||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||
|
||||
|
||||
@@ -50,10 +50,14 @@
|
||||
//#define DEBUG_DLSCH_FREE 1
|
||||
|
||||
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
|
||||
int r;
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr,
|
||||
uint16_t N_RB,
|
||||
const NR_DL_FRAME_PARMS* frame_parms) {
|
||||
|
||||
NR_gNB_DLSCH_t *dlsch = *dlschptr;
|
||||
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
|
||||
|
||||
int max_layers = (frame_parms->nb_antennas_tx<NR_MAX_NB_LAYERS) ? frame_parms->nb_antennas_tx : NR_MAX_NB_LAYERS;
|
||||
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*max_layers;
|
||||
|
||||
if (N_RB != 273) {
|
||||
a_segments = a_segments*N_RB;
|
||||
@@ -65,26 +69,30 @@ void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB) {
|
||||
free16(harq->b, a_segments * 1056);
|
||||
harq->b = NULL;
|
||||
}
|
||||
for (r = 0; r < a_segments; r++) {
|
||||
for (int r = 0; r < a_segments; r++) {
|
||||
free(harq->c[r]);
|
||||
harq->c[r] = NULL;
|
||||
}
|
||||
free(harq->c);
|
||||
free(harq->pdu);
|
||||
|
||||
for (int aa = 0; aa < 64; aa++)
|
||||
free(dlsch->calib_dl_ch_estimates[aa]);
|
||||
free(dlsch->calib_dl_ch_estimates);
|
||||
|
||||
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++)
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
for (int q=0; q<nb_codewords; q++)
|
||||
free(dlsch->mod_symbs[q]);
|
||||
free(dlsch->mod_symbs);
|
||||
|
||||
for (int layer = 0; layer < NR_MAX_NB_LAYERS; layer++) {
|
||||
free(dlsch->txdataF_precoding[layer]);
|
||||
for (int layer = 0; layer < max_layers; layer++) {
|
||||
free(dlsch->txdataF[layer]);
|
||||
for (int aa = 0; aa < 64; aa++)
|
||||
free(dlsch->ue_spec_bf_weights[layer][aa]);
|
||||
free(dlsch->ue_spec_bf_weights[layer]);
|
||||
}
|
||||
free(dlsch->txdataF);
|
||||
free(dlsch->ue_spec_bf_weights);
|
||||
|
||||
free(dlsch);
|
||||
*dlschptr = NULL;
|
||||
@@ -96,9 +104,9 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint32_t Nsoft,
|
||||
uint8_t abstraction_flag,
|
||||
uint16_t N_RB) {
|
||||
unsigned char i,r,aa,layer;
|
||||
int re;
|
||||
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS; //number of segments to be allocated
|
||||
|
||||
int max_layers = (frame_parms->nb_antennas_tx<NR_MAX_NB_LAYERS) ? frame_parms->nb_antennas_tx : NR_MAX_NB_LAYERS;
|
||||
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*max_layers; //number of segments to be allocated
|
||||
|
||||
if (N_RB != 273) {
|
||||
a_segments = a_segments*N_RB;
|
||||
@@ -114,31 +122,36 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
|
||||
dlsch->Mlimit = 4;
|
||||
dlsch->Nsoft = Nsoft;
|
||||
|
||||
for (layer=0; layer<NR_MAX_NB_LAYERS; layer++) {
|
||||
int txdataf_size = frame_parms->N_RB_DL*NR_SYMBOLS_PER_SLOT*NR_NB_SC_PER_RB*8; // max pdsch encoded length for each layer
|
||||
|
||||
dlsch->txdataF = (int32_t **)malloc16(max_layers*sizeof(int32_t *));
|
||||
|
||||
dlsch->ue_spec_bf_weights = (int32_t ***)malloc16(max_layers*sizeof(int32_t **));
|
||||
for (int layer=0; layer<max_layers; layer++) {
|
||||
dlsch->ue_spec_bf_weights[layer] = (int32_t **)malloc16(64*sizeof(int32_t *));
|
||||
|
||||
for (aa=0; aa<64; aa++) {
|
||||
for (int aa=0; aa<64; aa++) {
|
||||
dlsch->ue_spec_bf_weights[layer][aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
|
||||
|
||||
for (re=0; re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
|
||||
for (int re=0; re<OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES; re++) {
|
||||
dlsch->ue_spec_bf_weights[layer][aa][re] = 0x00007fff;
|
||||
}
|
||||
}
|
||||
|
||||
dlsch->txdataF[layer] = (int32_t *)malloc16((NR_MAX_PDSCH_ENCODED_LENGTH/NR_MAX_NB_LAYERS)*sizeof(int32_t)); // NR_MAX_NB_LAYERS is already included in NR_MAX_PDSCH_ENCODED_LENGTH
|
||||
dlsch->txdataF_precoding[layer] = (int32_t *)malloc16(2*14*frame_parms->ofdm_symbol_size*sizeof(int32_t));
|
||||
dlsch->txdataF[layer] = (int32_t *)malloc16((txdataf_size)*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (int q=0; q<NR_MAX_NB_CODEWORDS; q++)
|
||||
dlsch->mod_symbs[q] = (int32_t *)malloc16(NR_MAX_PDSCH_ENCODED_LENGTH*sizeof(int32_t));
|
||||
int nb_codewords = NR_MAX_NB_LAYERS > 4 ? 2 : 1;
|
||||
dlsch->mod_symbs = (int32_t **)malloc16(nb_codewords*sizeof(int32_t *));
|
||||
for (int q=0; q<nb_codewords; q++)
|
||||
dlsch->mod_symbs[q] = (int32_t *)malloc16(txdataf_size*max_layers*sizeof(int32_t));
|
||||
|
||||
dlsch->calib_dl_ch_estimates = (int32_t **)malloc16(64*sizeof(int32_t *));
|
||||
|
||||
for (aa=0; aa<64; aa++) {
|
||||
for (int aa=0; aa<64; aa++) {
|
||||
dlsch->calib_dl_ch_estimates[aa] = (int32_t *)malloc16(OFDM_SYMBOL_SIZE_COMPLEX_SAMPLES*sizeof(int32_t));
|
||||
}
|
||||
|
||||
for (i=0; i<20; i++) {
|
||||
for (int i=0; i<20; i++) {
|
||||
dlsch->harq_ids[0][i] = 0;
|
||||
dlsch->harq_ids[1][i] = 0;
|
||||
}
|
||||
@@ -153,7 +166,8 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
|
||||
nr_emulate_dlsch_payload(harq->pdu, (dlsch_bytes) >> 3);
|
||||
bzero(harq->b, dlsch_bytes);
|
||||
|
||||
for (r = 0; r < a_segments; r++) {
|
||||
harq->c = (uint8_t **)malloc16(a_segments*sizeof(uint8_t *));
|
||||
for (int r = 0; r < a_segments; r++) {
|
||||
// account for filler in first segment and CRCs for multiple segment case
|
||||
// [hna] 8448 is the maximum CB size in NR
|
||||
// 68*348 = 68*(maximum size of Zc)
|
||||
@@ -316,6 +330,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
stats->current_Qm = rel15->qamModOrder[0];
|
||||
}
|
||||
|
||||
int max_bytes = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*rel15->nrOfLayers*1056;
|
||||
if (A > 3824) {
|
||||
// Add 24-bit crc (polynomial A) to payload
|
||||
crc = crc24a(a,A)>>8;
|
||||
@@ -326,11 +341,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
//printf("a0 %d a1 %d a2 %d\n", a[A>>3], a[1+(A>>3)], a[2+(A>>3)]);
|
||||
harq->B = A+24;
|
||||
// harq->b = a;
|
||||
AssertFatal((A / 8) + 4 <= MAX_NR_DLSCH_PAYLOAD_BYTES,
|
||||
AssertFatal((A / 8) + 4 <= max_bytes,
|
||||
"A %d is too big (A/8+4 = %d > %d)\n",
|
||||
A,
|
||||
(A / 8) + 4,
|
||||
MAX_NR_DLSCH_PAYLOAD_BYTES);
|
||||
max_bytes);
|
||||
memcpy(harq->b, a, (A / 8) + 4); // why is this +4 if the CRC is only 3 bytes?
|
||||
} else {
|
||||
// Add 16-bit crc (polynomial A) to payload
|
||||
@@ -341,11 +356,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
//printf("a0 %d a1 %d \n", a[A>>3], a[1+(A>>3)]);
|
||||
harq->B = A+16;
|
||||
// harq->b = a;
|
||||
AssertFatal((A / 8) + 3 <= MAX_NR_DLSCH_PAYLOAD_BYTES,
|
||||
AssertFatal((A / 8) + 3 <= max_bytes,
|
||||
"A %d is too big (A/8+3 = %d > %d)\n",
|
||||
A,
|
||||
(A / 8) + 3,
|
||||
MAX_NR_DLSCH_PAYLOAD_BYTES);
|
||||
max_bytes);
|
||||
memcpy(harq->b, a, (A / 8) + 3); // using 3 bytes to mimic the case of 24 bit crc
|
||||
}
|
||||
|
||||
@@ -363,6 +378,11 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
impp.Kb = nr_segmentation(harq->b, harq->c, harq->B, &impp.n_segments, &impp.K, impp.Zc, &impp.F, impp.BG);
|
||||
stop_meas(dlsch_segmentation_stats);
|
||||
|
||||
if (impp.n_segments>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*rel15->nrOfLayers) {
|
||||
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",impp.n_segments,harq->B);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
for (int r=0; r<impp.n_segments; r++) {
|
||||
//d_tmp[r] = &harq->d[r][0];
|
||||
//channel_input[r] = &harq->d[r][0];
|
||||
|
||||
@@ -40,7 +40,7 @@ void nr_codeword_scrambling(uint8_t *in,
|
||||
__m256i c = ((__m256i*)in)[i];
|
||||
uint32_t in32 = _mm256_movemask_epi8(_mm256_slli_epi16(c,7));
|
||||
out[i]=(in32^s);
|
||||
//printf("in[%d] %x => %x\n",i,in32,out[i]);
|
||||
LOG_D(PHY,"in[%d] %x => %x\n",i,in32,out[i]);
|
||||
s=lte_gold_generic(&x1, &x2, 0);
|
||||
}
|
||||
#elif defined(__SSE4__)
|
||||
|
||||
@@ -106,7 +106,7 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t abstraction_flag,
|
||||
uint16_t N_RB);
|
||||
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB);
|
||||
void free_gNB_dlsch(NR_gNB_DLSCH_t **dlschptr, uint16_t N_RB, const NR_DL_FRAME_PARMS* frame_parms);
|
||||
|
||||
/** \brief This function is the top-level entry point to PUSCH demodulation, after frequency-domain transformation and channel estimation. It performs
|
||||
- RB extraction (signal and channel estimates)
|
||||
@@ -146,7 +146,7 @@ void nr_ulsch_extract_rbs_single(int32_t **rxdataF,
|
||||
|
||||
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
NR_gNB_ULSCH_t **ulsch_gNB,
|
||||
NR_gNB_ULSCH_t *ulsch_gNB,
|
||||
uint8_t symbol,
|
||||
uint8_t start_symbol,
|
||||
uint16_t nb_rb,
|
||||
|
||||
@@ -42,15 +42,14 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
for (i=0; i<gNB->number_of_nr_ulsch_max; i++) {
|
||||
AssertFatal(gNB->ulsch[i]!=NULL,"gNB->ulsch[%d] is null\n",i);
|
||||
AssertFatal(gNB->ulsch[i][0]!=NULL,"gNB->ulsch[%d][0] is null\n",i);
|
||||
LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i][0]->harq_mask,gNB->ulsch[i][0]->rnti,first_free_index);
|
||||
if ((gNB->ulsch[i][0]->harq_mask >0) &&
|
||||
(gNB->ulsch[i][0]->rnti==rnti)) return i;
|
||||
else if ((gNB->ulsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
|
||||
LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i]->harq_mask,gNB->ulsch[i]->rnti,first_free_index);
|
||||
if ((gNB->ulsch[i]->harq_mask >0) &&
|
||||
(gNB->ulsch[i]->rnti==rnti)) return i;
|
||||
else if ((gNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
|
||||
}
|
||||
if (type == SEARCH_EXIST) return -1;
|
||||
if (first_free_index != -1)
|
||||
gNB->ulsch[first_free_index][0]->rnti = 0;
|
||||
gNB->ulsch[first_free_index]->rnti = 0;
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
@@ -64,7 +63,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
|
||||
AssertFatal( (ulsch_id>=0) && (ulsch_id<gNB->number_of_nr_ulsch_max),
|
||||
"illegal or no ulsch_id found!!! rnti %04x ulsch_id %d\n",ulsch_pdu->rnti,ulsch_id);
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id][0];
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id];
|
||||
int harq_pid = ulsch_pdu->pusch_data.harq_process_id;
|
||||
ulsch->rnti = ulsch_pdu->rnti;
|
||||
//ulsch->rnti_type;
|
||||
|
||||
@@ -175,7 +175,7 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
//t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS];
|
||||
ulsch->harq_processes[i]->Z=0;
|
||||
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
|
||||
//int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
|
||||
//int16_t e[MAX_NUM_NR_ULSCH_SEGMENTS][3*8448];
|
||||
ulsch->harq_processes[i]->E=0;
|
||||
|
||||
|
||||
@@ -406,7 +406,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
#endif
|
||||
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id][0];
|
||||
NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[ULSCH_id];
|
||||
NR_gNB_PUSCH *pusch = phy_vars_gNB->pusch_vars[ULSCH_id];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
|
||||
|
||||
@@ -532,6 +532,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
&harq_process->F,
|
||||
p_decParams->BG);
|
||||
|
||||
if (harq_process->C>MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*n_layers) {
|
||||
LOG_E(PHY,"nr_segmentation.c: too many segments %d, B %d\n",harq_process->C,harq_process->B);
|
||||
return(-1);
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
|
||||
if (!frame%100)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user