Merge branch 'develop' into 'nr_prach_fr2'
This commit is contained in:
@@ -266,6 +266,42 @@ pipeline {
|
||||
}
|
||||
stage('Log Collection') {
|
||||
parallel {
|
||||
stage('Log Collection (eNB - Build)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.eNB_Credentials}", usernameVariable: 'eNB_Username', passwordVariable: 'eNB_Password']
|
||||
]) {
|
||||
echo '\u2705 \u001B[32mLog Collection (eNB - Build)\u001B[0m'
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectBuild --eNBIPAddress=${params.eNB_IPAddress} --eNBUserName=${eNB_Username} --eNBPassword=${eNB_Password} --eNBSourceCodePath=${params.eNB_SourceCodePath}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (eNB - Build)\u001B[0m'
|
||||
sh "sshpass -p \'${eNB_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${eNB_Username}@${params.eNB_IPAddress}:${eNB_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("build.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "build.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (OAI UE - Build)') {
|
||||
steps {
|
||||
echo '\u2705 \u001B[32mLog Collection (OAI UE - Build)\u001B[0m'
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.UE_Credentials}", usernameVariable: 'UE_Username', passwordVariable: 'UE_Password']
|
||||
]) {
|
||||
sh "python3 ci-scripts/main.py --mode=LogCollectBuild --UEIPAddress=${params.UE_IPAddress} --UEUserName=${UE_Username} --UEPassword=${UE_Password} --UESourceCodePath=${params.UE_SourceCodePath}"
|
||||
|
||||
echo '\u2705 \u001B[32mLog Transfer (UE - Build)\u001B[0m'
|
||||
sh "sshpass -p \'${UE_Password}\' scp -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 10' ${UE_Username}@${params.UE_IPAddress}:${UE_SourceCodePath}/cmake_targets/build.log.zip ./build.log.${env.BUILD_ID}.zip || true"
|
||||
}
|
||||
script {
|
||||
if(fileExists("build.log.${env.BUILD_ID}.zip")) {
|
||||
archiveArtifacts "build.log.${env.BUILD_ID}.zip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Log Collection (eNB - Run)') {
|
||||
steps {
|
||||
withCredentials([
|
||||
|
||||
@@ -59,7 +59,7 @@ if [ $# -eq 0 ]
|
||||
then
|
||||
echo " ---- Checking the whole repository ----"
|
||||
echo ""
|
||||
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted `
|
||||
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.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
|
||||
|
||||
@@ -67,17 +67,17 @@ then
|
||||
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
|
||||
|
||||
# Testing if explicit GNU GPL license banner
|
||||
egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "General Public License" . > files-w-gnu-gpl-license-banner.txt
|
||||
egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "General Public License" . | egrep -v "openair3/NAS/COMMON/milenage.h" > files-w-gnu-gpl-license-banner.txt
|
||||
|
||||
# Looking at exotic/suspect banner
|
||||
LIST_OF_FILES_W_BANNER=`egrep -irl --exclude-dir=.git --include=*.cpp --include=*.c --include=*.h "Copyright|copyleft" .`
|
||||
if [ -f ./files-w-suspect-banner.txt ]; then rm -f ./files-w-suspect-banner.txt; fi
|
||||
for FILE in $LIST_OF_FILES_W_BANNER
|
||||
do
|
||||
IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext"`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FILE`
|
||||
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_"`
|
||||
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" $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_|openair3/NAS/COMMON/milenage.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 ]
|
||||
@@ -178,7 +178,7 @@ 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 `
|
||||
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
|
||||
@@ -186,15 +186,19 @@ do
|
||||
echo $FULLFILE >> ./oai_rules_result_list.txt
|
||||
fi
|
||||
# Testing if explicit GNU GPL license banner
|
||||
egrep -i "General Public License" $FULLFILE >> files-w-gnu-gpl-license-banner.txt
|
||||
GNU_EXCEPTION=`echo $FULLFILE | egrep -c "openair3/NAS/COMMON/milenage.h" || true`
|
||||
if [ $GNU_EXCEPTION -eq 0 ]
|
||||
then
|
||||
egrep -il "General Public License" $FULLFILE >> files-w-gnu-gpl-license-banner.txt
|
||||
fi
|
||||
# Looking at exotic/suspect banner
|
||||
IS_BANNER=`egrep -i -c "Copyright|copyleft" $FULLFILE`
|
||||
IS_BANNER=`egrep -i -c "Copyright|copyleft" $FULLFILE || true`
|
||||
if [ $IS_BANNER -ne 0 ]
|
||||
then
|
||||
IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext"`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FULLFILE`
|
||||
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_"`
|
||||
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" $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_|openair3/NAS/COMMON/milenage.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 ]
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs = (
|
||||
{
|
||||
ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs = (
|
||||
{
|
||||
ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs = (
|
||||
{
|
||||
ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -356,6 +356,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -177,6 +177,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -173,6 +173,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -181,6 +181,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -183,6 +183,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -175,6 +175,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -126,10 +126,10 @@ gNBs =
|
||||
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
|
||||
#
|
||||
msg1_SubcarrierSpacing = 1,
|
||||
|
||||
# restrictedSetConfig
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPmappingType_0 = 1
|
||||
@@ -204,6 +204,7 @@ gNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.12.26";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -201,6 +201,7 @@ gNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
@@ -291,3 +292,6 @@ THREAD_STRUCT = (
|
||||
rrc_log_verbosity ="medium";
|
||||
};
|
||||
|
||||
uicc: {
|
||||
opc = "testopc";
|
||||
};
|
||||
|
||||
@@ -173,6 +173,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -136,6 +136,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -141,6 +141,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -139,6 +139,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -176,6 +176,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "192.168.15.130";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -144,6 +144,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "127.0.0.3";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -174,6 +174,7 @@ eNBs =
|
||||
////////// MME parameters:
|
||||
mme_ip_address = ( { ipv4 = "CI_MME_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
port = 36412 ;
|
||||
active = "yes";
|
||||
preference = "ipv4";
|
||||
}
|
||||
|
||||
@@ -84,6 +84,12 @@ nullPointer:common/utils/T/tracer/multi.c:265
|
||||
arrayIndexOutOfBounds:openair2/LAYER2/rlc_v2/tests/test.c:401
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// this file is used for testing the NR RLC implementation, this error is
|
||||
// not a problem, the programmer has to know what she does when writing
|
||||
// the tests
|
||||
arrayIndexOutOfBounds:openair2/LAYER2/nr_rlc/tests/test.c:451
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
// cppcheck does not understand the different lengths of arrays
|
||||
arrayIndexOutOfBounds:openair1/SIMULATION/TOOLS/random_channel.c:705
|
||||
arrayIndexOutOfBounds:openair1/SIMULATION/TOOLS/random_channel.c:706
|
||||
|
||||
+39
-2
@@ -133,7 +133,7 @@ class RANManagement():
|
||||
self.air_interface[self.eNB_instance] = 'nr-softmodem'
|
||||
else:
|
||||
self.air_interface[self.eNB_instance] = 'lte-softmodem'
|
||||
|
||||
|
||||
# Worakround for some servers, we need to erase completely the workspace
|
||||
if self.Build_eNB_forced_workspace_cleanup:
|
||||
mySSH.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15)
|
||||
@@ -427,7 +427,7 @@ class RANManagement():
|
||||
# Launch eNB with the modified config file
|
||||
mySSH.command('source oaienv', '\$', 5)
|
||||
mySSH.command('cd cmake_targets', '\$', 5)
|
||||
if self.air_interface == 'nr':
|
||||
if self.air_interface[self.eNB_instance] == 'nr-softmodem':
|
||||
mySSH.command('if [ -e rbconfig.raw ]; then echo ' + lPassWord + ' | sudo -S rm rbconfig.raw; fi', '\$', 5)
|
||||
mySSH.command('if [ -e reconfig.raw ]; then echo ' + lPassWord + ' | sudo -S rm reconfig.raw; fi', '\$', 5)
|
||||
# NOTE: WE SHALL do a check if the executable is present (in case build went wrong)
|
||||
@@ -705,6 +705,11 @@ class RANManagement():
|
||||
systemTime = ''
|
||||
maxPhyMemUsage = ''
|
||||
nbContextSwitches = ''
|
||||
#NSA FR1 check
|
||||
NSA_RAPROC_PUSCH_check = 0
|
||||
#dlsch and ulsch statistics (dictionary)
|
||||
dlsch_ulsch_stats = {}
|
||||
|
||||
for line in enb_log_file.readlines():
|
||||
# Runtime statistics
|
||||
result = re.search('Run time:' ,str(line))
|
||||
@@ -855,12 +860,27 @@ class RANManagement():
|
||||
result = re.search('MBMS USER-PLANE.*Requesting.*bytes from RLC', str(line))
|
||||
if result is not None:
|
||||
mbmsRequestMsg += 1
|
||||
#FR1 NSA test : add new markers to make sure gNB is used
|
||||
result = re.search('\[gNB [0-9]+\]\[RAPROC\] PUSCH with TC_RNTI [0-9a-fA-F]+ received correctly, adding UE MAC Context UE_id [0-9]+\/RNTI [0-9a-fA-F]+', str(line))
|
||||
if result is not None:
|
||||
NSA_RAPROC_PUSCH_check = 1
|
||||
#dlsch and ulsch statistics
|
||||
#keys below are the markers we are loooking for, loop over this keys list
|
||||
#everytime these markers are found in the log file, the previous ones are overwritten in the dict
|
||||
#eventually we record and print only the last occurence
|
||||
keys = {'dlsch_rounds','dlsch_total_bytes','ulsch_rounds','ulsch_total_bytes_scheduled'}
|
||||
for k in keys:
|
||||
result = re.search(k, line)
|
||||
if result is not None:
|
||||
#remove 1- all useless char before relevant info (ulsch or dlsch) 2- trailing char
|
||||
dlsch_ulsch_stats[k]=re.sub(r'^.*\]\s+', r'' , line.rstrip())
|
||||
enb_log_file.close()
|
||||
logging.debug(' File analysis completed')
|
||||
if (self.air_interface[self.eNB_instance] == 'lte-softmodem') or (self.air_interface[self.eNB_instance] == 'ocp-enb'):
|
||||
nodeB_prefix = 'e'
|
||||
else:
|
||||
nodeB_prefix = 'g'
|
||||
|
||||
if self.air_interface[self.eNB_instance] == 'nr-softmodem':
|
||||
if ulschReceiveOK > 0:
|
||||
statMsg = nodeB_prefix + 'NB showed ' + str(ulschReceiveOK) + ' "ULSCH received ok" message(s)'
|
||||
@@ -874,6 +894,23 @@ class RANManagement():
|
||||
statMsg = nodeB_prefix + 'NB ran with TX Write thread enabled'
|
||||
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
|
||||
htmleNBFailureMsg += statMsg + '\n'
|
||||
#FR1 NSA test : add new markers to make sure gNB is used
|
||||
if NSA_RAPROC_PUSCH_check:
|
||||
statMsg = '[RAPROC] PUSCH with TC_RNTI message check for ' + nodeB_prefix + 'NB : PASS '
|
||||
htmlMsg = statMsg+'\n'
|
||||
else:
|
||||
statMsg = '[RAPROC] PUSCH with TC_RNTI message check for ' + nodeB_prefix + 'NB : FAIL '
|
||||
htmlMsg = statMsg+'\n'
|
||||
logging.debug(statMsg)
|
||||
htmleNBFailureMsg += htmlMsg
|
||||
#ulsch and dlsch statistics
|
||||
if len(dlsch_ulsch_stats)!=0: #check if dictionary is not empty
|
||||
statMsg=''
|
||||
for key in dlsch_ulsch_stats: #for each dictionary key
|
||||
statMsg += dlsch_ulsch_stats[key] + '\n'
|
||||
logging.debug(dlsch_ulsch_stats[key])
|
||||
htmleNBFailureMsg += statMsg
|
||||
|
||||
if uciStatMsgCount > 0:
|
||||
statMsg = nodeB_prefix + 'NB showed ' + str(uciStatMsgCount) + ' "uci->stat" message(s)'
|
||||
logging.debug('\u001B[1;30;43m ' + statMsg + ' \u001B[0m')
|
||||
|
||||
+22
-16
@@ -1220,6 +1220,8 @@ function start_rf_sim_gnb {
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"source oaienv\"" >> $1
|
||||
echo "source oaienv" >> $1
|
||||
echo "echo \"export RFSIMULATOR=server\"" >> $1
|
||||
echo "export RFSIMULATOR=server" >> $1
|
||||
echo "cd ci-scripts/conf_files/" >> $1
|
||||
echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1
|
||||
#echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1
|
||||
@@ -1233,9 +1235,9 @@ function start_rf_sim_gnb {
|
||||
then
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #RA test => use --do-ra option
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -1320,30 +1322,25 @@ function start_rf_sim_nr_ue {
|
||||
local LOC_RA_TEST=$8
|
||||
|
||||
# Copy the RAW files from the gNB run
|
||||
# In RA test mode, they were not copied from gNB VM
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
scp -o StrictHostKeyChecking=no reconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
fi
|
||||
scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
scp -o StrictHostKeyChecking=no reconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
|
||||
echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"export RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}\"" >> $1
|
||||
echo "export RFSIMULATOR=${LOC_GNB_VM_IP_ADDR}" >> $1
|
||||
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "sudo cp /home/ubuntu/tmp/r*config.raw /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "sudo chmod 666 /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1
|
||||
fi
|
||||
echo "sudo cp /home/ubuntu/tmp/r*config.raw /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "sudo chmod 666 /home/ubuntu/tmp/cmake_targets/ran_build/build/r*config.raw" >> $1
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #RA test => use --do-ra option
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -2198,15 +2195,21 @@ function run_test_on_vm {
|
||||
PRB=106
|
||||
FREQUENCY=3510
|
||||
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir --parents $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
local try_cnt="0"
|
||||
NR_STATUS=0
|
||||
|
||||
######### start of RA TEST loop
|
||||
while [ $try_cnt -lt 10 ] #10 because it hardly succeed within CI
|
||||
while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
|
||||
do
|
||||
|
||||
SYNC_STATUS=0
|
||||
RA_STATUS=0
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*ra_test.log
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
@@ -2271,6 +2274,9 @@ function run_test_on_vm {
|
||||
SYNC_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_gnb.log $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_ping_gnb_from_nrue.log $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_ping_from_gnb_nrue.log
|
||||
rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_iperf_dl*txt $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}_iperf_ul*txt
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
|
||||
@@ -89,14 +89,14 @@
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 20pings in 20sec</desc>
|
||||
<ping_args>-c 20</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="050001">
|
||||
<class>Ping</class>
|
||||
<desc>Ping: 5pings in 1sec</desc>
|
||||
<ping_args>-c 5 -i 0.2</ping_args>
|
||||
<ping_packetloss_threshold>0</ping_packetloss_threshold>
|
||||
<ping_packetloss_threshold>50</ping_packetloss_threshold>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070000">
|
||||
@@ -104,6 +104,7 @@
|
||||
<desc>Terminate eNB</desc>
|
||||
<eNB_instance>0</eNB_instance>
|
||||
<eNB_serverId>0</eNB_serverId>
|
||||
<air_interface>lte</air_interface>
|
||||
</testCase>
|
||||
|
||||
<testCase id="070001">
|
||||
@@ -111,6 +112,7 @@
|
||||
<desc>Terminate gNB</desc>
|
||||
<eNB_instance>1</eNB_instance>
|
||||
<eNB_serverId>1</eNB_serverId>
|
||||
<air_interface>nr</air_interface>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
|
||||
+194
-129
@@ -23,6 +23,114 @@
|
||||
|
||||
cmake_minimum_required (VERSION 3.0)
|
||||
|
||||
|
||||
# System packages that are required
|
||||
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
|
||||
# or cmake provide a generic interface to pkg-config that widely used
|
||||
###################################
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
|
||||
include_directories(${LIBXML2_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(LIBXSLT libxslt REQUIRED)
|
||||
include_directories(${LIBXSLT_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(OPENSSL openssl REQUIRED)
|
||||
include_directories(${OPENSSL_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CONFIG libconfig REQUIRED)
|
||||
include_directories(${CONFIG_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CRYPTO libcrypto REQUIRED)
|
||||
include_directories(${CRYPTO_INCLUDE_DIRS})
|
||||
|
||||
#use native cmake method as this package is not in pkg-config
|
||||
if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
find_package(Boost REQUIRED)
|
||||
include_directories(${LIBBOOST_INCLUDE_DIR})
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/")
|
||||
include_directories("/usr/local/include/")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp)
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
set(option_HW_lib "-lSoapySDR -rdynamic -ldl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
|
||||
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
|
||||
if(NOT ${OPENPGM_FOUND})
|
||||
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
|
||||
else()
|
||||
include_directories(${OPENPGM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_search_module(NETTLE nettle)
|
||||
if(NOT ${NETTLE_FOUND})
|
||||
message( FATAL_ERROR "PACKAGE nettle not found: some targets will fail. Run build_oai -I again!")
|
||||
else()
|
||||
include_directories(${NETTLE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
message ("NETTLE VERSION_INSTALLED = ${NETTLE_VERSION}")
|
||||
|
||||
string(REGEX REPLACE "([0-9]+).*" "\\1" NETTLE_VERSION_MAJOR ${NETTLE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" NETTLE_VERSION_MINOR ${NETTLE_VERSION})
|
||||
message ("NETTLE_VERSION_MAJOR = ${NETTLE_VERSION_MAJOR}")
|
||||
message ("NETTLE_VERSION_MINOR = ${NETTLE_VERSION_MINOR}")
|
||||
|
||||
if ("${NETTLE_VERSION_MAJOR}" STREQUAL "" OR "${NETTLE_VERSION_MINOR}" STREQUAL "")
|
||||
message( FATAL_ERROR "The nettle version not detected properly. Try to run build_oai -I again" )
|
||||
endif()
|
||||
|
||||
add_definitions("-DNETTLE_VERSION_MAJOR=${NETTLE_VERSION_MAJOR}")
|
||||
add_definitions("-DNETTLE_VERSION_MINOR=${NETTLE_VERSION_MINOR}")
|
||||
|
||||
pkg_search_module(XPM xpm)
|
||||
if(NOT ${XPM_FOUND})
|
||||
message("PACKAGE xpm not found: some targets will fail")
|
||||
else()
|
||||
include_directories(${XPM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Atlas is required by some packages, but not found in pkg-config
|
||||
# So, here are some hacks here. Hope this gets fixed in future!
|
||||
if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
|
||||
include_directories("/usr/include/atlas")
|
||||
LINK_DIRECTORIES("/usr/lib/lapack")
|
||||
LINK_DIRECTORIES("/usr/lib64")
|
||||
LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here!
|
||||
|
||||
if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES blas)
|
||||
|
||||
else() # Case for Ubuntu
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
endif()
|
||||
|
||||
if(EXISTS "/usr/lib/atlas/libtatlas.so" OR EXISTS "/usr/lib64/atlas/libtatlas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES tatlas)
|
||||
else()
|
||||
list(APPEND ATLAS_LIBRARIES atlas) #Case for Ubuntu
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
# for ubuntu 17.10, directories are different
|
||||
elseif(EXISTS "/usr/include/x86_64-linux-gnu/cblas.h")
|
||||
|
||||
include_directories("/usr/include/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
list(APPEND ATLAS_LIBRARIES atlas)
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
else()
|
||||
message("No Blas/Atlas libs found, some targets will fail")
|
||||
endif()
|
||||
|
||||
#########################################################
|
||||
# Base directories, compatible with legacy OAI building #
|
||||
#########################################################
|
||||
@@ -232,8 +340,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
|
||||
#########################
|
||||
# set a flag for changes in the source code
|
||||
# these changes are related to hardcoded path to include .h files
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0 -DMALLOC_CHECK_=3")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2 -fno-delete-null-pointer-checks")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
|
||||
|
||||
set(GIT_BRANCH "UNKNOWN")
|
||||
@@ -302,7 +410,6 @@ set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
|
||||
add_library(ITTI
|
||||
${OCP_ITTI}/intertask_interface.cpp
|
||||
${OPENAIR_DIR}/common/utils/backtrace.c
|
||||
${OPENAIR_DIR}/common/utils/memory_pools.c
|
||||
)
|
||||
add_dependencies(ITTI rrc_flag)
|
||||
set(ITTI_LIB ITTI)
|
||||
@@ -378,6 +485,7 @@ add_custom_target (
|
||||
|
||||
add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
|
||||
${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c
|
||||
${OPENAIR2_DIR}/RRC/NR/nr_ngap_gNB.c
|
||||
)
|
||||
add_dependencies(NR_RRC_LIB nr_rrc_flag)
|
||||
include_directories ("${NR_RRC_FULL_DIR}")
|
||||
@@ -622,7 +730,7 @@ add_library(X2AP_ENB
|
||||
${X2AP_DIR}/x2ap_ids.c
|
||||
${X2AP_DIR}/x2ap_timers.c
|
||||
)
|
||||
add_dependencies(X2AP_ENB rrc_flag x2_flag)
|
||||
add_dependencies(X2AP_ENB X2AP_LIB rrc_flag x2_flag)
|
||||
|
||||
|
||||
# F1AP
|
||||
@@ -813,7 +921,7 @@ Message("CPU_Affinity flag is ${CPU_AFFINITY}")
|
||||
add_boolean_option(NO_RRM True "DO WE HAVE A RADIO RESSOURCE MANAGER: NO")
|
||||
|
||||
add_boolean_option(OAI_NW_DRIVER_TYPE_ETHERNET False "????")
|
||||
add_boolean_option(DEADLINE_SCHEDULER True "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
|
||||
add_boolean_option(DEADLINE_SCHEDULER False "Use the Linux scheduler SCHED_DEADLINE: kernel >= 3.14")
|
||||
add_boolean_option(CPU_AFFINITY False "Enable CPU Affinity of threads (only valid without deadline scheduler). It is enabled only with >2 CPUs")
|
||||
add_boolean_option(NAS_NETLINK False "useless ??? Must be True to compile nasmesh driver without rtai ????")
|
||||
add_boolean_option(OAI_NW_DRIVER_USE_NETLINK True "????")
|
||||
@@ -834,9 +942,9 @@ add_boolean_option(ENB_MODE True "Swap the include directories between openair2
|
||||
##########################
|
||||
# SCHEDULING/REAL-TIME/PERF options
|
||||
##########################
|
||||
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME True "Add data in vcd traces: disable it if perf issues")
|
||||
add_boolean_option(ENABLE_VCD True "always true now, time measurements of proc calls and var displays")
|
||||
add_boolean_option(ENABLE_VCD_FIFO True "time measurements of proc calls and var displays sent to FIFO (one more thread)")
|
||||
add_boolean_option(ENABLE_USE_CPU_EXECUTION_TIME False "Add data in vcd traces: disable it if perf issues")
|
||||
add_boolean_option(ENABLE_VCD False "always true now, time measurements of proc calls and var displays")
|
||||
add_boolean_option(ENABLE_VCD_FIFO False "time measurements of proc calls and var displays sent to FIFO (one more thread)")
|
||||
add_boolean_option(LINUX False "used in weird memcpy() in pdcp.c ???")
|
||||
add_boolean_option(LINUX_LIST False "used only in lists.c: either use OAI implementation of lists or Linux one (should be True, but it is False")
|
||||
add_boolean_option(OPENAIR_LTE True "Seems legacy: keep it to true")
|
||||
@@ -1250,6 +1358,7 @@ set(SECU_OSA_SRC
|
||||
${OPENAIR2_DIR}/UTIL/OSA/osa_stream_eia.c
|
||||
)
|
||||
add_library(SECU_OSA ${SECU_OSA_SRC})
|
||||
target_link_libraries(SECU_OSA ${NETTLE_LIBRARIES})
|
||||
|
||||
set(SECU_CN_SRC
|
||||
${OPENAIR3_DIR}/SECU/kdf.c
|
||||
@@ -1263,6 +1372,8 @@ set(SECU_CN_SRC
|
||||
)
|
||||
add_library(SECU_CN ${SECU_CN_SRC})
|
||||
|
||||
target_link_libraries(SECU_CN ${NETTLE_LIBRARIES})
|
||||
|
||||
# Physical Channel Procedures Scheduling
|
||||
################################"
|
||||
set(SCHED_SRC
|
||||
@@ -1628,6 +1739,7 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/sss_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/cic_filter_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_initial_sync.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_pbch.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_dlsch_demodulation.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
|
||||
@@ -2047,6 +2159,11 @@ set (GTPV1U_SRC
|
||||
add_library(GTPV1U ${GTPV1U_SRC})
|
||||
add_dependencies(GTPV1U rrc_flag)
|
||||
|
||||
#add_library (GTPV1U_OCP
|
||||
#${OPENAIR3_DIR}/ocp-gtp/gtp_itf.cpp
|
||||
#)
|
||||
#include_directories(${OPENAIR3_DIR}/ocp-gtp)
|
||||
|
||||
#NR case
|
||||
set (NR_GTPV1U_SRC
|
||||
${NR_RRC_DIR}/rrc_gNB_GTPV1U.c
|
||||
@@ -2350,6 +2467,14 @@ set (SHLIB_LOADER_SOURCES
|
||||
${OPENAIR_DIR}/common/utils/load_module_shlib.c
|
||||
)
|
||||
|
||||
add_library(LIB_5GNAS_GNB
|
||||
${NAS_SRC}/COMMON/nr_common.c
|
||||
${NAS_SRC}/gNB/network_process_nas.c
|
||||
${NAS_SRC}/NR_UE/ue_process_nas.c
|
||||
${OPENAIR3_DIR}//UICC/usim_interface.c
|
||||
)
|
||||
target_link_libraries(LIB_5GNAS_GNB SECU_CN ${CRYPTO_LIBRARIES})
|
||||
|
||||
# Make lfds as a own source code (even if it is a outside library)
|
||||
# For better intergration with compilation flags & structure of cmake
|
||||
###################################################################
|
||||
@@ -2426,114 +2551,6 @@ include_directories("${NFAPI_DIR}/nfapi/inc")
|
||||
include_directories("${NFAPI_DIR}/sim_common/inc")
|
||||
include_directories("${NFAPI_DIR}/pnf_sim/inc")
|
||||
|
||||
|
||||
# System packages that are required
|
||||
# We use either the cmake buildin, in ubuntu are in: /usr/share/cmake*/Modules/
|
||||
# or cmake provide a generic interface to pkg-config that widely used
|
||||
###################################
|
||||
include(FindPkgConfig)
|
||||
|
||||
pkg_search_module(LIBXML2 libxml-2.0 REQUIRED)
|
||||
include_directories(${LIBXML2_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(LIBXSLT libxslt REQUIRED)
|
||||
include_directories(${LIBXSLT_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(OPENSSL openssl REQUIRED)
|
||||
include_directories(${OPENSSL_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CONFIG libconfig REQUIRED)
|
||||
include_directories(${CONFIG_INCLUDE_DIRS})
|
||||
|
||||
pkg_search_module(CRYPTO libcrypto REQUIRED)
|
||||
include_directories(${CRYPTO_INCLUDE_DIRS})
|
||||
|
||||
#use native cmake method as this package is not in pkg-config
|
||||
if (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
find_package(Boost REQUIRED)
|
||||
include_directories(${LIBBOOST_INCLUDE_DIR})
|
||||
|
||||
elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/")
|
||||
include_directories("/usr/local/include/")
|
||||
set(HW_SOURCE ${HW_SOURCE}
|
||||
${OPENAIR_TARGETS}/ARCH/IRIS/USERSPACE/LIB/iris_lib.cpp)
|
||||
LINK_DIRECTORIES("/usr/local/lib")
|
||||
set(option_HW_lib "-lSoapySDR -rdynamic -ldl")
|
||||
|
||||
endif (${RF_BOARD} STREQUAL "OAI_USRP")
|
||||
|
||||
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
|
||||
if(NOT ${OPENPGM_FOUND})
|
||||
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
|
||||
else()
|
||||
include_directories(${OPENPGM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
pkg_search_module(NETTLE nettle)
|
||||
if(NOT ${NETTLE_FOUND})
|
||||
message( FATAL_ERROR "PACKAGE nettle not found: some targets will fail. Run build_oai -I again!")
|
||||
else()
|
||||
include_directories(${NETTLE_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
message ("NETTLE VERSION_INSTALLED = ${NETTLE_VERSION}")
|
||||
|
||||
string(REGEX REPLACE "([0-9]+).*" "\\1" NETTLE_VERSION_MAJOR ${NETTLE_VERSION})
|
||||
string(REGEX REPLACE "[0-9]+\\.([0-9]+).*" "\\1" NETTLE_VERSION_MINOR ${NETTLE_VERSION})
|
||||
message ("NETTLE_VERSION_MAJOR = ${NETTLE_VERSION_MAJOR}")
|
||||
message ("NETTLE_VERSION_MINOR = ${NETTLE_VERSION_MINOR}")
|
||||
|
||||
if ("${NETTLE_VERSION_MAJOR}" STREQUAL "" OR "${NETTLE_VERSION_MINOR}" STREQUAL "")
|
||||
message( FATAL_ERROR "The nettle version not detected properly. Try to run build_oai -I again" )
|
||||
endif()
|
||||
|
||||
add_definitions("-DNETTLE_VERSION_MAJOR=${NETTLE_VERSION_MAJOR}")
|
||||
add_definitions("-DNETTLE_VERSION_MINOR=${NETTLE_VERSION_MINOR}")
|
||||
|
||||
pkg_search_module(XPM xpm)
|
||||
if(NOT ${XPM_FOUND})
|
||||
message("PACKAGE xpm not found: some targets will fail")
|
||||
else()
|
||||
include_directories(${XPM_INCLUDE_DIRS})
|
||||
endif()
|
||||
|
||||
# Atlas is required by some packages, but not found in pkg-config
|
||||
# So, here are some hacks here. Hope this gets fixed in future!
|
||||
if(EXISTS "/usr/include/atlas/cblas.h" OR EXISTS "/usr/include/cblas.h")
|
||||
include_directories("/usr/include/atlas")
|
||||
LINK_DIRECTORIES("/usr/lib/lapack")
|
||||
LINK_DIRECTORIES("/usr/lib64")
|
||||
LINK_DIRECTORIES("/usr/lib64/atlas") #Added because atlas libraries in CentOS 7 are here!
|
||||
|
||||
if(EXISTS "/usr/lib64/libblas.so" OR EXISTS "/usr/lib/libblas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES blas)
|
||||
|
||||
else() # Case for Ubuntu
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
endif()
|
||||
|
||||
if(EXISTS "/usr/lib/atlas/libtatlas.so" OR EXISTS "/usr/lib64/atlas/libtatlas.so") #Case for CentOS7
|
||||
list(APPEND ATLAS_LIBRARIES tatlas)
|
||||
else()
|
||||
list(APPEND ATLAS_LIBRARIES atlas) #Case for Ubuntu
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
# for ubuntu 17.10, directories are different
|
||||
elseif(EXISTS "/usr/include/x86_64-linux-gnu/cblas.h")
|
||||
|
||||
include_directories("/usr/include/x86_64-linux-gnu")
|
||||
LINK_DIRECTORIES("/usr/lib/x86_64-linux-gnu")
|
||||
list(APPEND ATLAS_LIBRARIES cblas)
|
||||
list(APPEND ATLAS_LIBRARIES atlas)
|
||||
list(APPEND ATLAS_LIBRARIES lapack)
|
||||
|
||||
else()
|
||||
message("No Blas/Atlas libs found, some targets will fail")
|
||||
endif()
|
||||
|
||||
list(APPEND ATLAS_LIBRARIES lapack lapacke)
|
||||
|
||||
include_directories ("/usr/include/X11")
|
||||
@@ -2640,6 +2657,12 @@ add_executable(measurement_display
|
||||
${OPENAIR_DIR}/common/utils/threadPool/measurement_display.c)
|
||||
target_link_libraries (measurement_display minimal_lib)
|
||||
|
||||
add_executable(test5Gnas
|
||||
${OPENAIR_DIR}/openair3/TEST/test5Gnas.c
|
||||
)
|
||||
target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib )
|
||||
|
||||
|
||||
# lte-softmodem is both eNB and UE implementation
|
||||
###################################################
|
||||
|
||||
@@ -2681,7 +2704,7 @@ target_link_libraries (lte-softmodem
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-softmodem ${T_LIB})
|
||||
|
||||
@@ -2720,7 +2743,7 @@ target_link_libraries (ocp-enb
|
||||
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
|
||||
-Wl,--end-group z dl)
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
target_link_libraries (ocp-enb ${LIBXML2_LIBRARIES} pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${LIB_LMS_LIBRARIES} ${T_LIB})
|
||||
|
||||
add_executable(cu_test
|
||||
${OPENAIR2_DIR}/LAYER2/PROTO_AGENT/cu_test.c
|
||||
@@ -2792,7 +2815,7 @@ target_link_libraries (lte-uesoftmodem
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (lte-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (lte-uesoftmodem ${T_LIB})
|
||||
|
||||
@@ -2835,11 +2858,52 @@ target_link_libraries (nr-softmodem
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
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_executable(ocp-gnb
|
||||
${rrc_h}
|
||||
${nr_rrc_h}
|
||||
${s1ap_h}
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_DIR}/executables/ocp-gnb.c
|
||||
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${GTPU_need_ITTI}
|
||||
${XFORMS_SOURCE_NR}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
${XFORMSINTERFACE_SOURCE}
|
||||
)
|
||||
|
||||
target_link_libraries (ocp-gnb
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS NR_GTPV1U SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
|
||||
S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (ocp-gnb ${LIBXML2_LIBRARIES} )
|
||||
target_link_libraries (ocp-gnb pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (ocp-gnb ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (ocp-gnb ${T_LIB})
|
||||
add_dependencies(ocp-gnb ldpc_orig ldpc_optim ldpc_optim8seg ldpc params_libconfig rfsimulator oai_usrpdevif rfsimulator nrscope)
|
||||
|
||||
|
||||
# nr-uesoftmodem is UE implementation
|
||||
#######################################
|
||||
|
||||
@@ -2874,11 +2938,11 @@ target_link_libraries (nr-uesoftmodem
|
||||
RRC_LIB NR_RRC_LIB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
|
||||
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
|
||||
NFAPI_USER_LIB S1AP_LIB S1AP_ENB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES} ${ATLAS_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (nr-uesoftmodem ${T_LIB})
|
||||
|
||||
@@ -3045,7 +3109,7 @@ add_executable(nr_dlsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlsim
|
||||
-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_NR HASHTABLE -Wl,--end-group
|
||||
-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 -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
@@ -3063,7 +3127,8 @@ add_executable(nr_prachsim
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES})
|
||||
target_link_libraries(nr_prachsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB MAC_UE_NR SCHED_NR_UE_LIB RRC_LIB NR_RRC_LIB L2_NR CONFIG_LIB HASHTABLE -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON 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 -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
|
||||
add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
@@ -3095,7 +3160,7 @@ add_executable(nr_ulsim
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_ulsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR PHY_NR_COMMON 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_NR HASHTABLE -Wl,--end-group
|
||||
-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 -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
@@ -3130,7 +3195,7 @@ add_executable(test_epc_generate_scenario
|
||||
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
|
||||
)
|
||||
target_link_libraries (test_epc_generate_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
|
||||
add_executable(test_epc_play_scenario
|
||||
@@ -3149,7 +3214,7 @@ add_executable(test_epc_play_scenario
|
||||
)
|
||||
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
|
||||
target_link_libraries (test_epc_play_scenario
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
|
||||
|
||||
@@ -3169,7 +3234,7 @@ foreach(myExe s1ap
|
||||
${OPENAIR3_DIR}/TEST/test_${myExe}.c
|
||||
)
|
||||
target_link_libraries (test_${myExe}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} ${CONFIG_LIB}
|
||||
-Wl,--start-group SECU_CN UTIL LFDS -Wl,--end-group m rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
|
||||
)
|
||||
endforeach(myExe)
|
||||
|
||||
@@ -3194,7 +3259,7 @@ if (${T_TRACER})
|
||||
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
|
||||
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE MAC_NR_COMMON MAC_NR MAC_UE_NR
|
||||
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR
|
||||
CN_UTILS GTPV1U NR_GTPV1U SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
|
||||
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
|
||||
if (TARGET ${i})
|
||||
|
||||
@@ -483,11 +483,6 @@ function main() {
|
||||
echo_info "Flags for Deadline scheduler: $DEADLINE_SCHEDULER_FLAG_USER"
|
||||
echo_info "Flags for CPU Affinity: $CPU_AFFINITY_FLAG_USER"
|
||||
|
||||
if [ -n "$UHD_IMAGES_DIR" ] && [ -z "$INSTALL_EXTERNAL" ]; then
|
||||
echo_error "UHD images download settings will not be applied without -I present"
|
||||
exit
|
||||
fi
|
||||
|
||||
#######################################################
|
||||
# Setting and printing OAI envs, we should check here #
|
||||
#######################################################
|
||||
|
||||
+505
@@ -0,0 +1,505 @@
|
||||
#!/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
|
||||
# */
|
||||
|
||||
# brief
|
||||
# authors Laurent Thomas
|
||||
#
|
||||
#######################################
|
||||
if [ ! -f /etc/os-release ]; then
|
||||
echo "No /etc/os-release file found. You're likely on an unsupported distro."
|
||||
exit 1
|
||||
fi
|
||||
OS_DISTRO=$(grep "^ID=" /etc/os-release | sed "s/ID=//" | sed "s/\"//g")
|
||||
OS_RELEASE=$(grep "^VERSION_ID=" /etc/os-release | sed "s/VERSION_ID=//" | sed "s/\"//g")
|
||||
case "$OS_DISTRO" in
|
||||
ubuntu) OS_BASEDISTRO="debian"; INSTALLER="apt"; CMAKE="cmake" ;;
|
||||
esac
|
||||
|
||||
SUDO='sudo -E'
|
||||
|
||||
###############################
|
||||
## echo and family
|
||||
###############################
|
||||
black='\E[30m'
|
||||
red='\E[31m'
|
||||
green='\E[32m'
|
||||
yellow='\E[33m'
|
||||
blue='\E[1;34m'
|
||||
magenta='\E[35m'
|
||||
cyan='\E[36m'
|
||||
white='\E[37m'
|
||||
reset_color='\E[00m'
|
||||
COLORIZE=1
|
||||
|
||||
cecho() {
|
||||
# Color-echo
|
||||
# arg1 = message
|
||||
# arg2 = color
|
||||
local default_msg="No Message."
|
||||
message=${1:-$default_msg}
|
||||
color=${2:-$green}
|
||||
[ "$COLORIZE" = "1" ] && message="$color$message$reset_color"
|
||||
echo -e "$message"
|
||||
return
|
||||
}
|
||||
|
||||
echo_error() { cecho "$* $red" ;}
|
||||
echo_fatal() { cecho "$* $red"; exit 1 ;}
|
||||
echo_warning() { cecho "$* $yellow" ;}
|
||||
echo_success() { cecho "$* $green" ;}
|
||||
echo_info() { cecho "$* $blue" ;}
|
||||
|
||||
########################
|
||||
# distribution helpers #
|
||||
########################
|
||||
|
||||
# This function return a string to identify the distribution we are running
|
||||
# Examples:
|
||||
# ubuntu16.04
|
||||
# debian8.5
|
||||
get_distribution_release() {
|
||||
echo "$OS_DISTRO$OS_RELEASE"
|
||||
}
|
||||
|
||||
check_supported_distribution() {
|
||||
case $(get_distribution_release) in
|
||||
"ubuntu20.04") return 0 ;;
|
||||
esac
|
||||
return 1
|
||||
}
|
||||
|
||||
##################
|
||||
# Error handlers #
|
||||
##################
|
||||
|
||||
handler_EXIT() {
|
||||
local exit_code=$?
|
||||
[ "$exit_code" -eq 0 ] || echo_error "build have failed"
|
||||
exit $exit_code
|
||||
}
|
||||
|
||||
trap handler_EXIT EXIT
|
||||
|
||||
###########################
|
||||
# Cleaners
|
||||
###########################
|
||||
|
||||
clean_kernel() {
|
||||
$SUDO modprobe ip_tables
|
||||
$SUDO modprobe x_tables
|
||||
$SUDO iptables -P INPUT ACCEPT
|
||||
$SUDO iptables -F INPUT
|
||||
$SUDO iptables -P OUTPUT ACCEPT
|
||||
$SUDO iptables -F OUTPUT
|
||||
$SUDO iptables -P FORWARD ACCEPT
|
||||
$SUDO iptables -F FORWARD
|
||||
$SUDO iptables -t nat -F
|
||||
$SUDO iptables -t mangle -F
|
||||
$SUDO iptables -t filter -F
|
||||
$SUDO iptables -t raw -F
|
||||
echo_info "Flushed iptables"
|
||||
$SUDO rmmod nasmesh > /dev/null 2>&1
|
||||
$SUDO rmmod oai_nw_drv > /dev/null 2>&1
|
||||
$SUDO rmmod openair_rf > /dev/null 2>&1
|
||||
$SUDO rmmod ue_ip > /dev/null 2>&1
|
||||
echo_info "removed drivers from kernel"
|
||||
}
|
||||
|
||||
clean_all_files() {
|
||||
set_openair_env
|
||||
rm -rf "$OPENAIR_DIR"/targets/bin/*
|
||||
dir="$OPENAIR_DIR/cmake_targets"
|
||||
rm -rf "$dir"/log/*
|
||||
rm -rf "$dir"/ran_build/build
|
||||
rm -rf "$dir"/ran_build_noLOG/build
|
||||
rm -rf "$dir"/lte-simulators/build
|
||||
rm -rf "$dir"/phy_simulators/build
|
||||
rm -rf "$dir"/nas_sim_tools/build
|
||||
rm -rf "$dir"/oaisim_build_oai/build
|
||||
rm -rf "$dir"/oaisim_build_oai/CMakeLists.txt
|
||||
rm -rf "$dir"/autotests/bin
|
||||
rm -rf "$dir"/autotests/log
|
||||
rm -rf "$dir"/autotests/*/build
|
||||
}
|
||||
|
||||
############################################
|
||||
# External packages installers
|
||||
############################################
|
||||
|
||||
install_protobuf_from_source(){
|
||||
protobuf_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_install_log.txt
|
||||
echo_info "\nInstalling Google Protobuf from sources. The log file for Protobuf installation is here: $protobuf_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading protobuf"
|
||||
#rm -rf /tmp/protobuf-2.6.1.tar.gz* /tmp/protobuf-2.6.1
|
||||
#wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
|
||||
#tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
#cd protobuf-2.6.1/
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner "$USER" --group "$(groups | cut -d" " -f1)" --no-same-owner
|
||||
cd protobuf-3.3.0/ || exit
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$protobuf_install_log"
|
||||
}
|
||||
|
||||
install_protobuf_c_from_source(){
|
||||
protobuf_c_install_log=$OPENAIR_DIR/cmake_targets/log/protobuf_c_install_log.txt
|
||||
echo_info "\nInstalling Google Protobuf_C from sources. The log file for Protobuf_C installation is here: $protobuf_c_install_log "
|
||||
(
|
||||
if [[ "$OS_DISTRO" == "rhel" ]] || [[ "$OS_DISTRO" == "centos" ]]; then
|
||||
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
|
||||
fi
|
||||
cd /tmp || exit
|
||||
echo "Downloading protobuf-c"
|
||||
rm -rf /tmp/protobuf-c
|
||||
git clone https://github.com/protobuf-c/protobuf-c.git
|
||||
cd protobuf-c || exit
|
||||
git checkout 2a46af42784abf86804d536f6e0122d47cfeea45
|
||||
./autogen.sh
|
||||
./configure
|
||||
echo "Compiling protobuf-c"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$protobuf_c_install_log"
|
||||
}
|
||||
|
||||
install_usrp_uhd_driver_from_source(){
|
||||
uhd_install_log=$OPENAIR_DIR/cmake_targets/log/uhd_install_log.txt
|
||||
echo_info "\nInstalling UHD driver from sources. The log file for UHD driver installation is here: $uhd_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading UHD driver"
|
||||
rm -rf /tmp/uhd
|
||||
git clone https://github.com/EttusResearch/uhd.git
|
||||
cd uhd || exit
|
||||
git checkout tags/v3.13.0.2
|
||||
mkdir -p host/build
|
||||
cd host/build || exit
|
||||
$CMAKE ../
|
||||
echo "Compiling UHD"
|
||||
make -j"$(nproc)"
|
||||
make test
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$uhd_install_log"
|
||||
}
|
||||
|
||||
install_bladerf_driver_from_source(){
|
||||
bladerf_install_log=$OPENAIR_DIR/cmake_targets/log/bladerf_install_log.txt
|
||||
echo_info "\nInstalling BladeRF driver from sources. The log file for BladeRF driver installation is here: $bladerf_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading BladeRF driver"
|
||||
rm -rf /tmp/bladeRF
|
||||
git clone https://github.com/Nuand/bladeRF.git
|
||||
cd bladeRF || exit
|
||||
git checkout tags/2016.06
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
$CMAKE ../
|
||||
echo "Compiling BladeRF driver"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
echo "Downloading FPGA and firmware images"
|
||||
cd /tmp/bladeRF || exit
|
||||
wget --tries=3 --retry-connrefused https://www.nuand.com/fx3/bladeRF_fw_latest.img
|
||||
wget --tries=3 --retry-connrefused https://www.nuand.com/fpga/hostedx40-latest.rbf
|
||||
sudo mkdir -p /usr/share/Nuand/bladeRF
|
||||
sudo mv bladeRF_fw_latest.img /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
sudo mv hostedx40-latest.rbf /usr/share/Nuand/bladeRF/hostedx40.rbf
|
||||
) >& "$bladerf_install_log"
|
||||
}
|
||||
|
||||
check_install_bladerf_driver(){
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
$SUDO apt-get install -y bladerf libbladerf-dev
|
||||
$SUDO apt-get install -y bladerf-firmware-fx3
|
||||
$SUDO apt-get install -y bladerf-fpga-hostedx40
|
||||
elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
install_bladerf_driver_from_source
|
||||
else
|
||||
echo_error "BladeRF Installer for OAI does not support automatic build. Install BladeRF compiling sources manually from BladeRF website"
|
||||
fi
|
||||
}
|
||||
|
||||
flash_firmware_bladerf() {
|
||||
$SUDO bladeRF-cli --flash-firmware /usr/share/Nuand/bladeRF/bladeRF_fw.img
|
||||
}
|
||||
|
||||
install_soapy_from_source(){
|
||||
soapy_install_log=$OPENAIR_DIR/cmake_targets/log/soapy_install_log.txt
|
||||
echo_info "\nInstalling Soapy EcoSystem from source. The log file for Soapy installation is here: $soapy_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading SoapySDR"
|
||||
rm -rf /tmp/soapysdr
|
||||
git clone -b soapy-sdr-0.7.0 --single-branch https://github.com/pothosware/SoapySDR.git
|
||||
cd SoapySDR || exit
|
||||
#git checkout tags/release_003_010_001_001
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
$CMAKE ../
|
||||
echo "Compiling SoapySDR"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
cd /tmp || exit
|
||||
echo "Downloading SoapyRemote"
|
||||
rm -rf /tmp/soapyremote
|
||||
git clone -b soapy-remote-0.5.0 --single-branch https://github.com/pothosware/SoapyRemote.git
|
||||
cd SoapyRemote || exit
|
||||
#git checkout tags/release_003_010_001_001
|
||||
mkdir -p build
|
||||
cd build || exit
|
||||
cmake ../
|
||||
echo "Compiling SoapyRemote"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$soapy_install_log"
|
||||
}
|
||||
|
||||
install_soapy_iris_from_source(){
|
||||
iris_install_log=$OPENAIR_DIR/cmake_targets/log/iris_install_log.txt
|
||||
echo_info "\nInstalling Iris driver from source. The log file for Iris driver installation is here: $iris_install_log "
|
||||
(
|
||||
cd /tmp || exit
|
||||
echo "Downloading SoapyIris"
|
||||
rm -rf /tmp/sklk-soapyiris
|
||||
git clone -b soapy-iris-2018.08.0.1 --single-branch https://github.com/skylarkwireless/sklk-soapyiris.git
|
||||
cd sklk-soapyiris || exit
|
||||
mkdir -p build
|
||||
cd build ||exit
|
||||
cmake ../
|
||||
echo "Compiling SoapyIris"
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& "$iris_install_log"
|
||||
}
|
||||
|
||||
check_install_soapy () {
|
||||
#if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
#first we remove old installation
|
||||
$SUDO apt-get remove -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote || true
|
||||
#$SUDO add-apt-repository -y ppa:myriadrf/drivers
|
||||
#$SUDO apt-get update
|
||||
#$SUDO apt-get install -y soapysdr soapysdr-server libsoapysdr-dev python-soapysdr python3-soapysdr soapysdr-module-remote
|
||||
|
||||
#elif [[ "$OS_BASEDISTRO" == "fedora" ]]; then
|
||||
# $SUDO $INSTALLER -y install software-properties-common python3-software-properties python-software-properties subversion git python3 python-numpy python3-numpy cmake swig python-dev
|
||||
install_soapy_from_source
|
||||
#fi
|
||||
install_soapy_iris_from_source
|
||||
|
||||
}
|
||||
|
||||
check_install_ubuntu_packages() {
|
||||
$SUDO $INSTALLER update -y
|
||||
if [[ "$OS_DISTRO" == "ubuntu" ]]; then
|
||||
local LAPACK_LIBNAME="liblapack.so"
|
||||
local LAPACK_TARGET="/usr/lib/atlas-base/atlas/liblapack.so"
|
||||
$SUDO apt install -y software-properties-common
|
||||
case "$(get_distribution_release)" in
|
||||
"ubuntu20.04")
|
||||
specific_packages="libtasn1-6-dev libgnutls28-dev iproute2 libconfig-dev"
|
||||
LAPACK_LIBNAME="liblapack.so-x86_64-linux-gnu"
|
||||
LAPACK_TARGET="/usr/lib/x86_64-linux-gnu/atlas/liblapack.so"
|
||||
;;
|
||||
esac
|
||||
$SUDO $INSTALLER install -y \
|
||||
$specific_packages \
|
||||
check \
|
||||
dialog \
|
||||
dkms \
|
||||
gawk \
|
||||
libboost-all-dev \
|
||||
libpthread-stubs0-dev \
|
||||
openvpn \
|
||||
pkg-config \
|
||||
python3-dev \
|
||||
python-pexpect \
|
||||
sshfs \
|
||||
swig \
|
||||
tshark \
|
||||
uml-utilities \
|
||||
unzip \
|
||||
valgrind \
|
||||
vlan \
|
||||
exuberant-ctags \
|
||||
ntpdate \
|
||||
iperf3 \
|
||||
android-tools-adb \
|
||||
wvdial \
|
||||
python-numpy \
|
||||
sshpass \
|
||||
nscd \
|
||||
bc \
|
||||
ntp \
|
||||
python3-scipy \
|
||||
python3-matplotlib \
|
||||
bison \
|
||||
build-essential \
|
||||
cmake \
|
||||
cmake-curses-gui \
|
||||
ninja-build \
|
||||
doxygen \
|
||||
doxygen-gui \
|
||||
texlive-latex-base \
|
||||
ethtool \
|
||||
flex \
|
||||
gdb \
|
||||
git \
|
||||
graphviz \
|
||||
gtkwave \
|
||||
guile-2.0-dev \
|
||||
iperf \
|
||||
iptables \
|
||||
libxtables-dev \
|
||||
libatlas-base-dev \
|
||||
libblas-dev \
|
||||
liblapack-dev\
|
||||
liblapacke-dev\
|
||||
libffi-dev \
|
||||
libforms-bin \
|
||||
libforms-dev \
|
||||
libgcrypt20-dev \
|
||||
libgmp-dev \
|
||||
libgtk-3-dev \
|
||||
libidn2-0-dev \
|
||||
libidn11-dev \
|
||||
libmysqlclient-dev \
|
||||
libpython2.7-dev \
|
||||
libsctp1 \
|
||||
libsctp-dev \
|
||||
libssl-dev \
|
||||
libtool \
|
||||
libusb-1.0-0-dev \
|
||||
libxml2 \
|
||||
libxml2-dev \
|
||||
libxslt1-dev \
|
||||
mscgen \
|
||||
octave-signal \
|
||||
openssh-client \
|
||||
openssh-server \
|
||||
openssl \
|
||||
python3 \
|
||||
subversion \
|
||||
xmlstarlet \
|
||||
python3-pip \
|
||||
libyaml-dev \
|
||||
wget \
|
||||
libxpm-dev \
|
||||
libboost-all-dev \
|
||||
nettle-dev \
|
||||
nettle-bin
|
||||
fi
|
||||
|
||||
$SUDO update-alternatives --set "$LAPACK_LIBNAME" "$LAPACK_TARGET"
|
||||
|
||||
}
|
||||
|
||||
install_asn1c_from_source(){
|
||||
asn1_install_log=$OPENAIR_DIR/cmake_targets/log/asn1c_install_log.txt
|
||||
echo_info "\nInstalling ASN1. The log file for ASN1 installation is here: $asn1_install_log "
|
||||
(
|
||||
$SUDO rm -rf /tmp/asn1c
|
||||
# GIT_SSL_NO_VERIFY=true git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
git clone https://gitlab.eurecom.fr/oai/asn1c.git /tmp/asn1c
|
||||
cd /tmp/asn1c || exit
|
||||
# better to use a given commit than a branch in case the branch
|
||||
# is updated and requires modifications in the source of OAI
|
||||
#git checkout velichkov_s1ap_plus_option_group
|
||||
git checkout f12568d617dbf48497588f8e227d70388fa217c9
|
||||
autoreconf -iv
|
||||
./configure
|
||||
make -j"$(nproc)"
|
||||
$SUDO make install
|
||||
cd - || exit
|
||||
$SUDO ldconfig
|
||||
) > "$asn1_install_log" 2>&1
|
||||
}
|
||||
|
||||
#################################################
|
||||
# 2. compile
|
||||
################################################
|
||||
|
||||
install_nas_tools() {
|
||||
echo_success "generate .ue_emm.nvram .ue.nvram"
|
||||
./nvram --gen -c "$1" -o "$2"
|
||||
./usim --gen -c "$1" -o "$2"
|
||||
}
|
||||
|
||||
|
||||
################################
|
||||
# set_openair_env
|
||||
###############################
|
||||
set_openair_env(){
|
||||
fullpath=$(readlink -f "${BASH_SOURCE[0]}")
|
||||
[ -f "/.$fullpath" ] || fullpath=$(readlink -f "$PWD/$fullpath")
|
||||
openair_path=${fullpath%/cmake_targets/*}
|
||||
openair_path=${openair_path%/targets/*}
|
||||
openair_path=${openair_path%/openair[123]/*}
|
||||
export OPENAIR_DIR=$openair_path
|
||||
export OPENAIR1_DIR=$openair_path/openair1
|
||||
export OPENAIR2_DIR=$openair_path/openair2
|
||||
export OPENAIR3_DIR=$openair_path/openair3
|
||||
export OPENAIR_TARGETS=$openair_path/targets
|
||||
}
|
||||
|
||||
if ! check_supported_distribution; then
|
||||
echo_error "Your distribution $(get_distribution_release) is not supported by oai !"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo_info "Installing packages"
|
||||
check_install_ubuntu_packages
|
||||
|
||||
echo_info "installing ASN.1 compiler"
|
||||
install_asn1c_from_source
|
||||
|
||||
echo_info "installing protobuf/protobuf-c for flexran agent support"
|
||||
install_protobuf_from_source
|
||||
install_protobuf_c_from_source
|
||||
|
||||
if [ "$1" == "USRP" ] ; then
|
||||
echo_info "installing packages for USRP support"
|
||||
install_usrp_uhd_driver
|
||||
fi
|
||||
if [ "$1" == "BLADERF" ] ; then
|
||||
echo_info "installing packages for BLADERF support"
|
||||
check_install_bladerf_driver
|
||||
flash_firmware_bladerf
|
||||
fi
|
||||
if [ "$1" == "IRIS" ] ; then
|
||||
echo_info "installing packages for IRIS support"
|
||||
check_install_soapy
|
||||
# flash_firmware_iris
|
||||
fi
|
||||
@@ -42,12 +42,12 @@ KERNEL_MAJOR=$(uname -r | cut -d '.' -f2)
|
||||
|
||||
#check if we run inside a container
|
||||
IS_CONTAINER=`egrep -c "docker|podman|kubepods" /proc/self/cgroup || true`
|
||||
#sudo is not needed inside a container
|
||||
if [ $IS_CONTAINER -eq 0 ]
|
||||
#sudo is not needed when we are root
|
||||
if [ "$UID" = 0 ]
|
||||
then
|
||||
SUDO='sudo -S -E'
|
||||
else
|
||||
SUDO=''
|
||||
else
|
||||
SUDO='sudo -S -E'
|
||||
fi
|
||||
|
||||
###############################
|
||||
@@ -251,18 +251,13 @@ install_protobuf_from_source(){
|
||||
#wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gz
|
||||
#tar -xzvf protobuf-2.6.1.tar.gz --owner $USER --group $USER --no-same-owner
|
||||
#cd protobuf-2.6.1/
|
||||
|
||||
|
||||
if [ $IS_CONTAINER -eq 0 ]
|
||||
then
|
||||
rm -rf /tmp/protobuf-cpp-3.3.0.tar.gz* /tmp/protobuf-3.3.0
|
||||
wget --tries=3 --retry-connrefused https://github.com/google/protobuf/releases/download/v3.3.0/protobuf-cpp-3.3.0.tar.gz
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $USER --group $(groups | cut -d" " -f1) --no-same-owner
|
||||
tar -xzvf protobuf-cpp-3.3.0.tar.gz --owner $(id -u) --group $(id -g) --no-same-owner
|
||||
cd protobuf-3.3.0/
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
else
|
||||
export LD_LIBRARY_PATH=/usr/local/lib #protoc needs to know where toclook for shared libs
|
||||
rm -rf /tmp/protobuf
|
||||
@@ -270,11 +265,12 @@ install_protobuf_from_source(){
|
||||
cd /tmp/protobuf
|
||||
git submodule update --init --recursive
|
||||
./autogen.sh
|
||||
./configure
|
||||
make -j`nproc`
|
||||
make install
|
||||
ldconfig
|
||||
fi
|
||||
./configure
|
||||
echo "Compiling protobuf"
|
||||
make -j`nproc`
|
||||
$SUDO make install
|
||||
$SUDO ldconfig
|
||||
) >& $protobuf_install_log
|
||||
}
|
||||
|
||||
|
||||
+12
-9
@@ -397,18 +397,21 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
|
||||
/* define variable only used in LOG macro's */
|
||||
# define LOG_VAR(A,B) A B
|
||||
# else /* T_TRACER: remove all debugging and tracing messages, except errors */
|
||||
# define LOG_I(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ; } while(0)/* */
|
||||
# define LOG_W(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ; } while(0)/* */
|
||||
# define LOG_E(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ; } while(0)/* */
|
||||
# define LOG_D(c, x...) do {logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ; } while(0)/* */
|
||||
# define LOG_T(c, x...) /* */
|
||||
|
||||
# define LOG_DUMPMSG(c, b, s, x...) /* */
|
||||
# define LOG_E(c, x...) do { if( g_log->log_component[c].level >= OAILOG_ERR ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_ERR, x) ;} while (0)
|
||||
# define LOG_W(c, x...) do { if( g_log->log_component[c].level >= OAILOG_WARNING) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_WARNING, x) ;} while (0)
|
||||
# define LOG_I(c, x...) do { if( g_log->log_component[c].level >= OAILOG_INFO ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_INFO, x) ;} while (0)
|
||||
# define LOG_D(c, x...) do { if( g_log->log_component[c].level >= OAILOG_DEBUG ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_DEBUG, x) ;} while (0)
|
||||
# define LOG_T(c, x...) do { if( g_log->log_component[c].level >= OAILOG_TRACE ) logRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, OAILOG_TRACE, x) ;} while (0)
|
||||
# define VLOG(c,l, f, args) do { if( g_log->log_component[c].level >= l ) vlogRecord_mt(__FILE__, __FUNCTION__, __LINE__,c, l, f, args) ; } while (0)
|
||||
|
||||
# define nfapi_log(FILE, FNC, LN, COMP, LVL, FMT...)
|
||||
# define LOG_DEBUGFLAG(D) ( 0 )
|
||||
# define LOG_DUMPFLAG(D) ( 0 )
|
||||
# define LOG_DEBUGFLAG(D) (g_log->dump_mask & D)
|
||||
# define LOG_DUMPFLAG(D) (g_log->debug_mask & D)
|
||||
# define LOG_DUMPMSG(c, f, b, s, x...) do { if(g_log->dump_mask & f) log_dump(c, b, s, LOG_DUMP_CHAR, x) ;} while (0) /* */
|
||||
|
||||
# define LOG_M(file, vector, data, len, dec, format) do { write_file_matlab(file, vector, data, len, dec, format);} while(0)
|
||||
# define LOG_VAR(A,B)
|
||||
# define LOG_VAR(A,B) A B
|
||||
# endif /* T_TRACER */
|
||||
/* avoid warnings for variables only used in LOG macro's but set outside debug section */
|
||||
#define GCC_NOTUSED __attribute__((unused))
|
||||
|
||||
@@ -814,6 +814,7 @@ static inline unsigned long long int vcd_get_time(void)
|
||||
return (long long unsigned int)((time.tv_nsec - g_time_start.tv_nsec)) +
|
||||
((long long unsigned int)time.tv_sec - (long long unsigned int)g_time_start.tv_sec) * 1000000000UL;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
void vcd_signal_dumper_create_header(void)
|
||||
|
||||
@@ -601,11 +601,19 @@ extern int ouput_vcd;
|
||||
|
||||
#else /* T_TRACER */
|
||||
|
||||
#if ENABLE_VCD
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT) vcd_signal_dumper_init(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE() vcd_signal_dumper_close()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER() vcd_signal_dumper_create_header()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_variable_by_name(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2) vcd_signal_dumper_dump_function_by_name(vAr1,vAr2)
|
||||
#else
|
||||
#define VCD_SIGNAL_DUMPER_INIT(aRgUmEnT)
|
||||
#define VCD_SIGNAL_DUMPER_CLOSE()
|
||||
#define VCD_SIGNAL_DUMPER_CREATE_HEADER()
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(vAr1,vAr2)
|
||||
#define VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(vAr1,vAr2)
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* T_TRACER */
|
||||
|
||||
@@ -1,490 +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 "assertions.h"
|
||||
#include "memory_pools.h"
|
||||
|
||||
#if T_TRACER
|
||||
#include <string.h>
|
||||
#include "T.h"
|
||||
#endif
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
const static int mp_debug = 0;
|
||||
|
||||
# define MP_DEBUG(x, args...) do { if (mp_debug) fprintf(stdout, "[MP][D]"x, ##args); fflush (stdout); } \
|
||||
while(0)
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
#ifndef CHARS_TO_UINT32
|
||||
#define CHARS_TO_UINT32(c1, c2, c3, c4) (((c1) << 24) | ((c2) << 16) | ((c3) << 8) | (c4))
|
||||
#endif
|
||||
|
||||
#define MEMORY_POOL_ITEM_INFO_NUMBER 2
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
typedef int32_t items_group_position_t;
|
||||
typedef int32_t items_group_index_t;
|
||||
|
||||
typedef union items_group_positions_u {
|
||||
uint64_t all;
|
||||
struct {
|
||||
items_group_position_t put;
|
||||
items_group_position_t get;
|
||||
} ind;
|
||||
} items_group_positions_t;
|
||||
|
||||
typedef struct items_group_s {
|
||||
items_group_position_t number_plus_one;
|
||||
volatile uint32_t minimum;
|
||||
volatile items_group_positions_t positions;
|
||||
volatile items_group_index_t *indexes;
|
||||
} items_group_t;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
//static const items_group_position_t ITEMS_GROUP_POSITION_INVALID = -1;
|
||||
static const items_group_index_t ITEMS_GROUP_INDEX_INVALID = -1;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
typedef uint32_t pool_item_start_mark_t;
|
||||
typedef uint32_t pool_item_end_mark_t;
|
||||
|
||||
typedef uint32_t memory_pool_data_t;
|
||||
|
||||
typedef uint32_t pool_start_mark_t;
|
||||
|
||||
typedef uint32_t pools_start_mark_t;
|
||||
|
||||
typedef uint8_t pool_id_t;
|
||||
typedef uint8_t item_status_t;
|
||||
|
||||
typedef struct memory_pool_item_start_s {
|
||||
pool_item_start_mark_t start_mark;
|
||||
|
||||
pool_id_t pool_id;
|
||||
item_status_t item_status;
|
||||
uint16_t info[MEMORY_POOL_ITEM_INFO_NUMBER];
|
||||
} memory_pool_item_start_t;
|
||||
|
||||
typedef struct memory_pool_item_end_s {
|
||||
pool_item_end_mark_t end_mark;
|
||||
} memory_pool_item_end_t;
|
||||
|
||||
typedef struct memory_pool_item_s {
|
||||
memory_pool_item_start_t start;
|
||||
memory_pool_data_t data[0];
|
||||
memory_pool_item_end_t end;
|
||||
} memory_pool_item_t;
|
||||
|
||||
typedef struct memory_pool_s {
|
||||
pool_start_mark_t start_mark;
|
||||
|
||||
pool_id_t pool_id;
|
||||
uint32_t item_data_number;
|
||||
uint32_t pool_item_size;
|
||||
items_group_t items_group_free;
|
||||
memory_pool_item_t *items;
|
||||
} memory_pool_t;
|
||||
|
||||
|
||||
typedef struct memory_pools_s {
|
||||
pools_start_mark_t start_mark;
|
||||
|
||||
uint32_t pools_number;
|
||||
uint32_t pools_defined;
|
||||
memory_pool_t *pools;
|
||||
} memory_pools_t;
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static const uint32_t MAX_POOLS_NUMBER = 20;
|
||||
static const uint32_t MAX_POOL_ITEMS_NUMBER = 200 * 1000;
|
||||
static const uint32_t MAX_POOL_ITEM_SIZE = 100 * 1000;
|
||||
|
||||
static const pool_item_start_mark_t POOL_ITEM_START_MARK = CHARS_TO_UINT32 ('P', 'I', 's', 't');
|
||||
static const pool_item_end_mark_t POOL_ITEM_END_MARK = CHARS_TO_UINT32 ('p', 'i', 'E', 'N');
|
||||
|
||||
static const item_status_t ITEM_STATUS_FREE = 'F';
|
||||
static const item_status_t ITEM_STATUS_ALLOCATED = 'a';
|
||||
|
||||
static const pool_start_mark_t POOL_START_MARK = CHARS_TO_UINT32 ('P', '_', 's', 't');
|
||||
|
||||
static const pools_start_mark_t POOLS_START_MARK = CHARS_TO_UINT32 ('P', 'S', 's', 't');
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static inline uint32_t items_group_number_items (items_group_t *items_group) {
|
||||
return items_group->number_plus_one - 1;
|
||||
}
|
||||
|
||||
static inline uint32_t items_group_free_items (items_group_t *items_group) {
|
||||
items_group_positions_t positions;
|
||||
uint32_t free_items;
|
||||
positions.all = items_group->positions.all;
|
||||
free_items = items_group->number_plus_one + positions.ind.put - positions.ind.get;
|
||||
free_items %= items_group->number_plus_one;
|
||||
return free_items;
|
||||
}
|
||||
|
||||
static inline items_group_index_t items_group_get_free_item (items_group_t *items_group) {
|
||||
items_group_position_t get_raw;
|
||||
items_group_position_t put;
|
||||
items_group_position_t get;
|
||||
items_group_position_t free_items;
|
||||
items_group_index_t index = ITEMS_GROUP_INDEX_INVALID;
|
||||
/* Get current put position */
|
||||
put = items_group->positions.ind.put % items_group->number_plus_one;
|
||||
/* Get current get position and increase it */
|
||||
get_raw = __sync_fetch_and_add (&items_group->positions.ind.get, 1);
|
||||
get = get_raw % items_group->number_plus_one;
|
||||
|
||||
if(put == get) {
|
||||
/* No more item free, restore previous position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.get, 1);
|
||||
} else {
|
||||
/* Get index at current get position */
|
||||
index = items_group->indexes[get];
|
||||
|
||||
if (index <= ITEMS_GROUP_INDEX_INVALID) {
|
||||
/* Index has not yet been completely freed, restore previous get position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.get, 1);
|
||||
} else {
|
||||
if (get_raw == items_group->number_plus_one) {
|
||||
/* Wrap get position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.get, items_group->number_plus_one);
|
||||
}
|
||||
|
||||
free_items = items_group_free_items(items_group);
|
||||
|
||||
/* Updates minimum free items if needed */
|
||||
while (items_group->minimum > free_items) {
|
||||
items_group->minimum = free_items;
|
||||
}
|
||||
|
||||
/* Clear index at current get position to indicate that item is free */
|
||||
items_group->indexes[get] = ITEMS_GROUP_INDEX_INVALID;
|
||||
}
|
||||
}
|
||||
|
||||
return (index);
|
||||
}
|
||||
|
||||
static inline int items_group_put_free_item (items_group_t *items_group, items_group_index_t index) {
|
||||
items_group_position_t put_raw;
|
||||
items_group_position_t put;
|
||||
/* Get current put position and increase it */
|
||||
put_raw = __sync_fetch_and_add (&items_group->positions.ind.put, 1);
|
||||
put = put_raw % items_group->number_plus_one;
|
||||
|
||||
if (put_raw == items_group->number_plus_one) {
|
||||
/* Wrap position */
|
||||
__sync_fetch_and_sub (&items_group->positions.ind.put, items_group->number_plus_one);
|
||||
}
|
||||
|
||||
AssertError (items_group->indexes[put] <= ITEMS_GROUP_INDEX_INVALID, return (EXIT_FAILURE),
|
||||
"Index at current put position (%d) is not marked as free (%d)!\n", put, items_group->number_plus_one);
|
||||
/* Save freed item index at current put position */
|
||||
items_group->indexes[put] = index;
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
static inline memory_pools_t *memory_pools_from_handler (memory_pools_handle_t memory_pools_handle) {
|
||||
memory_pools_t *memory_pools;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = (memory_pools_t *) memory_pools_handle;
|
||||
/* Sanity check on passed handle */
|
||||
AssertError (memory_pools->start_mark == POOLS_START_MARK, memory_pools = NULL,
|
||||
"Handle %p is not a valid memory pools handle, start mark is missing!\n", memory_pools_handle);
|
||||
return (memory_pools);
|
||||
}
|
||||
|
||||
static inline memory_pool_item_t *memory_pool_item_from_handler (memory_pool_item_handle_t memory_pool_item_handle) {
|
||||
void *address;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
/* Recover memory_pools */
|
||||
address = memory_pool_item_handle - sizeof(memory_pool_item_start_t);
|
||||
memory_pool_item = (memory_pool_item_t *) address;
|
||||
/* Sanity check on passed handle */
|
||||
AssertError (memory_pool_item->start.start_mark == POOL_ITEM_START_MARK, memory_pool_item = NULL,
|
||||
"Handle %p is not a valid memory pool item handle, start mark is missing!\n", memory_pool_item);
|
||||
return (memory_pool_item);
|
||||
}
|
||||
|
||||
static inline memory_pool_item_t *memory_pool_item_from_index (memory_pool_t *memory_pool, items_group_index_t index) {
|
||||
void *address;
|
||||
address = (void *) memory_pool->items;
|
||||
address += index * memory_pool->pool_item_size;
|
||||
return (address);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
memory_pools_handle_t memory_pools_create (uint32_t pools_number) {
|
||||
memory_pools_t *memory_pools;
|
||||
pool_id_t pool;
|
||||
AssertFatal (pools_number <= MAX_POOLS_NUMBER, "Too many memory pools requested (%d/%d)!\n", pools_number, MAX_POOLS_NUMBER); /* Limit to a reasonable number of pools */
|
||||
/* Allocate memory_pools */
|
||||
memory_pools = malloc (sizeof(memory_pools_t));
|
||||
AssertFatal (memory_pools != NULL, "Memory pools structure allocation failed!\n");
|
||||
/* Initialize memory_pools */
|
||||
{
|
||||
memory_pools->start_mark = POOLS_START_MARK;
|
||||
memory_pools->pools_number = pools_number;
|
||||
memory_pools->pools_defined = 0;
|
||||
/* Allocate pools */
|
||||
memory_pools->pools = calloc (pools_number, sizeof(memory_pool_t));
|
||||
AssertFatal (memory_pools->pools != NULL, "Memory pools allocation failed!\n");
|
||||
|
||||
/* Initialize pools */
|
||||
for (pool = 0; pool < pools_number; pool++) {
|
||||
memory_pools->pools[pool].start_mark = POOL_START_MARK;
|
||||
}
|
||||
}
|
||||
return ((memory_pools_handle_t) memory_pools);
|
||||
}
|
||||
|
||||
char *memory_pools_statistics(memory_pools_handle_t memory_pools_handle) {
|
||||
memory_pools_t *memory_pools;
|
||||
pool_id_t pool;
|
||||
char *statistics;
|
||||
int printed_chars;
|
||||
uint32_t allocated_pool_memory;
|
||||
uint32_t allocated_pools_memory = 0;
|
||||
items_group_t *items_group;
|
||||
uint32_t pool_items_size;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertFatal (memory_pools != NULL, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
statistics = malloc(memory_pools->pools_defined * 200);
|
||||
printed_chars = sprintf (&statistics[0], "Pool: size, number, minimum, free, address space and memory used in Kbytes\n");
|
||||
|
||||
for (pool = 0; pool < memory_pools->pools_defined; pool++) {
|
||||
items_group = &memory_pools->pools[pool].items_group_free;
|
||||
allocated_pool_memory = items_group_number_items (items_group) * memory_pools->pools[pool].pool_item_size;
|
||||
allocated_pools_memory += allocated_pool_memory;
|
||||
pool_items_size = memory_pools->pools[pool].item_data_number * sizeof(memory_pool_data_t);
|
||||
printed_chars += sprintf (&statistics[printed_chars], " %2u: %6u, %6u, %6u, %6u, [%p-%p] %6u\n",
|
||||
pool, pool_items_size,
|
||||
items_group_number_items (items_group),
|
||||
items_group->minimum,
|
||||
items_group_free_items (items_group),
|
||||
memory_pools->pools[pool].items,
|
||||
((void *) memory_pools->pools[pool].items) + allocated_pool_memory,
|
||||
allocated_pool_memory / (1024));
|
||||
}
|
||||
|
||||
printed_chars = sprintf (&statistics[printed_chars], "Pools memory %u Kbytes\n", allocated_pools_memory / (1024));
|
||||
return (statistics);
|
||||
}
|
||||
|
||||
int memory_pools_add_pool (memory_pools_handle_t memory_pools_handle, uint32_t pool_items_number, uint32_t pool_item_size) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_t *memory_pool;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
AssertFatal (pool_items_number <= MAX_POOL_ITEMS_NUMBER, "Too many items for a memory pool (%u/%d)!\n", pool_items_number, MAX_POOL_ITEMS_NUMBER); /* Limit to a reasonable number of items */
|
||||
AssertFatal (pool_item_size <= MAX_POOL_ITEM_SIZE, "Item size is too big for memory pool items (%u/%d)!\n", pool_item_size, MAX_POOL_ITEM_SIZE); /* Limit to a reasonable item size */
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertFatal (memory_pools != NULL, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
/* Check number of already created pools */
|
||||
AssertFatal (memory_pools->pools_defined < memory_pools->pools_number, "Can not allocate more memory pool (%d)!\n", memory_pools->pools_number);
|
||||
/* Select pool */
|
||||
pool = memory_pools->pools_defined;
|
||||
memory_pool = &memory_pools->pools[pool];
|
||||
/* Initialize pool */
|
||||
{
|
||||
memory_pool->pool_id = pool;
|
||||
/* Item size in memory_pool_data_t items by excess */
|
||||
memory_pool->item_data_number = (pool_item_size + sizeof(memory_pool_data_t) - 1) / sizeof(memory_pool_data_t);
|
||||
memory_pool->pool_item_size = (memory_pool->item_data_number * sizeof(memory_pool_data_t)) + sizeof(memory_pool_item_t);
|
||||
memory_pool->items_group_free.number_plus_one = pool_items_number + 1;
|
||||
memory_pool->items_group_free.minimum = pool_items_number;
|
||||
memory_pool->items_group_free.positions.ind.put = pool_items_number;
|
||||
memory_pool->items_group_free.positions.ind.get = 0;
|
||||
/* Allocate free indexes */
|
||||
memory_pool->items_group_free.indexes = malloc(memory_pool->items_group_free.number_plus_one * sizeof(items_group_index_t));
|
||||
AssertFatal (memory_pool->items_group_free.indexes != NULL, "Memory pool indexes allocation failed!\n");
|
||||
|
||||
/* Initialize free indexes */
|
||||
for (item_index = 0; item_index < pool_items_number; item_index++) {
|
||||
memory_pool->items_group_free.indexes[item_index] = item_index;
|
||||
}
|
||||
|
||||
/* Last index is not allocated */
|
||||
memory_pool->items_group_free.indexes[item_index] = ITEMS_GROUP_INDEX_INVALID;
|
||||
/* Allocate items */
|
||||
memory_pool->items = calloc (pool_items_number, memory_pool->pool_item_size);
|
||||
AssertFatal (memory_pool->items != NULL, "Memory pool items allocation failed!\n");
|
||||
|
||||
/* Initialize items */
|
||||
for (item_index = 0; item_index < pool_items_number; item_index++) {
|
||||
memory_pool_item = memory_pool_item_from_index (memory_pool, item_index);
|
||||
memory_pool_item->start.start_mark = POOL_ITEM_START_MARK;
|
||||
memory_pool_item->start.pool_id = pool;
|
||||
memory_pool_item->start.item_status = ITEM_STATUS_FREE;
|
||||
memory_pool_item->data[memory_pool->item_data_number] = POOL_ITEM_END_MARK;
|
||||
}
|
||||
}
|
||||
memory_pools->pools_defined ++;
|
||||
return (0);
|
||||
}
|
||||
|
||||
memory_pool_item_handle_t memory_pools_allocate (memory_pools_handle_t memory_pools_handle, uint32_t item_size, uint16_t info_0, uint16_t info_1) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
memory_pool_item_handle_t memory_pool_item_handle = NULL;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index = ITEMS_GROUP_INDEX_INVALID;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertError (memory_pools != NULL, {}, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
|
||||
for (pool = 0; pool < memory_pools->pools_defined; pool++) {
|
||||
if ((memory_pools->pools[pool].item_data_number * sizeof(memory_pool_data_t)) < item_size) {
|
||||
/* This memory pool has too small items, skip it */
|
||||
continue;
|
||||
}
|
||||
|
||||
item_index = items_group_get_free_item(&memory_pools->pools[pool].items_group_free);
|
||||
|
||||
if (item_index <= ITEMS_GROUP_INDEX_INVALID) {
|
||||
/* Allocation failed, skip this pool */
|
||||
continue;
|
||||
} else {
|
||||
/* Allocation succeed, exit searching loop */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (item_index > ITEMS_GROUP_INDEX_INVALID) {
|
||||
/* Convert item index into memory_pool_item address */
|
||||
memory_pool_item = memory_pool_item_from_index (&memory_pools->pools[pool], item_index);
|
||||
/* Sanity check on item status, must be free */
|
||||
AssertFatal (memory_pool_item->start.item_status == ITEM_STATUS_FREE, "Item status is not set to free (%d) in pool %u, item %d!\n",
|
||||
memory_pool_item->start.item_status, pool, item_index);
|
||||
memory_pool_item->start.item_status = ITEM_STATUS_ALLOCATED;
|
||||
memory_pool_item->start.info[0] = info_0;
|
||||
memory_pool_item->start.info[1] = info_1;
|
||||
memory_pool_item_handle = memory_pool_item->data;
|
||||
MP_DEBUG(" Alloc [%2u][%6d]{%6d}, %3u %3u, %6u, %p, %p, %p\n",
|
||||
pool, item_index,
|
||||
items_group_free_items (&memory_pools->pools[pool].items_group_free),
|
||||
info_0, info_1,
|
||||
item_size,
|
||||
memory_pools->pools[pool].items,
|
||||
memory_pool_item,
|
||||
memory_pool_item_handle);
|
||||
} else {
|
||||
MP_DEBUG(" Alloc [--][------]{------}, %3u %3u, %6u, failed!\n", info_0, info_1, item_size);
|
||||
}
|
||||
|
||||
return memory_pool_item_handle;
|
||||
}
|
||||
|
||||
int memory_pools_free (memory_pools_handle_t memory_pools_handle, memory_pool_item_handle_t memory_pool_item_handle, uint16_t info_0) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index;
|
||||
uint32_t item_size;
|
||||
uint32_t pool_item_size;
|
||||
uint16_t info_1;
|
||||
int result;
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertError (memory_pools != NULL, return (EXIT_FAILURE), "Failed to retrieve memory pools for handle %p!\n", memory_pools_handle);
|
||||
/* Recover memory pool item */
|
||||
memory_pool_item = memory_pool_item_from_handler (memory_pool_item_handle);
|
||||
AssertError (memory_pool_item != NULL, return (EXIT_FAILURE), "Failed to retrieve memory pool item for handle %p!\n", memory_pool_item_handle);
|
||||
info_1 = memory_pool_item->start.info[1];
|
||||
/* Recover pool index */
|
||||
pool = memory_pool_item->start.pool_id;
|
||||
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
|
||||
item_size = memory_pools->pools[pool].item_data_number;
|
||||
pool_item_size = memory_pools->pools[pool].pool_item_size;
|
||||
item_index = (((void *) memory_pool_item) - ((void *) memory_pools->pools[pool].items)) / pool_item_size;
|
||||
MP_DEBUG(" Free [%2u][%6d]{%6d}, %3u %3u, %p, %p, %p, %u\n",
|
||||
pool, item_index,
|
||||
items_group_free_items (&memory_pools->pools[pool].items_group_free),
|
||||
memory_pool_item->start.info[0], info_1,
|
||||
memory_pool_item_handle, memory_pool_item,
|
||||
memory_pools->pools[pool].items, ((uint32_t) (item_size * sizeof(memory_pool_data_t))));
|
||||
/* Sanity check on calculated item index */
|
||||
AssertFatal (memory_pool_item == memory_pool_item_from_index(&memory_pools->pools[pool], item_index),
|
||||
"Incorrect memory pool item address (%p, %p) for pool %u, item %d!\n",
|
||||
memory_pool_item,(void *)memory_pool_item_from_index(&memory_pools->pools[pool], item_index), pool, item_index);
|
||||
/* Sanity check on end marker, must still be present (no write overflow) */
|
||||
AssertFatal (memory_pool_item->data[item_size] == POOL_ITEM_END_MARK,
|
||||
"Memory pool item is corrupted, end mark is not present for pool %u, item %d!\n", pool, item_index);
|
||||
/* Sanity check on item status, must be allocated */
|
||||
AssertFatal (memory_pool_item->start.item_status == ITEM_STATUS_ALLOCATED,
|
||||
"Trying to free a non allocated (%x) memory pool item (pool %u, item %d)!\n",
|
||||
memory_pool_item->start.item_status, pool, item_index);
|
||||
memory_pool_item->start.item_status = ITEM_STATUS_FREE;
|
||||
result = items_group_put_free_item(&memory_pools->pools[pool].items_group_free, item_index);
|
||||
AssertError (result == EXIT_SUCCESS, {}, "Failed to free memory pool item (pool %u, item %d)!\n", pool, item_index);
|
||||
return (result);
|
||||
}
|
||||
|
||||
void memory_pools_set_info (memory_pools_handle_t memory_pools_handle, memory_pool_item_handle_t memory_pool_item_handle, int index, uint16_t info) {
|
||||
memory_pools_t *memory_pools;
|
||||
memory_pool_item_t *memory_pool_item;
|
||||
pool_id_t pool;
|
||||
items_group_index_t item_index;
|
||||
uint32_t item_size;
|
||||
uint32_t pool_item_size;
|
||||
AssertFatal (index < MEMORY_POOL_ITEM_INFO_NUMBER, "Incorrect info index (%d/%d)!\n", index, MEMORY_POOL_ITEM_INFO_NUMBER);
|
||||
/* Recover memory pool item */
|
||||
memory_pool_item = memory_pool_item_from_handler (memory_pool_item_handle);
|
||||
AssertFatal (memory_pool_item != NULL, "Failed to retrieve memory pool item for handle %p!\n", memory_pool_item_handle);
|
||||
/* Set info[1] */
|
||||
memory_pool_item->start.info[index] = info;
|
||||
|
||||
/* Check item validity and log (not mandatory) */
|
||||
if (1) {
|
||||
/* Recover memory_pools */
|
||||
memory_pools = memory_pools_from_handler (memory_pools_handle);
|
||||
AssertFatal (memory_pools != NULL, "Failed to retrieve memory pool for handle %p!\n", memory_pools_handle);
|
||||
/* Recover pool index */
|
||||
pool = memory_pool_item->start.pool_id;
|
||||
AssertFatal (pool < memory_pools->pools_defined, "Pool index is invalid (%u/%u)!\n", pool, memory_pools->pools_defined);
|
||||
item_size = memory_pools->pools[pool].item_data_number;
|
||||
pool_item_size = memory_pools->pools[pool].pool_item_size;
|
||||
item_index = (((void *) memory_pool_item) - ((void *) memory_pools->pools[pool].items)) / pool_item_size;
|
||||
MP_DEBUG(" Info [%2u][%6d]{%6d}, %3u %3u, %p, %p, %p, %u\n",
|
||||
pool, item_index,
|
||||
items_group_free_items (&memory_pools->pools[pool].items_group_free),
|
||||
memory_pool_item->start.info[0], memory_pool_item->start.info[1],
|
||||
memory_pool_item_handle, memory_pool_item,
|
||||
memory_pools->pools[pool].items, ((uint32_t) (item_size * sizeof(memory_pool_data_t))));
|
||||
/* Sanity check on calculated item index */
|
||||
AssertFatal (memory_pool_item == memory_pool_item_from_index(&memory_pools->pools[pool], item_index),
|
||||
"Incorrect memory pool item address (%p, %p) for pool %u, item %d!\n",
|
||||
memory_pool_item, (void *)memory_pool_item_from_index(&memory_pools->pools[pool], item_index), pool, item_index);
|
||||
/* Sanity check on end marker, must still be present (no write overflow) */
|
||||
AssertFatal (memory_pool_item->data[item_size] == POOL_ITEM_END_MARK,
|
||||
"Memory pool item is corrupted, end mark is not present for pool %u, item %d!\n", pool, item_index);
|
||||
/* Sanity check on item status, must be allocated */
|
||||
AssertFatal (memory_pool_item->start.item_status == ITEM_STATUS_ALLOCATED,
|
||||
"Trying to free a non allocated (%x) memory pool item (pool %u, item %d)\n",
|
||||
memory_pool_item->start.item_status, pool, item_index);
|
||||
}
|
||||
}
|
||||
@@ -6,10 +6,9 @@ Each worker loop on pick from the same input queue jobs to do.
|
||||
|
||||
When a job is done, the worker sends a return if a return is defined.
|
||||
|
||||
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
|
||||
A selective abort allows to cancel parallel jobs (usage: a client pushed jobs, but from a response of one job, the other linked jobs becomes useless).
|
||||
|
||||
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client,
|
||||
so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
|
||||
All the thread pool functions are thread safe, nevertheless the working functions are implemented by the thread pool client, so the client has to tackle the parallel execution of his functions called "processingFunc" hereafter.
|
||||
|
||||
## license
|
||||
Author:
|
||||
@@ -18,65 +17,187 @@ When a job is done, the worker sends a return if a return is defined.
|
||||
|
||||
# jobs
|
||||
|
||||
A job is a message (notifiedFIFO_elt_t):
|
||||
next:
|
||||
internal FIFO chain, do not set it
|
||||
key:
|
||||
a long int that the client can use to identify a message or a group of messages
|
||||
responseFifo:
|
||||
if the client defines a response FIFO, the message will be posted back after processing
|
||||
processingFunc:
|
||||
any funtion (type void processingFunc(void *)) that the worker will launch
|
||||
msgData:
|
||||
the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
|
||||
malloced:
|
||||
a boolean that enable internal free in these cases:
|
||||
no return Fifo or Abort feature
|
||||
A job is a message (notifiedFIFO_elt_t):
|
||||
|
||||
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
|
||||
* next:
|
||||
internal FIFO chain, do not set it
|
||||
* key:
|
||||
a long int that the client can use to identify a message or a group of messages
|
||||
* ResponseFifo:
|
||||
if the client defines a response FIFO, the message will be posted back after processing
|
||||
* processingFunc:
|
||||
any funtion (type void processingFunc(void *)) that the worker will launch
|
||||
* msgData:
|
||||
the data passed to processingFunc. It can be added automatically, or you can set it to a buffer you are managing
|
||||
* malloced:
|
||||
a boolean that enable internal free in these cases:
|
||||
no return Fifo or Abort feature
|
||||
|
||||
The job messages can be created with newNotifiedFIFO_elt() and delNotifiedFIFO_elt() or managed by the client.
|
||||
|
||||
# Queues of jobs
|
||||
|
||||
Queues are type of:
|
||||
notifiedFIFO_t that must be initialized by init_notifiedFIFO()
|
||||
No delete function is required, the creator has only to free the data of type notifiedFIFO_t
|
||||
Queues are type of:
|
||||
|
||||
push_notifiedFIFO() add a job in the queue
|
||||
pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
|
||||
* notifiedFIFO_t that must be initialized by init_notifiedFIFO()
|
||||
* No delete function is required, the creator has only to free the data of type notifiedFIFO_t
|
||||
* push_notifiedFIFO() add a job in the queue
|
||||
* pull_notifiedFIFO() is blocking, poll_notifiedFIFO() is non blocking
|
||||
* abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
|
||||
|
||||
abort_notifiedFIFO() allows the customer to delete all waiting jobs that match with the key (see key in jobs definition)
|
||||
These queues details hereafter
|
||||
|
||||
## Common
|
||||
|
||||
newNotifiedFIFO_elt()
|
||||
|
||||
creates a message, that will later be used in queues/FIFO
|
||||
|
||||
delNotifiedFIFO_elt()
|
||||
|
||||
deletes it
|
||||
|
||||
NotifiedFifoData()
|
||||
|
||||
gives a pointer to the beginning of free usage memory in a message (you can put any data there, up to 'size' parameter you passed to newNotifiedFIFO_elt()
|
||||
|
||||
These 3 calls are not mandatory, you can also use your own memory to save the malloc()/free() that are behind these calls
|
||||
iFirst level: non thread safe FIFO (or queues)
|
||||
|
||||
# low level: fast and simple
|
||||
|
||||
initNotifiedFIFO_nothreadSafe()
|
||||
|
||||
to create a queue
|
||||
|
||||
pushNotifiedFIFO_nothreadSafe()
|
||||
|
||||
Add a element in a queue
|
||||
|
||||
pullNotifiedFIFO_nothreadSafe()
|
||||
|
||||
pull a element from a queue
|
||||
|
||||
As these queues are not thread safe, there is NO blocking mechanism, neither pull() versus poll() calls
|
||||
|
||||
There is no delete for a message queue: you only have to abandon the memory you allocated to call iinitNotifiedFIFO_nothreadSafe(notifiedFIFO_t *nf)
|
||||
|
||||
So if you malloced the memory under 'nf' parameter you have to free it, if it is automatic variable (local variable) or global variable, nothing is to be done.
|
||||
|
||||
|
||||
## thread safe queues
|
||||
|
||||
These queues are built on not thread safe queues when we need thread to thread protection
|
||||
|
||||
initNotifiedFIFO()
|
||||
|
||||
to create a queue
|
||||
|
||||
pushNotifiedFIFO()
|
||||
|
||||
Add a element in a queue
|
||||
|
||||
pullNotifiedFIFO()
|
||||
|
||||
pull a element from a queue, this call is blocking until a message arrived
|
||||
|
||||
pollNotifiedFIFO()
|
||||
|
||||
pull a element from a queue, this call is not blocking, so it returns always very shortly
|
||||
|
||||
in 99.9% cases, pull() is better than poll()
|
||||
|
||||
No delete() call, same principle as not thread safe queues
|
||||
|
||||
# Thread pools
|
||||
|
||||
## initialization
|
||||
The clients can create one or more thread pools with init_tpool()
|
||||
the params string structure:
|
||||
describes a list of cores, separated by "," that run a worker thread
|
||||
The clients can create one or more thread pools with init_tpool()
|
||||
|
||||
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and
|
||||
the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
|
||||
the params string structure: describes a list of cores, separated by "," that run a worker thread
|
||||
|
||||
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
|
||||
If the core exists on the CPU, the thread pool initialization sets the affinity between this thread and the related code (use negative values is allowed, so the thread will never be mapped on a specific core).
|
||||
|
||||
The threads are all Linux real time scheduler, their name is set automatically is "Tpool_<core id>"
|
||||
|
||||
## adding jobs
|
||||
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
|
||||
The client create their jobs messages as a notifiedFIFO_elt_t, then they push it with pushTpool() (that internally calls push_notifiedFIFO())
|
||||
|
||||
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
|
||||
If they need a return, they have to create response queues with init_notifiedFIFO() and set this FIFO pointer in the notifiedFIFO_elt_t before pushing the job.
|
||||
|
||||
## abort
|
||||
|
||||
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
|
||||
A abort service abortTpool() allows to abort all jobs that match a key (see jobs "key"). When the abort returns, it garanties no job (matching the key) response will be posted on response queues.
|
||||
|
||||
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
|
||||
Nevertheless, jobs already performed before the return of abortTpool() are pushed in the response Fifo queue.
|
||||
|
||||
## API details
|
||||
Each thread pool (there can be several in the same process) should be initialized
|
||||
|
||||
### initTpool(char *params,tpool_t *pool, bool performanceMeas) is to be called oncepool
|
||||
|
||||
the configuration parameter is a string, elements separated by ",":
|
||||
|
||||
* N: if a N is in the parameter list, no threads are created
|
||||
The purpose is to keep the same API in any case
|
||||
* a CPU with a little number of cores,
|
||||
or in debugging sessions to simplify the human work
|
||||
* a number that represent a valid CPU core on the target CPU
|
||||
A thread is created and stick on the core (with set affinity)
|
||||
* a number that is not a valid CPU core
|
||||
a floating thread is created (Linux is responsible of the real time core allocation)
|
||||
|
||||
example: "-1,-1,-1"
|
||||
as there is no core number -1, the thread pool is made of 3 floating threads
|
||||
be careful with fix allocation: it is hard to be more clever than Linux kernel
|
||||
|
||||
pool is the memory you allocated before to store the thread pool internal state (same concept as above queues)
|
||||
|
||||
performanceMeas is a flag to enable measurements (well described in documentation)
|
||||
|
||||
### pushTpool(tpool_t *t, notifiedFIFO_elt_t *msg)
|
||||
|
||||
adds a job to do in the thread pool
|
||||
|
||||
The msg data you can set are:
|
||||
|
||||
* key:
|
||||
a value for you that you will find back in the response
|
||||
it is also the key for abortTpool()
|
||||
* reponseFifo
|
||||
if you set it, the message will be sent back on this queue when the job is done
|
||||
if you don't set it, no return is performed, the thread pool frees the message 'msg' when the job is done
|
||||
* processingFunc
|
||||
the function the job will run. the function prototype is void <func>(void *memory)
|
||||
the data part (the pointer returned by NotifiedFifoData(msg)) is passed to the function
|
||||
it is used to send data to the processing function and also to write back results
|
||||
of course, writing back results will lead you to use also a return queue (the parameter reponseFifo)
|
||||
|
||||
### pullTpool() collects job result in a return queue
|
||||
|
||||
you collect results in one result queue: the message you gave to pushTpool(), nevertheless it has been updated by processingFunc()
|
||||
|
||||
An example of multiple return queues, in eNB: I created one single thread pool (because it depends mainly on CPU hardware), but i use two return queues: one for turbo encode, one for turbo decode.
|
||||
|
||||
### tryPullTpool()
|
||||
|
||||
is the same, but not blocking (pollTpool() would have been a better name)
|
||||
|
||||
### abortTpool()
|
||||
|
||||
Is a facility to cancel work you pushed to a thread pool
|
||||
|
||||
I used it once: when eNB performs turbo decode, I push all segments in the thread pool.
|
||||
|
||||
But when I get back the decoding results, if one segment can't be decoded, I don't need the results of the other segments of the same UE.
|
||||
|
||||
## Performance measurements
|
||||
|
||||
A performance measurement is integrated:
|
||||
the pool will automacillay fill timestamps:
|
||||
|
||||
* creationTime:
|
||||
time the request is push to the pool;
|
||||
A performance measurement is integrated:
|
||||
the pool will automacillay fill timestamps:
|
||||
|
||||
* creationTime:
|
||||
time the request is push to the pool;
|
||||
* startProcessingTime:
|
||||
time a worker start to run on the job
|
||||
* endProcessingTime:
|
||||
|
||||
+107
@@ -0,0 +1,107 @@
|
||||
<style type="text/css" rel="stylesheet">
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #fff;
|
||||
background-color: #110F14;
|
||||
}
|
||||
h2 { margin-left: 20px; }
|
||||
h3 { margin-left: 40px; }
|
||||
h4 { margin-left: 60px; }
|
||||
|
||||
.func2 { margin-left: 20px; }
|
||||
.func3 { margin-left: 40px; }
|
||||
.func4 { margin-left: 60px; }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
This tuto for 5G gNB NAS design
|
||||
{: .text-center}
|
||||
|
||||
# source files
|
||||
|
||||
executables/ocp-gnb.c: a main loop to create a debuggable gNB, see document SW_archi.md
|
||||
openair2/RRC/NR/nr_ngap_gNB.c: skeleton for interface with NGAP
|
||||
openair3/NAS/COMMON/milenage.h: a simple milenage implementation, depend only on crypto library
|
||||
openair3/NAS/COMMON/NR_NAS_defs.h: messages defined for NAS implemented in C: C struct, C enums and automatic conversion to labels for debug messages
|
||||
openair3/NAS/COMMON/nr_common.c: 5G NAS common code between gNB and UE
|
||||
openair3/UICC/usim_interface.c: UICC simulation for USIM messages
|
||||
|
||||
openair3/NAS/NR_UE/ue_process_nas.c: NAS code for UE
|
||||
|
||||
openair3/NAS/gNB/network_process_nas.c: NAS code for gNB running without 5GC
|
||||
|
||||
openair3/TEST/test5Gnas.c: unitary testing of NAS messages: encodes+decode a standard network entry, mixing code from UE and 5GC (or gNB in noCore)
|
||||
|
||||
# USIM simulation
|
||||
A new USIM simulation, that parameters are in regular OAI config files
|
||||
|
||||
## To open the USIM
|
||||
init_uicc() takes a parameter: the name of the block in the config file
|
||||
In case we run several UEs in one process, the variable section name allows to make several UEs configurations in one config file.
|
||||
|
||||
The NAS implementation uses this possibility.
|
||||
|
||||
# UE side
|
||||
UEprocessNAS() is the entry for all messages.
|
||||
It decodes the message type and call the specific function for each messgae
|
||||
|
||||
## Identityrequest + IdentityResponse
|
||||
When the UE receives the request, it stores the 5GC request parameters in the UE context ( UE->uicc pointer)
|
||||
It calls "scheduleNAS", that would trigger a answer (seeing general archtecture, it will probly be a itti message to future RRC or NGAP thread).
|
||||
|
||||
When the scheduler wants to encode the answer, it calls identityResponse()
|
||||
The UE search for a section in the config file called "uicc"
|
||||
it encodes the NAS answer with the IMSI, as a 4G compatible authentication.
|
||||
A future release would encode 5G SUPI as native 5G UICC.
|
||||
|
||||
## Authenticationrequest + authenticationResponse
|
||||
When the UE receives the request, it stores the 5GC request parameters in the UE context ( UE->uicc pointer)
|
||||
It calls "scheduleNAS", that would trigger a answer (seeing general archtecture, it will probly be a itti message to future RRC or NGAP thread).
|
||||
|
||||
When the scheduler wants to encode the answer, it calls authenticationResponse()
|
||||
The UE search for a section in the config file called "uicc"
|
||||
It uses the Milenage parameters of this section to encode a milenage response
|
||||
A future release would encode 5G new authentication cyphering functions.
|
||||
|
||||
## SecurityModeCommand + securityModeComplete
|
||||
When the UE receives the request it will:
|
||||
Selected NAS security algorithms: store it for future encoding
|
||||
Replayed UE security capabilities: check if it is equal to UE capabilities it sent to the 5GC
|
||||
IMEISV request: to implement
|
||||
ngKSI: Key set Indicator, similator to 4G to select a ciphering keys set
|
||||
|
||||
When the scheduler wants to encode the answer, it calls registrationComplete()
|
||||
|
||||
## registrationComplete
|
||||
To be defined in UE, this NAS message is done after RRC sequence completes
|
||||
|
||||
# gNB side
|
||||
gNB NGAP thread receives the NAS message from PHY layers
|
||||
In normal mode, it send it to the core network with no decoding.
|
||||
|
||||
Here after, the gNB mode "noCore" processing in gNB: NGAP calls the entry function: processNAS() instead of forwarding the packet to the 5GC
|
||||
|
||||
## RRCModeComplete + Identityrequest
|
||||
When the gNB completes RRC attach, it sends a first message to NGAP thread.
|
||||
Normal processing sends NGAP initial UE message, in noCore mode, it should call: identityRequest() that encode the NAS identity request inside the gNB.
|
||||
The gNB NGAP thread then should call the piece of code that forward the message to the UE as when it receives a NAS message from 5GC.
|
||||
|
||||
## All NAS coming from UE
|
||||
When NGAP thread receives a NAS message from lower layers, it encapsulates it to forward it to the 5GC. In "noCore" mode it calls processNAS().
|
||||
|
||||
This function stores in the gNB the NAS data, then it should encode the next message (identity, authentication, security mode) or do nothing (registration complete).
|
||||
|
||||
|
||||
<div class="panel panel-info">
|
||||
**Note**
|
||||
{: .panel-heading}
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -254,9 +254,11 @@ The NAS layer is based on **3GPP 24.301** and implements the following functions
|
||||
The following features are valid for the gNB and the 5G-NR UE.
|
||||
|
||||
* Static TDD,
|
||||
* FDD
|
||||
* Normal CP
|
||||
* 30 kHz subcarrier spacing
|
||||
* Bandwidths up to 80MHz (217 Physical Resource Blocks)
|
||||
* Intermediate downlink and uplink frequencies to interface with IF equipment
|
||||
* Single antenna port (single beam)
|
||||
* Slot format: 14 OFDM symbols in UL or DL
|
||||
* Highly efficient 3GPP compliant LDPC encoder and decoder (BG1 and BG2 supported)
|
||||
|
||||
@@ -132,6 +132,42 @@ With the RF simulator (on the same machine):
|
||||
|
||||
`sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --do-ra --rfsim --parallel-config PARALLEL_SINGLE_THREAD`
|
||||
|
||||
## IF setup with OAI
|
||||
|
||||
The -C and -CO flags can be used together at UE side to set custom downlink and uplink FR1 intermediate frequencies for the IF equipment.
|
||||
|
||||
In order to run this setup, the following flags are needed at the UE side:
|
||||
|
||||
`-C`
|
||||
|
||||
`--CO`
|
||||
|
||||
and the following parameters must be configured in the RUs section of the gNB configuration file:
|
||||
|
||||
`if_freq`
|
||||
|
||||
`if_offset`
|
||||
|
||||
### Run OAI with custom DL/UL intermediate frequencies
|
||||
|
||||
The following example uses DL frequency 2169.080 MHz and UL frequency offset -400 MHz, with a configuration file for band 66 at gNB side.
|
||||
|
||||
From the `cmake_targets/ran_build/build` folder:
|
||||
|
||||
gNB on machine 1:
|
||||
|
||||
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band66.tm1.106PRB.usrpx300.conf`
|
||||
|
||||
UE on machine 2:
|
||||
|
||||
`sudo ./nr-uesoftmodem -C 2169080000 --CO -400000000`
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
|
||||
|
||||
+212
@@ -0,0 +1,212 @@
|
||||
<style type="text/css" rel="stylesheet">
|
||||
|
||||
body {
|
||||
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
color: #fff;
|
||||
background-color: #110F14;
|
||||
}
|
||||
h2 { margin-left: 20px; }
|
||||
h3 { margin-left: 40px; }
|
||||
h4 { margin-left: 60px; }
|
||||
|
||||
.func2 { margin-left: 20px; }
|
||||
.func3 { margin-left: 40px; }
|
||||
.func4 { margin-left: 60px; }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
This tuto for 5G gNB design, with Open Cells main
|
||||
{: .text-center}
|
||||
|
||||
# Top file: executables/ocp-gnb.c
|
||||
|
||||
the function main() initializes the data from configuration file
|
||||
|
||||
# The main thread is in ru_thread()
|
||||
The infinite loop:
|
||||
## rx_rf()
|
||||
Collect radio signal samples from RF board
|
||||
all SDR processing is triggered by I/Q sample reception and it's date (timestamp)
|
||||
TX I/Q samples will have a date in the future, compared to RX timestamp
|
||||
called for each 5G NR slot
|
||||
it blocks until data is available
|
||||
the internal time comes from the RF board sampling numbers
|
||||
(each sample has a incremental number representing a very accurate timing)
|
||||
raw incoming data is in buffer called "rxdata"
|
||||
We derivate frame number, slot number, ... from the RX timestamp
|
||||
{: .func2}
|
||||
## nr_fep_full()
|
||||
"front end processing" of uplink signal
|
||||
performs DFT on the signal
|
||||
same function (duplicates): phy_procedures_gNB_common_RX()
|
||||
it computes the buffer rxdataF (for frequency) from rxdata (samples over time)
|
||||
rxdataF is the rxdata in frequency domain, phase aligned
|
||||
{: .func3}
|
||||
## gNB_top()
|
||||
only compute frame numbre, slot number, ...
|
||||
{: .func3}
|
||||
## ocp_rxtx()
|
||||
main processing for both UL and DL
|
||||
start by calling oai_subframe_ind() that trigger processing in pnf_p7_subframe_ind() purpose ???
|
||||
all the context is in the passed structure UL_INFO
|
||||
the context is not very clear: there is a mutex on it,
|
||||
but not actual coherency (see below handle_nr_rach() assumes data is up-to-date)
|
||||
The first part (in NR_UL_indication, uses the data computed by the lower part (phy_procedures_gNB_uespec_RX), but for the **previous** slot
|
||||
Then, phy_procedures_gNB_uespec_RX will hereafter replace the data for the next run
|
||||
This is very tricky and not thread safe at all.
|
||||
{: .func3}
|
||||
|
||||
### NR_UL_indication()
|
||||
This block processes data already decoded and stored in structures behind UL_INFO
|
||||
{: .func4}
|
||||
|
||||
* handle_nr_rach()
|
||||
process data from RACH primary detection
|
||||
if the input is a UE RACH detection
|
||||
{: .func4}
|
||||
* nr_schedule_msg2()
|
||||
{: .func4}
|
||||
* handle_nr_uci()
|
||||
????
|
||||
{: .func4}
|
||||
* handle_nr_ulsch()
|
||||
handles ulsch data prepared by nr_fill_indication()
|
||||
{: .func4}
|
||||
* gNB_dlsch_ulsch_scheduler ()
|
||||
the **scheduler** is called here, see dedicated chapter
|
||||
{: .func4}
|
||||
* NR_Schedule_response()
|
||||
process as per the scheduler decided
|
||||
{: .func4}
|
||||
|
||||
### L1_nr_prach_procedures()
|
||||
????
|
||||
{: .func4}
|
||||
### phy_procedures_gNB_uespec_RX()
|
||||
* nr_decode_pucch0()
|
||||
actual CCH channel decoding form rxdataF (rx data in frequency domain)
|
||||
populates UL_INFO.uci_ind, actual uci data is in gNB->pucch
|
||||
{: .func4}
|
||||
* nr_rx_pusch()
|
||||
{: .func4}
|
||||
* extracts data from rxdataF (frequency transformed received data)
|
||||
{: .func4}
|
||||
* nr_pusch_channel_estimation()
|
||||
{: .func4}
|
||||
* nr_ulsch_extract_rbs_single()
|
||||
{: .func4}
|
||||
* nr_ulsch_scale_channel()
|
||||
{: .func4}
|
||||
* nr_ulsch_channel_level()
|
||||
{: .func4}
|
||||
* nr_ulsch_channel_compensation()
|
||||
{: .func4}
|
||||
* nr_ulsch_compute_llr()
|
||||
this function creates the "likelyhood ratios"
|
||||
{: .func4}
|
||||
* nr_ulsch_procedures()
|
||||
{: .func4}
|
||||
* actual ULsch decoding
|
||||
{: .func4}
|
||||
* nr_ulsch_unscrambling()
|
||||
{: .func4}
|
||||
* nr_ulsch_decoding()
|
||||
{: .func4}
|
||||
* nr_fill_indication()
|
||||
populate the data for the next call to "NR_UL_indication()"
|
||||
it would be better to call **NR_UL_indication()** now instead of before (on previous slot)
|
||||
{: .func4}
|
||||
|
||||
### phy_procedures_gNB_TX()
|
||||
* nr_common_signal_procedures()
|
||||
generate common signals
|
||||
{: .func4}
|
||||
* nr_generate_dci_top()
|
||||
generate DCI: the scheduling informtion for each UE in both DL and UL
|
||||
{: .func4}
|
||||
* nr_generate_pdsch()
|
||||
generate DL shared channel (user data)
|
||||
{: .func4}
|
||||
|
||||
### nr_feptx_prec()
|
||||
tx precoding
|
||||
{: .func3}
|
||||
### nr_feptx0
|
||||
do the inverse DFT
|
||||
{: .func3}
|
||||
### tx_rf()
|
||||
send radio signal samples to the RF board
|
||||
the samples numbers are the future time for these samples emission on-air
|
||||
{: .func3}
|
||||
|
||||
# Scheduler
|
||||
The scheduler is called by the chain: nr_ul_indication()=>gNB_dlsch_ulsch_scheduler()
|
||||
It calls sub functions to process each physical channel (rach, ...)
|
||||
The scheduler uses and internal map of used RB: vrb_map and vrb_map_UL, so each specific channel scheduler can see the already filled RB in each subframe (the function gNB_dlsch_ulsch_scheduler() clears these two arrays when it starts)
|
||||
|
||||
The scheduler also calls "run_pdcp()", as this is not a autonomous thread, it needs to be called here to update traffic requests (DL) and to propagate waiting UL to upper layers
|
||||
After calling run_pdcp, it updates "rlc" time data but it doesn't actually process rlc
|
||||
it sends a iiti message to activate the thread for RRC, the answer will be asynchronous in ????
|
||||
|
||||
Calls schedule_nr_mib() that calls mac_rrc_nr_data_req() to fill MIB,
|
||||
|
||||
Calls each channel allocation: schedule SI, schedule_ul, schedule_dl, ...
|
||||
this is a major entry for "phy-test" mode: in this mode, the allocation is fixed
|
||||
all these channels goes to mac_rrc_nr_data_req() to get the data to transmit
|
||||
|
||||
nr_schedule_ue_spec() is called
|
||||
* calls nr_simple_dlsch_preprocessor()=> mac_rlc_status_ind() mac_rlc_status_ind() locks and checks directly inside rlc data the quantity of waiting data. So, the scheduler can allocate RBs
|
||||
* calls nr_update_pucch_scheduling()
|
||||
* get_pdsch_to_harq_feedback() to schedule retransmission in DL
|
||||
|
||||
Calls nr_fill_nfapi_dl_pdu() to actually populate what should be done by the lower layers to make the Tx subframe
|
||||
|
||||
|
||||
|
||||
# RRC
|
||||
RRC is a regular thread with itti loop on queue: TASK_RRC_GNB
|
||||
it receives it's configuration in message NRRRC_CONFIGURATION_REQ, then real time mesages for all events: S1/NGAP events, X2AP messages and RRC_SUBFRAME_PROCESS
|
||||
|
||||
RRC_SUBFRAME_PROCESS message is send each subframe
|
||||
|
||||
how does it communicate to scheduler ?
|
||||
|
||||
|
||||
# RLC
|
||||
RLC code is new implementation, not using OAI mechanisms: it is implmented directly on pthreads, ignoring OAI common functions.
|
||||
It runs a thread waiting incoming data, but it is mainly running inside calling thread.
|
||||
It is a library, running in thread RRC (except on itti message: F1AP_UL_RRC_MESSAGE for F1).
|
||||
|
||||
# NGAP
|
||||
NGAP would be a itti thread as is S1AP (+twin thread SCTP that is almost void processing)?
|
||||
About all messages are exchanged with RRC thread
|
||||
|
||||
|
||||
# GTP
|
||||
Gtp + UDP are two twin threads performing the data plane interface to the core network
|
||||
The design is hybrid: thread and inside other threads calls. It should at least be protected by a mutex.
|
||||
## GTP thread
|
||||
Gtp thread has a itti interface: queue TASK_GTPV1_U
|
||||
The interface is about full definition: control messages (create/delet GTP tunnels) and data messages (user plane UL and DL).
|
||||
PDCP layer push to the GTP queue (outside UDP thread that do almost nothing and work only with GTP thread) is to push a UL packet.
|
||||
|
||||
|
||||
## GTP thread running code from other layers
|
||||
gtp thread calls directly pdcp_data_req(), so it runs inside it's context internal pdcp structures updates
|
||||
|
||||
## inside other threads
|
||||
gtpv1u_create_s1u_tunnel(), delete tunnel, ... functions are called inside the other threads, without mutex.
|
||||
|
||||
|
||||
<div class="panel panel-info">
|
||||
**Note**
|
||||
{: .panel-heading}
|
||||
<div class="panel-body">
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -435,7 +435,7 @@ void pusch_procedures_tosplit(uint8_t *bufferZone, int bufSize, PHY_VARS_eNB *eN
|
||||
if ((ulsch) &&
|
||||
(ulsch->rnti>0) &&
|
||||
(ulsch_harq->status == ACTIVE) &&
|
||||
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
|
||||
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
|
||||
((ulsch_harq->subframe == subframe) || (ulsch_harq->repetition_number >1) ) &&
|
||||
(ulsch_harq->handled == 0)) {
|
||||
// UE has ULSCH scheduling
|
||||
@@ -1520,7 +1520,7 @@ void *cu_fs6(void *arg) {
|
||||
remoteIP[i]=0;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
AssertFatal(createUDPsock(NULL, CU_PORT, remoteIP, port_def, &sockFS6), "");
|
||||
L1_rxtx_proc_t L1proc= {0};
|
||||
// We pick the global thread pool from the legacy code global vars
|
||||
|
||||
+105
-147
@@ -78,9 +78,18 @@ int otg_enabled;
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
int split73;
|
||||
int usrp_tx_thread = 0;
|
||||
char * split73_config;
|
||||
int split73;
|
||||
int usrp_tx_thread = 0;
|
||||
AGENT_RRC_xface *agent_rrc_xface[NUM_MAX_ENB]= {0};
|
||||
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB]= {0};
|
||||
void flexran_agent_slice_update(mid_t module_idP) {
|
||||
}
|
||||
int proto_agent_start(mod_id_t mod_id, const cudu_params_t *p){
|
||||
return 0;
|
||||
}
|
||||
void proto_agent_stop(mod_id_t mod_id){
|
||||
}
|
||||
|
||||
static void *ru_thread( void *param );
|
||||
void kill_RU_proc(RU_t *ru) {
|
||||
@@ -101,21 +110,6 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
close_log_mem();
|
||||
oai_exit = 1;
|
||||
|
||||
if (RC.ru == NULL)
|
||||
exit(-1); // likely init not completed, prevent crash or hang, exit now...
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
if (RC.ru[ru_id] && RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (RC.ru[ru_id] && RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
sleep(1); //allow lte-softmodem threads to exit first
|
||||
exit(1);
|
||||
}
|
||||
@@ -399,6 +393,7 @@ int setup_RU_buffers(RU_t *ru) {
|
||||
return(0);
|
||||
}
|
||||
|
||||
#if 0
|
||||
void init_precoding_weights(PHY_VARS_eNB *eNB) {
|
||||
int layer,ru_id,aa,re,ue,tb;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
@@ -431,6 +426,7 @@ void init_precoding_weights(PHY_VARS_eNB *eNB) {
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void ocp_rx_prach(PHY_VARS_eNB *eNB,
|
||||
L1_rxtx_proc_t *proc,
|
||||
@@ -804,8 +800,7 @@ int init_rf(RU_t *ru) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
RU_t *ru;
|
||||
void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
|
||||
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
|
||||
int i;
|
||||
int CC_id;
|
||||
@@ -821,11 +816,8 @@ void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
|
||||
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
LOG_D(PHY,"Process RC.ru[%d]\n",ru_id);
|
||||
ru = RC.ru[ru_id];
|
||||
ru->rf_config_file = rf_config_file;
|
||||
ru->idx = ru_id;
|
||||
ru->idx = 0;
|
||||
ru->ts_offset = 0;
|
||||
|
||||
if (ru->is_slave == 1) {
|
||||
@@ -849,8 +841,6 @@ void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
ru->wakeup_L1_sleep_cnt_max = 3;
|
||||
|
||||
if (ru->num_eNB > 0) {
|
||||
LOG_D(PHY, "%s() RC.ru[%d].num_eNB:%d ru->eNB_list[0]:%p RC.eNB[0][0]:%p rf_config_file:%s\n",
|
||||
__FUNCTION__, ru_id, ru->num_eNB, ru->eNB_list[0], RC.eNB[0][0], ru->rf_config_file);
|
||||
AssertFatal(ru->eNB_list[0], "ru->eNB_list is not initialized\n");
|
||||
} else {
|
||||
LOG_E(PHY,"Wrong data model, assigning eNB 0, carrier 0 to RU 0\n");
|
||||
@@ -867,20 +857,19 @@ void init_RU(char *rf_config_file, int send_dmrssync) {
|
||||
int ruIndex=eNB0->num_RU++;
|
||||
eNB0->RU_list[ruIndex] = ru;
|
||||
}
|
||||
} // for ru_id
|
||||
}
|
||||
|
||||
void stop_RU(int nb_ru) {
|
||||
for (int inst = 0; inst < nb_ru; inst++) {
|
||||
LOG_I(PHY, "Stopping RU %d processing threads\n", inst);
|
||||
kill_RU_proc(RC.ru[inst]);
|
||||
//kill_RU_proc(RC.ru[inst]);
|
||||
}
|
||||
}
|
||||
|
||||
/* --------------------------------------------------------*/
|
||||
/* from here function to use configuration module */
|
||||
static int DEFBFW[] = {0x00007fff};
|
||||
void RCconfig_RU(void) {
|
||||
void ocpRCconfig_RU(RU_t* ru) {
|
||||
paramdef_t RUParams[] = RUPARAMS_DESC;
|
||||
paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
|
||||
config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
|
||||
@@ -891,87 +880,74 @@ void RCconfig_RU(void) {
|
||||
return;
|
||||
} // setting != NULL
|
||||
|
||||
if ( RC.ru != NULL ) {
|
||||
LOG_W(PHY, "Calling RCconfig_RU twice (nb ru=%d), ignoring the second call data structure is %p\n",
|
||||
RUParamList.numelt,RC.ru);
|
||||
return;
|
||||
ru->idx = 0;
|
||||
ru->if_timing = synch_to_ext_device;
|
||||
paramdef_t *vals=RUParamList.paramarray[0];
|
||||
|
||||
if (RC.nb_L1_inst >0)
|
||||
ru->num_eNB = vals[RU_ENB_LIST_IDX].numelt;
|
||||
else
|
||||
ru->num_eNB = 0;
|
||||
|
||||
for (int i=0; i<ru->num_eNB; i++)
|
||||
ru->eNB_list[i] = RC.eNB[vals[RU_ENB_LIST_IDX].iptr[i]][0];
|
||||
|
||||
if (config_isparamset(vals, RU_SDR_ADDRS)) {
|
||||
ru->openair0_cfg.sdr_addrs = strdup(*(vals[RU_SDR_ADDRS].strptr));
|
||||
}
|
||||
|
||||
RC.ru = (RU_t **)malloc(RC.nb_RU*sizeof(RU_t *));
|
||||
|
||||
for (int j = 0; j < RC.nb_RU; j++) {
|
||||
RC.ru[j] = (RU_t *)calloc(sizeof(RU_t), 1);
|
||||
RC.ru[j]->idx = j;
|
||||
LOG_I(PHY,"Creating RC.ru[%d]:%p\n", j, RC.ru[j]);
|
||||
RC.ru[j]->if_timing = synch_to_ext_device;
|
||||
paramdef_t *vals=RUParamList.paramarray[j];
|
||||
|
||||
if (RC.nb_L1_inst >0)
|
||||
RC.ru[j]->num_eNB = vals[RU_ENB_LIST_IDX].numelt;
|
||||
else
|
||||
RC.ru[j]->num_eNB = 0;
|
||||
|
||||
for (int i=0; i<RC.ru[j]->num_eNB; i++)
|
||||
RC.ru[j]->eNB_list[i] = RC.eNB[vals[RU_ENB_LIST_IDX].iptr[i]][0];
|
||||
|
||||
if (config_isparamset(vals, RU_SDR_ADDRS)) {
|
||||
RC.ru[j]->openair0_cfg.sdr_addrs = strdup(*(vals[RU_SDR_ADDRS].strptr));
|
||||
}
|
||||
|
||||
if (config_isparamset(vals, RU_SDR_CLK_SRC)) {
|
||||
char *paramVal=*(vals[RU_SDR_CLK_SRC].strptr);
|
||||
LOG_D(PHY, "RU clock source set as %s\n", paramVal);
|
||||
|
||||
if (strcmp(paramVal, "internal") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = internal;
|
||||
} else if (strcmp(paramVal, "external") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = external;
|
||||
} else if (strcmp(paramVal, "gpsdo") == 0) {
|
||||
RC.ru[j]->openair0_cfg.clock_source = gpsdo;
|
||||
} else {
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", paramVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(*(vals[RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(vals,RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
RC.ru[j]->if_south = LOCAL_RF;
|
||||
RC.ru[j]->function = eNodeB_3GPP;
|
||||
LOG_I(PHY, "Setting function for RU %d to eNodeB_3GPP\n",j);
|
||||
} else {
|
||||
RC.ru[j]->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
}
|
||||
|
||||
RC.ru[j]->max_pdschReferenceSignalPower = *(vals[RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
RC.ru[j]->max_rxgain = *(vals[RU_MAX_RXGAIN_IDX].uptr);
|
||||
RC.ru[j]->num_bands = vals[RU_BAND_LIST_IDX].numelt;
|
||||
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
|
||||
RC.ru[j]->sf_extension = *(vals[RU_SF_EXTENSION_IDX].uptr);
|
||||
RC.ru[j]->end_of_burst_delay = *(vals[RU_END_OF_BURST_DELAY_IDX].uptr);
|
||||
|
||||
for (int i=0; i<RC.ru[j]->num_bands; i++) RC.ru[j]->band[i] = vals[RU_BAND_LIST_IDX].iptr[i];
|
||||
if (config_isparamset(vals, RU_SDR_CLK_SRC)) {
|
||||
char *paramVal=*(vals[RU_SDR_CLK_SRC].strptr);
|
||||
LOG_D(PHY, "RU clock source set as %s\n", paramVal);
|
||||
|
||||
if (strcmp(paramVal, "internal") == 0) {
|
||||
ru->openair0_cfg.clock_source = internal;
|
||||
} else if (strcmp(paramVal, "external") == 0) {
|
||||
ru->openair0_cfg.clock_source = external;
|
||||
} else if (strcmp(paramVal, "gpsdo") == 0) {
|
||||
ru->openair0_cfg.clock_source = gpsdo;
|
||||
} else {
|
||||
LOG_I(PHY,"RU %d: Transport %s\n",j,*(vals[RU_TRANSPORT_PREFERENCE_IDX].strptr));
|
||||
RC.ru[j]->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
RC.ru[j]->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
RC.ru[j]->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
RC.ru[j]->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", paramVal);
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(*(vals[RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
|
||||
if ( !(config_isparamset(vals,RU_LOCAL_IF_NAME_IDX)) ) {
|
||||
ru->if_south = LOCAL_RF;
|
||||
ru->function = eNodeB_3GPP;
|
||||
} else {
|
||||
ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
}
|
||||
|
||||
ru->max_pdschReferenceSignalPower = *(vals[RU_MAX_RS_EPRE_IDX].uptr);;
|
||||
ru->max_rxgain = *(vals[RU_MAX_RXGAIN_IDX].uptr);
|
||||
ru->num_bands = vals[RU_BAND_LIST_IDX].numelt;
|
||||
/* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
|
||||
ru->sf_extension = *(vals[RU_SF_EXTENSION_IDX].uptr);
|
||||
ru->end_of_burst_delay = *(vals[RU_END_OF_BURST_DELAY_IDX].uptr);
|
||||
|
||||
for (int i=0; i<ru->num_bands; i++)
|
||||
ru->band[i] = vals[RU_BAND_LIST_IDX].iptr[i];
|
||||
} else {
|
||||
ru->eth_params.local_if_name = strdup(*(vals[RU_LOCAL_IF_NAME_IDX].strptr));
|
||||
ru->eth_params.my_addr = strdup(*(vals[RU_LOCAL_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.remote_addr = strdup(*(vals[RU_REMOTE_ADDRESS_IDX].strptr));
|
||||
ru->eth_params.my_portc = *(vals[RU_LOCAL_PORTC_IDX].uptr);
|
||||
ru->eth_params.remote_portc = *(vals[RU_REMOTE_PORTC_IDX].uptr);
|
||||
ru->eth_params.my_portd = *(vals[RU_LOCAL_PORTD_IDX].uptr);
|
||||
ru->eth_params.remote_portd = *(vals[RU_REMOTE_PORTD_IDX].uptr);
|
||||
} /* strcmp(local_rf, "yes") != 0 */
|
||||
|
||||
RC.ru[j]->nb_tx = *(vals[RU_NB_TX_IDX].uptr);
|
||||
RC.ru[j]->nb_rx = *(vals[RU_NB_RX_IDX].uptr);
|
||||
RC.ru[j]->att_tx = *(vals[RU_ATT_TX_IDX].uptr);
|
||||
RC.ru[j]->att_rx = *(vals[RU_ATT_RX_IDX].uptr);
|
||||
}// j=0..num_rus
|
||||
ru->nb_tx = *(vals[RU_NB_TX_IDX].uptr);
|
||||
ru->nb_rx = *(vals[RU_NB_RX_IDX].uptr);
|
||||
ru->att_tx = *(vals[RU_ATT_TX_IDX].uptr);
|
||||
ru->att_rx = *(vals[RU_ATT_RX_IDX].uptr);
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -1055,13 +1031,13 @@ void init_pdcp(void) {
|
||||
pdcp_module_init(pdcp_initmask);
|
||||
|
||||
if (NODE_IS_CU(RC.rrc[0]->node_type)) {
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
|
||||
//pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t)proto_agent_send_rlc_data_req);
|
||||
} else {
|
||||
pdcp_set_rlc_data_req_func((send_rlc_data_req_func_t) rlc_data_req);
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) pdcp_data_ind);
|
||||
}
|
||||
} else {
|
||||
pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
|
||||
//pdcp_set_pdcp_data_ind_func((pdcp_data_ind_func_t) proto_agent_send_pdcp_data_ind);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1087,16 +1063,11 @@ void terminate_task(module_id_t mod_id, task_id_t from, task_id_t to) {
|
||||
int stop_L1L2(module_id_t enb_id) {
|
||||
LOG_W(ENB_APP, "stopping lte-softmodem\n");
|
||||
|
||||
if (!RC.ru) {
|
||||
LOG_UI(ENB_APP, "no RU configured\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* these tasks need to pick up new configuration */
|
||||
terminate_task(enb_id, TASK_ENB_APP, TASK_RRC_ENB);
|
||||
oai_exit = 1;
|
||||
LOG_I(ENB_APP, "calling kill_RU_proc() for instance %d\n", enb_id);
|
||||
kill_RU_proc(RC.ru[enb_id]);
|
||||
//kill_RU_proc(RC.ru[enb_id]);
|
||||
LOG_I(ENB_APP, "calling kill_eNB_proc() for instance %d\n", enb_id);
|
||||
kill_eNB_proc(enb_id);
|
||||
oai_exit = 0;
|
||||
@@ -1106,7 +1077,7 @@ int stop_L1L2(module_id_t enb_id) {
|
||||
phy_free_lte_eNB(RC.eNB[enb_id][cc_id]);
|
||||
}
|
||||
|
||||
phy_free_RU(RC.ru[enb_id]);
|
||||
//phy_free_RU(RC.ru[enb_id]);
|
||||
free_lte_top();
|
||||
return 0;
|
||||
}
|
||||
@@ -1115,14 +1086,18 @@ int stop_L1L2(module_id_t enb_id) {
|
||||
* Restart the lte-softmodem after it has been soft-stopped with stop_L1L2()
|
||||
*/
|
||||
int restart_L1L2(module_id_t enb_id) {
|
||||
RU_t *ru = RC.ru[enb_id];
|
||||
RU_t *ru = NULL; //RC.ru[enb_id];
|
||||
MessageDef *msg_p = NULL;
|
||||
LOG_W(ENB_APP, "restarting lte-softmodem\n");
|
||||
/* block threads */
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
sync_var = -1;
|
||||
pthread_mutex_unlock(&sync_mutex);
|
||||
RC.ru_mask |= (1 << ru->idx);
|
||||
|
||||
/* copy the changed frame parameters to the RU */
|
||||
/* TODO this should be done for all RUs associated to this eNB */
|
||||
memcpy(&ru->frame_parms, &RC.eNB[enb_id][0]->frame_parms, sizeof(LTE_DL_FRAME_PARMS));
|
||||
|
||||
/* reset the list of connected UEs in the MAC, since in this process with
|
||||
* loose all UEs (have to reconnect) */
|
||||
init_UE_info(&RC.mac[enb_id]->UE_info);
|
||||
@@ -1135,11 +1110,6 @@ int restart_L1L2(module_id_t enb_id) {
|
||||
msg_p = itti_alloc_new_message(TASK_ENB_APP, RRC_CONFIGURATION_REQ);
|
||||
RRC_CONFIGURATION_REQ(msg_p) = RC.rrc[enb_id]->configuration;
|
||||
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(enb_id), msg_p);
|
||||
/* TODO XForms might need to be restarted, but it is currently (09/02/18)
|
||||
* broken, so we cannot test it */
|
||||
init_RU_proc(ru);
|
||||
ru->rf_map.card = 0;
|
||||
ru->rf_map.chain = 0; /* CC_id + chain_offset;*/
|
||||
init_eNB_afterRU();
|
||||
printf("Sending sync to all threads\n");
|
||||
pthread_mutex_lock(&sync_mutex);
|
||||
@@ -1187,10 +1157,16 @@ int main ( int argc, char **argv ) {
|
||||
RCconfig_L1();
|
||||
}
|
||||
|
||||
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
|
||||
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
|
||||
// some initialization is necessary and init_ru_vnf do this.
|
||||
RU_t ru;
|
||||
|
||||
|
||||
/* We need to read RU configuration before FlexRAN starts so it knows what
|
||||
* splits to report. Actual RU start comes later. */
|
||||
if (RC.nb_RU > 0 && NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
RCconfig_RU();
|
||||
if ( NFAPI_MODE != NFAPI_MODE_VNF) {
|
||||
ocpRCconfig_RU(&ru);
|
||||
LOG_I(PHY,
|
||||
"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",
|
||||
RC.nb_L1_inst, RC.nb_RU, get_nprocs());
|
||||
@@ -1211,7 +1187,7 @@ int main ( int argc, char **argv ) {
|
||||
if (RC.nb_inst > 0) {
|
||||
/* Start the agent. If it is turned off in the configuration, it won't start */
|
||||
for (i = 0; i < RC.nb_inst; i++) {
|
||||
flexran_agent_start(i);
|
||||
//flexran_agent_start(i);
|
||||
}
|
||||
|
||||
/* initializes PDCP and sets correct RLC Request/PDCP Indication callbacks
|
||||
@@ -1292,20 +1268,16 @@ int main ( int argc, char **argv ) {
|
||||
|
||||
printf("About to Init RU threads RC.nb_RU:%d\n", RC.nb_RU);
|
||||
|
||||
// RU thread and some L1 procedure aren't necessary in VNF or L2 FAPI simulator.
|
||||
// but RU thread deals with pre_scd and this is necessary in VNF and simulator.
|
||||
// some initialization is necessary and init_ru_vnf do this.
|
||||
|
||||
if (RC.nb_RU >0 && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
printf("Initializing RU threads\n");
|
||||
init_RU(get_softmodem_params()->rf_config_file,
|
||||
ocp_init_RU(&ru,
|
||||
get_softmodem_params()->rf_config_file,
|
||||
get_softmodem_params()->send_dmrs_sync);
|
||||
|
||||
for (int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
RC.ru[ru_id]->rf_map.card=0;
|
||||
RC.ru[ru_id]->rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
LOG_I(PHY,"Starting ru_thread %d\n",ru_id);
|
||||
init_RU_proc(RC.ru[ru_id]);
|
||||
}
|
||||
ru.rf_map.card=0;
|
||||
ru.rf_map.chain=CC_id+(get_softmodem_params()->chain_offset);
|
||||
init_RU_proc(&ru);
|
||||
|
||||
config_sync_var=0;
|
||||
|
||||
@@ -1316,6 +1288,7 @@ int main ( int argc, char **argv ) {
|
||||
LOG_I(ENB_APP,"RC.nb_RU:%d\n", RC.nb_RU);
|
||||
// once all RUs are ready intiailize the rest of the eNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init eNBs\n");
|
||||
sleep(1);
|
||||
|
||||
if (NFAPI_MODE!=NFAPI_MODE_PNF && NFAPI_MODE!=NFAPI_MODE_VNF) {
|
||||
LOG_I(ENB_APP,"Not NFAPI mode - call init_eNB_afterRU()\n");
|
||||
@@ -1369,10 +1342,6 @@ int main ( int argc, char **argv ) {
|
||||
}
|
||||
}
|
||||
|
||||
for (int inst = 0; inst < RC.nb_RU; inst++) {
|
||||
phy_free_RU(RC.ru[inst]);
|
||||
}
|
||||
|
||||
free_lte_top();
|
||||
end_configmodule();
|
||||
pthread_cond_destroy(&sync_cond);
|
||||
@@ -1381,17 +1350,6 @@ int main ( int argc, char **argv ) {
|
||||
pthread_mutex_destroy(&nfapi_sync_mutex);
|
||||
pthread_mutex_destroy(&ue_pf_po_mutex);
|
||||
|
||||
for(int ru_id=0; ru_id<RC.nb_RU; ru_id++) {
|
||||
if (RC.ru[ru_id]->rfdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func(&RC.ru[ru_id]->rfdevice);
|
||||
RC.ru[ru_id]->rfdevice.trx_end_func = NULL;
|
||||
}
|
||||
|
||||
if (RC.ru[ru_id]->ifdevice.trx_end_func) {
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func(&RC.ru[ru_id]->ifdevice);
|
||||
RC.ru[ru_id]->ifdevice.trx_end_func = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
terminate_opt();
|
||||
|
||||
+10
-1
@@ -256,6 +256,15 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
|
||||
// Do PRACH RU processing
|
||||
L1_nr_prach_procedures(gNB,frame_rx,slot_rx);
|
||||
|
||||
//apply the rx signal rotation here
|
||||
apply_nr_rotation_ul(&gNB->frame_parms,
|
||||
gNB->common_vars.rxdataF[0],
|
||||
slot_rx,
|
||||
0,
|
||||
gNB->frame_parms.Ncp==EXTENDED?12:14,
|
||||
gNB->frame_parms.ofdm_symbol_size);
|
||||
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx);
|
||||
}
|
||||
|
||||
@@ -266,7 +275,7 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
// run PHY TX procedures the one after the other for all CCs to avoid race conditions
|
||||
// (may be relaxed in the future for performance reasons)
|
||||
// *****************************************
|
||||
|
||||
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT) {
|
||||
|
||||
if(get_thread_parallel_conf() != PARALLEL_RU_L1_TRX_SPLIT) {
|
||||
|
||||
+39
-38
@@ -623,6 +623,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
unsigned int rxs;
|
||||
int i;
|
||||
uint32_t samples_per_slot = fp->get_samples_per_slot(*slot,fp);
|
||||
uint32_t samples_per_slot_prev ;
|
||||
openair0_timestamp ts,old_ts;
|
||||
AssertFatal(*slot<fp->slots_per_frame && *slot>=0, "slot %d is illegal (%d)\n",*slot,fp->slots_per_frame);
|
||||
|
||||
@@ -658,16 +659,16 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
ru->ts_offset = proc->timestamp_rx;
|
||||
proc->timestamp_rx = 0;
|
||||
} else {
|
||||
if (proc->timestamp_rx - old_ts != fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp)) {
|
||||
LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot,ru->ts_offset);
|
||||
ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot);
|
||||
samples_per_slot_prev = fp->get_samples_per_slot((*slot-1)%fp->slots_per_frame,fp);
|
||||
if (proc->timestamp_rx - old_ts != samples_per_slot_prev) {
|
||||
LOG_D(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples (ts_off %"PRId64")\n",proc->timestamp_rx - old_ts - samples_per_slot_prev,ru->ts_offset);
|
||||
ru->ts_offset += (proc->timestamp_rx - old_ts - samples_per_slot_prev);
|
||||
proc->timestamp_rx = ts-ru->ts_offset;
|
||||
}
|
||||
}
|
||||
|
||||
proc->frame_rx = (proc->timestamp_rx / (fp->samples_per_subframe*10))&1023;
|
||||
uint32_t idx_sf = proc->timestamp_rx / fp->samples_per_subframe;
|
||||
proc->tti_rx = (idx_sf * fp->slots_per_subframe + (int)round((float)(proc->timestamp_rx % fp->samples_per_subframe) / fp->samples_per_slot0))%(fp->slots_per_frame);
|
||||
proc->tti_rx = fp->get_slot_from_timestamp(proc->timestamp_rx,fp);
|
||||
// synchronize first reception to frame 0 subframe 0
|
||||
LOG_D(PHY,"RU %d/%d TS %llu (off %d), frame %d, slot %d.%d / %d\n",
|
||||
ru->idx,
|
||||
@@ -688,7 +689,7 @@ void rx_rf(RU_t *ru,int *frame,int *slot) {
|
||||
}
|
||||
|
||||
if (proc->frame_rx != *frame) {
|
||||
LOG_E(PHY,"Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d)\n",(long long unsigned int)proc->timestamp_rx,proc->frame_rx,*frame);
|
||||
LOG_E(PHY,"Received Timestamp (%llu) doesn't correspond to the time we think it is (proc->frame_rx %d frame %d, proc->tti_rx %d, slot %d)\n",(long long unsigned int)proc->timestamp_rx,proc->frame_rx,*frame,proc->tti_rx,*slot);
|
||||
exit_fun("Exiting");
|
||||
}
|
||||
} else {
|
||||
@@ -727,38 +728,34 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
//nr_subframe_t SF_type = nr_slot_select(cfg,slot%fp->slots_per_frame);
|
||||
if (slot_type == NR_DOWNLINK_SLOT || slot_type == NR_MIXED_SLOT || IS_SOFTMODEM_RFSIM) {
|
||||
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
txsymb = 0;
|
||||
for(int symbol_count =0;symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT;symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value==0)
|
||||
txsymb++;
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD){
|
||||
if(slot_type == NR_MIXED_SLOT) {
|
||||
txsymb = 0;
|
||||
for(int symbol_count = 0; symbol_count<NR_NUMBER_OF_SYMBOLS_PER_SLOT; symbol_count++) {
|
||||
if (cfg->tdd_table.max_tdd_periodicity_list[slot].max_num_of_symbol_per_slot_list[symbol_count].slot_config.value == 0)
|
||||
txsymb++;
|
||||
}
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
AssertFatal(txsymb>0,"illegal txsymb %d\n",txsymb);
|
||||
if(slot%(fp->slots_per_subframe/2))
|
||||
siglen = txsymb * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
else
|
||||
siglen = (fp->ofdm_symbol_size + fp->nb_prefix_samples0) + (txsymb - 1) * (fp->ofdm_symbol_size + fp->nb_prefix_samples);
|
||||
//+ ru->end_of_burst_delay;
|
||||
flags=3; // end of burst
|
||||
}
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD &&
|
||||
slot_type == NR_DOWNLINK_SLOT &&
|
||||
prevslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 2; // start of burst
|
||||
}
|
||||
if (slot_type == NR_DOWNLINK_SLOT && prevslot_type == NR_UPLINK_SLOT)
|
||||
flags = 2; // start of burst
|
||||
|
||||
if (cfg->cell_config.frame_duplex_type.value == TDD &&
|
||||
slot_type == NR_DOWNLINK_SLOT &&
|
||||
nextslot_type == NR_UPLINK_SLOT) {
|
||||
flags = 3; // end of burst
|
||||
if (slot_type == NR_DOWNLINK_SLOT && nextslot_type == NR_UPLINK_SLOT)
|
||||
flags = 3; // end of burst
|
||||
}
|
||||
|
||||
if (fp->freq_range==nr_FR2) {
|
||||
// the beam index is written in bits 8-10 of the flags
|
||||
// bit 11 enables the gpio programming
|
||||
int beam=0;
|
||||
if (slot==0) beam = 11; //3 for boresight & 8 to enable
|
||||
//if (slot==0) beam = 11; //3 for boresight & 8 to enable
|
||||
/*
|
||||
if (slot==0 || slot==40) beam=0&8;
|
||||
if (slot==10 || slot==50) beam=1&8;
|
||||
@@ -767,7 +764,7 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
|
||||
*/
|
||||
flags |= beam<<8;
|
||||
}
|
||||
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_FRAME_NUMBER_TX0_RU, frame );
|
||||
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TTI_NUMBER_TX0_RU, slot );
|
||||
@@ -861,9 +858,9 @@ void *ru_thread_prach( void *param ) {
|
||||
|
||||
if (wait_on_condition(&proc->mutex_prach,&proc->cond_prach,&proc->instance_cnt_prach,"ru_prach_thread") < 0) break;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
|
||||
/*VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_RU_PRACH_RX, 1 );
|
||||
|
||||
/*if (ru->gNB_list[0]){
|
||||
if (ru->gNB_list[0]){
|
||||
prach_procedures(
|
||||
ru->gNB_list[0],0
|
||||
);
|
||||
@@ -1149,19 +1146,22 @@ void fill_rf_config(RU_t *ru, char *rf_config_file) {
|
||||
if (ru->if_frequency == 0) {
|
||||
cfg->tx_freq[i] = (double)fp->dl_CarrierFreq;
|
||||
cfg->rx_freq[i] = (double)fp->ul_CarrierFreq;
|
||||
}
|
||||
else {
|
||||
} else if (ru->if_freq_offset){
|
||||
cfg->tx_freq[i] = (double)(ru->if_frequency);
|
||||
cfg->rx_freq[i] = (double)(ru->if_frequency + ru->if_freq_offset);
|
||||
LOG_I(PHY, "Setting IF TX frequency to %lu Hz with IF RX frequency offset %d Hz\n", ru->if_frequency, ru->if_freq_offset);
|
||||
} else {
|
||||
cfg->tx_freq[i] = (double)ru->if_frequency;
|
||||
cfg->rx_freq[i] = (double)(ru->if_frequency+fp->ul_CarrierFreq-fp->dl_CarrierFreq);
|
||||
}
|
||||
cfg->tx_gain[i] = ru->att_tx;
|
||||
cfg->rx_gain[i] = ru->max_rxgain-ru->att_rx;
|
||||
cfg->configFilename = rf_config_file;
|
||||
printf("channel %d, Setting tx_gain offset %f, rx_gain offset %f, tx_freq %f, rx_freq %f\n",
|
||||
LOG_I(PHY, "Channel %d: setting tx_gain offset %f, rx_gain offset %f, tx_freq %lu Hz, rx_freq %lu Hz\n",
|
||||
i, cfg->tx_gain[i],
|
||||
cfg->rx_gain[i],
|
||||
cfg->tx_freq[i],
|
||||
cfg->rx_freq[i]);
|
||||
(unsigned long)cfg->tx_freq[i],
|
||||
(unsigned long)cfg->rx_freq[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2220,7 +2220,7 @@ void set_function_spec_param(RU_t *ru) {
|
||||
case REMOTE_IF4p5:
|
||||
ru->do_prach = 0;
|
||||
ru->feprx = NULL; // DFTs
|
||||
ru->feptx_prec = (get_thread_worker_conf() == WORKER_ENABLE) ? NULL : nr_feptx_prec; // Precoding operation
|
||||
ru->feptx_prec = nr_feptx_prec; // Precoding operation
|
||||
ru->feptx_ofdm = NULL; // no OFDM mod
|
||||
ru->fh_south_in = fh_if4p5_south_in; // synchronous IF4p5 reception
|
||||
ru->fh_south_out = fh_if4p5_south_out; // synchronous IF4p5 transmission
|
||||
@@ -2494,6 +2494,7 @@ void RCconfig_RU(void)
|
||||
RC.ru[j]->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
|
||||
RC.ru[j]->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
|
||||
RC.ru[j]->if_frequency = *(RUParamList.paramarray[j][RU_IF_FREQUENCY].u64ptr);
|
||||
RC.ru[j]->if_freq_offset = *(RUParamList.paramarray[j][RU_IF_FREQ_OFFSET].iptr);
|
||||
|
||||
if (config_isparamset(RUParamList.paramarray[j], RU_BF_WEIGHTS_LIST_IDX)) {
|
||||
RC.ru[j]->nb_bfw = RUParamList.paramarray[j][RU_BF_WEIGHTS_LIST_IDX].numelt;
|
||||
|
||||
@@ -956,7 +956,7 @@ if(!IS_SOFTMODEM_NOS1)
|
||||
// once all RUs are ready initialize the rest of the gNBs ((dependence on final RU parameters after configuration)
|
||||
printf("ALL RUs ready - init gNBs\n");
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
|
||||
sleep(1);
|
||||
scopeParms_t p;
|
||||
p.argc=&argc;
|
||||
p.argv=argv;
|
||||
|
||||
+39
-49
@@ -135,17 +135,15 @@ typedef enum {
|
||||
|
||||
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t UE_id,
|
||||
uint8_t abstraction_flag)
|
||||
{
|
||||
|
||||
int nb_connected_gNB = 1, gNB_id;
|
||||
|
||||
memcpy(&(ue->frame_parms), frame_parms, sizeof(NR_DL_FRAME_PARMS));
|
||||
|
||||
ue->Mod_id = UE_id;
|
||||
ue->mac_enabled = 1;
|
||||
ue->if_inst = nr_ue_if_module_init(0);
|
||||
|
||||
// Setting UE mode to NOT_SYNCHED by default
|
||||
for (gNB_id = 0; gNB_id < nb_connected_gNB; gNB_id++){
|
||||
@@ -158,6 +156,9 @@ void init_nr_ue_vars(PHY_VARS_NR_UE *ue,
|
||||
|
||||
// intialize transport
|
||||
init_nr_ue_transport(ue, abstraction_flag);
|
||||
|
||||
// init N_TA offset
|
||||
init_N_TA_offset(ue);
|
||||
}
|
||||
|
||||
/*!
|
||||
@@ -175,24 +176,30 @@ static void UE_synch(void *arg) {
|
||||
int i, hw_slot_offset;
|
||||
PHY_VARS_NR_UE *UE = syncD->UE;
|
||||
sync_mode_t sync_mode = pbch;
|
||||
int CC_id = UE->CC_id;
|
||||
int freq_offset=0;
|
||||
//int CC_id = UE->CC_id;
|
||||
static int freq_offset=0;
|
||||
UE->is_synchronized = 0;
|
||||
|
||||
if (UE->UE_scan == 0) {
|
||||
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %"PRIu64", UL %"PRIu64" (oai_exit %d, rx_num_channels %d)\n",
|
||||
UE->frame_parms.dl_CarrierFreq, UE->frame_parms.ul_CarrierFreq,
|
||||
oai_exit, openair0_cfg[0].rx_num_channels);
|
||||
|
||||
#ifdef FR2_TEST
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0){
|
||||
UE->frame_parms.dl_CarrierFreq = downlink_frequency[0][0];
|
||||
UE->frame_parms.ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = UE->frame_parms.dl_CarrierFreq;
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = UE->frame_parms.ul_CarrierFreq;
|
||||
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
|
||||
|
||||
if (UE->frame_parms.frame_type == FDD)
|
||||
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_FDD;
|
||||
else
|
||||
openair0_cfg[UE->rf_map.card].duplex_mode = duplex_mode_TDD;
|
||||
LOG_I( PHY, "[SCHED][UE] Check absolute frequency DL %f, UL %f (RF card %d, oai_exit %d, channel %d, rx_num_channels %d)\n",
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i],
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i],
|
||||
UE->rf_map.card,
|
||||
oai_exit,
|
||||
i,
|
||||
openair0_cfg[0].rx_num_channels);
|
||||
|
||||
}
|
||||
|
||||
sync_mode = pbch;
|
||||
@@ -247,31 +254,25 @@ static void UE_synch(void *arg) {
|
||||
case pbch:
|
||||
LOG_I(PHY, "[UE thread Synch] Running Initial Synch (mode %d)\n",UE->mode);
|
||||
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
double rx_gain_off = 0;
|
||||
nr_get_carrier_frequencies(&UE->frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
if (nr_initial_sync( &syncD->proc, UE, UE->mode,2) == 0) {
|
||||
freq_offset = UE->common_vars.freq_offset; // frequency offset computed with pss in initial sync
|
||||
hw_slot_offset = ((UE->rx_offset<<1) / UE->frame_parms.samples_per_subframe * UE->frame_parms.slots_per_subframe) +
|
||||
round((float)((UE->rx_offset<<1) % UE->frame_parms.samples_per_subframe)/UE->frame_parms.samples_per_slot0);
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %d (DL %lu, UL %lu), UE_scan_carrier %d\n",
|
||||
hw_slot_offset,
|
||||
freq_offset,
|
||||
UE->rx_total_gain_dB,
|
||||
UE->frame_parms.dl_CarrierFreq+freq_offset,
|
||||
UE->frame_parms.ul_CarrierFreq+freq_offset,
|
||||
UE->UE_scan_carrier );
|
||||
|
||||
// rerun with new cell parameters and frequency-offset
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
|
||||
// todo: the freq_offset computed on DL shall be scaled before being applied to UL
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
if (freq_offset >= 0)
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] += abs(freq_offset);
|
||||
else
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] -= abs(freq_offset);
|
||||
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] =
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i]+(UE->frame_parms.ul_CarrierFreq-UE->frame_parms.dl_CarrierFreq);
|
||||
UE->frame_parms.dl_CarrierFreq = openair0_cfg[CC_id].rx_freq[i];
|
||||
}
|
||||
LOG_I(PHY,"Got synch: hw_slot_offset %d, carrier off %d Hz, rxgain %f (DL %f Hz, UL %f Hz)\n",
|
||||
hw_slot_offset,
|
||||
freq_offset,
|
||||
openair0_cfg[UE->rf_map.card].rx_gain[0],
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[0],
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[0]);
|
||||
|
||||
// reconfigure for potentially different bandwidth
|
||||
switch(UE->frame_parms.N_RB_DL) {
|
||||
@@ -315,7 +316,6 @@ static void UE_synch(void *arg) {
|
||||
//UE->rfdevice.trx_set_gains_func(&openair0,&openair0_cfg[0]);
|
||||
//UE->rfdevice.trx_stop_func(&UE->rfdevice);
|
||||
// sleep(1);
|
||||
//nr_init_frame_parms_ue(&UE->frame_parms);
|
||||
/*if (UE->rfdevice.trx_start_func(&UE->rfdevice) != 0 ) {
|
||||
LOG_E(HW,"Could not start the device\n");
|
||||
oai_exit=1;
|
||||
@@ -328,31 +328,21 @@ static void UE_synch(void *arg) {
|
||||
UE->is_synchronized = 1;
|
||||
}
|
||||
} else {
|
||||
// initial sync failed
|
||||
// calculate new offset and try again
|
||||
|
||||
if (UE->UE_scan_carrier == 1) {
|
||||
|
||||
if (freq_offset >= 0)
|
||||
freq_offset += 100;
|
||||
|
||||
freq_offset *= -1;
|
||||
LOG_I(PHY, "[initial_sync] trying carrier off %d Hz, rxgain %d (DL %lu, UL %lu)\n",
|
||||
freq_offset,
|
||||
UE->rx_total_gain_dB,
|
||||
UE->frame_parms.dl_CarrierFreq+freq_offset,
|
||||
UE->frame_parms.ul_CarrierFreq+freq_offset );
|
||||
|
||||
for (i=0; i<openair0_cfg[UE->rf_map.card].rx_num_channels; i++) {
|
||||
openair0_cfg[UE->rf_map.card].rx_freq[UE->rf_map.chain+i] = UE->frame_parms.dl_CarrierFreq+freq_offset;
|
||||
openair0_cfg[UE->rf_map.card].tx_freq[UE->rf_map.chain+i] = UE->frame_parms.ul_CarrierFreq+freq_offset;
|
||||
openair0_cfg[UE->rf_map.card].rx_gain[UE->rf_map.chain+i] = UE->rx_total_gain_dB;//-USRP_GAIN_OFFSET;
|
||||
nr_rf_card_config(&openair0_cfg[UE->rf_map.card], rx_gain_off, ul_carrier, dl_carrier, freq_offset);
|
||||
|
||||
if (UE->UE_scan_carrier==1)
|
||||
openair0_cfg[UE->rf_map.card].autocal[UE->rf_map.chain+i] = 1;
|
||||
}
|
||||
LOG_I(PHY, "Initial sync failed: trying carrier off %d Hz\n", freq_offset);
|
||||
|
||||
if (UE->mode != loop_through_memory)
|
||||
UE->rfdevice.trx_set_freq_func(&UE->rfdevice,&openair0_cfg[0],0);
|
||||
}// initial_sync=0
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
+124
-315
@@ -40,7 +40,7 @@
|
||||
//#undef FRAME_LENGTH_COMPLEX_SAMPLES //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
#include "openair1/PHY/MODULATION/nr_modulation.h"
|
||||
#include "PHY/phy_vars_nr_ue.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_vars.h"
|
||||
#include "PHY/NR_UE_TRANSPORT/nr_transport_proto_ue.h"
|
||||
#include "SCHED/sched_common_vars.h"
|
||||
#include "PHY/MODULATION/modulation_vars.h"
|
||||
//#include "../../SIMU/USER/init_lte.h"
|
||||
@@ -85,7 +85,9 @@ unsigned short config_frames[4] = {2,9,11,13};
|
||||
#include "executables/softmodem-common.h"
|
||||
#include "executables/thread-common.h"
|
||||
|
||||
// Raphael : missing
|
||||
extern const char *duplex_mode[];
|
||||
|
||||
// Thread variables
|
||||
pthread_cond_t nfapi_sync_cond;
|
||||
pthread_mutex_t nfapi_sync_mutex;
|
||||
int nfapi_sync_var=-1; //!< protected by mutex \ref nfapi_sync_mutex
|
||||
@@ -94,30 +96,40 @@ pthread_cond_t sync_cond;
|
||||
pthread_mutex_t sync_mutex;
|
||||
int sync_var=-1; //!< protected by mutex \ref sync_mutex.
|
||||
int config_sync_var=-1;
|
||||
tpool_t *Tpool;
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
RAN_CONTEXT_t RC;
|
||||
volatile int start_eNB = 0;
|
||||
volatile int start_UE = 0;
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
int single_thread_flag=1;
|
||||
static double snr_dB=20;
|
||||
// Command line options
|
||||
|
||||
int threequarter_fs=0;
|
||||
extern int16_t nr_dlsch_demod_shift;
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
//int32_t uplink_counter = 0;
|
||||
|
||||
|
||||
extern int16_t nr_dlsch_demod_shift;
|
||||
|
||||
int UE_scan = 0;
|
||||
int UE_scan_carrier = 0;
|
||||
int UE_fo_compensation = 0;
|
||||
int single_thread_flag = 1;
|
||||
int threequarter_fs = 0;
|
||||
int UE_scan_carrier = 0;
|
||||
int UE_fo_compensation = 0;
|
||||
int UE_no_timing_correction = 0;
|
||||
runmode_t mode = normal_txrx;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int N_RB_DL = 0;
|
||||
int tddflag = 0;
|
||||
int vcdflag = 0;
|
||||
uint8_t nb_antenna_tx = 1;
|
||||
uint8_t nb_antenna_rx = 1;
|
||||
double rx_gain_off = 0.0;
|
||||
uint32_t timing_advance = 0;
|
||||
char *usrp_args = NULL;
|
||||
char *rrc_config_path = NULL;
|
||||
int dumpframe = 0;
|
||||
|
||||
uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
int rx_input_level_dBm;
|
||||
|
||||
#if MAX_NUM_CCs == 1
|
||||
rx_gain_t rx_gain_mode[MAX_NUM_CCs][4] = {{max_gain,max_gain,max_gain,max_gain}};
|
||||
@@ -129,74 +141,25 @@ double tx_gain[MAX_NUM_CCs][4] = {{20,0,0,0},{20,0,0,0}};
|
||||
double rx_gain[MAX_NUM_CCs][4] = {{110,0,0,0},{20,0,0,0}};
|
||||
#endif
|
||||
|
||||
double rx_gain_off = 0.0;
|
||||
// UE and OAI config variables
|
||||
|
||||
double sample_rate=30.72e6;
|
||||
double bw = 10.0e6;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
int otg_enabled;
|
||||
double cpuf;
|
||||
|
||||
static int tx_max_power[MAX_NUM_CCs] = {0};
|
||||
|
||||
|
||||
int chain_offset=0;
|
||||
|
||||
|
||||
uint8_t dci_Format = 0;
|
||||
uint8_t agregation_Level =0xFF;
|
||||
|
||||
uint8_t nb_antenna_tx = 1;
|
||||
uint8_t nb_antenna_rx = 1;
|
||||
|
||||
char ref[128] = "internal";
|
||||
char channels[128] = "0";
|
||||
|
||||
|
||||
int rx_input_level_dBm;
|
||||
|
||||
//static int online_log_messages=0;
|
||||
|
||||
|
||||
int otg_enabled;
|
||||
//int number_of_cards = 1;
|
||||
|
||||
static NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
|
||||
int16_t node_synch_ref[MAX_NUM_CCs];
|
||||
|
||||
uint32_t target_dl_mcs = 28; //maximum allowed mcs
|
||||
uint32_t target_ul_mcs = 20;
|
||||
uint32_t timing_advance = 0;
|
||||
uint64_t num_missed_slots=0; // counter for the number of missed slots
|
||||
|
||||
|
||||
int transmission_mode=1;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
|
||||
/* flag set by eNB conf file to specify if the radio head is local or remote (default option is local) */
|
||||
//uint8_t local_remote_radio = BBU_LOCAL_RADIO_HEAD;
|
||||
/* struct for ethernet specific parameters given in eNB conf file */
|
||||
//eth_params_t *eth_params;
|
||||
|
||||
double cpuf;
|
||||
runmode_t mode = normal_txrx;
|
||||
int UE_scan = 0;
|
||||
int chain_offset = 0;
|
||||
uint64_t num_missed_slots = 0; // counter for the number of missed slots
|
||||
int transmission_mode = 1;
|
||||
int numerology = 0;
|
||||
int usrp_tx_thread = 0;
|
||||
int oaisim_flag = 0;
|
||||
int emulate_rf = 0;
|
||||
|
||||
char uecap_xer[1024],uecap_xer_in=0;
|
||||
|
||||
int oaisim_flag=0;
|
||||
int emulate_rf = 0;
|
||||
|
||||
tpool_t *Tpool;
|
||||
#ifdef UE_DLSCH_PARALLELISATION
|
||||
tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
|
||||
char *usrp_args=NULL;
|
||||
|
||||
char *rrc_config_path=NULL;
|
||||
|
||||
/* forward declarations */
|
||||
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]);
|
||||
|
||||
|
||||
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
|
||||
* this is very hackish - find a proper solution
|
||||
*/
|
||||
@@ -245,37 +208,6 @@ void exit_function(const char *file, const char *function, const int line, const
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
||||
void reset_stats(long arg) {
|
||||
//int i,j,k;
|
||||
/*PHY_VARS_eNB *phy_vars_eNB = PHY_vars_eNB_g[0][0];
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
for (k=0; k<8; k++) { //harq_processes
|
||||
for (j=0; j<phy_vars_eNB->dlsch[i][0]->Mlimit; j++) {
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_ACK[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_trials[k][j]=0;
|
||||
}
|
||||
|
||||
phy_vars_eNB->UE_stats[i].dlsch_l2_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_errors[k]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_consecutive_errors=0;
|
||||
|
||||
for (j=0; j<phy_vars_eNB->ulsch[i]->Mlimit; j++) {
|
||||
phy_vars_eNB->UE_stats[i].ulsch_decoding_attempts[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_decoding_attempts_last[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_round_errors[k][j]=0;
|
||||
phy_vars_eNB->UE_stats[i].ulsch_round_fer[k][j]=0;
|
||||
}
|
||||
}
|
||||
|
||||
phy_vars_eNB->UE_stats[i].dlsch_sliding_cnt=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_NAK_round0=0;
|
||||
phy_vars_eNB->UE_stats[i].dlsch_mcs_offset=0;
|
||||
}*/
|
||||
}
|
||||
|
||||
void *l2l1_task(void *arg) {
|
||||
MessageDef *message_p = NULL;
|
||||
int result;
|
||||
@@ -316,21 +248,12 @@ void *l2l1_task(void *arg) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
int16_t dlsch_demod_shift;
|
||||
|
||||
static void get_options(void) {
|
||||
int CC_id;
|
||||
int tddflag=0, nonbiotflag, vcdflag=0;
|
||||
|
||||
char *loopfile=NULL;
|
||||
int dumpframe=0;
|
||||
//uint32_t noS1;
|
||||
//uint32_t nokrnmod;
|
||||
//uint32_t nokrnmod;
|
||||
|
||||
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC_UE ;
|
||||
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
|
||||
|
||||
|
||||
paramdef_t cmdline_uemodeparams[] = CMDLINE_UEMODEPARAMS_DESC;
|
||||
paramdef_t cmdline_ueparams[] = CMDLINE_NRUEPARAMS_DESC;
|
||||
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
|
||||
@@ -351,54 +274,12 @@ static void get_options(void) {
|
||||
if (cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr)
|
||||
if ( *(cmdline_uemodeparams[CMDLINE_CALIBPRACHTX_IDX].uptr) > 0) mode = calib_prach_tx;
|
||||
|
||||
if (dumpframe > 0) mode = rx_dump_frame;
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
|
||||
UE_scan=0;
|
||||
|
||||
if (tddflag > 0) {
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
|
||||
frame_parms[CC_id]->frame_type = TDD;
|
||||
}
|
||||
if ((cmdline_uemodeparams[CMDLINE_DUMPMEMORY_IDX].paramflags & PARAMFLAG_PARAMSET) != 0)
|
||||
mode = rx_dump_frame;
|
||||
|
||||
if (vcdflag > 0)
|
||||
ouput_vcd = 1;
|
||||
|
||||
/*if (frame_parms[0]->N_RB_DL !=0) {
|
||||
if ( frame_parms[0]->N_RB_DL < 6 ) {
|
||||
frame_parms[0]->N_RB_DL = 6;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 6\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 100;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 100\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 50 && frame_parms[0]->N_RB_DL < 100 ) {
|
||||
frame_parms[0]->N_RB_DL = 50;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 50\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
if ( frame_parms[0]->N_RB_DL > 25 && frame_parms[0]->N_RB_DL < 50 ) {
|
||||
frame_parms[0]->N_RB_DL = 25;
|
||||
printf ( "%i: Invalid number of resource blocks, adjusted to 25\n",frame_parms[0]->N_RB_DL);
|
||||
}
|
||||
UE_scan = 0;
|
||||
frame_parms[0]->N_RB_UL=frame_parms[0]->N_RB_DL;
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
frame_parms[CC_id]->N_RB_DL=frame_parms[0]->N_RB_DL;
|
||||
frame_parms[CC_id]->N_RB_UL=frame_parms[0]->N_RB_UL;
|
||||
}
|
||||
}*/
|
||||
|
||||
for (CC_id=1; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
tx_max_power[CC_id]=tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
}
|
||||
|
||||
|
||||
if ( !(CONFIG_ISFLAGSET(CONFIG_ABORT)) && (!(CONFIG_ISFLAGSET(CONFIG_NOOOPT))) ) {
|
||||
// Here the configuration file is the XER encoded UE capabilities
|
||||
// Read it in and store in asn1c data structures
|
||||
@@ -408,44 +289,56 @@ static void get_options(void) {
|
||||
} /* UE with config file */
|
||||
}
|
||||
|
||||
// set PHY vars from command line
|
||||
void set_options(int CC_id, PHY_VARS_NR_UE *UE){
|
||||
|
||||
void set_default_frame_parms(NR_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs]) {
|
||||
int CC_id;
|
||||
// Init power variables
|
||||
tx_max_power[CC_id] = tx_max_power[0];
|
||||
rx_gain[0][CC_id] = rx_gain[0][0];
|
||||
tx_gain[0][CC_id] = tx_gain[0][0];
|
||||
|
||||
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
/* Set some default values that may be overwritten while reading options */
|
||||
frame_parms[CC_id] = (NR_DL_FRAME_PARMS *) calloc(sizeof(NR_DL_FRAME_PARMS),1);
|
||||
frame_parms[CC_id]->nr_band = 78;
|
||||
frame_parms[CC_id]->frame_type = FDD;
|
||||
frame_parms[CC_id]->tdd_config = 3;
|
||||
//frame_parms[CC_id]->tdd_config_S = 0;
|
||||
frame_parms[CC_id]->N_RB_DL = 106;
|
||||
frame_parms[CC_id]->N_RB_UL = 106;
|
||||
frame_parms[CC_id]->Ncp = NORMAL;
|
||||
//frame_parms[CC_id]->Ncp_UL = NORMAL;
|
||||
frame_parms[CC_id]->Nid_cell = 0;
|
||||
//frame_parms[CC_id]->num_MBSFN_config = 0;
|
||||
frame_parms[CC_id]->nb_antenna_ports_gNB = 1;
|
||||
frame_parms[CC_id]->nb_antennas_tx = 1;
|
||||
frame_parms[CC_id]->nb_antennas_rx = 1;
|
||||
//frame_parms[CC_id]->nushift = 0;
|
||||
// NR: Init to legacy LTE 20Mhz params
|
||||
frame_parms[CC_id]->numerology_index = 0;
|
||||
frame_parms[CC_id]->ttis_per_subframe = 1;
|
||||
frame_parms[CC_id]->slots_per_tti = 2;
|
||||
// Set UE variables
|
||||
UE->UE_scan = UE_scan;
|
||||
UE->UE_scan_carrier = UE_scan_carrier;
|
||||
UE->UE_fo_compensation = UE_fo_compensation;
|
||||
UE->no_timing_correction = UE_no_timing_correction;
|
||||
UE->mode = mode;
|
||||
UE->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
|
||||
UE->tx_total_gain_dB = (int)tx_gain[CC_id][0];
|
||||
UE->tx_power_max_dBm = tx_max_power[CC_id];
|
||||
|
||||
LOG_I(PHY,"Set UE mode %d, UE_fo_compensation %d, UE_scan %d, UE_scan_carrier %d, UE_no_timing_correction %d \n", mode, UE_fo_compensation, UE_scan, UE_scan_carrier, UE_no_timing_correction);
|
||||
|
||||
// Set FP variables
|
||||
NR_DL_FRAME_PARMS *fp = &UE->frame_parms;
|
||||
fp->nb_antennas_tx = nb_antenna_tx;
|
||||
fp->nb_antennas_rx = nb_antenna_rx;
|
||||
fp->threequarter_fs = threequarter_fs;
|
||||
if (tddflag){
|
||||
fp->frame_type = TDD;
|
||||
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
|
||||
}
|
||||
if (N_RB_DL){
|
||||
fp->N_RB_DL = N_RB_DL;
|
||||
LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
|
||||
}
|
||||
|
||||
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", nb_antenna_rx, nb_antenna_tx, threequarter_fs);
|
||||
|
||||
}
|
||||
|
||||
void init_openair0(void) {
|
||||
int card;
|
||||
int i;
|
||||
int freq_off = 0;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &PHY_vars_UE_g[0][0]->frame_parms;
|
||||
|
||||
for (card=0; card<MAX_CARDS; card++) {
|
||||
uint64_t dl_carrier, ul_carrier;
|
||||
openair0_cfg[card].configFilename = NULL;
|
||||
openair0_cfg[card].threequarter_fs = frame_parms[0]->threequarter_fs;
|
||||
numerology = frame_parms[0]->numerology_index;
|
||||
openair0_cfg[card].threequarter_fs = frame_parms->threequarter_fs;
|
||||
numerology = frame_parms->numerology_index;
|
||||
|
||||
if(frame_parms[0]->N_RB_DL == 66) {
|
||||
if(frame_parms->N_RB_DL == 66) {
|
||||
if (numerology==3) {
|
||||
openair0_cfg[card].sample_rate=122.88e6;
|
||||
openair0_cfg[card].samples_per_frame = 1228800;
|
||||
@@ -453,7 +346,7 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}else if(frame_parms[0]->N_RB_DL == 32) {
|
||||
}else if(frame_parms->N_RB_DL == 32) {
|
||||
if (numerology==3) {
|
||||
openair0_cfg[card].sample_rate=61.44e6;
|
||||
openair0_cfg[card].samples_per_frame = 614400;
|
||||
@@ -461,9 +354,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology! FR2 supports only 120KHz SCS for now.\n");
|
||||
exit(-1);
|
||||
}
|
||||
}else if(frame_parms[0]->N_RB_DL == 217) {
|
||||
}else if(frame_parms->N_RB_DL == 217) {
|
||||
if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=92.16e6;
|
||||
openair0_cfg[card].samples_per_frame = 921600;
|
||||
}
|
||||
@@ -475,9 +368,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 273) {
|
||||
} else if(frame_parms->N_RB_DL == 273) {
|
||||
if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
AssertFatal(0 == 1,"three quarter sampling not supported for N_RB 273\n");
|
||||
}
|
||||
else {
|
||||
@@ -488,9 +381,9 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 106) {
|
||||
} else if(frame_parms->N_RB_DL == 106) {
|
||||
if (numerology==0) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=23.04e6;
|
||||
openair0_cfg[card].samples_per_frame = 230400;
|
||||
} else {
|
||||
@@ -498,7 +391,7 @@ void init_openair0(void) {
|
||||
openair0_cfg[card].samples_per_frame = 307200;
|
||||
}
|
||||
} else if (numerology==1) {
|
||||
if (frame_parms[0]->threequarter_fs) {
|
||||
if (frame_parms->threequarter_fs) {
|
||||
openair0_cfg[card].sample_rate=46.08e6;
|
||||
openair0_cfg[card].samples_per_frame = 460800;
|
||||
}
|
||||
@@ -513,57 +406,44 @@ void init_openair0(void) {
|
||||
LOG_E(PHY,"Unsupported numerology!\n");
|
||||
exit(-1);
|
||||
}
|
||||
} else if(frame_parms[0]->N_RB_DL == 50) {
|
||||
} else if(frame_parms->N_RB_DL == 50) {
|
||||
openair0_cfg[card].sample_rate=15.36e6;
|
||||
openair0_cfg[card].samples_per_frame = 153600;
|
||||
} else if (frame_parms[0]->N_RB_DL == 25) {
|
||||
} else if (frame_parms->N_RB_DL == 25) {
|
||||
openair0_cfg[card].sample_rate=7.68e6;
|
||||
openair0_cfg[card].samples_per_frame = 76800;
|
||||
} else if (frame_parms[0]->N_RB_DL == 6) {
|
||||
} else if (frame_parms->N_RB_DL == 6) {
|
||||
openair0_cfg[card].sample_rate=1.92e6;
|
||||
openair0_cfg[card].samples_per_frame = 19200;
|
||||
}
|
||||
else {
|
||||
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms[0]->N_RB_DL);
|
||||
LOG_E(PHY,"Unknown NB_RB %d!\n",frame_parms->N_RB_DL);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
if (frame_parms[0]->frame_type==TDD)
|
||||
if (frame_parms->frame_type==TDD)
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_TDD;
|
||||
else //FDD
|
||||
else
|
||||
openair0_cfg[card].duplex_mode = duplex_mode_FDD;
|
||||
|
||||
printf("HW: Configuring card %d, nb_antennas_tx/rx %hhu/%hhu\n",card,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx,
|
||||
PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].Mod_id = 0;
|
||||
openair0_cfg[card].num_rb_dl=frame_parms[0]->N_RB_DL;
|
||||
openair0_cfg[card].num_rb_dl = frame_parms->N_RB_DL;
|
||||
openair0_cfg[card].clock_source = get_softmodem_params()->clock_source;
|
||||
openair0_cfg[card].time_source = get_softmodem_params()->timing_source;
|
||||
openair0_cfg[card].tx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels=min(2,PHY_vars_UE_g[0][0]->frame_parms.nb_antennas_rx);
|
||||
openair0_cfg[card].tx_num_channels = min(2, frame_parms->nb_antennas_tx);
|
||||
openair0_cfg[card].rx_num_channels = min(2, frame_parms->nb_antennas_rx);
|
||||
|
||||
for (i=0; i<4; i++) {
|
||||
if (i<openair0_cfg[card].tx_num_channels)
|
||||
openair0_cfg[card].tx_freq[i] = frame_parms[0]->ul_CarrierFreq;
|
||||
else
|
||||
openair0_cfg[card].tx_freq[i]=0.0;
|
||||
LOG_I(PHY, "HW: Configuring card %d, tx/rx num_channels %d/%d, duplex_mode %s\n",
|
||||
card,
|
||||
openair0_cfg[card].tx_num_channels,
|
||||
openair0_cfg[card].rx_num_channels,
|
||||
duplex_mode[openair0_cfg[card].duplex_mode]);
|
||||
|
||||
if (i<openair0_cfg[card].rx_num_channels)
|
||||
openair0_cfg[card].rx_freq[i] = frame_parms[0]->dl_CarrierFreq;
|
||||
else
|
||||
openair0_cfg[card].rx_freq[i]=0.0;
|
||||
nr_get_carrier_frequencies(frame_parms, &dl_carrier, &ul_carrier);
|
||||
|
||||
openair0_cfg[card].autocal[i] = 1;
|
||||
openair0_cfg[card].tx_gain[i] = tx_gain[0][i];
|
||||
openair0_cfg[card].rx_gain[i] = PHY_vars_UE_g[0][0]->rx_total_gain_dB - rx_gain_off;
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
printf("Card %d, channel %d, Setting tx_gain %f, rx_gain %f, tx_freq %f, rx_freq %f\n",
|
||||
card,i, openair0_cfg[card].tx_gain[i],
|
||||
openair0_cfg[card].rx_gain[i],
|
||||
openair0_cfg[card].tx_freq[i],
|
||||
openair0_cfg[card].rx_freq[i]);
|
||||
}
|
||||
nr_rf_card_config(&openair0_cfg[card], rx_gain_off, ul_carrier, dl_carrier, freq_off);
|
||||
|
||||
openair0_cfg[card].configFilename = get_softmodem_params()->rf_config_file;
|
||||
|
||||
if (usrp_args) openair0_cfg[card].sdr_addrs = usrp_args;
|
||||
|
||||
@@ -607,14 +487,12 @@ int main( int argc, char **argv ) {
|
||||
}
|
||||
set_softmodem_sighandler();
|
||||
CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
|
||||
set_default_frame_parms(frame_parms);
|
||||
mode = normal_txrx;
|
||||
memset(openair0_cfg,0,sizeof(openair0_config_t)*MAX_CARDS);
|
||||
memset(tx_max_power,0,sizeof(int)*MAX_NUM_CCs);
|
||||
// initialize logging
|
||||
logInit();
|
||||
// get options and fill parameters from configuration file
|
||||
get_options (); //Command-line options, enb_properties
|
||||
get_options(); //Command-line options
|
||||
get_common_options(SOFTMODEM_5GUE_BIT );
|
||||
#if T_TRACER
|
||||
T_Config_Init();
|
||||
@@ -649,14 +527,6 @@ int main( int argc, char **argv ) {
|
||||
init_NR_UE(1,rrc_config_path);
|
||||
if(IS_SOFTMODEM_NOS1)
|
||||
init_pdcp();
|
||||
/*
|
||||
#ifdef PDCP_USE_NETLINK
|
||||
netlink_init();
|
||||
#if defined(PDCP_USE_NETLINK_QUEUES)
|
||||
pdcp_netlink_init();
|
||||
#endif
|
||||
#endif
|
||||
*/
|
||||
|
||||
NB_UE_INST=1;
|
||||
NB_INST=1;
|
||||
@@ -667,93 +537,33 @@ int main( int argc, char **argv ) {
|
||||
AssertFatal(get_softmodem_params()->phy_test == 0,"RA and phy_test are mutually exclusive\n");
|
||||
|
||||
for (int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
printf("frame_parms %d\n",frame_parms[CC_id]->ofdm_symbol_size);
|
||||
frame_parms[CC_id]->nb_antennas_tx = nb_antenna_tx;
|
||||
frame_parms[CC_id]->nb_antennas_rx = nb_antenna_rx;
|
||||
frame_parms[CC_id]->nb_antenna_ports_gNB = 1; //initial value overwritten by initial sync later
|
||||
frame_parms[CC_id]->threequarter_fs = threequarter_fs;
|
||||
LOG_I(PHY,"Set nb_rx_antenna %d , nb_tx_antenna %d \n",frame_parms[CC_id]->nb_antennas_rx, frame_parms[CC_id]->nb_antennas_tx);
|
||||
|
||||
PHY_vars_UE_g[0][CC_id] = (PHY_VARS_NR_UE *)malloc(sizeof(PHY_VARS_NR_UE));
|
||||
|
||||
UE[CC_id] = PHY_vars_UE_g[0][CC_id];
|
||||
memset(UE[CC_id],0,sizeof(PHY_VARS_NR_UE));
|
||||
|
||||
set_options(CC_id, UE[CC_id]);
|
||||
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(0);
|
||||
if(mac->if_module != NULL && mac->if_module->phy_config_request != NULL)
|
||||
mac->if_module->phy_config_request(&mac->phy_config);
|
||||
|
||||
fapi_nr_config_request_t *nrUE_config = &UE[CC_id]->nrUE_config;
|
||||
nr_init_frame_parms_ue(frame_parms[CC_id],nrUE_config,NORMAL);
|
||||
|
||||
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config, *mac->scc->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0]);
|
||||
init_symbol_rotation(&UE[CC_id]->frame_parms, UE[CC_id]->frame_parms.dl_CarrierFreq);
|
||||
init_nr_ue_vars(UE[CC_id], 0, abstraction_flag);
|
||||
|
||||
#ifdef FR2_TEST
|
||||
// Overwrite DL frequency (for FR2 testing)
|
||||
if (downlink_frequency[0][0]!=0) {
|
||||
if (downlink_frequency[0][0]!=0){
|
||||
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
|
||||
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
|
||||
init_symbol_rotation(frame_parms[CC_id],frame_parms[CC_id]->dl_CarrierFreq);
|
||||
init_nr_ue_vars(UE[CC_id],frame_parms[CC_id],0,abstraction_flag);
|
||||
|
||||
UE[CC_id]->mac_enabled = 1;
|
||||
UE[CC_id]->if_inst = nr_ue_if_module_init(0);
|
||||
UE[CC_id]->UE_scan = UE_scan;
|
||||
UE[CC_id]->UE_scan_carrier = UE_scan_carrier;
|
||||
UE[CC_id]->UE_fo_compensation = UE_fo_compensation;
|
||||
UE[CC_id]->mode = mode;
|
||||
UE[CC_id]->no_timing_correction = UE_no_timing_correction;
|
||||
printf("UE[%d]->mode = %d\n",CC_id,mode);
|
||||
|
||||
UE[CC_id]->rx_total_gain_dB = (int)rx_gain[CC_id][0] + rx_gain_off;
|
||||
UE[CC_id]->tx_power_max_dBm = tx_max_power[CC_id];
|
||||
|
||||
if (UE[CC_id]->frame_parms.frame_type == FDD) {
|
||||
UE[CC_id]->N_TA_offset = 0;
|
||||
} else {
|
||||
int N_RB = UE[CC_id]->frame_parms.N_RB_DL;
|
||||
int N_TA_offset = UE[CC_id]->frame_parms.ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
double factor=1;
|
||||
switch (UE[CC_id]->frame_parms.numerology_index) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n");
|
||||
if (N_RB <= 25) factor = .25; // 7.68 Ms/s
|
||||
else if (N_RB <=50) factor = .5; // 15.36 Ms/s
|
||||
else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s
|
||||
else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s
|
||||
else AssertFatal(1==0,"Too many PRBS for mu=0\n");
|
||||
break;
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n");
|
||||
if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s
|
||||
break;
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n");
|
||||
break;
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(1==0,"scs_common should not be 60 kHz\n");
|
||||
if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s
|
||||
else AssertFatal(1==0,"N_RB %d is too big for curretn FR2 implementation\n",N_RB);
|
||||
break;
|
||||
|
||||
if (N_RB == 100)
|
||||
UE[CC_id]->N_TA_offset = 624;
|
||||
else if (N_RB == 50)
|
||||
UE[CC_id]->N_TA_offset = 624/2;
|
||||
else if (N_RB == 25)
|
||||
UE[CC_id]->N_TA_offset = 624/4;
|
||||
}
|
||||
if (UE[CC_id]->frame_parms.threequarter_fs == 1) factor = factor*.75;
|
||||
UE[CC_id]->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d)\n", UE[CC_id]->Mod_id, UE[CC_id]->N_TA_offset, factor, UE[CC_id]->frame_parms.ul_CarrierFreq, N_RB);
|
||||
if (frame_parms[CC_id]->frame_type == TDD)
|
||||
frame_parms[CC_id]->ul_CarrierFreq = downlink_frequency[0][0];
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// printf("tx_max_power = %d -> amp %d\n",tx_max_power[0],get_tx_amp(tx_max_poHwer,tx_max_power));
|
||||
init_openair0();
|
||||
// init UE_PF_PO and mutex lock
|
||||
pthread_mutex_init(&ue_pf_po_mutex, NULL);
|
||||
@@ -764,7 +574,6 @@ int main( int argc, char **argv ) {
|
||||
if(IS_SOFTMODEM_DOFORMS) {
|
||||
load_softscope("nr",PHY_vars_UE_g[0][0]);
|
||||
}
|
||||
number_of_cards = 1;
|
||||
|
||||
for(int CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
|
||||
PHY_vars_UE_g[0][CC_id]->rf_map.card=0;
|
||||
|
||||
@@ -48,13 +48,12 @@
|
||||
{"ue-scan-carrier", CONFIG_HLP_UESCAN, PARAMFLAG_BOOL, iptr:&UE_scan_carrier, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-fo-compensation", CONFIG_HLP_UEFO, PARAMFLAG_BOOL, iptr:&UE_fo_compensation, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-max-power", NULL, 0, iptr:&(tx_max_power[0]), defintval:90, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, iptr:&(frame_parms[0]->N_RB_DL), defintval:25, TYPE_UINT, 0}, \
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"r" , CONFIG_HLP_PRB, 0, iptr:&(N_RB_DL), defintval:25, TYPE_UINT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters common to eNodeB and UE */
|
||||
/* command line parameters common to gNB and UE */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define CMDLINE_PARAMS_DESC_UE { \
|
||||
@@ -62,22 +61,16 @@
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
{"E" , CONFIG_HLP_TQFS, PARAMFLAG_BOOL, iptr:&threequarter_fs, defintval:0, TYPE_INT, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS, 0, uptr:&target_dl_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS, 0, uptr:&target_ul_mcs, defintval:0, TYPE_UINT, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"V" , CONFIG_HLP_VCD, PARAMFLAG_BOOL, iptr:&vcdflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"s" , CONFIG_HLP_SNR, 0, dblptr:&snr_dB, defdblval:25, TYPE_DOUBLE, 0}, \
|
||||
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, iptr:&nonbiotflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"ue-timing-correction-disable", CONFIG_HLP_DISABLETIMECORR, PARAMFLAG_BOOL, iptr:&UE_no_timing_correction, defintval:0, TYPE_INT, 0}, \
|
||||
{"rrc_config_path", CONFIG_HLP_RRC_CFG_PATH,0, strptr:(char **)&rrc_config_path, defstrval:"./", TYPE_STRING, 0} \
|
||||
}
|
||||
|
||||
|
||||
extern int T_port;
|
||||
extern int T_nowait;
|
||||
extern int T_dont_fork;
|
||||
|
||||
|
||||
// In nr-ue.c
|
||||
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
|
||||
extern void fill_ue_band_info(void);
|
||||
@@ -86,7 +79,7 @@ extern void init_NR_UE_threads(int);
|
||||
extern void reset_opp_meas(void);
|
||||
extern void print_opp_meas(void);
|
||||
void *UE_thread(void *arg);
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, NR_DL_FRAME_PARMS *frame_parms, uint8_t UE_id, uint8_t abstraction_flag);
|
||||
void init_nr_ue_vars(PHY_VARS_NR_UE *ue, uint8_t UE_id, uint8_t abstraction_flag);
|
||||
extern tpool_t *Tpool;
|
||||
extern tpool_t *Tpool_dl;
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -63,6 +63,7 @@ extern "C"
|
||||
#define CONFIG_HLP_USIM "use XOR autentication algo in case of test usim mode\n"
|
||||
#define CONFIG_HLP_NOSNGLT "Disables single-thread mode in lte-softmodem\n"
|
||||
#define CONFIG_HLP_DLF "Set the downlink frequency for all component carriers\n"
|
||||
#define CONFIG_HLP_ULF "Set the uplink frequency offset for all component carriers\n"
|
||||
#define CONFIG_HLP_CHOFF "Channel id offset\n"
|
||||
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
|
||||
#define CONFIG_HLP_EXMCAL "Calibrate the EXMIMO borad, available files: exmimo2_2arxg.lime exmimo2_2brxg.lime \n"
|
||||
@@ -123,6 +124,7 @@ extern "C"
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
|
||||
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:0, TYPE_UINT64, 0}, \
|
||||
{"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
|
||||
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
|
||||
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
|
||||
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
|
||||
@@ -230,6 +232,7 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
|
||||
#define SOFTMODEM_RTSIGNAL (SIGRTMIN+1)
|
||||
extern void set_softmodem_sighandler(void);
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -720,9 +720,6 @@ int pnf_phy_hi_dci0_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfa
|
||||
}
|
||||
|
||||
int pnf_phy_dl_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, nfapi_dl_config_request_t *req) {
|
||||
if (RC.ru == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (RC.eNB == 0) {
|
||||
return -2;
|
||||
@@ -847,9 +844,6 @@ int pnf_phy_ul_config_req(L1_rxtx_proc_t *proc, nfapi_pnf_p7_config_t *pnf_p7, n
|
||||
req->ul_config_request_body.srs_present
|
||||
);
|
||||
|
||||
if (RC.ru == 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (RC.eNB == 0) {
|
||||
return -2;
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#include "PHY/impl_defs_nr.h"
|
||||
|
||||
#define NFAPI_UE_MAX_NUM_CB 8
|
||||
#define NFAPI_MAX_NUM_UL_PDU 8
|
||||
|
||||
/*
|
||||
typedef unsigned int uint32_t;
|
||||
@@ -155,7 +156,7 @@ typedef struct {
|
||||
uint16_t slot;
|
||||
fapi_nr_tx_config_t tx_config;
|
||||
uint16_t number_of_pdus;
|
||||
fapi_nr_tx_request_body_t *tx_request_body;
|
||||
fapi_nr_tx_request_body_t tx_request_body[NFAPI_MAX_NUM_UL_PDU];
|
||||
} fapi_nr_tx_request_t;
|
||||
|
||||
/// This struct replaces:
|
||||
|
||||
@@ -45,8 +45,6 @@
|
||||
|
||||
/*
|
||||
extern uint32_t from_nrarfcn(int nr_bandP,uint32_t dl_nrarfcn);
|
||||
|
||||
extern int32_t get_nr_uldl_offset(int nr_bandP);
|
||||
extern openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
*/
|
||||
|
||||
@@ -458,52 +456,26 @@ void nr_phy_config_request(NR_PHY_Config_t *phy_config) {
|
||||
uint8_t short_sequence, num_sequences, rootSequenceIndex, fd_occasion;
|
||||
NR_DL_FRAME_PARMS *fp = &RC.gNB[Mod_id]->frame_parms;
|
||||
nfapi_nr_config_request_scf_t *gNB_config = &RC.gNB[Mod_id]->gNB_config;
|
||||
int32_t dlul_offset = 0;
|
||||
|
||||
/*
|
||||
gNB_config->cell_config.phy_cell_id.value = phy_config->cfg->cell_config.phy_cell_id.value;
|
||||
gNB_config->carrier_config.dl_frequency.value = phy_config->cfg->carrier_config.dl_frequency.value;
|
||||
gNB_config->carrier_config.uplink_frequency.value = phy_config->cfg->carrier_config.uplink_frequency.value;
|
||||
gNB_config->ssb_config.scs_common.value = phy_config->cfg->ssb_config.scs_common.value;
|
||||
gNB_config->carrier_config.dl_bandwidth.value = phy_config->cfg->carrier_config.dl_bandwidth.value;
|
||||
gNB_config->carrier_config.uplink_bandwidth.value = phy_config->cfg->carrier_config.uplink_bandwidth.value;
|
||||
gNB_config->ssb_table.ssb_subcarrier_offset.value = phy_config->cfg->ssb_table.ssb_subcarrier_offset.value;
|
||||
gNB_config->ssb_table.ssb_offset_point_a.value = phy_config->cfg->ssb_table.ssb_offset_point_a.value;
|
||||
gNB_config->ssb_table.ssb_mask_list[0].ssb_mask.value = phy_config->cfg->ssb_table.ssb_mask_list[0].ssb_mask.value;
|
||||
gNB_config->ssb_table.ssb_mask_list[1].ssb_mask.value = phy_config->cfg->ssb_table.ssb_mask_list[1].ssb_mask.value;
|
||||
gNB_config->ssb_table.ssb_period.value = phy_config->cfg->ssb_table.ssb_period.value;
|
||||
for (int i=0; i<5; i++) {
|
||||
gNB_config->carrier_config.dl_grid_size[i].value = phy_config->cfg->carrier_config.dl_grid_size[i].value;
|
||||
gNB_config->carrier_config.ul_grid_size[i].value = phy_config->cfg->carrier_config.ul_grid_size[i].value;
|
||||
gNB_config->carrier_config.dl_k0[i].value = phy_config->cfg->carrier_config.dl_k0[i].value;
|
||||
gNB_config->carrier_config.ul_k0[i].value = phy_config->cfg->carrier_config.ul_k0[i].value;
|
||||
}
|
||||
|
||||
|
||||
if (phy_config->cfg->cell_config.frame_duplex_type.value == 0) {
|
||||
gNB_config->cell_config.frame_duplex_type.value = FDD;
|
||||
} else {
|
||||
gNB_config->cell_config.frame_duplex_type.value = TDD;
|
||||
}
|
||||
|
||||
memcpy((void*)&gNB_config->prach_config,(void*)&phy_config->cfg->prach_config,sizeof(phy_config->cfg->prach_config));
|
||||
memcpy((void*)&gNB_config->tdd_table,(void*)&phy_config->cfg->tdd_table,sizeof(phy_config->cfg->tdd_table));
|
||||
*/
|
||||
memcpy((void*)gNB_config,phy_config->cfg,sizeof(*phy_config->cfg));
|
||||
RC.gNB[Mod_id]->mac_enabled = 1;
|
||||
|
||||
uint64_t dl_bw_khz = (12*gNB_config->carrier_config.dl_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
|
||||
fp->dl_CarrierFreq = ((dl_bw_khz>>1) + gNB_config->carrier_config.dl_frequency.value)*1000 ;
|
||||
|
||||
int32_t dlul_offset = 0;
|
||||
lte_frame_type_t frame_type = 0;
|
||||
|
||||
get_band(fp->dl_CarrierFreq,&fp->nr_band,&dlul_offset,&frame_type);
|
||||
|
||||
uint64_t ul_bw_khz = (12*gNB_config->carrier_config.ul_grid_size[gNB_config->ssb_config.scs_common.value].value)*(15<<gNB_config->ssb_config.scs_common.value);
|
||||
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + gNB_config->carrier_config.uplink_frequency.value)*1000 ;
|
||||
|
||||
AssertFatal(fp->ul_CarrierFreq==(fp->dl_CarrierFreq+dlul_offset), "Disagreement in uplink frequency for band %d\n", fp->nr_band);
|
||||
fp->nr_band = *RC.nrmac[Mod_id]->common_channels[0].ServingCellConfigCommon->downlinkConfigCommon->frequencyInfoDL->frequencyBandList.list.array[0];
|
||||
|
||||
get_delta_duplex(fp->nr_band, gNB_config->ssb_config.scs_common.value, &dlul_offset);
|
||||
dlul_offset *= 1000;
|
||||
|
||||
AssertFatal(fp->ul_CarrierFreq == (fp->dl_CarrierFreq + dlul_offset), "Disagreement in uplink frequency for band %d: ul_CarrierFreq = %lu Hz vs expected %lu Hz\n", fp->nr_band, fp->ul_CarrierFreq, fp->dl_CarrierFreq + dlul_offset);
|
||||
|
||||
LOG_I(PHY, "DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, dlul_offset);
|
||||
|
||||
fp->threequarter_fs = openair0_cfg[0].threequarter_fs;
|
||||
LOG_I(PHY,"Configuring MIB for instance %d, : (Nid_cell %d,DL freq %llu, UL freq %llu)\n",
|
||||
Mod_id,
|
||||
|
||||
+59
-266
@@ -350,13 +350,6 @@ void phy_config_meas_ue(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,uint8_t n
|
||||
}
|
||||
*/
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
void phy_config_dedicated_scell_ue(uint8_t Mod_id,
|
||||
uint8_t eNB_index,
|
||||
SCellToAddMod_r10_t *sCellToAddMod_r10,
|
||||
int CC_id) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
void phy_config_harq_ue(module_id_t Mod_id,
|
||||
@@ -374,210 +367,6 @@ void phy_config_harq_ue(module_id_t Mod_id,
|
||||
|
||||
extern uint16_t beta_cqi[16];
|
||||
|
||||
/*
|
||||
void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated )
|
||||
{
|
||||
|
||||
static uint8_t first_dedicated_configuration = 0;
|
||||
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
|
||||
|
||||
phy_vars_ue->total_TBS[eNB_id]=0;
|
||||
phy_vars_ue->total_TBS_last[eNB_id]=0;
|
||||
phy_vars_ue->bitrate[eNB_id]=0;
|
||||
phy_vars_ue->total_received_bits[eNB_id]=0;
|
||||
phy_vars_ue->dlsch_errors[eNB_id]=0;
|
||||
phy_vars_ue->dlsch_errors_last[eNB_id]=0;
|
||||
phy_vars_ue->dlsch_received[eNB_id]=0;
|
||||
phy_vars_ue->dlsch_received_last[eNB_id]=0;
|
||||
phy_vars_ue->dlsch_fer[eNB_id]=0;
|
||||
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
|
||||
|
||||
if (physicalConfigDedicated) {
|
||||
LOG_D(PHY,"[UE %d] Received physicalConfigDedicated from eNB %d\n",Mod_id, eNB_id);
|
||||
LOG_D(PHY,"------------------------------------------------------------------------\n");
|
||||
|
||||
if (physicalConfigDedicated->pdsch_ConfigDedicated) {
|
||||
phy_vars_ue->pdsch_config_dedicated[eNB_id].p_a=physicalConfigDedicated->pdsch_ConfigDedicated->p_a;
|
||||
LOG_D(PHY,"pdsch_config_dedicated.p_a %d\n",phy_vars_ue->pdsch_config_dedicated[eNB_id].p_a);
|
||||
LOG_D(PHY,"\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated) {
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated->ackNackRepetition.present==PUCCH_ConfigDedicated__ackNackRepetition_PR_release)
|
||||
phy_vars_ue->pucch_config_dedicated[eNB_id].ackNackRepetition=0;
|
||||
else {
|
||||
phy_vars_ue->pucch_config_dedicated[eNB_id].ackNackRepetition=1;
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode)
|
||||
phy_vars_ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode = *physicalConfigDedicated->pucch_ConfigDedicated->tdd_AckNackFeedbackMode;
|
||||
else
|
||||
phy_vars_ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode = bundling;
|
||||
|
||||
if ( phy_vars_ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode == multiplexing)
|
||||
LOG_D(PHY,"pucch_config_dedicated.tdd_AckNackFeedbackMode = multiplexing\n");
|
||||
else
|
||||
LOG_D(PHY,"pucch_config_dedicated.tdd_AckNackFeedbackMode = bundling\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->pusch_ConfigDedicated) {
|
||||
phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_ACK_Index;
|
||||
phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_RI_Index;
|
||||
phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index = physicalConfigDedicated->pusch_ConfigDedicated->betaOffset_CQI_Index;
|
||||
|
||||
|
||||
LOG_D(PHY,"pusch_config_dedicated.betaOffset_ACK_Index %d\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index);
|
||||
LOG_D(PHY,"pusch_config_dedicated.betaOffset_RI_Index %d\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_RI_Index);
|
||||
LOG_D(PHY,"pusch_config_dedicated.betaOffset_CQI_Index %d => %d)\n",phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index,beta_cqi[phy_vars_ue->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index]);
|
||||
LOG_D(PHY,"\n");
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->uplinkPowerControlDedicated) {
|
||||
|
||||
phy_vars_ue->ul_power_control_dedicated[eNB_id].p0_UE_PUSCH = physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUSCH;
|
||||
phy_vars_ue->ul_power_control_dedicated[eNB_id].deltaMCS_Enabled= physicalConfigDedicated->uplinkPowerControlDedicated->deltaMCS_Enabled;
|
||||
phy_vars_ue->ul_power_control_dedicated[eNB_id].accumulationEnabled= physicalConfigDedicated->uplinkPowerControlDedicated->accumulationEnabled;
|
||||
phy_vars_ue->ul_power_control_dedicated[eNB_id].p0_UE_PUCCH= physicalConfigDedicated->uplinkPowerControlDedicated->p0_UE_PUCCH;
|
||||
phy_vars_ue->ul_power_control_dedicated[eNB_id].pSRS_Offset= physicalConfigDedicated->uplinkPowerControlDedicated->pSRS_Offset;
|
||||
phy_vars_ue->ul_power_control_dedicated[eNB_id].filterCoefficient= *physicalConfigDedicated->uplinkPowerControlDedicated->filterCoefficient;
|
||||
LOG_D(PHY,"ul_power_control_dedicated.p0_UE_PUSCH %d\n",phy_vars_ue->ul_power_control_dedicated[eNB_id].p0_UE_PUSCH);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.deltaMCS_Enabled %d\n",phy_vars_ue->ul_power_control_dedicated[eNB_id].deltaMCS_Enabled);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.accumulationEnabled %d\n",phy_vars_ue->ul_power_control_dedicated[eNB_id].accumulationEnabled);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.p0_UE_PUCCH %d\n",phy_vars_ue->ul_power_control_dedicated[eNB_id].p0_UE_PUCCH);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.pSRS_Offset %d\n",phy_vars_ue->ul_power_control_dedicated[eNB_id].pSRS_Offset);
|
||||
LOG_D(PHY,"ul_power_control_dedicated.filterCoefficient %d\n",phy_vars_ue->ul_power_control_dedicated[eNB_id].filterCoefficient);
|
||||
LOG_D(PHY,"\n");
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->antennaInfo) {
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 1+(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode);
|
||||
LOG_I(PHY,"Transmission Mode %d\n",phy_vars_ue->transmission_mode[eNB_id]);
|
||||
switch(physicalConfigDedicated->antennaInfo->choice.explicitValue.transmissionMode) {
|
||||
case AntennaInfoDedicated__transmissionMode_tm1:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 1;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm2:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 2;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm3:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 3;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm4:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 4;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm5:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 5;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm6:
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 6;
|
||||
break;
|
||||
case AntennaInfoDedicated__transmissionMode_tm7:
|
||||
lte_gold_ue_spec_port5(phy_vars_ue->lte_gold_uespec_port5_table, phy_vars_ue->frame_parms.Nid_cell, phy_vars_ue->pdcch_vars[0][eNB_id]->crnti);
|
||||
phy_vars_ue->transmission_mode[eNB_id] = 7;
|
||||
break;
|
||||
default:
|
||||
LOG_E(PHY,"Unknown transmission mode!\n");
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
LOG_D(PHY,"[UE %d] Received NULL physicalConfigDedicated->antennaInfo from eNB %d\n",Mod_id, eNB_id);
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->schedulingRequestConfig) {
|
||||
if (physicalConfigDedicated->schedulingRequestConfig->present == SchedulingRequestConfig_PR_setup) {
|
||||
phy_vars_ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex = physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex;
|
||||
phy_vars_ue->scheduling_request_config[eNB_id].sr_ConfigIndex=physicalConfigDedicated->schedulingRequestConfig->choice.setup.sr_ConfigIndex;
|
||||
phy_vars_ue->scheduling_request_config[eNB_id].dsr_TransMax=physicalConfigDedicated->schedulingRequestConfig->choice.setup.dsr_TransMax;
|
||||
|
||||
LOG_D(PHY,"scheduling_request_config.sr_PUCCH_ResourceIndex %d\n",phy_vars_ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
|
||||
LOG_D(PHY,"scheduling_request_config.sr_ConfigIndex %d\n",phy_vars_ue->scheduling_request_config[eNB_id].sr_ConfigIndex);
|
||||
LOG_D(PHY,"scheduling_request_config.dsr_TransMax %d\n",phy_vars_ue->scheduling_request_config[eNB_id].dsr_TransMax);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) {
|
||||
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = 0;
|
||||
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = 1;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_Bandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_ConfigIndex = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_HoppingBandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;
|
||||
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].transmissionComb = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
|
||||
|
||||
|
||||
LOG_D(PHY,"soundingrs_ul_config_dedicated.srs_ConfigIndex %d\n",phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_ConfigIndex);
|
||||
}
|
||||
|
||||
LOG_D(PHY,"------------------------------------------------------------\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (physicalConfigDedicated->cqi_ReportConfig) {
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic) {
|
||||
// configure PUSCH CQI reporting
|
||||
phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
|
||||
if ((phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm12) &&
|
||||
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm30) &&
|
||||
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm31))
|
||||
LOG_E(PHY,"Unsupported Aperiodic CQI Feedback Mode : %d\n",phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic);
|
||||
}
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) {
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_setup) {
|
||||
// configure PUCCH CQI reporting
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PUCCH_ResourceIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
|
||||
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex;
|
||||
}
|
||||
else if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_release) {
|
||||
// handle release
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
|
||||
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
LOG_D(PHY,"[PHY][UE %d] Received NULL radioResourceConfigDedicated from eNB %d\n",Mod_id,eNB_id);
|
||||
return;
|
||||
}
|
||||
|
||||
// fill cqi parameters for periodic CQI reporting
|
||||
get_cqipmiri_params(phy_vars_ue,eNB_id);
|
||||
|
||||
// disable MIB SIB decoding once we are on connected mode
|
||||
first_dedicated_configuration ++;
|
||||
if(first_dedicated_configuration > 1)
|
||||
{
|
||||
LOG_I(PHY,"Disable SIB MIB decoding \n");
|
||||
phy_vars_ue->decode_SIB = 0;
|
||||
phy_vars_ue->decode_MIB = 0;
|
||||
}
|
||||
//phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
|
||||
if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
|
||||
phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
|
||||
else
|
||||
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
|
||||
|
||||
LOG_I(PHY,"C-RNTI %x %x \n", phy_vars_ue->pdcch_vars[0][eNB_id]->crnti,
|
||||
phy_vars_ue->pdcch_vars[1][eNB_id]->crnti);
|
||||
|
||||
|
||||
}*/
|
||||
|
||||
/*! \brief Helper function to allocate memory for DLSCH data structures.
|
||||
* \param[out] pdsch Pointer to the LTE_UE_PDSCH structure to initialize.
|
||||
* \param[in] frame_parms LTE_DL_FRAME_PARMS structure.
|
||||
@@ -656,7 +445,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
|
||||
fp->nb_antennas_rx=1;
|
||||
// dmrs_UplinkConfig_t *dmrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig;
|
||||
// ptrs_UplinkConfig_t *ptrs_Uplink_Config = &ue->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig;
|
||||
printf("Initializing UE vars (abstraction %"PRIu8") for eNB TXant %"PRIu8", UE RXant %"PRIu8"\n",abstraction_flag,fp->nb_antennas_tx,fp->nb_antennas_rx);
|
||||
LOG_I(PHY, "Initializing UE vars (abstraction %u) for gNB TXant %u, UE RXant %u\n", abstraction_flag, fp->nb_antennas_tx, fp->nb_antennas_rx);
|
||||
//LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_UE][MOD %02u][]\n", ue->Mod_id+NB_eNB_INST);
|
||||
phy_init_nr_top(ue);
|
||||
// many memory allocation sizes are hard coded
|
||||
@@ -969,6 +758,64 @@ void init_nr_ue_transport(PHY_VARS_NR_UE *ue,
|
||||
|
||||
//ue->frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
|
||||
ue->dlsch_MCH[0] = new_nr_ue_dlsch(1,NR_MAX_DLSCH_HARQ_PROCESSES,NSOFT,MAX_LDPC_ITERATIONS_MBSFN,ue->frame_parms.N_RB_DL,0);
|
||||
|
||||
for(int i=0; i<5; i++)
|
||||
ue->dl_stats[i] = 0;
|
||||
}
|
||||
|
||||
|
||||
void init_N_TA_offset(PHY_VARS_NR_UE *ue){
|
||||
|
||||
NR_DL_FRAME_PARMS *fp = &ue->frame_parms;
|
||||
|
||||
if (fp->frame_type == FDD) {
|
||||
ue->N_TA_offset = 0;
|
||||
} else {
|
||||
int N_RB = fp->N_RB_DL;
|
||||
int N_TA_offset = fp->ul_CarrierFreq < 6e9 ? 400 : 431; // reference samples for 25600Tc @ 30.72 Ms/s for FR1, same @ 61.44 Ms/s for FR2
|
||||
double factor = 1;
|
||||
switch (fp->numerology_index) {
|
||||
case 0: //15 kHz scs
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 15kHz only for FR1\n");
|
||||
if (N_RB <= 25) factor = .25; // 7.68 Ms/s
|
||||
else if (N_RB <=50) factor = .5; // 15.36 Ms/s
|
||||
else if (N_RB <=75) factor = 1.0; // 30.72 Ms/s
|
||||
else if (N_RB <=100) factor = 1.0; // 30.72 Ms/s
|
||||
else AssertFatal(1==0, "Too many PRBS for mu=0\n");
|
||||
break;
|
||||
case 1: //30 kHz sc
|
||||
AssertFatal(N_TA_offset == 400, "scs_common 30kHz only for FR1\n");
|
||||
if (N_RB <= 106) factor = 2.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 275) factor = 4.0; // 122.88 Ms/s
|
||||
break;
|
||||
case 2: //60 kHz scs
|
||||
AssertFatal(1==0, "scs_common should not be 60 kHz\n");
|
||||
break;
|
||||
case 3: //120 kHz scs
|
||||
AssertFatal(N_TA_offset == 431, "scs_common 120kHz only for FR2\n");
|
||||
break;
|
||||
case 4: //240 kHz scs
|
||||
AssertFatal(1==0, "scs_common should not be 60 kHz\n");
|
||||
if (N_RB <= 32) factor = 1.0; // 61.44 Ms/s
|
||||
else if (N_RB <= 66) factor = 2.0; // 122.88 Ms/s
|
||||
else AssertFatal(1==0, "N_RB %d is too big for curretn FR2 implementation\n", N_RB);
|
||||
break;
|
||||
|
||||
if (N_RB == 100)
|
||||
ue->N_TA_offset = 624;
|
||||
else if (N_RB == 50)
|
||||
ue->N_TA_offset = 624/2;
|
||||
else if (N_RB == 25)
|
||||
ue->N_TA_offset = 624/4;
|
||||
}
|
||||
|
||||
if (fp->threequarter_fs == 1)
|
||||
factor = factor*.75;
|
||||
|
||||
ue->N_TA_offset = (int)(N_TA_offset * factor);
|
||||
|
||||
LOG_I(PHY,"UE %d Setting N_TA_offset to %d samples (factor %f, UL Freq %lu, N_RB %d)\n", ue->Mod_id, ue->N_TA_offset, factor, fp->ul_CarrierFreq, N_RB);
|
||||
}
|
||||
}
|
||||
|
||||
void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
|
||||
@@ -988,57 +835,3 @@ void phy_init_nr_top(PHY_VARS_NR_UE *ue) {
|
||||
//init_scrambling_lut();
|
||||
//set_taus_seed(1328);
|
||||
}
|
||||
|
||||
void set_default_frame_parms_single(nfapi_nr_config_request_t *config,
|
||||
NR_DL_FRAME_PARMS *frame_parms) {
|
||||
/* Set some default values that may be overwritten while reading options */
|
||||
frame_parms = (NR_DL_FRAME_PARMS*) malloc(sizeof(NR_DL_FRAME_PARMS));
|
||||
config = (nfapi_nr_config_request_t*) malloc(sizeof(nfapi_nr_config_request_t));
|
||||
config->subframe_config.numerology_index_mu.value =1;
|
||||
config->subframe_config.duplex_mode.value = 1; //FDD
|
||||
config->subframe_config.dl_cyclic_prefix_type.value = 0; //NORMAL
|
||||
config->rf_config.dl_carrier_bandwidth.value = 100;
|
||||
config->rf_config.ul_carrier_bandwidth.value = 100;
|
||||
config->sch_config.physical_cell_id.value = 0;
|
||||
|
||||
frame_parms->frame_type = FDD;
|
||||
//frame_parms[CC_id]->tdd_config_S = 0;
|
||||
frame_parms->N_RB_DL = 106;
|
||||
frame_parms->N_RB_UL = 106;
|
||||
frame_parms->Ncp = NORMAL;
|
||||
//frame_parms[CC_id]->Ncp_UL = NORMAL;
|
||||
frame_parms->Nid_cell = 0;
|
||||
//frame_parms[CC_id]->num_MBSFN_config = 0;
|
||||
frame_parms->nb_antenna_ports_gNB = 1;
|
||||
frame_parms->nb_antennas_tx = 1;
|
||||
frame_parms->nb_antennas_rx = 1;
|
||||
|
||||
//frame_parms[CC_id]->nushift = 0;
|
||||
|
||||
///frame_parms[CC_id]->phich_config_common.phich_resource = oneSixth;
|
||||
//frame_parms[CC_id]->phich_config_common.phich_duration = normal;
|
||||
|
||||
// UL RS Config
|
||||
/*frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 1;//n_DMRS1 set to 0
|
||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
|
||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
|
||||
frame_parms[CC_id]->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
|
||||
|
||||
frame_parms[CC_id]->pusch_config_common.n_SB = 1;
|
||||
frame_parms[CC_id]->pusch_config_common.hoppingMode = 0;
|
||||
frame_parms[CC_id]->pusch_config_common.pusch_HoppingOffset = 0;
|
||||
frame_parms[CC_id]->pusch_config_common.enable64QAM = 0;
|
||||
|
||||
frame_parms[CC_id]->prach_config_common.rootSequenceIndex=22;
|
||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig=1;
|
||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_ConfigIndex=0;
|
||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.highSpeedFlag=0;
|
||||
frame_parms[CC_id]->prach_config_common.prach_ConfigInfo.prach_FreqOffset=0;*/
|
||||
|
||||
// NR: Init to legacy LTE 20Mhz params
|
||||
frame_parms->numerology_index = 0;
|
||||
frame_parms->ttis_per_subframe = 1;
|
||||
frame_parms->slots_per_tti = 2;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -27,8 +27,6 @@
|
||||
uint32_t nr_subcarrier_spacing[MAX_NUM_SUBCARRIER_SPACING] = {15e3, 30e3, 60e3, 120e3, 240e3};
|
||||
uint16_t nr_slots_per_subframe[MAX_NUM_SUBCARRIER_SPACING] = {1, 2, 4, 8, 16};
|
||||
|
||||
|
||||
|
||||
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp)
|
||||
{
|
||||
|
||||
@@ -85,6 +83,7 @@ int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp)
|
||||
|
||||
void set_scs_parameters (NR_DL_FRAME_PARMS *fp, int mu, uint16_t bw)
|
||||
{
|
||||
|
||||
switch(mu) {
|
||||
|
||||
case NR_MU_0: //15kHz scs
|
||||
@@ -233,6 +232,20 @@ uint32_t get_samples_per_slot(int slot, NR_DL_FRAME_PARMS* fp)
|
||||
return samp_count;
|
||||
}
|
||||
|
||||
|
||||
uint32_t get_slot_from_timestamp(openair0_timestamp timestamp_rx, NR_DL_FRAME_PARMS* fp)
|
||||
{
|
||||
uint32_t slot_idx = 0;
|
||||
int samples_till_the_slot = 0;
|
||||
timestamp_rx = timestamp_rx%fp->samples_per_frame;
|
||||
|
||||
while (timestamp_rx > samples_till_the_slot) {
|
||||
samples_till_the_slot += fp->get_samples_per_slot(slot_idx,fp);
|
||||
slot_idx++;
|
||||
}
|
||||
return slot_idx;
|
||||
}
|
||||
|
||||
uint32_t get_samples_slot_timestamp(int slot, NR_DL_FRAME_PARMS* fp, uint8_t sl_ahead)
|
||||
{
|
||||
uint32_t samp_count = 0;
|
||||
@@ -251,13 +264,15 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
NR_DL_FRAME_PARMS *fp)
|
||||
{
|
||||
|
||||
AssertFatal (cfg != NULL, "%s %s:%i Null pointer to cfg %p!\n", __FUNCTION__, __FILE__, __LINE__, cfg);
|
||||
|
||||
fp->frame_type = cfg->cell_config.frame_duplex_type.value;
|
||||
fp->L_ssb = (((uint64_t) cfg->ssb_table.ssb_mask_list[0].ssb_mask.value)<<32) | cfg->ssb_table.ssb_mask_list[1].ssb_mask.value ;
|
||||
fp->N_RB_DL = cfg->carrier_config.dl_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
fp->N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
|
||||
|
||||
int Ncp = NFAPI_CP_NORMAL;
|
||||
int mu = cfg!= NULL ? cfg->ssb_config.scs_common.value : 0;
|
||||
int mu = cfg->ssb_config.scs_common.value;
|
||||
|
||||
#if DISABLE_LOG_X
|
||||
printf("Initializing frame parms for mu %d, N_RB %d, Ncp %d\n",mu, fp->N_RB_DL, Ncp);
|
||||
@@ -289,6 +304,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
(fp->nb_prefix_samples + fp->ofdm_symbol_size) * (fp->symbols_per_slot * fp->slots_per_subframe - 2);
|
||||
fp->get_samples_per_slot = &get_samples_per_slot;
|
||||
fp->get_samples_slot_timestamp = &get_samples_slot_timestamp;
|
||||
fp->get_slot_from_timestamp = &get_slot_from_timestamp;
|
||||
fp->samples_per_frame = 10 * fp->samples_per_subframe;
|
||||
fp->freq_range = (fp->dl_CarrierFreq < 6e9)? nr_FR1 : nr_FR2;
|
||||
|
||||
@@ -305,7 +321,7 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
}
|
||||
|
||||
fp->N_ssb = 0;
|
||||
int num_tx_ant = (cfg == NULL) ? fp->Lmax : cfg->carrier_config.num_tx_ant.value;
|
||||
int num_tx_ant = cfg->carrier_config.num_tx_ant.value;
|
||||
|
||||
for (int p=0; p<num_tx_ant; p++)
|
||||
fp->N_ssb += ((fp->L_ssb >> (63-p)) & 0x01);
|
||||
@@ -315,10 +331,23 @@ int nr_init_frame_parms(nfapi_nr_config_request_scf_t* cfg,
|
||||
}
|
||||
|
||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fapi_nr_config_request_t* config,
|
||||
int Ncp)
|
||||
fapi_nr_config_request_t* config,
|
||||
uint16_t nr_band)
|
||||
{
|
||||
|
||||
uint8_t nb_ant_ports_gNB = 1;
|
||||
uint8_t tdd_cfg = 3;
|
||||
uint8_t Nid_cell = 0;
|
||||
int Ncp = NORMAL;
|
||||
|
||||
// default values until overwritten by RRCConnectionReconfiguration
|
||||
fp->nb_antenna_ports_gNB = nb_ant_ports_gNB;
|
||||
fp->tdd_config = tdd_cfg;
|
||||
fp->Nid_cell = Nid_cell;
|
||||
fp->nr_band = nr_band;
|
||||
|
||||
LOG_I(PHY, "Initializing frame parms: set nb_antenna_ports_gNB %d, tdd_config, %d, Nid_cell %d\n", fp->nb_antenna_ports_gNB, fp->tdd_config, fp->Nid_cell);
|
||||
|
||||
uint64_t dl_bw_khz = (12*config->carrier_config.dl_grid_size[config->ssb_config.scs_common])*(15<<config->ssb_config.scs_common);
|
||||
fp->dl_CarrierFreq = ((dl_bw_khz>>1) + config->carrier_config.dl_frequency)*1000 ;
|
||||
|
||||
@@ -330,11 +359,15 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
fp->N_RB_DL = config->carrier_config.dl_grid_size[fp->numerology_index];
|
||||
|
||||
int32_t uplink_frequency_offset = 0;
|
||||
get_delta_duplex(fp->nr_band, fp->numerology_index, &uplink_frequency_offset);
|
||||
get_frame_type(fp->nr_band, fp->numerology_index, &fp->frame_type);
|
||||
uplink_frequency_offset *= 1000;
|
||||
|
||||
get_band(fp->dl_CarrierFreq, &fp->nr_band, &uplink_frequency_offset, &fp->frame_type);
|
||||
LOG_I(PHY, "Initializing frame parms: DL frequency %lu Hz, UL frequency %lu Hz: band %d, uldl offset %d Hz\n", fp->dl_CarrierFreq, fp->ul_CarrierFreq, fp->nr_band, uplink_frequency_offset);
|
||||
|
||||
AssertFatal(fp->frame_type==config->cell_config.frame_duplex_type, "Invalid duplex type in config request file for band %d\n", fp->nr_band);
|
||||
AssertFatal(fp->ul_CarrierFreq==(fp->dl_CarrierFreq+uplink_frequency_offset), "Disagreement in uplink frequency for band %d\n", fp->nr_band);
|
||||
|
||||
AssertFatal(fp->ul_CarrierFreq == (fp->dl_CarrierFreq + uplink_frequency_offset), "Disagreement in uplink frequency for band %d: ul_CarrierFreq = %lu Hz vs expected %lu Hz\n", fp->nr_band, fp->ul_CarrierFreq, fp->dl_CarrierFreq + uplink_frequency_offset);
|
||||
|
||||
#if DISABLE_LOG_X
|
||||
printf("Initializing UE frame parms for mu %d, N_RB %d, Ncp %d\n",fp->numerology_index, fp->N_RB_DL, Ncp);
|
||||
@@ -350,11 +383,6 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
|
||||
set_scs_parameters(fp,fp->numerology_index,config->carrier_config.dl_bandwidth);
|
||||
|
||||
fp->slots_per_frame = 10* fp->slots_per_subframe;
|
||||
|
||||
fp->nb_antenna_ports_gNB = 1; // default value until overwritten by RRCConnectionReconfiguration
|
||||
fp->nb_antennas_rx = 1; // default value until overwritten by RRCConnectionReconfiguration
|
||||
fp->nb_antennas_tx = 1; // default value until overwritten by RRCConnectionReconfiguration
|
||||
|
||||
fp->symbols_per_slot = ((Ncp == NORMAL)? 14 : 12); // to redefine for different slot formats
|
||||
fp->samples_per_subframe_wCP = fp->ofdm_symbol_size * fp->symbols_per_slot * fp->slots_per_subframe;
|
||||
fp->samples_per_frame_wCP = 10 * fp->samples_per_subframe_wCP;
|
||||
|
||||
@@ -394,9 +394,10 @@ int init_frame_parms(LTE_DL_FRAME_PARMS *frame_parms,uint8_t osf);
|
||||
void dump_frame_parms(LTE_DL_FRAME_PARMS *frame_parms);
|
||||
int nr_get_ssb_start_symbol(NR_DL_FRAME_PARMS *fp);
|
||||
int nr_init_frame_parms(nfapi_nr_config_request_scf_t *config, NR_DL_FRAME_PARMS *frame_parms);
|
||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms,fapi_nr_config_request_t *config,int Ncp);
|
||||
int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *frame_parms, fapi_nr_config_request_t *config, uint16_t nr_band);
|
||||
int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstraction_flag);
|
||||
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
|
||||
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
|
||||
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
|
||||
int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag);
|
||||
void nr_phy_config_request(NR_PHY_Config_t *gNB);
|
||||
|
||||
@@ -2242,16 +2242,12 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
MIMO_mode_t mimo_mode = -1;
|
||||
uint8_t mprime=0,Ns;
|
||||
int8_t lprime=-1;
|
||||
int aa=0;
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_MODULATION
|
||||
uint8_t Nl0; //= dlsch0_harq->Nl;
|
||||
uint8_t Nl1;
|
||||
#endif
|
||||
int ru_id;
|
||||
RU_t *ru;
|
||||
int eNB_id;
|
||||
|
||||
|
||||
if ((dlsch0 != NULL) && (dlsch1 != NULL)){
|
||||
@@ -2432,11 +2428,13 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
}
|
||||
|
||||
// mapping ue specific beamforming weights from UE specified DLSCH structure to RU beam weights for the eNB
|
||||
for (ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
||||
/*
|
||||
for (int ru_id=0;ru_id<RC.nb_RU;ru_id++) {
|
||||
RU_t *ru;
|
||||
ru = RC.ru[ru_id];
|
||||
for (eNB_id=0;eNB_id<ru->num_eNB;eNB_id++){
|
||||
for (int eNB_id=0;eNB_id<ru->num_eNB;eNB_id++){
|
||||
if (phy_vars_eNB == ru->eNB_list[eNB_id]) {
|
||||
for (aa=0;aa<ru->nb_tx;aa++){
|
||||
for (int aa=0;aa<ru->nb_tx;aa++){
|
||||
LOG_I(PHY,"ru_id:%d eNB_id:%d aa:%d memcpy(ru->beam_weights, dlsch0->ue_spec_bf_weights[ru_id][0],)\n", ru_id, eNB_id, aa);
|
||||
memcpy(ru->beam_weights[eNB_id][5][aa],
|
||||
dlsch0->ue_spec_bf_weights[ru_id][0],
|
||||
@@ -2445,6 +2443,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -506,10 +506,10 @@ void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq) {
|
||||
|
||||
const int nsymb = fp->symbols_per_slot * fp->slots_per_frame/10;
|
||||
const double Tc=(1/480e3/4096);
|
||||
const double Nu=2048*64*.5;
|
||||
const double Nu=2048*64*(1/(float)(1<<fp->numerology_index));
|
||||
const double f0= (double)CarrierFreq;
|
||||
const double Ncp0=16*64 + (144*64*.5);
|
||||
const double Ncp1=(144*64*.5);
|
||||
const double Ncp0=16*64 + (144*64*(1/(float)(1<<fp->numerology_index)));
|
||||
const double Ncp1=(144*64*(1/(float)(1<<fp->numerology_index)));
|
||||
double tl=0,poff,exp_re,exp_im;
|
||||
double Ncp,Ncpm1=Ncp0;
|
||||
|
||||
|
||||
@@ -112,4 +112,10 @@ void apply_nr_rotation(NR_DL_FRAME_PARMS *fp,
|
||||
|
||||
void init_symbol_rotation(NR_DL_FRAME_PARMS *fp,uint64_t CarrierFreq);
|
||||
|
||||
void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *rxdataF,
|
||||
int slot,
|
||||
int first_symbol,
|
||||
int nsymb,
|
||||
int length);
|
||||
#endif
|
||||
|
||||
@@ -483,21 +483,41 @@ int nr_slot_fep_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
dft(dftsize,(int16_t *)&tmp_dft_in,
|
||||
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
}
|
||||
else
|
||||
dft(dftsize,(int16_t *)&rxdata[rxdata_offset-sample_offset],
|
||||
else {
|
||||
//dft(dftsize,(int16_t *)&rxdata[rxdata_offset-sample_offset],
|
||||
// (int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
memcpy((void *)tmp_dft_in,
|
||||
(void *) &rxdata[rxdata_offset-sample_offset],
|
||||
(frame_parms->ofdm_symbol_size)*sizeof(int));
|
||||
dft(dftsize,(int16_t *)&tmp_dft_in,
|
||||
(int16_t *)&rxdataF[symbol * frame_parms->ofdm_symbol_size], 1);
|
||||
}
|
||||
|
||||
// clear DC carrier from OFDM symbols
|
||||
rxdataF[symbol * frame_parms->ofdm_symbol_size] = 0;
|
||||
|
||||
int symb_offset = (Ns%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",Ns,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t*)&rot2,
|
||||
(int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
frame_parms->ofdm_symbol_size,
|
||||
15);
|
||||
return(0);
|
||||
}
|
||||
|
||||
void apply_nr_rotation_ul(NR_DL_FRAME_PARMS *frame_parms,
|
||||
int32_t *rxdataF,
|
||||
int slot,
|
||||
int first_symbol,
|
||||
int nsymb,
|
||||
int length) {
|
||||
|
||||
|
||||
int symb_offset = (slot%frame_parms->slots_per_subframe)*frame_parms->symbols_per_slot;
|
||||
|
||||
for (int symbol=0;symbol<nsymb;symbol++) {
|
||||
|
||||
uint32_t rot2 = ((uint32_t*)frame_parms->symbol_rotation)[symbol+symb_offset];
|
||||
((int16_t*)&rot2)[1]=-((int16_t*)&rot2)[1];
|
||||
LOG_D(PHY,"slot %d, symb_offset %d rotating by %d.%d\n",slot,symb_offset,((int16_t*)&rot2)[0],((int16_t*)&rot2)[1]);
|
||||
rotate_cpx_vector((int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
(int16_t*)&rot2,
|
||||
(int16_t *)&rxdataF[frame_parms->ofdm_symbol_size*symbol],
|
||||
length,
|
||||
15);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -333,7 +333,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
uint8_t mod_order = rel15->qamModOrder[0];
|
||||
uint16_t Kr=0,r;
|
||||
uint32_t r_offset=0;
|
||||
uint8_t BG=1;
|
||||
uint32_t E;
|
||||
uint8_t Ilbrm = 1;
|
||||
uint32_t Tbslbrm = 950984; //max tbs
|
||||
@@ -431,9 +430,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
Coderate = (float) R /(float) 2048;
|
||||
|
||||
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25)
|
||||
BG = 2;
|
||||
dlsch->harq_processes[harq_pid]->BG = 2;
|
||||
else
|
||||
BG = 1;
|
||||
dlsch->harq_processes[harq_pid]->BG = 1;
|
||||
|
||||
start_meas(dlsch_segmentation_stats);
|
||||
Kb = nr_segmentation(dlsch->harq_processes[harq_pid]->b,
|
||||
@@ -443,7 +442,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
&dlsch->harq_processes[harq_pid]->K,
|
||||
Zc,
|
||||
&dlsch->harq_processes[harq_pid]->F,
|
||||
BG);
|
||||
dlsch->harq_processes[harq_pid]->BG);
|
||||
stop_meas(dlsch_segmentation_stats);
|
||||
F = dlsch->harq_processes[harq_pid]->F;
|
||||
|
||||
@@ -480,7 +479,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
|
||||
for(int j=0;j<(dlsch->harq_processes[harq_pid]->C/8+1);j++) {
|
||||
impp.macro_num=j;
|
||||
nrLDPC_encoder(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,BG,&impp);
|
||||
nrLDPC_encoder(dlsch->harq_processes[harq_pid]->c,dlsch->harq_processes[harq_pid]->d,*Zc,Kb,Kr,dlsch->harq_processes[harq_pid]->BG,&impp);
|
||||
}
|
||||
|
||||
|
||||
@@ -532,7 +531,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
start_meas(dlsch_rate_matching_stats);
|
||||
nr_rate_matching_ldpc(Ilbrm,
|
||||
Tbslbrm,
|
||||
BG,
|
||||
dlsch->harq_processes[harq_pid]->BG,
|
||||
*Zc,
|
||||
dlsch->harq_processes[harq_pid]->d[r],
|
||||
dlsch->harq_processes[harq_pid]->e+r_offset,
|
||||
|
||||
@@ -412,7 +412,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
|
||||
uci_pdu->harq->harq_list[0].harq_value = index&0x01;
|
||||
LOG_I(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
LOG_D(PHY, "Slot %d HARQ value %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
slot,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level);
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
@@ -427,7 +427,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
|
||||
uci_pdu->harq->harq_list[1].harq_value = index&0x01;
|
||||
uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01;
|
||||
LOG_I(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
LOG_D(PHY, "Slot %d HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
slot,uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level);
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
@@ -1464,7 +1464,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
} // cw loop
|
||||
corr_dB = dB_fixed64((uint64_t)corr);
|
||||
LOG_I(PHY,"cw_ML %d, metric %d dB\n",cw_ML,corr_dB);
|
||||
LOG_D(PHY,"cw_ML %d, metric %d dB\n",cw_ML,corr_dB);
|
||||
decodedPayload[0]=(uint64_t)cw_ML;
|
||||
}
|
||||
else { // polar coded case
|
||||
|
||||
@@ -445,7 +445,7 @@ int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
assert(0);
|
||||
}
|
||||
|
||||
if( symbol == 3)
|
||||
if( dmrss == 2) // update time statistics for last PBCH symbol
|
||||
{
|
||||
// do ifft of channel estimate
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++)
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
|
||||
|
||||
uint8_t nr_subframe2harq_pid(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t nr_tti_rx) {
|
||||
uint8_t nr_subframe2harq_pid(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t slot) {
|
||||
/*
|
||||
#ifdef DEBUG_DCI
|
||||
if (frame_parms->frame_type == TDD)
|
||||
@@ -69,11 +69,11 @@ uint8_t nr_subframe2harq_pid(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8
|
||||
#endif
|
||||
*/
|
||||
uint8_t ret = 255;
|
||||
uint8_t subframe = nr_tti_rx>>((int)(log2 (frame_parms->ttis_per_subframe)));
|
||||
uint8_t subframe = slot / frame_parms->slots_per_subframe;
|
||||
|
||||
AssertFatal(1==0,"Not ready for this ...\n");
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
ret = (((frame<<1)+nr_tti_rx)&7);
|
||||
ret = (((frame<<1)+slot)&7);
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
@@ -253,13 +253,15 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
t_nrLDPC_procBuf** p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
|
||||
|
||||
// HARQ stats
|
||||
phy_vars_ue->dl_stats[harq_process->round]++;
|
||||
|
||||
int16_t z [68*384];
|
||||
int8_t l [68*384];
|
||||
//__m128i l;
|
||||
//int16_t inv_d [68*384];
|
||||
uint8_t kc;
|
||||
uint8_t Ilbrm = 0;
|
||||
uint8_t Ilbrm = 1;
|
||||
|
||||
uint32_t Tbslbrm;// = 950984;
|
||||
uint16_t nb_rb;// = 30;
|
||||
@@ -296,7 +298,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
return(dlsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
/*if (nr_tti_rx> (10*frame_parms->ttis_per_subframe-1)) {
|
||||
/*if (nr_tti_rx> (frame_parms->slots_per_subframe-1)) {
|
||||
printf("dlsch_decoding.c: Illegal subframe index %d\n",nr_tti_rx);
|
||||
return(dlsch->max_ldpc_iterations + 1);
|
||||
}*/
|
||||
@@ -649,14 +651,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
}
|
||||
|
||||
int32_t frame_rx_prev = frame;
|
||||
int32_t tti_rx_prev = nr_tti_rx - 1;
|
||||
if (tti_rx_prev < 0) {
|
||||
frame_rx_prev--;
|
||||
tti_rx_prev += 10*frame_parms->ttis_per_subframe;
|
||||
}
|
||||
frame_rx_prev = frame_rx_prev%1024;
|
||||
|
||||
if (err_flag == 1) {
|
||||
//#if UE_DEBUG_TRACE
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
@@ -671,6 +665,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
if (harq_process->round >= dlsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
phy_vars_ue->dl_stats[4]++;
|
||||
}
|
||||
|
||||
if(is_crnti)
|
||||
@@ -843,7 +838,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
return(dlsch->max_ldpc_iterations);
|
||||
}
|
||||
|
||||
/* if (nr_tti_rx> (10*frame_parms->ttis_per_subframe-1)) {
|
||||
/* if (nr_tti_rx> (frame_parms->slots_per_subframe-1)) {
|
||||
printf("dlsch_decoding.c: Illegal subframe index %d\n",nr_tti_rx);
|
||||
return(dlsch->max_ldpc_iterations);
|
||||
}
|
||||
@@ -1246,14 +1241,6 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
//} //loop r
|
||||
|
||||
int32_t frame_rx_prev = frame;
|
||||
int32_t tti_rx_prev = nr_tti_rx - 1;
|
||||
if (tti_rx_prev < 0) {
|
||||
frame_rx_prev--;
|
||||
tti_rx_prev += 10*frame_parms->ttis_per_subframe;
|
||||
}
|
||||
frame_rx_prev = frame_rx_prev%1024;
|
||||
|
||||
if (err_flag == 1) {
|
||||
#if UE_DEBUG_TRACE
|
||||
LOG_D(PHY,"[UE %d] DLSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d, mcs %d) Kr %d r %d harq_process->round %d\n",
|
||||
|
||||
@@ -242,6 +242,10 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
|
||||
dlsch0_harq->Qm = nr_get_Qm_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
|
||||
dlsch0_harq->R = nr_get_code_rate_dl(dlsch[0]->harq_processes[harq_pid]->mcs, dlsch[0]->harq_processes[harq_pid]->mcs_table);
|
||||
if (dlsch0_harq->Qm == 0 || dlsch0_harq->R == 0) {
|
||||
LOG_W(MAC, "Invalid code rate or Mod order, likely due to unexpected DL DCI.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_HARQ
|
||||
printf("[DEMOD] MIMO mode = %d\n", dlsch0_harq->mimo_mode);
|
||||
@@ -684,14 +688,14 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol] = len*dlsch0_harq->Qm + llr_offset_symbol;
|
||||
|
||||
/*LOG_I(PHY,"compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %x @LLR Buff(symb) %x\n",
|
||||
LOG_D(PHY,"compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d energy %d\n",
|
||||
symbol,
|
||||
nb_rb,dlsch0_harq->Qm,
|
||||
pdsch_vars[eNB_id]->llr_length[symbol],
|
||||
pdsch_vars[eNB_id]->llr_offset[symbol],
|
||||
(int16_t*)pdsch_vars[eNB_id]->llr[0],
|
||||
pllr_symbol_cw0);*/
|
||||
|
||||
signal_energy(pdsch_vars[eNB_id]->rxdataF_comp0[0], 7*2*frame_parms->N_RB_DL*12));
|
||||
|
||||
|
||||
/*printf("compute LLRs [symbol %d] NbRB %d Qm %d LLRs-Length %d LLR-Offset %d @LLR Buff %p @LLR Buff(symb) %p\n",
|
||||
symbol,
|
||||
nb_rb,dlsch0_harq->Qm,
|
||||
@@ -981,7 +985,12 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
if (dlsch1_harq) {
|
||||
switch (nr_get_Qm_dl(dlsch1_harq->mcs,dlsch1_harq->mcs_table)) {
|
||||
uint8_t Qm = nr_get_Qm_dl(dlsch1_harq->mcs,dlsch1_harq->mcs_table);
|
||||
if (Qm == 0){
|
||||
LOG_W(MAC, "Invalid code rate or Mod order, likely due to unexpected DL DCI.\n");
|
||||
return -1;
|
||||
}
|
||||
switch (Qm) {
|
||||
case 2 :
|
||||
if (rx_type==rx_standard) {
|
||||
nr_dlsch_qpsk_llr(frame_parms,
|
||||
|
||||
@@ -297,9 +297,6 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc, PHY_VARS_NR_UE *ue, runmode_t mode,
|
||||
|
||||
rx_sss_nr(ue,&metric_tdd_ncp,&phase_tdd_ncp);
|
||||
|
||||
//FK: why do we need to do this again here?
|
||||
//nr_init_frame_parms_ue(fp,NR_MU_1,NORMAL,n_ssb_crb,0);
|
||||
|
||||
nr_gold_pbch(ue);
|
||||
ret = nr_pbch_detection(proc, ue,1,mode); // start pbch detection at first symbol after pss
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "PHY/LTE_REFSIG/lte_refsig.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
//#define DEBUG_PBCH 1
|
||||
//#define DEBUG_PBCH
|
||||
//#define DEBUG_PBCH_ENCODING
|
||||
|
||||
#ifdef OPENAIR2
|
||||
@@ -61,7 +61,8 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
int nushiftmod4 = frame_parms->nushift;
|
||||
unsigned int rx_offset = frame_parms->first_carrier_offset + frame_parms->ssb_start_subcarrier; //and
|
||||
|
||||
if (rx_offset>= frame_parms->ofdm_symbol_size) rx_offset-=frame_parms->ofdm_symbol_size;
|
||||
// if (rx_offset>= frame_parms->ofdm_symbol_size) rx_offset-=frame_parms->ofdm_symbol_size;
|
||||
rx_offset=(rx_offset)%(frame_parms->ofdm_symbol_size);
|
||||
|
||||
AssertFatal(symbol>=1 && symbol<5,
|
||||
"symbol %d illegal for PBCH extraction\n",
|
||||
@@ -103,8 +104,8 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
j++;
|
||||
}
|
||||
|
||||
//rx_offset=(rx_offset+1)&(frame_parms->ofdm_symbol_size-1);
|
||||
rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
|
||||
rx_offset=(rx_offset+1)%(frame_parms->ofdm_symbol_size);
|
||||
//rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
|
||||
}
|
||||
|
||||
rxF_ext+=9;
|
||||
@@ -126,12 +127,14 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
j++;
|
||||
}
|
||||
|
||||
//rx_offset=(rx_offset+1)&(frame_parms->ofdm_symbol_size-1);
|
||||
rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
|
||||
rx_offset=(rx_offset+1)%(frame_parms->ofdm_symbol_size);
|
||||
//rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 1) : (rx_offset+1);
|
||||
}
|
||||
|
||||
rxF_ext+=9;
|
||||
} else rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12);//rx_offset = (rx_offset+12)&(frame_parms->ofdm_symbol_size-1);
|
||||
} else{ //rx_offset = (rx_offset >= frame_parms->ofdm_symbol_size) ? (rx_offset - frame_parms->ofdm_symbol_size + 12) : (rx_offset+12);
|
||||
rx_offset = (rx_offset+12)%(frame_parms->ofdm_symbol_size);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1452,6 +1452,31 @@ int nr_initial_sync(UE_nr_rxtx_proc_t *proc,
|
||||
runmode_t mode,
|
||||
int n_frames);
|
||||
|
||||
/*!
|
||||
\brief This function gets the carrier frequencies either from FP or command-line-set global variables, depending on the availability of the latter
|
||||
@param fp Pointer to frame params
|
||||
@param dl_Carrier Pointer to DL carrier to be set
|
||||
@param ul_Carrier Pointer to UL carrier to be set
|
||||
*/
|
||||
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp,
|
||||
uint64_t *dl_Carrier,
|
||||
uint64_t *ul_Carrier);
|
||||
|
||||
/*!
|
||||
\brief This function sets the OAI RF card rx/tx params
|
||||
@param openair0_cfg Pointer OAI config for a specific card
|
||||
@param tx_gain_off Tx gain offset
|
||||
@param rx_gain_off Rx gain offset
|
||||
@param ul_Carrier UL carrier to be set
|
||||
@param dl_Carrier DL carrier to be set
|
||||
@param freq_offset Freq offset to be set
|
||||
*/
|
||||
void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_off,
|
||||
uint64_t ul_Carrier,
|
||||
uint64_t dl_Carrier,
|
||||
int freq_offset);
|
||||
|
||||
|
||||
/*!
|
||||
\brief Encoding of PUSCH/ACK/RI/ACK from 36-212.
|
||||
|
||||
@@ -139,6 +139,8 @@ typedef struct {
|
||||
uint32_t num_of_mod_symbols;
|
||||
// decode phich
|
||||
uint8_t decode_phich;
|
||||
// Encoder BG
|
||||
uint8_t BG;
|
||||
} NR_UL_UE_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* 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.0 (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 PHY/NR_UE_TRANSPORT/nr_ue_rf_config.c
|
||||
* \brief Functional helpers to configure the RF boards at UE side
|
||||
* \author Guido Casati
|
||||
* \date 2020
|
||||
* \version 0.1
|
||||
* \company Fraunhofer IIS
|
||||
* \email: guido.casati@iis.fraunhofer.de
|
||||
*/
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/phy_extern_nr_ue.h"
|
||||
#include "nr_transport_proto_ue.h"
|
||||
|
||||
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){
|
||||
|
||||
if (downlink_frequency[0][0])
|
||||
*dl_carrier = downlink_frequency[0][0];
|
||||
else
|
||||
*dl_carrier = fp->dl_CarrierFreq;
|
||||
|
||||
if (uplink_frequency_offset[0][0])
|
||||
*ul_carrier = *dl_carrier + uplink_frequency_offset[0][0];
|
||||
else
|
||||
*ul_carrier = *dl_carrier + fp->ul_CarrierFreq - fp->dl_CarrierFreq;
|
||||
|
||||
}
|
||||
|
||||
void nr_rf_card_config(openair0_config_t *openair0_cfg,
|
||||
double rx_gain_offset,
|
||||
uint64_t ul_carrier,
|
||||
uint64_t dl_carrier,
|
||||
int freq_offset){
|
||||
|
||||
uint8_t mod_id = 0;
|
||||
uint8_t cc_id = 0;
|
||||
PHY_VARS_NR_UE *ue = PHY_vars_UE_g[mod_id][cc_id];
|
||||
int rf_chain = ue->rf_map.chain;
|
||||
double rx_gain = ue->rx_total_gain_dB;
|
||||
double tx_gain = ue->tx_total_gain_dB;
|
||||
|
||||
for (int i = rf_chain; i < rf_chain + 4; i++) {
|
||||
|
||||
if (i < openair0_cfg->rx_num_channels)
|
||||
openair0_cfg->rx_freq[i + rf_chain] = dl_carrier + freq_offset;
|
||||
else
|
||||
openair0_cfg->rx_freq[i] = 0.0;
|
||||
|
||||
if (i<openair0_cfg->tx_num_channels)
|
||||
openair0_cfg->tx_freq[i] = ul_carrier + freq_offset;
|
||||
else
|
||||
openair0_cfg->tx_freq[i] = 0.0;
|
||||
|
||||
if (tx_gain)
|
||||
openair0_cfg->tx_gain[i] = tx_gain;
|
||||
if (rx_gain)
|
||||
openair0_cfg->rx_gain[i] = rx_gain - rx_gain_offset;
|
||||
|
||||
openair0_cfg->autocal[i] = 1;
|
||||
|
||||
LOG_I(PHY, "HW: Configuring channel %d (rf_chain %d): setting tx_gain %f, rx_gain %f, tx_freq %f Hz, rx_freq %f Hz\n",
|
||||
i,
|
||||
rf_chain,
|
||||
openair0_cfg->tx_gain[i],
|
||||
openair0_cfg->rx_gain[i],
|
||||
openair0_cfg->tx_freq[i],
|
||||
openair0_cfg->rx_freq[i]);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -232,7 +232,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
uint8_t mod_order;
|
||||
uint16_t Kr,r;
|
||||
uint32_t r_offset;
|
||||
uint8_t BG;
|
||||
uint32_t E,Kb;
|
||||
uint8_t Ilbrm;
|
||||
uint32_t Tbslbrm;
|
||||
@@ -255,7 +254,6 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
|
||||
Kr=0;
|
||||
r_offset=0;
|
||||
BG = 1;
|
||||
F=0;
|
||||
Ilbrm = 0;
|
||||
Tbslbrm = 950984; //max tbs
|
||||
@@ -327,10 +325,10 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
Coderate = (float) R /(float) 2048;
|
||||
|
||||
if ((A <=292) || ((A<=3824) && (Coderate <= 0.6667)) || Coderate <= 0.25){
|
||||
BG = 2;
|
||||
harq_process->BG = 2;
|
||||
}
|
||||
else{
|
||||
BG = 1;
|
||||
harq_process->BG = 1;
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_IN);
|
||||
@@ -341,7 +339,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
&harq_process->K,
|
||||
pz,
|
||||
&harq_process->F,
|
||||
BG);
|
||||
harq_process->BG);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_SEGMENTATION, VCD_FUNCTION_OUT);
|
||||
|
||||
F = harq_process->F;
|
||||
@@ -390,17 +388,20 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
}
|
||||
printf("\n");*/
|
||||
encoder_implemparams_t impp;
|
||||
impp.n_segments=harq_process->C;
|
||||
impp.macro_num=0;
|
||||
impp.tinput = NULL;
|
||||
impp.tprep = NULL;
|
||||
impp.tparity = NULL;
|
||||
impp.toutput = NULL;
|
||||
impp.n_segments = harq_process->C;
|
||||
impp.tinput = NULL;
|
||||
impp.tprep = NULL;
|
||||
impp.tparity = NULL;
|
||||
impp.toutput = NULL;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
|
||||
|
||||
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,BG,&impp);
|
||||
|
||||
|
||||
for(int j = 0; j < (harq_process->C/8 + 1); j++)
|
||||
{
|
||||
impp.macro_num = j;
|
||||
nrLDPC_encoder(harq_process->c,harq_process->d,*pz,Kb,Kr,harq_process->BG,&impp);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_OUT);
|
||||
|
||||
//stop_meas(te_stats);
|
||||
@@ -448,7 +449,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
|
||||
nr_rate_matching_ldpc(Ilbrm,
|
||||
Tbslbrm,
|
||||
BG,
|
||||
harq_process->BG,
|
||||
*pz,
|
||||
harq_process->d[r],
|
||||
harq_process->e+r_offset,
|
||||
|
||||
@@ -560,7 +560,6 @@ void set_frame_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue, int rate_change
|
||||
{
|
||||
/* set new value according to rate_change */
|
||||
frame_parms_ue->ofdm_symbol_size = (frame_parms_ue->ofdm_symbol_size / rate_change);
|
||||
frame_parms_ue->samples_per_tti = (frame_parms_ue->samples_per_tti / rate_change);
|
||||
frame_parms_ue->samples_per_subframe = (frame_parms_ue->samples_per_subframe / rate_change);
|
||||
|
||||
free_context_pss_nr();
|
||||
@@ -588,7 +587,6 @@ void set_frame_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue, int rate_change
|
||||
void restore_frame_context_pss_nr(NR_DL_FRAME_PARMS *frame_parms_ue, int rate_change)
|
||||
{
|
||||
frame_parms_ue->ofdm_symbol_size = frame_parms_ue->ofdm_symbol_size * rate_change;
|
||||
frame_parms_ue->samples_per_tti = frame_parms_ue->samples_per_tti * rate_change;
|
||||
frame_parms_ue->samples_per_subframe = frame_parms_ue->samples_per_subframe * rate_change;
|
||||
|
||||
free_context_pss_nr();
|
||||
@@ -620,8 +618,6 @@ void decimation_synchro_nr(PHY_VARS_NR_UE *PHY_vars_UE, int rate_change, int **r
|
||||
NR_DL_FRAME_PARMS *frame_parms = &(PHY_vars_UE->frame_parms);
|
||||
int samples_for_frame = 2*frame_parms->samples_per_frame;
|
||||
|
||||
AssertFatal(frame_parms->samples_per_tti > 3839,"Illegal samples_per_tti %d\n",frame_parms->samples_per_tti);
|
||||
|
||||
#if TEST_SYNCHRO_TIMING_PSS
|
||||
|
||||
opp_enabled = 1;
|
||||
|
||||
@@ -278,7 +278,7 @@ int32_t generate_srs_nr(SRS_ResourceSet_t *p_srs_resource_set,
|
||||
n_SRS = l/R;
|
||||
}
|
||||
else {
|
||||
int8_t N_slot_frame = NR_NUMBER_OF_SUBFRAMES_PER_FRAME * frame_parms->ttis_per_subframe;
|
||||
int8_t N_slot_frame = frame_parms->slots_per_frame;
|
||||
n_SRS = ((N_slot_frame*frame_number + slot_number - T_offset)/T_SRS)*(N_symb_SRS/R)+(l/R);
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ int is_srs_period_nr(SRS_Resource_t *p_SRS_Resource, NR_DL_FRAME_PARMS *frame_pa
|
||||
return (-1);
|
||||
}
|
||||
|
||||
int16_t N_slot_frame = NR_NUMBER_OF_SUBFRAMES_PER_FRAME * frame_parms->ttis_per_subframe;
|
||||
int16_t N_slot_frame = frame_parms->slots_per_frame;
|
||||
if ((N_slot_frame*frame_tx + slot_tx - T_offset)%T_SRS == 0) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ static void *scope_thread_eNB(void *arg) {
|
||||
}
|
||||
}
|
||||
|
||||
sleep(1);
|
||||
usleep(100*1000);
|
||||
}
|
||||
|
||||
// printf("%s",stats_buffer);
|
||||
|
||||
@@ -37,9 +37,12 @@ float tput_time_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_ue[NUMBER_OF_UE_MAX][TPUT_WINDOW_LENGTH] = {{0}};
|
||||
float tput_ue_max[NUMBER_OF_UE_MAX] = {0};
|
||||
|
||||
static void ia_receiver_on_off( FL_OBJECT *button, long arg)
|
||||
{
|
||||
void drawsymbol(FL_OBJECT *obj, int id,
|
||||
FL_POINT *p, int n, int w, int h) {
|
||||
fl_points( p, n, FL_YELLOW);
|
||||
}
|
||||
|
||||
static void ia_receiver_on_off( FL_OBJECT *button, long arg) {
|
||||
if (fl_get_button(button)) {
|
||||
fl_set_object_label(button, "IA Receiver ON");
|
||||
// PHY_vars_UE_g[0][0]->use_ia_receiver = 1;
|
||||
@@ -51,9 +54,7 @@ static void ia_receiver_on_off( FL_OBJECT *button, long arg)
|
||||
}
|
||||
}
|
||||
|
||||
static void dl_traffic_on_off( FL_OBJECT *button, long arg)
|
||||
{
|
||||
|
||||
static void dl_traffic_on_off( FL_OBJECT *button, long arg) {
|
||||
if (fl_get_button(button)) {
|
||||
fl_set_object_label(button, "DL Traffic ON");
|
||||
otg_enabled = 1;
|
||||
@@ -65,46 +66,38 @@ static void dl_traffic_on_off( FL_OBJECT *button, long arg)
|
||||
}
|
||||
}
|
||||
|
||||
FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
{
|
||||
|
||||
FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void ) {
|
||||
FL_OBJECT *obj;
|
||||
FD_lte_phy_scope_enb *fdui = fl_malloc( sizeof *fdui );
|
||||
|
||||
// Define form
|
||||
fdui->lte_phy_scope_enb = fl_bgn_form( FL_NO_BOX, 800, 800 );
|
||||
|
||||
// This the whole UI box
|
||||
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 800, "" );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLACK );
|
||||
|
||||
// Received signal
|
||||
fdui->rxsig_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 20, 370, 100, "Received Signal (Time-Domain, dB)" );
|
||||
fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
|
||||
|
||||
// Time-domain channel response
|
||||
fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "SRS Frequency Response (samples, abs)" );
|
||||
fl_set_object_boxtype( fdui->chest_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_t, FL_WHITE ); // Label color
|
||||
|
||||
// Frequency-domain channel response
|
||||
fdui->chest_f = fl_add_xyplot( FL_IMPULSE_XYPLOT, 20, 140, 760, 100, "Channel Frequency Response (RE, dB)" );
|
||||
fl_set_object_boxtype( fdui->chest_f, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_f, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_f, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds( fdui->chest_f,30,70);
|
||||
|
||||
// LLR of PUSCH
|
||||
fdui->pusch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 260, 500, 200, "PUSCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pusch_llr, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pusch_llr, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pusch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pusch_llr,2);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pusch_llr, 0, drawsymbol);
|
||||
// I/Q PUSCH comp
|
||||
fdui->pusch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 260, 240, 200, "PUSCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pusch_comp, FL_EMBOSSED_BOX );
|
||||
@@ -112,7 +105,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_object_lcolor( fdui->pusch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pusch_comp,2);
|
||||
fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pusch_comp, 0, drawsymbol);
|
||||
// I/Q PUCCH comp (format 1)
|
||||
fdui->pucch_comp1 = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 480, 240, 100, "PUCCH1 Energy (SR)" );
|
||||
fl_set_object_boxtype( fdui->pucch_comp1, FL_EMBOSSED_BOX );
|
||||
@@ -120,7 +113,7 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_object_lcolor( fdui->pucch_comp1, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pucch_comp1,2);
|
||||
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pucch_comp1, 0, drawsymbol);
|
||||
// I/Q PUCCH comp (fromat 1a/b)
|
||||
fdui->pucch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 600, 240, 100, "PUCCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pucch_comp, FL_EMBOSSED_BOX );
|
||||
@@ -128,13 +121,12 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_object_lcolor( fdui->pucch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pucch_comp,2);
|
||||
// fl_set_xyplot_xgrid( fdui->pusch_llr,FL_GRID_MAJOR);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pucch_comp, 0, drawsymbol);
|
||||
// Throughput on PUSCH
|
||||
fdui->pusch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 480, 500, 100, "PUSCH Throughput [frame]/[kbit/s]" );
|
||||
fl_set_object_boxtype( fdui->pusch_tput, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pusch_tput, FL_BLACK, FL_WHITE );
|
||||
fl_set_object_lcolor( fdui->pusch_tput, FL_WHITE ); // Label color
|
||||
|
||||
// Generic eNB Button
|
||||
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 20, 600, 240, 40, "" );
|
||||
fl_set_object_lalign(fdui->button_0, FL_ALIGN_CENTER );
|
||||
@@ -143,18 +135,15 @@ FD_lte_phy_scope_enb *create_lte_phy_scope_enb( void )
|
||||
fl_set_object_label(fdui->button_0, "DL Traffic OFF");
|
||||
fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
|
||||
fl_set_object_callback(fdui->button_0, dl_traffic_on_off, 0 );
|
||||
|
||||
fl_end_form( );
|
||||
fdui->lte_phy_scope_enb->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
||||
void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
PHY_VARS_eNB *phy_vars_enb,
|
||||
int UE_id)
|
||||
{
|
||||
|
||||
int UE_id) {
|
||||
LOG_D(HW,"scope for UE%d\n", UE_id);
|
||||
int i,i2,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms;
|
||||
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
|
||||
@@ -192,20 +181,18 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
}
|
||||
|
||||
coded_bits_per_codeword = frame_parms->N_RB_UL*12*Qm*frame_parms->symbols_per_tti;
|
||||
|
||||
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero
|
||||
chest_f_abs = (float *) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
llr = (float *) calloc(coded_bits_per_codeword,sizeof(float)); // init to zero
|
||||
bit = malloc(coded_bits_per_codeword*sizeof(float));
|
||||
|
||||
rxsig_t = (int16_t**) phy_vars_enb->RU_list[0]->common.rxdata;
|
||||
//chest_t = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates_time[eNB_id];
|
||||
chest_t = (int16_t**) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates;
|
||||
chest_f = (int16_t**) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates;
|
||||
pusch_llr = (int16_t*) phy_vars_enb->pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int32_t*) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0];
|
||||
pucch1_comp = (int32_t*) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1_thres = (int32_t*) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t*) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
chest_t = (int16_t **) phy_vars_enb->srs_vars[UE_id].srs_ch_estimates;
|
||||
chest_f = (int16_t **) phy_vars_enb->pusch_vars[UE_id]->drs_ch_estimates;
|
||||
pusch_llr = (int16_t *) phy_vars_enb->pusch_vars[UE_id]->llr;
|
||||
pusch_comp = (int32_t *) phy_vars_enb->pusch_vars[UE_id]->rxdataF_comp[0];
|
||||
pucch1_comp = (int32_t *) phy_vars_enb->pucch1_stats[UE_id];
|
||||
pucch1_thres = (int32_t *) phy_vars_enb->pucch1_stats_thres[UE_id];
|
||||
pucch1ab_comp = (int32_t *) phy_vars_enb->pucch1ab_stats[UE_id];
|
||||
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
@@ -236,7 +223,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
if (chest_t[0] !=NULL) {
|
||||
for (i=0; i<(frame_parms->ofdm_symbol_size); i++) {
|
||||
//i2 = (i+(frame_parms->ofdm_symbol_size>>1))%frame_parms->ofdm_symbol_size;
|
||||
i2=i;
|
||||
i2=i;
|
||||
//time2[i] = (float)(i-(frame_parms->ofdm_symbol_size>>1));
|
||||
time2[i] = (float)i;
|
||||
chest_t_abs[0][i] = 10*log10((float) (1+chest_t[0][2*i2]*chest_t[0][2*i2]+chest_t[0][2*i2+1]*chest_t[0][2*i2+1]));
|
||||
@@ -278,7 +265,6 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
freq[ind] = (float)ind;
|
||||
Re = (float)(chest_f[(atx<<1)+arx][(2*k)]);
|
||||
Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]);
|
||||
|
||||
chest_f_abs[ind] = (short)10*log10(1.0+((double)Re*Re + (double)Im*Im));
|
||||
ind++;
|
||||
}
|
||||
@@ -333,9 +319,9 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i] < range &&
|
||||
pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i+1] > -range &&
|
||||
pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i+1] < range ) {
|
||||
I[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i];
|
||||
Q[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i+1];
|
||||
ind++;
|
||||
I[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i];
|
||||
Q[ind] = pusch_comp[(2*frame_parms->N_RB_UL*12*k)+2*i+1];
|
||||
ind++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -346,75 +332,62 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
|
||||
// PUSCH I/Q of MF Output
|
||||
if (pucch1ab_comp!=NULL) {
|
||||
for (ind=0; ind<10240; ind++) {
|
||||
|
||||
I_pucch[ind] = (float)pucch1ab_comp[2*(ind)];
|
||||
Q_pucch[ind] = (float)pucch1ab_comp[2*(ind)+1];
|
||||
A_pucch[ind] = 10*log10(pucch1_comp[ind]);
|
||||
B_pucch[ind] = ind;
|
||||
C_pucch[ind] = (float)pucch1_thres[ind];
|
||||
}
|
||||
|
||||
fl_set_xyplot_data(form->pucch_comp,I_pucch,Q_pucch,10240,"","","");
|
||||
fl_set_xyplot_data(form->pucch_comp1,B_pucch,A_pucch,1024,"","","");
|
||||
fl_add_xyplot_overlay(form->pucch_comp1,1,B_pucch,C_pucch,1024,FL_RED);
|
||||
fl_set_xyplot_ybounds(form->pucch_comp,-5000,5000);
|
||||
fl_set_xyplot_xbounds(form->pucch_comp,-5000,5000);
|
||||
|
||||
fl_set_xyplot_ybounds(form->pucch_comp1,0,80);
|
||||
}
|
||||
|
||||
|
||||
// PUSCH Throughput
|
||||
memmove( tput_time_enb[UE_id], &tput_time_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
|
||||
memmove( tput_enb[UE_id], &tput_enb[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
|
||||
|
||||
tput_time_enb[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
|
||||
tput_enb[UE_id][TPUT_WINDOW_LENGTH-1] = ((float) total_dlsch_bitrate)/1000.0;
|
||||
|
||||
fl_set_xyplot_data(form->pusch_tput,tput_time_enb[UE_id],tput_enb[UE_id],TPUT_WINDOW_LENGTH,"","","");
|
||||
|
||||
// fl_get_xyplot_ybounds(form->pusch_tput,&ymin,&ymax);
|
||||
// fl_set_xyplot_ybounds(form->pusch_tput,0,ymax);
|
||||
|
||||
fl_check_forms();
|
||||
|
||||
free(llr);
|
||||
free(bit);
|
||||
free(chest_f_abs);
|
||||
}
|
||||
|
||||
FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
{
|
||||
|
||||
FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void ) {
|
||||
FL_OBJECT *obj;
|
||||
FD_lte_phy_scope_ue *fdui = fl_malloc( sizeof *fdui );
|
||||
|
||||
// Define form
|
||||
fdui->lte_phy_scope_ue = fl_bgn_form( FL_NO_BOX, 800, 900 );
|
||||
|
||||
// This the whole UI box
|
||||
obj = fl_add_box( FL_BORDER_BOX, 0, 0, 800, 900, "" );
|
||||
fl_set_object_color( obj, FL_BLACK, FL_BLACK );
|
||||
|
||||
// Received signal
|
||||
fdui->rxsig_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 20, 370, 100, "Received Signal (Time-Domain, dB)" );
|
||||
fl_set_object_boxtype( fdui->rxsig_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->rxsig_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->rxsig_t, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds(fdui->rxsig_t,10,70);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->rxsig_t, 0, drawsymbol);
|
||||
// Time-domain channel response
|
||||
fdui->chest_t = fl_add_xyplot( FL_NORMAL_XYPLOT, 410, 20, 370, 100, "Channel Impulse Response (samples, abs)" );
|
||||
fl_set_object_boxtype( fdui->chest_t, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_t, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_t, FL_WHITE ); // Label color
|
||||
|
||||
fl_set_xyplot_symbol(fdui->chest_t, 0, drawsymbol);
|
||||
// Frequency-domain channel response
|
||||
fdui->chest_f = fl_add_xyplot( FL_IMPULSE_XYPLOT, 20, 140, 760, 100, "Channel Frequency Response (RE, dB)" );
|
||||
fl_set_object_boxtype( fdui->chest_f, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->chest_f, FL_BLACK, FL_RED );
|
||||
fl_set_object_lcolor( fdui->chest_f, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_ybounds( fdui->chest_f,30,70);
|
||||
|
||||
// LLR of PBCH
|
||||
fdui->pbch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 260, 500, 100, "PBCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pbch_llr, FL_EMBOSSED_BOX );
|
||||
@@ -423,23 +396,23 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
fl_set_xyplot_symbolsize( fdui->pbch_llr,2);
|
||||
fl_set_xyplot_xgrid( fdui->pbch_llr,FL_GRID_MAJOR);
|
||||
fl_set_xyplot_xbounds( fdui->pbch_llr,0,1920);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pbch_llr, 0, drawsymbol);
|
||||
// I/Q PBCH comp
|
||||
fdui->pbch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 260, 240, 100, "PBCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pbch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pbch_comp, FL_BLACK, FL_GREEN );
|
||||
fl_set_object_lcolor( fdui->pbch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pbch_comp,2);
|
||||
fl_set_xyplot_symbol(fdui->pbch_comp, 0, drawsymbol);
|
||||
// fl_set_xyplot_xbounds( fdui->pbch_comp,-100,100);
|
||||
// fl_set_xyplot_ybounds( fdui->pbch_comp,-100,100);
|
||||
|
||||
// LLR of PDCCH
|
||||
fdui->pdcch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 380, 500, 100, "PDCCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pdcch_llr, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdcch_llr, FL_BLACK, FL_CYAN );
|
||||
fl_set_object_lcolor( fdui->pdcch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdcch_llr,2);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pdcch_llr, 0, drawsymbol);
|
||||
// I/Q PDCCH comp
|
||||
fdui->pdcch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 380, 240, 100, "PDCCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pdcch_comp, FL_EMBOSSED_BOX );
|
||||
@@ -447,7 +420,7 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
fl_set_object_lcolor( fdui->pdcch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdcch_comp,2);
|
||||
fl_set_xyplot_xgrid( fdui->pdcch_llr,FL_GRID_MAJOR);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pdcch_comp, 0, drawsymbol);
|
||||
// LLR of PDSCH
|
||||
fdui->pdsch_llr = fl_add_xyplot( FL_POINTS_XYPLOT, 20, 500, 500, 200, "PDSCH Log-Likelihood Ratios (LLR, mag)" );
|
||||
fl_set_object_boxtype( fdui->pdsch_llr, FL_EMBOSSED_BOX );
|
||||
@@ -455,20 +428,19 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
fl_set_object_lcolor( fdui->pdsch_llr, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdsch_llr,2);
|
||||
fl_set_xyplot_xgrid( fdui->pdsch_llr,FL_GRID_MAJOR);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pdsch_llr, 0, drawsymbol);
|
||||
// I/Q PDSCH comp
|
||||
fdui->pdsch_comp = fl_add_xyplot( FL_POINTS_XYPLOT, 540, 500, 240, 200, "PDSCH I/Q of MF Output" );
|
||||
fl_set_object_boxtype( fdui->pdsch_comp, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_comp, FL_BLACK, FL_YELLOW );
|
||||
fl_set_object_lcolor( fdui->pdsch_comp, FL_WHITE ); // Label color
|
||||
fl_set_xyplot_symbolsize( fdui->pdsch_comp,2);
|
||||
|
||||
fl_set_xyplot_symbol(fdui->pdsch_comp, 0, drawsymbol);
|
||||
// Throughput on PDSCH
|
||||
fdui->pdsch_tput = fl_add_xyplot( FL_NORMAL_XYPLOT, 20, 720, 500, 100, "PDSCH Throughput [frame]/[kbit/s]" );
|
||||
fl_set_object_boxtype( fdui->pdsch_tput, FL_EMBOSSED_BOX );
|
||||
fl_set_object_color( fdui->pdsch_tput, FL_BLACK, FL_WHITE );
|
||||
fl_set_object_lcolor( fdui->pdsch_tput, FL_WHITE ); // Label color
|
||||
|
||||
// Generic UE Button
|
||||
fdui->button_0 = fl_add_button( FL_PUSH_BUTTON, 540, 720, 240, 40, "" );
|
||||
fl_set_object_lalign(fdui->button_0, FL_ALIGN_CENTER );
|
||||
@@ -478,10 +450,8 @@ FD_lte_phy_scope_ue *create_lte_phy_scope_ue( void )
|
||||
fl_set_object_color(fdui->button_0, FL_RED, FL_RED);
|
||||
fl_set_object_callback(fdui->button_0, ia_receiver_on_off, 0 );
|
||||
fl_hide_object(fdui->button_0);
|
||||
|
||||
fl_end_form( );
|
||||
fdui->lte_phy_scope_ue->fdui = fdui;
|
||||
|
||||
return fdui;
|
||||
}
|
||||
|
||||
@@ -489,8 +459,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
PHY_VARS_UE *phy_vars_ue,
|
||||
int eNB_id,
|
||||
int UE_id,
|
||||
uint8_t subframe)
|
||||
{
|
||||
uint8_t subframe) {
|
||||
int i,arx,atx,ind,k;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms;
|
||||
int nsymb_ce = frame_parms->ofdm_symbol_size;//*frame_parms->symbols_per_tti;
|
||||
@@ -521,7 +490,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
unsigned char harq_pid = 0;
|
||||
int beamforming_mode = phy_vars_ue->transmission_mode[eNB_id]>6 ? phy_vars_ue->transmission_mode[eNB_id] : 0;
|
||||
|
||||
|
||||
if (phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]!=NULL) {
|
||||
harq_pid = phy_vars_ue->dlsch[phy_vars_ue->current_thread_id[subframe]][eNB_id][0]->current_harq_pid;
|
||||
|
||||
@@ -556,34 +524,32 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
coded_bits_per_codeword = 0; //frame_parms->N_RB_DL*12*get_Qm(mcs)*(frame_parms->symbols_per_tti);
|
||||
}
|
||||
|
||||
I = (float*) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*2,sizeof(float));
|
||||
Q = (float*) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*2,sizeof(float));
|
||||
chest_t_abs = (float**) malloc(nb_antennas_rx*sizeof(float*));
|
||||
I = (float *) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*2,sizeof(float));
|
||||
Q = (float *) calloc(frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*2,sizeof(float));
|
||||
chest_t_abs = (float **) malloc(nb_antennas_rx*sizeof(float *));
|
||||
|
||||
for (arx=0; arx<nb_antennas_rx; arx++) {
|
||||
chest_t_abs[arx] = (float*) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
|
||||
chest_t_abs[arx] = (float *) calloc(frame_parms->ofdm_symbol_size,sizeof(float));
|
||||
}
|
||||
|
||||
chest_f_abs = (float*) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
chest_f_abs = (float *) calloc(nsymb_ce*nb_antennas_rx*nb_antennas_tx,sizeof(float));
|
||||
//llr = (float*) calloc(coded_bits_per_codeword,sizeof(float)); // Cppcheck returns "invalidFunctionArg" error.
|
||||
llr = (float*) malloc(coded_bits_per_codeword*sizeof(float));
|
||||
llr = (float *) malloc(coded_bits_per_codeword*sizeof(float));
|
||||
memset((void *)llr, 0,coded_bits_per_codeword*sizeof(float)); // init to zero
|
||||
|
||||
bit = malloc(coded_bits_per_codeword*sizeof(float));
|
||||
llr_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
|
||||
bit_pdcch = (float*) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||
|
||||
rxsig_t = (int16_t**) phy_vars_ue->common_vars.rxdata;
|
||||
chest_t = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id];
|
||||
chest_f = (int16_t**) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id];
|
||||
pbch_llr = (int8_t*) phy_vars_ue->pbch_vars[eNB_id]->llr;
|
||||
pbch_comp = (int16_t*) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
|
||||
pdcch_llr = (int8_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr;
|
||||
pdcch_comp = (int16_t*) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0];
|
||||
pdsch_llr = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0
|
||||
llr_pdcch = (float *) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float)); // init to zero
|
||||
bit_pdcch = (float *) calloc(12*frame_parms->N_RB_DL*num_pdcch_symbols*2,sizeof(float));
|
||||
rxsig_t = (int16_t **) phy_vars_ue->common_vars.rxdata;
|
||||
chest_t = (int16_t **) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates_time[eNB_id];
|
||||
chest_f = (int16_t **) phy_vars_ue->common_vars.common_vars_rx_data_per_thread[phy_vars_ue->current_thread_id[subframe]].dl_ch_estimates[eNB_id];
|
||||
pbch_llr = (int8_t *) phy_vars_ue->pbch_vars[eNB_id]->llr;
|
||||
pbch_comp = (int16_t *) phy_vars_ue->pbch_vars[eNB_id]->rxdataF_comp[0];
|
||||
pdcch_llr = (int8_t *) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr;
|
||||
pdcch_comp = (int16_t *) phy_vars_ue->pdcch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp[0];
|
||||
pdsch_llr = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->llr[0]; // stream 0
|
||||
//pdsch_llr = (int16_t*) phy_vars_ue->lte_ue_pdsch_vars_SI[eNB_id]->llr[0]; // stream 0
|
||||
pdsch_comp = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0];
|
||||
pdsch_mag = (int16_t*) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0];
|
||||
pdsch_comp = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->rxdataF_comp0[0];
|
||||
pdsch_mag = (int16_t *) phy_vars_ue->pdsch_vars[phy_vars_ue->current_thread_id[subframe]][eNB_id]->dl_ch_mag0[0];
|
||||
|
||||
// Received signal in time domain of receive antenna 0
|
||||
if (rxsig_t != NULL) {
|
||||
@@ -652,7 +618,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
freq[ind] = (float)ind;
|
||||
Re = (float)(chest_f[(atx<<1)+arx][(2*k)]);
|
||||
Im = (float)(chest_f[(atx<<1)+arx][(2*k)+1]);
|
||||
|
||||
chest_f_abs[ind] = (short)10*log10(1.0+((double)Re*Re + (double)Im*Im));
|
||||
ind++;
|
||||
}
|
||||
@@ -715,13 +680,11 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
}
|
||||
|
||||
fl_set_xyplot_xbounds(form->pdcch_llr,0,12*frame_parms->N_RB_DL*2*3);
|
||||
if (frame_parms->N_RB_DL != 100)
|
||||
{
|
||||
fl_set_xyplot_data(form->pdcch_llr,bit_pdcch,llr_pdcch,12*frame_parms->N_RB_DL*2*num_pdcch_symbols,"","","");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D(PHY,"UE PDCCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
|
||||
if (frame_parms->N_RB_DL != 100) {
|
||||
fl_set_xyplot_data(form->pdcch_llr,bit_pdcch,llr_pdcch,12*frame_parms->N_RB_DL*2*num_pdcch_symbols,"","","");
|
||||
} else {
|
||||
LOG_D(PHY,"UE PDCCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -731,13 +694,11 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
I[i] = pdcch_comp[2*i];
|
||||
Q[i] = pdcch_comp[2*i+1];
|
||||
}
|
||||
if (frame_parms->N_RB_DL != 100)
|
||||
{
|
||||
fl_set_xyplot_data(form->pdcch_comp,I,Q,12*frame_parms->N_RB_DL*num_pdcch_symbols,"","","");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D(PHY,"UE PDCCH COMP plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
|
||||
if (frame_parms->N_RB_DL != 100) {
|
||||
fl_set_xyplot_data(form->pdcch_comp,I,Q,12*frame_parms->N_RB_DL*num_pdcch_symbols,"","","");
|
||||
} else {
|
||||
LOG_D(PHY,"UE PDCCH COMP plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -749,13 +710,11 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
}
|
||||
|
||||
fl_set_xyplot_xbounds(form->pdsch_llr,0,coded_bits_per_codeword);
|
||||
if (frame_parms->N_RB_DL != 100)
|
||||
{
|
||||
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","","");
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG_D(PHY,"UE PDSCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
|
||||
if (frame_parms->N_RB_DL != 100) {
|
||||
fl_set_xyplot_data(form->pdsch_llr,bit,llr,coded_bits_per_codeword,"","","");
|
||||
} else {
|
||||
LOG_D(PHY,"UE PDSCH LLR plot is bugged in 20 MHz BW, to be fixed !!!\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -765,7 +724,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
|
||||
for (k=0; k<frame_parms->symbols_per_tti; k++) {
|
||||
for (i=0; i<12*frame_parms->N_RB_DL/2; i++) {
|
||||
int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
|
||||
int j = (2*frame_parms->N_RB_DL*12*k)+4*i;
|
||||
I[ind] = (pdsch_mag[j ]!=0? 1.0/pdsch_mag[j ]: 0.0) * pdsch_comp[j ]*1.0;
|
||||
Q[ind] = (pdsch_mag[j+1]!=0? 1.0/pdsch_mag[j+1]: 0.0) * pdsch_comp[j+1]*1.0;
|
||||
ind++;
|
||||
@@ -778,7 +737,6 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
// PDSCH Throughput
|
||||
memmove( tput_time_ue[UE_id], &tput_time_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
|
||||
memmove( tput_ue[UE_id], &tput_ue[UE_id][1], (TPUT_WINDOW_LENGTH-1)*sizeof(float) );
|
||||
|
||||
tput_time_ue[UE_id][TPUT_WINDOW_LENGTH-1] = (float) frame;
|
||||
tput_ue[UE_id][TPUT_WINDOW_LENGTH-1] = ((float) total_dlsch_bitrate)/1000.0;
|
||||
|
||||
@@ -787,11 +745,8 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
|
||||
}
|
||||
|
||||
fl_set_xyplot_data(form->pdsch_tput,tput_time_ue[UE_id],tput_ue[UE_id],TPUT_WINDOW_LENGTH,"","","");
|
||||
|
||||
fl_set_xyplot_ybounds(form->pdsch_tput,0,tput_ue_max[UE_id]);
|
||||
|
||||
fl_check_forms();
|
||||
|
||||
free(I);
|
||||
free(Q);
|
||||
free(chest_f_abs);
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#ifndef __PHY_DEFS_NB_IOT__H__
|
||||
#define __PHY_DEFS_NB_IOT__H__
|
||||
|
||||
#ifndef _GNU_SOURCE
|
||||
#define _GNU_SOURCE
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
|
||||
@@ -624,6 +624,8 @@ typedef struct RU_t_s {
|
||||
int wakeup_L1_sleep_cnt_max;
|
||||
/// DL IF frequency in Hz
|
||||
uint64_t if_frequency;
|
||||
/// UL IF frequency offset to DL IF frequency in Hz
|
||||
int if_freq_offset;
|
||||
} RU_t;
|
||||
|
||||
|
||||
|
||||
@@ -110,6 +110,8 @@ typedef struct {
|
||||
uint32_t K;
|
||||
/// Number of "Filler" bits
|
||||
uint32_t F;
|
||||
/// Encoder BG
|
||||
uint8_t BG;
|
||||
} NR_DL_gNB_HARQ_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -1121,6 +1121,8 @@ typedef struct {
|
||||
SLIST_HEAD(ral_thresholds_gen_poll_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
|
||||
SLIST_HEAD(ral_thresholds_lte_poll_s, ral_threshold_phy_t) ral_thresholds_lte_polled[RAL_LINK_PARAM_LTE_MAX];
|
||||
#endif
|
||||
|
||||
int dl_stats[5];
|
||||
|
||||
} PHY_VARS_NR_UE;
|
||||
|
||||
|
||||
@@ -236,6 +236,7 @@ typedef struct {
|
||||
typedef struct NR_DL_FRAME_PARMS NR_DL_FRAME_PARMS;
|
||||
|
||||
typedef uint32_t (*get_samples_per_slot_t)(int slot, NR_DL_FRAME_PARMS* fp);
|
||||
typedef uint32_t (*get_slot_from_timestamp_t)(openair0_timestamp timestamp_rx, NR_DL_FRAME_PARMS* fp);
|
||||
|
||||
typedef uint32_t (*get_samples_slot_timestamp_t)(int slot, NR_DL_FRAME_PARMS* fp, uint8_t sl_ahead);
|
||||
|
||||
@@ -292,14 +293,14 @@ struct NR_DL_FRAME_PARMS {
|
||||
uint32_t samples_per_subframe;
|
||||
/// Number of samples in current slot
|
||||
get_samples_per_slot_t get_samples_per_slot;
|
||||
/// slot calculation from timestamp
|
||||
get_slot_from_timestamp_t get_slot_from_timestamp;
|
||||
/// Number of samples before slot
|
||||
get_samples_slot_timestamp_t get_samples_slot_timestamp;
|
||||
/// Number of samples in 0th and center slot of a subframe
|
||||
uint32_t samples_per_slot0;
|
||||
/// Number of samples in other slots of the subframe
|
||||
uint32_t samples_per_slotN0;
|
||||
/// Number of OFDM/SC-FDMA symbols in one subframe (to be modified to account for potential different in UL/DL)
|
||||
uint16_t symbols_per_tti;
|
||||
/// Number of samples in a radio frame
|
||||
uint32_t samples_per_frame;
|
||||
/// Number of samples in a subframe without CP
|
||||
@@ -308,15 +309,8 @@ struct NR_DL_FRAME_PARMS {
|
||||
uint32_t samples_per_slot_wCP;
|
||||
/// Number of samples in a radio frame without CP
|
||||
uint32_t samples_per_frame_wCP;
|
||||
/// Number of samples in a tti (same as subrame in LTE, slot in NR)
|
||||
uint32_t samples_per_tti;
|
||||
/// NR numerology index [0..5] as specified in 38.211 Section 4 (mu). 0=15khZ SCS, 1=30khZ, 2=60kHz, etc
|
||||
uint8_t numerology_index;
|
||||
/// NR number of ttis per subframe deduced from numerology (cf 38.211): 1, 2, 4, 8(not supported),16(not supported),32(not supported)
|
||||
uint8_t ttis_per_subframe;
|
||||
/// NR number of slots per tti . Assumption only 2 Slot per TTI is supported (Slot Config 1 in 38.211)
|
||||
uint8_t slots_per_tti;
|
||||
//#endif
|
||||
/// Number of Physical transmit antennas in node
|
||||
uint8_t nb_antennas_tx;
|
||||
/// Number of Receive antennas in node
|
||||
|
||||
@@ -32,7 +32,8 @@ extern char fmageren_name2[512];
|
||||
extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
|
||||
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
|
||||
|
||||
//#include "PHY/LTE_TRANSPORT/transport_extern.h"
|
||||
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
|
||||
|
||||
extern const short conjugate[8],conjugate2[8];
|
||||
extern int number_of_cards;
|
||||
|
||||
@@ -11,9 +11,9 @@ typedef struct {
|
||||
/// timestamp transmitted to HW
|
||||
openair0_timestamp timestamp_tx;
|
||||
//#ifdef UE_NR_PHY_DEMO
|
||||
/// NR TTI index within subframe_tx [0 .. ttis_per_subframe - 1] to act upon for transmission
|
||||
/// NR TTI index within subframe_tx [0 .. slots_per_subframe - 1] to act upon for transmission
|
||||
int nr_tti_tx;
|
||||
/// NR TTI index within subframe_rx [0 .. ttis_per_subframe - 1] to act upon for reception
|
||||
/// NR TTI index within subframe_rx [0 .. slots_per_subframe - 1] to act upon for reception
|
||||
int nr_tti_rx;
|
||||
/// NR slot index within frame_tx [0 .. slots_per_frame - 1] to act upon for transmission
|
||||
int nr_slot_tx;
|
||||
|
||||
@@ -89,13 +89,6 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
|
||||
if (fp->numerology_index != 0) {
|
||||
|
||||
if (!(slot%(fp->slots_per_subframe/2))&&(first_symbol==0)) { // case where first symbol in slot has longer prefix
|
||||
apply_nr_rotation(fp,
|
||||
(int16_t*)&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
slot,
|
||||
0,
|
||||
1,
|
||||
fp->ofdm_symbol_size);
|
||||
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
@@ -103,13 +96,6 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
|
||||
fp->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
|
||||
apply_nr_rotation(fp,
|
||||
(int16_t*)&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
|
||||
slot,
|
||||
1,
|
||||
num_symbols-1,
|
||||
fp->ofdm_symbol_size);
|
||||
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF+fp->ofdm_symbol_size],
|
||||
(int*)&ru->common.txdata[aa][slot_offset+fp->nb_prefix_samples0+fp->ofdm_symbol_size],
|
||||
fp->ofdm_symbol_size,
|
||||
@@ -118,12 +104,6 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
|
||||
CYCLIC_PREFIX);
|
||||
}
|
||||
else { // all symbols in slot have shorter prefix
|
||||
apply_nr_rotation(fp,
|
||||
(int16_t*)&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
slot,
|
||||
first_symbol,
|
||||
num_symbols,
|
||||
fp->ofdm_symbol_size);
|
||||
PHY_ofdm_mod(&ru->common.txdataF_BF[aa][slot_offsetF],
|
||||
(int*)&ru->common.txdata[aa][slot_offset],
|
||||
fp->ofdm_symbol_size,
|
||||
@@ -141,12 +121,6 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
|
||||
1,
|
||||
fp->nb_prefix_samples,
|
||||
CYCLIC_PREFIX);
|
||||
apply_nr_rotation(fp,
|
||||
(int16_t*)&ru->common.txdata[aa][slot_offset],
|
||||
slot,
|
||||
idx_sym,
|
||||
1,
|
||||
fp->ofdm_symbol_size+fp->nb_prefix_samples);
|
||||
slot_offset += fp->nb_prefix_samples+fp->ofdm_symbol_size;
|
||||
}
|
||||
else {
|
||||
@@ -156,12 +130,6 @@ void nr_feptx0(RU_t *ru,int tti_tx,int first_symbol, int num_symbols, int aa) {
|
||||
1,
|
||||
fp->nb_prefix_samples0,
|
||||
CYCLIC_PREFIX);
|
||||
apply_nr_rotation(fp,
|
||||
(int16_t*)&ru->common.txdata[aa][slot_offset],
|
||||
slot,
|
||||
0,
|
||||
1,
|
||||
fp->ofdm_symbol_size+fp->nb_prefix_samples0);
|
||||
slot_offset += fp->nb_prefix_samples0+fp->ofdm_symbol_size;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ int set_tdd_configuration_dedicated_nr(NR_DL_FRAME_PARMS *frame_parms) {
|
||||
while(p_current_TDD_UL_DL_SlotConfig != NULL) {
|
||||
int slot_index = p_current_TDD_UL_DL_SlotConfig->slotIndex;
|
||||
|
||||
if (slot_index < TDD_CONFIG_NB_FRAMES*(frame_parms->ttis_per_subframe * NR_NUMBER_OF_SUBFRAMES_PER_FRAME)) {
|
||||
if (slot_index < TDD_CONFIG_NB_FRAMES * frame_parms->slots_per_frame) {
|
||||
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols != 0) {
|
||||
if (p_current_TDD_UL_DL_SlotConfig->nrofDownlinkSymbols == NR_TDD_SET_ALL_SYMBOLS) {
|
||||
if (p_current_TDD_UL_DL_SlotConfig->nrofUplinkSymbols == 0) {
|
||||
|
||||
@@ -205,6 +205,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_GENERATE_DLSCH,0);
|
||||
}
|
||||
|
||||
|
||||
//apply the OFDM symbol rotation here
|
||||
apply_nr_rotation(fp,(int16_t*) &gNB->common_vars.txdataF[0][txdataF_offset],slot,0,fp->Ncp==EXTENDED?12:14,fp->ofdm_symbol_size);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX+offset,0);
|
||||
}
|
||||
|
||||
@@ -380,7 +384,8 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
|
||||
case 245: timing_advance_update /= 32; break;
|
||||
case 273: timing_advance_update /= 32; break;
|
||||
case 66: timing_advance_update /= 12; break;
|
||||
default: abort();
|
||||
case 32: timing_advance_update /= 12; break;
|
||||
default: AssertFatal(0==1,"No case defined for PRB %d to calculate timing_advance_update\n",gNB->frame_parms.N_RB_DL);
|
||||
}
|
||||
|
||||
// put timing advance command in 0..63 range
|
||||
@@ -511,7 +516,7 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
uint8_t symbol;
|
||||
unsigned char aa;
|
||||
|
||||
for(symbol = 0; symbol < NR_SYMBOLS_PER_SLOT; symbol++) {
|
||||
for(symbol = 0; symbol < (gNB->frame_parms.Ncp==EXTENDED?12:14); symbol++) {
|
||||
// nr_slot_fep_ul(gNB, symbol, proc->slot_rx, 0, 0);
|
||||
|
||||
for (aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
|
||||
@@ -524,6 +529,16 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
for (aa = 0; aa < gNB->frame_parms.nb_antennas_rx; aa++) {
|
||||
apply_nr_rotation_ul(&gNB->frame_parms,
|
||||
gNB->common_vars.rxdataF[aa],
|
||||
slot_rx,
|
||||
0,
|
||||
gNB->frame_parms.Ncp==EXTENDED?12:14,
|
||||
gNB->frame_parms.ofdm_symbol_size);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
|
||||
@@ -531,7 +546,9 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,1);
|
||||
LOG_D(PHY,"phy_procedures_gNB_uespec_RX frame %d, slot %d\n",frame_rx,slot_rx);
|
||||
|
||||
fill_ul_rb_mask(gNB, frame_rx, slot_rx);
|
||||
if (gNB->frame_parms.frame_type == TDD)
|
||||
fill_ul_rb_mask(gNB, frame_rx, slot_rx);
|
||||
|
||||
gNB_I0_measurements(gNB);
|
||||
|
||||
for (int i=0;i<NUMBER_OF_NR_PUCCH_MAX;i++){
|
||||
|
||||
@@ -388,6 +388,7 @@ void set_tx_harq_id(NR_UE_ULSCH_t *ulsch, int harq_pid, int slot_tx);
|
||||
int get_tx_harq_id(NR_UE_ULSCH_t *ulsch, int slot_tx);
|
||||
|
||||
int is_pbch_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp);
|
||||
int is_ssb_in_slot(fapi_nr_config_request_t *config, int frame, int slot, NR_DL_FRAME_PARMS *fp);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user