Commit 474cde3b authored by Robert Schmidt's avatar Robert Schmidt

Merge branch 'integration_2022_wk35b' into 'develop'

integration_2022_wk35b

See merge request oai/openairinterface5g!1689

MR !785 Add .clang-format file
MR !1487 LDPC offload on T1 card
MR !1677 NR LBRM for UL
MR !1683 Schedule ULSCH in flexible slots in InitialBWP
MR !1674 Optimize nr_rotation
MR !1685 Fix AssertFatal in Msg3
MR !1684 Implementation of a RA timer to remove UE in the case of Msg4 not be decoded by the UE
MR !1669 Fixes when there is no spCellConfig configured
MR !1648 simplify thread pool configuration
MR !1609 improve-nr_ul_channel_estimation
parents 8229f00d 23459a48
---
Language: Cpp
# BasedOnStyle: Google
AccessModifierOffset: -1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: true
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: After
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakStringLiterals: true
ColumnLimit: 200
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 1
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 1
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 1
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
TabWidth: 2
UseTab: Never
...
......@@ -21,7 +21,6 @@ The Regents of the University of California: BSD 3-Clause Licence.
Niels Provos <provos@citi.umich.edu>: BSD 2-Clause Licence.
## Credits for source code openair3/GTPV1-U/nw-gtpv1u: ##
Amit Chawre <http://www.amitchawre.net/contact.html>: BSD 2-Clause Licence.
## Credits for source code openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c and nrLDPC_offload.h: ##
Intel Corporation SPDX-License-Identifier: BSD-3-Clause Licence
......@@ -338,6 +338,27 @@ pipeline {
}
}
}
//avra is offline, re-enable once it is available
//stage ("Test T1 Offload") {
// when { expression {doMandatoryTests} }
// steps {
// script {
// triggerSlaveJob ('RAN-T1-Offload-Test', 'Test-T1-Offload')
// }
// }
// post {
// always {
// script {
// finalizeSlaveJob('RAN-T1-Offload-Test')
// }
// }
// failure {
// script {
// currentBuild.result = 'FAILURE'
// }
// }
// }
//}
}
}
stage ("Images Push to Registries") {
......
......@@ -111,17 +111,7 @@ pipeline {
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
sh "zip -r -qq localZip.zip ."
// Running astyle options on the list of modified files by the merge request
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
def res=readFile('./oai_rules_result.txt').trim();
if ("0".equals(res)) {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
addGitLabMRComment comment: message
} else {
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
addGitLabMRComment comment: message
}
// here was an astyle formatting check, with corresponding messages. The same could be done with clang-format
} else {
echo "Git Branch is ${GIT_BRANCH}"
echo "Git Commit is ${GIT_COMMIT}"
......@@ -132,9 +122,6 @@ pipeline {
sh "git log -n1 --pretty=format:\"%s\" > .git/CI_COMMIT_MSG"
sh "zip -r -qq localZip.zip ."
// Running astyle options on all C/H files in the repository
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
sh "./ci-scripts/checkCodingFormattingRules.sh"
}
}
}
......
# OAI is using a style that is similar to the Google style
--style=google
# long options can be written without the preceding '--'
# Convert tabs to spaces
convert-tabs
# Indentation is 2 spaces
indent=spaces=2
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
indent-switches
# Indent preprocessor blocks at bracket level 0.
indent-preproc-block
# Indent multi-line preprocessor #define statements.
indent-preproc-define
# Indent C++ comments beginning in column one.
indent-col1-comments
# Pad empty lines around header blocks
break-blocks
delete-empty-lines
# Attach a pointer or reference operator (*, &, or ^) to the variable name (right)
align-pointer=name
# The code line length is 200 characters/columns (this is the maximum allowed by astyle)
max-code-length=200
# If the line contains logical conditionals they will be placed first on the new line.
break-after-logical
# Force use of the linux end of line
lineend=linux
......@@ -24,8 +24,6 @@ function usage {
echo "OAI Coding / Formatting Guideline Check script"
echo " Original Author: Raphael Defosseux"
echo ""
echo " Requirement: astyle shall be installed"
echo ""
echo " By default (no options) the complete repository will be checked"
echo " In case of merge request, provided source and target branch,"
echo " the script will check only the modified files"
......@@ -57,11 +55,10 @@ fi
if [ $# -eq 0 ]
then
echo " ---- Checking the whole repository ----"
echo ""
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_TO_FORMAT > ./oai_rules_result.txt
# in this file we previously had a list of files that were not properly
# formatted. At the time of this MR, the Jenkinsfile expects this file, so
# we simply produce an empty one
touch ./oai_rules_result.txt
# Testing Circular Dependencies protection
awk '/#[ \t]*ifndef/ { gsub("^.*ifndef *",""); if (names[$1]!="") print "files with same {define ", FILENAME, names[$1]; names[$1]=FILENAME } /#[ \t]*define/ { gsub("^.*define *",""); if(names[$1]!=FILENAME) print "error in declaration", FILENAME, $1, names[$1]; nextfile }' `find openair* common targets executables -name *.h |grep -v LFDS` > header-files-w-incorrect-define.txt
......@@ -77,7 +74,7 @@ then
IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true`
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE || true`
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FILE || true`
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true`
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true`
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
then
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
......@@ -151,10 +148,6 @@ echo ""
# Retrieve the list of modified files since the latest develop commit
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
NB_TO_FORMAT=0
if [ -f oai_rules_result_list.txt ]
then
rm -f oai_rules_result_list.txt
fi
if [ -f header-files-w-incorrect-define.txt ]
then
rm -f header-files-w-incorrect-define.txt
......@@ -178,13 +171,6 @@ do
EXT="${filename##*.}"
if [ $EXT = "c" ] || [ $EXT = "h" ] || [ $EXT = "cpp" ] || [ $EXT = "hpp" ]
then
TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt $FULLFILE | grep -c Formatted || true`
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
if [ $TO_FORMAT -ne 0 ]
then
echo $FULLFILE
echo $FULLFILE >> ./oai_rules_result_list.txt
fi
# Testing if explicit GNU GPL license banner
GNU_EXCEPTION=`echo $FULLFILE | egrep -c "openair3/NAS/COMMON/milenage.h" || true`
if [ $GNU_EXCEPTION -eq 0 ]
......@@ -198,7 +184,7 @@ do
IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext" || true`
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE || true`
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence|License-Identifier: BSD-2-Clause" $FULLFILE || true`
IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/crc|openair1/PHY/CODING/types.h" || true`
IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|openair2/UTIL/OPT/packet-rohc.h|openair3/NAS/COMMON/milenage.h|openair1/PHY/CODING/types.h|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c|openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_offload.h" || true`
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
then
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
......@@ -215,9 +201,10 @@ do
fi
done
rm -f header-files-w-incorrect-define-tmp.txt
echo ""
echo " ----------------------------------------------------------"
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
echo $NB_TO_FORMAT > ./oai_rules_result.txt
# in this script we previously produced a list of files that were not properly
# formatted. At the time of this MR, the Jenkinsfile expects this file, so
# we simply produce an empty file
touch ./oai_rules_result.txt
exit 0
......@@ -675,7 +675,7 @@ class Containerize():
result = re.search('service=(?P<svc_name>[a-zA-Z0-9\_]+)', mySSH.getBefore())
if result is not None:
svcName = result.group('svc_name')
mySSH.command('docker-compose --file ci-docker-compose.yml up -d ' + svcName, '\$', 10)
mySSH.command('docker-compose --file ci-docker-compose.yml up -d ' + svcName, '\$', 15)
# Checking Status
mySSH.command('docker-compose --file ci-docker-compose.yml config', '\$', 5)
......
......@@ -56,7 +56,6 @@ class PhySim:
self.__workSpacePath=''
self.__buildLogFile='compile_phy_sim.log'
self.__runLogFile=''
self.__runResults=[]
self.__runLogPath='phy_sim_logs'
......@@ -64,20 +63,20 @@ class PhySim:
#PRIVATE Methods
#-----------------
def __CheckResults_PhySim(self,HTML,CONST,testcase_id):
def __CheckResults_LDPCTest(self,HTML,CONST,testcase_id):
mySSH = sshconnection.SSHConnection()
mySSH.open(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord)
#retrieve run log file and store it locally$
mySSH.copyin(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord, self.__workSpacePath+self.__runLogFile, '.')
mySSH.close()
#parse results looking for Encoding and Decoding mean values
self.__runResults=[]
runResults=[]
with open(self.__runLogFile) as f:
for line in f:
if 'mean' in line:
self.__runResults.append(line)
runResults.append(line)
#the values are appended for each mean value (2), so we take these 2 values from the list
info=self.__runResults[0]+self.__runResults[1]
info = runResults[0] + runResults[1]
#once parsed move the local logfile to its folder for tidiness
os.system('mv '+self.__runLogFile+' '+ self.__runLogPath+'/.')
......@@ -89,6 +88,38 @@ class PhySim:
HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', 1, html_queue)
return HTML
def __CheckResults_NRulsimTest(self, HTML, CONST, testcase_id):
html_queue = SimpleQueue()
#retrieve run log file and store it locally
mySSH = sshconnection.SSHConnection()
filename = self.__workSpacePath + self.__runLogFile
ret = mySSH.copyin(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord, filename, '.')
if ret != 0:
error_msg = f'could not recover test result file {filename}'
logging.error(error_msg)
html_queue.put(f'<pre style="background-color:white">{error_msg}</pre>')
HTML.CreateHtmlTestRowQueue("could not recover results", 'KO', 1, html_queue)
self.exitStatus = 1
return HTML
PUSCH_OK = False
with open(self.__runLogFile) as f:
PUSCH_OK = 'PUSCH test OK' in f.read()
# once parsed move the local logfile to its folder for tidiness
os.system(f'mv {self.__runLogFile} {self.__runLogPath}/.')
#updating the HTML with results
if PUSCH_OK:
html_queue.put('<pre style="background-color:white">succeeded</pre>')
HTML.CreateHtmlTestRowQueue(self.runargs, 'OK', 1, html_queue)
else:
error_msg = 'error: no "PUSCH test OK"'
logging.error(error_msg)
html_queue.put(f'<pre style="background-color:white">{error_msg}</pre>')
HTML.CreateHtmlTestRowQueue(self.runargs, 'KO', 1, html_queue)
self.exitStatus = 1
return HTML
def __CheckBuild_PhySim(self, HTML, CONST):
self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/'
......@@ -100,21 +131,16 @@ class PhySim:
mySSH.command('rm ' + self.__workSpacePath+self.__runLogFile, '\$', 5)
mySSH.close()
#check build result from local compile log file
buildStatus=False
with open(self.__buildLogFile) as f:
#nr_prachsim is the last compile step
if 'nr_prachsim compiled' in f.read():
buildStatus=True
#update HTML based on build status
if buildStatus:
HTML.CreateHtmlTestRow(self.buildargs, 'OK', CONST.ALL_PROCESSES_OK, 'LDPC')
if 'BUILD SHOULD BE SUCCESSFUL' in f.read():
HTML.CreateHtmlTestRow(self.buildargs, 'OK', CONST.ALL_PROCESSES_OK, 'PhySim')
self.exitStatus=0
else:
return HTML
logging.error('\u001B[1m Building Physical Simulators Failed\u001B[0m')
HTML.CreateHtmlTestRow(self.buildargs, 'KO', CONST.ALL_PROCESSES_OK, 'LDPC')
HTML.CreateHtmlTabFooter(False)
#exitStatus=1 will do a sys.exit in main
self.exitStatus=1
self.exitStatus = 1
return HTML
......@@ -163,8 +189,7 @@ class PhySim:
mySSH.command('source oaienv', '\$', 5)
mySSH.command('cd cmake_targets', '\$', 5)
mySSH.command('mkdir -p log', '\$', 5)
mySSH.command('chmod 777 log', '\$', 5)
mySSH.command('stdbuf -o0 ./build_oai ' + self.buildargs + ' 2>&1 | stdbuf -o0 tee ' + self.__buildLogFile, 'Bypassing the Tests|build have failed', 1500)
mySSH.command(f'./build_oai {self.buildargs} 2>&1 | tee {self.__buildLogFile}', '\$', 1500)
mySSH.close()
#check build status and update HTML object
......@@ -173,7 +198,8 @@ class PhySim:
return lHTML
def Run_PhySim(self,htmlObj,constObj,testcase_id):
def Run_LDPCTest(self,htmlObj,constObj,testcase_id):
self.__workSpacePath = self.eNBSourceCodePath+'/cmake_targets/'
#create run logs folder locally
os.system('mkdir -p ./'+self.__runLogPath)
#log file is tc_<testcase_id>.log remotely
......@@ -187,5 +213,18 @@ class PhySim:
mySSH.close()
#return updated HTML to main
lHTML = cls_oai_html.HTMLManagement()
lHTML=self.__CheckResults_PhySim(htmlObj,constObj,testcase_id)
lHTML=self.__CheckResults_LDPCTest(htmlObj,constObj,testcase_id)
return lHTML
def Run_NRulsimTest(self, htmlObj, constObj, testcase_id):
self.__workSpacePath=self.eNBSourceCodePath+'/cmake_targets/'
os.system(f'mkdir -p ./{self.__runLogPath}')
self.__runLogFile = f'physim_{testcase_id}.log'
mySSH = sshconnection.SSHConnection()
mySSH.open(self.eNBIpAddr, self.eNBUserName, self.eNBPassWord)
mySSH.command(f'cd {self.__workSpacePath}', '\$', 5)
mySSH.command(f'sudo {self.__workSpacePath}ran_build/build/nr_ulsim {self.runargs} > {self.__runLogFile} 2>&1', '\$', 30)
mySSH.close()
#return updated HTML to main
lHTML = self.__CheckResults_NRulsimTest(htmlObj, constObj, testcase_id)
return lHTML
......@@ -321,20 +321,6 @@ class StaticCodeAnalysis():
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:
......
......@@ -214,7 +214,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
}
);
......
......@@ -204,8 +204,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
prach_dtx_threshold = 200;
pucch0_dtx_threshold = 150;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
......
......@@ -231,7 +231,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 150;
}
......
......@@ -228,7 +228,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
}
);
......
......@@ -211,7 +211,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
......
......@@ -181,7 +181,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
......
......@@ -210,7 +210,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
pucch0_dtx_threshold = 80;
}
......
......@@ -237,7 +237,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
# pucch0_dtx_threshold = 150;
}
......
......@@ -234,7 +234,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
# pucch0_dtx_threshold = 150;
}
......
......@@ -233,7 +233,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
# pucch0_dtx_threshold = 150;
}
......
......@@ -237,7 +237,7 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
prach_dtx_threshold = 120;
prach_dtx_threshold = 200;
# pucch0_dtx_threshold = 150;
}
);
......
......@@ -235,7 +235,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
prach_dtx_threshold = 120;
# pucch0_dtx_threshold = 150;
}
......
......@@ -194,7 +194,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 8;
}
);
......
......@@ -210,7 +210,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 6;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
......
......@@ -211,7 +211,6 @@ L1s = (
{
num_cc = 1;
tr_n_preference = "local_mac";
thread_pool_size = 6;
}
);
......
......@@ -218,6 +218,7 @@ L1s = (
num_cc = 1;
tr_n_preference = "local_mac";
pusch_proc_threads = 8;
prach_dtx_threshold = 200;
ofdm_offset_divisor = 8; #set this to UINT_MAX for offset 0
}
);
......
......@@ -8,7 +8,6 @@ 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
......@@ -18,9 +17,6 @@ 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"
......
......@@ -457,9 +457,18 @@ def GetParametersFromXML(action):
if (string_field is not None):
CONTAINERS.testSvrId = string_field
else: # ie action == 'Run_PhySim':
elif action == 'Run_LDPCTest' or action == 'Run_NRulsimTest':
ldpc.runargs = test.findtext('physim_run_args')
elif action == 'LicenceAndFormattingCheck':
pass
elif action == 'Cppcheck_Analysis':
pass
else:
logging.error(f"unknown action {action}")
#check if given test is in list
#it is in list if one of the strings in 'list' is at the beginning of 'test'
......@@ -914,8 +923,14 @@ elif re.match('^TesteNB$', mode, re.IGNORECASE) or re.match('^TestUE$', mode, re
HTML=ldpc.Build_PhySim(HTML,CONST)
if ldpc.exitStatus==1:
RAN.prematureExit = True
elif action == 'Run_PhySim':
HTML=ldpc.Run_PhySim(HTML,CONST,id)
elif action == 'Run_LDPCTest':
HTML=ldpc.Run_LDPCTest(HTML,CONST,id)
if ldpc.exitStatus==1:
RAN.prematureExit = True
elif action == 'Run_NRulsimTest':
HTML=ldpc.Run_NRulsimTest(HTML,CONST,id)
if ldpc.exitStatus==1:
RAN.prematureExit = True
elif action == 'Build_Image':
CONTAINERS.BuildImage(HTML)
elif action == 'Build_Proxy':
......
......@@ -463,37 +463,7 @@ function report_build {
echo " </table>" >> ./build_results.html
echo " <h2>Build Summary</h2>" >> ./build_results.html
if [ -f ./oai_rules_result.txt ]
then
echo " <h3>OAI Coding / Formatting Guidelines Check</h3>" >> ./build_results.html
NB_FILES=`cat ./oai_rules_result.txt`
if [ $NB_FILES = "0" ]
then
echo " <div class=\"alert alert-success\">" >> ./build_results.html
if [ $PU_TRIG -eq 1 ]; then echo " <strong>All files in repository follow OAI rules. <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <strong>All modified files in Merge-Request follow OAI rules. <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./build_results.html; fi
echo " </div>" >> ./build_results.html
else
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
if [ $PU_TRIG -eq 1 ]; then echo " <strong>$NB_FILES files in repository DO NOT follow OAI rules. <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html; fi
if [ $MR_TRIG -eq 1 ]; then echo " <strong>$NB_FILES modified files in Merge-Request DO NOT follow OAI rules. <span class=\"glyphicon glyphicon-warning-sign\"></span></strong>" >> ./build_results.html; fi
echo " </div>" >> ./build_results.html
fi
if [ -f ./oai_rules_result_list.txt ]
then
echo " <button data-toggle=\"collapse\" data-target=\"#oai-formatting-details\">More details on formatting check</button>" >> ./build_results.html
echo " <div id=\"oai-formatting-details\" class=\"collapse\">" >> ./build_results.html
echo " <p>Please apply the following command to this(ese) file(s): </p>" >> ./build_results.html
echo " <p style=\"margin-left: 30px\"><strong><code>astyle --options=ci-scripts/astyle-options.txt filename(s)</code></strong></p>" >> ./build_results.html
echo " <table border = 1>" >> ./build_results.html
echo " <tr>" >> ./build_results.html
echo " <th bgcolor = \"lightcyan\" >Filename</th>" >> ./build_results.html
echo " </tr>" >> ./build_results.html
awk '{print " <tr><td>"$1"</td></tr>"}' ./oai_rules_result_list.txt >> ./build_results.html
echo " </table>" >> ./build_results.html
echo " </div>" >> ./build_results.html
echo " <br>" >> ./build_results.html
fi
if [ -f ./header-files-w-incorrect-define.txt ]
then
NB_FILES_IN_ERROR=`wc -l ./header-files-w-incorrect-define.txt | sed -e "s@ .*@@"`
......@@ -564,7 +534,6 @@ function report_build {
echo " <br>" >> ./build_results.html
fi
fi
fi
echo " <h2>Ubuntu 16.04 LTS -- Summary</h2>" >> ./build_results.html
......
- Build_Proxy
- Build_PhySim
- Run_PhySim
- Run_LDPCTest
- Run_NRulsimTest
- Build_eNB
- WaitEndBuild_eNB
- Initialize_eNB
......
......@@ -52,7 +52,7 @@
<testCase id="090102">
<class>Initialize_OAI_UE</class>
<desc>Initialize NR UE USRP</desc>
<Initialize_OAI_UE_args>--phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 50 --rrc_config_path . --dlsch-parallel 4 --log_config.global_log_options level,nocolor,time</Initialize_OAI_UE_args>
<Initialize_OAI_UE_args>--phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 50 --rrc_config_path . --log_config.global_log_options level,nocolor,time</Initialize_OAI_UE_args>
<air_interface>NR</air_interface>
</testCase>
......
......@@ -52,7 +52,7 @@
<testCase id="090104">
<class>Initialize_OAI_UE</class>
<desc>Initialize NR UE USRP</desc>
<Initialize_OAI_UE_args>--phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 75 --rrc_config_path . --dlsch-parallel 4 --log_config.global_log_options level,nocolor,time</Initialize_OAI_UE_args>
<Initialize_OAI_UE_args>--phy-test --usrp-args "addr=192.168.30.2,second_addr=192.168.50.2,clock_source=external,time_source=external" --ue-rxgain 75 --rrc_config_path . --log_config.global_log_options level,nocolor,time</Initialize_OAI_UE_args>
<air_interface>NR</air_interface>
</testCase>
......
......@@ -26,132 +26,125 @@
<htmlTabName>Test-ldpc-GPU</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>000001 000002 000003 000004 000005 000006 000007 000008 000009 000010 000011 000012 000013 000014 000015 000016 000017 000018 000019 000020 000021</TestCaseRequestedList>
<TestCaseRequestedList>000002 000003 000004 000005 000006 000007 000008 000009 000010 000011 000012 000013 000014 000015 000016 000017 000018 000019 000020 000021</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>Build_PhySim</class>
<desc>Build for physical simulator</desc>
<physim_build_args>--phy_simulators --ninja --noavx512</physim_build_args>
<forced_workspace_cleanup>FALSE</forced_workspace_cleanup>
</testCase>
<testCase id="000002">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 3872 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000003">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 3872 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000004">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 4224 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000005">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 4224 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000006">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 4576 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000007">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 4576 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000008">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 4928 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000009">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 4928 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000010">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 5280 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000011">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 5280 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000012">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 5632 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000013">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 5632 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000014">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 6336 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000015">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 6336 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000016">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 7040 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000017">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 7040 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000018">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 7744 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000019">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 7744 -s10 -n100 -G 1</physim_run_args>
</testCase>
<testCase id="000020">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with CPU</desc>
<physim_run_args>-l 8448 -s10 -n100</physim_run_args>
</testCase>
<testCase id="000021">
<class>Run_PhySim</class>
<class>Run_LDPCTest</class>
<desc>Run LDPC Test with GPU</desc>
<physim_run_args>-l 8448 -s10 -n100 -G 1</physim_run_args>
</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>build-offload</htmlTabRef>
<htmlTabName>Build physical simulators</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>000001</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>Build_PhySim</class>
<desc>Build physical simulators</desc>
<physim_build_args>--phy_simulators --ninja --noavx512</physim_build_args>
<forced_workspace_cleanup>FALSE</forced_workspace_cleanup>
</testCase>
</testCaseList>
<!--
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>test-t1-offload</htmlTabRef>
<htmlTabName>Test T1 Offload</htmlTabName>
<htmlTabIcon>tasks</htmlTabIcon>
<repeatCount>1</repeatCount>
<TestCaseRequestedList>000001 000002 000003 000004</TestCaseRequestedList>
<TestCaseExclusionList></TestCaseExclusionList>
<testCase id="000001">
<class>Run_NRulsimTest</class>
<desc>Run T1 Offload nr_ulsim</desc>
<physim_run_args>-n2 -s30 -m9 -r50 -R106 -o</physim_run_args>
</testCase>
<testCase id="000002">
<class>Run_NRulsimTest</class>
<desc>Run T1 Offload nr_ulsim</desc>
<physim_run_args>-n2 -s30 -m9 -r106 -R106 -o</physim_run_args>
</testCase>
<testCase id="000003">
<class>Run_NRulsimTest</class>
<desc>Run T1 Offload nr_ulsim</desc>
<physim_run_args>-n2 -s30 -m16 -r106 -R106 -o</physim_run_args>
</testCase>
<testCase id="000004">
<class>Run_NRulsimTest</class>
<desc>Run T1 Offload nr_ulsim</desc>
<physim_run_args>-n2 -s30 -m9 -r273 -R273 -o</physim_run_args>
</testCase>
</testCaseList>
......@@ -828,6 +828,31 @@ TARGET_LINK_LIBRARIES(benetel_5g pthread dl rt m numa)
##########################################################
# LDPC offload library
##########################################################
# there is no generic way to test for T1 Offload, it simply comes with the
# shared object
if (EXISTS "/usr/local/lib64/librte_pmd_hpac_sdfec_pmd.so")
set(T1_OFFLOAD_FOUND TRUE)
else()
set(T1_OFFLOAD_FOUND FALSE)
endif()
if(T1_OFFLOAD_FOUND)
message(STATUS "T1 Offload support detected")
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/lib64/pkgconfig/")
pkg_search_module(LIBDPDK REQUIRED libdpdk=20.05.0)
add_library(ldpc_offload MODULE ${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_decoder_offload.c)
set_target_properties(ldpc_offload PROPERTIES COMPILE_FLAGS "-DALLOW_EXPERIMENTAL_API")
target_compile_options(ldpc_offload PRIVATE ${LIBDPDK_CFLAGS})
target_link_libraries(ldpc_offload ${LIBDPDK_LDFLAGS} rte_pmd_hpac_sdfec_pmd "-Wl,-rpath /usr/local/lib64")
else()
message(STATUS "No T1 Offload support detected")
endif ()
##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
Message("DEADLINE_SCHEDULER flag is ${DEADLINE_SCHEDULER}")
......@@ -2772,7 +2797,11 @@ target_link_libraries (nr-softmodem pthread m CONFIG_LIB rt crypt ${CRYPTO_LIBRA
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})
target_link_libraries (nr-softmodem ${T_LIB})
add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
add_dependencies( nr-softmodem ldpc_orig ldpc_optim ldpc_optim8seg ldpc)
if(T1_OFFLOAD_FOUND)
add_dependencies( nr-softmodem ldpc_offload)
endif ()
# nr-uesoftmodem is UE implementation
#######################################
......@@ -2818,6 +2847,7 @@ if (CUDA_FOUND)
add_dependencies( nr-uesoftmodem ldpc_cuda)
add_dependencies( nr-softmodem ldpc_cuda)
endif (CUDA_FOUND)
###################################"
# Addexecutables for tests
####################################
......@@ -2981,6 +3011,11 @@ add_executable(nr_ulsim
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
if(T1_OFFLOAD_FOUND)
add_dependencies( nr_ulsim ldpc_offload)
endif ()
target_link_libraries(nr_ulsim
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB -lz -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ITTI ${OPENSSL_LIBRARIES} dl
......
#!/bin/bash
#/*
# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
# * contributor license agreements. See the NOTICE file distributed with
# * this work for additional information regarding copyright ownership.
# * The OpenAirInterface Software Alliance licenses this file to You under
# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
# * except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.openairinterface.org/?page_id=698
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *-------------------------------------------------------------------------------
# * For more information about the OpenAirInterface (OAI) Software Alliance:
# * contact@openairinterface.org
# */
# file indent_source_code
# brief
# author Lionel Gauthier
# company Eurecom
# email: lionel.gauthier@eurecom.fr
#
################################
# include helper functions
################################
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
source $THIS_SCRIPT_PATH/build_helper
function main()
{
local MAX_CODE_LENGTH=200
local INDENT_SPACES=2
set_openair_env
# remove trailing white spaces
#find $OPENAIR_DIR/openair1 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
#find $OPENAIR_DIR/openair2 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
#find $OPENAIR_DIR/openair3 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
#find $OPENAIR_DIR/openair3 -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
#find $OPENAIR_DIR/targets -type f \( -name '*.c' -o -name '*.h' \) -exec sed --in-place 's/[[:space:]]\+$//' {} \+
# Style google not available on 14.04
exit 0
# will use indent
command -v astyle >/dev/null 2>&1 || { echo >&2 "astyle required but it's not installed."; sudo apt-get install astyle; }
astyle --recursive --convert-tabs --indent=spaces=$INDENT_SPACES --style=kr --indent-col1-comments --max-code-length=$MAX_CODE_LENGTH \
$OPENAIR_DIR/openair1/*.h \
$OPENAIR_DIR/openair1/*.c \
$OPENAIR_DIR/openair2/*.h \
$OPENAIR_DIR/openair2/*.c \
$OPENAIR_DIR/openair3/*.h \
$OPENAIR_DIR/openair3/*.c \
$OPENAIR_DIR/openair3/*.h \
$OPENAIR_DIR/openair3/*.c \
$OPENAIR_DIR/targets/*.h \
$OPENAIR_DIR/targets/*.c
}
main "$@"
......@@ -48,6 +48,10 @@
// main log variables
// Fixme: a better place to be shure it is called
void read_cpu_hardware (void) __attribute__ ((constructor));
void read_cpu_hardware (void) {__builtin_cpu_init(); }
log_mem_cnt_t log_mem_d[2];
int log_mem_flag=0;
int log_mem_multi=1;
......
......@@ -366,6 +366,7 @@ typedef struct {
#define MATLAB_CSHORT_BRACKET3 15
int32_t write_file_matlab(const char *fname, const char *vname, void *data, int length, int dec, unsigned int format, int multiVec);
#define write_output(a, b, c, d, e, f) write_file_matlab(a, b, c, d, e, f, 0)
/*----------------macro definitions for reading log configuration from the config module */
#define CONFIG_STRING_LOG_PREFIX "log_config"
......
......@@ -45,9 +45,7 @@ extern "C" {
std::vector<MessageDef *> message_queue;
std::map<long,timer_elm_t> timer_map;
uint64_t next_timer=UINT64_MAX;
struct epoll_event *events =NULL;
int nb_fd_epoll=0;
int nb_events=0;
int epoll_fd=-1;
int sem_fd=-1;
} task_list_t;
......@@ -167,8 +165,6 @@ extern "C" {
struct epoll_event event;
task_list_t *t=tasks[task_id];
t->nb_fd_epoll++;
t->events = (struct epoll_event *)realloc((void *)t->events,
t->nb_fd_epoll * sizeof(struct epoll_event));
event.events = EPOLLIN | EPOLLERR;
event.data.u64 = 0;
event.data.fd = fd;
......@@ -185,10 +181,10 @@ extern "C" {
t->nb_fd_epoll--;
}
static inline int itti_get_events_locked(task_id_t task_id, struct epoll_event **events) {
static inline int itti_get_events_locked(task_id_t task_id, struct epoll_event *events, int max_events) {
task_list_t *t=tasks[task_id];
uint64_t current_time=0;
int nb_events;
do {
if ( t->next_timer != UINT64_MAX ) {
struct timespec tp;
......@@ -234,40 +230,41 @@ extern "C" {
pthread_mutex_unlock(&t->queue_cond_lock);
LOG_D(ITTI,"enter blocking wait for %s, timeout: %d ms\n", itti_get_task_name(task_id), epoll_timeout);
t->nb_events = epoll_wait(t->epoll_fd,t->events,t->nb_fd_epoll, epoll_timeout);
nb_events = epoll_wait(t->epoll_fd, events, max_events, epoll_timeout);
if ( t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
if ( nb_events < 0 && (errno == EINTR || errno == EAGAIN ) )
pthread_mutex_lock(&t->queue_cond_lock);
} while (t->nb_events < 0 && (errno == EINTR || errno == EAGAIN ) );
} while (nb_events < 0 && (errno == EINTR || errno == EAGAIN ) );
AssertFatal (t->nb_events >=0,
AssertFatal (nb_events >=0,
"epoll_wait failed for task %s, nb fds %d, timeout %lu: %s!\n",
itti_get_task_name(task_id), t->nb_fd_epoll, t->next_timer != UINT64_MAX ? t->next_timer-current_time : -1, strerror(errno));
LOG_D(ITTI,"receive on %d descriptors for %s\n", t->nb_events, itti_get_task_name(task_id));
itti_get_task_name(task_id), t->nb_fd_epoll,
t->next_timer != UINT64_MAX ? t->next_timer-current_time : -1,
strerror(errno));
LOG_D(ITTI,"receive on %d descriptors for %s\n", nb_events, itti_get_task_name(task_id));
if (t->nb_events == 0)
if (nb_events == 0)
/* No data to read -> return */
return 0;
for (int i = 0; i < t->nb_events; i++) {
for (int i = 0; i < nb_events; i++) {
/* Check if there is an event for ITTI for the event fd */
if ((t->events[i].events & EPOLLIN) &&
(t->events[i].data.fd == t->sem_fd)) {
if ((events[i].events & EPOLLIN) &&
(events[i].data.fd == t->sem_fd)) {
eventfd_t sem_counter;
/* Read will always return 1 */
AssertFatal( sizeof(sem_counter) == read (t->sem_fd, &sem_counter, sizeof(sem_counter)), "");
/* Mark that the event has been processed */
t->events[i].events &= ~EPOLLIN;
events[i].events &= ~EPOLLIN;
}
}
*events = t->events;
return t->nb_events;
return nb_events;
}
int itti_get_events(task_id_t task_id, struct epoll_event **events) {
int itti_get_events(task_id_t task_id, struct epoll_event *events, int nb_evts) {
pthread_mutex_lock(&tasks[task_id]->queue_cond_lock);
return itti_get_events_locked(task_id, events);
return itti_get_events_locked(task_id, events, nb_evts);
}
void itti_receive_msg(task_id_t task_id, MessageDef **received_msg) {
......@@ -275,15 +272,16 @@ extern "C" {
task_list_t *t=tasks[task_id];
pthread_mutex_lock(&t->queue_cond_lock);
struct epoll_event events[t->nb_fd_epoll];
// Weird condition to deal with crap legacy itti interface
if ( t->nb_fd_epoll == 1 ) {
while (t->message_queue.empty()) {
itti_get_events_locked(task_id, &t->events);
itti_get_events_locked(task_id, events, t->nb_fd_epoll);
pthread_mutex_lock(&t->queue_cond_lock);
}
} else {
if (t->message_queue.empty()) {
itti_get_events_locked(task_id, &t->events);
itti_get_events_locked(task_id, events, t->nb_fd_epoll);
pthread_mutex_lock(&t->queue_cond_lock);
}
}
......
......@@ -479,7 +479,7 @@ void itti_unsubscribe_event_fd(task_id_t task_id, int fd);
\param events events list
@returns number of events to handle
**/
int itti_get_events(task_id_t task_id, struct epoll_event **events);
int itti_get_events(task_id_t task_id, struct epoll_event *events, int nb_max_evts);
/** \brief Retrieves a message in the queue associated to task_id.
If the queue is empty, the thread is blocked till a new message arrives.
......
......@@ -111,7 +111,7 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name
if (measr) {
mkfifo(measr,0666);
AssertFatal(-1 != (pool->dummyTraceFd=
AssertFatal(-1 != (pool->dummyKeepReadingTraceFd=
open(measr, O_RDONLY| O_NONBLOCK)),"");
AssertFatal(-1 != (pool->traceFd=
open(measr, O_WRONLY|O_APPEND|O_NOATIME|O_NONBLOCK)),"");
......@@ -130,6 +130,7 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name
int c=toupper(curptr[0]);
switch (c) {
case 'N':
pool->activated=false;
break;
......@@ -161,6 +162,17 @@ void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name
}
}
void initFloatingCoresTpool(int nbThreads,tpool_t *pool, bool performanceMeas, char *name) {
char threads[1024] = "n";
if (nbThreads) {
strcpy(threads,"-1");
for (int i=1; i < nbThreads; i++)
strncat(threads,",-1", sizeof(threads-1));
}
threads[sizeof(threads-1)]=0;
initNamedTpool(threads, pool, performanceMeas, name);
}
#ifdef TEST_THREAD_POOL
volatile int oai_exit=0;
......
......@@ -256,9 +256,8 @@ typedef struct thread_pool {
bool activated;
bool measurePerf;
int traceFd;
int dummyTraceFd;
int dummyKeepReadingTraceFd;
uint64_t cpuCyclesMicroSec;
uint64_t startProcessingUE;
int nbThreads;
notifiedFIFO_t incomingFifo;
struct one_thread *allthreads;
......@@ -389,5 +388,6 @@ static inline int abortTpool(tpool_t *t) {
return nbRemoved;
}
void initNamedTpool(char *params,tpool_t *pool, bool performanceMeas, char *name);
void initFloatingCoresTpool(int nbThreads,tpool_t *pool, bool performanceMeas, char *name);
#define initTpool(PARAMPTR,TPOOLPTR, MEASURFLAG) initNamedTpool(PARAMPTR,TPOOLPTR, MEASURFLAG, NULL)
#endif
<table style="border-collapse: collapse; border: none;">
<tr style="border-collapse: collapse; border: none;">
<td style="border-collapse: collapse; border: none;">
<a href="http://www.openairinterface.org/">
<img src="./images/oai_final_logo.png" alt="" border=3 height=50 width=150>
</img>
</a>
</td>
<td style="border-collapse: collapse; border: none; vertical-align: center;">
<b><font size = "5">The OpenAirInterface repository: the sources</font></b>
</td>
</tr>
</table>
The OpenAirInterface software can be obtained from our gitLab
server. You will need a git client to get the sources. The repository
is currently used for main developments.
# Prerequisites
You need to install the subversion/git using the following commands:
You need to install git using the following commands:
```shell
sudo apt-get update
sudo apt-get install subversion git
sudo apt-get install git
```
# Using EURECOM Gitlab
The [openairinterface5g repository](https://gitlab.eurecom.fr/oai/openairinterface5g.git)
holds the source code for (eNB RAN + UE RAN).
For legal issues (licenses), the core network (EPC) source code is now moved away from
the above openairinterface5g git repository.
* A more recent version is available under our GitHub domain:
* [OAI GitHub openair-cn domain](https://github.com/OPENAIRINTERFACE)
* Check its wiki pages for more details
holds the source code for the RAN (4G and 5G).
Configure git with your name/email address (only important if you are developer and want to contribute/push code to Git Repository):
......@@ -44,18 +23,6 @@ git config --global user.name "Your Name"
git config --global user.email "Your email address"
```
- Add a certificate from gitlab.eurecom.fr to your Ubuntu 14.04 installation:
```shell
echo -n | openssl s_client -showcerts -connect gitlab.eurecom.fr:443 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | sudo tee -a /etc/ssl/certs/ca-certificates.crt
```
- Disable certificate check completely if you do not have root access to /etc/ssl directory
```shell
git config --global http.sslverify false
```
## In order to clone the Git repository (for OAI Users without login to gitlab server)
Cloning RAN repository (eNB RAN + UE RAN):
......@@ -70,13 +37,6 @@ Please send email to [contact@openairinterface.org](mailto:contact@openairinterf
as a developer (only important for users who want to commit code to the repository). If
you do not have account on gitlab.eurecom.fr, please register yourself to gitlab.eurecom.fr and provide the identifiant in the email.
* Clone with using ssh keys:
* You will need to put your ssh keys in https://gitlab.eurecom.fr/profile/keys
to access to the git repo. Once that is done, clone the git repository using:
* `git clone git@gitlab.eurecom.fr:oai/openairinterface5g.git`
* Clone with user name/password prompt:
* `git clone https://YOUR_USERNAME@gitlab.eurecom.fr/oai/openairinterface5g.git`
# Which branch to checkout?
On the RAN side:
......@@ -84,15 +44,15 @@ On the RAN side:
* **master**: This branch is targeted for the user community. Since January 2019, it is also subject to a Continuous Integration process. The update frequency is about once every 2-3 months. We are also performing bug fixes on this branch.
* **develop**: This branch contains recent commits that are tested on our CI test bench. The update frequency is about once a week.
Please see the work flow and policies page :
Please see the work flow and policies page:
https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/oai-policies-home
you can find the latest stable tag release here :
you can find the latest stable tag release here:
https://gitlab.eurecom.fr/oai/openairinterface5g/tags
The tag naming conventions are :
The tag naming conventions are:
- On `master` branch: **v1.`x`.`y`** where
* `x` is the minor release number, incremented every 2-3 months when we are merging `develop` into `master` branch.
......
We use [clang-format](https://clang.llvm.org/docs/ClangFormat.html) to format our code.
# Integration into editors
Integration into various editors (`vim`, `emacs`, `VSCode`, `CLion`) is on the
[clang-format project page](https://clang.llvm.org/docs/ClangFormat.html).
There is also an [eclipse plugin](https://github.com/wangzw/CppStyle).
# Integration into git
## Short version
See below for a more detailed explanation. In short: Add this to `~/.gitconfig`:
```
[clangFormat]
binary = clang-format-12
style = file
```
Now stage files for reformatting, then run `git clang-format`. It will reformat
only the code that is staged, and you can view reformatted code with `git
diff`. To add modified lines to your commit, stage them as well, then commit.
There is also a pre-commit hook that you can install. To install it, copy it
`pre-commit-clang` to `.git/hooks/pre-commit`, and make it executable.
## Long version
In order to integrate `clang-format` into `git`, follow these steps:
1) Copy `pre-commit-clang` to `.git/hooks/pre-commit` and make it executable.
2) Install clang-format-12 (needs at least Ubuntu 20, remove anything else)
```bash
$ sudo apt-get remove clang-format*
$ sudo apt-get install clang-format-12
```
3) Configure `git` (set correct executable, set mode, provide more convenient alias)
```bash
$ git config --global clangFormat.binary clang-format-12
$ git config --global clangFormat.style file
$ git config --global alias.clang-format clang-format-12
```
When this is done, you are set up. How to use:
4) When committing new code, add the code to commit into the staging (`git add
-p` or `git add <file>`) _and stash the rest_ (e.g., `git stash -p`, this is
quite important or reformatting might not work properly, or you don't know
what has been reformatted)
5) Run git clang-format. The staged code will be reformatted. After this, you
still have your changes in the staging area, and the formatted code appears
as additional modification. Thus, your changes can be seen with
```bash
$ git diff --staged
```
while the modifications of clang-format with
```bash
$ git diff
```
So now, you can add all or parts of reformatted code to the staging area
6) Commit. It won't work if code is not properly formatted due to the
pre-commit hook. Force committing with `git commit --no-verify`
......@@ -1273,11 +1273,7 @@ int main ( int argc, char **argv ) {
L1proc->respEncode=(notifiedFIFO_t *) malloc(sizeof(notifiedFIFO_t));
L1proc->respDecode=(notifiedFIFO_t *) malloc(sizeof(notifiedFIFO_t));
if ( strlen(get_softmodem_params()->threadPoolConfig) > 0 )
initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool, true);
else
initTpool("n", L1proc->threadPool, true);
initTpool(get_softmodem_params()->threadPoolConfig, L1proc->threadPool,cpumeas(CPUMEAS_GETSTATE));
initNotifiedFIFO(L1proc->respEncode);
initNotifiedFIFO(L1proc->respDecode);
}
......
......@@ -221,8 +221,7 @@ void rx_func(void *param) {
gNB->common_vars.rxdataF[aa],
slot_rx,
0,
gNB->frame_parms.Ncp==EXTENDED?12:14,
gNB->frame_parms.ofdm_symbol_size);
gNB->frame_parms.Ncp==EXTENDED?12:14);
}
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
}
......@@ -430,19 +429,8 @@ void init_gNB_Tpool(int inst) {
gNB = RC.gNB[inst];
gNB_L1_proc_t *proc = &gNB->proc;
int numCPU = sysconf(_SC_NPROCESSORS_ONLN);
LOG_I(PHY,"Number of threads requested in config file: %d, Number of threads available on this machine: %d\n",gNB->thread_pool_size,numCPU);
int threadCnt = min(numCPU, gNB->thread_pool_size);
if (threadCnt < 2) LOG_E(PHY,"Number of threads for gNB should be more than 1. Allocated only %d\n",threadCnt);
char pool[80];
sprintf(pool,"-1");
int s_offset = 0;
for (int icpu=1; icpu<threadCnt; icpu++) {
sprintf(pool+2+s_offset,",-1");
s_offset += 3;
}
if (getenv("noThreads")) strcpy(pool, "n");
initTpool(pool, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE));
// ULSCH decoding threadpool
initTpool(get_softmodem_params()->threadPoolConfig, &gNB->threadPool, cpumeas(CPUMEAS_GETSTATE));
// ULSCH decoder result FIFO
initNotifiedFIFO(&gNB->respDecode);
......@@ -536,7 +524,9 @@ void init_eNB_afterRU(void) {
RC.nb_nr_inst = 1;
for (inst=0; inst<RC.nb_nr_inst; inst++) {
LOG_I(PHY,"RC.nb_nr_CC[inst:%d]:%p\n", inst, RC.gNB[inst]);
gNB = RC.gNB[inst];
gNB->ldpc_offload_flag = ldpc_offload_flag;
phy_init_nr_gNB(gNB,0,0);
......
......@@ -97,7 +97,7 @@
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
#define CONFIG_HLP_LDPC_OFFLOAD "enable LDPC offload\n"
#define CONFIG_HLP_USRP_ARGS "set the arguments to identify USRP (same syntax as in UHD)\n"
#define CONFIG_HLP_FLOG "Enable online log \n"
......
......@@ -29,6 +29,7 @@
{"D" , CONFIG_HLP_DLBM_PHYTEST,0, u64ptr:&dlsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \
{"U" , CONFIG_HLP_ULBM_PHYTEST,0, u64ptr:&ulsch_slot_bitmap, defintval:0, TYPE_UINT64, 0}, \
{"usrp-tx-thread-config", CONFIG_HLP_USRP_THREAD, 0, iptr:&usrp_tx_thread, defstrval:0, TYPE_INT, 0}, \
{"ldpc-offload-enable", CONFIG_HLP_LDPC_OFFLOAD, 0, iptr:&ldpc_offload_flag, defstrval:0, TYPE_INT, 0}, \
{"uecap_file", CONFIG_HLP_UECAP_FILE, 0, strptr:&uecap_file, defstrval:"./uecap.xml", TYPE_STRING, 0}, \
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
}
......@@ -44,6 +45,7 @@ extern uint32_t target_ul_bw;
extern uint64_t dlsch_slot_bitmap;
extern uint64_t ulsch_slot_bitmap;
extern char *uecap_file;
extern int ldpc_offload_flag;
// In nr-gnb.c
extern void init_gNB(int single_thread_flag,int wait_for_sync);
......
......@@ -678,7 +678,7 @@ void processSlotRX(void *arg) {
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, no_relay, NULL );
#else
uint64_t a=rdtsc_oai();
phy_procedures_nrUE_RX(UE, proc, gNB_id, get_nrUE_params()->nr_dlsch_parallel, &phy_pdcch_config, &rxtxD->txFifo);
phy_procedures_nrUE_RX(UE, proc, gNB_id, &phy_pdcch_config, &rxtxD->txFifo);
LOG_D(PHY, "In %s: slot %d, time %llu\n", __FUNCTION__, proc->nr_slot_rx, (rdtsc_oai()-a)/3500);
#endif
......
......@@ -243,20 +243,7 @@ uint64_t set_nrUE_optmask(uint64_t bitmask) {
nrUE_params_t *get_nrUE_params(void) {
return &nrUE_params;
}
/* initialie thread pools used for NRUE processing paralleliation */
void init_tpools(uint8_t nun_dlsch_threads) {
char params[NR_RX_NB_TH*NR_NB_TH_SLOT*3+1]={0};
for (int i=0; i<NR_RX_NB_TH*NR_NB_TH_SLOT; i++) {
memcpy(params+(i*3),"-1,",3);
}
if (getenv("noThreads")) {
initTpool("n", &(nrUE_params.Tpool), false);
init_dlsch_tpool(0);
} else {
initTpool(params, &(nrUE_params.Tpool), false);
init_dlsch_tpool( nun_dlsch_threads);
}
}
static void get_options(void) {
paramdef_t cmdline_params[] =CMDLINE_NRUEPARAMS_DESC ;
......@@ -438,7 +425,7 @@ int main( int argc, char **argv ) {
#if T_TRACER
T_Config_Init();
#endif
init_tpools(nrUE_params.nr_dlsch_parallel);
initTpool(get_softmodem_params()->threadPoolConfig, &(nrUE_params.Tpool), cpumeas(CPUMEAS_GETSTATE));
//randominit (0);
set_taus_seed (0);
......
......@@ -31,7 +31,7 @@
#define CMDLINE_NRUEPARAMS_DESC { \
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:&usrp_args, defstrval:"type=b200", TYPE_STRING, 0}, \
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
{"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, u8ptr:&nrUE_params.nr_dlsch_parallel, defintval:0, TYPE_UINT8, 0}, \
{"dlsch-parallel", CONFIG_HLP_DLSCH_PARA, 0, u8ptr:NULL, defintval:0, TYPE_UINT8, 0}, \
{"offset-divisor", CONFIG_HLP_OFFSET_DIV, 0, uptr:&nrUE_params.ofdm_offset_divisor, defuintval:8, TYPE_UINT32, 0}, \
{"max-ldpc-iterations", CONFIG_HLP_MAX_LDPC_ITERATIONS, 0, u8ptr:&nrUE_params.max_ldpc_iterations, defuintval:5, TYPE_UINT8, 0}, \
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
......@@ -78,7 +78,6 @@
typedef struct {
uint64_t optmask; //mask to store boolean config options
uint32_t ofdm_offset_divisor; // Divisor for sample offset computation for each OFDM symbol
uint8_t nr_dlsch_parallel; // number of threads for dlsch decoding, 0 means no parallelization
uint8_t max_ldpc_iterations; // number of maximum LDPC iterations
tpool_t Tpool; // thread pool
} nrUE_params_t;
......
......@@ -46,7 +46,7 @@ static softmodem_params_t softmodem_params;
char *parallel_config=NULL;
char *worker_config=NULL;
int usrp_tx_thread = 0;
int ldpc_offload_flag=0;
uint8_t nfapi_mode=0;
static mapping softmodem_funcs[] = MAPPING_SOFTMODEM_FUNCTIONS;
......
......@@ -139,7 +139,7 @@ extern int usrp_tx_thread;
#define CMDLINE_PARAMS_DESC { \
{"rf-config-file", CONFIG_HLP_RFCFGF, 0, strptr:&RF_CONFIG_FILE, defstrval:NULL, TYPE_STRING, 0},\
{"split73", CONFIG_HLP_SPLIT73, 0, strptr:&SPLIT73, defstrval:NULL, TYPE_STRING, 0}, \
{"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:&TP_CONFIG, defstrval:"n", TYPE_STRING, 0}, \
{"thread-pool", CONFIG_HLP_TPOOL, 0, strptr:&TP_CONFIG, defstrval:"-1,-1,-1,-1,-1,-1,-1,-1", TYPE_STRING, 0}, \
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&PHY_TEST, defintval:0, TYPE_INT, 0}, \
{"do-ra", CONFIG_HLP_DORA, PARAMFLAG_BOOL, iptr:&DO_RA, defintval:0, TYPE_INT, 0}, \
{"sa", CONFIG_HLP_SA, PARAMFLAG_BOOL, iptr:&SA, defintval:0, TYPE_INT, 0}, \
......@@ -283,6 +283,7 @@ extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
extern int usrp_tx_thread;
extern uint16_t sl_ahead;
extern uint16_t sf_ahead;
extern int ldpc_offload_flag;
extern int oai_exit;
void tx_func(void *param);
......
......@@ -333,6 +333,7 @@ typedef struct
//Resource Allocation in time domain
uint8_t start_symbol_index;
uint8_t nr_of_symbols;
uint32_t tbslbrm;
//Optional Data only included if indicated in pduBitmap
nfapi_nr_ue_pusch_data_t pusch_data;
nfapi_nr_ue_pusch_uci_t pusch_uci;
......
This diff is collapsed.
/* SPDX-License-Identifier: BSD-3-Clause
* Copyright(c) 2017 Intel Corporation
*/
#ifndef _MAIN_H_
#define _MAIN_H_
#include <stddef.h>
#include <sys/queue.h>
#include <rte_common.h>
#include <rte_hexdump.h>
#include <rte_log.h>
#define TEST_SUCCESS 0
#define TEST_FAILED -1
#define TEST_SKIPPED 1
#define MAX_BURST 512U
#define DEFAULT_BURST 32U
#define DEFAULT_OPS 64U
#define DEFAULT_ITER 6U
enum op_data_type {
DATA_INPUT = 0,
DATA_SOFT_OUTPUT,
DATA_HARD_OUTPUT,
DATA_HARQ_INPUT,
DATA_HARQ_OUTPUT,
DATA_NUM_TYPES,
};
#define TEST_ASSERT(cond, msg, ...) do { \
if (!(cond)) { \
printf("TestCase %s() line %d failed: " \
msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
return TEST_FAILED; \
} \
} while (0)
/* Compare two buffers (length in bytes) */
#define TEST_ASSERT_BUFFERS_ARE_EQUAL(a, b, len, msg, ...) do { \
if (memcmp((a), (b), len)) { \
printf("TestCase %s() line %d failed: " \
msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
rte_memdump(stdout, "Buffer A", (a), len); \
rte_memdump(stdout, "Buffer B", (b), len); \
return TEST_FAILED; \
} \
} while (0)
#define TEST_ASSERT_SUCCESS(val, msg, ...) do { \
typeof(val) _val = (val); \
if (!(_val == 0)) { \
printf("TestCase %s() line %d failed (err %d): " \
msg "\n", __func__, __LINE__, _val, \
##__VA_ARGS__); \
return TEST_FAILED; \
} \
} while (0)
#define TEST_ASSERT_FAIL(val, msg, ...) \
TEST_ASSERT_SUCCESS(!(val), msg, ##__VA_ARGS__)
#define TEST_ASSERT_NOT_NULL(val, msg, ...) do { \
if ((val) == NULL) { \
printf("TestCase %s() line %d failed (null): " \
msg "\n", __func__, __LINE__, ##__VA_ARGS__); \
return TEST_FAILED; \
} \
} while (0)
struct unit_test_case {
int (*setup)(void);
void (*teardown)(void);
int (*testcase)(void);
const char *name;
};
#define TEST_CASE(testcase) {NULL, NULL, testcase, #testcase}
#define TEST_CASE_ST(setup, teardown, testcase) \
{setup, teardown, testcase, #testcase}
#define TEST_CASES_END() {NULL, NULL, NULL, NULL}
struct unit_test_suite {
const char *suite_name;
int (*setup)(void);
void (*teardown)(void);
struct unit_test_case unit_test_cases[];
};
int unit_test_suite_runner(struct unit_test_suite *suite);
typedef int (test_callback)(void);
TAILQ_HEAD(test_commands_list, test_command);
struct test_command {
TAILQ_ENTRY(test_command) next;
const char *command;
test_callback *callback;
};
void add_test_command(struct test_command *t);
/* Register a test function */
#define REGISTER_TEST_COMMAND(name, testsuite) \
static int test_func_##name(void) \
{ \
return unit_test_suite_runner(&testsuite); \
} \
static struct test_command test_struct_##name = { \
.command = RTE_STR(name), \
.callback = test_func_##name, \
}; \
RTE_INIT(test_register_##name) \
{ \
add_test_command(&test_struct_##name); \
}
const char *get_vector_filename(void);
unsigned int get_num_ops(void);
unsigned int get_burst_sz(void);
unsigned int get_num_lcores(void);
double get_snr(void);
unsigned int get_iter_max(void);
bool get_init_device(void);
#endif
......@@ -75,6 +75,20 @@ typedef struct nrLDPC_dec_params {
e_nrLDPC_outMode outMode; /**< Output format */
} t_nrLDPC_dec_params;
/**
Structure containing LDPC decoder parameters.
*/
typedef struct nrLDPCoffload_params {
uint8_t BG; /**< Base graph */
uint16_t Z;
uint16_t Kr;
uint8_t rv;
uint32_t E;
uint16_t n_cb;
uint16_t F; /**< Filler bits */
uint8_t Qm; /**< Modulation */
} t_nrLDPCoffload_params;
/**
Structure containing LDPC decoder processing time statistics.
*/
......
......@@ -24,6 +24,7 @@
#define __NRLDPC_DEFS__H__
#include <openair1/PHY/defs_nr_common.h>
#include "openair1/PHY/CODING/nrLDPC_decoder/nrLDPC_types.h"
/**
\brief LDPC encoder
\param 1 input
......@@ -71,5 +72,9 @@ typedef int(*nrLDPC_encoderfunc_t)(unsigned char **,unsigned char **,int,int,sho
\param p_llrOut Output vector
\param p_profiler LDPC profiler statistics
*/
typedef int32_t(*nrLDPC_decoderfunc_t)(t_nrLDPC_dec_params* , int8_t*, int8_t* , t_nrLDPC_time_stats* );
typedef int32_t(*nrLDPC_decoffloadfunc_t)(t_nrLDPC_dec_params* , uint8_t, uint8_t, uint8_t , uint8_t, uint16_t, uint32_t, uint8_t, int8_t*, int8_t* ,uint8_t);
typedef int32_t(*nrLDPC_dectopfunc_t)(void);
#endif
......@@ -24,14 +24,22 @@
nrLDPC_decoderfunc_t nrLDPC_decoder;
nrLDPC_encoderfunc_t nrLDPC_encoder;
nrLDPC_initcallfunc_t nrLDPC_initcall;
nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload;
nrLDPC_dectopfunc_t top_testsuite;
#else
/* functions to load the LDPC shared lib, implemented in openair1/PHY/CODING/nrLDPC_load.c */
extern int load_nrLDPClib(char *version) ;
extern int load_nrLDPClib_offload(void) ;
extern int free_nrLDPClib_offload(void) ;
extern int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr); // for ldpctest
/* ldpc coder/decoder functions, as loaded by load_nrLDPClib(). */
extern nrLDPC_initcallfunc_t nrLDPC_initcall;
extern nrLDPC_decoderfunc_t nrLDPC_decoder;
extern nrLDPC_encoderfunc_t nrLDPC_encoder;
extern nrLDPC_decoffloadfunc_t nrLDPC_decoder_offload;
extern nrLDPC_dectopfunc_t top_testsuite;
// inline functions:
#endif
......@@ -71,6 +71,56 @@ int load_nrLDPClib(char *version) {
return 0;
}
int load_nrLDPClib_offload(void) {
loader_shlibfunc_t shlib_decoffload_fdesc;
shlib_decoffload_fdesc.fname = "nrLDPC_decod_offload";
int ret=load_module_shlib("ldpc_offload",&shlib_decoffload_fdesc,1,NULL);
AssertFatal( (ret >= 0),"Error loading ldpc decoder offload");
nrLDPC_decoder_offload = (nrLDPC_decoffloadfunc_t)shlib_decoffload_fdesc.fptr;
t_nrLDPC_dec_params decParams;
t_nrLDPC_dec_params* p_decParams = &decParams;
int8_t l[68*384];
int8_t llrProcBuf[22*384];
p_decParams->Z = 384;
p_decParams->BG = 1;
AssertFatal(nrLDPC_decoder_offload(p_decParams,0, 0,
1,
0,
0,
25344,
8,
l,
llrProcBuf, 0)>=0,
"error loading LDPC decoder offload library\n");
return 0;
}
int free_nrLDPClib_offload(void) {
t_nrLDPC_dec_params decParams;
t_nrLDPC_dec_params* p_decParams = &decParams;
int8_t l[68*384];
int8_t llrProcBuf[22*384];
p_decParams->Z = 384;
p_decParams->BG = 1;
nrLDPC_decoder_offload(p_decParams,0,0,
1,
0,
0,
25344,
8,
l,
llrProcBuf, 2);
return 0;
}
int load_nrLDPClib_ref(char *libversion, nrLDPC_encoderfunc_t * nrLDPC_encoder_ptr) {
loader_shlibfunc_t shlib_encoder_fdesc;
......
......@@ -564,7 +564,6 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
}
}
return 0;
}
......@@ -475,9 +475,7 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
srs_vars[srs_id].srs = (int32_t *) malloc16_clear (2 * fp->ofdm_symbol_size * sizeof (int32_t));
}
LOG_I(PHY,"PRACH allocation\n");
// PRACH
prach_vars->prachF = (int16_t *) malloc16_clear (1024 * 2 * sizeof (int16_t));
// assume maximum of 64 RX antennas for PRACH receiver
prach_vars->prach_ifft[0] = (int32_t **) malloc16_clear (64 * sizeof (int32_t *));
......@@ -485,8 +483,6 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
prach_vars->prach_ifft[0][i] = (int32_t *) malloc16_clear (1024 * 2 * sizeof (int32_t));
prach_vars->rxsigF[0] = (int16_t **) malloc16_clear (64 * sizeof (int16_t *));
// PRACH BR
prach_vars_br->prachF = (int16_t *)malloc16_clear( 1024*2*sizeof(int32_t) );
// assume maximum of 64 RX antennas for PRACH receiver
for (int ce_level = 0; ce_level < 4; ce_level++) {
......@@ -576,8 +572,6 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
for (UE_id=0; UE_id<NUMBER_OF_SRS_MAX; UE_id++) free_and_zero(srs_vars[UE_id].srs);
free_and_zero(prach_vars->prachF);
for (i = 0; i < 64; i++) free_and_zero(prach_vars->prach_ifft[0][i]);
free_and_zero(prach_vars->prach_ifft[0]);
......@@ -589,7 +583,6 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
free_and_zero(prach_vars->rxsigF[ce_level]);
}
free_and_zero(prach_vars_br->prachF);
free_and_zero(prach_vars->rxsigF[0]);
for (int ULSCH_id=0; ULSCH_id<NUMBER_OF_ULSCH_MAX; ULSCH_id++) {
......
......@@ -689,8 +689,9 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
int idx = (j<<1) + i;
for (th_id=0; th_id<RX_NB_TH_MAX; th_id++) {
common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates[eNB_id][idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH) );
common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates_time[eNB_id][idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2 );
common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates[eNB_id][idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*
max(fp->symbols_per_tti*(fp->ofdm_symbol_size+LTE_CE_FILTER_LENGTH),6144) );
common_vars->common_vars_rx_data_per_thread[th_id].dl_ch_estimates_time[eNB_id][idx] = (int32_t *)malloc16_clear( sizeof(int32_t)*max(fp->ofdm_symbol_size*2,6144) );
}
}
}
......
......@@ -508,8 +508,12 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
crcTableInit();
init_scrambling_luts();
init_pucch2_luts();
load_nrLDPClib(NULL);
if (gNB->ldpc_offload_flag)
load_nrLDPClib_offload();
init_codebook_gNB(gNB);
// PBCH DMRS gold sequences generation
......
......@@ -106,9 +106,9 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_CH
if (Ns==0)
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[u][v][Msc_RS_idx],2*Msc_RS,2,1);
LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[u][v][Msc_RS_idx],2*Msc_RS,2,0);
else
LOG_M("drs_seq1.m","drsseq1",ul_ref_sigs_rx[u][v][Msc_RS_idx],2*Msc_RS,2,1);
LOG_M("drs_seq1.m","drsseq1",ul_ref_sigs_rx[u][v][Msc_RS_idx],2*Msc_RS,2,0);
#endif
......@@ -311,7 +311,7 @@ int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
// alpha = (int16_t) (((int32_t) SCALE * (int32_t) (pilot_pos2-k))/(pilot_pos2-pilot_pos1));
// beta = (int16_t) (((int32_t) SCALE * (int32_t) (k-pilot_pos1))/(pilot_pos2-pilot_pos1));
#ifdef DEBUG_CH
LOG_D(PHY,"lte_ul_channel_estimation: k=%d, alpha = %d, beta = %d\n",k,alpha,beta);
LOG_D(PHY,"lte_ul_channel_estimation: k=%d\n",k);
#endif
//symbol_offset_subframe = frame_parms->N_RB_UL*12*k;
......@@ -436,9 +436,9 @@ int32_t lte_ul_channel_estimation_RRU(LTE_DL_FRAME_PARMS *frame_parms,
#ifdef DEBUG_CH
if (l==pilot_pos1)
write_output("drs_seq0.m","drsseq0",ul_ref_sigs_rx[u][v][Msc_RS_idx],Msc_RS,1,1);
write_output("drs_seq0.m","drsseq0",ul_ref_sigs_rx[u][v][Msc_RS_idx],Msc_RS,1,0);
else
write_output("drs_seq1.m","drsseq1",ul_ref_sigs_rx[u][v][Msc_RS_idx],Msc_RS,1,1);
write_output("drs_seq1.m","drsseq1",ul_ref_sigs_rx[u][v][Msc_RS_idx],Msc_RS,1,0);
#endif
symbol_offset = frame_parms->N_RB_UL*12*l;
......
......@@ -74,6 +74,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
uint32_t subframe_offset=((frame_parms->Ncp==0)?14:12)*frame_parms->ofdm_symbol_size*subframe;
memset(d,0,24*sizeof(int16_t));
const int nushift=frame_parms->nushift;
if (frame_parms->nb_antenna_ports_eNB==1)
gain_lin_QPSK = (int16_t)(((int32_t)amp*ONE_OVER_SQRT2_Q15)>>15);
......@@ -245,7 +246,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y1_16[7] = -y0_16[5];
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m];
y1[j] += y1_16[m++];
y0[j+1] += y0_16[m];
......@@ -287,7 +288,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y1_16[7] = -y0_16[5];
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m];
y1[j] += y1_16[m++];
y0[j+1] += y0_16[m];
......@@ -329,7 +330,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y1_16[7] = -y0_16[5];
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m];
y1[j] += y1_16[m++];
y0[j+1] += y0_16[m];
......@@ -360,7 +361,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y0_16[7] = d[7]*gain_lin_QPSK;
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m++];
y0[j+1] += y0_16[m++];
}
......@@ -385,7 +386,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y0_16[7] = d[15]*gain_lin_QPSK;
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m++];
y0[j+1] += y0_16[m++];
}
......@@ -410,7 +411,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y0_16[7] = d[23]*gain_lin_QPSK;
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m++];
y0[j+1] += y0_16[m++];
}
......@@ -533,7 +534,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y1_16[7] = -y0_16[5];
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m];
y1[j] += y1_16[m++];
y0[j+1] += y0_16[m];
......@@ -644,7 +645,7 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms,
y0_16[7] = d[7]*gain_lin_QPSK;
for (i=0,j=0,m=0; i<6; i++,j+=2) {
if ((i!=(frame_parms->nushift))&&(i!=(frame_parms->nushift+3))) {
if ((i!=(nushift))&&(i!=((nushift+3)%6))) {
y0[j] += y0_16[m++];
y0[j+1] += y0_16[m++];
}
......
......@@ -62,9 +62,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint8_t Ncs_config;
uint8_t restricted_set;
uint8_t n_ra_prb;
int16_t *prachF=NULL;
int16_t **rxsigF=NULL;
int16_t *prach2;
uint8_t preamble_index;
uint16_t NCS,NCS2;
uint16_t preamble_offset=0,preamble_offset_old;
......@@ -77,12 +75,10 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint8_t not_found;
int k=0;
uint16_t u;
int16_t *Xu=0;
uint16_t offset;
c16_t *Xu=0;
int16_t Ncp;
uint16_t first_nonzero_root_idx=0;
uint8_t new_dft=0;
uint8_t aa;
int32_t lev;
int16_t levdB;
int fft_size=0,log2_ifft_size;
......@@ -130,14 +126,11 @@ void rx_prach0(PHY_VARS_eNB *eNB,
tdd_mapindex,Nf);
}
int16_t *prach[nb_rx];
uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
uint16_t N_ZC = (prach_fmt <4)?839:139;
if (eNB) {
if (br_flag == 1) {
prach_ifftp = eNB->prach_vars_br.prach_ifft[ce_level];
prachF = eNB->prach_vars_br.prachF;
rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
if (LOG_DEBUGFLAG(PRACH)) {
......@@ -151,7 +144,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
}
} else {
prach_ifftp = eNB->prach_vars.prach_ifft[0];
prachF = eNB->prach_vars.prachF;
rxsigF = eNB->prach_vars.rxsigF[0];
//if (LOG_DEBUGFLAG(PRACH)) {
......@@ -179,7 +171,8 @@ void rx_prach0(PHY_VARS_eNB *eNB,
AssertFatal(ru!=NULL,"ru is null\n");
int8_t dBEn0=0;
for (aa=0; aa<nb_rx; aa++) {
int16_t *prach[nb_rx];
for (int aa=0; aa<nb_rx; aa++) {
if (ru->if_south == LOCAL_RF || ru->function == NGFI_RAU_IF5) { // set the time-domain signal if we have to use it in this node
// DJP - indexing below in subframe zero takes us off the beginning of the array???
prach[aa] = (int16_t *)&ru->common.rxdata[aa][(subframe*fp->samples_per_tti)-ru->N_TA_offset];
......@@ -291,9 +284,9 @@ void rx_prach0(PHY_VARS_eNB *eNB,
LOG_D(PHY,"rx_prach: Doing FFT for N_RB_UL %d nb_rx:%d Ncp:%d\n",fp->N_RB_UL, nb_rx, Ncp);
}
for (aa=0; aa<nb_rx; aa++) {
for (int aa=0; aa<nb_rx; aa++) {
AssertFatal(prach[aa]!=NULL,"prach[%d] is null\n",aa);
prach2 = prach[aa] + (Ncp<<1);
int16_t *prach2 = prach[aa] + (Ncp<<1); // <<1 because type int16 but input is c16
// do DFT
switch (fp->N_RB_UL) {
......@@ -564,33 +557,34 @@ void rx_prach0(PHY_VARS_eNB *eNB,
new_dft = 0;
if (br_flag == 1) {
Xu=(int16_t *)eNB->X_u_br[ce_level][preamble_offset-first_nonzero_root_idx];
Xu=(c16_t *)eNB->X_u_br[ce_level][preamble_offset-first_nonzero_root_idx];
prach_ifft = prach_ifftp[prach_ifft_cnt++];
if (eNB->prach_vars_br.repetition_number[ce_level]==1) memset(prach_ifft,0,((N_ZC==839)?2048:256)*sizeof(int32_t));
} else {
Xu=(int16_t *)eNB->X_u[preamble_offset-first_nonzero_root_idx];
Xu=(c16_t *)eNB->X_u[preamble_offset-first_nonzero_root_idx];
prach_ifft = prach_ifftp[0];
memset(prach_ifft,0,((N_ZC==839) ? 2048 : 256)*sizeof(int32_t));
}
c16_t prachF[1024] __attribute__((aligned(32)))={0};
memset(prachF, 0, sizeof(int16_t)*2*1024 );
if (LOG_DUMPFLAG(PRACH)) {
if (prach[0]!= NULL) LOG_M("prach_rx0.m","prach_rx0",prach[0],6144+792,1,1);
LOG_M("prach_rx1.m","prach_rx1",prach[1],6144+792,1,1);
LOG_M("prach_rxF0.m","prach_rxF0",rxsigF[0],12288,1,1);
LOG_M("prach_rxF1.m","prach_rxF1",rxsigF[1],12288,1,1);
if (LOG_DUMPFLAG(PRACH))
for (int z=0; z<nb_rx; z++)
if( prach[z] ) {
char tmp[128];
sprintf(tmp,"prach_rx%d.m", z);
LOG_M(tmp,tmp,prach[z],6144+792,1,1);
sprintf(tmp,"prach_rxF%d.m", z);
LOG_M(tmp,tmp,rxsigF[z],12288,1,1);
}
for (aa=0; aa<nb_rx; aa++) {
for (int aa=0; aa<nb_rx; aa++) {
// Do componentwise product with Xu* on each antenna
k=0;
for (offset=0; offset<(N_ZC<<1); offset+=2) {
prachF[offset] = (int16_t)(((int32_t)Xu[offset]*rxsigF[aa][k] + (int32_t)Xu[offset+1]*rxsigF[aa][k+1])>>15);
prachF[offset+1] = (int16_t)(((int32_t)Xu[offset]*rxsigF[aa][k+1] - (int32_t)Xu[offset+1]*rxsigF[aa][k])>>15);
for (int offset=0; offset<N_ZC; offset++) {
prachF[offset].r = (int16_t)(((int32_t)Xu[offset].r*rxsigF[aa][k] + (int32_t)Xu[offset].i*rxsigF[aa][k+1])>>15);
prachF[offset].i = (int16_t)(((int32_t)Xu[offset].r*rxsigF[aa][k+1] - (int32_t)Xu[offset].i*rxsigF[aa][k])>>15);
k+=2;
if (k==(12*2*fp->ofdm_symbol_size))
......@@ -600,13 +594,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
// Now do IFFT of size 1024 (N_ZC=839) or 256 (N_ZC=139)
if (N_ZC == 839) {
log2_ifft_size = 10;
idft(IDFT_1024,prachF,prach_ifft_tmp,1);
idft(IDFT_1024,(int16_t*)prachF,prach_ifft_tmp,1);
// compute energy and accumulate over receive antennas and repetitions for BR
for (i=0; i<2048; i++)
prach_ifft[i] += (prach_ifft_tmp[i<<1]*prach_ifft_tmp[i<<1] + prach_ifft_tmp[1+(i<<1)]*prach_ifft_tmp[1+(i<<1)])>>9;
} else {
idft(IDFT_256,prachF,prach_ifft_tmp,1);
idft(IDFT_256,(int16_t*)prachF,prach_ifft_tmp,1);
log2_ifft_size = 8;
// compute energy and accumulate over receive antennas and repetitions for BR
......@@ -674,14 +668,12 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (br_flag == 0) {
LOG_M("rxsigF.m","prach_rxF",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0.m","prach_rxF_comp0",prachF,1024,1,1);
LOG_M("Xu.m","xu",Xu,N_ZC,1,1);
LOG_M("prach_ifft0.m","prach_t0",prach_ifft,1024,1,1);
LOG_M("SF2_3.m","sf2_3",&ru->common.rxdata[0][2*fp->samples_per_tti],2*fp->samples_per_tti,1,1);
} else {
LOG_E(PHY,"Dumping prach (br_flag %d), k = %d (n_ra_prb %d)\n",br_flag,k,n_ra_prb);
LOG_M("rxsigF_br.m","prach_rxF_br",&rxsigF[0][0],12288,1,1);
LOG_M("prach_rxF_comp0_br.m","prach_rxF_comp0_br",prachF,1024,1,1);
LOG_M("Xu_br.m","xu_br",Xu,N_ZC,1,1);
LOG_M("prach_ifft0_br.m","prach_t0_br",prach_ifft,1024,1,1);
}
......
......@@ -335,7 +335,10 @@ int ulsch_decoding_data(PHY_VARS_eNB *eNB, L1_rxtx_proc_t *proc,
}
union turboReqUnion id= {.s={ulsch->rnti,proc->frame_rx,proc->subframe_rx,0,0}};
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(turboDecode_t), id.p, proc->respDecode, processULSegment);
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(turboDecode_t),
id.p,
proc->respDecode,
processULSegment);
turboDecode_t * rdata=(turboDecode_t *) NotifiedFifoData(req);
rdata->eNB=eNB;
......
......@@ -112,8 +112,7 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int16_t* txdata,
int slot,
int first_symbol,
int nsymb,
int length);
int nsymb);
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp);
......@@ -123,8 +122,7 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF,
int slot,
int first_symbol,
int nsymb,
int length);
int nsymb);
/*! \brief Perform NR precoding. TS 38.211 V15.4.0 subclause 6.3.1.5
@param[in] datatx_F_precoding, Pointer to n_layers*re data array
......
......@@ -341,30 +341,41 @@ void do_OFDM_mod(int32_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t ne
}
void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
int16_t* trxdata,
int16_t* txdataF,
int slot,
int first_symbol,
int nsymb,
int length) {
int nsymb)
{
int symb_offset = (slot%fp->slots_per_subframe)*fp->symbols_per_slot;
c16_t *symbol_rotation = fp->symbol_rotation[0];
c16_t *symbol_rotation = fp->symbol_rotation[0] + symb_offset;
for (int sidx=0;sidx<nsymb;sidx++) {
for (int sidx = first_symbol; sidx < first_symbol + nsymb; sidx++) {
c16_t *this_rotation = symbol_rotation + sidx;
c16_t *this_symbol = ((c16_t*) txdataF) + sidx * fp->ofdm_symbol_size;
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d, length %d (%d,%d)\n",
first_symbol + sidx,
LOG_D(PHY,"Rotating symbol %d, slot %d, symbol_subframe_index %d (%d,%d)\n",
sidx,
slot,
sidx + first_symbol + symb_offset,
length,
symbol_rotation[sidx + first_symbol + symb_offset].r,
symbol_rotation[sidx + first_symbol + symb_offset].i);
rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
symbol_rotation + sidx + first_symbol + symb_offset,
((c16_t*) trxdata) + sidx * length,
length,
15);
sidx + symb_offset,
this_rotation->r,
this_rotation->i);
if (fp->N_RB_DL & 1) {
rotate_cpx_vector(this_symbol, this_rotation, this_symbol,
(fp->N_RB_DL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + fp->first_carrier_offset - 6,
this_rotation,
this_symbol + fp->first_carrier_offset - 6,
(fp->N_RB_DL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, this_rotation, this_symbol,
fp->N_RB_DL * 6, 15);
rotate_cpx_vector(this_symbol + fp->first_carrier_offset,
this_rotation,
this_symbol + fp->first_carrier_offset,
fp->N_RB_DL * 6, 15);
}
}
}
......@@ -107,20 +107,36 @@ int nr_slot_fep(PHY_VARS_NR_UE *ue,
symbol+symb_offset,rot2.r,rot2.i);
#endif
rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
&rot2,
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->ofdm_symbol_size,
15);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *this_symbol = (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol];
multadd_cpx_vector((int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
(int16_t *)shift_rot,
(int16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
1,
frame_parms->ofdm_symbol_size,
15);
if (frame_parms->N_RB_DL & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
(frame_parms->N_RB_DL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_DL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, (frame_parms->N_RB_DL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
1, (frame_parms->N_RB_DL + 1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
frame_parms->N_RB_DL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_DL * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, frame_parms->N_RB_DL * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset),
1, frame_parms->N_RB_DL * 6, 15);
}
}
#ifdef DEBUG_FEP
......@@ -223,11 +239,8 @@ int nr_slot_fep_init_sync(PHY_VARS_NR_UE *ue,
symbol+symb_offset,rot2.r,rot2.i);
#endif
rotate_cpx_vector((c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
&rot2,
(c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol],
frame_parms->ofdm_symbol_size,
15);
c16_t *this_symbol = (c16_t *)&common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[aa][frame_parms->ofdm_symbol_size*symbol];
rotate_cpx_vector(this_symbol, &rot2, this_symbol, frame_parms->ofdm_symbol_size, 15);
}
#ifdef DEBUG_FEP
......@@ -301,10 +314,8 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
int32_t *rxdataF,
int slot,
int first_symbol,
int nsymb,
int length) {
int nsymb)
{
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
int soffset = (slot&3)*frame_parms->symbols_per_slot*frame_parms->ofdm_symbol_size;
......@@ -313,19 +324,36 @@ void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
c16_t rot2 = frame_parms->symbol_rotation[1][symbol + symb_offset];
rot2.i=-rot2.i;
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,rot2.r,rot2.i);
rotate_cpx_vector((c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
&rot2,
(c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
length,
15);
c16_t *shift_rot = frame_parms->timeshift_symbol_rotation;
c16_t *this_symbol = (c16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)];
multadd_cpx_vector((int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
(int16_t *)shift_rot,
(int16_t *)&rxdataF[soffset+(frame_parms->ofdm_symbol_size*symbol)],
1,
length,
15);
if (frame_parms->N_RB_UL & 1) {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
(frame_parms->N_RB_UL + 1) * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
&rot2,
this_symbol + frame_parms->first_carrier_offset - 6,
(frame_parms->N_RB_UL + 1) * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, (frame_parms->N_RB_UL+1) * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset - 6),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset - 6),
1, (frame_parms->N_RB_UL+1) * 6, 15);
} else {
rotate_cpx_vector(this_symbol, &rot2, this_symbol,
frame_parms->N_RB_UL * 6, 15);
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
&rot2,
this_symbol + frame_parms->first_carrier_offset,
frame_parms->N_RB_UL * 6, 15);
multadd_cpx_vector((int16_t *)this_symbol, (int16_t *)shift_rot, (int16_t *)this_symbol,
1, frame_parms->N_RB_UL * 6, 15);
multadd_cpx_vector((int16_t *)(this_symbol + frame_parms->first_carrier_offset),
(int16_t *)(shift_rot + frame_parms->first_carrier_offset),
(int16_t *)(this_symbol + frame_parms->first_carrier_offset),
1, frame_parms->N_RB_UL * 6, 15);
}
}
}
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