Commit e639e792 authored by Thomas Schlichter's avatar Thomas Schlichter

Merge remote-tracking branch 'origin/develop' into support-15-kHz-SCS

parents 78152934 5bf454c7
...@@ -113,6 +113,21 @@ pipeline { ...@@ -113,6 +113,21 @@ pipeline {
GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' ' GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' '
echo GitPostArgs echo GitPostArgs
//calling SA-AmariS
jobName = "RAN-SA-AmariS-CN5G"
jobStatus = build job: jobName, wait : true, propagate : false, parameters: [
string(name: 'eNB_MR', value: String.valueOf(MR)),
string(name: 'eNB_Branch', value: String.valueOf(SRC_BRANCH)),
string(name: 'eNB_CommitID', value: String.valueOf(COMMIT_ID)),
string(name: 'eNB_TargetBranch', value: String.valueOf(TARGET_BRANCH)),
booleanParam(name: 'eNB_mergeRequest', value: Boolean.valueOf(ALLOW_MERGE))
]
jobResult = jobStatus.getResult()
build_url = jobStatus.getAbsoluteUrl()
build_id = jobStatus.getNumber().toString()
GitPostArgs += jobName + ' ' + build_url + ' ' + build_id + ' ' + jobResult + ' '
echo GitPostArgs
//calling OAIUE N310-X300 //calling OAIUE N310-X300
jobName = "RAN-SA-OAIUE-N310-X300-CN5G" jobName = "RAN-SA-OAIUE-N310-X300-CN5G"
jobStatus = build job: jobName, wait : true, propagate : false, parameters: [ jobStatus = build job: jobName, wait : true, propagate : false, parameters: [
......
...@@ -59,7 +59,7 @@ if [ $# -eq 0 ] ...@@ -59,7 +59,7 @@ if [ $# -eq 0 ]
then then
echo " ---- Checking the whole repository ----" echo " ---- Checking the whole repository ----"
echo "" echo ""
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted || true` NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive --exclude=ci-scripts --exclude=cmake_targets *.c *.h | grep -c Formatted || true`
echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT" echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT"
echo $NB_FILES_TO_FORMAT > ./oai_rules_result.txt echo $NB_FILES_TO_FORMAT > ./oai_rules_result.txt
...@@ -136,7 +136,7 @@ fi ...@@ -136,7 +136,7 @@ fi
# Merge request scenario # Merge request scenario
MERGE_COMMMIT=`git log -n1 --pretty=format:%H` MERGE_COMMMIT=`git log -n1 --pretty=format:%H`
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH` TARGET_INIT_COMMIT=`git log -n1 --pretty=format:%H origin/$TARGET_BRANCH`
echo " ---- Checking the modified files by the merge request ----" echo " ---- Checking the modified files by the merge request ----"
echo "" echo ""
......
...@@ -55,7 +55,7 @@ amarisoft_ue_1: ...@@ -55,7 +55,7 @@ amarisoft_ue_1:
Duration : 60 Duration : 60
Ping : /tmp/test_ue1.log Ping : /tmp/test_ue1.log
UELog : /tmp/ue1.log UELog : /tmp/ue1.log
HostIPAddress : 192.168.18.89 HostIPAddress : 172.21.16.144
HostUsername : root HostUsername : root
HostPassword : toor HostPassword : toor
HostSourceCodePath : /tmp HostSourceCodePath : /tmp
......
...@@ -294,6 +294,9 @@ class Containerize(): ...@@ -294,6 +294,9 @@ class Containerize():
if image != 'ran-build': if image != 'ran-build':
mySSH.command('sed -i -e "s#' + "ran-build" + ':latest#' + "ran-build" + ':' + imageTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5) mySSH.command('sed -i -e "s#' + "ran-build" + ':latest#' + "ran-build" + ':' + imageTag + '#" docker/Dockerfile.' + pattern + self.dockerfileprefix, '\$', 5)
mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200) mySSH.command(self.cli + ' build ' + self.cliBuildOptions + ' --target ' + image + ' --tag ' + image + ':' + imageTag + ' --file docker/Dockerfile.' + pattern + self.dockerfileprefix + ' . > cmake_targets/log/' + image + '.log 2>&1', '\$', 1200)
# Flatten Image
if image != 'ran-build':
mySSH.command('python3 ./ci-scripts/flatten_image.py --tag ' + image + ':' + imageTag, '\$', 300)
# split the log # split the log
mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5) mySSH.command('mkdir -p cmake_targets/log/' + image, '\$', 5)
mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5) mySSH.command('python3 ci-scripts/docker_log_split.py --logfilename=cmake_targets/log/' + image + '.log', '\$', 5)
......
...@@ -168,7 +168,7 @@ class PhySim: ...@@ -168,7 +168,7 @@ class PhySim:
mySSH.close() mySSH.close()
#check build status and update HTML object #check build status and update HTML object
lHTML = html.HTMLManagement() lHTML = cls_oai_html.HTMLManagement()
lHTML=self.__CheckBuild_PhySim(htmlObj,constObj) lHTML=self.__CheckBuild_PhySim(htmlObj,constObj)
return lHTML return lHTML
...@@ -186,6 +186,6 @@ class PhySim: ...@@ -186,6 +186,6 @@ class PhySim:
mySSH.command(self.__workSpacePath+'ran_build/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30) mySSH.command(self.__workSpacePath+'ran_build/build/ldpctest ' + self.runargs + ' >> '+self.__runLogFile, '\$', 30)
mySSH.close() mySSH.close()
#return updated HTML to main #return updated HTML to main
lHTML = html.HTMLManagement() lHTML = cls_oai_html.HTMLManagement()
lHTML=self.__CheckResults_PhySim(htmlObj,constObj,testcase_id) lHTML=self.__CheckResults_PhySim(htmlObj,constObj,testcase_id)
return lHTML return lHTML
...@@ -37,6 +37,7 @@ import logging ...@@ -37,6 +37,7 @@ import logging
import os import os
from pathlib import Path from pathlib import Path
import time import time
from multiprocessing import Process, Lock, SimpleQueue
#----------------------------------------------------------- #-----------------------------------------------------------
# OAI Testing modules # OAI Testing modules
...@@ -237,3 +238,205 @@ class StaticCodeAnalysis(): ...@@ -237,3 +238,205 @@ class StaticCodeAnalysis():
return 0 return 0
def LicenceAndFormattingCheck(self, HTML):
if self.ranRepository == '' or self.ranBranch == '' or self.ranCommitID == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
lIpAddr = self.eNBIPAddress
lUserName = self.eNBUserName
lPassWord = self.eNBPassword
lSourcePath = self.eNBSourceCodePath
if lIpAddr == '' or lUserName == '' or lPassWord == '' or lSourcePath == '':
HELP.GenericHelp(CONST.Version)
sys.exit('Insufficient Parameter')
logging.debug('Building on server: ' + lIpAddr)
mySSH = SSH.SSHConnection()
mySSH.open(lIpAddr, lUserName, lPassWord)
self.testCase_id = HTML.testCase_id
# on RedHat/CentOS .git extension is mandatory
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
if result is not None:
full_ran_repo_name = self.ranRepository.replace('git/', 'git')
else:
full_ran_repo_name = self.ranRepository + '.git'
mySSH.command('mkdir -p ' + lSourcePath, '\$', 5)
mySSH.command('cd ' + lSourcePath, '\$', 5)
mySSH.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + full_ran_repo_name + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600)
# Raphael: here add a check if git clone or git fetch went smoothly
mySSH.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
mySSH.command('git config user.name "OAI Jenkins"', '\$', 5)
mySSH.command('echo ' + lPassWord + ' | sudo -S git clean -x -d -ff', '\$', 30)
mySSH.command('mkdir -p cmake_targets/log', '\$', 5)
# 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
argToPass = ''
if (self.ranAllowMerge):
argToPass = '--build-arg MERGE_REQUEST=true --build-arg SRC_BRANCH=' + self.ranBranch
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)
argToPass += ' --build-arg TARGET_BRANCH=develop '
else:
logging.debug('Merging with the target branch: ' + self.ranTargetBranch)
mySSH.command('git merge --ff origin/' + self.ranTargetBranch + ' -m "Temporary merge for CI"', '\$', 5)
argToPass += ' --build-arg TARGET_BRANCH=' + self.ranTargetBranch + ' '
mySSH.command('docker image rm oai-formatting-check:latest || true', '\$', 60)
mySSH.command('docker build --target oai-formatting-check --tag oai-formatting-check:latest ' + argToPass + '--file ci-scripts/docker/Dockerfile.formatting.bionic . > cmake_targets/log/oai-formatting-check.txt 2>&1', '\$', 600)
mySSH.command('docker image rm oai-formatting-check:latest || true', '\$', 60)
mySSH.command('docker image prune --force', '\$', 60)
mySSH.command('docker volume prune --force', '\$', 60)
# Analyzing the logs
mySSH.command('cd ' + lSourcePath + '/cmake_targets', '\$', 5)
mySSH.command('mkdir -p build_log_' + self.testCase_id, '\$', 5)
mySSH.command('mv log/* ' + 'build_log_' + self.testCase_id, '\$', 5)
mySSH.close()
mySSH.copyin(lIpAddr, lUserName, lPassWord, lSourcePath + '/cmake_targets/build_log_' + self.testCase_id + '/*', '.')
finalStatus = 0
if (os.path.isfile('./oai-formatting-check.txt')):
analyzed = False
nbFilesNotFormatted = 0
listFiles = False
listFilesNotFormatted = []
circularHeaderDependency = False
circularHeaderDependencyFiles = []
gnuGplLicence = False
gnuGplLicenceFiles = []
suspectLicence = False
suspectLicenceFiles = []
with open('./oai-formatting-check.txt', 'r') as logfile:
for line in logfile:
ret = re.search('./ci-scripts/checkCodingFormattingRules.sh', str(line))
if ret is not None:
analyzed = True
if analyzed:
ret = re.search('Nb Files that do NOT follow OAI rules: (?P<nb_errors>[0-9\.]+)', str(line))
if ret is not None:
nbFilesNotFormatted = int(ret.group('nb_errors'))
if re.search('=== Files not properly formatted ===', str(line)) is not None:
listFiles = True
if listFiles:
if re.search('Removing intermediate container', str(line)) is not None:
listFiles = False
elif re.search('Running in|Files not properly formatted', str(line)) is not None:
pass
else:
listFilesNotFormatted.append(str(line).strip())
if re.search('=== Files with incorrect define protection ===', str(line)) is not None:
circularHeaderDependency = True
if circularHeaderDependency:
if re.search('Removing intermediate container', str(line)) is not None:
circularHeaderDependency = False
elif re.search('Running in|Files with incorrect define protection', str(line)) is not None:
pass
else:
circularHeaderDependencyFiles.append(str(line).strip())
if re.search('=== Files with a GNU GPL licence Banner ===', str(line)) is not None:
gnuGplLicence = True
if gnuGplLicence:
if re.search('Removing intermediate container', str(line)) is not None:
gnuGplLicence = False
elif re.search('Running in|Files with a GNU GPL licence Banner', str(line)) is not None:
pass
else:
gnuGplLicenceFiles.append(str(line).strip())
if re.search('=== Files with a suspect Banner ===', str(line)) is not None:
suspectLicence = True
if suspectLicence:
if re.search('Removing intermediate container', str(line)) is not None:
suspectLicence = False
elif re.search('Running in|Files with a suspect Banner', str(line)) is not None:
pass
else:
suspectLicenceFiles.append(str(line).strip())
logfile.close()
if analyzed:
logging.debug('files not formatted properly: ' + str(nbFilesNotFormatted))
if nbFilesNotFormatted == 0:
HTML.CreateHtmlTestRow('File(s) Format', 'OK', CONST.ALL_PROCESSES_OK)
else:
html_queue = SimpleQueue()
html_cell = '<pre style="background-color:white">\n'
html_cell += 'Number of files not following OAI Rules: ' + str(nbFilesNotFormatted) + '\n'
for nFile in listFilesNotFormatted:
html_cell += str(nFile).strip() + '\n'
html_cell += '</pre>'
html_queue.put(html_cell)
HTML.CreateHtmlTestRowQueue('File(s) Format', 'KO', 1, html_queue)
del(html_cell)
del(html_queue)
logging.debug('header files not respecting the circular dependency protection: ' + str(len(circularHeaderDependencyFiles)))
if len(circularHeaderDependencyFiles) == 0:
HTML.CreateHtmlTestRow('Header Circular Dependency', 'OK', CONST.ALL_PROCESSES_OK)
else:
html_queue = SimpleQueue()
html_cell = '<pre style="background-color:white">\n'
html_cell += 'Number of files not respecting: ' + str(len(circularHeaderDependencyFiles)) + '\n'
for nFile in circularHeaderDependencyFiles:
html_cell += str(nFile).strip() + '\n'
html_cell += '</pre>'
html_queue.put(html_cell)
HTML.CreateHtmlTestRowQueue('Header Circular Dependency', 'KO', 1, html_queue)
del(html_cell)
del(html_queue)
finalStatus = -1
logging.debug('files with a GNU GPL license: ' + str(len(gnuGplLicenceFiles)))
if len(gnuGplLicenceFiles) == 0:
HTML.CreateHtmlTestRow('Files w/ GNU GPL License', 'OK', CONST.ALL_PROCESSES_OK)
else:
html_queue = SimpleQueue()
html_cell = '<pre style="background-color:white">\n'
html_cell += 'Number of files not respecting: ' + str(len(gnuGplLicenceFiles)) + '\n'
for nFile in gnuGplLicenceFiles:
html_cell += str(nFile).strip() + '\n'
html_cell += '</pre>'
html_queue.put(html_cell)
HTML.CreateHtmlTestRowQueue('Files w/ GNU GPL License', 'KO', 1, html_queue)
del(html_cell)
del(html_queue)
finalStatus = -1
logging.debug('files with a suspect license: ' + str(len(suspectLicenceFiles)))
if len(suspectLicenceFiles) == 0:
HTML.CreateHtmlTestRow('Files with suspect license', 'OK', CONST.ALL_PROCESSES_OK)
else:
html_queue = SimpleQueue()
html_cell = '<pre style="background-color:white">\n'
html_cell += 'Number of files not respecting: ' + str(len(suspectLicenceFiles)) + '\n'
for nFile in suspectLicenceFiles:
html_cell += str(nFile).strip() + '\n'
html_cell += '</pre>'
html_queue.put(html_cell)
HTML.CreateHtmlTestRowQueue('Files with suspect license', 'KO', 1, html_queue)
del(html_cell)
del(html_queue)
finalStatus = -1
else:
finalStatus = -1
HTML.htmleNBFailureMsg = 'Could not fully analyze oai-formatting-check.txt file'
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
else:
finalStatus = -1
HTML.htmleNBFailureMsg = 'Could not access oai-formatting-check.txt file'
HTML.CreateHtmlTestRow('N/A', 'KO', CONST.ENB_PROCESS_NOLOGFILE_TO_ANALYZE)
return finalStatus
...@@ -38,7 +38,7 @@ gNBs = ...@@ -38,7 +38,7 @@ gNBs =
////////// Physical parameters: ////////// Physical parameters:
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_N1 = 2; pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2; pusch_AntennaPorts = 2;
pdcch_ConfigSIB1 = ( pdcch_ConfigSIB1 = (
......
...@@ -39,7 +39,7 @@ gNBs = ...@@ -39,7 +39,7 @@ gNBs =
////////// Physical parameters: ////////// Physical parameters:
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_N1 = 2; pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2; pusch_AntennaPorts = 2;
pdcch_ConfigSIB1 = ( pdcch_ConfigSIB1 = (
......
...@@ -225,6 +225,7 @@ RUs = ( ...@@ -225,6 +225,7 @@ RUs = (
att_tx = 0; att_tx = 0;
att_rx = 0; att_rx = 0;
bands = [7]; bands = [7];
sl_ahead = 12;
max_pdschReferenceSignalPower = -27; max_pdschReferenceSignalPower = -27;
max_rxgain = 75; max_rxgain = 75;
eNB_instances = [0]; eNB_instances = [0];
......
...@@ -20,7 +20,7 @@ gNBs = ...@@ -20,7 +20,7 @@ gNBs =
////////// Physical parameters: ////////// Physical parameters:
ssb_SubcarrierOffset = 31; //0; ssb_SubcarrierOffset = 31; //0;
pdsch_AntennaPorts_N1 = 2; pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2; pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54" ul_prbblacklist = "51,52,53,54"
......
...@@ -38,7 +38,7 @@ gNBs = ...@@ -38,7 +38,7 @@ gNBs =
////////// Physical parameters: ////////// Physical parameters:
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_N1 = 2; pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2; pusch_AntennaPorts = 2;
ul_prbblacklist = "51,52,53,54" ul_prbblacklist = "51,52,53,54"
do_SRS = 1; do_SRS = 1;
......
...@@ -38,7 +38,7 @@ gNBs = ...@@ -38,7 +38,7 @@ gNBs =
////////// Physical parameters: ////////// Physical parameters:
ssb_SubcarrierOffset = 0; ssb_SubcarrierOffset = 0;
pdsch_AntennaPorts_N1 = 2; pdsch_AntennaPorts_XP = 2;
pusch_AntennaPorts = 2; pusch_AntennaPorts = 2;
#pusch_TargetSNRx10 = 200; #pusch_TargetSNRx10 = 200;
#pucch_TargetSNRx10 = 200; #pucch_TargetSNRx10 = 200;
......
...@@ -63,8 +63,8 @@ gNBs = ...@@ -63,8 +63,8 @@ gNBs =
dl_carrierBandwidth = 106; dl_carrierBandwidth = 106;
#initialDownlinkBWP #initialDownlinkBWP
#genericParameters #genericParameters
# this is RBstart=27,L=48 (275*(L-1))+RBstart # this is RBstart=0,L=106 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 13475; # 6366 12925 12956 28875 12952 initialDLBWPlocationAndBandwidth = 28875;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1; initialDLBWPsubcarrierSpacing = 1;
...@@ -85,7 +85,7 @@ gNBs = ...@@ -85,7 +85,7 @@ gNBs =
pMax = 20; pMax = 20;
#initialUplinkBWP #initialUplinkBWP
#genericParameters #genericParameters
initialULBWPlocationAndBandwidth = 13475; initialULBWPlocationAndBandwidth = 28875;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1; initialULBWPsubcarrierSpacing = 1;
......
...@@ -15,7 +15,8 @@ Ref : ...@@ -15,7 +15,8 @@ Ref :
DLSCH encoding : 230.0 DLSCH encoding : 230.0
L1 Rx processing : 175.0 L1 Rx processing : 175.0
PUSCH inner-receiver : 100.0 PUSCH inner-receiver : 100.0
PUSCH decoding : 180.0 #PUSCH decoding : 180.0
PUSCH decoding : 240.0
DL & UL scheduling timing stats : 37.0 DL & UL scheduling timing stats : 37.0
UL Indication : 38.0 UL Indication : 38.0
Threshold : Threshold :
......
FROM ubuntu:bionic AS oai-formatting-check
ARG MERGE_REQUEST
ARG SRC_BRANCH
ARG TARGET_BRANCH
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
DEBIAN_FRONTEND=noninteractive apt-get install --yes \
astyle \
gawk \
git
WORKDIR /oai-ran
COPY . .
RUN /bin/bash -c "if [[ -v MERGE_REQUEST ]]; then echo 'Source Branch = $SRC_BRANCH'; echo 'Target Branch = $TARGET_BRANCH'; else echo 'Push to develop'; fi"
RUN /bin/bash -c "if [[ -v MERGE_REQUEST ]]; then ./ci-scripts/checkCodingFormattingRules.sh --src-branch $SRC_BRANCH --target-branch $TARGET_BRANCH; else ./ci-scripts/checkCodingFormattingRules.sh; fi"
RUN echo "=== Files not properly formatted ===" && \
/bin/bash -c "if [[ -f oai_rules_result_list.txt ]]; then cat oai_rules_result_list.txt; fi"
RUN echo "=== Files with incorrect define protection ===" && \
/bin/bash -c "if [[ -f header-files-w-incorrect-define.txt ]]; then cat header-files-w-incorrect-define.txt; fi"
RUN echo "=== Files with a GNU GPL licence Banner ===" && \
/bin/bash -c "if [[ -f files-w-gnu-gpl-license-banner.txt ]]; then cat files-w-gnu-gpl-license-banner.txt; fi"
RUN echo "=== Files with a suspect Banner ===" && \
/bin/bash -c "if [[ -f files-w-suspect-banner.txt ]]; then cat files-w-suspect-banner.txt; fi"
...@@ -255,16 +255,19 @@ class EPCManagement(): ...@@ -255,16 +255,19 @@ class EPCManagement():
mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5) mySSH.command('mkdir -p ' + self.SourceCodePath + '/scripts', '\$', 5)
mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5) mySSH.command('cd /opt/oai-cn5g-fed-v1.3/docker-compose', '\$', 5)
mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60) mySSH.command('python3 ./core-network.py '+self.cfgDeploy, '\$', 60)
time.sleep(2) if re.search('start-mini-as-ue', self.cfgDeploy):
mySSH.command('docker-compose -p 5gcn ps -a', '\$', 60) dFile = 'docker-compose-mini-nrf-asue.yaml'
else:
dFile = 'docker-compose-mini-nrf.yaml'
mySSH.command('docker-compose -p 5gcn -f ' + dFile + ' ps -a', '\$', 60)
if mySSH.getBefore().count('Up (healthy)') != 6: if mySSH.getBefore().count('Up (healthy)') != 6:
logging.error('Not all container healthy') logging.error('Not all container healthy')
else: else:
logging.debug('OK') logging.debug('OK --> all containers are healthy')
mySSH.command('docker-compose config | grep --colour=never image', '\$', 10) mySSH.command('docker-compose -p 5gcn -f ' + dFile + ' config | grep --colour=never image', '\$', 10)
listOfImages = mySSH.getBefore() listOfImages = mySSH.getBefore()
for imageLine in listOfImages.split('\\r\\n'): for imageLine in listOfImages.split('\\r\\n'):
res1 = re.search('image: (?P<name>[a-zA-Z0-9\-]+):(?P<tag>[a-zA-Z0-9\-]+)', str(imageLine)) res1 = re.search('image: (?P<name>[a-zA-Z0-9\-/]+):(?P<tag>[a-zA-Z0-9\-]+)', str(imageLine))
res2 = re.search('mysql', str(imageLine)) res2 = re.search('mysql', str(imageLine))
if res1 is not None and res2 is None: if res1 is not None and res2 is None:
html_cell += res1.group('name') + ':' + res1.group('tag') + ' ' html_cell += res1.group('name') + ':' + res1.group('tag') + ' '
...@@ -536,7 +539,7 @@ class EPCManagement(): ...@@ -536,7 +539,7 @@ class EPCManagement():
mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60) mySSH.command('python3 ./core-network.py '+self.cfgUnDeploy, '\$', 60)
mySSH.command('docker volume prune --force || true', '\$', 60) mySSH.command('docker volume prune --force || true', '\$', 60)
time.sleep(2) time.sleep(2)
mySSH.command('tshark -r /tmp/oai-cn5g.pcap | egrep --colour=never "Tracking area update" ','\$', 30) mySSH.command('tshark -r /tmp/oai-cn5g-v1.3.pcap | egrep --colour=never "Tracking area update" ','\$', 30)
result = re.search('Tracking area update request', mySSH.getBefore()) result = re.search('Tracking area update request', mySSH.getBefore())
if result is not None: if result is not None:
message = 'UE requested ' + str(mySSH.getBefore().count('Tracking area update request')) + 'Tracking area update request(s)' message = 'UE requested ' + str(mySSH.getBefore().count('Tracking area update request')) + 'Tracking area update request(s)'
...@@ -830,8 +833,8 @@ class EPCManagement(): ...@@ -830,8 +833,8 @@ class EPCManagement():
mySSH.command('zip mme.log.zip mme_check_run.*', '\$', 60) mySSH.command('zip mme.log.zip mme_check_run.*', '\$', 60)
elif re.match('OAICN5G', self.Type, re.IGNORECASE): elif re.match('OAICN5G', self.Type, re.IGNORECASE):
mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5) mySSH.command('cd ' + self.SourceCodePath + '/logs','\$', 5)
mySSH.command('cp -f /tmp/oai-cn5g.pcap .','\$', 30) mySSH.command('cp -f /tmp/oai-cn5g-v1.3.pcap .','\$', 30)
mySSH.command('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g.pcap','\$', 30) mySSH.command('zip mme.log.zip oai-amf.log oai-nrf.log oai-cn5g*.pcap','\$', 30)
mySSH.command('mv mme.log.zip ' + self.SourceCodePath + '/scripts','\$', 30) mySSH.command('mv mme.log.zip ' + self.SourceCodePath + '/scripts','\$', 30)
elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE): elif re.match('OAI', self.Type, re.IGNORECASE) or re.match('OAI-Rel14-CUPS', self.Type, re.IGNORECASE):
mySSH.command('zip mme.log.zip mme*.log', '\$', 60) mySSH.command('zip mme.log.zip mme*.log', '\$', 60)
......
"""
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-------------------------------------------------------------------------------
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
"""
import argparse
import re
import subprocess
import sys
def main() -> None:
args = _parse_args()
status = perform_flattening(args.tag)
sys.exit(status)
def _parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Flattening Image')
parser.add_argument(
'--tag', '-t',
action='store',
required=True,
help='Image Tag in image-name:image tag format',
)
return parser.parse_args()
def perform_flattening(tag):
# First detect which docker/podman command to use
cli = ''
image_prefix = ''
cmd = 'which podman || true'
podman_check = subprocess.check_output(cmd, shell=True, universal_newlines=True)
if re.search('podman', podman_check.strip()):
cli = 'sudo podman'
image_prefix = 'localhost/'
if cli == '':
cmd = 'which docker || true'
docker_check = subprocess.check_output(cmd, shell=True, universal_newlines=True)
if re.search('docker', docker_check.strip()):
cli = 'docker'
image_prefix = ''
if cli == '':
print ('No docker / podman installed: quitting')
return -1
print (f'Flattening {tag}')
# Creating a container
cmd = cli + ' run --name test-flatten --entrypoint /bin/true -d ' + tag
print (cmd)
subprocess.check_output(cmd, shell=True, universal_newlines=True)
# Export / Import trick
cmd = cli + ' export test-flatten | ' + cli + ' import '
# Bizarro syntax issue with podman
if cli == 'docker':
cmd += ' --change "ENV PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" '
else:
cmd += ' --change "ENV PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" '
if re.search('oai-enb', tag):
cmd += ' --change "WORKDIR /opt/oai-enb" '
cmd += ' --change "EXPOSE 2152/udp" '
cmd += ' --change "EXPOSE 36412/udp" '
cmd += ' --change "EXPOSE 36422/udp" '
cmd += ' --change "CMD [\\"/opt/oai-enb/bin/lte-softmodem.Rel15\\", \\"-O\\", \\"/opt/oai-enb/etc/enb.conf\\"]" '
cmd += ' --change "ENTRYPOINT [\\"/opt/oai-enb/bin/entrypoint.sh\\"]" '
if re.search('oai-gnb', tag):
cmd += ' --change "WORKDIR /opt/oai-gnb" '
cmd += ' --change "EXPOSE 2152/udp" '
cmd += ' --change "EXPOSE 36422/udp" '
cmd += ' --change "CMD [\\"/opt/oai-gnb/bin/nr-softmodem.Rel15\\", \\"-O\\", \\"/opt/oai-gnb/etc/gnb.conf\\"]" '
cmd += ' --change "ENTRYPOINT [\\"/opt/oai-gnb/bin/entrypoint.sh\\"]" '
if re.search('oai-lte-ue', tag):
cmd += ' --change "WORKDIR /opt/oai-lte-ue" '
cmd += ' --change "CMD [\\"/opt/oai-lte-ue/bin/lte-uesoftmodem.Rel15\\"]" '
cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ue/bin/entrypoint.sh\\"]" '
if re.search('oai-nr-ue', tag):
cmd += ' --change "WORKDIR /opt/oai-nr-ue" '
cmd += ' --change "CMD [\\"/opt/oai-nr-ue/bin/nr-uesoftmodem.Rel15\\", \\"-O\\", \\"/opt/oai-nr-ue/etc/nr-ue.conf\\"]" '
cmd += ' --change "ENTRYPOINT [\\"/opt/oai-nr-ue/bin/entrypoint.sh\\"]" '
if re.search('oai-lte-ru', tag):
cmd += ' --change "WORKDIR /opt/oai-lte-ru" '
cmd += ' --change "CMD [\\"/opt/oai-lte-ru/bin/oairu.Rel15\\", \\"-O\\", \\"/opt/oai-lte-ru/etc/rru.conf\\"]" '
cmd += ' --change "ENTRYPOINT [\\"/opt/oai-lte-ru/bin/entrypoint.sh\\"]" '
if re.search('oai-physim', tag):
cmd += ' --change "WORKDIR /opt/oai-physim" '
cmd += ' - ' + image_prefix + tag
print (cmd)
subprocess.check_output(cmd, shell=True, universal_newlines=True)
# Remove container
cmd = cli + ' rm -f test-flatten'
print (cmd)
subprocess.check_output(cmd, shell=True, universal_newlines=True)
# At this point the original image is a dangling image.
# CI pipeline will clean up (`image prune --force`)
return 0
if __name__ == '__main__':
main()
...@@ -799,7 +799,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -799,7 +799,7 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML.startTime=int(round(time.time() * 1000)) HTML.startTime=int(round(time.time() * 1000))
while CiTestObj.FailReportCnt < CiTestObj.repeatCounts[0] and RAN.prematureExit: while CiTestObj.FailReportCnt < CiTestObj.repeatCounts[0] and RAN.prematureExit:
RAN.prematureExit=False RAN.prematureExit=False
# At every iteratin of the retry loop, a separator will be added # At every iteration of the retry loop, a separator will be added
# pass CiTestObj.FailReportCnt as parameter of HTML.CreateHtmlRetrySeparator # pass CiTestObj.FailReportCnt as parameter of HTML.CreateHtmlRetrySeparator
HTML.CreateHtmlRetrySeparator(CiTestObj.FailReportCnt) HTML.CreateHtmlRetrySeparator(CiTestObj.FailReportCnt)
for test_case_id in todo_tests: for test_case_id in todo_tests:
...@@ -923,6 +923,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re ...@@ -923,6 +923,10 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
CONTAINERS.UndeployObject(HTML, RAN) CONTAINERS.UndeployObject(HTML, RAN)
elif action == 'Cppcheck_Analysis': elif action == 'Cppcheck_Analysis':
SCA.CppCheckAnalysis(HTML) SCA.CppCheckAnalysis(HTML)
elif action == 'LicenceAndFormattingCheck':
ret = SCA.LicenceAndFormattingCheck(HTML)
if ret != 0:
RAN.prematureExit = True
elif action == 'Deploy_Run_PhySim': elif action == 'Deploy_Run_PhySim':
PHYSIM.Deploy_PhySim(HTML, RAN) PHYSIM.Deploy_PhySim(HTML, RAN)
elif action == 'DeployGenObject': elif action == 'DeployGenObject':
......
...@@ -372,36 +372,30 @@ class RANManagement(): ...@@ -372,36 +372,30 @@ class RANManagement():
else: else:
pcapfile_prefix="gnb_" pcapfile_prefix="gnb_"
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5) eth_interface = 'any'
result = re.search('interfaceToUse=(?P<eth_interface>[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) fltr = 'sctp'
if result is not None: logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m')
eth_interface = result.group('eth_interface') pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap'
fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5)
logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5)
pcapfile = pcapfile_prefix + self.testCase_id + '_log.pcap'
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -f /tmp/' + pcapfile , '\$', 5)
mySSH.command('echo $USER; nohup sudo -E tshark -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + pcapfile + ' > /dev/null 2>&1 &','\$', 5)
mySSH.close() mySSH.close()
# If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB # If tracer options is on, running tshark on EPC side and capture traffic b/ EPC and eNB
result = re.search('T_stdout', str(self.Initialize_eNB_args)) if EPC.IPAddress != "none":
if (result is not None):
localEpcIpAddr = EPC.IPAddress localEpcIpAddr = EPC.IPAddress
localEpcUserName = EPC.UserName localEpcUserName = EPC.UserName
localEpcPassword = EPC.Password localEpcPassword = EPC.Password
mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword)
mySSH.command('ip addr show | awk -f /tmp/active_net_interfaces.awk | egrep -v "lo|tun"', '\$', 5) eth_interface = 'any'
result = re.search('interfaceToUse=(?P<eth_interface>[a-zA-Z0-9\-\_]+)done', mySSH.getBefore()) fltr = 'sctp'
if result is not None: logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m')
eth_interface = result.group('eth_interface') self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap'
fltr = 'port 38412 or port 36412 or port 36422' # NGAP, S1AP, X2AP mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5)
logging.debug('\u001B[1m Launching tshark on interface ' + eth_interface + ' with filter "' + fltr + '"\u001B[0m') mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5)
self.epcPcapFile = 'enb_' + self.testCase_id + '_s1log.pcap'
mySSH.command('echo ' + localEpcPassword + ' | sudo -S rm -f /tmp/' + self.epcPcapFile , '\$', 5)
mySSH.command('echo $USER; nohup sudo tshark -f "host ' + lIpAddr +'" -i ' + eth_interface + ' -f "' + fltr + '" -w /tmp/' + self.epcPcapFile + ' > /tmp/tshark.log 2>&1 &', localEpcUserName, 5)
mySSH.close() mySSH.close()
mySSH.open(lIpAddr, lUserName, lPassWord) mySSH.open(lIpAddr, lUserName, lPassWord)
mySSH.command('cd ' + lSourcePath, '\$', 5) mySSH.command('cd ' + lSourcePath, '\$', 5)
# Initialize_eNB_args usually start with -O and followed by the location in repository # Initialize_eNB_args usually start with -O and followed by the location in repository
...@@ -519,23 +513,19 @@ class RANManagement(): ...@@ -519,23 +513,19 @@ class RANManagement():
logging.error('\u001B[1;37;41m eNB/gNB/ocp-eNB logging system did not show got sync! \u001B[0m') logging.error('\u001B[1;37;41m eNB/gNB/ocp-eNB logging system did not show got sync! \u001B[0m')
HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'KO', CONST.ALL_PROCESSES_OK) HTML.CreateHtmlTestRow(self.air_interface[self.eNB_instance] + ' -O ' + config_file + extra_options, 'KO', CONST.ALL_PROCESSES_OK)
# In case of T tracer recording, we need to kill tshark on EPC side # In case of T tracer recording, we need to kill tshark on EPC side
result = re.search('T_stdout', str(self.Initialize_eNB_args)) localEpcIpAddr = EPC.IPAddress
if (result is not None): localEpcUserName = EPC.UserName
localEpcIpAddr = EPC.IPAddress localEpcPassword = EPC.Password
localEpcUserName = EPC.UserName mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword)
localEpcPassword = EPC.Password logging.debug('\u001B[1m Stopping tshark \u001B[0m')
mySSH.open(localEpcIpAddr, localEpcUserName, localEpcPassword) mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5)
logging.debug('\u001B[1m Stopping tshark \u001B[0m') if self.epcPcapFile != '':
mySSH.command('echo ' + localEpcPassword + ' | sudo -S killall --signal SIGKILL tshark', '\$', 5) mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5)
if self.epcPcapFile != '': mySSH.close()
time.sleep(0.5) if self.epcPcapFile != '':
mySSH.command('echo ' + localEpcPassword + ' | sudo -S chmod 666 /tmp/' + self.epcPcapFile, '\$', 5) copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.')
mySSH.close() if (copyin_res == 0):
time.sleep(1) mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.')
if self.epcPcapFile != '':
copyin_res = mySSH.copyin(localEpcIpAddr, localEpcUserName, localEpcPassword, '/tmp/' + self.epcPcapFile, '.')
if (copyin_res == 0):
mySSH.copyout(lIpAddr, lUserName, lPassWord, self.epcPcapFile, lSourcePath + '/cmake_targets/.')
self.prematureExit = True self.prematureExit = True
return return
else: else:
......
...@@ -528,15 +528,15 @@ class Dashboard: ...@@ -528,15 +528,15 @@ class Dashboard:
editable_mr = project.mergerequests.get(int(mr)) editable_mr = project.mergerequests.get(int(mr))
mr_notes = editable_mr.notes.list(all=True) mr_notes = editable_mr.notes.list(all=True)
body = '<a href="https://oaitestdashboard.s3.eu-west-1.amazonaws.com/MR'+mr+'/index.html">Consolidated Test Results</a><br>'+\ body = '[Consolidated Test Results](https://oaitestdashboard.s3.eu-west-1.amazonaws.com/MR'+mr+'/index.html)\\\n'
'Tested CommitID: ' + commit + '<br>' body += 'Tested CommitID: ' + commit + '\\\n'
for i in range(0,n_tests): for i in range(0,n_tests):
jobname = args[4*i] jobname = args[4*i]
buildurl = args[4*i+1] buildurl = args[4*i+1]
buildid = args[4*i+2] buildid = args[4*i+2]
status = args[4*i+3] status = args[4*i+3]
body += jobname+', status is <b>'+status+'</b>, (<a href="'+buildurl+'">'+buildid+'</a>)<br>' body += jobname+': **'+status+'** ([' + buildid + '](' + buildurl + '))\\\n'
#create new note #create new note
mr_note = editable_mr.notes.create({ mr_note = editable_mr.notes.create({
......
...@@ -47,3 +47,4 @@ ...@@ -47,3 +47,4 @@
- PingFromContainer - PingFromContainer
- IperfFromContainer - IperfFromContainer
- StatsFromGenObject - StatsFromGenObject
- LicenceAndFormattingCheck
...@@ -33,12 +33,10 @@ ...@@ -33,12 +33,10 @@
000013 000013
020011 020011
020012 020012
100011
</TestCaseRequestedList>
<!-- Not done yet because of code instability
030011 030011
030012 030012
--> 100011
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList> <TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000010"> <testCase id="000010">
...@@ -104,7 +102,7 @@ ...@@ -104,7 +102,7 @@
<server_container_name>rfsim5g-oai-ext-dn</server_container_name> <server_container_name>rfsim5g-oai-ext-dn</server_container_name>
<client_container_name>rfsim5g-oai-nr-ue</client_container_name> <client_container_name>rfsim5g-oai-nr-ue</client_container_name>
<server_options>-u -i 1 -s</server_options> <server_options>-u -i 1 -s</server_options>
<client_options>-B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 1M</client_options> <client_options>-B 12.1.1.2 -c 192.168.72.135 -u -i 1 -t 30 -b 3M</client_options>
</testCase> </testCase>
<testCase id="100011"> <testCase id="100011">
......
...@@ -142,8 +142,8 @@ ...@@ -142,8 +142,8 @@
<iperf_args>-u -b 125M -t 60 -i 1 -fm</iperf_args> <iperf_args>-u -b 125M -t 60 -i 1 -fm</iperf_args>
<direction>DL</direction> <direction>DL</direction>
<id>idefix</id> <id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold> <iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold> <iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile> <iperf_profile>single-ue</iperf_profile>
</testCase> </testCase>
......
<!--
Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The OpenAirInterface Software Alliance licenses this file to You under
the OAI Public License, Version 1.1 (the "License"); you may not use this file
except in compliance with the License.
You may obtain a copy of the License at
http://www.openairinterface.org/?page_id=698
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
For more information about the OpenAirInterface (OAI) Software Alliance:
contact@openairinterface.org
-->
<testCaseList>
<htmlTabRef>formatting-tab</htmlTabRef>
<htmlTabName>License and Formatting Checks</htmlTabName>
<htmlTabIcon>wrench</htmlTabIcon>
<TestCaseRequestedList>
000002
</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000002">
<class>LicenceAndFormattingCheck</class>
<desc>License and Formatting Checks</desc>
</testCase>
</testCaseList>
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
050000 050000
050001 050001
000001 000001
070003 070000
070002 070001
000001 000001
050000 050000
050001 050001
...@@ -52,14 +52,12 @@ ...@@ -52,14 +52,12 @@
<UE_Trace>yes</UE_Trace> <UE_Trace>yes</UE_Trace>
</testCase> </testCase>
<testCase id="010002"> <testCase id="010002">
<class>Terminate_UE</class> <class>Terminate_UE</class>
<desc>Terminate Quectel</desc> <desc>Terminate Quectel</desc>
<id>idefix</id> <id>idefix</id>
</testCase> </testCase>
<testCase id="030000"> <testCase id="030000">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize eNB</desc> <desc>Initialize eNB</desc>
...@@ -70,7 +68,6 @@ ...@@ -70,7 +68,6 @@
<eNB_Trace>yes</eNB_Trace> <eNB_Trace>yes</eNB_Trace>
</testCase> </testCase>
<testCase id="040000"> <testCase id="040000">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize gNB</desc> <desc>Initialize gNB</desc>
...@@ -92,7 +89,6 @@ ...@@ -92,7 +89,6 @@
<idle_sleep_time_in_sec>20</idle_sleep_time_in_sec> <idle_sleep_time_in_sec>20</idle_sleep_time_in_sec>
</testCase> </testCase>
<testCase id="050000"> <testCase id="050000">
<class>Ping</class> <class>Ping</class>
<desc>Ping: 20pings in 20sec</desc> <desc>Ping: 20pings in 20sec</desc>
...@@ -112,39 +108,17 @@ ...@@ -112,39 +108,17 @@
</testCase> </testCase>
<testCase id="070000"> <testCase id="070000">
<class>Iperf</class>
<desc>iperf (DL/30Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 30M -t 30</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070001">
<class>Iperf</class>
<desc>iperf (DL/90Mbps/UDP)(30 sec)(single-ue profile)</desc>
<iperf_args>-u -b 90M -t 30</iperf_args>
<direction>DL</direction>
<id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile>
</testCase>
<testCase id="070002">
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile)</desc> <desc>iperf (DL/125Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 125M -t 60</iperf_args> <iperf_args>-u -b 125M -t 60</iperf_args>
<direction>DL</direction> <direction>DL</direction>
<id>idefix</id> <id>idefix</id>
<iperf_packetloss_threshold>1</iperf_packetloss_threshold> <iperf_packetloss_threshold>25</iperf_packetloss_threshold>
<iperf_bitrate_threshold>95</iperf_bitrate_threshold> <iperf_bitrate_threshold>80</iperf_bitrate_threshold>
<iperf_profile>single-ue</iperf_profile> <iperf_profile>single-ue</iperf_profile>
</testCase> </testCase>
<testCase id="070003"> <testCase id="070001">
<class>Iperf</class> <class>Iperf</class>
<desc>iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile)</desc> <desc>iperf (UL/8Mbps/UDP)(60 sec)(single-ue profile)</desc>
<iperf_args>-u -b 8M -t 60</iperf_args> <iperf_args>-u -b 8M -t 60</iperf_args>
...@@ -155,7 +129,6 @@ ...@@ -155,7 +129,6 @@
<iperf_profile>single-ue</iperf_profile> <iperf_profile>single-ue</iperf_profile>
</testCase> </testCase>
<testCase id="080000"> <testCase id="080000">
<class>Terminate_eNB</class> <class>Terminate_eNB</class>
<desc>Terminate eNB</desc> <desc>Terminate eNB</desc>
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
--> -->
<testCaseList> <testCaseList>
<htmlTabRef>TEST-SA-FR1-Tab1</htmlTabRef> <htmlTabRef>TEST-SA-FR1-Tab1</htmlTabRef>
<htmlTabName>SA Ping DL UL with QUECTEL</htmlTabName> <htmlTabName>SA Ping DL UL with Quectel, 2.5ms TDD</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount> <repeatCount>1</repeatCount>
<TestCaseRequestedList> <TestCaseRequestedList>
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<testCase id="040000"> <testCase id="040000">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize gNB</desc> <desc>Initialize gNB</desc>
<Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args> <Initialize_eNB_args>-O ci-scripts/conf_files/gnb.band78.sa.fr1.106PRB.ddsuu.2x2.usrpn310.conf --sa -q --usrp-tx-thread-config 1 --T_stdout 2 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<eNB_instance>0</eNB_instance> <eNB_instance>0</eNB_instance>
<eNB_serverId>0</eNB_serverId> <eNB_serverId>0</eNB_serverId>
<air_interface>nr</air_interface> <air_interface>nr</air_interface>
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
<id>nrmodule2_quectel</id> <id>nrmodule2_quectel</id>
<ping_args>-c 40</ping_args> <ping_args>-c 40</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold> <ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>20</ping_rttavg_threshold> <ping_rttavg_threshold>10</ping_rttavg_threshold>
</testCase> </testCase>
<testCase id="050001"> <testCase id="050001">
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<id>nrmodule2_quectel</id> <id>nrmodule2_quectel</id>
<ping_args>-c 100 -i 0,2</ping_args> <ping_args>-c 100 -i 0,2</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold> <ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>20</ping_rttavg_threshold> <ping_rttavg_threshold>10</ping_rttavg_threshold>
</testCase> </testCase>
<testCase id="070000"> <testCase id="070000">
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<htmlTabRef>gNB-PHY-Test</htmlTabRef> <htmlTabRef>gNB-PHY-Test</htmlTabRef>
<htmlTabName>Run-gNB-PHY-Test</htmlTabName> <htmlTabName>Run-gNB-PHY-Test</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon> <htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>3</repeatCount> <repeatCount>1</repeatCount>
<TestCaseRequestedList> <TestCaseRequestedList>
090101 000001 090109 090101 000001 090109
</TestCaseRequestedList> </TestCaseRequestedList>
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
<testCase id="090101"> <testCase id="090101">
<class>Initialize_eNB</class> <class>Initialize_eNB</class>
<desc>Initialize gNB USRP</desc> <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> <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 --usrp-tx-thread-config 1 --log_config.global_log_options level,nocolor,time</Initialize_eNB_args>
<air_interface>NR</air_interface> <air_interface>NR</air_interface>
<USRP_IPAddress>192.168.20.2</USRP_IPAddress> <USRP_IPAddress>192.168.20.2</USRP_IPAddress>
</testCase> </testCase>
......
...@@ -2842,6 +2842,7 @@ target_link_libraries(ldpctest ...@@ -2842,6 +2842,7 @@ target_link_libraries(ldpctest
add_executable(nr_dlschsim add_executable(nr_dlschsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/executables/softmodem-common.c
${T_SOURCE} ${T_SOURCE}
${SHLIB_LOADER_SOURCES} ${SHLIB_LOADER_SOURCES}
) )
...@@ -2865,6 +2866,7 @@ target_link_libraries(nr_pbchsim ...@@ -2865,6 +2866,7 @@ target_link_libraries(nr_pbchsim
add_executable(nr_pucchsim add_executable(nr_pucchsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/executables/softmodem-common.c
${T_SOURCE} ${T_SOURCE}
${SHLIB_LOADER_SOURCES} ${SHLIB_LOADER_SOURCES}
) )
...@@ -2909,6 +2911,7 @@ target_link_libraries(nr_prachsim ...@@ -2909,6 +2911,7 @@ target_link_libraries(nr_prachsim
add_executable(nr_ulschsim add_executable(nr_ulschsim
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c ${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/executables/softmodem-common.c
${PHY_INTERFACE_DIR}/queue_t.c ${PHY_INTERFACE_DIR}/queue_t.c
${T_SOURCE} ${T_SOURCE}
${SHLIB_LOADER_SOURCES} ${SHLIB_LOADER_SOURCES}
......
...@@ -1186,9 +1186,10 @@ ...@@ -1186,9 +1186,10 @@
<testCase id="015108"> <testCase id="015108">
<class>execution</class> <class>execution</class>
<desc>nr_ulschsim Test cases. (Test1: 106 PRB), <desc>nr_ulschsim Test cases. (Test1: 106 PRBs),
(Test2: 217 PRB), (Test2: 217 PRBs),
(Test3: 273 PRB)</desc> (Test3: 273 PRBs)
(Test4: 106 PRBs 4-layer MIMO)</desc>
<pre_compile_prog></pre_compile_prog> <pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args> <compile_prog_args> --phy_simulators -c </compile_prog_args>
...@@ -1197,8 +1198,9 @@ ...@@ -1197,8 +1198,9 @@
<main_exec> $OPENAIR_DIR/targets/bin/nr_ulschsim.Rel15</main_exec> <main_exec> $OPENAIR_DIR/targets/bin/nr_ulschsim.Rel15</main_exec>
<main_exec_args>-R 106 -m9 -s13 -n100 <main_exec_args>-R 106 -m9 -s13 -n100
-R 217 -m15 -s15 -n100 -R 217 -m15 -s15 -n100
-R 273 -m19 -s20 -n100</main_exec_args> -R 273 -m19 -s20 -n100
<tags>nr_ulschsim.test1 nr_ulschsim.test2 nr_ulschsim.test3</tags> -R 106 -m9 -s13 -n100 -y4 -z4 -W4</main_exec_args>
<tags>nr_ulschsim.test1 nr_ulschsim.test2 nr_ulschsim.test3 nr_ulschsim.test4</tags>
<search_expr_true>PUSCH test OK</search_expr_true> <search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns> <nruns>3</nruns>
...@@ -1306,8 +1308,10 @@ ...@@ -1306,8 +1308,10 @@
(Test12: SC-FDMA, 216 PRBs), (Test12: SC-FDMA, 216 PRBs),
(Test13: SC-FDMA, 273 PRBs), (Test13: SC-FDMA, 273 PRBs),
(Test14: SC-FDMA, 3 DMRS), (Test14: SC-FDMA, 3 DMRS),
(Test15: MCS 16 50 PRBs 2 RX_Antenna), (Test15: MCS 19 50 PRBs 2 RX_Antenna),
(Test16: 25 PRBs, 15 kHz SCS)</desc> (Test16: MCS 9 106 PRBs MIMO 2 layers),
(Test17: MCS 9 106 PRBs MIMO 4 layers),
(Test18: 25 PRBs, 15 kHz SCS)</desc>
<pre_compile_prog></pre_compile_prog> <pre_compile_prog></pre_compile_prog>
<compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog> <compile_prog>$OPENAIR_DIR/cmake_targets/build_oai</compile_prog>
<compile_prog_args> --phy_simulators -c </compile_prog_args> <compile_prog_args> --phy_simulators -c </compile_prog_args>
...@@ -1323,14 +1327,16 @@ ...@@ -1323,14 +1327,16 @@
-n100 -s5 -T 2 1 2 -U 2 0 2 -n100 -s5 -T 2 1 2 -U 2 0 2
-n100 -s5 -T 2 2 2 -U 2 1 2 -n100 -s5 -T 2 2 2 -U 2 1 2
-n100 -s5 -a4 -b8 -T 2 1 2 -U 2 1 3 -n100 -s5 -a4 -b8 -T 2 1 2 -U 2 1 3
-n100 -s5 -Z -n100 -Z -s5
-n100 -s5 -Z -r75 -n100 -s5 -Z -r75
-n50 -s5 -Z -r216 -R217 -n50 -s5 -Z -r216 -R217
-n50 -s5 -Z -r270 -R273 -n50 -s5 -Z -r270 -R273
-n100 -s5 -Z -U 2 0 2 -n100 -s5 -Z -U 2 0 2
-n100 -m16 -s10 -z2 -n100 -m19 -s10 -S15 -z2
-n100 -m9 -r106 -s10 -W2 -y2 -z2
-n100 -m9 -r106 -s20 -W4 -y4 -z4
-n100 -u0 -m0 -R25 -r25 -i</main_exec_args> -n100 -u0 -m0 -R25 -r25 -i</main_exec_args>
<tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14 nr_ulsim.test15 nr_ulsim.test16</tags> <tags>nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14 nr_ulsim.test15 nr_ulsim.test16 nr_ulsim.test17 nr_ulsim.test18</tags>
<search_expr_true>PUSCH test OK</search_expr_true> <search_expr_true>PUSCH test OK</search_expr_true>
<search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false> <search_expr_false>segmentation fault|assertion|exiting|fatal</search_expr_false>
<nruns>3</nruns> <nruns>3</nruns>
......
...@@ -381,7 +381,7 @@ check_install_usrp_uhd_driver(){ ...@@ -381,7 +381,7 @@ check_install_usrp_uhd_driver(){
$SUDO apt-get remove libuhd3.14.1 -y || true $SUDO apt-get remove libuhd3.14.1 -y || true
$SUDO apt-get remove libuhd3.15.0 -y || true $SUDO apt-get remove libuhd3.15.0 -y || true
local distribution=$(get_distribution_release) local distribution=$(get_distribution_release)
if [[ "$distribution" == "ubuntu18.04" ]]; then if [[ "$distribution" == "ubuntu18.04" || "$distribution" == "ubuntu20.04" || "$distribution" == "ubuntu22.04" ]]; then
$SUDO apt-get remove libuhd4.0.0 -y || true $SUDO apt-get remove libuhd4.0.0 -y || true
$SUDO apt-get remove libuhd4.1.0 -y || true $SUDO apt-get remove libuhd4.1.0 -y || true
fi fi
...@@ -410,13 +410,15 @@ check_install_usrp_uhd_driver(){ ...@@ -410,13 +410,15 @@ check_install_usrp_uhd_driver(){
x=$((x + 1)) x=$((x + 1))
done done
$SUDO apt-get update $SUDO apt-get update
$SUDO apt-get -y install python python-tk libboost-all-dev libusb-1.0-0-dev $SUDO apt-get -y install python-tk libboost-all-dev libusb-1.0-0-dev
if [[ "$distribution" == "ubuntu16.04" ]]; then case "$(get_distribution_release)" in
"ubuntu16.04")
$SUDO apt-get -y install libuhd-dev libuhd3.15.0 uhd-host $SUDO apt-get -y install libuhd-dev libuhd3.15.0 uhd-host
fi ;;
if [[ "$distribution" == "ubuntu18.04" ]]; then "ubuntu18.04" | "ubuntu20.04" | "ubuntu22.04")
$SUDO apt-get -y install libuhd-dev libuhd4.1.0 uhd-host $SUDO apt-get -y install libuhd-dev libuhd4.2.0 uhd-host
fi ;;
esac
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
if [ $IS_CONTAINER -eq 0 ] if [ $IS_CONTAINER -eq 0 ]
then then
......
...@@ -450,6 +450,7 @@ extern "C" { ...@@ -450,6 +450,7 @@ extern "C" {
void itti_wait_tasks_end(void) { void itti_wait_tasks_end(void) {
shutting_down = false; shutting_down = false;
signal(SIGTERM, catch_sigterm); signal(SIGTERM, catch_sigterm);
//signal(SIGINT, catch_sigterm);
while (! shutting_down) while (! shutting_down)
{ {
sleep(24 * 3600); sleep(24 * 3600);
......
...@@ -193,6 +193,7 @@ Using the help option of the build script you can get the list of available opti ...@@ -193,6 +193,7 @@ Using the help option of the build script you can get the list of available opti
| --UE | maintained and tested in CI | build `lte-uesoftmodem` the LTE UE | | --UE | maintained and tested in CI | build `lte-uesoftmodem` the LTE UE |
| --gNB | maintained and tested in CI | build `nr-softmodem` the 5G gNodeB | | --gNB | maintained and tested in CI | build `nr-softmodem` the 5G gNodeB |
| --nrUE | maintained and tested in CI | build `nr-uesoftmodem` the 5G UE | | --nrUE | maintained and tested in CI | build `nr-uesoftmodem` the 5G UE |
| --arch-native | maintained | build with native architecture optimization |
| --usrp-recplay | deprecated | use the USRP configuration parameters to use the record player. | | --usrp-recplay | deprecated | use the USRP configuration parameters to use the record player. |
| --build-lib | maintained | build optional shared library(ies), which can then be loaded at run time via command line option. Use the --help option to get the list of supported optional libraries. `all` can be used to build all available optional libraries. | | --build-lib | maintained | build optional shared library(ies), which can then be loaded at run time via command line option. Use the --help option to get the list of supported optional libraries. `all` can be used to build all available optional libraries. |
| --UE-conf-nvram | maintained | Specifies the path to the input file used by the conf2uedata utility. defaults to [openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf](../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf) | | --UE-conf-nvram | maintained | Specifies the path to the input file used by the conf2uedata utility. defaults to [openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf](../openair3/NAS/TOOLS/ue_eurecom_test_sfr.conf) |
......
...@@ -332,6 +332,9 @@ The following features are valid for the gNB and the 5G-NR UE. ...@@ -332,6 +332,9 @@ The following features are valid for the gNB and the 5G-NR UE.
- evalution of RSRP report - evalution of RSRP report
- evaluation of CQI report - evaluation of CQI report
- MAC scheduling of SR reception - MAC scheduling of SR reception
- Bandwidth part (BWP) operation
- Handle multiple dedicated BWPs
- BWP switching through RRCReconfiguration method
**gNB RLC** **gNB RLC**
- Send/Receive operations according to 38.322 Rel.16 - Send/Receive operations according to 38.322 Rel.16
...@@ -493,6 +496,8 @@ The following features are valid for the gNB and the 5G-NR UE. ...@@ -493,6 +496,8 @@ The following features are valid for the gNB and the 5G-NR UE.
- Configuration of fapi PDU according to DCI - Configuration of fapi PDU according to DCI
* Scheduler procedures for SRS transmission * Scheduler procedures for SRS transmission
- Periodic SRS transmission - Periodic SRS transmission
* Bandwidth part (BWP) operation
- Operation in configured dedicated BWP through RRCSetup or RRCReconfiguration
**UE RLC** **UE RLC**
......
...@@ -165,7 +165,7 @@ From the `cmake_targets/ran_build/build` folder: ...@@ -165,7 +165,7 @@ From the `cmake_targets/ran_build/build` folder:
gNB on machine 1: gNB on machine 1:
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --sa` `sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --sa`
UE on machine 2: UE on machine 2:
...@@ -173,7 +173,7 @@ UE on machine 2: ...@@ -173,7 +173,7 @@ UE on machine 2:
With the RF simulator (on the same machine): With the RF simulator (on the same machine):
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa` `sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --sa`
`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --rfsim --sa` `sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 -s 516 --rfsim --sa`
...@@ -207,7 +207,24 @@ UE on machine 2: ...@@ -207,7 +207,24 @@ UE on machine 2:
`sudo ./nr-uesoftmodem --if_freq 2169080000 --if_freq_off -400000000` `sudo ./nr-uesoftmodem --if_freq 2169080000 --if_freq_off -400000000`
# MIMO configuration
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<img src="./images/mimo_antenna_ports.png" alt="" border=3 height=100 width=300>
</img>
</td>
</tr>
</table>
This image shows an example of gNB 5G MIMO logical antenna port configuration. It has to be noted that logical antenna ports might not directly correspond to physical antenna ports and each logical antenna port might consist of a sub-array of antennas.
The basic element is a dual-polarized antenna, therefore the minimal DL MIMO setup with two logical antenna ports would consist of two cross-polarized antenna elements. In a single panel configuration, as the one in the picture, this element can be repeated vertiacally and/or horizontally to form an equi-spaced 1D or 2D array. The values N1 and N2 represent the number of antenna ports in the two dimensions and the supported configurations are specified in Section 5.2.2.2.1 of TS 38.214.
The DL logical antenna port configuration can be selected through configuration file. `pdsch_AntennaPorts_N1` can be used to set N1 parameter, `pdsch_AntennaPorts_N2` to set N2 and `pdsch_AntennaPorts_XP` to set the cross-polarization configuration (1 for single pol, 2 for cross-pol). To be noted that if XP is 1 but N1 and/or N2 are larger than 1, this would result in a non-standard configuration and the PMI selected would be the identity matrix regardless of CSI report. The default value for each of these parameters is 1.
# Additional links
[Selecting an alternative ldpc implementation at run time](../openair1/PHY/CODING/DOC/LDPCImplementation.md) [Selecting an alternative ldpc implementation at run time](../openair1/PHY/CODING/DOC/LDPCImplementation.md)
......
# Procedure to add dedicated Bandwidth part (BWP)
## Contributed by 5G Testbed IISc
### Developers: Abhijith A, Shruthi S
# Terminology #
## Bandwidth part (BWP) ##
Bandwidth Part (BWP) is a set of contiguous Resource Blocks in the resource grid.
Parameters of a BWP are communicated to UE using RRC parameters: BWP-Downlink and BWP-Uplink.
A UE can be configured with a set of 4 BWPs in uplink (UL) and downlink (DL) direction (3GPP TS 38.331 Annex B.2 Description of BWP configuration options). But only 1 BWP can be active in UL and DL direction at a given time.
# Procedure to run multiple dedicated BWPs #
A maximum of 4 dedicated BWPs can be configured for a UE.
To configure multiple BWPs, add the following parameters to the gNB configuration file under "servingCellConfigDedicated":
## Setup of the Configuration files ##
```
firstActiveDownlinkBWP-Id = 1; #BWP-Id
defaultDownlinkBWP-Id = 1; #BWP-Id
firstActiveUplinkBWP-Id = 1; #BWP-Id
```
Each dedicated BWP must have:
```
# BWP 1 Configuration
dl_bwp-Id_1 = 1;
dl_bwp1_locationAndBandwidth = 28875; // RBstart=0, L=106 (40 MHz BW)
# subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
dl_bwp1_subcarrierSpacing = 1;
```
Find these parameters in this configuration file: "targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf"
# Testing gNB and UE in RF simulator
## gNB command:
```
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --gNBs.[0].min_rxtxtime 6 --rfsim --sa
```
## UE command:
```
sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --nokrnmod --rfsim --sa --uicc0.imsi 208990000000001
```
\ No newline at end of file
This diff is collapsed.
...@@ -50,7 +50,7 @@ At the moment of writing this document interoperability with the following COTS ...@@ -50,7 +50,7 @@ At the moment of writing this document interoperability with the following COTS
## 1.1 gNB build and configuration ## 1.1 gNB build and configuration
To get the code and build the gNB executable: To get the code and build the gNB executable:
### Ubuntu 18.04 ### Build gNB
```bash ```bash
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
git checkout develop git checkout develop
...@@ -61,42 +61,6 @@ To get the code and build the gNB executable: ...@@ -61,42 +61,6 @@ To get the code and build the gNB executable:
./build_oai --gNB -w USRP ./build_oai --gNB -w USRP
``` ```
### Ubuntu 20.04
```bash
# Build UHD from source
# https://files.ettus.com/manual/page_build_guide.html
sudo apt-get install libboost-all-dev libusb-1.0-0-dev doxygen python3-docutils python3-mako python3-numpy python3-requests python3-ruamel.yaml python3-setuptools cmake build-essential
git clone https://github.com/EttusResearch/uhd.git
cd uhd/host
mkdir build
cd build
cmake ../
make -j 4
make test # This step is optional
sudo make install
sudo ldconfig
sudo uhd_images_downloader
git clone https://gitlab.eurecom.fr/oai/openairinterface5g.git
git checkout develop
# Install dependencies in Ubuntu 20.04
cd
cd openairinterface5g/
source oaienv
cd cmake_targets/
./install_external_packages.ubuntu20
# Build OAI gNB
cd
cd openairinterface5g/
source oaienv
cd cmake_targets/
./build_oai --gNB -w USRP
```
A reference configuration file for the **monolithic** gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf). A reference configuration file for the **monolithic** gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
......
# how to build phy sim
cd cmake_targets/
sudo ./build_oai --phy_simulators -c
cd phy_simulators/build/
# ULSCH sim
# bit level validation
# PUSCH encoding and decoding for 4 layers 2 CMD without data
sudo ./nr_ulschsim -R 106 -m9 -s13 -n100 -y4 -z4 -W4
# UL sim
# Uplink chain validation
# PUSCH on UE side and gNB side,whole chain for PUSCH
# No channel model on data domain signal
# No cross-path connection
# PMI = 0 is only unitary prcoding matrix
sudo ./nr_ulsim -n100 -m9 -r106 -s13 -W4 -y4 -z4
# How to build rfsim
sudo ./build_oai -c --gNB --nrUE -w SIMU
# How to run with rfsim
# 4x4 RANK 4
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.4layer.conf --rfsim --phy-test --l 2 --L 4
sudo ./nr-uesoftmodem --rfsim --phy-test --ue-nb-ant-rx 4 --ue-nb-ant-tx 4
# 4x4 RANK 2
sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.4layer.conf --rfsim --phy-test --l 2 --L 2
sudo ./nr-uesoftmodem --rfsim --phy-test --ue-nb-ant-rx 4 --ue-nb-ant-tx 4
doc/images/mimo_antenna_ports.png

18.3 KB

File added
doc/testbenches_doc_resources/4g-faraday-bench.png

90.2 KB

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds, positioning, shapes.symbols}
\usepackage{helvet}
\renewcommand*{\rmdefault}{\sfdefault}
\begin{document}
\begin{tikzpicture}
[
font=\footnotesize,
faraday/.style={minimum size=3cm, draw, dashed},
duplexer/.style={draw,fill=white},
]
\node[faraday, label={[anchor=south west]above left:Faraday cage}] (faraday) {};
\node[above left=0cm and 2.8cm of faraday, label=above:hutch] (hutch)
{\includegraphics[width=1.2cm]{server}};
\node[right=0.3cm of hutch, label=above:B210] (b210h)
{\includegraphics[width=1.2cm]{b210}} edge (hutch);
\node[below left=0.35cm of faraday.north east] (anto)
{\includegraphics[width=0.3cm]{antenna}};
\draw (b210h) -| node [pos=0.25, duplexer] {B7} (anto);
\node[below left=0cm and 2.8cm of faraday, label=above:starsky] (starsky)
{\includegraphics[width=1.2cm]{server}};
\node[right=0.3cm of starsky, label=above:B210] (b210s)
{\includegraphics[width=1.2cm]{b210}} edge (starsky);
\draw (hutch) -- (b210h);
\node[above left=0.35cm of faraday.south east] (antn)
{\includegraphics[width=0.3cm]{antenna}};
\draw (b210s) -| node [pos=0.35, duplexer] {B40} (antn);
\node[below right=-0.2cm and 0.8cm of b210s] (antn2)
{\includegraphics[width=0.3cm]{antenna}};
\draw (b210s) -| (antn2);
\node[left=5cm of faraday, label=above:nano] (nano)
{\includegraphics[width=1.2cm]{server}};
\draw (hutch) -- (nano);
\draw (starsky) -- (nano);
\node[above right=0.0cm and 0.35cm of faraday.west] (phone1)
{\includegraphics[height=0.5cm]{phone}};
\node[below right=0.0cm and 0.35cm of faraday.west] (phone2)
{\includegraphics[height=0.5cm]{phone}};
\draw (nano) -- node[above] {USB/adb} +(5cm,0) |- (phone1);
\draw (nano) -- +(5cm,0) |- (phone2);
\node[right=1.5cm of faraday, label=above:B210] (b210c)
{\includegraphics[width=1.2cm]{b210}};
\node[left=.5cm of faraday.east] (antc)
{\includegraphics[width=0.3cm]{antenna}};
\draw (b210c) -- node [pos=0.35, duplexer] {B7UE} (antc);
\node[right=0.7cm of b210c, label=above:carabe] (carabe)
{\includegraphics[width=1.2cm]{server}}
edge (b210c);
\end{tikzpicture}
\end{document}
File added
doc/testbenches_doc_resources/5g-nsa-faraday-bench.png

87.3 KB

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds, positioning, shapes.symbols}
\usepackage{helvet}
\renewcommand*{\rmdefault}{\sfdefault}
\begin{document}
\begin{tikzpicture}
[
font=\footnotesize,
faraday/.style={minimum size=3cm, draw, dashed},
duplexer/.style={draw,fill=white},
]
\node[faraday, label={[anchor=south east]above right:Faraday cage}] (faraday) {};
\node[above left=0cm and 2.8cm of faraday, label=above:obelix] (obelix)
{\includegraphics[width=1.2cm]{server}};
\node[right=0.3cm of obelix, label=above:B200-mini] (b210o)
{\includegraphics[width=1.2cm]{b200-mini}} edge (obelix);
\node[below right=0.35cm of faraday.north west] (anto)
{\includegraphics[width=0.3cm]{antenna}};
\draw (b210o) -| node [pos=0.2, duplexer] {B7} (anto);
\node[below left=0cm and 2.8cm of faraday, label=above:nepes] (nepes)
{\includegraphics[width=1.2cm]{server}};
\node[right=0.3cm of nepes, label=above:B200-mini] (b210n)
{\includegraphics[width=1.2cm]{b200-mini}} edge (nepes);
\draw (obelix) -- (b210o);
\node[above right=0.35cm of faraday.south west] (antn)
{\includegraphics[width=0.3cm]{antenna}};
\draw (b210n) -| node [pos=0.2, duplexer] {B78} (antn);
\node[left=5cm of faraday, label=above:porcepix] (porcepix)
{\includegraphics[width=1.2cm]{server}};
\draw (obelix) -- (porcepix);
\draw (nepes) -- (porcepix);
\node[right=1.5cm of faraday, label=above:RM500Q-GL] (quectel)
{\includegraphics[height=1.2cm]{quectel}};
\node[above left=-0.1cm and 0.2cm of faraday.east] (aq2)
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[above=-0.2cm of aq2] (aq1)
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[below=-0.2cm of aq2] (aq3)
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[below=-0.2cm of aq3]
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[right=1cm of quectel, label=above:idefix] (idefix)
{\includegraphics[width=1.2cm]{server}}
edge (quectel);
\end{tikzpicture}
\end{document}
File added
doc/testbenches_doc_resources/5g-ota-bench.png

87.9 KB

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds, positioning, shapes.symbols}
\usepackage{helvet}
\renewcommand*{\rmdefault}{\sfdefault}
\begin{document}
\begin{tikzpicture}
[
font=\footnotesize,
faraday/.style={minimum size=3cm, draw, dashed},
duplexer/.style={draw,fill=white},
]
\node[label=above:porcepix] (porcepix)
{\includegraphics[width=1.2cm]{server}};
\node[above right=1cm and 2cm of porcepix, label=above:asterix] (asterix)
{\includegraphics[width=1.2cm]{server}}
edge (porcepix);
\node[right=0.3cm of asterix, label=above:N310] (n310a)
{\includegraphics[width=1.5cm]{n310}} edge (asterix);
\node[right=.2cm of n310a, duplexer] (b78o) {B78} edge (n310a);
\node[below right=-0.1cm and 0.35cm of b78o.east] (anto1)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[above right=-0.1cm and 0.35cm of b78o.east] (anto2)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[right=2cm of porcepix, label=above:obelix] (obelix)
{\includegraphics[width=1.2cm]{server}}
edge (porcepix);
\node[above right=-0.5cm and 0.3cm of obelix, label=above:N310] (n310o)
{\includegraphics[width=1.5cm]{n310}} edge (obelix);
\node[right=.2cm of n310o, duplexer] (b78o) {B40} edge (n310o);
\node[below right=-0.1cm and 0.35cm of b78o.east] (anto1)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[above right=-0.1cm and 0.35cm of b78o.east] (anto2)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[below right=-0.5cm and 0.3cm of obelix, label=above:X310] (x310o)
{\includegraphics[width=1.5cm]{x310}} edge (obelix);
\node[right=.2cm of x310o, duplexer] (b78o) {B78} edge (x310o);
\node[below right=-0.1cm and 0.35cm of b78o.east] (anto1)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[above right=-0.1cm and 0.35cm of b78o.east] (anto2)
{\includegraphics[width=0.3cm]{antenna}} edge (b78o);
\node[right=5.0cm of n310o, label=above:RM500Q-GL] (quectel)
{\includegraphics[height=1.2cm]{quectel}};
\node[above left=-0.1cm and 0.8cm of quectel.west] (aq2)
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[above=-0.2cm of aq2] (aq1)
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[below=-0.2cm of aq2] (aq3)
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[below=-0.2cm of aq3]
{\includegraphics[width=0.3cm]{antenna}} edge (quectel);
\node[right=1cm of quectel, label=above:nrmodule2] (nrmodule2)
{\includegraphics[width=1.2cm]{server}}
edge (quectel);
\end{tikzpicture}
\end{document}
File added
doc/testbenches_doc_resources/b200-mini.png

233 KB

doc/testbenches_doc_resources/b210.jpg

32.1 KB

doc/testbenches_doc_resources/indoor_live.jpg

248 KB

doc/testbenches_doc_resources/legacy1.jpg

105 KB

doc/testbenches_doc_resources/legacy2.jpg

119 KB

doc/testbenches_doc_resources/n310.png

118 KB

doc/testbenches_doc_resources/next_ci.jpg

154 KB

doc/testbenches_doc_resources/next_dev.jpg

181 KB

doc/testbenches_doc_resources/outdoor_live.jpg

164 KB

File added
doc/testbenches_doc_resources/quectel.png

86.4 KB

File added
doc/testbenches_doc_resources/x310.jpg

10.9 KB

...@@ -128,7 +128,6 @@ void rx_func(void *param) { ...@@ -128,7 +128,6 @@ void rx_func(void *param) {
int slot_rx = info->slot_rx; int slot_rx = info->slot_rx;
int frame_tx = info->frame_tx; int frame_tx = info->frame_tx;
int slot_tx = info->slot_tx; int slot_tx = info->slot_tx;
sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config; nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
start_meas(&softmodem_stats_rxtx_sf); start_meas(&softmodem_stats_rxtx_sf);
......
...@@ -99,9 +99,6 @@ int attach_rru(RU_t *ru); ...@@ -99,9 +99,6 @@ int attach_rru(RU_t *ru);
int connect_rau(RU_t *ru); int connect_rau(RU_t *ru);
static void NRRCconfig_RU(void); static void NRRCconfig_RU(void);
uint16_t sf_ahead;
uint16_t slot_ahead;
uint16_t sl_ahead;
extern int emulate_rf; extern int emulate_rf;
extern int numerology; extern int numerology;
...@@ -372,8 +369,8 @@ void fh_if4p5_south_in(RU_t *ru, ...@@ -372,8 +369,8 @@ void fh_if4p5_south_in(RU_t *ru,
proc->frame_rx = f; proc->frame_rx = f;
proc->timestamp_rx = (proc->frame_rx * fp->samples_per_subframe * 10) + fp->get_samples_slot_timestamp(proc->tti_rx, fp, 0); proc->timestamp_rx = (proc->frame_rx * fp->samples_per_subframe * 10) + fp->get_samples_slot_timestamp(proc->tti_rx, fp, 0);
// proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_subframe); // proc->timestamp_tx = proc->timestamp_rx + (4*fp->samples_per_subframe);
proc->tti_tx = (sl+(fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; proc->tti_tx = (sl+ru->sl_ahead)%fp->slots_per_frame;
proc->frame_tx = (sl>(fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (f+1)&1023 : f; proc->frame_tx = (sl>(fp->slots_per_frame-1-(ru->sl_ahead))) ? (f+1)&1023 : f;
if (proc->first_rx == 0) { if (proc->first_rx == 0) {
if (proc->tti_rx != *slot) { if (proc->tti_rx != *slot) {
...@@ -1307,8 +1304,7 @@ void *ru_thread( void *param ) { ...@@ -1307,8 +1304,7 @@ void *ru_thread( void *param ) {
} }
} }
sf_ahead = (uint16_t) ceil((float)6/(0x01<<fp->numerology_index)); LOG_I(PHY, "Signaling main thread that RU %d is ready, sl_ahead %d\n",ru->idx,ru->sl_ahead);
LOG_I(PHY, "Signaling main thread that RU %d is ready, sf_ahead %d\n",ru->idx,sf_ahead);
pthread_mutex_lock(&RC.ru_mutex); pthread_mutex_lock(&RC.ru_mutex);
RC.ru_mask &= ~(1<<ru->idx); RC.ru_mask &= ~(1<<ru->idx);
pthread_cond_signal(&RC.ru_cond); pthread_cond_signal(&RC.ru_cond);
...@@ -1326,6 +1322,7 @@ void *ru_thread( void *param ) { ...@@ -1326,6 +1322,7 @@ void *ru_thread( void *param ) {
else LOG_I(PHY,"RU %d rf device ready\n",ru->idx); else LOG_I(PHY,"RU %d rf device ready\n",ru->idx);
} else LOG_I(PHY,"RU %d no rf device\n",ru->idx); } else LOG_I(PHY,"RU %d no rf device\n",ru->idx);
LOG_I(PHY,"RU %d RF started\n",ru->idx);
// start trx write thread // start trx write thread
if(usrp_tx_thread == 1) { if(usrp_tx_thread == 1) {
if (ru->start_write_thread) { if (ru->start_write_thread) {
...@@ -1393,9 +1390,12 @@ void *ru_thread( void *param ) { ...@@ -1393,9 +1390,12 @@ void *ru_thread( void *param ) {
opp_enabled = opp_enabled0; opp_enabled = opp_enabled0;
} }
if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul); if (initial_wait == 0 && ru->rx_fhaul.trials > 1000) reset_meas(&ru->rx_fhaul);
proc->timestamp_tx = proc->timestamp_rx + (sf_ahead*fp->samples_per_subframe); proc->timestamp_tx = proc->timestamp_rx;
proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(fp->slots_per_subframe*sf_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx; int sl=proc->tti_tx;
proc->tti_tx = (proc->tti_rx + (fp->slots_per_subframe*sf_ahead))%fp->slots_per_frame; for (int slidx=0;slidx<ru->sl_ahead;slidx++)
proc->timestamp_tx += fp->get_samples_per_slot((sl+slidx)%fp->slots_per_frame,fp);
proc->frame_tx = (proc->tti_rx > (fp->slots_per_frame-1-(ru->sl_ahead))) ? (proc->frame_rx+1)&1023 : proc->frame_rx;
proc->tti_tx = (proc->tti_rx + ru->sl_ahead)%fp->slots_per_frame;
LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n", LOG_D(PHY,"AFTER fh_south_in - SFN/SL:%d%d RU->proc[RX:%d.%d TX:%d.%d] RC.gNB[0]:[RX:%d%d TX(SFN):%d]\n",
frame,slot, frame,slot,
proc->frame_rx,proc->tti_rx, proc->frame_rx,proc->tti_rx,
...@@ -1426,7 +1426,6 @@ void *ru_thread( void *param ) { ...@@ -1426,7 +1426,6 @@ void *ru_thread( void *param ) {
// Do PRACH RU processing // Do PRACH RU processing
int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST); int prach_id=find_nr_prach_ru(ru,proc->frame_rx,proc->tti_rx,SEARCH_EXIST);
uint8_t prachStartSymbol,N_dur; uint8_t prachStartSymbol,N_dur;
if (prach_id>=0) { if (prach_id>=0) {
T(T_GNB_PHY_PRACH_INPUT_SIGNAL, T_INT(proc->frame_rx), T_INT(proc->tti_rx), T_INT(0), T(T_GNB_PHY_PRACH_INPUT_SIGNAL, T_INT(proc->frame_rx), T_INT(proc->tti_rx), T_INT(0),
T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx-1,fp,0)]/*-ru->N_TA_offset*/, fp->get_samples_per_slot(proc->tti_rx,fp)*4*2)); T_BUFFER(&ru->common.rxdata[0][fp->get_samples_slot_timestamp(proc->tti_rx-1,fp,0)]/*-ru->N_TA_offset*/, fp->get_samples_per_slot(proc->tti_rx,fp)*4*2));
...@@ -2098,9 +2097,7 @@ static void NRRCconfig_RU(void) { ...@@ -2098,9 +2097,7 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);; RC.ru[j]->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr); RC.ru[j]->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr); RC.ru[j]->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
} //strcmp(local_rf, "yes") == 0 } //strcmp(local_rf, "yes") == 0
else { else {
printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr)); printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
...@@ -2120,8 +2117,6 @@ static void NRRCconfig_RU(void) { ...@@ -2120,8 +2117,6 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->function = NGFI_RAU_IF5;
RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE; RC.ru[j]->eth_params.transp_preference = ETH_UDP_IF5_ECPRI_MODE;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_ecpri_if5") == 0) {
RC.ru[j]->if_south = REMOTE_IF5;
} else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) { } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
RC.ru[j]->if_south = REMOTE_IF5; RC.ru[j]->if_south = REMOTE_IF5;
RC.ru[j]->function = NGFI_RAU_IF5; RC.ru[j]->function = NGFI_RAU_IF5;
...@@ -2144,7 +2139,13 @@ static void NRRCconfig_RU(void) { ...@@ -2144,7 +2139,13 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr); RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr);
RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr); RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr);
RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr); RC.ru[j]->do_precoding = *(RUParamList.paramarray[j][RU_DO_PRECODING].iptr);
RC.ru[j]->sl_ahead = *(RUParamList.paramarray[j][RU_SL_AHEAD].iptr);
RC.ru[j]->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
for (i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
RC.ru[j]->openair0_cfg.nr_flag = *(RUParamList.paramarray[j][RU_NR_FLAG].iptr);
RC.ru[j]->openair0_cfg.nr_band = RC.ru[j]->band[0];
RC.ru[j]->openair0_cfg.nr_scs_for_raster = *(RUParamList.paramarray[j][RU_NR_SCS_FOR_RASTER].iptr);
printf("[RU %d] Setting nr_flag %d, nr_band %d, nr_scs_for_raster %d\n",j,RC.ru[j]->openair0_cfg.nr_flag,RC.ru[j]->openair0_cfg.nr_band,RC.ru[j]->openair0_cfg.nr_scs_for_raster);
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) { if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt; RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n" #define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n" #define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n" #define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n" #define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n" #define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
#define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n" #define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n"
......
...@@ -732,7 +732,7 @@ int main( int argc, char **argv ) { ...@@ -732,7 +732,7 @@ int main( int argc, char **argv ) {
printf("wait_gNBs()\n"); printf("wait_gNBs()\n");
wait_gNBs(); wait_gNBs();
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU); printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
int sl_ahead=6;
if (RC.nb_RU >0) { if (RC.nb_RU >0) {
printf("Initializing RU threads\n"); printf("Initializing RU threads\n");
init_NR_RU(get_softmodem_params()->rf_config_file); init_NR_RU(get_softmodem_params()->rf_config_file);
...@@ -740,7 +740,10 @@ int main( int argc, char **argv ) { ...@@ -740,7 +740,10 @@ int main( int argc, char **argv ) {
for (ru_id=0; ru_id<RC.nb_RU; ru_id++) { for (ru_id=0; ru_id<RC.nb_RU; ru_id++) {
RC.ru[ru_id]->rf_map.card=0; RC.ru[ru_id]->rf_map.card=0;
RC.ru[ru_id]->rf_map.chain=CC_id+chain_offset; RC.ru[ru_id]->rf_map.chain=CC_id+chain_offset;
if (ru_id==0) sl_ahead = RC.ru[ru_id]->sl_ahead;
else AssertFatal(RC.ru[ru_id]->sl_ahead != RC.ru[0]->sl_ahead,"RU %d has different sl_ahead %d than RU 0 %d\n",ru_id,RC.ru[ru_id]->sl_ahead,RC.ru[0]->sl_ahead);
} }
} }
config_sync_var=0; config_sync_var=0;
...@@ -757,6 +760,7 @@ int main( int argc, char **argv ) { ...@@ -757,6 +760,7 @@ int main( int argc, char **argv ) {
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration) // once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
printf("ALL RUs ready - init gNBs\n"); printf("ALL RUs ready - init gNBs\n");
for (int idx=0;idx<RC.nb_nr_L1_inst;idx++) RC.gNB[idx]->if_inst->sl_ahead = sl_ahead;
if(IS_SOFTMODEM_DOSCOPE) { if(IS_SOFTMODEM_DOSCOPE) {
sleep(1); sleep(1);
scopeParms_t p; scopeParms_t p;
...@@ -835,10 +839,10 @@ int main( int argc, char **argv ) { ...@@ -835,10 +839,10 @@ int main( int argc, char **argv ) {
} }
for (int inst = 0; inst < NB_RU; inst++) { for (int inst = 0; inst < NB_RU; inst++) {
kill_NR_RU_proc(inst);
nr_phy_free_RU(RC.ru[inst]); nr_phy_free_RU(RC.ru[inst]);
} }
free_lte_top();
pthread_cond_destroy(&sync_cond); pthread_cond_destroy(&sync_cond);
pthread_mutex_destroy(&sync_mutex); pthread_mutex_destroy(&sync_mutex);
pthread_cond_destroy(&nfapi_sync_cond); pthread_cond_destroy(&nfapi_sync_cond);
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \ {"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, i8ptr:&threequarter_fs, defintval:0, TYPE_INT8, 0}, \
{"m" , CONFIG_HLP_DLMCS_PHYTEST,0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \ {"m" , CONFIG_HLP_DLMCS_PHYTEST,0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
{"l" , CONFIG_HLP_DLNL_PHYTEST,0, uptr:&target_dl_Nl, defintval:0, TYPE_UINT, 0}, \ {"l" , CONFIG_HLP_DLNL_PHYTEST,0, uptr:&target_dl_Nl, defintval:0, TYPE_UINT, 0}, \
{"L" , CONFIG_HLP_ULNL_PHYTEST,0, uptr:&target_ul_Nl, defintval:0, TYPE_UINT, 0}, \
{"t" , CONFIG_HLP_ULMCS_PHYTEST,0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \ {"t" , CONFIG_HLP_ULMCS_PHYTEST,0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
{"M" , CONFIG_HLP_DLBW_PHYTEST,0, uptr:&target_dl_bw, defintval:0, TYPE_UINT, 0}, \ {"M" , CONFIG_HLP_DLBW_PHYTEST,0, uptr:&target_dl_bw, defintval:0, TYPE_UINT, 0}, \
{"T" , CONFIG_HLP_ULBW_PHYTEST,0, uptr:&target_ul_bw, defintval:0, TYPE_UINT, 0}, \ {"T" , CONFIG_HLP_ULBW_PHYTEST,0, uptr:&target_ul_bw, defintval:0, TYPE_UINT, 0}, \
...@@ -36,6 +37,7 @@ ...@@ -36,6 +37,7 @@
extern threads_t threads; extern threads_t threads;
extern uint32_t target_dl_mcs; extern uint32_t target_dl_mcs;
extern uint32_t target_dl_Nl; extern uint32_t target_dl_Nl;
extern uint32_t target_ul_Nl;
extern uint32_t target_ul_mcs; extern uint32_t target_ul_mcs;
extern uint32_t target_dl_bw; extern uint32_t target_dl_bw;
extern uint32_t target_ul_bw; extern uint32_t target_ul_bw;
......
...@@ -613,7 +613,7 @@ void processSlotTX(void *arg) { ...@@ -613,7 +613,7 @@ void processSlotTX(void *arg) {
int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx); int tx_slot_type = nr_ue_slot_select(cfg, proc->frame_tx, proc->nr_slot_tx);
uint8_t gNB_id = 0; uint8_t gNB_id = 0;
LOG_D(PHY,"%d.%d => slot type %d\n",proc->frame_tx,proc->nr_slot_tx,tx_slot_type); LOG_D(PHY,"processSlotTX %d.%d => slot type %d\n",proc->frame_tx,proc->nr_slot_tx,tx_slot_type);
if (tx_slot_type == NR_UPLINK_SLOT || tx_slot_type == NR_MIXED_SLOT){ if (tx_slot_type == NR_UPLINK_SLOT || tx_slot_type == NR_MIXED_SLOT){
// trigger L2 to run ue_scheduler thru IF module // trigger L2 to run ue_scheduler thru IF module
...@@ -713,7 +713,8 @@ void processSlotRX(void *arg) { ...@@ -713,7 +713,8 @@ void processSlotRX(void *arg) {
LOG_D(PHY, "Sending Uplink data \n"); LOG_D(PHY, "Sending Uplink data \n");
nr_ue_pusch_common_procedures(UE, nr_ue_pusch_common_procedures(UE,
proc->nr_slot_tx, proc->nr_slot_tx,
&UE->frame_parms,1); &UE->frame_parms,
UE->frame_parms.nb_antennas_tx);
} }
if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) { if (UE->UE_mode[gNB_id] > NOT_SYNCHED && UE->UE_mode[gNB_id] < PUSCH) {
......
...@@ -200,7 +200,6 @@ void install_nr_schedule_handlers(NR_IF_Module_t *if_inst); ...@@ -200,7 +200,6 @@ void install_nr_schedule_handlers(NR_IF_Module_t *if_inst);
void install_schedule_handlers(IF_Module_t *if_inst); void install_schedule_handlers(IF_Module_t *if_inst);
extern int single_thread_flag; extern int single_thread_flag;
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
extern uint16_t slot_ahead;
void oai_create_enb(void) { void oai_create_enb(void) {
int bodge_counter=0; int bodge_counter=0;
...@@ -459,6 +458,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { ...@@ -459,6 +458,7 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) {
//wait.tv_nsec = 0; //wait.tv_nsec = 0;
// wake up TX for subframe n+sf_ahead // wake up TX for subframe n+sf_ahead
// lock the TX mutex and make sure the thread is ready // lock the TX mutex and make sure the thread is ready
AssertFatal(gNB->if_inst->sl_ahead==6,"gNB->if_inst->sl_ahead %d : This is hard-coded to 6 in nfapi P7!!!\n",gNB->if_inst->sl_ahead);
if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) { if (pthread_mutex_timedlock(&L1_proc->mutex,&wait) != 0) {
LOG_E( PHY, "[gNB] ERROR pthread_mutex_lock for gNB RXTX thread %d (IC %d)\n", L1_proc->slot_rx&1,L1_proc->instance_cnt ); LOG_E( PHY, "[gNB] ERROR pthread_mutex_lock for gNB RXTX thread %d (IC %d)\n", L1_proc->slot_rx&1,L1_proc->instance_cnt );
exit_fun( "error locking mutex_rxtx" ); exit_fun( "error locking mutex_rxtx" );
...@@ -485,11 +485,11 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) { ...@@ -485,11 +485,11 @@ int wake_gNB_rxtx(PHY_VARS_gNB *gNB, uint16_t sfn, uint16_t slot) {
// The last (TS_rx mod samples_per_frame) was n*samples_per_tti, // The last (TS_rx mod samples_per_frame) was n*samples_per_tti,
// we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti, // we want to generate subframe (n+N), so TS_tx = TX_rx+N*samples_per_tti,
// and proc->subframe_tx = proc->subframe_rx+sf_ahead // and proc->subframe_tx = proc->subframe_rx+sf_ahead
L1_proc->timestamp_tx = proc->timestamp_rx + (slot_ahead *fp->samples_per_subframe); L1_proc->timestamp_tx = proc->timestamp_rx + (gNB->if_inst->sl_ahead *fp->samples_per_subframe);
L1_proc->frame_rx = proc->frame_rx; L1_proc->frame_rx = proc->frame_rx;
L1_proc->slot_rx = proc->slot_rx; L1_proc->slot_rx = proc->slot_rx;
L1_proc->frame_tx = (L1_proc->slot_rx > (19-slot_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx; L1_proc->frame_tx = (L1_proc->slot_rx > (19-gNB->if_inst->sl_ahead)) ? (L1_proc->frame_rx+1)&1023 : L1_proc->frame_rx;
L1_proc->slot_tx = (L1_proc->slot_rx + slot_ahead)%20; L1_proc->slot_tx = (L1_proc->slot_rx + gNB->if_inst->sl_ahead)%20;
//LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx); //LOG_D(PHY, "sfn/sf:%d%d proc[rx:%d%d] rx:%d%d] About to wake rxtx thread\n\n", sfn, slot, proc->frame_rx, proc->slot_rx, L1_proc->frame_rx, L1_proc->slot_rx);
//NFAPI_TRACE(NFAPI_TRACE_INFO, "\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx); //NFAPI_TRACE(NFAPI_TRACE_INFO, "\nEntering wake_gNB_rxtx sfn %d slot %d\n",L1_proc->frame_rx,L1_proc->slot_rx);
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
#define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64 #define FAPI_NR_MAX_RA_OCCASION_PER_CSIRS 64
// Constants Defined in 38.213 // Constants Defined in 38.213
#define FAPI_NR_MAX_CORESET_PER_BWP 3 #define FAPI_NR_MAX_CORESET_PER_BWP 3
#define FAPI_NR_MAX_SS 10 #define FAPI_NR_MAX_SS_PER_BWP 10
#define FAPI_NR_MAX_SS FAPI_NR_MAX_SS_PER_BWP*NR_MAX_NUM_BWP
/// RX_IND /// RX_IND
......
...@@ -308,6 +308,7 @@ typedef struct ...@@ -308,6 +308,7 @@ typedef struct
uint8_t transform_precoding; uint8_t transform_precoding;
uint16_t data_scrambling_id; uint16_t data_scrambling_id;
uint8_t nrOfLayers; uint8_t nrOfLayers;
uint8_t Tpmi;
//DMRS //DMRS
uint16_t ul_dmrs_symb_pos; uint16_t ul_dmrs_symb_pos;
uint8_t dmrs_config_type; uint8_t dmrs_config_type;
...@@ -464,6 +465,7 @@ typedef struct { ...@@ -464,6 +465,7 @@ typedef struct {
uint8_t nEpreRatioOfPDSCHToPTRS; uint8_t nEpreRatioOfPDSCHToPTRS;
/// MCS table for this DLSCH /// MCS table for this DLSCH
uint8_t mcs_table; uint8_t mcs_table;
uint32_t tbslbrm;
uint8_t nscid; uint8_t nscid;
uint16_t dlDmrsScramblingId; uint16_t dlDmrsScramblingId;
uint16_t pduBitmap; uint16_t pduBitmap;
......
...@@ -776,6 +776,10 @@ typedef struct { ...@@ -776,6 +776,10 @@ typedef struct {
nfapi_nr_dl_dci_pdu_t dci_pdu[MAX_DCI_CORESET]; nfapi_nr_dl_dci_pdu_t dci_pdu[MAX_DCI_CORESET];
} nfapi_nr_dl_tti_pdcch_pdu_rel15_t; } nfapi_nr_dl_tti_pdcch_pdu_rel15_t;
typedef struct {
uint32_t tbSizeLbrmBytes;
}nfapi_v3_pdsch_maintenance_parameters_t;
typedef struct { typedef struct {
uint16_t pduBitmap; uint16_t pduBitmap;
uint16_t rnti; uint16_t rnti;
...@@ -854,6 +858,7 @@ typedef struct { ...@@ -854,6 +858,7 @@ typedef struct {
uint8_t nEpreRatioOfPDSCHToPTRS; uint8_t nEpreRatioOfPDSCHToPTRS;
// Beamforming // Beamforming
nfapi_nr_tx_precoding_and_beamforming_t precodingAndBeamforming; nfapi_nr_tx_precoding_and_beamforming_t precodingAndBeamforming;
nfapi_v3_pdsch_maintenance_parameters_t maintenance_parms_v3;
}nfapi_nr_dl_tti_pdsch_pdu_rel15_t; }nfapi_nr_dl_tti_pdsch_pdu_rel15_t;
...@@ -1195,6 +1200,10 @@ typedef struct ...@@ -1195,6 +1200,10 @@ typedef struct
#define PUSCH_PDU_BITMAP_PUSCH_PTRS 0x4 #define PUSCH_PDU_BITMAP_PUSCH_PTRS 0x4
#define PUSCH_PDU_BITMAP_DFTS_OFDM 0x8 #define PUSCH_PDU_BITMAP_DFTS_OFDM 0x8
typedef struct {
uint32_t tbSizeLbrmBytes;
}nfapi_v3_pusch_maintenance_parameters_t;
typedef struct typedef struct
{ {
uint16_t pdu_bit_map;//Bitmap indicating presence of optional PDUs (see above) uint16_t pdu_bit_map;//Bitmap indicating presence of optional PDUs (see above)
...@@ -1240,7 +1249,7 @@ typedef struct ...@@ -1240,7 +1249,7 @@ typedef struct
nfapi_nr_dfts_ofdm_t dfts_ofdm; nfapi_nr_dfts_ofdm_t dfts_ofdm;
//beamforming //beamforming
nfapi_nr_ul_beamforming_t beamforming; nfapi_nr_ul_beamforming_t beamforming;
nfapi_v3_pdsch_maintenance_parameters_t maintenance_parms_v3;
} nfapi_nr_pusch_pdu_t; } nfapi_nr_pusch_pdu_t;
//for pucch_pdu: //for pucch_pdu:
......
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
#define FAPI2_IP_DSCP 0 #define FAPI2_IP_DSCP 0
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
extern uint16_t slot_ahead;
//uint16_t sf_ahead=4; //uint16_t sf_ahead=4;
...@@ -933,7 +932,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl ...@@ -933,7 +932,7 @@ int pnf_p7_slot_ind(pnf_p7_t* pnf_p7, uint16_t phy_id, uint16_t sfn, uint16_t sl
// save the curren time, sfn and slot // save the curren time, sfn and slot
pnf_p7->slot_start_time_hr = pnf_get_current_time_hr(); pnf_p7->slot_start_time_hr = pnf_get_current_time_hr();
slot_ahead = 6; int slot_ahead = 6;
uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead); uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead);
uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx); uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx);
uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx); uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx);
......
...@@ -481,16 +481,11 @@ uint32_t nr_compute_tbs(uint16_t Qm, ...@@ -481,16 +481,11 @@ uint32_t nr_compute_tbs(uint16_t Qm,
uint8_t tb_scaling, uint8_t tb_scaling,
uint8_t Nl); uint8_t Nl);
uint32_t nr_compute_tbslbrm(uint16_t table,
uint16_t nb_rb,
uint8_t Nl);
void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f); void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f);
void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f); void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f);
int nr_rate_matching_ldpc(uint8_t Ilbrm, int nr_rate_matching_ldpc(uint32_t Tbslbrm,
uint32_t Tbslbrm,
uint8_t BG, uint8_t BG,
uint16_t Z, uint16_t Z,
uint8_t *w, uint8_t *w,
...@@ -501,8 +496,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -501,8 +496,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
uint8_t rvidx, uint8_t rvidx,
uint32_t E); uint32_t E);
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
uint32_t Tbslbrm,
uint8_t BG, uint8_t BG,
uint16_t Z, uint16_t Z,
int16_t *w, int16_t *w,
......
...@@ -387,8 +387,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f) ...@@ -387,8 +387,7 @@ void nr_deinterleaving_ldpc(uint32_t E, uint8_t Qm, int16_t *e,int16_t *f)
} }
int nr_rate_matching_ldpc(uint8_t Ilbrm, int nr_rate_matching_ldpc(uint32_t Tbslbrm,
uint32_t Tbslbrm,
uint8_t BG, uint8_t BG,
uint16_t Z, uint16_t Z,
uint8_t *w, uint8_t *w,
...@@ -409,7 +408,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -409,7 +408,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
//Bit selection //Bit selection
N = (BG==1)?(66*Z):(50*Z); N = (BG==1)?(66*Z):(50*Z);
if (Ilbrm == 0) if (Tbslbrm == 0)
Ncb = N; Ncb = N;
else { else {
Nref = 3*Tbslbrm/(2*C); //R_LBRM = 2/3 Nref = 3*Tbslbrm/(2*C); //R_LBRM = 2/3
...@@ -419,11 +418,11 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -419,11 +418,11 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z; ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d, Ilbrm %d\n", E, F, Foffset,ind, Ncb, rvidx, Ilbrm); printf("nr_rate_matching_ldpc: E %d, F %d, Foffset %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n", E, F, Foffset,ind, Ncb, rvidx, Tbslbrm);
#endif #endif
if (Foffset > E) { if (Foffset > E) {
LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d)\n",Foffset,E); LOG_E(PHY,"nr_rate_matching: invalid parameters (Foffset %d > E %d) F %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n",Foffset,E,F, ind, Ncb, rvidx, Tbslbrm);
return -1; return -1;
} }
if (Foffset > Ncb) { if (Foffset > Ncb) {
...@@ -471,8 +470,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -471,8 +470,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
return 0; return 0;
} }
int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
uint32_t Tbslbrm,
uint8_t BG, uint8_t BG,
uint16_t Z, uint16_t Z,
int16_t *w, int16_t *w,
...@@ -498,7 +496,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, ...@@ -498,7 +496,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
//Bit selection //Bit selection
N = (BG==1)?(66*Z):(50*Z); N = (BG==1)?(66*Z):(50*Z);
if (Ilbrm == 0) if (Tbslbrm == 0)
Ncb = N; Ncb = N;
else { else {
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3 Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
...@@ -516,7 +514,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm, ...@@ -516,7 +514,7 @@ int nr_rate_matching_ldpc_rx(uint8_t Ilbrm,
} }
#ifdef RM_DEBUG #ifdef RM_DEBUG
printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d, Ilbrm %d\n", clear, E, ind, Ncb, rvidx, Ilbrm); printf("nr_rate_matching_ldpc_rx: Clear %d, E %d, k0 %d, Ncb %d, rvidx %d, Tbslbrm %d\n", clear, E, ind, Ncb, rvidx, Tbslbrm);
#endif #endif
if (clear==1) memset(w,0,Ncb*sizeof(int16_t)); if (clear==1) memset(w,0,Ncb*sizeof(int16_t));
......
...@@ -136,7 +136,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ...@@ -136,7 +136,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) {
} }
} }
int max_mimo_layers =(CSI_RS_antenna_ports<NR_MAX_NB_LAYERS) ? CSI_RS_antenna_ports : NR_MAX_NB_LAYERS; 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 **)); gNB->nr_mimo_precoding_matrix = (int32_t ***)malloc16(max_mimo_layers* sizeof(int32_t **));
int32_t ***mat = gNB->nr_mimo_precoding_matrix; int32_t ***mat = gNB->nr_mimo_precoding_matrix;
...@@ -236,7 +236,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ...@@ -236,7 +236,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) {
if((llb != ll) || (mmb != mm) || ((N1 == 1) && (N2 == 1))){ if((llb != ll) || (mmb != mm) || ((N1 == 1) && (N2 == 1))){
pmiq += 1; pmiq += 1;
mat[1][pmiq] = (int32_t *)malloc16((2*N1*N2)*(2)*sizeof(int32_t)); mat[1][pmiq] = (int32_t *)malloc16((2*N1*N2)*(2)*sizeof(int32_t));
LOG_I(PHY, "layer 2 Codebook pmiq = %d\n",pmiq); LOG_D(PHY, "layer 2 Codebook pmiq = %d\n",pmiq);
for(int j_col=0; j_col<2; j_col++) { for(int j_col=0; j_col<2; j_col++) {
if (j_col==0) { if (j_col==0) {
llc = llb; llc = llb;
...@@ -320,7 +320,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ...@@ -320,7 +320,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) {
if((llb != ll) || (mmb != mm)){ if((llb != ll) || (mmb != mm)){
pmiq += 1; pmiq += 1;
mat[2][pmiq] = (int32_t *)malloc16((2*N1*N2)*(3)*sizeof(int32_t)); mat[2][pmiq] = (int32_t *)malloc16((2*N1*N2)*(3)*sizeof(int32_t));
LOG_I(PHY, "layer 3 Codebook pmiq = %d\n",pmiq); LOG_D(PHY, "layer 3 Codebook pmiq = %d\n",pmiq);
for(int j_col=0; j_col<3; j_col++) { for(int j_col=0; j_col<3; j_col++) {
if (j_col==0) { if (j_col==0) {
llc = llb; llc = llb;
...@@ -411,7 +411,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) { ...@@ -411,7 +411,7 @@ int init_codebook_gNB(PHY_VARS_gNB *gNB) {
if((llb != ll) || (mmb != mm)){ if((llb != ll) || (mmb != mm)){
pmiq += 1; pmiq += 1;
mat[3][pmiq] = (int32_t *)malloc16((2*N1*N2)*4*sizeof(int32_t)); mat[3][pmiq] = (int32_t *)malloc16((2*N1*N2)*4*sizeof(int32_t));
LOG_I(PHY, "layer 4 pmiq = %d\n",pmiq); LOG_D(PHY, "layer 4 pmiq = %d\n",pmiq);
for(int j_col=0; j_col<4; j_col++) { for(int j_col=0; j_col<4; j_col++) {
if (j_col==0) { if (j_col==0) {
llc = llb; llc = llb;
...@@ -692,10 +692,18 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -692,10 +692,18 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
pusch_vars[ULSCH_id]->ul_ch_magb0 = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->ul_ch_magb0 = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **)malloc16(n_buf*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->rho = (int32_t **)malloc16(n_buf*sizeof(int32_t *) ); pusch_vars[ULSCH_id]->rho = (int32_t ***)malloc16(Prx*sizeof(int32_t **) );
pusch_vars[ULSCH_id]->llr_layers = (int16_t **)malloc16(max_ul_mimo_layers*sizeof(int32_t *) );
for (i=0; i<Prx; i++) { for (i=0; i<Prx; i++) {
pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot );
pusch_vars[ULSCH_id]->rho[i] = (int32_t **)malloc16_clear(NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS*sizeof(int32_t*));
for (int j=0; j< max_ul_mimo_layers; j++) {
for (int k=0; k<max_ul_mimo_layers; k++) {
pusch_vars[ULSCH_id]->rho[i][j*max_ul_mimo_layers+k]=(int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot );
}
}
} }
for (i=0; i<n_buf; i++) { for (i=0; i<n_buf; i++) {
pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_slot );
...@@ -707,7 +715,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB, ...@@ -707,7 +715,10 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
pusch_vars[ULSCH_id]->ul_ch_magb0[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->ul_ch_magb0[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot );
pusch_vars[ULSCH_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot );
pusch_vars[ULSCH_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot ); pusch_vars[ULSCH_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot );
pusch_vars[ULSCH_id]->rho[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*nb_re_pusch2*fp->symbols_per_slot ); }
for (i=0; i< max_ul_mimo_layers; i++) {
pusch_vars[ULSCH_id]->llr_layers[i] = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear
} }
pusch_vars[ULSCH_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear pusch_vars[ULSCH_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) ); // [hna] 6144 is LTE and (8*((3*8*6144)+12)) is not clear
pusch_vars[ULSCH_id]->ul_valid_re_per_slot = (int16_t *)malloc16_clear( sizeof(int16_t)*fp->symbols_per_slot); pusch_vars[ULSCH_id]->ul_valid_re_per_slot = (int16_t *)malloc16_clear( sizeof(int16_t)*fp->symbols_per_slot);
...@@ -824,8 +835,15 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -824,8 +835,15 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
NR_gNB_PUSCH** pusch_vars = gNB->pusch_vars; NR_gNB_PUSCH** pusch_vars = gNB->pusch_vars;
for (int ULSCH_id=0; ULSCH_id<gNB->number_of_nr_ulsch_max; ULSCH_id++) { for (int ULSCH_id=0; ULSCH_id<gNB->number_of_nr_ulsch_max; ULSCH_id++) {
for (int i=0; i< max_ul_mimo_layers; i++)
free_and_zero(pusch_vars[ULSCH_id]->llr_layers[i]);
for (int i = 0; i < Prx; i++) { for (int i = 0; i < Prx; i++) {
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]); free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
for (int j=0; j< max_ul_mimo_layers; j++) {
for (int k=0; k<max_ul_mimo_layers; k++)
free_and_zero(pusch_vars[ULSCH_id]->rho[i][j*max_ul_mimo_layers+k]);
}
free_and_zero(pusch_vars[ULSCH_id]->rho[i]);
} }
for (int i = 0; i < n_buf; i++) { for (int i = 0; i < n_buf; i++) {
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates[i]);
...@@ -837,8 +855,8 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB) ...@@ -837,8 +855,8 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb0[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb0[i]);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag[i]);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb[i]); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb[i]);
free_and_zero(pusch_vars[ULSCH_id]->rho[i]);
} }
free_and_zero(pusch_vars[ULSCH_id]->llr_layers);
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext); free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates);
free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext); free_and_zero(pusch_vars[ULSCH_id]->ul_ch_estimates_ext);
......
...@@ -41,7 +41,7 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -41,7 +41,7 @@ int nr_phy_init_RU(RU_t *ru) {
int p; int p;
int re; int re;
LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d\n",ru_if_types[ru->if_south],ru->nb_tx); LOG_I(PHY,"Initializing RU signal buffers (if_south %s) nb_tx %d, nb_rx %d\n",ru_if_types[ru->if_south],ru->nb_tx, ru->nb_rx);
nfapi_nr_config_request_scf_t *cfg; nfapi_nr_config_request_scf_t *cfg;
ru->nb_log_antennas=0; ru->nb_log_antennas=0;
...@@ -205,12 +205,11 @@ void nr_phy_free_RU(RU_t *ru) ...@@ -205,12 +205,11 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->prach_rxsigF[j][i]); free_and_zero(ru->prach_rxsigF[j][i]);
free_and_zero(ru->prach_rxsigF[j]); free_and_zero(ru->prach_rxsigF[j]);
} }
if (ru->do_precoding == 1) { if (ru->do_precoding == 1) {
for (i = 0; i < ru->num_gNB; i++) { for (i = 0; i < ru->num_gNB; i++) {
for (p = 0; p < ru->nb_log_antennas; p++) { for (p = 0; p < ru->nb_log_antennas; p++) {
for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]); for (j=0; j<ru->nb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
free_and_zero(ru->beam_weights[i][p]); free_and_zero(ru->beam_weights[i][p]);
} }
} }
for(i=0; i< ru->nb_tx; ++i) for(i=0; i< ru->nb_tx; ++i)
......
...@@ -493,7 +493,7 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue) ...@@ -493,7 +493,7 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue)
for (int k = 0; k < RX_NB_TH_MAX; k++) { 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_dlsch(&ue->dlsch[k][i][j], N_RB_DL);
if (j==0) if (j==0)
free_nr_ue_ulsch(&ue->ulsch[k][i], N_RB_DL); free_nr_ue_ulsch(&ue->ulsch[k][i], N_RB_DL, &ue->frame_parms);
} }
} }
...@@ -514,7 +514,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { ...@@ -514,7 +514,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) {
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"); 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]); LOG_D(PHY,"dlsch[%d][%d][%d] => %p\n",k,i,j,ue->dlsch[k][i][j]);
if (j==0) { 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"); AssertFatal((ue->ulsch[k][i] = new_nr_ue_ulsch(ue->frame_parms.N_RB_UL, NR_MAX_ULSCH_HARQ_PROCESSES,&ue->frame_parms))!=NULL,"Can't get ue ulsch structures\n");
LOG_D(PHY,"ulsch[%d][%d] => %p\n",k,i,ue->ulsch[k][i]); LOG_D(PHY,"ulsch[%d][%d] => %p\n",k,i,ue->ulsch[k][i]);
} }
} }
......
...@@ -366,8 +366,10 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, ...@@ -366,8 +366,10 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
uint8_t sco = 0; uint8_t sco = 0;
if (((fp->freq_range == nr_FR1) && (config->ssb_table.ssb_subcarrier_offset<24)) || if (((fp->freq_range == nr_FR1) && (config->ssb_table.ssb_subcarrier_offset<24)) ||
((fp->freq_range == nr_FR2) && (config->ssb_table.ssb_subcarrier_offset<12)) ) ((fp->freq_range == nr_FR2) && (config->ssb_table.ssb_subcarrier_offset<12)) ) {
sco = config->ssb_table.ssb_subcarrier_offset; if (fp->freq_range == nr_FR1)
sco = config->ssb_table.ssb_subcarrier_offset>>config->ssb_config.scs_common;
}
fp->ssb_start_subcarrier = (12 * config->ssb_table.ssb_offset_point_a + sco); fp->ssb_start_subcarrier = (12 * config->ssb_table.ssb_offset_point_a + sco);
set_Lmax(fp); set_Lmax(fp);
......
...@@ -1052,7 +1052,7 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e ...@@ -1052,7 +1052,7 @@ static inline int64_t clock_difftime_ns(struct timespec start, struct timespec e
void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seqno, uint16_t packet_type) { void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seqno, uint16_t packet_type) {
LTE_DL_FRAME_PARMS *fp=ru->frame_parms; LTE_DL_FRAME_PARMS *fp=ru->frame_parms;
int32_t *txp[fp->nb_antennas_tx], *rxp[fp->nb_antennas_rx]; int32_t *txp[ru->nb_tx], *rxp[ru->nb_rx];
int32_t *tx_buffer=NULL; int32_t *tx_buffer=NULL;
uint16_t packet_id=0, i=0; uint16_t packet_id=0, i=0;
...@@ -1106,9 +1106,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq ...@@ -1106,9 +1106,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq
NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
int offset,siglen; int offset,siglen,factor=1;
if (nrfp) { if (nrfp) {
offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
siglen = nrfp->get_samples_per_slot(tti,nrfp); siglen = nrfp->get_samples_per_slot(tti,nrfp);
} }
else { else {
...@@ -1116,6 +1116,13 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq ...@@ -1116,6 +1116,13 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq
siglen = spsf; siglen = spsf;
} }
if (ru->openair0_cfg.nr_flag==1) {
if (nrfp->N_RB_DL <= 162 && nrfp->N_RB_DL >= 106) factor = 2;
else if (nrfp->N_RB_DL < 106) factor=4;
}
else {
factor = 30720/spsf;
}
for (i=0; i < ru->nb_tx; i++) for (i=0; i < ru->nb_tx; i++)
txp[i] = (int32_t*)&ru->common.txdata[i][offset]; txp[i] = (int32_t*)&ru->common.txdata[i][offset];
...@@ -1124,8 +1131,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq ...@@ -1124,8 +1131,9 @@ void send_IF5(RU_t *ru, openair0_timestamp proc_timestamp, int tti, uint8_t *seq
//VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id ); //VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_SEND_IF5_PKT_ID, packet_id );
//VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 ); //VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF0, 1 );
clock_gettime( CLOCK_MONOTONIC, &start_comp); clock_gettime( CLOCK_MONOTONIC, &start_comp);
ru->ifdevice.trx_write_func2(&ru->ifdevice, ru->ifdevice.trx_write_func2(&ru->ifdevice,
(proc_timestamp + packet_id*spp_eth-500)*(30720/spsf), (proc_timestamp + packet_id*spp_eth-600)*factor,
(void*)txp[aid], (void*)txp[aid],
spp_eth, spp_eth,
aid, aid,
...@@ -1326,6 +1334,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa ...@@ -1326,6 +1334,8 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa
NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms; NR_DL_FRAME_PARMS *nrfp = ru->nr_frame_parms;
int offset,siglen; int offset,siglen;
int factor=1;
int ts_offset;
if (nrfp) { if (nrfp) {
offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0); offset = nrfp->get_samples_slot_timestamp(tti,nrfp,0);
siglen = nrfp->get_samples_per_slot(tti,nrfp); siglen = nrfp->get_samples_per_slot(tti,nrfp);
...@@ -1334,6 +1344,15 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa ...@@ -1334,6 +1344,15 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa
offset = tti*fp->samples_per_subframe; offset = tti*fp->samples_per_subframe;
siglen = spsf; siglen = spsf;
} }
if (ru->openair0_cfg.nr_flag==1) { // This check if RRU knows about NR numerologies
if (nrfp->N_RB_DL <= 162 && nrfp->N_RB_DL >= 106) factor = 2;
else if (nrfp->N_RB_DL < 106) factor=4;
ts_offset = 64;
}
else {
factor = 30720/spsf;
ts_offset = 256;
}
for (i=0; i < ru->nb_rx; i++) for (i=0; i < ru->nb_rx; i++)
rxp[i] = &ru->common.rxdata[i][offset]; rxp[i] = &ru->common.rxdata[i][offset];
int aid; int aid;
...@@ -1352,12 +1371,12 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa ...@@ -1352,12 +1371,12 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa
&aid); &aid);
clock_gettime( CLOCK_MONOTONIC, &if_time); clock_gettime( CLOCK_MONOTONIC, &if_time);
timeout[packet_id] = if_time.tv_nsec; timeout[packet_id] = if_time.tv_nsec;
timestamp[packet_id] /= (30720/spsf); timestamp[packet_id] /= factor; // for LTE this is the sample rate reduction w.r.t 30.72, for NR 122.88
LOG_D(PHY,"TTI %d: Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0])); LOG_D(PHY,"TTI %d: factor = %d Received packet %d: aid %d, TS %llu, oldTS %llu, diff %lld, \n",tti,factor,packet_id,aid,(unsigned long long)timestamp[packet_id],(unsigned long long)oldTS,(unsigned long long)(timestamp[packet_id]-timestamp[0]));
if (aid==0) { if (aid==0) {
if (firstTS==1) firstTS=0; if (firstTS==1) firstTS=0;
else if (oldTS + 256 != timestamp[packet_id]) { else if (oldTS + ts_offset != timestamp[packet_id]) {
LOG_I(PHY,"oldTS %llu, newTS %llu, diff %llu, timein %lu, timeout %lu\n",(long long unsigned int)oldTS,(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[packet_id]-oldTS,timein[packet_id],timeout[packet_id]); LOG_I(PHY,"oldTS %llu, newTS %llu, diff %llu, timein %lu, timeout %lu\n",(long long unsigned int)oldTS,(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[packet_id]-oldTS,timein[packet_id],timeout[packet_id]);
for (int i=0;i<=packet_id;i++) LOG_I(PHY,"packet %d TS %llu, timein %lu, timeout %lu\n",i,(long long unsigned int)timestamp[i],timein[i],timeout[i]); for (int i=0;i<=packet_id;i++) LOG_I(PHY,"packet %d TS %llu, timein %lu, timeout %lu\n",i,(long long unsigned int)timestamp[i],timein[i],timeout[i]);
AssertFatal(1==0,"fronthaul problem\n"); AssertFatal(1==0,"fronthaul problem\n");
...@@ -1369,7 +1388,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa ...@@ -1369,7 +1388,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int tti, uint16_t pa
// HYPOTHESIS: first packet per subframe has lowest timestamp of subframe // HYPOTHESIS: first packet per subframe has lowest timestamp of subframe
// should detect out of order and act accordingly .... // should detect out of order and act accordingly ....
AssertFatal(aid==0 || aid==1,"aid %d != 0 or 1\n",aid); AssertFatal(aid==0 || aid==1 || aid==2 || aid==3,"aid %d != 0,1,2 or 3\n",aid);
LOG_D(PHY,"rxp[%d] %p, dest %p, offset %d (%llu,%llu)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(int)(timestamp[packet_id]-timestamp[0]),(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[0]); LOG_D(PHY,"rxp[%d] %p, dest %p, offset %d (%llu,%llu)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(int)(timestamp[packet_id]-timestamp[0]),(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[0]);
memcpy((void*)(rxp[aid]+(timestamp[packet_id]-timestamp[0])), memcpy((void*)(rxp[aid]+(timestamp[packet_id]-timestamp[0])),
(void*)temp_rx, (void*)temp_rx,
......
...@@ -113,8 +113,12 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb ...@@ -113,8 +113,12 @@ void gNB_I0_measurements(PHY_VARS_gNB *gNB,int slot, int first_symb,int num_symb
for (int s=first_symb;s<(first_symb+num_symb);s++) { for (int s=first_symb;s<(first_symb+num_symb);s++) {
for (rb=0; rb<frame_parms->N_RB_UL; rb++) { for (rb=0; rb<frame_parms->N_RB_UL; rb++) {
int offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + if (s==first_symb /*&& ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0)*/) {
(frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size; nb_symb[rb]=0;
for (int aarx=0; aarx<frame_parms->nb_antennas_rx;aarx++)
measurements->n0_subband_power[aarx][rb]=0;
}
int offset0 = (slot&3)*(frame_parms->symbols_per_slot * frame_parms->ofdm_symbol_size) + (frame_parms->first_carrier_offset + (rb*12))%frame_parms->ofdm_symbol_size;
if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe if ((gNB->rb_mask_ul[s][rb>>5]&(1<<(rb&31))) == 0) { // check that rb was not used in this subframe
nb_symb[rb]++; nb_symb[rb]++;
for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) { for (int aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
......
...@@ -39,9 +39,11 @@ ...@@ -39,9 +39,11 @@
#include "nr_refsig.h" #include "nr_refsig.h"
#include "PHY/defs_gNB.h" #include "PHY/defs_gNB.h"
/*Table 7.4.1.1.2-1/2 from 38.211 */ // Table 6.4.1.1.3-1/2 from TS 38.211
int delta1[8] = {0, 0, 1, 1, 0, 0, 1, 1};
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}}; int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}}; int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
int delta2[12] = {0, 0, 2, 2, 4, 4, 0, 0, 2, 2, 4, 4};
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}}; int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1}};
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}}; int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
...@@ -49,6 +51,13 @@ int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1 ...@@ -49,6 +51,13 @@ int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1
short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,23170,-23170,-23170,-23170,23170}; short nr_rx_mod_table[14] = {0,0,23170,-23170,-23170,23170,23170,-23170,23170,23170,-23170,-23170,-23170,23170};
short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170}; short nr_rx_nmod_table[14] = {0,0,-23170,23170,23170,-23170,-23170,23170,-23170,-23170,23170,23170,23170,-23170};
int nr_pusch_dmrs_delta(uint8_t dmrs_config_type, unsigned short p) {
if (dmrs_config_type == pusch_dmrs_type1) {
return delta1[p];
} else {
return delta2[p];
}
}
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
unsigned int Ns, unsigned int Ns,
......
...@@ -42,6 +42,8 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid); ...@@ -42,6 +42,8 @@ void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid);
void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid); void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid);
int nr_pusch_dmrs_delta(uint8_t dmrs_config_type, unsigned short p);
int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB, int nr_pusch_dmrs_rx(PHY_VARS_gNB *gNB,
unsigned int Ns, unsigned int Ns,
unsigned int *nr_gold_pusch, unsigned int *nr_gold_pusch,
......
...@@ -106,8 +106,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB, ...@@ -106,8 +106,8 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex; cset_start_symb = pdcch_pdu_rel15->StartSymbolIndex;
cset_nsymb = pdcch_pdu_rel15->DurationSymbols; cset_nsymb = pdcch_pdu_rel15->DurationSymbols;
dci_idx = 0; dci_idx = 0;
LOG_D(PHY, "Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart); LOG_D(PHY, "pdcch: Coreset rb_offset %d, nb_rb %d BWP Start %d\n",rb_offset,n_rb,pdcch_pdu_rel15->BWPStart);
LOG_D(PHY, "Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb); LOG_D(PHY, "pdcch: Coreset starting subcarrier %d on symbol %d (%d symbols)\n", cset_start_sc, cset_start_symb, cset_nsymb);
// DMRS length is per OFDM symbol // DMRS length is per OFDM symbol
uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE) uint32_t dmrs_length = n_rb*6; //2(QPSK)*3(per RB)*6(REG per CCE)
uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE) uint32_t encoded_length = dci_pdu->AggregationLevel*108; //2(QPSK)*9(per RB)*6(REG per CCE)
......
...@@ -84,6 +84,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx, ...@@ -84,6 +84,8 @@ void nr_generate_pdsch(processingData_L1tx_t *msgTx,
uint8_t dmrs_Type = rel15->dmrsConfigType; uint8_t dmrs_Type = rel15->dmrsConfigType;
int nb_re_dmrs; int nb_re_dmrs;
uint16_t n_dmrs; uint16_t n_dmrs;
LOG_D(PHY,"pdsch: BWPStart %d, BWPSize %d, rbStart %d, rbsize %d\n",
rel15->BWPStart,rel15->BWPSize,rel15->rbStart,rel15->rbSize);
if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) { if (rel15->dmrsConfigType==NFAPI_NR_DMRS_TYPE1) {
nb_re_dmrs = 6*rel15->numDmrsCdmGrpsNoData; nb_re_dmrs = 6*rel15->numDmrsCdmGrpsNoData;
} }
......
...@@ -232,27 +232,20 @@ void ldpc8blocks( void *p) { ...@@ -232,27 +232,20 @@ void ldpc8blocks( void *p) {
#endif #endif
uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr); uint32_t E = nr_get_E(G, impp->n_segments, mod_order, rel15->nrOfLayers, rr);
//#ifdef DEBUG_DLSCH_CODING //#ifdef DEBUG_DLSCH_CODING
LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n", LOG_D(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d,nrOfLayer %d)...\n",
rr, rr,
impp->n_segments, impp->n_segments,
G, G,
E, E,
impp->F, impp->F,
Kr-impp->F-2*(*impp->Zc), Kr-impp->F-2*(*impp->Zc),
mod_order,nb_rb); mod_order,nb_rb,rel15->nrOfLayers);
// for tbslbrm calculation according to 5.4.2.1 of 38.212
uint8_t Nl = 4;
if (rel15->nrOfLayers < Nl)
Nl = rel15->nrOfLayers;
uint32_t Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl); uint32_t Tbslbrm = rel15->maintenance_parms_v3.tbSizeLbrmBytes;
uint8_t Ilbrm = 1;
uint8_t e[E]; uint8_t e[E];
bzero (e, E); bzero (e, E);
nr_rate_matching_ldpc(Ilbrm, nr_rate_matching_ldpc(Tbslbrm,
Tbslbrm,
impp->BG, impp->BG,
*impp->Zc, *impp->Zc,
impp->d[rr], impp->d[rr],
...@@ -262,6 +255,20 @@ void ldpc8blocks( void *p) { ...@@ -262,6 +255,20 @@ void ldpc8blocks( void *p) {
Kr-impp->F-2*(*impp->Zc), Kr-impp->F-2*(*impp->Zc),
rel15->rvIndex[0], rel15->rvIndex[0],
E); E);
if (Kr-impp->F-2*(*impp->Zc)> E) {
LOG_E(PHY,"dlsch coding A %d Kr %d G %d (nb_rb %d, nb_symb_sch %d, nb_re_dmrs %d, length_dmrs %d, mod_order %d)\n",
A,impp->K,G, nb_rb,nb_symb_sch,nb_re_dmrs,length_dmrs,(int)mod_order);
LOG_E(NR_PHY,"Rate Matching, Code segment %d/%d (coded bits (G) %u, E %d, Kr %d, Filler bits %d, Filler offset %d mod_order %d, nb_rb %d)...\n",
rr,
impp->n_segments,
G,
E,
Kr,
impp->F,
Kr-impp->F-2*(*impp->Zc),
mod_order,nb_rb);
}
#ifdef DEBUG_DLSCH_CODING #ifdef DEBUG_DLSCH_CODING
for (int i =0; i<16; i++) for (int i =0; i<16; i++)
......
...@@ -68,7 +68,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame, int slot, find_type_t type) { ...@@ -68,7 +68,7 @@ int16_t find_nr_prach(PHY_VARS_gNB *gNB,int frame, int slot, find_type_t type) {
} }
else if ((type == SEARCH_EXIST) && else if ((type == SEARCH_EXIST) &&
(gNB->prach_vars.list[i].frame == frame) && (gNB->prach_vars.list[i].frame == frame) &&
(gNB->prach_vars.list[i].slot == slot)) { (gNB->prach_vars.list[i].slot == slot)) {
return i; return i;
} }
} }
...@@ -107,15 +107,15 @@ int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type) { ...@@ -107,15 +107,15 @@ int16_t find_nr_prach_ru(RU_t *ru,int frame,int slot, find_type_t type) {
for (uint16_t i=0; i<NUMBER_OF_NR_RU_PRACH_MAX; i++) { for (uint16_t i=0; i<NUMBER_OF_NR_RU_PRACH_MAX; i++) {
LOG_D(PHY,"searching for PRACH in %d.%d : prach_index %d=> %d.%d\n", frame,slot,i, LOG_D(PHY,"searching for PRACH in %d.%d : prach_index %d=> %d.%d\n", frame,slot,i,
ru->prach_list[i].frame,ru->prach_list[i].slot); ru->prach_list[i].frame,ru->prach_list[i].slot);
if((type == SEARCH_EXIST_OR_FREE) && if((type == SEARCH_EXIST_OR_FREE) &&
(ru->prach_list[i].frame == -1) && (ru->prach_list[i].frame == -1) &&
(ru->prach_list[i].slot == -1)) { (ru->prach_list[i].slot == -1)) {
pthread_mutex_unlock(&ru->prach_list_mutex); pthread_mutex_unlock(&ru->prach_list_mutex);
return i; return i;
} }
else if ((type == SEARCH_EXIST) && else if ((type == SEARCH_EXIST) &&
(ru->prach_list[i].frame == frame) && (ru->prach_list[i].frame == frame) &&
(ru->prach_list[i].slot == slot)) { (ru->prach_list[i].slot == slot)) {
pthread_mutex_unlock(&ru->prach_list_mutex); pthread_mutex_unlock(&ru->prach_list_mutex);
return i; return i;
} }
...@@ -193,7 +193,8 @@ void rx_nr_prach_ru(RU_t *ru, ...@@ -193,7 +193,8 @@ void rx_nr_prach_ru(RU_t *ru,
rxsigF = ru->prach_rxsigF[prachOccasion]; rxsigF = ru->prach_rxsigF[prachOccasion];
AssertFatal(ru->if_south == LOCAL_RF,"we shouldn't call this if if_south != LOCAL_RF\n"); AssertFatal(ru->if_south == LOCAL_RF || ru->if_south == REMOTE_IF5,
"we shouldn't call this if if_south != LOCAL_RF or REMOTE_IF5\n");
for (int aa=0; aa<ru->nb_rx; aa++){ for (int aa=0; aa<ru->nb_rx; aa++){
if (prach_sequence_length == 0) slot2=(slot/fp->slots_per_subframe)*fp->slots_per_subframe; if (prach_sequence_length == 0) slot2=(slot/fp->slots_per_subframe)*fp->slots_per_subframe;
......
...@@ -52,6 +52,7 @@ void nr_codeword_scrambling(uint8_t *in, ...@@ -52,6 +52,7 @@ void nr_codeword_scrambling(uint8_t *in,
((uint16_t*)&in32)[0] = _mm_movemask_epi8(_mm_slli_epi16(in128[0],7)); ((uint16_t*)&in32)[0] = _mm_movemask_epi8(_mm_slli_epi16(in128[0],7));
((uint16_t*)&in32)[1] = _mm_movemask_epi8(_mm_slli_epi16(in128[1],7)); ((uint16_t*)&in32)[1] = _mm_movemask_epi8(_mm_slli_epi16(in128[1],7));
out[i]=(in32^s); out[i]=(in32^s);
LOG_D(PHY,"in[%d] %x => %x\n",i,in32,out[i]);
s=lte_gold_generic(&x1, &x2, 0); s=lte_gold_generic(&x1, &x2, 0);
} }
//#elsif defined(__arm__) || defined(__aarch64) //#elsif defined(__arm__) || defined(__aarch64)
......
...@@ -136,21 +136,22 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB, ...@@ -136,21 +136,22 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
@param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR) @param nb_rb_pusch The number of RBs allocated (used for Resource Allocation Type 1 in NR)
@param frame_parms, Pointer to frame descriptor structure @param frame_parms, Pointer to frame descriptor structure
*/ */
void nr_ulsch_extract_rbs_single(int32_t **rxdataF, void nr_ulsch_extract_rbs(int32_t **rxdataF,
NR_gNB_PUSCH *pusch_vars, NR_gNB_PUSCH *pusch_vars,
int slot, int slot,
unsigned char symbol, unsigned char symbol,
uint8_t is_dmrs_symbol, uint8_t is_dmrs_symbol,
nfapi_nr_pusch_pdu_t *pusch_pdu, nfapi_nr_pusch_pdu_t *pusch_pdu,
NR_DL_FRAME_PARMS *frame_parms); NR_DL_FRAME_PARMS *frame_parms);
void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext, void nr_ulsch_scale_channel(int32_t **ul_ch_estimates_ext,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
NR_gNB_ULSCH_t *ulsch_gNB, NR_gNB_ULSCH_t *ulsch_gNB,
uint8_t symbol, uint8_t symbol,
uint8_t start_symbol, uint8_t is_dmrs_symbol,
uint16_t nb_rb, uint32_t len,
pusch_dmrs_type_t pusch_dmrs_type); uint8_t nrOfLayers,
uint16_t nb_rb);
/** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal /** \brief This function computes the average channel level over all allocated RBs and antennas (TX/RX) in order to compute output shift for compensated signal
@param ul_ch_estimates_ext Channel estimates in allocated RBs @param ul_ch_estimates_ext Channel estimates in allocated RBs
...@@ -184,9 +185,10 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext, ...@@ -184,9 +185,10 @@ void nr_ulsch_channel_compensation(int **rxdataF_ext,
int **ul_ch_mag, int **ul_ch_mag,
int **ul_ch_magb, int **ul_ch_magb,
int **rxdataF_comp, int **rxdataF_comp,
int **rho, int ***rho,
NR_DL_FRAME_PARMS *frame_parms, NR_DL_FRAME_PARMS *frame_parms,
unsigned char symbol, unsigned char symbol,
int length,
uint8_t is_dmrs_symbol, uint8_t is_dmrs_symbol,
unsigned char mod_order, unsigned char mod_order,
uint8_t nrOfLayers, uint8_t nrOfLayers,
...@@ -254,8 +256,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -254,8 +256,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
@param mod_order modulation order @param mod_order modulation order
*/ */
void nr_ulsch_compute_llr(int32_t *rxdataF_comp, void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int32_t **ul_ch_magb, int32_t *ul_ch_magb,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
......
...@@ -85,6 +85,33 @@ void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n ...@@ -85,6 +85,33 @@ void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n
nr_codeword_unscrambling(llr, size, 0, Nid, n_RNTI); nr_codeword_unscrambling(llr, size, 0, Nid, n_RNTI);
} }
void nr_ulsch_layer_demapping(int16_t *llr_cw,
uint8_t Nl,
uint8_t mod_order,
uint32_t length,
int16_t **llr_layers)
{
switch (Nl) {
case 1:
memcpy((void*)llr_cw, (void*)llr_layers[0], (length)*sizeof(int16_t));
break;
case 2:
case 3:
case 4:
for (int i=0; i<(length/Nl/mod_order); i++) {
for (int l=0; l<Nl; l++) {
for (int m=0; m<mod_order; m++) {
llr_cw[i*Nl*mod_order+l*mod_order+m] = llr_layers[l][i*mod_order+m];
}
}
}
break;
default:
AssertFatal(0, "Not supported number of layers %d\n", Nl);
}
}
void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) { void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
for (int i=0;i<gNB->number_of_nr_ulsch_max;i++) { for (int i=0;i<gNB->number_of_nr_ulsch_max;i++) {
......
...@@ -71,6 +71,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -71,6 +71,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n_RNTI); void nr_ulsch_unscrambling(int16_t* llr, uint32_t size, uint32_t Nid, uint32_t n_RNTI);
void nr_ulsch_layer_demapping(int16_t *llr_cw,
uint8_t Nl,
uint8_t mod_order,
uint32_t length,
int16_t **llr_layers);
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, void nr_ulsch_procedures(PHY_VARS_gNB *gNB,
int frame_rx, int frame_rx,
int slot_rx, int slot_rx,
......
...@@ -57,8 +57,7 @@ ...@@ -57,8 +57,7 @@
void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL) void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
{ {
int i,r; uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
NR_gNB_ULSCH_t *ulsch = *ulschptr; NR_gNB_ULSCH_t *ulsch = *ulschptr;
if (N_RB_UL != 273) { if (N_RB_UL != 273) {
...@@ -66,17 +65,18 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL) ...@@ -66,17 +65,18 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr, uint16_t N_RB_UL)
a_segments = a_segments/273 +1; a_segments = a_segments/273 +1;
} }
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) { for (int i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
if (ulsch->harq_processes[i]) { if (ulsch->harq_processes[i]) {
if (ulsch->harq_processes[i]->b) { if (ulsch->harq_processes[i]->b) {
free_and_zero(ulsch->harq_processes[i]->b); free_and_zero(ulsch->harq_processes[i]->b);
ulsch->harq_processes[i]->b = NULL; ulsch->harq_processes[i]->b = NULL;
} }
for (r=0; r<a_segments; r++) { for (int r=0; r<a_segments; r++) {
free_and_zero(ulsch->harq_processes[i]->c[r]); free_and_zero(ulsch->harq_processes[i]->c[r]);
free_and_zero(ulsch->harq_processes[i]->d[r]); free_and_zero(ulsch->harq_processes[i]->d[r]);
free_and_zero(ulsch->harq_processes[i]->w[r]);
} }
free_and_zero(ulsch->harq_processes[i]->c);
free_and_zero(ulsch->harq_processes[i]->d);
free_and_zero(ulsch->harq_processes[i]); free_and_zero(ulsch->harq_processes[i]);
ulsch->harq_processes[i] = NULL; ulsch->harq_processes[i] = NULL;
} }
...@@ -90,7 +90,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) ...@@ -90,7 +90,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
NR_gNB_ULSCH_t *ulsch; NR_gNB_ULSCH_t *ulsch;
uint8_t i,r; uint8_t i,r;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS; //number of segments to be allocated
if (N_RB_UL != 273) { if (N_RB_UL != 273) {
a_segments = a_segments*N_RB_UL; a_segments = a_segments*N_RB_UL;
...@@ -107,10 +107,11 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL) ...@@ -107,10 +107,11 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations, uint16_t N_RB_UL)
ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t)); ulsch->harq_processes[i] = (NR_UL_gNB_HARQ_t *)malloc16_clear(sizeof(NR_UL_gNB_HARQ_t));
ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes); ulsch->harq_processes[i]->b = (uint8_t*)malloc16_clear(ulsch_bytes);
ulsch->harq_processes[i]->c = (uint8_t**)malloc16_clear(a_segments*sizeof(uint8_t *));
ulsch->harq_processes[i]->d = (int16_t**)malloc16_clear(a_segments*sizeof(int16_t *));
for (r=0; r<a_segments; r++) { for (r=0; r<a_segments; r++) {
ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t)); ulsch->harq_processes[i]->c[r] = (uint8_t*)malloc16_clear(8448*sizeof(uint8_t));
ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t)); ulsch->harq_processes[i]->d[r] = (int16_t*)malloc16_clear((68*384)*sizeof(int16_t));
ulsch->harq_processes[i]->w[r] = (int16_t*)malloc16_clear((3*(6144+64))*sizeof(int16_t));
} }
} }
...@@ -168,8 +169,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch) ...@@ -168,8 +169,6 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
ulsch->harq_processes[i]->C=0; ulsch->harq_processes[i]->C=0;
/// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2) /// Pointers to code blocks after LDPC coding (38.212 V15.4.0 section 5.3.2)
//int16_t *d[MAX_NUM_NR_ULSCH_SEGMENTS]; //int16_t *d[MAX_NUM_NR_ULSCH_SEGMENTS];
/// LDPC processing buffer
//t_nrLDPC_procBuf* p_nrLDPC_procBuf[MAX_NUM_NR_ULSCH_SEGMENTS];
ulsch->harq_processes[i]->Z=0; 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) /// 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_ULSCH_SEGMENTS][3*8448]; //int16_t e[MAX_NUM_NR_ULSCH_SEGMENTS][3*8448];
...@@ -234,7 +233,6 @@ void nr_processULSegment(void* arg) { ...@@ -234,7 +233,6 @@ void nr_processULSegment(void* arg) {
int rv_index = rdata->rv_index; int rv_index = rdata->rv_index;
int r_offset = rdata->r_offset; int r_offset = rdata->r_offset;
uint8_t kc = rdata->Kc; uint8_t kc = rdata->Kc;
uint32_t Tbslbrm = rdata->Tbslbrm;
short* ulsch_llr = rdata->ulsch_llr; short* ulsch_llr = rdata->ulsch_llr;
int max_ldpc_iterations = p_decoderParms->numMaxIter; int max_ldpc_iterations = p_decoderParms->numMaxIter;
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32))); int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
...@@ -244,8 +242,6 @@ void nr_processULSegment(void* arg) { ...@@ -244,8 +242,6 @@ void nr_processULSegment(void* arg) {
__m128i *pv = (__m128i*)&z; __m128i *pv = (__m128i*)&z;
__m128i *pl = (__m128i*)&l; __m128i *pl = (__m128i*)&l;
uint8_t Ilbrm = 0;
Kr = ulsch_harq->K; Kr = ulsch_harq->K;
Kr_bytes = Kr>>3; Kr_bytes = Kr>>3;
...@@ -262,9 +258,12 @@ void nr_processULSegment(void* arg) { ...@@ -262,9 +258,12 @@ void nr_processULSegment(void* arg) {
//////////////////////////// ulsch_llr =====> ulsch_harq->e ////////////////////////////// //////////////////////////// ulsch_llr =====> ulsch_harq->e //////////////////////////////
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
int16_t harq_e[3*8448];
nr_deinterleaving_ldpc(E, nr_deinterleaving_ldpc(E,
Qm, Qm,
ulsch_harq->e[r], harq_e,
ulsch_llr+r_offset); ulsch_llr+r_offset);
//for (int i =0; i<16; i++) //for (int i =0; i<16; i++)
...@@ -273,16 +272,7 @@ void nr_processULSegment(void* arg) { ...@@ -273,16 +272,7 @@ void nr_processULSegment(void* arg) {
stop_meas(&phy_vars_gNB->ulsch_deinterleaving_stats); stop_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
/*LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n", //////////////////////////////////////////////////////////////////////////////////////////
harq_pid,r, G,
Kr*3,
ulsch_harq->TBS,
Qm,
nb_rb,
n_layers,
pusch_pdu->pusch_data.rv_index,
ulsch_harq->round);*/
//////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
...@@ -293,12 +283,11 @@ void nr_processULSegment(void* arg) { ...@@ -293,12 +283,11 @@ void nr_processULSegment(void* arg) {
//start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats); //start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
if (nr_rate_matching_ldpc_rx(Ilbrm, if (nr_rate_matching_ldpc_rx(rdata->tbslbrm,
Tbslbrm,
p_decoderParms->BG, p_decoderParms->BG,
p_decoderParms->Z, p_decoderParms->Z,
ulsch_harq->d[r], ulsch_harq->d[r],
ulsch_harq->e[r], harq_e,
ulsch_harq->C, ulsch_harq->C,
rv_index, rv_index,
ulsch_harq->new_rx, ulsch_harq->new_rx,
...@@ -361,13 +350,13 @@ void nr_processULSegment(void* arg) { ...@@ -361,13 +350,13 @@ void nr_processULSegment(void* arg) {
if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) { if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) {
#ifdef PRINT_CRC_CHECK #ifdef PRINT_CRC_CHECK
LOG_I(PHY, "Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations); LOG_I(PHY,"Segment %d CRC OK, iterations %d/%d\n",r,no_iteration_ldpc,max_ldpc_iterations);
#endif #endif
rdata->decodeIterations = no_iteration_ldpc; rdata->decodeIterations = no_iteration_ldpc;
if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--; if (rdata->decodeIterations > p_decoderParms->numMaxIter) rdata->decodeIterations--;
} else { } else {
#ifdef PRINT_CRC_CHECK #ifdef PRINT_CRC_CHECK
LOG_I(PHY, "CRC NOK\n"); LOG_I(PHY,"CRC NOK\n");
#endif #endif
rdata->decodeIterations = max_ldpc_iterations + 1; rdata->decodeIterations = max_ldpc_iterations + 1;
} }
...@@ -394,7 +383,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -394,7 +383,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
uint32_t r_offset; uint32_t r_offset;
uint32_t offset; uint32_t offset;
int kc; int kc;
int Tbslbrm;
int E; int E;
#ifdef PRINT_CRC_CHECK #ifdef PRINT_CRC_CHECK
...@@ -449,12 +437,13 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -449,12 +437,13 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
if (harq_process->ndi != pusch_pdu->pusch_data.new_data_indicator) { if (harq_process->ndi != pusch_pdu->pusch_data.new_data_indicator) {
harq_process->new_rx = true; harq_process->new_rx = true;
harq_process->ndi = pusch_pdu->pusch_data.new_data_indicator; harq_process->ndi = pusch_pdu->pusch_data.new_data_indicator;
LOG_E(PHY,"Missed ULSCH detection. NDI toggled but rv %d does not correspond to first reception\n",pusch_pdu->pusch_data.rv_index); LOG_D(PHY,"Missed ULSCH detection. NDI toggled but rv %d does not correspond to first reception\n",pusch_pdu->pusch_data.rv_index);
} }
A = (harq_process->TBS)<<3; A = (harq_process->TBS)<<3;
LOG_D(NR_PHY, "ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d, Coderate %d\n", harq_pid, A, G, mcs, n_layers, nb_rb, Qm, n_layers, R); LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, Coderate %d RV %d round %d\n",
harq_pid, A, G, mcs, n_layers, nb_rb, Qm, R, pusch_pdu->pusch_data.rv_index, harq_process->round);
if (R<1024) if (R<1024)
Coderate = (float) R /(float) 1024; Coderate = (float) R /(float) 1024;
...@@ -539,7 +528,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -539,7 +528,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
if (!frame%100) if (!frame%100)
printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z); printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z);
#endif #endif
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,n_layers);
p_decParams->Z = harq_process->Z; p_decParams->Z = harq_process->Z;
...@@ -549,7 +537,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -549,7 +537,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
r_offset = 0; r_offset = 0;
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS_PER_LAYER*n_layers; //number of segments to be allocated
if (nb_rb != 273) { if (nb_rb != 273) {
a_segments = a_segments*nb_rb; a_segments = a_segments*nb_rb;
...@@ -590,10 +578,10 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -590,10 +578,10 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
rdata->r_offset = r_offset; rdata->r_offset = r_offset;
rdata->Kr_bytes = Kr_bytes; rdata->Kr_bytes = Kr_bytes;
rdata->rv_index = pusch_pdu->pusch_data.rv_index; rdata->rv_index = pusch_pdu->pusch_data.rv_index;
rdata->Tbslbrm = Tbslbrm;
rdata->offset = offset; rdata->offset = offset;
rdata->ulsch = ulsch; rdata->ulsch = ulsch;
rdata->ulsch_id = ULSCH_id; rdata->ulsch_id = ULSCH_id;
rdata->tbslbrm = pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes;
pushTpool(phy_vars_gNB->threadPool,req); pushTpool(phy_vars_gNB->threadPool,req);
phy_vars_gNB->nbDecode++; phy_vars_gNB->nbDecode++;
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode); LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode);
......
...@@ -64,7 +64,7 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp, ...@@ -64,7 +64,7 @@ void nr_ulsch_qpsk_llr(int32_t *rxdataF_comp,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
...@@ -110,12 +110,12 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, ...@@ -110,12 +110,12 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
ch_mag = (__m256i*)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))]; ch_mag = (__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
#else #else
ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))]; ch_mag = (__m128i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (int16x8_t*)&ul_ch_mag[(symbol*nb_rb*12)];
#endif #endif
#ifdef __AVX2__ #ifdef __AVX2__
...@@ -231,8 +231,8 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp, ...@@ -231,8 +231,8 @@ void nr_ulsch_16qam_llr(int32_t *rxdataF_comp,
//---------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------
void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int32_t **ul_ch_magb, int32_t *ul_ch_magb,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
...@@ -265,15 +265,15 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -265,15 +265,15 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
#if defined(__x86_64__) || defined(__i386__) #if defined(__x86_64__) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
ch_mag = (__m256i*)&ul_ch_mag[0][(symbol*(off+(nb_rb*12)))]; ch_mag = (__m256i*)&ul_ch_mag[(symbol*(off+(nb_rb*12)))];
ch_magb = (__m256i*)&ul_ch_magb[0][(symbol*(off+(nb_rb*12)))]; ch_magb = (__m256i*)&ul_ch_magb[(symbol*(off+(nb_rb*12)))];
#else #else
ch_mag = (__m128i*)&ul_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (__m128i*)&ul_ch_mag[(symbol*nb_rb*12)];
ch_magb = (__m128i*)&ul_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (__m128i*)&ul_ch_magb[(symbol*nb_rb*12)];
#endif #endif
#elif defined(__arm__) #elif defined(__arm__)
ch_mag = (int16x8_t*)&ul_ch_mag[0][(symbol*nb_rb*12)]; ch_mag = (int16x8_t*)&ul_ch_mag[(symbol*nb_rb*12)];
ch_magb = (int16x8_t*)&ul_ch_magb[0][(symbol*nb_rb*12)]; ch_magb = (int16x8_t*)&ul_ch_magb[(symbol*nb_rb*12)];
#endif #endif
#ifdef __AVX2__ #ifdef __AVX2__
...@@ -471,8 +471,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp, ...@@ -471,8 +471,8 @@ void nr_ulsch_64qam_llr(int32_t *rxdataF_comp,
void nr_ulsch_compute_llr(int32_t *rxdataF_comp, void nr_ulsch_compute_llr(int32_t *rxdataF_comp,
int32_t **ul_ch_mag, int32_t *ul_ch_mag,
int32_t **ul_ch_magb, int32_t *ul_ch_magb,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint32_t nb_rb, uint32_t nb_rb,
uint32_t nb_re, uint32_t nb_re,
......
This diff is collapsed.
...@@ -148,7 +148,7 @@ short filt8_dcr0_h[8]= { ...@@ -148,7 +148,7 @@ short filt8_dcr0_h[8]= {
0,4096,8192,12288,16384,0,0,0}; 0,4096,8192,12288,16384,0,0,0};
short filt8_l1[8] = { short filt8_l1[8] = {
24576,16384,0,0,0,0,0,0}; 24576,16384,8192,0,0,0,0,0};
short filt8_ml1[8] = { short filt8_ml1[8] = {
-8192,0,8192,16384,8192,0,0,0}; -8192,0,8192,16384,8192,0,0,0};
...@@ -163,10 +163,10 @@ short filt8_mm1[8]= { ...@@ -163,10 +163,10 @@ short filt8_mm1[8]= {
0,0,0,0,8192,16384,8192,0}; 0,0,0,0,8192,16384,8192,0};
short filt8_dcl1[8]= { short filt8_dcl1[8]= {
0,0,0,16384,12288,8192,4096,0}; 0,0,16384,12288,8192,4096,0,0};
short filt8_dcr1[8]= { short filt8_dcr1[8]= {
0,0,0,0,4096,8192,12288,16384}; 0,0,0,4096,8192,12288,16384,0};
short filt8_dcl1_h[8]= { short filt8_dcl1_h[8]= {
0,16384,12288,8192,4096,0,0,0}; 0,16384,12288,8192,4096,0,0,0};
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment