Commit 2d3f4f73 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/develop' into ldpc-decoder-codegen

parents bf538993 d7dae8fa
...@@ -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>
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<id>nrmodule2_quectel</id> <id>nrmodule2_quectel</id>
<ping_args>-c 20</ping_args> <ping_args>-c 20</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold> <ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>40</ping_rttavg_threshold> <ping_rttavg_threshold>60</ping_rttavg_threshold>
</testCase> </testCase>
<testCase id="050001"> <testCase id="050001">
<class>Ping</class> <class>Ping</class>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<id>nrmodule2_quectel</id> <id>nrmodule2_quectel</id>
<ping_args>-c 100 -s 1024 -i 0,2</ping_args> <ping_args>-c 100 -s 1024 -i 0,2</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold> <ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>40</ping_rttavg_threshold> <ping_rttavg_threshold>60</ping_rttavg_threshold>
</testCase> </testCase>
......
...@@ -88,7 +88,7 @@ ...@@ -88,7 +88,7 @@
<id>nrmodule2_quectel</id> <id>nrmodule2_quectel</id>
<ping_args>-c 20</ping_args> <ping_args>-c 20</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold> <ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>40</ping_rttavg_threshold> <ping_rttavg_threshold>60</ping_rttavg_threshold>
</testCase> </testCase>
<testCase id="050003"> <testCase id="050003">
<class>Ping</class> <class>Ping</class>
...@@ -96,7 +96,7 @@ ...@@ -96,7 +96,7 @@
<id>nrmodule2_quectel</id> <id>nrmodule2_quectel</id>
<ping_args>-c 100 -s 1024 -i 0,2</ping_args> <ping_args>-c 100 -s 1024 -i 0,2</ping_args>
<ping_packetloss_threshold>1</ping_packetloss_threshold> <ping_packetloss_threshold>1</ping_packetloss_threshold>
<ping_rttavg_threshold>40</ping_rttavg_threshold> <ping_rttavg_threshold>60</ping_rttavg_threshold>
</testCase> </testCase>
......
...@@ -1548,9 +1548,10 @@ set(PHY_SRC_UE ...@@ -1548,9 +1548,10 @@ set(PHY_SRC_UE
set(PHY_NR_SRC_COMMON set(PHY_NR_SRC_COMMON
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_prach_common.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_prach_common.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_csi_rs.c
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_scrambling.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_scrambling.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/scrambling_luts.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/scrambling_luts.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c
) )
set(PHY_NR_SRC set(PHY_NR_SRC
...@@ -1574,7 +1575,6 @@ set(PHY_SRC_UE ...@@ -1574,7 +1575,6 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_csi_rs.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gen_mod_table.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/dmrs_nr.c
...@@ -1622,6 +1622,7 @@ set(PHY_SRC_UE ...@@ -1622,6 +1622,7 @@ set(PHY_SRC_UE
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_tools_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/pucch_nr.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/pucch_nr.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/csi_rx.c
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c ${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c ${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
...@@ -2848,6 +2849,7 @@ target_link_libraries(ldpctest ...@@ -2848,6 +2849,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}
) )
...@@ -2871,6 +2873,7 @@ target_link_libraries(nr_pbchsim ...@@ -2871,6 +2873,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}
) )
...@@ -2915,6 +2918,7 @@ target_link_libraries(nr_prachsim ...@@ -2915,6 +2918,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}
......
...@@ -1104,7 +1104,8 @@ ...@@ -1104,7 +1104,8 @@
(Test19: Mapping type A, 3 DMRS Symbols), (Test19: Mapping type A, 3 DMRS Symbols),
(Test20: Mapping type B, 4 DMRS Symbols), (Test20: Mapping type B, 4 DMRS Symbols),
(Test21: 4x4 MIMO, 1 Layer), (Test21: 4x4 MIMO, 1 Layer),
(Test22: 4x4 MIMO, 2 Layers)</desc> (Test22: 4x4 MIMO, 2 Layers),
(Test23: 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>
...@@ -1132,8 +1133,9 @@ ...@@ -1132,8 +1133,9 @@
-n100 -s2 -U 2 0 2 -n100 -s2 -U 2 0 2
-n100 -s2 -U 2 1 3 -n100 -s2 -U 2 1 3
-n10 -s20 -U 3 0 0 2 -gR -x1 -y4 -z4 -n10 -s20 -U 3 0 0 2 -gR -x1 -y4 -z4
-n10 -s20 -U 3 0 0 2 -gR -x2 -y4 -z4</main_exec_args> -n10 -s20 -U 3 0 0 2 -gR -x2 -y4 -z4
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 nr_dlsim.test22</tags> -n100 -m0 -e0 -R25 -b25 -i</main_exec_args>
<tags>nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19 nr_dlsim.test20 nr_dlsim.test21 nr_dlsim.test22 nr_dlsim.test23</tags>
<search_expr_true>PDSCH test OK</search_expr_true> <search_expr_true>PDSCH 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>
...@@ -1184,9 +1186,10 @@ ...@@ -1184,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>
...@@ -1195,8 +1198,9 @@ ...@@ -1195,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>
...@@ -1304,7 +1308,10 @@ ...@@ -1304,7 +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)</desc> (Test15: MCS 19 50 PRBs 2 RX_Antenna),
(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>
...@@ -1320,14 +1327,16 @@ ...@@ -1320,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</main_exec_args> -n100 -m19 -s10 -S15 -z2
-n100 -m9 -r106 -s10 -W2 -y2 -z2
<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</tags> -n100 -m9 -r106 -s20 -W4 -y4 -z4
-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 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>
...@@ -1338,10 +1347,11 @@ ...@@ -1338,10 +1347,11 @@
<desc>nr_prachsim Test cases. (Test1: 30kHz SCS, 106 PRBs, Prach format A2), <desc>nr_prachsim Test cases. (Test1: 30kHz SCS, 106 PRBs, Prach format A2),
(Test2: 30kHz SCS, 217 PRBs, Prach format A2), (Test2: 30kHz SCS, 217 PRBs, Prach format A2),
(Test3: 30kHz SCS, 273 PRBs, Prach format A2), (Test3: 30kHz SCS, 273 PRBs, Prach format A2),
(Test4: 30kHz SCS, 106 PRBs, Prach format 0), (Test4: 30kHz SCS, 106 PRBs, Prach format 0),
(Test5: 120kHz SCS, 32 PRBs, Prach format A2), (Test5: 120kHz SCS, 32 PRBs, Prach format A2),
(Test6: 120kHz SCS, 66 PRBs, Prach format A2), (Test6: 120kHz SCS, 66 PRBs, Prach format A2),
(Test7: 120kHz SCS, 66 PRBs, High Speed Enabled)</desc> (Test7: 120kHz SCS, 66 PRBs, High Speed Enabled),
(Test8: 15kHz SCS, 25 PRBs)</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>
...@@ -1351,11 +1361,12 @@ ...@@ -1351,11 +1361,12 @@
<main_exec_args>-a -s -30 -n 100 -p 63 -R 106 <main_exec_args>-a -s -30 -n 100 -p 63 -R 106
-a -s -30 -n 100 -p 63 -R 217 -a -s -30 -n 100 -p 63 -R 217
-a -s -30 -n 100 -p 63 -R 273 -a -s -30 -n 100 -p 63 -R 273
-a -s -30 -n 100 -p 63 -R 106 -c 4 -a -s -30 -n 100 -p 63 -R 106 -c 4
-a -s -30 -n 100 -p 32 -R 32 -m 3 -c52 -a -s -30 -n 100 -p 32 -R 32 -m 3 -c52
-a -s -30 -n 100 -p 32 -R 66 -m 3 -c52 -a -s -30 -n 100 -p 32 -R 66 -m 3 -c52
-a -s -30 -n 100 -R 66 -m 3 -c52 -H</main_exec_args> -a -s -30 -n 100 -R 66 -m 3 -c52 -H
<tags>nr_prachsim.test1 nr_prachsim.test2 nr_prachsim.test3 nr_prachsim.test4 nr_prachsim.test5 nr_prachsim.test6 nr_prachsim.test7</tags> -a -s -30 -n 100 -p 99 -R 25 -m 0</main_exec_args>
<tags>nr_prachsim.test1 nr_prachsim.test2 nr_prachsim.test3 nr_prachsim.test4 nr_prachsim.test5 nr_prachsim.test6 nr_prachsim.test7 nr_prachsim.test8</tags>
<search_expr_true>PRACH test OK</search_expr_true> <search_expr_true>PRACH 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>
......
...@@ -721,11 +721,11 @@ function main() { ...@@ -721,11 +721,11 @@ function main() {
# simlist="ldpctest" # simlist="ldpctest"
for f in $simlist ; do for f in $simlist ; do
compilations \ compilations \
ran_build $f \ $BUILD_DIR $f \
$f $dbin/$f.$REL $f $dbin/$f.$REL
done done
compilations \ compilations \
ran_build coding \ $BUILD_DIR coding \
libcoding.so $dbin/libcoding.so libcoding.so $dbin/libcoding.so
fi fi
...@@ -737,7 +737,7 @@ function main() { ...@@ -737,7 +737,7 @@ function main() {
simlist="secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2" simlist="secu_knas_encrypt_eia1 secu_kenb aes128_ctr_encrypt aes128_ctr_decrypt secu_knas_encrypt_eea2 secu_knas secu_knas_encrypt_eea1 kdf aes128_cmac_encrypt secu_knas_encrypt_eia2"
for f in $simlist ; do for f in $simlist ; do
compilations \ compilations \
ran_build test_$f \ $BUILD_DIR test_$f \
test_$f $dbin/test_$f.$REL test_$f $dbin/test_$f.$REL
done done
fi fi
......
...@@ -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
......
...@@ -191,67 +191,6 @@ int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart) { ...@@ -191,67 +191,6 @@ int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart) {
return(PRBalloc_to_locationandbandwidth0(NPRB,RBstart,275)); return(PRBalloc_to_locationandbandwidth0(NPRB,RBstart,275));
} }
/// Target code rate tables indexed by Imcs
/* TS 38.214 table 5.1.3.1-1 - MCS index table 1 for PDSCH */
uint16_t nr_target_code_rate_table1[29] = {120, 157, 193, 251, 308, 379, 449, 526, 602, 679, 340, 378, 434, 490, 553, \
616, 658, 438, 466, 517, 567, 616, 666, 719, 772, 822, 873, 910, 948};
/* TS 38.214 table 5.1.3.1-2 - MCS index table 2 for PDSCH */
// Imcs values 20 and 26 have been multiplied by 2 to avoid the floating point
uint16_t nr_target_code_rate_table2[28] = {120, 193, 308, 449, 602, 378, 434, 490, 553, 616, 658, 466, 517, 567, \
616, 666, 719, 772, 822, 873, 1365, 711, 754, 797, 841, 885, 1833, 948};
/* TS 38.214 table 5.1.3.1-3 - MCS index table 3 for PDSCH */
uint16_t nr_target_code_rate_table3[29] = {30, 40, 50, 64, 78, 99, 120, 157, 193, 251, 308, 379, 449, 526, 602, 340, \
378, 434, 490, 553, 616, 438, 466, 517, 567, 616, 666, 719, 772};
uint16_t nr_tbs_table[93] = {24, 32, 40, 48, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 152, 160, 168, 176, 184, 192, 208, 224, 240, 256, 272, 288, 304, 320, \
336, 352, 368, 384, 408, 432, 456, 480, 504, 528, 552, 576, 608, 640, 672, 704, 736, 768, 808, 848, 888, 928, 984, 1032, 1064, 1128, 1160, 1192, 1224, 1256, \
1288, 1320, 1352, 1416, 1480, 1544, 1608, 1672, 1736, 1800, 1864, 1928, 2024, 2088, 2152, 2216, 2280, 2408, 2472, 2536, 2600, 2664, 2728, 2792, 2856, 2976, \
3104, 3240, 3368, 3496, 3624, 3752, 3824};
uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) {
case 1:
return (((Imcs<10)||(Imcs==29))?2:((Imcs<17)||(Imcs==30))?4:((Imcs<29)||(Imcs==31))?6:-1);
break;
case 2:
return (((Imcs<5)||(Imcs==28))?2:((Imcs<11)||(Imcs==29))?4:((Imcs<20)||(Imcs==30))?6:((Imcs<28)||(Imcs==31))?8:-1);
break;
case 3:
return (((Imcs<15)||(Imcs==29))?2:((Imcs<21)||(Imcs==30))?4:((Imcs<29)||(Imcs==31))?6:-1);
break;
default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx);
return(0);
break;
}
}
uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx) {
switch(table_idx) {
case 1:
return (nr_target_code_rate_table1[Imcs]);
break;
case 2:
return (nr_target_code_rate_table2[Imcs]);
break;
case 3:
return (nr_target_code_rate_table3[Imcs]);
break;
default:
AssertFatal(0, "Invalid MCS table index %d (expected in range [1,3])\n", table_idx);
return(0);
break;
}
}
void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) { void get_coreset_rballoc(uint8_t *FreqDomainResource,int *n_rb,int *rb_offset) {
uint8_t count=0, start=0, start_set=0; uint8_t count=0, start=0, start_set=0;
...@@ -503,7 +442,6 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) { ...@@ -503,7 +442,6 @@ int get_nr_table_idx(int nr_bandP, uint8_t scs_index) {
return i; return i;
} }
int get_subband_size(int NPRB,int size) { int get_subband_size(int NPRB,int size) {
// implements table 5.2.1.4-2 from 36.214 // implements table 5.2.1.4-2 from 36.214
// //
......
...@@ -69,12 +69,6 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB); ...@@ -69,12 +69,6 @@ int NRRIV2BW(int locationAndBandwidth,int N_RB);
int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB); int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize); int PRBalloc_to_locationandbandwidth0(int NPRB,int RBstart,int BWPsize);
int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart); int PRBalloc_to_locationandbandwidth(int NPRB,int RBstart);
extern uint16_t nr_target_code_rate_table1[29];
extern uint16_t nr_target_code_rate_table2[28];
extern uint16_t nr_target_code_rate_table3[29];
extern uint16_t nr_tbs_table[93];
uint8_t nr_get_Qm(uint8_t Imcs, uint8_t table_idx);
uint32_t nr_get_code_rate(uint8_t Imcs, uint8_t table_idx);
int get_subband_size(int NPRB,int size); int get_subband_size(int NPRB,int size);
void SLIV2SL(int SLIV,int *S,int *L); void SLIV2SL(int SLIV,int *S,int *L);
int get_dmrs_port(int nl, uint16_t dmrs_ports); int get_dmrs_port(int nl, uint16_t dmrs_ports);
......
...@@ -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);
......
...@@ -80,7 +80,7 @@ static inline notifiedFIFO_elt_t *newNotifiedFIFO_elt(int size, ...@@ -80,7 +80,7 @@ static inline notifiedFIFO_elt_t *newNotifiedFIFO_elt(int size,
notifiedFIFO_t *reponseFifo, notifiedFIFO_t *reponseFifo,
void (*processingFunc)(void *)) { void (*processingFunc)(void *)) {
notifiedFIFO_elt_t *ret; notifiedFIFO_elt_t *ret;
AssertFatal( NULL != (ret=(notifiedFIFO_elt_t *) malloc(sizeof(notifiedFIFO_elt_t)+size+32)), ""); AssertFatal( NULL != (ret=(notifiedFIFO_elt_t *) calloc(1, sizeof(notifiedFIFO_elt_t)+size+32)), "");
ret->next=NULL; ret->next=NULL;
ret->key=key; ret->key=key;
ret->reponseFifo=reponseFifo; ret->reponseFifo=reponseFifo;
......
...@@ -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

...@@ -173,7 +173,7 @@ void init_transport(PHY_VARS_eNB *eNB) { ...@@ -173,7 +173,7 @@ void init_transport(PHY_VARS_eNB *eNB) {
} }
for (int i=0; i<NUMBER_OF_ULSCH_MAX; i++) { for (int i=0; i<NUMBER_OF_ULSCH_MAX; i++) {
LOG_D(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i); LOG_D(PHY,"Allocating Transport Channel Buffers for ULSCH, UE %d\n",i);
AssertFatal((eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0)) != NULL, AssertFatal((eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,fp->N_RB_UL, 0)) != NULL,
"Can't get eNB ulsch structures\n"); "Can't get eNB ulsch structures\n");
// this is the transmission mode for the signalling channels // this is the transmission mode for the signalling channels
......
...@@ -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) {
...@@ -722,10 +719,17 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -722,10 +719,17 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb); AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
if(slot%(fp->slots_per_subframe/2)) if (fp->slots_per_subframe == 1) {
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples); if (txsymb <= 7)
else siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples); else
siglen = 2 * (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 2) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
} else {
if(slot%(fp->slots_per_subframe/2))
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
else
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
}
//+ ru->end_of_burst_delay; //+ ru->end_of_burst_delay;
flags = 3; // end of burst flags = 3; // end of burst
...@@ -1052,11 +1056,12 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) { ...@@ -1052,11 +1056,12 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
cfg->tx_gain[i] = ru->att_tx; cfg->tx_gain[i] = ru->att_tx;
cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx; cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx;
cfg->configFilename = rf_config_file; cfg->configFilename = rf_config_file;
LOG_I(PHY, "Channel %d: setting tx_gain offset %f, rx_gain offset %f, tx_freq %lu Hz, rx_freq %lu Hz\n", LOG_I(PHY, "Channel %d: setting tx_gain offset %.0f, rx_gain offset %.0f, tx_freq %.0f Hz, rx_freq %.0f Hz, tune_offset %.0f Hz\n",
i, cfg->tx_gain[i], i, cfg->tx_gain[i],
cfg->rx_gain[i], cfg->rx_gain[i],
(unsigned long)cfg->tx_freq[i], cfg->tx_freq[i],
(unsigned long)cfg->rx_freq[i]); cfg->rx_freq[i],
cfg->tune_offset);
} }
} }
...@@ -1300,8 +1305,7 @@ void *ru_thread( void *param ) { ...@@ -1300,8 +1305,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);
...@@ -1319,6 +1323,7 @@ void *ru_thread( void *param ) { ...@@ -1319,6 +1323,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) {
...@@ -1386,9 +1391,12 @@ void *ru_thread( void *param ) { ...@@ -1386,9 +1391,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,
...@@ -1419,7 +1427,6 @@ void *ru_thread( void *param ) { ...@@ -1419,7 +1427,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));
...@@ -2052,6 +2059,8 @@ static void NRRCconfig_RU(void) { ...@@ -2052,6 +2059,8 @@ static void NRRCconfig_RU(void) {
RC.ru[j]->openair0_cfg.time_source = internal; RC.ru[j]->openair0_cfg.time_source = internal;
} }
RC.ru[j]->openair0_cfg.tune_offset = get_softmodem_params()->tune_offset;
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) { if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) { if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
RC.ru[j]->if_south = LOCAL_RF; RC.ru[j]->if_south = LOCAL_RF;
...@@ -2091,9 +2100,7 @@ static void NRRCconfig_RU(void) { ...@@ -2091,9 +2100,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));
...@@ -2113,8 +2120,6 @@ static void NRRCconfig_RU(void) { ...@@ -2113,8 +2120,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;
...@@ -2137,7 +2142,13 @@ static void NRRCconfig_RU(void) { ...@@ -2137,7 +2142,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) {
......
...@@ -354,6 +354,7 @@ void init_openair0(void) { ...@@ -354,6 +354,7 @@ void init_openair0(void) {
openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL; openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL;
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source; openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
openair0_cfg[card].time_source = get_softmodem_params()->timing_source; openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
openair0_cfg[card].tune_offset = get_softmodem_params()->tune_offset;
openair0_cfg[card].tx_num_channels = min(4, frame_parms->nb_antennas_tx); openair0_cfg[card].tx_num_channels = min(4, frame_parms->nb_antennas_tx);
openair0_cfg[card].rx_num_channels = min(4, frame_parms->nb_antennas_rx); openair0_cfg[card].rx_num_channels = min(4, frame_parms->nb_antennas_rx);
......
...@@ -60,6 +60,7 @@ extern "C" ...@@ -60,6 +60,7 @@ extern "C"
#define CONFIG_HLP_DMRSSYNC "tells RU to insert DMRS in subframe 1 slot 0" #define CONFIG_HLP_DMRSSYNC "tells RU to insert DMRS in subframe 1 slot 0"
#define CONFIG_HLP_CLK "tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)\n" #define CONFIG_HLP_CLK "tells hardware to use a clock reference (0:internal, 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_TME "tells hardware to use a time reference (0:internal, 1:external, 2:gpsdo)\n" #define CONFIG_HLP_TME "tells hardware to use a time reference (0:internal, 1:external, 2:gpsdo)\n"
#define CONFIG_HLP_TUNE_OFFSET "LO tuning offset to use in Hz\n"
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n" #define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n" #define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n" #define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
...@@ -118,6 +119,7 @@ extern "C" ...@@ -118,6 +119,7 @@ extern "C"
#define EMULATE_RF softmodem_params.emulate_rf #define EMULATE_RF softmodem_params.emulate_rf
#define CLOCK_SOURCE softmodem_params.clock_source #define CLOCK_SOURCE softmodem_params.clock_source
#define TIMING_SOURCE softmodem_params.timing_source #define TIMING_SOURCE softmodem_params.timing_source
#define TUNE_OFFSET softmodem_params.tune_offset
#define SEND_DMRSSYNC softmodem_params.send_dmrs_sync #define SEND_DMRSSYNC softmodem_params.send_dmrs_sync
#define USIM_TEST softmodem_params.usim_test #define USIM_TEST softmodem_params.usim_test
#define PRB_INTERPOLATION softmodem_params.prb_interpolation #define PRB_INTERPOLATION softmodem_params.prb_interpolation
...@@ -141,6 +143,7 @@ extern int usrp_tx_thread; ...@@ -141,6 +143,7 @@ extern int usrp_tx_thread;
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \ {"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&USIM_TEST, defintval:0, TYPE_UINT8, 0}, \
{"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \ {"clock-source", CONFIG_HLP_CLK, 0, uptr:&CLOCK_SOURCE, defintval:0, TYPE_UINT, 0}, \
{"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \ {"time-source", CONFIG_HLP_TME, 0, uptr:&TIMING_SOURCE, defintval:0, TYPE_UINT, 0}, \
{"tune-offset", CONFIG_HLP_TUNE_OFFSET, 0, dblptr:&TUNE_OFFSET, defintval:0, TYPE_DOUBLE, 0}, \
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \ {"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \ {"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \ {"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
...@@ -245,6 +248,7 @@ typedef struct { ...@@ -245,6 +248,7 @@ typedef struct {
int band; int band;
uint32_t clock_source; uint32_t clock_source;
uint32_t timing_source; uint32_t timing_source;
double tune_offset;
int hw_timing_advance; int hw_timing_advance;
uint32_t send_dmrs_sync; uint32_t send_dmrs_sync;
int prb_interpolation; int prb_interpolation;
......
...@@ -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;
...@@ -433,6 +434,9 @@ typedef struct { ...@@ -433,6 +434,9 @@ typedef struct {
uint8_t mcs; uint8_t mcs;
uint8_t ndi; uint8_t ndi;
uint8_t rv; uint8_t rv;
uint16_t targetCodeRate;
uint8_t qamModOrder;
uint32_t TBS;
uint8_t tb2_mcs; uint8_t tb2_mcs;
uint8_t tb2_ndi; uint8_t tb2_ndi;
uint8_t tb2_rv; uint8_t tb2_rv;
...@@ -464,6 +468,7 @@ typedef struct { ...@@ -464,6 +468,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;
...@@ -476,20 +481,20 @@ typedef struct { ...@@ -476,20 +481,20 @@ typedef struct {
typedef struct { typedef struct {
uint16_t bwp_size;// uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4
uint16_t bwp_start;// uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended
uint8_t subcarrier_spacing;// uint16_t start_rb; // PRB where this CSI resource starts related to common resource block #0 (CRB#0). Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSIFrequencyOccupation], Value: 0 ->274
uint8_t cyclic_prefix;// uint16_t nr_of_rbs; // Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSI-FrequencyOccupation], Value: 24 -> 276
uint16_t start_rb; uint8_t csi_type; // CSI Type [3GPP TS 38.211, sec 7.4.1.5], Value: 0:TRS; 1:CSI-RS NZP; 2:CSI-RS ZP
uint16_t nr_of_rbs; uint8_t row; // Row entry into the CSI Resource location table. [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 1-18
uint8_t csi_type;//Value: 0:TRS 1:CSI-RS NZP 2:CSI-RS ZP uint16_t freq_domain; // Bitmap defining the frequencyDomainAllocation [3GPP TS 38.211, sec 7.4.1.5.3] [3GPP TS 38.331 CSIResourceMapping], Value: Up to the 12 LSBs, actual size is determined by the Row parameter
uint8_t row;//Row entry into the CSI Resource location table. [TS38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1] Value: 1-18 uint8_t symb_l0; // The time domain location l0 and firstOFDMSymbolInTimeDomain [3GPP TS 38.211, sec 7.4.1.5.3], Value: 0->13
uint16_t freq_domain;//Value: Up to the 12 LSBs, actual size is determined by the Row parameter uint8_t symb_l1; // The time domain location l1 and firstOFDMSymbolInTimeDomain2 [3GPP TS 38.211, sec 7.4.1.5.3], Value: 2->12
uint8_t symb_l0;//The time domain location l0 and firstOFDMSymbolInTimeDomain Value: 0->13 uint8_t cdm_type; // The cdm-Type field [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: noCDM; 1: fd-CDM2; 2: cdm4-FD2-TD2; 3: cdm8-FD2-TD4
uint8_t symb_l1;// uint8_t freq_density; // The density field, p and comb offset (for dot5). [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: dot5 (even RB); 1: dot5 (odd RB); 2: one; 3: three
uint8_t cdm_type; uint16_t scramb_id; // ScramblingID of the CSI-RS [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->1023
uint8_t freq_density;//The density field, p and comb offset (for dot5).0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three uint8_t power_control_offset; // Ratio of PDSCH EPRE to NZP CSI-RSEPRE [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->23 representing -8 to 15 dB in 1dB steps; 255: L1 is configured with ProfileSSS
uint16_t scramb_id;//ScramblingID of the CSI-RS [TS38.214, sec 5.2.2.3.1] Value: 0->1023 uint8_t power_control_offset_ss; // Ratio of NZP CSI-RS EPRE to SSB/PBCH block EPRE [3GPP TS 38.214, sec 5.2.2.3.1], Values: 0: -3dB; 1: 0dB; 2: 3dB; 3: 6dB; 255: L1 is configured with ProfileSSS
} fapi_nr_dl_config_csirs_pdu_rel15_t; } fapi_nr_dl_config_csirs_pdu_rel15_t;
......
...@@ -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;
...@@ -920,32 +925,24 @@ typedef struct ...@@ -920,32 +925,24 @@ typedef struct
} nfapi_nr_dlsch_pdu_t; } nfapi_nr_dlsch_pdu_t;
*/ */
//for csi-rs_pdu:
//table 3-39
typedef struct typedef struct
{ {
uint16_t bwp_size;// uint8_t subcarrier_spacing; // subcarrierSpacing [3GPP TS 38.211, sec 4.2], Value:0->4
uint16_t bwp_start;// uint8_t cyclic_prefix; // Cyclic prefix type [3GPP TS 38.211, sec 4.2], 0: Normal; 1: Extended
uint8_t subcarrier_spacing;// uint16_t start_rb; // PRB where this CSI resource starts related to common resource block #0 (CRB#0). Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSIFrequencyOccupation], Value: 0 ->274
uint8_t cyclic_prefix;// uint16_t nr_of_rbs; // Number of PRBs across which this CSI resource spans. Only multiples of 4 are allowed. [3GPP TS 38.331, sec 6.3.2 parameter CSI-FrequencyOccupation], Value: 24 -> 276
uint16_t start_rb; uint8_t csi_type; // CSI Type [3GPP TS 38.211, sec 7.4.1.5], Value: 0:TRS; 1:CSI-RS NZP; 2:CSI-RS ZP
uint16_t nr_of_rbs; uint8_t row; // Row entry into the CSI Resource location table. [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 1-18
uint8_t csi_type;//Value: 0:TRS 1:CSI-RS NZP 2:CSI-RS ZP uint16_t freq_domain; // Bitmap defining the frequencyDomainAllocation [3GPP TS 38.211, sec 7.4.1.5.3] [3GPP TS 38.331 CSIResourceMapping], Value: Up to the 12 LSBs, actual size is determined by the Row parameter
uint8_t row;//Row entry into the CSI Resource location table. [TS38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1] Value: 1-18 uint8_t symb_l0; // The time domain location l0 and firstOFDMSymbolInTimeDomain [3GPP TS 38.211, sec 7.4.1.5.3], Value: 0->13
uint16_t freq_domain;//Value: Up to the 12 LSBs, actual size is determined by the Row parameter uint8_t symb_l1; // The time domain location l1 and firstOFDMSymbolInTimeDomain2 [3GPP TS 38.211, sec 7.4.1.5.3], Value: 2->12
uint8_t symb_l0;//The time domain location l0 and firstOFDMSymbolInTimeDomain Value: 0->13 uint8_t cdm_type; // The cdm-Type field [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: noCDM; 1: fd-CDM2; 2: cdm4-FD2-TD2; 3: cdm8-FD2-TD4
uint8_t symb_l1;// uint8_t freq_density; // The density field, p and comb offset (for dot5). [3GPP TS 38.211, sec 7.4.1.5.3 and table 7.4.1.5.3-1], Value: 0: dot5 (even RB); 1: dot5 (odd RB); 2: one; 3: three
uint8_t cdm_type; uint16_t scramb_id; // ScramblingID of the CSI-RS [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->1023
uint8_t freq_density;//The density field, p and comb offset (for dot5).0: dot5 (even RB), 1: dot5 (odd RB), 2: one, 3: three uint8_t power_control_offset; // Ratio of PDSCH EPRE to NZP CSI-RSEPRE [3GPP TS 38.214, sec 5.2.2.3.1], Value: 0->23 representing -8 to 15 dB in 1dB steps; 255: L1 is configured with ProfileSSS
uint16_t scramb_id;//ScramblingID of the CSI-RS [TS38.214, sec 5.2.2.3.1] Value: 0->1023 uint8_t power_control_offset_ss; // Ratio of NZP CSI-RS EPRE to SSB/PBCH block EPRE [3GPP TS 38.214, sec 5.2.2.3.1], Values: 0: -3dB; 1: 0dB; 2: 3dB; 3: 6dB; 255: L1 is configured with ProfileSSS
//tx power info
uint8_t power_control_offset;//Ratio of PDSCH EPRE to NZP CSI-RSEPRE Value :0->23 representing -8 to 15 dB in 1dB steps
uint8_t power_control_offset_ss;//Ratio of SSB/PBCH block EPRE to NZP CSI-RS EPRES 0: -3dB, 1: 0dB, 2: 3dB, 3: 6dB
} nfapi_nr_dl_tti_csi_rs_pdu_rel15_t; } nfapi_nr_dl_tti_csi_rs_pdu_rel15_t;
//for ssb_pdu:
typedef struct typedef struct
{ {
...@@ -1195,6 +1192,10 @@ typedef struct ...@@ -1195,6 +1192,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 +1241,7 @@ typedef struct ...@@ -1240,7 +1241,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:
......
...@@ -200,8 +200,6 @@ static uint8_t pack_tpm_value(nfapi_dl_config_dci_dl_tpm_t *value, uint8_t **ppW ...@@ -200,8 +200,6 @@ static uint8_t pack_tpm_value(nfapi_dl_config_dci_dl_tpm_t *value, uint8_t **ppW
static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) { static uint8_t pack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppWritePackedMsg, uint8_t *end) {
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv; nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv;
return( return(
push16(value->bwp_size, ppWritePackedMsg, end) &&
push16(value->bwp_start, ppWritePackedMsg, end) &&
push8(value->subcarrier_spacing, ppWritePackedMsg, end) && push8(value->subcarrier_spacing, ppWritePackedMsg, end) &&
push8(value->cyclic_prefix, ppWritePackedMsg, end) && push8(value->cyclic_prefix, ppWritePackedMsg, end) &&
push16(value->start_rb, ppWritePackedMsg, end) && push16(value->start_rb, ppWritePackedMsg, end) &&
...@@ -3663,8 +3661,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -3663,8 +3661,6 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) { static uint8_t unpack_dl_tti_csi_rs_pdu_rel15_value(void *tlv, uint8_t **ppReadPackedMsg, uint8_t *end) {
nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv; nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *value = (nfapi_nr_dl_tti_csi_rs_pdu_rel15_t *)tlv;
return( return(
pull16(ppReadPackedMsg, &value->bwp_size, end) &&
pull16(ppReadPackedMsg, &value->bwp_start, end) &&
pull8(ppReadPackedMsg, &value->subcarrier_spacing, end) && pull8(ppReadPackedMsg, &value->subcarrier_spacing, end) &&
pull8(ppReadPackedMsg, &value->cyclic_prefix, end) && pull8(ppReadPackedMsg, &value->cyclic_prefix, end) &&
pull16(ppReadPackedMsg, &value->start_rb, end) && pull16(ppReadPackedMsg, &value->start_rb, end) &&
......
...@@ -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);
......
...@@ -469,28 +469,11 @@ int32_t nr_segmentation(unsigned char *input_buffer, ...@@ -469,28 +469,11 @@ int32_t nr_segmentation(unsigned char *input_buffer,
unsigned int *F, unsigned int *F,
uint8_t BG); uint8_t BG);
/*!\fn uint32_t nr_compute_tbs
\brief This function returns the TBS in bits as per 6.1.4.2 of TS 38.214
*/
uint32_t nr_compute_tbs(uint16_t Qm,
uint16_t R,
uint16_t nb_rb,
uint16_t nb_symb_sch,
uint16_t nb_dmrs_prb,
uint16_t nb_rb_oh,
uint8_t tb_scaling,
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 +484,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm, ...@@ -501,8 +484,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));
......
This diff is collapsed.
...@@ -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;
...@@ -124,9 +124,10 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -124,9 +124,10 @@ int nr_phy_init_RU(RU_t *ru) {
ru->num_gNB,NUMBER_OF_gNB_MAX); ru->num_gNB,NUMBER_OF_gNB_MAX);
LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB); LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
if (ru->do_precoding == 1) {
if (ru->do_precoding == 1) {
int beam_count = 0; int beam_count = 0;
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1 if (ru->nb_tx>1) { //Enable beamforming when nb_tx > 1
for (p=0;p<ru->nb_log_antennas;p++) { for (p=0;p<ru->nb_log_antennas;p++) {
//if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0 //if ((fp->L_ssb >> (63-p)) & 0x01)//64 bit-map with the MSB @2⁶³ corresponds to SSB ssb_index 0
...@@ -149,7 +150,7 @@ int nr_phy_init_RU(RU_t *ru) { ...@@ -149,7 +150,7 @@ int nr_phy_init_RU(RU_t *ru) {
} // for j } // for j
//} //}
} // for p } // for p
} //for i } // for i
} }
ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*)); ru->common.beam_id = (uint8_t**)malloc16_clear(ru->nb_tx*sizeof(uint8_t*));
...@@ -205,12 +206,11 @@ void nr_phy_free_RU(RU_t *ru) ...@@ -205,12 +206,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)
......
...@@ -76,7 +76,6 @@ void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch, ...@@ -76,7 +76,6 @@ void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch,
pdsch->dl_ch_magr0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->dl_ch_magr0 = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*fp->nb_antennas_rx*sizeof(int32_t *) );
pdsch->ptrs_phase_per_slot = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->ptrs_phase_per_slot = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
pdsch->ptrs_re_per_slot = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) ); pdsch->ptrs_re_per_slot = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
pdsch->dl_ch_ptrs_estimates_ext = (int32_t **)malloc16_clear( fp->nb_antennas_rx*sizeof(int32_t *) );
// the allocated memory size is fixed: // the allocated memory size is fixed:
AssertFatal( fp->nb_antennas_rx <= 4, "nb_antennas_rx > 4" );//Extend the max number of UE Rx antennas to 4 AssertFatal( fp->nb_antennas_rx <= 4, "nb_antennas_rx > 4" );//Extend the max number of UE Rx antennas to 4
...@@ -86,7 +85,6 @@ void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch, ...@@ -86,7 +85,6 @@ void phy_init_nr_ue_PDSCH(NR_UE_PDSCH *const pdsch,
pdsch->rxdataF_uespec_pilots[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * fp->N_RB_DL*12); pdsch->rxdataF_uespec_pilots[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * fp->N_RB_DL*12);
pdsch->ptrs_phase_per_slot[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * 14 ); pdsch->ptrs_phase_per_slot[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * 14 );
pdsch->ptrs_re_per_slot[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * 14); pdsch->ptrs_re_per_slot[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * 14);
pdsch->dl_ch_ptrs_estimates_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t) * num);
pdsch->rho[i] = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS*sizeof(int32_t *) ); pdsch->rho[i] = (int32_t **)malloc16_clear( NR_MAX_NB_LAYERS*NR_MAX_NB_LAYERS*sizeof(int32_t *) );
for (int j=0; j<NR_MAX_NB_LAYERS; j++) { for (int j=0; j<NR_MAX_NB_LAYERS; j++) {
...@@ -126,7 +124,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp ...@@ -126,7 +124,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp
free_and_zero(pdsch->rxdataF_uespec_pilots[i]); free_and_zero(pdsch->rxdataF_uespec_pilots[i]);
free_and_zero(pdsch->ptrs_phase_per_slot[i]); free_and_zero(pdsch->ptrs_phase_per_slot[i]);
free_and_zero(pdsch->ptrs_re_per_slot[i]); free_and_zero(pdsch->ptrs_re_per_slot[i]);
free_and_zero(pdsch->dl_ch_ptrs_estimates_ext[i]);
free_and_zero(pdsch->rho[i]); free_and_zero(pdsch->rho[i]);
} }
free_and_zero(pdsch->pmi_ext); free_and_zero(pdsch->pmi_ext);
...@@ -149,7 +146,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp ...@@ -149,7 +146,6 @@ void phy_term_nr_ue__PDSCH(NR_UE_PDSCH* pdsch, const NR_DL_FRAME_PARMS *const fp
free_and_zero(pdsch->dl_ch_magr0); free_and_zero(pdsch->dl_ch_magr0);
free_and_zero(pdsch->ptrs_phase_per_slot); free_and_zero(pdsch->ptrs_phase_per_slot);
free_and_zero(pdsch->ptrs_re_per_slot); free_and_zero(pdsch->ptrs_re_per_slot);
free_and_zero(pdsch->dl_ch_ptrs_estimates_ext);
} }
int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
...@@ -159,10 +155,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -159,10 +155,12 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
NR_UE_COMMON *const common_vars = &ue->common_vars; NR_UE_COMMON *const common_vars = &ue->common_vars;
NR_UE_PBCH **const pbch_vars = ue->pbch_vars; NR_UE_PBCH **const pbch_vars = ue->pbch_vars;
NR_UE_PRACH **const prach_vars = ue->prach_vars; NR_UE_PRACH **const prach_vars = ue->prach_vars;
int i,slot,symb, gNB_id, th_id; NR_UE_CSI_IM **const csiim_vars = ue->csiim_vars;
NR_UE_CSI_RS **const csirs_vars = ue->csirs_vars;
NR_UE_SRS **const srs_vars = ue->srs_vars; NR_UE_SRS **const srs_vars = ue->srs_vars;
int i, j, slot, symb, gNB_id, th_id;
LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx); LOG_I(PHY, "Initializing UE vars for gNB TXant %u, UE RXant %u\n", fp->nb_antennas_tx, fp->nb_antennas_rx);
phy_init_nr_top(ue); phy_init_nr_top(ue);
...@@ -339,9 +337,45 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -339,9 +337,45 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH)); prach_vars[gNB_id] = (NR_UE_PRACH *)malloc16_clear(sizeof(NR_UE_PRACH));
pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH)); pbch_vars[gNB_id] = (NR_UE_PBCH *)malloc16_clear(sizeof(NR_UE_PBCH));
csiim_vars[gNB_id] = (NR_UE_CSI_IM *)malloc16_clear(sizeof(NR_UE_CSI_IM));
csirs_vars[gNB_id] = (NR_UE_CSI_RS *)malloc16_clear(sizeof(NR_UE_CSI_RS));
srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS)); srs_vars[gNB_id] = (NR_UE_SRS *)malloc16_clear(sizeof(NR_UE_SRS));
csiim_vars[gNB_id]->active = false;
csirs_vars[gNB_id]->active = false;
srs_vars[gNB_id]->active = false; srs_vars[gNB_id]->active = false;
// ceil((NB_RB*8(max allocation per RB)*2(QPSK))/32)
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
ue->nr_csi_rs_info = (nr_csi_rs_info_t *)malloc16_clear(sizeof(nr_csi_rs_info_t));
ue->nr_csi_rs_info->nr_gold_csi_rs = (uint32_t ***)malloc16(fp->slots_per_frame*sizeof(uint32_t **));
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs!=NULL, "NR init: csi reference signal malloc failed\n");
for (int slot=0; slot<fp->slots_per_frame; slot++) {
ue->nr_csi_rs_info->nr_gold_csi_rs[slot] = (uint32_t **)malloc16(fp->symbols_per_slot*sizeof(uint32_t *));
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs[slot]!=NULL, "NR init: csi reference signal for slot %d - malloc failed\n", slot);
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb] = (uint32_t *)malloc16(csi_dmrs_init_length*sizeof(uint32_t));
AssertFatal(ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]!=NULL, "NR init: csi reference signal for slot %d symbol %d - malloc failed\n", slot, symb);
}
}
ue->nr_csi_rs_info->noise_power = (uint32_t*)malloc16_clear(sizeof(uint32_t));
ue->nr_csi_rs_info->csi_rs_generated_signal = (int32_t **)malloc16(NR_MAX_NB_PORTS * sizeof(int32_t *) );
for (i=0; i<NR_MAX_NB_PORTS; i++) {
ue->nr_csi_rs_info->csi_rs_generated_signal[i] = (int32_t *) malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t));
}
ue->nr_csi_rs_info->csi_rs_received_signal = (int32_t **)malloc16(fp->nb_antennas_rx * sizeof(int32_t *) );
ue->nr_csi_rs_info->csi_rs_ls_estimated_channel = (int32_t ***)malloc16(fp->nb_antennas_rx * sizeof(int32_t **) );
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq = (int32_t ***)malloc16(fp->nb_antennas_rx * sizeof(int32_t **) );
for (i=0; i<fp->nb_antennas_rx; i++) {
ue->nr_csi_rs_info->csi_rs_received_signal[i] = (int32_t *) malloc16_clear(fp->samples_per_frame_wCP * sizeof(int32_t));
ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i] = (int32_t **) malloc16_clear(NR_MAX_NB_PORTS * sizeof(int32_t *));
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i] = (int32_t **) malloc16_clear(NR_MAX_NB_PORTS * sizeof(int32_t *));
for (j=0; j<NR_MAX_NB_PORTS; j++) {
ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i][j] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size * sizeof(int32_t));
ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i][j] = (int32_t *) malloc16_clear(fp->ofdm_symbol_size * sizeof(int32_t));
}
}
ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t)); ue->nr_srs_info = (nr_srs_info_t *)malloc16_clear(sizeof(nr_srs_info_t));
ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t)); ue->nr_srs_info->sc_list = (uint16_t *) malloc16_clear(6*fp->N_RB_UL*sizeof(uint16_t));
ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) ); ue->nr_srs_info->srs_generated_signal = (int32_t *) malloc16_clear( (2*(fp->samples_per_frame)+2048)*sizeof(int32_t) );
...@@ -460,6 +494,32 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -460,6 +494,32 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
free_and_zero(ue->pdcch_vars[th_id][gNB_id]); free_and_zero(ue->pdcch_vars[th_id][gNB_id]);
} }
for (int i=0; i<NR_MAX_NB_PORTS; i++) {
free_and_zero(ue->nr_csi_rs_info->csi_rs_generated_signal[i]);
}
for (int i = 0; i < fp->nb_antennas_rx; i++) {
free_and_zero(ue->nr_csi_rs_info->csi_rs_received_signal[i]);
for (int j=0; j<NR_MAX_NB_PORTS; j++) {
free_and_zero(ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i][j]);
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i][j]);
}
free_and_zero(ue->nr_csi_rs_info->csi_rs_ls_estimated_channel[i]);
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq[i]);
}
for (int slot=0; slot<fp->slots_per_frame; slot++) {
for (int symb=0; symb<fp->symbols_per_slot; symb++) {
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs[slot][symb]);
}
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs[slot]);
}
free_and_zero(ue->nr_csi_rs_info->noise_power);
free_and_zero(ue->nr_csi_rs_info->nr_gold_csi_rs);
free_and_zero(ue->nr_csi_rs_info->csi_rs_generated_signal);
free_and_zero(ue->nr_csi_rs_info->csi_rs_received_signal);
free_and_zero(ue->nr_csi_rs_info->csi_rs_ls_estimated_channel);
free_and_zero(ue->nr_csi_rs_info->csi_rs_estimated_channel_freq);
free_and_zero(ue->nr_csi_rs_info);
for (int i = 0; i < fp->nb_antennas_rx; i++) { for (int i = 0; i < fp->nb_antennas_rx; i++) {
free_and_zero(ue->nr_srs_info->srs_received_signal[i]); free_and_zero(ue->nr_srs_info->srs_received_signal[i]);
free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]); free_and_zero(ue->nr_srs_info->srs_ls_estimated_channel[i]);
...@@ -477,6 +537,8 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB) ...@@ -477,6 +537,8 @@ void term_nr_ue_signal(PHY_VARS_NR_UE *ue, int nb_connected_gNB)
free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted); free_and_zero(ue->nr_srs_info->srs_estimated_channel_time_shifted);
free_and_zero(ue->nr_srs_info); free_and_zero(ue->nr_srs_info);
free_and_zero(ue->csiim_vars[gNB_id]);
free_and_zero(ue->csirs_vars[gNB_id]);
free_and_zero(ue->srs_vars[gNB_id]); free_and_zero(ue->srs_vars[gNB_id]);
free_and_zero(ue->pbch_vars[gNB_id]); free_and_zero(ue->pbch_vars[gNB_id]);
...@@ -497,7 +559,7 @@ void term_nr_ue_transport(PHY_VARS_NR_UE *ue) ...@@ -497,7 +559,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);
} }
} }
...@@ -518,7 +580,7 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue) { ...@@ -518,7 +580,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,
......
...@@ -665,8 +665,9 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) { ...@@ -665,8 +665,9 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp) {
void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp) void init_timeshift_rotation(NR_DL_FRAME_PARMS *fp)
{ {
const int sample_offset = fp->nb_prefix_samples / fp->ofdm_offset_divisor;
for (int i = 0; i < fp->ofdm_symbol_size; i++) { for (int i = 0; i < fp->ofdm_symbol_size; i++) {
double poff = -i * 2.0 * M_PI * 144.0 / 2048.0 / fp->ofdm_offset_divisor; double poff = -i * 2.0 * M_PI * sample_offset / fp->ofdm_symbol_size;
double exp_re = cos(poff); double exp_re = cos(poff);
double exp_im = sin(-poff); double exp_im = sin(-poff);
fp->timeshift_symbol_rotation[i*2] = (int16_t)round(exp_re * 32767); fp->timeshift_symbol_rotation[i*2] = (int16_t)round(exp_re * 32767);
......
...@@ -34,47 +34,6 @@ ...@@ -34,47 +34,6 @@
#define LOG_I(A,B...) printf(A) #define LOG_I(A,B...) printf(A)
#endif*/ #endif*/
dft_size_idx_t get_dft_size_idx(uint16_t ofdm_symbol_size)
{
switch (ofdm_symbol_size) {
case 128:
return DFT_128;
case 256:
return DFT_256;
case 512:
return DFT_512;
case 1024:
return DFT_1024;
case 1536:
return DFT_1536;
case 2048:
return DFT_2048;
case 3072:
return DFT_3072;
case 4096:
return DFT_4096;
case 6144:
return DFT_6144;
case 8192:
return DFT_8192;
default:
printf("unsupported ofdm symbol size \n");
assert(0);
}
return DFT_SIZE_IDXTABLESIZE;
}
int nr_slot_fep(PHY_VARS_NR_UE *ue, int nr_slot_fep(PHY_VARS_NR_UE *ue,
UE_nr_rxtx_proc_t *proc, UE_nr_rxtx_proc_t *proc,
unsigned char symbol, unsigned char symbol,
...@@ -96,7 +55,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue, ...@@ -96,7 +55,7 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
nb_prefix_samples0 = frame_parms->nb_prefix_samples; nb_prefix_samples0 = frame_parms->nb_prefix_samples;
} }
dft_size_idx_t dftsize = get_dft_size_idx(frame_parms->ofdm_symbol_size); dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size);
// This is for misalignment issues // This is for misalignment issues
int32_t tmp_dft_in[8192] __attribute__ ((aligned (32))); int32_t tmp_dft_in[8192] __attribute__ ((aligned (32)));
...@@ -195,7 +154,7 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue, ...@@ -195,7 +154,7 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
} }
unsigned int frame_length_samples = frame_parms->samples_per_frame; unsigned int frame_length_samples = frame_parms->samples_per_frame;
dft_size_idx_t dftsize = get_dft_size_idx(frame_parms->ofdm_symbol_size); dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size);
// This is for misalignment issues // This is for misalignment issues
int32_t tmp_dft_in[8192] __attribute__ ((aligned (32))); int32_t tmp_dft_in[8192] __attribute__ ((aligned (32)));
...@@ -289,7 +248,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms, ...@@ -289,7 +248,7 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
unsigned int nb_prefix_samples = frame_parms->nb_prefix_samples; unsigned int nb_prefix_samples = frame_parms->nb_prefix_samples;
unsigned int nb_prefix_samples0 = frame_parms->nb_prefix_samples0; unsigned int nb_prefix_samples0 = frame_parms->nb_prefix_samples0;
dft_size_idx_t dftsize = get_dft_size_idx(frame_parms->ofdm_symbol_size); dft_size_idx_t dftsize = get_dft(frame_parms->ofdm_symbol_size);
// This is for misalignment issues // This is for misalignment issues
int32_t tmp_dft_in[8192] __attribute__ ((aligned (32))); int32_t tmp_dft_in[8192] __attribute__ ((aligned (32)));
......
...@@ -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++) {
......
...@@ -295,74 +295,6 @@ uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_ ...@@ -295,74 +295,6 @@ uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_
#define CHECK_DMRS_PBCH_SEQUENCE #define CHECK_DMRS_PBCH_SEQUENCE
void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE], uint16_t Nid_cell)
{
uint32_t cinit;
int i_ssb;
int n_hf;
int _i_ssb;
#ifdef CHECK_DMRS_PBCH_SEQUENCE
uint32_t dmrs_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE];
uint32_t *dmrs_sequence = calloc(CELL_DMRS_LENGTH, sizeof(uint32_t));
if (dmrs_sequence == NULL) {
msg("Fatal error: memory allocation problem \n");
assert(0);
}
else
{
printf("Check of demodulation reference signal of pbch sequence \n");
}
#endif
/* for each slot number */
for (i_ssb = 0; i_ssb<DMRS_PBCH_I_SSB; i_ssb++) {
/* for each ofdm position */
for (n_hf=0; n_hf<DMRS_PBCH_N_HF; n_hf++) {
_i_ssb = i_ssb + 4*n_hf;
cinit = (((_i_ssb + 1)*((Nid_cell>>4) + 1))<<11) + ((_i_ssb + 1)<<6) + (Nid_cell%4);
pseudo_random_sequence_optimised(DMRS_BITMAP_SIZE, &(dmrs_pbch_bitmap[i_ssb][n_hf][0]), cinit);
#ifdef CHECK_DMRS_PBCH_SEQUENCE
/* it allows checking generated with standard generation code */
pseudo_random_sequence(DMRS_BITMAP_SIZE*sizeof(uint32_t), dmrs_sequence, cinit);
int j = 0;
int k = 0;
/* format for getting bitmap from uint32_t */
for (int i=0; i<DMRS_BITMAP_SIZE; i++) {
dmrs_bitmap[i_ssb][n_hf][i] = 0;
/* convert to bitmap */
for (; j < k + 32; j++) {
dmrs_bitmap[i_ssb][n_hf][i] |= (dmrs_sequence[j]<<j);
}
k = j;
}
for (int i=0; i<DMRS_BITMAP_SIZE; i++) {
if (dmrs_pbch_bitmap[i_ssb][n_hf][i] != dmrs_bitmap[i_ssb][n_hf][i]) {
printf("Error in gold sequence computation for ns %d l %d and index %i : 0x%x 0x%x \n", i_ssb, n_hf, i, dmrs_pbch_bitmap[i_ssb][n_hf][i], dmrs_bitmap[i_ssb][n_hf][i]);
assert(0);
}
}
#endif
}
}
#ifdef CHECK_DMRS_PBCH_SEQUENCE
free(dmrs_sequence);
#endif
}
/* return the position of next dmrs symbol in a slot */ /* return the position of next dmrs symbol in a slot */
int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol) int8_t get_next_dmrs_symbol_in_slot(uint16_t ul_dmrs_symb_pos, uint8_t counter, uint8_t end_symbol)
{ {
......
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
int pseudo_random_sequence(int M_PN, uint32_t *c, uint32_t cinit); int pseudo_random_sequence(int M_PN, uint32_t *c, uint32_t cinit);
void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell); void lte_gold_new(LTE_DL_FRAME_PARMS *frame_parms, uint32_t lte_gold_table[20][2][14], uint16_t Nid_cell);
void generate_dmrs_pbch(uint32_t dmrs_pbch_bitmap[DMRS_PBCH_I_SSB][DMRS_PBCH_N_HF][DMRS_BITMAP_SIZE], uint16_t Nid_cell);
uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type); uint16_t get_dmrs_freq_idx_ul(uint16_t n, uint8_t k_prime, uint8_t delta, uint8_t dmrs_type);
uint8_t allowed_xlsch_re_in_dmrs_symbol(uint16_t k, uint8_t allowed_xlsch_re_in_dmrs_symbol(uint16_t k,
......
...@@ -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,
......
...@@ -123,27 +123,3 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid) { ...@@ -123,27 +123,3 @@ void nr_gold_pusch(PHY_VARS_gNB* gNB, int nscid, uint32_t nid) {
} }
} }
} }
void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid)
{
NR_DL_FRAME_PARMS *fp = &gNB->frame_parms;
uint32_t ***csi_rs = gNB->nr_gold_csi_rs;
uint32_t x1, x2;
uint8_t reset;
int csi_dmrs_init_length = ((fp->N_RB_DL<<4)>>5)+1;
for (uint8_t slot=0; slot<fp->slots_per_frame; slot++) {
for (uint8_t symb=0; symb<fp->symbols_per_slot; symb++) {
reset = 1;
x2 = ((1<<10) * (fp->symbols_per_slot*slot+symb+1) * ((Nid<<1)+1) + (Nid));
for (uint32_t n=0; n<csi_dmrs_init_length; n++) {
csi_rs[slot][symb][n] = lte_gold_generic(&x1, &x2, reset);
reset = 0;
}
}
}
}
...@@ -38,10 +38,12 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB); ...@@ -38,10 +38,12 @@ void nr_init_pbch_dmrs(PHY_VARS_gNB* gNB);
*/ */
void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid); void nr_init_pdcch_dmrs(PHY_VARS_gNB* gNB, uint32_t Nid);
void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint8_t nscid, uint32_t Nid); void nr_init_pdsch_dmrs(PHY_VARS_gNB* gNB, uint8_t nscid, uint32_t Nid);
void nr_init_csi_rs(PHY_VARS_gNB* gNB, uint32_t Nid); void nr_init_csi_rs(NR_DL_FRAME_PARMS *fp, uint32_t ***csi_rs, 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,
......
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.
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