Merge branch 'develop-nr' into nr_polar_uci
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
// Comments
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label 'bellatrix'
|
||||
}
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
gitLabConnection('OAI GitLab')
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build gNb-usrp", "Build nr-UE-usrp", "Build phy-sim", "Analysis with cppcheck"])
|
||||
}
|
||||
|
||||
stages {
|
||||
stage ("Verify Guidelines") {
|
||||
steps {
|
||||
echo "Git URL is ${GIT_URL}"
|
||||
echo "GitLab Act is ${env.gitlabActionType}"
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
// GitLab-Jenkins plugin integration is lacking to perform the merge by itself
|
||||
// Doing it manually --> it may have merge conflicts
|
||||
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
sh "zip -r -qq localZip.zip ."
|
||||
|
||||
// Running astyle options on the list of modified files by the merge request
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
|
||||
def res=readFile('./oai_rules_result.txt').trim();
|
||||
if ("0".equals(res)) {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
|
||||
addGitLabMRComment comment: message
|
||||
} else {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
|
||||
addGitLabMRComment comment: message
|
||||
}
|
||||
} else {
|
||||
echo "Git Branch is ${GIT_BRANCH}"
|
||||
echo "Git Commit is ${GIT_COMMIT}"
|
||||
|
||||
sh "zip -r -qq localZip.zip ."
|
||||
// Running astyle options on all C/H files in the repository
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Variant Builds") {
|
||||
parallel {
|
||||
stage ("Analysis with cppcheck") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Analysis with cppcheck") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNb-USRP") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build 5G gNB-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build gNb-usrp") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant gnb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build 5G NR-UE-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build nr-UE-usrp") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant nu-ue-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build physical simulators") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build phy-sim") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
dir ('archives') {
|
||||
sh "zip -r -qq vm_build_logs.zip enb_usrp phy_sim cppcheck gnb_usrp nrue_usrp"
|
||||
}
|
||||
if(fileExists('archives/vm_build_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
|
||||
}
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
} else {
|
||||
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
|
||||
}
|
||||
if(fileExists('build_results.html')) {
|
||||
archiveArtifacts artifacts: 'build_results.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Destroy all Virtual Machines") {
|
||||
steps {
|
||||
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
// Stage destroy may not be run if error in previous stage
|
||||
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
success {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
echo "This is a MERGE event"
|
||||
addGitLabMRComment comment: message
|
||||
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
||||
slackSend channel: 'ci-enb', color: 'good', message: message2
|
||||
} else {
|
||||
slackSend channel: 'ci-enb', color: 'good', message: message
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
echo "This is a MERGE event"
|
||||
addGitLabMRComment comment: message
|
||||
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
||||
slackSend channel: 'ci-enb', color: 'danger', message: message2
|
||||
} else {
|
||||
slackSend channel: 'ci-enb', color: 'danger', message: message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
# OAI is using a style that is similar to the Google style
|
||||
--style=google
|
||||
# long options can be written without the preceding '--'
|
||||
# Convert tabs to spaces
|
||||
convert-tabs
|
||||
# Indentation is 2 spaces
|
||||
indent=spaces=2
|
||||
# Indent 'switch' blocks so that the 'case X:' statements are indented in the switch block.
|
||||
indent-switches
|
||||
# Indent C++ comments beginning in column one.
|
||||
indent-col1-comments
|
||||
# Pad empty lines around header blocks
|
||||
break-blocks
|
||||
delete-empty-lines
|
||||
# Attach a pointer or reference operator (*, &, or ^) to the variable name (right)
|
||||
align-pointer=name
|
||||
# The code line length is 200 characters/columns
|
||||
max-code-length=200
|
||||
break-after-logical
|
||||
lineend=linux
|
||||
Executable
+153
@@ -0,0 +1,153 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI Local Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " buildLocally.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --workspace #### OR -ws ####"
|
||||
echo " Specify the workspace"
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 2 ] && [ $# -ne 1 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-ws|--workspace)
|
||||
JENKINS_WKSP="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
cd $JENKINS_WKSP
|
||||
STATUS=0
|
||||
|
||||
############################################################
|
||||
# Creating a tmp folder to store results and artifacts
|
||||
############################################################
|
||||
if [ ! -d $JENKINS_WKSP/archives ]
|
||||
then
|
||||
mkdir $JENKINS_WKSP/archives
|
||||
fi
|
||||
|
||||
source oaienv
|
||||
cd $JENKINS_WKSP/cmake_targets
|
||||
|
||||
############################################################
|
||||
# Building eNb with USRP option
|
||||
############################################################
|
||||
ARCHIVES_LOC=$JENKINS_WKSP/archives/enb_usrp
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir $ARCHIVES_LOC
|
||||
fi
|
||||
./build_oai --eNB -w USRP -c
|
||||
|
||||
# Generated log files:
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/lte-softmodem.Rel14.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target lte-softmodem" $JENKINS_WKSP/cmake_targets/log/lte-softmodem.Rel14.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/lte-softmodem.Rel14.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/params_libconfig.Rel14.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target params_libconfig" $JENKINS_WKSP/cmake_targets/log/params_libconfig.Rel14.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/params_libconfig.Rel14.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/coding.Rel14.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target coding" $JENKINS_WKSP/cmake_targets/log/coding.Rel14.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/coding.Rel14.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/oai_usrpdevif.Rel14.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target oai_usrpdevif" $JENKINS_WKSP/cmake_targets/log/oai_usrpdevif.Rel14.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/oai_usrpdevif.Rel14.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
|
||||
############################################################
|
||||
# Building basic simulator
|
||||
############################################################
|
||||
ARCHIVES_LOC=$JENKINS_WKSP/archives/basic_sim
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir $ARCHIVES_LOC
|
||||
fi
|
||||
cd $JENKINS_WKSP/cmake_targets
|
||||
./build_oai --basic-simulator -c
|
||||
|
||||
# Generated log files:
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/basic_simulator_enb.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target lte-softmodem" $JENKINS_WKSP/cmake_targets/log/basic_simulator_enb.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/basic_simulator_enb.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/basic_simulator_ue.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target lte-uesoftmodem" $JENKINS_WKSP/cmake_targets/log/basic_simulator_ue.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/basic_simulator_ue.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ -f $JENKINS_WKSP/cmake_targets/log/conf2uedata.Rel14.txt ]
|
||||
then
|
||||
LOCAL_STAT=`egrep -c "Built target conf2uedata" $JENKINS_WKSP/cmake_targets/log/conf2uedata.Rel14.txt`
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
cp $JENKINS_WKSP/cmake_targets/log/conf2uedata.Rel14.txt $ARCHIVES_LOC
|
||||
else
|
||||
STATUS=-1
|
||||
fi
|
||||
|
||||
############################################################
|
||||
# Creating a zip for Jenkins archiving
|
||||
############################################################
|
||||
cd $JENKINS_WKSP/archives/
|
||||
zip -r local_build_logs.zip basic_sim enb_usrp
|
||||
|
||||
exit $STATUS
|
||||
Executable
+363
@@ -0,0 +1,363 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI VM Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo " Requirements:"
|
||||
echo " -- uvtool uvtool-libvirt apt-cacher"
|
||||
echo " -- xenial image already synced"
|
||||
echo " Default:"
|
||||
echo " -- eNB with USRP"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " buildOnVM.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --workspace #### OR -ws ####"
|
||||
echo " Specify the workspace."
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant gnb-usrp OR -v5"
|
||||
echo " --variant nu-ue-usrp OR -v6"
|
||||
echo " Specify the variant to build."
|
||||
echo ""
|
||||
echo " --keep-vm-alive OR -k"
|
||||
echo " Keep the VM alive after the build."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function variant_usage {
|
||||
echo "OAI VM Build Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " --variant enb-usrp OR -v1"
|
||||
echo " --variant basic-sim OR -v2"
|
||||
echo " --variant phy-sim OR -v3"
|
||||
echo " --variant cppcheck OR -v4"
|
||||
echo " --variant gnb-usrp OR -v5"
|
||||
echo " --variant nu-ue-usrp OR -v6"
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -lt 1 ] || [ $# -gt 9 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_TEMPLATE=ci-
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
VM_NAME=ci-enb-usrp
|
||||
ARCHIVES_LOC=enb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
KEEP_VM_ALIVE=0
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-ws|--workspace)
|
||||
JENKINS_WKSP="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-k|--keep-vm-alive)
|
||||
KEEP_VM_ALIVE=1
|
||||
shift
|
||||
;;
|
||||
-v1)
|
||||
VM_NAME=ci-enb-usrp
|
||||
ARCHIVES_LOC=enb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
shift
|
||||
;;
|
||||
-v2)
|
||||
VM_NAME=ci-basic-sim
|
||||
ARCHIVES_LOC=basic_sim
|
||||
LOG_PATTERN=basic_simulator
|
||||
NB_PATTERN_FILES=2
|
||||
BUILD_OPTIONS="--basic-simulator"
|
||||
shift
|
||||
;;
|
||||
-v3)
|
||||
VM_NAME=ci-phy-sim
|
||||
ARCHIVES_LOC=phy_sim
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=3
|
||||
BUILD_OPTIONS="--phy_simulators"
|
||||
shift
|
||||
;;
|
||||
-v4)
|
||||
VM_NAME=ci-cppcheck
|
||||
ARCHIVES_LOC=cppcheck
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2"
|
||||
shift
|
||||
;;
|
||||
-v5)
|
||||
VM_NAME=ci-gnb-usrp
|
||||
ARCHIVES_LOC=gnb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--gNB -w USRP"
|
||||
shift
|
||||
;;
|
||||
-v6)
|
||||
VM_NAME=ci-ue-nr-usrp
|
||||
ARCHIVES_LOC=nrue_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--nrUE -w USRP"
|
||||
shift
|
||||
;;
|
||||
--variant)
|
||||
variant="$2"
|
||||
case $variant in
|
||||
enb-usrp)
|
||||
VM_NAME=ci-enb-usrp
|
||||
ARCHIVES_LOC=enb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--eNB -w USRP"
|
||||
;;
|
||||
basic-sim)
|
||||
VM_NAME=ci-basic-sim
|
||||
ARCHIVES_LOC=basic_sim
|
||||
LOG_PATTERN=basic_simulator
|
||||
NB_PATTERN_FILES=2
|
||||
BUILD_OPTIONS="--basic-simulator"
|
||||
;;
|
||||
phy-sim)
|
||||
VM_NAME=ci-phy-sim
|
||||
ARCHIVES_LOC=phy_sim
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=3
|
||||
BUILD_OPTIONS="--phy_simulators"
|
||||
;;
|
||||
cppcheck)
|
||||
VM_NAME=ci-cppcheck
|
||||
ARCHIVES_LOC=cppcheck
|
||||
LOG_PATTERN=cppcheck.xml
|
||||
NB_PATTERN_FILES=1
|
||||
BUILD_OPTIONS="--enable=warning --force --xml --xml-version=2"
|
||||
;;
|
||||
gnb-usrp)
|
||||
VM_NAME=ci-gnb-usrp
|
||||
ARCHIVES_LOC=gnb_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--gNB -w USRP"
|
||||
;;
|
||||
nu-ue-usrp)
|
||||
VM_NAME=ci-ue-nr-usrp
|
||||
ARCHIVES_LOC=nrue_usrp
|
||||
LOG_PATTERN=.Rel14.txt
|
||||
NB_PATTERN_FILES=4
|
||||
BUILD_OPTIONS="--nrUE -w USRP"
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Syntax Error: Invalid Variant option -> $variant"
|
||||
echo ""
|
||||
variant_usage
|
||||
exit 1
|
||||
esac
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ ! -f $JENKINS_WKSP/localZip.zip ]
|
||||
then
|
||||
echo "Missing localZip.zip file!"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f /etc/apt/apt.conf.d/01proxy ]
|
||||
then
|
||||
echo "Missing /etc/apt/apt.conf.d/01proxy file!"
|
||||
echo "Is apt-cacher installed and configured?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
|
||||
then
|
||||
VM_TEMPLATE=ci-
|
||||
else
|
||||
VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}-
|
||||
fi
|
||||
|
||||
VM_NAME=`echo $VM_NAME | sed -e "s#ci-#$VM_TEMPLATE#"`
|
||||
VM_CMDS=${VM_NAME}_cmds.txt
|
||||
ARCHIVES_LOC=${JENKINS_WKSP}/archives/${ARCHIVES_LOC}
|
||||
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_CMD_FILE = $VM_CMDS"
|
||||
echo "JENKINS_WKSP = $JENKINS_WKSP"
|
||||
echo "ARCHIVES_LOC = $ARCHIVES_LOC"
|
||||
echo "BUILD_OPTIONS = $BUILD_OPTIONS"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Creating VM ($VM_NAME) on Ubuntu Cloud Image base"
|
||||
echo "############################################################"
|
||||
uvt-kvm create $VM_NAME release=xenial --memory 2048 --cpu 4 --unsafe-caching --template ci-scripts/template-host.xml
|
||||
echo "Waiting for VM to be started"
|
||||
uvt-kvm wait $VM_NAME --insecure
|
||||
|
||||
VM_IP_ADDR=`uvt-kvm ip $VM_NAME`
|
||||
echo "$VM_NAME has for IP addr = $VM_IP_ADDR"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Copying GIT repo into VM ($VM_NAME)"
|
||||
echo "############################################################"
|
||||
scp -o StrictHostKeyChecking=no localZip.zip ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
scp -o StrictHostKeyChecking=no /etc/apt/apt.conf.d/01proxy ubuntu@$VM_IP_ADDR:/home/ubuntu
|
||||
|
||||
echo "############################################################"
|
||||
echo "Running install and build script on VM ($VM_NAME)"
|
||||
echo "############################################################"
|
||||
echo "sudo cp 01proxy /etc/apt/apt.conf.d/" > $VM_CMDS
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
echo "echo \"sudo apt-get --yes --quiet install zip cppcheck \"" >> $VM_CMDS
|
||||
echo "sudo apt-get update > zip-install.txt 2>&1" >> $VM_CMDS
|
||||
echo "sudo apt-get --yes install zip cppcheck >> zip-install.txt 2>&1" >> $VM_CMDS
|
||||
else
|
||||
echo "echo \"sudo apt-get --yes --quiet install zip subversion libboost-dev \"" >> $VM_CMDS
|
||||
echo "sudo apt-get --yes install zip subversion libboost-dev > zip-install.txt 2>&1" >> $VM_CMDS
|
||||
fi
|
||||
echo "mkdir tmp" >> $VM_CMDS
|
||||
echo "cd tmp" >> $VM_CMDS
|
||||
echo "echo \"unzip -qq -DD ../localZip.zip\"" >> $VM_CMDS
|
||||
echo "unzip -qq -DD ../localZip.zip" >> $VM_CMDS
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
echo "mkdir cmake_targets/log" >> $VM_CMDS
|
||||
echo "cp /home/ubuntu/zip-install.txt cmake_targets/log" >> $VM_CMDS
|
||||
echo "echo \"cppcheck $BUILD_OPTIONS . \"" >> $VM_CMDS
|
||||
echo "cppcheck $BUILD_OPTIONS . 2> cmake_targets/log/cppcheck.xml 1> cmake_targets/log/cppcheck_build.txt" >> $VM_CMDS
|
||||
else
|
||||
echo "echo \"source oaienv\"" >> $VM_CMDS
|
||||
echo "source oaienv" >> $VM_CMDS
|
||||
echo "cd cmake_targets/" >> $VM_CMDS
|
||||
echo "mkdir log" >> $VM_CMDS
|
||||
echo "cp /home/ubuntu/zip-install.txt log" >> $VM_CMDS
|
||||
echo "echo \"./build_oai -I $BUILD_OPTIONS \"" >> $VM_CMDS
|
||||
echo "./build_oai -I $BUILD_OPTIONS > log/install-build.txt 2>&1" >> $VM_CMDS
|
||||
fi
|
||||
ssh -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR < $VM_CMDS
|
||||
|
||||
echo "############################################################"
|
||||
echo "Creating a tmp folder to store results and artifacts"
|
||||
echo "############################################################"
|
||||
if [ ! -d $JENKINS_WKSP/archives ]
|
||||
then
|
||||
mkdir $JENKINS_WKSP/archives
|
||||
fi
|
||||
|
||||
if [ ! -d $ARCHIVES_LOC ]
|
||||
then
|
||||
mkdir $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.txt $ARCHIVES_LOC
|
||||
if [[ "$VM_NAME" == *"-cppcheck"* ]]
|
||||
then
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/*.xml $ARCHIVES_LOC
|
||||
fi
|
||||
|
||||
if [ $KEEP_VM_ALIVE -eq 0 ]
|
||||
then
|
||||
echo "############################################################"
|
||||
echo "Destroying VM"
|
||||
echo "############################################################"
|
||||
uvt-kvm destroy $VM_NAME
|
||||
ssh-keygen -R $VM_IP_ADDR
|
||||
fi
|
||||
rm -f $VM_CMDS
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking build status"
|
||||
echo "############################################################"
|
||||
|
||||
LOG_FILES=`ls $ARCHIVES_LOC/*.txt $ARCHIVES_LOC/*.xml`
|
||||
STATUS=0
|
||||
NB_FOUND_FILES=0
|
||||
|
||||
for FULLFILE in $LOG_FILES
|
||||
do
|
||||
if [[ $FULLFILE == *"$LOG_PATTERN"* ]]
|
||||
then
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
if [ "$LOG_PATTERN" == ".Rel14.txt" ]
|
||||
then
|
||||
PASS_PATTERN=`echo $filename | sed -e "s#$LOG_PATTERN##"`
|
||||
fi
|
||||
if [ "$LOG_PATTERN" == "basic_simulator" ]
|
||||
then
|
||||
PASS_PATTERN="lte-"
|
||||
fi
|
||||
if [ "$LOG_PATTERN" == "cppcheck.xml" ]
|
||||
then
|
||||
PASS_PATTERN="results version"
|
||||
LOCAL_STAT=`egrep -c "$PASS_PATTERN" $FULLFILE`
|
||||
else
|
||||
LOCAL_STAT=`egrep -c "Built target $PASS_PATTERN" $FULLFILE`
|
||||
fi
|
||||
if [ $LOCAL_STAT -eq 0 ]; then STATUS=-1; fi
|
||||
NB_FOUND_FILES=$((NB_FOUND_FILES + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $NB_PATTERN_FILES -ne $NB_FOUND_FILES ]; then STATUS=-1; fi
|
||||
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "STATUS seems OK"
|
||||
else
|
||||
echo "STATUS failed?"
|
||||
fi
|
||||
exit $STATUS
|
||||
Executable
+121
@@ -0,0 +1,121 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI Coding / Formatting Guideline Check script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " Requirement: astyle shall be installed"
|
||||
echo ""
|
||||
echo " By default (no options) the complete repository will be checked"
|
||||
echo " In case of merge request, provided source and target branch,"
|
||||
echo " the script will check only the modified files"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " checkCodingFormattingRules.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 4 ] && [ $# -ne 1 ] && [ $# -ne 0 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
echo " ---- Checking the whole repository ----"
|
||||
echo ""
|
||||
NB_FILES_TO_FORMAT=`astyle --dry-run --options=ci-scripts/astyle-options.txt --recursive *.c *.h | grep -c Formatted `
|
||||
echo "Nb Files that do NOT follow OAI rules: $NB_FILES_TO_FORMAT"
|
||||
echo $NB_FILES_TO_FORMAT > ./oai_rules_result.txt
|
||||
exit 0
|
||||
fi
|
||||
|
||||
checker=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
|
||||
if [ $checker -ne 3 ]
|
||||
then
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo ""
|
||||
echo "Syntax Error: missing option"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Merge request scenario
|
||||
|
||||
MERGE_COMMMIT=`git log -n1 | grep commit | sed -e "s@commit @@"`
|
||||
TARGET_INIT_COMMIT=`cat .git/refs/remotes/origin/$TARGET_BRANCH`
|
||||
|
||||
echo " ---- Checking the modified files by the merge request ----"
|
||||
echo ""
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Merged Commit is : $MERGE_COMMMIT"
|
||||
echo "Target Init is : $TARGET_INIT_COMMIT"
|
||||
|
||||
# Retrieve the list of modified files since the latest develop commit
|
||||
MODIFIED_FILES=`git log $TARGET_INIT_COMMIT..$MERGE_COMMMIT --oneline --name-status | egrep "^M|^A" | sed -e "s@^M\t*@@" -e "s@^A\t*@@" | sort | uniq`
|
||||
NB_TO_FORMAT=0
|
||||
for FULLFILE in $MODIFIED_FILES
|
||||
do
|
||||
echo $FULLFILE
|
||||
filename=$(basename -- "$FULLFILE")
|
||||
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 `
|
||||
NB_TO_FORMAT=$((NB_TO_FORMAT + TO_FORMAT))
|
||||
fi
|
||||
done
|
||||
echo "Nb Files that do NOT follow OAI rules: $NB_TO_FORMAT"
|
||||
echo $NB_TO_FORMAT > ./oai_rules_result.txt
|
||||
|
||||
exit 0
|
||||
Executable
+81
@@ -0,0 +1,81 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI VM Destroy script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo " destroyAllRunningVM.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -gt 4 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
VM_TEMPLATE=ci-
|
||||
JOB_NAME=XX
|
||||
BUILD_ID=XX
|
||||
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$JOB_NAME" == "XX" ] || [ "$BUILD_ID" == "XX" ]
|
||||
then
|
||||
VM_TEMPLATE=ci-
|
||||
else
|
||||
VM_TEMPLATE=${JOB_NAME}-b${BUILD_ID}-
|
||||
fi
|
||||
|
||||
LIST_CI_VM=`uvt-kvm list | grep $VM_TEMPLATE`
|
||||
|
||||
for CI_VM in $LIST_CI_VM
|
||||
do
|
||||
VM_IP_ADDR=`uvt-kvm ip $CI_VM`
|
||||
echo "VM to destroy: $CI_VM -- IP $VM_IP_ADDR"
|
||||
uvt-kvm destroy $CI_VM
|
||||
ssh-keygen -R $VM_IP_ADDR
|
||||
done
|
||||
|
||||
exit 0
|
||||
|
||||
Executable
+109
@@ -0,0 +1,109 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI GitLab merge request applying script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo ""
|
||||
echo " doGitLabMerge.sh [OPTIONS] [MANDATORY_OPTIONS]"
|
||||
echo ""
|
||||
echo "Mandatory Options:"
|
||||
echo "------------------"
|
||||
echo ""
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --src-commit #### OR -sc ####"
|
||||
echo " Specify the source commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --target-commit #### OR -tc ####"
|
||||
echo " Specify the target commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
if [ $# -ne 8 ] && [ $# -ne 1 ]
|
||||
then
|
||||
echo "Syntax Error: not the correct number of arguments"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
checker=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-sc|--src-commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tc|--target-commit)
|
||||
TARGET_COMMIT_ID="$2"
|
||||
let "checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
echo "Source Branch is : $SOURCE_BRANCH"
|
||||
echo "Source Commit ID is : $SOURCE_COMMIT_ID"
|
||||
echo "Target Branch is : $TARGET_BRANCH"
|
||||
echo "Target Commit ID is : $TARGET_COMMIT_ID"
|
||||
|
||||
if [ $checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing option"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
git config user.email "jenkins@openairinterface.org"
|
||||
git config user.name "OAI Jenkins"
|
||||
|
||||
git checkout -f $SOURCE_COMMIT_ID
|
||||
|
||||
git merge --ff $TARGET_COMMIT_ID -m "Temporary merge for CI"
|
||||
|
||||
exit 0
|
||||
|
||||
|
||||
Executable
+558
@@ -0,0 +1,558 @@
|
||||
#!/bin/bash
|
||||
|
||||
function usage {
|
||||
echo "OAI Local Build Report script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo "Usage:"
|
||||
echo "------"
|
||||
echo ""
|
||||
echo " reportBuildLocally.sh [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo "--------"
|
||||
echo ""
|
||||
echo " --help OR -h"
|
||||
echo " Print this help message."
|
||||
echo ""
|
||||
echo "Job Options:"
|
||||
echo "------------"
|
||||
echo ""
|
||||
echo " --git-url #### OR -gu ####"
|
||||
echo " Specify the URL of the GIT Repository."
|
||||
echo ""
|
||||
echo " --job-name #### OR -jn ####"
|
||||
echo " Specify the name of the Jenkins job."
|
||||
echo ""
|
||||
echo " --build-id #### OR -id ####"
|
||||
echo " Specify the build ID of the Jenkins job."
|
||||
echo ""
|
||||
echo " --trigger merge-request OR -mr"
|
||||
echo " --trigger push OR -pu"
|
||||
echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
|
||||
echo ""
|
||||
echo "Merge-Request Options:"
|
||||
echo "----------------------"
|
||||
echo ""
|
||||
echo " --src-branch #### OR -sb ####"
|
||||
echo " Specify the source branch of the merge request."
|
||||
echo ""
|
||||
echo " --src-commit #### OR -sc ####"
|
||||
echo " Specify the source commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo " --target-branch #### OR -tb ####"
|
||||
echo " Specify the target branch of the merge request (usually develop)."
|
||||
echo ""
|
||||
echo " --target-commit #### OR -tc ####"
|
||||
echo " Specify the target commit ID (SHA-1) of the merge request."
|
||||
echo ""
|
||||
echo "Push Options:"
|
||||
echo "----------------------"
|
||||
echo ""
|
||||
echo " --branch #### OR -br ####"
|
||||
echo " Specify the branch of the push event."
|
||||
echo ""
|
||||
echo " --commit #### OR -co ####"
|
||||
echo " Specify the commit ID (SHA-1) of the push event."
|
||||
echo ""
|
||||
echo ""
|
||||
}
|
||||
|
||||
function trigger_usage {
|
||||
echo "OAI Local Build Report script"
|
||||
echo " Original Author: Raphael Defosseux"
|
||||
echo ""
|
||||
echo " --trigger merge-request OR -mr"
|
||||
echo " --trigger push OR -pu"
|
||||
echo " Specify trigger action of the Jenkins job. Either a merge-request event or a push event."
|
||||
echo ""
|
||||
}
|
||||
|
||||
function details_table {
|
||||
echo " <h4>$1</h4>" >> $3
|
||||
|
||||
echo " <table border = \"1\">" >> $3
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> $3
|
||||
echo " <th>File</th>" >> $3
|
||||
echo " <th>Line Number</th>" >> $3
|
||||
echo " <th>Status</th>" >> $3
|
||||
echo " <th>Message</th>" >> $3
|
||||
echo " </tr>" >> $3
|
||||
|
||||
LIST_MESSAGES=`egrep "error:|warning:" $2 | egrep -v "jobserver unavailable|Clock skew detected.|flexran.proto"`
|
||||
COMPLETE_MESSAGE="start"
|
||||
for MESSAGE in $LIST_MESSAGES
|
||||
do
|
||||
if [[ $MESSAGE == *"/home/ubuntu/tmp"* ]]
|
||||
then
|
||||
FILENAME=`echo $MESSAGE | sed -e "s#^/home/ubuntu/tmp/##" | awk -F ":" '{print $1}'`
|
||||
LINENB=`echo $MESSAGE | awk -F ":" '{print $2}'`
|
||||
if [ "$COMPLETE_MESSAGE" != "start" ]
|
||||
then
|
||||
COMPLETE_MESSAGE=`echo $COMPLETE_MESSAGE | sed -e "s#‘#'#g" -e "s#’#'#g"`
|
||||
echo " <td>$COMPLETE_MESSAGE</td>" >> $3
|
||||
echo " </tr>" >> $3
|
||||
fi
|
||||
echo " <tr>" >> $3
|
||||
echo " <td>$FILENAME</td>" >> $3
|
||||
echo " <td>$LINENB</td>" >> $3
|
||||
else
|
||||
if [[ $MESSAGE == *"warning:"* ]] || [[ $MESSAGE == *"error:"* ]]
|
||||
then
|
||||
MSGTYPE=`echo $MESSAGE | sed -e "s#:##g"`
|
||||
echo " <td>$MSGTYPE</td>" >> $3
|
||||
COMPLETE_MESSAGE=""
|
||||
else
|
||||
COMPLETE_MESSAGE=$COMPLETE_MESSAGE" "$MESSAGE
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$COMPLETE_MESSAGE" != "start" ]
|
||||
then
|
||||
COMPLETE_MESSAGE=`echo $COMPLETE_MESSAGE | sed -e "s#‘#'#g" -e "s#’#'#g"`
|
||||
echo " <td>$COMPLETE_MESSAGE</td>" >> $3
|
||||
echo " </tr>" >> $3
|
||||
fi
|
||||
echo " </table>" >> $3
|
||||
}
|
||||
|
||||
function summary_table_header {
|
||||
echo " <h3>$1</h3>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Element</th>" >> ./build_results.html
|
||||
echo " <th>Status</th>" >> ./build_results.html
|
||||
echo " <th>Nb Errors</th>" >> ./build_results.html
|
||||
echo " <th>Nb Warnings</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function summary_table_row {
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >$1</th>" >> ./build_results.html
|
||||
if [ -f $2 ]
|
||||
then
|
||||
STATUS=`egrep -c "$3" $2`
|
||||
if [ $STATUS -eq 1 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</th>" >> ./build_results.html
|
||||
fi
|
||||
NB_ERRORS=`egrep -c "error:" $2`
|
||||
if [ $NB_ERRORS -eq 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >$NB_ERRORS</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >$NB_ERRORS</th>" >> ./build_results.html
|
||||
fi
|
||||
NB_WARNINGS=`egrep "warning:" $2 | egrep -v "jobserver unavailable|Clock skew detected.|flexran.proto" | egrep -c "warning:"`
|
||||
if [ $NB_WARNINGS -eq 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >$NB_WARNINGS</th>" >> ./build_results.html
|
||||
else
|
||||
if [ $NB_WARNINGS -gt 20 ]
|
||||
then
|
||||
echo " <td bgcolor = \"red\" >$NB_WARNINGS</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"orange\" >$NB_WARNINGS</th>" >> ./build_results.html
|
||||
fi
|
||||
fi
|
||||
if [ $NB_ERRORS -ne 0 ] || [ $NB_WARNINGS -ne 0 ]
|
||||
then
|
||||
details_table "$1" $2 $4
|
||||
fi
|
||||
else
|
||||
echo " <td bgcolor = \"lightgray\" >Unknown</th>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightgray\" >--</th>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightgray\" >--</th>" >> ./build_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function summary_table_footer {
|
||||
echo " </table>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function sca_summary_table_header {
|
||||
echo " <h3>$1</h3>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Error / Warning Type</th>" >> ./build_results.html
|
||||
echo " <th>Nb Errors</th>" >> ./build_results.html
|
||||
echo " <th>Nb Warnings</th>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo "0" > ccp_error_cnt.txt
|
||||
}
|
||||
|
||||
function sca_summary_table_row {
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >$2</td>" >> ./build_results.html
|
||||
if [ -f $1 ]
|
||||
then
|
||||
NB_ERRORS=`egrep "severity=\"error\"" $1 | egrep -c "id=\"$3\""`
|
||||
echo " <td>$NB_ERRORS</td>" >> ./build_results.html
|
||||
echo " <td>N/A</td>" >> ./build_results.html
|
||||
if [ -f ccp_error_cnt.txt ]
|
||||
then
|
||||
TOTAL_ERRORS=`cat ccp_error_cnt.txt`
|
||||
TOTAL_ERRORS=$((TOTAL_ERRORS + NB_ERRORS))
|
||||
echo $TOTAL_ERRORS > ccp_error_cnt.txt
|
||||
fi
|
||||
else
|
||||
echo " <td>Unknown</td>" >> ./build_results.html
|
||||
echo " <td>Unknown</td>" >> ./build_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
}
|
||||
|
||||
function sca_summary_table_footer {
|
||||
if [ -f $1 ]
|
||||
then
|
||||
NB_ERRORS=`egrep -c "severity=\"error\"" $1`
|
||||
NB_WARNINGS=`egrep -c "severity=\"warning\"" $1`
|
||||
if [ -f ccp_error_cnt.txt ]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Others</td>" >> ./build_results.html
|
||||
TOTAL_ERRORS=`cat ccp_error_cnt.txt`
|
||||
TOTAL_ERRORS=$((NB_ERRORS - TOTAL_ERRORS))
|
||||
echo " <td>$TOTAL_ERRORS</td>" >> ./build_results.html
|
||||
echo " <td>$NB_WARNINGS</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
rm -f ccp_error_cnt.txt
|
||||
fi
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Total</th>" >> ./build_results.html
|
||||
echo " <th>$NB_ERRORS</th>" >> ./build_results.html
|
||||
echo " <th>$NB_WARNINGS</th>" >> ./build_results.html
|
||||
else
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./build_results.html
|
||||
echo " <th>Total</th>" >> ./build_results.html
|
||||
echo " <th>Unknown</th>" >> ./build_results.html
|
||||
echo " <th>Unknown</th>" >> ./build_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <p>Full details in zipped artifact (cppcheck/cppcheck.xml) </p>" >> ./build_results.html
|
||||
echo " <p>Graphical Interface tool : <code>cppcheck-gui -l cppcheck/cppcheck.xml</code> </p>" >> ./build_results.html
|
||||
}
|
||||
|
||||
jb_checker=0
|
||||
mr_checker=0
|
||||
pu_checker=0
|
||||
MR_TRIG=0
|
||||
PU_TRIG=0
|
||||
while [[ $# -gt 0 ]]
|
||||
do
|
||||
key="$1"
|
||||
|
||||
case $key in
|
||||
-h|--help)
|
||||
shift
|
||||
usage
|
||||
exit 0
|
||||
;;
|
||||
-gu|--git-url)
|
||||
GIT_URL="$2"
|
||||
let "jb_checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-jn|--job-name)
|
||||
JOB_NAME="$2"
|
||||
let "jb_checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-id|--build-id)
|
||||
BUILD_ID="$2"
|
||||
let "jb_checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
--trigger)
|
||||
TRIG="$2"
|
||||
case $TRIG in
|
||||
merge-request)
|
||||
MR_TRIG=1
|
||||
;;
|
||||
push)
|
||||
PU_TRIG=1
|
||||
;;
|
||||
*)
|
||||
echo ""
|
||||
echo "Syntax Error: Invalid Trigger option -> $TRIG"
|
||||
echo ""
|
||||
trigger_usage
|
||||
exit
|
||||
;;
|
||||
esac
|
||||
let "jb_checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-mr)
|
||||
MR_TRIG=1
|
||||
let "jb_checker|=0x8"
|
||||
shift
|
||||
;;
|
||||
-pu)
|
||||
PU_TRIG=1
|
||||
let "jb_checker|=0x8"
|
||||
shift
|
||||
;;
|
||||
-sb|--src-branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "mr_checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-sc|--src-commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "mr_checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tb|--target-branch)
|
||||
TARGET_BRANCH="$2"
|
||||
let "mr_checker|=0x4"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-tc|--target-commit)
|
||||
TARGET_COMMIT_ID="$2"
|
||||
let "mr_checker|=0x8"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-br|--branch)
|
||||
SOURCE_BRANCH="$2"
|
||||
let "pu_checker|=0x1"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
-co|--commit)
|
||||
SOURCE_COMMIT_ID="$2"
|
||||
let "pu_checker|=0x2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Syntax Error: unknown option: $key"
|
||||
echo ""
|
||||
usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
done
|
||||
|
||||
if [ $jb_checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing job information."
|
||||
# TODO : list missing info
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $PU_TRIG -eq 1 ] && [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: trigger action incoherent."
|
||||
echo ""
|
||||
trigger_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $pu_checker -ne 3 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing push information."
|
||||
# TODO : list missing info
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
if [ $mr_checker -ne 15 ]
|
||||
then
|
||||
echo ""
|
||||
echo "Syntax Error: missing merge-request information."
|
||||
# TODO : list missing info
|
||||
echo ""
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "<!DOCTYPE html>" > ./build_results.html
|
||||
echo "<html class=\"no-js\" lang=\"en-US\">" >> ./build_results.html
|
||||
echo "<head>" >> ./build_results.html
|
||||
echo " <title>Build Results for $JOB_NAME job build #$BUILD_ID</title>" >> ./build_results.html
|
||||
echo " <base href = \"http://www.openairinterface.org/\" />" >> ./build_results.html
|
||||
echo "</head>" >> ./build_results.html
|
||||
echo "<body>" >> ./build_results.html
|
||||
echo " <table style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
|
||||
echo " <tr style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
|
||||
echo " <td style=\"border-collapse: collapse; border: none;\">" >> ./build_results.html
|
||||
echo " <a href=\"http://www.openairinterface.org/\">" >> ./build_results.html
|
||||
echo " <img src=\"/wp-content/uploads/2016/03/cropped-oai_final_logo2.png\" alt=\"\" border=\"none\" height=50 width=150>" >> ./build_results.html
|
||||
echo " </img>" >> ./build_results.html
|
||||
echo " </a>" >> ./build_results.html
|
||||
echo " </td>" >> ./build_results.html
|
||||
echo " <td style=\"border-collapse: collapse; border: none; vertical-align: center;\">" >> ./build_results.html
|
||||
echo " <b><font size = \"6\">Job Summary -- Job: $JOB_NAME -- Build-ID: $BUILD_ID</font></b>" >> ./build_results.html
|
||||
echo " </td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <br>" >> ./build_results.html
|
||||
echo " <table border = \"1\">" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >GIT Repository</td>" >> ./build_results.html
|
||||
echo " <td>$GIT_URL</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Job Trigger</td>" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td>Push Event</td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td>Merge-Request</td>" >> ./build_results.html; fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
if [ $PU_TRIG -eq 1 ]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Branch</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_BRANCH</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Commit ID</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
fi
|
||||
if [ $MR_TRIG -eq 1 ]
|
||||
then
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Source Branch</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_BRANCH</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Source Commit ID</td>" >> ./build_results.html
|
||||
echo " <td>$SOURCE_COMMIT_ID</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Target Branch</td>" >> ./build_results.html
|
||||
echo " <td>$TARGET_BRANCH</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Target Commit ID</td>" >> ./build_results.html
|
||||
echo " <td>$TARGET_COMMIT_ID</td>" >> ./build_results.html
|
||||
echo " </tr>" >> ./build_results.html
|
||||
fi
|
||||
echo " </table>" >> ./build_results.html
|
||||
echo " <h2>Build Summary</h2>" >> ./build_results.html
|
||||
|
||||
if [ -f ./oai_rules_result.txt ]
|
||||
then
|
||||
echo " <h3>OAI Coding / Formatting Guidelines Check</h3>" >> ./build_results.html
|
||||
echo " <table border = "1">" >> ./build_results.html
|
||||
echo " <tr>" >> ./build_results.html
|
||||
echo " <td bgcolor = \"lightcyan\" >Result:</td>" >> ./build_results.html
|
||||
NB_FILES=`cat ./oai_rules_result.txt`
|
||||
if [ $NB_FILES = "0" ]
|
||||
then
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All files in repository follow OAI rules. </td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"green\">All modified files in Merge-Request follow OAI rules.</td>" >> ./build_results.html; fi
|
||||
else
|
||||
if [ $PU_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES files in repository DO NOT follow OAI rules. </td>" >> ./build_results.html; fi
|
||||
if [ $MR_TRIG -eq 1 ]; then echo " <td bgcolor = \"orange\">$NB_FILES modified files in Merge-Request DO NOT follow OAI rules.</td>" >> ./build_results.html; fi
|
||||
fi
|
||||
echo " </tr>" >> ./build_results.html
|
||||
echo " </table>" >> ./build_results.html
|
||||
fi
|
||||
|
||||
sca_summary_table_header "OAI Static Code Analysis with CPPCHECK"
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized variable" uninitvar
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Uninitialized struct member" uninitStructMember
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory leak" memleak
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Memory is freed twice" doubleFree
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Resource leak" resourceLeak
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Possible null pointer dereference" nullPointer
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Array access out of bounds" arrayIndexOutOfBounds
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Buffer is accessed out of bounds" bufferAccessOutOfBounds
|
||||
sca_summary_table_row ./archives/cppcheck/cppcheck.xml "Expression depends on order of evaluation of side effects" unknownEvaluationOrder
|
||||
sca_summary_table_footer ./archives/cppcheck/cppcheck.xml
|
||||
|
||||
summary_table_header "OAI Build eNB -- USRP option"
|
||||
summary_table_row "LTE SoftModem - Release 14" ./archives/enb_usrp/lte-softmodem.Rel14.txt "Built target lte-softmodem" ./enb_usrp_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/enb_usrp/coding.Rel14.txt "Built target coding" ./enb_usrp_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/enb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./enb_usrp_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/enb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./enb_usrp_row4.html
|
||||
summary_table_footer
|
||||
|
||||
if [ -f ./archives/basic_sim/basic_simulator_enb.txt ]
|
||||
then
|
||||
summary_table_header "OAI Build basic simulator option"
|
||||
summary_table_row "Basic Simulator eNb - Release 14" ./archives/basic_sim/basic_simulator_enb.txt "Built target lte-softmodem" ./basic_sim_row1.html
|
||||
summary_table_row "Basic Simulator UE - Release 14" ./archives/basic_sim/basic_simulator_ue.txt "Built target lte-uesoftmodem" ./basic_sim_row2.html
|
||||
summary_table_row "Conf 2 UE data - Release 14" ./archives/basic_sim/conf2uedata.Rel14.txt "Built target conf2uedata" ./basic_sim_row3.html
|
||||
summary_table_footer
|
||||
fi
|
||||
|
||||
summary_table_header "OAI Build Physical simulators option"
|
||||
summary_table_row "DL Simulator - Release 14" ./archives/phy_sim/dlsim.Rel14.txt "Built target dlsim" ./phy_sim_row1.html
|
||||
summary_table_row "UL Simulator - Release 14" ./archives/phy_sim/ulsim.Rel14.txt "Built target ulsim" ./phy_sim_row2.html
|
||||
summary_table_row "Coding - Release 14" ./archives/phy_sim/coding.Rel14.txt "Built target coding" ./phy_sim_row3.html
|
||||
summary_table_footer
|
||||
|
||||
if [ -f archives/gnb_usrp/nr-softmodem.Rel14.txt ]
|
||||
then
|
||||
summary_table_header "OAI Build gNB -- USRP option"
|
||||
summary_table_row "LTE SoftModem - Release 15" ./archives/gnb_usrp/nr-softmodem.Rel14.txt "Built target nr-softmodem" ./gnb_usrp_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/gnb_usrp/coding.Rel14.txt "Built target coding" ./gnb_usrp_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/gnb_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./gnb_usrp_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/gnb_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./gnb_usrp_row4.html
|
||||
summary_table_footer
|
||||
fi
|
||||
|
||||
if [ -f archives/nrue_usrp/nr-uesoftmodem.Rel14.txt ]
|
||||
then
|
||||
summary_table_header "OAI Build 5G NR UE -- USRP option"
|
||||
summary_table_row "UE SoftModem - Release 15" ./archives/nrue_usrp/nr-uesoftmodem.Rel14.txt "Built target nr-uesoftmodem" ./nrue_usrp_row1.html
|
||||
summary_table_row "Coding - Release 14" ./archives/nrue_usrp/coding.Rel14.txt "Built target coding" ./nrue_usrp_row2.html
|
||||
summary_table_row "OAI USRP device if - Release 14" ./archives/nrue_usrp/oai_usrpdevif.Rel14.txt "Built target oai_usrpdevif" ./nrue_usrp_row3.html
|
||||
summary_table_row "Parameters Lib Config - Release 14" ./archives/nrue_usrp/params_libconfig.Rel14.txt "Built target params_libconfig" ./nrue_usrp_row4.html
|
||||
summary_table_footer
|
||||
fi
|
||||
|
||||
echo " <h3>Details</h3>" >> ./build_results.html
|
||||
|
||||
for DETAILS_TABLE in `ls ./enb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./basic_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./phy_sim_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./gnb_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
for DETAILS_TABLE in `ls ./nrue_usrp_row*.html`
|
||||
do
|
||||
cat $DETAILS_TABLE >> ./build_results.html
|
||||
done
|
||||
rm -f ./enb_usrp_row*.html ./basic_sim_row*.html ./phy_sim_row*.html ./gnb_usrp_row*.html ./nrue_usrp_row*.html
|
||||
|
||||
echo "</body>" >> ./build_results.html
|
||||
echo "</html>" >> ./build_results.html
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,27 @@
|
||||
<domain type='kvm'>
|
||||
<os>
|
||||
<type>hvm</type>
|
||||
<boot dev='hd'/>
|
||||
</os>
|
||||
<features>
|
||||
<acpi/>
|
||||
<apic/>
|
||||
<pae/>
|
||||
</features>
|
||||
<cpu mode='host-passthrough'>
|
||||
</cpu>
|
||||
<devices>
|
||||
<interface type='network'>
|
||||
<source network='default'/>
|
||||
<model type='virtio'/>
|
||||
</interface>
|
||||
<serial type='pty'>
|
||||
<source path='/dev/pts/3'/>
|
||||
<target port='0'/>
|
||||
</serial>
|
||||
<graphics type='vnc' autoport='yes' listen='127.0.0.1'>
|
||||
<listen type='address' address='127.0.0.1'/>
|
||||
</graphics>
|
||||
<video/>
|
||||
</devices>
|
||||
</domain>
|
||||
@@ -1275,7 +1275,12 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/nr_pbch.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/srs_modulation_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_TRANSPORT/dci_tools_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/ul_ref_seq_nr.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_dmrs_rx.c
|
||||
${OPENAIR1_DIR}/PHY/NR_REFSIG/nr_gold_ue.c
|
||||
${OPENAIR1_DIR}/PHY/NR_UE_ESTIMATION/nr_dl_channel_estimation.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/file_output.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lte_dfts.c
|
||||
@@ -1289,6 +1294,8 @@ set(PHY_SRC_UE
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/time_meas.c
|
||||
${OPENAIR1_DIR}/PHY/TOOLS/lut.c
|
||||
${OPENAIR1_DIR}/PHY/INIT/nr_init_ue.c
|
||||
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
|
||||
#${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_common_ue.c
|
||||
)
|
||||
|
||||
|
||||
@@ -2127,6 +2134,44 @@ target_link_libraries (lte-uesoftmodem-nos1 ${T_LIB})
|
||||
###################################################
|
||||
|
||||
add_executable(nr-softmodem
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-gnb.c
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-ru.c
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-softmodem.c
|
||||
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
|
||||
${OPENAIR_TARGETS}/COMMON/create_tasks.c
|
||||
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${GTPU_need_ITTI}
|
||||
${XFORMS_SOURCE}
|
||||
${XFORMS_SOURCE_SOFTMODEM}
|
||||
${T_SOURCE}
|
||||
${CONFIG_SOURCES}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
|
||||
target_link_libraries (nr-softmodem
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB}
|
||||
RRC_LIB S1AP_LIB S1AP_ENB L2
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
|
||||
target_link_libraries (nr-softmodem ${LIBXML2_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem pthread m ${CONFIG_LIBRARIES} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${NETTLE_LIBRARIES} sctp ${XFORMS_LIBRARIES} ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem ${LIB_LMS_LIBRARIES})
|
||||
target_link_libraries (nr-softmodem ${T_LIB})
|
||||
|
||||
# nr-softmodem-nos1
|
||||
###################################################
|
||||
|
||||
add_executable(nr-softmodem-nos1
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
@@ -2153,7 +2198,7 @@ add_executable(nr-softmodem
|
||||
target_link_libraries (nr-softmodem
|
||||
-Wl,--start-group
|
||||
UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_RU LFDS GTPV1U SECU_CN SECU_OSA
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB}
|
||||
${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${MIH_LIB}
|
||||
RRC_LIB S1AP_LIB S1AP_ENB L2
|
||||
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
-Wl,--end-group z dl)
|
||||
@@ -2204,7 +2249,7 @@ target_link_libraries (nr-uesoftmodem ${T_LIB})
|
||||
add_executable(nr-uesoftmodem-nos1
|
||||
${rrc_h}
|
||||
${s1ap_h}
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-ue.c
|
||||
${OPENAIR_TARGETS}/RT/USER/nr-uesoftmodem.c
|
||||
@@ -2488,7 +2533,7 @@ endforeach()
|
||||
# force castxml and clang compilation with gnu89 standard
|
||||
# we can't use cXX standard as pthread_rwlock_t is gnu standard
|
||||
list(APPEND itti_compiler_options "-std=gnu89")
|
||||
set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
|
||||
set (ITTI_H ${OPENAIR_DIR}/common/utils/T/T.h) #${ITTI_DIR}/intertask_interface_types.h)
|
||||
if(EXISTS /usr/bin/gccxml)
|
||||
set(xml_command gccxml ${itti_compiler_options} -fxml=${OPENAIR_BIN_DIR}/messages.xml ${ITTI_H})
|
||||
else()
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NFAPI_INTERFACE_NR_EXTENSION_H_
|
||||
#define _NFAPI_INTERFACE_NR_EXTENSION_H_
|
||||
#ifndef _NFAPI_INTERFACE_H_
|
||||
#define _NFAPI_INTERFACE_H_
|
||||
|
||||
#include "stddef.h"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,317 @@
|
||||
#ifndef _NFAPI_INTERFACE_NR_H_
|
||||
#define _NFAPI_INTERFACE_NR_H_
|
||||
|
||||
#include "nfapi_interface.h"
|
||||
|
||||
//These TLVs are used exclusively by nFAPI
|
||||
typedef struct
|
||||
{
|
||||
// These TLVs are used to setup the transport connection between VNF and PNF
|
||||
// nfapi_ipv4_address_t p7_vnf_address_ipv4;
|
||||
// nfapi_ipv6_address_t p7_vnf_address_ipv6;
|
||||
// nfapi_uint16_tlv_t p7_vnf_port;
|
||||
|
||||
// nfapi_ipv4_address_t p7_pnf_address_ipv4;
|
||||
// nfapi_ipv6_address_t p7_pnf_address_ipv6;
|
||||
// nfapi_uint16_tlv_t p7_pnf_port;
|
||||
|
||||
// // These TLVs are used to setup the transport connection between VNF and PNF
|
||||
// nfapi_uint8_tlv_t dl_ue_per_sf;
|
||||
// nfapi_uint8_tlv_t ul_ue_per_sf;
|
||||
|
||||
// These TLVs are used by PNF to report its RF capabilities to the VNF software
|
||||
nfapi_rf_bands_t rf_bands;
|
||||
|
||||
// These TLVs are used by the VNF to configure the synchronization with the PNF.
|
||||
// nfapi_uint8_tlv_t timing_window;
|
||||
// nfapi_uint8_tlv_t timing_info_mode;
|
||||
// nfapi_uint8_tlv_t timing_info_period;
|
||||
|
||||
// These TLVs are used by the VNF to configure the RF in the PNF
|
||||
// nfapi_uint16_tlv_t max_transmit_power;
|
||||
nfapi_uint16_tlv_t earfcn;
|
||||
|
||||
// nfapi_nmm_frequency_bands_t nmm_gsm_frequency_bands;
|
||||
// nfapi_nmm_frequency_bands_t nmm_umts_frequency_bands;
|
||||
// nfapi_nmm_frequency_bands_t nmm_lte_frequency_bands;
|
||||
// nfapi_uint8_tlv_t nmm_uplink_rssi_supported;
|
||||
|
||||
} nfapi_nr_nfapi_t;
|
||||
|
||||
#define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV4_TAG 0x5100
|
||||
#define NFAPI_NR_NFAPI_P7_VNF_ADDRESS_IPV6_TAG 0x5101
|
||||
#define NFAPI_NR_NFAPI_P7_VNF_PORT_TAG 0x5102
|
||||
#define NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV4_TAG 0x5103
|
||||
#define NFAPI_NR_NFAPI_P7_PNF_ADDRESS_IPV6_TAG 0x5104
|
||||
#define NFAPI_NR_NFAPI_P7_PNF_PORT_TAG 0x5105
|
||||
|
||||
#define NFAPI_NR_NFAPI_DOWNLINK_UES_PER_SUBFRAME_TAG 0x510A
|
||||
#define NFAPI_NR_NFAPI_UPLINK_UES_PER_SUBFRAME_TAG 0x510B
|
||||
#define NFAPI_NR_NFAPI_RF_BANDS_TAG 0x5114
|
||||
#define NFAPI_NR_NFAPI_TIMING_WINDOW_TAG 0x511E
|
||||
#define NFAPI_NR_NFAPI_TIMING_INFO_MODE_TAG 0x511F
|
||||
#define NFAPI_NR_NFAPI_TIMING_INFO_PERIOD_TAG 0x5120
|
||||
#define NFAPI_NR_NFAPI_MAXIMUM_TRANSMIT_POWER_TAG 0x5128
|
||||
#define NFAPI_NR_NFAPI_EARFCN_TAG 0x5129
|
||||
#define NFAPI_NR_NFAPI_NMM_GSM_FREQUENCY_BANDS_TAG 0x5130
|
||||
#define NFAPI_NR_NFAPI_NMM_UMTS_FREQUENCY_BANDS_TAG 0x5131
|
||||
#define NFAPI_NR_NFAPI_NMM_LTE_FREQUENCY_BANDS_TAG 0x5132
|
||||
#define NFAPI_NR_NFAPI_NMM_UPLINK_RSSI_SUPPORTED_TAG 0x5133
|
||||
|
||||
// P5 Message Structures
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t numerology_index_mu;
|
||||
nfapi_uint16_tlv_t duplex_mode;
|
||||
} nfapi_nr_subframe_config_t;
|
||||
|
||||
#define NFAPI_NR_SUBFRAME_CONFIG_DUPLEX_MODE_TAG 0x5001
|
||||
#define NFAPI_NR_SUBFRAME_CONFIG_PCFICH_POWER_OFFSET_TAG 0x5002
|
||||
#define NFAPI_NR_SUBFRAME_CONFIG_PB_TAG 0x5003
|
||||
#define NFAPI_NR_SUBFRAME_CONFIG_DL_CYCLIC_PREFIX_TYPE_TAG 0x5004
|
||||
#define NFAPI_NR_SUBFRAME_CONFIG_UL_CYCLIC_PREFIX_TYPE_TAG 0x5005
|
||||
#define NFAPI_NR_SUBFRAME_CONFIG_NUMEROLOGY_INDEX_MU_TAG 0x5006
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t tx_antenna_ports;
|
||||
nfapi_uint16_tlv_t rx_antenna_ports;
|
||||
} nfapi_nr_rf_config_t;
|
||||
|
||||
#define NFAPI_NR_RF_CONFIG_DL_CHANNEL_BANDWIDTH_TAG 0x500A
|
||||
#define NFAPI_NR_RF_CONFIG_UL_CHANNEL_BANDWIDTH_TAG 0x500B
|
||||
#define NFAPI_NR_RF_CONFIG_REFERENCE_SIGNAL_POWER_TAG 0x500C
|
||||
#define NFAPI_NR_RF_CONFIG_TX_ANTENNA_PORTS_TAG 0x500D
|
||||
#define NFAPI_NR_RF_CONFIG_RX_ANTENNA_PORTS_TAG 0x500E
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t physical_cell_id;
|
||||
nfapi_uint16_tlv_t half_frame_index;
|
||||
nfapi_uint16_tlv_t ssb_subcarrier_offset;
|
||||
nfapi_uint16_tlv_t ssb_position_in_burst;
|
||||
nfapi_uint16_tlv_t ssb_periodicity;
|
||||
nfapi_uint16_tlv_t ss_pbch_block_power;
|
||||
nfapi_uint16_tlv_t n_ssb_crb;
|
||||
} nfapi_nr_sch_config_t;
|
||||
|
||||
#define NFAPI_NR_SCH_CONFIG_PHYSICAL_CELL_ID_TAG 0x501E
|
||||
#define NFAPI_NR_SCH_CONFIG_HALF_FRAME_INDEX_TAG 0x501F
|
||||
#define NFAPI_NR_SCH_CONFIG_SSB_SUBCARRIER_OFFSET_TAG 0x5020
|
||||
#define NFAPI_NR_SCH_CONFIG_SSB_POSITION_IN_BURST 0x5021
|
||||
#define NFAPI_NR_SCH_CONFIG_SSB_PERIODICITY 0x5022
|
||||
#define NFAPI_NR_SCH_CONFIG_SS_PBCH_BLOCK_POWER 0x5023
|
||||
#define NFAPI_NR_SCH_CONFIG_N_SSB_CRB 0x5024
|
||||
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t prach_RootSequenceIndex; ///// L1 parameter 'PRACHRootSequenceIndex'
|
||||
nfapi_uint16_tlv_t prach_msg1_SubcarrierSpacing; ///// L1 parameter 'prach-Msg1SubcarrierSpacing'
|
||||
nfapi_uint16_tlv_t restrictedSetConfig;
|
||||
nfapi_uint16_tlv_t msg3_transformPrecoding; ///// L1 parameter 'msg3-tp'
|
||||
/////////////////--------------------NR RACH-ConfigGeneric--------------------/////////////////
|
||||
nfapi_uint16_tlv_t prach_ConfigurationIndex; ///// L1 parameter 'PRACHConfigurationIndex'
|
||||
nfapi_uint16_tlv_t prach_msg1_FDM; ///// L1 parameter 'prach-FDM'
|
||||
nfapi_uint16_tlv_t prach_msg1_FrequencyStart; ///// L1 parameter 'prach-frequency-start'
|
||||
nfapi_uint16_tlv_t zeroCorrelationZoneConfig;
|
||||
nfapi_uint16_tlv_t preambleReceivedTargetPower;
|
||||
} nfapi_nr_rach_config_t;
|
||||
|
||||
typedef struct {
|
||||
//NR FrequencyInfoDL
|
||||
nfapi_uint16_tlv_t absoluteFrequencySSB;
|
||||
nfapi_uint16_tlv_t ssb_SubcarrierOffset; ///// L1 parameter 'kssb'
|
||||
nfapi_uint16_tlv_t DL_FreqBandIndicatorNR;
|
||||
nfapi_uint16_tlv_t DL_absoluteFrequencyPointA; ///// L1 parameter 'offset-ref-low-scs-ref-PRB'
|
||||
//NR DL SCS-SpecificCarrier ///// L1 parameter 'offset-pointA-set'
|
||||
nfapi_uint16_tlv_t DL_offsetToCarrier; ///// L1 parameter 'offset-pointA-low-scs '
|
||||
nfapi_uint16_tlv_t DL_SCS_SubcarrierSpacing; ///// L1 parameter 'ref-scs'
|
||||
nfapi_uint16_tlv_t DL_SCS_SpecificCarrier_k0; ///// L1 parameter 'k0'
|
||||
nfapi_uint16_tlv_t DL_carrierBandwidth; ///// L1 parameter 'BW'
|
||||
} nfapi_nr_dl_frequencyinfo_t;
|
||||
|
||||
typedef struct {
|
||||
//NR BWP-DownlinkCommon
|
||||
nfapi_uint16_tlv_t DL_locationAndBandwidth; ///// L1 parameter 'DL-BWP-loc'
|
||||
nfapi_uint16_tlv_t DL_BWP_SubcarrierSpacing; ///// Corresponds to subcarrier spacing according to 38.211, Table 4.2-1
|
||||
nfapi_uint16_tlv_t DL_BWP_prefix_type;
|
||||
} nfapi_nr_bwp_dl_t;
|
||||
|
||||
typedef struct {
|
||||
//NR FrequencyInfoUL
|
||||
nfapi_uint16_tlv_t UL_FreqBandIndicatorNR;
|
||||
nfapi_uint16_tlv_t UL_absoluteFrequencyPointA; ///// L1 parameter 'offset-ref-low-scs-ref-PRB'
|
||||
nfapi_uint16_tlv_t UL_additionalSpectrumEmission;
|
||||
nfapi_uint16_tlv_t UL_p_Max;
|
||||
nfapi_uint16_tlv_t UL_frequencyShift7p5khz;
|
||||
//NR UL SCS-SpecificCarrier ///// L1 parameter 'offset-pointA-set'
|
||||
nfapi_uint16_tlv_t UL_offsetToCarrier; ///// L1 parameter 'offset-pointA-low-scs '
|
||||
nfapi_uint16_tlv_t UL_SCS_SubcarrierSpacing; ///// L1 parameter 'ref-scs'
|
||||
nfapi_uint16_tlv_t UL_SCS_SpecificCarrier_k0; ///// L1 parameter 'k0'
|
||||
nfapi_uint16_tlv_t UL_carrierBandwidth; ///// L1 parameter 'BW'
|
||||
} nfapi_nr_ul_frequencyinfo_t;
|
||||
|
||||
typedef struct {
|
||||
//NR BWP-UplinkCommon ///// L1 parameter 'initial-UL-BWP'
|
||||
nfapi_uint16_tlv_t UL_locationAndBandwidth; ///// L1 parameter 'DL-BWP-loc'
|
||||
nfapi_uint16_tlv_t UL_BWP_SubcarrierSpacing; ///// Corresponds to subcarrier spacing according to 38.211, Table 4.2-1
|
||||
nfapi_uint16_tlv_t UL_BWP_prefix_type;
|
||||
} nfapi_nr_bwp_ul_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t groupHoppingEnabledTransformPrecoding; ///// L1 parameter 'Group-hopping-enabled-Transform-precoding'
|
||||
nfapi_uint16_tlv_t msg3_DeltaPreamble; ///// L1 parameter 'Delta-preamble-msg3'
|
||||
nfapi_uint16_tlv_t p0_NominalWithGrant; ///// L1 parameter 'p0-nominal-pusch-withgrant'
|
||||
nfapi_uint16_tlv_t TimeDomainResourceAllocation_k2; ///// L1 parameter 'K2'
|
||||
nfapi_uint16_tlv_t TimeDomainResourceAllocation_mappingType; ///// L1 parameter 'Mapping-type'
|
||||
} nfapi_nr_pusch_config_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t pucch_GroupHopping; ///// L1 parameter 'PUCCH-GroupHopping'
|
||||
nfapi_uint16_tlv_t p0_nominal; ///// L1 parameter 'p0-nominal-pucch'
|
||||
} nfapi_nr_pucch_config_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t TimeDomainResourceAllocation_k0; ///// L1 parameter 'K0'
|
||||
nfapi_uint16_tlv_t TimeDomainResourceAllocation_mappingType; ///// L1 parameter 'Mapping-type'
|
||||
} nfapi_nr_pdsch_config_t;
|
||||
|
||||
typedef struct{
|
||||
nfapi_uint16_tlv_t controlResourceSetId; ///// L1 parameter 'CORESET-ID'
|
||||
nfapi_uint16_tlv_t frequencyDomainResources ///// L1 parameter 'CORESET-freq-dom'
|
||||
nfapi_uint16_tlv_t duration; ///// L1 parameter 'CORESET-time-duration'
|
||||
nfapi_uint16_tlv_t cce_REG_MappingType; ///// L1 parameter 'CORESET-CCE-REG-mapping-type'
|
||||
nfapi_uint16_tlv_t reg_BundleSize; ///// L1 parameter 'CORESET-REG-bundle-size'
|
||||
nfapi_uint16_tlv_t interleaverSize; ///// L1 parameter 'CORESET-interleaver-size'
|
||||
nfapi_uint16_tlv_t shiftIndex; ///// L1 parameter 'CORESET-shift-index'
|
||||
nfapi_uint16_tlv_t precoderGranularity; ///// L1 parameter 'CORESET-precoder-granuality'
|
||||
nfapi_uint16_tlv_t TCI_StateId; ///// L1 parameter 'TCI-StatesPDCCH'
|
||||
nfapi_uint16_tlv_t tci_PresentInDCI; ///// L1 parameter 'TCI-PresentInDCI'
|
||||
nfapi_uint16_tlv_t pdcch_DMRS_ScramblingID; ///// L1 parameter 'PDCCH-DMRS-Scrambling-ID'
|
||||
} nfapi_nr_pdcch_commonControlResourcesSets_t;
|
||||
|
||||
typedef struct{
|
||||
nfapi_uint16_tlv_t SearchSpaceId;
|
||||
nfapi_uint16_tlv_t commonSearchSpaces_controlResourceSetId;
|
||||
nfapi_uint16_tlv_t SearchSpace_monitoringSlotPeriodicityAndOffset; ///// L1 parameters 'Montoring-periodicity-PDCCH-slot'
|
||||
nfapi_uint16_tlv_t monitoringSymbolsWithinSlot ///// L1 parameter 'Montoring-symbols-PDCCH-within-slot'
|
||||
nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel1; ///// L1 parameter 'Aggregation-level-1'
|
||||
nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel2; ///// L1 parameter 'Aggregation-level-2'
|
||||
nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel4; ///// L1 parameter 'Aggregation-level-4'
|
||||
nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel8; ///// L1 parameter 'Aggregation-level-8'
|
||||
nfapi_uint16_tlv_t SearchSpace_nrofCandidates_aggregationLevel16; ///// L1 parameter 'Aggregation-level-16'
|
||||
nfapi_uint16_tlv_t Common_dci_Format2_0_nrofCandidates_SFI_And_aggregationLevel; ///// L1 parameters 'SFI-Num-PDCCH-cand' and 'SFI-Aggregation-Level'
|
||||
nfapi_uint16_tlv_t Common_dci_Format2_3_monitoringPeriodicity; ///// L1 parameter 'SRS-monitoring-periodicity'
|
||||
nfapi_uint16_tlv_t Common_dci_Format2_3_nrofPDCCH_Candidates; ///// L1 parameter 'SRS-Num-PDCCH-cand'
|
||||
nfapi_uint16_tlv_t ue_Specific__dci_Formats;
|
||||
} nfapi_nr_pdcch_commonSearchSpaces_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_nr_pdcch_commonControlResourcesSets_t commonControlResourcesSets;
|
||||
nfapi_nr_pfcch_commonSearchSpaces_t commonSearchSpaces;
|
||||
nfapi_uint16_tlv_t searchSpaceSIB1; ///// L1 parameter 'rmsi-SearchSpace'
|
||||
nfapi_uint16_tlv_t searchSpaceOtherSystemInformation; ///// L1 parameter 'osi-SearchSpace'
|
||||
nfapi_uint16_tlv_t pagingSearchSpace; ///// L1 parameter 'paging-SearchSpace'
|
||||
nfapi_uint16_tlv_t ra_SearchSpace; ///// L1 parameter 'ra-SearchSpace'
|
||||
nfapi_uint16_tlv_t rach_ra_ControlResourceSet; ///// L1 parameter 'rach-coreset-configuration'
|
||||
|
||||
} nfapi_nr_pdcch_common_config_t;
|
||||
|
||||
typedef struct {
|
||||
nfapi_uint16_tlv_t ssb_PositionsInBurst_PR; ///// L1 parameter 'SSB-Transmitted
|
||||
nfapi_uint16_tlv_t ssb_periodicityServingCell;
|
||||
nfapi_uint16_tlv_t dmrs_TypeA_Position; ///// Position of (first) DL DM-RS
|
||||
nfapi_uint16_tlv_t NIA_SubcarrierSpacing; ///// Used only for non-initial access (e.g. SCells, PCell of SCG)
|
||||
nfapi_uint16_tlv_t ss_PBCH_BlockPower;
|
||||
} nfapi_nr_servingcellconfigcommon_t;
|
||||
|
||||
typedef struct {
|
||||
//NR TDD-UL-DL-ConfigCommon ///// L1 parameter 'UL-DL-configuration-common'
|
||||
nfapi_uint16_tlv_t referenceSubcarrierSpacing; ///// L1 parameter 'reference-SCS'
|
||||
nfapi_uint16_tlv_t dl_UL_TransmissionPeriodicity; ///// L1 parameter 'DL-UL-transmission-periodicity'
|
||||
nfapi_uint16_tlv_t nrofDownlinkSlots; ///// L1 parameter 'number-of-DL-slots'
|
||||
nfapi_uint16_tlv_t nrofDownlinkSymbols; ///// L1 parameter 'number-of-DL-symbols-common'
|
||||
nfapi_uint16_tlv_t nrofUplinkSlots; ///// L1 parameter 'number-of-UL-slots'
|
||||
nfapi_uint16_tlv_t nrofUplinkSymbols; ///// L1 parameter 'number-of-UL-symbols-common'
|
||||
} nfapi_nr_tdd_ul_dl_config_t;
|
||||
|
||||
|
||||
typedef struct {
|
||||
//RateMatchPattern is used to configure one rate matching pattern for PDSCH ///// L1 parameter 'Resource-set-cekk'
|
||||
nfapi_uint16_tlv_t rateMatchPatternId;
|
||||
nfapi_uint16_tlv_t RateMatchPattern_patternType;
|
||||
nfapi_uint16_tlv_t symbolsInResourceBlock; ///// L1 parameter 'rate-match-PDSCH-bitmap2
|
||||
nfapi_uint16_tlv_t periodicityAndPattern; ///// L1 parameter 'rate-match-PDSCH-bitmap3'
|
||||
nfapi_uint16_tlv_t RateMatchPattern_controlResourceSet;
|
||||
nfapi_uint16_tlv_t RateMatchPattern_subcarrierSpacing; ///// L1 parameter 'resource-pattern-scs'
|
||||
nfapi_uint16_tlv_t RateMatchPattern_mode;
|
||||
} nfapi_nr_ratematchpattern_t;
|
||||
|
||||
typedef struct {
|
||||
//NR RateMatchPatternLTE-CRS
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_carrierFreqDL; ///// L1 parameter 'center-subcarrier-location'
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_carrierBandwidthDL; ///// L1 parameter 'BW'
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_nrofCRS_Ports; ///// L1 parameter 'rate-match-resources-numb-LTE-CRS-antenna-port'
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_v_Shift; ///// L1 parameter 'rate-match-resources-LTE-CRS-v-shift'
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_radioframeAllocationPeriod;
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_radioframeAllocationOffset;
|
||||
nfapi_uint16_tlv_t RateMatchPatternLTE_CRS_subframeAllocation_choice;
|
||||
} nfapi_nr_ratematchpattern_lte_crs_t;
|
||||
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
nfapi_p4_p5_message_header_t header;
|
||||
uint8_t num_tlv;
|
||||
nfapi_nr_subframe_config_t subframe_config;
|
||||
nfapi_nr_rf_config_t rf_config;
|
||||
nfapi_nr_sch_config_t sch_config;
|
||||
nfapi_nr_rach_config_t rach_config;
|
||||
nfapi_nr_dl_frequencyinfo_t dl_frequencyinfo;
|
||||
nfapi_nr_bwp_dl_t bwp_dl;
|
||||
nfapi_nr_ul_frequencyinfo_t ul_frequencyinfo;
|
||||
nfapi_nr_bwp_ul_t bwp_ul;
|
||||
nfapi_nr_pusch_config_t pusch_config;
|
||||
nfapi_nr_pucch_config_t pucch_config;
|
||||
nfapi_nr_pdsch_config_t pdsch_config;
|
||||
nfapi_nr_pucch_config_t pdcch_config;
|
||||
nfapi_nr_servingcellconfigcommon_t servingcellconfigcommon;
|
||||
nfapi_nr_tdd_ul_dl_config_t tdd_ul_dl_config;
|
||||
nfapi_nr_ratematchpattern_t ratematchpattern;
|
||||
nfapi_nr_ratematchpattern_lte_crs_t ratematchpattern_lte_crs;
|
||||
nfapi_nr_nfapi_t nfapi_config;
|
||||
|
||||
nfapi_vendor_extension_tlv_t vendor_extension;
|
||||
} nfapi_nr_config_request_t;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_DL_DCI_FORMAT_1_0 = 0,
|
||||
NFAPI_NR_DL_DCI_FORMAT_1_1,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_0,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_1,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_2,
|
||||
NFAPI_NR_DL_DCI_FORMAT_2_3,
|
||||
} nfapi_nr_dl_dci_format_e;
|
||||
|
||||
typedef enum {
|
||||
NFAPI_NR_UL_DCI_FORMAT_0_0 = 0,
|
||||
NFAPI_NR_UL_DCI_FORMAT_1_0,
|
||||
} nfapi_nr_ul_dci_format_e;
|
||||
|
||||
// P7 Sub Structures
|
||||
typedef struct {
|
||||
nfapi_tl_t tl;
|
||||
// conf
|
||||
uint8_t dci_format;
|
||||
uint8_t cce_idx;
|
||||
uint8_t aggregation_level;
|
||||
uint16_t rnti;
|
||||
// DCI fields
|
||||
|
||||
} nfapi_nr_dl_config_dci_dl_pdu_rel15_t;
|
||||
#define NFAPI_NR_DL_CONFIG_REQUEST_DCI_DL_PDU_REL15_TAG
|
||||
|
||||
typedef struct {
|
||||
nfapi_nr_dl_config_dci_dl_pdu_rel15_t dci_dl_pdu_rel15;
|
||||
} nfapi_nr_dl_config_dci_dl_pdu;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -18,5 +18,5 @@ alias oailte='cd $OPENAIR_TARGETS/RT/USER'
|
||||
alias oais='cd $OPENAIR_TARGETS/SIMU/USER'
|
||||
alias oaiex='cd $OPENAIR_TARGETS/SIMU/EXAMPLES'
|
||||
|
||||
export IIOD_REMOTE=192.168.121.32
|
||||
export IIOD_REMOTE=192.168.1.2
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ int slot_fep_pbch(PHY_VARS_NR_UE *ue,
|
||||
NR_UE_COMMON *common_vars = &ue->common_vars;
|
||||
uint8_t eNB_id = 0;//ue_common_vars->eNb_id;
|
||||
unsigned char aa;
|
||||
unsigned char symbol = l+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
|
||||
unsigned char symbol = l;//+((7-frame_parms->Ncp)*(Ns&1)); ///symbol within sub-frame
|
||||
unsigned int nb_prefix_samples = (no_prefix ? 0 : frame_parms->nb_prefix_samples);
|
||||
unsigned int nb_prefix_samples0 = (no_prefix ? 0 : frame_parms->nb_prefix_samples0);
|
||||
unsigned int subframe_offset;//,subframe_offset_F;
|
||||
@@ -181,7 +181,7 @@ int slot_fep_pbch(PHY_VARS_NR_UE *ue,
|
||||
}
|
||||
|
||||
if (ue->perfect_ce == 0) {
|
||||
if ((l==0) || (l==(4-frame_parms->Ncp))) {
|
||||
if ((l>0) && (l<4)) {
|
||||
for (aa=0; aa<frame_parms->nb_antenna_ports_eNB; aa++) {
|
||||
|
||||
#ifdef DEBUG_FEP
|
||||
@@ -190,11 +190,11 @@ int slot_fep_pbch(PHY_VARS_NR_UE *ue,
|
||||
#if UE_TIMING_TRACE
|
||||
start_meas(&ue->dlsch_channel_estimation_stats);
|
||||
#endif
|
||||
/* nr_pbch_channel_estimation(ue,eNB_id,0,
|
||||
nr_pbch_channel_estimation(ue,eNB_id,0,
|
||||
Ns,
|
||||
aa,
|
||||
l,
|
||||
symbol);*/
|
||||
symbol);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* 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_REFSIG/nr_dl_dmrs.c
|
||||
* \brief Top-level routines for generating DMRS from 38-211
|
||||
* \author
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email:
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
//#define DEBUG_DL_DMRS
|
||||
//#define NR_PBCH_DMRS_LENGTH_DWORD 5
|
||||
//#define NR_PBCH_DMRS_LENGTH 144
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "refsig_defs_ue.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "log.h"
|
||||
|
||||
/*Table 7.4.1.1.2-1/2 from 38.211 */
|
||||
int wf1[8][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1}};
|
||||
int wt1[8][2] = {{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1}};
|
||||
int wf2[12][2] = {{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,-1},{1,1},{1,1},{1,1},{1,-1},{1,1},{1,1}};
|
||||
int wt2[12][2] = {{1,1},{1,1},{1,1},{1,1},{1,1},{1,1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1},{1,-1}};
|
||||
|
||||
short nr_mod_table[14] = {0,0,23170,23170,-23170,-23170,23170,23170,23170,-23170,-23170,23170,-23170,-23170};
|
||||
//extern short nr_mod_table[NR_MOD_TABLE_SIZE_SHORT];
|
||||
|
||||
|
||||
int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
unsigned int ncp,
|
||||
unsigned int Ns,
|
||||
unsigned int nr_gold_pdsch[2][20][2][21],
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
int length_dmrs,
|
||||
unsigned short nb_pdsch_rb)
|
||||
{
|
||||
int32_t qpsk[4],nqpsk[4],*qpsk_p, n;
|
||||
int w,mprime,ind,l,ind_dword,ind_qpsk_symb,kp,lp, config_type, k;
|
||||
short pamp;
|
||||
|
||||
typedef int array_of_w[2];
|
||||
array_of_w *wf;
|
||||
array_of_w *wt;
|
||||
|
||||
config_type = 1;
|
||||
printf("dmrs config type %d port %d\n", config_type, p);
|
||||
|
||||
// Compute the correct pilot amplitude, sqrt_rho_b = Q3.13
|
||||
pamp = 23170; //ONE_OVER_SQRT2_Q15;
|
||||
|
||||
// This includes complex conjugate for channel estimation
|
||||
((short *)&qpsk[0])[0] = pamp;
|
||||
((short *)&qpsk[0])[1] = -pamp;
|
||||
((short *)&qpsk[1])[0] = -pamp;
|
||||
((short *)&qpsk[1])[1] = -pamp;
|
||||
((short *)&qpsk[2])[0] = pamp;
|
||||
((short *)&qpsk[2])[1] = pamp;
|
||||
((short *)&qpsk[3])[0] = -pamp;
|
||||
((short *)&qpsk[3])[1] = pamp;
|
||||
|
||||
((short *)&nqpsk[0])[0] = -pamp;
|
||||
((short *)&nqpsk[0])[1] = pamp;
|
||||
((short *)&nqpsk[1])[0] = pamp;
|
||||
((short *)&nqpsk[1])[1] = pamp;
|
||||
((short *)&nqpsk[2])[0] = -pamp;
|
||||
((short *)&nqpsk[2])[1] = -pamp;
|
||||
((short *)&nqpsk[3])[0] = pamp;
|
||||
((short *)&nqpsk[3])[1] = -pamp;
|
||||
|
||||
wf = (config_type==0) ? wf1 : wf2;
|
||||
wt = (config_type==0) ? wt1 : wt2;
|
||||
|
||||
if (config_type > 1)
|
||||
LOG_E(PHY,"Bad PDSCH DMRS config type %d\n", config_type);
|
||||
|
||||
if ((p>=1000) && (p<((config_type==0) ? 1008 : 1012))) {
|
||||
if (/*ue->frame_parms.Ncp == NORMAL*/ncp ==0) {
|
||||
|
||||
// r_n from 38.211 7.4.1.1
|
||||
for (n=0; n<nb_pdsch_rb*((config_type==0) ? 3:2); n++) {
|
||||
for (lp =0; lp<length_dmrs; lp++){
|
||||
for (kp=0; kp<2; kp++){
|
||||
w = (wf[p-1000][kp])*(wt[p-1000][lp]);
|
||||
qpsk_p = (w==1) ? qpsk : nqpsk;
|
||||
|
||||
ind = 2*n+kp;
|
||||
ind_dword = ind>>4;
|
||||
ind_qpsk_symb = ind&0xf;
|
||||
|
||||
output[k] = qpsk_p[(ue->nr_gold_pdsch[0][Ns][lp][ind_dword]>>(2*ind_qpsk_symb))&3];
|
||||
|
||||
|
||||
#ifdef DEBUG_DL_DMRS
|
||||
LOG_I(PHY,"Ns %d, p %d, ind_dword %d, ind_qpsk_symbol %d\n",
|
||||
Ns,p,idx_dword,idx_qpsk_symb);
|
||||
LOG_I(PHY,"index = %d\n",(nr_gold_pdsch[0][Ns][lprime][ind_dword]>>(2*ind_qpsk_symb))&3);
|
||||
#endif
|
||||
|
||||
k++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"extended cp not supported for PDSCH DMRS yet\n");
|
||||
}
|
||||
} else {
|
||||
LOG_E(PHY,"Illegal p %d PDSCH DMRS port\n",p);
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
int nr_pbch_dmrs_rx(unsigned int *nr_gold_pbch,
|
||||
int32_t *output )
|
||||
{
|
||||
int m;
|
||||
|
||||
/// BPSK modulation
|
||||
for (m=0; m<NR_PBCH_DMRS_LENGTH; m++) {
|
||||
((int16_t*)output)[m<<1] = nr_mod_table[((1 + ((nr_gold_pbch[m>>5]&(1<<(m&0x1f)))>>(m&0x1f)))<<1)];
|
||||
((int16_t*)output)[(m<<1)+1] = nr_mod_table[((1 + ((nr_gold_pbch[m>>5]&(1<<(m&0x1f)))>>(m&0x1f)))<<1) + 1];
|
||||
#ifdef DEBUG_PBCH
|
||||
//printf("nr_gold_pbch[m>>5] %x\n",nr_gold_pbch[m>>5]);
|
||||
if (m<6)
|
||||
printf("m %d output %d %d addr %p\n", m, output[2*m], output[2*m+1],&output[0]);
|
||||
#endif
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
/*
|
||||
* 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 "refsig_defs_ue.h"
|
||||
|
||||
void nr_gold_pbch(PHY_VARS_NR_UE* ue)
|
||||
{
|
||||
|
||||
unsigned int n, x1, x2;
|
||||
unsigned char Nid, i_ssb, i_ssb2;
|
||||
unsigned char Lmax, l, n_hf, N_hf;
|
||||
|
||||
Nid = ue->frame_parms.Nid_cell;
|
||||
|
||||
Lmax = 8; //(fp->dl_CarrierFreq < 3e9)? 4:8;
|
||||
N_hf = (Lmax == 4)? 2:1;
|
||||
|
||||
for (n_hf = 0; n_hf < N_hf; n_hf++) {
|
||||
|
||||
for (l = 0; l < Lmax ; l++) {
|
||||
i_ssb = l & (Lmax-1);
|
||||
i_ssb2 = (i_ssb<<2) + n_hf;
|
||||
|
||||
x1 = 1 + (1<<31);
|
||||
x2 = (1<<11) * (i_ssb2 + 1) * ((Nid>>2) + 1) + (1<<6) * (i_ssb2 + 1) + (Nid&3);
|
||||
x2 = x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
|
||||
// skip first 50 double words (1600 bits)
|
||||
for (n = 1; n < 50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
}
|
||||
|
||||
for (n=0; n<NR_PBCH_DMRS_LENGTH_DWORD; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
ue->nr_gold_pbch[n_hf][l][n] = x1 ^ x2;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,unsigned short lbar,unsigned int nr_gold_pdsch[2][20][2][21],unsigned int Nid_cell, unsigned short *n_idDMRS, unsigned short length_dmrs)
|
||||
{
|
||||
|
||||
unsigned char ns,l;
|
||||
unsigned int n,x1,x2,x2tmp0,x2tmp1, x2tmp2,x2s;
|
||||
int nscid;
|
||||
unsigned int nid;
|
||||
|
||||
/// to be updated from higher layer
|
||||
//unsigned short lbar = 0;
|
||||
|
||||
for (nscid=0; nscid<2; nscid++) {
|
||||
if (n_idDMRS)
|
||||
nid = n_idDMRS[nscid];
|
||||
else
|
||||
nid = Nid_cell;
|
||||
|
||||
for (ns=0; ns<20; ns++) {
|
||||
|
||||
for (l=0; l<length_dmrs; l++) {
|
||||
|
||||
x2tmp0 = ((14*ns+(lbar+l)+1)*((nid<<1)+1))<<17;
|
||||
x2 = (x2tmp0+(nid<<1))%(1<<31); //cinit
|
||||
|
||||
x1 = 1+ (1<<31);
|
||||
x2=x2 ^ ((x2 ^ (x2>>1) ^ (x2>>2) ^ (x2>>3))<<31);
|
||||
|
||||
// skip first 50 double words (1600 bits)
|
||||
for (n=1; n<50; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
//printf("x1 : %x, x2 : %x\n",x1,x2);
|
||||
}
|
||||
|
||||
for (n=0; n<14; n++) {
|
||||
x1 = (x1>>1) ^ (x1>>4);
|
||||
x1 = x1 ^ (x1<<31) ^ (x1<<28);
|
||||
x2 = (x2>>1) ^ (x2>>2) ^ (x2>>3) ^ (x2>>4);
|
||||
x2 = x2 ^ (x2<<31) ^ (x2<<30) ^ (x2<<29) ^ (x2<<28);
|
||||
nr_gold_pdsch[nscid][ns][l][n] = x1^x2;
|
||||
//printf("n=%d : c %x\n",n,x1^x2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* Definitions for LTE Reference signals */
|
||||
/* Author R. Knopp / EURECOM / OpenAirInterface.org */
|
||||
#ifndef __NR_REFSIG_DEFS__H__
|
||||
#define __NR_REFSIG_DEFS__H__
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
|
||||
|
||||
/*!\brief This function generates the NR Gold sequence (38-211, Sec 5.2.1) for the PBCH DMRS.
|
||||
@param PHY_VARS_NR_UE* ue structure provides configuration, frame parameters and the pointers to the 32 bits sequence storage tables
|
||||
*/
|
||||
int nr_pbch_dmrs_rx(unsigned int *nr_gold_pbch, int32_t *output );
|
||||
|
||||
/*int nr_pdsch_dmrs_rx(PHY_VARS_NR_UE *ue,
|
||||
unsigned int ncp,
|
||||
unsigned int Ns,
|
||||
unsigned int nr_gold_pdsch[2][20][2][21],
|
||||
int32_t *output,
|
||||
unsigned short p,
|
||||
int length_dmrs,
|
||||
unsigned short nb_pdsch_rb);*/
|
||||
|
||||
void nr_gold_pbch(PHY_VARS_NR_UE* ue);
|
||||
|
||||
void nr_gold_pdsch(PHY_VARS_NR_UE* ue,
|
||||
unsigned short lbar,
|
||||
unsigned int nr_gold_pdsch[2][20][2][21],
|
||||
unsigned int Nid_cell,
|
||||
unsigned short *n_idDMRS,
|
||||
unsigned short length_dmrs);
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_TRANSPORT/nr_dci.c
|
||||
* \brief Implements DCI encoding/decoding (38.212/38.213/38.214). Current NR compliance V15.1 2018-06.
|
||||
* \author Guy De Souza
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: desouza@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "nr_dci.h"
|
||||
|
||||
uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
nr_rnti_type_e rnti,
|
||||
NR_BWP_PARMS* bwp,
|
||||
nfapi_nr_config_request_t* config)
|
||||
{
|
||||
uint8_t size = 0;
|
||||
uint16_t N_RB = bwp->N_RB;
|
||||
|
||||
switch(format) {
|
||||
|
||||
case nr_dci_format_0_0:
|
||||
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 --16
|
||||
size += 16;
|
||||
size += ceil( log2( (N_RB*(N_RB+1))>>2 ) ); // Freq domain assignment -- hopping scenario to be updated
|
||||
// Time domain assignment
|
||||
// UL/SUL indicator
|
||||
break;
|
||||
|
||||
case nr_dci_format_0_1:
|
||||
/// fixed: Format identifier 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2, SRS request 2 --17
|
||||
size += 17;
|
||||
// Carrier indicator
|
||||
// UL/SUL indicator
|
||||
// BWP Indicator
|
||||
// Freq domain assignment
|
||||
// Time domain assignment
|
||||
// VRB to PRB mapping
|
||||
// Frequency Hopping flag
|
||||
// 1st DAI
|
||||
// 2nd DAI
|
||||
// SRS resource indicator
|
||||
// Precoding info and number of layers
|
||||
// Antenna ports
|
||||
// CSI request
|
||||
// CBGTI
|
||||
// PTRS - DMRS association
|
||||
// beta offset indicator
|
||||
// DMRS sequence init
|
||||
break;
|
||||
|
||||
case nr_dci_format_1_0:
|
||||
/// fixed: Format identifier 1, VRB2PRB 1, MCS 5, NDI 1, RV 2, HARQ PID 4, DAI 2, PUCCH TPC 2, PUCCH RInd 3, PDSCH to HARQ TInd 3 --24
|
||||
size += 24;
|
||||
size += ceil( log2( (N_RB*(N_RB+1))>>2 ) ); // Freq domain assignment
|
||||
// Time domain assignment
|
||||
break;
|
||||
|
||||
case nr_dci_format_1_1:
|
||||
// Carrier indicator
|
||||
size += 1; // Format identifier
|
||||
// BWP Indicator
|
||||
// Freq domain assignment
|
||||
// Time domain assignment
|
||||
// VRB to PRB mapping
|
||||
// PRB bundling size indicator
|
||||
// Rate matching indicator
|
||||
// ZP CSI-RS trigger
|
||||
/// TB1- MCS 5, NDI 1, RV 2
|
||||
size += 8;
|
||||
// TB2
|
||||
size += 4 ; // HARQ PID
|
||||
// DAI
|
||||
size += 2; // TPC PUCCH
|
||||
size += 3; // PUCCH resource indicator
|
||||
size += 3; // PDSCH to HARQ timing indicator
|
||||
// Antenna ports
|
||||
// Tx Config Indication
|
||||
size += 2; // SRS request
|
||||
// CBGTI
|
||||
// CBGFI
|
||||
size += 1; // DMRS sequence init
|
||||
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_0:
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_1:
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_2:
|
||||
break;
|
||||
|
||||
case nr_dci_format_2_3:
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid NR DCI format %d\n", format);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc,
|
||||
int32_t** txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
nfapi_config_request_t* config)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
#ifndef __PHY_NR_TRANSPORT_DCI__H
|
||||
#define __PHY_NR_TRANSPORT_DCI__H
|
||||
|
||||
#include "defs_gNB.h"
|
||||
|
||||
|
||||
typedef enum {
|
||||
nr_dci_format_0_0=0,
|
||||
nr_dci_format_0_1,
|
||||
nr_dci_format_2_0,
|
||||
nr_dci_format_2_1,
|
||||
nr_dci_format_2_2,
|
||||
nr_dci_format_2_3,
|
||||
nr_dci_format_1_0,
|
||||
nr_dci_format_1_1,
|
||||
} nr_dci_format_e;
|
||||
|
||||
typedef enum {
|
||||
nr_rnti_type_SI_RNTI=0,
|
||||
nr_rnti_type_RA_RNTI,
|
||||
nr_rnti_type_C_RNTI,
|
||||
nr_rnti_type_TC_RNTI,
|
||||
nr_rnti_type_CS_RNTI,
|
||||
nr_rnti_type_P_RNTI
|
||||
} nr_rnti_type_e;
|
||||
|
||||
|
||||
typedef struct {
|
||||
/// Length of DCI in bits
|
||||
uint8_t size;
|
||||
/// Aggregation level
|
||||
uint8_t L;
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
/// rnti
|
||||
nr_rnti_type_e rnti;
|
||||
/// Format
|
||||
DCI_format_t format;
|
||||
/// DCI pdu
|
||||
uint8_t dci_pdu[8];
|
||||
} NR_DCI_ALLOC_t;
|
||||
|
||||
|
||||
uint8_t nr_get_dci_size(nr_dci_format_e format,
|
||||
nr_rnti_type_e rnti,
|
||||
NR_BWP_PARMS bwp,
|
||||
nfapi_nr_config_request_t* config);
|
||||
|
||||
uint8_t nr_generate_dci_top(NR_DCI_ALLOC_t dci_alloc,
|
||||
int32_t** txdataF,
|
||||
int16_t amp,
|
||||
NR_DL_FRAME_PARMS* frame_parms,
|
||||
nfapi_config_request_t* config)
|
||||
|
||||
#endif //__PHY_NR_TRANSPORT_DCI__H
|
||||
@@ -207,7 +207,7 @@ int nr_generate_pbch(NR_gNB_PBCH *pbch,
|
||||
mod_pbch_e[(i<<1)+1] = nr_mod_table[((NR_MOD_TABLE_QPSK_OFFSET + idx)<<1)+1];
|
||||
|
||||
#ifdef DEBUG_PBCH
|
||||
printf("i %d mod_pbch %d %d\n", i, mod_pbch_e[2*i], mod_pbch_e[2*i+1]);
|
||||
printf("i %d idx %d mod_pbch %d %d\n", i, idx, mod_pbch_e[2*i], mod_pbch_e[2*i+1]);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/NR_TRANSPORT/nr_pdcch.c
|
||||
* \brief Implements PDCCH physical channel TX/RX procedures (38.211). Current NR compliance V15.1 2018-06.
|
||||
* \author Guy De Souza
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: desouza@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
|
||||
#include "nr_dci.h"
|
||||
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
short filt16a_l0[16] = {
|
||||
16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r0[16] = {
|
||||
0,0,0,0,0,4096,8192,12288,16384,20480,24576,28672,0,0,0,0};
|
||||
|
||||
short filt16a_m0[16] = {
|
||||
0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,-12288,0,0,0,0};
|
||||
|
||||
short filt16a_l1[16] = {
|
||||
20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r1[16] = {
|
||||
0,0,0,0,0,0,4096,8192,12288,16384,20480,24576,0,0,0,0};
|
||||
|
||||
short filt16a_m1[16] = {
|
||||
-4096,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,-8192,0,0,0,0};
|
||||
|
||||
short filt16a_l2[16] = {
|
||||
24576,20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r2[16] = {
|
||||
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
|
||||
|
||||
short filt16a_m2[16] = {
|
||||
-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,-4096,0,0,0,0};
|
||||
|
||||
short filt16a_l3[16] = {
|
||||
28672,24576,20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r3[16] = {
|
||||
0,0,0,0,0,0,0,0,4096,8192,12288,16384,0,0,0,0};
|
||||
|
||||
short filt16a_m3[16] = {
|
||||
-12288,-8192,-4096,0,4096,8192,12288,16384,12288,8192,4096,0,0,0,0,0};
|
||||
|
||||
short filt16a_l0_dc[16] = {
|
||||
16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r0_dc[16] = {
|
||||
0,0,0,0,0,3276,9830,13107,16384,19660,22937,26214,0,0,0,0};
|
||||
|
||||
short filt16a_m0_dc[16] = {
|
||||
0,4096,8192,12288,16384,13107,6553,3276,0,-3277,-6554,-9831,0,0,0,0};
|
||||
|
||||
short filt16a_l1_dc[16] = {
|
||||
16384,12288,8192,4096,0,-4096,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r1_dc[16] = {
|
||||
0,0,0,0,0,0,6553,9830,13107,16384,19660,22937,0,0,0,0};
|
||||
|
||||
short filt16a_m1_dc[16] = {
|
||||
-4096,0,4096,8192,12288,16384,9830,6553,3276,0,-3277,-6554,0,0,0,0};
|
||||
|
||||
short filt16a_l2_dc[16] = {
|
||||
26214,22937,19660,16384,13107,9830,6553,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r2_dc[16] = {
|
||||
0,0,0,0,0,0,0,4096,8192,12288,16384,20480,0,0,0,0};
|
||||
|
||||
short filt16a_m2_dc[16] = {
|
||||
-6554,-3277,0,3276,6553,6553,16384,12288,8192,4096,0,-4096,0,0,0,0};
|
||||
|
||||
short filt16a_l3_dc[16] = {
|
||||
26214,22937,19660,16384,13107,9830,3276,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_r3_dc[16] = {
|
||||
0,0,0,0,0,0,0,0,4096,8192,12288,16384,0,0,0,0};
|
||||
|
||||
short filt16a_m3_dc[16] = {
|
||||
-9831,-6554,-3277,0,3276,6553,9830,16384,12288,8192,4096,0,0,0,0,0};
|
||||
|
||||
short filt16a_1[16] = {
|
||||
16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384,16384};
|
||||
|
||||
short filt16a_2l0[16] = {
|
||||
16384,12288,8192,4096,-4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_2r0[16] = {
|
||||
0,4096,8192,12288,16384,20480,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_2l1[16] = {
|
||||
20480,16384,12288,8192,4096,0,0,0,0,0,0,0,0,0,0,0};
|
||||
|
||||
short filt16a_2r1[16] = {
|
||||
-4096,0,4096,8192,12288,16384,0,0,0,0,0,0,0,0,0,0};
|
||||
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#ifdef USER_MODE
|
||||
#include <string.h>
|
||||
#endif
|
||||
//#include "defs.h"
|
||||
//#include "SCHED/defs.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "filt16a_32.h"
|
||||
#include "T.h"
|
||||
#define DEBUG_CH
|
||||
|
||||
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_id,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char p,
|
||||
unsigned char l,
|
||||
unsigned char symbol)
|
||||
{
|
||||
int pilot[2][200] __attribute__((aligned(16)));
|
||||
unsigned char aarx;
|
||||
unsigned short k;
|
||||
unsigned int pilot_cnt;
|
||||
int16_t ch[2],*pil,*rxF,*dl_ch,*fl,*fm,*f2l,*fr,f1,*f2r,*fl_dc,*fm_dc,*fr_dc;
|
||||
int ch_offset,symbol_offset;
|
||||
|
||||
uint16_t Nid_cell = (eNB_offset == 0) ? ue->frame_parms.Nid_cell : ue->measurements.adj_cell_id[eNB_offset-1];
|
||||
|
||||
uint8_t nushift;
|
||||
uint8_t previous_thread_id = ue->current_thread_id[Ns>>1]==0 ? (RX_NB_TH-1):(ue->current_thread_id[Ns>>1]-1);
|
||||
int **dl_ch_estimates =ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].dl_ch_estimates[eNB_offset];
|
||||
int **rxdataF=ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[Ns>>1]].rxdataF;
|
||||
|
||||
|
||||
// recompute nushift with eNB_offset corresponding to adjacent eNB on which to perform channel estimation
|
||||
nushift = Nid_cell%4;
|
||||
|
||||
if (ue->high_speed_flag == 0) // use second channel estimate position for temporary storage
|
||||
ch_offset = ue->frame_parms.ofdm_symbol_size ;
|
||||
else
|
||||
ch_offset = ue->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
symbol_offset = ue->frame_parms.ofdm_symbol_size*symbol;
|
||||
|
||||
k = nushift;
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("PBCH Channel Estimation : ThreadId %d, eNB_offset %d cell_id %d ch_offset %d, OFDM size %d, Ncp=%d, l=%d, Ns=%d, k=%d symbol %d\n",ue->current_thread_id[Ns>>1], eNB_offset,Nid_cell,ch_offset,ue->frame_parms.ofdm_symbol_size,
|
||||
ue->frame_parms.Ncp,l,Ns,k, symbol);
|
||||
#endif
|
||||
|
||||
switch (k) {
|
||||
case 0:
|
||||
fl = filt16a_l0;
|
||||
fm = filt16a_m0;
|
||||
fr = filt16a_r0;
|
||||
fl_dc = filt16a_l0;
|
||||
fm_dc = filt16a_m0;
|
||||
fr_dc = filt16a_r0;
|
||||
f1 = filt16a_1;
|
||||
f2l = filt16a_2l0;
|
||||
f2r = filt16a_2r0;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
fl = filt16a_l1;
|
||||
fm = filt16a_m1;
|
||||
fr = filt16a_r1;
|
||||
fl_dc = filt16a_l1;
|
||||
fm_dc = filt16a_m1;
|
||||
fr_dc = filt16a_r1;
|
||||
f1 = filt16a_1;
|
||||
f2l = filt16a_2l1;
|
||||
f2r = filt16a_2r1;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
fl = filt16a_l2;
|
||||
fm = filt16a_m2;
|
||||
fr = filt16a_r2;
|
||||
fl_dc = filt16a_l2;
|
||||
fm_dc = filt16a_m2;
|
||||
fr_dc = filt16a_r2;
|
||||
f1 = filt16a_1;
|
||||
f2l = filt16a_2l0;
|
||||
f2r = filt16a_2r0;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
fl = filt16a_l3;
|
||||
fm = filt16a_m3;
|
||||
fr = filt16a_r3;
|
||||
fl_dc = filt16a_l3;
|
||||
fm_dc = filt16a_m3;
|
||||
fr_dc = filt16a_r3;
|
||||
f1 = filt16a_1;
|
||||
f2l = filt16a_2l1;
|
||||
f2r = filt16a_2r1;
|
||||
break;
|
||||
|
||||
default:
|
||||
msg("pbch_channel_estimation: k=%d -> ERROR\n",k);
|
||||
return(-1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// generate pilot
|
||||
nr_pbch_dmrs_rx(ue->nr_gold_pbch,
|
||||
&pilot[p][0]);
|
||||
|
||||
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
|
||||
|
||||
pil = (int16_t *)&pilot[p][0];
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k+(ue->frame_parms.ofdm_symbol_size-10*12))];
|
||||
dl_ch = (int16_t *)&dl_ch_estimates[(p<<1)+aarx][ch_offset];
|
||||
|
||||
memset(dl_ch,0,4*(ue->frame_parms.ofdm_symbol_size));
|
||||
if (ue->high_speed_flag==0) // multiply previous channel estimate by ch_est_alpha
|
||||
multadd_complex_vector_real_scalar(dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),
|
||||
ue->ch_est_alpha,dl_ch-(ue->frame_parms.ofdm_symbol_size<<1),
|
||||
1,ue->frame_parms.ofdm_symbol_size);
|
||||
#ifdef DEBUG_CH
|
||||
printf("ch est pilot addr %p RB_DL %d\n",&pilot[p][0], ue->frame_parms.N_RB_DL);
|
||||
printf("k %d, first_carrier %d\n",k,ue->frame_parms.first_carrier_offset);
|
||||
printf("rxF addr %p\n", rxF);
|
||||
printf("dl_ch addr %p\n",dl_ch);
|
||||
#endif
|
||||
if ((ue->frame_parms.N_RB_DL&1)==0) {
|
||||
|
||||
// Treat first 2 pilots specially (left edge)
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("ch 0 %d\n",((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1]));
|
||||
printf("pilot 0 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
for (int i= 0; i<8; i++)
|
||||
printf("dl_ch addr %p %d\n", dl_ch+i, *(dl_ch+i));
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
//printf("after dl_ch %d %d\n", dl_ch, *(dl_ch));
|
||||
//for (int i= 0; i<16; i++)
|
||||
// printf("dl_ch %d %d\n", dl_ch+i, *(dl_ch+i));
|
||||
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
printf("pilot 2 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
dl_ch+=24;
|
||||
|
||||
for (pilot_cnt=3; pilot_cnt<(3*20); pilot_cnt+=3) {
|
||||
|
||||
if (pilot_cnt == 30)
|
||||
rxF = (int16_t *)&rxdataF[aarx][(symbol_offset+k)];
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
//printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fl,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
|
||||
//for (int i= 0; i<8; i++)
|
||||
// printf("pilot_cnt %d dl_ch %d %d\n", pilot_cnt, dl_ch+i, *(dl_ch+i));
|
||||
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
#ifdef DEBUG_CH
|
||||
//printf("pilot %d : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",pilot_cnt+1,rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
multadd_real_vector_complex_scalar(fm,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
|
||||
ch[0] = (int16_t)(((int32_t)pil[0]*rxF[0] - (int32_t)pil[1]*rxF[1])>>15);
|
||||
ch[1] = (int16_t)(((int32_t)pil[0]*rxF[1] + (int32_t)pil[1]*rxF[0])>>15);
|
||||
|
||||
#ifdef DEBUG_CH
|
||||
// printf("pilot 1 : rxF - > (%d,%d) ch -> (%d,%d), pil -> (%d,%d) \n",rxF[0],rxF[1],ch[0],ch[1],pil[0],pil[1]);
|
||||
#endif
|
||||
|
||||
multadd_real_vector_complex_scalar(fr,
|
||||
ch,
|
||||
dl_ch,
|
||||
16);
|
||||
pil+=2;
|
||||
rxF+=8;
|
||||
dl_ch+=24;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
printf("finish dl_ch addr %p\n", dl_ch);
|
||||
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
#ifndef __LTE_ESTIMATION_DEFS__H__
|
||||
#define __LTE_ESTIMATION_DEFS__H__
|
||||
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
/** @addtogroup _PHY_PARAMETER_ESTIMATION_BLOCKS_
|
||||
* @{
|
||||
*/
|
||||
|
||||
/*!\brief Timing drift hysterisis in samples*/
|
||||
#define SYNCH_HYST 2
|
||||
|
||||
/*!
|
||||
\brief This function performs channel estimation including frequency and temporal interpolation
|
||||
\param phy_vars_ue Pointer to UE PHY variables
|
||||
\param eNB_id Index of target eNB
|
||||
\param eNB_offset Offset for interfering eNB (in terms cell ID mod 3)
|
||||
\param Ns slot number (0..19)
|
||||
\param p antenna port
|
||||
\param l symbol within slot
|
||||
\param symbol symbol within frame
|
||||
*/
|
||||
int nr_dl_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_id,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char p,
|
||||
unsigned char l,
|
||||
unsigned char symbol);
|
||||
|
||||
int nr_pbch_channel_estimation(PHY_VARS_NR_UE *ue,
|
||||
uint8_t eNB_id,
|
||||
uint8_t eNB_offset,
|
||||
unsigned char Ns,
|
||||
unsigned char p,
|
||||
unsigned char l,
|
||||
unsigned char symbol);
|
||||
#endif
|
||||
Executable
+6438
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file PHY/LTE_TRANSPORT/dci_nr.h
|
||||
* \brief typedefs for NR DCI structures from 38-212.
|
||||
* \author R. Knopp, A. Mico Pereperez
|
||||
* \date 2018
|
||||
* \version 0.1
|
||||
* \company Eurecom
|
||||
* \email: knopp@eurecom.fr
|
||||
* \note
|
||||
* \warning
|
||||
*/
|
||||
#ifndef USER_MODE
|
||||
#include "PHY/types.h"
|
||||
#else
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define MAX_DCI_SIZE_BITS 45
|
||||
|
||||
|
||||
#define NR_PDCCH_DCI_H
|
||||
#ifdef NR_PDCCH_DCI_H
|
||||
struct NR_DCI_INFO_EXTRACTED {
|
||||
uint8_t carrier_ind ; // 0 CARRIER_IND: 0 or 3 bits, as defined in Subclause x.x of [5, TS38.213]
|
||||
uint8_t sul_ind_0_1 ; // 1 SUL_IND_0_1:
|
||||
uint8_t identifier_dci_formats ; // 2 IDENTIFIER_DCI_FORMATS:
|
||||
uint8_t slot_format_ind ; // 3 SLOT_FORMAT_IND: size of DCI format 2_0 is configurable by higher layers up to 128 bits, according to Subclause 11.1.1 of [5, TS 38.213]
|
||||
uint8_t pre_emption_ind ; // 4 PRE_EMPTION_IND: size of DCI format 2_1 is configurable by higher layers up to 126 bits, according to Subclause 11.2 of [5, TS 38.213]. Each pre-emption indication is 14 bits
|
||||
uint8_t tpc_cmd_number ; // 5 TPC_CMD_NUMBER: The parameter xxx provided by higher layers determines the index to the TPC command number for an UL of a cell. Each TPC command number is 2 bits
|
||||
uint8_t block_number ; // 6 BLOCK_NUMBER: starting position of a block is determined by the parameter startingBitOfFormat2_3
|
||||
uint8_t bandwidth_part_ind ; // 7 BANDWIDTH_PART_IND:
|
||||
uint16_t freq_dom_resource_assignment_UL; // 8 FREQ_DOM_RESOURCE_ASSIGNMENT_UL: PUSCH hopping with resource allocation type 1 not considered
|
||||
// (NOTE 1) If DCI format 0_0 is monitored in common search space
|
||||
// and if the number of information bits in the DCI format 0_0 prior to padding
|
||||
// is larger than the payload size of the DCI format 1_0 monitored in common search space
|
||||
// the bitwidth of the frequency domain resource allocation field in the DCI format 0_0
|
||||
// is reduced such that the size of DCI format 0_0 equals to the size of the DCI format 1_0
|
||||
uint16_t freq_dom_resource_assignment_DL; // 9 FREQ_DOM_RESOURCE_ASSIGNMENT_DL:
|
||||
uint8_t time_dom_resource_assignment ; // 10 TIME_DOM_RESOURCE_ASSIGNMENT: 0, 1, 2, 3, or 4 bits as defined in Subclause 6.1.2.1 of [6, TS 38.214]. The bitwidth for this field is determined as log2(I) bits,
|
||||
// where I the number of entries in the higher layer parameter pusch-AllocationList
|
||||
uint8_t vrb_to_prb_mapping ; // 11 VRB_TO_PRB_MAPPING: 0 bit if only resource allocation type 0
|
||||
uint8_t prb_bundling_size_ind ; // 12 PRB_BUNDLING_SIZE_IND:0 bit if the higher layer parameter PRB_bundling is not configured or is set to 'static', or 1 bit if the higher layer parameter PRB_bundling is set to 'dynamic' according to Subclause 5.1.2.3 of [6, TS 38.214]
|
||||
uint8_t rate_matching_ind ; // 13 RATE_MATCHING_IND: 0, 1, or 2 bits according to higher layer parameter rate-match-PDSCH-resource-set
|
||||
uint8_t zp_csi_rs_trigger ; // 14 ZP_CSI_RS_TRIGGER:
|
||||
uint8_t freq_hopping_flag ; // 15 FREQ_HOPPING_FLAG: 0 bit if only resource allocation type 0
|
||||
uint8_t tb1_mcs ; // 16 TB1_MCS:
|
||||
uint8_t tb1_ndi ; // 17 TB1_NDI:
|
||||
uint8_t tb1_rv ; // 18 TB1_RV:
|
||||
uint8_t tb2_mcs ; // 19 TB2_MCS:
|
||||
uint8_t tb2_ndi ; // 20 TB2_NDI:
|
||||
uint8_t tb2_rv ; // 21 TB2_RV:
|
||||
uint8_t mcs ; // 22 MCS:
|
||||
uint8_t ndi ; // 23 NDI:
|
||||
uint8_t rv ; // 24 RV:
|
||||
uint8_t harq_process_number ; // 25 HARQ_PROCESS_NUMBER:
|
||||
uint8_t dai ; // 26 DAI: For format1_1: 4 if more than one serving cell are configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 MSB bits are the counter DAI and the 2 LSB bits are the total DAI
|
||||
// 2 if one serving cell is configured in the DL and the higher layer parameter HARQ-ACK-codebook=dynamic, where the 2 bits are the counter DAI
|
||||
// 0 otherwise
|
||||
uint8_t first_dai ; // 27 FIRST_DAI: (1 or 2 bits) 1 bit for semi-static HARQ-ACK
|
||||
uint8_t second_dai ; // 28 SECOND_DAI: (0 or 2 bits) 2 bits for dynamic HARQ-ACK codebook with two HARQ-ACK sub-codebooks
|
||||
uint8_t tpc_pusch ; // 29 TPC_PUSCH:
|
||||
uint8_t tpc_pucch ; // 30 TPC_PUCCH:
|
||||
uint8_t pucch_resource_ind ; // 31 PUCCH_RESOURCE_IND:
|
||||
uint8_t pdsch_to_harq_feedback_time_ind ; // 32 PDSCH_TO_HARQ_FEEDBACK_TIME_IND:
|
||||
uint8_t short_message_ind ; // 33 SHORT_MESSAGE_IND: 1 bit if crc scrambled with P-RNTI
|
||||
uint8_t srs_resource_ind ; // 34 SRS_RESOURCE_IND:
|
||||
uint8_t precod_nbr_layers ; // 35 PRECOD_NBR_LAYERS:
|
||||
uint8_t antenna_ports ; // 36 ANTENNA_PORTS:
|
||||
uint8_t tci ; // 37 TCI: 0 bit if higher layer parameter tci-PresentInDCI is not enabled; otherwise 3 bits
|
||||
uint8_t srs_request ; // 38 SRS_REQUEST:
|
||||
uint8_t tpc_cmd_number_format2_3 ; // 39 TPC_CMD_NUMBER_FORMAT2_3:
|
||||
uint8_t csi_request ; // 40 CSI_REQUEST:
|
||||
uint8_t cbgti ; // 41 CBGTI: 0, 2, 4, 6, or 8 bits determined by higher layer parameter maxCodeBlockGroupsPerTransportBlock for the PDSCH
|
||||
uint8_t cbgfi ; // 42 CBGFI: 0 or 1 bit determined by higher layer parameter codeBlockGroupFlushIndicator
|
||||
uint8_t ptrs_dmrs ; // 43 PTRS_DMRS:
|
||||
uint8_t beta_offset_ind ; // 44 BETA_OFFSET_IND:
|
||||
uint8_t dmrs_seq_ini ; // 45 DMRS_SEQ_INI: 1 bit if the cell has two ULs and the number of bits for DCI format 1_0 before padding
|
||||
// is larger than the number of bits for DCI format 0_0 before padding; 0 bit otherwise
|
||||
uint8_t sul_ind_0_0 ; // 46 SUL_IND_0_0:
|
||||
uint16_t padding ; // 47 PADDING: (Note 2) If DCI format 0_0 is monitored in common search space
|
||||
// and if the number of information bits in the DCI format 0_0 prior to padding
|
||||
// is less than the payload size of the DCI format 1_0 monitored in common search space
|
||||
// zeros shall be appended to the DCI format 0_0
|
||||
// until the payload size equals that of the DCI format 1_0
|
||||
|
||||
};
|
||||
typedef struct NR_DCI_INFO_EXTRACTED NR_DCI_INFO_EXTRACTED_t;
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -42,6 +42,7 @@
|
||||
|
||||
#include "PHY/NR_REFSIG/pss_nr.h"
|
||||
#include "PHY/NR_REFSIG/sss_nr.h"
|
||||
#include "PHY/NR_REFSIG/refsig_defs_ue.h"
|
||||
|
||||
extern openair0_config_t openair0_cfg[];
|
||||
static nfapi_config_request_t config_t;
|
||||
@@ -63,6 +64,9 @@ int pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
ue->rx_offset);
|
||||
#endif
|
||||
|
||||
int nb_prefix_samples0 = frame_parms->nb_prefix_samples0;
|
||||
frame_parms->nb_prefix_samples0 = 0;
|
||||
|
||||
//symbol 1
|
||||
slot_fep_pbch(ue,
|
||||
1,
|
||||
@@ -87,6 +91,8 @@ int pbch_detection(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
0,
|
||||
1);
|
||||
|
||||
frame_parms->nb_prefix_samples0 = nb_prefix_samples0;
|
||||
|
||||
pbch_decoded = 0;
|
||||
|
||||
//for (frame_mod4=0; frame_mod4<4; frame_mod4++) {
|
||||
@@ -256,7 +262,8 @@ int nr_initial_sync(PHY_VARS_NR_UE *ue, runmode_t mode)
|
||||
|
||||
set_default_frame_parms_single(config,&ue->frame_parms);
|
||||
nr_init_frame_parms_ue(config,&ue->frame_parms);
|
||||
//generate_dmrs_pbch(ue->dmrs_pbch_bitmap_nr, frame_parms->Nid_cell);
|
||||
|
||||
nr_gold_pbch(ue);
|
||||
ret = pbch_detection(ue,mode);
|
||||
// write_output("rxdata2.m","rxd2",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
|
||||
|
||||
|
||||
@@ -65,96 +65,104 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
|
||||
uint16_t rb;
|
||||
uint8_t i,j,aarx,aatx;
|
||||
int *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
|
||||
int32_t *dl_ch0,*dl_ch0_ext,*rxF,*rxF_ext;
|
||||
|
||||
int rx_offset = frame_parms->ofdm_symbol_size-3*12;
|
||||
int ch_offset = frame_parms->N_RB_DL*6-3*12;
|
||||
int nushiftmod4 = frame_parms->nushift%4;
|
||||
int rx_offset = frame_parms->ofdm_symbol_size-10*12;
|
||||
int nushiftmod4 = frame_parms->nushift;
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
/*
|
||||
printf("extract_rbs (nushift %d): symbol_mod=%d, rx_offset=%d, ch_offset=%d\n",frame_parms->nushift,symbol_mod,
|
||||
(rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))*2,
|
||||
LTE_CE_OFFSET+ch_offset+(symbol_mod*(frame_parms->ofdm_symbol_size)));
|
||||
*/
|
||||
|
||||
|
||||
printf("extract_rbs (nushift %d): rx_offset=%d, symbol %d\n",frame_parms->nushift,
|
||||
(rx_offset + (symbol*(frame_parms->ofdm_symbol_size))),symbol);
|
||||
|
||||
rxF = &rxdataF[aarx][(rx_offset + (symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
rxF_ext = &rxdataF_ext[aarx][symbol*(20*12)];
|
||||
#ifdef DEBUG_PBCH
|
||||
int16_t *p = (int16_t *)rxF;
|
||||
for (int i =0; i<240;i++){
|
||||
printf("rxF [%d]= %d\n",i,rxF[i]);
|
||||
printf("pbch pss %d %d @%p\n", p[2*i], p[2*i+1], &p[2*i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
for (rb=0; rb<20; rb++) {
|
||||
// skip DC carrier
|
||||
if (rb==10) {
|
||||
rxF = &rxdataF[aarx][(1 + (symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
rxF = &rxdataF[aarx][((symbol*(frame_parms->ofdm_symbol_size)))];
|
||||
}
|
||||
|
||||
j=0;
|
||||
if ((symbol==1) || (symbol==3)) {
|
||||
j=0;
|
||||
|
||||
for (i=0; i<12; i++) {
|
||||
if ((i!=nushiftmod4) &&
|
||||
(i!=(nushiftmod4+4)) &&
|
||||
(i!=(nushiftmod4+8))) {
|
||||
rxF_ext[j++]=rxF[i];
|
||||
rxF_ext[j]=rxF[i];
|
||||
//printf("rxF ext[%d] = %d rxF [%d]= %d\n",j,rxF_ext[j],i,rxF[i]);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
rxF+=12;
|
||||
rxF_ext+=8;
|
||||
rxF_ext+=9;
|
||||
} else { //symbol 2
|
||||
if ((rb < 4) && (rb >15)){
|
||||
for (i=0; i<12; i++) {
|
||||
if ((i!=nushiftmod4) &&
|
||||
(i!=(nushiftmod4+4)) &&
|
||||
(i!=(nushiftmod4+8))) {
|
||||
rxF_ext[j++]=rxF[i];
|
||||
rxF_ext[j]=rxF[i];
|
||||
//printf("rxF ext[%d] = %d at %p\n",j,rxF_ext[j],&rxF[i]);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
rxF+=12;
|
||||
rxF_ext+=8;
|
||||
rxF_ext+=9;
|
||||
}
|
||||
}
|
||||
|
||||
for (aatx=0; aatx<4; aatx++) { //frame_parms->nb_antenna_ports_eNB;aatx++) {
|
||||
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB;aatx++) {
|
||||
if (high_speed_flag == 1)
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset+(symbol*(frame_parms->ofdm_symbol_size))];
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][(symbol*(frame_parms->ofdm_symbol_size))];
|
||||
else
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][LTE_CE_OFFSET+ch_offset];
|
||||
dl_ch0 = &dl_ch_estimates[(aatx<<1)+aarx][0];
|
||||
|
||||
printf("dl_ch0 addr %p\n",dl_ch0);
|
||||
|
||||
dl_ch0_ext = &dl_ch_estimates_ext[(aatx<<1)+aarx][symbol*(20*12)];
|
||||
|
||||
for (rb=0; rb<20; rb++) {
|
||||
// skip DC carrier
|
||||
// if (rb==3) dl_ch0++;
|
||||
memcpy(dl_ch0_ext,dl_ch0,12*sizeof(int));
|
||||
j=0;
|
||||
if ((symbol==1) || (symbol==3)) {
|
||||
j=0;
|
||||
|
||||
for (i=0; i<12; i++) {
|
||||
for (i=0; i<12; i++) {
|
||||
if ((i!=nushiftmod4) &&
|
||||
(i!=(nushiftmod4+4)) &&
|
||||
(i!=(nushiftmod4+8))) {
|
||||
rxF_ext[j++]=rxF[i];
|
||||
dl_ch0_ext[j]=dl_ch0[i];
|
||||
if ((rb==0) && (i<2))
|
||||
printf("dl ch0 ext[%d] = %d dl_ch0 [%d]= %d\n",j,dl_ch0_ext[j],i,dl_ch0[i]);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
dl_ch0+=12;
|
||||
dl_ch0_ext+=8;
|
||||
dl_ch0_ext+=9;
|
||||
}
|
||||
else { //symbol 2
|
||||
if ((rb < 4) && (rb >15)){
|
||||
for (i=0; i<12; i++) {
|
||||
if ((i!=nushiftmod4) &&
|
||||
(i!=(nushiftmod4+4)) &&
|
||||
(i!=(nushiftmod4+8))) {
|
||||
dl_ch0_ext[j++]=dl_ch0[i];
|
||||
if ((i!=nushiftmod4) &&
|
||||
(i!=(nushiftmod4+4)) &&
|
||||
(i!=(nushiftmod4+8))) {
|
||||
dl_ch0_ext[j]=dl_ch0[i];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dl_ch0+=12;
|
||||
dl_ch0_ext+=8;
|
||||
dl_ch0_ext+=9;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -507,13 +515,14 @@ static unsigned char dummy_w_rx[3*3*(16+PBCH_A)];
|
||||
static int8_t pbch_w_rx[3*3*(16+PBCH_A)],pbch_d_rx[96+(3*(16+PBCH_A))];
|
||||
|
||||
|
||||
uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc,
|
||||
NR_UE_PBCH *nr_ue_pbch_vars,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4)
|
||||
uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
NR_UE_PBCH *nr_ue_pbch_vars,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t eNB_id,
|
||||
MIMO_mode_t mimo_mode,
|
||||
uint32_t high_speed_flag,
|
||||
uint8_t frame_mod4)
|
||||
{
|
||||
|
||||
NR_UE_COMMON *nr_ue_common_vars = &ue->common_vars;
|
||||
@@ -547,8 +556,12 @@ uint16_t nr_rx_pbch( PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc,
|
||||
for (symbol=1; symbol<4; symbol++) {
|
||||
|
||||
#ifdef DEBUG_PBCH
|
||||
msg("[PBCH] starting extract\n");
|
||||
msg("[PBCH] starting extract ofdm size %d\n",frame_parms->ofdm_symbol_size );
|
||||
#endif
|
||||
|
||||
printf("address dataf %p",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF);
|
||||
//write_output("rxdataF0_pbch.m","rxF0pbch",nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,frame_parms->ofdm_symbol_size*4,2,1);
|
||||
|
||||
nr_pbch_extract(nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].rxdataF,
|
||||
nr_ue_common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[subframe_rx]].dl_ch_estimates[eNB_id],
|
||||
nr_ue_pbch_vars->rxdataF_ext,
|
||||
|
||||
@@ -328,8 +328,43 @@ typedef struct {
|
||||
int8_t g_pucch;
|
||||
} NR_UE_DLSCH_t;
|
||||
|
||||
typedef enum {format0_0,
|
||||
format0_1,
|
||||
format1_0,
|
||||
format1_1,
|
||||
format2_0,
|
||||
format2_1,
|
||||
format2_2,
|
||||
format2_3
|
||||
} NR_DCI_format_t;
|
||||
|
||||
|
||||
typedef enum {nr_pucch_format0=0,
|
||||
nr_pucch_format1,
|
||||
nr_pucch_format2,
|
||||
nr_pucch_format3,
|
||||
nr_pucch_format4
|
||||
} NR_PUCCH_FMT_t;
|
||||
|
||||
typedef struct {
|
||||
/// Length of DCI in bits
|
||||
uint8_t dci_length;
|
||||
/// Aggregation level
|
||||
uint8_t L;
|
||||
/// Position of first CCE of the dci
|
||||
int firstCCE;
|
||||
/// flag to indicate that this is a RA response
|
||||
boolean_t ra_flag;
|
||||
/// rnti
|
||||
rnti_t rnti;
|
||||
/// Format
|
||||
NR_DCI_format_t format;
|
||||
/// search space
|
||||
dci_space_t search_space;
|
||||
/// DCI pdu
|
||||
uint8_t dci_pdu[8];
|
||||
} NR_DCI_ALLOC_t;
|
||||
|
||||
|
||||
/**@}*/
|
||||
#endif
|
||||
|
||||
@@ -320,7 +320,7 @@ typedef struct PHY_VARS_gNB_s {
|
||||
/// counter to average prach energh over first 100 prach opportunities
|
||||
int prach_energy_counter;
|
||||
|
||||
// PDSCH Varaibles
|
||||
// PDSCH Variables
|
||||
PDSCH_CONFIG_DEDICATED pdsch_config_dedicated[NUMBER_OF_UE_MAX];
|
||||
|
||||
// PUSCH Varaibles
|
||||
|
||||
+217
-7
@@ -21,7 +21,7 @@
|
||||
|
||||
/*! \file PHY/defs_nr_UE.h
|
||||
\brief Top-level defines and structure definitions for nr ue
|
||||
\author Guy De Souza, H. WANG
|
||||
\author Guy De Souza, H. WANG, A. Mico Pereperez
|
||||
\date 2018
|
||||
\version 0.1
|
||||
\company Eurecom
|
||||
@@ -140,7 +140,9 @@
|
||||
|
||||
#endif
|
||||
|
||||
#include "PHY/NR_UE_TRANSPORT/dci_nr.h"
|
||||
//#include "PHY/LTE_TRANSPORT/defs.h"
|
||||
//#include "PHY/NR_UE_TRANSPORT/defs_nr.h"
|
||||
#include <pthread.h>
|
||||
|
||||
#include "targets/ARCH/COMMON/common_lib.h"
|
||||
@@ -569,6 +571,207 @@ typedef struct {
|
||||
//MIMO_mode_t mimo_mode;
|
||||
} NR_UE_PDSCH_FLP;
|
||||
|
||||
#define NR_PDCCH_DEFS_NR_UE
|
||||
#define NR_NBR_CORESET_ACT_BWP 3 // The number of CoreSets per BWP is limited to 3 (including initial CORESET: ControlResourceId 0)
|
||||
#define NR_NBR_SEARCHSPACE_ACT_BWP 10 // The number of SearchSpaces per BWP is limited to 10 (including initial SEARCHSPACE: SearchSpaceId 0)
|
||||
#ifdef NR_PDCCH_DEFS_NR_UE
|
||||
|
||||
#define NBR_NR_FORMATS 8
|
||||
#define NBR_NR_DCI_FIELDS 48
|
||||
// The following parameters define 'position' of each DCI field described in TS 38.212
|
||||
#define CARRIER_IND 0
|
||||
#define SUL_IND_0_1 1
|
||||
#define IDENTIFIER_DCI_FORMATS 2
|
||||
#define SLOT_FORMAT_IND 3
|
||||
#define PRE_EMPTION_IND 4
|
||||
#define TPC_CMD_NUMBER 5
|
||||
#define BLOCK_NUMBER 6
|
||||
#define BANDWIDTH_PART_IND 7
|
||||
#define FREQ_DOM_RESOURCE_ASSIGNMENT_UL 8
|
||||
#define FREQ_DOM_RESOURCE_ASSIGNMENT_DL 9
|
||||
#define TIME_DOM_RESOURCE_ASSIGNMENT 10
|
||||
#define VRB_TO_PRB_MAPPING 11
|
||||
#define PRB_BUNDLING_SIZE_IND 12
|
||||
#define RATE_MATCHING_IND 13
|
||||
#define ZP_CSI_RS_TRIGGER 14
|
||||
#define FREQ_HOPPING_FLAG 15
|
||||
#define TB1_MCS 16
|
||||
#define TB1_NDI 17
|
||||
#define TB1_RV 18
|
||||
#define TB2_MCS 19
|
||||
#define TB2_NDI 20
|
||||
#define TB2_RV 21
|
||||
#define MCS 22
|
||||
#define NDI 23
|
||||
#define RV 24
|
||||
#define HARQ_PROCESS_NUMBER 25
|
||||
#define DAI_ 26
|
||||
#define FIRST_DAI 27
|
||||
#define SECOND_DAI 28
|
||||
#define TPC_PUSCH 29
|
||||
#define TPC_PUCCH 30
|
||||
#define PUCCH_RESOURCE_IND 31
|
||||
#define PDSCH_TO_HARQ_FEEDBACK_TIME_IND 32
|
||||
#define SHORT_MESSAGE_IND 33
|
||||
#define SRS_RESOURCE_IND 34
|
||||
#define PRECOD_NBR_LAYERS 35
|
||||
#define ANTENNA_PORTS 36
|
||||
#define TCI 37
|
||||
#define SRS_REQUEST 38
|
||||
#define TPC_CMD_NUMBER_FORMAT2_3 39
|
||||
#define CSI_REQUEST 40
|
||||
#define CBGTI 41
|
||||
#define CBGFI 42
|
||||
#define PTRS_DMRS 43
|
||||
#define BETA_OFFSET_IND 44
|
||||
#define DMRS_SEQ_INI 45
|
||||
#define SUL_IND_0_0 46
|
||||
#define PADDING 47
|
||||
|
||||
typedef enum {bundle_n2=2,bundle_n3=3,bundle_n6=6} NR_UE_CORESET_REG_bundlesize_t;
|
||||
|
||||
typedef enum {interleave_n2=2,interleave_n3=3,interleave_n6=6} NR_UE_CORESET_interleaversize_t;
|
||||
|
||||
typedef struct {
|
||||
//Corresponds to L1 parameter 'CORESET-REG-bundle-size' (see 38.211, section FFS_Section)
|
||||
NR_UE_CORESET_REG_bundlesize_t reg_bundlesize;
|
||||
//Corresponds to L1 parameter 'CORESET-interleaver-size' (see 38.211, 38.213, section FFS_Section)
|
||||
NR_UE_CORESET_interleaversize_t interleaversize;
|
||||
//Corresponds to L1 parameter 'CORESET-shift-index' (see 38.211, section 7.3.2.2)
|
||||
int shiftIndex;
|
||||
} NR_UE_CORESET_CCE_REG_MAPPING_t;
|
||||
|
||||
typedef enum {allContiguousRBs=0,sameAsREGbundle=1} NR_UE_CORESET_precoder_granularity_t;
|
||||
|
||||
typedef struct {
|
||||
/*
|
||||
* define CORESET structure according to 38.331
|
||||
*
|
||||
* controlResourceSetId: Corresponds to L1 parameter 'CORESET-ID'
|
||||
* Value 0 identifies the common CORESET configured in MIB and in ServingCellConfigCommon
|
||||
* Values 1..maxNrofControlResourceSets-1 identify CORESETs configured by dedicated signalling
|
||||
* frequencyDomainResources: BIT STRING (SIZE (45))
|
||||
* Corresponds to L1 parameter 'CORESET-freq-dom'(see 38.211, section 7.3.2.2)
|
||||
* Frequency domain resources for the CORESET. Each bit corresponds a group of 6 RBs, with grouping starting from PRB 0,
|
||||
* which is fully contained in the bandwidth part within which the CORESET is configured.
|
||||
* duration: INTEGER (1..maxCoReSetDuration)
|
||||
* Corresponds to L1 parameter 'CORESET-time-duration' (see 38.211, section 7.3.2.2FFS_Section)
|
||||
* Contiguous time duration of the CORESET in number of symbols
|
||||
* cce-REG-MappingType: interleaved
|
||||
* reg-BundleSize: ENUMERATED {n2, n3, n6}
|
||||
* interleaverSize: ENUMERATED {n2, n3, n6}
|
||||
* shiftIndex: INTEGER
|
||||
* nonInterleaved NULL
|
||||
* precoderGranularity: ENUMERATED {sameAsREG-bundle, allContiguousRBs}
|
||||
* Corresponds to L1 parameter 'CORESET-precoder-granuality' (see 38.211, sections 7.3.2.2 and 7.4.1.3.2)
|
||||
* tci-StatesPDCCH: SEQUENCE(SIZE (1..maxNrofTCI-StatesPDCCH)) OF TCI-StateId OPTIONAL
|
||||
* A subset of the TCI states defined in TCI-States used for providing QCL relationships between the DL RS(s)
|
||||
* in one RS Set (TCI-State) and the PDCCH DMRS ports.
|
||||
* Corresponds to L1 parameter 'TCI-StatesPDCCH' (see 38.214, section FFS_Section)
|
||||
* tci-PresentInDCI: ENUMERATED {enabled} OPTIONAL
|
||||
* Corresponds to L1 parameter 'TCI-PresentInDCI' (see 38,213, section 5.1.5)
|
||||
* pdcch-DMRS-ScramblingID: BIT STRING (SIZE (16)) OPTIONAL
|
||||
* PDCCH DMRS scrambling initalization.
|
||||
* Corresponds to L1 parameter 'PDCCH-DMRS-Scrambling-ID' (see 38.214, section 5.1)
|
||||
* When the field is absent the UE applies the value '0'.
|
||||
*/
|
||||
int controlResourceSetId;
|
||||
uint64_t frequencyDomainResources;
|
||||
int duration;
|
||||
NR_UE_CORESET_CCE_REG_MAPPING_t cce_reg_mappingType;
|
||||
NR_UE_CORESET_precoder_granularity_t precoderGranularity;
|
||||
int tciStatesPDCCH;
|
||||
int tciPresentInDCI;
|
||||
uint16_t pdcchDMRSScramblingID;
|
||||
|
||||
} NR_UE_PDCCH_CORESET;
|
||||
|
||||
// Slots for PDCCH Monitoring configured as periodicity and offset
|
||||
typedef enum {nr_sl1=1,nr_sl2=2,nr_sl4=4,nr_sl5=5,nr_sl8=8,nr_sl10=10,nr_sl16=16,nr_sl20=20} NR_UE_SLOT_PERIOD_OFFSET_t;
|
||||
typedef enum {nc0=0,nc1=1,nc2=2,nc3=3,nc4=4,nc5=5,nc6=6,nc8=8} NR_UE_SEARCHSPACE_nbrCAND_t;
|
||||
typedef enum {nsfi1=1,nsfi2=2} NR_UE_SEARCHSPACE_nbrCAND_SFI_t;
|
||||
typedef enum {n2_3_1=1,n2_3_2=2} NR_UE_SEARCHSPACE_nbrCAND_2_3_t;
|
||||
typedef enum {cformat0_0_and_1_0=0,cformat2_0=2,cformat2_1=3,cformat2_2=4,cformat2_3=5} NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t;
|
||||
typedef enum {uformat0_0_and_1_0=0,uformat0_1_and_1_1=1} NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t;
|
||||
// Monitoring periodicity of SRS PDCCH in number of slots for DCI format 2-3
|
||||
// Corresponds to L1 parameter 'SRS-Num-PDCCH-cand' (see 38.212, 38.213, section 7.3.1, 11.3)
|
||||
typedef enum {mp1=1,mp2=2,mp4=4,mp5=5,mp8=8,mp10=10,mp16=16,mp20=20} NR_UE_SEARCHSPACE_MON_PERIOD_t;
|
||||
//typedef enum {n1=1,n2=2} NR_UE_SEARCHSPACE_nbrCAND_2_3_t;
|
||||
// The number of PDCCH candidates for DCI format 2-3 for the configured aggregation level.
|
||||
// Corresponds to L1 parameter 'SRS-Num-PDCCH-cand' (see 38.212, 38.213, section 7.3.1, 11.3)
|
||||
typedef enum {common=0,ue_specific=1} NR_SEARCHSPACE_TYPE_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
/*
|
||||
* searchSpaceType: Indicates whether this is a common search space (present) or a UE specific search space (CHOICE)
|
||||
* as well as DCI formats to monitor for (description in struct NR_UE_PDCCH_SEARCHSPACE_TYPE
|
||||
* common: Configures this search space as common search space (CSS) and DCI formats to monitor
|
||||
* ue-Specific: Configures this search space as UE specific search space (USS)
|
||||
* The UE monitors the DCI format with CRC scrambled by
|
||||
* C-RNTI, CS-RNTI (if configured), TC-RNTI (if a certain condition is met),
|
||||
* and SP-CSI-RNTI (if configured)
|
||||
*/
|
||||
|
||||
NR_SEARCHSPACE_TYPE_t type;
|
||||
NR_UE_SEARCHSPACE_CSS_DCI_FORMAT_t common_dci_formats;
|
||||
//NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_SFI_aggr_level[5]; // FIXME! A table of five enum elements
|
||||
NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel1;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel2;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel4;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel8;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_SFI_t sfi_nrofCandidates_aggrlevel16;
|
||||
NR_UE_SEARCHSPACE_MON_PERIOD_t srs_monitoringPeriodicity2_3;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_2_3_t srs_nrofCandidates;
|
||||
NR_UE_SEARCHSPACE_USS_DCI_FORMAT_t ue_specific_dci_formats;
|
||||
|
||||
} NR_UE_PDCCH_SEARCHSPACE_TYPE;
|
||||
|
||||
typedef struct {
|
||||
/*
|
||||
* define SearchSpace structure according to 38.331
|
||||
*
|
||||
* searchSpaceId: Identity of the search space. SearchSpaceId = 0 identifies the SearchSpace configured via PBCH (MIB)
|
||||
* The searchSpaceId is unique among the BWPs of a Serving Cell
|
||||
* controlResourceSetId: CORESET applicable for this SearchSpace
|
||||
* 0 identifies the common CORESET configured in MIB
|
||||
* 1..maxNrofControlResourceSets-1 identify CORESETs configured by dedicated signalling
|
||||
* monitoringSlotPeriodicityAndOffset:
|
||||
* Slots for PDCCH Monitoring configured as periodicity and offset.
|
||||
* Corresponds to L1 parameters 'Montoring-periodicity-PDCCH-slot' and
|
||||
* 'Montoring-offset-PDCCH-slot' (see 38.213, section 10)
|
||||
* monitoringSymbolsWithinSlot:
|
||||
* Symbols for PDCCH monitoring in the slots configured for PDCCH monitoring
|
||||
* The most significant (left) bit represents the first OFDM in a slot
|
||||
*
|
||||
* nrofCandidates: Number of PDCCH candidates per aggregation level
|
||||
*
|
||||
* searchSpaceType: Indicates whether this is a common search space (present) or a UE specific search space
|
||||
* as well as DCI formats to monitor for (description in struct NR_UE_PDCCH_SEARCHSPACE_TYPE
|
||||
* common: Configures this search space as common search space (CSS) and DCI formats to monitor
|
||||
* ue-Specific: Configures this search space as UE specific search space (USS)
|
||||
* The UE monitors the DCI format with CRC scrambled by
|
||||
* C-RNTI, CS-RNTI (if configured), TC-RNTI (if a certain condition is met),
|
||||
* and SP-CSI-RNTI (if configured)
|
||||
*/
|
||||
// INTEGER (0..maxNrofSearchSpaces-1) (0..40-1)
|
||||
int searchSpaceId;
|
||||
int controlResourceSetId;
|
||||
// FIXME! Verify type to be used for this parameter (sl1, sl2, sl4, sl5, sl8, sl10, sl16, sl20). Maybe enum.
|
||||
NR_UE_SLOT_PERIOD_OFFSET_t monitoringSlotPeriodicityAndOffset;
|
||||
int monitoringSlotPeriodicityAndOffset_offset;
|
||||
// bit string size 14. Bitmap to indicate symbols within slot where PDCCH has to be monitored
|
||||
// the MSB (left) bit represents first OFDM in slot
|
||||
uint16_t monitoringSymbolWithinSlot;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel1;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel2;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel4;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel8;
|
||||
NR_UE_SEARCHSPACE_nbrCAND_t nrofCandidates_aggrlevel16;
|
||||
NR_UE_PDCCH_SEARCHSPACE_TYPE searchSpaceType;
|
||||
|
||||
} NR_UE_PDCCH_SEARCHSPACE;
|
||||
#endif
|
||||
typedef struct {
|
||||
/// \brief Pointers to extracted PDCCH symbols in frequency-domain.
|
||||
/// - first index: ? [0..7] (hard coded) FIXME! accessed via \c nb_antennas_rx
|
||||
@@ -621,6 +824,13 @@ typedef struct {
|
||||
//Check for specific DCIFormat and AgregationLevel
|
||||
uint8_t dciFormat;
|
||||
uint8_t agregationLevel;
|
||||
#ifdef NR_PDCCH_DEFS_NR_UE
|
||||
// CORESET structure, where maximum number of CORESETs to be handled is 3 (according to 38.331 V15.1.0)
|
||||
NR_UE_PDCCH_CORESET coreset[NR_NBR_CORESET_ACT_BWP];
|
||||
// SEARCHSPACE structure, where maximum number of SEARCHSPACEs to be handled is 10 (according to 38.331 V15.1.0)
|
||||
// Each SearchSpace is associated with one ControlResourceSet
|
||||
NR_UE_PDCCH_SEARCHSPACE searchSpace[NR_NBR_SEARCHSPACE_ACT_BWP];
|
||||
#endif
|
||||
} NR_UE_PDCCH;
|
||||
|
||||
#define PBCH_A 24
|
||||
@@ -769,14 +979,14 @@ typedef struct {
|
||||
|
||||
#endif
|
||||
|
||||
/// UE-specific reference symbols (p=5), TM 7
|
||||
uint32_t lte_gold_uespec_port5_table[20][38];
|
||||
/// PBCH DMRS sequence
|
||||
uint32_t nr_gold_pbch[2][64][NR_PBCH_DMRS_LENGTH_DWORD];
|
||||
|
||||
/// ue-specific reference symbols
|
||||
uint32_t lte_gold_uespec_table[2][20][2][21];
|
||||
/// PDSCH DMRS
|
||||
uint32_t nr_gold_pdsch[2][20][2][21];
|
||||
|
||||
/// mbsfn reference symbols
|
||||
uint32_t lte_gold_mbsfn_table[10][3][42];
|
||||
/// PDCCH DMRS
|
||||
uint32_t nr_gold_pdcch[10][3][42];
|
||||
|
||||
uint32_t X_u[64][839];
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#define __PHY_DEFS_NR_COMMON__H__
|
||||
|
||||
#include "defs_common.h"
|
||||
#include "nfapi_interface.h"
|
||||
#include "impl_defs_nr.h"
|
||||
#include "PHY/CODING/nrPolar_tools/nr_polar_defs.h"
|
||||
|
||||
@@ -56,6 +57,8 @@
|
||||
#define NR_PBCH_DMRS_LENGTH 144
|
||||
#define NR_PBCH_DMRS_LENGTH_DWORD 5 // roundup(NR_PBCH_DMRS_LENGTH/32)
|
||||
|
||||
#define NR_MAX_NUM_BWP 4
|
||||
|
||||
typedef enum {
|
||||
NR_MU_0=0,
|
||||
NR_MU_1,
|
||||
@@ -73,6 +76,17 @@ typedef enum{
|
||||
nr_ssb_type_E
|
||||
} nr_ssb_type_e;
|
||||
|
||||
typedef struct NR_BWP_PARMS {
|
||||
/// Associated numerology index
|
||||
uint8_t numerology_index;
|
||||
/// Freq domain location
|
||||
uint8_t location;
|
||||
/// Bandwidth in PRB
|
||||
uint16_t N_RB;
|
||||
/// Size of FFT/IFFT
|
||||
uint16_t ofdm_symbol_size;
|
||||
} NR_BWP_PARMS;
|
||||
|
||||
typedef struct NR_DL_FRAME_PARMS {
|
||||
/// Number of resource blocks (RB) in DL
|
||||
uint8_t N_RB_DL;
|
||||
@@ -165,6 +179,11 @@ typedef struct NR_DL_FRAME_PARMS {
|
||||
/// PBCH polar encoder params
|
||||
t_nrPolar_params pbch_polar_params;
|
||||
|
||||
//BWP params
|
||||
NR_BWP_PARMS initial_bwp_params_dl;
|
||||
NR_BWP_PARMS initial_bwp_params_ul;
|
||||
|
||||
} NR_DL_FRAME_PARMS;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -44,6 +44,7 @@ int16_t *primary_synch2_time;
|
||||
//PHY_VARS *PHY_vars;
|
||||
#ifndef OCP_FRAMEWORK
|
||||
PHY_VARS_NR_UE ***PHY_vars_UE_g;
|
||||
PHY_VARS_eNB ***PHY_vars_eNB_g;
|
||||
LTE_DL_FRAME_PARMS *lte_frame_parms_g;
|
||||
#else
|
||||
PHY_VARS_NR_UE * PHY_vars_UE_g[MAX_UE][MAX_NUM_CCs]={NULL};
|
||||
|
||||
@@ -32,7 +32,8 @@
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "SCHED_NR/defs.h"
|
||||
#include "sched_nr.h"
|
||||
#include "PHY/MODULATION/modulation_common.h"
|
||||
|
||||
#include "PHY/LTE_TRANSPORT/if4_tools.h"
|
||||
#include "PHY/LTE_TRANSPORT/if5_tools.h"
|
||||
@@ -85,6 +86,7 @@ void nr_feptx0(RU_t *ru,int slot) {
|
||||
void nr_feptx_ofdm_2thread(RU_t *ru) {
|
||||
|
||||
NR_DL_FRAME_PARMS *fp=ru->nr_frame_parms;
|
||||
nfapi_config_request_t *cfg = &ru->gNB_list[0]->gNB_config;
|
||||
RU_proc_t *proc = &ru->proc;
|
||||
struct timespec wait;
|
||||
int subframe = ru->proc.subframe_tx;
|
||||
@@ -94,7 +96,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru) {
|
||||
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
|
||||
if (nr_subframe_select(fp,subframe) == SF_UL) return;
|
||||
if (nr_subframe_select(cfg,subframe) == SF_UL) return;
|
||||
|
||||
// this copy should be done in the precoding thread (currently inactive)
|
||||
for (int aa=0;aa<ru->nb_tx;aa++)
|
||||
@@ -104,7 +106,7 @@ void nr_feptx_ofdm_2thread(RU_t *ru) {
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM , 1 );
|
||||
|
||||
if (nr_subframe_select(fp,subframe)==SF_DL) {
|
||||
if (nr_subframe_select(cfg,subframe)==SF_DL) {
|
||||
// If this is not an S-subframe
|
||||
if (pthread_mutex_timedlock(&proc->mutex_feptx,&wait) != 0) {
|
||||
printf("[RU] ERROR pthread_mutex_lock for feptx thread (IC %d)\n", proc->instance_cnt_feptx);
|
||||
@@ -202,8 +204,8 @@ void nr_feptx_ofdm(RU_t *ru) {
|
||||
|
||||
slot_offset = subframe*fp->samples_per_subframe;
|
||||
|
||||
if ((nr_subframe_select(fp,subframe)==SF_DL)||
|
||||
((nr_subframe_select(fp,subframe)==SF_S))) {
|
||||
if ((nr_subframe_select(cfg,subframe)==SF_DL)||
|
||||
((nr_subframe_select(cfg,subframe)==SF_S))) {
|
||||
// LOG_D(HW,"Frame %d: Generating slot %d\n",frame,next_slot);
|
||||
|
||||
start_meas(&ru->ofdm_mod_stats);
|
||||
@@ -228,7 +230,7 @@ void nr_feptx_ofdm(RU_t *ru) {
|
||||
14,
|
||||
fp);
|
||||
// if S-subframe generate first slot only
|
||||
if (nr_subframe_select(fp,subframe) == SF_DL)
|
||||
if (nr_subframe_select(cfg,subframe) == SF_DL)
|
||||
nr_normal_prefix_mod(&ru->common.txdataF_BF[aa][slot_offset_F+slot_sizeF],
|
||||
dummy_tx_b+(fp->samples_per_subframe / fp->slots_per_subframe),
|
||||
14,
|
||||
|
||||
@@ -31,12 +31,13 @@
|
||||
*/
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "SCHED_NR/defs.h"
|
||||
#include "sched_nr.h"
|
||||
|
||||
|
||||
nr_subframe_t nr_subframe_select(nfapi_config_request_t *cfg,unsigned char subframe)
|
||||
{
|
||||
if (cfg->subframe_config.duplex_mode.value == FDD)
|
||||
return(SF_DL);
|
||||
else
|
||||
return SF_DL;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
|
||||
#include "PHY/phy_extern.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "sched_nr.h"
|
||||
#include "PHY/NR_TRANSPORT/nr_transport.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED/sched_common_extern.h"
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
\author R. Knopp, F. Kaltenberger
|
||||
\author Guy De Souza
|
||||
\company EURECOM
|
||||
\email knopp@eurecom.fr
|
||||
\email desouza@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __openair_SCHED_NR_DEFS_H__
|
||||
@@ -33,23 +33,11 @@
|
||||
#include "SCHED/sched_eNB.h"
|
||||
|
||||
lte_subframe_t nr_subframe_select (nfapi_config_request_t *cfg, unsigned char subframe);
|
||||
int nr_generate_pss( int16_t *d_pss,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint8_t ssb_start_symbol,
|
||||
nfapi_config_request_t* config,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
int nr_generate_sss( int16_t *d_sss,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
uint8_t ssb_start_symbol,
|
||||
nfapi_config_request_t* config,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
int nr_generate_pbch_dmrs(uint32_t gold_sequence,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
nfapi_config_request_t* config,
|
||||
NR_DL_FRAME_PARMS *frame_parms);
|
||||
void nr_set_ssb_first_subcarrier(nfapi_config_request_t *cfg, NR_DL_FRAME_PARMS *fp);
|
||||
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, gNB_rxtx_proc_t *proc, int do_meas);
|
||||
void nr_init_feptx_thread(RU_t *ru,pthread_attr_t *attr_feptx);
|
||||
void nr_feptx_ofdm(RU_t *ru);
|
||||
void nr_feptx_ofdm_2thread(RU_t *ru);
|
||||
void nr_feptx0(RU_t *ru,int slot);
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,373 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
\author R. Knopp, F. Kaltenberger
|
||||
\company EURECOM
|
||||
\email knopp@eurecom.fr
|
||||
*/
|
||||
|
||||
#ifndef __openair_SCHED_H__
|
||||
#define __openair_SCHED_H__
|
||||
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
|
||||
|
||||
/*enum THREAD_INDEX { OPENAIR_THREAD_INDEX = 0,
|
||||
TOP_LEVEL_SCHEDULER_THREAD_INDEX,
|
||||
DLC_SCHED_THREAD_INDEX,
|
||||
openair_SCHED_NB_THREADS
|
||||
};*/ // do not modify this line
|
||||
|
||||
|
||||
#define OPENAIR_THREAD_PRIORITY 255
|
||||
|
||||
|
||||
#define OPENAIR_THREAD_STACK_SIZE PTHREAD_STACK_MIN //4096 //RTL_PTHREAD_STACK_MIN*6
|
||||
//#define DLC_THREAD_STACK_SIZE 4096 //DLC stack size
|
||||
//#define UE_SLOT_PARALLELISATION
|
||||
//#define UE_DLSCH_PARALLELISATION
|
||||
|
||||
/*enum openair_SCHED_STATUS {
|
||||
openair_SCHED_STOPPED=1,
|
||||
openair_SCHED_STARTING,
|
||||
openair_SCHED_STARTED,
|
||||
openair_SCHED_STOPPING
|
||||
};*/
|
||||
|
||||
/*enum openair_ERROR {
|
||||
// HARDWARE CAUSES
|
||||
openair_ERROR_HARDWARE_CLOCK_STOPPED= 1,
|
||||
|
||||
// SCHEDULER CAUSE
|
||||
openair_ERROR_OPENAIR_RUNNING_LATE,
|
||||
openair_ERROR_OPENAIR_SCHEDULING_FAILED,
|
||||
|
||||
// OTHERS
|
||||
openair_ERROR_OPENAIR_TIMING_OFFSET_OUT_OF_BOUNDS,
|
||||
};*/
|
||||
|
||||
/*enum openair_SYNCH_STATUS {
|
||||
openair_NOT_SYNCHED=1,
|
||||
openair_SYNCHED,
|
||||
openair_SCHED_EXIT
|
||||
};*/
|
||||
|
||||
/*enum openair_HARQ_TYPE {
|
||||
openair_harq_DL = 0,
|
||||
openair_harq_UL,
|
||||
openair_harq_RA
|
||||
};*/
|
||||
|
||||
#define DAQ_AGC_ON 1
|
||||
#define DAQ_AGC_OFF 0
|
||||
|
||||
|
||||
/** @addtogroup _PHY_PROCEDURES_
|
||||
* @{
|
||||
*/
|
||||
|
||||
|
||||
/*! \brief Top-level entry routine for UE procedures. Called every slot by process scheduler. In even slots, it performs RX functions from previous subframe (if required). On odd slots, it generate TX waveform for the following subframe.
|
||||
@param phy_vars_ue Pointer to UE variables on which to act
|
||||
@param eNB_id ID of eNB on which to act
|
||||
@param abstraction_flag Indicator of PHY abstraction
|
||||
@param mode calibration/debug mode
|
||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||
@param *phy_vars_rn pointer to RN variables
|
||||
*/
|
||||
void phy_procedures_UE_lte(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type);
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
/*! \brief Top-level entry routine for relay node procedures actinf as UE. This proc will make us of the existing UE procs.
|
||||
@param last_slot Index of last slot (0-19)
|
||||
@param next_slot Index of next_slot (0-19)
|
||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||
*/
|
||||
int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, relaying_type_t r_type);
|
||||
#endif
|
||||
|
||||
/*! \brief Scheduling for UE TX procedures in normal subframes.
|
||||
@param phy_vars_ue Pointer to UE variables on which to act
|
||||
@param proc Pointer to RXn-TXnp4 proc information
|
||||
@param eNB_id Local id of eNB on which to act
|
||||
@param abstraction_flag Indicator of PHY abstraction
|
||||
@param mode calib/normal mode
|
||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||
*/
|
||||
void phy_procedures_UE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode,relaying_type_t r_type);
|
||||
/*! \brief Scheduling for UE RX procedures in normal subframes.
|
||||
@param last_slot Index of last slot (0-19)
|
||||
@param phy_vars_ue Pointer to UE variables on which to act
|
||||
@param proc Pointer to RXn_TXnp4 proc information
|
||||
@param eNB_id Local id of eNB on which to act
|
||||
@param abstraction_flag Indicator of PHY abstraction
|
||||
@param mode calibration/debug mode
|
||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||
@param phy_vars_rn pointer to RN variables
|
||||
*/
|
||||
int phy_procedures_UE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type);
|
||||
int phy_procedures_slot_parallelization_UE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,uint8_t do_pdcch_flag,runmode_t mode,relaying_type_t r_type);
|
||||
|
||||
#ifdef UE_SLOT_PARALLELISATION
|
||||
void *UE_thread_slot1_dl_processing(void *arg);
|
||||
#endif
|
||||
|
||||
/*! \brief Scheduling for UE TX procedures in TDD S-subframes.
|
||||
@param phy_vars_ue Pointer to UE variables on which to act
|
||||
@param eNB_id Local id of eNB on which to act
|
||||
@param abstraction_flag Indicator of PHY abstraction
|
||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||
*/
|
||||
void phy_procedures_UE_S_TX(PHY_VARS_NR_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag,relaying_type_t r_type);
|
||||
|
||||
/*! \brief Scheduling for UE RX procedures in TDD S-subframes.
|
||||
@param phy_vars_ue Pointer to UE variables on which to act
|
||||
@param eNB_id Local id of eNB on which to act
|
||||
@param abstraction_flag Indicator of PHY abstraction
|
||||
@param r_type indicates the relaying operation: 0: no_relaying, 1: unicast relaying type 1, 2: unicast relaying type 2, 3: multicast relaying
|
||||
*/
|
||||
void phy_procedures_UE_S_RX(PHY_VARS_NR_UE *ue,uint8_t eNB_id,uint8_t abstraction_flag, relaying_type_t r_type);
|
||||
|
||||
|
||||
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index.
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param subframe Subframe index
|
||||
@returns Subframe type (DL,UL,S)
|
||||
*/
|
||||
|
||||
|
||||
nr_subframe_t nr_subframe_select(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
|
||||
|
||||
|
||||
/*! \brief Function to compute subframe type as a function of Frame type and TDD Configuration (implements Table 4.2.2 from 36.211, p.11 from version 8.6) and subframe index. Same as nr_subframe_select, except that it uses the Mod_id and is provided as a service to the MAC scheduler.
|
||||
@param Mod_id Index of eNB
|
||||
@param CC_id Component Carrier Index
|
||||
@param subframe Subframe index
|
||||
@returns Subframe type (DL,UL,S)
|
||||
*/
|
||||
nr_subframe_t nr_get_subframe_direction(uint8_t Mod_id, uint8_t CC_id,uint8_t subframe);
|
||||
|
||||
/*! \brief Function to compute timing of Msg3 transmission on UL-SCH (first UE transmission in RA procedure). This implements the timing in paragraph a) from Section 6.1.1 in 36.213 (p. 17 in version 8.6). Used by eNB upon transmission of random-access response (RA_RNTI) to program corresponding ULSCH reception procedure. Used by UE upon reception of random-access response (RA_RNTI) to program corresponding ULSCH transmission procedure. This does not support the UL_delay field in RAR (always assumed to be 0).
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param current_subframe Index of subframe where RA_RNTI was received
|
||||
@param current_frame Index of frame where RA_RNTI was received
|
||||
@param frame Frame index where Msg3 is to be transmitted (n+6 mod 10 for FDD, different for TDD)
|
||||
@param subframe subframe index where Msg3 is to be transmitted (n, n+1 or n+2)
|
||||
*/
|
||||
void nr_get_Msg3_alloc(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t current_subframe,
|
||||
uint32_t current_frame,
|
||||
uint32_t *frame,
|
||||
uint8_t *subframe);
|
||||
|
||||
/*! \brief Function to compute timing of Msg3 retransmission on UL-SCH (first UE transmission in RA procedure).
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param current_subframe Index of subframe where RA_RNTI was received
|
||||
@param current_frame Index of frame where RA_RNTI was received
|
||||
@param frame Frame index where Msg3 is to be transmitted (n+6 mod 10 for FDD, different for TDD)
|
||||
@param subframe subframe index where Msg3 is to be transmitted (n, n+1 or n+2)
|
||||
*/
|
||||
void nr_get_Msg3_alloc_ret(NR_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t current_subframe,
|
||||
uint32_t current_frame,
|
||||
uint32_t *frame,
|
||||
uint8_t *subframe);
|
||||
|
||||
/*! \brief Get ULSCH harq_pid for Msg3 from RAR subframe. This returns n+k mod 10 (k>6) and corresponds to the rule in Section 6.1.1 from 36.213
|
||||
@param frame_parms Pointer to DL Frame Parameters
|
||||
@param frame Frame index
|
||||
@param current_subframe subframe of RAR transmission
|
||||
@returns harq_pid (0 ... 7)
|
||||
*/
|
||||
uint8_t nr_get_Msg3_harq_pid(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t current_subframe);
|
||||
|
||||
/*! \brief Get ULSCH harq_pid from PHICH subframe
|
||||
@param frame_parms Pointer to DL Frame Parameters
|
||||
@param subframe subframe of PHICH
|
||||
@returns harq_pid (0 ... 7)
|
||||
*/
|
||||
|
||||
/*! \brief Function to indicate failure of contention resolution or RA procedure. It places the UE back in PRACH mode.
|
||||
@param Mod_id Instance index of UE
|
||||
@param CC_id Component Carrier Index
|
||||
@param eNB_index Index of eNB
|
||||
*/
|
||||
void ra_failed(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/*! \brief Function to indicate success of contention resolution or RA procedure.
|
||||
@param Mod_id Instance index of UE
|
||||
@param CC_id Component Carrier Index
|
||||
@param eNB_index Index of eNB
|
||||
*/
|
||||
void ra_succeeded(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/*! \brief Compute ACK/NACK information for PUSCH/PUCCH for UE transmission in subframe n. This function implements table 10.1-1 of 36.213, p. 69.
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param harq_ack Pointer to dlsch_ue harq_ack status descriptor
|
||||
@param subframe Subframe for UE transmission (n in 36.213)
|
||||
@param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
|
||||
@returns status indicator for PUCCH/PUSCH transmission
|
||||
*/
|
||||
uint8_t nr_get_ack(NR_DL_FRAME_PARMS *frame_parms,nr_harq_status_t *harq_ack,uint8_t subframe_tx,uint8_t subframe_rx,uint8_t *o_ACK, uint8_t cw_idx);
|
||||
|
||||
/*! \brief Reset ACK/NACK information
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param harq_ack Pointer to dlsch_ue harq_ack status descriptor
|
||||
@param subframe Subframe for UE transmission (n in 36.213)
|
||||
@param o_ACK Pointer to ACK/NAK payload for PUCCH/PUSCH
|
||||
@returns status indicator for PUCCH/PUSCH transmission
|
||||
*/
|
||||
uint8_t nr_reset_ack(NR_DL_FRAME_PARMS *frame_parms,
|
||||
nr_harq_status_t *harq_ack,
|
||||
unsigned char subframe_tx,
|
||||
unsigned char subframe_rx,
|
||||
unsigned char *o_ACK,
|
||||
uint8_t *pN_bundled,
|
||||
uint8_t cw_idx);
|
||||
|
||||
/*! \brief Compute UL ACK subframe from DL subframe. This is used to retrieve corresponding DLSCH HARQ pid at eNB upon reception of ACK/NAK information on PUCCH/PUSCH. Derived from Table 10.1-1 in 36.213 (p. 69 in version 8.6)
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param subframe Subframe for UE transmission (n in 36.213)
|
||||
@param ACK_index TTI bundling index (0,1)
|
||||
@returns Subframe index for corresponding DL transmission
|
||||
*/
|
||||
uint8_t nr_ul_ACK_subframe2_dl_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t subframe,uint8_t ACK_index);
|
||||
|
||||
/*! \brief Computes number of DL subframes represented by a particular ACK received on UL (M from Table 10.1-1 in 36.213, p. 69 in version 8.6)
|
||||
@param frame_parms Pointer to DL frame parameter descriptor
|
||||
@param subframe Subframe for UE transmission (n in 36.213)
|
||||
@returns Number of DL subframes (M)
|
||||
*/
|
||||
uint8_t nr_ul_ACK_subframe2_M(NR_DL_FRAME_PARMS *frame_parms,unsigned char subframe);
|
||||
|
||||
/*! \brief Indicates the SR TXOp in current subframe. Implements Table 10.1-5 from 36.213.
|
||||
@param phy_vars_ue Pointer to UE variables
|
||||
@param proc Pointer to RXn_TXnp4 thread context
|
||||
@param eNB_id ID of eNB which is to receive the SR
|
||||
@returns 1 if TXOp is active.
|
||||
*/
|
||||
uint8_t nr_is_SR_TXOp(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id);
|
||||
|
||||
/*! \brief Gives the UL subframe corresponding to a PDDCH order in subframe n
|
||||
@param frame_parms Pointer to DL frame parameters
|
||||
@param proc Pointer to RXn-TXnp4 proc information
|
||||
@param n subframe of PDCCH
|
||||
@returns UL subframe corresponding to pdcch order
|
||||
*/
|
||||
uint8_t nr_pdcch_alloc2ul_subframe(NR_DL_FRAME_PARMS *frame_parms,uint8_t n);
|
||||
|
||||
/*! \brief Gives the UL frame corresponding to a PDDCH order in subframe n
|
||||
@param frame_parms Pointer to DL frame parameters
|
||||
@param frame Frame of received PDCCH
|
||||
@param n subframe of PDCCH
|
||||
@returns UL frame corresponding to pdcch order
|
||||
*/
|
||||
uint32_t nr_pdcch_alloc2ul_frame(NR_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n);
|
||||
|
||||
|
||||
uint16_t nr_get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
|
||||
|
||||
|
||||
int8_t nr_find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
|
||||
|
||||
void nr_process_timing_advance(module_id_t Mod_id,uint8_t CC_id,int16_t timing_advance);
|
||||
void nr_process_timing_advance_rar(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint16_t timing_advance);
|
||||
|
||||
unsigned int get_tx_amp(int power_dBm, int power_max_dBm, int N_RB_UL, int nb_rb);
|
||||
|
||||
void phy_reset_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/*! \brief This function retrives the resource (n1_pucch) corresponding to a PDSCH transmission in
|
||||
subframe n-4 which is acknowledged in subframe n (for FDD) according to n1_pucch = Ncce + N1_pucch. For
|
||||
TDD, this routine computes the complex procedure described in Section 10.1 of 36.213 (through tables 10.1-1,10.1-2)
|
||||
@param phy_vars_ue Pointer to UE variables
|
||||
@param proc Pointer to RXn-TXnp4 proc information
|
||||
@param harq_ack Pointer to dlsch_ue harq_ack status descriptor
|
||||
@param eNB_id Index of eNB
|
||||
@param b Pointer to PUCCH payload (b[0],b[1])
|
||||
@param SR 1 means there's a positive SR in parallel to ACK/NAK
|
||||
@returns n1_pucch
|
||||
*/
|
||||
uint16_t nr_get_n1_pucch(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
nr_harq_status_t *harq_ack,
|
||||
uint8_t eNB_id,
|
||||
uint8_t *b,
|
||||
uint8_t SR);
|
||||
|
||||
|
||||
/*! \brief This function retrieves the PHY UE mode. It is used as a helper function for the UE MAC.
|
||||
@param Mod_id Local UE index on which to act
|
||||
@param CC_id Component Carrier Index
|
||||
@param eNB_index ID of eNB
|
||||
@returns UE mode
|
||||
*/
|
||||
UE_MODE_t get_ue_mode(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
|
||||
|
||||
/*! \brief This function implements the power control mechanism for PUCCH from 36.213.
|
||||
@param phy_vars_ue PHY variables
|
||||
@param proc Pointer to proc descriptor
|
||||
@param eNB_id Index of eNB
|
||||
@param pucch_fmt Format of PUCCH that is being transmitted
|
||||
@returns Transmit power
|
||||
*/
|
||||
int16_t nr_pucch_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t subframe,uint8_t eNB_id,PUCCH_FMT_t pucch_fmt);
|
||||
|
||||
/*! \brief This function implements the power control mechanism for PUCCH from 36.213.
|
||||
@param phy_vars_ue PHY variables
|
||||
@param proc Pointer to proc descriptor
|
||||
@param eNB_id Index of eNB
|
||||
@param j index of type of PUSCH (SPS, Normal, Msg3)
|
||||
@returns Transmit power
|
||||
*/
|
||||
void nr_pusch_power_cntl(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag);
|
||||
|
||||
/*! \brief This function implements the power control mechanism for SRS from 36.213.
|
||||
@param phy_vars_ue PHY variables
|
||||
@param proc Pointer to proc descriptor
|
||||
@param eNB_id Index of eNB
|
||||
@param j index of type of PUSCH (SPS, Normal, Msg3)
|
||||
@returns Transmit power
|
||||
*/
|
||||
void nr_srs_power_cntl(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t *pnb_rb_srs, uint8_t abstraction_flag);
|
||||
|
||||
void nr_get_cqipmiri_params(PHY_VARS_NR_UE *ue,uint8_t eNB_id);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void nr_dump_dlsch(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe,uint8_t harq_pid);
|
||||
void nr_dump_dlsch_SI(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
void nr_dump_dlsch_ra(PHY_VARS_NR_UE *phy_vars_ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t subframe);
|
||||
|
||||
|
||||
int nr_is_srs_occasion_common(NR_DL_FRAME_PARMS *frame_parms,int frame_tx,int subframe_tx);
|
||||
|
||||
void nr_compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeriodicity,uint16_t *psrsOffset);
|
||||
|
||||
/*@}*/
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file extern.h
|
||||
* \brief mac externs
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1.0
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MAC_EXTERN_H__
|
||||
#define __MAC_EXTERN_H__
|
||||
|
||||
|
||||
#ifdef USER_MODE
|
||||
//#include "stdio.h"
|
||||
#endif //USER_MODE
|
||||
//#include "PHY/defs.h"
|
||||
#include "PHY/defs_nr_UE.h"
|
||||
#include "defs.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
#ifdef PHY_EMUL
|
||||
//#include "SIMULATION/simulation_defs.h"
|
||||
#endif //PHY_EMUL
|
||||
//#include "PHY_INTERFACE/defs.h"
|
||||
//#include "RRC/LITE/defs.h"
|
||||
|
||||
extern const uint32_t BSR_TABLE[BSR_TABLE_SIZE];
|
||||
//extern uint32_t EBSR_Level[63];
|
||||
extern const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE];
|
||||
//extern uint32_t Extended_BSR_TABLE[63]; ----currently not used
|
||||
|
||||
extern const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE];
|
||||
|
||||
extern UE_MAC_INST *UE_mac_inst;
|
||||
extern eNB_MAC_INST *eNB_mac_inst;
|
||||
extern eNB_RRC_INST *eNB_rrc_inst;
|
||||
extern UE_RRC_INST *UE_rrc_inst;
|
||||
extern UE_MAC_INST *ue_mac_inst;
|
||||
extern MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
extern uint8_t Is_rrc_registered;
|
||||
|
||||
extern eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
|
||||
extern eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
|
||||
|
||||
|
||||
|
||||
//#ifndef USER_MODE
|
||||
//extern MAC_xface *mac_xface;
|
||||
extern RRC_XFACE *Rrc_xface;
|
||||
|
||||
extern uint8_t Is_rrc_registered;
|
||||
|
||||
#ifndef PHY_EMUL
|
||||
#ifndef PHYSIM
|
||||
#define NB_INST 1
|
||||
#else
|
||||
extern unsigned char NB_INST;
|
||||
#endif
|
||||
extern unsigned char NB_eNB_INST;
|
||||
extern unsigned char NB_UE_INST;
|
||||
extern unsigned char NB_RN_INST;
|
||||
extern unsigned short NODE_ID[1];
|
||||
extern void* bigphys_malloc(int);
|
||||
#else
|
||||
extern EMULATION_VARS *Emul_vars;
|
||||
#endif //PHY_EMUL
|
||||
|
||||
|
||||
extern int cqi_to_mcs[16];
|
||||
|
||||
extern uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
extern uint8_t rb_table[33];
|
||||
|
||||
extern DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
|
||||
|
||||
extern DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu;
|
||||
extern DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A;
|
||||
extern DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
|
||||
|
||||
extern DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
|
||||
extern DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
|
||||
|
||||
extern DCI0_5MHz_FDD_t UL_alloc_pdu_fdd;
|
||||
|
||||
extern DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd;
|
||||
extern DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd;
|
||||
extern DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd;
|
||||
|
||||
extern DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd;
|
||||
extern DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd;
|
||||
|
||||
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
|
||||
extern DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
|
||||
extern DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
|
||||
|
||||
#endif //DEF_H
|
||||
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/*
|
||||
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The OpenAirInterface Software Alliance licenses this file to You under
|
||||
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.openairinterface.org/?page_id=698
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*-------------------------------------------------------------------------------
|
||||
* For more information about the OpenAirInterface (OAI) Software Alliance:
|
||||
* contact@openairinterface.org
|
||||
*/
|
||||
|
||||
/*! \file vars.h
|
||||
* \brief mac vars
|
||||
* \author Navid Nikaein and Raymond Knopp
|
||||
* \date 2010 - 2014
|
||||
* \version 1.0
|
||||
* \email navid.nikaein@eurecom.fr
|
||||
* @ingroup _mac
|
||||
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __MAC_VARS_H__
|
||||
#define __MAC_VARS_H__
|
||||
#ifdef USER_MODE
|
||||
//#include "stdio.h"
|
||||
#endif //USER_MODE
|
||||
#include "PHY/defs.h"
|
||||
#include "defs.h"
|
||||
#include "PHY_INTERFACE/defs.h"
|
||||
#include "COMMON/mac_rrc_primitives.h"
|
||||
|
||||
const uint32_t BSR_TABLE[BSR_TABLE_SIZE]= {0,10,12,14,17,19,22,26,31,36,42,49,57,67,78,91,
|
||||
105,125,146,171,200,234,274,321,376,440,515,603,706,826,967,1132,
|
||||
1326,1552,1817,2127,2490,2915,3413,3995,4677,5467,6411,7505,8787,10287,12043,14099,
|
||||
16507,19325,22624,26487,31009,36304,42502,49759,58255,68201,79846,93479,109439, 128125,150000, 300000
|
||||
};
|
||||
// extended bsr table--currently not used
|
||||
const uint32_t Extended_BSR_TABLE[BSR_TABLE_SIZE] = {0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,
|
||||
181,223,274,337,414,509,625,769,945,1162,1429,
|
||||
1757,2161,2657,3267,4017,4940,6074,7469,9185,
|
||||
11294,13888,17077,20999,25822,31752,39045,48012,
|
||||
59039,72598,89272,109774,134986,165989,204111,
|
||||
250990,308634,379519,466683,573866,705666,867737,
|
||||
1067031,1312097,1613447,1984009,2439678,3000000,
|
||||
6000000};
|
||||
|
||||
//#define MAX_SIZE_OF_AGG3 576
|
||||
//#define MAX_SIZE_OF_AGG2 288
|
||||
//#define MAX_SIZE_OF_AGG1 144
|
||||
//#define MAX_SIZE_OF_AGG0 72
|
||||
|
||||
/*
|
||||
* If the CQI is low, then scheduler will use a higher aggregation level and lower aggregation level otherwise
|
||||
* this is also dependent to transmission mode, where an offset could be defined
|
||||
*/
|
||||
// the follwoing three tables are calibrated for TXMODE 1 and 2
|
||||
const uint8_t cqi2fmt0_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= {
|
||||
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 37 bits
|
||||
//{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
|
||||
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 41
|
||||
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 43
|
||||
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE = 44
|
||||
};
|
||||
const uint8_t cqi2fmt1x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= {
|
||||
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size < 38 bits
|
||||
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE < 43
|
||||
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE < 47
|
||||
{3, 3, 3, 3, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0} // 20_DCI0_CRC_SIZE < 55
|
||||
};
|
||||
const uint8_t cqi2fmt2x_agg[MAX_SUPPORTED_BW][CQI_VALUE_RANGE]= {
|
||||
{3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0}, // 1.4_DCI0_CRC_Size= 47 bits
|
||||
{3, 3, 3, 3, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0}, // 5_DCI0_CRC_SIZE = 55
|
||||
{3, 3, 3, 3, 2, 2, 2, 1, 1, 1, 1, 0, 0, 0, 0, 0}, // 10_DCI0_CRC_SIZE = 59
|
||||
{3, 3, 3, 3, 3, 2, 2, 2, 2, 2, 1, 1, 1, 1, 0, 0} // 20_DCI0_CRC_SIZE = 64
|
||||
};
|
||||
|
||||
//uint32_t EBSR_Level[63]={0,10,13,16,19,23,29,35,43,53,65,80,98,120,147,181};
|
||||
|
||||
MAC_xface *mac_xface;
|
||||
|
||||
uint32_t RRC_CONNECTION_FLAG;
|
||||
|
||||
UE_MAC_INST *UE_mac_inst; //[NB_MODULE_MAX];
|
||||
eNB_MAC_INST *eNB_mac_inst; //[NB_MODULE_MAX];
|
||||
MAC_RLC_XFACE *Mac_rlc_xface;
|
||||
|
||||
/// Primary component carrier index of eNB
|
||||
int pCC_id[NUMBER_OF_eNB_MAX];
|
||||
|
||||
|
||||
|
||||
eNB_ULSCH_INFO eNB_ulsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
|
||||
eNB_DLSCH_INFO eNB_dlsch_info[NUMBER_OF_eNB_MAX][MAX_NUM_CCs][NUMBER_OF_UE_MAX]; // eNBxUE = 8x8
|
||||
|
||||
/*
|
||||
#ifndef USER_MODE
|
||||
RRC_XFACE *Rrc_xface;
|
||||
MAC_xface *mac_xface;
|
||||
#else
|
||||
#include "PHY_INTERFACE/extern.h"
|
||||
#include "RRC/LITE/extern.h"
|
||||
#endif
|
||||
*/
|
||||
|
||||
uint8_t Is_rrc_registered;
|
||||
|
||||
#ifdef OPENAIR2
|
||||
unsigned char NB_eNB_INST=0;
|
||||
unsigned char NB_UE_INST=0;
|
||||
unsigned char NB_RN_INST=0;
|
||||
unsigned char NB_INST=0;
|
||||
#endif
|
||||
|
||||
|
||||
DCI0_5MHz_TDD_1_6_t UL_alloc_pdu;
|
||||
|
||||
DCI1A_5MHz_TDD_1_6_t DLSCH_alloc_pdu1A;
|
||||
DCI1A_5MHz_TDD_1_6_t RA_alloc_pdu;
|
||||
DCI1A_5MHz_TDD_1_6_t BCCH_alloc_pdu;
|
||||
|
||||
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
|
||||
DCI1_5MHz_TDD_t DLSCH_alloc_pdu;
|
||||
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
DCI1C_5MHz_t MCCH_alloc_pdu;
|
||||
#endif
|
||||
|
||||
DCI0_5MHz_FDD_t UL_alloc_pdu_fdd;
|
||||
|
||||
DCI1A_5MHz_FDD_t DLSCH_alloc_pdu1A_fdd;
|
||||
DCI1A_5MHz_FDD_t RA_alloc_pdu_fdd;
|
||||
DCI1A_5MHz_FDD_t BCCH_alloc_pdu_fdd;
|
||||
|
||||
DCI1A_5MHz_FDD_t CCCH_alloc_pdu_fdd;
|
||||
DCI1_5MHz_FDD_t DLSCH_alloc_pdu_fdd;
|
||||
|
||||
DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu1;
|
||||
DCI2_5MHz_2A_TDD_t DLSCH_alloc_pdu2;
|
||||
|
||||
DCI1E_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu1E;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
|
||||
#undef MALLOC //there are two conflicting definitions, so we better make sure we don't use it at all
|
||||
|
||||
@@ -74,6 +74,7 @@
|
||||
#include "LAYER2/MAC/mac_extern.h"
|
||||
#include "PHY/LTE_TRANSPORT/transport_proto.h"
|
||||
#include "SCHED/sched_eNB.h"
|
||||
#include "SCHED_NR/sched_nr.h"
|
||||
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
|
||||
#include "PHY/INIT/phy_init.h"
|
||||
|
||||
@@ -332,7 +333,7 @@ static inline void fh_if5_mobipass_south_out(RU_t *ru) {
|
||||
static inline void fh_if4p5_south_out(RU_t *ru) {
|
||||
if (ru == RC.ru[0]) VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_TST, ru->proc.timestamp_tx&0xffffffff );
|
||||
LOG_D(PHY,"Sending IF4p5 for frame %d subframe %d\n",ru->proc.frame_tx,ru->proc.subframe_tx);
|
||||
if (subframe_select(&ru->frame_parms,ru->proc.subframe_tx)!=SF_UL)
|
||||
if (nr_subframe_select(&ru->gNB_list[0]->gNB_config,ru->proc.subframe_tx)!=SF_UL)
|
||||
send_IF4p5(ru,ru->proc.frame_tx, ru->proc.subframe_tx, IF4p5_PDLFFT);
|
||||
}
|
||||
|
||||
@@ -380,7 +381,7 @@ void fh_if4p5_south_in(RU_t *ru,int *frame,int *subframe) {
|
||||
|
||||
uint16_t packet_type;
|
||||
uint32_t symbol_number=0;
|
||||
uint32_t symbol_mask_full;
|
||||
uint32_t symbol_mask_full=0;
|
||||
/*
|
||||
if ((fp->frame_type == TDD) && (subframe_select(fp,*subframe)==SF_S))
|
||||
symbol_mask_full = (1<<fp->ul_symbols_in_S_subframe)-1;
|
||||
@@ -2155,7 +2156,7 @@ void init_RU(char *rf_config_file) {
|
||||
gNB0 = ru->gNB_list[0];
|
||||
fp = ru->nr_frame_parms;
|
||||
LOG_D(PHY, "RU FUnction:%d ru->if_south:%d\n", ru->function, ru->if_south);
|
||||
LOG_D(PHY, "gNB0:%p fp:%d\n", gNB0, fp);
|
||||
|
||||
if (gNB0)
|
||||
{
|
||||
if ((ru->function != NGFI_RRU_IF5) && (ru->function != NGFI_RRU_IF4p5))
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "PHY/types.h"
|
||||
|
||||
#include "flexran_agent.h"
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
#if defined(ENABLE_USE_MME)
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
// Comments
|
||||
|
||||
pipeline {
|
||||
agent {
|
||||
label 'bellatrix'
|
||||
}
|
||||
options {
|
||||
disableConcurrentBuilds()
|
||||
timestamps()
|
||||
gitLabConnection('OAI GitLab')
|
||||
gitlabBuilds(builds: ["Build eNb-USRP", "Build basic-sim", "Build phy-sim", "Analysis with cppcheck"])
|
||||
}
|
||||
|
||||
stages {
|
||||
stage ("Verify Guidelines") {
|
||||
steps {
|
||||
echo "Git URL is ${GIT_URL}"
|
||||
echo "GitLab Act is ${env.gitlabActionType}"
|
||||
script {
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
// GitLab-Jenkins plugin integration is lacking to perform the merge by itself
|
||||
// Doing it manually --> it may have merge conflicts
|
||||
sh "./ci-scripts/doGitLabMerge.sh --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
sh "zip -r -qq localZip.zip ."
|
||||
|
||||
// Running astyle options on the list of modified files by the merge request
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh --src-branch ${env.gitlabSourceBranch} --target-branch ${env.gitlabTargetBranch}"
|
||||
def res=readFile('./oai_rules_result.txt').trim();
|
||||
if ("0".equals(res)) {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): All Changed files in Merge Request follow OAI Formatting Rules"
|
||||
addGitLabMRComment comment: message
|
||||
} else {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): Some Changed files in Merge Request DO NOT follow OAI Formatting Rules"
|
||||
addGitLabMRComment comment: message
|
||||
}
|
||||
} else {
|
||||
echo "Git Branch is ${GIT_BRANCH}"
|
||||
echo "Git Commit is ${GIT_COMMIT}"
|
||||
|
||||
sh "zip -r -qq localZip.zip ."
|
||||
// Running astyle options on all C/H files in the repository
|
||||
// For the moment, there is no fail criteria. Just a notification of number of files that do not follow
|
||||
sh "./ci-scripts/checkCodingFormattingRules.sh"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Variant Builds") {
|
||||
parallel {
|
||||
stage ("Analysis with cppcheck") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Analysis with cppcheck") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant cppcheck --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNb-USRP") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNb-USRP") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build basic simulator") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build basic-sim") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant basic-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build physical simulators") {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build phy-sim") {
|
||||
sh "./ci-scripts/buildOnVM.sh --workspace $WORKSPACE --variant phy-sim --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
dir ('archives') {
|
||||
sh "zip -r vm_build_logs.zip basic_sim enb_usrp phy_sim cppcheck"
|
||||
}
|
||||
if(fileExists('archives/vm_build_logs.zip')) {
|
||||
archiveArtifacts artifacts: 'archives/vm_build_logs.zip'
|
||||
}
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger merge-request --src-branch ${env.gitlabSourceBranch} --src-commit ${env.gitlabMergeRequestLastCommit} --target-branch ${env.gitlabTargetBranch} --target-commit ${GIT_COMMIT}"
|
||||
} else {
|
||||
sh "./ci-scripts/reportBuildLocally.sh --git-url ${GIT_URL} --job-name ${JOB_NAME} --build-id ${BUILD_ID} --trigger push --branch ${GIT_BRANCH} --commit ${GIT_COMMIT}"
|
||||
}
|
||||
if(fileExists('build_results.html')) {
|
||||
archiveArtifacts artifacts: 'build_results.html'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stage ("Destroy all Virtual Machines") {
|
||||
steps {
|
||||
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
always {
|
||||
script {
|
||||
// Stage destroy may not be run if error in previous stage
|
||||
sh "./ci-scripts/destroyAllRunningVM.sh --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
success {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ")"
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
echo "This is a MERGE event"
|
||||
addGitLabMRComment comment: message
|
||||
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): passed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
||||
slackSend channel: 'ci-enb', color: 'good', message: message2
|
||||
} else {
|
||||
slackSend channel: 'ci-enb', color: 'good', message: message
|
||||
}
|
||||
}
|
||||
}
|
||||
failure {
|
||||
script {
|
||||
def message = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ")"
|
||||
if ("MERGE".equals(env.gitlabActionType)) {
|
||||
echo "This is a MERGE event"
|
||||
addGitLabMRComment comment: message
|
||||
def message2 = "OAI " + JOB_NAME + " build (" + BUILD_ID + "): failed (" + BUILD_URL + ") -- MergeRequest #" + env.gitlabMergeRequestIid + " (" + env.gitlabMergeRequestTitle + ")"
|
||||
slackSend channel: 'ci-enb', color: 'danger', message: message2
|
||||
} else {
|
||||
slackSend channel: 'ci-enb', color: 'danger', message: message
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user