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
This commit is contained in:
+107
@@ -0,0 +1,107 @@
|
||||
---
|
||||
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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
# 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)
|
||||
|
||||
+62
-23
@@ -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')
|
||||
self.exitStatus=0
|
||||
else:
|
||||
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
|
||||
if 'BUILD SHOULD BE SUCCESSFUL' in f.read():
|
||||
HTML.CreateHtmlTestRow(self.buildargs, 'OK', CONST.ALL_PROCESSES_OK, 'PhySim')
|
||||
self.exitStatus=0
|
||||
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
|
||||
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"
|
||||
|
||||
|
||||
+19
-4
@@ -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,106 +463,75 @@ function report_build {
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <h2>Build Summary</h2>" >> ./build_results.html
|
||||
|
||||
if [ -f ./oai_rules_result.txt ]
|
||||
echo " <h3>OAI Coding / Formatting Guidelines Check</h3>" >> ./build_results.html
|
||||
if [ -f ./header-files-w-incorrect-define.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
|
||||
NB_FILES_IN_ERROR=`wc -l ./header-files-w-incorrect-define.txt | sed -e "s@ .*@@"`
|
||||
if [ $NB_FILES_IN_ERROR -eq 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
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>No Issue for CIRCULAR DEPENDENCY PROTECTION in modified files</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>No Issue for CIRCULAR DEPENDENCY PROTECTION in the whole repository</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
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} modified files MAY NOT HAVE CIRCULAR DEPENDENCY PROTECTION</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} files in repository MAY NOT HAVE CIRCULAR DEPENDENCY PROTECTION in the whole repository</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 " <button data-toggle=\"collapse\" data-target=\"#oai-circular-details\">More details on circular dependency protection check</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-circular-details\" class=\"collapse\">" >> ./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 " <th bgcolor = \"lightcyan\" >Potential Issue</th>" >> ./build_results.html
|
||||
echo " <th bgcolor = \"lightcyan\" >Impacted File</th>" >> ./build_results.html
|
||||
echo " <th bgcolor = \"lightcyan\" >Incorrect Macro</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
awk '{print " <tr><td>"$1"</td></tr>"}' ./oai_rules_result_list.txt >> ./build_results.html
|
||||
awk '{if($0 ~/error in/){print " <tr><td>error in declaration</td><td>"$4"</td><td>"$5"</td></tr>"};if($0 ~/files with same/){print " <tr><td>files with same #define</td><td>"$5"</td><td>"$6"</td></tr>"}}' ./header-files-w-incorrect-define.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 ]
|
||||
fi
|
||||
if [ -f ./files-w-gnu-gpl-license-banner.txt ]
|
||||
then
|
||||
NB_FILES_IN_ERROR=`wc -l ./files-w-gnu-gpl-license-banner.txt | sed -e "s@ .*@@"`
|
||||
if [ $NB_FILES_IN_ERROR -ne 0 ]
|
||||
then
|
||||
NB_FILES_IN_ERROR=`wc -l ./header-files-w-incorrect-define.txt | sed -e "s@ .*@@"`
|
||||
if [ $NB_FILES_IN_ERROR -eq 0 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-success\">" >> ./build_results.html
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>No Issue for CIRCULAR DEPENDENCY PROTECTION in modified files</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>No Issue for CIRCULAR DEPENDENCY PROTECTION in the whole repository</strong>" >> ./build_results.html; fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
else
|
||||
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} modified files MAY NOT HAVE CIRCULAR DEPENDENCY PROTECTION</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} files in repository MAY NOT HAVE CIRCULAR DEPENDENCY PROTECTION in the whole repository</strong>" >> ./build_results.html; fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-circular-details\">More details on circular dependency protection check</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-circular-details\" class=\"collapse\">" >> ./build_results.html
|
||||
echo " <table border = 1>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <th bgcolor = \"lightcyan\" >Potential Issue</th>" >> ./build_results.html
|
||||
echo " <th bgcolor = \"lightcyan\" >Impacted File</th>" >> ./build_results.html
|
||||
echo " <th bgcolor = \"lightcyan\" >Incorrect Macro</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
awk '{if($0 ~/error in/){print " <tr><td>error in declaration</td><td>"$4"</td><td>"$5"</td></tr>"};if($0 ~/files with same/){print " <tr><td>files with same #define</td><td>"$5"</td><td>"$6"</td></tr>"}}' ./header-files-w-incorrect-define.txt >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
fi
|
||||
echo " <div class=\"alert alert-danger\">" >> ./build_results.html
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} modified files HAVE a GNU GPL license banner</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} files in repository HAVE a GNU GPL license banner</strong>" >> ./build_results.html; fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-license-gpl\">More details on GNU GPL license banner issue</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-license-gpl\" class=\"collapse\">" >> ./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>"}' ./files-w-gnu-gpl-license-banner.txt >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
fi
|
||||
if [ -f ./files-w-gnu-gpl-license-banner.txt ]
|
||||
fi
|
||||
if [ -f ./files-w-suspect-banner.txt ]
|
||||
then
|
||||
NB_FILES_IN_ERROR=`wc -l ./files-w-suspect-banner.txt | sed -e "s@ .*@@"`
|
||||
if [ $NB_FILES_IN_ERROR -ne 0 ]
|
||||
then
|
||||
NB_FILES_IN_ERROR=`wc -l ./files-w-gnu-gpl-license-banner.txt | sed -e "s@ .*@@"`
|
||||
if [ $NB_FILES_IN_ERROR -ne 0 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-danger\">" >> ./build_results.html
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} modified files HAVE a GNU GPL license banner</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} files in repository HAVE a GNU GPL license banner</strong>" >> ./build_results.html; fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-license-gpl\">More details on GNU GPL license banner issue</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-license-gpl\" class=\"collapse\">" >> ./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>"}' ./files-w-gnu-gpl-license-banner.txt >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
if [ -f ./files-w-suspect-banner.txt ]
|
||||
then
|
||||
NB_FILES_IN_ERROR=`wc -l ./files-w-suspect-banner.txt | sed -e "s@ .*@@"`
|
||||
if [ $NB_FILES_IN_ERROR -ne 0 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} modified files HAVE a suspect license banner</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} files in repository HAVE a suspect license banner</strong>" >> ./build_results.html; fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-license-suspect\">More details on suspect banner files</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-license-suspect\" class=\"collapse\">" >> ./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>"}' ././files-w-suspect-banner.txt >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
fi
|
||||
echo " <div class=\"alert alert-warning\">" >> ./build_results.html
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} modified files HAVE a suspect license banner</strong>" >> ./build_results.html; fi
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <strong>${NB_FILES_IN_ERROR} files in repository HAVE a suspect license banner</strong>" >> ./build_results.html; fi
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-license-suspect\">More details on suspect banner files</button>" >> ./build_results.html
|
||||
echo " <div id=\"oai-license-suspect\" class=\"collapse\">" >> ./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>"}' ././files-w-suspect-banner.txt >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " </div>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
- 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>
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
<!--
|
||||
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>
|
||||
@@ -0,0 +1,54 @@
|
||||
<!--
|
||||
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
|
||||
|
||||
@@ -1,68 +0,0 @@
|
||||
#!/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
|
||||
|
||||
@@ -39,14 +39,14 @@ notifiedFIFO_t measur_fifo;
|
||||
double get_cpu_freq_GHz(void)
|
||||
{
|
||||
if (cpu_freq_GHz <1 ) {
|
||||
time_stats_t ts = {0};
|
||||
reset_meas(&ts);
|
||||
ts.trials++;
|
||||
ts.in = rdtsc_oai();
|
||||
sleep(1);
|
||||
ts.diff = (rdtsc_oai()-ts.in);
|
||||
cpu_freq_GHz = (double)ts.diff/1000000000;
|
||||
printf("CPU Freq is %f \n", cpu_freq_GHz);
|
||||
time_stats_t ts = {0};
|
||||
reset_meas(&ts);
|
||||
ts.trials++;
|
||||
ts.in = rdtsc_oai();
|
||||
sleep(1);
|
||||
ts.diff = (rdtsc_oai()-ts.in);
|
||||
cpu_freq_GHz = (double)ts.diff/1000000000;
|
||||
printf("CPU Freq is %f \n", cpu_freq_GHz);
|
||||
}
|
||||
return cpu_freq_GHz;
|
||||
}
|
||||
|
||||
+6
-46
@@ -1,41 +1,20 @@
|
||||
<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.
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
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);
|
||||
}
|
||||
|
||||
+5
-15
@@ -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);
|
||||
|
||||
+1
-1
@@ -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);
|
||||
|
||||
@@ -447,7 +434,7 @@ int main( int argc, char **argv ) {
|
||||
|
||||
init_opt() ;
|
||||
load_nrLDPClib(NULL);
|
||||
|
||||
|
||||
if (ouput_vcd) {
|
||||
vcd_signal_dumper_init("/tmp/openair_dump_nrUE.vcd");
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,135 @@
|
||||
/* 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;
|
||||
|
||||
|
||||
@@ -497,10 +497,10 @@ int nr_rate_matching_ldpc_rx(uint32_t Tbslbrm,
|
||||
N = (BG==1)?(66*Z):(50*Z);
|
||||
|
||||
if (Tbslbrm == 0)
|
||||
Ncb = N;
|
||||
Ncb = N;
|
||||
else {
|
||||
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
|
||||
Ncb = min(N, Nref);
|
||||
Nref = (3*Tbslbrm/(2*C)); //R_LBRM = 2/3
|
||||
Ncb = min(N, Nref);
|
||||
}
|
||||
|
||||
ind = (index_k0[BG-1][rvidx]*Ncb/N)*Z;
|
||||
@@ -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,7 +74,8 @@ 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);
|
||||
else
|
||||
@@ -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) {
|
||||
@@ -562,37 +555,38 @@ void rx_prach0(PHY_VARS_eNB *eNB,
|
||||
|
||||
if (new_dft == 1) {
|
||||
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));
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
for (aa=0; aa<nb_rx; aa++) {
|
||||
c16_t prachF[1024] __attribute__((aligned(32)))={0};
|
||||
|
||||
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 (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))
|
||||
k=0;
|
||||
}
|
||||
@@ -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);
|
||||
sidx + symb_offset,
|
||||
this_rotation->r,
|
||||
this_rotation->i);
|
||||
|
||||
rotate_cpx_vector(((c16_t*) trxdata) + sidx * length,
|
||||
symbol_rotation + sidx + first_symbol + symb_offset,
|
||||
((c16_t*) trxdata) + sidx * length,
|
||||
length,
|
||||
15);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ int nr_est_timing_advance_pusch(PHY_VARS_gNB* gNB, int UE_id)
|
||||
return max_pos - sync_pos;
|
||||
}
|
||||
|
||||
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
int nr_est_timing_advance_srs(const NR_DL_FRAME_PARMS *frame_parms,
|
||||
const int32_t srs_estimated_channel_time[][frame_parms->ofdm_symbol_size]) {
|
||||
int timing_advance = 0;
|
||||
int max_val = 0;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,7 @@
|
||||
#include "PHY/NR_TRANSPORT/nr_ulsch.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_dlsch.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "SCHED_NR/fapi_nr_l1.h"
|
||||
#include "defs.h"
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "common/utils/LOG/log.h"
|
||||
@@ -381,6 +382,23 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
uint32_t offset;
|
||||
int kc;
|
||||
int E;
|
||||
int8_t llrProcBuf[22*384];
|
||||
int ret = 0;
|
||||
int i,j;
|
||||
int8_t enable_ldpc_offload = phy_vars_gNB->ldpc_offload_flag;
|
||||
int16_t z_ol [68*384];
|
||||
int8_t l_ol [68*384];
|
||||
__m128i *pv_ol128 = (__m128i*)&z_ol;
|
||||
__m128i *pl_ol128 = (__m128i*)&l_ol;
|
||||
int no_iteration_ldpc = 2;
|
||||
int length_dec;
|
||||
uint8_t crc_type;
|
||||
int K_bits_F;
|
||||
int16_t z [68*384 + 16] __attribute__ ((aligned(16)));
|
||||
int8_t l [68*384 + 16] __attribute__ ((aligned(16)));
|
||||
|
||||
__m128i *pv = (__m128i*)&z;
|
||||
__m128i *pl = (__m128i*)&l;
|
||||
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
prnt_crc_cnt++;
|
||||
@@ -395,7 +413,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
LOG_E(PHY,"ulsch_decoding.c: NULL harq_process pointer\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint8_t dtx_det = 0;
|
||||
t_nrLDPC_dec_params decParams;
|
||||
t_nrLDPC_dec_params* p_decParams = &decParams;
|
||||
|
||||
@@ -422,6 +440,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
harq_process->round = nr_rv_to_round(pusch_pdu->pusch_data.rv_index);
|
||||
|
||||
harq_process->new_rx = false; // flag to indicate if this is a new reception for this harq (initialized to false)
|
||||
dtx_det = 0;
|
||||
if (harq_process->round == 0) {
|
||||
harq_process->new_rx = true;
|
||||
harq_process->ndi = pusch_pdu->pusch_data.new_data_indicator;
|
||||
@@ -431,6 +450,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
if (harq_process->ndi != pusch_pdu->pusch_data.new_data_indicator) {
|
||||
harq_process->new_rx = true;
|
||||
harq_process->ndi = pusch_pdu->pusch_data.new_data_indicator;
|
||||
|
||||
LOG_D(PHY,"Missed ULSCH detection. NDI toggled but rv %d does not correspond to first reception\n",pusch_pdu->pusch_data.rv_index);
|
||||
}
|
||||
|
||||
@@ -546,12 +566,179 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
Kr = harq_process->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
offset = 0;
|
||||
|
||||
//if ((enable_ldpc_offload)&& (dtx_det==0))
|
||||
if (enable_ldpc_offload){
|
||||
// if (dtx_det==0) {
|
||||
|
||||
if (harq_process->C == 1) {
|
||||
if (A > 3824)
|
||||
crc_type = CRC24_A;
|
||||
else
|
||||
crc_type = CRC16;
|
||||
|
||||
length_dec = harq_process->B;
|
||||
}
|
||||
else {
|
||||
crc_type = CRC24_B;
|
||||
length_dec = (harq_process->B+24*harq_process->C)/harq_process->C;
|
||||
}
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
E = nr_get_E(G, harq_process->C, Qm, n_layers, r);
|
||||
memset(harq_process->c[r],0,Kr_bytes);
|
||||
|
||||
if ((dtx_det==0)&&(pusch_pdu->pusch_data.rv_index==0)){
|
||||
//if (dtx_det==0){
|
||||
if (mcs >9){
|
||||
memcpy((&z_ol[0]),ulsch_llr+r_offset,E*sizeof(short));
|
||||
|
||||
for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++)
|
||||
{
|
||||
pl_ol128[j] = _mm_packs_epi16(pv_ol128[i],pv_ol128[i+1]);
|
||||
}
|
||||
|
||||
ret = nrLDPC_decoder_offload(p_decParams, harq_pid,
|
||||
ULSCH_id,r,
|
||||
pusch_pdu->pusch_data.rv_index,
|
||||
harq_process->F,
|
||||
E,
|
||||
Qm,
|
||||
(int8_t*)&pl_ol128[0],
|
||||
llrProcBuf, 1);
|
||||
if (ret<0) {
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in LDPC decoder offload\n");
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
else{
|
||||
K_bits_F = Kr-harq_process->F;
|
||||
|
||||
t_nrLDPC_time_stats procTime = {0};
|
||||
t_nrLDPC_time_stats* p_procTime = &procTime ;
|
||||
/// code blocks after bit selection in rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
|
||||
int16_t harq_e[3*8448];
|
||||
|
||||
nr_deinterleaving_ldpc(E,
|
||||
Qm,
|
||||
harq_e,
|
||||
ulsch_llr+r_offset);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(pusch_pdu->maintenance_parms_v3.tbSizeLbrmBytes,
|
||||
p_decParams->BG,
|
||||
p_decParams->Z,
|
||||
harq_process->d[r],
|
||||
harq_e,
|
||||
harq_process->C,
|
||||
pusch_pdu->pusch_data.rv_index,
|
||||
harq_process->new_rx,
|
||||
E,
|
||||
harq_process->F,
|
||||
Kr-harq_process->F-2*(p_decParams->Z))==-1) {
|
||||
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n");
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//set first 2*Z_c bits to zeros
|
||||
memset(&z[0],0,2*harq_process->Z*sizeof(int16_t));
|
||||
//set Filler bits
|
||||
memset((&z[0]+K_bits_F),127,harq_process->F*sizeof(int16_t));
|
||||
//Move coded bits before filler bits
|
||||
memcpy((&z[0]+2*harq_process->Z),harq_process->d[r],(K_bits_F-2*harq_process->Z)*sizeof(int16_t));
|
||||
//skip filler bits
|
||||
memcpy((&z[0]+Kr),harq_process->d[r]+(Kr-2*harq_process->Z),(kc*harq_process->Z-Kr)*sizeof(int16_t));
|
||||
//Saturate coded bits before decoding into 8 bits values
|
||||
for (i=0, j=0; j < ((kc*harq_process->Z)>>4)+1; i+=2, j++)
|
||||
{
|
||||
pl[j] = _mm_packs_epi16(pv[i],pv[i+1]);
|
||||
}
|
||||
|
||||
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
|
||||
(int8_t*)&pl[0],
|
||||
llrProcBuf,
|
||||
p_procTime);
|
||||
|
||||
}
|
||||
|
||||
for (int m=0; m < Kr>>3; m ++) {
|
||||
harq_process->c[r][m]= (uint8_t) llrProcBuf[m];
|
||||
}
|
||||
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "Segment %d CRC OK\n",r);
|
||||
#endif
|
||||
no_iteration_ldpc = 2;
|
||||
} else {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "segment %d CRC NOK\n",r);
|
||||
#endif
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
}
|
||||
//}
|
||||
|
||||
r_offset += E;
|
||||
|
||||
/*for (int k=0;k<8;k++)
|
||||
{
|
||||
printf("output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
|
||||
printf("llrprocbuf [%d] = %x adr %p\n", k, llrProcBuf[k], llrProcBuf+k);
|
||||
}
|
||||
*/
|
||||
}
|
||||
else{
|
||||
dtx_det = 0;
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations+1;
|
||||
}
|
||||
bool decodeSuccess = (no_iteration_ldpc <= ulsch->max_ldpc_iterations);
|
||||
if (decodeSuccess) {
|
||||
memcpy(harq_process->b+offset,
|
||||
harq_process->c[r],
|
||||
Kr_bytes - (harq_process->F>>3) -((harq_process->C>1)?3:0));
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
harq_process->processedSegments++;
|
||||
}
|
||||
else {
|
||||
LOG_D(PHY,"uplink segment error %d/%d\n",r,harq_process->C);
|
||||
LOG_D(PHY, "ULSCH %d in error\n",ULSCH_id);
|
||||
break; //don't even attempt to decode other segments
|
||||
}
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0);
|
||||
|
||||
if ((harq_process->processedSegments==(harq_process->C))) {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for slot %d TBS %d\n",
|
||||
phy_vars_gNB->Mod_id,harq_process->slot,harq_process->TBS);
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(phy_vars_gNB,harq_process->frame, harq_process->slot, ULSCH_id, harq_pid, 0,0);
|
||||
|
||||
} else {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d\n",
|
||||
phy_vars_gNB->Mod_id, harq_process->frame, harq_process->slot,
|
||||
harq_pid,harq_process->status, harq_process->round,harq_process->TBS,r);
|
||||
harq_process->handled = 1;
|
||||
no_iteration_ldpc = ulsch->max_ldpc_iterations + 1;
|
||||
LOG_D(PHY, "ULSCH %d in error\n",ULSCH_id);
|
||||
nr_fill_indication(phy_vars_gNB,harq_process->frame, harq_process->slot, ULSCH_id, harq_pid, 1,0);
|
||||
}
|
||||
ulsch->last_iteration_cnt = no_iteration_ldpc;
|
||||
}
|
||||
|
||||
else {
|
||||
dtx_det = 0;
|
||||
void (*nr_processULSegment_ptr)(void*) = &nr_processULSegment;
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
E = nr_get_E(G, harq_process->C, Qm, n_layers, r);
|
||||
|
||||
union ldpcReqUnion id = {.s={ulsch->rnti,frame,nr_tti_rx,0,0}};
|
||||
notifiedFIFO_elt_t *req = newNotifiedFIFO_elt(sizeof(ldpcDecode_t), id.p, &phy_vars_gNB->respDecode, nr_processULSegment_ptr);
|
||||
ldpcDecode_t * rdata=(ldpcDecode_t *) NotifiedFifoData(req);
|
||||
@@ -581,5 +768,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -183,4 +183,4 @@ int nr_get_srs_signal(PHY_VARS_gNB *gNB,
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,29 +57,6 @@ notifiedFIFO_t freeBlocks_dl;
|
||||
notifiedFIFO_elt_t *msgToPush_dl;
|
||||
int nbDlProcessing =0;
|
||||
|
||||
|
||||
static tpool_t pool_dl;
|
||||
//extern double cpuf;
|
||||
|
||||
void init_dlsch_tpool(uint8_t num_dlsch_threads) {
|
||||
char *params = NULL;
|
||||
|
||||
if( num_dlsch_threads==0) {
|
||||
params = calloc(1,2);
|
||||
memcpy(params,"N",1);
|
||||
}
|
||||
else {
|
||||
params = calloc(1,(num_dlsch_threads*3)+1);
|
||||
for (int i=0; i<num_dlsch_threads; i++) {
|
||||
memcpy(params+(i*3),"-1,",3);
|
||||
}
|
||||
}
|
||||
|
||||
initNamedTpool(params, &pool_dl, false,"dlsch");
|
||||
free(params);
|
||||
}
|
||||
|
||||
|
||||
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr, uint16_t N_RB_DL) {
|
||||
|
||||
uint16_t a_segments = MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER*NR_MAX_NB_LAYERS;
|
||||
@@ -207,7 +184,7 @@ bool nr_ue_postDecode(PHY_VARS_NR_UE *phy_vars_ue, notifiedFIFO_elt_t *req, bool
|
||||
|
||||
} else {
|
||||
if ( !last ) {
|
||||
int nb=abortTpoolJob(&(pool_dl), req->key);
|
||||
int nb=abortTpoolJob(&get_nrUE_params()->Tpool, req->key);
|
||||
nb+=abortNotifiedFIFOJob(nf_p, req->key);
|
||||
LOG_D(PHY,"downlink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
|
||||
LOG_D(PHY, "DLSCH %d in error\n",rdata->dlsch_id);
|
||||
@@ -606,7 +583,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
reset_meas(&rdata->ts_deinterleave);
|
||||
reset_meas(&rdata->ts_rate_unmatch);
|
||||
reset_meas(&rdata->ts_ldpc_decode);
|
||||
pushTpool(&(pool_dl),req);
|
||||
pushTpool(&get_nrUE_params()->Tpool,req);
|
||||
nbDecode++;
|
||||
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",nbDecode);
|
||||
r_offset += E;
|
||||
@@ -614,7 +591,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
for (r=0; r<nbDecode; r++) {
|
||||
notifiedFIFO_elt_t *req=pullTpool(&nf, &(pool_dl));
|
||||
notifiedFIFO_elt_t *req=pullTpool(&nf, &get_nrUE_params()->Tpool);
|
||||
if (req == NULL)
|
||||
break; // Tpool has been stopped
|
||||
bool last = false;
|
||||
|
||||
@@ -480,45 +480,45 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
nbSymb = dlsch1_harq->nb_symbols;
|
||||
pduBitmap = dlsch1_harq->pduBitmap;
|
||||
}
|
||||
|
||||
|
||||
/* Check for PTRS bitmap and process it respectively */
|
||||
if((pduBitmap & 0x1) && (type == PDSCH)) {
|
||||
nr_pdsch_ptrs_processing(ue,
|
||||
pdsch_vars,
|
||||
frame_parms,
|
||||
dlsch0_harq,
|
||||
dlsch1_harq,
|
||||
gNB_id,
|
||||
nr_slot_rx,
|
||||
symbol,
|
||||
(nb_rb_pdsch*12),
|
||||
dlsch[0]->rnti,rx_type);
|
||||
pdsch_vars,
|
||||
frame_parms,
|
||||
dlsch0_harq,
|
||||
dlsch1_harq,
|
||||
gNB_id,
|
||||
nr_slot_rx,
|
||||
symbol,
|
||||
(nb_rb_pdsch*12),
|
||||
dlsch[0]->rnti,rx_type);
|
||||
pdsch_vars[gNB_id]->dl_valid_re[symbol-1] -= pdsch_vars[gNB_id]->ptrs_re_per_slot[0][symbol];
|
||||
}
|
||||
|
||||
|
||||
/* at last symbol in a slot calculate LLR's for whole slot */
|
||||
if(symbol == (startSymbIdx + nbSymb -1)) {
|
||||
for(uint8_t i =startSymbIdx; i < (startSymbIdx+nbSymb);i++) {
|
||||
/* re evaluating the first symbol flag as LLR's are done in symbol loop */
|
||||
if(i == startSymbIdx && i < 3) {
|
||||
first_symbol_flag =1;
|
||||
first_symbol_flag =1;
|
||||
}
|
||||
else {
|
||||
first_symbol_flag=0;
|
||||
first_symbol_flag=0;
|
||||
}
|
||||
/* Calculate LLR's for each symbol */
|
||||
nr_dlsch_llr(pdsch_vars, frame_parms,
|
||||
rxdataF_comp_ptr, dl_ch_mag_ptr,
|
||||
dlsch0_harq, dlsch1_harq,
|
||||
rx_type, harq_pid,
|
||||
gNB_id, gNB_id_i,
|
||||
first_symbol_flag,
|
||||
i, nb_rb_pdsch,
|
||||
codeword_TB0, codeword_TB1,
|
||||
pdsch_vars[gNB_id]->dl_valid_re[i-1],
|
||||
nr_slot_rx, beamforming_mode);
|
||||
rxdataF_comp_ptr, dl_ch_mag_ptr,
|
||||
dlsch0_harq, dlsch1_harq,
|
||||
rx_type, harq_pid,
|
||||
gNB_id, gNB_id_i,
|
||||
first_symbol_flag,
|
||||
i, nb_rb_pdsch,
|
||||
codeword_TB0, codeword_TB1,
|
||||
pdsch_vars[gNB_id]->dl_valid_re[i-1],
|
||||
nr_slot_rx, beamforming_mode);
|
||||
}
|
||||
|
||||
|
||||
int dmrs_type = dlsch[0]->harq_processes[harq_pid]->dmrsConfigType;
|
||||
uint8_t nb_re_dmrs;
|
||||
uint16_t dmrs_len = get_num_dmrs(dlsch[0]->harq_processes[harq_pid]->dlDmrsSymbPos);
|
||||
@@ -528,29 +528,29 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
nb_re_dmrs = 4*dlsch[0]->harq_processes[harq_pid]->n_dmrs_cdm_groups;
|
||||
}
|
||||
dlsch[0]->harq_processes[harq_pid]->G = nr_get_G(dlsch[0]->harq_processes[harq_pid]->nb_rb,
|
||||
dlsch[0]->harq_processes[harq_pid]->nb_symbols,
|
||||
nb_re_dmrs,
|
||||
dmrs_len,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl);
|
||||
dlsch[0]->harq_processes[harq_pid]->nb_symbols,
|
||||
nb_re_dmrs,
|
||||
dmrs_len,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl);
|
||||
nr_dlsch_layer_demapping(pdsch_vars[gNB_id]->llr,
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->G,
|
||||
codeword_TB0,
|
||||
codeword_TB1,
|
||||
pdsch_vars[gNB_id]->layer_llr);
|
||||
dlsch[0]->harq_processes[harq_pid]->Nl,
|
||||
dlsch[0]->harq_processes[harq_pid]->Qm,
|
||||
dlsch[0]->harq_processes[harq_pid]->G,
|
||||
codeword_TB0,
|
||||
codeword_TB1,
|
||||
pdsch_vars[gNB_id]->layer_llr);
|
||||
}
|
||||
|
||||
|
||||
stop_meas(&ue->generic_stat_bis[proc->thread_id][slot]);
|
||||
if (cpumeas(CPUMEAS_GETSTATE))
|
||||
LOG_D(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_slot_rx,slot,symbol,ue->generic_stat_bis[proc->thread_id][slot].p_time/(cpuf*1000.0));
|
||||
|
||||
|
||||
// Please keep it: useful for debugging
|
||||
#ifdef DEBUG_PDSCH_RX
|
||||
char filename[50];
|
||||
uint8_t aa = 0;
|
||||
|
||||
|
||||
snprintf(filename, 50, "rxdataF0_symb_%d_nr_slot_rx_%d.m", symbol, nr_slot_rx);
|
||||
write_output(filename, "rxdataF0", &common_vars->common_vars_rx_data_per_thread[proc->thread_id].rxdataF[0][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1);
|
||||
|
||||
|
||||
@@ -381,7 +381,7 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
|
||||
start_meas(&ue->ulsch_rate_matching_stats);
|
||||
if (nr_rate_matching_ldpc(0,
|
||||
if (nr_rate_matching_ldpc(harq_process->pusch_pdu.tbslbrm,
|
||||
harq_process->BG,
|
||||
*pz,
|
||||
harq_process->d[r],
|
||||
|
||||
@@ -597,17 +597,28 @@ uint8_t nr_ue_pusch_common_procedures(PHY_VARS_NR_UE *UE,
|
||||
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
for(ap = 0; ap < n_antenna_ports; ap++) {
|
||||
for (int s=0;s<NR_NUMBER_OF_SYMBOLS_PER_SLOT;s++){
|
||||
c16_t rot=((c16_t*)frame_parms->symbol_rotation[1])[s + symb_offset];
|
||||
c16_t *this_symbol = (c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s];
|
||||
c16_t rot=frame_parms->symbol_rotation[1][s + symb_offset];
|
||||
LOG_D(PHY,"rotating txdataF symbol %d (%d) => (%d.%d)\n",
|
||||
s,
|
||||
s + symb_offset,
|
||||
rot.r, rot.i);
|
||||
|
||||
rotate_cpx_vector((c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
&rot,
|
||||
(c16_t *)&txdataF[ap][frame_parms->ofdm_symbol_size * s],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
if (frame_parms->N_RB_UL & 1) {
|
||||
rotate_cpx_vector(this_symbol, &rot, this_symbol,
|
||||
(frame_parms->N_RB_UL + 1) * 6, 15);
|
||||
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset - 6,
|
||||
&rot,
|
||||
this_symbol + frame_parms->first_carrier_offset - 6,
|
||||
(frame_parms->N_RB_UL + 1) * 6, 15);
|
||||
} else {
|
||||
rotate_cpx_vector(this_symbol, &rot, this_symbol,
|
||||
frame_parms->N_RB_UL * 6, 15);
|
||||
rotate_cpx_vector(this_symbol + frame_parms->first_carrier_offset,
|
||||
&rot,
|
||||
this_symbol + frame_parms->first_carrier_offset,
|
||||
frame_parms->N_RB_UL * 6, 15);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
|
||||
void bit8_rxdemux(int length,int offset)
|
||||
{
|
||||
|
||||
int i;
|
||||
short *rx1_ptr = (short *)&PHY_vars->rx_vars[1].RX_DMA_BUFFER[offset];
|
||||
short *rx0_ptr = (short *)&PHY_vars->rx_vars[0].RX_DMA_BUFFER[offset];
|
||||
char *rx0_ptr2 = (char *)(&PHY_vars->rx_vars[0].RX_DMA_BUFFER[offset]);
|
||||
// short tmp;
|
||||
short r0,i0,r1,i1;
|
||||
|
||||
// printf("demuxing: %d,%d\n",length,offset);
|
||||
|
||||
// printf("%x %x\n",PHY_vars->chsch_data[0].CHSCH_f_sync[0], PHY_vars->chsch_data[0].CHSCH_f_sync[1]);
|
||||
|
||||
for (i=0; i<length; i++) {
|
||||
|
||||
|
||||
|
||||
|
||||
r0= (short)(rx0_ptr2[i<<2]); // Re 0
|
||||
|
||||
i0= (short)(rx0_ptr2[(i<<2)+1]); // Im 0
|
||||
|
||||
r1= (short)(rx0_ptr2[(i<<2)+2]); // Re 1
|
||||
|
||||
i1= (short)(rx0_ptr2[(i<<2)+3]); // Im 1
|
||||
|
||||
rx0_ptr[(i<<1)] = r0;
|
||||
rx0_ptr[(i<<1)+1] =i0;
|
||||
rx1_ptr[i<<1] =r1;
|
||||
rx1_ptr[(i<<1)+1] =i1;
|
||||
}
|
||||
|
||||
// printf("%x %x\n",PHY_vars->chsch_data[0].CHSCH_f_sync[0], PHY_vars->chsch_data[0].CHSCH_f_sync[1]);
|
||||
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "PHY/types.h"
|
||||
#include "PHY/defs.h"
|
||||
#include "PHY/extern.h"
|
||||
|
||||
|
||||
void bit8_txmux(int length,int offset)
|
||||
{
|
||||
|
||||
int i;
|
||||
short *dest,*dest2;
|
||||
|
||||
|
||||
|
||||
|
||||
for (i=0; i<length; i++) {
|
||||
|
||||
dest = (short *)&PHY_vars->tx_vars[0].TX_DMA_BUFFER[i+offset];
|
||||
dest2 = (short *)&PHY_vars->tx_vars[1].TX_DMA_BUFFER[i+offset];
|
||||
|
||||
((char *)dest)[0] = (char)(dest[0]>>BIT8_TX_SHIFT);
|
||||
((char *)dest)[1] = (char)(dest[1]>>BIT8_TX_SHIFT);
|
||||
((char *)dest)[2] = (char)(dest2[0]>>BIT8_TX_SHIFT);
|
||||
((char *)dest)[3] = (char)(dest2[1]>>BIT8_TX_SHIFT);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,163 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
static __m128i alpha_128 __attribute__ ((aligned(16)));
|
||||
static __m128i shift __attribute__ ((aligned(16)));
|
||||
|
||||
int add_cpx_vector(short *x,
|
||||
short *alpha,
|
||||
short *y,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
alpha_128 = _mm_set1_epi32(*((int*)alpha));
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
y_128[0] = _mm_adds_epi16(alpha_128, x_128[0]);
|
||||
y_128[1] = _mm_adds_epi16(alpha_128, x_128[1]);
|
||||
y_128[2] = _mm_adds_epi16(alpha_128, x_128[2]);
|
||||
y_128[3] = _mm_adds_epi16(alpha_128, x_128[3]);
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128 +=4;
|
||||
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int add_vector32_scalar(short *x,
|
||||
int alpha,
|
||||
short *y,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
alpha_128 = _mm_setr_epi32(alpha,0,alpha,0);
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
y_128[0] = _mm_add_epi32(alpha_128, x_128[0]);
|
||||
y_128[1] = _mm_add_epi32(alpha_128, x_128[1]);
|
||||
y_128[2] = _mm_add_epi32(alpha_128, x_128[2]);
|
||||
y_128[3] = _mm_add_epi32(alpha_128, x_128[3]);
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128 +=4;
|
||||
|
||||
}
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
int add_real_vector64_scalar(short *x,
|
||||
long long int a,
|
||||
short *y,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
alpha_128 = _mm_set1_epi64((__m64) a);
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
y_128[0] = _mm_add_epi64(alpha_128, x_128[0]);
|
||||
y_128[1] = _mm_add_epi64(alpha_128, x_128[1]);
|
||||
y_128[2] = _mm_add_epi64(alpha_128, x_128[2]);
|
||||
y_128[3] = _mm_add_epi64(alpha_128, x_128[3]);
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128+=4;
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
|
||||
main ()
|
||||
{
|
||||
|
||||
short input[256] __attribute__((aligned(16)));
|
||||
short output[256] __attribute__((aligned(16)));
|
||||
|
||||
int i;
|
||||
c16_t alpha;
|
||||
|
||||
Zero_Buffer(output,256*2);
|
||||
|
||||
input[0] = 100;
|
||||
input[1] = 200;
|
||||
input[2] = 100;
|
||||
input[3] = 200;
|
||||
input[4] = 1234;
|
||||
input[5] = -1234;
|
||||
input[6] = 1234;
|
||||
input[7] = -1234;
|
||||
input[8] = 100;
|
||||
input[9] = 200;
|
||||
input[10] = 100;
|
||||
input[11] = 200;
|
||||
input[12] = 1000;
|
||||
input[13] = 2000;
|
||||
input[14] = 1000;
|
||||
input[15] = 2000;
|
||||
|
||||
alpha.r = 10;
|
||||
alpha.i = -10;
|
||||
|
||||
add_cpx_vector(input,(short*) &alpha,input,8);
|
||||
|
||||
for (i=0; i<16; i+=2)
|
||||
printf("output[%d] = %d + %d i\n",i,input[i],input[i+1]);
|
||||
|
||||
}
|
||||
|
||||
#endif //MAIN
|
||||
@@ -23,153 +23,6 @@
|
||||
#include "tools_defs.h"
|
||||
|
||||
|
||||
int add_vector16(short *x,
|
||||
short *y,
|
||||
short *z,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
__m128i *z_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
z_128 = (__m128i *)&z[0];
|
||||
|
||||
|
||||
for(i=0; i<(N>>5); i++) {
|
||||
/*
|
||||
printf("i = %d\n",i);
|
||||
print_shorts(x_128[0],"x[0]=");
|
||||
print_shorts(y_128[0],"y[0]=");
|
||||
*/
|
||||
|
||||
z_128[0] = _mm_adds_epi16(x_128[0],y_128[0]);
|
||||
/*
|
||||
print_shorts(z_128[0],"z[0]=");
|
||||
|
||||
print_shorts(x_128[1],"x[1]=");
|
||||
print_shorts(y_128[1],"y[1]=");
|
||||
*/
|
||||
|
||||
z_128[1] = _mm_adds_epi16(x_128[1],y_128[1]);
|
||||
/*
|
||||
print_shorts(z_128[1],"z[1]=");
|
||||
|
||||
print_shorts(x_128[2],"x[2]=");
|
||||
print_shorts(y_128[2],"y[2]=");
|
||||
*/
|
||||
|
||||
z_128[2] = _mm_adds_epi16(x_128[2],y_128[2]);
|
||||
/*
|
||||
print_shorts(z_128[2],"z[2]=");
|
||||
|
||||
print_shorts(x_128[3],"x[3]=");
|
||||
print_shorts(y_128[3],"y[3]=");
|
||||
*/
|
||||
|
||||
z_128[3] = _mm_adds_epi16(x_128[3],y_128[3]);
|
||||
/*
|
||||
print_shorts(z_128[3],"z[3]=");
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
x_128 +=4;
|
||||
y_128 +=4;
|
||||
z_128 +=4;
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
/*
|
||||
print_shorts64(__m64 x,char *s) {
|
||||
|
||||
printf("%s ",s);
|
||||
printf("%d %d %d %d\n",((short *)&x)[0],((short *)&x)[1],((short *)&x)[2],((short *)&x)[3]);
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
int add_vector16_64(short *x,
|
||||
short *y,
|
||||
short *z,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m64 *x_64;
|
||||
__m64 *y_64;
|
||||
__m64 *z_64;
|
||||
|
||||
x_64 = (__m64 *)&x[0];
|
||||
y_64 = (__m64 *)&y[0];
|
||||
z_64 = (__m64 *)&z[0];
|
||||
|
||||
|
||||
for(i=0; i<(N>>2); i++) {
|
||||
/*
|
||||
printf("i = %d\n",i);
|
||||
print_shorts64(x_64[i],"x[i]=");
|
||||
print_shorts64(y_64[i],"y[i]=");
|
||||
*/
|
||||
|
||||
z_64[i] = _mm_adds_pi16(x_64[i],y_64[i]);
|
||||
/*
|
||||
print_shorts64(z_64[i],"z[i]=");
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
return(0);
|
||||
}
|
||||
|
||||
int add_cpx_vector32(short *x,
|
||||
short *y,
|
||||
short *z,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
__m128i *z_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
z_128 = (__m128i *)&z[0];
|
||||
|
||||
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
z_128[0] = _mm_add_epi32(x_128[0],y_128[0]);
|
||||
z_128[1] = _mm_add_epi32(x_128[1],y_128[1]);
|
||||
z_128[2] = _mm_add_epi32(x_128[2],y_128[2]);
|
||||
z_128[3] = _mm_add_epi32(x_128[3],y_128[3]);
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128 +=4;
|
||||
z_128 +=4;
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
return(0);
|
||||
}
|
||||
|
||||
int32_t sub_cpx_vector16(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
@@ -201,73 +54,6 @@ int32_t sub_cpx_vector16(int16_t *x,
|
||||
|
||||
|
||||
|
||||
int add_real_vector64(short *x,
|
||||
short* y,
|
||||
short *z,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
__m128i *z_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
z_128 = (__m128i *)&z[0];
|
||||
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
z_128[0] = _mm_add_epi64(x_128[0], y_128[0]);
|
||||
z_128[1] = _mm_add_epi64(x_128[1], y_128[1]);
|
||||
z_128[2] = _mm_add_epi64(x_128[2], y_128[2]);
|
||||
z_128[3] = _mm_add_epi64(x_128[3], y_128[3]);
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128+=4;
|
||||
z_128+=4;
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
return(0);
|
||||
}
|
||||
|
||||
int sub_real_vector64(short *x,
|
||||
short* y,
|
||||
short *z,
|
||||
unsigned int N)
|
||||
{
|
||||
unsigned int i; // loop counter
|
||||
|
||||
__m128i *x_128;
|
||||
__m128i *y_128;
|
||||
__m128i *z_128;
|
||||
|
||||
x_128 = (__m128i *)&x[0];
|
||||
y_128 = (__m128i *)&y[0];
|
||||
z_128 = (__m128i *)&z[0];
|
||||
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
z_128[0] = _mm_sub_epi64(x_128[0], y_128[0]);
|
||||
z_128[1] = _mm_sub_epi64(x_128[1], y_128[1]);
|
||||
z_128[2] = _mm_sub_epi64(x_128[2], y_128[2]);
|
||||
z_128[3] = _mm_sub_epi64(x_128[3], y_128[3]);
|
||||
|
||||
|
||||
x_128+=4;
|
||||
y_128+=4;
|
||||
z_128+=4;
|
||||
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -280,7 +66,7 @@ main ()
|
||||
int i;
|
||||
c16_t alpha;
|
||||
|
||||
Zero_Buffer(output,256*2);
|
||||
memset(output,0,256*2);
|
||||
|
||||
input[0] = 100;
|
||||
input[1] = 200;
|
||||
|
||||
+114
-215
@@ -22,28 +22,6 @@
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "tools_defs.h"
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#define simd_q15_t __m128i
|
||||
#define simdshort_q15_t __m64
|
||||
#define shiftright_int16(a,shift) _mm_srai_epi16(a,shift)
|
||||
#define set1_int16(a) _mm_set1_epi16(a)
|
||||
#define mulhi_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),1)
|
||||
#define mulhi_s1_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),2)
|
||||
#define adds_int16(a,b) _mm_adds_epi16(a,b)
|
||||
#define mullo_int16(a,b) _mm_mullo_epi16(a,b)
|
||||
#elif defined(__arm__)
|
||||
#define simd_q15_t int16x8_t
|
||||
#define simdshort_q15_t int16x4_t
|
||||
#define shiftright_int16(a,shift) vshrq_n_s16(a,shift)
|
||||
#define set1_int16(a) vdupq_n_s16(a)
|
||||
#define mulhi_int16(a,b) vqdmulhq_s16(a,b)
|
||||
#define mulhi_s1_int16(a,b) vshlq_n_s16(vqdmulhq_s16(a,b),1)
|
||||
#define adds_int16(a,b) vqaddq_s16(a,b)
|
||||
#define mullo_int16(a,b) vmulq_s16(a,b)
|
||||
#define _mm_empty()
|
||||
#define _m_empty()
|
||||
#endif
|
||||
|
||||
|
||||
void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
int16_t alpha,
|
||||
@@ -111,216 +89,137 @@ void multadd_real_vector_complex_scalar(int16_t *x,
|
||||
}
|
||||
}
|
||||
|
||||
void multadd_real_four_symbols_vector_complex_scalar(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y)
|
||||
{
|
||||
|
||||
// do 8 multiplications at a time
|
||||
simd_q15_t alpha_r_128,alpha_i_128,yr,yi,*x_128=(simd_q15_t*)x;
|
||||
simd_q15_t y_128;
|
||||
y_128 = _mm_loadu_si128((simd_q15_t*)y);
|
||||
|
||||
alpha_r_128 = set1_int16(alpha[0]);
|
||||
alpha_i_128 = set1_int16(alpha[1]);
|
||||
|
||||
|
||||
yr = mulhi_s1_int16(alpha_r_128,x_128[0]);
|
||||
yi = mulhi_s1_int16(alpha_i_128,x_128[0]);
|
||||
y_128 = _mm_adds_epi16(y_128,_mm_unpacklo_epi16(yr,yi));
|
||||
y_128 = _mm_adds_epi16(y_128,_mm_unpackhi_epi16(yr,yi));
|
||||
|
||||
_mm_storeu_si128((simd_q15_t*)y, y_128);
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
}
|
||||
#ifdef __AVX2__
|
||||
void rotate_cpx_vector(c16_t *x,
|
||||
c16_t *alpha,
|
||||
c16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift)
|
||||
c16_t *alpha,
|
||||
c16_t *y,
|
||||
uint32_t N,
|
||||
uint16_t output_shift)
|
||||
{
|
||||
// Multiply elementwise two complex vectors of N elements
|
||||
// x - input 1 in the format |Re0 Im0 |,......,|Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// alpha - input 2 in the format |Re0 Im0|
|
||||
// We assume x2 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// y - output in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0)
|
||||
// WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
|
||||
simd_q15_t *y_128,alpha_128;
|
||||
int32_t *xd=(int32_t *)x;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i shift = _mm_cvtsi32_si128(output_shift);
|
||||
register simd_q15_t m0,m1,m2,m3;
|
||||
|
||||
((int16_t *)&alpha_128)[0] = alpha->r;
|
||||
((int16_t *)&alpha_128)[1] = -alpha->i;
|
||||
((int16_t *)&alpha_128)[2] = alpha->i;
|
||||
((int16_t *)&alpha_128)[3] = alpha->r;
|
||||
((int16_t *)&alpha_128)[4] = alpha->r;
|
||||
((int16_t *)&alpha_128)[5] = -alpha->i;
|
||||
((int16_t *)&alpha_128)[6] = alpha->i;
|
||||
((int16_t *)&alpha_128)[7] = alpha->r;
|
||||
#elif defined(__arm__)
|
||||
int32x4_t shift;
|
||||
int32x4_t ab_re0,ab_re1,ab_im0,ab_im1,re32,im32;
|
||||
int16_t reflip[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
int32x4x2_t xtmp;
|
||||
|
||||
((int16_t *)&alpha_128)[0] = alpha->r;
|
||||
((int16_t *)&alpha_128)[1] = alpha->i;
|
||||
((int16_t *)&alpha_128)[2] = alpha->r;
|
||||
((int16_t *)&alpha_128)[3] = alpha->i;
|
||||
((int16_t *)&alpha_128)[4] = alpha->r;
|
||||
((int16_t *)&alpha_128)[5] = alpha->i;
|
||||
((int16_t *)&alpha_128)[6] = alpha->r;
|
||||
((int16_t *)&alpha_128)[7] = alpha->i;
|
||||
int16x8_t bflip = vrev32q_s16(alpha_128);
|
||||
int16x8_t bconj = vmulq_s16(alpha_128,*(int16x8_t *)reflip);
|
||||
shift = vdupq_n_s32(-output_shift);
|
||||
// multiply a complex vector with a complex value (alpha)
|
||||
// stores result in y
|
||||
// N is the number of complex numbers
|
||||
// output_shift reduces the result of the multiplication by this number of bits
|
||||
//AssertFatal(N%8==0, "To be developped");
|
||||
#ifdef __AVX2__
|
||||
if ( (intptr_t)x%32 == 0 && !(intptr_t)y%32 == 0 && __builtin_cpu_supports("avx2")) {
|
||||
// output is 32 bytes aligned, but not the input
|
||||
|
||||
const c16_t for_re={alpha->r, -alpha->i};
|
||||
__m256i const alpha_for_real = _mm256_set1_epi32(*(uint32_t*)&for_re);
|
||||
const c16_t for_im={alpha->i, alpha->r};
|
||||
__m256i const alpha_for_im= _mm256_set1_epi32(*(uint32_t*)&for_im);
|
||||
__m256i const perm_mask =
|
||||
_mm256_set_epi8(31,30,23,22,29,28,21,20,27,26,19,18,25,24,17,16,
|
||||
15,14,7,6,13,12,5,4,11,10,3,2,9,8,1,0);
|
||||
__m256i* xd= (__m256i*)x;
|
||||
const __m256i *end=xd+N/8;
|
||||
for( __m256i* yd = (__m256i *)y; xd<end ; yd++, xd++) {
|
||||
const __m256i xre = _mm256_srai_epi32(_mm256_madd_epi16(*xd,alpha_for_real),
|
||||
output_shift);
|
||||
const __m256i xim = _mm256_srai_epi32(_mm256_madd_epi16(*xd,alpha_for_im),
|
||||
output_shift);
|
||||
// a bit faster than unpacklo+unpackhi+packs
|
||||
const __m256i tmp=_mm256_packs_epi32(xre,xim);
|
||||
*yd=_mm256_shuffle_epi8(tmp,perm_mask);
|
||||
}
|
||||
c16_t* alpha16=(c16_t*) alpha, *yLast;
|
||||
yLast=((c16_t*)y)+(N/8)*8;
|
||||
for (c16_t* xTail=(c16_t*) end;
|
||||
xTail<((c16_t*) x)+N;
|
||||
xTail++, yLast++) {
|
||||
*yLast=c16mulShift(*xTail,*alpha16,output_shift);
|
||||
}
|
||||
} else {
|
||||
#endif
|
||||
y_128 = (simd_q15_t *) y;
|
||||
// Multiply elementwise two complex vectors of N elements
|
||||
// x - input 1 in the format |Re0 Im0 |,......,|Re(N-1) Im(N-1)|
|
||||
// We assume x1 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// alpha - input 2 in the format |Re0 Im0|
|
||||
// We assume x2 with a dynamic of 15 bit maximum
|
||||
//
|
||||
// y - output in the format |Re0 Im0|,......,|Re(N-1) Im(N-1)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
// log2_amp - increase the output amplitude by a factor 2^log2_amp (default is 0)
|
||||
// WARNING: log2_amp>0 can cause overflow!!
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
|
||||
for(i=0; i<N>>2; i++) {
|
||||
simd_q15_t *y_128,alpha_128;
|
||||
int32_t *xd=(int32_t *)x;
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
m0 = _mm_setr_epi32(xd[0],xd[0],xd[1],xd[1]);
|
||||
m1 = _mm_setr_epi32(xd[2],xd[2],xd[3],xd[3]);
|
||||
m2 = _mm_madd_epi16(m0,alpha_128); //complex multiply. result is 32bit [Re Im Re Im]
|
||||
m3 = _mm_madd_epi16(m1,alpha_128); //complex multiply. result is 32bit [Re Im Re Im]
|
||||
m2 = _mm_sra_epi32(m2,shift); // shift right by shift in order to compensate for the input amplitude
|
||||
m3 = _mm_sra_epi32(m3,shift); // shift right by shift in order to compensate for the input amplitude
|
||||
__m128i shift = _mm_cvtsi32_si128(output_shift);
|
||||
register simd_q15_t m0,m1,m2,m3;
|
||||
|
||||
y_128[0] = _mm_packs_epi32(m2,m3); // pack in 16bit integers with saturation [re im re im re im re im]
|
||||
//print_ints("y_128[0]=", &y_128[0]);
|
||||
((int16_t *)&alpha_128)[0] = alpha->r;
|
||||
((int16_t *)&alpha_128)[1] = -alpha->i;
|
||||
((int16_t *)&alpha_128)[2] = alpha->i;
|
||||
((int16_t *)&alpha_128)[3] = alpha->r;
|
||||
((int16_t *)&alpha_128)[4] = alpha->r;
|
||||
((int16_t *)&alpha_128)[5] = -alpha->i;
|
||||
((int16_t *)&alpha_128)[6] = alpha->i;
|
||||
((int16_t *)&alpha_128)[7] = alpha->r;
|
||||
#elif defined(__arm__)
|
||||
int32x4_t shift;
|
||||
int32x4_t ab_re0,ab_re1,ab_im0,ab_im1,re32,im32;
|
||||
int16_t reflip[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
int32x4x2_t xtmp;
|
||||
|
||||
((int16_t *)&alpha_128)[0] = alpha->r;
|
||||
((int16_t *)&alpha_128)[1] = alpha->i;
|
||||
((int16_t *)&alpha_128)[2] = alpha->r;
|
||||
((int16_t *)&alpha_128)[3] = alpha->i;
|
||||
((int16_t *)&alpha_128)[4] = alpha->r;
|
||||
((int16_t *)&alpha_128)[5] = alpha->i;
|
||||
((int16_t *)&alpha_128)[6] = alpha->r;
|
||||
((int16_t *)&alpha_128)[7] = alpha->i;
|
||||
int16x8_t bflip = vrev32q_s16(alpha_128);
|
||||
int16x8_t bconj = vmulq_s16(alpha_128,*(int16x8_t *)reflip);
|
||||
shift = vdupq_n_s32(-output_shift);
|
||||
#endif
|
||||
y_128 = (simd_q15_t *) y;
|
||||
|
||||
|
||||
for(i=0; i<N>>2; i++) {
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
m0 = _mm_setr_epi32(xd[0],xd[0],xd[1],xd[1]);
|
||||
m1 = _mm_setr_epi32(xd[2],xd[2],xd[3],xd[3]);
|
||||
m2 = _mm_madd_epi16(m0,alpha_128); //complex multiply. result is 32bit [Re Im Re Im]
|
||||
m3 = _mm_madd_epi16(m1,alpha_128); //complex multiply. result is 32bit [Re Im Re Im]
|
||||
m2 = _mm_sra_epi32(m2,shift); // shift right by shift in order to compensate for the input amplitude
|
||||
m3 = _mm_sra_epi32(m3,shift); // shift right by shift in order to compensate for the input amplitude
|
||||
|
||||
y_128[0] = _mm_packs_epi32(m2,m3); // pack in 16bit integers with saturation [re im re im re im re im]
|
||||
//print_ints("y_128[0]=", &y_128[0]);
|
||||
#elif defined(__arm__)
|
||||
|
||||
ab_re0 = vmull_s16(((int16x4_t*)xd)[0],((int16x4_t*)&bconj)[0]);
|
||||
ab_re1 = vmull_s16(((int16x4_t*)xd)[1],((int16x4_t*)&bconj)[1]);
|
||||
ab_im0 = vmull_s16(((int16x4_t*)xd)[0],((int16x4_t*)&bflip)[0]);
|
||||
ab_im1 = vmull_s16(((int16x4_t*)xd)[1],((int16x4_t*)&bflip)[1]);
|
||||
re32 = vshlq_s32(vcombine_s32(vpadd_s32(((int32x2_t*)&ab_re0)[0],((int32x2_t*)&ab_re0)[1]),
|
||||
vpadd_s32(((int32x2_t*)&ab_re1)[0],((int32x2_t*)&ab_re1)[1])),
|
||||
shift);
|
||||
im32 = vshlq_s32(vcombine_s32(vpadd_s32(((int32x2_t*)&ab_im0)[0],((int32x2_t*)&ab_im0)[1]),
|
||||
vpadd_s32(((int32x2_t*)&ab_im1)[0],((int32x2_t*)&ab_im1)[1])),
|
||||
shift);
|
||||
ab_re0 = vmull_s16(((int16x4_t*)xd)[0],((int16x4_t*)&bconj)[0]);
|
||||
ab_re1 = vmull_s16(((int16x4_t*)xd)[1],((int16x4_t*)&bconj)[1]);
|
||||
ab_im0 = vmull_s16(((int16x4_t*)xd)[0],((int16x4_t*)&bflip)[0]);
|
||||
ab_im1 = vmull_s16(((int16x4_t*)xd)[1],((int16x4_t*)&bflip)[1]);
|
||||
re32 = vshlq_s32(vcombine_s32(vpadd_s32(((int32x2_t*)&ab_re0)[0],((int32x2_t*)&ab_re0)[1]),
|
||||
vpadd_s32(((int32x2_t*)&ab_re1)[0],((int32x2_t*)&ab_re1)[1])),
|
||||
shift);
|
||||
im32 = vshlq_s32(vcombine_s32(vpadd_s32(((int32x2_t*)&ab_im0)[0],((int32x2_t*)&ab_im0)[1]),
|
||||
vpadd_s32(((int32x2_t*)&ab_im1)[0],((int32x2_t*)&ab_im1)[1])),
|
||||
shift);
|
||||
|
||||
xtmp = vzipq_s32(re32,im32);
|
||||
xtmp = vzipq_s32(re32,im32);
|
||||
|
||||
y_128[0] = vcombine_s16(vmovn_s32(xtmp.val[0]),vmovn_s32(xtmp.val[1]));
|
||||
y_128[0] = vcombine_s16(vmovn_s32(xtmp.val[0]),vmovn_s32(xtmp.val[1]));
|
||||
|
||||
#endif
|
||||
|
||||
xd+=4;
|
||||
y_128+=1;
|
||||
xd+=4;
|
||||
y_128+=1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
int mult_vector32_scalar(int16_t *x1,
|
||||
int x2,
|
||||
int16_t *y,
|
||||
uint32_t N)
|
||||
|
||||
{
|
||||
// Multiply elementwise two real vectors of N elements
|
||||
// x1 - input 1 in the format |Re(0) xxx Re(1) xxx|,......,|Re(N-2) xxx Re(N-1) xxx|
|
||||
// We assume x1 with a dinamic of 31 bit maximum
|
||||
//
|
||||
// x1 - input 2
|
||||
//
|
||||
// y - output in the format |Re0 (64bit) |,......,|Re(N-1) (64bit)|
|
||||
//
|
||||
// N - the size f the vectors (this function does N cpx mpy. WARNING: N>=4;
|
||||
//
|
||||
|
||||
uint32_t i; // loop counter
|
||||
|
||||
__m128i *x1_128;
|
||||
__m128i x2_128;
|
||||
__m128i *y_128;
|
||||
|
||||
|
||||
x1_128 = (__m128i *)&x1[0];
|
||||
x2_128 = _mm_setr_epi32(x2,0,x2,0);
|
||||
y_128 = (__m128i *)&y[0];
|
||||
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
y_128[0] = _mm_mul_epu32(x1_128[0],x2_128);
|
||||
y_128[1] = _mm_mul_epu32(x1_128[1],x2_128);
|
||||
y_128[2] = _mm_mul_epu32(x1_128[2],x2_128);
|
||||
y_128[3] = _mm_mul_epu32(x1_128[3],x2_128);
|
||||
|
||||
|
||||
x1_128+=4;
|
||||
y_128 +=4;
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
*/
|
||||
|
||||
int complex_conjugate(int16_t *x1,
|
||||
int16_t *y,
|
||||
uint32_t N)
|
||||
|
||||
{
|
||||
uint32_t i; // loop counter
|
||||
|
||||
simd_q15_t *x1_128;
|
||||
simd_q15_t *y_128;
|
||||
int16_t x2[8] __attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
simd_q15_t *x2_128 = (simd_q15_t*)&x2[0];
|
||||
x1_128 = (simd_q15_t *)&x1[0];
|
||||
y_128 = (simd_q15_t *)&y[0];
|
||||
|
||||
|
||||
// we compute 4 cpx multiply for each loop
|
||||
for(i=0; i<(N>>3); i++) {
|
||||
y_128[0] = mullo_int16(x1_128[0],*x2_128);
|
||||
y_128[1] = mullo_int16(x1_128[1],*x2_128);
|
||||
y_128[2] = mullo_int16(x1_128[2],*x2_128);
|
||||
y_128[3] = mullo_int16(x1_128[3],*x2_128);
|
||||
|
||||
|
||||
x1_128+=4;
|
||||
y_128 +=4;
|
||||
}
|
||||
|
||||
|
||||
_mm_empty();
|
||||
_m_empty();
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
#ifdef MAIN
|
||||
#define L 8
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "PHY/sse_intrin.h"
|
||||
|
||||
void Zero_Buffer(void *buf,unsigned int length)
|
||||
{
|
||||
// zeroes the mmx_t buffer 'buf' starting from buf[0] to buf[length-1] in bytes
|
||||
int i;
|
||||
register __m64 mm0;
|
||||
__m64 *mbuf = (__m64 *)buf;
|
||||
|
||||
// length>>=3; // put length in quadwords
|
||||
mm0 = _m_pxor(mm0,mm0); // clear the register
|
||||
|
||||
for(i=0; i<length>>3; i++) // for each i
|
||||
mbuf[i] = mm0; // put 0 in buf[i]
|
||||
|
||||
_mm_empty();
|
||||
}
|
||||
|
||||
void mmxcopy(void *dest,void *src,int size)
|
||||
{
|
||||
|
||||
// copy size bytes from src to dest
|
||||
register int i;
|
||||
register __m64 mm0;
|
||||
__m64 *mmsrc = (__m64 *)src, *mmdest= (__m64 *)dest;
|
||||
|
||||
|
||||
|
||||
for (i=0; i<size>>3; i++) {
|
||||
mm0 = mmsrc[i];
|
||||
mmdest[i] = mm0;
|
||||
}
|
||||
|
||||
_mm_empty();
|
||||
}
|
||||
|
||||
void Zero_Buffer_nommx(void *buf,unsigned int length)
|
||||
{
|
||||
|
||||
int i;
|
||||
|
||||
for (i=0; i<length>>2; i++)
|
||||
((int *)buf)[i] = 0;
|
||||
|
||||
}
|
||||
|
||||
@@ -2575,7 +2575,6 @@ const static int16_t tw64c[96] __attribute__((aligned(32))) = {
|
||||
#define simd_q15_t __m128i
|
||||
#define simdshort_q15_t __m64
|
||||
#define shiftright_int16(a,shift) _mm_srai_epi16(a,shift)
|
||||
#define set1_int16(a) _mm_set1_epi16(a);
|
||||
#define mulhi_int16(a,b) _mm_mulhrs_epi16 (a,b)
|
||||
#ifdef __AVX2__
|
||||
#define simd256_q15_t __m256i
|
||||
|
||||
+206
-87
@@ -29,46 +29,199 @@
|
||||
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
#include "PHY/sse_intrin.h"
|
||||
#include "common/utils/assertions.h"
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
#define simd_q15_t __m128i
|
||||
#define simdshort_q15_t __m64
|
||||
#define shiftright_int16(a,shift) _mm_srai_epi16(a,shift)
|
||||
#define set1_int16(a) _mm_set1_epi16(a)
|
||||
#define mulhi_int16(a,b) _mm_mulhrs_epi16 (a,b)
|
||||
#define mulhi_s1_int16(a,b) _mm_slli_epi16(_mm_mulhi_epi16(a,b),2)
|
||||
#define adds_int16(a,b) _mm_adds_epi16(a,b)
|
||||
#define mullo_int16(a,b) _mm_mullo_epi16(a,b)
|
||||
#elif defined(__arm__)
|
||||
#define simd_q15_t int16x8_t
|
||||
#define simdshort_q15_t int16x4_t
|
||||
#define shiftright_int16(a,shift) vshrq_n_s16(a,shift)
|
||||
#define set1_int16(a) vdupq_n_s16(a)
|
||||
#define mulhi_int16(a,b) vqdmulhq_s16(a,b)
|
||||
#define mulhi_s1_int16(a,b) vshlq_n_s16(vqdmulhq_s16(a,b),1)
|
||||
#define adds_int16(a,b) vqaddq_s16(a,b)
|
||||
#define mullo_int16(a,b) vmulq_s16(a,b)
|
||||
#define _mm_empty()
|
||||
#define _m_empty()
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define CEILIDIV(a,b) ((a+b-1)/b)
|
||||
#define ROUNDIDIV(a,b) (((a<<1)+b)/(b<<1))
|
||||
|
||||
typedef struct complexd {
|
||||
double r;
|
||||
double i;
|
||||
} cd_t;
|
||||
typedef struct complexd {
|
||||
double r;
|
||||
double i;
|
||||
} cd_t;
|
||||
|
||||
typedef struct complexf {
|
||||
float r;
|
||||
float i;
|
||||
} cf_t;
|
||||
typedef struct complexf {
|
||||
float r;
|
||||
float i;
|
||||
} cf_t;
|
||||
|
||||
typedef struct complex16 {
|
||||
int16_t r;
|
||||
int16_t i;
|
||||
} c16_t;
|
||||
typedef struct complex16 {
|
||||
int16_t r;
|
||||
int16_t i;
|
||||
} c16_t;
|
||||
|
||||
typedef struct complex32 {
|
||||
int32_t r;
|
||||
int32_t i;
|
||||
} c32_t;
|
||||
typedef struct complex32 {
|
||||
int32_t r;
|
||||
int32_t i;
|
||||
} c32_t;
|
||||
|
||||
typedef struct complex64 {
|
||||
int64_t r;
|
||||
int64_t i;
|
||||
} c64_t;
|
||||
|
||||
#define squaredMod(a) ((a).r*(a).r + (a).i*(a).i)
|
||||
#define csum(res, i1, i2) (res).r = (i1).r + (i2).r ; (res).i = (i1).i + (i2).i
|
||||
|
||||
__attribute__((always_inline)) inline c16_t c16mulShift(const c16_t a, const c16_t b, const int Shift) {
|
||||
return (c16_t) {
|
||||
.r = (int16_t)((a.r * b.r - a.i * b.i) >> Shift),
|
||||
.i = (int16_t)((a.r * b.i + a.i * b.r) >> Shift)
|
||||
};
|
||||
}
|
||||
|
||||
typedef struct complex64 {
|
||||
int64_t r;
|
||||
int64_t i;
|
||||
} c64_t;
|
||||
__attribute__((always_inline)) inline c16_t c16divShift(const c16_t a, const c16_t b, const int Shift) {
|
||||
return (c16_t) {
|
||||
.r = (int16_t)((a.r * b.r + a.i * b.i) >> Shift),
|
||||
.i = (int16_t)((a.r * b.i - a.i * b.r) >> Shift)
|
||||
};
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) inline c16_t c16maddShift(const c16_t a, const c16_t b, c16_t c, const int Shift) {
|
||||
return (c16_t) {
|
||||
.r = (int16_t)(((a.r * b.r - a.i * b.i ) >> Shift) + c.r),
|
||||
.i = (int16_t)(((a.r * b.i + a.i * b.r ) >> Shift) + c.i)
|
||||
};
|
||||
}
|
||||
|
||||
#define squaredMod(a) ((a).r*(a).r+(a).i*(a).i)
|
||||
#define csum(res, i1, i2) (res).r=(i1).r+(i2).r ; (res).i=(i1).i+(i2).i
|
||||
__attribute__((always_inline)) inline c32_t c32x16mulShift(const c16_t a, const c16_t b, const int Shift) {
|
||||
return (c32_t) {
|
||||
.r = (a.r * b.r - a.i * b.i) >> Shift,
|
||||
.i = (a.r * b.i + a.i * b.r) >> Shift
|
||||
};
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) inline c32_t c32x16maddShift(const c16_t a, const c16_t b, const c32_t c, const int Shift) {
|
||||
return (c32_t) {
|
||||
.r = ((a.r * b.r - a.i * b.i) >> Shift) + c.r,
|
||||
.i = ((a.r * b.i + a.i * b.r) >> Shift) + c.i
|
||||
};
|
||||
}
|
||||
|
||||
__attribute__((always_inline)) inline c16_t c16x32div(const c32_t a, const int div) {
|
||||
return (c16_t) {
|
||||
.r = (int16_t)(a.r / div),
|
||||
.i = (int16_t)(a.i / div)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// On N complex numbers
|
||||
// y.r += (x * alpha.r) >> 14
|
||||
// y.i += (x * alpha.i) >> 14
|
||||
// See regular C implementation at the end
|
||||
__attribute__((always_inline)) inline void c16multaddVectRealComplex(const int16_t *x,
|
||||
const c16_t *alpha,
|
||||
c16_t *y,
|
||||
const int N) {
|
||||
#ifdef __AVX2__
|
||||
const int8_t makePairs[32] __attribute__((aligned(32)))={
|
||||
0,1,0+16,1+16,
|
||||
2,3,2+16,3+16,
|
||||
4,5,4+16,5+16,
|
||||
6,7,6+16,7+16,
|
||||
8,9,8+16,9+16,
|
||||
10,11,10+16,11+16,
|
||||
12,13,12+16,13+16,
|
||||
14,15,14+16,15+16};
|
||||
|
||||
__m256i alpha256= _mm256_set1_epi32(*(int32_t *)alpha);
|
||||
__m128i *x128=(__m128i *)x;
|
||||
__m128i *y128=(__m128i *)y;
|
||||
AssertFatal(N%8==0,"Not implemented\n");
|
||||
for (int i=0; i<N/8; i++) {
|
||||
const __m256i xduplicate=_mm256_broadcastsi128_si256(*x128);
|
||||
const __m256i x_duplicate_ordered=_mm256_shuffle_epi8(xduplicate,*(__m256i*)makePairs);
|
||||
const __m256i x_mul_alpha_shift15 =_mm256_mulhrs_epi16(alpha256, x_duplicate_ordered);
|
||||
// Existing multiplication normalization is weird, constant table in alpha need to be doubled
|
||||
const __m256i x_mul_alpha_x2= _mm256_adds_epi16(x_mul_alpha_shift15,x_mul_alpha_shift15);
|
||||
*y128= _mm_adds_epi16(_mm256_extracti128_si256(x_mul_alpha_x2,0),*y128);
|
||||
y128++;
|
||||
*y128= _mm_adds_epi16(_mm256_extracti128_si256(x_mul_alpha_x2,1),*y128);
|
||||
y128++;
|
||||
x128++;
|
||||
}
|
||||
|
||||
#elif defined(__x86_64__) || defined(__i386__) || defined(__arm__)
|
||||
uint32_t i;
|
||||
|
||||
// do 8 multiplications at a time
|
||||
simd_q15_t alpha_r_128,alpha_i_128,yr,yi,*x_128=(simd_q15_t*)x,*y_128=(simd_q15_t*)y;
|
||||
int j;
|
||||
|
||||
// printf("alpha = %d,%d\n",alpha[0],alpha[1]);
|
||||
alpha_r_128 = set1_int16(alpha->r);
|
||||
alpha_i_128 = set1_int16(alpha->i);
|
||||
|
||||
j=0;
|
||||
|
||||
for (i=0; i<N>>3; i++) {
|
||||
|
||||
yr = mulhi_s1_int16(alpha_r_128,x_128[i]);
|
||||
yi = mulhi_s1_int16(alpha_i_128,x_128[i]);
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
y_128[j] = _mm_adds_epi16(y_128[j],_mm_unpacklo_epi16(yr,yi));
|
||||
j++;
|
||||
y_128[j] = _mm_adds_epi16(y_128[j],_mm_unpackhi_epi16(yr,yi));
|
||||
j++;
|
||||
#elif defined(__arm__)
|
||||
int16x8x2_t yint;
|
||||
yint = vzipq_s16(yr,yi);
|
||||
y_128[j] = adds_int16(y_128[j],yint.val[0]);
|
||||
j++;
|
||||
y_128[j] = adds_int16(y_128[j],yint.val[1]);
|
||||
|
||||
j++;
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
for (int i=0; i<N; i++) {
|
||||
int tmpr=y[i].r+((x[i]*alpha->r)>>14);
|
||||
if (tmpr>INT16_MAX)
|
||||
tmpr=INT16_MAX;
|
||||
if (tmpr<INT16_MIN)
|
||||
tmpr=INT16_MIN;
|
||||
int tmpi=y[i].i+((x[i]*alpha->i)>>14);
|
||||
if (tmpi>INT16_MAX)
|
||||
tmpi=INT16_MAX;
|
||||
if (tmpi<INT16_MIN)
|
||||
tmpi=INT16_MIN;
|
||||
y[i].r=(int16_t)tmpr;
|
||||
y[i].i=(int16_t)tmpi;
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
//cmult_sv.h
|
||||
|
||||
/*!\fn void multadd_real_vector_complex_scalar(int16_t *x,int16_t *alpha,int16_t *y,uint32_t N)
|
||||
@@ -85,10 +238,29 @@ void multadd_real_vector_complex_scalar(int16_t *x,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
void multadd_real_four_symbols_vector_complex_scalar(int16_t *x,
|
||||
int16_t *alpha,
|
||||
int16_t *y);
|
||||
__attribute__((always_inline)) inline void multadd_real_four_symbols_vector_complex_scalar(int16_t *x,
|
||||
c16_t *alpha,
|
||||
c16_t *y)
|
||||
{
|
||||
|
||||
// do 8 multiplications at a time
|
||||
simd_q15_t alpha_r_128,alpha_i_128,yr,yi,*x_128=(simd_q15_t*)x;
|
||||
simd_q15_t y_128;
|
||||
y_128 = _mm_loadu_si128((simd_q15_t*)y);
|
||||
|
||||
alpha_r_128 = set1_int16(alpha->r);
|
||||
alpha_i_128 = set1_int16(alpha->i);
|
||||
|
||||
|
||||
yr = mulhi_s1_int16(alpha_r_128,x_128[0]);
|
||||
yi = mulhi_s1_int16(alpha_i_128,x_128[0]);
|
||||
y_128 = _mm_adds_epi16(y_128,_mm_unpacklo_epi16(yr,yi));
|
||||
y_128 = _mm_adds_epi16(y_128,_mm_unpackhi_epi16(yr,yi));
|
||||
|
||||
_mm_storeu_si128((simd_q15_t*)y, y_128);
|
||||
|
||||
}
|
||||
|
||||
/*!\fn void multadd_complex_vector_real_scalar(int16_t *x,int16_t alpha,int16_t *y,uint8_t zero_flag,uint32_t N)
|
||||
This function performs componentwise multiplication and accumulation of a real scalar and a complex vector.
|
||||
@param x Vector input (Q1.15) in the format |Re0 Im0|Re1 Im 1| ...
|
||||
@@ -114,7 +286,7 @@ void multadd_complex_vector_real_scalar(int16_t *x,
|
||||
|
||||
//cmult_vv.c
|
||||
/*!
|
||||
Multiply elementwise the complex conjugate of x1 with x2.
|
||||
Multiply elementwise the complex conjugate of x1 with x2.
|
||||
@param x1 - input 1 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
We assume x1 with a dinamic of 15 bit maximum
|
||||
@param x2 - input 2 in the format |Re0 Im0 Re1 Im1|,......,|Re(N-2) Im(N-2) Re(N-1) Im(N-1)|
|
||||
@@ -364,8 +536,8 @@ dft_size_idx_t get_dft(int ofdm_symbol_size)
|
||||
printf("function get_dft : unsupported ofdm symbol size \n");
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function;
|
||||
}
|
||||
return DFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function;
|
||||
}
|
||||
|
||||
typedef enum idft_size_idx {
|
||||
@@ -448,8 +620,8 @@ idft_size_idx_t get_idft(int ofdm_symbol_size)
|
||||
printf("function get_idft : unsupported ofdm symbol size \n");
|
||||
assert(0);
|
||||
break;
|
||||
}
|
||||
return IDFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function
|
||||
}
|
||||
return IDFT_SIZE_IDXTABLESIZE; // never reached and will trigger assertion in idft function
|
||||
}
|
||||
|
||||
|
||||
@@ -491,58 +663,6 @@ int32_t sub_cpx_vector16(int16_t *x,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t add_cpx_vector32(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t add_real_vector64(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t sub_real_vector64(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t add_real_vector64_scalar(int16_t *x,
|
||||
long long int a,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
/*!\fn int32_t add_vector16(int16_t *x,int16_t *y,int16_t *z,uint32_t N)
|
||||
This function performs componentwise addition of two vectors with Q1.15 components.
|
||||
@param x Vector input (Q1.15)
|
||||
@param y Scalar input (Q1.15)
|
||||
@param z Scalar output (Q1.15)
|
||||
@param N Length of x WARNING: N must be a multiple of 32
|
||||
|
||||
The function implemented is : \f$\mathbf{z} = \mathbf{x} + \mathbf{y}\f$
|
||||
*/
|
||||
int32_t add_vector16(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t add_vector16_64(int16_t *x,
|
||||
int16_t *y,
|
||||
int16_t *z,
|
||||
uint32_t N);
|
||||
|
||||
int32_t complex_conjugate(int16_t *x1,
|
||||
int16_t *y,
|
||||
uint32_t N);
|
||||
|
||||
void bit8_txmux(int32_t length,int32_t offset);
|
||||
|
||||
void bit8_rxdemux(int32_t length,int32_t offset);
|
||||
|
||||
void Zero_Buffer(void *,uint32_t);
|
||||
void Zero_Buffer_nommx(void *buf,uint32_t length);
|
||||
|
||||
void mmxcopy(void *dest,void *src,int size);
|
||||
|
||||
/*!\fn int32_t signal_energy(int *,uint32_t);
|
||||
\brief Computes the signal energy per subcarrier
|
||||
*/
|
||||
@@ -631,7 +751,6 @@ int64_t dot_product64(int16_t *x,
|
||||
|
||||
double interp(double x, double *xs, double *ys, int count);
|
||||
|
||||
int write_output(const char *fname,const char *vname,void *data,int length,int dec,char format);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -181,9 +181,6 @@ typedef struct {
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// \brief ?.
|
||||
/// first index: ? [0..1023] (hard coded)
|
||||
int16_t *prachF;
|
||||
/// \brief ?.
|
||||
/// first index: ce_level [0..3]
|
||||
/// second index: rx antenna [0..63] (hard coded) \note Hard coded array size indexed by \c nb_antennas_rx.
|
||||
|
||||
@@ -807,7 +807,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
double N0;
|
||||
|
||||
unsigned char first_run_I0_measurements;
|
||||
|
||||
int ldpc_offload_flag;
|
||||
|
||||
unsigned char is_secondary_gNB; // primary by default
|
||||
unsigned char is_init_sync; /// Flag to tell if initial synchronization is performed. This affects how often the secondary eNB will listen to the PSS from the primary system.
|
||||
@@ -894,7 +894,6 @@ typedef struct PHY_VARS_gNB_s {
|
||||
notifiedFIFO_t resp_RU_tx;
|
||||
tpool_t threadPool;
|
||||
int nbDecode;
|
||||
uint8_t thread_pool_size;
|
||||
int number_of_nr_dlsch_max;
|
||||
int number_of_nr_ulsch_max;
|
||||
void * scopeData;
|
||||
|
||||
@@ -49,7 +49,7 @@ extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
|
||||
|
||||
void prach_procedures(PHY_VARS_eNB *eNB,
|
||||
int br_flag ) {
|
||||
uint16_t max_preamble[4],max_preamble_energy[4],max_preamble_delay[4],avg_preamble_energy[4];
|
||||
uint16_t max_preamble[4]={0},max_preamble_energy[4]={0},max_preamble_delay[4]={0},avg_preamble_energy[4]={0};
|
||||
uint16_t i;
|
||||
int frame,subframe;
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ void phy_procedures_gNB_TX(processingData_L1tx_t *msgTx,
|
||||
|
||||
//apply the OFDM symbol rotation here
|
||||
for (aa=0; aa<cfg->carrier_config.num_tx_ant.value; aa++) {
|
||||
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
|
||||
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[aa][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
|
||||
@@ -296,7 +296,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
uint8_t l, number_dmrs_symbols = 0;
|
||||
uint32_t G;
|
||||
uint16_t start_symbol, number_symbols, nb_re_dmrs;
|
||||
|
||||
uint8_t enable_ldpc_offload = gNB->ldpc_offload_flag;
|
||||
start_symbol = pusch_pdu->start_symbol_index;
|
||||
number_symbols = pusch_pdu->nr_of_symbols;
|
||||
|
||||
@@ -361,14 +361,15 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
slot_rx,
|
||||
harq_pid,
|
||||
G);
|
||||
|
||||
while (gNB->nbDecode > 0) {
|
||||
notifiedFIFO_elt_t *req = pullTpool(&gNB->respDecode, &gNB->threadPool);
|
||||
if (req == NULL)
|
||||
break; // Tpool has been stopped
|
||||
nr_postDecode(gNB, req);
|
||||
delNotifiedFIFO_elt(req);
|
||||
}
|
||||
if (enable_ldpc_offload ==0) {
|
||||
while (gNB->nbDecode > 0) {
|
||||
notifiedFIFO_elt_t *req = pullTpool(&gNB->respDecode, &gNB->threadPool);
|
||||
if (req == NULL)
|
||||
break; // Tpool has been stopped
|
||||
nr_postDecode(gNB, req);
|
||||
delNotifiedFIFO_elt(req);
|
||||
}
|
||||
}
|
||||
stop_meas(&gNB->ulsch_decoding_stats);
|
||||
}
|
||||
|
||||
@@ -493,6 +494,7 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
gNB->UL_INFO.rx_ind.number_of_pdus++;
|
||||
|
||||
pthread_mutex_unlock(&gNB->UL_INFO_mutex);
|
||||
|
||||
}
|
||||
|
||||
// Function to fill UL RB mask to be used for N0 measurements
|
||||
@@ -779,8 +781,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot),
|
||||
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres);
|
||||
|
||||
|
||||
|
||||
gNB->pusch_vars[ULSCH_id]->DTX=0;
|
||||
}
|
||||
stop_meas(&gNB->rx_pusch_stats);
|
||||
|
||||
@@ -126,7 +126,6 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
uint8_t dlsch_parallel,
|
||||
NR_UE_PDCCH_CONFIG *phy_pdcch_config,
|
||||
notifiedFIFO_t *txFifo);
|
||||
|
||||
|
||||
@@ -1325,7 +1325,6 @@ void *UE_thread_slot1_dl_processing(void *arg) {
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
uint8_t dlsch_parallel,
|
||||
NR_UE_PDCCH_CONFIG *phy_pdcch_config,
|
||||
notifiedFIFO_t *txFifo) {
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
|
||||
|
||||
//#define DEBUG_NR_DLSCHSIM
|
||||
@@ -65,7 +66,8 @@ double cpuf;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
|
||||
const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
// needed for some functions
|
||||
PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } };
|
||||
uint16_t n_rnti = 0x1234;
|
||||
@@ -73,6 +75,13 @@ openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
|
||||
|
||||
nrUE_params_t nrUE_params={0};
|
||||
|
||||
nrUE_params_t *get_nrUE_params(void) {
|
||||
return &nrUE_params;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
@@ -344,7 +353,6 @@ int main(int argc, char **argv)
|
||||
|
||||
if (snr1set == 0)
|
||||
snr1 = snr0 + 10;
|
||||
init_dlsch_tpool(dlsch_threads);
|
||||
|
||||
if (ouput_vcd)
|
||||
vcd_signal_dumper_init("/tmp/openair_dump_nr_dlschsim.vcd");
|
||||
@@ -363,7 +371,8 @@ int main(int argc, char **argv)
|
||||
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = calloc(1, sizeof(PHY_VARS_gNB));
|
||||
gNB = RC.gNB[0];
|
||||
initTpool(gNBthreads, &gNB->threadPool, true);
|
||||
initNamedTpool(gNBthreads, &gNB->threadPool, true, "gNB-tpool");
|
||||
initFloatingCoresTpool(dlsch_threads, &nrUE_params.Tpool, false, "UE-tpool");
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include <executables/nr-uesoftmodem.h>
|
||||
|
||||
const char *__asan_default_options()
|
||||
{
|
||||
@@ -362,12 +363,6 @@ void nr_dlsim_preprocessor(module_id_t module_id,
|
||||
AssertFatal(current_BWP->mcsTableIdx >= 0 && current_BWP->mcsTableIdx <= 2, "invalid mcsTableIdx %d\n", current_BWP->mcsTableIdx);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask; //mask to store boolean config options
|
||||
uint8_t nr_dlsch_parallel; // number of threads for dlsch decoding, 0 means no parallelization
|
||||
tpool_t Tpool; // thread pool
|
||||
} nrUE_params_t;
|
||||
|
||||
nrUE_params_t nrUE_params;
|
||||
|
||||
nrUE_params_t *get_nrUE_params(void) {
|
||||
@@ -475,7 +470,7 @@ int main(int argc, char **argv)
|
||||
|
||||
FILE *scg_fd=NULL;
|
||||
|
||||
while ((c = getopt (argc, argv, "f:hA:pf:g:i:n:s:S:t:x:y:z:M:N:F:GR:dPI:L:Ea:b:d:e:m:w:T:U:q:X:Y")) != -1) {
|
||||
while ((c = getopt (argc, argv, "f:hA:pf:g:i:n:s:S:t:x:y:z:M:N:F:GR:d:PI:L:Ea:b:e:m:w:T:U:q:X:Y")) != -1) {
|
||||
switch (c) {
|
||||
case 'f':
|
||||
scg_fd = fopen(optarg,"r");
|
||||
@@ -642,7 +637,7 @@ int main(int argc, char **argv)
|
||||
g_rbSize = atoi(optarg);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
case 'd':
|
||||
dlsch_threads = atoi(optarg);
|
||||
break;
|
||||
|
||||
@@ -748,8 +743,6 @@ int main(int argc, char **argv)
|
||||
|
||||
if (snr1set==0)
|
||||
snr1 = snr0+10;
|
||||
init_dlsch_tpool(dlsch_threads);
|
||||
|
||||
|
||||
RC.gNB = (PHY_VARS_gNB**) malloc(sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = (PHY_VARS_gNB*) malloc(sizeof(PHY_VARS_gNB ));
|
||||
@@ -1001,7 +994,7 @@ int main(int argc, char **argv)
|
||||
unsigned char *test_input_bit;
|
||||
unsigned int errors_bit = 0;
|
||||
|
||||
initTpool("N", &(nrUE_params.Tpool), false);
|
||||
initFloatingCoresTpool(dlsch_threads, &nrUE_params.Tpool, false, "UE-tpool");
|
||||
|
||||
test_input_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
|
||||
estimated_output_bit = (unsigned char *) malloc16(sizeof(unsigned char) * 16 * 68 * 384);
|
||||
@@ -1042,7 +1035,7 @@ int main(int argc, char **argv)
|
||||
snrRun = 0;
|
||||
int n_errs = 0;
|
||||
|
||||
initTpool(gNBthreads, &gNB->threadPool, true);
|
||||
initNamedTpool(gNBthreads, &gNB->threadPool, true, "gNB-tpool");
|
||||
initNotifiedFIFO(&gNB->L1_tx_free);
|
||||
initNotifiedFIFO(&gNB->L1_tx_filled);
|
||||
initNotifiedFIFO(&gNB->L1_tx_out);
|
||||
@@ -1268,7 +1261,6 @@ int main(int argc, char **argv)
|
||||
phy_procedures_nrUE_RX(UE,
|
||||
&UE_proc,
|
||||
0,
|
||||
dlsch_threads,
|
||||
&phy_pdcch_config,
|
||||
NULL);
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "openair1/PHY/MODULATION/nr_modulation.h"
|
||||
#include <executables/softmodem-common.h>
|
||||
#include <executables/nr-uesoftmodem.h>
|
||||
//#define DEBUG_NR_PBCHSIM
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
@@ -72,6 +73,12 @@ softmodem_params_t *get_softmodem_params(void) {
|
||||
return &softmodem_params;
|
||||
}
|
||||
|
||||
nrUE_params_t nrUE_params={0};
|
||||
|
||||
nrUE_params_t *get_nrUE_params(void) {
|
||||
return &nrUE_params;
|
||||
}
|
||||
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
|
||||
int nr_ue_pdcch_procedures(uint8_t gNB_id,
|
||||
@@ -606,6 +613,12 @@ int main(int argc, char **argv)
|
||||
|
||||
for (aa=0; aa<gNB->frame_parms.nb_antennas_tx; aa++) {
|
||||
if (cyclic_prefix_type == 1) {
|
||||
apply_nr_rotation(frame_parms,
|
||||
(int16_t*)gNB->common_vars.txdataF[aa],
|
||||
slot,
|
||||
0,
|
||||
12);
|
||||
|
||||
PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
|
||||
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
@@ -613,10 +626,17 @@ int main(int argc, char **argv)
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
} else {
|
||||
apply_nr_rotation(frame_parms,
|
||||
(int16_t*)gNB->common_vars.txdataF[aa],
|
||||
slot,
|
||||
0,
|
||||
14);
|
||||
|
||||
/*nr_normal_prefix_mod(gNB->common_vars.txdataF[aa],
|
||||
&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
|
||||
14,
|
||||
frame_parms);*/
|
||||
|
||||
PHY_ofdm_mod(gNB->common_vars.txdataF[aa],
|
||||
(int*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
@@ -624,26 +644,12 @@ int main(int argc, char **argv)
|
||||
frame_parms->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
|
||||
apply_nr_rotation(frame_parms,
|
||||
(int16_t*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)],
|
||||
slot,
|
||||
0,
|
||||
1,
|
||||
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples0);
|
||||
|
||||
PHY_ofdm_mod(&gNB->common_vars.txdataF[aa][frame_parms->ofdm_symbol_size],
|
||||
(int*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)+frame_parms->nb_prefix_samples0+frame_parms->ofdm_symbol_size],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
13,
|
||||
frame_parms->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
|
||||
apply_nr_rotation(frame_parms,
|
||||
(int16_t*)&txdata[aa][frame_parms->get_samples_slot_timestamp(slot,frame_parms,0)+frame_parms->nb_prefix_samples0+frame_parms->ofdm_symbol_size],
|
||||
slot,
|
||||
1,
|
||||
13,
|
||||
frame_parms->ofdm_symbol_size+frame_parms->nb_prefix_samples);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
#include <openair2/RRC/NR_UE/rrc_defs.h>
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
|
||||
#define NR_PRACH_DEBUG 1
|
||||
#define PRACH_WRITE_OUTPUT_DEBUG 1
|
||||
@@ -223,12 +224,6 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
uint64_t optmask; //mask to store boolean config options
|
||||
uint8_t nr_dlsch_parallel; // number of threads for dlsch decoding, 0 means no parallelization
|
||||
tpool_t Tpool; // thread pool
|
||||
} nrUE_params_t;
|
||||
|
||||
nrUE_params_t nrUE_params;
|
||||
|
||||
nrUE_params_t *get_nrUE_params(void) {
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "openair1/SIMULATION/RF/rf.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
|
||||
THREAD_STRUCT thread_struct;
|
||||
PHY_VARS_gNB *gNB;
|
||||
@@ -60,12 +61,20 @@ double cpuf;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
|
||||
const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
// needed for some functions
|
||||
PHY_VARS_NR_UE * PHY_vars_UE_g[1][1]={{NULL}};
|
||||
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
|
||||
nrUE_params_t nrUE_params={0};
|
||||
|
||||
nrUE_params_t *get_nrUE_params(void) {
|
||||
return &nrUE_params;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
#include "openair2/LAYER2/NR_MAC_COMMON/nr_mac_common.h"
|
||||
#include "executables/nr-uesoftmodem.h"
|
||||
|
||||
//#define DEBUG_NR_ULSCHSIM
|
||||
|
||||
@@ -61,7 +62,8 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
void init_downlink_harq_status(NR_DL_UE_HARQ_t *dl_harq) {}
|
||||
|
||||
uint8_t const nr_rv_round_map[4] = {0, 2, 3, 1};
|
||||
|
||||
const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
|
||||
const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
|
||||
double cpuf;
|
||||
//uint8_t nfapi_mode = 0;
|
||||
uint16_t NB_UE_INST = 1;
|
||||
@@ -109,6 +111,13 @@ int nr_postDecode_sim(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
ulsch->last_iteration_cnt = rdata->decodeIterations;
|
||||
return 0;
|
||||
}
|
||||
|
||||
nrUE_params_t nrUE_params;
|
||||
|
||||
nrUE_params_t *get_nrUE_params(void) {
|
||||
return &nrUE_params;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
@@ -387,8 +396,7 @@ int main(int argc, char **argv)
|
||||
gNB = RC.gNB[0];
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
|
||||
char tp_param[] = "n";
|
||||
initTpool(tp_param, &gNB->threadPool, true);
|
||||
initTpool("n", &gNB->threadPool, true);
|
||||
initNotifiedFIFO(&gNB->respDecode);
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->N_RB_DL = N_RB_DL;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user