Merge branch 'develop' of https://gitlab.eurecom.fr/oai/openairinterface5g into develop
Conflicts: openair1/SIMULATION/NR_PHY/ulsim.c
This commit is contained in:
@@ -21,3 +21,7 @@ The Regents of the University of California: BSD 3-Clause Licence.
|
||||
|
||||
Niels Provos <provos@citi.umich.edu>: BSD 2-Clause Licence.
|
||||
|
||||
## Credits for source code openair3/GTPV1-U/nw-gtpv1u: ##
|
||||
|
||||
Amit Chawre <http://www.amitchawre.net/contact.html>: BSD 2-Clause Licence.
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@ def sendSocialMediaMessage(pipeChannel, pipeColor, pipeMessage) {
|
||||
}
|
||||
}
|
||||
|
||||
def doRedHatBuild = false
|
||||
def doFlexranCtrlTest = false
|
||||
|
||||
// Location of the executor node
|
||||
@@ -85,21 +84,6 @@ pipeline {
|
||||
echo "Platform is ${env.TESTPLATFORM_OWNER}"
|
||||
}
|
||||
|
||||
if (params.RedHatRemoteServer == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.RedHatRemoteCredentials == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (params.RedHatWorkingPath == null) {
|
||||
allParametersPresent = false
|
||||
}
|
||||
if (allParametersPresent) {
|
||||
echo "Performing Red Hat Build"
|
||||
doRedHatBuild = true
|
||||
} else {
|
||||
doRedHatBuild = false
|
||||
}
|
||||
if (params.FlexRanRtcGitLabRepository_Credentials != null) {
|
||||
doFlexranCtrlTest = true
|
||||
}
|
||||
@@ -279,7 +263,7 @@ pipeline {
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNB-USRP") {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID} --keep-vm-alive"
|
||||
sh "./ci-scripts/oai-ci-vm-tool wait --workspace $WORKSPACE --variant enb-usrp --job-name ${JOB_NAME} --build-id ${BUILD_ID}"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,28 +295,6 @@ pipeline {
|
||||
}
|
||||
}
|
||||
}
|
||||
stage ("Build eNB-USRP on Red Hat") {
|
||||
when {
|
||||
expression {doRedHatBuild}
|
||||
}
|
||||
steps {
|
||||
gitlabCommitStatus(name: "Build eNB-USRP-RHE") {
|
||||
script {
|
||||
try {
|
||||
withCredentials([
|
||||
[$class: 'UsernamePasswordMultiBinding', credentialsId: "${params.RedHatRemoteCredentials}", usernameVariable: 'RH_Username', passwordVariable: 'RH_Password']
|
||||
]) {
|
||||
timeout (time: 20, unit: 'MINUTES') {
|
||||
sh "./ci-scripts/buildOnRH.sh --workspace $WORKSPACE --job-name ${JOB_NAME} --build-id ${BUILD_ID} --remote-host ${params.RedHatRemoteServer} --remote-path ${params.RedHatWorkingPath} --remote-user-name ${RH_Username} --remote-password ${RH_Password}"
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
echo "Red Hat build failed but we could keep running pipeline if all ubuntu-based build passed"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
post {
|
||||
failure {
|
||||
|
||||
@@ -77,7 +77,7 @@ then
|
||||
IS_NFAPI=`echo $FILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext"`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FILE`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FILE`
|
||||
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h"`
|
||||
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_"`
|
||||
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
|
||||
then
|
||||
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
|
||||
@@ -194,12 +194,12 @@ do
|
||||
IS_NFAPI=`echo $FULLFILE | egrep -c "nfapi/open-nFAPI|nfapi/oai_integration/vendor_ext"`
|
||||
IS_OAI_LICENCE_PRESENT=`egrep -c "OAI Public License" $FULLFILE`
|
||||
IS_BSD_LICENCE_PRESENT=`egrep -c "the terms of the BSD Licence" $FULLFILE`
|
||||
IS_EXCEPTION=`echo $FILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h"`
|
||||
IS_EXCEPTION=`echo $FULLFILE | egrep -c "common/utils/collection/tree.h|common/utils/collection/queue.h|common/utils/itti_analyzer/common/queue.h|openair3/UTILS/tree.h|openair3/UTILS/queue.h|openair3/GTPV1-U/nw-gtpv1u|openair2/UTIL/OPT/ws_"`
|
||||
if [ $IS_OAI_LICENCE_PRESENT -eq 0 ] && [ $IS_BSD_LICENCE_PRESENT -eq 0 ]
|
||||
then
|
||||
if [ $IS_NFAPI -eq 0 ] && [ $IS_EXCEPTION -eq 0 ]
|
||||
then
|
||||
echo $FILE >> ./files-w-suspect-banner.txt
|
||||
echo $FULLFILE >> ./files-w-suspect-banner.txt
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -184,6 +184,8 @@ eNBs =
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -367,6 +367,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -188,6 +188,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -189,6 +189,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
///M2
|
||||
target_mce_m2_ip_address = ( { ipv4 = "127.0.0.7";
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -145,6 +145,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -184,6 +184,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
target_enb_x2_ip_address = (
|
||||
{ ipv4 = "CI_RCC_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -192,6 +192,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -144,6 +144,8 @@ eNBs =
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_size = 5;
|
||||
discRxPool_ResourceConfig_subframeBitmap_choice_bs_bits_unused = 0;
|
||||
|
||||
//SSB central frequency of NR secondary cell group (for ENDC NSA)
|
||||
nr_scg_ssb_freq = 641272;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -190,6 +192,8 @@ eNBs =
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -183,6 +183,8 @@ eNBs =
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
target_enb_x2_ip_address = (
|
||||
{ ipv4 = "CI_RCC_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
|
||||
@@ -131,12 +131,12 @@ gNBs =
|
||||
# 0=unrestricted, 1=restricted type A, 2=restricted type B
|
||||
restrictedSetConfig = 0,
|
||||
# pusch-ConfigCommon (up to 16 elements)
|
||||
initialULBWPk2_0 = 2;
|
||||
initialULBWPk2_0 = 6;
|
||||
initialULBWPmappingType_0 = 1
|
||||
# this is SS=0 L=11
|
||||
initialULBWPstartSymbolAndLength_0 = 55;
|
||||
|
||||
initialULBWPk2_1 = 2;
|
||||
initialULBWPk2_1 = 6;
|
||||
initialULBWPmappingType_1 = 1;
|
||||
# this is SS=0 L=12
|
||||
initialULBWPstartSymbolAndLength_1 = 69;
|
||||
|
||||
@@ -210,6 +210,8 @@ gNBs =
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
target_enb_x2_ip_address = (
|
||||
{ ipv4 = "CI_FR1_CTL_ENB_IP_ADDR";
|
||||
ipv6 = "192:168:30::17";
|
||||
|
||||
@@ -184,6 +184,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -185,6 +185,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
////////// MCE parameters:
|
||||
target_mce_m2_ip_address = ( { ipv4 = "127.0.0.7";
|
||||
|
||||
@@ -185,6 +185,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
////////// MCE parameters:
|
||||
target_mce_m2_ip_address = ( { ipv4 = "127.0.0.7";
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -150,6 +150,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -150,6 +150,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -150,6 +150,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -155,6 +155,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
|
||||
////////// MCE parameters:
|
||||
|
||||
@@ -155,6 +155,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
|
||||
////////// MCE parameters:
|
||||
|
||||
@@ -185,6 +185,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -765,6 +765,59 @@ function report_test {
|
||||
echo " <td align = \"center\" colspan = 4 >Test without EPC (aka noS1): ${TMODE} -- ${BW}PRB </td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
|
||||
#RA test (--do-ra option)
|
||||
|
||||
#build log files names
|
||||
RA_ENB_LOG=$ARCHIVES_LOC/ra_check_${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
|
||||
RA_UE_LOG=$ARCHIVES_LOC/ra_check_${TMODE}_${BW}prb_${CN_CONFIG}_ue.log
|
||||
if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
|
||||
then
|
||||
#get rid of full path
|
||||
NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
|
||||
echo " <td>Check if RA proc succeeded</td>" >> ./test_simulator_results.html
|
||||
|
||||
#gNB RA check
|
||||
GNB_RECEIVED=`egrep -c "received correctly" $RA_ENB_LOG`
|
||||
GNB_CONNECTED=`egrep -c "now 5G connected" $RA_ENB_LOG`
|
||||
#UE RA check
|
||||
UE_RA_PROC_OK=`egrep -c "RA procedure succeeded" $RA_UE_LOG`
|
||||
|
||||
|
||||
if [ $GNB_RECEIVED -gt 0 ] && [ $GNB_CONNECTED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
echo " <td><pre>" >> ./test_simulator_results.html
|
||||
if [ $GNB_RECEIVED -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- gNB --> RA received</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- gNB RA NOT RECEIVED</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $GNB_CONNECTED -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- gNB --> 5G connected</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- gNB NOT 5G CONNECTED</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $UE_RA_PROC_OK -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- NR UE --> RA procedure succeded</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- NR UE RA procedure failed</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </pre></td>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
#SYNC test
|
||||
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
|
||||
UE_LOG=`echo $ENB_LOG | sed -e "s#gnb#ue#"`
|
||||
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
|
||||
|
||||
+104
-29
@@ -276,6 +276,22 @@ function check_ping_result {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
function check_ra_result {
|
||||
local LOC_GNB_LOG=$1
|
||||
local LOC_UE_LOG=$2
|
||||
|
||||
#gNB RA test
|
||||
echo "Checking gNB Log for RA success"
|
||||
egrep "received correctly" $1
|
||||
egrep "now 5G connected" $1
|
||||
|
||||
#UE RA test
|
||||
echo 'Checking UE Log for RA success'
|
||||
egrep "RA procedure succeeded" $2
|
||||
|
||||
}
|
||||
|
||||
# In DL: iperf server should be on UE side
|
||||
# -B oaitun_ue{j}-IP-Addr
|
||||
# iperf client should be on EPC (S1) or eNB (noS1) side
|
||||
@@ -1172,6 +1188,8 @@ function start_rf_sim_gnb {
|
||||
local LOC_CONF_FILE=$5
|
||||
# 1 is with S1 and 0 without S1 aka noS1
|
||||
local LOC_S1_CONFIGURATION=$6
|
||||
#LOC_RA_TEST=1 will run the RA test check
|
||||
local LOC_RA_TEST=$7
|
||||
|
||||
if [ -e rbconfig.raw ]; then rm -f rbconfig.raw; fi
|
||||
if [ -e reconfig.raw ]; then rm -f reconfig.raw; fi
|
||||
@@ -1192,7 +1210,12 @@ function start_rf_sim_gnb {
|
||||
echo "sudo rm -f r*config.raw" >> $1
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #RA test => use --do-ra option
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
echo "cat ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -1249,6 +1272,8 @@ function start_rf_sim_gnb {
|
||||
echo "RF-SIM gNB oaitun_enb1 is UP and CONFIGURED"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
sleep 10
|
||||
echo "echo \"free -m\"" > $1
|
||||
echo "free -m" >> $1
|
||||
@@ -1267,6 +1292,8 @@ function start_rf_sim_nr_ue {
|
||||
local LOC_FREQUENCY=$6
|
||||
# 1 is with S1 and 0 without S1 aka noS1
|
||||
local LOC_S1_CONFIGURATION=$7
|
||||
#LOC_RA_TEST=1 will run the RA test check
|
||||
local LOC_RA_TEST=$8
|
||||
|
||||
# Copy the RAW files from the gNB run
|
||||
scp -o StrictHostKeyChecking=no rbconfig.raw ubuntu@$LOC_NR_UE_VM_IP_ADDR:/home/ubuntu/tmp
|
||||
@@ -1281,7 +1308,12 @@ function start_rf_sim_nr_ue {
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
else #RA test => use --do-ra option
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --nokrnmod 1 --rfsim --do-ra --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
echo "cat ./my-nr-softmodem-run.sh" >> $1
|
||||
@@ -1340,6 +1372,8 @@ function start_rf_sim_nr_ue {
|
||||
echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED"
|
||||
fi
|
||||
sleep 10
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2027,30 +2061,6 @@ function run_test_on_vm {
|
||||
|
||||
done
|
||||
|
||||
full_l2_sim_destroy
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking run status"
|
||||
echo "############################################################"
|
||||
|
||||
if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $MBMS_STATUS -eq 0 ]
|
||||
then
|
||||
echo "LTE MBMS RFSIM seems OK"
|
||||
else
|
||||
echo "LTE MBMS RFSIM seems to FAIL"
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "LTE RFSIM seems OK"
|
||||
echo "LTE: TEST_OK" > $ARCHIVES_LOC/test_final_status.log
|
||||
else
|
||||
echo "LTE RFSIM seems to FAIL"
|
||||
echo "LTE: TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
fi
|
||||
|
||||
####################
|
||||
## FeMBMS CASE noS1 ##
|
||||
####################
|
||||
@@ -2123,6 +2133,13 @@ function run_test_on_vm {
|
||||
|
||||
if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $MBMS_STATUS -eq 0 ]
|
||||
then
|
||||
echo "LTE MBMS RFSIM seems OK"
|
||||
else
|
||||
echo "LTE MBMS RFSIM seems to FAIL"
|
||||
STATUS=-1
|
||||
fi
|
||||
if [ $FeMBMS_STATUS -eq 0 ]
|
||||
then
|
||||
echo "LTE FeMBMS RFSIM seems OK"
|
||||
@@ -2153,8 +2170,10 @@ function run_test_on_vm {
|
||||
NR_STATUS=0
|
||||
|
||||
######### start of loop
|
||||
while [ $try_cnt -lt 1 ]
|
||||
while [ $try_cnt -lt 4 ]
|
||||
do
|
||||
|
||||
#start RA test
|
||||
SYNC_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
@@ -2163,13 +2182,69 @@ function run_test_on_vm {
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
echo "############################################################"
|
||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG
|
||||
#last argument = 1 is to enable --do-ra for RA test
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||
echo "############################################################"
|
||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG
|
||||
#last argument = 1 is to enable --do-ra for RA test
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1
|
||||
if [ $NR_UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ gNB and NR-UE not syncing"
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
|
||||
SYNC_STATUS=-1
|
||||
try_cnt=$[$try_cnt+1]
|
||||
continue
|
||||
fi
|
||||
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
|
||||
echo "############################################################"
|
||||
sleep 20
|
||||
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
|
||||
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
|
||||
|
||||
|
||||
|
||||
#check RA markers in gNB and NR UE log files
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Checking RA on gNB / NR-UE"
|
||||
echo "############################################################"
|
||||
|
||||
mv $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_GNB_LOG_FILE
|
||||
mv $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_NR_UE_LOG_FILE
|
||||
check_ra_result $ARCHIVES_LOC/ra_check_$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_NR_UE_LOG_FILE
|
||||
|
||||
|
||||
#end RA test
|
||||
|
||||
|
||||
|
||||
|
||||
SYNC_STATUS=0
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
echo "############################################################"
|
||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 0
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||
echo "############################################################"
|
||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 0
|
||||
if [ $NR_UE_SYNC -eq 0 ]
|
||||
then
|
||||
echo "Problem w/ gNB and NR-UE not syncing"
|
||||
|
||||
@@ -2003,7 +2003,7 @@ add_dependencies(L2_UE rrc_flag s1ap_flag x2_flag)
|
||||
|
||||
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
|
||||
|
||||
add_library( MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_gNB/nr_compute_tbs_common.c)
|
||||
add_library( MAC_NR_COMMON ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_mac_common.c ${OPENAIR2_DIR}/LAYER2/NR_MAC_COMMON/nr_compute_tbs_common.c)
|
||||
|
||||
include_directories("${OPENAIR2_DIR}/NR_UE_PHY_INTERFACE")
|
||||
include_directories("${OPENAIR2_DIR}/LAYER2")
|
||||
@@ -2772,7 +2772,7 @@ if (NOT ${NOS1})
|
||||
endif()
|
||||
target_link_libraries (lte-uesoftmodem
|
||||
-Wl,--start-group
|
||||
RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP F1AP_LIB
|
||||
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP F1AP_LIB
|
||||
GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
|
||||
PHY_UE PHY_RU LFDS L2_UE L2_LTE LFDS7 SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
|
||||
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
|
||||
@@ -2792,6 +2792,7 @@ add_executable(nr-softmodem
|
||||
${s1ap_h}
|
||||
# ${OPENAIR_BIN_DIR}/messages_xml.h
|
||||
${OPENAIR_DIR}/executables/nr-gnb.c
|
||||
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
|
||||
${OPENAIR_DIR}/executables/nr-ru.c
|
||||
${OPENAIR_DIR}/executables/nr-softmodem.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
@@ -3023,12 +3024,15 @@ add_executable(nr_dlsim
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_dlsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR HASHTABLE -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
@@ -3039,14 +3043,18 @@ add_executable(nr_prachsim
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES})
|
||||
target_link_libraries(nr_prachsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB MAC_UE_NR SCHED_NR_UE_LIB RRC_LIB NR_RRC_LIB L2_NR CONFIG_LIB -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_RU PHY_NR_UE MAC_NR_COMMON SCHED_NR_LIB MAC_UE_NR SCHED_NR_UE_LIB RRC_LIB NR_RRC_LIB L2_NR CONFIG_LIB HASHTABLE -Wl,--end-group m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl)
|
||||
|
||||
add_executable(nr_ulschsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulschsim.c
|
||||
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
@@ -3061,16 +3069,20 @@ target_link_libraries(nr_ulschsim
|
||||
|
||||
add_executable(nr_ulsim
|
||||
${OPENAIR1_DIR}/SIMULATION/NR_PHY/ulsim.c
|
||||
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
|
||||
${OPENAIR_DIR}/common/utils/utils.c
|
||||
${OPENAIR_DIR}/common/utils/system.c
|
||||
${OPENAIR_DIR}/common/utils/nr/nr_common.c
|
||||
${OPENAIR_DIR}/executables/softmodem-common.c
|
||||
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
|
||||
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
|
||||
${NFAPI_USER_DIR}/nfapi.c
|
||||
${UTIL_SRC}
|
||||
${T_SOURCE}
|
||||
${SHLIB_LOADER_SOURCES}
|
||||
)
|
||||
target_link_libraries(nr_ulsim
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR -Wl,--end-group
|
||||
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR PHY_NR_COMMON PHY_NR_UE SCHED_NR_LIB SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_NR HASHTABLE -Wl,--end-group
|
||||
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
|
||||
)
|
||||
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -147,6 +147,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -149,6 +149,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -149,6 +149,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -149,6 +149,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
project (OpenAirInterface)
|
||||
set ( CMAKE_BUILD_TYPE )
|
||||
set ( CFLAGS_PROCESSOR_USER "" )
|
||||
set ( UE_EXPANSION False )
|
||||
set ( PRE_SCD_THREAD False )
|
||||
set ( UESIM_EXPANSION False )
|
||||
set ( ENABLE_VCD_FIFO False )
|
||||
set ( RF_BOARD "OAI_USRP")
|
||||
set ( RF_BOARD "None")
|
||||
set ( TRANSP_PRO "None")
|
||||
set ( PACKAGE_NAME "")
|
||||
set ( DEADLINE_SCHEDULER "False" )
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _TRACER_DEFS_H_
|
||||
#define _TRACER_DEFS_H_
|
||||
#ifndef _COMMON_UTILS_T_DEFS_H_
|
||||
#define _COMMON_UTILS_T_DEFS_H_
|
||||
|
||||
/* types of plots */
|
||||
#define PLOT_VS_TIME 0
|
||||
@@ -27,4 +27,4 @@ void *forwarder(char *ip, int port);
|
||||
void forward(void *forwarder, char *buf, int size);
|
||||
void forward_start_client(void *forwarder, int socket);
|
||||
|
||||
#endif /* _TRACER_DEFS_H_ */
|
||||
#endif /* _COMMON_UTILS_T_DEFS_H_ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _TRACER_DEFS_H_
|
||||
#define _TRACER_DEFS_H_
|
||||
#ifndef _COMMON_UTILS_T_TRACER_DEFS_H_
|
||||
#define _COMMON_UTILS_T_TRACER_DEFS_H_
|
||||
|
||||
/* types of plots */
|
||||
#define PLOT_VS_TIME 0
|
||||
@@ -21,4 +21,4 @@ void t_gui_start(void);
|
||||
void t_gui_set_input_signal(int eNB, int frame, int subframe, int antenna,
|
||||
int size, void *buf);
|
||||
|
||||
#endif /* _TRACER_DEFS_H_ */
|
||||
#endif /* _COMMON_UTILS_T_TRACER_DEFS_H_ */
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "no";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
+25
-1
@@ -100,13 +100,37 @@ Some other useful paramters of the UE are
|
||||
- --clock-source: sets the clock-source (internal or external).
|
||||
- --time-source: sets the time-source (internal or external).
|
||||
|
||||
|
||||
## noS1 setup with OAI UE
|
||||
|
||||
Instead of randomly generated payload, in the phy-test mode we can also inject/receive user-plane traffic over a TUN interface. This is the so-called noS1 mode.
|
||||
|
||||
This setup is described in the [rfsimulator page](../targets/ARCH/rfsimulator/README.md#5g-case). In theory this should also work with the real hardware target although this has yet to be tested.
|
||||
|
||||
## do-ra setup with OAI
|
||||
|
||||
The do-ra flag is used to ran the NR Random Access procedures in contention-free mode. Currently OAI implements the RACH process from Msg1 to Msg3.
|
||||
|
||||
In order to run the RA, the following flag is needed for both the gNB and the UE:
|
||||
|
||||
`--do-ra`
|
||||
|
||||
### Run OAI in do-ra mode
|
||||
|
||||
From the `cmake_targets/ran_build/build` folder:
|
||||
|
||||
gNB on machine 1:
|
||||
|
||||
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra`
|
||||
|
||||
UE on machine 2:
|
||||
|
||||
`sudo ./nr-uesoftmodem --do-ra`
|
||||
|
||||
With the RF simulator (on the same machine):
|
||||
|
||||
`sudo RFSIMULATOR=gnb ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-LTE-EPC/CONF/gnb.band78.tm1.106PRB.usrpn300.conf --do-ra --rfsim --parallel-config PARALLEL_SINGLE_THREAD`
|
||||
|
||||
`sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem --do-ra --rfsim --parallel-config PARALLEL_SINGLE_THREAD`
|
||||
|
||||
|
||||
[oai wiki home](https://gitlab.eurecom.fr/oai/openairinterface5g/wikis/home)
|
||||
|
||||
@@ -12,6 +12,7 @@ STATUS 2020/09/10 : updated the status of interop (end to end UL/DL traffic)
|
||||
7. [Log file monitoring](#log-file-monitoring)
|
||||
6. [Required tools for debug](#required-tools-for-debug)
|
||||
7. [Status of interoperability](#status-of-interoperability)
|
||||
8. [CI integration](#ci-integration)
|
||||
|
||||
## Configuration Overview
|
||||
|
||||
@@ -70,7 +71,7 @@ cd cmake_targets/
|
||||
- **EPC**
|
||||
|
||||
for reference:
|
||||
https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master-documentation/docs/DEPLOY_HOME.md
|
||||
https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/docs/DEPLOY_HOME.md
|
||||
|
||||
|
||||
|
||||
@@ -204,7 +205,7 @@ The test takes typically a few seconds, max 10-15 seconds. If it takes more than
|
||||
- **EPC** (on EPC host):
|
||||
|
||||
for reference:
|
||||
https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master-documentation/docs/DEPLOY_HOME.md
|
||||
https://github.com/OPENAIRINTERFACE/openair-epc-fed/blob/master/docs/DEPLOY_HOME.md
|
||||
|
||||
|
||||
|
||||
@@ -384,3 +385,16 @@ The following parts have been validated with FR1 COTS UE:
|
||||
some packet losses might still occur even in ideal channel conditions
|
||||
|
||||
|
||||
## CI integration
|
||||
The automation scripts are available on ILIADE.
|
||||
The end-to-end test is integrated in the CI flow in a semi-automated manner, comprising 3 steps:
|
||||
- update a YAML file comprising the IT resources definition, branch and commit number the test has to run on
|
||||
- run the python script that generates the test from the YAML file
|
||||
```
|
||||
python3 obj_build_from_yaml.py py_params_template.yaml fr1.sh
|
||||
```
|
||||
- run the test (fr1.sh)
|
||||
|
||||
At the date of writing, the test comprises the deployment of the components (epc, eNB, gNB, cots ue) and the execution of 2 pings procedures (20 pings in 20sec, then 5 pings in 1sec)
|
||||
|
||||
This automation is run for every integration branch to be merged into develop.
|
||||
|
||||
@@ -187,6 +187,8 @@ eNBs =
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
|
||||
NETWORK_INTERFACES :
|
||||
{
|
||||
|
||||
@@ -212,6 +212,8 @@ gNBs =
|
||||
enable_x2 = "yes";
|
||||
t_reloc_prep = 1000; /* unit: millisecond */
|
||||
tx2_reloc_overall = 2000; /* unit: millisecond */
|
||||
t_dc_prep = 1000; /* unit: millisecond */
|
||||
t_dc_overall = 2000; /* unit: millisecond */
|
||||
target_enb_x2_ip_address = (
|
||||
{ ipv4 = "192.168.18.199";
|
||||
ipv6 = "192:168:30::17";
|
||||
|
||||
+88
-14
@@ -139,7 +139,6 @@ extern void add_subframe(uint16_t *frameP, uint16_t *subframeP, int offset);
|
||||
//#define TICK_TO_US(ts) (ts.diff)
|
||||
#define TICK_TO_US(ts) (ts.trials==0?0:ts.diff/ts.trials)
|
||||
|
||||
|
||||
static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_tx, int slot_tx, char *thread_name) {
|
||||
|
||||
sl_ahead = sf_ahead*gNB->frame_parms.slots_per_subframe;
|
||||
@@ -178,6 +177,59 @@ static inline int rxtx(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int frame_t
|
||||
|
||||
T(T_GNB_PHY_DL_TICK, T_INT(gNB->Mod_id), T_INT(frame_tx), T_INT(slot_tx));
|
||||
|
||||
/* hack to remove UEs */
|
||||
extern int rnti_to_remove[10];
|
||||
extern volatile int rnti_to_remove_count;
|
||||
extern pthread_mutex_t rnti_to_remove_mutex;
|
||||
if (pthread_mutex_lock(&rnti_to_remove_mutex)) exit(1);
|
||||
int up_removed = 0;
|
||||
int down_removed = 0;
|
||||
int pucch_removed = 0;
|
||||
for (int i = 0; i < rnti_to_remove_count; i++) {
|
||||
LOG_W(PHY, "to remove rnti %d\n", rnti_to_remove[i]);
|
||||
void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
|
||||
void clean_gNB_dlsch(NR_gNB_DLSCH_t *dlsch);
|
||||
int j;
|
||||
for (j = 0; j < NUMBER_OF_NR_ULSCH_MAX; j++)
|
||||
if (gNB->ulsch[j][0]->rnti == rnti_to_remove[i]) {
|
||||
gNB->ulsch[j][0]->rnti = 0;
|
||||
gNB->ulsch[j][0]->harq_mask = 0;
|
||||
//clean_gNB_ulsch(gNB->ulsch[j][0]);
|
||||
int h;
|
||||
for (h = 0; h < NR_MAX_ULSCH_HARQ_PROCESSES; h++) {
|
||||
gNB->ulsch[j][0]->harq_processes[h]->status = SCH_IDLE;
|
||||
gNB->ulsch[j][0]->harq_processes[h]->round = 0;
|
||||
gNB->ulsch[j][0]->harq_processes[h]->handled = 0;
|
||||
}
|
||||
up_removed++;
|
||||
}
|
||||
for (j = 0; j < NUMBER_OF_NR_DLSCH_MAX; j++)
|
||||
if (gNB->dlsch[j][0]->rnti == rnti_to_remove[i]) {
|
||||
gNB->dlsch[j][0]->rnti = 0;
|
||||
gNB->dlsch[j][0]->harq_mask = 0;
|
||||
//clean_gNB_dlsch(gNB->dlsch[j][0]);
|
||||
down_removed++;
|
||||
}
|
||||
for (j = 0; j < NUMBER_OF_NR_PUCCH_MAX; j++)
|
||||
if (gNB->pucch[j]->active > 0 &&
|
||||
gNB->pucch[j]->pucch_pdu.rnti == rnti_to_remove[i]) {
|
||||
gNB->pucch[j]->active = 0;
|
||||
gNB->pucch[j]->pucch_pdu.rnti = 0;
|
||||
pucch_removed++;
|
||||
}
|
||||
#if 0
|
||||
for (j = 0; j < NUMBER_OF_NR_PDCCH_MAX; j++)
|
||||
gNB->pdcch_pdu[j].frame = -1;
|
||||
for (j = 0; j < NUMBER_OF_NR_PDCCH_MAX; j++)
|
||||
gNB->ul_pdcch_pdu[j].frame = -1;
|
||||
for (j = 0; j < NUMBER_OF_NR_PRACH_MAX; j++)
|
||||
gNB->prach_vars.list[j].frame = -1;
|
||||
#endif
|
||||
}
|
||||
if (rnti_to_remove_count) LOG_W(PHY, "to remove rnti_to_remove_count=%d, up_removed=%d down_removed=%d pucch_removed=%d\n", rnti_to_remove_count, up_removed, down_removed, pucch_removed);
|
||||
rnti_to_remove_count = 0;
|
||||
if (pthread_mutex_unlock(&rnti_to_remove_mutex)) exit(1);
|
||||
|
||||
/*
|
||||
// if this is IF5 or 3GPP_gNB
|
||||
if (gNB && gNB->RU_list && gNB->RU_list[0] && gNB->RU_list[0]->function < NGFI_RAU_IF4p5) {
|
||||
@@ -545,6 +597,8 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
|
||||
int i;
|
||||
struct timespec abstime;
|
||||
int time_ns = 50000;
|
||||
int wait_timer = 0;
|
||||
bool do_last_check = 1;
|
||||
|
||||
AssertFatal((ret=pthread_mutex_lock(&proc->mutex_RU))==0,"mutex_lock returns %d\n",ret);
|
||||
for (i=0; i<gNB->num_RU; i++) {
|
||||
@@ -565,22 +619,36 @@ int wakeup_rxtx(PHY_VARS_gNB *gNB,RU_t *ru) {
|
||||
AssertFatal((ret=pthread_mutex_unlock(&proc->mutex_RU))==0,"muex_unlock returns %d\n",ret);
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &abstime);
|
||||
abstime.tv_nsec = abstime.tv_nsec + time_ns;
|
||||
|
||||
if (abstime.tv_nsec >= 1000*1000*1000) {
|
||||
abstime.tv_nsec -= 1000*1000*1000;
|
||||
abstime.tv_sec += 1;
|
||||
}
|
||||
|
||||
// wake up TX for subframe n+sf_ahead
|
||||
// lock the TX mutex and make sure the thread is ready
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
while (wait_timer < 200) {
|
||||
clock_gettime(CLOCK_REALTIME, &abstime);
|
||||
abstime.tv_nsec = abstime.tv_nsec + time_ns;
|
||||
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
return(-1);
|
||||
if (abstime.tv_nsec >= 1000*1000*1000) {
|
||||
abstime.tv_nsec -= 1000*1000*1000;
|
||||
abstime.tv_sec += 1;
|
||||
}
|
||||
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so wait for a bit
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
wait_timer += 50;
|
||||
usleep(50);
|
||||
}
|
||||
else {
|
||||
do_last_check = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (do_last_check) {
|
||||
AssertFatal((ret=pthread_mutex_timedlock(&L1_proc->mutex, &abstime)) == 0,"mutex_lock returns %d\n", ret);
|
||||
if (L1_proc->instance_cnt == 0) { // L1_thread is busy so abort the subframe
|
||||
AssertFatal((ret=pthread_mutex_unlock( &L1_proc->mutex))==0,"muex_unlock return %d\n",ret);
|
||||
LOG_W(PHY,"L1_thread isn't ready in %d.%d, aborting RX processing\n",ru_proc->frame_rx,ru_proc->tti_rx);
|
||||
return (-1);
|
||||
}
|
||||
}
|
||||
|
||||
++L1_proc->instance_cnt;
|
||||
@@ -793,6 +861,12 @@ void init_gNB_proc(int inst) {
|
||||
pthread_mutex_init(&sync_phy_proc.mutex_phy_proc_tx, NULL);
|
||||
pthread_cond_init(&sync_phy_proc.cond_phy_proc_tx, NULL);
|
||||
sync_phy_proc.phy_proc_CC_id = 0;
|
||||
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
char ul_pool[] = "-1,-1";
|
||||
initTpool(ul_pool, gNB->threadPool, false);
|
||||
initNotifiedFIFO(gNB->respDecode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
+18
-1
@@ -420,7 +420,7 @@ void processSlotRX( PHY_VARS_NR_UE *UE, UE_nr_rxtx_proc_t *proc) {
|
||||
phy_procedures_slot_parallelization_nrUE_RX( UE, proc, 0, 0, 1, UE->mode, no_relay, NULL );
|
||||
#else
|
||||
uint64_t a=rdtsc();
|
||||
phy_procedures_nrUE_RX( UE, proc, 0, 1, UE->mode);
|
||||
phy_procedures_nrUE_RX( UE, proc, 0, UE->mode);
|
||||
LOG_D(PHY,"phy_procedures_nrUE_RX: slot:%d, time %lu\n", proc->nr_tti_rx, (rdtsc()-a)/3500);
|
||||
//printf(">>> nr_ue_pdcch_procedures ended\n");
|
||||
#endif
|
||||
@@ -839,6 +839,23 @@ void init_NR_UE(int nb_inst, char* rrc_config_path) {
|
||||
AssertFatal((rrc_inst = nr_l3_init_ue(rrc_config_path)) != NULL, "can not initialize RRC module\n");
|
||||
AssertFatal((mac_inst = nr_l2_init_ue(rrc_inst)) != NULL, "can not initialize L2 module\n");
|
||||
AssertFatal((mac_inst->if_module = nr_ue_if_module_init(inst)) != NULL, "can not initialize IF module\n");
|
||||
|
||||
NR_PUSCH_TimeDomainResourceAllocationList_t *pusch_TimeDomainAllocationList = NULL;
|
||||
if (mac_inst->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac_inst->ULbwp[0]->bwp_Dedicated->pusch_Config->choice.setup->pusch_TimeDomainAllocationList->choice.setup;
|
||||
}
|
||||
else if (mac_inst->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList) {
|
||||
pusch_TimeDomainAllocationList = mac_inst->ULbwp[0]->bwp_Common->pusch_ConfigCommon->choice.setup->pusch_TimeDomainAllocationList;
|
||||
}
|
||||
|
||||
if (pusch_TimeDomainAllocationList) {
|
||||
for(int i = 0; i < pusch_TimeDomainAllocationList->list.count; i++) {
|
||||
AssertFatal(*pusch_TimeDomainAllocationList->list.array[i]->k2 >= DURATION_RX_TO_TX,
|
||||
"Slot offset K2 (%ld) cannot be less than DURATION_RX_TO_TX (%d)\n",
|
||||
*pusch_TimeDomainAllocationList->list.array[i]->k2,
|
||||
DURATION_RX_TO_TX);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -21,8 +21,8 @@
|
||||
|
||||
/* Header file generated by fdesign on Thu Aug 28 12:13:51 2014 */
|
||||
|
||||
#ifndef FD_stats_form_h_
|
||||
#define FD_stats_form_h_
|
||||
#ifndef _EXECUTABLES_STATS_H_
|
||||
#define _EXECUTABLES_STATS_H_
|
||||
|
||||
#include <forms.h>
|
||||
|
||||
@@ -43,4 +43,4 @@ typedef struct {
|
||||
|
||||
extern FD_stats_form *create_form_stats_form( void );
|
||||
|
||||
#endif /* FD_stats_form_h_ */
|
||||
#endif /* _EXECUTABLES_STATS_H_ */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef _THREADS_T_H_
|
||||
#define _THREADS_T_H_
|
||||
#ifndef _EXECUTABLES_THREADS_T_H_
|
||||
#define _EXECUTABLES_THREADS_T_H_
|
||||
|
||||
typedef struct threads_s {
|
||||
int main;
|
||||
@@ -18,4 +18,4 @@ typedef struct threads_s {
|
||||
//int dlsch_td1_three;
|
||||
} threads_t;
|
||||
|
||||
#endif /* _THREADS_T_H_ */
|
||||
#endif /* _EXECUTABLES_THREADS_T_H_ */
|
||||
|
||||
@@ -415,8 +415,14 @@ typedef struct {
|
||||
uint8_t number_of_candidates;
|
||||
uint16_t CCE[64];
|
||||
uint8_t L[64];
|
||||
uint8_t dci_length;
|
||||
uint8_t dci_format;
|
||||
// 3GPP TS 38.212 Sec. 7.3.1.0, 3GPP TS 138.131 sec. 6.3.2 (SearchSpace)
|
||||
// The maximum number of DCI lengths allowed by the spec are 4, with max 3 for C-RNTI.
|
||||
// But a given search space may only support a maximum of 2 DCI formats at a time
|
||||
// depending on its search space type configured by RRC. Hence for blind decoding, UE
|
||||
// needs to monitor only upto 2 DCI lengths for a given search space.
|
||||
uint8_t num_dci_options; // Num DCIs the UE actually needs to decode (1 or 2)
|
||||
uint8_t dci_length_options[2];
|
||||
uint8_t dci_format_options[2];
|
||||
} fapi_nr_dl_config_dci_dl_pdu_rel15_t;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -469,6 +469,9 @@ int32_t nr_segmentation(unsigned char *input_buffer,
|
||||
unsigned int *F,
|
||||
uint8_t BG);
|
||||
|
||||
/*!\fn uint32_t nr_compute_tbs
|
||||
\brief This function returns the TBS in bits as per 6.1.4.2 of TS 38.214
|
||||
*/
|
||||
uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint16_t nb_rb,
|
||||
@@ -480,8 +483,7 @@ uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
|
||||
uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
uint16_t nb_rb,
|
||||
uint8_t Nl,
|
||||
uint8_t C);
|
||||
uint8_t Nl);
|
||||
|
||||
void nr_interleaving_ldpc(uint32_t E, uint8_t Qm, uint8_t *e,uint8_t *f);
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ int nr_rate_matching_ldpc(uint8_t Ilbrm,
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (E + F <= Ncb-ind) { //E+F doesn't contain all coded bits
|
||||
if (E <= Ncb-ind) { //E+F doesn't contain all coded bits
|
||||
memcpy((void*)(e),(void*)(w+ind),E);
|
||||
k=E;
|
||||
}
|
||||
|
||||
@@ -264,11 +264,11 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
|
||||
for (i=0; i<Prx; i++) {
|
||||
pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_estimates_time[i] = (int32_t *)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2*fp->symbols_per_slot ); // max intensity in freq is 1 sc every 2 RBs
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->ofdm_symbol_size*2*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_ptrs_estimates_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ptrs_phase_per_slot[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->symbols_per_slot); // symbols per slot
|
||||
pusch_vars[ULSCH_id]->rxdataF_comp[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*N_RB_UL*12*fp->symbols_per_slot );
|
||||
pusch_vars[ULSCH_id]->ul_ch_mag0[i] = (int32_t *)malloc16_clear( fp->symbols_per_slot*sizeof(int32_t)*N_RB_UL*12 );
|
||||
|
||||
@@ -39,95 +39,6 @@
|
||||
//#define DEBUG_DCI
|
||||
//#define DEBUG_CHANNEL_CODING
|
||||
|
||||
|
||||
uint16_t nr_get_dci_size(nfapi_nr_dci_format_e format,
|
||||
nfapi_nr_rnti_type_e rnti_type,
|
||||
uint16_t N_RB) {
|
||||
uint16_t size = 0;
|
||||
|
||||
switch(format) {
|
||||
/*Only sizes for 0_0 and 1_0 are correct at the moment*/
|
||||
case NFAPI_NR_UL_DCI_FORMAT_0_0:
|
||||
/// fixed: Format identifier 1, Hop flag 1, MCS 5, NDI 1, RV 2, HARQ PID 4, PUSCH TPC 2 Time Domain assgnmt 4 --20
|
||||
size += 20;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment -- hopping scenario to be updated
|
||||
size += nr_get_dci_size(NFAPI_NR_DL_DCI_FORMAT_1_0, rnti_type, N_RB) - size; // Padding to match 1_0 size
|
||||
// UL/SUL indicator assumed to be 0
|
||||
break;
|
||||
|
||||
case NFAPI_NR_UL_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 NFAPI_NR_DL_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 Time Domain assgnmt 4 -- 28
|
||||
size += 28;
|
||||
size += (uint8_t)ceil( log2( (N_RB*(N_RB+1))>>1 ) ); // Freq domain assignment
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_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 NFAPI_NR_DL_DCI_FORMAT_2_0:
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_1:
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_2:
|
||||
break;
|
||||
|
||||
case NFAPI_NR_DL_DCI_FORMAT_2_3:
|
||||
break;
|
||||
|
||||
default:
|
||||
AssertFatal(1==0, "Invalid NR DCI format %d\n", format);
|
||||
}
|
||||
|
||||
return size;
|
||||
}
|
||||
|
||||
void nr_pdcch_scrambling(uint32_t *in,
|
||||
uint32_t size,
|
||||
uint32_t Nid,
|
||||
|
||||
@@ -527,7 +527,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
if (rel15->nrOfLayers < Nl)
|
||||
Nl = rel15->nrOfLayers;
|
||||
|
||||
Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl,dlsch->harq_processes[harq_pid]->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(rel15->mcsTable[0],nb_rb,Nl);
|
||||
|
||||
start_meas(dlsch_rate_matching_stats);
|
||||
nr_rate_matching_ldpc(Ilbrm,
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
*/
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
|
||||
void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch,uint8_t N_RB_UL);
|
||||
|
||||
|
||||
@@ -52,9 +52,6 @@
|
||||
#define OAI_UL_LDPC_MAX_NUM_LLR 27000//26112 // NR_LDPC_NCOL_BG1*NR_LDPC_ZMAX = 68*384
|
||||
//#define PRINT_CRC_CHECK
|
||||
|
||||
static uint64_t nb_total_decod =0;
|
||||
static uint64_t nb_error_decod =0;
|
||||
|
||||
//extern double cpuf;
|
||||
|
||||
void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr,uint8_t N_RB_UL)
|
||||
@@ -286,7 +283,177 @@ void clean_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
static uint32_t prnt_crc_cnt = 0;
|
||||
#endif
|
||||
|
||||
uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
void nr_processULSegment(void* arg) {
|
||||
ldpcDecode_t *rdata = (ldpcDecode_t*) arg;
|
||||
PHY_VARS_gNB *phy_vars_gNB = rdata->gNB;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
t_nrLDPC_dec_params *p_decoderParms = &rdata->decoderParms;
|
||||
int length_dec;
|
||||
int no_iteration_ldpc;
|
||||
int Kr;
|
||||
int Kr_bytes;
|
||||
int K_bytes_F;
|
||||
uint8_t crc_type;
|
||||
int i;
|
||||
int j;
|
||||
int r = rdata->segment_r;
|
||||
int A = rdata->A;
|
||||
int E = rdata->E;
|
||||
int Qm = rdata->Qm;
|
||||
int rv_index = rdata->rv_index;
|
||||
int r_offset = rdata->r_offset;
|
||||
uint8_t kc = rdata->Kc;
|
||||
uint32_t Tbslbrm = rdata->Tbslbrm;
|
||||
short* ulsch_llr = rdata->ulsch_llr;
|
||||
int max_ldpc_iterations = p_decoderParms->numMaxIter;
|
||||
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
|
||||
|
||||
int16_t z [68*384];
|
||||
int8_t l [68*384];
|
||||
|
||||
__m128i *pv = (__m128i*)&z;
|
||||
__m128i *pl = (__m128i*)&l;
|
||||
|
||||
uint8_t Ilbrm = 0;
|
||||
|
||||
Kr = ulsch_harq->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
K_bytes_F = Kr_bytes-(ulsch_harq->F>>3);
|
||||
|
||||
t_nrLDPC_time_stats procTime;
|
||||
t_nrLDPC_time_stats* p_procTime = &procTime ;
|
||||
|
||||
//start_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////// nr_deinterleaving_ldpc ///////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////// ulsch_llr =====> ulsch_harq->e //////////////////////////////
|
||||
|
||||
nr_deinterleaving_ldpc(E,
|
||||
Qm,
|
||||
ulsch_harq->e[r],
|
||||
ulsch_llr+r_offset);
|
||||
|
||||
//for (int i =0; i<16; i++)
|
||||
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,ulsch_harq->w[r][i], r_offset);
|
||||
|
||||
stop_meas(&phy_vars_gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
|
||||
/*LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rv %d, round %d)...\n",
|
||||
harq_pid,r, G,
|
||||
Kr*3,
|
||||
ulsch_harq->TBS,
|
||||
Qm,
|
||||
nb_rb,
|
||||
n_layers,
|
||||
pusch_pdu->pusch_data.rv_index,
|
||||
ulsch_harq->round);*/
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////// nr_rate_matching_ldpc_rx ////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////// ulsch_harq->e =====> ulsch_harq->d /////////////////////////
|
||||
|
||||
//start_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||
Tbslbrm,
|
||||
p_decoderParms->BG,
|
||||
p_decoderParms->Z,
|
||||
ulsch_harq->d[r],
|
||||
ulsch_harq->e[r],
|
||||
ulsch_harq->C,
|
||||
rv_index,
|
||||
(ulsch_harq->round==0)?1:0,
|
||||
E,
|
||||
ulsch_harq->F,
|
||||
Kr-ulsch_harq->F-2*(p_decoderParms->Z))==-1) {
|
||||
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n");
|
||||
rdata->decodeIterations = max_ldpc_iterations + 1;
|
||||
return;
|
||||
} else {
|
||||
stop_meas(&phy_vars_gNB->ulsch_rate_unmatching_stats);
|
||||
}
|
||||
|
||||
memset(ulsch_harq->c[r],0,Kr_bytes);
|
||||
|
||||
if (ulsch_harq->C == 1) {
|
||||
if (A > 3824)
|
||||
crc_type = CRC24_A;
|
||||
else
|
||||
crc_type = CRC16;
|
||||
|
||||
length_dec = ulsch_harq->B;
|
||||
}
|
||||
else {
|
||||
crc_type = CRC24_B;
|
||||
length_dec = (ulsch_harq->B+24*ulsch_harq->C)/ulsch_harq->C;
|
||||
}
|
||||
|
||||
//start_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||
|
||||
memset(pv,0,2*ulsch_harq->Z*sizeof(int16_t));
|
||||
memset((pv+K_bytes_F),127,ulsch_harq->F*sizeof(int16_t));
|
||||
|
||||
for (i=((2*p_decoderParms->Z)>>3), j = 0; i < K_bytes_F; i++, j++) {
|
||||
pv[i]= _mm_loadu_si128((__m128i*)(&ulsch_harq->d[r][8*j]));
|
||||
}
|
||||
|
||||
AssertFatal(kc!=255,"");
|
||||
j+=(ulsch_harq->F>>3);
|
||||
for (i=Kr_bytes; i < ((kc*p_decoderParms->Z)>>3); i++, j++) {
|
||||
pv[i]= _mm_loadu_si128((__m128i*)(&ulsch_harq->d[r][8*j]));
|
||||
}
|
||||
|
||||
for (i=0, j=0; j < ((kc*p_decoderParms->Z)>>4); i+=2, j++) {
|
||||
pl[j] = _mm_packs_epi16(pv[i],pv[i+1]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////// nrLDPC_decoder /////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
|
||||
|
||||
no_iteration_ldpc = nrLDPC_decoder(p_decoderParms,
|
||||
(int8_t*)&pl[0],
|
||||
llrProcBuf,
|
||||
ulsch_harq->p_nrLDPC_procBuf[r],
|
||||
p_procTime);
|
||||
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,ulsch_harq->F,crc_type)) {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "Segment %d CRC OK\n",r);
|
||||
#endif
|
||||
rdata->decodeIterations = no_iteration_ldpc;
|
||||
} else {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
LOG_I(PHY, "CRC NOK\n");
|
||||
#endif
|
||||
rdata->decodeIterations = max_ldpc_iterations + 1;
|
||||
}
|
||||
|
||||
for (int m=0; m < Kr>>3; m ++) {
|
||||
ulsch_harq->c[r][m]= (uint8_t) llrProcBuf[m];
|
||||
}
|
||||
|
||||
//stop_meas(&phy_vars_gNB->ulsch_ldpc_decoding_stats);
|
||||
}
|
||||
|
||||
uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
uint8_t UE_id,
|
||||
short *ulsch_llr,
|
||||
NR_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -296,36 +463,36 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
uint8_t harq_pid,
|
||||
uint32_t G) {
|
||||
|
||||
uint32_t A,E;
|
||||
uint32_t ret, offset;
|
||||
int32_t no_iteration_ldpc, length_dec;
|
||||
uint32_t r,r_offset=0,Kr=8424,Kr_bytes,K_bytes_F,err_flag=0;
|
||||
uint8_t crc_type;
|
||||
int8_t llrProcBuf[OAI_UL_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
|
||||
uint32_t A;
|
||||
uint32_t r;
|
||||
uint32_t r_offset;
|
||||
uint32_t offset;
|
||||
int kc;
|
||||
int Tbslbrm;
|
||||
int E;
|
||||
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
prnt_crc_cnt++;
|
||||
#endif
|
||||
|
||||
|
||||
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[UE_id][0];
|
||||
NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[UE_id][0];
|
||||
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
|
||||
|
||||
t_nrLDPC_dec_params decParams;
|
||||
t_nrLDPC_dec_params* p_decParams = &decParams;
|
||||
t_nrLDPC_time_stats procTime;
|
||||
t_nrLDPC_time_stats* p_procTime = &procTime ;
|
||||
if (!harq_process) {
|
||||
printf("ulsch_decoding.c: NULL harq_process pointer\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
t_nrLDPC_procBuf** p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
|
||||
|
||||
int16_t z [68*384];
|
||||
int8_t l [68*384];
|
||||
uint8_t kc = 255;
|
||||
uint8_t Ilbrm = 0;
|
||||
uint32_t Tbslbrm = 950984;
|
||||
int Kr;
|
||||
int Kr_bytes;
|
||||
|
||||
phy_vars_gNB->nbDecode = 0;
|
||||
harq_process->processedSegments = 0;
|
||||
|
||||
if (!harq_process) {
|
||||
LOG_E(PHY,"ulsch_decoding.c: NULL harq_process pointer\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
double Coderate = 0.0;
|
||||
|
||||
// ------------------------------------------------------------------
|
||||
@@ -336,30 +503,16 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
uint8_t n_layers = pusch_pdu->nrOfLayers;
|
||||
// ------------------------------------------------------------------
|
||||
|
||||
uint32_t i,j;
|
||||
|
||||
__m128i *pv = (__m128i*)&z;
|
||||
__m128i *pl = (__m128i*)&l;
|
||||
|
||||
|
||||
if (!ulsch_llr) {
|
||||
printf("ulsch_decoding.c: NULL ulsch_llr pointer\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
LOG_E(PHY,"ulsch_decoding.c: NULL ulsch_llr pointer\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (!frame_parms) {
|
||||
printf("ulsch_decoding.c: NULL frame_parms pointer\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
// harq_process->trials[nfapi_ulsch_pdu_rel15->round]++;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,1);
|
||||
harq_process->TBS = pusch_pdu->pusch_data.tb_size;
|
||||
harq_process->round = nr_rv_round_map[pusch_pdu->pusch_data.rv_index];
|
||||
|
||||
A = (harq_process->TBS)<<3;
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
|
||||
LOG_D(PHY,"ULSCH Decoding, harq_pid %d TBS %d G %d mcs %d Nl %d nb_rb %d, Qm %d, n_layers %d\n",harq_pid,A,G, mcs, n_layers, nb_rb, Qm, n_layers);
|
||||
|
||||
@@ -401,12 +554,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
NR_gNB_SCH_STATS_t *stats=NULL;
|
||||
int first_free=-1;
|
||||
for (int i=0;i<NUMBER_OF_NR_SCH_STATS_MAX;i++) {
|
||||
if (gNB->ulsch_stats[i].rnti == 0 && first_free == -1) {
|
||||
if (phy_vars_gNB->ulsch_stats[i].rnti == 0 && first_free == -1) {
|
||||
first_free = i;
|
||||
stats=&gNB->ulsch_stats[i];
|
||||
stats=&phy_vars_gNB->ulsch_stats[i];
|
||||
}
|
||||
if (gNB->ulsch_stats[i].rnti == ulsch->rnti) {
|
||||
stats=&gNB->ulsch_stats[i];
|
||||
if (phy_vars_gNB->ulsch_stats[i].rnti == ulsch->rnti) {
|
||||
stats=&phy_vars_gNB->ulsch_stats[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -420,13 +573,13 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
stats->current_RI = n_layers;
|
||||
stats->total_bytes_tx += harq_process->TBS;
|
||||
}
|
||||
// This is a new packet, so compute quantities regarding segmentation
|
||||
if (A > 3824)
|
||||
harq_process->B = A+24;
|
||||
else
|
||||
harq_process->B = A+16;
|
||||
}
|
||||
if (A > 3824)
|
||||
harq_process->B = A+24;
|
||||
else
|
||||
harq_process->B = A+16;
|
||||
|
||||
// [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F)
|
||||
// [hna] Perform nr_segmenation with input and output set to NULL to calculate only (B, C, K, Z, F)
|
||||
nr_segmentation(NULL,
|
||||
NULL,
|
||||
harq_process->B,
|
||||
@@ -437,18 +590,18 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
p_decParams->BG);
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
|
||||
if (!frame%100)
|
||||
printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z);
|
||||
printf("ulsch decoding nr segmentation Z %d\n", harq_process->Z);
|
||||
if (!frame%100)
|
||||
printf("K %d C %d Z %d \n", harq_process->K, harq_process->C, harq_process->Z);
|
||||
#endif
|
||||
}
|
||||
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,n_layers);
|
||||
|
||||
p_decParams->Z = harq_process->Z;
|
||||
|
||||
|
||||
p_decParams->numMaxIter = ulsch->max_ldpc_iterations;
|
||||
p_decParams->outMode= 0;
|
||||
|
||||
err_flag = 0;
|
||||
r_offset = 0;
|
||||
|
||||
uint16_t a_segments = MAX_NUM_NR_ULSCH_SEGMENTS; //number of segments to be allocated
|
||||
@@ -460,284 +613,48 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *gNB,
|
||||
|
||||
if (harq_process->C > a_segments) {
|
||||
LOG_E(PHY,"Illegal harq_process->C %d > %d\n",harq_process->C,a_segments);
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
return 1;
|
||||
}
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("Segmentation: C %d, K %d\n",harq_process->C,harq_process->K);
|
||||
#endif
|
||||
|
||||
//opp_enabled=1;
|
||||
|
||||
Kr = harq_process->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
K_bytes_F = Kr_bytes-(harq_process->F>>3);
|
||||
offset = 0;
|
||||
void (*nr_processULSegment_ptr)(void*) = &nr_processULSegment;
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
E = nr_get_E(G, harq_process->C, Qm, n_layers, r);
|
||||
|
||||
union ldpcReqUnion id = {.s={ulsch->rnti,frame,nr_tti_rx,0,0}};
|
||||
notifiedFIFO_elt_t *req=newNotifiedFIFO_elt(sizeof(ldpcDecode_t), id.p, phy_vars_gNB->respDecode, nr_processULSegment_ptr);
|
||||
ldpcDecode_t * rdata=(ldpcDecode_t *) NotifiedFifoData(req);
|
||||
|
||||
start_meas(&gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////// nr_deinterleaving_ldpc ///////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//////////////////////////// ulsch_llr =====> harq_process->e //////////////////////////////
|
||||
|
||||
nr_deinterleaving_ldpc(E,
|
||||
Qm,
|
||||
harq_process->e[r],
|
||||
ulsch_llr+r_offset);
|
||||
|
||||
//for (int i =0; i<16; i++)
|
||||
// printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||
|
||||
stop_meas(&gNB->ulsch_deinterleaving_stats);
|
||||
|
||||
|
||||
LOG_D(PHY,"HARQ_PID %d Rate Matching Segment %d (coded bits %d,unpunctured/repeated bits %d, TBS %d, mod_order %d, nb_rb %d, Nl %d, rvidx %d, round %d)...\n",
|
||||
harq_pid,r, G,
|
||||
Kr*3,
|
||||
harq_process->TBS,
|
||||
Qm,
|
||||
nb_rb,
|
||||
n_layers,
|
||||
pusch_pdu->pusch_data.rv_index,
|
||||
harq_process->round);
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////// nr_rate_matching_ldpc_rx ////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
///////////////////////// harq_process->e =====> harq_process->d /////////////////////////
|
||||
|
||||
start_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,n_layers,harq_process->C);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||
Tbslbrm,
|
||||
p_decParams->BG,
|
||||
p_decParams->Z,
|
||||
harq_process->d[r],
|
||||
harq_process->e[r],
|
||||
harq_process->C,
|
||||
pusch_pdu->pusch_data.rv_index,
|
||||
(harq_process->round==0)?1:0,
|
||||
E,
|
||||
harq_process->F,
|
||||
Kr-harq_process->F-2*(p_decParams->Z))==-1) {
|
||||
|
||||
stop_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
|
||||
LOG_E(PHY,"ulsch_decoding.c: Problem in rate_matching\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
} else {
|
||||
stop_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
}
|
||||
|
||||
rdata->gNB = phy_vars_gNB;
|
||||
rdata->ulsch_harq = harq_process;
|
||||
rdata->decoderParms = decParams;
|
||||
rdata->ulsch_llr = ulsch_llr;
|
||||
rdata->Kc = kc;
|
||||
rdata->harq_pid = harq_pid;
|
||||
rdata->segment_r = r;
|
||||
rdata->nbSegments = harq_process->C;
|
||||
rdata->E = E;
|
||||
rdata->A = A;
|
||||
rdata->Qm = Qm;
|
||||
rdata->r_offset = r_offset;
|
||||
rdata->Kr_bytes = Kr_bytes;
|
||||
rdata->rv_index = pusch_pdu->pusch_data.rv_index;
|
||||
rdata->Tbslbrm = Tbslbrm;
|
||||
rdata->offset = offset;
|
||||
rdata->ulsch = ulsch;
|
||||
rdata->ulsch_id = UE_id;
|
||||
pushTpool(phy_vars_gNB->threadPool,req);
|
||||
phy_vars_gNB->nbDecode++;
|
||||
LOG_D(PHY,"Added a block to decode, in pipe: %d\n",phy_vars_gNB->nbDecode);
|
||||
r_offset += E;
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
if (r==0) {
|
||||
write_output("decoder_llr.m","decllr",ulsch_llr,G,1,0);
|
||||
write_output("decoder_in.m","dec",&harq_process->d[0][0],E,1,0);
|
||||
}
|
||||
|
||||
printf("decoder input(segment %u) :", r);
|
||||
int i;
|
||||
for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
printf("%d : %d\n",i,harq_process->d[r][i]);
|
||||
printf("\n");
|
||||
#endif
|
||||
|
||||
|
||||
// printf("Clearing c, %p\n",harq_process->c[r]);
|
||||
memset(harq_process->c[r],0,Kr_bytes);
|
||||
|
||||
// printf("done\n");
|
||||
if (harq_process->C == 1) {
|
||||
if (A > 3824)
|
||||
crc_type = CRC24_A;
|
||||
else
|
||||
crc_type = CRC16;
|
||||
|
||||
length_dec = harq_process->B;
|
||||
}
|
||||
else {
|
||||
crc_type = CRC24_B;
|
||||
length_dec = (harq_process->B+24*harq_process->C)/harq_process->C;
|
||||
}
|
||||
|
||||
if (err_flag == 0) {
|
||||
|
||||
start_meas(&gNB->ulsch_ldpc_decoding_stats);
|
||||
|
||||
//LOG_E(PHY,"AbsSubframe %d.%d Start LDPC segment %d/%d A %d ",frame%1024,nr_tti_rx,r,harq_process->C-1, A);
|
||||
|
||||
|
||||
memset(pv,0,2*harq_process->Z*sizeof(int16_t));
|
||||
memset((pv+K_bytes_F),127,harq_process->F*sizeof(int16_t));
|
||||
|
||||
for (i=((2*p_decParams->Z)>>3), j = 0; i < K_bytes_F; i++, j++) {
|
||||
pv[i]= _mm_loadu_si128((__m128i*)(&harq_process->d[r][8*j]));
|
||||
}
|
||||
|
||||
AssertFatal(kc!=255,"");
|
||||
j+=(harq_process->F>>3);
|
||||
for (i=Kr_bytes; i < ((kc*p_decParams->Z)>>3); i++, j++) {
|
||||
pv[i]= _mm_loadu_si128((__m128i*)(&harq_process->d[r][8*j]));
|
||||
}
|
||||
|
||||
for (i=0, j=0; j < ((kc*p_decParams->Z)>>4); i+=2, j++) {
|
||||
pl[j] = _mm_packs_epi16(pv[i],pv[i+1]);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////// nrLDPC_decoder /////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////// pl =====> llrProcBuf //////////////////////////////////
|
||||
|
||||
no_iteration_ldpc = nrLDPC_decoder(p_decParams,
|
||||
(int8_t*)&pl[0],
|
||||
llrProcBuf,
|
||||
p_nrLDPC_procBuf[r],
|
||||
p_procTime);
|
||||
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
//if (prnt_crc_cnt % 10 == 0)
|
||||
LOG_I(PHY, "Segment %d CRC OK\n",r);
|
||||
#endif
|
||||
ret = no_iteration_ldpc;
|
||||
} else {
|
||||
#ifdef PRINT_CRC_CHECK
|
||||
//if (prnt_crc_cnt%10 == 0)
|
||||
LOG_I(PHY, "CRC NOK\n");
|
||||
#endif
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
}
|
||||
nb_total_decod++;
|
||||
|
||||
if (no_iteration_ldpc > ulsch->max_ldpc_iterations){
|
||||
nb_error_decod++;
|
||||
}
|
||||
|
||||
for (int m=0; m < Kr>>3; m ++) {
|
||||
harq_process->c[r][m]= (uint8_t) llrProcBuf[m];
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
//printf("output decoder %d %d %d %d %d \n", harq_process->c[r][0], harq_process->c[r][1], harq_process->c[r][2],harq_process->c[r][3], harq_process->c[r][4]);
|
||||
for (int k=0;k<A>>3;k++)
|
||||
printf("output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
|
||||
printf("no_iterations_ldpc %d (ret %u)\n",no_iteration_ldpc,ret);
|
||||
//write_output("dec_output.m","dec0",harq_process->c[0],Kr_bytes,1,4);
|
||||
#endif
|
||||
|
||||
stop_meas(&gNB->ulsch_ldpc_decoding_stats);
|
||||
}
|
||||
|
||||
if ((err_flag == 0) && (ret >= (ulsch->max_ldpc_iterations + 1))) {
|
||||
// a Code segment is in error so break;
|
||||
LOG_D(PHY,"AbsSubframe %d.%d CRC failed, segment %d/%d \n",frame%1024,nr_tti_rx,r,harq_process->C-1);
|
||||
err_flag = 1;
|
||||
}
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
int32_t frame_rx_prev = frame;
|
||||
int32_t tti_rx_prev = nr_tti_rx - 1;
|
||||
if (tti_rx_prev < 0) {
|
||||
frame_rx_prev--;
|
||||
tti_rx_prev += frame_parms->slots_per_frame;
|
||||
}
|
||||
frame_rx_prev = frame_rx_prev%1024;
|
||||
|
||||
if (err_flag == 1) {
|
||||
|
||||
#ifdef gNB_DEBUG_TRACE
|
||||
LOG_I(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) Kr %d r %d\n",
|
||||
gNB->Mod_id, frame, nr_tti_rx, harq_pid,harq_process->status, harq_process->round,harq_process->TBS,Kr,r);
|
||||
#endif
|
||||
|
||||
// harq_process->harq_ack.ack = 0;
|
||||
// harq_process->harq_ack.harq_id = harq_pid;
|
||||
// harq_process->harq_ack.send_harq_status = 1;
|
||||
// harq_process->errors[harq_process->round]++;
|
||||
//harq_process->round++;
|
||||
|
||||
if (harq_process->round >= ulsch->Mlimit) {
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
harq_process->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
}
|
||||
|
||||
// LOG_D(PHY,"[gNB %d] ULSCH: Setting NACK for nr_tti_rx %d (pid %d, pid status %d, round %d/Max %d, TBS %d)\n",
|
||||
// gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->status,harq_process->round,ulsch->Mlimit,harq_process->TBS);
|
||||
|
||||
harq_process->handled = 1;
|
||||
ret = ulsch->max_ldpc_iterations + 1;
|
||||
|
||||
} else {
|
||||
|
||||
#ifdef gNB_DEBUG_TRACE
|
||||
LOG_I(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d TBS %d\n",
|
||||
gNB->Mod_id,nr_tti_rx,harq_process->TBS);
|
||||
#endif
|
||||
|
||||
harq_process->status = SCH_IDLE;
|
||||
harq_process->round = 0;
|
||||
// harq_process->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << harq_pid);
|
||||
// harq_process->harq_ack.ack = 1;
|
||||
// harq_process->harq_ack.harq_id = harq_pid;
|
||||
// harq_process->harq_ack.send_harq_status = 1;
|
||||
|
||||
// LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d (pid %d, round %d, TBS %d)\n",gNB->Mod_id,nr_tti_rx,harq_pid,harq_process->round,harq_process->TBS);
|
||||
|
||||
|
||||
// Reassembly of Transport block here
|
||||
offset = 0;
|
||||
Kr = harq_process->K;
|
||||
Kr_bytes = Kr>>3;
|
||||
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
|
||||
memcpy(harq_process->b+offset,
|
||||
harq_process->c[r],
|
||||
Kr_bytes- - (harq_process->F>>3) -((harq_process->C>1)?3:0));
|
||||
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("Segment %u : Kr = %u bytes\n", r, Kr_bytes);
|
||||
printf("copied %d bytes to b sequence (harq_pid %d)\n", (Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)), harq_pid);
|
||||
printf("b[0] = %x, c[%d] = %x\n", harq_process->b[offset], harq_process->F>>3, harq_process->c[r]);
|
||||
#endif
|
||||
|
||||
}
|
||||
if (stats) stats->total_bytes_rx += harq_process->TBS;
|
||||
}
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
LOG_I(PHY, "Decoder output (payload) at SFN/SF: %d/%d TBS: %d\n", frame, nr_tti_rx,harq_process->TBS);
|
||||
for (i = 0; i < harq_process->TBS; i++) {
|
||||
//harq_process_ul_ue->a[i] = (unsigned char) rand();
|
||||
//printf("a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]);
|
||||
printf("%02x ",harq_process->b[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
ulsch->last_iteration_cnt = ret;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0);
|
||||
return(ret);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1147,9 +1147,9 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
|
||||
//--------------------- RBs extraction ---------------------
|
||||
//----------------------------------------------------------
|
||||
|
||||
if (nb_re_pusch > 0) {
|
||||
gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
|
||||
|
||||
gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
|
||||
if (nb_re_pusch > 0) {
|
||||
|
||||
start_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
|
||||
|
||||
@@ -67,7 +67,7 @@ int nr_find_pucch(uint16_t rnti,
|
||||
AssertFatal(gNB!=NULL,"gNB is null\n");
|
||||
int index = -1;
|
||||
|
||||
for (int i=0; i<NUMBER_OF_NR_ULSCH_MAX; i++) {
|
||||
for (int i=0; i<NUMBER_OF_NR_PUCCH_MAX; i++) {
|
||||
AssertFatal(gNB->pucch[i]!=NULL,"gNB->pucch[%d] is null\n",i);
|
||||
if ((gNB->pucch[i]->active >0) &&
|
||||
(gNB->pucch[i]->pucch_pdu.rnti==rnti) &&
|
||||
@@ -414,7 +414,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->harq_confidence_level = (no_conf) ? 1 : 0;
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(1);
|
||||
uci_pdu->harq->harq_list[0].harq_value = index&0x01;
|
||||
LOG_I(PHY, "HARQ value %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
LOG_D(PHY, "HARQ value %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level);
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
@@ -429,7 +429,7 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
|
||||
uci_pdu->harq->harq_list = (nfapi_nr_harq_t*)malloc(2);
|
||||
uci_pdu->harq->harq_list[1].harq_value = index&0x01;
|
||||
uci_pdu->harq->harq_list[0].harq_value = (index>>1)&0x01;
|
||||
LOG_I(PHY, "HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
LOG_D(PHY, "HARQ values %d and %d with confidence level (0 is good, 1 is bad) %d\n",
|
||||
uci_pdu->harq->harq_list[1].harq_value,uci_pdu->harq->harq_list[0].harq_value,uci_pdu->harq->harq_confidence_level);
|
||||
if (pucch_pdu->sr_flag == 1) {
|
||||
uci_pdu->sr = calloc(1,sizeof(*uci_pdu->sr));
|
||||
|
||||
@@ -845,7 +845,6 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
for (int i=0;i<pdcch_vars->nb_search_space;i++) {
|
||||
|
||||
rel15 = &pdcch_vars->pdcch_config[i];
|
||||
int dci_length = rel15->dci_length;
|
||||
//int gNB_id = 0;
|
||||
int16_t tmp_e[16*108];
|
||||
rnti_t n_rnti;
|
||||
@@ -853,41 +852,47 @@ uint8_t nr_dci_decoding_procedure(PHY_VARS_NR_UE *ue,
|
||||
for (int j=0;j<rel15->number_of_candidates;j++) {
|
||||
int CCEind = rel15->CCE[j];
|
||||
int L = rel15->L[j];
|
||||
uint64_t dci_estimation[2]= {0};
|
||||
const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList);
|
||||
|
||||
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L);
|
||||
// Loop over possible DCI lengths
|
||||
for (int k = 0; k < rel15->num_dci_options; k++) {
|
||||
int dci_length = rel15->dci_length_options[k];
|
||||
uint64_t dci_estimation[2]= {0};
|
||||
const t_nrPolar_params *currentPtrDCI = nr_polar_params(NR_POLAR_DCI_MESSAGE_TYPE, dci_length, L, 1, &ue->polarList);
|
||||
|
||||
nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
|
||||
LOG_D(PHY, "Trying DCI candidate %d of %d number of candidates, CCE %d (%d), L %d\n", j, rel15->number_of_candidates, CCEind, CCEind*9*6*2, L);
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108];
|
||||
for (int index_z = 0; index_z < 96; index_z++){
|
||||
for (int i=0; i<9; i++) {
|
||||
LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]));
|
||||
nr_pdcch_unscrambling(&pdcch_vars->e_rx[CCEind*108], rel15->coreset.scrambling_rnti, L*108, rel15->coreset.pdcch_dmrs_scrambling_id, tmp_e);
|
||||
|
||||
#ifdef DEBUG_DCI_DECODING
|
||||
uint32_t * z = (uint32_t *) &pdcch_vars->e_rx[CCEind*108];
|
||||
for (int index_z = 0; index_z < 96; index_z++){
|
||||
for (int i=0; i<9; i++) {
|
||||
LOG_D(PHY,"z[%d]=(%d,%d) \n", (9*index_z + i), *(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
uint16_t crc = polar_decoder_int16(tmp_e,
|
||||
dci_estimation,
|
||||
1,
|
||||
currentPtrDCI);
|
||||
|
||||
n_rnti = rel15->rnti;
|
||||
|
||||
if (crc == n_rnti) {
|
||||
LOG_D(PHY,"Decoded crc %x matches rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format_options[k]);
|
||||
dci_ind->SFN = frame;
|
||||
dci_ind->slot = slot;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format_options[k];
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length;
|
||||
memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8);
|
||||
dci_ind->number_of_dcis++;
|
||||
break; // If DCI is found, no need to check for remaining DCI lengths
|
||||
} else {
|
||||
LOG_D(PHY,"Decoded crc %x does not match rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format_options[k]);
|
||||
}
|
||||
#endif
|
||||
|
||||
uint16_t crc = polar_decoder_int16(tmp_e,
|
||||
dci_estimation,
|
||||
1,
|
||||
currentPtrDCI);
|
||||
|
||||
n_rnti = rel15->rnti;
|
||||
|
||||
if (crc == n_rnti) {
|
||||
LOG_D(PHY,"Decoded crc %x matches rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format);
|
||||
dci_ind->SFN = frame;
|
||||
dci_ind->slot = slot;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].rnti = n_rnti;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].n_CCE = CCEind;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].dci_format = rel15->dci_format;
|
||||
dci_ind->dci_list[dci_ind->number_of_dcis].payloadSize = dci_length;
|
||||
memcpy((void*)dci_ind->dci_list[dci_ind->number_of_dcis].payloadBits,(void*)dci_estimation,8);
|
||||
dci_ind->number_of_dcis++;
|
||||
} else {
|
||||
LOG_D(PHY,"Decoded crc %x does not match rnti %x for DCI format %d\n", crc, n_rnti, rel15->dci_format);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -478,9 +478,9 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_RATE_MATCHING, VCD_FUNCTION_IN);
|
||||
|
||||
if ((harq_process->Nl)<4)
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,harq_process->Nl,harq_process->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,harq_process->Nl);
|
||||
else
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,4,harq_process->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,4);
|
||||
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||
@@ -1069,7 +1069,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
if (harq_process->Nl < Nl)
|
||||
Nl = harq_process->Nl;
|
||||
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,harq_process->Nl,harq_process->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,harq_process->Nl);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||
Tbslbrm,
|
||||
@@ -1610,9 +1610,9 @@ void nr_dlsch_decoding_process(void *arg)
|
||||
#endif
|
||||
|
||||
if (Nl<4)
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,Nl,harq_process->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,Nl);
|
||||
else
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,4,harq_process->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(harq_process->mcs_table,nb_rb,4);
|
||||
|
||||
if (nr_rate_matching_ldpc_rx(Ilbrm,
|
||||
Tbslbrm,
|
||||
|
||||
@@ -53,11 +53,9 @@ int16_t nr_dlsch_demod_shift = 0;
|
||||
//int16_t interf_unaw_shift = 13;
|
||||
|
||||
//#define DEBUG_HARQ
|
||||
|
||||
//#define DEBUG_PHY 1
|
||||
//#define DEBUG_DLSCH_DEMOD 1
|
||||
|
||||
|
||||
//#define DEBUG_PHY
|
||||
//#define DEBUG_DLSCH_DEMOD
|
||||
//#define DEBUG_PDSCH_RX
|
||||
|
||||
// [MCS][i_mod (0,1,2) = (2,4,6)]
|
||||
//unsigned char offset_mumimo_llr_drange_fix=0;
|
||||
@@ -188,7 +186,6 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
|
||||
if (dlsch0_harq && dlsch1_harq){
|
||||
|
||||
//printf("status TB0 = %d, status TB1 = %d \n", dlsch[0]->harq_processes[harq_pid]->status, dlsch[1]->harq_processes[harq_pid]->status);
|
||||
LOG_D(PHY,"AbsSubframe %d.%d / Sym %d harq_pid %d, harq status %d.%d \n", frame, nr_tti_rx, symbol, harq_pid, dlsch0_harq->status, dlsch1_harq->status);
|
||||
|
||||
if ((dlsch0_harq->status == ACTIVE) && (dlsch1_harq->status == ACTIVE)){
|
||||
@@ -1042,42 +1039,30 @@ int nr_rx_pdsch(PHY_VARS_NR_UE *ue,
|
||||
LOG_I(PHY, "[AbsSFN %u.%d] Slot%d Symbol %d: LLR Computation %5.2f \n",frame,nr_tti_rx,slot,symbol,ue->generic_stat_bis[ue->current_thread_id[nr_tti_rx]][slot].p_time/(cpuf*1000.0));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Please keep it: useful for debugging
|
||||
#if 0
|
||||
if( (symbol == 13) && (nr_tti_rx==0) && (dlsch0_harq->Qm == 6) /*&& (nb_rb==25)*/)
|
||||
{
|
||||
LOG_E(PHY,"Dump Phy Chan Est \n");
|
||||
if(1)
|
||||
{
|
||||
#if 1
|
||||
write_output("rxdataF0.m" , "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("rxdataF1.m" , "rxdataF1", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
write_output("dl_ch_estimates00.m", "dl_ch_estimates00", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].dl_ch_estimates[eNB_id][0][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates01.m", "dl_ch_estimates01", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].dl_ch_estimates[eNB_id][1][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates10.m", "dl_ch_estimates10", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].dl_ch_estimates[eNB_id][2][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
//write_output("dl_ch_estimates11.m", "dl_ch_estimates11", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].dl_ch_estimates[eNB_id][3][0],14*frame_parms->ofdm_symbol_size,1,1);
|
||||
#ifdef DEBUG_PDSCH_RX
|
||||
char filename[40];
|
||||
uint8_t aa = 0;
|
||||
|
||||
snprintf(filename, 40, "rxdataF0_symb_%d_nr_tti_rx_%d.m", symbol, nr_tti_rx);
|
||||
write_output(filename, "rxdataF0", &common_vars->common_vars_rx_data_per_thread[ue->current_thread_id[nr_tti_rx]].rxdataF[0][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1);
|
||||
|
||||
//write_output("rxdataF_ext00.m" , "rxdataF_ext00", &pdsch_vars[eNB_id]->rxdataF_ext[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_ext01.m" , "rxdataF_ext01", &pdsch_vars[eNB_id]->rxdataF_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_ext10.m" , "rxdataF_ext10", &pdsch_vars[eNB_id]->rxdataF_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_ext11.m" , "rxdataF_ext11", &pdsch_vars[eNB_id]->rxdataF_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("dl_ch_estimates_ext00.m", "dl_ch_estimates_ext00", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("dl_ch_estimates_ext01.m", "dl_ch_estimates_ext01", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("dl_ch_estimates_ext10.m", "dl_ch_estimates_ext10", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[2][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("dl_ch_estimates_ext11.m", "dl_ch_estimates_ext11", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[3][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
write_output("rxdataF_comp00.m","rxdataF_comp00", &pdsch_vars[eNB_id]->rxdataF_comp0[0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_comp01.m","rxdataF_comp01", &pdsch_vars[eNB_id]->rxdataF_comp0[1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_comp10.m","rxdataF_comp10", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][0][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
//write_output("rxdataF_comp11.m","rxdataF_comp11", &pdsch_vars[eNB_id]->rxdataF_comp1[harq_pid][round][1][0],14*frame_parms->N_RB_DL*12,1,1);
|
||||
#endif
|
||||
write_output("llr0.m","llr0", &pdsch_vars[eNB_id]->llr[0][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
|
||||
//write_output("llr1.m","llr1", &pdsch_vars[eNB_id]->llr[1][0],(14*nb_rb*12*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm),1,0);
|
||||
snprintf(filename, 40, "dl_ch_estimates0%d_symb_%d_nr_tti_rx_%d.m", aa, symbol, nr_tti_rx);
|
||||
write_output(filename, "dl_ch_estimates", &pdsch_vars[eNB_id]->dl_ch_estimates[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->ofdm_symbol_size, 1, 1);
|
||||
|
||||
snprintf(filename, 40, "rxdataF_ext0%d_symb_%d_nr_tti_rx_%d.m", aa, symbol, nr_tti_rx);
|
||||
write_output(filename, "rxdataF_ext", &pdsch_vars[eNB_id]->rxdataF_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1);
|
||||
|
||||
AssertFatal(0," ");
|
||||
}
|
||||
snprintf(filename, 40, "dl_ch_estimates_ext0%d_symb_%d_nr_tti_rx_%d.m", aa, symbol, nr_tti_rx);
|
||||
write_output(filename, "dl_ch_estimates_ext00", &pdsch_vars[eNB_id]->dl_ch_estimates_ext[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1);
|
||||
|
||||
snprintf(filename, 40, "rxdataF_comp0%d_symb_%d_nr_tti_rx_%d.m", aa, symbol, nr_tti_rx);
|
||||
write_output(filename, "rxdataF_comp00", &pdsch_vars[eNB_id]->rxdataF_comp0[aa][0], NR_SYMBOLS_PER_SLOT*frame_parms->N_RB_DL*NR_NB_SC_PER_RB, 1, 1);
|
||||
|
||||
for (int i=0; i < 2; i++){
|
||||
snprintf(filename, 40, "llr%d_symb_%d_nr_tti_rx_%d.m", i, symbol, nr_tti_rx);
|
||||
write_output(filename,"llr", &pdsch_vars[eNB_id]->llr[i][0], (NR_SYMBOLS_PER_SLOT*nb_rb*NR_NB_SC_PER_RB*dlsch1_harq->Qm) - 4*(nb_rb*4*dlsch1_harq->Qm), 1, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -2572,51 +2557,51 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t nr_tti_rx,unsigned int *
|
||||
char fname[32],vname[32];
|
||||
int N_RB_DL=ue->frame_parms.N_RB_DL;
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_ext0",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_rxF_r%d_ext0.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_rxF_r%d_ext0",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
if (ue->frame_parms.nb_antennas_rx >1) {
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_ext1",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_rxF_r%d_ext1.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_rxF_r%d_ext1",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext00.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext00",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_ch_r%d_ext00.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_ch_r%d_ext00",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
if (ue->transmission_mode[eNB_id]==7){
|
||||
sprintf(fname,"dlsch%d_bf_ch_r%d.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_bf_ch_r%d",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_bf_ch_r%d.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_bf_ch_r%d",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_bf_ch_estimates[0],512*nsymb,1,1);
|
||||
//write_output(fname,vname,phy_vars_ue->lte_ue_pdsch_vars[eNB_id]->dl_bf_ch_estimates[0],512,1,1);
|
||||
|
||||
sprintf(fname,"dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_bf_ch_r%d_ext00",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_bf_ch_r%d_ext00.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_bf_ch_r%d_ext00",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_bf_ch_estimates_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
if (ue->frame_parms.nb_antennas_rx == 2) {
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext01.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext01",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_ch_r%d_ext01.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_ch_r%d_ext01",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_estimates_ext[1],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
if (ue->frame_parms.nb_antenna_ports_gNB == 2) {
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext10.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext10",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_ch_r%d_ext10.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_ch_r%d_ext10",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
if (ue->frame_parms.nb_antennas_rx == 2) {
|
||||
sprintf(fname,"dlsch%d_ch_r%d_ext11.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_ch_r%d_ext11",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_ch_r%d_ext11.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_ch_r%d_ext11",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_uespec0",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_rxF_r%d_uespec0.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_rxF_r%d_uespec0",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_uespec_pilots[0],12*N_RB_DL,1,1);
|
||||
|
||||
/*
|
||||
@@ -2624,33 +2609,33 @@ void dump_dlsch2(PHY_VARS_UE *ue,uint8_t eNB_id,uint8_t nr_tti_rx,unsigned int *
|
||||
write_output("dlsch%d_ch_ext10.m","dl10_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[2],12*N_RB_DL*nsymb,1,1);
|
||||
write_output("dlsch%d_ch_ext11.m","dl11_ch0_ext",pdsch_vars[eNB_id]->dl_ch_estimates_ext[3],12*N_RB_DL*nsymb,1,1);
|
||||
*/
|
||||
sprintf(fname,"dlsch%d_r%d_rho.m",eNB_id,round);
|
||||
sprintf(vname,"dl_rho_r%d_%d",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_r%d_rho.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl_rho_r%d_%d",eNB_id,round);
|
||||
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_rho_ext[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
sprintf(fname,"dlsch%d_r%d_rho2.m",eNB_id,round);
|
||||
sprintf(vname,"dl_rho2_r%d_%d",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_r%d_rho2.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl_rho2_r%d_%d",eNB_id,round);
|
||||
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_rho2_ext[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_comp0",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_rxF_r%d_comp0.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_rxF_r%d_comp0",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_comp0[0],12*N_RB_DL*nsymb,1,1);
|
||||
if (ue->frame_parms.nb_antenna_ports_gNB == 2) {
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_rxF_r%d_comp1",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_rxF_r%d_comp1.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_rxF_r%d_comp1",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->rxdataF_comp1[harq_pid][round][0],12*N_RB_DL*nsymb,1,1);
|
||||
}
|
||||
|
||||
sprintf(fname,"dlsch%d_rxF_r%d_llr.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_r%d_llr",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_rxF_r%d_llr.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_r%d_llr",eNB_id,round);
|
||||
write_output(fname,vname, ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->llr[0],coded_bits_per_codeword[0],1,0);
|
||||
sprintf(fname,"dlsch%d_r%d_mag1.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_r%d_mag1",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_r%d_mag1.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_r%d_mag1",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_mag0[0],12*N_RB_DL*nsymb,1,1);
|
||||
sprintf(fname,"dlsch%d_r%d_mag2.m",eNB_id,round);
|
||||
sprintf(vname,"dl%d_r%d_mag2",eNB_id,round);
|
||||
snprintf(fname, 32, "dlsch%d_r%d_mag2.m",eNB_id,round);
|
||||
snprintf(vname, 32, "dl%d_r%d_mag2",eNB_id,round);
|
||||
write_output(fname,vname,ue->pdsch_vars[ue->current_thread_id[nr_tti_rx]][eNB_id]->dl_ch_magb0[0],12*N_RB_DL*nsymb,1,1);
|
||||
|
||||
// printf("log2_maxh = %d\n",ue->pdsch_vars[eNB_id]->log2_maxh);
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
#include "common/utils/LOG/vcd_signal_dumper.h"
|
||||
#include "LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
|
||||
//#define DEBUG_ULSCH_CODING
|
||||
|
||||
void free_nr_ue_ulsch(NR_UE_ULSCH_t **ulschptr,unsigned char N_RB_UL)
|
||||
|
||||
@@ -248,7 +249,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
crc = 1;
|
||||
harq_process = ulsch->harq_processes[harq_pid];
|
||||
nb_rb = harq_process->pusch_pdu.rb_size;
|
||||
A = harq_process->pusch_pdu.pusch_data.tb_size;
|
||||
A = harq_process->pusch_pdu.pusch_data.tb_size*8;
|
||||
pz = &Z;
|
||||
mod_order = nr_get_Qm_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
|
||||
R = nr_get_code_rate_ul(harq_process->pusch_pdu.mcs_index, harq_process->pusch_pdu.mcs_table);
|
||||
@@ -271,7 +272,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
// if (harq_process->Ndi == 1) { // this is a new packet
|
||||
if (harq_process->round == 0) { // this is a new packet
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("encoding thinks this is a new packet \n");
|
||||
#endif
|
||||
|
||||
@@ -345,7 +346,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
F = harq_process->F;
|
||||
Kr = harq_process->K;
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
uint16_t Kr_bytes;
|
||||
Kr_bytes = Kr>>3;
|
||||
#endif
|
||||
@@ -358,7 +359,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
//start_meas(te_stats);
|
||||
for (r=0; r<harq_process->C; r++) {
|
||||
//channel_input[r] = &harq_process->d[r][0];
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
printf("Encoder: B %d F %d \n",harq_process->B, harq_process->F);
|
||||
printf("start ldpc encoder segment %d/%d\n",r,harq_process->C);
|
||||
printf("input %d %d %d %d %d \n", harq_process->c[r][0], harq_process->c[r][1], harq_process->c[r][2],harq_process->c[r][3], harq_process->c[r][4]);
|
||||
@@ -391,6 +392,10 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
encoder_implemparams_t impp;
|
||||
impp.n_segments=harq_process->C;
|
||||
impp.macro_num=0;
|
||||
impp.tinput = NULL;
|
||||
impp.tprep = NULL;
|
||||
impp.tparity = NULL;
|
||||
impp.toutput = NULL;
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_LDPC_ENCODER_OPTIM, VCD_FUNCTION_IN);
|
||||
|
||||
@@ -400,7 +405,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
//stop_meas(te_stats);
|
||||
//printf("end ldpc encoder -- output\n");
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
write_output("ulsch_enc_input0.m","enc_in0",&harq_process->c[0][0],Kr_bytes,1,4);
|
||||
write_output("ulsch_enc_output0.m","enc0",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,4);
|
||||
#endif
|
||||
@@ -438,7 +443,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
E = nr_get_E(G, harq_process->C, mod_order, harq_process->pusch_pdu.nrOfLayers, r);
|
||||
|
||||
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->pusch_pdu.nrOfLayers,harq_process->C);
|
||||
Tbslbrm = nr_compute_tbslbrm(0,nb_rb,harq_process->pusch_pdu.nrOfLayers);
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RATE_MATCHING_LDPC, VCD_FUNCTION_IN);
|
||||
nr_rate_matching_ldpc(Ilbrm,
|
||||
@@ -456,7 +461,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
for (int i =0; i<16; i++)
|
||||
printf("output ratematching e[%d]= %d r_offset %d\n", i,harq_process->e[i+r_offset], r_offset);
|
||||
#endif
|
||||
@@ -482,7 +487,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
|
||||
//stop_meas(i_stats);
|
||||
|
||||
|
||||
#ifdef DEBUG_DLSCH_CODING
|
||||
#ifdef DEBUG_ULSCH_CODING
|
||||
for (int i =0; i<16; i++)
|
||||
printf("output interleaving f[%d]= %d r_offset %d\n", i,harq_process->f[i+r_offset], r_offset);
|
||||
|
||||
|
||||
@@ -101,74 +101,53 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
LOG_D(PHY,"nr_ue_ulsch_procedures hard_id %d %d.%d\n",harq_pid,frame,slot);
|
||||
|
||||
uint32_t available_bits;
|
||||
uint8_t mod_order, cwd_index, num_of_codewords, l;
|
||||
uint8_t cwd_index, l;
|
||||
uint32_t scrambled_output[NR_MAX_NB_CODEWORDS][NR_MAX_PDSCH_ENCODED_LENGTH>>5];
|
||||
uint32_t ***pusch_dmrs;
|
||||
int16_t **tx_layers;
|
||||
int32_t **txdataF;
|
||||
uint16_t start_sc, start_rb;
|
||||
int8_t Wf[2], Wt[2], l_prime[2], delta;
|
||||
uint16_t rnti, n_dmrs, code_rate, number_dmrs_symbols, nb_rb, k;
|
||||
uint8_t dmrs_type, nb_dmrs_re_per_rb, number_of_symbols, mcs, Nl;
|
||||
int ap, start_symbol, Nid_cell, i;
|
||||
int sample_offsetF, N_RE_prime, N_PRB_oh;
|
||||
uint16_t ul_dmrs_symb_pos;
|
||||
uint8_t L_ptrs, K_ptrs; // PTRS parameters
|
||||
uint16_t beta_ptrs; // PTRS parameter related to power control
|
||||
uint8_t nb_dmrs_re_per_rb;
|
||||
int ap, i;
|
||||
int sample_offsetF, N_RE_prime;
|
||||
|
||||
NR_UE_ULSCH_t *ulsch_ue;
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue=NULL;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &UE->frame_parms;
|
||||
NR_UE_PUSCH *pusch_ue = UE->pusch_vars[thread_id][gNB_id];
|
||||
// ptrs_UplinkConfig_t *ptrs_Uplink_Config = &UE->pusch_config.dmrs_UplinkConfig.ptrs_UplinkConfig;
|
||||
|
||||
num_of_codewords = 1; // tmp assumption
|
||||
Nid_cell = 0;
|
||||
N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
|
||||
number_dmrs_symbols = 0;
|
||||
uint8_t num_of_codewords = 1; // tmp assumption
|
||||
int Nid_cell = 0;
|
||||
int N_PRB_oh = 0; // higher layer (RRC) parameter xOverhead in PUSCH-ServingCellConfig
|
||||
uint16_t number_dmrs_symbols = 0;
|
||||
|
||||
for (cwd_index = 0;cwd_index < num_of_codewords; cwd_index++) {
|
||||
|
||||
ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_index];
|
||||
harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
|
||||
NR_UE_ULSCH_t *ulsch_ue = UE->ulsch[thread_id][gNB_id][cwd_index];
|
||||
NR_UL_UE_HARQ_t *harq_process_ul_ue = ulsch_ue->harq_processes[harq_pid];
|
||||
nfapi_nr_ue_pusch_pdu_t *pusch_pdu = &harq_process_ul_ue->pusch_pdu;
|
||||
|
||||
start_symbol = harq_process_ul_ue->pusch_pdu.start_symbol_index;
|
||||
ul_dmrs_symb_pos = harq_process_ul_ue->pusch_pdu.ul_dmrs_symb_pos;
|
||||
number_of_symbols = harq_process_ul_ue->pusch_pdu.nr_of_symbols;
|
||||
dmrs_type = harq_process_ul_ue->pusch_pdu.dmrs_config_type;
|
||||
int start_symbol = pusch_pdu->start_symbol_index;
|
||||
uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos;
|
||||
uint8_t number_of_symbols = pusch_pdu->nr_of_symbols;
|
||||
uint8_t dmrs_type = pusch_pdu->dmrs_config_type;
|
||||
uint16_t start_rb = pusch_pdu->rb_start;
|
||||
uint16_t nb_rb = pusch_pdu->rb_size;
|
||||
uint8_t Nl = pusch_pdu->nrOfLayers;
|
||||
uint8_t mod_order = pusch_pdu->qam_mod_order;
|
||||
uint16_t rnti = pusch_pdu->rnti;
|
||||
uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data;
|
||||
uint16_t start_sc = frame_parms->first_carrier_offset + start_rb*NR_NB_SC_PER_RB;
|
||||
|
||||
for (i = start_symbol; i < start_symbol + number_of_symbols; i++) {
|
||||
if (start_sc >= frame_parms->ofdm_symbol_size)
|
||||
start_sc -= frame_parms->ofdm_symbol_size;
|
||||
|
||||
if((ul_dmrs_symb_pos >> i) & 0x01)
|
||||
number_dmrs_symbols += 1;
|
||||
|
||||
}
|
||||
|
||||
rnti = harq_process_ul_ue->pusch_pdu.rnti;
|
||||
ulsch_ue->Nid_cell = Nid_cell;
|
||||
|
||||
nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*harq_process_ul_ue->pusch_pdu.num_dmrs_cdm_grps_no_data;
|
||||
get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols);
|
||||
|
||||
// TbD num_of_mod_symbols is set but never used
|
||||
N_RE_prime = NR_NB_SC_PER_RB*number_of_symbols - nb_dmrs_re_per_rb*number_dmrs_symbols - N_PRB_oh;
|
||||
|
||||
nb_rb = harq_process_ul_ue->pusch_pdu.rb_size;
|
||||
|
||||
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*num_of_codewords;
|
||||
|
||||
mcs = harq_process_ul_ue->pusch_pdu.mcs_index;
|
||||
Nl = harq_process_ul_ue->pusch_pdu.nrOfLayers;
|
||||
mod_order = nr_get_Qm_ul(mcs, 0);
|
||||
code_rate = nr_get_code_rate_ul(mcs, 0);
|
||||
|
||||
harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = nr_compute_tbs(mod_order,
|
||||
code_rate,
|
||||
nb_rb,
|
||||
number_of_symbols,
|
||||
nb_dmrs_re_per_rb*number_dmrs_symbols,
|
||||
0,
|
||||
0,
|
||||
harq_process_ul_ue->pusch_pdu.nrOfLayers);
|
||||
|
||||
/////////////////////////ULSCH coding/////////////////////////
|
||||
///////////
|
||||
|
||||
@@ -210,14 +189,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
/////////////////////////DMRS Modulation/////////////////////////
|
||||
///////////
|
||||
pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
|
||||
n_dmrs = (nb_rb*((dmrs_type == pusch_dmrs_type1) ? 6:4)*number_dmrs_symbols);
|
||||
uint32_t ***pusch_dmrs = UE->nr_gold_pusch_dmrs[slot];
|
||||
uint16_t n_dmrs = (start_rb+nb_rb)*((dmrs_type == pusch_dmrs_type1) ? 6:4);
|
||||
int16_t mod_dmrs[n_dmrs<<1] __attribute((aligned(16)));
|
||||
///////////
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
@@ -227,9 +202,10 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
///////////
|
||||
|
||||
int16_t mod_ptrs[nb_rb] __attribute((aligned(16))); // assume maximum number of PTRS per pusch allocation
|
||||
K_ptrs = 0; // just to avoid a warning
|
||||
uint8_t L_ptrs, K_ptrs = 0;
|
||||
uint16_t beta_ptrs = 1; // temp value until power control is implemented
|
||||
|
||||
if (harq_process_ul_ue->pusch_pdu.pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
|
||||
K_ptrs = harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_freq_density;
|
||||
L_ptrs = 1<<harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_time_density;
|
||||
@@ -274,11 +250,6 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
for (l = start_symbol; l < start_symbol + number_of_symbols; l++) {
|
||||
|
||||
if((ul_dmrs_symb_pos >> l) & 0x01)
|
||||
is_dmrs = 1;
|
||||
else
|
||||
is_dmrs = 0;
|
||||
|
||||
if (is_dmrs == 1)
|
||||
nb_re_dmrs_per_rb = nb_dmrs_re_per_rb;
|
||||
else
|
||||
nb_re_dmrs_per_rb = 0;
|
||||
@@ -303,64 +274,70 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
txdataF = UE->common_vars.txdataF;
|
||||
|
||||
start_rb = harq_process_ul_ue->pusch_pdu.rb_start;
|
||||
start_sc = frame_parms->first_carrier_offset + start_rb*NR_NB_SC_PER_RB;
|
||||
|
||||
if (start_sc >= frame_parms->ofdm_symbol_size)
|
||||
start_sc -= frame_parms->ofdm_symbol_size;
|
||||
|
||||
for (ap=0; ap< Nl; ap++) {
|
||||
|
||||
uint8_t k_prime = 0;
|
||||
uint16_t m = 0;
|
||||
|
||||
// DMRS params for this ap
|
||||
get_Wt(Wt, ap, dmrs_type);
|
||||
get_Wf(Wf, ap, dmrs_type);
|
||||
delta = get_delta(ap, dmrs_type);
|
||||
|
||||
|
||||
uint8_t k_prime=0;
|
||||
uint8_t is_dmrs, is_ptrs, is_dmrs_symbol;
|
||||
uint16_t m=0, n=0, dmrs_idx=0, ptrs_idx = 0;
|
||||
|
||||
for (l=start_symbol; l<start_symbol+number_of_symbols; l++) {
|
||||
ptrs_idx = 0; // every PTRS symbol has a new gold sequence
|
||||
k = start_sc;
|
||||
n = 0;
|
||||
dmrs_idx = 0;
|
||||
|
||||
uint16_t k = start_sc;
|
||||
uint16_t n = 0;
|
||||
uint8_t is_dmrs_sym = 0;
|
||||
uint8_t is_ptrs_sym = 0;
|
||||
uint16_t dmrs_idx = 0, ptrs_idx = 0;
|
||||
|
||||
if ((ul_dmrs_symb_pos >> l) & 0x01) {
|
||||
is_dmrs_sym = 1;
|
||||
|
||||
if (pusch_pdu->transform_precoding == 1){ // if transform precoding is disabled
|
||||
if (dmrs_type == pusch_dmrs_type1)
|
||||
dmrs_idx = start_rb*6;
|
||||
else
|
||||
dmrs_idx = start_rb*4;
|
||||
} else {
|
||||
dmrs_idx = 0;
|
||||
}
|
||||
|
||||
nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
|
||||
|
||||
} else if (pusch_pdu->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
|
||||
|
||||
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols)) {
|
||||
is_ptrs_sym = 1;
|
||||
nr_modulation(pusch_dmrs[l][0], nb_rb, DMRS_MOD_ORDER, mod_ptrs);
|
||||
}
|
||||
}
|
||||
|
||||
for (i=0; i< nb_rb*NR_NB_SC_PER_RB; i++) {
|
||||
|
||||
uint8_t is_dmrs = 0;
|
||||
uint8_t is_ptrs = 0;
|
||||
|
||||
sample_offsetF = l*frame_parms->ofdm_symbol_size + k;
|
||||
|
||||
is_dmrs = 0;
|
||||
is_ptrs = 0;
|
||||
is_dmrs_symbol = 0;
|
||||
|
||||
if((ul_dmrs_symb_pos >> l) & 0x01) {
|
||||
is_dmrs_symbol = 1;
|
||||
if (is_dmrs_sym) {
|
||||
if (k == ((start_sc+get_dmrs_freq_idx_ul(n, k_prime, delta, dmrs_type))%frame_parms->ofdm_symbol_size))
|
||||
is_dmrs = 1;
|
||||
}
|
||||
|
||||
if (harq_process_ul_ue->pusch_pdu.pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS){
|
||||
|
||||
if(is_ptrs_symbol(l, ulsch_ue->ptrs_symbols))
|
||||
} else if (is_ptrs_sym) {
|
||||
is_ptrs = is_ptrs_subcarrier(k,
|
||||
rnti,
|
||||
ap,
|
||||
dmrs_type,
|
||||
K_ptrs,
|
||||
nb_rb,
|
||||
harq_process_ul_ue->pusch_pdu.pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
|
||||
pusch_pdu->pusch_ptrs.ptrs_ports_list[0].ptrs_re_offset,
|
||||
start_sc,
|
||||
frame_parms->ofdm_symbol_size);
|
||||
}
|
||||
|
||||
if (is_dmrs == 1) {
|
||||
|
||||
if (k == start_sc){
|
||||
nr_modulation(pusch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
|
||||
}
|
||||
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[dmrs_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (Wt[l_prime[0]]*Wf[k_prime]*AMP*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
|
||||
|
||||
@@ -378,16 +355,12 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
|
||||
} else if (is_ptrs == 1) {
|
||||
|
||||
if (k == start_sc){
|
||||
nr_modulation(pusch_dmrs[l][0], nb_rb, DMRS_MOD_ORDER, mod_ptrs);
|
||||
}
|
||||
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = (beta_ptrs*AMP*mod_ptrs[ptrs_idx<<1]) >> 15;
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = (beta_ptrs*AMP*mod_ptrs[(ptrs_idx<<1) + 1]) >> 15;
|
||||
|
||||
ptrs_idx++;
|
||||
|
||||
} else if (!is_dmrs_symbol || allowed_xlsch_re_in_dmrs_symbol(k,start_sc,harq_process_ul_ue->pusch_pdu.num_dmrs_cdm_grps_no_data,dmrs_type)) {
|
||||
} else if (!is_dmrs_sym || allowed_xlsch_re_in_dmrs_symbol(k, start_sc, cdm_grps_no_data, dmrs_type)) {
|
||||
|
||||
((int16_t*)txdataF[ap])[(sample_offsetF)<<1] = ((int16_t *) ulsch_ue->y)[m<<1];
|
||||
((int16_t*)txdataF[ap])[((sample_offsetF)<<1) + 1] = ((int16_t *) ulsch_ue->y)[(m<<1) + 1];
|
||||
@@ -412,8 +385,8 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//}
|
||||
NR_UL_UE_HARQ_t *harq_process_ulsch=NULL;
|
||||
harq_process_ulsch = UE->ulsch[thread_id][gNB_id][0]->harq_processes[harq_pid];
|
||||
harq_process_ulsch->status = SCH_IDLE;
|
||||
|
||||
+40
-1
@@ -263,6 +263,8 @@ typedef struct {
|
||||
int16_t e[MAX_NUM_NR_DLSCH_SEGMENTS][3*8448];
|
||||
/// Number of bits in each code block after rate matching for LDPC code (38.212 V15.4.0 section 5.4.2.1)
|
||||
uint32_t E;
|
||||
/// Number of segments processed so far
|
||||
uint32_t processedSegments;
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -475,7 +477,6 @@ typedef struct {
|
||||
uint8_t cl_done;
|
||||
} NR_gNB_PUSCH;
|
||||
|
||||
|
||||
/// Context data structure for RX/TX portion of slot processing
|
||||
typedef struct {
|
||||
/// Component Carrier index
|
||||
@@ -822,7 +823,45 @@ typedef struct PHY_VARS_gNB_s {
|
||||
time_stats_t rx_dft_stats;
|
||||
time_stats_t ulsch_freq_offset_estimation_stats;
|
||||
*/
|
||||
notifiedFIFO_t *respDecode;
|
||||
tpool_t *threadPool;
|
||||
int nbDecode;
|
||||
|
||||
} PHY_VARS_gNB;
|
||||
|
||||
typedef struct LDPCDecode_s {
|
||||
PHY_VARS_gNB *gNB;
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq;
|
||||
t_nrLDPC_dec_params decoderParms;
|
||||
NR_gNB_ULSCH_t *ulsch;
|
||||
short* ulsch_llr;
|
||||
int ulsch_id;
|
||||
int harq_pid;
|
||||
int rv_index;
|
||||
int A;
|
||||
int E;
|
||||
int Kc;
|
||||
int Qm;
|
||||
int Kr_bytes;
|
||||
int nbSegments;
|
||||
int segment_r;
|
||||
int r_offset;
|
||||
int offset;
|
||||
int Tbslbrm;
|
||||
int decodeIterations;
|
||||
} ldpcDecode_t;
|
||||
|
||||
struct ldpcReqId {
|
||||
uint16_t rnti;
|
||||
uint16_t frame;
|
||||
uint8_t subframe;
|
||||
uint8_t codeblock;
|
||||
uint16_t spare;
|
||||
} __attribute__((packed));
|
||||
|
||||
union ldpcReqUnion {
|
||||
struct ldpcReqId s;
|
||||
uint64_t p;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -912,10 +912,6 @@ typedef struct {
|
||||
char ulsch_no_allocation_counter[NUMBER_OF_CONNECTED_eNB_MAX];
|
||||
|
||||
unsigned char ulsch_Msg3_active[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
uint32_t ulsch_Msg3_frame[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
unsigned char ulsch_Msg3_subframe[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
uint8_t Msg3_startSymbol[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
uint8_t Msg3_Length[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
|
||||
NR_PRACH_RESOURCES_t *prach_resources[NUMBER_OF_CONNECTED_gNB_MAX];
|
||||
int turbo_iterations, turbo_cntl_iterations;
|
||||
|
||||
@@ -213,12 +213,74 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
|
||||
*/
|
||||
|
||||
void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req);
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
NR_gNB_ULSCH_t *ulsch = rdata->ulsch;
|
||||
int r = rdata->segment_r;
|
||||
|
||||
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
|
||||
ulsch_harq->processedSegments++;
|
||||
LOG_D(PHY, "processing result of segment: %d, processed %d/%d\n",
|
||||
rdata->segment_r, ulsch_harq->processedSegments, rdata->nbSegments);
|
||||
gNB->nbDecode--;
|
||||
LOG_D(PHY,"remain to decoded in subframe: %d\n", gNB->nbDecode);
|
||||
|
||||
if (decodeSuccess) {
|
||||
memcpy(ulsch_harq->b+rdata->offset,
|
||||
ulsch_harq->c[r],
|
||||
rdata->Kr_bytes- - (ulsch_harq->F>>3) -((ulsch_harq->C>1)?3:0));
|
||||
|
||||
} else {
|
||||
if ( rdata->nbSegments != ulsch_harq->processedSegments ) {
|
||||
int nb=abortTpool(gNB->threadPool, req->key);
|
||||
nb+=abortNotifiedFIFO(gNB->respDecode, req->key);
|
||||
gNB->nbDecode-=nb;
|
||||
LOG_D(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
|
||||
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
|
||||
AssertFatal(ulsch_harq->processedSegments+nb == rdata->nbSegments,"processed: %d, aborted: %d, total %d\n",
|
||||
ulsch_harq->processedSegments, nb, rdata->nbSegments);
|
||||
ulsch_harq->processedSegments=rdata->nbSegments;
|
||||
}
|
||||
}
|
||||
|
||||
// if all segments are done
|
||||
if (rdata->nbSegments == ulsch_harq->processedSegments) {
|
||||
if (decodeSuccess) {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting ACK for nr_tti_rx %d TBS %d\n",
|
||||
gNB->Mod_id,ulsch_harq->slot,ulsch_harq->TBS);
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
|
||||
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0);
|
||||
} else {
|
||||
LOG_D(PHY,"[gNB %d] ULSCH: Setting NAK for SFN/SF %d/%d (pid %d, status %d, round %d, TBS %d) r %d\n",
|
||||
gNB->Mod_id, ulsch_harq->frame, ulsch_harq->slot,
|
||||
rdata->harq_pid,ulsch_harq->status, ulsch_harq->round,ulsch_harq->TBS,r);
|
||||
if (ulsch_harq->round >= ulsch->Mlimit) {
|
||||
ulsch_harq->status = SCH_IDLE;
|
||||
ulsch_harq->round = 0;
|
||||
ulsch_harq->handled = 0;
|
||||
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
|
||||
}
|
||||
ulsch_harq->handled = 1;
|
||||
|
||||
LOG_D(PHY, "ULSCH %d in error\n",rdata->ulsch_id);
|
||||
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 1);
|
||||
}
|
||||
ulsch->last_iteration_cnt = rdata->decodeIterations;
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_gNB_ULSCH_DECODING,0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH_id, uint8_t harq_pid)
|
||||
{
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
nfapi_nr_pusch_pdu_t *pusch_pdu = &gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->ulsch_pdu;
|
||||
|
||||
uint8_t ret;
|
||||
uint8_t l, number_dmrs_symbols = 0;
|
||||
uint32_t G;
|
||||
uint16_t start_symbol, number_symbols, nb_re_dmrs;
|
||||
@@ -270,25 +332,22 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
|
||||
//----------------------------------------------------------
|
||||
|
||||
start_meas(&gNB->ulsch_decoding_stats);
|
||||
ret = nr_ulsch_decoding(gNB,
|
||||
ULSCH_id,
|
||||
gNB->pusch_vars[ULSCH_id]->llr,
|
||||
frame_parms,
|
||||
pusch_pdu,
|
||||
frame_rx,
|
||||
slot_rx,
|
||||
harq_pid,
|
||||
G);
|
||||
stop_meas(&gNB->ulsch_decoding_stats);
|
||||
nr_ulsch_decoding(gNB,
|
||||
ULSCH_id,
|
||||
gNB->pusch_vars[ULSCH_id]->llr,
|
||||
frame_parms,
|
||||
pusch_pdu,
|
||||
frame_rx,
|
||||
slot_rx,
|
||||
harq_pid,
|
||||
G);
|
||||
|
||||
if (ret > gNB->ulsch[ULSCH_id][0]->max_ldpc_iterations){
|
||||
LOG_D(PHY, "ULSCH %d in error\n",ULSCH_id);
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
|
||||
}
|
||||
else if(gNB->ulsch[ULSCH_id][0]->harq_processes[harq_pid]->b!=NULL){
|
||||
LOG_D(PHY, "ULSCH received ok \n");
|
||||
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 0);
|
||||
while (gNB->nbDecode > 0) {
|
||||
notifiedFIFO_elt_t *req=pullTpool(gNB->respDecode, gNB->threadPool);
|
||||
nr_postDecode(gNB, req);
|
||||
delNotifiedFIFO_elt(req);
|
||||
}
|
||||
stop_meas(&gNB->ulsch_decoding_stats);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -111,17 +111,18 @@ int phy_procedures_RN_UE_RX(unsigned char last_slot, unsigned char next_slot, re
|
||||
@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_nrUE_TX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id, uint8_t thread_id);
|
||||
|
||||
/*! \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
|
||||
@param ue Pointer to UE variables on which to act
|
||||
@param proc Pointer to proc information
|
||||
@param gNB_id Local id of eNB on which to act
|
||||
@param mode calibration/debug mode
|
||||
*/
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,UE_nr_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t do_pdcch_flag,runmode_t mode);
|
||||
int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
|
||||
UE_nr_rxtx_proc_t *proc,
|
||||
uint8_t gNB_id,
|
||||
runmode_t mode);
|
||||
|
||||
int phy_procedures_slot_parallelization_nrUE_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);
|
||||
|
||||
|
||||
|
||||
@@ -57,10 +57,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
NR_UE_PDCCH *pdcch_vars = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
|
||||
NR_UE_ULSCH_t *ulsch0 = PHY_vars_UE_g[module_id][cc_id]->ulsch[thread_id][0][0];
|
||||
NR_DL_FRAME_PARMS frame_parms = PHY_vars_UE_g[module_id][cc_id]->frame_parms;
|
||||
//PRACH_RESOURCES_t *prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[0];
|
||||
|
||||
// PUCCH_ConfigCommon_nr_t *pucch_config_common = PHY_vars_UE_g[module_id][cc_id]->pucch_config_common_nr[0];
|
||||
// PUCCH_Config_t *pucch_config_dedicated = PHY_vars_UE_g[module_id][cc_id]->pucch_config_dedicated_nr[0];
|
||||
|
||||
if(scheduled_response->dl_config != NULL){
|
||||
fapi_nr_dl_config_request_t *dl_config = scheduled_response->dl_config;
|
||||
@@ -93,11 +89,11 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
dlsch0->current_harq_pid = current_harq_pid;
|
||||
dlsch0->active = 1;
|
||||
dlsch0->rnti = dl_config->dl_config_list[i].dlsch_config_pdu.rnti;
|
||||
//dlsch0->harq_processes[0]->mcs = &dlsch_config_pdu->mcs;
|
||||
dlsch0_harq = dlsch0->harq_processes[current_harq_pid];
|
||||
|
||||
if (dlsch0_harq){
|
||||
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
dlsch0_harq->BWPStart = dlsch_config_pdu->BWPStart;
|
||||
dlsch0_harq->BWPSize = dlsch_config_pdu->BWPSize;
|
||||
dlsch0_harq->nb_rb = dlsch_config_pdu->number_rbs;
|
||||
@@ -121,8 +117,7 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
pdcch_vars->nb_search_space = 0;
|
||||
dl_config->number_pdus = 0;
|
||||
}
|
||||
|
||||
if (scheduled_response->ul_config != NULL){
|
||||
@@ -159,13 +154,14 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
ulsch0->f_pusch = pusch_config_pdu->absolute_delta_PUSCH;
|
||||
|
||||
if (scheduled_response->tx_request){
|
||||
if (scheduled_response->tx_request){ // TBR todo here it should loop through the number of tx pdus
|
||||
fapi_nr_tx_request_body_t *tx_req_body = scheduled_response->tx_request->tx_request_body;
|
||||
|
||||
//harq_process_ul_ue->a = (unsigned char*)calloc(TBS/8, sizeof(unsigned char));
|
||||
memcpy(harq_process_ul_ue->a, tx_req_body->pdu, tx_req_body->pdu_length);
|
||||
|
||||
harq_process_ul_ue->status = ACTIVE;
|
||||
|
||||
scheduled_response->tx_request->number_of_pdus = 0;
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -223,7 +219,6 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
|
||||
case (FAPI_NR_UL_CONFIG_TYPE_PRACH):
|
||||
// prach config pdu
|
||||
//prach_resources = PHY_vars_UE_g[module_id][cc_id]->prach_resources[gNB_id];
|
||||
prach_config_pdu = &ul_config->ul_config_list[i].prach_config_pdu;
|
||||
memcpy((void*)&(PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_pdu), (void*)prach_config_pdu, sizeof(fapi_nr_ul_config_prach_pdu));
|
||||
PHY_vars_UE_g[module_id][cc_id]->prach_vars[gNB_id]->prach_Config_enabled = 1;
|
||||
@@ -233,11 +228,9 @@ int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response){
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ul_config->number_pdus = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -67,6 +67,9 @@
|
||||
#include "SIMULATION/LTE_PHY/common_sim.h"
|
||||
|
||||
|
||||
unsigned char NB_eNB_INST=0;
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
rlc_info_t Rlc_info_um,Rlc_info_am_config;
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
@@ -84,8 +87,6 @@ uint64_t downlink_frequency[MAX_NUM_CCs][4];
|
||||
// dummy functions
|
||||
int dummy_nr_ue_ul_indication(nr_uplink_indication_t *ul_info) { return(0); }
|
||||
|
||||
void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;}
|
||||
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
const int CC_id,
|
||||
const uint8_t gNB_index,
|
||||
@@ -96,19 +97,33 @@ int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void pdcp_layer_init(void) {}
|
||||
boolean_t
|
||||
pdcp_data_ind(
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
mem_block_t *const sdu_buffer_pP
|
||||
) { return(false);}
|
||||
const rb_id_t Srb_id,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t *const buffer_pP
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
int rrc_init_nr_global_param(void){return(0);}
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||
gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void config_common(int Mod_idP,
|
||||
int pdsch_AntennaPorts,
|
||||
@@ -124,7 +139,6 @@ int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned char short_padding,
|
||||
unsigned short post_padding){return 0;}
|
||||
void nr_DRB_preconfiguration(void){}
|
||||
|
||||
// needed for some functions
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
@@ -184,7 +198,7 @@ int main(int argc, char **argv)
|
||||
|
||||
int frame=1,slot=1;
|
||||
int frame_length_complex_samples;
|
||||
int frame_length_complex_samples_no_prefix;
|
||||
//int frame_length_complex_samples_no_prefix;
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
UE_nr_rxtx_proc_t UE_proc;
|
||||
NR_Sched_Rsp_t Sched_INFO;
|
||||
@@ -192,12 +206,11 @@ int main(int argc, char **argv)
|
||||
NR_UE_MAC_INST_t *UE_mac;
|
||||
int cyclic_prefix_type = NFAPI_CP_NORMAL;
|
||||
int run_initial_sync=0;
|
||||
int do_pdcch_flag=1;
|
||||
int pusch_tgt_snrx10 = 200;
|
||||
int pucch_tgt_snrx10 = 200;
|
||||
int loglvl=OAILOG_INFO;
|
||||
|
||||
float target_error_rate = 0.01;
|
||||
//float target_error_rate = 0.01;
|
||||
int css_flag=0;
|
||||
|
||||
cpuf = get_cpu_freq_GHz();
|
||||
@@ -359,7 +372,7 @@ int main(int argc, char **argv)
|
||||
|
||||
case 'I':
|
||||
run_initial_sync=1;
|
||||
target_error_rate=0.1;
|
||||
//target_error_rate=0.1;
|
||||
slot = 0;
|
||||
break;
|
||||
|
||||
@@ -585,7 +598,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
frame_length_complex_samples = frame_parms->samples_per_subframe*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||
frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||
//frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP*NR_NUMBER_OF_SUBFRAMES_PER_FRAME;
|
||||
|
||||
s_re = malloc(2*sizeof(double*));
|
||||
s_im = malloc(2*sizeof(double*));
|
||||
@@ -698,7 +711,7 @@ int main(int argc, char **argv)
|
||||
|
||||
|
||||
nr_ue_phy_config_request(&UE_mac->phy_config);
|
||||
NR_UE_list_t *UE_list = &RC.nrmac[0]->UE_list;
|
||||
NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info;
|
||||
//NR_COMMON_channels_t *cc = RC.nrmac[0]->common_channels;
|
||||
snrRun = 0;
|
||||
|
||||
@@ -759,11 +772,11 @@ int main(int argc, char **argv)
|
||||
memset(RC.nrmac[0]->cce_list[1][1],0,MAX_NUM_CCE*sizeof(int));
|
||||
clear_nr_nfapi_information(RC.nrmac[0], 0, frame, slot);
|
||||
|
||||
UE_list->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1);
|
||||
UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].ndi = !(trial&1);
|
||||
|
||||
|
||||
UE_list->UE_sched_ctrl[0].harq_processes[harq_pid].round = round;
|
||||
UE_list->UE_sched_ctrl[0].current_harq_pid = harq_pid;
|
||||
UE_info->UE_sched_ctrl[0].harq_processes[harq_pid].round = round;
|
||||
UE_info->UE_sched_ctrl[0].current_harq_pid = harq_pid;
|
||||
gNB->dlsch[0][0]->harq_processes[harq_pid]->round = round;
|
||||
|
||||
if (css_flag == 0) nr_schedule_uss_dlsch_phytest(0,frame,slot,&pucch_sched,&dlsch_config);
|
||||
@@ -883,7 +896,6 @@ int main(int argc, char **argv)
|
||||
phy_procedures_nrUE_RX(UE,
|
||||
&UE_proc,
|
||||
0,
|
||||
do_pdcch_flag,
|
||||
normal_txrx);
|
||||
|
||||
//printf("dlsim round %d ends\n",round);
|
||||
|
||||
@@ -49,6 +49,10 @@
|
||||
#define NR_PRACH_DEBUG 1
|
||||
#define PRACH_WRITE_OUTPUT_DEBUG 1
|
||||
|
||||
unsigned char NB_eNB_INST=0;
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
rlc_info_t Rlc_info_um,Rlc_info_am_config;
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
RAN_CONTEXT_t RC;
|
||||
@@ -66,17 +70,34 @@ int sl_ahead = 0;
|
||||
uint64_t get_softmodem_optmask(void) {return 0;}
|
||||
softmodem_params_t *get_softmodem_params(void) {return 0;}
|
||||
|
||||
void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;}
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const rb_id_t Srb_id,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t *const buffer_pP
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
boolean_t pdcp_data_ind(const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
mem_block_t *const sdu_buffer_pP) {return(false);}
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||
gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void nr_DRB_preconfiguration(void){}
|
||||
void pdcp_layer_init(void) {}
|
||||
int8_t nr_mac_rrc_data_ind_ue(const module_id_t module_id, const int CC_id, const uint8_t gNB_index, const int8_t channel, const uint8_t* pduP, const sdu_size_t pdu_len) {return 0;}
|
||||
|
||||
int main(int argc, char **argv){
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "openair1/SIMULATION/RF/rf.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
|
||||
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
|
||||
//#define DEBUG_NR_ULSCHSIM
|
||||
|
||||
@@ -67,6 +68,44 @@ PHY_VARS_NR_UE *PHY_vars_UE_g[1][1] = { { NULL } };
|
||||
uint16_t n_rnti = 0x1234;
|
||||
openair0_config_t openair0_cfg[MAX_CARDS];
|
||||
|
||||
int nr_postDecode_sim(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
|
||||
ldpcDecode_t *rdata = (ldpcDecode_t*) NotifiedFifoData(req);
|
||||
NR_UL_gNB_HARQ_t *ulsch_harq = rdata->ulsch_harq;
|
||||
NR_gNB_ULSCH_t *ulsch = rdata->ulsch;
|
||||
int r = rdata->segment_r;
|
||||
|
||||
bool decodeSuccess = (rdata->decodeIterations <= rdata->decoderParms.numMaxIter);
|
||||
ulsch_harq->processedSegments++;
|
||||
gNB->nbDecode--;
|
||||
|
||||
if (decodeSuccess) {
|
||||
memcpy(ulsch_harq->b+rdata->offset,
|
||||
ulsch_harq->c[r],
|
||||
rdata->Kr_bytes- - (ulsch_harq->F>>3) -((ulsch_harq->C>1)?3:0));
|
||||
} else {
|
||||
if ( rdata->nbSegments != ulsch_harq->processedSegments ) {
|
||||
int nb=abortTpool(gNB->threadPool, req->key);
|
||||
nb+=abortNotifiedFIFO(gNB->respDecode, req->key);
|
||||
gNB->nbDecode-=nb;
|
||||
AssertFatal(ulsch_harq->processedSegments+nb == rdata->nbSegments,"processed: %d, aborted: %d, total %d\n",
|
||||
ulsch_harq->processedSegments, nb, rdata->nbSegments);
|
||||
ulsch_harq->processedSegments=rdata->nbSegments;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
// if all segments are done
|
||||
if (rdata->nbSegments == ulsch_harq->processedSegments) {
|
||||
if (decodeSuccess) {
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
||||
ulsch->last_iteration_cnt = rdata->decodeIterations;
|
||||
return 0;
|
||||
}
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
char c;
|
||||
@@ -92,7 +131,7 @@ int main(int argc, char **argv)
|
||||
NR_DL_FRAME_PARMS *frame_parms;
|
||||
double sigma;
|
||||
unsigned char qbits = 8;
|
||||
int ret;
|
||||
int ret=0;
|
||||
int loglvl = OAILOG_WARNING;
|
||||
uint64_t SSB_positions=0x01;
|
||||
uint16_t nb_symb_sch = 12;
|
||||
@@ -338,6 +377,11 @@ int main(int argc, char **argv)
|
||||
gNB = RC.gNB[0];
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
char tp_param[] = "n";
|
||||
initTpool(tp_param, gNB->threadPool, true);
|
||||
initNotifiedFIFO(gNB->respDecode);
|
||||
frame_parms = &gNB->frame_parms; //to be initialized I suppose (maybe not necessary for PBCH)
|
||||
frame_parms->nb_antennas_tx = n_tx;
|
||||
frame_parms->nb_antennas_rx = n_rx;
|
||||
@@ -408,7 +452,7 @@ int main(int argc, char **argv)
|
||||
rel15_ul->pusch_data.rv_index = rvidx;
|
||||
rel15_ul->nrOfLayers = Nl;
|
||||
rel15_ul->target_code_rate = code_rate;
|
||||
rel15_ul->pusch_data.tb_size = TBS>>3;
|
||||
rel15_ul->pusch_data.tb_size = TBS/8;
|
||||
///////////////////////////////////////////////////
|
||||
|
||||
double *modulated_input = malloc16(sizeof(double) * 16 * 68 * 384); // [hna] 16 segments, 68*Zc
|
||||
@@ -444,7 +488,7 @@ int main(int argc, char **argv)
|
||||
harq_process_ul_ue->pusch_pdu.nr_of_symbols = nb_symb_sch;
|
||||
harq_process_ul_ue->num_of_mod_symbols = N_RE_prime*nb_rb*nb_codewords;
|
||||
harq_process_ul_ue->pusch_pdu.pusch_data.rv_index = rvidx;
|
||||
harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS;
|
||||
harq_process_ul_ue->pusch_pdu.pusch_data.tb_size = TBS/8;
|
||||
harq_process_ul_ue->a = &test_input[0];
|
||||
|
||||
}
|
||||
@@ -531,10 +575,15 @@ int main(int argc, char **argv)
|
||||
rel15_ul->qam_mod_order,
|
||||
rel15_ul->nrOfLayers);
|
||||
|
||||
ret = nr_ulsch_decoding(gNB, UE_id, channel_output_fixed, frame_parms, rel15_ul,
|
||||
nr_ulsch_decoding(gNB, UE_id, channel_output_fixed, frame_parms, rel15_ul,
|
||||
frame, subframe, harq_pid, G);
|
||||
while (gNB->nbDecode > 0) {
|
||||
notifiedFIFO_elt_t *req=pullTpool(gNB->respDecode, gNB->threadPool);
|
||||
ret = nr_postDecode_sim(gNB, req);
|
||||
delNotifiedFIFO_elt(req);
|
||||
}
|
||||
|
||||
if (ret > ulsch_gNB->max_ldpc_iterations)
|
||||
if (ret)
|
||||
n_errors++;
|
||||
|
||||
//count errors
|
||||
|
||||
@@ -55,11 +55,17 @@
|
||||
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
|
||||
#include "openair2/LAYER2/NR_MAC_UE/mac_proto.h"
|
||||
#include "openair2/LAYER2/NR_MAC_gNB/mac_proto.h"
|
||||
#include "common/utils/threadPool/thread-pool.h"
|
||||
|
||||
#define inMicroS(a) (((double)(a))/(cpu_freq_GHz*1000.0))
|
||||
#include "SIMULATION/LTE_PHY/common_sim.h"
|
||||
|
||||
//#define DEBUG_ULSIM
|
||||
|
||||
unsigned char NB_eNB_INST=0;
|
||||
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
|
||||
rlc_info_t Rlc_info_um,Rlc_info_am_config;
|
||||
|
||||
PHY_VARS_gNB *gNB;
|
||||
PHY_VARS_NR_UE *UE;
|
||||
RAN_CONTEXT_t RC;
|
||||
@@ -84,20 +90,34 @@ int generate_dlsch_header(unsigned char *mac_header,
|
||||
unsigned char *ue_cont_res_id,
|
||||
unsigned char short_padding,
|
||||
unsigned short post_padding){return 0;}
|
||||
void pdcp_layer_init (void) {}
|
||||
boolean_t pdcp_data_ind(
|
||||
|
||||
void
|
||||
rrc_data_ind(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const srb_flag_t srb_flagP,
|
||||
const MBMS_flag_t MBMS_flagP,
|
||||
const rb_id_t rb_idP,
|
||||
const sdu_size_t sdu_buffer_sizeP,
|
||||
mem_block_t *const sdu_buffer_pP
|
||||
) { return(false);}
|
||||
const rb_id_t Srb_id,
|
||||
const sdu_size_t sdu_sizeP,
|
||||
const uint8_t *const buffer_pP
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
void pdcp_run (const protocol_ctxt_t *const ctxt_pP) { return;}
|
||||
void nr_DRB_preconfiguration(void){}
|
||||
int rrc_init_nr_global_param(void){return(0);}
|
||||
int
|
||||
gtpv1u_create_s1u_tunnel(
|
||||
const instance_t instanceP,
|
||||
const gtpv1u_enb_create_tunnel_req_t *const create_tunnel_req_pP,
|
||||
gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
const gtpv1u_enb_create_tunnel_resp_t *const create_tunnel_resp_pP,
|
||||
uint8_t *inde_list
|
||||
) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// needed for some functions
|
||||
uint16_t n_rnti = 0x1234;
|
||||
@@ -181,6 +201,7 @@ int main(int argc, char **argv)
|
||||
int pucch_tgt_snrx10 = 200;
|
||||
int ibwps=24;
|
||||
int ibwp_rboffset=41;
|
||||
int params_from_file = 0;
|
||||
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0 ) {
|
||||
exit_fun("[NR_ULSIM] Error, configuration module init failed\n");
|
||||
}
|
||||
@@ -417,6 +438,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
break;
|
||||
|
||||
case 'Q':
|
||||
params_from_file = 1;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 'h':
|
||||
printf("%s -h(elp) -p(extended_prefix) -N cell_id -f output_filename -F input_filename -g channel_model -n n_frames -t Delayspread -s snr0 -S snr1 -x transmission_mode -y TXant -z RXant -i Intefrence0 -j Interference1 -A interpolation_file -C(alibration offset dB) -N CellId\n", argv[0]);
|
||||
@@ -438,7 +463,7 @@ int main(int argc, char **argv)
|
||||
printf("-A Interpolation_filname Run with Abstraction to generate Scatter plot using interpolation polynomial in file\n");
|
||||
//printf("-C Generate Calibration information for Abstraction (effective SNR adjustment to remove Pe bias w.r.t. AWGN)\n");
|
||||
printf("-F Input filename (.txt format) for RX conformance testing\n");
|
||||
printf("-G raw file containing RRC configuration (generated by gNB)\n");
|
||||
printf("-G Offset of samples to read from file (0 default)\n");
|
||||
printf("-M Multiple SSB positions in burst\n");
|
||||
printf("-N Nid_cell\n");
|
||||
printf("-O oversampling factor (1,2,4,8,16)\n");
|
||||
@@ -448,6 +473,7 @@ int main(int argc, char **argv)
|
||||
printf("-P Print ULSCH performances\n");
|
||||
printf("-T Enable PTRS, arguments list L_PTRS{0,1,2} K_PTRS{2,4}, e.g. -T 2 0 2 \n");
|
||||
printf("-U Change DMRS Config, arguments list DMRS TYPE{0=A,1=B} DMRS AddPos{0:3}, e.g. -U 2 0 2 \n");
|
||||
printf("-Q If -F used, read parameters from file\n");
|
||||
exit(-1);
|
||||
break;
|
||||
|
||||
@@ -494,6 +520,11 @@ int main(int argc, char **argv)
|
||||
RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
|
||||
RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB));
|
||||
gNB = RC.gNB[0];
|
||||
gNB->threadPool = (tpool_t*)malloc(sizeof(tpool_t));
|
||||
gNB->respDecode = (notifiedFIFO_t*) malloc(sizeof(notifiedFIFO_t));
|
||||
char tp_param[] = "n";
|
||||
initTpool(tp_param, gNB->threadPool, true);
|
||||
initNotifiedFIFO(gNB->respDecode);
|
||||
//gNB_config = &gNB->gNB_config;
|
||||
|
||||
//memset((void *)&gNB->UL_INFO,0,sizeof(gNB->UL_INFO));
|
||||
@@ -716,6 +747,7 @@ int main(int argc, char **argv)
|
||||
//for (int i=0;i<16;i++) printf("%f\n",gaussdouble(0.0,1.0));
|
||||
snrRun = 0;
|
||||
int n_errs = 0;
|
||||
int read_errors=0;
|
||||
|
||||
int slot_offset = frame_parms->get_samples_slot_timestamp(slot,frame_parms,0);
|
||||
int slot_length = slot_offset - frame_parms->get_samples_slot_timestamp(slot-1,frame_parms,0);
|
||||
@@ -725,31 +757,35 @@ int main(int argc, char **argv)
|
||||
// 800 samples is N_TA_OFFSET for FR1 @ 30.72 Ms/s,
|
||||
AssertFatal(frame_parms->subcarrier_spacing==30000,"only 30 kHz for file input for now (%d)\n",frame_parms->subcarrier_spacing);
|
||||
|
||||
fseek(input_fd,file_offset*((slot_length<<2)+4000+16),SEEK_SET);
|
||||
fread((void*)&n_rnti,sizeof(int16_t),1,input_fd);
|
||||
printf("rnti %x\n",n_rnti);
|
||||
fread((void*)&nb_rb,sizeof(int16_t),1,input_fd);
|
||||
printf("nb_rb %d\n",nb_rb);
|
||||
int16_t dummy;
|
||||
fread((void*)&start_rb,sizeof(int16_t),1,input_fd);
|
||||
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
|
||||
printf("rb_start %d\n",start_rb);
|
||||
fread((void*)&nb_symb_sch,sizeof(int16_t),1,input_fd);
|
||||
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
|
||||
printf("nb_symb_sch %d\n",nb_symb_sch);
|
||||
fread((void*)&start_symbol,sizeof(int16_t),1,input_fd);
|
||||
printf("start_symbol %d\n",start_symbol);
|
||||
fread((void*)&Imcs,sizeof(int16_t),1,input_fd);
|
||||
printf("mcs %d\n",Imcs);
|
||||
fread((void*)&rv_index,sizeof(int16_t),1,input_fd);
|
||||
printf("rv_index %d\n",rv_index);
|
||||
// fread((void*)&harq_pid,sizeof(int16_t),1,input_fd);
|
||||
fread((void*)&dummy,sizeof(int16_t),1,input_fd);
|
||||
printf("harq_pid %d\n",harq_pid);
|
||||
fread((void*)&gNB->common_vars.rxdata[0][slot_offset-delay],
|
||||
sizeof(int16_t),
|
||||
slot_length<<1,
|
||||
input_fd);
|
||||
if (params_from_file) {
|
||||
fseek(input_fd,file_offset*((slot_length<<2)+4000+16),SEEK_SET);
|
||||
read_errors+=fread((void*)&n_rnti,sizeof(int16_t),1,input_fd);
|
||||
printf("rnti %x\n",n_rnti);
|
||||
read_errors+=fread((void*)&nb_rb,sizeof(int16_t),1,input_fd);
|
||||
printf("nb_rb %d\n",nb_rb);
|
||||
int16_t dummy;
|
||||
read_errors+=fread((void*)&start_rb,sizeof(int16_t),1,input_fd);
|
||||
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
|
||||
printf("rb_start %d\n",start_rb);
|
||||
read_errors+=fread((void*)&nb_symb_sch,sizeof(int16_t),1,input_fd);
|
||||
//fread((void*)&dummy,sizeof(int16_t),1,input_fd);
|
||||
printf("nb_symb_sch %d\n",nb_symb_sch);
|
||||
read_errors+=fread((void*)&start_symbol,sizeof(int16_t),1,input_fd);
|
||||
printf("start_symbol %d\n",start_symbol);
|
||||
read_errors+=fread((void*)&Imcs,sizeof(int16_t),1,input_fd);
|
||||
printf("mcs %d\n",Imcs);
|
||||
read_errors+=fread((void*)&rv_index,sizeof(int16_t),1,input_fd);
|
||||
printf("rv_index %d\n",rv_index);
|
||||
// fread((void*)&harq_pid,sizeof(int16_t),1,input_fd);
|
||||
read_errors+=fread((void*)&dummy,sizeof(int16_t),1,input_fd);
|
||||
printf("harq_pid %d\n",harq_pid);
|
||||
}
|
||||
fseek(input_fd,file_offset*sizeof(int16_t)*2,SEEK_SET);
|
||||
read_errors+=fread((void*)&gNB->common_vars.rxdata[0][slot_offset-delay],
|
||||
sizeof(int16_t),
|
||||
slot_length<<1,
|
||||
input_fd);
|
||||
if (read_errors==0) exit(1);
|
||||
for (int i=0;i<16;i+=2) printf("slot_offset %d : %d,%d\n",
|
||||
slot_offset,
|
||||
((int16_t*)&gNB->common_vars.rxdata[0][slot_offset])[i],
|
||||
@@ -767,6 +803,17 @@ int main(int argc, char **argv)
|
||||
int n_errors[4] = {0,0,0,0};;
|
||||
int round_trials[4]={0,0,0,0};
|
||||
uint32_t errors_scrambling[4] = {0,0,0,0};
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->rx_pusch_stats);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_deinterleaving_stats);
|
||||
reset_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
reset_meas(&gNB->ulsch_ldpc_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_unscrambling_stats);
|
||||
reset_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
reset_meas(&gNB->ulsch_llr_stats);
|
||||
reset_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
reset_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
|
||||
clear_pusch_stats(gNB);
|
||||
for (trial = 0; trial < n_trials; trial++) {
|
||||
@@ -780,19 +827,6 @@ int main(int argc, char **argv)
|
||||
ulsch_ue[0]->harq_processes[harq_pid]->round = round;
|
||||
gNB->ulsch[0][0]->harq_processes[harq_pid]->round = round;
|
||||
rv_index = nr_rv_round_map[round];
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->rx_pusch_stats);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_deinterleaving_stats);
|
||||
reset_meas(&gNB->ulsch_rate_unmatching_stats);
|
||||
reset_meas(&gNB->ulsch_ldpc_decoding_stats);
|
||||
reset_meas(&gNB->ulsch_unscrambling_stats);
|
||||
reset_meas(&gNB->ulsch_channel_estimation_stats);
|
||||
reset_meas(&gNB->ulsch_ptrs_processing_stats);
|
||||
reset_meas(&gNB->ulsch_llr_stats);
|
||||
reset_meas(&gNB->ulsch_mrc_stats);
|
||||
reset_meas(&gNB->ulsch_channel_compensation_stats);
|
||||
reset_meas(&gNB->ulsch_rbs_extraction_stats);
|
||||
|
||||
UE_proc.nr_tti_tx = slot;
|
||||
UE_proc.frame_tx = frame;
|
||||
@@ -884,6 +918,7 @@ int main(int argc, char **argv)
|
||||
ul_config.ul_config_list[0].pdu_type = FAPI_NR_UL_CONFIG_TYPE_PUSCH;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.rnti = n_rnti;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pdu_bit_map = pdu_bit_map;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.qam_mod_order = mod_order;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.rb_size = nb_rb;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.rb_start = start_rb;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.nr_of_symbols = nb_symb_sch;
|
||||
@@ -896,7 +931,7 @@ int main(int argc, char **argv)
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.nrOfLayers = precod_nbr_layers;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.absolute_delta_PUSCH = 0;
|
||||
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.tb_size = TBS/8;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.new_data_indicator = trial & 0x1;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.rv_index = rv_index;
|
||||
ul_config.ul_config_list[0].pusch_config_pdu.pusch_data.harq_process_id = harq_pid;
|
||||
@@ -908,7 +943,7 @@ int main(int argc, char **argv)
|
||||
|
||||
nr_fill_ulsch(gNB,frame,slot,pusch_pdu);
|
||||
|
||||
for (int i=0;i<(TBS>>3);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff;
|
||||
for (int i=0;i<(TBS/8);i++) ulsch_ue[0]->harq_processes[harq_pid]->a[i]=i&0xff;
|
||||
double scale = 1;
|
||||
|
||||
if (input_fd == NULL) {
|
||||
@@ -1126,9 +1161,9 @@ int main(int argc, char **argv)
|
||||
printStatIndent2(&gNB->ulsch_llr_stats,"ULSCH llr computation");
|
||||
printStatIndent(&gNB->ulsch_unscrambling_stats,"ULSCH unscrambling");
|
||||
printStatIndent(&gNB->ulsch_decoding_stats,"ULSCH total decoding time");
|
||||
printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving");
|
||||
printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx");
|
||||
printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding");
|
||||
//printStatIndent2(&gNB->ulsch_deinterleaving_stats,"ULSCH deinterleaving");
|
||||
//printStatIndent2(&gNB->ulsch_rate_unmatching_stats,"ULSCH rate matching rx");
|
||||
//printStatIndent2(&gNB->ulsch_ldpc_decoding_stats,"ULSCH ldpc decoding");
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ typedef struct gtpv1u_enb_delete_tunnel_req_s {
|
||||
uint8_t num_erab;
|
||||
ebi_t eps_bearer_id[GTPV1U_MAX_BEARERS_PER_UE];
|
||||
//teid_t enb_S1u_teid; ///< local SGW S11 Tunnel Endpoint Identifier
|
||||
int from_gnb; ///< Indicates if the message comes from gNB or eNB (1 = comes from gNB, 0 from eNB)
|
||||
} gtpv1u_enb_delete_tunnel_req_t;
|
||||
|
||||
typedef struct gtpv1u_enb_delete_tunnel_resp_s {
|
||||
@@ -170,4 +171,5 @@ typedef struct {
|
||||
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
|
||||
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
|
||||
} Gtpv1uS1Req;
|
||||
|
||||
#endif /* GTPV1_U_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -323,6 +323,8 @@ typedef struct RrcConfigurationReq_s {
|
||||
char *discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_buf[MAX_NUM_CCs];
|
||||
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_size[MAX_NUM_CCs];
|
||||
long discRxPoolPS_ResourceConfig_subframeBitmap_choice_bs_bits_unused[MAX_NUM_CCs];
|
||||
//Nr secondary cell group SSB central frequency (for ENDC NSA)
|
||||
int nr_scg_ssb_freq;
|
||||
} RrcConfigurationReq;
|
||||
|
||||
#define MAX_NUM_NBIOT_CELEVELS 3
|
||||
|
||||
@@ -48,10 +48,19 @@ MESSAGE_DEF(X2AP_HANDOVER_CANCEL , MESSAGE_PRIORITY_MED, x2ap_han
|
||||
/* handover messages X2AP <-> S1AP */
|
||||
MESSAGE_DEF(X2AP_UE_CONTEXT_RELEASE , MESSAGE_PRIORITY_MED, x2ap_ue_context_release_t , x2ap_ue_context_release)
|
||||
|
||||
/*Senb bearer addition messages X2AP <-> RRC */
|
||||
/* Senb bearer addition messages X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_SENB_ADDITION_REQ , MESSAGE_PRIORITY_MED, x2ap_senb_addition_req_t , x2ap_senb_addition_req)
|
||||
|
||||
/*SGnb bearer addition messages X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_ADDITION_REQ , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_addition_req_t , x2ap_ENDC_sgnb_addition_req)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_ADDITION_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_addition_req_ACK_t , x2ap_ENDC_sgnb_addition_req_ACK)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_RECONF_COMPLETE , MESSAGE_PRIORITY_MED, x2ap_ENDC_reconf_complete_t , x2ap_ENDC_sgnb_reconf_complete)
|
||||
/* SGnb bearer addition messages X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_ENDC_SETUP_REQ , MESSAGE_PRIORITY_MED, x2ap_ENDC_setup_req_t , x2ap_ENDC_setup_req)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_ADDITION_REQ , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_addition_req_t , x2ap_ENDC_sgnb_addition_req)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_ADDITION_REQ_ACK , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_addition_req_ACK_t, x2ap_ENDC_sgnb_addition_req_ACK)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_RECONF_COMPLETE , MESSAGE_PRIORITY_MED, x2ap_ENDC_reconf_complete_t , x2ap_ENDC_sgnb_reconf_complete)
|
||||
|
||||
/* SGnb UE releases ('request' is for enb starting the process, 'required' for gnb) */
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_RELEASE_REQUEST , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_release_request_t , x2ap_ENDC_sgnb_release_request)
|
||||
MESSAGE_DEF(X2AP_ENDC_SGNB_RELEASE_REQUIRED , MESSAGE_PRIORITY_MED, x2ap_ENDC_sgnb_release_required_t, x2ap_ENDC_sgnb_release_required)
|
||||
|
||||
/* ENDC timers' timeout X2AP <-> RRC */
|
||||
MESSAGE_DEF(X2AP_ENDC_DC_PREP_TIMEOUT , MESSAGE_PRIORITY_MED, x2ap_ENDC_dc_prep_timeout_t , x2ap_ENDC_dc_prep_timeout)
|
||||
MESSAGE_DEF(X2AP_ENDC_DC_OVERALL_TIMEOUT , MESSAGE_PRIORITY_MED, x2ap_ENDC_dc_overall_timeout_t , x2ap_ENDC_dc_overall_timeout)
|
||||
|
||||
@@ -25,22 +25,34 @@
|
||||
#include "s1ap_messages_types.h"
|
||||
#include "LTE_PhysCellId.h"
|
||||
|
||||
typedef enum {
|
||||
X2AP_CAUSE_T_DC_PREP_TIMEOUT,
|
||||
X2AP_CAUSE_T_DC_OVERALL_TIMEOUT,
|
||||
X2AP_CAUSE_RADIO_CONNECTION_WITH_UE_LOST,
|
||||
} x2ap_cause_t;
|
||||
|
||||
//-------------------------------------------------------------------------------------------//
|
||||
// Defines to access message fields.
|
||||
|
||||
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
|
||||
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
|
||||
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
|
||||
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
|
||||
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
|
||||
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
|
||||
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
|
||||
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
|
||||
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
|
||||
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
|
||||
#define X2AP_ENDC_SGNB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req
|
||||
#define X2AP_ENDC_SGNB_ADDITION_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req_ACK
|
||||
#define X2AP_ENDC_SGNB_RECONF_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_reconf_complete
|
||||
|
||||
#define X2AP_REGISTER_ENB_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_req
|
||||
#define X2AP_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_req
|
||||
#define X2AP_SETUP_RESP(mSGpTR) (mSGpTR)->ittiMsg.x2ap_setup_resp
|
||||
#define X2AP_HANDOVER_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req
|
||||
#define X2AP_HANDOVER_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_req_ack
|
||||
#define X2AP_REGISTER_ENB_CNF(mSGpTR) (mSGpTR)->ittiMsg.x2ap_register_enb_cnf
|
||||
#define X2AP_DEREGISTERED_ENB_IND(mSGpTR) (mSGpTR)->ittiMsg.x2ap_deregistered_enb_ind
|
||||
#define X2AP_UE_CONTEXT_RELEASE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ue_context_release
|
||||
#define X2AP_HANDOVER_CANCEL(mSGpTR) (mSGpTR)->ittiMsg.x2ap_handover_cancel
|
||||
#define X2AP_SENB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_senb_addition_req
|
||||
#define X2AP_ENDC_SGNB_ADDITION_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req
|
||||
#define X2AP_ENDC_SGNB_ADDITION_REQ_ACK(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_addition_req_ACK
|
||||
#define X2AP_ENDC_SGNB_RECONF_COMPLETE(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_reconf_complete
|
||||
#define X2AP_ENDC_SGNB_RELEASE_REQUEST(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_release_request
|
||||
#define X2AP_ENDC_SGNB_RELEASE_REQUIRED(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_sgnb_release_required
|
||||
#define X2AP_ENDC_DC_PREP_TIMEOUT(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_dc_prep_timeout
|
||||
#define X2AP_ENDC_DC_OVERALL_TIMEOUT(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_dc_overall_timeout
|
||||
#define X2AP_ENDC_SETUP_REQ(mSGpTR) (mSGpTR)->ittiMsg.x2ap_ENDC_setup_req
|
||||
|
||||
#define X2AP_MAX_NB_ENB_IP_ADDRESS 2
|
||||
|
||||
@@ -144,6 +156,8 @@ typedef struct x2ap_register_enb_req_s {
|
||||
/* timers (unit: millisecond) */
|
||||
int t_reloc_prep;
|
||||
int tx2_reloc_overall;
|
||||
int t_dc_prep;
|
||||
int t_dc_overall;
|
||||
} x2ap_register_enb_req_t;
|
||||
|
||||
typedef struct x2ap_subframe_process_s {
|
||||
@@ -288,10 +302,6 @@ typedef struct x2ap_senb_addition_req_s {
|
||||
|
||||
}x2ap_senb_addition_req_t;
|
||||
|
||||
|
||||
|
||||
|
||||
//Panos: Have to see what should be the additional/different elements comparing to handover req ack
|
||||
typedef struct x2ap_senb_addition_req_ack_s {
|
||||
|
||||
int MeNB_UE_X2_id;
|
||||
@@ -313,6 +323,13 @@ typedef struct x2ap_senb_addition_req_ack_s {
|
||||
|
||||
} x2ap_senb_addition_req_ack_t;
|
||||
|
||||
|
||||
typedef struct x2ap_ENDC_setup_req_s {
|
||||
uint32_t Nid_cell[MAX_NUM_CCs];
|
||||
int num_cc;
|
||||
uint32_t servedNrCell_band[MAX_NUM_CCs];
|
||||
} x2ap_ENDC_setup_req_t;
|
||||
|
||||
typedef struct x2ap_ENDC_sgnb_addition_req_s {
|
||||
int ue_x2_id;
|
||||
LTE_PhysCellId_t target_physCellId;
|
||||
@@ -357,6 +374,8 @@ typedef struct x2ap_ENDC_sgnb_addition_req_ACK_s {
|
||||
|
||||
int SgNB_ue_x2_id;
|
||||
|
||||
int gnb_x2_assoc_id; // to be stored in the rrc's ue context, used when sending 'sgnb reconfiguration complete'
|
||||
|
||||
/* used for X2AP->RRC in source eNB */
|
||||
int rnti;
|
||||
|
||||
@@ -384,16 +403,26 @@ typedef struct x2ap_ENDC_sgnb_addition_req_ACK_s {
|
||||
|
||||
typedef struct x2ap_ENDC_reconf_complete_s {
|
||||
int MeNB_ue_x2_id;
|
||||
|
||||
int SgNB_ue_x2_id;
|
||||
LTE_PhysCellId_t target_physCellId;
|
||||
|
||||
x2ap_sgNB_reconf_response_information_t reconf_response;
|
||||
|
||||
uint8_t rrc_buffer[4096 /* arbitrary, big enough */];
|
||||
int rrc_buffer_size;
|
||||
|
||||
int gnb_x2_assoc_id;
|
||||
} x2ap_ENDC_reconf_complete_t;
|
||||
|
||||
typedef struct x2ap_ENDC_sgnb_release_request_s {
|
||||
int rnti;
|
||||
x2ap_cause_t cause;
|
||||
int assoc_id;
|
||||
} x2ap_ENDC_sgnb_release_request_t;
|
||||
|
||||
typedef struct x2ap_ENDC_sgnb_release_required_s {
|
||||
int gnb_rnti;
|
||||
} x2ap_ENDC_sgnb_release_required_t;
|
||||
|
||||
typedef struct x2ap_ENDC_dc_prep_timeout_s {
|
||||
int rnti;
|
||||
} x2ap_ENDC_dc_prep_timeout_t;
|
||||
|
||||
typedef struct x2ap_ENDC_dc_overall_timeout_s {
|
||||
int rnti;
|
||||
} x2ap_ENDC_dc_overall_timeout_t;
|
||||
|
||||
#endif /* X2AP_MESSAGES_TYPES_H_ */
|
||||
|
||||
@@ -1576,6 +1576,8 @@ int RCconfig_RRC(uint32_t i, eNB_RRC_INST *rrc, int macrlc_has_f1) {
|
||||
} // !NODE_IS_DU(node_type)
|
||||
}
|
||||
|
||||
RRC_CONFIGURATION_REQ (msg_p).nr_scg_ssb_freq = ccparams_lte.nr_scg_ssb_freq;
|
||||
|
||||
if (!NODE_IS_DU(rrc->node_type)) {
|
||||
char srb1path[MAX_OPTNAME_SIZE*2 + 8];
|
||||
sprintf(srb1path,"%s.%s",enbpath,ENB_CONFIG_STRING_SRB1);
|
||||
@@ -2731,20 +2733,28 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
|
||||
{
|
||||
int t_reloc_prep = 0;
|
||||
int tx2_reloc_overall = 0;
|
||||
int t_dc_prep = 0;
|
||||
int t_dc_overall = 0;
|
||||
paramdef_t p[] = {
|
||||
{ "t_reloc_prep", "t_reloc_prep", 0, iptr:&t_reloc_prep, defintval:0, TYPE_INT, 0 },
|
||||
{ "tx2_reloc_overall", "tx2_reloc_overall", 0, iptr:&tx2_reloc_overall, defintval:0, TYPE_INT, 0 }
|
||||
{ "tx2_reloc_overall", "tx2_reloc_overall", 0, iptr:&tx2_reloc_overall, defintval:0, TYPE_INT, 0 },
|
||||
{ "t_dc_prep", "t_dc_prep", 0, iptr:&t_dc_prep, defintval:0, TYPE_INT, 0 },
|
||||
{ "t_dc_overall", "t_dc_overall", 0, iptr:&t_dc_overall, defintval:0, TYPE_INT, 0 }
|
||||
};
|
||||
config_get(p, sizeof(p)/sizeof(paramdef_t), aprefix);
|
||||
|
||||
if (t_reloc_prep <= 0 || t_reloc_prep > 10000 ||
|
||||
tx2_reloc_overall <= 0 || tx2_reloc_overall > 20000) {
|
||||
LOG_E(X2AP, "timers in configuration file have wrong values. We must have [0 < t_reloc_prep <= 10000] and [0 < tx2_reloc_overall <= 20000]\n");
|
||||
tx2_reloc_overall <= 0 || tx2_reloc_overall > 20000 ||
|
||||
t_dc_prep <= 0 || t_dc_prep > 10000 ||
|
||||
t_dc_overall <= 0 || t_dc_overall > 20000) {
|
||||
LOG_E(X2AP, "timers in configuration file have wrong values. We must have [0 < t_reloc_prep <= 10000] and [0 < tx2_reloc_overall <= 20000] and [0 < t_dc_prep <= 10000] and [0 < t_dc_overall <= 20000]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_reloc_prep = t_reloc_prep;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).tx2_reloc_overall = tx2_reloc_overall;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_dc_prep = t_dc_prep;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_dc_overall = t_dc_overall;
|
||||
}
|
||||
// SCTP SETTING
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
|
||||
|
||||
@@ -429,6 +429,9 @@ typedef enum {
|
||||
//SIB1-MBMS
|
||||
#define ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL "mbms_dedicated_serving_cell"
|
||||
|
||||
//NSA NR Cell SSB Absolute Frequency
|
||||
#define ENB_CONFIG_STRING_NR_SCG_SSB_FREQ "nr_scg_ssb_freq"
|
||||
|
||||
|
||||
|
||||
#define ENB_CONFIG_STRING_PDSCH_MAX_NUM_REPETITION_CE_MODE_A_R13 "pdsch_maxNumRepetitionCEmodeA_r13"
|
||||
@@ -577,6 +580,7 @@ typedef struct ccparams_lte_s {
|
||||
int32_t srb1_poll_pdu;
|
||||
int32_t srb1_poll_byte;
|
||||
int32_t srb1_max_retx_threshold;
|
||||
int32_t nr_scg_ssb_freq;
|
||||
} ccparams_lte_t;
|
||||
|
||||
#define CCPARAMS_CHECK { \
|
||||
@@ -780,7 +784,8 @@ typedef struct ccparams_lte_s {
|
||||
{ENB_CONFIG_STRING_UETIMERS_N311, NULL, 0, iptr:&ccparams.ue_TimersAndConstants_n311, defintval:1, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_UE_TRANSMISSION_MODE, NULL, 0, iptr:&ccparams.ue_TransmissionMode, defintval:1, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_UE_MULTIPLE_MAX, NULL, 0, iptr:&ccparams.ue_multiple_max, defintval:4, TYPE_UINT, 0}, \
|
||||
{ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL, NULL, 0, strptr:&ccparams.mbms_dedicated_serving_cell, defstrval:"DISABLE", TYPE_STRING, 0} \
|
||||
{ENB_CONFIG_STRING_MBMS_DEDICATED_SERVING_CELL, NULL, 0, strptr:&ccparams.mbms_dedicated_serving_cell, defstrval:"DISABLE", TYPE_STRING, 0}, \
|
||||
{ENB_CONFIG_STRING_NR_SCG_SSB_FREQ, NULL, 0, iptr:&ccparams.nr_scg_ssb_freq, defintval:641272, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1123,20 +1123,28 @@ int RCconfig_NR_X2(MessageDef *msg_p, uint32_t i) {
|
||||
{
|
||||
int t_reloc_prep = 0;
|
||||
int tx2_reloc_overall = 0;
|
||||
int t_dc_prep = 0;
|
||||
int t_dc_overall = 0;
|
||||
paramdef_t p[] = {
|
||||
{ "t_reloc_prep", "t_reloc_prep", 0, iptr:&t_reloc_prep, defintval:0, TYPE_INT, 0 },
|
||||
{ "tx2_reloc_overall", "tx2_reloc_overall", 0, iptr:&tx2_reloc_overall, defintval:0, TYPE_INT, 0 }
|
||||
{ "tx2_reloc_overall", "tx2_reloc_overall", 0, iptr:&tx2_reloc_overall, defintval:0, TYPE_INT, 0 },
|
||||
{ "t_dc_prep", "t_dc_prep", 0, iptr:&t_dc_prep, defintval:0, TYPE_INT, 0 },
|
||||
{ "t_dc_overall", "t_dc_overall", 0, iptr:&t_dc_overall, defintval:0, TYPE_INT, 0 }
|
||||
};
|
||||
config_get(p, sizeof(p)/sizeof(paramdef_t), aprefix);
|
||||
|
||||
if (t_reloc_prep <= 0 || t_reloc_prep > 10000 ||
|
||||
tx2_reloc_overall <= 0 || tx2_reloc_overall > 20000) {
|
||||
LOG_E(X2AP, "timers in configuration file have wrong values. We must have [0 < t_reloc_prep <= 10000] and [0 < tx2_reloc_overall <= 20000]\n");
|
||||
tx2_reloc_overall <= 0 || tx2_reloc_overall > 20000 ||
|
||||
t_dc_prep <= 0 || t_dc_prep > 10000 ||
|
||||
t_dc_overall <= 0 || t_dc_overall > 20000) {
|
||||
LOG_E(X2AP, "timers in configuration file have wrong values. We must have [0 < t_reloc_prep <= 10000] and [0 < tx2_reloc_overall <= 20000] and [0 < t_dc_prep <= 10000] and [0 < t_dc_overall <= 20000]\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_reloc_prep = t_reloc_prep;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).tx2_reloc_overall = tx2_reloc_overall;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_dc_prep = t_dc_prep;
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).t_dc_overall = t_dc_overall;
|
||||
}
|
||||
// SCTP SETTING
|
||||
X2AP_REGISTER_ENB_REQ (msg_p).sctp_out_streams = SCTP_OUT_STREAMS;
|
||||
|
||||
@@ -211,7 +211,7 @@ schedule_MBMS_NFAPI(module_id_t module_idP, uint8_t CC_id, frame_t frameP,
|
||||
msi_pos++;
|
||||
while((non_mbsfn_SubframeConfig & (0x100 >> msi_pos)) == (0x100>>msi_pos))
|
||||
msi_pos++;
|
||||
mbms_mch_i=0;
|
||||
mbms_mch_i=0;
|
||||
|
||||
if((subframeP==0)){
|
||||
x=0;
|
||||
|
||||
+49
-54
@@ -27,76 +27,70 @@
|
||||
|
||||
#include "common/utils/nr/nr_common.h"
|
||||
#include <math.h>
|
||||
#include "PHY/defs_nr_common.h"
|
||||
|
||||
//Table 5.1.2.2-2
|
||||
uint16_t Tbstable_nr[INDEX_MAX_TBS_TABLE] = {24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,208,224,240,256,272,288,304,320,336,352,368,384,408,432,456,480,504,528,552,576,608,640,672,704,736,768,808,848,888,928,984,1032,1064,1128,1160,1192,1224,1256,1288,1320,1352,1416,1480,1544,1608,1672,1736,1800,1864,1928,2024,2088,2152,2216,2280,2408,2472,2536,2600,2664,2728,2792,2856,2976,3104,3240,3368,3496,3624,3752,3824};
|
||||
|
||||
uint16_t NPRB_LBRM[7] = {32,66,107,135,162,217,273};
|
||||
|
||||
// Transport block size determination according to 6.1.4.2 of TS 38.214
|
||||
// returns the TBS in bits
|
||||
uint32_t nr_compute_tbs(uint16_t Qm,
|
||||
uint16_t R,
|
||||
uint16_t nb_rb,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint16_t nb_rb,
|
||||
uint16_t nb_symb_sch,
|
||||
uint16_t nb_dmrs_prb,
|
||||
uint16_t nb_rb_oh,
|
||||
uint8_t tb_scaling,
|
||||
uint8_t Nl)
|
||||
uint8_t Nl)
|
||||
{
|
||||
|
||||
uint16_t nbp_re, nb_re;
|
||||
uint32_t nr_tbs=0;
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n, scale;
|
||||
uint16_t nbp_re, nb_re;
|
||||
uint32_t nr_tbs=0;
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n, scale;
|
||||
|
||||
nbp_re = 12 * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
nbp_re = NR_NB_SC_PER_RB * nb_symb_sch - nb_dmrs_prb - nb_rb_oh;
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
scale = (R>1024)?11:10;
|
||||
// Intermediate number of information bits
|
||||
Ninfo = ((nb_re * R * Qm * Nl)>>scale)>>tb_scaling;
|
||||
|
||||
nb_re = min(156, nbp_re) * nb_rb;
|
||||
|
||||
scale = (R>1024)?11:10;
|
||||
|
||||
// Intermediate number of information bits
|
||||
Ninfo = ((nb_re * R * Qm * Nl)>>scale)>>tb_scaling;
|
||||
|
||||
if (Ninfo <=3824) {
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, (Ninfo>>n)<<n);
|
||||
for (int i=0; i<INDEX_MAX_TBS_TABLE; i++) {
|
||||
if (Tbstable_nr[i] >= Np_info){
|
||||
nr_tbs = Tbstable_nr[i];
|
||||
break;
|
||||
}
|
||||
if (Ninfo <=3824) {
|
||||
n = max(3, floor(log2(Ninfo)) - 6);
|
||||
Np_info = max(24, (Ninfo>>n)<<n);
|
||||
for (int i=0; i<INDEX_MAX_TBS_TABLE; i++) {
|
||||
if (Tbstable_nr[i] >= Np_info){
|
||||
nr_tbs = Tbstable_nr[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
n = log2(Ninfo-24)-5;
|
||||
Np_info = max(3840, (ROUNDIDIV((Ninfo-24),(1<<n)))<<n);
|
||||
|
||||
if (R <= 256) {
|
||||
C = CEILIDIV((Np_info+24),3816);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
} else {
|
||||
if (Np_info > 8424){
|
||||
C = CEILIDIV((Np_info+24),8424);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
} else {
|
||||
nr_tbs = ((CEILIDIV((Np_info+24),8))<<3) - 24;
|
||||
}
|
||||
}
|
||||
else {
|
||||
n = log2(Ninfo-24)-5;
|
||||
Np_info = max(3840, (ROUNDIDIV((Ninfo-24),(1<<n)))<<n);
|
||||
|
||||
if (R <= 256) {
|
||||
C = CEILIDIV((Np_info+24),3816);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
if (Np_info > 8424){
|
||||
C = CEILIDIV((Np_info+24),8424);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
nr_tbs = ((CEILIDIV((Np_info+24),8))<<3) - 24;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
//printf("Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
return nr_tbs;
|
||||
}
|
||||
//printf("Ninfo %d nbp_re %d nb_re %d Qm %d, R %d, tbs %d\n", Ninfo, nbp_re, nb_re, Qm, R, nr_tbs);
|
||||
return nr_tbs;
|
||||
}
|
||||
|
||||
|
||||
//tbslbrm calculation according to 5.4.2.1 of 38.212
|
||||
uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
uint16_t nb_rb,
|
||||
uint8_t Nl,
|
||||
uint8_t C)
|
||||
uint8_t Nl)
|
||||
{
|
||||
|
||||
uint16_t R, nb_re;
|
||||
@@ -104,14 +98,14 @@ uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
uint8_t Qm;
|
||||
int i;
|
||||
uint32_t nr_tbs=0;
|
||||
uint32_t Ninfo, Np_info;
|
||||
uint32_t Ninfo, Np_info, C;
|
||||
uint8_t n;
|
||||
|
||||
for (i=0; i<7; i++) {
|
||||
if (NPRB_LBRM[i] >= nb_rb){
|
||||
nb_rb_lbrm = NPRB_LBRM[i];
|
||||
break;
|
||||
}
|
||||
if (NPRB_LBRM[i] >= nb_rb){
|
||||
nb_rb_lbrm = NPRB_LBRM[i];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Qm = ((table == 1)? 8 : 6);
|
||||
@@ -136,10 +130,12 @@ uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
Np_info = max(3840, (ROUNDIDIV((Ninfo-24),(1<<n)))<<n);
|
||||
|
||||
if (R <= 256) {
|
||||
C = CEILIDIV((Np_info+24),3816);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
if (Np_info > 8424){
|
||||
C = CEILIDIV((Np_info+24),8424);
|
||||
nr_tbs = (C<<3)*CEILIDIV((Np_info+24),(C<<3)) - 24;
|
||||
}
|
||||
else {
|
||||
@@ -150,5 +146,4 @@ uint32_t nr_compute_tbslbrm(uint16_t table,
|
||||
|
||||
}
|
||||
return nr_tbs;
|
||||
|
||||
}
|
||||
@@ -1603,11 +1603,9 @@ uint16_t Table_51312[28][2] = {{2,120},{2,193},{2,308},{2,449},{2,602},{4,378},{
|
||||
uint16_t Table_51313[29][2] = {{2,30},{2,40},{2,50},{2,64},{2,78},{2,99},{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{4,340},
|
||||
{4,378},{4,434},{4,490},{4,553},{4,616},{6,438},{6,466},{6,517},{6,567},{6,616},{6,666}, {6,719}, {6,772}};
|
||||
|
||||
//Table 6.1.4.1-1 of 38.214 TODO fix for tp-pi2BPSK
|
||||
uint16_t Table_61411[28][2] = {{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{2,679},{4,340},{4,378},{4,434},{4,490},{4,553},{4,616},
|
||||
{4,658},{6,466},{6,517},{6,567},{6,616},{6,666},{6,719},{6,772},{6,822},{6,873}, {6,910}, {6,948}};
|
||||
|
||||
//Table 6.1.4.1-2 of 38.214 TODO fix for tp-pi2BPSK
|
||||
uint16_t Table_61412[28][2] = {{2,30},{2,40},{2,50},{2,64},{2,78},{2,99},{2,120},{2,157},{2,193},{2,251},{2,308},{2,379},{2,449},{2,526},{2,602},{2,679},
|
||||
{4,378},{4,434},{4,490},{4,553},{4,616},{4,658},{4,699},{4,772},{6,567},{6,616},{6,666}, {6,772}};
|
||||
|
||||
@@ -2471,6 +2469,40 @@ int16_t fill_dmrs_mask(NR_PDSCH_Config_t *pdsch_Config,int dmrs_TypeA_Position,i
|
||||
return(-1);
|
||||
}
|
||||
|
||||
uint8_t get_pusch_mcs_table(long *mcs_Table,
|
||||
int is_tp,
|
||||
int dci_format,
|
||||
int rnti_type,
|
||||
int target_ss,
|
||||
bool config_grant) {
|
||||
|
||||
// implementing 6.1.4.1 in 38.214
|
||||
if (mcs_Table != NULL) {
|
||||
if (config_grant || (rnti_type == NR_RNTI_CS)) {
|
||||
if (*mcs_Table == NR_PUSCH_Config__mcs_Table_qam256)
|
||||
return 1;
|
||||
else
|
||||
return (2+(is_tp<<1));
|
||||
}
|
||||
else {
|
||||
if ((*mcs_Table == NR_PUSCH_Config__mcs_Table_qam256) &&
|
||||
(dci_format == NR_UL_DCI_FORMAT_0_1) &&
|
||||
((rnti_type == NR_RNTI_C ) || (rnti_type == NR_RNTI_SP_CSI)))
|
||||
return 1;
|
||||
// TODO take into account UE configuration
|
||||
if ((*mcs_Table == NR_PUSCH_Config__mcs_Table_qam64LowSE) &&
|
||||
(target_ss == NR_SearchSpace__searchSpaceType_PR_ue_Specific) &&
|
||||
((rnti_type == NR_RNTI_C ) || (rnti_type == NR_RNTI_SP_CSI)))
|
||||
return (2+(is_tp<<1));
|
||||
if (rnti_type == NR_RNTI_MCS_C)
|
||||
return (2+(is_tp<<1));
|
||||
AssertFatal(1==0,"Invalid configuration to set MCS table");
|
||||
}
|
||||
}
|
||||
else
|
||||
return (0+(is_tp*3));
|
||||
}
|
||||
|
||||
|
||||
int binomial(int n, int k) {
|
||||
int c = 1, i;
|
||||
|
||||
@@ -60,7 +60,8 @@ typedef enum {
|
||||
NR_RNTI_INT,
|
||||
NR_RNTI_TPC_PUSCH,
|
||||
NR_RNTI_TPC_PUCCH,
|
||||
NR_RNTI_TPC_SRS
|
||||
NR_RNTI_TPC_SRS,
|
||||
NR_RNTI_MCS_C,
|
||||
} nr_rnti_type_t;
|
||||
|
||||
uint16_t config_bandwidth(int mu, int nb_rb, int nr_band);
|
||||
@@ -100,6 +101,13 @@ int get_nr_prach_info_from_index(uint8_t index,
|
||||
uint8_t *N_t_slot,
|
||||
uint8_t *N_dur);
|
||||
|
||||
uint8_t get_pusch_mcs_table(long *mcs_Table,
|
||||
int is_tp,
|
||||
int dci_format,
|
||||
int rnti_type,
|
||||
int target_ss,
|
||||
bool config_grant);
|
||||
|
||||
uint8_t compute_nr_root_seq(NR_RACH_ConfigCommon_t *rach_config,
|
||||
uint8_t nb_preambles,
|
||||
uint8_t unpaired);
|
||||
|
||||
@@ -221,6 +221,10 @@ typedef struct {
|
||||
uint32_t RA_tx_frame;
|
||||
/// Random-access variable for window calculation (subframe of last change in window counter)
|
||||
uint8_t RA_tx_subframe;
|
||||
/// Scheduled TX frame for RA Msg3
|
||||
frame_t msg3_frame;
|
||||
/// Scheduled TX slot for RA Msg3
|
||||
slot_t msg3_slot;
|
||||
/// Random-access variable for backoff (frame of last change in backoff counter)
|
||||
uint32_t RA_backoff_frame;
|
||||
/// Random-access variable for backoff (subframe of last change in backoff counter)
|
||||
@@ -243,13 +247,11 @@ typedef struct {
|
||||
uint8_t generate_nr_prach;
|
||||
|
||||
//// FAPI-like interface message
|
||||
fapi_nr_tx_request_t tx_request;
|
||||
fapi_nr_ul_config_request_t ul_config_request;
|
||||
fapi_nr_dl_config_request_t dl_config_request;
|
||||
|
||||
/// Interface module instances
|
||||
nr_ue_if_module_t *if_module;
|
||||
nr_scheduled_response_t scheduled_response;
|
||||
nr_phy_config_t phy_config;
|
||||
|
||||
/// BSR report flag management
|
||||
|
||||
@@ -88,6 +88,24 @@ NR_UE_MAC_INST_t *get_mac_inst(
|
||||
\param ul_info UL indication*/
|
||||
NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_indication_t *ul_info);
|
||||
|
||||
/**\brief fill nr_scheduled_response struct instance
|
||||
@param nr_scheduled_response_t * pointer to scheduled_response instance to fill
|
||||
@param fapi_nr_dl_config_request_t* pointer to dl_config,
|
||||
@param fapi_nr_ul_config_request_t* pointer to ul_config,
|
||||
@param fapi_nr_tx_request_t* pointer to tx_request;
|
||||
@param module_id_t mod_id module ID
|
||||
@param int cc_id CC ID
|
||||
@param frame_t frame frame number
|
||||
@param int slot reference number */
|
||||
void fill_scheduled_response(nr_scheduled_response_t *scheduled_response,
|
||||
fapi_nr_dl_config_request_t *dl_config,
|
||||
fapi_nr_ul_config_request_t *ul_config,
|
||||
fapi_nr_tx_request_t *tx_request,
|
||||
module_id_t mod_id,
|
||||
int cc_id,
|
||||
frame_t frame,
|
||||
int slot);
|
||||
|
||||
/* \brief Get SR payload (0,1) from UE MAC
|
||||
@param Mod_id Instance id of UE in machine
|
||||
@param CC_id Component Carrier index
|
||||
@@ -156,7 +174,7 @@ int8_t nr_ue_process_dlsch(module_id_t module_id, int cc_id, uint8_t gNB_index,
|
||||
|
||||
void ue_dci_configuration(NR_UE_MAC_INST_t *mac, fapi_nr_dl_config_request_t *dl_config, frame_t frame, int slot);
|
||||
|
||||
void nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
int nr_extract_dci_info(NR_UE_MAC_INST_t *mac,
|
||||
int dci_format,
|
||||
uint8_t dci_length,
|
||||
uint16_t rnti,
|
||||
@@ -197,6 +215,17 @@ and fills the PRACH PDU per each FD occasion.
|
||||
*/
|
||||
void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t slotP);
|
||||
|
||||
/* \brief This function schedules the Msg3 transmission
|
||||
@param
|
||||
@param
|
||||
@param
|
||||
@returns void
|
||||
*/
|
||||
void nr_ue_msg3_scheduler(NR_UE_MAC_INST_t *mac,
|
||||
frame_t current_frame,
|
||||
sub_frame_t current_slot,
|
||||
uint8_t Msg3_tda_id);
|
||||
|
||||
/* \brief Function called by PHY to process the received RAR and check that the preamble matches what was sent by the gNB. It provides the timing advance and t-CRNTI.
|
||||
@param Mod_id Index of UE instance
|
||||
@param CC_id Index to a component carrier
|
||||
@@ -212,6 +241,7 @@ random-access procedure
|
||||
uint16_t nr_ue_process_rar(module_id_t mod_id,
|
||||
int CC_id,
|
||||
frame_t frameP,
|
||||
sub_frame_t slotP,
|
||||
uint8_t * dlsch_buffer,
|
||||
rnti_t * t_crnti,
|
||||
uint8_t preamble_index,
|
||||
@@ -264,5 +294,16 @@ void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
|
||||
void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id);
|
||||
|
||||
void nr_ue_msg2_scheduler(module_id_t mod_id, uint16_t rach_frame, uint16_t rach_slot, uint16_t *msg2_frame, uint16_t *msg2_slot);
|
||||
|
||||
int8_t nr_ue_process_dci_freq_dom_resource_assignment(nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu,
|
||||
fapi_nr_dl_config_dlsch_pdu_rel15_t *dlsch_config_pdu,
|
||||
uint16_t n_RB_ULBWP,
|
||||
uint16_t n_RB_DLBWP,
|
||||
uint16_t riv);
|
||||
|
||||
void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
|
||||
uint8_t *nb_dmrs_re_per_rb,
|
||||
uint16_t *number_dmrs_symbols);
|
||||
|
||||
#endif
|
||||
/** @}*/
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/*! \file nr_l1_helper.c
|
||||
* \brief PHY helper functions for PRACH adapted to NR
|
||||
* \brief PHY/MAC helper functions
|
||||
* \author Guido Casati
|
||||
* \date 2019
|
||||
* \version 2.0
|
||||
@@ -151,3 +151,23 @@ int nr_get_Po_NOMINAL_PUSCH(NR_PRACH_RESOURCES_t *prach_resources, module_id_t m
|
||||
|
||||
return receivedTargerPower;
|
||||
}
|
||||
|
||||
void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
|
||||
uint8_t *nb_dmrs_re_per_rb,
|
||||
uint16_t *number_dmrs_symbols){
|
||||
|
||||
int start_symbol = pusch_pdu->start_symbol_index;
|
||||
uint8_t number_of_symbols = pusch_pdu->nr_of_symbols;
|
||||
uint16_t ul_dmrs_symb_pos = pusch_pdu->ul_dmrs_symb_pos;
|
||||
uint8_t dmrs_type = pusch_pdu->dmrs_config_type;
|
||||
uint8_t cdm_grps_no_data = pusch_pdu->num_dmrs_cdm_grps_no_data;
|
||||
|
||||
*number_dmrs_symbols = 0;
|
||||
for (int i = start_symbol; i < start_symbol + number_of_symbols; i++) {
|
||||
if((ul_dmrs_symb_pos >> i) & 0x01)
|
||||
*number_dmrs_symbols += 1;
|
||||
}
|
||||
|
||||
*nb_dmrs_re_per_rb = ((dmrs_type == pusch_dmrs_type1) ? 6:4)*cdm_grps_no_data;
|
||||
|
||||
}
|
||||
|
||||
@@ -493,9 +493,13 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
if (mac->RA_window_cnt >= 0 && mac->RA_RAPID_found == 1) {
|
||||
|
||||
// Reset RA_active flag: it disables Msg3 retransmission (8.3 of TS 38.213)
|
||||
// TbD Msg3 Retransmissions to be scheduled by DCI 0_0
|
||||
mac->RA_active = 0;
|
||||
mac->RA_window_cnt = -1;
|
||||
mac->ra_state = RA_SUCCEEDED;
|
||||
LOG_I(MAC, "[MAC][UE %d][RAPROC] Frame %d: nr_tti_tx %d: RAR successfully received \n", mod_id, frame, nr_tti_tx);
|
||||
mac->generate_nr_prach = 2;
|
||||
LOG_I(MAC, "[MAC][UE %d][RAPROC]: RAR successfully received \n", mod_id);
|
||||
|
||||
} else if (mac->RA_window_cnt == 0 && !mac->RA_RAPID_found) {
|
||||
|
||||
@@ -578,7 +582,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
|
||||
|
||||
mac->RA_window_cnt--;
|
||||
|
||||
LOG_I(MAC, "[MAC][UE %d][RAPROC] Frame %d: nr_tti_tx %d: RAR reception not successful, (RA window count %d) \n",
|
||||
LOG_D(MAC, "[MAC][UE %d][RAPROC][%d.%d]: RAR not received yet (RA window count %d) \n",
|
||||
mod_id,
|
||||
frame,
|
||||
nr_tti_tx,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user