OK" >> ./test_simulator_results.html
else
echo " | KO | " >> ./test_simulator_results.html
fi
echo " " >> ./test_simulator_results.html
- if [ $NB_ENB_GOT_SYNC -eq 1 ]
+ if [ $NB_ENB_GOT_SYNC -gt 0 ]
then
echo "- eNB --> got sync" >> ./test_simulator_results.html
else
@@ -748,6 +748,82 @@ function report_test {
echo " | Statistics | " >> ./test_simulator_results.html
echo " " >> ./test_simulator_results.html
+ #SA
+ EPC_CONFIGS=("noS1")
+ TRANS_MODES=("tdd")
+ FR_MODE=("SA")
+ BW_CASES=(106)
+ for CN_CONFIG in ${EPC_CONFIGS[@]}
+ do
+ for TMODE in ${TRANS_MODES[@]}
+ do
+ for BW in ${BW_CASES[@]}
+ do
+ echo " " >> ./test_simulator_results.html
+ if [[ $CN_CONFIG =~ .*wS1.* ]]
+ then
+ echo " | Test with EPC (aka withS1): ${TMODE} -- ${BW}PRB -- ${FR_MODE} | " >> ./test_simulator_results.html
+ else
+ echo " Test without EPC (aka noS1): ${TMODE} -- ${BW}PRB -- ${FR_MODE} | " >> ./test_simulator_results.html
+ fi
+ echo " " >> ./test_simulator_results.html
+
+
+ #SA test (--sa option)
+
+ SA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_sa_test.log
+ SA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_sa_test.log
+ if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
+ then
+ #get rid of full path
+ NAME_ENB=`echo $SA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
+ NAME_UE=`echo $SA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
+ echo " " >> ./test_simulator_results.html
+ echo " | $NAME_ENB --- $NAME_UE | " >> ./test_simulator_results.html
+ echo " Check if SA proc succeeded | " >> ./test_simulator_results.html
+
+
+ RRC_CHECK=`egrep -c "Received rrcSetupComplete" $SA_ENB_LOG`
+ CBRA_CHECK=`egrep -c "Received Ack of RA-Msg4\. CBRA procedure succeeded" $SA_ENB_LOG`
+ SIB1_CHECK=`egrep -c "SIB1 decoded" $SA_UE_LOG`
+
+
+ if [ $RRC_CHECK -gt 0 ] && [ $CBRA_CHECK -gt 0 ] && [ $SIB1_CHECK -gt 0 ]
+ then
+ echo " OK | " >> ./test_simulator_results.html
+ else
+ echo " KO | " >> ./test_simulator_results.html
+ fi
+
+ echo " " >> ./test_simulator_results.html
+ if [ $RRC_CHECK -gt 0 ]
+ then
+ echo "- Received rrcSetupComplete OK" >> ./test_simulator_results.html
+ else
+ echo "- Received rrcSetupComplete KO" >> ./test_simulator_results.html
+ fi
+ if [ $CBRA_CHECK -gt 0 ]
+ then
+ echo "- CBRA procedure succeeded OK" >> ./test_simulator_results.html
+ else
+ echo "- CBRA procedure succeeded KO" >> ./test_simulator_results.html
+ fi
+ if [ $SIB1_CHECK -gt 0 ]
+ then
+ echo "- SIB1 decoded OK" >> ./test_simulator_results.html
+ else
+ echo "- SIB1 decoded KO" >> ./test_simulator_results.html
+ fi
+
+ echo " | " >> ./test_simulator_results.html
+ echo " " >> ./test_simulator_results.html
+ fi
+
+ done
+ done
+ done
+
+
EPC_CONFIGS=("noS1")
TRANS_MODES=("tdd")
FR_MODE=("FR2")
diff --git a/ci-scripts/runTestOnVM.sh b/ci-scripts/runTestOnVM.sh
index cb751c3830..058d64b0ba 100755
--- a/ci-scripts/runTestOnVM.sh
+++ b/ci-scripts/runTestOnVM.sh
@@ -277,6 +277,46 @@ function check_ping_result {
}
+function check_sa_result {
+ local LOC_GNB_LOG=$1
+ local LOC_UE_LOG=$2
+
+ #if log files exist
+ if [ -f $LOC_GNB_LOG ] && [ -f $LOC_UE_LOG ]
+ then
+
+ #gNB SA test
+ #console check
+ echo "Checking gNB Log for SA success"
+ egrep "Received rrcSetupComplete" $1
+ egrep "Received Ack of RA-Msg4\. CBRA procedure succeeded" $1
+
+ #script check
+ local RRC_CHECK=`egrep -c "Received rrcSetupComplete" $1`
+ local CBRA_CHECK=`egrep -c "Received Ack of RA-Msg4\. CBRA procedure succeeded" $1`
+
+ #UE SA test
+ #console check
+ echo 'Checking UE Log for SA success'
+ egrep "SIB1 decoded" $2
+ #script check
+ local SIB1_CHECK=`egrep -c "SIB1 decoded" $2`
+
+ #generate status
+ if [ $RRC_CHECK -eq 0 ] || [ $CBRA_CHECK -eq 0 ] || [ $SIB1_CHECK -eq 0 ]
+ then
+ SA_STATUS=-1
+ echo "SA test FAILED, could not find the markers"
+ fi
+ #case where log files do not exist
+ else
+ echo "SA test log files not present"
+ SA_STATUS=-1
+ fi
+
+}
+
+
function check_ra_result {
local LOC_GNB_LOG=$1
local LOC_UE_LOG=$2
@@ -964,6 +1004,12 @@ function start_l2_sim_ue {
echo "ifconfig" > $1
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1
rm $1
+ else
+ echo "Setting Routes for all UEs"
+ echo "cd /home/ubuntu/tmp/cmake_targets/tools" > $1
+ echo "./setup_routes.sh $LOC_NB_UES" >> $1
+ ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_UE_VM_IP_ADDR < $1
+ rm $1
fi
}
@@ -1209,8 +1255,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
+ #LOC_RA_SA_TEST=1 will run the RA test check ; =2 will run the SA test
+ local LOC_RA_SA_TEST=$7
if [ -e rbconfig.raw ]; then rm -f rbconfig.raw; fi
if [ -e reconfig.raw ]; then rm -f reconfig.raw; fi
@@ -1233,11 +1279,14 @@ function start_rf_sim_gnb {
echo "sudo rm -f r*config.raw" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
+ if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
then
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test\" > ./my-nr-softmodem-run.sh " >> $1
- else #RA test => use --do-ra option
- echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra\" > ./my-nr-softmodem-run.sh " >> $1
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim --phy-test --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
+ then
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --do-ra --lowmem --noS1\" > ./my-nr-softmodem-run.sh " >> $1
+ else #SA test => use --sa option
+ echo "echo \"./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --rfsim --sa --lowmem \" > ./my-nr-softmodem-run.sh " >> $1
fi
fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
@@ -1273,7 +1322,7 @@ function start_rf_sim_gnb {
fi
# check noS1 config only outside RA test (as it does not support noS1)
- if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_TEST -eq 0 ]
+ if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_SA_TEST -eq 0 ]
then
echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
# Checking oaitun_enb1 interface has now an IP address
@@ -1318,8 +1367,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
+ #LOC_RA_SA_TEST=1 will run the RA test check ; =2 will run the SA test
+ local LOC_RA_SA_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
@@ -1336,11 +1385,14 @@ function start_rf_sim_nr_ue {
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
if [ $LOC_S1_CONFIGURATION -eq 0 ]
then
- if [ $LOC_RA_TEST -eq 0 ] #no RA test => use --phy-test option
+ if [ $LOC_RA_SA_TEST -eq 0 ] #no RA test => use --phy-test option
then
echo "echo \"./nr-uesoftmodem --nokrnmod 1 --rfsim --phy-test --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/ --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
- else #RA test => use --do-ra option
+ elif [ $LOC_RA_SA_TEST -eq 1 ] #RA test => use --do-ra option
+ then
echo "echo \"./nr-uesoftmodem --rfsim --do-ra --log_config.global_log_options level,nocolor --rrc_config_path /home/ubuntu/tmp/cmake_targets/ran_build/build/\" > ./my-nr-softmodem-run.sh " >> $1
+ else #SA test => use --sa option
+ echo "echo \"./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --log_config.global_log_options level,nocolor\" > ./my-nr-softmodem-run.sh " >> $1
fi
fi
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
@@ -1375,7 +1427,7 @@ function start_rf_sim_nr_ue {
echo "RF-SIM NR-UE is sync'ed w/ gNB"
fi
# Checking oaitun_ue1 interface has now an IP address (only outside RA test)
- if [ $LOC_RA_TEST -eq 0 ]
+ if [ $LOC_RA_SA_TEST -eq 0 ]
then
i="0"
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
@@ -2189,6 +2241,88 @@ function run_test_on_vm {
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
then
+ echo "############################################################"
+ echo "SA TEST"
+ echo "############################################################"
+ #SA test, attention : has a different config file from the rest of the test
+ CN_CONFIG="noS1"
+ CONF_FILE=gnb.band78.sa.fr1.106PRB.usrpb210.conf
+ S1_NOS1_CFG=0
+ PRB=106
+ FREQUENCY=3510
+
+ if [ ! -d $ARCHIVES_LOC ]
+ then
+ mkdir --parents $ARCHIVES_LOC
+ fi
+
+ local try_cnt=0
+ NR_STATUS=0
+
+ ######### start of SA TEST loop
+ while [ $try_cnt -lt 5 ] #5 because it hardly succeed within CI
+ do
+
+ SYNC_STATUS=0
+ SA_STATUS=0
+ rm -f $ARCHIVES_LOC/tdd_${PRB}prb_${CN_CONFIG}*sa_test.log
+
+ echo "############################################################"
+ echo "${CN_CONFIG} : Starting the gNB"
+ echo "############################################################"
+ CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb_sa_test.log
+ #last argument = 2 is to enable --sa for SA test
+ start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 2
+
+ echo "############################################################"
+ echo "${CN_CONFIG} : Starting the NR-UE"
+ echo "############################################################"
+ CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue_sa_test.log
+ #last argument = 2 is to enable --sa for SA 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 2
+ 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 SA markers in gNB and NR UE log files
+ echo "############################################################"
+ echo "${CN_CONFIG} : Checking SA on gNB / NR-UE"
+ echo "############################################################"
+
+ # Proper check to be done when SA test is working!
+ check_sa_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE
+ if [ $SA_STATUS -ne 0 ]
+ then
+ echo "SA test NOT OK"
+ echo "try_cnt = " $try_cnt
+ try_cnt=$((try_cnt+1))
+ else
+ try_cnt=$((try_cnt+10))
+ fi
+ done
+ ########### end SA test
+
+ sleep 30
+
+
+
echo "############################################################"
echo "RA TEST FR2"
echo "############################################################"
@@ -2493,6 +2627,7 @@ function run_test_on_vm {
echo "Checking run status"
echo "############################################################"
+ if [ $SA_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $RA_FR2_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $RA_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi
diff --git a/ci-scripts/sshconnection.py b/ci-scripts/sshconnection.py
index 4a0992436b..b4087c9695 100644
--- a/ci-scripts/sshconnection.py
+++ b/ci-scripts/sshconnection.py
@@ -35,6 +35,7 @@ import pexpect # pexpect
import logging
import time # sleep
import re
+import subprocess
import sys
#-----------------------------------------------------------
@@ -44,6 +45,9 @@ class SSHConnection():
def __init__(self):
self.ssh = ''
self.picocom_closure = False
+ self.ipaddress = ''
+ self.username = ''
+ self.cmd2Results = ''
def disablePicocomClosure(self):
self.picocom_closure = False
@@ -98,6 +102,8 @@ class SSHConnection():
pass
else:
sys.exit('SSH Connection Failed')
+ self.ipaddress = ipaddress
+ self.username = username
@@ -146,10 +152,23 @@ class SSHConnection():
logging.debug('Expected Line : ' + expectedline)
sys.exit(self.sshresponse)
+ def command2(self, commandline, timeout, silent=False):
+ if not silent:
+ logging.debug(commandline)
+ self.cmd2Results = ''
+ myHost = self.username + '@' + self.ipaddress
+ # CAUTION: THIS METHOD IMPLIES THAT THERE ARE VALID SSH KEYS
+ # BETWEEN THE PYTHON EXECUTOR NODE AND THE REMOTE HOST
+ # OTHERWISE IT WON'T WORK
+ lSsh = subprocess.Popen(["ssh", "%s" % myHost, commandline],shell=False,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
+ self.cmd2Results = str(lSsh.stdout.readlines())
+
def close(self):
self.ssh.timeout = 5
self.ssh.sendline('exit')
self.sshresponse = self.ssh.expect([pexpect.EOF, pexpect.TIMEOUT])
+ self.ipaddress = ''
+ self.username = ''
if self.sshresponse == 0:
pass
elif self.sshresponse == 1:
diff --git a/ci-scripts/xml_files/benetel_nsa_base.xml b/ci-scripts/xml_files/benetel_nsa_quectel.xml
similarity index 72%
rename from ci-scripts/xml_files/benetel_nsa_base.xml
rename to ci-scripts/xml_files/benetel_nsa_quectel.xml
index 0aed28dffa..ed93f59e81 100644
--- a/ci-scripts/xml_files/benetel_nsa_base.xml
+++ b/ci-scripts/xml_files/benetel_nsa_quectel.xml
@@ -21,49 +21,40 @@
-->
- TEST-FR1-TM1
- FR1
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL
tasks
+ 3
- 010000
030000
040000
- 010001
- 000001
+ 000002
+ 010000
050000
050001
000001
- 060000
- 060001
- 000001
070000
+ 000001
070001
+ 000001
010002
000001
080001
080000
- 010003
Initialize_UE
- Initialize UE
+ Initialize Quectel
+ idefix
-
- Terminate_UE
- Terminate UE
-
-
-
- Attach_UE
- Attach UE
-
Detach_UE
Detach UE
+ idefix
@@ -74,27 +65,35 @@
0
0
lte
-
+
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/benetel-5g.conf
+ -O ci-scripts/conf_files/benetel-5g.conf -q
1
1
nr
+ IdleSleep
+ Sleep
+ 5
+
+
+
IdleSleep
Sleep
20
+
Ping
Ping: 20pings in 20sec
+ idefix
-c 20
50
@@ -102,46 +101,32 @@
Ping
Ping: 100pings in 20sec
+ idefix
-c 100 -i 0.2
50
-
-
- Iperf
- iperf (DL/2.5Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 2.5M -t 60 -i 1
- 50
- single-ue
-
-
-
- Iperf
- iperf (UL/1.5Mbps/UDP)(60 sec)(single-ue profile)
- -u -b 1.5M -t 60 -i 1 -R
- 50
- single-ue
-
-
-
Iperf
- iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 20M -t 20 -i 1
+ iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 20M -t 60 -i 1
+ DL
+ idefix
50
single-ue
Iperf
- iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 3M -t 20 -i 1 -R
+ iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 3M -t 60 -i 1
+ UL
+ idefix
50
single-ue
-
Terminate_eNB
Terminate eNB
diff --git a/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml b/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
new file mode 100644
index 0000000000..93c0c5a00a
--- /dev/null
+++ b/ci-scripts/xml_files/benetel_nsa_quectel_longrun.xml
@@ -0,0 +1,149 @@
+
+
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL
+ tasks
+ 3
+
+ 030000
+ 040000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000001
+ 070000
+ 000001
+ 070001
+ 000001
+ 010002
+ 000001
+ 080001
+ 080000
+
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ idefix
+
+
+
+
+ Detach_UE
+ Detach UE
+ idefix
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/benetel-4g.conf
+ 0
+ 0
+ lte
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/benetel-5g.conf -q
+ 1
+ 1
+ nr
+
+
+
+ IdleSleep
+ Sleep
+ 10
+
+
+
+ IdleSleep
+ Sleep
+ 30
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ idefix
+ -c 20
+ 50
+
+
+
+ Ping
+ Ping: 100pings in 20sec
+ idefix
+ -c 100 -i 0.2
+ 50
+
+
+
+ Iperf
+ iperf (DL/20Mbps/UDP)(20 min)(single-ue profile)
+ -u -b 20M -t 1200 -i 1
+ DL
+ idefix
+ 50
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/3Mbps/UDP)(20 min)(single-ue profile)
+ -u -b 2M -t 1200 -i 1
+ UL
+ idefix
+ 50
+ single-ue
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/container_image_build.xml b/ci-scripts/xml_files/container_image_build.xml
index 430729c49c..e7eabc0794 100644
--- a/ci-scripts/xml_files/container_image_build.xml
+++ b/ci-scripts/xml_files/container_image_build.xml
@@ -35,6 +35,7 @@
all
0
0
+ True
diff --git a/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml
index 64c3517166..bfaaceaa2d 100644
--- a/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/enb_ue_usrp210_band7_build.xml
@@ -32,7 +32,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/enb_usrp210_band13_build.xml b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
index 888a1230ae..53066573c8 100644
--- a/ci-scripts/xml_files/enb_usrp210_band13_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band13_build.xml
@@ -33,7 +33,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/enb_usrp210_band40_build.xml b/ci-scripts/xml_files/enb_usrp210_band40_build.xml
index 64c3517166..bfaaceaa2d 100644
--- a/ci-scripts/xml_files/enb_usrp210_band40_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band40_build.xml
@@ -32,7 +32,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/enb_usrp210_band7_build.xml b/ci-scripts/xml_files/enb_usrp210_band7_build.xml
index 64c3517166..bfaaceaa2d 100644
--- a/ci-scripts/xml_files/enb_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/enb_usrp210_band7_build.xml
@@ -32,7 +32,7 @@
Build_eNB
Build eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel.xml b/ci-scripts/xml_files/fr1_nsa_quectel.xml
new file mode 100644
index 0000000000..7ec3a5f140
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_nsa_quectel.xml
@@ -0,0 +1,149 @@
+
+
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL
+ tasks
+ 1
+
+ 030000
+ 040000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000001
+ 070000
+ 000001
+ 070001
+ 000001
+ 010002
+ 080001
+ 080000
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ idefix
+ yes
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ idefix
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ 0
+ 0
+ lte
+ yes
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
+ 1
+ 1
+ nr
+
+
+
+ IdleSleep
+ Sleep
+ 5
+
+
+
+ IdleSleep
+ Sleep
+ 20
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ idefix
+ -c 20
+ 50
+
+
+
+ Ping
+ Ping: 100pings in 20sec
+ idefix
+ -c 100 -i 0.2
+ 50
+
+
+
+ Iperf
+ iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 20M -t 60
+ DL
+ idefix
+ 50
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 3M -t 60
+ UL
+ idefix
+ 50
+ single-ue
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/fr1_nsa_base_ref.xml b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
similarity index 76%
rename from ci-scripts/xml_files/fr1_nsa_base_ref.xml
rename to ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
index fd47db10b2..2263f731c5 100644
--- a/ci-scripts/xml_files/fr1_nsa_base_ref.xml
+++ b/ci-scripts/xml_files/fr1_nsa_quectel_attach_detach.xml
@@ -22,48 +22,60 @@
-->
TEST-NSA-FR1-TM1
- NSA FULL
+ NSA Ping Attach Detach with QUECTEL
tasks
+ 1
- 010000
030000
040000
- 010001
+ 000002
+ 010000
000001
050000
- 050001
000001
- 060000
- 060001
+ 010004
+ 000001
+ 010003
+ 000001
+ 050000
+ 000001
+ 010004
+ 000001
+ 010003
+ 000001
+ 050000
000001
- 070000
010002
- 000001
080001
080000
- 010003
Initialize_UE
- Initialize UE
+ Initialize Quectel
+ idefix
+ yes
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ idefix
- Terminate_UE
- Terminate UE
-
-
-
Attach_UE
- Attach UE
+ Attach Quectel
+ idefix
-
+
Detach_UE
- Detach UE
-
+ Detach Quectel
+ idefix
+
@@ -73,27 +85,36 @@
0
0
lte
-
+ yes
+
Initialize_eNB
Initialize gNB
- -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
1
1
nr
+ IdleSleep
+ Sleep
+ 5
+
+
+
IdleSleep
Sleep
20
+
Ping
Ping: 20pings in 20sec
+ idefix
-c 20
50
@@ -101,46 +122,32 @@
Ping
Ping: 100pings in 20sec
+ idefix
-c 100 -i 0.2
50
-
-
- Iperf
- iperf (DL/3Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 3M -t 20 -i 1
- 50
- single-ue
-
-
-
- Iperf
- iperf (UL/1Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 1M -t 20 -i 1 -R
- 50
- single-ue
-
-
-
Iperf
- iperf (DL/20Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 20M -t 20 -i 1
+ iperf (DL/20Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 20M -t 60
+ DL
+ idefix
50
single-ue
Iperf
- iperf (UL/3Mbps/UDP)(20 sec)(single-ue profile)
- -u -b 3M -t 20 -i 1 -R
+ iperf (UL/3Mbps/UDP)(60 sec)(single-ue profile)
+ -u -b 3M -t 60
+ UL
+ idefix
50
single-ue
-
Terminate_eNB
Terminate eNB
diff --git a/ci-scripts/xml_files/fr1_nsa_quectel_long.xml b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
new file mode 100644
index 0000000000..21ff7a63c5
--- /dev/null
+++ b/ci-scripts/xml_files/fr1_nsa_quectel_long.xml
@@ -0,0 +1,148 @@
+
+
+ TEST-NSA-FR1-TM1
+ NSA Ping DL UL with QUECTEL (Longer)
+ tasks
+ 1
+
+ 030000
+ 040000
+ 000002
+ 010000
+ 000001
+ 050000
+ 050001
+ 000001
+ 070000
+ 000001
+ 070001
+ 000001
+ 010002
+ 080001
+ 080000
+
+
+
+
+ Initialize_UE
+ Initialize Quectel
+ idefix
+
+
+
+
+ Terminate_UE
+ Terminate Quectel
+ idefix
+
+
+
+
+ Initialize_eNB
+ Initialize eNB
+ -O ci-scripts/conf_files/enb.band7.tm1.fr1.25PRB.usrpb210.conf
+ 0
+ 0
+ lte
+ yes
+
+
+
+
+ Initialize_eNB
+ Initialize gNB
+ -O ci-scripts/conf_files/gnb.band78.tm1.fr1.106PRB.usrpb210.conf -E -q
+ 1
+ 1
+ nr
+
+
+
+ IdleSleep
+ Sleep
+ 5
+
+
+
+ IdleSleep
+ Sleep
+ 20
+
+
+
+
+ Ping
+ Ping: 20pings in 20sec
+ idefix
+ -c 20
+ 50
+
+
+
+ Ping
+ Ping: 100pings in 20sec
+ idefix
+ -c 100 -i 0.2
+ 50
+
+
+
+ Iperf
+ iperf (DL/20Mbps/UDP)(600 sec)(single-ue profile)
+ -u -b 20M -t 600
+ DL
+ idefix
+ 50
+ single-ue
+
+
+
+ Iperf
+ iperf (UL/3Mbps/UDP)(600 sec)(single-ue profile)
+ -u -b 3M -t 600
+ UL
+ idefix
+ 50
+ single-ue
+
+
+
+
+ Terminate_eNB
+ Terminate eNB
+ 0
+ 0
+ lte
+
+
+
+ Terminate_eNB
+ Terminate gNB
+ 1
+ 1
+ nr
+
+
+
+
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
index ab221c918d..d383dbb61b 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band40_build.xml
@@ -33,7 +33,7 @@
Build_eNB
Build eNB (USRP -- Ethernet Fronthaul)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
index ab221c918d..d383dbb61b 100644
--- a/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
+++ b/ci-scripts/xml_files/if4p5_usrp210_band7_build.xml
@@ -33,7 +33,7 @@
Build_eNB
Build eNB (USRP -- Ethernet Fronthaul)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
diff --git a/ci-scripts/xml_files/multi_rru_band38_build.xml b/ci-scripts/xml_files/multi_rru_band38_build.xml
index ba45eab10a..1370a3a396 100644
--- a/ci-scripts/xml_files/multi_rru_band38_build.xml
+++ b/ci-scripts/xml_files/multi_rru_band38_build.xml
@@ -26,7 +26,7 @@
wrench
010101 010102 010103
- 000101 000102 000103
+ 000102 000103 000101
@@ -50,7 +50,7 @@
Build_eNB
Build Master RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
1
1
True
@@ -59,7 +59,7 @@
WaitEndBuild_eNB
Wait for end of Build Master RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
1
1
@@ -67,7 +67,7 @@
Build_eNB
Build Slave RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
2
2
True
@@ -76,7 +76,7 @@
WaitEndBuild_eNB
Wait for end of Build Slave RRU
- -w USRP -c --eNB --ninja
+ -w USRP -c --RU --ninja
2
2
diff --git a/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml b/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml
index c5a912a33d..0ac6bfcc0d 100644
--- a/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml
+++ b/ci-scripts/xml_files/x2ho_enb_usrp210_band13_build.xml
@@ -42,7 +42,7 @@
Build_eNB
Build Slave eNB (USRP)
- -w USRP -c --eNB
+ -w USRP -c --eNB --ninja
1
1
diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt
index 69f3d6c271..41a086c37e 100644
--- a/cmake_targets/CMakeLists.txt
+++ b/cmake_targets/CMakeLists.txt
@@ -62,6 +62,8 @@ elseif (${RF_BOARD} STREQUAL "OAI_IRIS")
endif (${RF_BOARD} STREQUAL "OAI_USRP")
+message("RU=${RU}")
+
pkg_search_module(OPENPGM openpgm-5.1 openpgm-5.2)
if(NOT ${OPENPGM_FOUND})
message("PACKAGE openpgm-5.1 is required by binaries such as oaisim: will fail later if this target is built")
@@ -318,7 +320,7 @@ if (CUDA_FOUND)
set(CUDA_CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -Wno-packed-bitfield-compat -fPIC -Wall -fno-strict-aliasing -rdynamic -std=c++11 -D CUDA_FLAG"
)
-
+
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER} -D CUDA_FLAG"
)
@@ -335,10 +337,6 @@ else (CUDA_FOUND)
)
endif ()
-if(NR)
- add_definitions(-DNR=1)
-endif()
-
if (SANITIZE_ADDRESS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -fno-common")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-common")
@@ -351,7 +349,7 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath -Wl,${CMAKE_CU
#########################
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
-set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -O0 -DMALLOC_CHECK_=3")
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g3 -Og -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g3 -DMALLOC_CHECK_=3 -O2 -fno-delete-null-pointer-checks")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O3")
@@ -416,7 +414,6 @@ add_boolean_option(UE_AUTOTEST_TRACE False "Activate UE autotest specific logs
add_boolean_option(UE_DEBUG_TRACE False "Activate UE debug trace")
add_boolean_option(UE_TIMING_TRACE False "Activate UE timing trace")
add_boolean_option(DEBUG_CONSOLE False "makes debugging easier, disables stdout/stderr buffering")
-add_boolean_option(NEW_GTPU True "NEW_GTP")
set (OCP_ITTI ${OPENAIR_DIR}/common/utils/ocp_itti)
add_library(ITTI
@@ -441,7 +438,6 @@ set(asn1_generated_dir ${OPENAIR_BIN_DIR})
set(protoc_call "${OPENAIR_CMAKE}/tools/generate_protobuf")
set(protobuf_generated_dir ${OPENAIR_BIN_DIR})
-
# RRC
######
set (RRC_ASN1_VERSION "Rel15")
@@ -452,15 +448,18 @@ add_definitions(-DLTE_RRC_VERSION=${LTE_RRC_VERSION})
set (RRC_FULL_DIR ${asn1_generated_dir}/RRC_${RRC_ASN1_VERSION})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_"
- RESULT_VARIABLE ret)
+if (${RU} STREQUAL 0)
+ execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "LTE_" " " "${RRC_FULL_DIR}" "${RRC_GRAMMAR}"
+ RESULT_VARIABLE ret)
+endif (${RU} STREQUAL 0)
+
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
file(GLOB rrc_source ${RRC_FULL_DIR}/*.c)
add_custom_target (
rrc_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${RRC_FULL_DIR}" "${RRC_GRAMMAR}" "LTE_"
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "LTE_" " " "${RRC_FULL_DIR}" "${RRC_GRAMMAR}"
DEPENDS ${RRC_GRAMMAR}
)
@@ -481,20 +480,22 @@ add_definitions(-DNR_RRC_VERSION=${NR_RRC_VERSION})
set (NR_RRC_FULL_DIR ${asn1_generated_dir}/RRC_${NR_RRC_ASN1_VERSION})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice"
- RESULT_VARIABLE ret)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NR_" "-findirect-choice" "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}"
+ RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif ()
file(GLOB nr_rrc_source ${NR_RRC_FULL_DIR}/*.c)
file(GLOB nr_rrc_h ${NR_RRC_FULL_DIR}/*.h)
+
add_custom_target (
nr_rrc_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}" "NR_" "-findirect-choice"
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NR_" "-findirect-choice" "${NR_RRC_FULL_DIR}" "${NR_RRC_GRAMMAR}"
DEPENDS ${NR_RRC_GRAMMAR}
)
-add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
+add_library(NR_RRC_LIB ${nr_rrc_h} ${nr_rrc_source}
${OPENAIR2_DIR}/RRC/NR/MESSAGES/asn1_msg.c
)
add_dependencies(NR_RRC_LIB nr_rrc_flag)
@@ -515,18 +516,21 @@ set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
-file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+ file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
+endif (${RU} STREQUAL 0)
-add_custom_target (
- s1ap_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "S1AP_" -fno-include-deps
- DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
-)
+ add_custom_target (
+ s1ap_flag ALL
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}" "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ DEPENDS "${S1AP_ASN_DIR}/${S1AP_ASN_FILES}"
+ )
add_library(S1AP_LIB
${S1AP_source}
@@ -569,8 +573,9 @@ set(NGAP_ASN_DIR ${NGAP_DIR}/MESSAGES/ASN1/ASN1_files)
set(NGAP_C_DIR ${asn1_generated_dir}/NGAP_${NGAP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps -findirect-choice
- RESULT_VARIABLE ret)
+execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NGAP_" "-fno-include-deps -findirect-choice" "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
+ RESULT_VARIABLE ret)
if (NOT ${ret} STREQUAL 0)
message(FATAL_ERROR "${ret}: error")
endif (NOT ${ret} STREQUAL 0)
@@ -578,8 +583,8 @@ file(GLOB NGAP_source ${NGAP_C_DIR}/*.c)
add_custom_target (
ngap_flag ALL
- ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}" "NGAP_" -fno-include-deps
- DEPENDS "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
+ ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "NGAP_" "-fno-include-deps -findirect-choice" "${NGAP_C_DIR}" "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
+ DEPENDS "${NGAP_ASN_DIR}/${NGAP_ASN_FILES}"
)
add_library(NGAP_LIB
@@ -635,17 +640,20 @@ set(M2AP_ASN_DIR ${M2AP_DIR}/MESSAGES/ASN1/${M2AP_RELEASE})
set(M2AP_C_DIR ${asn1_generated_dir}/M2AP_${M2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps -DEMIT_ASN_DEBUG=1
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+endif (${RU} STREQUAL 0)
file(GLOB M2AP_source ${M2AP_C_DIR}/*.c)
add_custom_target (
m2_flag ALL
- COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}" "M2AP_" -fno-include-deps
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M2AP_" "-fno-include-deps -DEMIT_ASN_DEBUG=1" "${M2AP_C_DIR}" "${M2AP_ASN_DIR}/${M2AP_ASN_FILES}"
DEPENDS ${M2AP_ASN_DIR}/${M2AP_ASN_FILES}
)
@@ -705,17 +713,20 @@ set(M3AP_ASN_DIR ${M3AP_DIR}/MESSAGES/ASN1/${M3AP_RELEASE})
set(M3AP_C_DIR ${asn1_generated_dir}/M3AP_${M3AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+endif (${RU} STREQUAL 0)
file(GLOB M3AP_source ${M3AP_C_DIR}/*.c)
add_custom_target (
m3_flag ALL
- COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}" "M3AP_" -fno-include-deps
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "M3AP_" -fno-include-deps "${M3AP_C_DIR}" "${M3AP_ASN_DIR}/${M3AP_ASN_FILES}"
DEPENDS ${M3AP_ASN_DIR}/${M3AP_ASN_FILES}
)
@@ -759,17 +770,20 @@ add_definitions(-DX2AP_VERSION=${X2AP_VERSION})
set(X2AP_ASN_DIR ${X2AP_DIR}/MESSAGES/ASN1/${X2AP_RELEASE})
set(X2AP_C_DIR ${asn1_generated_dir}/X2AP_${X2AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
-execute_process(COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps
- RESULT_VARIABLE ret)
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "${ret}: error")
-endif (NOT ${ret} STREQUAL 0)
+if (${RU} STREQUAL 0)
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "X2AP_" -fno-include-deps "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}"
+ RESULT_VARIABLE ret)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "${ret}: error")
+ endif (NOT ${ret} STREQUAL 0)
+endif (${RU} STREQUAL 0)
file(GLOB X2AP_source ${X2AP_C_DIR}/*.c)
add_custom_target (
x2_flag ALL
- COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}" "X2AP_" -fno-include-deps
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "X2AP_" -fno-include-deps "${X2AP_C_DIR}" "${X2AP_ASN_DIR}/${X2AP_ASN_FILES}"
DEPENDS ${X2AP_ASN_DIR}/${X2AP_ASN_FILES}
)
@@ -816,22 +830,28 @@ set(F1AP_ASN_FILES
${F1AP_ASN_DIR}/F1AP-Containers.asn
)
-set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
-message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
-execute_process(COMMAND mkdir -p ${F1AP_ASN_GENERATED_C_DIR}
- COMMAND env "ASN1C_PREFIX=F1AP_" asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
- RESULT_VARIABLE ret
- OUTPUT_QUIET
- ERROR_QUIET)
+if (${RU} STREQUAL 0)
+ set(F1AP_ASN_GENERATED_C_DIR ${asn1_generated_dir}/F1AP_${ASN1RELDIR})
+ message("calling ASN1C_PREFIX=F1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -findirect-choice -fno-include-deps -D ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}")
+ execute_process(
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
+ RESULT_VARIABLE ret
+ )
-if (NOT ${ret} STREQUAL 0)
- message(FATAL_ERROR "asn1c: error")
-endif (NOT ${ret} STREQUAL 0)
+ if (NOT ${ret} STREQUAL 0)
+ message(FATAL_ERROR "asn1c: error")
+ endif (NOT ${ret} STREQUAL 0)
-file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
-add_library(F1AP_LIB
- ${F1AP_ASN_GENERATED_C_FILES}
-)
+ add_custom_target (
+ f1_flag ALL
+ COMMAND ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "F1AP_" "-findirect-choice -fno-include-deps" ${F1AP_ASN_GENERATED_C_DIR} ${F1AP_ASN_FILES}
+ DEPENDS ${F1AP_ASN_FILES}
+ )
+ file(GLOB F1AP_ASN_GENERATED_C_FILES ${F1AP_ASN_GENERATED_C_DIR}/*.c)
+ add_library(F1AP_LIB
+ ${F1AP_ASN_GENERATED_C_FILES}
+ )
+ add_dependencies (F1AP_LIB f1_flag)
include_directories ("${F1AP_ASN_GENERATED_C_DIR}")
include_directories ("${F1AP_DIR}")
@@ -841,6 +861,7 @@ add_library(F1AP
${F1AP_C_FILES}
)
+endif (${RU} STREQUAL 0)
# Hardware dependant options
###################################
@@ -849,8 +870,6 @@ add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2"
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "OAI_USRP" "OAI_BLADERF" "OAI_LMSSDR" "OAI_SIMU")
-
-
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
set (CONFIG_ROOTDIR
@@ -1003,6 +1022,7 @@ add_boolean_option(PRE_SCD_THREAD False "enable UE_EXPANSION w
add_boolean_option(UESIM_EXPANSION False "enable UESIM_EXPANSION with max 256 UE")
add_boolean_option(ITTI_SIM False "enable itti simulator")
add_boolean_option(RFSIM_NAS False "enable rfsim nas")
+
########################
# Include order
##########################
@@ -1483,7 +1503,7 @@ add_dependencies(SCHED_UE_LIB rrc_flag)
set(SCHED_SRC_NR_UE
${OPENAIR1_DIR}/SCHED_NR_UE/phy_procedures_nr_ue.c
${OPENAIR1_DIR}/SCHED_NR/phy_procedures_nr_common.c
- ${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
+ ${OPENAIR1_DIR}/SCHED_NR_UE/fapi_nr_ue_l1.c
${OPENAIR1_DIR}/SCHED_NR_UE/phy_frame_config_nr_ue.c
${OPENAIR1_DIR}/SCHED_NR_UE/harq_nr.c
${OPENAIR1_DIR}/SCHED_NR_UE/pucch_uci_ue_nr.c
@@ -1646,7 +1666,6 @@ set(PHY_SRC_COMMON
${OPENAIR1_DIR}/PHY/CODING/viterbi_lte.c
${OPENAIR1_DIR}/PHY/INIT/init_top.c
${OPENAIR1_DIR}/PHY/INIT/lte_parms.c
- ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${OPENAIR1_DIR}/PHY/TOOLS/cadd_vv.c
${OPENAIR1_DIR}/PHY/TOOLS/dfts_load.c
${OPENAIR1_DIR}/PHY/TOOLS/log2_approx.c
@@ -1797,7 +1816,7 @@ set(PHY_SRC_UE
${PHY_POLARSRC}
${PHY_SMALLBLOCKSRC}
${PHY_NR_CODINGIF}
- ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c
+ ${OPENAIR1_DIR}/PHY/NR_TRANSPORT/pucch_rx.c
${OPENAIR1_DIR}/PHY/NR_TRANSPORT/nr_uci_tools_common.c
)
set(PHY_NR_UE_SRC
@@ -1976,7 +1995,7 @@ set(NR_RLC_SRC
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_sdu.c
${OPENAIR2_DIR}/LAYER2/nr_rlc/nr_rlc_ue_manager.c
)
-
+
set(NR_PDCP_SRC
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_oai_api.c
${OPENAIR2_DIR}/LAYER2/nr_pdcp/nr_pdcp_ue_manager.c
@@ -2009,7 +2028,7 @@ set(L2_SRC
${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c
)
-
+
set(L2_RRC_SRC
${OPENAIR2_DIR}/LAYER2/openair2_proc.c
# ${RRC_DIR}/rrc_UE.c
@@ -2055,14 +2074,14 @@ set(L2_SRC_UE
${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c
)
-
+
set(L2_RRC_SRC_UE
${RRC_DIR}/rrc_UE.c
${RRC_DIR}/rrc_common.c
${RRC_DIR}/L2_interface_common.c
${RRC_DIR}/L2_interface_ue.c
- )
-
+ )
+
set(NR_L2_SRC_UE
${NR_RLC_SRC}
${NR_PDCP_SRC}
@@ -2120,7 +2139,7 @@ set (MAC_SRC_UE
${MAC_DIR}/rar_tools_ue.c
${MAC_DIR}/config_ue.c
)
-
+
set (MAC_NR_SRC_UE
${NR_UE_PHY_INTERFACE_DIR}/NR_IF_Module.c
${NR_UE_MAC_DIR}/config_ue.c
@@ -2192,6 +2211,7 @@ add_library(L2_NR
${MAC_NR_SRC}
${GNB_APP_SRC}
)
+target_compile_definitions(L2_NR PUBLIC NEW_GTPU)
add_library(L2_LTE_NR
${L2_RRC_SRC}
@@ -2199,7 +2219,8 @@ add_library(L2_LTE_NR
${ENB_APP_SRC}
${MCE_APP_SRC}
)
-
+target_compile_definitions(L2_LTE_NR PUBLIC NEW_GTPU)
+
add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag x2_flag)
add_library(L2_UE
@@ -2246,6 +2267,7 @@ add_library (GTPV1U_OCP
${RRC_DIR}/rrc_eNB_GTPV1U.c
${OPENAIR3_DIR}/ocp-gtpu/gtp_itf.cpp
)
+target_compile_definitions(GTPV1U_OCP PUBLIC NEW_GTPU)
add_dependencies(GTPV1U_OCP rrc_flag)
include_directories(${OPENAIR3_DIR}/ocp-gtp)
@@ -2264,12 +2286,6 @@ set (NR_GTPV1U_SRC
add_library(NR_GTPV1U ${NR_GTPV1U_SRC})
add_dependencies(NR_GTPV1U rrc_flag)
-if (${NEW_GTPU})
-set(GTPV1U GTPV1U_OCP)
-else()
-set(GTPV1U NR_GTPV1U)
-endif()
-
set (MME_APP_SRC
${OPENAIR3_DIR}/MME_APP/mme_app.c
${OPENAIR3_DIR}/MME_APP/mme_config.c
@@ -2548,7 +2564,7 @@ if(NAS_UE)
endif()
-#if(ITTI_SIM OR RFSIM_NAS)
+if(ITTI_SIM OR RFSIM_NAS)
set(libnas_ue_api_OBJS
${NAS_SRC}UE/API/USER/at_command.c
${NAS_SRC}UE/API/USER/at_error.c
@@ -2674,7 +2690,7 @@ endif()
include_directories(${NAS_SRC}UE/EMM/SAP)
include_directories(${NAS_SRC}UE/ESM)
include_directories(${NAS_SRC}UE/ESM/SAP)
-#endif()
+endif()
# nbiot
add_definitions("-DNUMBER_OF_UE_MAX_NB_IoT=16")
@@ -2741,7 +2757,7 @@ add_library(SIMU_COMMON
# Simulation library
##########################
-set (SIMUSRC
+set (SIMUSRC
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_channel.c
${OPENAIR1_DIR}/SIMULATION/TOOLS/multipath_tv_channel.c
@@ -2804,7 +2820,7 @@ add_library(nrscope MODULE ${XFORMS_SOURCE_NR})
target_link_libraries(nrscope ${XFORMS_LIBRARIES})
-add_library(rfsimulator MODULE
+add_library(rfsimulator MODULE
${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c
${OPENAIR_TARGETS}/ARCH/rfsimulator/apply_channelmod.c
${OPENAIR_TARGETS}/ARCH/rfsimulator/new_channel_sim.c
@@ -2812,7 +2828,7 @@ add_library(rfsimulator MODULE
)
target_link_libraries(rfsimulator SIMU_COMMON ${ATLAS_LIBRARIES})
-add_library(oai_iqplayer MODULE
+add_library(oai_iqplayer MODULE
${OPENAIR_TARGETS}/ARCH/iqplayer/iqplayer_lib.c
)
set(CMAKE_MODULE_PATH "${OPENAIR_DIR}/cmake_targets/tools/MODULES" "${CMAKE_MODULE_PATH}")
@@ -2882,7 +2898,7 @@ add_executable(measurement_display
${OPENAIR_DIR}/common/utils/threadPool/measurement_display.c)
target_link_libraries (measurement_display minimal_lib)
-add_executable(test5Gnas
+add_executable(test5Gnas
${OPENAIR_DIR}/openair3/TEST/test5Gnas.c
)
target_link_libraries (test5Gnas LIB_5GNAS_GNB CONFIG_LIB minimal_lib )
@@ -2907,12 +2923,15 @@ add_executable(lte-softmodem
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
+ ${OPENAIR2_DIR}/F1AP/dummy_enb.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${OPENAIR_DIR}/common/utils/lte/ue_power.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -2923,11 +2942,11 @@ add_dependencies(lte-softmodem rrc_flag s1ap_flag x2_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB ${GTPV1U} SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB LFDS7
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
-
+
target_link_libraries (lte-softmodem ${LIBXML2_LIBRARIES})
target_link_libraries (lte-softmodem pthread m ${CONFIG_LIB} rt crypt ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} sctp ${PROTOBUF_LIB} ${CMAKE_DL_LIBS} ${LIBYAML_LIBRARIES})
target_link_libraries (lte-softmodem ${LIB_LMS_LIBRARIES})
@@ -2954,6 +2973,8 @@ add_executable(ocp-enb
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${OPENAIR_DIR}/common/utils/lte/ue_power.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -2964,7 +2985,7 @@ add_dependencies(ocp-enb rrc_flag s1ap_flag x2_flag oai_iqplayer coding params_l
target_link_libraries (ocp-enb
-Wl,--start-group
- RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB ${GTPV1U} SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
+ RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB NR_GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU LFDS L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB LFDS7 SIMU_COMMON
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} ${FSPT_MSG_LIB} ${PROTO_AGENT_LIB}
-Wl,--end-group z dl)
@@ -2998,6 +3019,33 @@ target_link_libraries(du_test
${PROTO_AGENT_LIB} pthread UTIL ${T_LIB} dl ${ITTI_LIB}
)
+add_executable(oairu
+ ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
+ ${OPENAIR_TARGETS}/RT/USER/ru_control.c
+ ${OPENAIR_TARGETS}/RT/USER/rt_wrapper.c
+ ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
+ ${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
+ ${OPENAIR_DIR}/executables/softmodem-common.c
+ ${OPENAIR_DIR}/openair1/SCHED/phy_procedures_lte_common.c
+ ${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
+ ${OPENAIR_DIR}/executables/main_ru.c
+ ${T_SOURCE}
+ ${OPENAIR_DIR}/common/utils/LOG/log.c
+ ${CONFIG_SOURCES}
+ ${OPENAIR_DIR}/common/utils/utils.c
+ ${OPENAIR_DIR}/common/utils/system.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
+ ${SHLIB_LOADER_SOURCES}
+)
+target_link_libraries (oairu
+ -Wl,--start-group
+ SCHED_RU_LIB
+ PHY_COMMON PHY_RU
+ -Wl,--end-group z dl)
+
+target_link_libraries (oairu pthread m ${CONFIG_LIB} rt ${CMAKE_DL_LIBS} ${T_LIB})
+
+
# lte-uesoftmodem is UE implementation
#######################################
@@ -3006,9 +3054,6 @@ add_executable(lte-uesoftmodem
${OPENAIR_TARGETS}/RT/USER/lte-ue.c
${OPENAIR_TARGETS}/RT/USER/lte-uesoftmodem.c
${OPENAIR_DIR}/executables/softmodem-common.c
- ${OPENAIR_TARGETS}/RT/USER/lte-ru.c
- ${OPENAIR_TARGETS}/RT/USER/ru_control.c
- ${OPENAIR_TARGETS}/RT/USER/rfsim.c
${OPENAIR_TARGETS}/COMMON/create_tasks_ue.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR_TARGETS}/ARCH/COMMON/record_player.c
@@ -3020,6 +3065,8 @@ add_executable(lte-uesoftmodem
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${OPENAIR_DIR}/common/utils/lte/ue_power.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -3035,7 +3082,7 @@ target_link_libraries (lte-uesoftmodem
-Wl,--start-group
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
+ NR_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 MISC_NFAPI_LTE_LIB
${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${ATLAS_LIBRARIES}
-Wl,--end-group z dl)
@@ -3066,6 +3113,8 @@ add_executable(nr-softmodem
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
+ ${OPENAIR_DIR}/common/utils/lte/ue_power.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
@@ -3074,10 +3123,11 @@ add_executable(nr-softmodem
${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c
)
+target_compile_definitions(nr-softmodem PUBLIC NEW_GTPU)
target_link_libraries (nr-softmodem
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS ${GTPV1U} SECU_CN SECU_OSA
- ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
+ ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
-Wl,--end-group z dl)
@@ -3115,8 +3165,8 @@ add_executable(ocp-gnb
target_link_libraries (ocp-gnb
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS ${GTPV1U} SECU_CN SECU_OSA
- ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
+ ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB SIMU_COMMON
-Wl,--end-group z dl)
@@ -3162,7 +3212,9 @@ target_link_libraries (nr-uesoftmodem
RRC_LIB NR_RRC_LIB NGAP_LIB NGAP_GNB SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT UDP SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB
PHY_COMMON PHY_NR_COMMON PHY_UE PHY_NR_UE PHY_RU LFDS NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB
NFAPI_USER_LIB MISC_NFAPI_NR_LIB S1AP_LIB S1AP_ENB
- ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES}
+ NFAPI_USER_LIB S1AP_LIB S1AP_ENB
+ ${MSC_LIB} ${RAL_LIB} ${NAS_UE_LIB} ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} LFDS7 ${ATLAS_LIBRARIES} LIB_5GNAS_GNB LIB_NAS_SIMUE ${NAS_SIM_LIB}
-Wl,--end-group z dl)
target_link_libraries (nr-uesoftmodem ${LIBXML2_LIBRARIES})
@@ -3192,7 +3244,7 @@ target_link_libraries (dlsim_tm4
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${T_LIB}
)
-add_executable(rftest
+add_executable(rftest
${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_test.c
${OPENAIR_DIR}/openair1/PHY/TOOLS/calibration_scope.c
${OPENAIR_DIR}/common/utils/system.c
@@ -3203,7 +3255,7 @@ add_executable(rftest
)
target_link_libraries(rftest minimal_lib PHY_NR_COMMON pthread dl m forms ${T_LIB} )
-add_executable(polartest
+add_executable(polartest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/polartest.c
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
@@ -3216,7 +3268,7 @@ target_link_libraries(polartest
m pthread ${ATLAS_LIBRARIES} dl
)
-add_executable(smallblocktest
+add_executable(smallblocktest
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/smallblocktest.c
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
@@ -3234,17 +3286,17 @@ target_link_libraries(smallblocktest
# temp_C_flag = CMAKE_C_FLAGS
#set(CMAKE_C_FLAGS " ")
-set (TEMP_C_FLAG ${CMAKE_C_FLAGS})
+set (TEMP_C_FLAG ${CMAKE_C_FLAGS})
set (CMAKE_C_FLAGS ${CUDA_CMAKE_C_FLAGS})
-set (TEMP_CXX_FLAG ${CMAKE_CXX_FLAGS})
+set (TEMP_CXX_FLAG ${CMAKE_CXX_FLAGS})
set (CMAKE_CXX_FLAGS ${CUDA_CMAKE_CXX_FLAGS})
if (CUDA_FOUND)
###################################################
-# For CUDA library
+# For CUDA library
###################################################
-
- CUDA_ADD_LIBRARY(LDPC_CU
+
+ CUDA_ADD_LIBRARY(LDPC_CU
${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.cu
)
CUDA_ADD_CUFFT_TO_TARGET(LDPC_CU)
@@ -3254,14 +3306,14 @@ if (CUDA_FOUND)
${SHLIB_LOADER_SOURCES}
)
target_link_libraries(ldpctest -ldl
- -Wl,--start-group
- LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
+ -Wl,--start-group
+ LDPC_CU UTIL SIMU PHY_NR CONFIG_LIB
-Wl,--end-group
m pthread ${ATLAS_LIBRARIES} dl
)
else (CUDA_FOUND)
- add_executable(ldpctest
+ add_executable(ldpctest
${PHY_NR_CODINGIF}
${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
${T_SOURCE}
@@ -3273,21 +3325,21 @@ set (CMAKE_C_FLAGS ${TEMP_C_FLAG})
set (CMAKE_CXX_FLAGS ${TEMP_CXX_FLAG})
-# add_executable(ldpctest
+# add_executable(ldpctest
# ${PHY_NR_CODINGIF}
# ${OPENAIR1_DIR}/PHY/CODING/TESTBENCH/ldpctest.c
# ${T_SOURCE}
# ${SHLIB_LOADER_SOURCES}
# )
-add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
+add_dependencies( ldpctest ldpc_orig ldpc_optim ldpc_optim8seg ldpc )
target_link_libraries(ldpctest
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_NR PHY_COMMON PHY_NR_COMMON CONFIG_LIB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} dl
)
-add_executable(nr_dlschsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
+add_executable(nr_dlschsim
+ ${OPENAIR1_DIR}/SIMULATION/NR_PHY/dlschsim.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/utils.c
@@ -3296,13 +3348,13 @@ add_executable(nr_dlschsim
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
-target_link_libraries(nr_dlschsim
+target_link_libraries(nr_dlschsim
-Wl,--start-group UTIL SIMU_COMMON SIMU PHY_COMMON PHY_NR_COMMON PHY_NR PHY_NR_UE SCHED_NR_LIB CONFIG_LIB MAC_NR_COMMON -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} dl
)
-add_executable(nr_pbchsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c
+add_executable(nr_pbchsim
+ ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pbchsim.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/utils.c
@@ -3317,8 +3369,8 @@ target_link_libraries(nr_pbchsim
)
#PUCCH ---> Prashanth
-add_executable(nr_pucchsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
+add_executable(nr_pucchsim
+ ${OPENAIR1_DIR}/SIMULATION/NR_PHY/pucchsim.c
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/system.c
@@ -3346,7 +3398,7 @@ add_executable(nr_dlsim
${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_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl
@@ -3354,7 +3406,7 @@ target_link_libraries(nr_dlsim
target_compile_definitions(nr_dlsim PUBLIC -DPHYSICAL_SIMULATOR)
add_executable(nr_prachsim
- ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c
+ ${OPENAIR1_DIR}/SIMULATION/NR_PHY/prachsim.c
${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
@@ -3366,7 +3418,7 @@ add_executable(nr_prachsim
${UTIL_SRC}
${T_SOURCE}
${SHLIB_LOADER_SOURCES})
-target_link_libraries(nr_prachsim
+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 SCHED_NR_UE_LIB MAC_NR MAC_UE_NR MAC_NR_COMMON RRC_LIB NR_RRC_LIB CONFIG_LIB L2_LTE_NR L2_NR HASHTABLE X2AP_ENB X2AP_LIB SECU_CN NGAP_GNB -Wl,--end-group
m pthread ${ATLAS_LIBRARIES} ${T_LIB} ${ITTI_LIB} ${OPENSSL_LIBRARIES} dl)
@@ -3406,13 +3458,16 @@ target_link_libraries(nr_ulsim
target_compile_definitions(nr_ulsim PUBLIC -DPHYSICAL_SIMULATOR)
foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim syncsim)
-
+
add_executable(${myExe}
${OPENAIR1_DIR}/SIMULATION/LTE_PHY/${myExe}.c
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
${OPENAIR_DIR}/common/utils/backtrace.c
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/utils.c
+ ${OPENAIR_DIR}/common/utils/lte/ue_power.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
+ ${OPENAIR1_DIR}/PHY/INIT/lte_param_init.c
${XFORMS_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
@@ -3423,7 +3478,7 @@ foreach(myExe dlsim dlsim_tm7 ulsim pbchsim scansim mbmssim pdcchsim pucchsim pr
-Wl,--start-group SIMU_COMMON SIMU UTIL SCHED_LIB SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON PHY_NR_COMMON PHY PHY_UE PHY_RU LFDS ${ITTI_LIB} LFDS7 -Wl,--end-group
pthread m rt ${CONFIG_LIB} ${ATLAS_LIBRARIES} ${XFORMS_LIBRARIES} ${T_LIB} dl
)
-
+
endforeach(myExe)
add_executable(test_epc_generate_scenario
@@ -3435,7 +3490,7 @@ add_executable(test_epc_generate_scenario
${OPENAIR3_DIR}/S1AP/s1ap_eNB_defs.h
)
target_link_libraries (test_epc_generate_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP ${GTPV1U} LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY LFDS ${ITTI_LIB} ${MSC_LIB} L2 -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
add_executable(test_epc_play_scenario
@@ -3454,7 +3509,7 @@ add_executable(test_epc_play_scenario
)
target_include_directories(test_epc_play_scenario PUBLIC /usr/local/share/asn1c)
target_link_libraries (test_epc_play_scenario
- -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP ${GTPV1U} LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
+ -Wl,--start-group RRC_LIB S1AP_LIB X2AP_LIB X2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP NR_GTPV1U LIB_NAS_UE SECU_CN UTIL HASHTABLE SCTP_CLIENT MME_APP UDP SCHED_LIB PHY_NR_COMMON PHY_COMMON PHY PHY_UE LFDS ${ITTI_LIB} ${MSC_LIB} -Wl,--end-group pthread m rt crypt sctp ${LIBXML2_LIBRARIES} ${LIBXSLT_LIBRARIES} ${CRYPTO_LIBRARIES} ${OPENSSL_LIBRARIES} ${CONFIG_LIB}
)
@@ -3486,13 +3541,13 @@ endforeach(myExe)
if (${T_TRACER})
foreach(i
#all "add_executable" definitions (except tests, rb_tool, updatefw)
- lte-softmodem lte-uesoftmodem nr-softmodem
+ lte-softmodem lte-uesoftmodem nr-softmodem
nr-uesoftmodem dlsim dlsim_tm4 dlsim_tm7 nr-ittisim
ulsim pbchsim scansim mbmssim pdcchsim pucchsim prachsim
syncsim nr_ulsim nr_dlsim nr_dlschsim nr_pbchsim nr_pucchsim
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions
- ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
+ ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB X2AP_LIB X2AP_ENB M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB F1AP_LIB F1AP
params_libconfig oai_exmimodevif oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass tcp_bridge tcp_bridge_oai
coding FLPT_MSG ASYNC_IF FLEXRAN_AGENT HASHTABLE MSC UTIL OMG_SUMO
@@ -3500,7 +3555,7 @@ if (${T_TRACER})
NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_VNF_LIB NFAPI_USER_LIB
PHY_COMMON PHY PHY_UE PHY_NR PHY_NR_COMMON PHY_NR_UE PHY_RU PHY_MEX
L2 L2_LTE L2_NR L2_LTE_NR L2_UE NR_L2_UE L2_UE_LTE_NR MAC_NR_COMMON MAC_NR MAC_UE_NR NGAP_GNB
- CN_UTILS ${GTPV1U} SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
+ CN_UTILS NR_GTPV1U GTPV1U_OCP SCTP_CLIENT MME_APP UDP LIB_NAS_UE NB_IoT LFDS LFDS7 SIMU_COMMON SIMU SIMU_ETH OPENAIR0_LIB
ldpc_orig ldpc_optim ldpc_optim8seg ldpc PROTO_AGENT dfts)
if (TARGET ${i})
add_dependencies(${i} generate_T)
@@ -3597,16 +3652,20 @@ add_executable(nr-ittisim
${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/threadPool/thread-pool.c
+ ${OPENAIR_DIR}/common/utils/lte/ue_power.c
+ ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
+ ${OPENAIR2_DIR}/ENB_APP/flexran_agent_ran_api_to_fix.c
${XFORMSINTERFACE_SOURCE}
${T_SOURCE}
${CONFIG_SOURCES}
${SHLIB_LOADER_SOURCES}
)
+target_compile_definitions(nr-ittisim PUBLIC NEW_GTPU)
target_link_libraries (nr-ittisim
-Wl,--start-group
- UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS ${GTPV1U} SECU_CN SECU_OSA
- ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
+ UTIL HASHTABLE SCTP_CLIENT UDP SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU LFDS GTPV1U_OCP SECU_CN SECU_OSA
+ ${ITTI_LIB} ${FLPT_MSG_LIB} ${ASYNC_IF_LIB} ${FLEXRAN_AGENT_LIB} LFDS7 ${MSC_LIB} ${RAL_LIB} ${NAS_SIM_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
X2AP_LIB X2AP_ENB F1AP_LIB F1AP M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB ${PROTO_AGENT_LIB} ${FSPT_MSG_LIB}
PHY_NR_UE SCHED_NR_UE_LIB NR_L2_UE
diff --git a/cmake_targets/at_commands/CMakeLists.txt b/cmake_targets/at_commands/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/README.txt b/cmake_targets/autotests/README.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/core.py b/cmake_targets/autotests/core.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/log.py b/cmake_targets/autotests/log.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/openair.py b/cmake_targets/autotests/openair.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/templates/index.html b/cmake_targets/autotests/templates/index.html
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/templates/testcase_report.html b/cmake_targets/autotests/templates/testcase_report.html
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/test_case_list.xml b/cmake_targets/autotests/test_case_list.xml
old mode 100644
new mode 100755
index b0511f63cc..29257e482f
--- a/cmake_targets/autotests/test_case_list.xml
+++ b/cmake_targets/autotests/test_case_list.xml
@@ -1099,8 +1099,9 @@
(Test14: 3 PTRS, 8 Interpolated Symbols),
(Test15: 6 PTRS, 5 Interpolated Symbols),
(Test16: 11 PTRS, 0 Interpolated Symbols),
- (Test17: 2 DMRS Symbols),
- (Test18: 3 DMRS Symbols)
+ (Test17: Mapping type A, 2 DMRS Symbols),
+ (Test18: Mapping type A, 3 DMRS Symbols),
+ (Test19: Mapping type B, 4 DMRS Symbols)
$OPENAIR_DIR/cmake_targets/build_oai
--phy_simulators -c
@@ -1124,8 +1125,9 @@
-n100 -s5 -T 2 1 2
-n100 -s5 -T 2 0 4
-n100 -s2 -U 2 0 1
- -n100 -s2 -U 2 0 2
- nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18
+ -n100 -s2 -U 2 0 2
+ -n100 -s2 -U 2 1 3
+ nr_dlsim.test1 nr_dlsim.test2 nr_dlsim.test3 nr_dlsim.test4 nr_dlsim.test5 nr_dlsim.test6 nr_dlsim.test7 nr_dlsim.test8 nr_dlsim.test9 nr_dlsim.test10 nr_dlsim.test11 nr_dlsim.test12 nr_dlsim.test13 nr_dlsim.test14 nr_dlsim.test15 nr_dlsim.test16 nr_dlsim.test17 nr_dlsim.test18 nr_dlsim.test19
PDSCH test OK
segmentation fault|assertion|exiting|fatal
3
@@ -1287,15 +1289,16 @@
(Test3: MCS 28 50 PRBs),
(Test4: MCS 9 217 PRBs),
(Test5: MCS 9 273 PRBs),
- (Test6: DMRS Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols),
- (Test7: DMRS Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols),
- (Test8: DMRS Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols),
- (Test9: SC-FDMA, 50 PRBs),
- (Test10: SC-FDMA, 75 PRBs),
- (Test11: SC-FDMA, 216 PRBs),
- (Test12: SC-FDMA, 273 PRBs),
- (Test13: SC-FDMA, 3 DMRS),
- (Test14: MCS 16 50 PRBs 2 RX_Antenna)
+ (Test6: DMRS Type A, 2 DMRS Symbols),
+ (Test7: DMRS Type A, 3 DMRS, 4 PTRS, 5 Interpolated Symbols),
+ (Test8: DMRS Type B, 3 DMRS, 2 PTRS, 7 Interpolated Symbols),
+ (Test9: DMRS Type B, 3 DMRS, 2 PTRS, 3 Interpolated Symbols),
+ (Test10: SC-FDMA, 50 PRBs),
+ (Test11: SC-FDMA, 75 PRBs),
+ (Test12: SC-FDMA, 216 PRBs),
+ (Test13: SC-FDMA, 273 PRBs),
+ (Test14: SC-FDMA, 3 DMRS),
+ (Test15: MCS 16 50 PRBs 2 RX_Antenna)
$OPENAIR_DIR/cmake_targets/build_oai
--phy_simulators -c
@@ -1307,6 +1310,7 @@
-n100 -m28 -s20
-n100 -m9 -R217 -r217 -s5
-n100 -m9 -R273 -r273 -s5
+ -n100 -s5 -U 2 0 1
-n100 -s5 -T 2 1 2 -U 2 0 2
-n100 -s5 -T 2 2 2 -U 2 1 2
-n100 -s5 -a4 -b8 -T 2 1 2 -U 2 1 3
@@ -1317,7 +1321,7 @@
-n100 -s2 -Z -U 2 0 2
-n100 -m16 -s10 -z2
- nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14
+ nr_ulsim.test1 nr_ulsim.test2 nr_ulsim.test3 nr_ulsim.test4 nr_ulsim.test5 nr_ulsim.test6 nr_ulsim.test7 nr_ulsim.test8 nr_ulsim.test9 nr_ulsim.test10 nr_ulsim.test11 nr_ulsim.test12 nr_ulsim.test13 nr_ulsim.test14 nr_ulsim.test15
PUSCH test OK
segmentation fault|assertion|exiting|fatal
3
diff --git a/cmake_targets/autotests/testsuite_ue_noS1.xml b/cmake_targets/autotests/testsuite_ue_noS1.xml
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml b/cmake_targets/autotests/testsuite_ue_noS1_TCL.xml
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/tools/lib_autotest.py b/cmake_targets/autotests/tools/lib_autotest.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/tools/lib_autotest_analyser.py b/cmake_targets/autotests/tools/lib_autotest_analyser.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/tools/wdial.bandrich.conf b/cmake_targets/autotests/tools/wdial.bandrich.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/3276.txt b/cmake_targets/autotests/v2/actions/3276.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/alu_epc.bash b/cmake_targets/autotests/v2/actions/alu_epc.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/alu_epc_stop.bash b/cmake_targets/autotests/v2/actions/alu_epc_stop.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/alu_hss.bash b/cmake_targets/autotests/v2/actions/alu_hss.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/bandrich.txt b/cmake_targets/autotests/v2/actions/bandrich.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/client_tcp.bash b/cmake_targets/autotests/v2/actions/client_tcp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/client_udp.bash b/cmake_targets/autotests/v2/actions/client_udp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/clone_repository.bash b/cmake_targets/autotests/v2/actions/clone_repository.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/compilation.bash b/cmake_targets/autotests/v2/actions/compilation.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/execution.bash b/cmake_targets/autotests/v2/actions/execution.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/execution_compile.bash b/cmake_targets/autotests/v2/actions/execution_compile.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/modem.py b/cmake_targets/autotests/v2/actions/modem.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/run_enb.bash b/cmake_targets/autotests/v2/actions/run_enb.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/server_tcp.bash b/cmake_targets/autotests/v2/actions/server_tcp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/server_udp.bash b/cmake_targets/autotests/v2/actions/server_udp.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_3276.bash b/cmake_targets/autotests/v2/actions/start_3276.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_3276.py b/cmake_targets/autotests/v2/actions/start_3276.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_bandrich.bash b/cmake_targets/autotests/v2/actions/start_bandrich.bash
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/start_bandrich.py b/cmake_targets/autotests/v2/actions/start_bandrich.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/stop_3276.py b/cmake_targets/autotests/v2/actions/stop_3276.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/stop_bandrich.py b/cmake_targets/autotests/v2/actions/stop_bandrich.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/wvdial.3276.conf b/cmake_targets/autotests/v2/actions/wvdial.3276.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf b/cmake_targets/autotests/v2/actions/wvdial.bandrich.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/alu_test.py b/cmake_targets/autotests/v2/alu_test.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.10MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.20MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band38.tm1.usrpb210.tdd.5MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.10MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.20MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf b/cmake_targets/autotests/v2/config/enb.band7.tm1.usrpb210.fdd.5MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.10MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.20MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf b/cmake_targets/autotests/v2/config/rcc.band7.tm1.if4p5.5MHz.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.10MHz.udp.usrpb210.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.20MHz.udp.usrpb210.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf b/cmake_targets/autotests/v2/config/rru.band7.tm1.if4p5.5MHz.udp.usrpb210.conf
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/connection.py b/cmake_targets/autotests/v2/connection.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/machine_list.py b/cmake_targets/autotests/v2/machine_list.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/main.py b/cmake_targets/autotests/v2/main.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/task.py b/cmake_targets/autotests/v2/task.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/autotests/v2/utils.py b/cmake_targets/autotests/v2/utils.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/build_oai b/cmake_targets/build_oai
index 2eb04b1695..d95b30e052 100755
--- a/cmake_targets/build_oai
+++ b/cmake_targets/build_oai
@@ -71,6 +71,7 @@ ITTI_SIM="False"
RFSIM_NAS="False"
SANITIZE_ADDRESS="False"
OPTIONAL_LIBRARIES="telnetsrv enbscope uescope nrscope msc"
+RU=0
trap handle_ctrl_c INT
function print_help() {
@@ -105,6 +106,8 @@ Options
Makes the NR softmodem
--nrUE
Makes the NR UE softmodem
+--RU
+ Makes the OAI RRU (without full stack)
--UE
Makes the UE specific parts (ue_ip, usim, nvram) from the given configuration file
--UE-conf-nvram [configuration file]
@@ -242,29 +245,38 @@ function main() {
shift;;
--eNB)
eNB=1
+ RU=0
echo_info "Will compile eNB"
shift;;
--eNBocp)
eNBocp=1
+ RU=0
echo_info "Will compile OCP eNB"
shift;;
--gNB)
gNB=1
+ RU=0
NR="True"
echo_info "Will compile gNB"
shift;;
+ --RU)
+ RU=1
+ echo_info "Will compile RRU"
+ shift;;
-a | --agent)
echo_info "FlexRAN support is always compiled into the eNB"
shift;;
--UE)
+ RU=0
UE=1
echo_info "Will compile UE"
shift;;
--nrUE)
+ RU=0
nrUE=1
- NR="True"
rfsimNas=1
RFSIM_NAS="True"
+ NR="True"
echo_info "Will compile NR UE"
shift;;
--mu)
@@ -299,6 +311,7 @@ function main() {
shift 2;;
-P | --phy_simulators)
SIMUS_PHY=1
+ RU=0
echo_info "Will compile dlsim, ulsim, ..."
shift;;
-S | --core_simulators)
@@ -467,7 +480,7 @@ function main() {
########################################################
# to be discussed
- if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$gNB" = "1" ] ; then
+ if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$gNB" = "1" -o "$RU" = "1" ] ; then
if [ "$HW" = "None" -a "$TP" = "None" ] ; then
echo_info "No local radio head and no transport protocol selected"
fi
@@ -594,7 +607,7 @@ function main() {
config_libconfig_shlib=params_libconfig
# first generate the CMakefile in the right directory
- if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" -o "$rfsimNas" = "1" ] ; then
+ if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HW" = "EXMIMO" -o "$ittiSIM" = "1" -o "$rfsimNas" = "1" ] ; then
# softmodem compilation
@@ -618,9 +631,9 @@ function main() {
echo "set ( UE_TIMING_TRACE $UE_TIMING_TRACE )" >> $cmake_file
echo "set ( USRP_REC_PLAY $USRP_REC_PLAY )" >> $cmake_file
echo "set ( SKIP_SHARED_LIB_FLAG $SKIP_SHARED_LIB_FLAG )" >> $cmake_file
+ echo "set ( RU $RU )" >> $cmake_file
echo "set ( ITTI_SIM $ITTI_SIM )" >> $cmake_file
echo "set ( RFSIM_NAS $RFSIM_NAS )" >> $cmake_file
- echo "set ( NR \"${NR}\" )" >> $cmake_file
echo "set ( SANITIZE_ADDRESS $SANITIZE_ADDRESS )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$build_dir/build
@@ -636,6 +649,9 @@ function main() {
if [ "$gNB" = "1" ] ; then
execlist="$execlist nr-softmodem"
fi
+ if [ "$RU" = "1" ] ; then
+ execlist="$execlist oairu"
+ fi
if [ "$UE" = 1 ] ; then
execlist="$execlist lte-uesoftmodem"
fi
@@ -664,28 +680,29 @@ function main() {
$build_dir $config_libconfig_shlib \
lib$config_libconfig_shlib.so $dbin/lib$config_libconfig_shlib.so
- compilations \
- $build_dir coding \
- libcoding.so $dbin/libcoding.so
-
-
- #check if we run inside a container or not
- #IS_CONTAINER variable is defined in build_helper file
- #compile nasmesh and rb_tool only if NOT running in a container
- if [ $IS_CONTAINER -eq 0 ]
- then
- compilations \
- $build_dir nasmesh \
- CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+ if [ "$RU" = "0" ] ; then
compilations \
- $build_dir rb_tool \
- rb_tool $dbin/rb_tool
+ $build_dir coding \
+ libcoding.so $dbin/libcoding.so
- cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
- fi #IS_CONTAINER
+ #check if we run inside a container or not
+ #IS_CONTAINER variable is defined in build_helper file
+ #compile nasmesh and rb_tool only if NOT running in a container
+ if [ $IS_CONTAINER -eq 0 ]
+ then
+ compilations \
+ $build_dir nasmesh \
+ CMakeFiles/nasmesh/nasmesh.ko $dbin/nasmesh.ko
+
+ compilations \
+ $build_dir rb_tool \
+ rb_tool $dbin/rb_tool
+
+ cp $OPENAIR_DIR/cmake_targets/tools/init_nas_nos1 $dbin
+ fi #IS_CONTAINER
+ fi
fi
-
fi
if [ "$UE" = 1 ] ; then
@@ -867,7 +884,7 @@ function main() {
####################################################
# Build RF device and transport protocol libraries #
####################################################
- if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$nrUE" = "1" -o "$HWLAT" = "1" ] ; then
+ if [ "$eNB" = "1" -o "$eNBocp" = "1" -o "$UE" = "1" -o "$gNB" = "1" -o "$RU" = "1" -o "$nrUE" = "1" -o "$HWLAT" = "1" ] ; then
# build RF device libraries
if [ "$HW" != "None" ] ; then
diff --git a/cmake_targets/doxygen/CMakeLists.txt b/cmake_targets/doxygen/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/epc_test/CMakeLists.template b/cmake_targets/epc_test/CMakeLists.template
old mode 100644
new mode 100755
diff --git a/cmake_targets/nas_sim_tools/CMakeLists.txt b/cmake_targets/nas_sim_tools/CMakeLists.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/phy_simulators/CMakeLists.txt b/cmake_targets/phy_simulators/CMakeLists.txt
old mode 100644
new mode 100755
index 447e90bcab..f8c659959f
--- a/cmake_targets/phy_simulators/CMakeLists.txt
+++ b/cmake_targets/phy_simulators/CMakeLists.txt
@@ -17,4 +17,5 @@ set ( UE_TIMING_TRACE False )
set ( USRP_REC_PLAY False )
set ( SKIP_SHARED_LIB_FLAG False )
set ( PHYSIM True)
+set ( RU 0)
include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)
diff --git a/cmake_targets/s1c_mme_test/CMakeLists.template b/cmake_targets/s1c_mme_test/CMakeLists.template
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/Kbuild.cmake b/cmake_targets/tools/Kbuild.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeParseArguments.cmake b/cmake_targets/tools/MODULES/CMakeParseArguments.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeUserFindMySQL.cmake b/cmake_targets/tools/MODULES/CMakeUserFindMySQL.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeUserUseBison.cmake b/cmake_targets/tools/MODULES/CMakeUserUseBison.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/CMakeUserUseFlex.cmake b/cmake_targets/tools/MODULES/CMakeUserUseFlex.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindFreeDiameter.cmake b/cmake_targets/tools/MODULES/FindFreeDiameter.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindGCCXML.cmake b/cmake_targets/tools/MODULES/FindGCCXML.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindGcrypt.cmake b/cmake_targets/tools/MODULES/FindGcrypt.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindGnuTLS.cmake b/cmake_targets/tools/MODULES/FindGnuTLS.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindKbuild.cmake b/cmake_targets/tools/MODULES/FindKbuild.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindLibXml2.cmake b/cmake_targets/tools/MODULES/FindLibXml2.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindMySQL.cmake b/cmake_targets/tools/MODULES/FindMySQL.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindNettle.cmake b/cmake_targets/tools/MODULES/FindNettle.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindPostgreSQL.cmake b/cmake_targets/tools/MODULES/FindPostgreSQL.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/FindSCTP.cmake b/cmake_targets/tools/MODULES/FindSCTP.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/Kbuild.cmake b/cmake_targets/tools/MODULES/Kbuild.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/cmake_useful.cmake b/cmake_targets/tools/MODULES/cmake_useful.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/kbuild_system.cmake b/cmake_targets/tools/MODULES/kbuild_system.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/kmodule.cmake b/cmake_targets/tools/MODULES/kmodule.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/MODULES/path_prefixes.cmake b/cmake_targets/tools/MODULES/path_prefixes.cmake
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/asn1tostruct.py b/cmake_targets/tools/asn1tostruct.py
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/build_helper b/cmake_targets/tools/build_helper
index 9b8363fc2b..30fdb7eb1e 100755
--- a/cmake_targets/tools/build_helper
+++ b/cmake_targets/tools/build_helper
@@ -113,6 +113,7 @@ check_supported_distribution() {
"rhel7.6") return 0 ;;
"rhel7.7") return 0 ;;
"rhel7.8") return 0 ;;
+ "rhel7.9") return 0 ;;
"rhel8.2") return 0 ;;
"rhel8.3") return 0 ;;
"rhel8.4") return 0 ;;
diff --git a/cmake_targets/tools/example_enb_exmimo_mme_hss.txt b/cmake_targets/tools/example_enb_exmimo_mme_hss.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt b/cmake_targets/tools/example_oaisim_enb_ue_mme_virtual.txt
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/exmimo2_2arxg.lime b/cmake_targets/tools/exmimo2_2arxg.lime
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/exmimo2_2brxg.lime b/cmake_targets/tools/exmimo2_2brxg.lime
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/exmimo_stop_octave.m b/cmake_targets/tools/exmimo_stop_octave.m
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel10/SystemInformation-r8-IEs.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-NB-r13-IEs.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff b/cmake_targets/tools/fix_asn1.data/RRC.rel14/SystemInformation-r8-IEs.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff b/cmake_targets/tools/fix_asn1.data/X2AP.rel11.2/X2ap-CriticalityDiagnostics-IE-List.h.diff
old mode 100644
new mode 100755
diff --git a/cmake_targets/tools/make_asn1c_includes.sh b/cmake_targets/tools/make_asn1c_includes.sh
index 1598678a73..00c88d6497 100755
--- a/cmake_targets/tools/make_asn1c_includes.sh
+++ b/cmake_targets/tools/make_asn1c_includes.sh
@@ -1,13 +1,19 @@
#!/bin/bash
-GENERATED_FULL_DIR=$1
-shift
-ASN1_SOURCE_DIR=$1
-shift
export ASN1C_PREFIX=$1
shift
-options=$*
+options=$1
+shift
+GENERATED_FULL_DIR=$1
+shift
+ASN1_SOURCE_DIR=$*
done_flag="$GENERATED_FULL_DIR"/done
-if [ "$done_flag" -ot $ASN1_SOURCE_DIR ] ; then
+rebuild=0
+for f in $ASN1_SOURCE_DIR ; do
+ if [ "$done_flag" -ot "$f" ] ; then
+ rebuild=1
+ fi
+done
+if [ $rebuild -eq 1 ] ; then
rm -f "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.c "$GENERATED_FULL_DIR"/${ASN1C_PREFIX}*.h
mkdir -p "$GENERATED_FULL_DIR"
asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example $options -D $GENERATED_FULL_DIR $ASN1_SOURCE_DIR |& egrep -v "^Copied|^Compiled" | sort -u
diff --git a/cmake_targets/tools/setup_routes.sh b/cmake_targets/tools/setup_routes.sh
new file mode 100755
index 0000000000..67fe250be7
--- /dev/null
+++ b/cmake_targets/tools/setup_routes.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+for i in $(seq 1 $1);
+do
+ let table=1000+$i
+ echo "sudo ip route add 10.0.1.0/24 dev oaitun_ue$i table $table"
+ sudo ip route add 10.0.1.0/24 dev oaitun_ue$i table $table
+ echo "sudo ip route add default via 10.0.1.1 dev oaitun_ue$i table $table"
+ sudo ip route add default via 10.0.1.1 dev oaitun_ue$i table $table
+ let octet=$i+1
+ echo "sudo ip rule add from 10.0.1.$octet table $table"
+ sudo ip rule add from 10.0.1.$octet table $table
+done
diff --git a/cmake_targets/tools/test_helper b/cmake_targets/tools/test_helper
old mode 100644
new mode 100755
diff --git a/common/config/config_cmdline.c b/common/config/config_cmdline.c
index 1df1bc16f7..f5dfae06b6 100644
--- a/common/config/config_cmdline.c
+++ b/common/config/config_cmdline.c
@@ -211,7 +211,7 @@ int config_process_cmdline(paramdef_t *cfgoptions,int numoptions, char *prefix)
while (c > 0 ) {
char *oneargv = strdup(config_get_if()->argv[i]); /* we use strtok_r which modifies its string paramater, and we don't want argv to be modified */
-
+ if(!oneargv) abort();
/* first check help options, either --help, -h or --help_ */
if (strncmp(oneargv, "-h",2) == 0 || strncmp(oneargv, "--help",6) == 0 ) {
char *tokctx = NULL;
diff --git a/common/ran_context.h b/common/ran_context.h
index 3f57c000a0..db981e9182 100644
--- a/common/ran_context.h
+++ b/common/ran_context.h
@@ -39,7 +39,7 @@
#include "PHY/types.h"
#include "PHY/impl_defs_top.h"
-#include "ENB_APP/enb_config.h"
+//#include "ENB_APP/enb_config.h"
#include "flexran_agent_defs.h"
#include "gtpv1u.h"
@@ -122,5 +122,5 @@ typedef struct {
pthread_cond_t ru_cond;
} RAN_CONTEXT_t;
-
+extern RAN_CONTEXT_t RC;
#endif
diff --git a/common/utils/LOG/log.c b/common/utils/LOG/log.c
index 8029ba826b..d0a53a755b 100644
--- a/common/utils/LOG/log.c
+++ b/common/utils/LOG/log.c
@@ -460,7 +460,7 @@ int logInit (void)
register_log_component("LOCALIZE","log",LOCALIZE);
register_log_component("NAS","log",NAS);
register_log_component("UDP","",UDP_);
- register_log_component("GTPV1U","",GTPU);
+ register_log_component("GTPU","",GTPU);
register_log_component("S1AP","",S1AP);
register_log_component("F1AP","",F1AP);
register_log_component("M2AP","",M2AP);
diff --git a/common/utils/lte/prach_utils.c b/common/utils/lte/prach_utils.c
new file mode 100644
index 0000000000..9ef29e55a5
--- /dev/null
+++ b/common/utils/lte/prach_utils.c
@@ -0,0 +1,425 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+/*! \file common/utils/lte/prach_utils.c
+ * \brief utils for PRACH common to both PHY and MAC
+ * \author R. Knopp
+ * \date 2020
+ * \version 0.1
+ * \company Eurecom
+ * \email: knopp@eurecom.fr
+ * \note
+ * \warning
+ */
+
+#include
+
+
+#include "PHY/LTE_TRANSPORT/transport_common.h"
+
+// This is table 5.7.1-4 from 36.211
+PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = {
+ // TDD Configuration Index 0
+ { {1,{{0,1,0,2}}},{1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {1,{{0,1,0,2}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {1,{{0,1,0,2}}}},
+ // TDD Configuration Index 1
+ { {1,{{0,2,0,2}}},{1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {1,{{0,2,0,2}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {1,{{0,2,0,2}}}},
+ // TDD Configuration Index 2
+ { {1,{{0,1,1,2}}},{1,{{0,1,1,1}}}, {1,{{0,1,1,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,1}}}},
+ // TDD Configuration Index 3
+ { {1,{{0,0,0,2}}},{1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {1,{{0,0,0,2}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {1,{{0,0,0,2}}}},
+ // TDD Configuration Index 4
+ { {1,{{0,0,1,2}}},{1,{{0,0,1,1}}}, {1,{{0,0,1,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,1}}}},
+ // TDD Configuration Index 5
+ { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}},
+ // TDD Configuration Index 6
+ { {2,{{0,0,0,2},{0,0,1,2}}}, {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {2,{{0,0,0,1},{0,0,0,2}}}, {2,{{0,0,0,0},{0,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {2,{{0,0,0,2},{0,0,1,1}}}},
+ // TDD Configuration Index 7
+ { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,0,2}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}},
+ // TDD Configuration Index 8
+ { {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,0,1}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{0,0,1,1}}}},
+ // TDD Configuration Index 9
+ { {3,{{0,0,0,1},{0,0,0,2},{0,0,1,2}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,1,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,0,2}}}, {3,{{0,0,0,0},{0,0,0,1},{1,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {3,{{0,0,0,1},{0,0,0,2},{0,0,1,1}}}},
+ // TDD Configuration Index 10
+ { {3,{{0,0,0,0},{0,0,1,0},{0,0,1,1}}}, {3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,2},{0,0,1,0}}}},
+ // TDD Configuration Index 11
+ { {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{0,0,0,1},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{0,0,1,1}}}},
+ // TDD Configuration Index 12
+ { {4,{{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}}, {4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}},
+ {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,2}}},
+ {4,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {4,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 13
+ { {4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,2}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 14
+ { {4,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 15
+ { {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,1},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1}}},
+ {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,1},{1,0,0,2}}},
+ {5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,1}}}, {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}},
+ {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1}}}
+ },
+ // TDD Configuration Index 16
+ { {5,{{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,1,1}}},
+ {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,1,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,2}}},
+ {5,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}
+ },
+ // TDD Configuration Index 17
+ { {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,2}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}
+ },
+ // TDD Configuration Index 18
+ { {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{0,0,1,2}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,1},{1,0,1,1}}},
+ {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{1,0,0,0},{1,0,0,1},{1,0,0,2}}},
+ {6,{{0,0,0,0},{0,0,0,1},{1,0,0,0},{1,0,0,1},{2,0,0,0},{2,0,0,1}}},
+ {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,0,2}}}
+ },
+ // TDD Configuration Index 19
+ { {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,1,0},{0,0,1,1},{1,0,0,0},{1,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,0},{0,0,0,1},{0,0,0,2},{0,0,1,0},{0,0,1,1},{1,0,1,1}}}
+ },
+ // TDD Configuration Index 20
+ { {1,{{0,1,0,1}}},{1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}},
+ // TDD Configuration Index 21
+ { {1,{{0,2,0,1}}},{1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}},
+
+ // TDD Configuration Index 22
+ { {1,{{0,1,1,1}}},{1,{{0,1,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,0}}}},
+
+ // TDD Configuration Index 23
+ { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}},
+
+ // TDD Configuration Index 24
+ { {1,{{0,0,1,1}}},{1,{{0,0,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,0}}}},
+
+ // TDD Configuration Index 25
+ { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{1,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}},
+
+ // TDD Configuration Index 26
+ { {3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}},
+
+ // TDD Configuration Index 27
+ { {4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}}
+ },
+
+ // TDD Configuration Index 28
+ { {5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}}, {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}},
+ {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}}
+ },
+
+ // TDD Configuration Index 29
+ { {6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}},
+ {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}},
+ {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1},{2,0,1,0}}}
+ },
+
+
+ // TDD Configuration Index 30
+ { {1,{{0,1,0,1}}},{1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,1}}}},
+
+ // TDD Configuration Index 31
+ { {1,{{0,2,0,1}}},{1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,1}}}},
+
+ // TDD Configuration Index 32
+ { {1,{{0,1,1,1}}},{1,{{0,1,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,1,0}}}},
+
+ // TDD Configuration Index 33
+ { {1,{{0,0,0,1}}},{1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,1}}}},
+
+ // TDD Configuration Index 34
+ { {1,{{0,0,1,1}}},{1,{{0,0,1,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,1,0}}}},
+
+ // TDD Configuration Index 35
+ { {2,{{0,0,0,1},{0,0,1,1}}}, {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{1,0,0,1}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,1},{0,0,1,0}}}},
+
+ // TDD Configuration Index 36
+ { {3,{{0,0,0,1},{0,0,1,1},{1,0,0,1}}}, {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{1,0,0,1},{2,0,0,1}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,1},{0,0,1,0},{1,0,0,1}}}},
+
+ // TDD Configuration Index 37
+ { {4,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1}}}, {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0}}}
+ },
+
+ // TDD Configuration Index 38
+ { {5,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1}}}, {5,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {5,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1}}},
+ {5,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {5,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1}}}
+ },
+
+ // TDD Configuration Index 39
+ { {6,{{0,0,0,1},{0,0,1,1},{1,0,0,1},{1,0,1,1},{2,0,0,1},{2,0,1,1}}},
+ {6,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0},{2,0,0,0},{2,0,1,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{1,0,0,1},{2,0,0,1},{3,0,0,1},{4,0,0,1},{5,0,0,1}}},
+ {6,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0},{4,0,0,0},{5,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {6,{{0,0,0,1},{0,0,1,0},{1,0,0,1},{1,0,1,0},{2,0,0,1},{2,0,1,0}}}
+ },
+
+ // TDD Configuration Index 40
+ { {1,{{0,1,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,1,0,0}}}},
+ // TDD Configuration Index 41
+ { {1,{{0,2,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,2,0,0}}}},
+
+ // TDD Configuration Index 42
+ { {1,{{0,1,1,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}},
+
+ // TDD Configuration Index 43
+ { {1,{{0,0,0,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {1,{{0,0,0,0}}}},
+
+ // TDD Configuration Index 44
+ { {1,{{0,0,1,0}}},{0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}, {0,{{0,0,0,0}}}},
+
+ // TDD Configuration Index 45
+ { {2,{{0,0,0,0},{0,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0}}}, {2,{{0,0,0,0},{1,0,0,0}}}},
+
+ // TDD Configuration Index 46
+ { {3,{{0,0,0,0},{0,0,1,0},{1,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0}}}, {3,{{0,0,0,0},{1,0,0,0},{2,0,0,0}}}},
+
+ // TDD Configuration Index 47
+ { {4,{{0,0,0,0},{0,0,1,0},{1,0,0,0},{1,0,1,0}}}, {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {0,{{0,0,0,0},{0,0,0,0},{0,0,0,0},{0,0,0,0}}},
+ {4,{{0,0,0,0},{1,0,0,0},{2,0,0,0},{3,0,0,0}}}
+ }
+};
+
+
+uint8_t get_prach_fmt(int prach_ConfigIndex,int frame_type) {
+ if (frame_type == FDD) // FDD
+ return(prach_ConfigIndex>>4);
+ else {
+ if (prach_ConfigIndex < 20)
+ return (0);
+
+ if (prach_ConfigIndex < 30)
+ return (1);
+
+ if (prach_ConfigIndex < 40)
+ return (2);
+
+ if (prach_ConfigIndex < 48)
+ return (3);
+ else
+ return (4);
+ }
+}
+
+uint8_t get_prach_prb_offset(int frame_type,
+ int tdd_config,
+ int N_RB_UL,
+ uint8_t prach_ConfigIndex,
+ uint8_t n_ra_prboffset,
+ uint8_t tdd_mapindex, uint16_t Nf) {
+ uint8_t n_ra_prb;
+ uint8_t f_ra,t1_ra;
+ uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
+ uint8_t Nsp=2;
+
+ if (frame_type == TDD) { // TDD
+ if (tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach==0) {
+ LOG_E(PHY, "Illegal prach_ConfigIndex %"PRIu8"", prach_ConfigIndex);
+ return(-1);
+ }
+
+ // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211)
+ f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra;
+
+ if (prach_fmt < 4) {
+ if ((f_ra&1) == 0) {
+ n_ra_prb = n_ra_prboffset + 6*(f_ra>>1);
+ } else {
+ n_ra_prb = N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1);
+ }
+ } else {
+ if ((tdd_config >2) && (tdd_config<6))
+ Nsp = 2;
+
+ t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
+
+ if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) {
+ n_ra_prb = 6*f_ra;
+ } else {
+ n_ra_prb = N_RB_UL - 6*(f_ra+1);
+ }
+ }
+ } else { //FDD
+ n_ra_prb = n_ra_prboffset;
+ }
+
+ return(n_ra_prb);
+}
+
+int is_prach_subframe0(int tdd_config,int frame_type,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe) {
+ uint8_t t0_ra;
+ uint8_t t1_ra;
+ uint8_t t2_ra;
+ int prach_mask = 0;
+
+ if (frame_type == FDD) { //FDD
+ //implement Table 5.7.1-2 from 36.211 (Rel-10, p.41)
+ if ((((frame&1) == 1) && (subframe < 9)) ||
+ (((frame&1) == 0) && (subframe == 9))) // This is an odd frame, ignore even-only PRACH frames
+ if (((prach_ConfigIndex&0xf)<3) || // 0,1,2,16,17,18,32,33,34,48,49,50
+ ((prach_ConfigIndex&0x1f)==18) || // 18,50
+ ((prach_ConfigIndex&0xf)==15)) // 15,47
+ return(0);
+
+ switch (prach_ConfigIndex&0x1f) {
+ case 0:
+ case 3:
+ if (subframe==1) prach_mask = 1;
+
+ break;
+
+ case 1:
+ case 4:
+ if (subframe==4) prach_mask = 1;
+
+ break;
+
+ case 2:
+ case 5:
+ if (subframe==7) prach_mask = 1;
+
+ break;
+
+ case 6:
+ if ((subframe==1) || (subframe==6)) prach_mask=1;
+
+ break;
+
+ case 7:
+ if ((subframe==2) || (subframe==7)) prach_mask=1;
+
+ break;
+
+ case 8:
+ if ((subframe==3) || (subframe==8)) prach_mask=1;
+
+ break;
+
+ case 9:
+ if ((subframe==1) || (subframe==4) || (subframe==7)) prach_mask=1;
+
+ break;
+
+ case 10:
+ if ((subframe==2) || (subframe==5) || (subframe==8)) prach_mask=1;
+
+ break;
+
+ case 11:
+ if ((subframe==3) || (subframe==6) || (subframe==9)) prach_mask=1;
+
+ break;
+
+ case 12:
+ if ((subframe&1)==0) prach_mask=1;
+
+ break;
+
+ case 13:
+ if ((subframe&1)==1) prach_mask=1;
+
+ break;
+
+ case 14:
+ prach_mask=1;
+ break;
+
+ case 15:
+ if (subframe==9) prach_mask=1;
+
+ break;
+ }
+ } else { // TDD
+ AssertFatal(prach_ConfigIndex<64,
+ "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
+ AssertFatal(tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach>0,
+ "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
+ t0_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t0_ra;
+ t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
+ t2_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t2_ra;
+#ifdef PRACH_DEBUG
+ LOG_I(PHY,"[PRACH] Checking for PRACH format (ConfigIndex %d) in TDD subframe %d (%d,%d,%d)\n",
+ prach_ConfigIndex,
+ subframe,
+ t0_ra,t1_ra,t2_ra);
+#endif
+
+ if ((((t0_ra == 1) && ((frame &1)==0))|| // frame is even and PRACH is in even frames
+ ((t0_ra == 2) && ((frame &1)==1))|| // frame is odd and PRACH is in odd frames
+ (t0_ra == 0)) && // PRACH is in all frames
+ (((subframe<5)&&(t1_ra==0)) || // PRACH is in 1st half-frame
+ (((subframe>4)&&(t1_ra==1))))) { // PRACH is in 2nd half-frame
+ if ((prach_ConfigIndex<48) && // PRACH only in normal UL subframe
+ (((subframe%5)-2)==t2_ra)) prach_mask=1;
+ else if ((prach_ConfigIndex>47) && (((subframe%5)-1)==t2_ra)) prach_mask=1; // PRACH can be in UpPTS
+ }
+ }
+
+ return(prach_mask);
+}
+
diff --git a/common/utils/lte/prach_utils.h b/common/utils/lte/prach_utils.h
new file mode 100644
index 0000000000..995805fbd2
--- /dev/null
+++ b/common/utils/lte/prach_utils.h
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+/*! \file common/utils/prach_utils.h
+* \brief computation of some PRACH variables used in both MAC and PHY
+* \author R. Knopp
+* \date 2020
+* \version 0.1
+* \company Eurecom
+* \email: raymond.knopp@eurecom.fr, florian.kaltenberger@eurecom.fr, oscar.tonelli@yahoo.it
+* \note
+* \warning
+*/
+uint8_t get_prach_fmt(int prach_ConfigIndex,int frame_type);
+
+uint8_t get_prach_prb_offset(int frame_type,
+ int tdd_config,
+ int N_RB_UL,
+ uint8_t prach_ConfigIndex,
+ uint8_t n_ra_prboffset,
+ uint8_t tdd_mapindex, uint16_t Nf);
+int is_prach_subframe0(int tdd_config,int frame_type,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe);
diff --git a/common/utils/lte/ue_power.c b/common/utils/lte/ue_power.c
new file mode 100644
index 0000000000..b377abf2ff
--- /dev/null
+++ b/common/utils/lte/ue_power.c
@@ -0,0 +1,108 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+/*! \file ue_power.c
+* \brief Routines to compute UE TX power according to 36.213
+* \author R. Knopp, F. Kaltenberger
+* \date 2020
+* \version 0.1
+* \company Eurecom
+* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
+* \note
+* \warning
+*/
+
+#include
+#include
+#include "PHY/defs_eNB.h"
+#include "PHY/TOOLS/dB_routines.h"
+
+extern int16_t hundred_times_delta_TF[100];
+extern uint16_t hundred_times_log10_NPRB[100];
+
+int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, int ncp, uint8_t use_srs)
+{
+
+ /// The payload + CRC size in bits, "B"
+ uint32_t B;
+ /// Number of code segments
+ uint32_t C;
+ /// Number of "small" code segments
+ uint32_t Cminus;
+ /// Number of "large" code segments
+ uint32_t Cplus;
+ /// Number of bits in "small" code segments (<6144)
+ uint32_t Kminus;
+ /// Number of bits in "large" code segments (<6144)
+ uint32_t Kplus;
+ /// Total number of bits across all segments
+ uint32_t sumKr;
+ /// Number of "Filler" bits
+ uint32_t F;
+ // num resource elements
+ uint32_t num_re=0.0;
+ // num symbols
+ uint32_t num_symb=0.0;
+ /// effective spectral efficiency of the PUSCH
+ uint32_t MPR_x100=0;
+ /// beta_offset
+ uint16_t beta_offset_pusch_x8=8;
+ /// delta mcs
+ float delta_mcs=0.0;
+ /// bandwidth factor
+ float bw_factor=0.0;
+
+ B= tbs+24;
+ lte_segmentation(NULL,
+ NULL,
+ B,
+ &C,
+ &Cplus,
+ &Cminus,
+ &Kplus,
+ &Kminus,
+ &F);
+
+
+ sumKr = Cminus*Kminus + Cplus*Kplus;
+ num_symb = 12-(ncp<<1)-(use_srs==0?0:1);
+ num_re = num_symb * nb_rb * 12;
+
+ if (num_re == 0)
+ return(0);
+
+ MPR_x100 = 100*sumKr/num_re;
+
+ if (control_only == 1 )
+ beta_offset_pusch_x8=8; // fixme
+
+ //(beta_offset_pusch_x8=ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
+
+ // if deltamcs_enabledm
+ delta_mcs = ((hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch_x8)>>3))/100.0);
+
+ bw_factor = (norm!=0) ? 0 : (hundred_times_log10_NPRB[nb_rb-1]/100.0);
+ LOG_D(PHY,"estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)\n",
+ (int16_t)ceil(delta_mcs + bw_factor), num_re, sumKr, MPR_x100, delta_mcs, bw_factor);
+ return (int16_t)ceil(delta_mcs + bw_factor);
+
+}
+
diff --git a/targets/RT/USER/rfsim.h b/common/utils/lte/ue_power.h
similarity index 69%
rename from targets/RT/USER/rfsim.h
rename to common/utils/lte/ue_power.h
index 801ab5eb56..caeebec2c8 100644
--- a/targets/RT/USER/rfsim.h
+++ b/common/utils/lte/ue_power.h
@@ -18,23 +18,17 @@
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
-#ifndef __RFSIM__H__
-#define __RFSIM__H__
-#include "lte-softmodem.h"
-#include "openair1/SIMULATION/TOOLS/sim.h"
-#include "platform_constants.h"
-#include "common/ran_context.h"
-#include "PHY/defs_UE.h"
-#include "PHY/defs_eNB.h"
-void init_ocm(void);
+/*! \file ue_power.h
+* \brief support routines used in MAC and PHY
+* \author R. Knopp, F. Kaltenberger
+* \date 2020
+* \version 0.1
+* \company Eurecom
+* \email: knopp@eurecom.fr,florian.kaltenberger@eurecom.fr
+* \note
+* \warning
+*/
-void update_ocm(double snr_dB,double sinr_dB);
+int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
-//extern pthread_mutex_t async_server_lock;
-//extern pthread_cond_t async_server_notify;
-//extern int async_server_shutdown;
-
-void init_channel_vars(void);
-
-#endif
diff --git a/common/utils/system.c b/common/utils/system.c
index 4c6c1a4dc0..d8b66c51d3 100644
--- a/common/utils/system.c
+++ b/common/utils/system.c
@@ -96,6 +96,54 @@ static void read_pipe(int p, char *b, int size) {
}
}
+static int baseRunTimeCommand(char* cmd, size_t cmdSize) {
+ FILE *fp;
+ size_t retSize = 0;
+
+ fp = popen(cmd, "r");
+ if(fp) {
+ memset(cmd, 0, cmdSize);
+ retSize = fread(cmd, 1, cmdSize, fp);
+ fclose(fp);
+ } else {
+ LOG_D(HW,"%s:%d:%s: Cannot open %s\n", __FILE__, __LINE__, __FUNCTION__, cmd);
+ }
+
+ if (retSize == 0) {
+ return 0;
+ }
+ return atoi(cmd);
+}
+
+int checkIfFedoraDistribution(void) {
+ char cmd[200];
+
+ memset(cmd, 0, 200);
+ sprintf(cmd, "cat /etc/os-release | grep ID_LIKE | grep -ic fedora || true");
+ return baseRunTimeCommand(cmd, 200);
+}
+
+int checkIfGenericKernelOnFedora(void) {
+ char cmd[200];
+
+ memset(cmd, 0, 200);
+ sprintf(cmd, "uname -a | grep -c rt || true");
+ return (1 - baseRunTimeCommand(cmd, 200));
+}
+
+int checkIfInsideContainer(void) {
+ char cmd[200];
+ int res = 0;
+
+ memset(cmd, 0, 200);
+ sprintf(cmd, "cat /proc/self/cgroup | egrep -c 'libpod|podman|kubepods' || true");
+ res = baseRunTimeCommand(cmd, 200);
+ if (res > 0)
+ return 1;
+ else
+ return 0;
+}
+
/********************************************************************/
/* background process */
/********************************************************************/
@@ -200,29 +248,38 @@ void start_background_system(void) {
void threadCreate(pthread_t* t, void * (*func)(void*), void * param, char* name, int affinity, int priority){
pthread_attr_t attr;
int ret;
+ int settingPriority = 1;
ret=pthread_attr_init(&attr);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
ret=pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI);
- AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
- if(prioritysched_get_priority_max(SCHED_FIFO)) {
- LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
- priority,
- sched_get_priority_min(SCHED_OAI),
- sched_get_priority_max(SCHED_OAI));
- if(prioritysched_get_priority_max(SCHED_OAI))
- priority=sched_get_priority_max(SCHED_OAI);
+ if (checkIfFedoraDistribution())
+ if (checkIfGenericKernelOnFedora())
+ if (checkIfInsideContainer())
+ settingPriority = 0;
+
+ if (settingPriority) {
+ ret=pthread_attr_setschedpolicy(&attr, SCHED_OAI);
+ AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
+ if(prioritysched_get_priority_max(SCHED_FIFO)) {
+ LOG_E(TMR,"Prio not possible: %d, min is %d, max: %d, forced in the range\n",
+ priority,
+ sched_get_priority_min(SCHED_OAI),
+ sched_get_priority_max(SCHED_OAI));
+ if(prioritysched_get_priority_max(SCHED_OAI))
+ priority=sched_get_priority_max(SCHED_OAI);
+ }
+ AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),"");
+ struct sched_param sparam={0};
+ sparam.sched_priority = priority;
+ ret=pthread_attr_setschedparam(&attr, &sparam);
+ AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
}
- AssertFatal(priority<=sched_get_priority_max(SCHED_OAI),"");
- struct sched_param sparam={0};
- sparam.sched_priority = priority;
- ret=pthread_attr_setschedparam(&attr, &sparam);
- AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
+
ret=pthread_create(t, &attr, func, param);
AssertFatal(ret==0,"ret: %d, errno: %d\n",ret, errno);
diff --git a/common/utils/system.h b/common/utils/system.h
index fbfd338a1a..c76fef9144 100644
--- a/common/utils/system.h
+++ b/common/utils/system.h
@@ -58,6 +58,14 @@ void thread_top_init(char *thread_name,
uint64_t deadline,
uint64_t period);
+/****************************************************
+ * Functions to check system at runtime.
+ ****************************************************/
+
+int checkIfFedoraDistribution(void);
+int checkIfGenericKernelOnFedora(void);
+int checkIfInsideContainer(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/common/utils/telnetsrv/telnetsrv.h b/common/utils/telnetsrv/telnetsrv.h
index b66641d5c8..59655501d3 100644
--- a/common/utils/telnetsrv/telnetsrv.h
+++ b/common/utils/telnetsrv/telnetsrv.h
@@ -31,6 +31,7 @@
#ifndef TELNETSRV_H
#define TELNETSRV_H
+#include
#define TELNETSRV_MODNAME "telnetsrv"
#define TELNET_PORT 9090
diff --git a/configuration/bladeRF/enb-band7-5mhz.conf b/configuration/bladeRF/enb-band7-5mhz.conf
index 9156a74fb0..9d19207522 100644
--- a/configuration/bladeRF/enb-band7-5mhz.conf
+++ b/configuration/bladeRF/enb-band7-5mhz.conf
@@ -238,7 +238,7 @@ MACRLCs = (
THREAD_STRUCT = (
{
parallel_config = "PARALLEL_RU_L1_TRX_SPLITaaaaaa";
- worker_config = "ENABLE";
+ worker_config = "WORKER_ENABLE";
}
);
diff --git a/doc/RUNMODEM.md b/doc/RUNMODEM.md
index 8d84646e07..dc7a982310 100644
--- a/doc/RUNMODEM.md
+++ b/doc/RUNMODEM.md
@@ -134,22 +134,24 @@ With the RF simulator (on the same machine):
## SA setup with OAI
-The sa flag is used to run gNB in standalone mode. Currently OAI in NR standalone mode transmits and receives SIB1 and triggers the RA procedure for initial access.
+The sa flag is used to run gNB in standalone mode.
-In order to run gNB in standalone mode, the following flag is needed at gNB:
+In order to run gNB and UE in standalone mode, the following flag is needed:
`--sa`
-### Run OAI in sa mode
-
-At the gNB the --sa flag does the following
-- it reads the RRC configuration from the configuration file
-- it encodes the RRCConfiguration and the RBconfig message and stores them in the binary files rbconfig.raw and reconfig.raw
-- the RRC encodes SIB1 according the configuration file and transmits it through PDSCH
+At the gNB the --sa flag does the following:
+- The RRC encodes SIB1 according to the configuration file and transmits it through NR-BCCH-DL-SCH.
At the UE the --sa flag will:
-- Read the binary files rbconfig.raw and reconfig.raw from the current directory (a different directory can be specified with the flag --rrc_config_path) and process them
-- After the successful decoding of a SIB1 at RRC, the UE will start the 5G NR Initial Access Procedure by triggering the RA procedure.
+- Decode SIB1 and starts the 5G NR Initial Access Procedure for SA:
+ 1) 5G-NR RRC Connection Setup
+ 2) NAS Authentication and Security
+ 3) 5G-NR AS Security Procedure
+ 4) 5G-NR RRC Reconfiguration
+ 5) Start Downlink and Uplink Data Transfer
+
+### Run OAI in SA mode
From the `cmake_targets/ran_build/build` folder:
@@ -159,13 +161,13 @@ gNB on machine 1:
UE on machine 2:
-`sudo ./nr-uesoftmodem --rrc_config_path . --sa`
+`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --sa`
With the RF simulator (on the same machine):
`sudo ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa`
-`sudo ./nr-uesoftmodem --rrc_config_path . --rfsim --sa`
+`sudo ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa`
## IF setup with OAI
diff --git a/doc/TESTING_5GSA_setup.md b/doc/TESTING_5GSA_setup.md
new file mode 100644
index 0000000000..786af5e27c
--- /dev/null
+++ b/doc/TESTING_5GSA_setup.md
@@ -0,0 +1,162 @@
+
+# OAI 5G SA tutorial [Under construction]
+
+In the following tutorial we describe how to deploy configure and test the two SA OAI setups:
+
+ - SA setup with OAI gNB and COTS UE
+ - SA setup with OAI gNB and OAI UE
+
+The operating system and hardware requirements to support OAI 5G NR are described [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/wikis/5g-nr-development-and-setup).
+
+# 1. SA setup with COTS UE
+At the moment of writing this document interoperability with the following COTS UE devices is being tested:
+
+ - [Quectel RM500Q-GL](https://www.quectel.com/product/5g-rm500q-gl/)
+ - [Simcom SIMCOM8200EA](https://www.simcom.com/product/SIM8200G.html)
+ - Huawei Mate 30 Pro
+
+ End-to-end control plane signaling to achieve a 5G SA connection, UE registration and PDU session establishment with the CN, as well as some basic user-plane traffic tests have been validated so far using the Quectel module and Huawei Mate 30 pro and partially validated with SIMCOM module. In terms of interoperability with different 5G Core Networks, so far this setup has been tested with:
+
+
+ - [OAI CN](https://openairinterface.org/oai-5g-core-network-project/)
+ - Nokia SA Box
+ - [Free CN](https://www.free5gc.org/)
+
+
+ ## 1.1 gNB build and configuration
+At the moment of writing this document, most of the code to support the SA setup is not merged into develop branch yet, but it is accessible through the following branches:
+
+ - NR_SA_F1AP_5GRECORDS
+ - develop-NR_SA_F1AP_5GRECORDS (up-to-date with latest develop branch)
+
+To build the gNB executable:
+```bash
+ cd cmake_targets
+ ./build_oai -I -w USRP #For OAI first time installation only to install software dependencies
+ ./build_oai --gNB -w USRP
+```
+
+A reference configuration file for the gNB is provided [here](https://gitlab.eurecom.fr/oai/openairinterface5g/-/blob/develop-NR_SA_F1AP_5GRECORDS/targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf).
+
+
+In the following, we highlight the fields of the file that have to be configured according to the configuration and interfaces of the Core Network. First, the PLMN section has to be filled with the proper values that match the configuration of the AMF and the UE USIM.
+```bash
+ // Tracking area code, 0x0000 and 0xfffe are reserved values
+ tracking_area_code = 1;
+ plmn_list = ({
+ mcc = 208;
+ mnc = 99;
+ mnc_length = 2;
+ snssaiList = (
+ {
+ sst = 1;
+ sd = 0x1; // 0 false, else true
+ },
+ {
+ sst = 1;
+ sd = 0x112233; // 0 false, else true
+ }
+ );
+ });
+```
+Then, the source and destination IP interfaces for the communication with
+the Core Network also need to be set as shown below.
+
+```bash
+ ////////// MME parameters:
+ amf_ip_address = ( { ipv4 = "192.168.70.132";
+ ipv6 = "192:168:30::17";
+ active = "yes";
+ preference = "ipv4";
+ }
+ );
+ NETWORK_INTERFACES :
+ {
+ GNB_INTERFACE_NAME_FOR_NG_AMF = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.70.129/24";
+ GNB_INTERFACE_NAME_FOR_NGU = "demo-oai";
+ GNB_IPV4_ADDRESS_FOR_NGU = "192.168.70.129/24";
+ GNB_PORT_FOR_S1U = 2152; # Spec 2152
+ };
+```
+In the first part (*amf_ip_address*) we specify the IP of the AMF and in the second part (*NETWORK_INTERFACES*) we specify the gNB local interface with AMF (N2 interface) and the UPF (N3 interface).
+
+### **gNB configuration in CU/DU split mode**
+For the configuration of the gNB in CU and DU blocks the following sample configuration files are provided for the CU and DU entities respectively.
+......
+At the point of writing this document the control-plane exchanges between the CU and the DU over *F1-C* interface have been validated. The integration of *F1-U* over gtp-u for the support of data plane traffic is ongoing.
+
+## 1.2 OAI 5G Core Network installation and configuration
+The instructions for the installation of OAI CN components (AMF, SMF, NRF, UPF) using docker compose can be found [here](https://gitlab.eurecom.fr/oai/cn5g). Below are some complementary instructions which can be useful for the deployment.
+
+ ## 1.3 Execution of SA scenario
+
+After having configured the gNB, we can start the individual components in the following sequence:
+
+ - Launch Core Network
+ - Launch gNB
+ - Launch COTS UE (disable airplane mode)
+
+The execution command to start the gNB (in monolithic mode) is the following:
+```bash
+cd cmake_targets/ran_build/build
+sudo ./nr-softmodem -E --sa -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf
+```
+
+# 2. SA Setup with OAI UE
+The SA setup with OAI UE has been validated with RFSIMULATOR for the moment. The control plane for the successful UE registration and PDU Session establishment has been verified with OAI and Nokia SA Box CNs. User-plane traffic validation after the establishment of the 5G connection is still pending for this setup.
+
+In the following, we provide the instructions on how to build, configure and execute this SA setup.
+
+## 2.1 Build and configuration
+To build the gNB and OAI UE executables:
+
+```bash
+ cd cmake_targets
+ ./build_oai -I #For OAI first time installation only to install software dependencies
+ ./build_oai --gNB --nrUE -w SIMU
+```
+The gNB configuration can be performed according to what is described in section 1.1, using the same reference configuration file as with the RF scenario.
+
+### NAS configuration for the OAI UE
+At the moment, the NAS configuration parameters of the OAI UE are hardcoded in ***openair3/NAS/NR_UE/nr_nas_msg_sim.c***. More specifically:
+
+ - The SUCI (*Subscription Concealed Identifier*) corresponding to default IMSI 2089900007487 is hardcoded in functions *generateRegistrationRequest()* and *generateIdentityResponse()* through the following lines:
+```bash
+ mm_msg->registration_request.fgsmobileidentity.suci.typeofidentity = FGS_MOBILE_IDENTITY_SUCI;
+ mm_msg->registration_request.fgsmobileidentity.suci.mncdigit1 = 9;
+ mm_msg->registration_request.fgsmobileidentity.suci.mncdigit2 = 9;
+ mm_msg->registration_request.fgsmobileidentity.suci.mncdigit3 = 0xf;
+ mm_msg->registration_request.fgsmobileidentity.suci.mccdigit1 = 2;
+ mm_msg->registration_request.fgsmobileidentity.suci.mccdigit2 = 0;
+ mm_msg->registration_request.fgsmobileidentity.suci.mccdigit3 = 8;
+ mm_msg->registration_request.fgsmobileidentity.suci.schemeoutput = 0x4778;
+```
+ - USIM_API_K and OPc keys are hardcoded at the beginning of the file:
+```bash
+// USIM_API_K: fe c8 6b a6 eb 70 7e d0 89 05 75 7b 1b b4 4b 8f
+uint8_t k[16] = {0xfe, 0xc8, 0x6b, 0xa6, 0xeb, 0x70, 0x7e, 0xd0, 0x89, 0x05, 0x75, 0x7b, 0x1b, 0xb4, 0x4b, 0x8f};
+// OPC: c4 24 49 36 3b ba d0 2b 66 d1 6b c9 75 d7 7c c1
+const uint8_t opc[16] = {0xc4, 0x24, 0x49, 0x36, 0x3b, 0xba, 0xd0, 0x2b, 0x66, 0xd1, 0x6b, 0xc9, 0x75, 0xd7, 0x7c, 0xc1};
+```
+- The NSSAI (*Network Slice Assistance Information*) and DNN (*Data Network Name*) are hardcoded in function *generatePduSessionEstablishRequest()*
+```bash
+ uint8_t nssai[]={1,0,0,1}; //Corresponding to SST:1, SD:1
+ uint8_t dnn[4]={0x4,0x6f,0x61,0x69}; //Corresponding to dnn:"oai"
+```
+For interoperability with OAI or other CNs, it should be ensured that the configuration of the aforementioned parameters match the configuration of the corresponding subscribed user at the core network.
+Hardcoding of the USIM information will soon be substituted with parsing those parameters from a configuration file.
+
+## 2.2 Execution of SA scenario
+
+The order of starting the different components should be the same as the one described in section 1.3.
+
+ - To launch the gNB:
+ ```bash
+ sudo RFSIMULATOR=server ./nr-softmodem -O ../../../targets/PROJECTS/GENERIC-NR-5GC/CONF/gnb.sa.band78.fr1.106PRB.usrpb210.conf --rfsim --sa
+ ```
+- To launch the OAI UE:
+ ```bash
+sudo RFSIMULATOR=127.0.0.1 ./nr-uesoftmodem -r 106 --numerology 1 --band 78 -C 3619200000 --rfsim --sa --nokrnmod
+```
+The IP address at the execution command of the OAI UE corresponds to the target IP of the gNB host that the RFSIMULATOR at the UE will connect to. In the above example, we assume that the gNB and UE are running on the same host so the specified address (127.0.0.1) is the one of the loopback interface.
diff --git a/doc/TESTING_GNB_W_COTS_UE.md b/doc/TESTING_GNB_W_COTS_UE.md
index 5f9299f0ef..84f43bfc27 100644
--- a/doc/TESTING_GNB_W_COTS_UE.md
+++ b/doc/TESTING_GNB_W_COTS_UE.md
@@ -44,6 +44,7 @@ Our code might not work with all 5G phones yet, but we are constantly improving
* Oppo Reno 5G
* Samsung A90 5G
+* Samsung A42 5G
* Google Pixel 5G (note1)
* Simcom SIMCOM8200EA
* Quectel RM500Q-GL
diff --git a/doc/testing_gnb_w_cots_ue_resources/enb.conf b/doc/testing_gnb_w_cots_ue_resources/enb.conf
index 35249aac25..a6bbd98bda 100755
--- a/doc/testing_gnb_w_cots_ue_resources/enb.conf
+++ b/doc/testing_gnb_w_cots_ue_resources/enb.conf
@@ -238,7 +238,7 @@ MACRLCs = (
THREAD_STRUCT = (
{
parallel_config = "PARALLEL_RU_L1_TRX_SPLITaaaaaa";
- worker_config = "ENABLE";
+ worker_config = "WORKER_ENABLE";
}
);
diff --git a/docker/Dockerfile.lteRU.rhel8.2 b/docker/Dockerfile.lteRU.rhel8.2
new file mode 100644
index 0000000000..35078de007
--- /dev/null
+++ b/docker/Dockerfile.lteRU.rhel8.2
@@ -0,0 +1,99 @@
+#/*
+# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+# * contributor license agreements. See the NOTICE file distributed with
+# * this work for additional information regarding copyright ownership.
+# * The OpenAirInterface Software Alliance licenses this file to You under
+# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+# * except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.openairinterface.org/?page_id=698
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *-------------------------------------------------------------------------------
+# * For more information about the OpenAirInterface (OAI) Software Alliance:
+# * contact@openairinterface.org
+# */
+#---------------------------------------------------------------------
+#
+# Dockerfile for the Open-Air-Interface BUILD service
+# Valid for RHEL8
+#
+#---------------------------------------------------------------------
+
+FROM ran-build:latest AS ru-build
+
+RUN rm -Rf /oai-ran
+WORKDIR /oai-ran
+COPY . .
+
+#run build_oai to build the target image
+RUN /bin/sh oaienv && \
+ cd cmake_targets && \
+ mkdir -p log && \
+ ./build_oai --RU --ninja -w USRP --verbose-ci
+
+RUN yum install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
+
+#start from scratch for target executable
+FROM registry.access.redhat.com/ubi8/ubi:latest as oai-lte-ru
+ENV TZ=Europe/Paris
+
+RUN yum update -y && \
+ yum install -y --enablerepo="ubi-8-codeready-builder" \
+ tzdata \
+ atlas \
+ net-tools \
+ iputils \
+ iproute && \
+ echo "/usr/local/lib" > /etc/ld.so.conf.d/local-lib.conf && \
+ echo "/usr/local/lib64" >> /etc/ld.so.conf.d/local-lib.conf
+
+WORKDIR /opt/oai-lte-ru/bin
+COPY --from=ru-build /oai-ran/targets/bin/oairu.Rel15 .
+COPY --from=ru-build /oai-ran/docker/scripts/lte_ru_entrypoint.sh entrypoint.sh
+
+WORKDIR /usr/local/lib/
+COPY --from=ru-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so .
+COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
+
+# Copying from the ran-build image the USRP needed packages
+COPY --from=ru-build /lib64/libconfig.so.9 /lib64
+COPY --from=ru-build /lib64/libblas.so.3 /lib64
+COPY --from=ru-build /lib64/liblapack.so.3 /lib64
+COPY --from=ru-build /lib64/liblapacke.so.3 /lib64
+COPY --from=ru-build /lib64/libboost_chrono.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_date_time.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_filesystem.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_program_options.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_serialization.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_thread.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_system.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_unit_test_framework.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_atomic.so.1.66.0 /lib64
+COPY --from=ru-build /lib64/libboost_timer.so.1.66.0 /lib64
+COPY --from=ru-build /usr/local/lib64/libuhd.so.4.0.0 /usr/local/lib64
+
+RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \
+ ldconfig
+
+# Copy the relevant configuration files for RRU
+WORKDIR /opt/oai-lte-ru/etc
+COPY --from=ru-build /oai-ran/docker/etc/rru* ./
+
+WORKDIR /opt/oai-lte-ru
+
+ENTRYPOINT ["/opt/oai-lte-ru/bin/entrypoint.sh"]
+CMD ["/opt/oai-lte-ru/bin/oairu.Rel15", "-O", "/opt/oai-lte-ru/etc/rru.conf"]
diff --git a/docker/Dockerfile.lteRU.ubuntu18 b/docker/Dockerfile.lteRU.ubuntu18
new file mode 100644
index 0000000000..381d63d9f3
--- /dev/null
+++ b/docker/Dockerfile.lteRU.ubuntu18
@@ -0,0 +1,94 @@
+#/*
+# * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+# * contributor license agreements. See the NOTICE file distributed with
+# * this work for additional information regarding copyright ownership.
+# * The OpenAirInterface Software Alliance licenses this file to You under
+# * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+# * except in compliance with the License.
+# * You may obtain a copy of the License at
+# *
+# * http://www.openairinterface.org/?page_id=698
+# *
+# * Unless required by applicable law or agreed to in writing, software
+# * distributed under the License is distributed on an "AS IS" BASIS,
+# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# * See the License for the specific language governing permissions and
+# * limitations under the License.
+# *-------------------------------------------------------------------------------
+# * For more information about the OpenAirInterface (OAI) Software Alliance:
+# * contact@openairinterface.org
+# */
+#---------------------------------------------------------------------
+#
+# Dockerfile for the Open-Air-Interface BUILD service
+# Valid for Ubuntu 18.04
+#
+#---------------------------------------------------------------------
+
+FROM ran-build:latest AS ru-build
+
+RUN rm -Rf /oai-ran
+WORKDIR /oai-ran
+COPY . .
+
+#run build_oai to build the target image
+RUN /bin/sh oaienv && \
+ cd cmake_targets && \
+ mkdir -p log && \
+ ./build_oai --RU --ninja -w USRP --verbose-ci
+
+RUN apt-get install -y python3-pip && \
+ pip3 install --ignore-installed pyyaml && \
+ python3 ./docker/scripts/generateTemplate.py ./docker/scripts/enb_parameters.yaml
+
+#start from scratch for target executable
+FROM ubuntu:bionic as oai-lte-ru
+ENV DEBIAN_FRONTEND=noninteractive
+ENV TZ=Europe/Paris
+
+RUN apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get upgrade --yes && \
+ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
+ tzdata \
+ software-properties-common \
+ libblas3 \
+ libatlas3-base \
+ libconfig9 \
+ net-tools \
+ iputils-ping \
+ iproute2 && \
+ # Install UHD driver from ettus ppa
+ # At time of writing, it is 3.14
+ add-apt-repository ppa:ettusresearch/uhd --yes && \
+ apt-get update && \
+ DEBIAN_FRONTEND=noninteractive apt-get install --yes \
+ python \
+ libusb-1.0-0 \
+ libuhd003 \
+ uhd-host && \
+ rm -rf /var/lib/apt/lists/*
+
+WORKDIR /opt/oai-lte-ru/bin
+COPY --from=ru-build /oai-ran/targets/bin/oairu.Rel15 .
+COPY --from=ru-build /oai-ran/docker/scripts/lte_ru_entrypoint.sh entrypoint.sh
+
+WORKDIR /usr/local/lib/
+COPY --from=ru-build /oai-ran/targets/bin/liboai_eth_transpro.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libtcp_bridge_oai.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/librfsimulator.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/liboai_usrpdevif.so.Rel15 .
+COPY --from=ru-build /oai-ran/targets/bin/libparams_libconfig.so .
+COPY --from=ru-build /oai-ran/cmake_targets/ran_build/build/libdfts.so .
+RUN /bin/bash -c "ln -s /usr/local/lib/liboai_eth_transpro.so.Rel15 /usr/local/lib/liboai_transpro.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/liboai_usrpdevif.so.Rel15 /usr/local/lib/liboai_device.so" && \
+ /bin/bash -c "ln -s /usr/local/lib/librfsimulator.so.Rel15 /usr/local/lib/librfsimulator.so" && \
+ ldconfig
+
+# Copy the relevant configuration files for RRU
+WORKDIR /opt/oai-lte-ru/etc
+COPY --from=ru-build /oai-ran/docker/etc/rru* ./
+
+WORKDIR /opt/oai-lte-ru
+
+ENTRYPOINT ["/opt/oai-lte-ru/bin/entrypoint.sh"]
+CMD ["/opt/oai-lte-ru/bin/oairu.Rel15", "-O", "/opt/oai-lte-ru/etc/rru.conf"]
diff --git a/docker/scripts/enb_entrypoint.sh b/docker/scripts/enb_entrypoint.sh
index dbe97360f6..6810a86416 100755
--- a/docker/scripts/enb_entrypoint.sh
+++ b/docker/scripts/enb_entrypoint.sh
@@ -11,6 +11,8 @@ if [[ -v USE_FDD_DU ]]; then ln -s $PREFIX/etc/du.fdd.conf $PREFIX/etc/enb.conf;
if [[ -v USE_FDD_MONO ]]; then ln -s $PREFIX/etc/enb.fdd.conf $PREFIX/etc/enb.conf; fi
if [[ -v USE_TDD_MONO ]]; then ln -s $PREFIX/etc/enb.tdd.conf $PREFIX/etc/enb.conf; fi
if [[ -v USE_FDD_FAPI_RCC ]]; then ln -s $PREFIX/etc/rcc.nfapi.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_FDD_IF4P5_RCC ]]; then ln -s $PREFIX/etc/rcc.if4p5.fdd.conf $PREFIX/etc/enb.conf; fi
+if [[ -v USE_TDD_IF4P5_RCC ]]; then ln -s $PREFIX/etc/rcc.if4p5.tdd.conf $PREFIX/etc/enb.conf; fi
if [[ -v USE_FDD_RRU ]]; then ln -s $PREFIX/etc/rru.fdd.conf $PREFIX/etc/enb.conf; fi
if [[ -v USE_TDD_RRU ]]; then ln -s $PREFIX/etc/rru.tdd.conf $PREFIX/etc/enb.conf; fi
diff --git a/docker/scripts/enb_parameters.yaml b/docker/scripts/enb_parameters.yaml
index d115d177ab..749600f47d 100644
--- a/docker/scripts/enb_parameters.yaml
+++ b/docker/scripts/enb_parameters.yaml
@@ -25,7 +25,7 @@
dest_dir: docker/etc
- configurations:
- - filePrefix: cu
+ - filePrefix: cu.band7.tm1.25PRB
outputfilename: "cu.fdd.conf"
config:
- key: Active_eNBs
@@ -68,7 +68,7 @@
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
- - filePrefix: du
+ - filePrefix: du.band7.tm1.25PRB
outputfilename: "du.fdd.conf"
config:
- key: Active_eNBs
@@ -248,3 +248,89 @@
- key: ENB_IPV4_ADDRESS_FOR_X2C
env: "@F1_CU_IP_ADDRESS@"
+ - filePrefix: "rcc.band7.tm1.if4p5.lo.25PRB"
+ outputfilename: "rcc.if4p5.fdd.conf"
+ config:
+ - key: Active_eNBs
+ env: "@ENB_NAME@"
+ - key: eNB_name
+ env: "@ENB_NAME@"
+ - key: plmn_list
+ env:
+ mcc: "@MCC@"
+ mnc: "@MNC@"
+ mnc_length: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: eutra_band
+ env: "@UTRA_BAND_ID@"
+ - key: downlink_frequency
+ env: "@DL_FREQUENCY_IN_MHZ@000000"
+ - key: uplink_frequency_offset
+ env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
+ - key: Nid_cell
+ env: "@NID_CELL@"
+ - key: N_RB_DL
+ env: "@NB_PRB@"
+ - key: ipv4
+ env: "@MME_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1_MME
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1_MME
+ env: "@RCC_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1U
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1U
+ env: "@RCC_IP_ADDRESS@"
+ - key: ENB_IPV4_ADDRESS_FOR_X2C
+ env: "@RCC_IP_ADDRESS@"
+ - key: local_if_name
+ env: "@IF4P5_IF_NAME@"
+ - key: remote_address
+ env: "@IF4P5_RRU_IP_ADDRESS@"
+ - key: local_address
+ env: "@IF4P5_RCC_IP_ADDRESS@"
+
+ - filePrefix: "rcc.band40.tm1.25PRB"
+ outputfilename: "rcc.if4p5.tdd.conf"
+ config:
+ - key: Active_eNBs
+ env: "@ENB_NAME@"
+ - key: eNB_name
+ env: "@ENB_NAME@"
+ - key: plmn_list
+ env:
+ mcc: "@MCC@"
+ mnc: "@MNC@"
+ mnc_length: "@MNC_LENGTH@"
+ - key: tracking_area_code
+ env: "@TAC@"
+ - key: eutra_band
+ env: "@UTRA_BAND_ID@"
+ - key: downlink_frequency
+ env: "@DL_FREQUENCY_IN_MHZ@000000"
+ - key: uplink_frequency_offset
+ env: "@UL_FREQUENCY_OFFSET_IN_MHZ@000000"
+ - key: Nid_cell
+ env: "@NID_CELL@"
+ - key: N_RB_DL
+ env: "@NB_PRB@"
+ - key: ipv4
+ env: "@MME_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1_MME
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1_MME
+ env: "@RCC_S1C_IP_ADDRESS@"
+ - key: ENB_INTERFACE_NAME_FOR_S1U
+ env: "@RCC_IF_NAME@"
+ - key: ENB_IPV4_ADDRESS_FOR_S1U
+ env: "@RCC_IP_ADDRESS@"
+ - key: ENB_IPV4_ADDRESS_FOR_X2C
+ env: "@RCC_IP_ADDRESS@"
+ - key: local_if_name
+ env: "@IF4P5_IF_NAME@"
+ - key: remote_address
+ env: "@IF4P5_RRU_IP_ADDRESS@"
+ - key: local_address
+ env: "@IF4P5_RCC_IP_ADDRESS@"
+
diff --git a/docker/scripts/generateTemplate.py b/docker/scripts/generateTemplate.py
index 418476d395..5ce0d146e5 100644
--- a/docker/scripts/generateTemplate.py
+++ b/docker/scripts/generateTemplate.py
@@ -39,20 +39,24 @@ def main():
for config in data[1]["configurations"]:
filePrefix = config["filePrefix"]
outputfilename = config["outputfilename"]
+ print('================================================')
print('filePrefix = ' + filePrefix)
print('outputfilename = ' + outputfilename)
for inputfile in dir:
if inputfile.find(filePrefix) >=0:
- prefix_outputfile = {"cu": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
- "du": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ prefix_outputfile = {"cu.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "du.band7.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rru.fdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rru.tdd": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"enb.band7.tm1.25PRB.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"enb.band40.tm1.25PRB.FairScheduler.usrpb210": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"rcc.band7.tm1.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "rcc.band7.tm1.if4p5.lo.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
+ "rcc.band40.tm1.25PRB": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue.nfapi": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}',
"ue_sim_ci": f'{data[0]["paths"]["dest_dir"]}/{outputfilename}'
}
+ print('inputfile = ' + inputfile)
if filePrefix in prefix_outputfile:
outputfile1 = prefix_outputfile[filePrefix]
diff --git a/docker/scripts/lte_ru_entrypoint.sh b/docker/scripts/lte_ru_entrypoint.sh
new file mode 100755
index 0000000000..f466e25ec2
--- /dev/null
+++ b/docker/scripts/lte_ru_entrypoint.sh
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+set -euo pipefail
+
+PREFIX=/opt/oai-lte-ru
+
+# Based another env var, pick one template to use
+if [[ -v USE_FDD_RRU ]]; then ln -s $PREFIX/etc/rru.fdd.conf $PREFIX/etc/rru.conf; fi
+if [[ -v USE_TDD_RRU ]]; then ln -s $PREFIX/etc/rru.tdd.conf $PREFIX/etc/rru.conf; fi
+
+# Only this template will be manipulated
+CONFIG_FILES=`ls $PREFIX/etc/rru.conf || true`
+
+for c in ${CONFIG_FILES}; do
+ # grep variable names (format: ${VAR}) from template to be rendered
+ VARS=$(grep -oP '@[a-zA-Z0-9_]+@' ${c} | sort | uniq | xargs)
+
+ # create sed expressions for substituting each occurrence of ${VAR}
+ # with the value of the environment variable "VAR"
+ EXPRESSIONS=""
+ for v in ${VARS}; do
+ NEW_VAR=`echo $v | sed -e "s#@##g"`
+ if [[ "${!NEW_VAR}x" == "x" ]]; then
+ echo "Error: Environment variable '${NEW_VAR}' is not set." \
+ "Config file '$(basename $c)' requires all of $VARS."
+ exit 1
+ fi
+ EXPRESSIONS="${EXPRESSIONS};s|${v}|${!NEW_VAR}|g"
+ done
+ EXPRESSIONS="${EXPRESSIONS#';'}"
+
+ # render template and inline replace config file
+ sed -i "${EXPRESSIONS}" ${c}
+done
+
+# Load the USRP binaries
+if [[ -v USE_B2XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t b2xx
+elif [[ -v USE_X3XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t x3xx
+elif [[ -v USE_N3XX ]]; then
+ /usr/lib/uhd/utils/uhd_images_downloader.py -t n3xx
+fi
+
+echo "=================================="
+echo "== Starting eNB soft modem"
+if [[ -v USE_ADDITIONAL_OPTIONS ]]; then
+ echo "Additional option(s): ${USE_ADDITIONAL_OPTIONS}"
+ new_args=()
+ while [[ $# -gt 0 ]]; do
+ new_args+=("$1")
+ shift
+ done
+ for word in ${USE_ADDITIONAL_OPTIONS}; do
+ new_args+=("$word")
+ done
+ echo "${new_args[@]}"
+ exec "${new_args[@]}"
+else
+ echo "$@"
+ exec "$@"
+fi
diff --git a/executables/main-fs6.c b/executables/main-fs6.c
index 5283ce5eaa..438edb4044 100644
--- a/executables/main-fs6.c
+++ b/executables/main-fs6.c
@@ -750,7 +750,7 @@ void phy_procedures_eNB_uespec_RX_fromsplit(uint8_t *bufferZone, int nbBlocks,PH
recvFs6Ul(bufferZone, nbBlocks, eNB, ul_propa);
// dirty memory allocation in OAI...
- for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++)
+ for (int i = 0; i < NUMBER_OF_UCI_MAX; i++)
if ( eNB->uci_vars[i].frame == proc->frame_rx &&
eNB->uci_vars[i].subframe == proc->subframe_rx )
eNB->uci_vars[i].active=0;
@@ -1145,7 +1145,7 @@ void appendFs6DLUEcch(uint8_t *bufferZone, PHY_VARS_eNB *eNB, int frame, int sub
commonUDP_t *newUDPheader=(commonUDP_t *) firstFreeByte;
bool first_UE=true;
- for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
+ for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
LTE_eNB_UCI *uci = &(eNB->uci_vars[i]);
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
diff --git a/executables/main-ocp.c b/executables/main-ocp.c
index 962b738e25..c5f18419a3 100644
--- a/executables/main-ocp.c
+++ b/executables/main-ocp.c
@@ -205,7 +205,6 @@ void init_eNB_afterRU(void) {
for (int inst=0; instframe_parms.nb_antennas_rx = 0;
eNB->frame_parms.nb_antennas_tx = 0;
eNB->prach_vars.rxsigF[0] = (int16_t **)malloc16(64*sizeof(int16_t *));
@@ -231,12 +230,26 @@ void init_eNB_afterRU(void) {
for (int ce_level=0; ce_level<4; ce_level++)
eNB->prach_vars_br.rxsigF[ce_level][aa] = eNB->RU_list[ru_id]->prach_rxsigF_br[ce_level][i];
- eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
}
}
- AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 4, "");
- AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 4, "");
+
+ AssertFatal( eNB->frame_parms.nb_antennas_rx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
+ AssertFatal( eNB->frame_parms.nb_antennas_tx > 0 && eNB->frame_parms.nb_antennas_rx < 5, "");
+
+ phy_init_lte_eNB(eNB,0,0);
+
+ // need to copy rxdataF after L1 variables are allocated
+ for (int inst=0; instnum_RU; ru_id++) {
+ for (int i=0; iRU_list[ru_id]->nb_rx; aa++,i++)
+ eNB->common_vars.rxdataF[aa] = eNB->RU_list[ru_id]->common.rxdataF[i];
+ }
+ }
+ }
+
LOG_I(PHY,"inst %d, CC_id %d : nb_antennas_rx %d\n",inst,CC_id,eNB->frame_parms.nb_antennas_rx);
init_transport(eNB);
//init_precoding_weights(RC.eNB[inst][CC_id]);
@@ -803,7 +816,7 @@ int init_rf(RU_t *ru) {
pthread_setname_np(pthread_self(),name);
return ret;
}
-
+
void ocp_init_RU(RU_t *ru, char *rf_config_file, int send_dmrssync) {
PHY_VARS_eNB *eNB0= (PHY_VARS_eNB *)NULL;
int i;
diff --git a/executables/main_ru.c b/executables/main_ru.c
new file mode 100644
index 0000000000..93a580560e
--- /dev/null
+++ b/executables/main_ru.c
@@ -0,0 +1,382 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+/*! \file oairu.c
+ * \brief Top-level threads for radio-unit
+ * \author R. Knopp
+ * \date 2020
+ * \version 0.1
+ * \company Eurecom
+ * \email: knopp@eurecom.fr
+ * \note
+ * \warning
+ */
+
+
+#define _GNU_SOURCE /* See feature_test_macros(7) */
+#include
+
+
+
+
+#include "assertions.h"
+#include "PHY/types.h"
+
+#include "PHY/defs_RU.h"
+#include "common/config/config_userapi.h"
+#include "common/utils/load_module_shlib.h"
+
+
+#include "../../ARCH/COMMON/common_lib.h"
+#include "../../ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
+
+
+#include "PHY/phy_vars.h"
+#include "SCHED/sched_common_vars.h"
+#include "PHY/TOOLS/phy_scope_interface.h"
+#include "common/utils/LOG/log.h"
+#include "common/utils/LOG/vcd_signal_dumper.h"
+#include "PHY/INIT/phy_init.h"
+#include "openair2/ENB_APP/enb_paramdef.h"
+#include "system.h"
+
+#include
+#include
+#include
+
+static int DEFBANDS[] = {7};
+static int DEFENBS[] = {0};
+static int DEFBFW[] = {0x00007fff};
+
+THREAD_STRUCT thread_struct;
+
+pthread_cond_t sync_cond;
+pthread_mutex_t sync_mutex;
+int sync_var=-1; //!< protected by mutex \ref sync_mutex.
+int config_sync_var=-1;
+
+volatile int oai_exit = 0;
+uint16_t sf_ahead = 4;
+RU_t ru_m;
+
+
+extern void init_RU0(RU_t *ru,int ru_id,char *rf_config_file, int send_dmrssync);
+extern void init_RU_proc(RU_t *ru);
+extern void kill_RU_proc(RU_t *ru);
+extern void set_function_spec_param(RU_t *ru);
+
+int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
+
+
+void nfapi_setmode(nfapi_mode_t nfapi_mode) { return; }
+void exit_function(const char *file, const char *function, const int line, const char *s) {
+
+ if (s != NULL) {
+ printf("%s:%d %s() Exiting OAI softmodem: %s\n",file,line, function, s);
+ }
+ close_log_mem();
+ oai_exit = 1;
+
+ if (ru_m.rfdevice.trx_end_func) {
+ ru_m.rfdevice.trx_end_func(&ru_m.rfdevice);
+ ru_m.rfdevice.trx_end_func = NULL;
+ }
+
+ if (ru_m.ifdevice.trx_end_func) {
+ ru_m.ifdevice.trx_end_func(&ru_m.ifdevice);
+ ru_m.ifdevice.trx_end_func = NULL;
+ }
+
+ pthread_mutex_destroy(ru_m.ru_mutex);
+ pthread_cond_destroy(ru_m.ru_cond);
+ sleep(1); //allow lte-softmodem threads to exit first
+ exit(1);
+}
+
+
+static void get_options(void) {
+ CONFIG_SETRTFLAG(CONFIG_NOEXITONHELP);
+ get_common_options(SOFTMODEM_ENB_BIT );
+ CONFIG_CLEARRTFLAG(CONFIG_NOEXITONHELP);
+
+ //RCConfig();
+
+}
+
+
+
+
+
+extern void phy_free_RU(RU_t *);
+
+nfapi_mode_t nfapi_getmode(void) {
+ return(NFAPI_MODE_PNF);
+}
+
+void oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind) {
+
+ AssertFatal(1==0,"This is bad ... please check why we get here\n");
+}
+
+void wait_eNBs(void){ return; }
+
+uint64_t downlink_frequency[MAX_NUM_CCs][4];
+
+
+int main ( int argc, char **argv )
+{
+
+ if ( load_configmodule(argc,argv,0) == NULL) {
+ exit_fun("[SOFTMODEM] Error, configuration module init failed\n");
+ }
+
+ logInit();
+ printf("Reading in command-line options\n");
+ get_options ();
+
+ if (CONFIG_ISFLAGSET(CONFIG_ABORT) ) {
+ fprintf(stderr,"Getting configuration failed\n");
+ exit(-1);
+ }
+
+#if T_TRACER
+ T_Config_Init();
+#endif
+ printf("configuring for RRU\n");
+
+#ifndef PACKAGE_VERSION
+# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
+#endif
+ LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
+
+ /* Read configuration */
+
+ printf("About to Init RU threads\n");
+
+
+ RU_t *ru=&ru_m;
+
+ paramdef_t RUParams[] = RUPARAMS_DESC;
+ paramlist_def_t RUParamList = {CONFIG_STRING_RU_LIST,NULL,0};
+ config_getlist( &RUParamList,RUParams,sizeof(RUParams)/sizeof(paramdef_t), NULL);
+
+ int j=0;
+ uint64_t ru_mask=1;
+ pthread_mutex_t ru_mutex; pthread_mutex_init(&ru_mutex,NULL);
+ pthread_cond_t ru_cond; pthread_cond_init(&ru_cond,NULL);
+
+ ru->ru_mask= &ru_mask;
+ ru->ru_mutex = &ru_mutex;
+ ru->ru_cond = &ru_cond;
+
+ ru->if_timing = synch_to_ext_device;
+ ru->num_eNB = 0;
+ ru->has_ctrl_prt = 1;
+ if (config_isparamset(RUParamList.paramarray[j], RU_SDR_ADDRS)) {
+ ru->openair0_cfg.sdr_addrs = strdup(*(RUParamList.paramarray[j][RU_SDR_ADDRS].strptr));
+ }
+
+ if (config_isparamset(RUParamList.paramarray[j], RU_SDR_CLK_SRC)) {
+ if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "internal") == 0) {
+ ru->openair0_cfg.clock_source = internal;
+ LOG_D(PHY, "RU clock source set as internal\n");
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "external") == 0) {
+ ru->openair0_cfg.clock_source = external;
+ LOG_D(PHY, "RU clock source set as external\n");
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr), "gpsdo") == 0) {
+ ru->openair0_cfg.clock_source = gpsdo;
+ LOG_D(PHY, "RU clock source set as gpsdo\n");
+ } else {
+ LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
+ }
+ }
+ else {
+ ru->openair0_cfg.clock_source = unset;
+ }
+
+ if (config_isparamset(RUParamList.paramarray[j], RU_SDR_TME_SRC)) {
+ if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "internal") == 0) {
+ ru->openair0_cfg.time_source = internal;
+ LOG_D(PHY, "RU time source set as internal\n");
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "external") == 0) {
+ ru->openair0_cfg.time_source = external;
+ LOG_D(PHY, "RU time source set as external\n");
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_SDR_TME_SRC].strptr), "gpsdo") == 0) {
+ ru->openair0_cfg.time_source = gpsdo;
+ LOG_D(PHY, "RU time source set as gpsdo\n");
+ } else {
+ LOG_E(PHY, "Erroneous RU time source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
+ }
+ }
+ else {
+ ru->openair0_cfg.time_source = unset;
+ }
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
+ if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
+ AssertFatal(1==0,"IF_NAME is required\n");
+ } else {
+ ru->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
+ ru->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
+ ru->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
+ ru->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
+ ru->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
+
+ // Check if control port set
+ if (!(config_isparamset(RUParamList.paramarray[j],RU_REMOTE_PORTC_IDX)) ) {
+ printf("Removing control port for RU %d\n",j);
+ ru->has_ctrl_prt = 0;
+ } else {
+ ru->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
+ ru->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
+ printf(" Control port %u \n",ru->eth_params.my_portc);
+ }
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF5;
+ ru->eth_params.transp_preference = ETH_UDP_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF5 (udp)\n",j);
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF5;
+ ru->eth_params.transp_preference = ETH_RAW_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF5 (raw)\n",j);
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF4p5;
+ ru->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF4p5 (udp)\n",j);
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
+ ru->if_south = LOCAL_RF;
+ ru->function = NGFI_RRU_IF4p5;
+ ru->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
+ printf("Setting function for RU %d to NGFI_RRU_IF4p5 (raw)\n",j);
+ }
+
+ printf("RU %d is_slave=%s\n",j,*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr));
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru->is_slave=1;
+ else ru->is_slave=0;
+
+ printf("RU %d ota_sync_enabled=%s\n",j,*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr));
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_OTA_SYNC_ENABLE_IDX].strptr), "yes") == 0) ru->ota_sync_enable=1;
+ else ru->ota_sync_enable=0;
+ }
+
+ ru->max_pdschReferenceSignalPower = *(RUParamList.paramarray[j][RU_MAX_RS_EPRE_IDX].uptr);;
+ ru->max_rxgain = *(RUParamList.paramarray[j][RU_MAX_RXGAIN_IDX].uptr);
+ ru->num_bands = RUParamList.paramarray[j][RU_BAND_LIST_IDX].numelt;
+ /* sf_extension is in unit of samples for 30.72MHz here, has to be scaled later */
+ ru->sf_extension = *(RUParamList.paramarray[j][RU_SF_EXTENSION_IDX].uptr);
+
+ for (int i=0; inum_bands; i++) ru->band[i] = RUParamList.paramarray[j][RU_BAND_LIST_IDX].iptr[i];
+ } //strcmp(local_rf, "yes") == 0
+ else {
+ printf("RU %d: Transport %s\n",j,*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr));
+ ru->eth_params.local_if_name = strdup(*(RUParamList.paramarray[j][RU_LOCAL_IF_NAME_IDX].strptr));
+ ru->eth_params.my_addr = strdup(*(RUParamList.paramarray[j][RU_LOCAL_ADDRESS_IDX].strptr));
+ ru->eth_params.remote_addr = strdup(*(RUParamList.paramarray[j][RU_REMOTE_ADDRESS_IDX].strptr));
+ ru->eth_params.my_portc = *(RUParamList.paramarray[j][RU_LOCAL_PORTC_IDX].uptr);
+ ru->eth_params.remote_portc = *(RUParamList.paramarray[j][RU_REMOTE_PORTC_IDX].uptr);
+ ru->eth_params.my_portd = *(RUParamList.paramarray[j][RU_LOCAL_PORTD_IDX].uptr);
+ ru->eth_params.remote_portd = *(RUParamList.paramarray[j][RU_REMOTE_PORTD_IDX].uptr);
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp") == 0) {
+ ru->if_south = REMOTE_IF5;
+ ru->function = NGFI_RAU_IF5;
+ ru->eth_params.transp_preference = ETH_UDP_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw") == 0) {
+ ru->if_south = REMOTE_IF5;
+ ru->function = NGFI_RAU_IF5;
+ ru->eth_params.transp_preference = ETH_RAW_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "udp_if4p5") == 0) {
+ ru->if_south = REMOTE_IF4p5;
+ ru->function = NGFI_RAU_IF4p5;
+ ru->eth_params.transp_preference = ETH_UDP_IF4p5_MODE;
+ } else if (strcmp(*(RUParamList.paramarray[j][RU_TRANSPORT_PREFERENCE_IDX].strptr), "raw_if4p5") == 0) {
+ ru->if_south = REMOTE_IF4p5;
+ ru->function = NGFI_RAU_IF4p5;
+ ru->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
+ }
+
+ if (strcmp(*(RUParamList.paramarray[j][RU_IS_SLAVE_IDX].strptr), "yes") == 0) ru->is_slave=1;
+ else ru->is_slave=0;
+ } /* strcmp(local_rf, "yes") != 0 */
+
+ ru->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
+ ru->nb_rx = *(RUParamList.paramarray[j][RU_NB_RX_IDX].uptr);
+ ru->att_tx = *(RUParamList.paramarray[j][RU_ATT_TX_IDX].uptr);
+ ru->att_rx = *(RUParamList.paramarray[j][RU_ATT_RX_IDX].uptr);
+
+
+ set_worker_conf("WORKER_ENABLE");
+
+ mlockall(MCL_CURRENT | MCL_FUTURE);
+ pthread_cond_init(&sync_cond,NULL);
+ pthread_mutex_init(&sync_mutex, NULL);
+
+ init_RU0(ru,0,get_softmodem_params()->rf_config_file,get_softmodem_params()->send_dmrs_sync);
+ ru->rf_map.card=0;
+ ru->rf_map.chain=(get_softmodem_params()->chain_offset);
+
+ LOG_I(PHY, "Initializing RRU descriptor : (%s,%s,%d)\n", ru_if_types[ru->if_south], NB_timing[ru->if_timing], ru->function);
+ set_function_spec_param(ru);
+ LOG_I(PHY, "Starting ru_thread , is_slave %d, send_dmrs %d\n", ru->is_slave, ru->generate_dmrs_sync);
+ init_RU_proc(ru);
+
+ pthread_mutex_lock(&ru_mutex);
+ while (ru_mask>0)
+ pthread_cond_wait(&ru_cond,&ru_mutex);
+ pthread_mutex_unlock(&ru_mutex);
+ LOG_I(PHY,"RU configured, unlocking threads\n");
+ config_sync_var=0;
+ pthread_mutex_lock(&sync_mutex);
+ sync_var=0;
+ pthread_cond_broadcast(&sync_cond);
+ pthread_mutex_unlock(&sync_mutex);
+
+ while (oai_exit==0) sleep(1);
+ // stop threads
+
+ kill_RU_proc(ru);
+ phy_free_RU(ru);
+
+ free_lte_top();
+ end_configmodule();
+
+ if (ru->rfdevice.trx_end_func) {
+ ru->rfdevice.trx_end_func(&ru->rfdevice);
+ ru->rfdevice.trx_end_func = NULL;
+ }
+
+ if (ru->ifdevice.trx_end_func) {
+ ru->ifdevice.trx_end_func(&ru->ifdevice);
+ ru->ifdevice.trx_end_func = NULL;
+ }
+
+
+
+ logClean();
+ printf("Bye.\n");
+ return 0;
+}
diff --git a/executables/nr-gnb.c b/executables/nr-gnb.c
index 5a2f251750..ea675eba9e 100644
--- a/executables/nr-gnb.c
+++ b/executables/nr-gnb.c
@@ -359,7 +359,7 @@ void *nrL1_stats_thread(void *param) {
AssertFatal(fd!=NULL,"Cannot open ngL1_stats.log\n");
dump_nr_I0_stats(fd,gNB);
dump_pusch_stats(fd,gNB);
- // dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
+ // nr_dump_uci_stats(fd,eNB,eNB->proc.L1_proc_tx.frame_tx);
fclose(fd);
}
return(NULL);
@@ -404,7 +404,6 @@ void init_gNB_Tpool(int inst) {
if(opp_enabled == 1) threadCreate(&proc->process_stats_thread, process_stats_thread,(void *)gNB, "time_meas", -1, OAI_PRIORITY_RT_LOW);
threadCreate(&proc->L1_stats_thread,nrL1_stats_thread,(void*)gNB,"L1_stats",-1,OAI_PRIORITY_RT_LOW);
-
}
@@ -493,8 +492,6 @@ printf("after %p\n", gNB->common_vars.rxdataF[aa]);
}
-
-
void init_gNB(int single_thread_flag,int wait_for_sync) {
int inst;
diff --git a/executables/nr-ru.c b/executables/nr-ru.c
index f4a6510ad7..421ff4ad3e 100644
--- a/executables/nr-ru.c
+++ b/executables/nr-ru.c
@@ -24,14 +24,8 @@
#include
#include
#include
-#include
-#include
-#include
#include
#include
-#include
-#include
-#include
#include
#include
@@ -39,7 +33,6 @@
#include "common/utils/assertions.h"
#include "common/utils/system.h"
-#include "msc.h"
#include "../../ARCH/COMMON/common_lib.h"
#include "../../ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
@@ -50,20 +43,15 @@
#include "PHY/types.h"
#include "PHY/defs_nr_common.h"
#include "PHY/phy_extern.h"
-#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
#include "PHY/INIT/phy_init.h"
-#include "SCHED/sched_eNB.h"
#include "SCHED_NR/sched_nr.h"
#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
-#include "RRC/LTE/rrc_extern.h"
-#include "PHY_INTERFACE/phy_interface.h"
#include "common/utils/LOG/log.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-#include "enb_config.h"
#include
#ifdef SMBV
@@ -112,6 +100,7 @@ void configure_ru(int idx, void *arg);
void configure_rru(int idx, void *arg);
int attach_rru(RU_t *ru);
int connect_rau(RU_t *ru);
+static void NRRCconfig_RU(void);
uint16_t sf_ahead;
uint16_t slot_ahead;
@@ -1837,7 +1826,7 @@ void init_NR_RU(char *rf_config_file)
pthread_cond_init(&RC.ru_cond,NULL);
// read in configuration file)
printf("configuring RU from file\n");
- RCconfig_RU();
+ NRRCconfig_RU();
LOG_I(PHY,"number of L1 instances %d, number of RU %d, number of CPU cores %d\n",RC.nb_nr_L1_inst,RC.nb_RU,get_nprocs());
LOG_D(PHY,"Process RUs RC.nb_RU:%d\n",RC.nb_RU);
@@ -1912,7 +1901,7 @@ void stop_RU(int nb_ru)
/* --------------------------------------------------------*/
/* from here function to use configuration module */
-void RCconfig_RU(void)
+static void NRRCconfig_RU(void)
{
int i = 0, j = 0;
paramdef_t RUParams[] = RUPARAMS_DESC;
@@ -1979,9 +1968,9 @@ void RCconfig_RU(void)
}
else {
LOG_I(PHY,"Setting time source to internal\n");
- RC.ru[j]->openair0_cfg.time_source = internal;
+ RC.ru[j]->openair0_cfg.time_source = internal;
}
-
+
if (strcmp(*(RUParamList.paramarray[j][RU_LOCAL_RF_IDX].strptr), "yes") == 0) {
if ( !(config_isparamset(RUParamList.paramarray[j],RU_LOCAL_IF_NAME_IDX)) ) {
RC.ru[j]->if_south = LOCAL_RF;
@@ -2051,7 +2040,7 @@ void RCconfig_RU(void)
RC.ru[j]->if_south = REMOTE_IF4p5;
RC.ru[j]->function = NGFI_RAU_IF4p5;
RC.ru[j]->eth_params.transp_preference = ETH_RAW_IF4p5_MODE;
- }
+ }
} /* strcmp(local_rf, "yes") != 0 */
RC.ru[j]->nb_tx = *(RUParamList.paramarray[j][RU_NB_TX_IDX].uptr);
diff --git a/executables/nr-softmodem.c b/executables/nr-softmodem.c
index c7e636736b..4727d09b04 100644
--- a/executables/nr-softmodem.c
+++ b/executables/nr-softmodem.c
@@ -163,10 +163,17 @@ int otg_enabled;
uint32_t timing_advance = 0;
uint64_t num_missed_slots=0; // counter for the number of missed slots
+#include
+#include
+
int split73=0;
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
AssertFatal(false, "Must not be called in this context\n");
}
+void sendFs6Ulharq(enum pckType type, int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, int frame, int subframe, uint8_t *harq_ack, uint8_t tdd_mapping_mode, uint16_t tdd_multiplexing_mask, uint16_t rnti, int32_t stat) {
+ AssertFatal(false, "Must not be called in this context\n");
+}
+
extern void reset_opp_meas(void);
extern void print_opp_meas(void);
@@ -363,35 +370,10 @@ int create_gNB_tasks(uint32_t gnb_nb) {
}
}
- if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
+ /*if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
LOG_E(GTPU, "Create task for GTPV1U failed\n");
return -1;
- }
- }
- }
-
- if (AMF_MODE_ENABLED && (get_softmodem_params()->phy_test==0 && get_softmodem_params()->do_ra==1)){
- if (gnb_nb > 0) {
- if(NGAP_CONF_MODE){
- if (itti_create_task (TASK_NGAP, ngap_gNB_task, NULL) < 0) {
- LOG_E(NGAP, "Create task for NGAP failed\n");
- return -1;
- }
- } else {
- LOG_E(NGAP, "Ngap task not created\n");
- }
-
- if(!emulate_rf){
- if (itti_create_task (TASK_UDP, udp_eNB_task, NULL) < 0) {
- LOG_E(UDP_, "Create task for UDP failed\n");
- return -1;
- }
- }
-
- if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
- LOG_E(GTPU, "Create task for GTPV1U failed\n");
- return -1;
- }
+ }*/
}
}
@@ -406,6 +388,13 @@ int create_gNB_tasks(uint32_t gnb_nb) {
LOG_E(NR_RRC, "Create task for NR RRC gNB failed\n");
return -1;
}
+ //Use check on x2ap to consider the NSA scenario and check on AMF_MODE_ENABLED for the SA scenario
+ if(is_x2ap_enabled() || AMF_MODE_ENABLED){
+ if (itti_create_task (TASK_GTPV1_U, &nr_gtpv1u_gNB_task, NULL) < 0) {
+ LOG_E(GTPU, "Create task for GTPV1U failed\n");
+ return -1;
+ }
+ }
}
return 0;
@@ -643,7 +632,6 @@ static void wait_nfapi_init(char *thread_name) {
void init_pdcp(void) {
if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
// pdcp_layer_init();
- // pdcp_layer_init_for_CU();
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1) {
@@ -739,20 +727,12 @@ if(!IS_SOFTMODEM_NOS1)
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
-
- if(IS_SOFTMODEM_NOS1)
- init_pdcp();
-
if (RC.nb_nr_L1_inst > 0)
RCconfig_NR_L1();
// don't create if node doesn't connect to RRC/S1/GTP
AssertFatal(create_gNB_tasks(1) == 0,"cannot create ITTI tasks\n");
-
-
-
-
/* Start the agent. If it is turned off in the configuration, it won't start */
/*
RCconfig_nr_flexran();
diff --git a/executables/nr-ue.c b/executables/nr-ue.c
index 3215bd91d1..10a9ca317b 100644
--- a/executables/nr-ue.c
+++ b/executables/nr-ue.c
@@ -612,7 +612,7 @@ void *UE_thread(void *arg) {
thread_idx = absolute_slot % NR_RX_NB_TH;
int slot_nr = absolute_slot % nb_slot_frame;
notifiedFIFO_elt_t *msgToPush;
- AssertFatal((msgToPush=pullTpool(&freeBlocks,&(get_nrUE_params()->Tpool))) != NULL,"chained list failure");
+ AssertFatal((msgToPush=pullNotifiedFIFO_nothreadSafe(&freeBlocks)) != NULL,"chained list failure");
nr_rxtx_thread_data_t *curMsg=(nr_rxtx_thread_data_t *)NotifiedFifoData(msgToPush);
curMsg->UE=UE;
// update thread index for received subframe
@@ -719,11 +719,13 @@ void *UE_thread(void *arg) {
if (openair0_cfg[0].duplex_mode == duplex_mode_TDD) {
uint8_t tdd_period = mac->phy_config.config_req.tdd_table.tdd_period_in_slots;
+
int nrofUplinkSlots = 0;
if (mac->scc_SIB)
- nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+ nrofUplinkSlots = mac->scc_SIB->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
else if (mac->scc)
- nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+ nrofUplinkSlots = mac->scc->tdd_UL_DL_ConfigurationCommon->pattern1.nrofUplinkSlots;
+
uint8_t num_UL_slots = nrofUplinkSlots + (nrofUplinkSlots != 0);
uint8_t first_tx_slot = tdd_period - num_UL_slots;
diff --git a/executables/nr-uesoftmodem.c b/executables/nr-uesoftmodem.c
index ded2ddcecf..cbc79912a2 100644
--- a/executables/nr-uesoftmodem.c
+++ b/executables/nr-uesoftmodem.c
@@ -82,7 +82,6 @@ unsigned short config_frames[4] = {2,9,11,13};
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
#include "PHY/TOOLS/phy_scope_interface.h"
#include "PHY/TOOLS/nr_phy_scope.h"
-#define NRUE_MAIN
#include
#include "executables/softmodem-common.h"
#include "executables/thread-common.h"
@@ -93,6 +92,7 @@ unsigned short config_frames[4] = {2,9,11,13};
extern const char *duplex_mode[];
THREAD_STRUCT thread_struct;
+nrUE_params_t nrUE_params;
// Thread variables
pthread_cond_t nfapi_sync_cond;
@@ -153,8 +153,9 @@ int transmission_mode = 1;
int numerology = 0;
int oaisim_flag = 0;
int emulate_rf = 0;
-uint32_t N_RB_DL=106;
-char uecap_xer[1024],uecap_xer_in=0;
+uint32_t N_RB_DL = 106;
+char uecap_xer_in = 0;
+char uecap_xer[1024];
/* see file openair2/LAYER2/MAC/main.c for why abstraction_flag is needed
* this is very hackish - find a proper solution
@@ -183,6 +184,7 @@ struct timespec clock_difftime(struct timespec start, struct timespec end) {
void print_difftimes(void) {
LOG_I(HW,"difftimes min = %lu ns ; max = %lu ns\n", min_diff_time.tv_nsec, max_diff_time.tv_nsec);
}
+
int create_tasks_nrue(uint32_t ue_nb) {
LOG_D(NR_RRC, "%s(ue_nb:%d)\n", __FUNCTION__, ue_nb);
itti_wait_ready(1);
@@ -334,8 +336,9 @@ void set_options(int CC_id, PHY_VARS_NR_UE *UE){
LOG_I(PHY, "Set UE frame_type %d\n", fp->frame_type);
}
- LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
fp->N_RB_DL = N_RB_DL;
+
+ LOG_I(PHY, "Set UE N_RB_DL %d\n", N_RB_DL);
LOG_I(PHY, "Set UE nb_rx_antenna %d, nb_tx_antenna %d, threequarter_fs %d\n", fp->nb_antennas_rx, fp->nb_antennas_tx, fp->threequarter_fs);
}
@@ -451,10 +454,6 @@ int main( int argc, char **argv ) {
#endif
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
- RC.nrrrc = (gNB_RRC_INST **)malloc(1*sizeof(gNB_RRC_INST *));
- RC.nrrrc[0] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
- RC.nrrrc[0]->node_type = ngran_gNB;
-
init_NR_UE(1,rrc_config_path);
if(IS_SOFTMODEM_NOS1 || get_softmodem_params()->sa)
init_pdcp();
@@ -490,10 +489,12 @@ int main( int argc, char **argv ) {
nrUE_config->carrier_config.ul_grid_size[nrUE_config->ssb_config.scs_common] = UE[CC_id]->frame_parms.N_RB_DL;
nrUE_config->carrier_config.dl_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<ssb_config.scs_common)))/1000;
nrUE_config->carrier_config.uplink_frequency = (downlink_frequency[0][0] -(6*UE[CC_id]->frame_parms.N_RB_DL*(15000<ssb_config.scs_common)))/1000;
- nrUE_config->cell_config.frame_duplex_type = TDD;
nrUE_config->ssb_table.ssb_offset_point_a = (UE[CC_id]->frame_parms.N_RB_DL - 20)>>1;
-
+ // Initialize values, will be updated upon SIB1 reception
+ nrUE_config->cell_config.frame_duplex_type = TDD;
+ nrUE_config->ssb_table.ssb_mask_list[0].ssb_mask = 0xFFFFFFFF;
+ nrUE_config->ssb_table.ssb_period = 1;
}
nr_init_frame_parms_ue(&UE[CC_id]->frame_parms, nrUE_config,
@@ -530,14 +531,6 @@ int main( int argc, char **argv ) {
// wait for end of program
printf("TYPE TO TERMINATE\n");
- //Don't understand why generation of RRCSetupRequest is called here. It seems wrong
- protocol_ctxt_t ctxt_pP = {0};
- ctxt_pP.enb_flag = ENB_FLAG_NO;
- ctxt_pP.rnti = 0x1234;
- RC.nrrrc = (gNB_RRC_INST **)malloc(1*sizeof(gNB_RRC_INST *));
- RC.nrrrc[0] = (gNB_RRC_INST*)malloc(sizeof(gNB_RRC_INST));
- RC.nrrrc[0]->node_type = ngran_gNB;
- nr_rrc_ue_generate_RRCSetupRequest(ctxt_pP.module_id, 0);
if (create_tasks_nrue(1) < 0) {
printf("cannot create ITTI tasks\n");
exit(-1); // need a softer mode
diff --git a/executables/nr-uesoftmodem.h b/executables/nr-uesoftmodem.h
index 5ef6bffd7e..be3ca2d1a2 100644
--- a/executables/nr-uesoftmodem.h
+++ b/executables/nr-uesoftmodem.h
@@ -72,9 +72,6 @@ extern uint64_t get_nrUE_optmask(void);
extern uint64_t set_nrUE_optmask(uint64_t bitmask);
extern nrUE_params_t *get_nrUE_params(void);
-#ifdef NRUE_MAIN
-nrUE_params_t nrUE_params;
-#endif
// In nr-ue.c
extern int setup_nr_ue_buffers(PHY_VARS_NR_UE **phy_vars_ue, openair0_config_t *openair0_cfg);
diff --git a/executables/softmodem-common.h b/executables/softmodem-common.h
index 7ab1f926c6..b6a2b18215 100644
--- a/executables/softmodem-common.h
+++ b/executables/softmodem-common.h
@@ -89,6 +89,8 @@ extern "C"
#define CONFIG_HLP_EMULATE_RF "Emulated RF enabled(disable by defult)\n"
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
+#define CONFIG_HLP_USRP_THREAD "having extra thead for usrp tx\n"
+
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
@@ -136,7 +138,7 @@ extern int usrp_tx_thread;
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&WAIT_FOR_SYNC, defintval:0, TYPE_INT, 0}, \
{"single-thread-enable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&SINGLE_THREAD_FLAG, defintval:0, TYPE_INT, 0}, \
{"C" , CONFIG_HLP_DLF, 0, u64ptr:&(downlink_frequency[0][0]), defuintval:3619200000, TYPE_UINT64, 0}, \
- {"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:3619200000, TYPE_INT, 0}, \
+ {"CO" , CONFIG_HLP_ULF, 0, iptr:&(uplink_frequency_offset[0][0]), defintval:0, TYPE_INT, 0}, \
{"a" , CONFIG_HLP_CHOFF, 0, iptr:&CHAIN_OFFSET, defintval:0, TYPE_INT, 0}, \
{"d" , CONFIG_HLP_SOFTS, PARAMFLAG_BOOL, uptr:(uint32_t *)&do_forms, defintval:0, TYPE_INT8, 0}, \
{"q" , CONFIG_HLP_STMON, PARAMFLAG_BOOL, iptr:&opp_enabled, defintval:0, TYPE_INT, 0}, \
@@ -257,6 +259,7 @@ extern char *get_softmodem_function(uint64_t *sofmodemfunc_mask_ptr);
extern void set_softmodem_sighandler(void);
extern uint64_t downlink_frequency[MAX_NUM_CCs][4];
extern int32_t uplink_frequency_offset[MAX_NUM_CCs][4];
+extern int usrp_tx_thread;
extern uint16_t sl_ahead;
extern uint16_t sf_ahead;
extern volatile int oai_exit;
diff --git a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
index fc9cd66077..8520a5d162 100644
--- a/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
+++ b/nfapi/open-nFAPI/pnf/public_inc/nfapi_pnf_interface.h
@@ -27,7 +27,6 @@ extern "C" {
#include
#include "nfapi_nr_interface.h"
#include "nfapi_nr_interface_scf.h"
-
#include
#include "openair1/PHY/defs_gNB.h"
diff --git a/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h b/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
new file mode 100644
index 0000000000..f77ffff2eb
--- /dev/null
+++ b/openair1/PHY/CODING/TESTBENCH/coding_unitary_defs.h
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * -------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+#ifndef __CODING_UNITARY_DEFS__h__
+#define __CODING_UNITARY_DEFS__h__
+int oai_exit=0;
+unsigned int NB_UE_INST = 1;
+#include "openair1/PHY/defs_UE.h"
+PHY_VARS_UE ***PHY_vars_UE_g;
+#include "common/ran_context.h"
+RAN_CONTEXT_t RC;
+
+void exit_function(const char* file, const char* function, const int line, const char *s) {
+ const char * msg= s==NULL ? "no comment": s;
+ printf("Exiting at: %s:%d %s(), %s\n", file, line, function, msg);
+ exit(-1);
+}
+
+signed char quantize(double D, double x, unsigned char B) {
+ double qxd;
+ short maxlev;
+ qxd = floor(x / D);
+ maxlev = 1 << (B - 1); //(char)(pow(2,B-1));
+
+ if (qxd <= -maxlev)
+ qxd = -maxlev;
+ else if (qxd >= maxlev)
+ qxd = maxlev - 1;
+
+ return ((char) qxd);
+}
+
+
+#endif
+
diff --git a/openair1/PHY/CODING/TESTBENCH/ldpctest.c b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
index f6769251cd..91c5d59611 100644
--- a/openair1/PHY/CODING/TESTBENCH/ldpctest.c
+++ b/openair1/PHY/CODING/TESTBENCH/ldpctest.c
@@ -26,9 +26,11 @@
#include "assertions.h"
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/CODING/nrLDPC_extern.h"
-#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
+//#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/PHY/CODING/nrLDPC_decoder_LYC/nrLDPC_decoder_LYC.h"
-#define MAX_NUM_DLSCH_SEGMENTS 16
+#include "openair1/PHY/defs_nr_common.h"
+#include "coding_unitary_defs.h"
+
#define MAX_BLOCK_LENGTH 8448
#ifndef malloc16
@@ -81,9 +83,6 @@ typedef struct {
int n_iter_max;
} n_iter_stats_t;
-RAN_CONTEXT_t RC;
-PHY_VARS_UE ***PHY_vars_UE_g;
-uint16_t NB_UE_INST = 1;
nrLDPC_encoderfunc_t encoder_orig;
short lift_size[51]= {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,18,20,22,24,26,28,30,32,36,40,44,48,52,56,60,64,72,80,88,96,104,112,120,128,144,160,176,192,208,224,240,256,288,320,352,384};
@@ -117,7 +116,7 @@ int test_ldpc(short No_iteration,
sigma = 1.0/sqrt(2*SNR);
opp_enabled=1;
//short test_input[block_length];
- unsigned char *test_input[MAX_NUM_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
+ unsigned char *test_input[MAX_NUM_NR_DLSCH_SEGMENTS]={NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};;
//short *c; //padded codeword
unsigned char *estimated_output[MAX_NUM_DLSCH_SEGMENTS];
unsigned char *estimated_output_bit[MAX_NUM_DLSCH_SEGMENTS];
diff --git a/openair1/PHY/CODING/TESTBENCH/polartest.c b/openair1/PHY/CODING/TESTBENCH/polartest.c
index e43ba507ab..8e7e377542 100644
--- a/openair1/PHY/CODING/TESTBENCH/polartest.c
+++ b/openair1/PHY/CODING/TESTBENCH/polartest.c
@@ -11,16 +11,12 @@
#include "PHY/CODING/nrPolar_tools/nr_polar_uci_defs.h"
#include "PHY/CODING/coding_defs.h"
#include "SIMULATION/TOOLS/sim.h"
-#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
//#include "common/utils/LOG/log.h"
-
+#include "coding_unitary_defs.h"
//#define DEBUG_DCI_POLAR_PARAMS
//#define DEBUG_POLAR_TIMING
//#define DEBUG_POLARTEST
-RAN_CONTEXT_t RC;
-PHY_VARS_UE ***PHY_vars_UE_g;
-uint16_t NB_UE_INST = 1;
int main(int argc, char *argv[])
{
diff --git a/openair1/PHY/CODING/TESTBENCH/smallblocktest.c b/openair1/PHY/CODING/TESTBENCH/smallblocktest.c
index f750d24977..c9ed678a8f 100644
--- a/openair1/PHY/CODING/TESTBENCH/smallblocktest.c
+++ b/openair1/PHY/CODING/TESTBENCH/smallblocktest.c
@@ -1,13 +1,10 @@
#include
#include "SIMULATION/TOOLS/sim.h"
#include "PHY/CODING/nrSmallBlock/nr_small_block_defs.h"
-#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
+#include "coding_unitary_defs.h"
//#define DEBUG_SMALLBLOCKTEST
-RAN_CONTEXT_t RC;
-PHY_VARS_UE ***PHY_vars_UE_g;
-uint16_t NB_UE_INST = 1;
int main(int argc, char *argv[])
{
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
index 18db8a01fb..8fe115b23a 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_decoder.c
@@ -40,9 +40,9 @@
#include "assertions.h"
int8_t polar_decoder(double *input,
- uint32_t *out,
- t_nrPolar_params *polarParams,
- uint8_t listSize)
+ uint32_t *out,
+ const t_nrPolar_params *polarParams,
+ uint8_t listSize)
{
//Assumes no a priori knowledge.
uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
@@ -299,7 +299,7 @@ int8_t polar_decoder(double *input,
int8_t polar_decoder_dci(double *input,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint8_t listSize,
uint16_t n_RNTI) {
uint8_t ***bit = nr_alloc_uint8_3D_array(polarParams->N, (polarParams->n+1), 2*listSize);
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
index a44a08a701..c2e9fd9381 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_defs.h
@@ -138,22 +138,22 @@ typedef struct nrPolar_params t_nrPolar_params;
void polar_encoder(uint32_t *input,
uint32_t *output,
- t_nrPolar_params *polarParams);
+ const t_nrPolar_params *polarParams);
void polar_encoder_dci(uint32_t *in,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint16_t n_RNTI);
void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
- t_nrPolar_params *polarParams);
+ const t_nrPolar_params *polarParams);
int8_t polar_decoder(double *input,
- uint32_t *output,
- t_nrPolar_params *polarParams,
+ uint32_t *output,
+ const t_nrPolar_params *polarParams,
uint8_t listSize);
uint32_t polar_decoder_int16(int16_t *input,
@@ -163,21 +163,21 @@ uint32_t polar_decoder_int16(int16_t *input,
int8_t polar_decoder_dci(double *input,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint8_t listSize,
uint16_t n_RNTI);
void generic_polar_decoder(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void applyFtoleft(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void applyGtoright(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void computeBeta(const t_nrPolar_params *pp,
- decoder_node_t *node);
+ decoder_node_t *node);
void build_decoder_tree(t_nrPolar_params *pp);
void build_polar_tables(t_nrPolar_params *polarParams);
diff --git a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
index 27c062c217..e61b3dff9b 100644
--- a/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
+++ b/openair1/PHY/CODING/nrPolar_tools/nr_polar_encoder.c
@@ -43,7 +43,7 @@
void polar_encoder(uint32_t *in,
uint32_t *out,
- t_nrPolar_params *polarParams) {
+ const t_nrPolar_params *polarParams) {
if (1) {//polarParams->idx == 0 || polarParams->idx == 1) { //PBCH or PDCCH
/*
uint64_t B = (((uint64_t)*in)&((((uint64_t)1)<<32)-1)) | (((uint64_t)crc24c((uint8_t*)in,polarParams->payloadBits)>>8)<payloadBits);
@@ -154,7 +154,7 @@ void polar_encoder(uint32_t *in,
void polar_encoder_dci(uint32_t *in,
uint32_t *out,
- t_nrPolar_params *polarParams,
+ const t_nrPolar_params *polarParams,
uint16_t n_RNTI) {
#ifdef DEBUG_POLAR_ENCODER_DCI
printf("[polar_encoder_dci] in: [0]->0x%08x \t [1]->0x%08x \t [2]->0x%08x \t [3]->0x%08x\n", in[0], in[1], in[2], in[3]);
@@ -251,9 +251,9 @@ void polar_encoder_dci(uint32_t *in,
#endif
}
-static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline));
+static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) __attribute__((always_inline));
-static inline void polar_rate_matching(t_nrPolar_params *polarParams,void *in,void *out) {
+static inline void polar_rate_matching(const t_nrPolar_params *polarParams,void *in,void *out) {
// handle rate matching with a single 128 bit word using bit shuffling
// can be done with SIMD intrisics if needed
@@ -411,7 +411,7 @@ void polar_encoder_fast(uint64_t *A,
void *out,
int32_t crcmask,
uint8_t ones_flag,
- t_nrPolar_params *polarParams) {
+ const t_nrPolar_params *polarParams) {
// AssertFatal(polarParams->K > 32, "K = %d < 33, is not supported yet\n",polarParams->K);
AssertFatal(polarParams->K < 129, "K = %d > 128, is not supported yet\n",polarParams->K);
AssertFatal(polarParams->payloadBits < 65, "payload bits = %d > 64, is not supported yet\n",polarParams->payloadBits);
diff --git a/openair1/PHY/INIT/init_top.c b/openair1/PHY/INIT/init_top.c
index 0990a58266..81fb28cc98 100644
--- a/openair1/PHY/INIT/init_top.c
+++ b/openair1/PHY/INIT/init_top.c
@@ -73,7 +73,6 @@ void init_lte_top(LTE_DL_FRAME_PARMS *frame_parms) {
init_unscrambling_lut();
init_scrambling_lut();
//set_taus_seed(1328);
- init_sss();
}
void free_lte_top(void) {
diff --git a/openair1/PHY/INIT/lte_init.c b/openair1/PHY/INIT/lte_init.c
index 2c7e3e88eb..1daeb72187 100644
--- a/openair1/PHY/INIT/lte_init.c
+++ b/openair1/PHY/INIT/lte_init.c
@@ -35,7 +35,7 @@
#include "assertions.h"
#include
#include "nfapi/oai_integration/vendor_ext.h"
-
+#include
extern uint32_t from_earfcn(int eutra_bandP,uint32_t dl_earfcn);
extern int32_t get_uldl_offset(int eutra_bandP);
@@ -46,6 +46,17 @@ uint8_t dmrs1_tab[8] = { 0, 2, 3, 4, 6, 8, 9, 10 };
int N_RB_DL_array[6] = { 6, 15, 25, 50, 75, 100 };
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
+void pdsch_procedures(PHY_VARS_eNB *eNB,
+ L1_rxtx_proc_t *proc,
+ int harq_pid,
+ LTE_eNB_DLSCH_t *dlsch,
+ LTE_eNB_DLSCH_t *dlsch1);
+
+void init_sss(void);
+
int
l1_north_init_eNB () {
int i,j;
@@ -347,6 +358,33 @@ void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
lte_gold_mbsfn_khz_1dot25 (fp, RC.eNB[Mod_id][CC_id]->lte_gold_mbsfn_khz_1dot25_table, fp->Nid_cell_mbsfn);
}
+void fill_subframe_mask(PHY_VARS_eNB *eNB) {
+
+ AssertFatal(eNB->subframe_mask!=NULL,"Subframe mask is null\n");
+ int32_t **dummy_tx=eNB->common_vars.txdataF;
+ eNB->common_vars.txdataF = eNB->subframe_mask;
+
+ for (int sf=0;sf<10;sf++) {
+ if (subframe_select(&eNB->frame_parms,sf)==SF_DL) {
+ LTE_DL_eNB_HARQ_t *dlsch_harq=eNB->dlsch[0][0]->harq_processes[0];
+ L1_rxtx_proc_t proc;
+ proc.frame_tx=0;
+ proc.subframe_tx=sf;
+ eNB->dlsch[0][0]->harq_ids[0][sf]=0;
+ eNB->dlsch[0][0]->rnti=0x1234;
+ dlsch_harq->nb_rb=48;
+ dlsch_harq->rb_alloc[0]=(uint32_t)0xffffffff;
+ dlsch_harq->Qm=2;
+ dlsch_harq->Nl=1;
+ dlsch_harq->pdsch_start=1;
+ dlsch_harq->mimo_mode=(eNB->frame_parms.nb_antenna_ports_eNB>1) ? ALAMOUTI : SISO;
+ dlsch_harq->dl_power_off = 1;
+ computeRhoB_eNB(4,eNB->frame_parms.pdsch_config_common.p_b,eNB->frame_parms.nb_antenna_ports_eNB,eNB->dlsch[0][0],dlsch_harq->dl_power_off);
+ pdsch_procedures(eNB,&proc,0,eNB->dlsch[0][0],NULL);
+ }
+ }
+ eNB->common_vars.txdataF = dummy_tx;
+}
int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
unsigned char is_secondary_eNB,
@@ -385,7 +423,9 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell);
generate_pcfich_reg_mapping (fp);
generate_phich_reg_mapping (fp);
+ init_sss();
+ init_fde();
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
eNB->first_run_timing_advance[UE_id] =
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
@@ -397,9 +437,13 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
eNB->first_run_I0_measurements =
1; ///This flag used to be static. With multiple eNBs this does no longer work, hence we put it in the structure. However it has to be initialized with 1, which is performed here.
+ eNB->use_DTX=1;
if (NFAPI_MODE!=NFAPI_MODE_VNF) {
common_vars->rxdata = (int32_t **)NULL;
common_vars->txdataF = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t *));
+ if (eNB->use_DTX==0) {
+ eNB->subframe_mask = (int32_t **)malloc16(NB_ANTENNA_PORTS_ENB*sizeof(int32_t *));
+ }
common_vars->rxdataF = (int32_t **)malloc16(64*sizeof(int32_t *));
LOG_I(PHY,"[INIT] NB_ANTENNA_PORTS_ENB:%d fp->nb_antenna_ports_eNB:%d\n", NB_ANTENNA_PORTS_ENB, fp->nb_antenna_ports_eNB);
@@ -409,17 +453,19 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_I(PHY,"[INIT] common_vars->txdataF[%d] = %p (%lu bytes)\n",
i,common_vars->txdataF[i],
fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t));
+ if (eNB->use_DTX==0 && inb_antenna_ports_eNB) eNB->subframe_mask[i] = malloc16_clear(fp->ofdm_symbol_size*fp->symbols_per_tti*10*sizeof(int32_t) );
}
}
+ LOG_I(PHY,"[INIT]SRS allocation\n");
// Channel estimates for SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
- srs_vars[UE_id].srs_ch_estimates = (int32_t **) malloc16 (64 * sizeof (int32_t *));
- srs_vars[UE_id].srs_ch_estimates_time = (int32_t **) malloc16 (64 * sizeof (int32_t *));
+ for (int srs_id = 0; srs_id < NUMBER_OF_SRS_MAX; srs_id++) {
+ srs_vars[srs_id].srs_ch_estimates = (int32_t **) malloc16 (64 * sizeof (int32_t *));
+ srs_vars[srs_id].srs_ch_estimates_time = (int32_t **) malloc16 (64 * sizeof (int32_t *));
for (i = 0; i < 64; i++) {
- srs_vars[UE_id].srs_ch_estimates[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size);
- srs_vars[UE_id].srs_ch_estimates_time[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2);
+ srs_vars[srs_id].srs_ch_estimates[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size);
+ srs_vars[srs_id].srs_ch_estimates_time[i] = (int32_t *) malloc16_clear (sizeof (int32_t) * fp->ofdm_symbol_size * 2);
}
} //UE_id
@@ -427,10 +473,11 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
init_ulsch_power_LUT ();
// SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
- srs_vars[UE_id].srs = (int32_t *) malloc16_clear (2 * fp->ofdm_symbol_size * sizeof (int32_t));
+ for (int srs_id = 0; srs_id < NUMBER_OF_SRS_MAX; srs_id++) {
+ srs_vars[srs_id].srs = (int32_t *) malloc16_clear (2 * fp->ofdm_symbol_size * sizeof (int32_t));
}
+ LOG_I(PHY,"PRACH allocation\n");
// PRACH
prach_vars->prachF = (int16_t *) malloc16_clear (1024 * 2 * sizeof (int16_t));
// assume maximum of 64 RX antennas for PRACH receiver
@@ -461,34 +508,33 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
LOG_D(PHY,"[INIT] prach_vars->rxsigF[%d] = %p\n",i,prach_vars->rxsigF[i]);
}*/
- for (UE_id=0; UE_idrxdataF_ext = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->rxdataF_ext2 = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->drs_ch_estimates = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->drs_ch_estimates_time = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->rxdataF_comp = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->ul_ch_mag = (int32_t **) malloc16 (2 * sizeof (int32_t *));
- pusch_vars[UE_id]->ul_ch_magb = (int32_t **) malloc16 (2 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id] = (LTE_eNB_PUSCH *) malloc16_clear (NUMBER_OF_ULSCH_MAX * sizeof (LTE_eNB_PUSCH));
+ pusch_vars[ULSCH_id]->rxdataF_ext = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->rxdataF_ext2 = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->drs_ch_estimates = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->drs_ch_estimates_time = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->rxdataF_comp = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->ul_ch_mag = (int32_t **) malloc16 (4 * sizeof (int32_t *));
+ pusch_vars[ULSCH_id]->ul_ch_magb = (int32_t **) malloc16 (4 * sizeof (int32_t *));
AssertFatal (fp->ofdm_symbol_size > 127, "fp->ofdm_symbol_size %d<128\n", fp->ofdm_symbol_size);
AssertFatal (fp->symbols_per_tti > 11, "fp->symbols_per_tti %d < 12\n", fp->symbols_per_tti);
AssertFatal (fp->N_RB_UL > 5, "fp->N_RB_UL %d < 6\n", fp->N_RB_UL);
-
- for (i = 0; i < 2; i++) {
- // RK 2 times because of output format of FFT!
+ AssertFatal (fp->nb_antennas_rx > 0,"fp->nb_antennas_rx = %d\n",fp->nb_antennas_rx);
+ for (i = 0; i < fp->nb_antennas_rx; i++) {
// FIXME We should get rid of this
- pusch_vars[UE_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->rxdataF_ext2[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->drs_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->drs_ch_estimates_time[i] = (int32_t *)malloc16_clear( 2*sizeof(int32_t)*fp->ofdm_symbol_size );
- pusch_vars[UE_id]->rxdataF_comp[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
- pusch_vars[UE_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
- pusch_vars[UE_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[ULSCH_id]->rxdataF_ext[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[ULSCH_id]->drs_ch_estimates[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[ULSCH_id]->drs_ch_estimates_time[i] = (int32_t *)malloc16_clear( 4*sizeof(int32_t)*fp->ofdm_symbol_size );
+ pusch_vars[ULSCH_id]->rxdataF_comp[i] = (int32_t *)malloc16_clear( sizeof(int32_t)*fp->N_RB_UL*12*fp->symbols_per_tti );
+ pusch_vars[ULSCH_id]->ul_ch_mag[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
+ pusch_vars[ULSCH_id]->ul_ch_magb[i] = (int32_t *)malloc16_clear( fp->symbols_per_tti*sizeof(int32_t)*fp->N_RB_UL*12 );
}
- pusch_vars[UE_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
- } //UE_id
+ pusch_vars[ULSCH_id]->llr = (int16_t *)malloc16_clear( (8*((3*8*6144)+12))*sizeof(int16_t) );
+ } //ULSCH_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++)
eNB->UE_stats_ptr[UE_id] = &eNB->UE_stats[UE_id];
@@ -518,19 +564,19 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
free_and_zero(common_vars->rxdataF);
// Channel estimates for SRS
- for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
+ for (int srs_id = 0; srs_id < NUMBER_OF_SRS_MAX; srs_id++) {
for (i=0; i<64; i++) {
- free_and_zero(srs_vars[UE_id].srs_ch_estimates[i]);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates_time[i]);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates[i]);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates_time[i]);
}
- free_and_zero(srs_vars[UE_id].srs_ch_estimates);
- free_and_zero(srs_vars[UE_id].srs_ch_estimates_time);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates);
+ free_and_zero(srs_vars[srs_id].srs_ch_estimates_time);
} //UE_id
free_ul_ref_sigs();
- for (UE_id=0; UE_idprachF);
@@ -548,26 +594,26 @@ void phy_free_lte_eNB(PHY_VARS_eNB *eNB) {
free_and_zero(prach_vars_br->prachF);
free_and_zero(prach_vars->rxsigF[0]);
- for (UE_id=0; UE_idrxdataF_ext[i]);
- free_and_zero(pusch_vars[UE_id]->rxdataF_ext2[i]);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates[i]);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates_time[i]);
- free_and_zero(pusch_vars[UE_id]->rxdataF_comp[i]);
- free_and_zero(pusch_vars[UE_id]->ul_ch_mag[i]);
- free_and_zero(pusch_vars[UE_id]->ul_ch_magb[i]);
+ for (int ULSCH_id=0; ULSCH_idnb_antennas_rx; i++) {
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates_time[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag[i]);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb[i]);
}
- free_and_zero(pusch_vars[UE_id]->rxdataF_ext);
- free_and_zero(pusch_vars[UE_id]->rxdataF_ext2);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates);
- free_and_zero(pusch_vars[UE_id]->drs_ch_estimates_time);
- free_and_zero(pusch_vars[UE_id]->rxdataF_comp);
- free_and_zero(pusch_vars[UE_id]->ul_ch_mag);
- free_and_zero(pusch_vars[UE_id]->ul_ch_magb);
- free_and_zero(pusch_vars[UE_id]->llr);
- free_and_zero(pusch_vars[UE_id]);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates);
+ free_and_zero(pusch_vars[ULSCH_id]->drs_ch_estimates_time);
+ free_and_zero(pusch_vars[ULSCH_id]->rxdataF_comp);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_mag);
+ free_and_zero(pusch_vars[ULSCH_id]->ul_ch_magb);
+ free_and_zero(pusch_vars[ULSCH_id]->llr);
+ free_and_zero(pusch_vars[ULSCH_id]);
} //UE_id
for (UE_id = 0; UE_id < NUMBER_OF_UE_MAX; UE_id++) eNB->UE_stats_ptr[UE_id] = NULL;
diff --git a/openair1/PHY/INIT/lte_init_ru.c b/openair1/PHY/INIT/lte_init_ru.c
index 8ad928f8a0..a856c33999 100644
--- a/openair1/PHY/INIT/lte_init_ru.c
+++ b/openair1/PHY/INIT/lte_init_ru.c
@@ -21,9 +21,8 @@
#include "phy_init.h"
#include "SCHED/sched_eNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
-#include "SIMULATION/TOOLS/sim.h"
+//#include "SIMULATION/TOOLS/sim.h"
#include "LTE_RadioResourceConfigCommonSIB.h"
#include "LTE_RadioResourceConfigDedicated.h"
#include "LTE_TDD-Config.h"
@@ -34,6 +33,8 @@
void init_7_5KHz(void);
+extern const char ru_if_types[MAX_RU_IF_TYPES][20];
+
int phy_init_RU(RU_t *ru) {
LTE_DL_FRAME_PARMS *fp = ru->frame_parms;
RU_CALIBRATION *calibration = &ru->calibration;
@@ -44,6 +45,7 @@ int phy_init_RU(RU_t *ru) {
if (ru->is_slave == 1) {
generate_ul_ref_sigs_rx();
}
+ else generate_ul_ref_sigs();
if (ru->if_south <= REMOTE_IF5) { // this means REMOTE_IF5 or LOCAL_RF, so allocate memory for time-domain signals
// Time-domain signals
@@ -135,14 +137,14 @@ int phy_init_RU(RU_t *ru) {
}
}
- AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
- RC.nb_L1_inst,NUMBER_OF_eNB_MAX);
- LOG_D(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
+ AssertFatal(ru->num_eNB <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
+ ru->num_eNB,NUMBER_OF_eNB_MAX);
+ LOG_D(PHY,"[INIT] %s() ru->num_eNB:%d \n", __FUNCTION__, ru->num_eNB);
int starting_antenna_index=0;
for (i=0; iidx; i++) starting_antenna_index+=ru->nb_tx;
- for (i=0; inum_eNB; i++) {
for (p=0; p<15; p++) {
LOG_D(PHY,"[INIT] %s() nb_antenna_ports_eNB:%d \n", __FUNCTION__, ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB);
@@ -240,7 +242,7 @@ void phy_free_RU(RU_t *ru) {
free_and_zero(ru->prach_rxsigF[0]);
/* ru->prach_rxsigF_br is not allocated -> don't free */
- for (i = 0; i < RC.nb_L1_inst; i++) {
+ for (i = 0; i < ru->num_eNB; i++) {
for (p = 0; p < 15; p++) {
if (p < ru->eNB_list[i]->frame_parms.nb_antenna_ports_eNB || p == 5) {
for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
diff --git a/openair1/PHY/INIT/lte_init_ue.c b/openair1/PHY/INIT/lte_init_ue.c
index 64a5992a64..b756735816 100644
--- a/openair1/PHY/INIT/lte_init_ue.c
+++ b/openair1/PHY/INIT/lte_init_ue.c
@@ -39,6 +39,7 @@ void init_7_5KHz(void);
uint8_t dmrs1_tab_ue[8] = {0,2,3,4,6,8,9,10};
+void init_sss(void);
void phy_config_sib1_ue(module_id_t Mod_id,int CC_id,
uint8_t eNB_id,
@@ -629,6 +630,7 @@ int init_lte_ue_signal(PHY_VARS_UE *ue,
init_frame_parms(&ue->frame_parms,1);
lte_sync_time_init(&ue->frame_parms);
init_lte_top(&ue->frame_parms);
+ init_sss();
init_7_5KHz();
init_ul_hopping(&ue->frame_parms);
// many memory allocation sizes are hard coded
diff --git a/openair1/PHY/INIT/lte_param_init.c b/openair1/PHY/INIT/lte_param_init.c
index 1505ee018e..504c8fa80a 100644
--- a/openair1/PHY/INIT/lte_param_init.c
+++ b/openair1/PHY/INIT/lte_param_init.c
@@ -25,7 +25,6 @@
#include
#include
-#include "SIMULATION/TOOLS/sim.h"
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
@@ -33,7 +32,9 @@
#include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
-#include "targets/RT/USER/lte-softmodem.h"
+#include "executables/softmodem-common.h"
+#include "SIMULATION/TOOLS/sim.h"
+
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
extern RU_t *ru;
diff --git a/openair1/PHY/INIT/nr_init.c b/openair1/PHY/INIT/nr_init.c
index e05045d3ed..f9be627974 100644
--- a/openair1/PHY/INIT/nr_init.c
+++ b/openair1/PHY/INIT/nr_init.c
@@ -110,7 +110,7 @@ int l1_north_init_gNB() {
int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
unsigned char is_secondary_gNB,
- unsigned char abstraction_flag) {
+ unsigned char lowmem_flag) {
// shortcuts
NR_DL_FRAME_PARMS *const fp = &gNB->frame_parms;
nfapi_nr_config_request_scf_t *cfg = &gNB->gNB_config;
@@ -128,6 +128,15 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
while(gNB->configured == 0) usleep(10000);
+ if (lowmem_flag == 1) {
+ gNB->number_of_nr_dlsch_max = 2;
+ gNB->number_of_nr_ulsch_max = 2;
+ }
+ else {
+ gNB->number_of_nr_dlsch_max = NUMBER_OF_NR_DLSCH_MAX;
+ gNB->number_of_nr_ulsch_max = NUMBER_OF_NR_ULSCH_MAX;
+ }
+
load_dftslib();
LOG_D(PHY,"[MSC_NEW][FRAME 00000][PHY_gNB][MOD %02"PRIu8"][]\n", gNB->Mod_id);
@@ -287,7 +296,7 @@ int phy_init_nr_gNB(PHY_VARS_gNB *gNB,
int N_RB_UL = cfg->carrier_config.ul_grid_size[cfg->ssb_config.scs_common.value].value;
- for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) {
pusch_vars[ULSCH_id] = (NR_gNB_PUSCH *)malloc16_clear( sizeof(NR_gNB_PUSCH) );
pusch_vars[ULSCH_id]->rxdataF_ext = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
pusch_vars[ULSCH_id]->rxdataF_ext2 = (int32_t **)malloc16(Prx*sizeof(int32_t *) );
@@ -372,7 +381,7 @@ void phy_free_nr_gNB(PHY_VARS_gNB *gNB)
free_and_zero(prach_vars->prach_ifft[0]);
free_and_zero(prach_vars->rxsigF[0]);
*/
- for (int ULSCH_id=0; ULSCH_idnumber_of_nr_ulsch_max; ULSCH_id++) {
for (int i = 0; i < 2; i++) {
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext[i]);
free_and_zero(pusch_vars[ULSCH_id]->rxdataF_ext2[i]);
@@ -563,9 +572,9 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
AssertFatal(gNB->pucch[i]!=NULL,"Can't initialize pucch %d \n", i);
}
- for (i=0; inumber_of_nr_dlsch_max; i++) {
- LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,NUMBER_OF_NR_DLSCH_MAX);
+ LOG_I(PHY,"Allocating Transport Channel Buffers for DLSCH %d/%d\n",i,gNB->number_of_nr_dlsch_max);
for (j=0; j<2; j++) {
gNB->dlsch[i][j] = new_gNB_dlsch(fp,1,16,NSOFT,0,grid_size);
@@ -573,9 +582,9 @@ void init_nr_transport(PHY_VARS_gNB *gNB) {
}
}
- for (i=0; inumber_of_nr_ulsch_max; i++) {
- LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
+ LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH %d/%d\n",i,gNB->number_of_nr_ulsch_max);
for (j=0; j<2; j++) {
// ULSCH for data
diff --git a/openair1/PHY/INIT/nr_init_ru.c b/openair1/PHY/INIT/nr_init_ru.c
index cb3fd076a7..8189a7ab34 100644
--- a/openair1/PHY/INIT/nr_init_ru.c
+++ b/openair1/PHY/INIT/nr_init_ru.c
@@ -21,9 +21,6 @@
#include "phy_init.h"
#include "SCHED/sched_common.h"
-#include "PHY/phy_extern.h"
-#include "PHY/NR_TRANSPORT/nr_transport_proto.h"
-#include "SIMULATION/TOOLS/sim.h"
/*#include "RadioResourceConfigCommonSIB.h"
#include "RadioResourceConfigDedicated.h"
#include "TDD-Config.h"
@@ -33,6 +30,10 @@
#include
#include "openair1/PHY/defs_RU.h"
+void init_prach_ru_list(RU_t *ru);
+
+extern const char ru_if_types[MAX_RU_IF_TYPES][20];
+
int nr_phy_init_RU(RU_t *ru) {
NR_DL_FRAME_PARMS *fp = ru->nr_frame_parms;
@@ -44,7 +45,7 @@ int nr_phy_init_RU(RU_t *ru) {
nfapi_nr_config_request_scf_t *cfg;
ru->nb_log_antennas=0;
- for (int n=0;nnum_gNB;n++) {
cfg = &ru->config;
if (cfg->carrier_config.num_tx_ant.value > ru->nb_log_antennas) ru->nb_log_antennas = cfg->carrier_config.num_tx_ant.value;
}
@@ -117,10 +118,10 @@ int nr_phy_init_RU(RU_t *ru) {
}
}
- AssertFatal(RC.nb_nr_L1_inst <= NUMBER_OF_eNB_MAX,"gNB instances %d > %d\n",
- RC.nb_nr_L1_inst,NUMBER_OF_gNB_MAX);
+ AssertFatal(ru->num_gNB <= NUMBER_OF_gNB_MAX,"gNB instances %d > %d\n",
+ ru->num_gNB,NUMBER_OF_gNB_MAX);
- LOG_I(PHY,"[INIT] %s() RC.nb_nr_L1_inst:%d \n", __FUNCTION__, RC.nb_nr_L1_inst);
+ LOG_I(PHY,"[INIT] %s() ru->num_gNB:%d \n", __FUNCTION__, ru->num_gNB);
int beam_count = 0;
if (ru->nb_tx>1) {//Enable beamforming when nb_tx > 1
@@ -131,7 +132,7 @@ int nr_phy_init_RU(RU_t *ru) {
AssertFatal(ru->nb_bfw==(beam_count*ru->nb_tx),"Number of beam weights from config file is %d while the expected number is %d",ru->nb_bfw,(beam_count*ru->nb_tx));
int l_ind = 0;
- for (i=0; inum_gNB; i++) {
for (p=0;pnb_log_antennas;p++) {
//if ((fp->L_ssb >> (63-p)) & 0x01) {
ru->beam_weights[i][p] = (int32_t **)malloc16_clear(ru->nb_tx*sizeof(int32_t*));
@@ -199,8 +200,7 @@ void nr_phy_free_RU(RU_t *ru)
free_and_zero(ru->prach_rxsigF[j][i]);
}
}
-
- for (i = 0; i < RC.nb_nr_L1_inst; i++) {
+ for (i = 0; i < ru->num_gNB; i++) {
for (p = 0; p < 15; p++) {
for (j=0; jnb_tx; j++) free_and_zero(ru->beam_weights[i][p][j]);
free_and_zero(ru->beam_weights[i][p]);
diff --git a/openair1/PHY/INIT/nr_init_ue.c b/openair1/PHY/INIT/nr_init_ue.c
index 7288f063c2..0b5b343fd4 100644
--- a/openair1/PHY/INIT/nr_init_ue.c
+++ b/openair1/PHY/INIT/nr_init_ue.c
@@ -28,6 +28,7 @@
#include "TDD-Config.h"
#include "MBSFN-SubframeConfigList.h"*/
#include "openair1/PHY/defs_RU.h"
+#include "openair1/PHY/impl_defs_nr.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "assertions.h"
#include
@@ -206,7 +207,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,
}
for (i=0;iPDSCH_Config.pdsch_TimeDomainResourceAllocation[i] = (NR_PDSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(NR_PDSCH_TimeDomainResourceAllocation_t));
+ ue->PDSCH_Config.pdsch_TimeDomainResourceAllocation[i] = (PDSCH_TimeDomainResourceAllocation_t *)malloc16(sizeof(PDSCH_TimeDomainResourceAllocation_t));
ue->PDSCH_Config.pdsch_TimeDomainResourceAllocation[i]->mappingType = typeA;
}
diff --git a/openair1/PHY/INIT/nr_parms.c b/openair1/PHY/INIT/nr_parms.c
index 9aabc5e1e9..3a9d8a6c18 100644
--- a/openair1/PHY/INIT/nr_parms.c
+++ b/openair1/PHY/INIT/nr_parms.c
@@ -261,11 +261,11 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
LOG_I(PHY, "Initializing frame parms: set nb_antenna_ports_gNB %d, tdd_config, %d, Nid_cell %d\n", fp->nb_antenna_ports_gNB, fp->tdd_config, fp->Nid_cell);
-
uint64_t dl_bw_khz = (12*config->carrier_config.dl_grid_size[config->ssb_config.scs_common])*(15<ssb_config.scs_common);
- LOG_I(PHY,"dl_bw_kHz %lu\n",dl_bw_khz);
fp->dl_CarrierFreq = ((dl_bw_khz>>1) + config->carrier_config.dl_frequency)*1000 ;
- LOG_I(PHY,"dl_CarrierFreq %lu\n",fp->dl_CarrierFreq);
+
+ LOG_D(PHY,"dl_bw_kHz %lu\n",dl_bw_khz);
+ LOG_D(PHY,"dl_CarrierFreq %lu\n",fp->dl_CarrierFreq);
uint64_t ul_bw_khz = (12*config->carrier_config.ul_grid_size[config->ssb_config.scs_common])*(15<ssb_config.scs_common);
fp->ul_CarrierFreq = ((ul_bw_khz>>1) + config->carrier_config.uplink_frequency)*1000 ;
diff --git a/openair1/PHY/INIT/phy_init.h b/openair1/PHY/INIT/phy_init.h
index 2db0ccc258..2ab610739d 100644
--- a/openair1/PHY/INIT/phy_init.h
+++ b/openair1/PHY/INIT/phy_init.h
@@ -399,7 +399,7 @@ int init_nr_ue_signal(PHY_VARS_NR_UE *ue,int nb_connected_eNB,uint8_t abstractio
void init_nr_ue_transport(PHY_VARS_NR_UE *ue,int abstraction_flag);
void init_N_TA_offset(PHY_VARS_NR_UE *ue);
void nr_dump_frame_parms(NR_DL_FRAME_PARMS *frame_parms);
-int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char abstraction_flag);
+int phy_init_nr_gNB(PHY_VARS_gNB *gNB, unsigned char is_secondary_gNB, unsigned char lowmem_flag);
void nr_phy_config_request(NR_PHY_Config_t *gNB);
void nr_phy_config_request_sim(PHY_VARS_gNB *gNB,int N_RB_DL,int N_RB_UL,int mu,int Nid_cell,uint64_t position_in_burst);
void phy_free_nr_gNB(PHY_VARS_gNB *gNB);
@@ -408,6 +408,7 @@ void init_nr_transport(PHY_VARS_gNB *gNB);
void init_dfts(void);
+void fill_subframe_mask(PHY_VARS_eNB *eNB);
/** @} */
#endif
diff --git a/openair1/PHY/LTE_ESTIMATION/freq_equalization.c b/openair1/PHY/LTE_ESTIMATION/freq_equalization.c
index 3fd58a4989..6d382bdd63 100644
--- a/openair1/PHY/LTE_ESTIMATION/freq_equalization.c
+++ b/openair1/PHY/LTE_ESTIMATION/freq_equalization.c
@@ -20,11 +20,11 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
+#include "PHY/LTE_ESTIMATION/lte_estimation.h"
-// This is 512/(1:256) in __m128i format
-int16_t inv_ch[256*8] = {512,512,512,512,512,512,512,512,
+// This is 4096/(1:4096) in __m128i format
+__m128i inv_ch[4096];/* = {512,512,512,512,512,512,512,512,
256,256,256,256,256,256,256,256,
170,170,170,170,170,170,170,170,
128,128,128,128,128,128,128,128,
@@ -280,7 +280,11 @@ int16_t inv_ch[256*8] = {512,512,512,512,512,512,512,512,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,
2,2,2,2,2,2,2,2,
- };
+ };*/
+
+void init_fde() {
+ for (int i=1;i<4096;i++) inv_ch[i] = _mm_set1_epi16(4096/i);
+}
void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp,
@@ -313,12 +317,12 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
amp=(*((int16_t*)&ul_ch_mag128[re]));
- if (amp>255)
- amp=255;
+ if (amp>4095)
+ amp=4095;
- // printf("freq_eq: symbol %d re %d => %d,%d,%d, (%d) (%d,%d) => ",symbol,re,*((int16_t*)(&ul_ch_mag128[re])),amp,inv_ch[8*amp],*((int16_t*)(&ul_ch_mag128[re]))*inv_ch[8*amp],*(int16_t*)&(rxdataF_comp128[re]),*(1+(int16_t*)&(rxdataF_comp128[re])));
+ //printf("freq_eq: symbol %d re %d => mag %d,amp %d,inv %d, prod %d (%d,%d)\n",symbol,re,*((int16_t*)(&ul_ch_mag128[re])),amp,_mm_extract_epi16(inv_ch[amp],0),(*((int16_t*)(&ul_ch_mag128[re]))*_mm_extract_epi16(inv_ch[amp],0))>>3,*(int16_t*)&(rxdataF_comp128[re]),*(1+(int16_t*)&(rxdataF_comp128[re])));
#if defined(__x86_64__) || defined(__i386__)
- rxdataF_comp128[re] = _mm_mullo_epi16(rxdataF_comp128[re],*((__m128i *)&inv_ch[8*amp]));
+ rxdataF_comp128[re] = _mm_srai_epi16(_mm_mullo_epi16(rxdataF_comp128[re],inv_ch[amp]),3);
if (Qm==4)
ul_ch_mag128[re] = _mm_set1_epi16(324); // this is 512*2/sqrt(10)
@@ -327,7 +331,7 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
ul_ch_magb128[re] = _mm_set1_epi16(158); // this is 512*2/sqrt(42)
}
#elif defined(__arm__)
- rxdataF_comp128[re] = vmulq_s16(rxdataF_comp128[re],*((int16x8_t *)&inv_ch[8*amp]));
+ rxdataF_comp128[re] = vmulq_s16(rxdataF_comp128[re],inv_ch[amp]);
if (Qm==4)
ul_ch_mag128[re] = vdupq_n_s16(324); // this is 512*2/sqrt(10)
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
index f85162e095..aac8e71828 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_adjust_sync_eNB.c
@@ -21,7 +21,6 @@
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
@@ -118,12 +117,12 @@ int lte_est_timing_advance_pusch(LTE_DL_FRAME_PARMS *frame_parms,
int temp, i, aa, max_pos=0, max_val=0;
short Re,Im;
- uint8_t cyclic_shift = 0;
- int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
+ // uint8_t cyclic_shift = 0;
+ int sync_pos = 0;//(frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
AssertFatal(frame_parms->ofdm_symbol_size > 127,"frame_parms->ofdm_symbol_size %d<128\n",frame_parms->ofdm_symbol_size);
- AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<3,"frame_parms->nb_antennas_rx %d not in [0,1]\n",
- frame_parms->nb_antennas_rx);
+ AssertFatal(frame_parms->nb_antennas_rx >0 && frame_parms->nb_antennas_rx<=4,"frame_parms->nb_antennas_rx %d not in [1...%d]\n",
+ frame_parms->nb_antennas_rx,4);
for (i = 0; i < frame_parms->ofdm_symbol_size; i++) {
temp = 0;
@@ -142,9 +141,5 @@ int lte_est_timing_advance_pusch(LTE_DL_FRAME_PARMS *frame_parms,
if (max_pos>frame_parms->ofdm_symbol_size/2)
max_pos = max_pos-frame_parms->ofdm_symbol_size;
- //#ifdef DEBUG_PHY
- LOG_D(PHY,"max_pos = %d, sync_pos=%d\n",max_pos,sync_pos);
- //#endif //DEBUG_PHY
-
return max_pos - sync_pos;
}
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
index 2d79158920..7eeeb998ba 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_eNB_measurements.c
@@ -32,6 +32,30 @@
int32_t rx_power_avg_eNB[3];
+void dump_I0_stats(FILE *fd,PHY_VARS_eNB *eNB) {
+
+
+ int min_I0=1000,max_I0=0;
+ int amin=0,amax=0;
+ for (int i=0; iframe_parms.N_RB_UL; i++) {
+ if (i==(eNB->frame_parms.N_RB_UL>>1) - 1) i+=2;
+
+ if (eNB->measurements.n0_subband_power_tot_dB[i]measurements.n0_subband_power_tot_dB[i]; amin=i;}
+
+ if (eNB->measurements.n0_subband_power_tot_dB[i]>max_I0) {max_I0 = eNB->measurements.n0_subband_power_tot_dB[i]; amax=i;}
+ }
+
+ for (int i=0; iframe_parms.N_RB_UL; i++) {
+ fprintf(fd,"%2d.",eNB->measurements.n0_subband_power_tot_dB[i]-eNB->measurements.n0_subband_power_avg_dB);
+ if (i%25 == 24) fprintf(fd,"\n");
+ }
+
+ fprintf(fd,"\nmax_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, eNB->measurements.n0_subband_power_avg_dB);
+
+ fprintf(fd,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
+
+
+}
void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
int subframe,
module_id_t eNB_id,
@@ -87,46 +111,45 @@ void lte_eNB_I0_measurements(PHY_VARS_eNB *eNB,
nb_rb++;
for (aarx=0; aarxnb_antennas_rx; aarx++) {
measurements->n0_subband_power[aarx][rb] = 0;
- for (int s=0;s<14-(frame_parms->Ncp<<1);s++) {
- // select the 7th symbol in an uplink subframe
- offset = offset0 + (s*frame_parms->ofdm_symbol_size);
- ul_ch = &common_vars->rxdataF[aarx][offset];
- len = 12;
+ for (int s=0;s<(14-(frame_parms->Ncp<<1));s++) {
+ offset = offset0 + (s*frame_parms->ofdm_symbol_size);
+ ul_ch = &common_vars->rxdataF[aarx][offset];
+ len = 12;
// just do first half of middle PRB for odd number of PRBs
- if (((frame_parms->N_RB_UL&1) == 1) &&
- (rb==(frame_parms->N_RB_UL>>1))) {
- len=6;
- }
+ if (((frame_parms->N_RB_UL&1) == 1) &&
+ (rb==(frame_parms->N_RB_UL>>1))) {
+ len=6;
+ }
- AssertFatal(ul_ch, "RX signal buffer (freq) problem");
+ AssertFatal(ul_ch, "RX signal buffer (freq) problem");
- measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
+ measurements->n0_subband_power[aarx][rb] += signal_energy_nodc(ul_ch,len);
- }
+ } // symbol
measurements->n0_subband_power[aarx][rb]/=(14-(frame_parms->Ncp<<1));
measurements->n0_subband_power_dB[aarx][rb] = dB_fixed(measurements->n0_subband_power[aarx][rb]);
n0_power_tot += measurements->n0_subband_power[aarx][rb];
- }
+ } //antenna
n0_power_tot/=frame_parms->nb_antennas_rx;
n0_power_tot2 += n0_power_tot;
- measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot/frame_parms->nb_antennas_rx);
+ measurements->n0_subband_power_tot_dB[rb] = dB_fixed(n0_power_tot);
measurements->n0_subband_power_tot_dBm[rb] = measurements->n0_subband_power_tot_dB[rb] - eNB->rx_total_gain_dB - dB_fixed(frame_parms->N_RB_UL);
- }
- }
+ } //rb not used in subframe
+ } //rb
if (nb_rb>0) measurements->n0_subband_power_avg_dB = dB_fixed(n0_power_tot2/nb_rb);
}
void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
module_id_t eNB_id,
- module_id_t UE_id,
+ module_id_t srs_id,
unsigned char init_averaging)
{
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
PHY_MEASUREMENTS_eNB *measurements = &eNB->measurements;
- LTE_eNB_SRS *srs_vars = &eNB->srs_vars[UE_id];
+ LTE_eNB_SRS *srs_vars = &eNB->srs_vars[srs_id];
int32_t aarx,rx_power_correction;
int32_t rx_power;
@@ -136,7 +159,7 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
//printf("Running eNB_srs_measurements for eNB_id %d\n",eNB_id);
if (init_averaging == 1)
- rx_power_avg_eNB[UE_id] = 0;
+ rx_power_avg_eNB[srs_id] = 0;
rx_power = 0;
@@ -152,24 +175,24 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
for (aarx=0; aarxnb_antennas_rx; aarx++) {
- measurements->rx_spatial_power[UE_id][0][aarx] =
+ measurements->rx_spatial_power[srs_id][0][aarx] =
((signal_energy_nodc(&srs_vars->srs_ch_estimates[aarx][frame_parms->first_carrier_offset],
(frame_parms->N_RB_DL*6)) +
signal_energy_nodc(&srs_vars->srs_ch_estimates[aarx][1],
(frame_parms->N_RB_DL*6)))*rx_power_correction) -
measurements->n0_power[aarx];
- measurements->rx_spatial_power[UE_id][0][aarx]<<=1; // because of noise only in odd samples
+ measurements->rx_spatial_power[srs_id][0][aarx]<<=1; // because of noise only in odd samples
- measurements->rx_spatial_power_dB[UE_id][0][aarx] = (unsigned short) dB_fixed(measurements->rx_spatial_power[UE_id][0][aarx]);
+ measurements->rx_spatial_power_dB[srs_id][0][aarx] = (unsigned short) dB_fixed(measurements->rx_spatial_power[srs_id][0][aarx]);
- measurements->wideband_cqi[UE_id][aarx] = measurements->rx_spatial_power[UE_id][0][aarx];
+ measurements->wideband_cqi[srs_id][aarx] = measurements->rx_spatial_power[srs_id][0][aarx];
// measurements->rx_power[UE_id][aarx]/=frame_parms->nb_antennas_tx;
- measurements->wideband_cqi_dB[UE_id][aarx] = (unsigned short) dB_fixed(measurements->wideband_cqi[UE_id][aarx]);
- rx_power += measurements->wideband_cqi[UE_id][aarx];
+ measurements->wideband_cqi_dB[srs_id][aarx] = (unsigned short) dB_fixed(measurements->wideband_cqi[srs_id][aarx]);
+ rx_power += measurements->wideband_cqi[srs_id][aarx];
// measurements->rx_avg_power_dB[UE_id] += measurements->rx_power_dB[UE_id][aarx];
}
@@ -177,14 +200,14 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
// measurements->rx_avg_power_dB[UE_id]/=frame_parms->nb_antennas_rx;
if (init_averaging == 0)
- rx_power_avg_eNB[UE_id] = ((k1*rx_power_avg_eNB[UE_id]) + (k2*rx_power))>>10;
+ rx_power_avg_eNB[srs_id] = ((k1*rx_power_avg_eNB[srs_id]) + (k2*rx_power))>>10;
else
- rx_power_avg_eNB[UE_id] = rx_power;
+ rx_power_avg_eNB[srs_id] = rx_power;
- measurements->wideband_cqi_tot[UE_id] = dB_fixed2(rx_power,2*measurements->n0_power_tot);
+ measurements->wideband_cqi_tot[srs_id] = dB_fixed2(rx_power,2*measurements->n0_power_tot);
// times 2 since we have noise only in the odd carriers of the srs comb
- measurements->rx_rssi_dBm[UE_id] = (int32_t)dB_fixed(rx_power_avg_eNB[UE_id])-eNB->rx_total_gain_dB;
+ measurements->rx_rssi_dBm[srs_id] = (int32_t)dB_fixed(rx_power_avg_eNB[srs_id])-eNB->rx_total_gain_dB;
@@ -200,21 +223,21 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
else if (rb>12)
ul_ch = &srs_vars->srs_ch_estimates[aarx][6 + (rb-13)*12];
else {
- measurements->subband_cqi_dB[UE_id][aarx][rb] = 0;
+ measurements->subband_cqi_dB[srs_id][aarx][rb] = 0;
continue;
}
// cqi
if (aarx==0)
- measurements->subband_cqi_tot[UE_id][rb]=0;
+ measurements->subband_cqi_tot[srs_id][rb]=0;
- measurements->subband_cqi[UE_id][aarx][rb] = (signal_energy_nodc(ul_ch,12))*rx_power_correction - measurements->n0_power[aarx];
+ measurements->subband_cqi[srs_id][aarx][rb] = (signal_energy_nodc(ul_ch,12))*rx_power_correction - measurements->n0_power[aarx];
- if (measurements->subband_cqi[UE_id][aarx][rb] < 0)
- measurements->subband_cqi[UE_id][aarx][rb]=0;
+ if (measurements->subband_cqi[srs_id][aarx][rb] < 0)
+ measurements->subband_cqi[srs_id][aarx][rb]=0;
- measurements->subband_cqi_tot[UE_id][rb] += measurements->subband_cqi[UE_id][aarx][rb];
- measurements->subband_cqi_dB[UE_id][aarx][rb] = dB_fixed2(measurements->subband_cqi[UE_id][aarx][rb],
+ measurements->subband_cqi_tot[srs_id][rb] += measurements->subband_cqi[srs_id][aarx][rb];
+ measurements->subband_cqi_dB[srs_id][aarx][rb] = dB_fixed2(measurements->subband_cqi[srs_id][aarx][rb],
2*measurements->n0_power[aarx]);
// 2*n0_power since we have noise from the odd carriers in the comb of the srs
@@ -225,7 +248,7 @@ void lte_eNB_srs_measurements(PHY_VARS_eNB *eNB,
for (rb=0; rbN_RB_DL; rb++) {
- measurements->subband_cqi_tot_dB[UE_id][rb] = dB_fixed2(measurements->subband_cqi_tot[UE_id][rb],
+ measurements->subband_cqi_tot_dB[srs_id][rb] = dB_fixed2(measurements->subband_cqi_tot[srs_id][rb],
measurements->n0_power_tot);
/*
if (measurements->subband_cqi_tot_dB[UE_id][rb] == 65)
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h
index fc40280853..6ba901e29f 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_estimation.h
+++ b/openair1/PHY/LTE_ESTIMATION/lte_estimation.h
@@ -288,6 +288,8 @@ void freq_equalization(LTE_DL_FRAME_PARMS *frame_parms,
unsigned short Msc_RS,
unsigned char Qm);
+void init_fde(void);
+void dump_I0_stats(FILE *fd,PHY_VARS_eNB *eNB);
/** @} */
#endif
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
index 57b4c28661..1fbc8b7ef2 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_sync_time.c
@@ -27,12 +27,9 @@
//#include
#include
-#include "LAYER2/MAC/mac.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern_ue.h"
-#include "PHY_INTERFACE/phy_interface.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
-#include "RRC/LTE/rrc_extern.h"
// Note: this is for prototype of generate_drs_pusch (OTA synchronization of RRUs)
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
diff --git a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
index 1d1b16e036..0ce716ef20 100644
--- a/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
+++ b/openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c
@@ -20,7 +20,7 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
+//#include "PHY/phy_extern.h"
#include "PHY/sse_intrin.h"
//#define DEBUG_CH
#include "common/utils/LOG/log.h"
@@ -34,12 +34,18 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
#define SCALE 0x3FFF
+static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
+//static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
+
+extern unsigned short dftsizes[34];
+extern int16_t *ul_ref_sigs_rx[30][2][34];
+
int32_t lte_ul_channel_estimation(LTE_DL_FRAME_PARMS *frame_parms,
L1_rxtx_proc_t *proc,
- LTE_eNB_ULSCH_t * ulsch,
- int32_t **ul_ch_estimates,
- int32_t **ul_ch_estimates_time,
- int32_t **rxdataF_ext,
+ LTE_eNB_ULSCH_t * ulsch,
+ int32_t **ul_ch_estimates,
+ int32_t **ul_ch_estimates_time,
+ int32_t **rxdataF_ext,
module_id_t UE_id,
unsigned char l,
unsigned char Ns) {
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
index 4b06f67bbe..61af617d6e 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c
@@ -53,22 +53,25 @@
//#undef LOG_D
//#define LOG_D(A,B...) printf(B)
-int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
- uint16_t i;
- int16_t first_free_index=-1;
+int find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
+ int first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
- for (i=0; idlsch[i]!=NULL,"eNB->dlsch[%d] is null\n",i);
- AssertFatal(eNB->dlsch[i]!=NULL,"eNB->dlsch[%d][0] is null\n",i);
+ for (int i=0; idlsch[i][0] == NULL) continue;
LOG_D(PHY,"searching for rnti %x : UE index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,eNB->dlsch[i][0]->harq_mask,eNB->dlsch[i][0]->rnti,first_free_index);
- if ((eNB->dlsch[i][0]->harq_mask >0) &&
- (eNB->dlsch[i][0]->rnti==rnti)) return i;
- else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ if (type == SEARCH_EXIST_RA) {
+ if (eNB->dlsch[i][0]->rnti==rnti) return i;
+ } else {
+ if ((eNB->dlsch[i][0]->harq_mask >0) &&
+ (eNB->dlsch[i][0]->rnti==rnti)) return i;
+ else if ((eNB->dlsch[i][0]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ }
+
}
- if (type == SEARCH_EXIST)
+ if (type == SEARCH_EXIST_RA || type == SEARCH_EXIST)
return -1;
if (first_free_index != -1)
@@ -78,20 +81,23 @@ int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
}
-int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
- uint16_t i;
- int16_t first_free_index=-1;
+int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type) {
+ int first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
- for (i=0; iulsch[i]!=NULL,"eNB->ulsch[%d] is null\n",i);
+ for (int i=0; iulsch[i]==NULL) continue;
- if ((eNB->ulsch[i]->harq_mask >0) &&
- (eNB->ulsch[i]->rnti==rnti)) return i;
- else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ if (type == SEARCH_EXIST_RA) {
+ if (eNB->ulsch[i]->rnti == rnti) return i;
+ } else {
+ if ((eNB->ulsch[i]->harq_mask >0) &&
+ (eNB->ulsch[i]->rnti==rnti)) return i;
+ else if ((eNB->ulsch[i]->harq_mask == 0) && (first_free_index==-1)) first_free_index=i;
+ }
}
- if (type == SEARCH_EXIST)
+ if (type == SEARCH_EXIST_RA || type == SEARCH_EXIST)
return -1;
if (first_free_index != -1)
@@ -301,7 +307,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
- if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ) {
+ if( (UE_id<0) || (UE_id>=NUMBER_OF_DLSCH_MAX) ) {
LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id);
return;
}
@@ -476,7 +482,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->harq_pid = rel8->harq_process;
((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->dai = rel8->downlink_assignment_index;
((DCI1A_20MHz_TDD_1_6_t *)dci_pdu)->padding = 0;
- // printf("TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",mcs,rballoc,rv,NPRB);
+ //LOG_D(PHY,"TDD 1A: mcs %d, rballoc %x,rv %d, NPRB %d\n",rel8->mcs_1,rel8->resource_block_coding,rel8->redundancy_version_1,NPRB);
} else {
dci_alloc->dci_length = sizeof_DCI1A_20MHz_FDD_t;
((DCI1A_20MHz_FDD_t *)dci_pdu)->type = 1;
@@ -535,7 +541,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,
dlsch0->harq_mask |= (1 << rel8->harq_process);
- if (rel8->rnti_type == 1) LOG_D(PHY,"DCI 1A: round %d, mcs %d, TBS %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,dlsch0_harq->TBS,rel8->resource_block_coding,
+ if (rel8->rnti != SI_RNTI) LOG_D(PHY,"DCI 1A: round %d, mcs %d, TBS %d, rballoc %x, rv %d, rnti %x, harq process %d\n",dlsch0_harq->round,rel8->mcs_1,dlsch0_harq->TBS,rel8->resource_block_coding,
rel8->redundancy_version_1,rel8->rnti,rel8->harq_process);
break;
@@ -1550,7 +1556,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc,mDCI_ALLOC_t *dc
dci_alloc->i0 = rel13->initial_transmission_sf_io;
UE_id = find_dlsch (rel13->rnti, eNB, SEARCH_EXIST_OR_FREE);
AssertFatal (UE_id != -1, "no free or exiting dlsch_context\n");
- AssertFatal (UE_id < NUMBER_OF_UE_MAX, "returned UE_id %d >= %d(NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX);
+ AssertFatal (UE_id < NUMBER_OF_DLSCH_MAX, "returned UE_id %d >= %d(NUMBER_OF_DLSCH_MAX)\n", UE_id, NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch0_harq = dlsch0->harq_processes[rel13->harq_process];
dci_alloc->ra_flag = 0;
@@ -1955,7 +1961,7 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_proc_t *proc,
if(frame_parms->frame_type == TDD) {
UE_id = find_ulsch(pdu->dci_pdu_rel8.rnti, eNB,SEARCH_EXIST_OR_FREE);
- if(UE_id != -1) {
+ if(UE_id >=0 -1 || UE_id < NUMBER_OF_ULSCH_MAX) {
eNB->ulsch[UE_id]->harq_processes[pdu->dci_pdu_rel8.harq_pid]->V_UL_DAI = dai +1;
}
}
diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
index 583d12eedb..64e74ebfbf 100644
--- a/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
+++ b/openair1/PHY/LTE_TRANSPORT/dci_tools_common.c
@@ -32,7 +32,6 @@
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
-#include "SCHED/sched_eNB.h"
#ifdef DEBUG_DCI_TOOLS
#include "PHY/phy_vars.h"
#endif
@@ -43,7 +42,6 @@
//#define DEBUG_HARQ
-#include "LAYER2/MAC/mac.h"
//#define DEBUG_DCI
@@ -100,7 +98,6 @@ uint16_t RIV2nb_rb_LUT100[6000];
uint16_t RIV2first_rb_LUT100[6000];
uint16_t RIV_max100=0;
-extern RAN_CONTEXT_t RC;
extern uint32_t current_dlsch_cqi;
@@ -273,15 +270,6 @@ uint16_t get_nCCE(uint8_t num_pdcch_symbols,LTE_DL_FRAME_PARMS *frame_parms,uint
-uint16_t get_nCCE_mac(uint8_t Mod_id,uint8_t CC_id,int num_pdcch_symbols,int subframe)
-{
-
- // check for eNB only !
- return(get_nCCE(num_pdcch_symbols,
- &RC.eNB[Mod_id][CC_id]->frame_parms,
- get_mi(&RC.eNB[Mod_id][CC_id]->frame_parms,subframe)));
-}
-
void conv_eMTC_rballoc (uint16_t resource_block_coding, uint32_t N_RB_DL, uint32_t * rb_alloc)
{
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
index 3eb44d98fa..b5bcb0848d 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_coding.c
@@ -96,6 +96,7 @@ void free_eNB_dlsch(LTE_eNB_DLSCH_t *dlsch) {
}
+
LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
unsigned char Mdlharq,
uint32_t Nsoft,
@@ -110,7 +111,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
switch (N_RB_DL) {
case 6:
- bw_scaling =16;
+ bw_scaling = 4;
break;
case 25:
@@ -160,7 +161,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
for (i=0; iharq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
- LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
+ LOG_I(PHY, "Required DLSCH mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
MAX_DLSCH_PAYLOAD_BYTES/bw_scaling,bw_scaling, i,dlsch->harq_processes[i]);
if (dlsch->harq_processes[i]) {
@@ -169,9 +170,9 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
dlsch->harq_processes[i]->b = (unsigned char *)malloc16(MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
if (dlsch->harq_processes[i]->b) {
- bzero(dlsch->harq_processes[i]->b,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
+ memset(dlsch->harq_processes[i]->b,0,MAX_DLSCH_PAYLOAD_BYTES/bw_scaling);
} else {
- printf("Can't get b\n");
+ AssertFatal(1==0,"Can't get b\n");
exit_flag=1;
}
@@ -181,15 +182,15 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
dlsch->harq_processes[i]->c[r] = (uint8_t *)malloc16(((r==0)?8:0) + 3+ 768);
if (dlsch->harq_processes[i]->c[r]) {
- bzero(dlsch->harq_processes[i]->c[r],((r==0)?8:0) + 3+ 768);
+ memset(dlsch->harq_processes[i]->c[r],0,((r==0)?8:0) + 3+ 768);
} else {
- printf("Can't get c\n");
+ AssertFatal(1==0,"Can't get c\n");
exit_flag=2;
}
}
}
} else {
- printf("Can't get harq_p %d\n",i);
+ AssertFatal(1==0,"Can't get harq_p %d\n",i);
exit_flag=3;
}
}
@@ -203,7 +204,7 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,
}
}
- LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
+ LOG_I(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
exit_flag, sizeof(LTE_eNB_DLSCH_t));
free_eNB_dlsch(dlsch);
return(NULL);
@@ -360,6 +361,7 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
proc->nbEncode=0;
+
// if (hadlsch->Ndi == 1) { // this is a new packet
if (hadlsch->round == 0) { // this is a new packet
// Add 24-bit crc (polynomial A) to payload
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
index 347fbb026b..aba4a464f2 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c
@@ -2375,16 +2375,14 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
for (l=num_pdcch_symbols; lmimo_mode,
pmi2hex_2Ar2(dlsch0_harq->pmi_alloc),
mod_order0,
mod_order1,
rb_alloc[0]
);
-#endif
}
if (frame_parms->Ncp==0) { // normal prefix
@@ -2980,7 +2978,7 @@ int allocate_REs_in_RB_MCH_khz_1dot25(int32_t **txdataF,
case 2: //QPSK
- LOG_D(PHY,"%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
+ LOG_D(PHY,"%d : %d,%d => ",tti_offset,((int16_t*)&txdataF[0][tti_offset])[0],((int16_t*)&txdataF[0][tti_offset])[1]);
((int16_t*)&txdataF[0][tti_offset])[0] = (x0[*jj]==1) ? (-gain_lin_QPSK) : gain_lin_QPSK; //I //b_i
*jj = *jj + 1;
@@ -3082,7 +3080,7 @@ int mch_modulation_khz_1dot25(int32_t **txdataF,
uint8_t skip_dc=0;
uint8_t mod_order = dlsch->harq_processes[0]->Qm;
int16_t qam16_table_a[4],qam64_table_a[8];//,qam16_table_b[4],qam64_table_b[8];
- int16_t *qam_table_s;
+ int16_t *qam_table_s=qam16_table_a;
nsymb_pmch = 1;
nsymb = (frame_parms->Ncp == NORMAL) ? 14 : 12;
@@ -3125,12 +3123,8 @@ int mch_modulation_khz_1dot25(int32_t **txdataF,
}
- if (mod_order == 4)
- qam_table_s = qam16_table_a;
- else if (mod_order == 6)
+ if (mod_order == 6)
qam_table_s = qam64_table_a;
- else
- qam_table_s = NULL;
//LOG_I(PHY,"Allocated rb %d, subframe_offset %d,amp %d\n",rb,subframe_offset,amp);
allocate_REs_in_RB_MCH_khz_1dot25(txdataF,
diff --git a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c
index b03f59fb78..015a95a862 100644
--- a/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c
+++ b/openair1/PHY/LTE_TRANSPORT/dlsch_scrambling.c
@@ -113,9 +113,6 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
x2 = ((Ns>>1)<<9) + frame_parms->Nid_cell_mbsfn; //this is c_init in 36.211 Sec 6.3.1 for PMCH
}
-#ifdef DEBUG_SCRAMBLING
- printf("scrambling: i0 %d rnti %x, q %d, Ns %d, Nid_cell %d, G %d x2 %x\n",dlsch->i0,dlsch->rnti,q,Ns,frame_parms->Nid_cell, G, x2);
-#endif
s = lte_gold_generic(&x1, &x2, 1);
for (n=0; n<(1+(G>>5)); n++) {
diff --git a/openair1/PHY/LTE_TRANSPORT/if4_tools.c b/openair1/PHY/LTE_TRANSPORT/if4_tools.c
index 95ad420028..09c0b4ba0f 100644
--- a/openair1/PHY/LTE_TRANSPORT/if4_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/if4_tools.c
@@ -30,10 +30,13 @@
* \warning
*/
-#include "PHY/defs_eNB.h"
+#include
+//#include "PHY/defs_eNB.h"
+#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h"
-#include "PHY/phy_extern.h"
-#include "SCHED/sched_eNB.h"
+//#include "PHY/phy_extern.h"
+//#include "SCHED/sched_eNB.h"
+lte_subframe_t subframe_select(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe);
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
diff --git a/openair1/PHY/LTE_TRANSPORT/if5_tools.c b/openair1/PHY/LTE_TRANSPORT/if5_tools.c
index f39f3ef872..e2bec337aa 100644
--- a/openair1/PHY/LTE_TRANSPORT/if5_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/if5_tools.c
@@ -31,11 +31,11 @@
*/
#include
-#include "PHY/defs_eNB.h"
+#include
+#include "PHY/defs_RU.h"
#include "PHY/TOOLS/alaw_lut.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
#include "targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h"
-#include
#include "common/utils/LOG/vcd_signal_dumper.h"
//#define DEBUG_DL_MOBIPASS
//#define DEBUG_UL_MOBIPASS
@@ -1469,7 +1469,7 @@ void recv_IF5(RU_t *ru, openair0_timestamp *proc_timestamp, int subframe, uint16
// HYPOTHESIS: first packet per subframe has lowest timestamp of subframe
// should detect out of order and act accordingly ....
AssertFatal(aid==0 || aid==1,"aid %d != 0 or 1\n",aid);
- //LOG_I(PHY,"rxp[%d] %p, dest %p, offset %d (%lld,%lld)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(timestamp[packet_id]-timestamp[0]),timestamp[packet_id],timestamp[0]);
+ LOG_D(PHY,"rxp[%d] %p, dest %p, offset %d (%llu,%llu)\n",aid,rxp[aid],rxp[aid]+(timestamp[packet_id]-timestamp[0]),(int)(timestamp[packet_id]-timestamp[0]),(long long unsigned int)timestamp[packet_id],(long long unsigned int)timestamp[0]);
memcpy((void*)(rxp[aid]+(timestamp[packet_id]-timestamp[0])),
(void*)temp_rx,
spp_eth<<2);
diff --git a/openair1/PHY/LTE_TRANSPORT/pbch.c b/openair1/PHY/LTE_TRANSPORT/pbch.c
index dfa990269e..8e9a968827 100644
--- a/openair1/PHY/LTE_TRANSPORT/pbch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pbch.c
@@ -72,6 +72,7 @@ int allocate_pbch_REs_in_RB(LTE_DL_FRAME_PARMS *frame_parms,
first_re=0;
last_re=12;
+
for (re=first_re; re
#include
+#include "common/utils/lte/prach_utils.h"
void rx_prach0(PHY_VARS_eNB *eNB,
RU_t *ru,
@@ -84,7 +85,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
uint8_t aa;
int32_t lev;
int16_t levdB;
- int fft_size,log2_ifft_size;
+ int fft_size=0,log2_ifft_size;
int16_t prach_ifft_tmp[2048*2] __attribute__((aligned(32)));
int32_t *prach_ifft=(int32_t *)NULL;
int32_t **prach_ifftp=(int32_t **)NULL;
@@ -112,7 +113,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ConfigIndex = fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[ce_level];
Ncs_config = fp->prach_emtc_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
restricted_set = fp->prach_emtc_config_common.prach_ConfigInfo.highSpeedFlag;
- n_ra_prb = get_prach_prb_offset(fp,prach_ConfigIndex,
+ n_ra_prb = get_prach_prb_offset(fp->frame_type,fp->tdd_config,fp->N_RB_UL,fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[ce_level],
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
tdd_mapindex,Nf);
// update pointers to results for ce_level
@@ -124,7 +125,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prach_ConfigIndex = fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
Ncs_config = fp->prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig;
restricted_set = fp->prach_config_common.prach_ConfigInfo.highSpeedFlag;
- n_ra_prb = get_prach_prb_offset(fp,prach_ConfigIndex,
+ n_ra_prb = get_prach_prb_offset(fp->frame_type,fp->tdd_config,fp->N_RB_UL,fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex,Nf);
}
@@ -140,7 +141,7 @@ void rx_prach0(PHY_VARS_eNB *eNB,
rxsigF = eNB->prach_vars_br.rxsigF[ce_level];
if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,
"PRACH (eNB) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d, rootSequenceIndex %d, repetition number %d,numRepetitionsPrePreambleAttempt %d\n",
br_flag,ce_level,frame_prach,subframe,
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],
@@ -153,24 +154,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
prachF = eNB->prach_vars.prachF;
rxsigF = eNB->prach_vars.rxsigF[0];
- if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,
+ //if (LOG_DEBUGFLAG(PRACH)) {
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (eNB) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d , rootSequenceIndex %d\n", subframe,
fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex,rootSequenceIndex);
- }
+ //}
}
} else {
if (br_flag == 1) {
rxsigF = ru->prach_rxsigF_br[ce_level];
if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach (br_flag %d, ce_level %d) for frame %d subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
br_flag,ce_level,frame_prach,subframe,fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[ce_level],prach_ConfigIndex);
}
} else {
rxsigF = ru->prach_rxsigF[0];
if (LOG_DEBUGFLAG(PRACH)) {
- if (((frame_prach)&1023) < 20) LOG_I(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
+ if (((frame_prach)&1023) < 20) LOG_D(PHY,"PRACH (RU) : running rx_prach for subframe %d, prach_FreqOffset %d, prach_ConfigIndex %d\n",
subframe,fp->prach_config_common.prach_ConfigInfo.prach_FreqOffset,prach_ConfigIndex);
}
}
@@ -299,11 +300,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 6:
if (prach_fmt == 4) {
dft(DFT_256,prach2,rxsigF[aa],1);
+ fft_size=256;
} else {
dft(DFT_1536,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_1536,prach2+3072,rxsigF[aa]+3072,1);
+ fft_size=1536;
}
break;
@@ -311,13 +314,14 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 15:
if (prach_fmt == 4) {
dft(DFT_256,prach2,rxsigF[aa],1);
+ fft_size=256;
} else {
dft(DFT_3072,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_3072,prach2+6144,rxsigF[aa]+6144,1);
}
-
+ fft_size=3072;
break;
case 25:
@@ -339,11 +343,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 50:
if (prach_fmt == 4) {
dft(DFT_2048,prach2,rxsigF[aa],1);
+ fft_size=2048;
} else {
dft(DFT_12288,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_12288,prach2+24576,rxsigF[aa]+24576,1);
+ fft_size=12288;
}
break;
@@ -351,11 +357,13 @@ void rx_prach0(PHY_VARS_eNB *eNB,
case 75:
if (prach_fmt == 4) {
dft(DFT_3072,prach2,rxsigF[aa],1);
+ fft_size=3072;
} else {
dft(DFT_18432,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
+ fft_size=18432;
}
break;
@@ -364,20 +372,24 @@ void rx_prach0(PHY_VARS_eNB *eNB,
if (fp->threequarter_fs==0) {
if (prach_fmt == 4) {
dft(DFT_4096,prach2,rxsigF[aa],1);
+ fft_size=2048;
} else {
dft(DFT_24576,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_24576,prach2+49152,rxsigF[aa]+49152,1);
+ fft_size=24576;
}
} else {
if (prach_fmt == 4) {
dft(DFT_3072,prach2,rxsigF[aa],1);
+ fft_size=3072;
} else {
dft(DFT_18432,prach2,rxsigF[aa],1);
if (prach_fmt>1)
dft(DFT_18432,prach2+36864,rxsigF[aa]+36864,1);
+ fft_size=18432;
}
}
@@ -547,7 +559,6 @@ void rx_prach0(PHY_VARS_eNB *eNB,
}
log2_ifft_size = 10;
- fft_size = 6144;
if (new_dft == 1) {
new_dft = 0;
diff --git a/openair1/PHY/LTE_TRANSPORT/prach_common.c b/openair1/PHY/LTE_TRANSPORT/prach_common.c
index 393d4ca3f8..e366e8edbc 100644
--- a/openair1/PHY/LTE_TRANSPORT/prach_common.c
+++ b/openair1/PHY/LTE_TRANSPORT/prach_common.c
@@ -34,7 +34,7 @@
#include "PHY/phy_extern.h"
#include "PHY/phy_extern_ue.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
-
+#include "common/utils/lte/prach_utils.h"
uint16_t NCS_unrestricted[16] = {0,13,15,18,22,26,32,38,46,59,76,93,119,167,279,419};
uint16_t NCS_restricted[15] = {15,18,22,26,32,38,46,55,68,82,100,128,158,202,237}; // high-speed case
@@ -44,6 +44,9 @@ int16_t ru[2*839]; // quantized roots of unity
uint32_t ZC_inv[839]; // multiplicative inverse for roots u
uint16_t du[838];
+extern PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7];
+
+/*
// This is table 5.7.1-4 from 36.211
PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = {
// TDD Configuration Index 0
@@ -254,7 +257,7 @@ PRACH_TDD_PREAMBLE_MAP tdd_preamble_map[64][7] = {
}
};
-
+*/
uint16_t prach_root_sequence_map0_3[838] = { 129, 710, 140, 699, 120, 719, 210, 629, 168, 671, 84, 755, 105, 734, 93, 746, 70, 769, 60, 779,
2, 837, 1, 838,
@@ -378,192 +381,13 @@ uint8_t get_fid_prach_tdd(module_id_t Mod_id,uint8_t tdd_map_index) {
return(tdd_preamble_map[fp->prach_config_common.prach_ConfigInfo.prach_ConfigIndex][fp->tdd_config].map[tdd_map_index].f_ra);
}
-uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type) {
- if (frame_type == FDD) // FDD
- return(prach_ConfigIndex>>4);
- else {
- if (prach_ConfigIndex < 20)
- return (0);
-
- if (prach_ConfigIndex < 30)
- return (1);
-
- if (prach_ConfigIndex < 40)
- return (2);
-
- if (prach_ConfigIndex < 48)
- return (3);
- else
- return (4);
- }
-}
-
-uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
- uint8_t prach_ConfigIndex,
- uint8_t n_ra_prboffset,
- uint8_t tdd_mapindex, uint16_t Nf) {
- lte_frame_type_t frame_type = frame_parms->frame_type;
- uint8_t tdd_config = frame_parms->tdd_config;
- uint8_t n_ra_prb;
- uint8_t f_ra,t1_ra;
- uint8_t prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
- uint8_t Nsp=2;
-
- if (frame_type == TDD) { // TDD
- if (tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach==0) {
- LOG_E(PHY, "Illegal prach_ConfigIndex %"PRIu8"", prach_ConfigIndex);
- return(-1);
- }
-
- // adjust n_ra_prboffset for frequency multiplexing (p.36 36.211)
- f_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[tdd_mapindex].f_ra;
-
- if (prach_fmt < 4) {
- if ((f_ra&1) == 0) {
- n_ra_prb = n_ra_prboffset + 6*(f_ra>>1);
- } else {
- n_ra_prb = frame_parms->N_RB_UL - 6 - n_ra_prboffset + 6*(f_ra>>1);
- }
- } else {
- if ((tdd_config >2) && (tdd_config<6))
- Nsp = 2;
-
- t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
-
- if ((((Nf&1)*(2-Nsp)+t1_ra)&1) == 0) {
- n_ra_prb = 6*f_ra;
- } else {
- n_ra_prb = frame_parms->N_RB_UL - 6*(f_ra+1);
- }
- }
- } else { //FDD
- n_ra_prb = n_ra_prboffset;
- }
-
- return(n_ra_prb);
-}
-
-int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe) {
- // uint8_t prach_ConfigIndex = frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
- uint8_t tdd_config = frame_parms->tdd_config;
- uint8_t t0_ra;
- uint8_t t1_ra;
- uint8_t t2_ra;
- int prach_mask = 0;
-
- if (frame_parms->frame_type == FDD) { //FDD
- //implement Table 5.7.1-2 from 36.211 (Rel-10, p.41)
- if ((((frame&1) == 1) && (subframe < 9)) ||
- (((frame&1) == 0) && (subframe == 9))) // This is an odd frame, ignore even-only PRACH frames
- if (((prach_ConfigIndex&0xf)<3) || // 0,1,2,16,17,18,32,33,34,48,49,50
- ((prach_ConfigIndex&0x1f)==18) || // 18,50
- ((prach_ConfigIndex&0xf)==15)) // 15,47
- return(0);
-
- switch (prach_ConfigIndex&0x1f) {
- case 0:
- case 3:
- if (subframe==1) prach_mask = 1;
-
- break;
-
- case 1:
- case 4:
- if (subframe==4) prach_mask = 1;
-
- break;
-
- case 2:
- case 5:
- if (subframe==7) prach_mask = 1;
-
- break;
-
- case 6:
- if ((subframe==1) || (subframe==6)) prach_mask=1;
-
- break;
-
- case 7:
- if ((subframe==2) || (subframe==7)) prach_mask=1;
-
- break;
-
- case 8:
- if ((subframe==3) || (subframe==8)) prach_mask=1;
-
- break;
-
- case 9:
- if ((subframe==1) || (subframe==4) || (subframe==7)) prach_mask=1;
-
- break;
-
- case 10:
- if ((subframe==2) || (subframe==5) || (subframe==8)) prach_mask=1;
-
- break;
-
- case 11:
- if ((subframe==3) || (subframe==6) || (subframe==9)) prach_mask=1;
-
- break;
-
- case 12:
- if ((subframe&1)==0) prach_mask=1;
-
- break;
-
- case 13:
- if ((subframe&1)==1) prach_mask=1;
-
- break;
-
- case 14:
- prach_mask=1;
- break;
-
- case 15:
- if (subframe==9) prach_mask=1;
-
- break;
- }
- } else { // TDD
- AssertFatal(prach_ConfigIndex<64,
- "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
- AssertFatal(tdd_preamble_map[prach_ConfigIndex][tdd_config].num_prach>0,
- "Illegal prach_ConfigIndex %d for ",prach_ConfigIndex);
- t0_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t0_ra;
- t1_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t1_ra;
- t2_ra = tdd_preamble_map[prach_ConfigIndex][tdd_config].map[0].t2_ra;
-#ifdef PRACH_DEBUG
- LOG_I(PHY,"[PRACH] Checking for PRACH format (ConfigIndex %d) in TDD subframe %d (%d,%d,%d)\n",
- prach_ConfigIndex,
- subframe,
- t0_ra,t1_ra,t2_ra);
-#endif
-
- if ((((t0_ra == 1) && ((frame &1)==0))|| // frame is even and PRACH is in even frames
- ((t0_ra == 2) && ((frame &1)==1))|| // frame is odd and PRACH is in odd frames
- (t0_ra == 0)) && // PRACH is in all frames
- (((subframe<5)&&(t1_ra==0)) || // PRACH is in 1st half-frame
- (((subframe>4)&&(t1_ra==1))))) { // PRACH is in 2nd half-frame
- if ((prach_ConfigIndex<48) && // PRACH only in normal UL subframe
- (((subframe%5)-2)==t2_ra)) prach_mask=1;
- else if ((prach_ConfigIndex>47) && (((subframe%5)-1)==t2_ra)) prach_mask=1; // PRACH can be in UpPTS
- }
- }
-
- return(prach_mask);
-}
-
int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame, uint8_t subframe) {
uint8_t prach_ConfigIndex = frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
- int prach_mask = is_prach_subframe0(frame_parms, prach_ConfigIndex, frame, subframe);
+ int prach_mask = is_prach_subframe0(frame_parms->tdd_config,frame_parms->frame_type, prach_ConfigIndex, frame, subframe);
for (int i=0; i<4; i++) {
if (frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_CElevel_enable[i] == 1)
- prach_mask |= (is_prach_subframe0(frame_parms, frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i],
+ prach_mask |= (is_prach_subframe0(frame_parms->tdd_config,frame_parms->frame_type, frame_parms->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[i],
frame, subframe) << (i+1));
}
diff --git a/openair1/PHY/LTE_TRANSPORT/prach_extern.h b/openair1/PHY/LTE_TRANSPORT/prach_extern.h
index 47fbd93ad7..3404646923 100644
--- a/openair1/PHY/LTE_TRANSPORT/prach_extern.h
+++ b/openair1/PHY/LTE_TRANSPORT/prach_extern.h
@@ -35,7 +35,7 @@
#include "PHY/sse_intrin.h"
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
+//#include "PHY/phy_extern.h"
//#define PRACH_DEBUG 1
//#define PRACH_WRITE_OUTPUT_DEBUG 1
@@ -74,17 +74,6 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
uint8_t get_fid_prach_tdd(module_id_t Mod_id,uint8_t tdd_map_index);
-uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
-
-
-uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
- uint8_t prach_ConfigIndex,
- uint8_t n_ra_prboffset,
- uint8_t tdd_mapindex, uint16_t Nf);
-
-
-int is_prach_subframe0(LTE_DL_FRAME_PARMS *frame_parms,uint8_t prach_ConfigIndex,uint32_t frame, uint8_t subframe);
-
int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t subframe);
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch.c b/openair1/PHY/LTE_TRANSPORT/pucch.c
index c72fa1b480..3270066448 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch.c
@@ -65,10 +65,41 @@ int16_t cfo_pucch_ep[24*6] = {24278,-22005,29621,-14010,32412,-4808,32412,4807,2
+void dump_uci_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame) {
+
+ int strpos=0;
+ char output[16384];
+
+ for (int i=0;iuci_stats[i].rnti>0) {
+ eNB_UCI_STATS_t *uci_stats = &eNB->uci_stats[i];
+ strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch1_trials %d, pucch1_n0 %d dB, pucch1_thres %d dB, current pucch1_stat_pos %d dB, current pucch1_stat_neg %d dB, positive SR count %d\n",
+ i,uci_stats->rnti,uci_stats->pucch1_trials,eNB->measurements.n0_pucch_dB/*max(eNB->measurements.n0_subband_power_tot_dB[0], eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1])*/,uci_stats->pucch1_thres,dB_fixed(uci_stats->current_pucch1_stat_pos),dB_fixed(uci_stats->current_pucch1_stat_neg),uci_stats->pucch1_positive_SR);
+ strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch1_low (%d,%d)dB pucch1_high (%d,%d)dB\n",
+ i,uci_stats->rnti,
+ dB_fixed(uci_stats->pucch1_low_stat[0]),
+ dB_fixed(uci_stats->pucch1_low_stat[1]),
+ dB_fixed(uci_stats->pucch1_high_stat[0]),
+ dB_fixed(uci_stats->pucch1_high_stat[1]));
+
+ strpos+=sprintf(output+strpos,"UCI %d RNTI %x: pucch1a_trials %d, pucch1a_stat (%d,%d), pucch1b_trials %d, pucch1b_stat (%d,%d) pucch1ab_DTX %d\n",
+ i,uci_stats->rnti,
+ uci_stats->pucch1a_trials,
+ uci_stats->current_pucch1a_stat_re,
+ uci_stats->current_pucch1a_stat_im,
+ uci_stats->pucch1b_trials,
+ uci_stats->current_pucch1b_stat_re,
+ uci_stats->current_pucch1b_stat_im,
+ uci_stats->pucch1ab_DTX);
+ }
+ }
+ if (fd) fprintf(fd,"%s",output);
+ else printf("%s",output);
+}
/* PUCCH format3 >> */
/* SubCarrier Demap */
uint16_t pucchfmt3_subCarrierDeMapping( PHY_VARS_eNB *eNB,
- int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
+ int16_t SubCarrierDeMapData[4][14][12][2],
uint16_t n3_pucch ) {
LTE_eNB_COMMON *eNB_common_vars = &eNB->common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
@@ -118,8 +149,8 @@ uint16_t pucchfmt3_subCarrierDeMapping( PHY_VARS_eNB *eNB,
}
/* cyclic shift hopping remove */
-uint16_t pucchfmt3_Baseseq_csh_remove( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
- int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2],
+uint16_t pucchfmt3_Baseseq_csh_remove( int16_t SubCarrierDeMapData[4][14][12][2],
+ int16_t CshData_fmt3[4][14][12][2],
LTE_DL_FRAME_PARMS *frame_parms,
uint8_t subframe,
uint8_t ncs_cell[20][7] ) {
@@ -169,9 +200,9 @@ const int16_t TBL_3_SF5_GEN_N_DASH_NS[MAXROW_TBL_SF5_OS_IDX] = {0,3,6,8,10};
const int16_t TBL_3_SF4_GEN_N_DASH_NS[MAXROW_TBL_SF4_OS_IDX] = {0,3,6,9};
/* Channel estimation */
-uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2],
- double delta_theta[NB_ANTENNAS_RX][12],
- int16_t ChestValue[NB_ANTENNAS_RX][2][12][2],
+uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[4][14][12][2],
+ double delta_theta[4][12],
+ int16_t ChestValue[4][2][12][2],
int16_t *Interpw,
uint8_t subframe,
uint8_t shortened_format,
@@ -183,12 +214,12 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
int16_t np, np_n, ip_ind=-1;
//int16_t npucch_sf;
int16_t calctmp[2];
- int16_t BsCshData[NB_ANTENNAS_RX][D_NSYM1SF][D_NSC1RB][2];
- //int16_t delta_theta_calctmp[NB_ANTENNAS_RX][4][D_NSC1RB][2], delta_theta_comp[NB_ANTENNAS_RX][D_NSC1RB][2];
- int16_t delta_theta_comp[NB_ANTENNAS_RX][D_NSC1RB][2];
- int16_t CsData_allavg[NB_ANTENNAS_RX][14][2];
- int16_t CsData_temp[NB_ANTENNAS_RX][D_NSYM1SF][D_NSC1RB][2];
- int32_t IP_CsData_allsfavg[NB_ANTENNAS_RX][14][4][2];
+ int16_t BsCshData[4][D_NSYM1SF][D_NSC1RB][2];
+ //int16_t delta_theta_calctmp[4][4][D_NSC1RB][2], delta_theta_comp[4][D_NSC1RB][2];
+ int16_t delta_theta_comp[4][D_NSC1RB][2];
+ int16_t CsData_allavg[4][14][2];
+ int16_t CsData_temp[4][D_NSYM1SF][D_NSC1RB][2];
+ int32_t IP_CsData_allsfavg[4][14][4][2];
int32_t IP_allavg[D_NPUCCH_SF5];
//int16_t temp_ch[2];
int16_t m[NUMBER_OF_UE_MAX], m_self=0, same_m_number;
@@ -432,9 +463,9 @@ uint16_t pucchfmt3_ChannelEstimation( int16_t SubCarrierDeMapData[NB_ANTENNAS_RX
}
/* Channel Equalization */
-uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2],
- int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2],
- int16_t ChestValue[NB_ANTENNAS_RX][2][12][2],
+uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[4][14][12][2],
+ int16_t ChdetAfterValue_fmt3[4][14][12][2],
+ int16_t ChestValue[4][2][12][2],
LTE_DL_FRAME_PARMS *frame_parms) {
int16_t aa, sltNo, symNo, k;
@@ -457,9 +488,9 @@ uint16_t pucchfmt3_Equalization( int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2]
}
/* Frequency deviation remove AFC */
-uint16_t pucchfmt3_FrqDevRemove( int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2],
- double delta_theta[NB_ANTENNAS_RX][12],
- int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2],
+uint16_t pucchfmt3_FrqDevRemove( int16_t ChdetAfterValue_fmt3[4][14][12][2],
+ double delta_theta[4][12],
+ int16_t RemoveFrqDev_fmt3[4][2][5][12][2],
LTE_DL_FRAME_PARMS *frame_parms ) {
int16_t aa, sltNo, symNo1slt, k, n;
double calctmp[2];
@@ -509,8 +540,8 @@ const int16_t TBL_3_SF4[MAXROW_TBL_SF4_fmt3][MAXCLM_TBL_SF4][2] = {
};
/* orthogonal sequence remove */
-uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2],
- int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2],
+uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[4][2][5][12][2],
+ int16_t Fmt3xDataRmvOrth[4][2][5][12][2],
uint8_t shortened_format,
uint16_t n3_pucch,
LTE_DL_FRAME_PARMS *frame_parms ) {
@@ -556,7 +587,7 @@ uint16_t pucchfmt3_OrthSeqRemove( int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5
}
/* averaging antenna */
-uint16_t pucchfmt3_AvgAnt( int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2],
+uint16_t pucchfmt3_AvgAnt( int16_t Fmt3xDataRmvOrth[4][2][5][12][2],
int16_t Fmt3xDataAvgAnt[2][5][12][2],
uint8_t shortened_format,
LTE_DL_FRAME_PARMS *frame_parms ) {
@@ -856,7 +887,7 @@ uint32_t calc_pucch_1x_interference(PHY_VARS_eNB *eNB,
uint32_t rx_pucch(PHY_VARS_eNB *eNB,
PUCCH_FMT_t fmt,
- uint8_t UE_id,
+ uint8_t UCI_id,
uint16_t n1_pucch,
uint16_t n2_pucch,
uint8_t shortened_format,
@@ -871,15 +902,15 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
static int first_call = 1;
LTE_eNB_COMMON *common_vars = &eNB->common_vars;
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
- int8_t sigma2_dB = eNB->measurements.n0_pucch_dB;
+ int8_t sigma2_dB = /*max(eNB->measurements.n0_subband_power_tot_dB[0], eNB->measurements.n0_subband_power_tot_dB[eNB->frame_parms.N_RB_UL-1]); */eNB->measurements.n0_pucch_dB;
uint32_t u,v,n,aa;
uint32_t z[12*14];
int16_t *zptr;
- int16_t rxcomp[NB_ANTENNAS_RX][2*12*14];
+ int16_t rxcomp[4][2*12*14];
uint8_t ns,N_UL_symb,nsymb,n_oc,n_oc0,n_oc1;
uint8_t c = (frame_parms->Ncp==0) ? 3 : 2;
- uint16_t nprime,nprime0,nprime1;
+ int16_t nprime,nprime0,nprime1;
uint16_t i,j,re_offset,thres,h,off;
uint8_t Nprime_div_deltaPUCCH_Shift,Nprime,d;
uint8_t m,l,refs,phase,re,l2,phase_max=0;
@@ -887,12 +918,12 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
int16_t tmp_re,tmp_im,W_re=0,W_im=0;
int16_t *rxptr;
uint32_t symbol_offset;
- int16_t stat_ref_re,stat_ref_im,*cfo;
- int16_t chest0_re[NB_ANTENNAS_RX][12],chest0_im[NB_ANTENNAS_RX][12];
- int16_t chest1_re[NB_ANTENNAS_RX][12],chest1_im[NB_ANTENNAS_RX][12];
+ int16_t stat0_ref_re[4],stat0_ref_im[4],stat1_ref_re[4],stat1_ref_im[4],*cfo;
+ int16_t chest0_re[4][12],chest0_im[4][12];
+ int16_t chest1_re[4][12],chest1_im[4][12];
int32_t chest_mag;
- int32_t stat_re=0,stat_im=0;
- uint32_t stat,stat_max=0;
+ int32_t stat0_re[4],stat1_re[4],stat0_im[4],stat1_im[4];
+ uint32_t stat0[4],stat1[4],stat_max=0,stat0_max[4],stat1_max[4];
uint8_t log2_maxh;
uint8_t deltaPUCCH_Shift = frame_parms->pucch_config_common.deltaPUCCH_Shift;
uint8_t NRB2 = frame_parms->pucch_config_common.nRB_CQI;
@@ -905,13 +936,13 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
int chL;
/* PUCCH format3 >> */
uint16_t Ret = 0;
- int16_t SubCarrierDeMapData[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
- int16_t CshData_fmt3[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
- double delta_theta[NB_ANTENNAS_RX][12]; //[Antenna][Subcarrier][Complex]
- int16_t ChestValue[NB_ANTENNAS_RX][2][12][2]; //[Antenna][Slot][Subcarrier][Complex]
- int16_t ChdetAfterValue_fmt3[NB_ANTENNAS_RX][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
- int16_t RemoveFrqDev_fmt3[NB_ANTENNAS_RX][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
- int16_t Fmt3xDataRmvOrth[NB_ANTENNAS_RX][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
+ int16_t SubCarrierDeMapData[4][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
+ int16_t CshData_fmt3[4][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
+ double delta_theta[4][12]; //[Antenna][Subcarrier][Complex]
+ int16_t ChestValue[4][2][12][2]; //[Antenna][Slot][Subcarrier][Complex]
+ int16_t ChdetAfterValue_fmt3[4][14][12][2]; //[Antenna][Symbol][Subcarrier][Complex]
+ int16_t RemoveFrqDev_fmt3[4][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
+ int16_t Fmt3xDataRmvOrth[4][2][5][12][2]; //[Antenna][Slot][PUCCH_Symbol][Subcarrier][Complex]
int16_t Fmt3xDataAvgAnt[2][5][12][2]; //[Slot][PUCCH_Symbol][Subcarrier][Complex]
int16_t Fmt3xDataAvgSym[2][12][2]; //[Slot][Subcarrier][Complex]
int16_t IFFTOutData_Fmt3[2][12][2]; //[Slot][Subcarrier][Complex]
@@ -941,9 +972,27 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
first_call=0;
}
-
+ eNB_UCI_STATS_t *uci_stats = NULL;
if(fmt!=pucch_format3) { /* PUCCH format3 */
+
+ eNB_UCI_STATS_t *first_uci_stats=NULL;
+ for (int i=0;iuci_stats[i].rnti == eNB->uci_vars[UCI_id].rnti) {
+ uci_stats = &eNB->uci_stats[i];
+ break;
+ } else if (first_uci_stats == NULL && eNB->uci_stats[i].rnti == 0) first_uci_stats = &eNB->uci_stats[i];
+ if (uci_stats == NULL) {
+ if (first_uci_stats == NULL) {
+ LOG_E(PHY,"first_uci_stats is NULL\n");
+ return -1;
+ }
+ uci_stats=first_uci_stats;
+ uci_stats->rnti = eNB->uci_vars[UCI_id].rnti;
+ }
+
+ AssertFatal(uci_stats!=NULL,"No stat index found\n");
+ uci_stats->frame = frame;
// TODO
// "SR+ACK/NACK" length is only 7 bits.
// This restriction will be lifted in the future.
@@ -1149,57 +1198,63 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// Do cfo correction and MRC across symbols
if (fmt == pucch_format1) {
+ uci_stats->pucch1_trials++;
#ifdef DEBUG_PUCCH_RX
printf("Doing PUCCH detection for format 1\n");
#endif
stat_max = 0;
for (phase=0; phase<7; phase++) {
- stat=0;
-
+ int stat=0;
for (aa=0; aanb_antennas_rx; aa++) {
+ stat0[aa]=0;stat1[aa]=0;
for (re=0; re<12; re++) {
- stat_re=0;
- stat_im=0;
+ stat0_re[aa]=0;
+ stat0_im[aa]=0;
+ stat1_re[aa]=0;
+ stat1_im[aa]=0;
off=re<<1;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
for (l=0; l<(nsymb>>1); l++) {
- stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
- stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb;
+ stat0_re[aa] += (((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15))/nsymb;
+ stat0_im[aa] += (((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15))/nsymb;
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) , stat %d\n",subframe,phase,l,re,
rxcomp[aa][off],rxcomp[aa][1+off],
cfo[l<<1],cfo[1+(l<<1)],
- stat_re,stat_im,stat);
+ stat0_re[aa],stat0_im[aa],stat);
#endif
}
for (l2=0,l=(nsymb>>1); l < nsymb; l++,l2++) {
- stat_re += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
- stat_im += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
+ stat1_re[aa] += (((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15))/nsymb;
+ stat1_im[aa] += (((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15))/nsymb;
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d,%d) => (%d,%d) x (%d,%d) : (%d,%d), stat %d\n",subframe,phase,l2,re,
rxcomp[aa][off],rxcomp[aa][1+off],
cfo[l2<<1],cfo[1+(l2<<1)],
- stat_re,stat_im,stat);
+ stat1_re[aa],stat1_im[aa],stat);
#endif
}
-
- stat += ((stat_re*stat_re) + (stat_im*stat_im));
+
+ stat0[aa] += ((stat0_re[aa]*stat0_re[aa]) + (stat0_im[aa]*stat0_im[aa]));
+ stat1[aa] += ((stat1_re[aa]*stat1_re[aa]) + (stat1_im[aa]*stat1_im[aa]));
} //re
+ stat+=(stat0[aa]+stat1[aa]);
} // aa
-
if (stat>stat_max) {
stat_max = stat;
phase_max = phase;
+ for (aa=0;aanb_antennas_rx;aa++) {
+ stat0_max[aa] = stat0[aa];
+ stat1_max[aa] = stat1[aa];
+ }
}
} //phase
- // stat_max *= nsymb; // normalize to energy per symbol
- // stat_max /= (frame_parms->N_RB_UL*12); //
stat_max /= 12;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH: stat %d, stat_max %d, phase_max %d\n", stat,stat_max,phase_max);
@@ -1207,12 +1262,14 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
LOG_I(PHY,"[eNB] PUCCH fmt1: stat_max : %d, sigma2_dB %d (%d, %d), phase_max : %d\n",dB_fixed(stat_max),sigma2_dB,eNB->measurements.n0_subband_power_tot_dBm[6],pucch1_thres,phase_max);
#endif
- eNB->pucch1_stats[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = stat_max;
- eNB->pucch1_stats_thres[UE_id][(subframe<<10)+eNB->pucch1_stats_cnt[UE_id][subframe]] = sigma2_dB+pucch1_thres;
- eNB->pucch1_stats_cnt[UE_id][subframe] = (eNB->pucch1_stats_cnt[UE_id][subframe]+1)&1023;
- T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(frame), T_INT(subframe),
+ eNB->pucch1_stats[UCI_id][(subframe<<10)+eNB->pucch1_stats_cnt[UCI_id][subframe]] = stat_max;
+ eNB->pucch1_stats_thres[UCI_id][(subframe<<10)+eNB->pucch1_stats_cnt[UCI_id][subframe]] = sigma2_dB+pucch1_thres;
+ eNB->pucch1_stats_cnt[UCI_id][subframe] = (eNB->pucch1_stats_cnt[UCI_id][subframe]+1)&1023;
+ uci_stats->pucch1_thres = sigma2_dB+pucch1_thres;
+ T(T_ENB_PHY_PUCCH_1_ENERGY, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UCI_id].rnti), T_INT(frame), T_INT(subframe),
T_INT(stat_max), T_INT(sigma2_dB+pucch1_thres));
+
/*
if (eNB->pucch1_stats_cnt[UE_id][subframe] == 0) {
LOG_M("pucch_debug.m","pucch_energy",
@@ -1226,11 +1283,18 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// This is a moving average of the PUCCH1 statistics conditioned on being above or below the threshold
if (sigma2_dB<(dB_fixed(stat_max)-pucch1_thres)) {
*payload = 1;
+ uci_stats->current_pucch1_stat_pos = stat_max;
+ for (int aa=0;aanb_antennas_rx;aa++) {
+ uci_stats->pucch1_low_stat[aa]=stat0_max[aa];
+ uci_stats->pucch1_high_stat[aa]=stat1_max[aa];
+ uci_stats->pucch1_positive_SR++;
+ }
} else {
+ uci_stats->current_pucch1_stat_neg = stat_max;
*payload = 0;
}
- if (UE_id==0) {
+ if (UCI_id==0) {
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_ENERGY,dB_fixed(stat_max));
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_UE0_SR_THRES,sigma2_dB+pucch1_thres);
}
@@ -1239,29 +1303,30 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
LOG_D(PHY,"Doing PUCCH detection for format 1a/1b\n");
#endif
-
+ int stat_re=0,stat_im=0;
for (phase=0; phase<7; phase++) {
- stat=0;
-
+ int stat=0;
for (aa=0; aanb_antennas_rx; aa++) {
+ stat0[aa]=0;
+ stat1[aa]=0;
for (re=0; re<12; re++) {
// compute received energy first slot, seperately for data and reference
// by coherent combining across symbols but not resource elements
// Note: assumption is that channel is stationary over symbols in slot after CFO
- stat_re=0;
- stat_im=0;
- stat_ref_re=0;
- stat_ref_im=0;
+ stat0_re[aa]=0;
+ stat0_im[aa]=0;
+ stat0_ref_re[aa]=0;
+ stat0_ref_im[aa]=0;
off=re<<1;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase] : &cfo_pucch_ep[12*phase];
for (l=0; l<(nsymb>>1); l++) {
if ((l<2)||(l>(nsymb>>1) - 3)) { //data symbols
- stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
- stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+ stat0_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
+ stat0_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
} else { //reference symbols
- stat_ref_re += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
- stat_ref_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
+ stat0_ref_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
+ stat0_ref_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
}
off+=2;
@@ -1274,26 +1339,21 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
}
// this is total energy received, summed over data and reference
- if (fmt==pucch_format1a){
- stat += ((((stat_re*stat_re)) + ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }else{
- stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) +
- ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }
-
+ stat0[aa] += ((((stat0_re[aa]*stat0_re[aa])) + ((stat0_im[aa]*stat0_im[aa])) +
+ ((stat0_ref_re[aa]*stat0_ref_re[aa])) + ((stat0_ref_im[aa]*stat0_ref_im[aa])))/nsymb);
// now second slot
- stat_re=0;
- stat_im=0;
- stat_ref_re=0;
- stat_ref_im=0;
+ stat1_re[aa]=0;
+ stat1_im[aa]=0;
+ stat1_ref_re[aa]=0;
+ stat1_ref_im[aa]=0;
for (l2=0,l=(nsymb>>1); l< nsymb; l++,l2++) {
if ((l2<2) || ((l2>(nsymb>>1) - 3)) ) { // data symbols
- stat_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
- stat_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
+ stat1_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
+ stat1_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
} else { //reference_symbols
- stat_ref_re += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
- stat_ref_im += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
+ stat1_ref_re[aa] += ((rxcomp[aa][off]*(int32_t)cfo[l2<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l2<<1)])>>15);
+ stat1_ref_im[aa] += ((rxcomp[aa][off]*(int32_t)cfo[1+(l2<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l2<<1)])>>15);
}
off+=2;
@@ -1308,20 +1368,16 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
printf("aa%d re %d : phase %d : stat %d\n",aa,re,phase,stat);
#endif
- if (fmt==pucch_format1a){
- stat += ((((stat_re*stat_re)) + ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }else{
- stat += ((((stat_re*stat_re)) + ((stat_im*stat_im)) +
- ((stat_ref_re*stat_ref_re)) + ((stat_ref_im*stat_ref_im)))/nsymb);
- }
-
+ stat1[aa] += ((((stat1_re[aa]*stat1_re[aa])) + ((stat1_im[aa]*stat1_im[aa])) +
+ ((stat1_ref_re[aa]*stat1_ref_re[aa])) + ((stat1_ref_im[aa]*stat1_ref_im[aa])))/nsymb);
} //re
+ stat+=(stat0[aa]+stat1[aa]);
} // aa
#ifdef DEBUG_PUCCH_RX
LOG_D(PHY,"Format 1A: phase %d : stat %d\n",phase,stat);
#endif
-
+
if (stat>stat_max) {
stat_max = stat;
phase_max = phase;
@@ -1332,8 +1388,6 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PUCCH_RX
LOG_I(PHY,"[eNB] PUCCH fmt1a/b: stat_max : %d (%d : sigma2 %d), phase_max : %d\n",stat_max,dB_fixed(stat_max),sigma2_dB,phase_max);
#endif
- stat_re=0;
- stat_im=0;
// Do detection now
@@ -1341,13 +1395,12 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// For instance i assume to skip pucch1_thres from the test below.
// Not 100% sure
- if (sigma2_dB<(dB_fixed(stat_max) - (IS_SOFTMODEM_IQPLAYER?0:pucch1_thres)) ) {//
+ if (sigma2_dB<(dB_fixed(stat_max) - (IS_SOFTMODEM_IQPLAYER?0:pucch1_thres)) ) {//
chL = (nsymb>>1)-4;
chest_mag=0;
cfo = (frame_parms->Ncp==0) ? &cfo_pucch_np[14*phase_max] : &cfo_pucch_ep[12*phase_max];
for (aa=0; aanb_antennas_rx; aa++) {
- // channel estimates first
for (re=0; re<12; re++) {
// channel estimate for first slot
chest0_re[aa][re]=0;
@@ -1381,6 +1434,11 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
// now do channel matched filter
for (aa=0; aanb_antennas_rx; aa++) {
+ stat0_re[aa]=0;
+ stat0_im[aa]=0;
+ stat1_re[aa]=0;
+ stat1_im[aa]=0;
+
for (re=0; re<12; re++) {
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d chest0[%d][%d] => (%d,%d)\n",subframe,aa,re,
@@ -1392,8 +1450,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l);
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
+ stat0_re[aa] += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
+ stat0_im[aa] += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1409,8 +1467,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l);
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
+ stat0_re[aa] += (((tmp_re*chest0_re[aa][re])>>log2_maxh) + ((tmp_im*chest0_im[aa][re])>>log2_maxh));
+ stat0_im[aa] += (((tmp_re*chest0_im[aa][re])>>log2_maxh) - ((tmp_im*chest0_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1431,8 +1489,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l) + (nsymb>>1)*24;
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
+ stat1_re[aa] += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
+ stat1_im[aa] += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1448,8 +1506,8 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
off=(re<<1) + (24*l) + (nsymb>>1)*24;
tmp_re = ((rxcomp[aa][off]*(int32_t)cfo[l<<1])>>15) - ((rxcomp[aa][1+off]*(int32_t)cfo[1+(l<<1)])>>15);
tmp_im = ((rxcomp[aa][off]*(int32_t)cfo[1+(l<<1)])>>15) + ((rxcomp[aa][1+off]*(int32_t)cfo[(l<<1)])>>15);
- stat_re += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
- stat_im += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
+ stat1_re[aa] += (((tmp_re*chest1_re[aa][re])>>log2_maxh) + ((tmp_im*chest1_im[aa][re])>>log2_maxh));
+ stat1_im[aa] += (((tmp_re*chest1_im[aa][re])>>log2_maxh) - ((tmp_im*chest1_re[aa][re])>>log2_maxh));
off+=2;
#ifdef DEBUG_PUCCH_RX
printf("[PHY][eNB] PUCCH subframe %d (%d,%d) => (%d,%d) x (%d,%d) : (%d,%d) => (%d,%d)\n",subframe,l,re,
@@ -1464,29 +1522,42 @@ uint32_t rx_pucch(PHY_VARS_eNB *eNB,
printf("aa%d re %d : stat %d,%d\n",aa,re,stat_re,stat_im);
#endif
} //re
+ stat_re+=stat0_re[aa]+stat1_re[aa];
+ stat_im+=stat0_im[aa]+stat1_im[aa];
} // aa
LOG_D(PHY,"PUCCH 1a/b: subframe %d : stat %d,%d (pos %d)\n",subframe,stat_re,stat_im,
- (subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe]));
+ (subframe<<10) + (eNB->pucch1ab_stats_cnt[UCI_id][subframe]));
LOG_D(PHY,"In pucch.c PUCCH 1a/b: ACK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
- eNB->pucch1ab_stats[UE_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_re);
- eNB->pucch1ab_stats[UE_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UE_id][subframe])] = (stat_im);
- eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
+ eNB->pucch1ab_stats[UCI_id][(subframe<<11) + 2*(eNB->pucch1ab_stats_cnt[UCI_id][subframe])] = (stat_re);
+ eNB->pucch1ab_stats[UCI_id][(subframe<<11) + 1+2*(eNB->pucch1ab_stats_cnt[UCI_id][subframe])] = (stat_im);
+ eNB->pucch1ab_stats_cnt[UCI_id][subframe] = (eNB->pucch1ab_stats_cnt[UCI_id][subframe]+1)&1023;
/* frame not available here - set to -1 for the moment */
- T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UE_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
+ T(T_ENB_PHY_PUCCH_1AB_IQ, T_INT(eNB->Mod_id), T_INT(eNB->uci_vars[UCI_id].rnti), T_INT(-1), T_INT(subframe), T_INT(stat_re), T_INT(stat_im));
*payload = (stat_re<0) ? 1 : 2; // 1 == ACK, 2 == NAK
- if (fmt==pucch_format1b)
+ if (fmt==pucch_format1b) {
+ uci_stats->pucch1b_trials++;
*(1+payload) = (stat_im<0) ? 1 : 2;
+ uci_stats->current_pucch1b_stat_re = stat_re;
+ uci_stats->current_pucch1b_stat_im = stat_im;
+ }
+ else {
+ uci_stats->pucch1a_trials++;
+ uci_stats->current_pucch1a_stat_re = stat_re;
+ uci_stats->current_pucch1a_stat_im = stat_im;
+ }
+
} else { // insufficient energy on PUCCH so NAK
LOG_D(PHY,"In pucch.c PUCCH 1a/b: NAK subframe %d : sigma2_dB %d, stat_max %d, pucch1_thres %d\n",subframe,sigma2_dB,dB_fixed(stat_max),pucch1_thres);
*payload = 4; // DTX
- ((int16_t *)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[0] = (int16_t)(stat_re);
- ((int16_t *)&eNB->pucch1ab_stats[UE_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UE_id][subframe])])[1] = (int16_t)(stat_im);
- eNB->pucch1ab_stats_cnt[UE_id][subframe] = (eNB->pucch1ab_stats_cnt[UE_id][subframe]+1)&1023;
+ ((int16_t *)&eNB->pucch1ab_stats[UCI_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UCI_id][subframe])])[0] = (int16_t)(stat_re);
+ ((int16_t *)&eNB->pucch1ab_stats[UCI_id][(subframe<<10) + (eNB->pucch1ab_stats_cnt[UCI_id][subframe])])[1] = (int16_t)(stat_im);
+ eNB->pucch1ab_stats_cnt[UCI_id][subframe] = (eNB->pucch1ab_stats_cnt[UCI_id][subframe]+1)&1023;
if (fmt==pucch_format1b)
*(1+payload) = 4;
+ uci_stats->pucch1ab_DTX++;
}
} else {
LOG_E(PHY,"[eNB] PUCCH fmt2/2a/2b not supported\n");
diff --git a/openair1/PHY/LTE_TRANSPORT/pucch_common.c b/openair1/PHY/LTE_TRANSPORT/pucch_common.c
index 5b939b08d2..d7a500d5f7 100644
--- a/openair1/PHY/LTE_TRANSPORT/pucch_common.c
+++ b/openair1/PHY/LTE_TRANSPORT/pucch_common.c
@@ -31,7 +31,6 @@
*/
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
-#include "LAYER2/MAC/mac.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/LOG/log.h"
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common.h b/openair1/PHY/LTE_TRANSPORT/transport_common.h
index ab2921c2b9..93ca7195de 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_common.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_common.h
@@ -35,9 +35,9 @@
#include "dci.h"
#include "mdci.h"
//#include "uci.h"
-#ifndef STANDALONE_COMPILE
- #include "UTIL/LISTS/list.h"
-#endif
+//#ifndef STANDALONE_COMPILE
+// #include "UTIL/LISTS/list.h"
+//#endif
#define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5
@@ -57,7 +57,7 @@
// maximum of 3 segments before each coding block if data length exceeds 6144 bits.
-#define MAX_NUM_DLSCH_SEGMENTS 16
+#define MAX_NUM_DLSCH_SEGMENTS 13
#define MAX_NUM_ULSCH_SEGMENTS MAX_NUM_DLSCH_SEGMENTS
#define MAX_DLSCH_PAYLOAD_BYTES (MAX_NUM_DLSCH_SEGMENTS*768)
#define MAX_ULSCH_PAYLOAD_BYTES (MAX_NUM_ULSCH_SEGMENTS*768)
@@ -93,7 +93,8 @@
#define PMI_2A_R1_1j 2
typedef enum { SEARCH_EXIST=0,
- SEARCH_EXIST_OR_FREE
+ SEARCH_EXIST_OR_FREE,
+ SEARCH_EXIST_RA
} find_type_t;
typedef enum {
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
index 1944f06fab..622f37b3bc 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_common_proto.h
@@ -223,7 +223,9 @@ uint8_t get_num_prach_tdd(module_id_t Mod_id);
@param frame_type 0-FDD, 1-TDD
@returns 0-1 accordingly
*/
+/*
uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
+*/
/*!
\brief Helper for MAC, returns frequency index of PRACH resource in TDD for a particular configuration index
@@ -306,12 +308,12 @@ void init_scrambling_lut(void);
void init_unscrambling_lut(void);
-
+/*
uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t prach_ConfigIndex,
uint8_t n_ra_prboffset,
uint8_t tdd_mapindex, uint16_t Nf);
-
+*/
uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,frame_t frame,uint8_t subframe);
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
@@ -319,6 +321,6 @@ uint32_t conv_1C_RIV(int32_t rballoc,uint32_t N_RB_DL);
void conv_rballoc(uint8_t ra_header,uint32_t rb_alloc,uint32_t N_RB_DL,uint32_t *rb_alloc2);
-int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
+int16_t estimate_ue_tx_power(int norm,uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs);
#endif
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_eNB.h b/openair1/PHY/LTE_TRANSPORT/transport_eNB.h
index 5e446db5fd..b3985e973a 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_eNB.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_eNB.h
@@ -36,9 +36,9 @@
#include "dci.h"
#include "mdci.h"
#include "uci_common.h"
-#ifndef STANDALONE_COMPILE
- #include "UTIL/LISTS/list.h"
-#endif
+//#ifndef STANDALONE_COMPILE
+// #include "UTIL/LISTS/list.h"
+//#endif
// structures below implement 36-211 and 36-212
diff --git a/openair1/PHY/LTE_TRANSPORT/transport_proto.h b/openair1/PHY/LTE_TRANSPORT/transport_proto.h
index 9e37821b05..19af50056c 100644
--- a/openair1/PHY/LTE_TRANSPORT/transport_proto.h
+++ b/openair1/PHY/LTE_TRANSPORT/transport_proto.h
@@ -520,6 +520,9 @@ int generate_eNB_ulsch_params_from_dci(PHY_VARS_eNB *PHY_vars_eNB,
void dump_ulsch(PHY_VARS_eNB *phy_vars_eNB,int frame, int subframe, uint8_t UE_id,int round);
+void dump_ulsch_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame);
+void dump_uci_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame);
+
@@ -691,13 +694,11 @@ void conv_eMTC_rballoc(uint16_t resource_block_coding,
uint32_t N_RB_DL,
uint32_t *rb_alloc);
-int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
+int find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
-int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
+int find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
-int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
-
-uint8_t get_prach_fmt(uint8_t prach_ConfigIndex,lte_frame_type_t frame_type);
+int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
uint32_t lte_gold_generic(uint32_t *x1, uint32_t *x2, uint8_t reset);
diff --git a/openair1/PHY/LTE_TRANSPORT/uci_tools.c b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
index f8ade9afc8..ae039bec2a 100644
--- a/openair1/PHY/LTE_TRANSPORT/uci_tools.c
+++ b/openair1/PHY/LTE_TRANSPORT/uci_tools.c
@@ -37,12 +37,11 @@
//#define DEBUG_UCI 1
-int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) {
- uint16_t i;
- int16_t first_free_index=-1;
+int find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) {
+ int first_free_index=-1;
AssertFatal(eNB!=NULL,"eNB is null\n");
- for (i=0; iuci_vars[i].active >0) &&
(eNB->uci_vars[i].rnti==rnti) &&
(eNB->uci_vars[i].frame==frame) &&
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
index 476d7028b1..ae8c666d18 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_decoding.c
@@ -468,6 +468,35 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
ulsch_harq->Nsymb_pusch,
nb_rb);
//#endif
+
+ eNB_SCH_STATS_t *stats=NULL;
+ int first_free=-1;
+ for (int i=0;iulsch_stats[i].rnti == 0 && first_free == -1) {
+ first_free = i;
+ stats=&eNB->ulsch_stats[i];
+ }
+ if (eNB->ulsch_stats[i].rnti == ulsch->rnti) {
+ stats=&eNB->ulsch_stats[i];
+ break;
+ }
+ }
+ if (stats) {
+ stats->rnti = ulsch->rnti;
+ stats->round_trials[ulsch_harq->round]++;
+ stats->frame=proc->frame_rx;
+ }
+ if (ulsch_harq->round == 0) {
+ if (stats) {
+ stats->current_Qm = Q_m;
+ stats->current_RI = 1;
+ stats->total_bytes_tx += ulsch_harq->TBS;
+ stats->current_TBS = ulsch_harq->TBS;
+ stats->current_G = ulsch_harq->G;
+ }
+ }
+
+
//if (ulsch_harq->round == 0) { // delete for RB shortage pattern
// This is a new packet, so compute quantities regarding segmentation
ulsch_harq->B = A+24;
@@ -1086,3 +1115,44 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,
ret = ulsch_decoding_data_all(eNB,proc, UE_id,harq_pid,llr8_flag);
return(ret);
}
+
+#define STATSTRLEN 16384
+void dump_ulsch_stats(FILE *fd,PHY_VARS_eNB *eNB,int frame) {
+
+ char output[16384];
+ int stroff=0;
+ for (int i=0;iulsch_stats[i].rnti>0 && eNB->ulsch_stats[i].round_trials[0]>100) {
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
+ stroff+=sprintf(output+stroff,"ULSCH RNTI %x: ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n",
+ eNB->ulsch_stats[i].rnti, aa,eNB->ulsch_stats[i].ulsch_power[aa],aa,eNB->ulsch_stats[i].ulsch_noise_power[aa]);
+ AssertFatal(stroff<(STATSTRLEN-1000),"Increase STATSTRLEN\n");
+ stroff+=sprintf(output+stroff,"ULSCH RNTI %x: round_trials %d(%1.1e):%d(%1.1e):%d(%1.1e):%d\n",
+ eNB->ulsch_stats[i].rnti,
+ eNB->ulsch_stats[i].round_trials[0],
+ (double)eNB->ulsch_stats[i].round_trials[1]/eNB->ulsch_stats[i].round_trials[0],
+ eNB->ulsch_stats[i].round_trials[1],
+ (double)eNB->ulsch_stats[i].round_trials[2]/eNB->ulsch_stats[i].round_trials[0],
+ eNB->ulsch_stats[i].round_trials[2],
+ (double)eNB->ulsch_stats[i].round_trials[3]/eNB->ulsch_stats[i].round_trials[0],
+ eNB->ulsch_stats[i].round_trials[3]);
+ stroff+=sprintf(output+stroff,"ULSCH RNTI %x: current_Qm %d, current_G %d, current_TBS %d, current_rate %f,current_RI %d, timing_offset %d, total_bytes RX/SCHED %d/%d\n",
+ eNB->ulsch_stats[i].rnti,
+ eNB->ulsch_stats[i].current_Qm,
+ eNB->ulsch_stats[i].current_G,
+ eNB->ulsch_stats[i].current_TBS,
+ (double)eNB->ulsch_stats[i].current_G/eNB->ulsch_stats[i].current_TBS,
+ eNB->ulsch_stats[i].current_RI,
+ eNB->ulsch_stats[i].timing_offset,
+ eNB->ulsch_stats[i].total_bytes_rx,
+ eNB->ulsch_stats[i].total_bytes_tx);
+ }
+ fprintf(fd,"%s",output);
+}
+
+void clear_ulsch_stats(PHY_VARS_eNB *eNB) {
+
+ for (int i=0;iulsch_stats[i],0,sizeof(eNB->ulsch_stats[i]));
+}
+
diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
index eeab616097..3529df8e44 100644
--- a/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
+++ b/openair1/PHY/LTE_TRANSPORT/ulsch_demodulation.c
@@ -31,12 +31,12 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
+//#include "PHY/phy_extern.h"
#include "transport_eNB.h"
#include "PHY/sse_intrin.h"
#include "transport_common_proto.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
-#include "PHY/MODULATION/modulation_eNB.h"
+//#include "PHY/MODULATION/modulation_eNB.h"
#include "T.h"
@@ -45,8 +45,11 @@
//extern int **ulchmag_eren;
//eren
-static short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0};
-static short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1};
+static const short jitter[8] __attribute__ ((aligned(16))) = {1,0,0,1,0,1,1,0};
+static const short jitterc[8] __attribute__ ((aligned(16))) = {0,1,1,0,1,0,0,1};
+static const short conjugate[8]__attribute__((aligned(16))) = {-1,1,-1,1,-1,1,-1,1};
+static const short conjugate2[8]__attribute__((aligned(16))) = {1,-1,1,-1,1,-1,1,-1};
+
void lte_idft(LTE_DL_FRAME_PARMS *frame_parms,uint32_t *z, uint16_t Msc_PUSCH) {
#if defined(__x86_64__) || defined(__i386__)
@@ -511,7 +514,6 @@ void ulsch_16qam_llr(LTE_DL_FRAME_PARMS *frame_parms,
for (i=0; i<(nb_rb*3); i++) {
#if defined(__x86_64__) || defined(__i386__)
mmtmpU0 = _mm_abs_epi16(rxF[i]);
- // print_shorts("tmp0",&tmp0);
mmtmpU0 = _mm_subs_epi16(ch_mag[i],mmtmpU0);
(*llrp128)[0] = _mm_unpacklo_epi32(rxF[i],mmtmpU0);
(*llrp128)[1] = _mm_unpackhi_epi32(rxF[i],mmtmpU0);
@@ -627,11 +629,15 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t symbol,
uint16_t nb_rb) {
#if defined(__x86_64__) || defined(__i386__)
- __m128i *rxdataF_comp128_0,*ul_ch_mag128_0,*ul_ch_mag128_0b;
- __m128i *rxdataF_comp128_1,*ul_ch_mag128_1,*ul_ch_mag128_1b;
+ __m128i *rxdataF_comp128_0=NULL,*ul_ch_mag128_0=NULL,*ul_ch_mag128_0b=NULL;
+ __m128i *rxdataF_comp128_1=NULL,*ul_ch_mag128_1=NULL,*ul_ch_mag128_1b=NULL;
+ __m128i *rxdataF_comp128_2=NULL,*ul_ch_mag128_2=NULL,*ul_ch_mag128_2b=NULL;
+ __m128i *rxdataF_comp128_3=NULL,*ul_ch_mag128_3=NULL,*ul_ch_mag128_3b=NULL;
#elif defined(__arm__)
int16x8_t *rxdataF_comp128_0,*ul_ch_mag128_0,*ul_ch_mag128_0b;
int16x8_t *rxdataF_comp128_1,*ul_ch_mag128_1,*ul_ch_mag128_1b;
+ int16x8_t *rxdataF_comp128_2,*ul_ch_mag128_2,*ul_ch_mag128_2b;
+ int16x8_t *rxdataF_comp128_3,*ul_ch_mag128_3,*ul_ch_mag128_3b;
#endif
int32_t i;
@@ -643,15 +649,39 @@ void ulsch_detection_mrc(LTE_DL_FRAME_PARMS *frame_parms,
ul_ch_mag128_1 = (__m128i *)&ul_ch_mag[1][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_0b = (__m128i *)&ul_ch_magb[0][symbol*frame_parms->N_RB_DL*12];
ul_ch_mag128_1b = (__m128i *)&ul_ch_magb[1][symbol*frame_parms->N_RB_DL*12];
-
- // MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
- for (i=0; inb_antennas_rx>2) {
+ rxdataF_comp128_2 = (__m128i *)&rxdataF_comp[2][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_2 = (__m128i *)&ul_ch_mag[2][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_2b = (__m128i *)&ul_ch_magb[2][symbol*frame_parms->N_RB_DL*12];
+ }
+ if (frame_parms->nb_antennas_rx>3) {
+ rxdataF_comp128_3 = (__m128i *)&rxdataF_comp[3][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_3 = (__m128i *)&ul_ch_mag[3][symbol*frame_parms->N_RB_DL*12];
+ ul_ch_mag128_3b = (__m128i *)&ul_ch_magb[3][symbol*frame_parms->N_RB_DL*12];
}
+ // MRC on each re of rb, both on MF output and magnitude (for 16QAM/64QAM llr computation)
+ if (frame_parms->nb_antennas_rx==2)
+ for (i=0; inb_antennas_rx==3)
+ for (i=0; inb_antennas_rx==4)
+ for (i=0; iN_RB_DL*12];
rxdataF_comp128_1 = (int16x8_t *)&rxdataF_comp[1][symbol*frame_parms->N_RB_DL*12];
@@ -795,7 +825,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU0 = _mm_srai_epi32(mmtmpU0,output_shift);
mmtmpU1 = _mm_packs_epi32(mmtmpU0,mmtmpU0);
ul_ch_mag128[2] = _mm_unpacklo_epi16(mmtmpU1,mmtmpU1);
- LOG_D(PHY,"comp: symbol %d rb %d => %d,%d,%d (output_shift %d)\n",symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
+ //LOG_I(PHY,"comp: ant %d symbol %d rb %d => %d,%d,%d (output_shift %d)\n",aarx,symbol,rb,*((int16_t *)&ul_ch_mag128[0]),*((int16_t *)&ul_ch_mag128[1]),*((int16_t *)&ul_ch_mag128[2]),output_shift);
#elif defined(__arm__)
mmtmpU0 = vmull_s16(ul_ch128[0], ul_ch128[0]);
mmtmpU0 = vqshlq_s32(vqaddq_s32(mmtmpU0,vrev64q_s32(mmtmpU0)),-output_shift128);
@@ -834,6 +864,7 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
// print_ints("c1",&mmtmpU3);
rxdataF_comp128[0] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
/*
+ LOG_I(PHY,"Antenna %d:",aarx);
print_shorts("rx:",&rxdataF128[0]);
print_shorts("ch:",&ul_ch128[0]);
print_shorts("pack:",&rxdataF_comp128[0]);
@@ -851,9 +882,12 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
rxdataF_comp128[1] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
- // print_shorts("rx:",rxdataF128[1]);
- // print_shorts("ch:",ul_ch128[1]);
- // print_shorts("pack:",rxdataF_comp128[1]);
+ /*
+ LOG_I(PHY,"Antenna %d:",aarx);
+ print_shorts("rx:",&rxdataF128[1]);
+ print_shorts("ch:",&ul_ch128[1]);
+ print_shorts("pack:",&rxdataF_comp128[1]);
+ */
// multiply by conjugated channel
mmtmpU0 = _mm_madd_epi16(ul_ch128[2],rxdataF128[2]);
// mmtmpU0 contains real part of 4 consecutive outputs (32-bit)
@@ -867,9 +901,12 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
mmtmpU2 = _mm_unpacklo_epi32(mmtmpU0,mmtmpU1);
mmtmpU3 = _mm_unpackhi_epi32(mmtmpU0,mmtmpU1);
rxdataF_comp128[2] = _mm_packs_epi32(mmtmpU2,mmtmpU3);
- // print_shorts("rx:",rxdataF128[2]);
- // print_shorts("ch:",ul_ch128[2]);
- // print_shorts("pack:",rxdataF_comp128[2]);
+ /*
+ LOG_I(PHY,"Antenna %d:",aarx);
+ print_shorts("rx:",&rxdataF128[2]);
+ print_shorts("ch:",&ul_ch128[2]);
+ print_shorts("pack:",&rxdataF_comp128[2]);
+ */
// Add a jitter to compensate for the saturation in "packs" resulting in a bias on the DC after IDFT
rxdataF_comp128[0] = _mm_add_epi16(rxdataF_comp128[0],(*(__m128i *)&jitter[0]));
rxdataF_comp128[1] = _mm_add_epi16(rxdataF_comp128[1],(*(__m128i *)&jitter[0]));
@@ -1078,6 +1115,15 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
for (i=0; inb_antennas_rx; i++) {
+ pusch_vars->ulsch_power[i] = signal_energy_nodc(pusch_vars->drs_ch_estimates[i],
+ ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)/correction_factor;
+ LOG_D(PHY,"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid,
+ ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_x10(pusch_vars->ulsch_power[i]));
+ pusch_vars->ulsch_noise_power[i]=0;
+ for (int rb=0;rbharq_processes[harq_pid]->nb_rb;rb++)
+ pusch_vars->ulsch_noise_power[i]+=eNB->measurements.n0_subband_power[i][rb]/ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
+ LOG_D(PHY,"noise power[%d] %d\n",i,dB_fixed_x10(pusch_vars->ulsch_noise_power[i]));
+/* Check this modification w.r.t to new PUSCH modifications
//symbol 3
int symbol_offset = frame_parms->N_RB_UL*12*(3 - frame_parms->Ncp);
pusch_vars->ulsch_interference_power[i] = interference_power(&pusch_vars->drs_ch_estimates[i][symbol_offset],ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12);
@@ -1100,7 +1146,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
}
LOG_D(PHY,"%4.4d.%d power harq_pid %d rb %2.2d TBS %2.2d (MPR_times_Ks %d correction %d) power %d dBtimes10\n", proc->frame_rx, proc->subframe_rx, harq_pid, ulsch[UE_id]->harq_processes[harq_pid]->nb_rb, ulsch[UE_id]->harq_processes[harq_pid]->TBS,MPR_times_100Ks,correction_factor,dB_fixed_x10(pusch_vars->ulsch_power[i]));
-
+ */
}
ulsch_channel_level(pusch_vars->drs_ch_estimates,
@@ -1113,8 +1159,7 @@ void rx_ulsch(PHY_VARS_eNB *eNB,
for (aarx=0; aarxnb_antennas_rx; aarx++)
avgs = cmax(avgs,avgU[aarx]);
- // log2_maxh = 4+(log2_approx(avgs)/2);
- log2_maxh = (log2_approx(avgs)/2)+ log2_approx(frame_parms->nb_antennas_rx-1)+4;
+ log2_maxh = 4+(log2_approx(avgs)/2);
LOG_D(PHY,"[ULSCH] log2_maxh = %d (%d,%d)\n",log2_maxh,avgU[0],avgs);
for (l=0; l<(frame_parms->symbols_per_tti-ulsch[UE_id]->harq_processes[harq_pid]->srs_active); l++) {
@@ -1221,67 +1266,56 @@ void dump_ulsch(PHY_VARS_eNB *eNB,int frame,int subframe,uint8_t UE_id,int round
uint8_t harq_pid;
char fname[100],vname[100];
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
- LOG_UI(PHY,"Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, TBS %d, Qm %d, N_symb %d\n",
+ LOG_UI(PHY,"Dumping ULSCH in subframe %d with harq_pid %d, round %d for NB_rb %d, first_rb %d, TBS %d, Qm %d, N_symb %d\n",
subframe,harq_pid,round,eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,
+ eNB->ulsch[UE_id]->harq_processes[harq_pid]->first_rb,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS,eNB->ulsch[UE_id]->harq_processes[harq_pid]->Qm,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_pusch);
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
+ LOG_UI(PHY,"ulsch_power[%d] %d, ulsch_noise_power[%d] %d\n",aa,dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_power[aa]),aa,dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_noise_power[aa]));
sprintf(fname,"/tmp/ulsch_r%d_d",round);
sprintf(vname,"/tmp/ulsch_r%d_dseq",round);
LOG_UM(fname,vname,&eNB->ulsch[UE_id]->harq_processes[harq_pid]->d[0][96],
eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus*3,1,0);
if (eNB->common_vars.rxdata) {
- sprintf(fname,"/tmp/rxsig0_r%d.m",round);
- sprintf(vname,"rxs0_r%d",round);
- LOG_UM(fname,vname, &eNB->common_vars.rxdata[0][0],eNB->frame_parms.samples_per_tti*10,1,1);
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/rxsig%d_r%d.m",aarx,round);
+ sprintf(vname,"rxs%d_r%d",aarx,round);
+ LOG_UM(fname,vname, &eNB->common_vars.rxdata[aarx][0],eNB->frame_parms.samples_per_tti*10,1,1);
- if (eNB->frame_parms.nb_antennas_rx>1)
- if (eNB->common_vars.rxdata) {
- sprintf(fname,"/tmp/rxsig1_r%d.m",round);
- sprintf(vname,"rxs1_r%d",round);
- LOG_UM(fname,vname, &eNB->common_vars.rxdata[1][0],eNB->frame_parms.samples_per_tti*10,1,1);
- }
+ }
}
-
- sprintf(fname,"/tmp/rxsigF0_r%d.m",round);
- sprintf(vname,"rxsF0_r%d",round);
- LOG_UM(fname,vname, (void *)&eNB->common_vars.rxdataF[0][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
-
- if (eNB->frame_parms.nb_antennas_rx>1) {
- sprintf(fname,"/tmp/rxsigF1_r%d.m",round);
- sprintf(vname,"rxsF1_r%d",round);
- LOG_UM(vname,fname, &eNB->common_vars.rxdataF[1][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
+ if (eNB->common_vars.rxdataF) {
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/rxsigF%d_r%d.m",aarx,round);
+ sprintf(vname,"rxsF%d_r%d",aarx,round);
+ LOG_UM(fname,vname, (void *)&eNB->common_vars.rxdataF[aarx][0],eNB->frame_parms.ofdm_symbol_size*nsymb,1,1);
+ }
}
-
- sprintf(fname,"/tmp/rxsigF0_ext_r%d.m",round);
- sprintf(vname,"rxsF0_ext_r%d",round);
- LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
-
- if (eNB->frame_parms.nb_antennas_rx>1) {
- sprintf(fname,"/tmp/rxsigF1_ext_r%d.m",round);
- sprintf(vname,"rxsF1_ext_r%d",round);
- LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_ext[1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ if (eNB->pusch_vars[UE_id]->rxdataF_ext) {
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/rxsigF%d_ext_r%d.m",aarx,round);
+ sprintf(vname,"rxsF%d_ext_r%d",aarx,round);
+ LOG_UM(fname,vname, &eNB->pusch_vars[UE_id]->rxdataF_ext[aarx][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ }
}
-
/*
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est0.m","srsest0",eNB->srs_vars[UE_id].srs_ch_estimates[0],eNB->frame_parms.ofdm_symbol_size,1,1);
if (eNB->frame_parms.nb_antennas_rx>1)
if (eNB->srs_vars[UE_id].srs_ch_estimates) LOG_UM("/tmp/srs_est1.m","srsest1",eNB->srs_vars[UE_id].srs_ch_estimates[1],eNB->frame_parms.ofdm_symbol_size,1,1);
*/
- sprintf(fname,"/tmp/drs_est0_r%d.m",round);
- sprintf(vname,"drsest0_r%d",round);
- LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
+ sprintf(fname,"/tmp/drs_est%d_r%d.m",aarx,round);
+ sprintf(vname,"drsest%d_r%d",aarx,round);
+ LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[aarx],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
- if (eNB->frame_parms.nb_antennas_rx>1) {
- sprintf(fname,"/tmp/drs_est1_r%d.m",round);
- sprintf(vname,"drsest1_r%d",round);
- LOG_UM(fname,vname,eNB->pusch_vars[UE_id]->drs_ch_estimates[1],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
+ sprintf(fname,"/tmp/ulsch%d_rxF_comp0_r%d.m",aarx,round);
+ sprintf(vname,"ulsch_rxF%d_comp0_r%d",aarx,round);
+ LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[aarx][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
}
- sprintf(fname,"/tmp/ulsch0_rxF_comp0_r%d.m",round);
- sprintf(vname,"ulsch0_rxF_comp0_r%d",round);
- LOG_UM(fname,vname,&eNB->pusch_vars[UE_id]->rxdataF_comp[0][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
// LOG_M("ulsch_rxF_comp1.m","ulsch0_rxF_comp1",&eNB->pusch_vars[UE_id]->rxdataF_comp[0][1][0],eNB->frame_parms.N_RB_UL*12*nsymb,1,1);
sprintf(fname,"/tmp/ulsch_rxF_llr_r%d.m",round);
sprintf(vname,"ulsch_llr_r%d",round);
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
index 7442a0ae7e..39900113b7 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/dlsch_decoding.c
@@ -78,7 +78,7 @@ LTE_UE_DLSCH_t *new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_
switch (N_RB_DL) {
case 6:
- bw_scaling =16;
+ bw_scaling =4;
break;
case 25:
@@ -276,7 +276,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
switch (frame_parms->N_RB_DL) {
case 6:
- bw_scaling =16;
+ bw_scaling =4;
break;
case 25:
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c
index ab7c2b9091..929f63e9fc 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c
+++ b/openair1/PHY/LTE_UE_TRANSPORT/prach_ue.c
@@ -41,6 +41,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "../LTE_TRANSPORT/prach_extern.h"
+#include "common/utils/lte/prach_utils.h"
//#define PRACH_DEBUG 1
@@ -115,7 +116,9 @@ int32_t generate_prach( PHY_VARS_UE *ue, uint8_t eNB_id, uint8_t subframe, uint1
NCS = NCS_restricted[Ncs_config];
}
- n_ra_prb = get_prach_prb_offset(&(ue->frame_parms),
+ n_ra_prb = get_prach_prb_offset(ue->frame_parms.frame_type,
+ ue->frame_parms.tdd_config,
+ ue->frame_parms.N_RB_UL,
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
ue->frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset,
tdd_mapindex, Nf);
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
index 3299401443..7ab795cae9 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
+++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_proto_ue.h
@@ -1740,10 +1740,5 @@ double computeRhoB_UE(PDSCH_CONFIG_DEDICATED *pdsch_config_dedicated,
LTE_UE_DLSCH_t *dlsch_ue);
*/
-uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
- uint8_t prach_ConfigIndex,
- uint8_t n_ra_prboffset,
- uint8_t tdd_mapindex, uint16_t Nf);
-
/**@}*/
#endif
diff --git a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
index 4c433a5683..6b84a5f969 100644
--- a/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
+++ b/openair1/PHY/LTE_UE_TRANSPORT/transport_ue.h
@@ -36,9 +36,11 @@
#include "../LTE_TRANSPORT/mdci.h"
#include "../LTE_TRANSPORT/uci_common.h"
#include "../LTE_TRANSPORT/transport_common.h"
+/*
#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif
+*/
#include "../LTE_TRANSPORT/transport_common.h"
diff --git a/openair1/PHY/MODULATION/beamforming.c b/openair1/PHY/MODULATION/beamforming.c
index 4405c46abf..d592aa466e 100644
--- a/openair1/PHY/MODULATION/beamforming.c
+++ b/openair1/PHY/MODULATION/beamforming.c
@@ -44,7 +44,6 @@
#include "PHY/defs_common.h"
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/CODING/coding_defs.h"
#include "PHY/CODING/coding_extern.h"
#include "PHY/CODING/lte_interleaver_inline.h"
diff --git a/openair1/PHY/MODULATION/slot_fep_ul.c b/openair1/PHY/MODULATION/slot_fep_ul.c
index 746f8dbc0e..ccb7ee5f3e 100644
--- a/openair1/PHY/MODULATION/slot_fep_ul.c
+++ b/openair1/PHY/MODULATION/slot_fep_ul.c
@@ -20,8 +20,8 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
-#include "modulation_eNB.h"
+//#include "PHY/phy_extern.h"
+//#include "modulation_eNB.h"
//#define DEBUG_FEP
diff --git a/openair1/PHY/MODULATION/ul_7_5_kHz.c b/openair1/PHY/MODULATION/ul_7_5_kHz.c
index a5b428a813..384b9d621c 100644
--- a/openair1/PHY/MODULATION/ul_7_5_kHz.c
+++ b/openair1/PHY/MODULATION/ul_7_5_kHz.c
@@ -20,7 +20,6 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include
#include "PHY/sse_intrin.h"
#include "modulation_extern.h"
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci.c b/openair1/PHY/NR_TRANSPORT/nr_dci.c
index b9cb30df10..ea96756184 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci.c
@@ -182,62 +182,64 @@ void nr_generate_dci(PHY_VARS_gNB *gNB,
}
/*Mapping the encoded DCI along with the DMRS */
- for (int cce_count = 0; cce_count < dci_pdu->AggregationLevel; cce_count ++) {
+ for(int symbol_idx = 0; symbol_idx < pdcch_pdu_rel15->DurationSymbols; symbol_idx++) {
+ for (int cce_count = 0; cce_count < dci_pdu->AggregationLevel; cce_count+=pdcch_pdu_rel15->DurationSymbols) {
- int8_t cce_idx = reg_list_order[cce_count];
+ int8_t cce_idx = reg_list_order[cce_count];
- for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
+ for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
- k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx;
-
- if (k >= frame_parms.ofdm_symbol_size)
- k -= frame_parms.ofdm_symbol_size;
-
- l = cset_start_symb + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].symb_idx;
-
- // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2
- if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG)
- dmrs_idx =(gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx / pdcch_pdu_rel15->DurationSymbols) * 3;
- else
- dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx / pdcch_pdu_rel15->DurationSymbols + rb_offset) * 3;
-
- k_prime = 0;
-
- for (int m = 0; m < NR_NB_SC_PER_RB; m++) {
- if (m == (k_prime << 2) + 1) { // DMRS if not already mapped
- ((int16_t *) txdataF)[(l * frame_parms.ofdm_symbol_size + k) << 1] =
- (amp * mod_dmrs[l][dmrs_idx << 1]) >> 15;
- ((int16_t *) txdataF)[((l * frame_parms.ofdm_symbol_size + k) << 1) + 1] =
- (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
-
-#ifdef DEBUG_PDCCH_DMRS
- printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
- ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
-#endif
-
- dmrs_idx++;
- k_prime++;
-
- } else { // DCI payload
- ((int16_t *) txdataF)[(l * frame_parms.ofdm_symbol_size + k) << 1] = (amp * mod_dci[dci_idx << 1]) >> 15;
- ((int16_t *) txdataF)[((l * frame_parms.ofdm_symbol_size + k) << 1) + 1] =
- (amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
-#ifdef DEBUG_DCI
- printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
- ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
-#endif
-
- dci_idx++;
- }
-
- k++;
+ k = cset_start_sc + gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].start_sc_idx;
if (k >= frame_parms.ofdm_symbol_size)
k -= frame_parms.ofdm_symbol_size;
- } // m
- } // reg_in_cce_idx
- } // cce_count
+ l = cset_start_symb + symbol_idx;
+
+ // dmrs index depends on reference point for k according to 38.211 7.4.1.3.2
+ if (pdcch_pdu_rel15->CoreSetType == NFAPI_NR_CSET_CONFIG_PDCCH_CONFIG)
+ dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx) * 3;
+ else
+ dmrs_idx = (gNB->cce_list[d][cce_idx].reg_list[reg_in_cce_idx].reg_idx + rb_offset) * 3;
+
+ k_prime = 0;
+
+ for (int m = 0; m < NR_NB_SC_PER_RB; m++) {
+ if (m == (k_prime << 2) + 1) { // DMRS if not already mapped
+ ((int16_t *) txdataF)[(l * frame_parms.ofdm_symbol_size + k) << 1] =
+ (amp * mod_dmrs[l][dmrs_idx << 1]) >> 15;
+ ((int16_t *) txdataF)[((l * frame_parms.ofdm_symbol_size + k) << 1) + 1] =
+ (amp * mod_dmrs[l][(dmrs_idx << 1) + 1]) >> 15;
+
+#ifdef DEBUG_PDCCH_DMRS
+ printf("PDCCH DMRS: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
+ ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
+#endif
+
+ dmrs_idx++;
+ k_prime++;
+
+ } else { // DCI payload
+ ((int16_t *) txdataF)[(l * frame_parms.ofdm_symbol_size + k) << 1] = (amp * mod_dci[dci_idx << 1]) >> 15;
+ ((int16_t *) txdataF)[((l * frame_parms.ofdm_symbol_size + k) << 1) + 1] =
+ (amp * mod_dci[(dci_idx << 1) + 1]) >> 15;
+#ifdef DEBUG_DCI
+ printf("PDCCH: l %d position %d => (%d,%d)\n",l,k,((int16_t *)txdataF)[(l*frame_parms.ofdm_symbol_size + k)<<1],
+ ((int16_t *)txdataF)[((l*frame_parms.ofdm_symbol_size + k)<<1)+1]);
+#endif
+
+ dci_idx++;
+ }
+
+ k++;
+
+ if (k >= frame_parms.ofdm_symbol_size)
+ k -= frame_parms.ofdm_symbol_size;
+
+ } // m
+ } // reg_in_cce_idx
+ } // cce_count
+ } // symbol_idx
LOG_D(PHY,
"DCI: payloadSize = %d | payload = %llx\n",
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
index 4775851a65..c562dfaa41 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dci_tools.c
@@ -136,7 +136,7 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
get_coreset_rballoc(pdcch_pdu_rel15->FreqDomainResource,&n_rb,&rb_offset);
- int N_reg = n_rb * pdcch_pdu_rel15->DurationSymbols;
+ int N_reg = n_rb;
int C=-1;
AssertFatal(N_reg > 0,"N_reg cannot be 0\n");
@@ -174,8 +174,8 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
for (uint8_t reg_idx=0; reg_idxreg_list[reg_idx];
reg->reg_idx = bsize*idx + reg_idx;
- reg->start_sc_idx = (reg->reg_idx/pdcch_pdu_rel15->DurationSymbols) * NR_NB_SC_PER_RB;
- reg->symb_idx = reg->reg_idx % pdcch_pdu_rel15->DurationSymbols;
+ reg->start_sc_idx = reg->reg_idx * NR_NB_SC_PER_RB;
+ reg->symb_idx = 0;
LOG_D(PHY, "reg %d symbol %d start subcarrier %d\n", reg->reg_idx, reg->symb_idx, reg->start_sc_idx);
}
}
@@ -185,8 +185,8 @@ void nr_fill_cce_list(PHY_VARS_gNB *gNB, uint8_t m, nfapi_nr_dl_tti_pdcch_pdu_r
for (uint8_t reg_idx=0; reg_idxreg_list[reg_idx];
reg->reg_idx = cce->cce_idx*NR_NB_REG_PER_CCE + reg_idx;
- reg->start_sc_idx = (reg->reg_idx/pdcch_pdu_rel15->DurationSymbols) * NR_NB_SC_PER_RB;
- reg->symb_idx = reg->reg_idx % pdcch_pdu_rel15->DurationSymbols;
+ reg->start_sc_idx = reg->reg_idx * NR_NB_SC_PER_RB;
+ reg->symb_idx = 0;
LOG_D(PHY, "reg %d symbol %d start subcarrier %d\n", reg->reg_idx, reg->symb_idx, reg->start_sc_idx);
}
@@ -239,7 +239,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
//uint64_t *dci_pdu = (uint64_t*)pdcch_pdu_rel15->dci_pdu[i].Payload;
int dlsch_id = find_nr_dlsch(pdcch_pdu_rel15->dci_pdu[i].RNTI,gNB,SEARCH_EXIST_OR_FREE);
- if( (dlsch_id<0) || (dlsch_id>=NUMBER_OF_NR_DLSCH_MAX) ){
+ if( (dlsch_id<0) || (dlsch_id>=gNB->number_of_nr_dlsch_max) ){
LOG_E(PHY,"illegal dlsch_id found!!! rnti %04x dlsch_id %d\n",(unsigned int)pdcch_pdu_rel15->dci_pdu[i].RNTI,dlsch_id);
return;
}
@@ -255,10 +255,7 @@ void nr_fill_dci(PHY_VARS_gNB *gNB,
dlsch->harq_mask |= (1<rnti = pdcch_pdu_rel15->dci_pdu[i].RNTI;
- // nr_fill_cce_list(gNB,0);
-
-
-
+ // nr_fill_cce_list(gNB,0);
}
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
index d06c4bbb1c..b1dbc7c7d9 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch.c
@@ -82,7 +82,6 @@ void nr_pdsch_codeword_scrambling_optim(uint8_t *in,
s=lte_gold_generic(&x1, &x2, 1);
-
#if defined(__AVX2__)
for (int i=0; i<((size>>5)+((size&0x1f) > 0 ? 1 : 0)); i++) {
in32=_mm256_movemask_epi8(_mm256_slli_epi16(((__m256i*)in)[i],7));
@@ -133,7 +132,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
time_stats_t *dlsch_interleaving_stats=&gNB->dlsch_interleaving_stats;
time_stats_t *dlsch_segmentation_stats=&gNB->dlsch_segmentation_stats;
- for (int dlsch_id=0;dlsch_idnumber_of_nr_dlsch_max;dlsch_id++) {
dlsch = gNB->dlsch[dlsch_id][0];
if (dlsch->slot_tx[slot] == 0) continue;
@@ -160,8 +159,7 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
uint16_t nb_re = ((12*rel15->NrOfSymbols)-nb_re_dmrs*dmrs_len-xOverhead)*rel15->rbSize*rel15->nrOfLayers;
uint8_t Qm = rel15->qamModOrder[0];
uint32_t encoded_length = nb_re*Qm;
- int16_t mod_dmrs[14][n_dmrs<<1] __attribute__ ((aligned(16)));
-
+ int16_t mod_dmrs[n_dmrs<<1] __attribute__ ((aligned(16)));
/* PTRS */
uint16_t beta_ptrs = 1;
@@ -266,24 +264,6 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
printf("\n");
}
#endif
-
- /// DMRS QPSK modulation
- // TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part
- for (int l=rel15->StartSymbolIndex; lStartSymbolIndex+rel15->NrOfSymbols; l++) {
- if (rel15->dlDmrsSymbPos & (1 << l)) {
- nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs[l]); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
-
-#ifdef DEBUG_DLSCH
- printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type);
- for (int i=0; i>4; i++) {
- for (int j=0; j<8; j++) {
- printf("%d %d\t", mod_dmrs[l][((i<<3)+j)<<1], mod_dmrs[l][(((i<<3)+j)<<1)+1]);
- }
- printf("\n");
- }
-#endif
- }
- }
/// Resource mapping
@@ -351,6 +331,21 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
}
}
+ /// DMRS QPSK modulation
+ if (rel15->dlDmrsSymbPos & (1 << l)) {
+ nr_modulation(pdsch_dmrs[l][0], n_dmrs*2, DMRS_MOD_ORDER, mod_dmrs); // currently only codeword 0 is modulated. Qm = 2 as DMRS is QPSK modulated
+
+#ifdef DEBUG_DLSCH
+ printf("DMRS modulation (symbol %d, %d symbols, type %d):\n", l, n_dmrs, dmrs_Type);
+ for (int i=0; i>4; i++) {
+ for (int j=0; j<8; j++) {
+ printf("%d %d\t", mod_dmrs[((i<<3)+j)<<1], mod_dmrs[(((i<<3)+j)<<1)+1]);
+ }
+ printf("\n");
+ }
+#endif
+ }
+
/* calculate if current symbol is PTRS symbols */
ptrs_idx = 0;
@@ -381,8 +376,8 @@ uint8_t nr_generate_pdsch(PHY_VARS_gNB *gNB,
/* Map DMRS Symbol */
if ( ( dmrs_symbol_map & (1 << l) ) && (k == ((start_sc+get_dmrs_freq_idx(n, k_prime, delta, dmrs_Type))%(frame_parms->ofdm_symbol_size)))) {
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[l][dmrs_idx<<1]) >> 15;
- txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[l][(dmrs_idx<<1) + 1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[dmrs_idx<<1]) >> 15;
+ txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + 1 + (2*txdataF_offset)] = (Wt[l_prime]*Wf[k_prime]*amp*mod_dmrs[(dmrs_idx<<1) + 1]) >> 15;
#ifdef DEBUG_DLSCH_MAPPING
printf("dmrs_idx %d\t l %d \t k %d \t k_prime %d \t n %d \t txdataF: %d %d\n",
dmrs_idx, l, k, k_prime, n, txdataF_precoding[ap][((l*frame_parms->ofdm_symbol_size + k)<<1) + (2*txdataF_offset)],
@@ -545,6 +540,6 @@ void dump_pdsch_stats(PHY_VARS_gNB *gNB) {
void clear_pdsch_stats(PHY_VARS_gNB *gNB) {
- for (int i=0;inumber_of_nr_dlsch_max;i++)
memset((void*)&gNB->dlsch_stats[i],0,sizeof(gNB->dlsch_stats[i]));
}
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
index 437b444e91..1e372eb9e0 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_coding.c
@@ -44,6 +44,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "common/utils/LOG/log.h"
#include
+#include
//#define DEBUG_DLSCH_CODING
//#define DEBUG_DLSCH_FREE 1
diff --git a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
index 05d6c4c112..543002827d 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_dlsch_tools.c
@@ -260,7 +260,7 @@ int16_t find_nr_dlsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
int16_t first_free_index=-1;
AssertFatal(gNB!=NULL,"gNB is null\n");
- for (i=0; inumber_of_nr_dlsch_max; i++) {
AssertFatal(gNB->dlsch[i]!=NULL,"gNB->dlsch[%d] is null\n",i);
AssertFatal(gNB->dlsch[i][0]!=NULL,"gNB->dlsch[%d][0] is null\n",i);
LOG_D(PHY,"searching for rnti %x : dlsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,
@@ -286,7 +286,7 @@ void nr_fill_dlsch(PHY_VARS_gNB *gNB,
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &pdsch_pdu->pdsch_pdu_rel15;
int dlsch_id = find_nr_dlsch(rel15->rnti,gNB,SEARCH_EXIST);
- AssertFatal( (dlsch_id>=0) && (dlsch_id=0) && (dlsch_idnumber_of_nr_dlsch_max),
"illegal or no dlsch_id found!!! rnti %04x dlsch_id %d\n",rel15->rnti,dlsch_id);
NR_gNB_DLSCH_t *dlsch = gNB->dlsch[dlsch_id][0];
NR_DL_gNB_HARQ_t *harq = &dlsch->harq_process;
diff --git a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
index 5e6011c437..994ff18bc8 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
+++ b/openair1/PHY/NR_TRANSPORT/nr_transport_proto.h
@@ -133,15 +133,13 @@ NR_gNB_DLSCH_t *new_gNB_dlsch(NR_DL_FRAME_PARMS *frame_parms,
@param ue Pointer to PHY variables
@param UE_id id of current UE
@param frame Frame number
- @param nr_tti_rx TTI number
- @param symbol Symbol on which to act (within-in nr_TTI_rx)
+ @param slot Slot number
@param harq_pid HARQ process ID
*/
int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint8_t UE_id,
uint32_t frame,
- uint8_t nr_tti_rx,
- unsigned char symbol,
+ uint8_t slot,
unsigned char harq_pid);
/** \brief This function performs RB extraction (signal and channel estimates) (currently signal only until channel estimation and compensation are implemented)
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
index 17e8fbfe5f..53ff90404b 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch.c
@@ -41,7 +41,7 @@ int16_t find_nr_ulsch(uint16_t rnti, PHY_VARS_gNB *gNB,find_type_t type) {
int16_t first_free_index=-1;
AssertFatal(gNB!=NULL,"gNB is null\n");
- for (i=0; inumber_of_nr_ulsch_max; i++) {
AssertFatal(gNB->ulsch[i]!=NULL,"gNB->ulsch[%d] is null\n",i);
AssertFatal(gNB->ulsch[i][0]!=NULL,"gNB->ulsch[%d][0] is null\n",i);
LOG_D(PHY,"searching for rnti %x : ulsch_index %d=> harq_mask %x, rnti %x, first_free_index %d\n", rnti,i,gNB->ulsch[i][0]->harq_mask,gNB->ulsch[i][0]->rnti,first_free_index);
@@ -62,7 +62,7 @@ void nr_fill_ulsch(PHY_VARS_gNB *gNB,
int ulsch_id = find_nr_ulsch(ulsch_pdu->rnti,gNB,SEARCH_EXIST_OR_FREE);
- AssertFatal( (ulsch_id>=0) && (ulsch_id=0) && (ulsch_idnumber_of_nr_ulsch_max),
"illegal or no ulsch_id found!!! rnti %04x ulsch_id %d\n",ulsch_pdu->rnti,ulsch_id);
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ulsch_id][0];
@@ -143,11 +143,11 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
char output[16384];
int stroff=0;
- for (int i=0;inumber_of_nr_ulsch_max;i++) {
if (gNB->ulsch_stats[i].rnti>0) {
- for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
- if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
- gNB->ulsch_stats[i].rnti,
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++)
+ if (aa==0) stroff+=sprintf(output+stroff,"ULSCH RNTI %4x: ulsch_power[%d] %d,%d ulsch_noise_power[%d] %d.%d\n",
+ gNB->ulsch_stats[i].rnti,
aa,gNB->ulsch_stats[i].power[aa]/10,gNB->ulsch_stats[i].power[aa]%10,
aa,gNB->ulsch_stats[i].noise_power[aa]/10,gNB->ulsch_stats[i].noise_power[aa]%10);
else stroff+=sprintf(output+stroff," ulsch_power[%d] %d.%d, ulsch_noise_power[%d] %d.%d\n",
@@ -170,21 +170,21 @@ void dump_pusch_stats(FILE *fd,PHY_VARS_gNB *gNB) {
gNB->ulsch_stats[i].current_RI,
gNB->ulsch_stats[i].total_bytes_rx,
gNB->ulsch_stats[i].total_bytes_tx);
- }
+ }
}
fprintf(fd,"%s",output);
}
void clear_pusch_stats(PHY_VARS_gNB *gNB) {
- for (int i=0;inumber_of_nr_ulsch_max;i++)
memset((void*)&gNB->ulsch_stats[i],0,sizeof(gNB->ulsch_stats[i]));
}
NR_gNB_SCH_STATS_t *get_ulsch_stats(PHY_VARS_gNB *gNB,NR_gNB_ULSCH_t *ulsch) {
NR_gNB_SCH_STATS_t *stats=NULL;
int first_free=-1;
- for (int i=0;inumber_of_nr_ulsch_max;i++) {
if (gNB->ulsch_stats[i].rnti == 0 && first_free == -1) {
first_free = i;
stats=&gNB->ulsch_stats[i];
diff --git a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
index e358985c12..12170d187a 100644
--- a/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
+++ b/openair1/PHY/NR_TRANSPORT/nr_ulsch_demodulation.c
@@ -12,6 +12,8 @@
//#define DEBUG_RB_EXT
//#define DEBUG_CH_MAG
+#define INVALID_VALUE 255
+
void nr_idft(int32_t *z, uint32_t Msc_PUSCH)
{
@@ -1157,12 +1159,11 @@ void nr_ulsch_detection_mrc(NR_DL_FRAME_PARMS *frame_parms,
int nr_rx_pusch(PHY_VARS_gNB *gNB,
uint8_t ulsch_id,
uint32_t frame,
- uint8_t nr_tti_rx,
- unsigned char symbol,
+ uint8_t slot,
unsigned char harq_pid)
{
- uint8_t aarx, aatx, dmrs_symbol_flag; // dmrs_symbol_flag, a flag to indicate DMRS REs in current symbol
+ uint8_t aarx, aatx;
uint32_t nb_re_pusch, bwp_start_subcarrier;
int avgs;
int avg[4];
@@ -1170,210 +1171,202 @@ int nr_rx_pusch(PHY_VARS_gNB *gNB,
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
nfapi_nr_pusch_pdu_t *rel15_ul = &gNB->ulsch[ulsch_id][0]->harq_processes[harq_pid]->ulsch_pdu;
- dmrs_symbol_flag = 0;
-
- if(symbol == rel15_ul->start_symbol_index){
- gNB->pusch_vars[ulsch_id]->dmrs_symbol = 0;
- gNB->pusch_vars[ulsch_id]->cl_done = 0;
- }
-
+ gNB->pusch_vars[ulsch_id]->dmrs_symbol = INVALID_VALUE;
+ gNB->pusch_vars[ulsch_id]->cl_done = 0;
bwp_start_subcarrier = ((rel15_ul->rb_start + rel15_ul->bwp_start)*NR_NB_SC_PER_RB + frame_parms->first_carrier_offset) % frame_parms->ofdm_symbol_size;
-
- dmrs_symbol_flag = ((rel15_ul->ul_dmrs_symb_pos)>>symbol)&0x01;
-
- LOG_D(PHY,"symbol %d bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n",symbol,bwp_start_subcarrier,rel15_ul->rb_start,frame_parms->first_carrier_offset);
+ LOG_D(PHY,"bwp_start_subcarrier %d, rb_start %d, first_carrier_offset %d\n", bwp_start_subcarrier, rel15_ul->rb_start, frame_parms->first_carrier_offset);
LOG_D(PHY,"ul_dmrs_symb_pos %x\n",rel15_ul->ul_dmrs_symb_pos);
- if (dmrs_symbol_flag == 1){
- if (((rel15_ul->ul_dmrs_symb_pos)>>((symbol+1)%frame_parms->symbols_per_slot))&0x01)
- AssertFatal(1==0,"Double DMRS configuration is not yet supported\n");
-
- if (rel15_ul->dmrs_config_type == 0) {
- // if no data in dmrs cdm group is 1 only even REs have no data
- // if no data in dmrs cdm group is 2 both odd and even REs have no data
- nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*6));
- }
- else {
- nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*4));
- }
- LOG_D(PHY,"dmrs_symbol: nb_re_pusch %d\n",nb_re_pusch);
- gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
-
- } else {
- nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
- }
-
//----------------------------------------------------------
//--------------------- Channel estimation ---------------------
//----------------------------------------------------------
start_meas(&gNB->ulsch_channel_estimation_stats);
- if (dmrs_symbol_flag == 1) {
- nr_pusch_channel_estimation(gNB,
- nr_tti_rx,
- 0, // p
- symbol,
- ulsch_id,
- bwp_start_subcarrier,
- rel15_ul);
+ for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
+ uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
+ LOG_D(PHY, "symbol %d, dmrs_symbol_flag :%d\n", symbol, dmrs_symbol_flag);
+ if (dmrs_symbol_flag == 1) {
+ if (gNB->pusch_vars[ulsch_id]->dmrs_symbol == INVALID_VALUE)
+ gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
- nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
+ nr_pusch_channel_estimation(gNB,
+ slot,
+ 0, // p
+ symbol,
+ ulsch_id,
+ bwp_start_subcarrier,
+ rel15_ul);
- for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
- if (symbol == rel15_ul->start_symbol_index) {
- gNB->pusch_vars[ulsch_id]->ulsch_power[aarx]=0;
- gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]=0;
+ nr_gnb_measurements(gNB, ulsch_id, harq_pid, symbol);
+
+ for (aarx = 0; aarx < frame_parms->nb_antennas_rx; aarx++) {
+ if (symbol == rel15_ul->start_symbol_index) {
+ gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] = 0;
+ gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx] = 0;
+ }
+ gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(
+ &gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol * frame_parms->ofdm_symbol_size],
+ rel15_ul->rb_size * 12);
+ for (int rb = 0; rb < rel15_ul->rb_size; rb++) {
+ gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx] +=
+ gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start + rel15_ul->rb_start + rb] /
+ rel15_ul->rb_size;
+ }
}
- gNB->pusch_vars[ulsch_id]->ulsch_power[aarx] += signal_energy_nodc(&gNB->pusch_vars[ulsch_id]->ul_ch_estimates[aarx][symbol*frame_parms->ofdm_symbol_size],
- rel15_ul->rb_size*12);
- for (int rb=0;rbrb_size;rb++) {
- gNB->pusch_vars[ulsch_id]->ulsch_noise_power[aarx]+=gNB->measurements.n0_subband_power[aarx][rel15_ul->bwp_start+rel15_ul->rb_start+rb]/rel15_ul->rb_size;
- }
-
}
}
stop_meas(&gNB->ulsch_channel_estimation_stats);
- //----------------------------------------------------------
- //--------------------- RBs extraction ---------------------
- //----------------------------------------------------------
- gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
+#ifdef __AVX2__
+ int off = ((rel15_ul->rb_size&1) == 1)? 4:0;
+#else
+ int off = 0;
+#endif
+ uint32_t rxdataF_ext_offset = 0;
- if (nb_re_pusch > 0) {
+ for(uint8_t symbol = rel15_ul->start_symbol_index; symbol < (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols); symbol++) {
+ uint8_t dmrs_symbol_flag = (rel15_ul->ul_dmrs_symb_pos >> symbol) & 0x01;
+ if (dmrs_symbol_flag == 1) {
+ if ((rel15_ul->ul_dmrs_symb_pos >> ((symbol + 1) % frame_parms->symbols_per_slot)) & 0x01)
+ AssertFatal(1==0,"Double DMRS configuration is not yet supported\n");
- start_meas(&gNB->ulsch_rbs_extraction_stats);
- nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
- gNB->pusch_vars[ulsch_id],
- symbol,
- dmrs_symbol_flag,
- rel15_ul,
- frame_parms);
- stop_meas(&gNB->ulsch_rbs_extraction_stats);
+ gNB->pusch_vars[ulsch_id]->dmrs_symbol = symbol;
- //----------------------------------------------------------
- //--------------------- Channel Scaling --------------------
- //----------------------------------------------------------
-
- nr_ulsch_scale_channel(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
- frame_parms,
- gNB->ulsch[ulsch_id],
- symbol,
- dmrs_symbol_flag,
- rel15_ul->rb_size,
- rel15_ul->dmrs_config_type);
-
-
- if (gNB->pusch_vars[ulsch_id]->cl_done==0) {
-
- nr_ulsch_channel_level(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
- frame_parms,
- avg,
- symbol,
- nb_re_pusch,
- rel15_ul->rb_size);
-
- avgs = 0;
-
- for (aatx=0;aatxnb_antennas_rx;aarx++)
- avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
-
- gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
- gNB->pusch_vars[ulsch_id]->cl_done = 1;
+ if (rel15_ul->dmrs_config_type == 0) {
+ // if no data in dmrs cdm group is 1 only even REs have no data
+ // if no data in dmrs cdm group is 2 both odd and even REs have no data
+ nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*6));
+ }
+ else {
+ nb_re_pusch = rel15_ul->rb_size *(12 - (rel15_ul->num_dmrs_cdm_grps_no_data*4));
+ }
+ } else {
+ nb_re_pusch = rel15_ul->rb_size * NR_NB_SC_PER_RB;
}
- //----------------------------------------------------------
- //--------------------- Channel Compensation ---------------
- //----------------------------------------------------------
+ gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] = nb_re_pusch;
+ LOG_D(PHY,"symbol %d: nb_re_pusch %d, DMRS symbl used for Chest :%d \n", symbol, nb_re_pusch, gNB->pusch_vars[ulsch_id]->dmrs_symbol);
- start_meas(&gNB->ulsch_channel_compensation_stats);
- nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
- gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
- gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
- gNB->pusch_vars[ulsch_id]->rxdataF_comp,
- (nb_antennas_ue_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
- frame_parms,
+ //----------------------------------------------------------
+ //--------------------- RBs extraction ---------------------
+ //----------------------------------------------------------
+ if (nb_re_pusch > 0) {
+
+ start_meas(&gNB->ulsch_rbs_extraction_stats);
+ nr_ulsch_extract_rbs_single(gNB->common_vars.rxdataF,
+ gNB->pusch_vars[ulsch_id],
symbol,
dmrs_symbol_flag,
- rel15_ul->qam_mod_order,
- rel15_ul->rb_size,
- gNB->pusch_vars[ulsch_id]->log2_maxh);
- stop_meas(&gNB->ulsch_channel_compensation_stats);
+ rel15_ul,
+ frame_parms);
+ stop_meas(&gNB->ulsch_rbs_extraction_stats);
- start_meas(&gNB->ulsch_mrc_stats);
- nr_ulsch_detection_mrc(frame_parms,
- gNB->pusch_vars[ulsch_id]->rxdataF_comp,
- gNB->pusch_vars[ulsch_id]->ul_ch_mag,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb,
- symbol,
- rel15_ul->rb_size);
- stop_meas(&gNB->ulsch_mrc_stats);
+ //----------------------------------------------------------
+ //--------------------- Channel Scaling --------------------
+ //----------------------------------------------------------
+ nr_ulsch_scale_channel(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
+ frame_parms,
+ gNB->ulsch[ulsch_id],
+ symbol,
+ dmrs_symbol_flag,
+ rel15_ul->rb_size,
+ rel15_ul->dmrs_config_type);
+ if (gNB->pusch_vars[ulsch_id]->cl_done==0) {
+ nr_ulsch_channel_level(gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
+ frame_parms,
+ avg,
+ symbol,
+ nb_re_pusch,
+ rel15_ul->rb_size);
+
+ avgs = 0;
+
+ for (aatx=0;aatxnb_antennas_rx;aarx++)
+ avgs = cmax(avgs,avg[(aatx<<1)+aarx]);
+
+ gNB->pusch_vars[ulsch_id]->log2_maxh = (log2_approx(avgs)/2)+3;
+ gNB->pusch_vars[ulsch_id]->cl_done = 1;
+ }
+
+ //----------------------------------------------------------
+ //--------------------- Channel Compensation ---------------
+ //----------------------------------------------------------
+ start_meas(&gNB->ulsch_channel_compensation_stats);
+ nr_ulsch_channel_compensation(gNB->pusch_vars[ulsch_id]->rxdataF_ext,
+ gNB->pusch_vars[ulsch_id]->ul_ch_estimates_ext,
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
+ gNB->pusch_vars[ulsch_id]->rxdataF_comp,
+ (nb_antennas_ue_tx>1) ? gNB->pusch_vars[ulsch_id]->rho : NULL,
+ frame_parms,
+ symbol,
+ dmrs_symbol_flag,
+ rel15_ul->qam_mod_order,
+ rel15_ul->rb_size,
+ gNB->pusch_vars[ulsch_id]->log2_maxh);
+ stop_meas(&gNB->ulsch_channel_compensation_stats);
+
+ start_meas(&gNB->ulsch_mrc_stats);
+ nr_ulsch_detection_mrc(frame_parms,
+ gNB->pusch_vars[ulsch_id]->rxdataF_comp,
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb,
+ symbol,
+ rel15_ul->rb_size);
+ stop_meas(&gNB->ulsch_mrc_stats);
+
+ if (rel15_ul->transform_precoding == 0) {
- if (rel15_ul->transform_precoding == 0) {
-
#ifdef __AVX2__
// For odd number of resource blocks need byte alignment to multiple of 8
int nb_re_pusch2 = nb_re_pusch + (nb_re_pusch&7);
#else
int nb_re_pusch2 = nb_re_pusch;
- #endif
-
- // perform IDFT operation on the compensated rxdata if transform precoding is enabled
- nr_idft(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * nb_re_pusch2], nb_re_pusch);
- LOG_D(PHY,"Transform precoding being done on data- symbol: %d, nb_re_pusch: %d\n", symbol, nb_re_pusch);
- }
+ #endif
+ // perform IDFT operation on the compensated rxdata if transform precoding is enabled
+ nr_idft(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * nb_re_pusch2], nb_re_pusch);
+ LOG_D(PHY,"Transform precoding being done on data- symbol: %d, nb_re_pusch: %d\n", symbol, nb_re_pusch);
+ }
- //----------------------------------------------------------
- //--------------------- PTRS Processing --------------------
- //----------------------------------------------------------
+ //----------------------------------------------------------
+ //--------------------- PTRS Processing --------------------
+ //----------------------------------------------------------
+ /* In case PTRS is enabled then LLR will be calculated after PTRS symbols are processed *
+ * otherwise LLR are calculated for each symbol based upon DMRS channel estimates only. */
+ if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS) {
+ start_meas(&gNB->ulsch_ptrs_processing_stats);
+ nr_pusch_ptrs_processing(gNB,
+ frame_parms,
+ rel15_ul,
+ ulsch_id,
+ slot,
+ symbol,
+ nb_re_pusch);
+ stop_meas(&gNB->ulsch_ptrs_processing_stats);
- /* In case PTRS is enabled then LLR will be calculated after PTRS symbols are processed *
- * otherwise LLR are calculated for each symbol based upon DMRS channel estimates only. */
- if (rel15_ul->pdu_bit_map & PUSCH_PDU_BITMAP_PUSCH_PTRS)
- {
- start_meas(&gNB->ulsch_ptrs_processing_stats);
- nr_pusch_ptrs_processing(gNB,
- frame_parms,
- rel15_ul,
- ulsch_id,
- nr_tti_rx,
- symbol,
- nb_re_pusch);
- stop_meas(&gNB->ulsch_ptrs_processing_stats);
+ /* Subtract total PTRS RE's in the symbol from PUSCH RE's */
+ gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] -= gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
+ }
- /* Subtract total PTRS RE's in the symbol from PUSCH RE's */
- gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol] -= gNB->pusch_vars[ulsch_id]->ptrs_re_per_slot;
- }
- }
-
- /*---------------------------------------------------------------------------------------------------- */
- /*-------------------- LLRs computation -------------------------------------------------------------*/
- /*-----------------------------------------------------------------------------------------------------*/
- if(symbol == (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols -1)) {
-
-#ifdef __AVX2__
- int off = ((rel15_ul->rb_size&1) == 1)? 4:0;
-#else
- int off = 0;
-#endif
- uint32_t rxdataF_ext_offset = 0;
- for(uint8_t i =rel15_ul->start_symbol_index; i< (rel15_ul->start_symbol_index + rel15_ul->nr_of_symbols);i++) {
+ /*---------------------------------------------------------------------------------------------------- */
+ /*-------------------- LLRs computation -------------------------------------------------------------*/
+ /*-----------------------------------------------------------------------------------------------------*/
start_meas(&gNB->ulsch_llr_stats);
- nr_ulsch_compute_llr(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][i * (off + rel15_ul->rb_size * NR_NB_SC_PER_RB)],
- gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
- gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
- &gNB->pusch_vars[ulsch_id]->llr[rxdataF_ext_offset * rel15_ul->qam_mod_order],
- rel15_ul->rb_size,
- gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[i],
- i,
- rel15_ul->qam_mod_order);
+ nr_ulsch_compute_llr(&gNB->pusch_vars[ulsch_id]->rxdataF_comp[0][symbol * (off + rel15_ul->rb_size * NR_NB_SC_PER_RB)],
+ gNB->pusch_vars[ulsch_id]->ul_ch_mag0,
+ gNB->pusch_vars[ulsch_id]->ul_ch_magb0,
+ &gNB->pusch_vars[ulsch_id]->llr[rxdataF_ext_offset * rel15_ul->qam_mod_order],
+ rel15_ul->rb_size,
+ gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol],
+ symbol,
+ rel15_ul->qam_mod_order);
stop_meas(&gNB->ulsch_llr_stats);
- rxdataF_ext_offset += gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[i];
- }// symbol loop
- }// last symbol check
-
- return (0);
+ rxdataF_ext_offset += gNB->pusch_vars[ulsch_id]->ul_valid_re_per_slot[symbol];
+ }
+ } // symbol loop
+
+ return 0;
}
diff --git a/openair1/PHY/NR_TRANSPORT/pucch_rx.c b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
index 8ebb937d05..2b5343aa60 100644
--- a/openair1/PHY/NR_TRANSPORT/pucch_rx.c
+++ b/openair1/PHY/NR_TRANSPORT/pucch_rx.c
@@ -296,7 +296,8 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
for(i=0;inr_of_symbols;l++) {
- corr_re[l]=0;corr_im[l]=0;
+ corr_re[l]=0;
+ corr_im[l]=0;
seq_index = (pucch_pdu->initial_cyclic_shift+
mcs[i]+
gNB->pucch0_lut.lut[cs_ind][slot][l+pucch_pdu->start_symbol_index])%12;
@@ -346,7 +347,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
index=maxpos;
-
// estimate CQI for MAC (from antenna port 0 only)
int max_n0 = uci_stats->pucch0_n00>uci_stats->pucch0_n01 ? uci_stats->pucch0_n00:uci_stats->pucch0_n01;
int SNRtimes10 = dB_fixed_times10(signal_energy_nodc(&rxdataF[0][pucch_pdu->start_symbol_index*frame_parms->ofdm_symbol_size+re_offset[0]],12)) - (10*max_n0);
@@ -399,7 +399,6 @@ void nr_decode_pucch0(PHY_VARS_gNB *gNB,
uci_stats->pucch0_positive_SR++;
}
uci_stats->pucch01_trials++;
-
}
else {
uci_pdu->harq = calloc(1,sizeof(*uci_pdu->harq));
@@ -1600,7 +1599,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
if (pucch_pdu->bit_len_harq>0) {
int harq_bytes=pucch_pdu->bit_len_harq>>3;
if ((pucch_pdu->bit_len_harq&7) > 0) harq_bytes++;
- uci_pdu->pduBitmap|=1;
+ uci_pdu->pduBitmap|=2;
uci_pdu->harq.harq_payload = (uint8_t*)malloc(harq_bytes);
uci_pdu->harq.harq_crc = decoderState;
int i=0;
@@ -1614,7 +1613,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
}
if (pucch_pdu->sr_flag == 1) {
- uci_pdu->pduBitmap|=2;
+ uci_pdu->pduBitmap|=1;
uci_pdu->sr.sr_bit_len = 1;
uci_pdu->sr.sr_payload = malloc(1);
uci_pdu->sr.sr_payload[0] = decodedPayload[0]&1;
@@ -1643,8 +1642,7 @@ void nr_decode_pucch2(PHY_VARS_gNB *gNB,
}
}
-
-void dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
+void nr_dump_uci_stats(FILE *fd,PHY_VARS_gNB *gNB,int frame) {
int strpos=0;
char output[16384];
diff --git a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
index 6937c23a6d..4af7e4d45b 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/dci_nr.c
@@ -142,7 +142,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
if (reg_bundle_size_L != 0) { // interleaving will be done only if reg_bundle_size_L != 0
coreset_interleaved = 1;
- coreset_C = (uint32_t) ((coreset_nbr_rb * coreset_time_dur) / (coreset_interleaver_size_R * reg_bundle_size_L));
+ coreset_C = (uint32_t) (coreset_nbr_rb / (coreset_interleaver_size_R * reg_bundle_size_L));
} else {
reg_bundle_size_L = 6;
}
@@ -150,7 +150,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
int f_bundle_j_list[NR_MAX_PDCCH_AGG_LEVEL] = {};
- for (int reg = 0; reg < ((coreset_nbr_rb * coreset_time_dur)); reg++) {
+ for (int reg = 0; reg < coreset_nbr_rb; reg++) {
if ((reg % reg_bundle_size_L) == 0) {
if (r == coreset_interleaver_size_R) {
r = 0;
@@ -158,7 +158,7 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
}
bundle_j = (c * coreset_interleaver_size_R) + r;
- f_bundle_j = ((r * coreset_C) + c + n_shift) % ((coreset_nbr_rb * coreset_time_dur) / reg_bundle_size_L);
+ f_bundle_j = ((r * coreset_C) + c + n_shift) % (coreset_nbr_rb / reg_bundle_size_L);
if (coreset_interleaved == 0) f_bundle_j = bundle_j;
@@ -184,22 +184,28 @@ void nr_pdcch_demapping_deinterleaving(uint32_t *llr,
}
}
- for(int reg=0; reg<((coreset_nbr_rb*coreset_time_dur)); reg++) {
+ int rb = 0;
+ for (int c_id = 0; c_id < number_of_candidates; c_id++ ) {
+ for (int symbol_idx = 0; symbol_idx < coreset_time_dur; symbol_idx++) {
+ for (int cce_count = CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur; cce_count < CCE[c_id/coreset_time_dur]+c_id%coreset_time_dur+L[c_id]; cce_count += coreset_time_dur) {
+ for (int reg_in_cce_idx = 0; reg_in_cce_idx < NR_NB_REG_PER_CCE; reg_in_cce_idx++) {
- f_reg = (f_bundle_j_list_ord[reg/6]*reg_bundle_size_L)+(reg%reg_bundle_size_L);
- index_z = 9*reg;
- index_llr = 9*((uint16_t)floor(f_reg/coreset_time_dur)+((f_reg%coreset_time_dur)*(coreset_nbr_rb)));
+ f_reg = (f_bundle_j_list_ord[cce_count] * reg_bundle_size_L) + reg_in_cce_idx;
+ index_z = 9 * rb;
+ index_llr = (uint16_t) (f_reg + symbol_idx * coreset_nbr_rb) * 9;
- for (int i=0; i<9; i++) {
- z[index_z + i] = llr[index_llr + i];
+ for (int i = 0; i < 9; i++) {
+ z[index_z + i] = llr[index_llr + i];
#ifdef NR_PDCCH_DCI_DEBUG
- LOG_D(PHY,"[reg=%d,bundle_j=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n",
- reg,bundle_j,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
- f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
+ LOG_I(PHY,"[cce_count=%d,reg_in_cce_idx=%d,bundle_j=%d,symbol_idx=%d,candidate=%d] z[%d]=(%d,%d) <-> \t[f_reg=%d,fbundle_j=%d] llr[%d]=(%d,%d) \n",
+ cce_count,reg_in_cce_idx,bundle_j,symbol_idx,c_id,(index_z + i),*(int16_t *) &z[index_z + i],*(1 + (int16_t *) &z[index_z + i]),
+ f_reg,f_bundle_j,(index_llr + i),*(int16_t *) &llr[index_llr + i], *(1 + (int16_t *) &llr[index_llr + i]));
#endif
+ }
+ rb++;
+ }
+ }
}
-
- if ((reg%reg_bundle_size_L) == 0) r++;
}
}
@@ -726,8 +732,10 @@ int32_t nr_rx_pdcch(PHY_VARS_NR_UE *ue,
rel15 = &pdcch_vars->pdcch_config[i];
int n_rb,rb_offset;
get_coreset_rballoc(rel15->coreset.frequency_domain_resource,&n_rb,&rb_offset);
+
LOG_D(PHY,"pdcch coreset: freq %x, n_rb %d, rb_offset %d\n",
- rel15->coreset.frequency_domain_resource[0],n_rb,rb_offset);
+ rel15->coreset.frequency_domain_resource[0],n_rb,rb_offset);
+
for (int s=rel15->coreset.StartSymbolIndex; s<(rel15->coreset.StartSymbolIndex+rel15->coreset.duration); s++) {
LOG_D(PHY,"in nr_pdcch_extract_rbs_single(rxdataF -> rxdataF_ext || dl_ch_estimates -> dl_ch_estimates_ext)\n");
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
index 0554ddcca0..2cb944b842 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_dlsch_decoding.c
@@ -697,7 +697,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DLSCH_COMBINE_SEG, VCD_FUNCTION_OUT);
dlsch->last_iteration_cnt = ret;
- // log_dump(PHY, harq_process->b, 60, LOG_DUMP_CHAR,"nrue pdsch rx frame %d %d: ", frame, nr_slot_rx );
return(ret);
}
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
index 76fe180aba..0d372deedf 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_prach.c
@@ -66,7 +66,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
uint8_t Mod_id, fd_occasion, preamble_index, restricted_set, not_found;
uint16_t rootSequenceIndex, prach_fmt_id, NCS, *prach_root_sequence_map, preamble_offset = 0;
- uint16_t preamble_shift = 0, preamble_index0, n_shift_ra, n_shift_ra_bar, d_start, numshift, N_ZC, u, offset, offset2, first_nonzero_root_idx;
+ uint16_t preamble_shift = 0, preamble_index0, n_shift_ra, n_shift_ra_bar, d_start=0, numshift, N_ZC, u, offset, offset2, first_nonzero_root_idx;
int16_t prach_tmp[98304*2*4] __attribute__((aligned(32)));
int16_t Ncp = 0, amp, *prach, *prach2, *prachF, *Xu;
@@ -218,12 +218,12 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
k *= 2;
LOG_I(PHY, "PRACH [UE %d] in slot %d, placing PRACH in position %d, msg1 frequency start %d (k1 %d), preamble_offset %d, first_nonzero_root_idx %d\n", Mod_id,
- slot,
- k,
- n_ra_prb,
- nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
- preamble_offset,
- first_nonzero_root_idx);
+ slot,
+ k,
+ n_ra_prb,
+ nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].k1,
+ preamble_offset,
+ first_nonzero_root_idx);
Xu = (int16_t*)ue->X_u[preamble_offset-first_nonzero_root_idx];
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
index eaff6df0c9..e8a9606255 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_transport_ue.h
@@ -38,10 +38,10 @@
//#include "PHY/defs_nr_UE.h"
#include "../NR_TRANSPORT/nr_transport_common_proto.h"
-#ifndef STANDALONE_COMPILE
+/*#ifndef STANDALONE_COMPILE
#include "UTIL/LISTS/list.h"
#endif
-
+*/
#include "openair2/NR_UE_PHY_INTERFACE/NR_IF_Module.h"
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
index 76fc5f298f..6cf782d9d8 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ue_rf_helpers.c
@@ -31,13 +31,15 @@
#include "PHY/defs_nr_UE.h"
#include "PHY/phy_extern_nr_ue.h"
#include "nr_transport_proto_ue.h"
+#include "executables/softmodem-common.h"
void nr_get_carrier_frequencies(NR_DL_FRAME_PARMS *fp, uint64_t *dl_carrier, uint64_t *ul_carrier){
- if (downlink_frequency[0][0])
- *dl_carrier = downlink_frequency[0][0];
- else
+ if (get_softmodem_params()->phy_test==1 || get_softmodem_params()->do_ra==1 || !downlink_frequency[0][0]) {
*dl_carrier = fp->dl_CarrierFreq;
+ } else {
+ *dl_carrier = downlink_frequency[0][0];
+ }
if (uplink_frequency_offset[0][0])
*ul_carrier = *dl_carrier + uplink_frequency_offset[0][0];
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
index 1adc81d556..8f3d1987bc 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_coding.c
@@ -264,13 +264,15 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
LOG_D(PHY,"ulsch coding nb_rb %d, Nl = %d\n", nb_rb, harq_process->pusch_pdu.nrOfLayers);
LOG_D(PHY,"ulsch coding A %d G %d mod_order %d\n", A,G, mod_order);
- LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n",harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator);
+ LOG_D(PHY,"harq_pid %d harq_process->ndi %d, pusch_data.new_data_indicator %d\n",
+ harq_pid,harq_process->ndi,harq_process->pusch_pdu.pusch_data.new_data_indicator);
+
if (harq_process->first_tx == 1 ||
harq_process->ndi != harq_process->pusch_pdu.pusch_data.new_data_indicator) { // this is a new packet
#ifdef DEBUG_ULSCH_CODING
printf("encoding thinks this is a new packet \n");
#endif
- harq_process->first_tx=0;
+ harq_process->first_tx = 0;
///////////////////////// a---->| add CRC |---->b /////////////////////////
///////////
/*
@@ -413,7 +415,7 @@ int nr_ulsch_encoding(NR_UE_ULSCH_t *ulsch,
///////////
///////////////////////////////////////////////////////////////////////////////
- LOG_D(PHY,"setting ndi to %d from pusch_data\n",harq_process->pusch_pdu.pusch_data.new_data_indicator);
+ LOG_D(PHY,"setting ndi to %d from pusch_data\n", harq_process->pusch_pdu.pusch_data.new_data_indicator);
harq_process->ndi = harq_process->pusch_pdu.pusch_data.new_data_indicator;
}
F = harq_process->F;
diff --git a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
index e92dc7476f..d65ee6c73f 100644
--- a/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
+++ b/openair1/PHY/NR_UE_TRANSPORT/nr_ulsch_ue.c
@@ -147,7 +147,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
get_num_re_dmrs(pusch_pdu, &nb_dmrs_re_per_rb, &number_dmrs_symbols);
LOG_D(PHY,"ulsch %x : start_rb %d bwp_start %d start_sc %d start_symbol %d num_symbols %d cdmgrpsnodata %d num_dmrs %d dmrs_re_per_rb %d\n",
- rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb);
+ rnti,start_rb,pusch_pdu->bwp_start,start_sc,start_symbol,number_of_symbols,cdm_grps_no_data,number_dmrs_symbols,nb_dmrs_re_per_rb);
// 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;
@@ -164,8 +164,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
///////////
////////////////////////////////////////////////////////////////////
- //log_dump(PHY, harq_process_ul_ue->a, 16, LOG_DUMP_CHAR,"nrue pusch tx frame %d %d: ", frame, slot);
-
+
/////////////////////////ULSCH scrambling/////////////////////////
///////////
@@ -366,7 +365,7 @@ void nr_ue_ulsch_procedures(PHY_VARS_NR_UE *UE,
// TODO: performance improvement, we can skip the modulation of DMRS symbols outside the bandwidth part
// Perform this on gold sequence, not required when SC FDMA operation is done,
- LOG_D(PHY,"DMRS in symbol %d\n",l);
+ LOG_D(PHY,"DMRS in symbol %d\n",l);
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 {
diff --git a/openair1/PHY/TOOLS/lte_phy_scope.h b/openair1/PHY/TOOLS/lte_phy_scope.h
index af9858ebad..1873fabea0 100644
--- a/openair1/PHY/TOOLS/lte_phy_scope.h
+++ b/openair1/PHY/TOOLS/lte_phy_scope.h
@@ -28,6 +28,7 @@
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/impl_defs_top.h"
+#include
/* Forms and Objects */
diff --git a/openair1/PHY/TOOLS/nr_phy_scope.c b/openair1/PHY/TOOLS/nr_phy_scope.c
index 90a252dc98..c840149507 100644
--- a/openair1/PHY/TOOLS/nr_phy_scope.c
+++ b/openair1/PHY/TOOLS/nr_phy_scope.c
@@ -240,7 +240,7 @@ static void genericWaterFall (OAIgraph_t *graph, scopeSample_t *values, const in
for (int pix=0; pixw; pix++) {
scopeSample_t *end=values+(pix+1)*samplesPerPixel;
end-=2;
- AssertFatal(end <= values+datasize,"diff : %u", end-values+datasize);
+ AssertFatal(end <= values+datasize,"diff : %ld", end-values+datasize);
double val=0;
for (scopeSample_t *s=values+(pix)*samplesPerPixel;
diff --git a/openair1/PHY/TOOLS/oai_dfts.c b/openair1/PHY/TOOLS/oai_dfts.c
index 6e85bca384..83207426fd 100644
--- a/openair1/PHY/TOOLS/oai_dfts.c
+++ b/openair1/PHY/TOOLS/oai_dfts.c
@@ -32,17 +32,17 @@
#define M_PI 3.14159265358979323846
#endif
#define OAIDFTS_MAIN
-#ifndef MR_MAIN
-#include "PHY/defs_common.h"
-#include "PHY/impl_defs_top.h"
-#else
+//#ifndef MR_MAIN
+//#include "PHY/defs_common.h"
+//#include "PHY/impl_defs_top.h"
+//#else
#include "time_meas.h"
#include "LOG/log.h"
#define debug_msg
#define ONE_OVER_SQRT2_Q15 23170
-int oai_exit=0;
-#endif
+//int oai_exit=0;
+//#endif
#define ONE_OVER_SQRT3_Q15 18919
@@ -50,6 +50,8 @@ int oai_exit=0;
#include "assertions.h"
+#include "tools_defs.h"
+
#define print_shorts(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7])
#define print_shorts256(s,x) printf("%s %d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",s,(x)[0],(x)[1],(x)[2],(x)[3],(x)[4],(x)[5],(x)[6],(x)[7],(x)[8],(x)[9],(x)[10],(x)[11],(x)[12],(x)[13],(x)[14],(x)[15])
diff --git a/openair1/PHY/defs_RU.h b/openair1/PHY/defs_RU.h
index 86c94421f2..66cb51adc6 100644
--- a/openair1/PHY/defs_RU.h
+++ b/openair1/PHY/defs_RU.h
@@ -436,6 +436,14 @@ typedef enum {
typedef struct RU_t_s {
/// index of this ru
uint32_t idx;
+ /// pointer to first RU
+ struct RU_t_s *ru0;
+ /// pointer to ru_mask
+ uint64_t *ru_mask;
+ /// pointer to ru_mutex
+ pthread_mutex_t *ru_mutex;
+ /// pointer to ru_cond
+ pthread_cond_t *ru_cond;
/// Pointer to configuration file
char *rf_config_file;
/// southbound interface
@@ -446,6 +454,12 @@ typedef struct RU_t_s {
node_function_t function;
/// Ethernet parameters for fronthaul interface
eth_params_t eth_params;
+ /// flag to indicate RF emulation mode
+ int emulate_rf;
+ /// numerology index
+ int numerology;
+ /// flag to indicate basicsim operation
+ int basicsim;
/// flag to indicate the RU is in sync with a master reference
int in_synch;
/// timing offset
diff --git a/openair1/PHY/defs_common.h b/openair1/PHY/defs_common.h
index 70ca77fcc6..a371b2334b 100644
--- a/openair1/PHY/defs_common.h
+++ b/openair1/PHY/defs_common.h
@@ -945,6 +945,23 @@ extern int sync_var;
#define DECODE_NUM_FPTR 13
+// Mask for identifying subframe for MBMS
+#define MBSFN_TDD_SF3 0x80// for TDD
+#define MBSFN_TDD_SF4 0x40
+#define MBSFN_TDD_SF7 0x20
+#define MBSFN_TDD_SF8 0x10
+#define MBSFN_TDD_SF9 0x08
+
+
+
+#define MBSFN_FDD_SF1 0x80// for FDD
+#define MBSFN_FDD_SF2 0x40
+#define MBSFN_FDD_SF3 0x20
+#define MBSFN_FDD_SF6 0x10
+#define MBSFN_FDD_SF7 0x08
+#define MBSFN_FDD_SF8 0x04
+
+
typedef uint8_t(decoder_if_t)(int16_t *y,
int16_t *y2,
uint8_t *decoded_bytes,
diff --git a/openair1/PHY/defs_eNB.h b/openair1/PHY/defs_eNB.h
index 0f1bf75114..030d50bc04 100644
--- a/openair1/PHY/defs_eNB.h
+++ b/openair1/PHY/defs_eNB.h
@@ -164,10 +164,10 @@ typedef struct {
/// - first index: rx antenna id [0..nb_antennas_rx[
/// - second index: ? [0..12*N_RB_UL*frame_parms->symbols_per_tti[
int32_t **ul_ch_magb;
- /// measured RX power based on DRS
- int ulsch_power[2];
- /// measured Interference power based on DRS
- int ulsch_interference_power[2];
+ /// measured RX power based on DMRS
+ int ulsch_power[4];
+ /// measured RX power of noise
+ int ulsch_noise_power[4];
/// \brief llr values.
/// - first index: ? [0..1179743] (hard coded)
int16_t *llr;
@@ -217,6 +217,58 @@ typedef struct {
int ret;
} td_params;
+/// Context data structure for RX/TX portion of subframe processing
+typedef struct {
+ /// Component Carrier index
+ uint8_t CC_id;
+ /// timestamp transmitted to HW
+ openair0_timestamp timestamp_tx;
+ openair0_timestamp timestamp_rx;
+ /// subframe to act upon for transmission
+ int subframe_tx;
+ /// subframe to act upon for reception
+ int subframe_rx;
+ /// frame to act upon for transmission
+ int frame_tx;
+ /// frame to act upon for reception
+ int frame_rx;
+ int frame_prach;
+ int subframe_prach;
+ int frame_prach_br;
+ int subframe_prach_br;
+ /// \brief Instance count for RXn-TXnp4 processing thread.
+ /// \internal This variable is protected by \ref mutex_rxtx.
+ int instance_cnt;
+ /// pthread structure for RXn-TXnp4 processing thread
+ pthread_t pthread;
+ /// pthread attributes for RXn-TXnp4 processing thread
+ pthread_attr_t attr;
+ /// condition variable for tx processing thread
+ pthread_cond_t cond;
+ /// mutex for RXn-TXnp4 processing thread
+ pthread_mutex_t mutex;
+ /// scheduling parameters for RXn-TXnp4 thread
+ struct sched_param sched_param_rxtx;
+
+ /// \internal This variable is protected by \ref mutex_RUs.
+ int instance_cnt_RUs;
+ /// condition variable for tx processing thread
+ pthread_cond_t cond_RUs;
+ /// mutex for RXn-TXnp4 processing thread
+ pthread_mutex_t mutex_RUs;
+ tpool_t *threadPool;
+ int nbEncode;
+ int nbDecode;
+ notifiedFIFO_t *respEncode;
+ notifiedFIFO_t *respDecode;
+ pthread_mutex_t mutex_emulateRF;
+ int instance_cnt_emulateRF;
+ pthread_t pthread_emulateRF;
+ pthread_attr_t attr_emulateRF;
+ pthread_cond_t cond_emulateRF;
+ int first_rx;
+} L1_rxtx_proc_t;
+
typedef struct {
struct PHY_VARS_eNB_s *eNB;
LTE_eNB_DLSCH_t *dlsch;
@@ -362,8 +414,11 @@ typedef struct L1_proc_t_s {
L1_rxtx_proc_t L1_proc,L1_proc_tx;
/// stats thread pthread descriptor
pthread_t process_stats_thread;
+ /// L1 stats pthread descriptor
+ pthread_t L1_stats_thread;
/// for waking up tx procedure
RU_proc_t *ru_proc;
+ struct PHY_VARS_eNB_s *eNB;
} L1_proc_t;
@@ -395,36 +450,73 @@ typedef struct {
short n0_subband_power_avg_dB;
// eNB measurements (per user)
//! estimated received spatial signal power (linear)
- unsigned int rx_spatial_power[NUMBER_OF_UE_MAX][2][2];
+ unsigned int rx_spatial_power[NUMBER_OF_SRS_MAX][2][2];
//! estimated received spatial signal power (dB)
- unsigned short rx_spatial_power_dB[NUMBER_OF_UE_MAX][2][2];
+ unsigned short rx_spatial_power_dB[NUMBER_OF_SRS_MAX][2][2];
//! estimated rssi (dBm)
- short rx_rssi_dBm[NUMBER_OF_UE_MAX];
+ short rx_rssi_dBm[NUMBER_OF_SRS_MAX];
//! estimated correlation (wideband linear) between spatial channels (computed in dlsch_demodulation)
- int rx_correlation[NUMBER_OF_UE_MAX][2];
+ int rx_correlation[NUMBER_OF_SRS_MAX][2];
//! estimated correlation (wideband dB) between spatial channels (computed in dlsch_demodulation)
- int rx_correlation_dB[NUMBER_OF_UE_MAX][2];
+ int rx_correlation_dB[NUMBER_OF_SRS_MAX][2];
/// Wideband CQI (= SINR)
- int wideband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
+ int wideband_cqi[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB];
/// Wideband CQI in dB (= SINR dB)
- int wideband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB];
+ int wideband_cqi_dB[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB];
/// Wideband CQI (sum of all RX antennas, in dB)
- char wideband_cqi_tot[NUMBER_OF_UE_MAX];
+ char wideband_cqi_tot[NUMBER_OF_SRS_MAX];
/// Subband CQI per RX antenna and RB (= SINR)
- int subband_cqi[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
+ int subband_cqi[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB][100];
/// Total Subband CQI and RB (= SINR)
int subband_cqi_tot[NUMBER_OF_UE_MAX][100];
/// Subband CQI in dB and RB (= SINR dB)
- int subband_cqi_dB[NUMBER_OF_UE_MAX][MAX_NUM_RU_PER_eNB][100];
+ int subband_cqi_dB[NUMBER_OF_SRS_MAX][MAX_NUM_RU_PER_eNB][100];
/// Total Subband CQI and RB
- int subband_cqi_tot_dB[NUMBER_OF_UE_MAX][100];
+ int subband_cqi_tot_dB[NUMBER_OF_SRS_MAX][100];
/// PRACH background noise level
int prach_I0;
/// PUCCH background noise level
int n0_pucch_dB;
} PHY_MEASUREMENTS_eNB;
+typedef struct {
+ uint16_t rnti;
+ int frame;
+ int round_trials[8];
+ int total_bytes_tx;
+ int total_bytes_rx;
+ int current_G;
+ int current_TBS;
+ int current_Qm;
+ int current_mcs;
+ int current_RI;
+ int timing_offset;
+ int ulsch_power[4];
+ int ulsch_noise_power[4];
+} eNB_SCH_STATS_t;
+
+typedef struct {
+ uint16_t rnti;
+ int frame;
+ int pucch1_trials;
+ int pucch1_thres;
+ int current_pucch1_stat_pos;
+ int current_pucch1_stat_neg;
+ int pucch1_positive_SR;
+ int pucch1_low_stat[4];
+ int pucch1_high_stat[4];
+ int pucch1_phase;
+ int pucch1a_trials;
+ int current_pucch1a_stat_re;
+ int current_pucch1a_stat_im;
+ int pucch1ab_DTX;
+ int pucch1b_trials;
+ int current_pucch1b_stat_re;
+ int current_pucch1b_stat_im;
+ int pucch3_trials;
+ int current_pucch3_stat;
+} eNB_UCI_STATS_t;
/// Top-level PHY Data Structure for eNB
typedef struct PHY_VARS_eNB_s {
@@ -472,13 +564,13 @@ typedef struct PHY_VARS_eNB_s {
LTE_eNB_MPDCCH mpdcch_vars[2];
LTE_eNB_PRACH prach_vars_br;
LTE_eNB_COMMON common_vars;
- LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_VARS_MAX];
- LTE_eNB_SRS srs_vars[NUMBER_OF_UE_MAX];
+ LTE_eNB_UCI uci_vars[NUMBER_OF_UCI_MAX];
+ LTE_eNB_SRS srs_vars[NUMBER_OF_SRS_MAX];
LTE_eNB_PBCH pbch;
- LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_UE_MAX];
+ LTE_eNB_PUSCH *pusch_vars[NUMBER_OF_ULSCH_MAX];
LTE_eNB_PRACH prach_vars;
- LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_UE_MAX][2]; // Nusers times two spatial streams
- LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_UE_MAX+1]; // Nusers + number of RA
+ LTE_eNB_DLSCH_t *dlsch[NUMBER_OF_DLSCH_MAX][2]; // Num active DLSCH contexts times two spatial streams
+ LTE_eNB_ULSCH_t *ulsch[NUMBER_OF_ULSCH_MAX]; // Num active ULSCH contexts
LTE_eNB_DLSCH_t *dlsch_SI,*dlsch_ra,*dlsch_p;
LTE_eNB_DLSCH_t *dlsch_MCH;
LTE_eNB_DLSCH_t *dlsch_PCH;
@@ -489,7 +581,7 @@ typedef struct PHY_VARS_eNB_s {
uint32_t lte_gold_table[20][2][14];
/// UE-specific reference symbols (p=5), TM 7
- uint32_t lte_gold_uespec_port5_table[NUMBER_OF_UE_MAX][20][38];
+ uint32_t lte_gold_uespec_port5_table[NUMBER_OF_DLSCH_MAX][20][38];
/// UE-specific reference symbols (p=7...14), TM 8/9/10
uint32_t lte_gold_uespec_table[2][20][2][21];
@@ -521,6 +613,9 @@ typedef struct PHY_VARS_eNB_s {
uint8_t pbch_pdu[4]; //PBCH_PDU_SIZE
char eNB_generate_rar;
+ /// indicator that eNB signal generation uses DTX (i.e. signal is cleared in each subframe
+ int use_DTX;
+ int32_t **subframe_mask;
/// Indicator set to 0 after first SR
uint8_t first_sr[NUMBER_OF_UE_MAX];
@@ -592,7 +687,12 @@ typedef struct PHY_VARS_eNB_s {
/// Information regarding TM5
MU_MIMO_mode mu_mimo_mode[NUMBER_OF_UE_MAX];
-
+ /// statistics for DLSCH measurement collection
+ eNB_SCH_STATS_t dlsch_stats[NUMBER_OF_SCH_STATS_MAX];
+ /// statistics for ULSCH measurement collection
+ eNB_SCH_STATS_t ulsch_stats[NUMBER_OF_SCH_STATS_MAX];
+ /// statis for UCI (PUCCH) measurement collection
+ eNB_UCI_STATS_t uci_stats[NUMBER_OF_SCH_STATS_MAX];
/// target_ue_dl_mcs : only for debug purposes
uint32_t target_ue_dl_mcs;
/// target_ue_ul_mcs : only for debug purposes
diff --git a/openair1/PHY/defs_gNB.h b/openair1/PHY/defs_gNB.h
index 129f7a9a71..364e3a118a 100644
--- a/openair1/PHY/defs_gNB.h
+++ b/openair1/PHY/defs_gNB.h
@@ -751,7 +751,6 @@ typedef struct PHY_VARS_gNB_s {
// nfapi_nr_dl_tti_pdcch_pdu *pdcch_pdu;
// nfapi_nr_ul_dci_request_pdus_t *ul_dci_pdu;
-
uint16_t num_pdsch_rnti[80];
NR_gNB_SSB_t ssb[64];
NR_gNB_PBCH pbch;
@@ -886,6 +885,8 @@ typedef struct PHY_VARS_gNB_s {
tpool_t *threadPool;
int nbDecode;
uint8_t pusch_proc_threads;
+ int number_of_nr_dlsch_max;
+ int number_of_nr_ulsch_max;
void * scopeData;
} PHY_VARS_gNB;
diff --git a/openair1/PHY/impl_defs_nr.h b/openair1/PHY/impl_defs_nr.h
index 5ead56fe5f..d500d6e7a2 100644
--- a/openair1/PHY/impl_defs_nr.h
+++ b/openair1/PHY/impl_defs_nr.h
@@ -36,7 +36,6 @@
#include
#include "types.h"
-#include "NR_PDSCH-TimeDomainResourceAllocation.h"
#ifdef DEFINE_VARIABLES_PHY_IMPLEMENTATION_DEFS_NR_H
#define EXTERN
@@ -395,6 +394,13 @@ typedef struct{
typedef struct{
// to be defined FIXME!!!
}zp_CSI_RS_Resource_t;
+
+typedef struct{
+ int k0;
+ int mappingType;
+ int startSymbolAndLength;
+
+}PDSCH_TimeDomainResourceAllocation_t;
typedef struct {
/*
* resourceAllocation
@@ -447,7 +453,8 @@ typedef struct {
*/
maxNrofCodeWordsScheduledByDCI_t maxNrofCodeWordsScheduledByDCI;
- NR_PDSCH_TimeDomainResourceAllocation_t *pdsch_TimeDomainResourceAllocation[MAX_NR_OF_DL_ALLOCATIONS];
+
+ PDSCH_TimeDomainResourceAllocation_t *pdsch_TimeDomainResourceAllocation[MAX_NR_OF_DL_ALLOCATIONS];
} PDSCH_Config_t;
diff --git a/openair1/PHY/phy_extern.h b/openair1/PHY/phy_extern.h
index 4ba5e328e3..d5fea5aec6 100644
--- a/openair1/PHY/phy_extern.h
+++ b/openair1/PHY/phy_extern.h
@@ -23,7 +23,6 @@
#define __PHY_EXTERN_H__
#include "PHY/defs_common.h"
-#include "common/ran_context.h"
extern char* namepointer_chMag ;
extern char* namepointer_log2;
@@ -33,14 +32,13 @@ extern unsigned int RX_DMA_BUFFER[4][NB_ANTENNAS_RX];
extern unsigned int TX_DMA_BUFFER[4][NB_ANTENNAS_TX];
#include "PHY/LTE_TRANSPORT/transport_extern.h"
-//#include "SIMULATION/ETH_TRANSPORT/extern.h"
+#include "PHY/defs_RU.h"
extern unsigned int DAQ_MBOX;
extern int number_of_cards;
extern const short conjugate[8],conjugate2[8];
-extern RAN_CONTEXT_t RC;
extern short primary_synch0[144];
extern short primary_synch1[144];
diff --git a/openair1/PHY/phy_extern_ue.h b/openair1/PHY/phy_extern_ue.h
index fdaf6eaa89..9f227806fd 100644
--- a/openair1/PHY/phy_extern_ue.h
+++ b/openair1/PHY/phy_extern_ue.h
@@ -23,7 +23,6 @@
#define __PHY_EXTERN_UE__H__
#include "PHY/defs_UE.h"
-#include "common/ran_context.h"
extern char* namepointer_chMag ;
extern char* namepointer_log2;
diff --git a/openair1/PHY/phy_vars.h b/openair1/PHY/phy_vars.h
index dadb1649ec..9edb7031b9 100644
--- a/openair1/PHY/phy_vars.h
+++ b/openair1/PHY/phy_vars.h
@@ -25,7 +25,6 @@
#include "PHY/types.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
-#include "common/ran_context.h"
char* namepointer_chMag ;
char fmageren_name2[512];
@@ -38,9 +37,10 @@ char* namepointer_log2;
#include "PHY/LTE_TRANSPORT/transport_vars.h"
#include "PHY/MODULATION/modulation_vars.h"
+#include "nfapi/oai_integration/vendor_ext.h"
+
PHY_VARS_UE ***PHY_vars_UE_g;
-RAN_CONTEXT_t RC;
UL_RCC_IND_t UL_RCC_INFO;
unsigned short rev[2048],rev_times4[8192],rev_half[1024];
diff --git a/openair1/SCHED/fapi_l1.c b/openair1/SCHED/fapi_l1.c
index 3f342802b4..ecfec02193 100644
--- a/openair1/SCHED/fapi_l1.c
+++ b/openair1/SCHED/fapi_l1.c
@@ -32,11 +32,15 @@
#include "PHY/defs_eNB.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
+#include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "SCHED/sched_eNB.h"
#include "nfapi/oai_integration/vendor_ext.h"
#include "nfapi_pnf_interface.h"
#include "fapi_l1.h"
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req);
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req);
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req);
@@ -209,13 +213,13 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
- if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ) {
+ if( (UE_id<0) || (UE_id>=NUMBER_OF_DLSCH_MAX) ) {
LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rel8->rnti,UE_id);
return;
}
//AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- //AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+ //AssertFatal(UE_id= %d(NUMBER_OF_DLSCHMAX)\n",UE_id,NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch1 = eNB->dlsch[UE_id][1];
@@ -291,7 +295,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
if ((rel13->pdsch_payload_type <2) && (rel13->ue_type>0)) { // this is a BR/CE UE and SIB1-BR/SI-BR
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+ AssertFatal(UE_id= %d(NUMBER_OF_DLSCH_MAX)\n",UE_id,NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch0->harq_mask = 1;
dlsch0_harq = dlsch0->harq_processes[0];
@@ -366,7 +370,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,L1_rxtx_pro
} else {
UE_id = find_dlsch(rel8->rnti,eNB,SEARCH_EXIST_OR_FREE);
AssertFatal(UE_id!=-1,"no free or exiting dlsch_context\n");
- AssertFatal(UE_id= %d(NUMBER_OF_UE_MAX)\n",UE_id,NUMBER_OF_UE_MAX);
+ AssertFatal(UE_id= %d(NUMBER_OF_DLSCH_MAX)\n",UE_id,NUMBER_OF_DLSCH_MAX);
dlsch0 = eNB->dlsch[UE_id][0];
dlsch1 = eNB->dlsch[UE_id][1];
dlsch0->sib1_br_flag=0;
@@ -596,7 +600,7 @@ void handle_uci_sr_pdu(PHY_VARS_eNB *eNB,
uci->frame = frame;
uci->subframe = subframe;
uci->rnti = ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti;
- uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
+ uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
uci->type = SR;
uci->pucch_fmt = pucch_format1;
uci->num_antenna_ports = 1;
@@ -622,7 +626,7 @@ void handle_uci_sr_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_
uci->frame = frame;
uci->subframe = subframe;
uci->rnti = ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti;
- uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
+ uci->ue_id = find_ulsch(ul_config_pdu->uci_sr_harq_pdu.ue_information.ue_information_rel8.rnti,eNB,SEARCH_EXIST_OR_FREE);
uci->type = HARQ_SR;
uci->num_antenna_ports = 1;
uci->num_pucch_resources = 1;
@@ -660,7 +664,7 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p
if (NFAPI_MODE==NFAPI_MODE_VNF) return;
- for (i=0; isoundingrs_ul_config_dedicated[i].active==1) continue;
eNB->soundingrs_ul_config_dedicated[i].active = 1;
@@ -676,7 +680,7 @@ void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_p
break;
}
- AssertFatal(imodule_id;
@@ -780,7 +785,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
nfapi_dl_config_request_pdu_t *dl_config_pdu;
nfapi_hi_dci0_request_pdu_t *hi_dci0_req_pdu;
nfapi_ul_config_request_pdu_t *ul_config_pdu;
- int i;
+
eNB->pdcch_vars[subframe&1].num_pdcch_symbols = number_pdcch_ofdm_symbols;
eNB->pdcch_vars[subframe&1].num_dci = 0;
eNB->phich_vars[subframe&1].num_hi = 0;
@@ -811,8 +816,8 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
// clear DCI allocation maps for new subframe
if (NFAPI_MODE!=NFAPI_MODE_VNF)
- for (i=0; iulsch[i]) {
+ for (int i=0; iulsch[i]!=NULL) {
ulsch_harq = eNB->ulsch[i]->harq_processes[harq_pid];
ulsch_harq->dci_alloc=0;
ulsch_harq->rar_alloc=0;
@@ -820,7 +825,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
}
}
- for (i=0; idl_config_request_body.dl_config_pdu_list[i];
//LOG_D(PHY,"NFAPI: dl_pdu %d : type %d\n",i,dl_config_pdu->pdu_type);
@@ -969,7 +974,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
}
if (NFAPI_MODE!=NFAPI_MODE_VNF)
- for (i=0; ihi_dci0_request_body.hi_dci0_pdu_list[i];
LOG_D(PHY,"NFAPI: hi_dci0_pdu %d : type %d\n",i,hi_dci0_req_pdu->pdu_type);
@@ -993,7 +998,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
if (NFAPI_MODE!=NFAPI_MONOLITHIC) {
if (number_ul_pdu>0) {
uint8_t ulsch_pdu_num = 0;
- for (i=0; iul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE) ||
(UL_req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_CQI_RI_PDU_TYPE) ||
(UL_req->ul_config_request_body.ul_config_pdu_list[i].pdu_type == NFAPI_UL_CONFIG_ULSCH_HARQ_PDU_TYPE) ||
@@ -1020,7 +1025,7 @@ void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc) {
}
}
} else {
- for (i=0; iul_config_request_body.ul_config_pdu_list[i];
LOG_D(PHY,"NFAPI: ul_pdu %d : type %d\n",i,ul_config_pdu->pdu_type);
AssertFatal(ul_config_pdu->pdu_type == NFAPI_UL_CONFIG_ULSCH_PDU_TYPE ||
diff --git a/openair1/SCHED/fapi_l1.h b/openair1/SCHED/fapi_l1.h
index 6b9121e17f..b8f0ae1dd8 100644
--- a/openair1/SCHED/fapi_l1.h
+++ b/openair1/SCHED/fapi_l1.h
@@ -31,8 +31,6 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/defs_gNB.h"
-#include "PHY/phy_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h"
#include "SCHED/sched_common.h"
@@ -82,4 +80,4 @@ void handle_uci_harq_pdu(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_request_pdu
void handle_srs_pdu(PHY_VARS_eNB *eNB,nfapi_ul_config_request_pdu_t *ul_config_pdu,uint16_t frame,uint8_t subframe);
-void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc);
+void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc);
diff --git a/openair1/SCHED/phy_procedures_lte_common.c b/openair1/SCHED/phy_procedures_lte_common.c
index 0b592b9c55..7033c52701 100644
--- a/openair1/SCHED/phy_procedures_lte_common.c
+++ b/openair1/SCHED/phy_procedures_lte_common.c
@@ -1085,73 +1085,3 @@ void compute_srs_pos(lte_frame_type_t frameType,uint16_t isrs,uint16_t *psrsPeri
}
}
-
-// uint8_t eNB_id,uint8_t harq_pid, uint8_t UE_id,
-int16_t estimate_ue_tx_power(uint32_t tbs, uint32_t nb_rb, uint8_t control_only, lte_prefix_type_t ncp, uint8_t use_srs)
-{
-
- /// The payload + CRC size in bits, "B"
- uint32_t B;
- /// Number of code segments
- uint32_t C;
- /// Number of "small" code segments
- uint32_t Cminus;
- /// Number of "large" code segments
- uint32_t Cplus;
- /// Number of bits in "small" code segments (<6144)
- uint32_t Kminus;
- /// Number of bits in "large" code segments (<6144)
- uint32_t Kplus;
- /// Total number of bits across all segments
- uint32_t sumKr;
- /// Number of "Filler" bits
- uint32_t F;
- // num resource elements
- uint32_t num_re=0.0;
- // num symbols
- uint32_t num_symb=0.0;
- /// effective spectral efficiency of the PUSCH
- uint32_t MPR_x100=0;
- /// beta_offset
- uint16_t beta_offset_pusch_x8=8;
- /// delta mcs
- float delta_mcs=0.0;
- /// bandwidth factor
- float bw_factor=0.0;
-
- B= tbs+24;
- lte_segmentation(NULL,
- NULL,
- B,
- &C,
- &Cplus,
- &Cminus,
- &Kplus,
- &Kminus,
- &F);
-
-
- sumKr = Cminus*Kminus + Cplus*Kplus;
- num_symb = 12-(ncp<<1)-(use_srs==0?0:1);
- num_re = num_symb * nb_rb * 12;
-
- if (num_re == 0)
- return(0);
-
- MPR_x100 = 100*sumKr/num_re;
-
- if (control_only == 1 )
- beta_offset_pusch_x8=8; // fixme
-
- //(beta_offset_pusch_x8=ue->ulsch[eNB_id]->harq_processes[harq_pid]->control_only == 1) ? ue->ulsch[eNB_id]->beta_offset_cqi_times8:8;
-
- // if deltamcs_enabledm
- delta_mcs = ((hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_x10((beta_offset_pusch_x8)>>3))/100.0);
- bw_factor = (hundred_times_log10_NPRB[nb_rb-1]/100.0);
-#ifdef DEBUG_SEGMENTATION
- printf("estimated ue tx power %d (num_re %d, sumKr %d, mpr_x100 %d, delta_mcs %f, bw_factor %f)\n",
- (int16_t)ceil(delta_mcs + bw_factor), num_re, sumKr, MPR_x100, delta_mcs, bw_factor);
-#endif
- return (int16_t)ceil(delta_mcs + bw_factor);
-
-}
diff --git a/openair1/SCHED/phy_procedures_lte_eNb.c b/openair1/SCHED/phy_procedures_lte_eNb.c
index d894061acd..973c921d23 100644
--- a/openair1/SCHED/phy_procedures_lte_eNb.c
+++ b/openair1/SCHED/phy_procedures_lte_eNb.c
@@ -52,21 +52,24 @@
#define MBMS_NFAPI_SCHEDULER
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
-int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor) {
+
+int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t ULSCH_id,uint8_t harq_pid, uint8_t bw_factor) {
uint32_t Nre,sumKr,MPR_x100,Kr,r;
uint16_t beta_offset_pusch;
- DevAssert( UE_id < NUMBER_OF_UE_MAX+1 );
+ DevAssert( ULSCH_id < NUMBER_OF_ULSCH_MAX+1 );
DevAssert( harq_pid < 8 );
- Nre = eNB->ulsch[UE_id]->harq_processes[harq_pid]->Nsymb_initial *
- eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12;
+ Nre = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->Nsymb_initial *
+ eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->nb_rb*12;
sumKr = 0;
- for (r=0; rulsch[UE_id]->harq_processes[harq_pid]->C; r++) {
- if (rulsch[UE_id]->harq_processes[harq_pid]->Cminus)
- Kr = eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kminus;
+ for (r=0; rulsch[ULSCH_id]->harq_processes[harq_pid]->C; r++) {
+ if (rulsch[ULSCH_id]->harq_processes[harq_pid]->Cminus)
+ Kr = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->Kminus;
else
- Kr = eNB->ulsch[UE_id]->harq_processes[harq_pid]->Kplus;
+ Kr = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->Kplus;
sumKr += Kr;
}
@@ -79,14 +82,14 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t
// FK 20140908 sumKr is only set after the ulsch_encoding
beta_offset_pusch = 8;
//(eNB->ulsch[UE_id]->harq_processes[harq_pid]->control_only == 1) ? eNB->ulsch[UE_id]->beta_offset_cqi_times8:8;
- DevAssert( UE_id < NUMBER_OF_UE_MAX );
+ DevAssert( ULSCH_id < NUMBER_OF_ULSCH_MAX );
//#warning "This condition happens sometimes. Need more investigation" // navid
//DevAssert( MPR_x100/6 < 100 );
if (1==1) { //eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
if (bw_factor == 1) {
- uint8_t nb_rb = eNB->ulsch[UE_id]->harq_processes[harq_pid]->nb_rb;
+ uint8_t nb_rb = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->nb_rb;
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_x10((beta_offset_pusch)>>3)) + hundred_times_log10_NPRB[nb_rb-1];
} else
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_x10((beta_offset_pusch)>>3));
@@ -97,21 +100,21 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid) {
- int8_t UE_id;
+ int8_t ULSCH_id;
if ((RC.eNB == NULL) || (module_idP > RC.nb_inst) || (CC_id > RC.nb_CC[module_idP])) {
LOG_E(PHY,"get_UE_stats: No eNB found (or not allocated) for Mod_id %d,CC_id %d\n",module_idP,CC_id);
return -1;
}
- UE_id = find_ulsch( rnti, RC.eNB[module_idP][CC_id],SEARCH_EXIST);
+ ULSCH_id = find_ulsch( rnti, RC.eNB[module_idP][CC_id],SEARCH_EXIST);
- if (UE_id == -1) {
+ if (ULSCH_id == -1) {
// not found
return 0;
}
- return get_hundred_times_delta_IF_eNB( RC.eNB[module_idP][CC_id], UE_id, harq_pid, 0 );
+ return get_hundred_times_delta_IF_eNB( RC.eNB[module_idP][CC_id], ULSCH_id, harq_pid, 0 );
}
int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
@@ -499,9 +502,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
int do_meas) {
int frame=proc->frame_tx;
int subframe=proc->subframe_tx;
- uint32_t i,aa;
uint8_t harq_pid;
- int16_t UE_id=0;
uint8_t num_pdcch_symbols=0;
uint8_t num_dci=0;
uint8_t num_mdci = 0;
@@ -516,12 +517,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX+(eNB->CC_id),1);
if (do_meas==1) start_meas(&eNB->phy_proc_tx);
-
if (do_meas==1) start_meas(&eNB->dlsch_common_and_dci);
// clear the transmit data array for the current subframe
- for (aa = 0; aa < fp->nb_antenna_ports_eNB; aa++) {
- memset (&eNB->common_vars.txdataF[aa][subframe * fp->ofdm_symbol_size * (fp->symbols_per_tti)], 0, fp->ofdm_symbol_size * (fp->symbols_per_tti) * sizeof (int32_t));
+ for (int aa = 0; aa < fp->nb_antenna_ports_eNB; aa++) {
+ if (eNB->use_DTX==0)
+ memcpy(&eNB->common_vars.txdataF[aa][subframe * fp->ofdm_symbol_size * (fp->symbols_per_tti)],
+ &eNB->subframe_mask[aa][subframe*fp->ofdm_symbol_size*fp->symbols_per_tti],
+ fp->ofdm_symbol_size * (fp->symbols_per_tti) * sizeof (int32_t));
+ else memset(&eNB->common_vars.txdataF[aa][subframe * fp->ofdm_symbol_size * (fp->symbols_per_tti)], 0, fp->ofdm_symbol_size * (fp->symbols_per_tti) * sizeof (int32_t));
}
if (NFAPI_MODE==NFAPI_MONOLITHIC || NFAPI_MODE==NFAPI_MODE_PNF) {
@@ -556,7 +560,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
ul_frame = pdcch_alloc2ul_frame (fp, frame, subframe);
// clear previous allocation information for all UEs
- for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ for (volatile int i = 0; i < NUMBER_OF_DLSCH_MAX; i++) {
if (eNB->dlsch[i][0])
eNB->dlsch[i][0]->subframe_tx[subframe] = 0;
}
@@ -565,7 +569,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
//if ((ul_subframe < 10)&&
// (subframe_select(fp,ul_subframe)==SF_UL)) { // This means that there is a potential UL subframe that will be scheduled here
if (ul_subframe < 10) { // This means that there is a potential UL subframe that will be scheduled here
- for (i=0; iulsch[i] && eNB->ulsch[i]->ue_type >0) harq_pid = 0;
else
@@ -651,9 +655,9 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
// Now scan UE specific DLSCH
LTE_eNB_DLSCH_t *dlsch0,*dlsch1;
- for (UE_id=0; UE_iddlsch[(uint8_t)UE_id][0];
- dlsch1 = eNB->dlsch[(uint8_t)UE_id][1];
+ for (int DLSCH_id=0; DLSCH_iddlsch[(uint8_t)DLSCH_id][0];
+ dlsch1 = eNB->dlsch[(uint8_t)DLSCH_id][1];
if ((dlsch0)&&(dlsch0->rnti>0)&&
#ifdef PHY_TX_THREAD
@@ -663,12 +667,13 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#endif
) {
// get harq_pid
- harq_pid = dlsch0->harq_ids[frame%2][subframe];
+ harq_pid = dlsch0->harq_ids[frame%2][subframe];
//AssertFatal(harq_pid>=0,"harq_pid is negative\n");
if((harq_pid < 0) || (harq_pid >= dlsch0->Mdlharq)) {
+
if (dlsch0->ue_type==0)
- LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 UE_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,UE_id,frame,subframe,dlsch0->rnti,
+ LOG_E(PHY,"harq_pid:%d corrupt must be 0-7 DLSCH_id:%d frame:%d subframe:%d rnti:%x [ %1d.%1d.%1d.%1d.%1d.%1d.%1d.%1d\n", harq_pid,DLSCH_id,frame,subframe,dlsch0->rnti,
dlsch0->harq_ids[frame%2][0],
dlsch0->harq_ids[frame%2][1],
dlsch0->harq_ids[frame%2][2],
@@ -682,7 +687,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
proc,
harq_pid,
dlsch0,
- &eNB->UE_stats[(uint32_t)UE_id])) {
+ &eNB->UE_stats[(uint32_t)DLSCH_id])) {
// if we generate dlsch, we must generate pdsch
pdsch_procedures(eNB,
proc,
@@ -717,6 +722,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if (do_meas==1) stop_meas(&eNB->phy_proc_tx);
}
+/* This has to be updated with FAPI structures*/
void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
LTE_DL_FRAME_PARMS *fp = &eNB->frame_parms;
@@ -728,7 +734,7 @@ void srs_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
// Do SRS processing
// check if there is SRS and we have to use shortened format
// TODO: check for exceptions in transmission of SRS together with ACK/NACK
- for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ for (i = 0; i < NUMBER_OF_SRS_MAX; i++) {
if (eNB->soundingrs_ul_config_dedicated[i].active == 1) {
if (lte_srs_channel_estimation (fp, &eNB->common_vars, &eNB->srs_vars[i], &eNB->soundingrs_ul_config_dedicated[i], subframe, 0 /*eNB_id */ )) {
LOG_E (PHY, "problem processing SRS\n");
@@ -793,7 +799,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
calc_pucch_1x_interference(eNB, frame, subframe, 0);
- for (int i = 0; i < NUMBER_OF_UCI_VARS_MAX; i++) {
+ for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
uci = &(eNB->uci_vars[i]);
if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
@@ -850,7 +856,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
int pucch1_thres = (uci->ue_type == 0) ? eNB->pucch1_DTX_threshold : eNB->pucch1_DTX_threshold_emtc[0];
metric_SR = rx_pucch(eNB,
uci->pucch_fmt,
- uci->ue_id,
+ i,//uci->ue_id,
uci->n_pucch_1_0_sr[0],
0, // n2_pucch
uci->srs_active, // shortened format
@@ -1275,7 +1281,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
#ifdef DEBUG_PHY_PROC
LOG_D (PHY, "[eNB %d][PDSCH %x] Frame %d subframe %d ACK/NAK metric 0 %d, metric 1 %d, (%d,%d)\n", eNB->Mod_id,
- eNB->dlsch[UE_id][0]->rnti, frame, subframe, metric0, metric1, pucch_b0b1[0], pucch_b0b1[1]);
+ eNB->dlsch[DLSCH_id][0]->rnti, frame, subframe, metric0, metric1, pucch_b0b1[0], pucch_b0b1[1]);
#endif
}
@@ -1298,7 +1304,7 @@ uci_procedures(PHY_VARS_eNB *eNB,
}
}
} // end if ((uci->active == 1) && (uci->frame == frame) && (uci->subframe == subframe)) {
- } // end loop for (int i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ } // end loop for (int i = 0; i < NUMBER_OF_UCI_MAX; i++) {
}
void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
@@ -1325,7 +1331,7 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
int nb=abortTpool(proc->threadPool, req->key);
nb+=abortNotifiedFIFO(proc->respDecode, req->key);
proc->nbDecode-=nb;
- LOG_I(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, nb);
+ LOG_D(PHY,"uplink segment error %d/%d, aborted %d segments\n",rdata->segment_r,rdata->nbSegments, 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;
@@ -1381,6 +1387,15 @@ void postDecode(L1_rxtx_proc_t *proc, notifiedFIFO_elt_t *req) {
fill_rx_indication(eNB,i,rdata->frame,rdata->subframe); // indicate SDU to MAC
ulsch_harq->status = SCH_IDLE;
ulsch->harq_mask &= ~(1 << rdata->harq_pid);
+ for (int j=0;julsch_stats[j].rnti == ulsch->rnti) {
+ eNB->ulsch_stats[j].total_bytes_rx+=ulsch_harq->TBS;
+ for (int aa=0;aaframe_parms.nb_antennas_rx;aa++) {
+ eNB->ulsch_stats[j].ulsch_power[aa] = dB_fixed_x10(eNB->pusch_vars[rdata->UEid]->ulsch_power[aa]);
+ eNB->ulsch_stats[j].ulsch_noise_power[aa] = dB_fixed_x10(eNB->pusch_vars[rdata->UEid]->ulsch_noise_power[aa]);
+ }
+ break;
+ }
T (T_ENB_PHY_ULSCH_UE_ACK, T_INT(eNB->Mod_id), T_INT(rdata->frame), T_INT(rdata->subframe), T_INT(ulsch->rnti),
T_INT(rdata->harq_pid));
} // ulsch not in error
@@ -1401,8 +1416,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
const int frame = proc->frame_rx;
uint32_t harq_pid0 = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
- for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
+ for (i = 0; i < NUMBER_OF_ULSCH_MAX; i++) {
ulsch = eNB->ulsch[i];
+ if (!ulsch) continue;
if (ulsch->ue_type > 0) harq_pid = 0;
else harq_pid=harq_pid0;
@@ -1411,10 +1427,9 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
if (ulsch->rnti>0) LOG_D(PHY,"eNB->ulsch[%d]->harq_processes[harq_pid:%d] SFN/SF:%04d%d: PUSCH procedures, UE %d/%x ulsch_harq[status:%d SFN/SF:%04d%d handled:%d]\n",
i, harq_pid, frame,subframe,i,ulsch->rnti,
- ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
+ ulsch_harq->status, ulsch_harq->frame, ulsch_harq->subframe, ulsch_harq->handled);
- if ((ulsch) &&
- (ulsch->rnti>0) &&
+ if ((ulsch->rnti>0) &&
(ulsch_harq->status == ACTIVE) &&
((ulsch_harq->frame == frame) || (ulsch_harq->repetition_number >1) ) &&
((ulsch_harq->subframe == subframe) || (ulsch_harq->repetition_number >1) ) &&
@@ -1459,6 +1474,17 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
ulsch_harq->V_UL_DAI,
ulsch_harq->nb_rb>20 ? 1 : 0);
stop_meas(&eNB->ulsch_decoding_stats);
+/*
+ int ulsch_id=-1;
+ for (ulsch_id=0;ulsch_idrnti == eNB->ulsch_stats[ulsch_id].rnti) break;
+ AssertFatal(ulsch_id>=0,"no ulsch_id found\n");
+
+ if (eNB->ulsch_stats[ulsch_id].round_trials[0]>100) {
+ dump_ulsch(eNB,frame,subframe,i,ulsch_harq->round);
+ AssertFatal(1==0,"exiting\n");
+ }
+*/
}
else if ((ulsch) &&
(ulsch->rnti>0) &&
@@ -1472,7 +1498,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
ulsch->harq_mask &= ~(1 << harq_pid);
LOG_W (PHY, "Removing stale ULSCH config for UE %x harq_pid %d (harq_mask is now 0x%2.2x)\n", ulsch->rnti, harq_pid, ulsch->harq_mask);
}
- } // for (i=0; inbDecode > 0) {
notifiedFIFO_elt_t *req=pullTpool(proc->respDecode, proc->threadPool);
@@ -1537,7 +1563,7 @@ void kill_te_thread(PHY_VARS_eNB *eNB) {
}
void fill_rx_indication(PHY_VARS_eNB *eNB,
- int UE_id,
+ int ULSCH_id,
int frame,
int subframe) {
nfapi_rx_indication_pdu_t *pdu;
@@ -1545,7 +1571,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
int sync_pos;
uint32_t harq_pid;
- if (eNB->ulsch[UE_id]->ue_type > 0) harq_pid = 0;
+ if (eNB->ulsch[ULSCH_id]->ue_type > 0) harq_pid = 0;
else {
harq_pid = subframe2harq_pid (&eNB->frame_parms,
frame, subframe);
@@ -1555,19 +1581,22 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4| subframe;
eNB->UL_INFO.rx_ind.rx_indication_body.tl.tag = NFAPI_RX_INDICATION_BODY_TAG;
pdu = &eNB->UL_INFO.rx_ind.rx_indication_body.rx_pdu_list[eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus];
- // pdu->rx_ue_information.handle = eNB->ulsch[UE_id]->handle;
+ // pdu->rx_ue_information.handle = eNB->ulsch[ULSCH_id]->handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
- pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
+ pdu->rx_ue_information.rnti = eNB->ulsch[ULSCH_id]->rnti;
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
- pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
+ pdu->rx_indication_rel8.length = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
- pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->decodedBytes;
+ pdu->data = eNB->ulsch[ULSCH_id]->harq_processes[harq_pid]->decodedBytes;
// estimate timing advance for MAC
- sync_pos = lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[UE_id]->drs_ch_estimates_time);
- timing_advance_update = sync_pos; // - eNB->frame_parms.nb_prefix_samples/4; //to check
+ sync_pos = lte_est_timing_advance_pusch(&eNB->frame_parms, eNB->pusch_vars[ULSCH_id]->drs_ch_estimates_time);
+ timing_advance_update = sync_pos;
- // if (timing_advance_update > 10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);}
- // if (timing_advance_update < -10) { dump_ulsch(eNB,frame,subframe,UE_id); exit(-1);}
+ for (int i=0;iulsch_stats[i].rnti == eNB->ulsch[ULSCH_id]->rnti)
+ eNB->ulsch_stats[i].timing_offset = sync_pos;
+ // if (timing_advance_update > 10) { dump_ulsch(eNB,frame,subframe,ULSCH_id); exit(-1);}
+ // if (timing_advance_update < -10) { dump_ulsch(eNB,frame,subframe,ULSCH_id); exit(-1);}
switch (eNB->frame_parms.N_RB_DL) {
case 6: /* nothing to do */
break;
@@ -1607,7 +1636,13 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
pdu->rx_indication_rel8.timing_advance = timing_advance_update;
// estimate UL_CQI for MAC
- int SNRtimes10 = dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_power[0] + ((eNB->frame_parms.nb_antennas_rx>1) ?eNB->pusch_vars[UE_id]->ulsch_power[1] : 0 ) ) - dB_fixed_x10(eNB->pusch_vars[UE_id]->ulsch_interference_power[0]+((eNB->frame_parms.nb_antennas_rx>1) ?eNB->pusch_vars[UE_id]->ulsch_interference_power[1] : 0 ) );
+ int total_power=0, avg_noise_power=0;
+ for (int i=0;iframe_parms.nb_antennas_rx;i++) {
+ total_power+=(eNB->pusch_vars[ULSCH_id]->ulsch_power[i]);
+ avg_noise_power+=(eNB->pusch_vars[ULSCH_id]->ulsch_noise_power[i])/eNB->frame_parms.nb_antennas_rx;
+ }
+ int SNRtimes10 = dB_fixed_x10(total_power) -
+ dB_fixed_x10(avg_noise_power);
if (SNRtimes10 < -640)
pdu->rx_indication_rel8.ul_cqi = 0;
@@ -1616,9 +1651,11 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
else
pdu->rx_indication_rel8.ul_cqi = (640 + SNRtimes10) / 5;
- LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d,%d), timing_advance %d (update %d)\n",
- harq_pid,frame,subframe,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,eNB->measurements.n0_subband_power_avg_dB,pdu->rx_indication_rel8.timing_advance,
- timing_advance_update);
+ LOG_D(PHY,"[PUSCH %d] Frame %d Subframe %d Filling RX_indication with SNR %d (%d,%d,%d), timing_advance %d (update %d,sync_pos %d)\n",
+ harq_pid,frame,subframe,SNRtimes10,pdu->rx_indication_rel8.ul_cqi,dB_fixed_x10(total_power),dB_fixed_x10(avg_noise_power),pdu->rx_indication_rel8.timing_advance,timing_advance_update,sync_pos);
+ for (int i=0;iframe_parms.nb_antennas_rx;i++)
+ LOG_D(PHY,"antenna %d: ulsch_power %d, noise_power %d\n",i,dB_fixed_x10(eNB->pusch_vars[ULSCH_id]->ulsch_power[i]),dB_fixed_x10(eNB->pusch_vars[ULSCH_id]->ulsch_noise_power[i]));
+
eNB->UL_INFO.rx_ind.rx_indication_body.number_of_pdus++;
eNB->UL_INFO.rx_ind.sfn_sf = frame<<4 | subframe;
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
@@ -1629,7 +1666,7 @@ void fill_rx_indication(PHY_VARS_eNB *eNB,
* Release the harq process if its round is >= 'after_rounds'
*/
static void do_release_harq(PHY_VARS_eNB *eNB,
- int UE_id,
+ int DLSCH_id,
int tb,
uint16_t frame,
uint8_t subframe,
@@ -1644,10 +1681,10 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
int harq_pid;
int subframe_tx;
int frame_tx;
- AssertFatal(UE_id != -1, "No existing dlsch context\n");
- AssertFatal(UE_id < NUMBER_OF_UE_MAX, "Returned UE_id %d >= %d (NUMBER_OF_UE_MAX)\n", UE_id, NUMBER_OF_UE_MAX);
- dlsch0 = eNB->dlsch[UE_id][0];
- dlsch1 = eNB->dlsch[UE_id][1];
+ AssertFatal(DLSCH_id != -1, "No existing dlsch context\n");
+ AssertFatal(DLSCH_id < NUMBER_OF_DLSCH_MAX, "Returned DLSCH_id %d >= %d (NUMBER_OF_DLSCH_MAX)\n", DLSCH_id, NUMBER_OF_DLSCH_MAX);
+ dlsch0 = eNB->dlsch[DLSCH_id][0];
+ dlsch1 = eNB->dlsch[DLSCH_id][1];
if (eNB->frame_parms.frame_type == FDD) {
subframe_tx = (subframe + 6) % 10;
@@ -1746,13 +1783,13 @@ static void do_release_harq(PHY_VARS_eNB *eNB,
} // end if TDD
}
-static void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) {
+static void release_harq(PHY_VARS_eNB *eNB,int DLSCH_id,int tb,uint16_t frame,uint8_t subframe,uint16_t mask, int is_ack) {
/*
* Maximum number of DL transmissions = 4.
* TODO: get the value from configuration.
* If is_ack is true then we release immediately. The value -1 can be used for that.
*/
- do_release_harq(eNB, UE_id, tb, frame, subframe, mask, is_ack ? -1 : 4);
+ do_release_harq(eNB, DLSCH_id, tb, frame, subframe, mask, is_ack ? -1 : 4);
}
int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
@@ -1832,14 +1869,14 @@ void fill_ulsch_cqi_indication (PHY_VARS_eNB *eNB, uint16_t frame, uint8_t subfr
}
void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_harq, uint16_t rnti, int frame, int subframe, int bundling) {
- int UE_id = find_dlsch(rnti,eNB,SEARCH_EXIST);
+ int DLSCH_id = find_dlsch(rnti,eNB,SEARCH_EXIST);
- if( (UE_id<0) || (UE_id>=NUMBER_OF_UE_MAX) ) {
- LOG_E(PHY,"illegal UE_id found!!! rnti %04x UE_id %d\n",rnti,UE_id);
+ if( (DLSCH_id<0) || (DLSCH_id>=NUMBER_OF_DLSCH_MAX) ) {
+ LOG_E(PHY,"illegal DLSCH_id found!!! rnti %04x DLSCH_id %d\n",rnti,DLSCH_id);
return;
}
- //AssertFatal(UE_id>=0,"UE_id doesn't exist\n");
+ //AssertFatal(DLSCH_id>=0,"DLSCH_id doesn't exist\n");
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_harq_indication_pdu_t *pdu = &eNB->UL_INFO.harq_ind.harq_indication_body.harq_pdu_list[eNB->UL_INFO.harq_ind.harq_indication_body.number_of_harqs];
int M;
@@ -1861,7 +1898,7 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
AssertFatal (ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n", i, ulsch_harq->o_ACK[i]);
pdu->harq_indication_fdd_rel13.harq_tb_n[i] = 2 - ulsch_harq->o_ACK[i];
// release DLSCH if needed
- release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
}
} else { // TDD
M = ul_ACK_subframe2_M (&eNB->frame_parms, subframe);
@@ -1877,14 +1914,14 @@ void fill_ulsch_harq_indication (PHY_VARS_eNB *eNB, LTE_UL_eNB_HARQ_t *ulsch_har
* We have to release the proper HARQ in case of ACK or NACK if max retransmission reached.
* Basically, call release_harq with 1 as last argument when ACK and 0 when NACK.
*/
- release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
- if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
- else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
+ else if (M==1 && ulsch_harq->O_ACK==2 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,DLSCH_id,i,frame,subframe,0xffff, ulsch_harq->o_ACK[i] == 1);
else if (M>1 && ulsch_harq->o_ACK[i] == 1) {
// spatial bundling
- release_harq(eNB,UE_id,0,frame,subframe,1<o_ACK[i] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,1<o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,1<o_ACK[i] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,1<o_ACK[i] == 1);
}
}
}
@@ -1900,10 +1937,10 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
return;
}
- int UE_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST);
+ int DLSCH_id=find_dlsch(uci->rnti,eNB,SEARCH_EXIST);
- //AssertFatal(UE_id>=0,"UE_id doesn't exist rnti:%x\n", uci->rnti);
- if (UE_id < 0) {
+ //AssertFatal(DLSCH_id>=0,"DLSCH_id doesn't exist rnti:%x\n", uci->rnti);
+ if (DLSCH_id < 0) {
LOG_E(PHY,"SFN/SF:%04d%d Unable to find rnti:%x do not send HARQ\n", frame, subframe, uci->rnti);
return;
}
@@ -1943,7 +1980,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
AssertFatal (harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n", harq_ack[0]);
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
// release DLSCH if needed
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
} else if (uci->pucch_fmt == pucch_format1b) {
pdu->harq_indication_fdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_FDD_REL13_TAG;
pdu->harq_indication_fdd_rel13.mode = 0;
@@ -1953,8 +1990,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pdu->harq_indication_fdd_rel13.harq_tb_n[0] = harq_ack[0];
pdu->harq_indication_fdd_rel13.harq_tb_n[1] = harq_ack[1];
// release DLSCH if needed
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
} else AssertFatal(1==0,"only format 1a/b for now, received %d\n",uci->pucch_fmt);
} else { // TDD
AssertFatal (tdd_mapping_mode == 0 || tdd_mapping_mode == 1 || tdd_mapping_mode == 2, "Illegal tdd_mapping_mode %d\n", tdd_mapping_mode);
@@ -1972,7 +2009,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
// release all bundled DLSCH if needed
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
} else if (uci->pucch_fmt == pucch_format1b) {
pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[1] == 4, "harq_ack[0] is %d, should be 0,1 or 4\n",harq_ack[0]);
@@ -1981,8 +2018,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = harq_ack[0];
pdu->harq_indication_tdd_rel13.harq_data[1].bundling.value_0 = harq_ack[1];
// release all DLSCH if needed
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
}
break;
@@ -1996,7 +2033,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
AssertFatal(harq_ack[0] == 1 || harq_ack[0] == 2 || harq_ack[0] == 4, "harq_ack[0] is %d, should be 1,2 or 4\n",harq_ack[0]);
pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
// release all DLSCH if needed
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
} else if (uci->num_pucch_resources == 1 && uci->pucch_fmt == pucch_format1b) {
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_tdd_rel13.number_of_ack_nack = 2;
@@ -2005,8 +2042,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = harq_ack[0];
pdu->harq_indication_tdd_rel13.harq_data[1].multiplex.value_0 = harq_ack[1];
// release all DLSCH if needed
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, harq_ack[0] == 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, harq_ack[1] == 1);
} else { // num_pucch_resources (M) > 1
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
pdu->harq_indication_tdd_rel13.number_of_ack_nack = uci->num_pucch_resources;
@@ -2018,8 +2055,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 4) pdu->harq_indication_tdd_rel13.harq_data[3].multiplex.value_0 = harq_ack[3];
// spatial-bundling in this case so release both HARQ if necessary
- release_harq(eNB,UE_id,0,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
- release_harq(eNB,UE_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,tdd_multiplexing_mask, 1 /* force release? previous code was unconditional */);
}
break;
@@ -2043,8 +2080,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 1 || uci->num_pucch_resources == 4 ||
tdd_config5_sf2scheds == 1 || tdd_config5_sf2scheds == 4 || tdd_config5_sf2scheds == 7) {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, 1);
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
@@ -2055,8 +2092,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 2 || tdd_config5_sf2scheds == 2 ||
tdd_config5_sf2scheds == 5 || tdd_config5_sf2scheds == 8) {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, 1);
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
@@ -2067,8 +2104,8 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
if (uci->num_pucch_resources == 3 || tdd_config5_sf2scheds == 3 ||
tdd_config5_sf2scheds == 6 || tdd_config5_sf2scheds == 9) {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
- release_harq(eNB,UE_id,0,frame,subframe,0xffff, 1);
- release_harq(eNB,UE_id,1,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,0,frame,subframe,0xffff, 1);
+ release_harq(eNB,DLSCH_id,1,frame,subframe,0xffff, 1);
} else {
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
}
@@ -2085,7 +2122,7 @@ void fill_uci_harq_indication (int UEid, PHY_VARS_eNB *eNB, LTE_eNB_UCI *uci, in
pthread_mutex_unlock(&eNB->UL_INFO_mutex);
}
-void fill_crc_indication (PHY_VARS_eNB *eNB, int UE_id, int frame, int subframe, uint8_t crc_flag) {
+void fill_crc_indication (PHY_VARS_eNB *eNB, int ULSCH_id, int frame, int subframe, uint8_t crc_flag) {
pthread_mutex_lock(&eNB->UL_INFO_mutex);
nfapi_crc_indication_pdu_t *pdu = &eNB->UL_INFO.crc_ind.crc_indication_body.crc_pdu_list[eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs];
eNB->UL_INFO.crc_ind.sfn_sf = frame<<4 | subframe;
@@ -2094,7 +2131,7 @@ void fill_crc_indication (PHY_VARS_eNB *eNB, int UE_id, int frame, int subframe,
pdu->instance_length = 0; // don't know what to do with this
// pdu->rx_ue_information.handle = handle;
pdu->rx_ue_information.tl.tag = NFAPI_RX_UE_INFORMATION_TAG;
- pdu->rx_ue_information.rnti = eNB->ulsch[UE_id]->rnti;
+ pdu->rx_ue_information.rnti = eNB->ulsch[ULSCH_id]->rnti;
pdu->crc_indication_rel8.tl.tag = NFAPI_CRC_INDICATION_REL8_TAG;
pdu->crc_indication_rel8.crc_flag = crc_flag;
eNB->UL_INFO.crc_ind.crc_indication_body.number_of_crcs++;
@@ -2133,20 +2170,24 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,L1_rxtx_proc_t *proc) {
}
lte_eNB_I0_measurements (eNB, subframe, 0, eNB->first_run_I0_measurements);
- int min_I0=1000,max_I0=0;
- int amin=0,amax=0;
- if ((frame==0) && (subframe==3)) {
- for (int i=0; iframe_parms.N_RB_UL; i++) {
- if (i==(eNB->frame_parms.N_RB_UL>>1) - 1) i+=2;
- if (eNB->measurements.n0_subband_power_tot_dB[i]measurements.n0_subband_power_tot_dB[i]; amin=i;}
-
- if (eNB->measurements.n0_subband_power_tot_dB[i]>max_I0) {max_I0 = eNB->measurements.n0_subband_power_tot_dB[i]; amax=i;}
- }
-
- LOG_I (PHY, "max_I0 %d (rb %d), min_I0 %d (rb %d), avg I0 %d\n", max_I0, amax, min_I0, amin, eNB->measurements.n0_subband_power_avg_dB);
+ // clear unused statistics after 2 seconds
+ for (int i=0;iulsch_stats[i].frame <= frame) {
+ if ((eNB->ulsch_stats[i].frame + 200) < frame) memset(&eNB->ulsch_stats[i],0,sizeof(eNB->ulsch_stats[i]));
+ }
+ else {
+ if (eNB->ulsch_stats[i].frame + 200 < (frame+1024)) memset(&eNB->ulsch_stats[i],0,sizeof(eNB->ulsch_stats[i]));
+ }
+ if (eNB->uci_stats[i].frame <= frame) {
+ if ((eNB->uci_stats[i].frame + 200) < frame) memset(&eNB->uci_stats[i],0,sizeof(eNB->uci_stats[i]));
+ }
+ else {
+ if (eNB->uci_stats[i].frame + 200 < (frame+1024)) memset(&eNB->uci_stats[i],0,sizeof(eNB->uci_stats[i]));
+ }
}
+
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX_UESPEC, 0 );
}
@@ -2163,13 +2204,7 @@ void release_rnti_of_phy(module_id_t mod_id) {
eNB_PHY = RC.eNB[mod_id][CC_id];
rnti = release_rntis.ue_release_request_TLVs_list[i].rnti;
- for (j=0; julsch[j];
-
- if((ulsch != NULL) && (ulsch->rnti == rnti)) {
- LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
- clean_eNb_ulsch(ulsch);
- }
+ for (j=0; jdlsch[j][0];
@@ -2179,14 +2214,18 @@ void release_rnti_of_phy(module_id_t mod_id) {
}
}
- ulsch = eNB_PHY->ulsch[j];
+ for (j=0;julsch[j];
- if((ulsch != NULL) && (ulsch->rnti == rnti)) {
- LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
- clean_eNb_ulsch(ulsch);
+ if((ulsch != NULL) && (ulsch->rnti == rnti)) {
+ LOG_I(PHY, "clean_eNb_ulsch ulsch[%d] UE %x\n", j, rnti);
+ clean_eNb_ulsch(ulsch);
+ for (j=0;julsch_stats[j].rnti == rnti) {eNB_PHY->ulsch_stats[j].rnti=0; break;}
+ }
}
- for(j=0; juci_vars[j].rnti == rnti) {
LOG_I(PHY, "clean eNb uci_vars[%d] UE %x \n",j, rnti);
memset(&eNB_PHY->uci_vars[i],0,sizeof(LTE_eNB_UCI));
diff --git a/openair1/SCHED/prach_procedures.c b/openair1/SCHED/prach_procedures.c
index b99bb2ee7d..4d0fe428e8 100644
--- a/openair1/SCHED/prach_procedures.c
+++ b/openair1/SCHED/prach_procedures.c
@@ -31,8 +31,6 @@
*/
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
-#include "SCHED/sched_eNB.h"
#include "nfapi_interface.h"
#include "fapi_l1.h"
#include "nfapi_pnf.h"
@@ -46,7 +44,6 @@
#include
-#include "intertask_interface.h"
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
@@ -188,7 +185,7 @@ void prach_procedures(PHY_VARS_eNB *eNB,
else {
eNB->measurements.prach_I0 = ((eNB->measurements.prach_I0*900)>>10) + ((avg_preamble_energy[0]*124)>>10);
- if (frame==0) LOG_I(PHY,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
+ if (frame==0) LOG_D(PHY,"prach_I0 = %d.%d dB\n",eNB->measurements.prach_I0/10,eNB->measurements.prach_I0%10);
if (eNB->prach_energy_counter < 100) eNB->prach_energy_counter++;
}
diff --git a/openair1/SCHED/ru_procedures.c b/openair1/SCHED/ru_procedures.c
index 70399f0a23..15eba7b5bc 100644
--- a/openair1/SCHED/ru_procedures.c
+++ b/openair1/SCHED/ru_procedures.c
@@ -54,7 +54,6 @@
#include "PHY/defs_eNB.h"
-#include "PHY/phy_extern.h"
#include "SCHED/sched_eNB.h"
#include "PHY/MODULATION/modulation_eNB.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
@@ -140,27 +139,26 @@ void feptx0(RU_t *ru,
int num_symb = 7;
if (subframe_select(fp,subframe) == SF_S)
- num_symb = fp->dl_symbols_in_S_subframe+1;
+ num_symb = fp->dl_symbols_in_S_subframe+1;
- if (ru->generate_dmrs_sync == 1 && slot == 0 && subframe == 1 && aa==0) {
+ if (ru->generate_dmrs_sync == 1 && slot == 2 && aa==0) {
//int32_t dmrs[ru->frame_parms.ofdm_symbol_size*14] __attribute__((aligned(32)));
//int32_t *dmrsp[2] ={dmrs,NULL}; //{&dmrs[(3-ru->frame_parms.Ncp)*ru->frame_parms.ofdm_symbol_size],NULL};
-
- generate_drs_pusch((PHY_VARS_UE *)NULL,
- (UE_rxtx_proc_t*)NULL,
- fp,
- ru->common.txdataF_BF,
- 0,
- AMP,
- 0,
- 0,
- fp->N_RB_DL,
- aa);
+ generate_drs_pusch((PHY_VARS_UE *)NULL,
+ (UE_rxtx_proc_t*)NULL,
+ fp,
+ ru->common.txdataF_BF,
+ 0,
+ AMP,
+ 0,
+ 0,
+ fp->N_RB_DL,
+ aa);
}
- normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
- (int*)&ru->common.txdata[aa][slot_offset],
- num_symb,
- fp);
+ normal_prefix_mod(&ru->common.txdataF_BF[aa][(slot&1)*slot_sizeF],
+ (int*)&ru->common.txdata[aa][slot_offset],
+ num_symb,
+ fp);
}
}
@@ -474,15 +472,16 @@ void feptx_prec(RU_t *ru,
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_PREC+ru->idx , 1);
for (aa=0;aanb_tx;aa++) {
- memset(ru->common.txdataF_BF[aa],0,sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
- for (int p=0;pdo_precoding == 0) {
- if (p==0)
- memcpy((void*)ru->common.txdataF_BF[aa],
- (void*)&eNB->common_vars.txdataF[aa][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
- sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
- } else {
- if (pnb_antenna_ports_eNB) {
+ if (ru->do_precoding == 0) {
+ memcpy((void*)ru->common.txdataF_BF[aa],
+ (void*)&eNB->common_vars.txdataF[aa%fp->nb_antenna_ports_eNB][subframe*fp->symbols_per_tti*fp->ofdm_symbol_size],
+ sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
+
+ }
+ else {
+ memset(ru->common.txdataF_BF[aa],0,sizeof(int32_t)*fp->ofdm_symbol_size*fp->symbols_per_tti);
+ for (int p=0;pnb_antenna_ports_eNB) {
// For the moment this does nothing different than below, except ignore antenna ports 5,7,8.
for (l=0;lnum_pdcch_symbols;l++)
beam_precoding(eNB->common_vars.txdataF,
@@ -494,10 +493,10 @@ void feptx_prec(RU_t *ru,
aa,
p,
eNB->Mod_id);
- } //if (pnb_antenna_ports_eNB)
+ } //if (pnb_antenna_ports_eNB)
// PDSCH region
- if (pnb_antenna_ports_eNB || p==5 || p==7 || p==8) {
+ if (pnb_antenna_ports_eNB || p==5 || p==7 || p==8) {
for (l=pdcch_vars->num_pdcch_symbols;lsymbols_per_tti;l++) {
beam_precoding(eNB->common_vars.txdataF,
ru->common.txdataF_BF,
@@ -510,8 +509,8 @@ void feptx_prec(RU_t *ru,
eNB->Mod_id);
} // for (l=pdcch_vars ....)
} // if (pnb_antenna_ports_eNB) ...
- } // ru->do_precoding!=0
- } // for (p=0...)
+ } // for (p=0...)
+ } // if do_precoding
} // for (aa=0 ...)
if(ru->idx<2)
@@ -658,7 +657,7 @@ void ru_fep_full_2thread(RU_t *ru,
struct timespec wait;
- if ((fp->frame_type == TDD) && (subframe_select(fp,subframe) != SF_UL)) return;
+ if ((fp->frame_type == TDD) && (subframe_select(fp,subframe) == SF_DL)) return;
if (ru->idx == 0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPRX, 1 );
@@ -705,7 +704,7 @@ void ru_fep_full_2thread(RU_t *ru,
if (proc->tti_rx/*proc->subframe_rx*/==1 && ru->is_slave==1/* && ru->state == RU_CHECK_SYNC*/)
{
- //LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
+ LOG_I(PHY,"Running check synchronization procedure for frame %d\n", proc->frame_rx);
ulsch_extract_rbs_single(ru->common.rxdataF,
calibration->rxdataF_ext,
0,
@@ -731,9 +730,10 @@ void ru_fep_full_2thread(RU_t *ru,
check_sync_pos = lte_est_timing_advance_pusch(ru->frame_parms, ru->calibration.drs_ch_estimates_time);
if (ru->state == RU_CHECK_SYNC) {
if ((check_sync_pos >= 0 && check_sync_pos<8) || (check_sync_pos < 0 && check_sync_pos>-8)) {
- LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
+// LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
ru->wait_check++;
}
+ LOG_I(PHY,"~~~~~~~~~~~ check_sync_pos %d, frame %d, cnt %d\n",check_sync_pos,proc->frame_rx,ru->wait_check);
if (ru->wait_check==20) {
ru->state = RU_RUN;
@@ -743,10 +743,11 @@ void ru_fep_full_2thread(RU_t *ru,
rru_config_msg.len = sizeof(RRU_CONFIG_msg_t); // TODO: set to correct msg len
LOG_I(PHY,"Sending RRU_sync_ok to RAU\n");
AssertFatal((ru->ifdevice.trx_ctlsend_func(&ru->ifdevice,&rru_config_msg,rru_config_msg.len)!=-1),"Failed to send msg to RAU %d\n",ru->idx);
+/*
//LOG_I(PHY,"~~~~~~~~~ RU_RUN\n");
- /*LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
+ LOG_M("dmrs_time.m","dmrstime",calibration->drs_ch_estimates_time[0], (fp->ofdm_symbol_size),1,1);
LOG_M("rxdataF_ext.m","rxdataFext",&calibration->rxdataF_ext[0][36*fp->N_RB_DL], 12*(fp->N_RB_DL),1,1);
- LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
+ //LOG_M("drs_seq0.m","drsseq0",ul_ref_sigs_rx[0][0][23],600,1,1);
LOG_M("rxdata.m","rxdata",&ru->common.rxdata[0][0], fp->samples_per_tti*2,1,1);
exit(-1);*/
}
diff --git a/openair1/SCHED/sched_common.h b/openair1/SCHED/sched_common.h
index f3e43d516e..c9fc338686 100644
--- a/openair1/SCHED/sched_common.h
+++ b/openair1/SCHED/sched_common.h
@@ -311,7 +311,7 @@ void get_cqipmiri_params(PHY_VARS_UE *ue,uint8_t eNB_id);
int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id, uint8_t eNB_index);
-void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc);
+void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc);
LTE_eNB_UE_stats* get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti);
diff --git a/openair1/SCHED/sched_eNB.h b/openair1/SCHED/sched_eNB.h
index f04bec2e5c..de987b0ac7 100644
--- a/openair1/SCHED/sched_eNB.h
+++ b/openair1/SCHED/sched_eNB.h
@@ -193,7 +193,7 @@ int8_t find_ue_ulsch(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
-void schedule_response(Sched_Rsp_t *Sched_INFO, L1_rxtx_proc_t *proc);
+void schedule_response(Sched_Rsp_t *Sched_INFO, void *proc);
LTE_eNB_UE_stats *get_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti);
diff --git a/openair1/SCHED_NR/fapi_nr_l1.c b/openair1/SCHED_NR/fapi_nr_l1.c
index 88f3dca070..012e088dff 100644
--- a/openair1/SCHED_NR/fapi_nr_l1.c
+++ b/openair1/SCHED_NR/fapi_nr_l1.c
@@ -168,7 +168,7 @@ void nr_schedule_response(NR_Sched_Rsp_t *Sched_INFO){
int pdcch_received=0;
gNB->num_pdsch_rnti[slot]=0;
- for (int i=0; inumber_of_nr_dlsch_max; i++) {
gNB->dlsch[i][0]->rnti=0;
gNB->dlsch[i][0]->harq_mask=0;
}
diff --git a/openair1/SCHED_NR/nr_prach_procedures.c b/openair1/SCHED_NR/nr_prach_procedures.c
index 533dbb8e1a..c95d3dc937 100644
--- a/openair1/SCHED_NR/nr_prach_procedures.c
+++ b/openair1/SCHED_NR/nr_prach_procedures.c
@@ -121,8 +121,7 @@ void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot) {
max_preamble_delay[0],
gNB->prach_energy_counter);
- if ((gNB->prach_energy_counter == 100) &&
- (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
+ if ((gNB->prach_energy_counter == 100) && (max_preamble_energy[0] > gNB->measurements.prach_I0+gNB->prach_thres)) {
LOG_I(PHY,"[gNB %d][RAPROC] Frame %d, slot %d Initiating RA procedure with preamble %d, energy %d.%d dB, delay %d start symbol %u freq index %u\n",
gNB->Mod_id,
diff --git a/openair1/SCHED_NR/nr_ru_procedures.c b/openair1/SCHED_NR/nr_ru_procedures.c
index 1b2baf03f5..c8042ecec3 100644
--- a/openair1/SCHED_NR/nr_ru_procedures.c
+++ b/openair1/SCHED_NR/nr_ru_procedures.c
@@ -31,15 +31,12 @@
*/
#include "PHY/defs_gNB.h"
-#include "PHY/phy_extern.h"
#include "sched_nr.h"
#include "PHY/MODULATION/modulation_common.h"
#include "PHY/MODULATION/nr_modulation.h"
#include "PHY/LTE_TRANSPORT/if4_tools.h"
#include "PHY/LTE_TRANSPORT/if5_tools.h"
-#include "LAYER2/NR_MAC_COMMON/nr_mac_extern.h"
-#include "LAYER2/MAC/mac.h"
#include "common/utils/LOG/log.h"
#include "common/utils/system.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
diff --git a/openair1/SCHED_NR/phy_procedures_nr_gNB.c b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
index 49e5fac495..717487c101 100644
--- a/openair1/SCHED_NR/phy_procedures_nr_gNB.c
+++ b/openair1/SCHED_NR/phy_procedures_nr_gNB.c
@@ -259,7 +259,6 @@ void nr_postDecode(PHY_VARS_gNB *gNB, notifiedFIFO_elt_t *req) {
LOG_D(PHY, "ULSCH received ok \n");
nr_fill_indication(gNB,ulsch_harq->frame, ulsch_harq->slot, rdata->ulsch_id, rdata->harq_pid, 0);
- //log_dump(PHY, ulsch_harq->b, 16, LOG_DUMP_CHAR,"gnb pusch rx frame %d %d: ", ulsch_harq->frame, ulsch_harq->slot);
} 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,
@@ -356,7 +355,7 @@ void nr_ulsch_procedures(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, int ULSCH
}
-void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag) {
+ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id, uint8_t harq_pid, uint8_t crc_flag) {
pthread_mutex_lock(&gNB->UL_INFO_mutex);
@@ -382,9 +381,9 @@ void nr_fill_indication(PHY_VARS_gNB *gNB, int frame, int slot_rx, int ULSCH_id,
LOG_D(PHY, "Estimated timing advance PUSCH is = %d, timing_advance_update is %d \n", sync_pos,timing_advance_update);
- // estimate UL_CQI for MAC
+ // estimate UL_CQI for MAC
- int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) -
+ int SNRtimes10 = dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) -
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot);
LOG_D(PHY, "Estimated SNR for PUSCH is = %f dB (ulsch_power %f, noise %f)\n", SNRtimes10/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot)/10.0,dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot)/10.0);
@@ -463,7 +462,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
}
}
}
- for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
int harq_pid;
NR_UL_gNB_HARQ_t *ulsch_harq;
@@ -526,7 +525,7 @@ void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
}
-void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
+int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
/* those variables to log T_GNB_PHY_PUCCH_PUSCH_IQ only when we try to decode */
int pucch_decode_done = 0;
int pusch_decode_done = 0;
@@ -612,9 +611,10 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
}
}
- for (int ULSCH_id=0;ULSCH_idnumber_of_nr_ulsch_max;ULSCH_id++) {
NR_gNB_ULSCH_t *ulsch = gNB->ulsch[ULSCH_id][0];
int harq_pid;
+ int no_sig;
NR_UL_gNB_HARQ_t *ulsch_harq;
if ((ulsch) &&
@@ -660,13 +660,14 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
pusch_decode_done = 1;
- uint8_t symbol_start = ulsch_harq->ulsch_pdu.start_symbol_index;
- uint8_t symbol_end = symbol_start + ulsch_harq->ulsch_pdu.nr_of_symbols;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_NR_RX_PUSCH,1);
start_meas(&gNB->rx_pusch_stats);
- for (uint8_t symbol = symbol_start; symbol < symbol_end; symbol++) {
- nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, symbol, harq_pid);
- }
+ no_sig = nr_rx_pusch(gNB, ULSCH_id, frame_rx, slot_rx, harq_pid);
+ if (no_sig) {
+ LOG_D(PHY, "PUSCH not detected in frame %d, slot %d\n", frame_rx, slot_rx);
+ nr_fill_indication(gNB, frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
+ return 1;
+ }
gNB->pusch_vars[ULSCH_id]->ulsch_power_tot=0;
gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot=0;
for (int aarx=0;aarxframe_parms.nb_antennas_rx;aarx++) {
@@ -675,17 +676,18 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[aarx]/=num_dmrs;
gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot += gNB->pusch_vars[ULSCH_id]->ulsch_noise_power[aarx];
}
- if (dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) <
+ if (dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot) <
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot) + gNB->pusch_thres) {
NR_gNB_SCH_STATS_t *stats=get_ulsch_stats(gNB,ulsch);
LOG_D(PHY, "PUSCH not detected in %d.%d (%d,%d,%d)\n",frame_rx,slot_rx,
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_power_tot),
dB_fixed_x10(gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot),gNB->pusch_thres);
+ gNB->pusch_vars[ULSCH_id]->ulsch_power_tot = gNB->pusch_vars[ULSCH_id]->ulsch_noise_power_tot;
nr_fill_indication(gNB,frame_rx, slot_rx, ULSCH_id, harq_pid, 1);
gNB->pusch_vars[ULSCH_id]->DTX=1;
stats->DTX++;
- return;
+ return 1;
} else gNB->pusch_vars[ULSCH_id]->DTX=0;
stop_meas(&gNB->rx_pusch_stats);
@@ -711,4 +713,5 @@ void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx)
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_UESPEC_RX,0);
+ return 0;
}
diff --git a/openair1/SCHED_NR/sched_nr.h b/openair1/SCHED_NR/sched_nr.h
index e0cf20d862..5e31c08d38 100644
--- a/openair1/SCHED_NR/sched_nr.h
+++ b/openair1/SCHED_NR/sched_nr.h
@@ -38,7 +38,7 @@ void fill_ul_rb_mask(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
void nr_set_ssb_first_subcarrier(nfapi_nr_config_request_scf_t *cfg, NR_DL_FRAME_PARMS *fp);
void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB, int frame_tx, int slot_tx, int do_meas);
void phy_procedures_gNB_common_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
-void phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
+int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx);
void L1_nr_prach_procedures(PHY_VARS_gNB *gNB,int frame,int slot);
void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame,int slot,nfapi_nr_dl_tti_ssb_pdu ssb_pdu);
void nr_feptx_ofdm(RU_t *ru,int frame_tx,int tti_tx);
diff --git a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
index 5fbd88987e..bb54c0027c 100644
--- a/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
+++ b/openair1/SCHED_NR_UE/fapi_nr_ue_l1.c
@@ -238,7 +238,7 @@ int8_t nr_ue_phy_config_request(nr_phy_config_t *phy_config){
if(phy_config != NULL) {
memcpy(nrUE_config,&phy_config->config_req,sizeof(fapi_nr_config_request_t));
if (PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] == NOT_SYNCHED)
- PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] = PRACH;
+ PHY_vars_UE_g[phy_config->Mod_id][phy_config->CC_id]->UE_mode[0] = PRACH;
}
return 0;
}
diff --git a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
index 6842411440..83e439956c 100644
--- a/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
+++ b/openair1/SCHED_NR_UE/phy_procedures_nr_ue.c
@@ -2075,7 +2075,6 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
} else {
-
nr_prach = nr_ue_get_rach(prach_resources, &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, frame_tx, gNB_id, nr_slot_tx);
LOG_D(PHY, "In %s:[%d.%d] getting PRACH resources : %d\n", __FUNCTION__, frame_tx, nr_slot_tx,nr_prach);
}
diff --git a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
index a7ef1f3ae0..df1cbad3ca 100644
--- a/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
+++ b/openair1/SCHED_NR_UE/pucch_uci_ue_nr.c
@@ -166,7 +166,7 @@ static float RSRP_meas_mapping_nr[98]
-43
}
;
-
+
long
binary_search_float_nr(
float elements[],
diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c
index 8955454282..adfda7a0c8 100644
--- a/openair1/SIMULATION/LTE_PHY/dlsim.c
+++ b/openair1/SIMULATION/LTE_PHY/dlsim.c
@@ -60,7 +60,7 @@
#include "dummy_functions.c"
#include "executables/thread-common.h"
#include "executables/split_headers.h"
-
+#include "common/ran_context.h"
void feptx_ofdm(RU_t *ru, int frame, int subframe);
void feptx_prec(RU_t *ru, int frame, int subframe);
@@ -85,6 +85,7 @@ double DS_TDL = .03;
static int cmpdouble(const void *p1, const void *p2) {
return *(double *)p1 > *(double *)p2;
}
+RAN_CONTEXT_t RC;
int emulate_rf = 0;
int split73=0;
@@ -936,9 +937,10 @@ int main(int argc, char **argv) {
NB_RB = conv_nprb(0,DLSCH_RB_ALLOC,N_RB_DL);
} else {
- if (rballocset==0) NB_RB = 8;
+ if (rballocset==0) NB_RB = 2+TPC;
else NB_RB = DLSCH_RB_ALLOC;
+ printf("Common PDSCH: NB_RB = %d\n",NB_RB);
AssertFatal(NB_RB <= N_RB_DL,"illegal NB_RB %d\n",NB_RB);
}
diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c
index c6049bc31d..0d39e6e533 100644
--- a/openair1/SIMULATION/LTE_PHY/ulsim.c
+++ b/openair1/SIMULATION/LTE_PHY/ulsim.c
@@ -55,6 +55,8 @@
#include "executables/thread-common.h"
#include "targets/RT/USER/lte-softmodem.h"
#include "executables/split_headers.h"
+#include "common/ran_context.h"
+#include "PHY/LTE_ESTIMATION/lte_estimation.h"
double cpuf;
#define inMicroS(a) (((double)(a))/(get_cpu_freq_GHz()*1000.0))
@@ -87,7 +89,7 @@ static int cmpdouble(const void *p1, const void *p2) {
return *(double *)p1 > *(double *)p2;
}
-
+RAN_CONTEXT_t RC;
int split73=0;
void sendFs6Ul(PHY_VARS_eNB *eNB, int UE_id, int harq_pid, int segmentID, int16_t *data, int dataLen, int r_offset) {
AssertFatal(false, "Must not be called in this context\n");
@@ -345,7 +347,6 @@ int main(int argc, char **argv) {
int UE_id = 0;
static int nb_rb=25,first_rb=0,mcs=0,round=0;
//unsigned char l;
- static int awgn_flag = 0 ;
SCM_t channel_model=Rice1;
unsigned char *input_buffer=0,harq_pid;
unsigned short input_buffer_length;
@@ -407,7 +408,7 @@ int main(int argc, char **argv) {
printf("Detected cpu_freq %f GHz\n",cpu_freq_GHz);
AssertFatal(load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) != NULL, "Cannot load configuration module, exiting\n");
logInit();
- set_glog(OAILOG_WARNING);
+ set_glog(OAILOG_INFO);
T_stdout = 1;
// enable these lines if you need debug info
// however itti will catch all signals, so ctrl-c won't work anymore
@@ -1089,14 +1090,12 @@ int main(int argc, char **argv) {
}
}
- if (awgn_flag == 0) {
- if (UE2eNB->max_Doppler == 0) {
- multipath_channel(UE2eNB,s_re,s_im,r_re,r_im,
- eNB->frame_parms.samples_per_tti,hold_channel,0);
- } else {
- multipath_tv_channel(UE2eNB,s_re,s_im,r_re,r_im,
- 2*eNB->frame_parms.samples_per_tti,hold_channel);
- }
+ if (UE2eNB->max_Doppler == 0) {
+ multipath_channel(UE2eNB,s_re,s_im,r_re,r_im,
+ eNB->frame_parms.samples_per_tti,hold_channel,0);
+ } else {
+ multipath_tv_channel(UE2eNB,s_re,s_im,r_re,r_im,
+ 2*eNB->frame_parms.samples_per_tti,hold_channel);
}
if(abstx) {
@@ -1139,6 +1138,15 @@ int main(int argc, char **argv) {
sqrt(sigma2/2)*gaussdouble(0.0,1.0));
}
}
+ if (n_frames==1)
+ for (i=0; iframe_parms.samples_per_tti; i++) {
+ for (aa=0; aaframe_parms.nb_antennas_rx; aa++) {
+ ((short *) &ru->common.rxdata[aa][eNB->frame_parms.samples_per_tti*(subframe+1)%10])[2*i] =
+ (short) (sqrt(sigma2/2)*gaussdouble(0.0,1.0));
+ ((short *) &ru->common.rxdata[aa][eNB->frame_parms.samples_per_tti*(subframe+1)%10])[2*i+1] =
+ (short) (sqrt(sigma2/2)*gaussdouble(0.0,1.0));
+ }
+ }
if (n_frames<=10) {
printf("rx_level Null symbol %f\n",10*log10((double)signal_energy((int *)
@@ -1164,9 +1172,10 @@ int main(int argc, char **argv) {
start_meas(&eNB->phy_proc_rx);
ru->feprx = (get_thread_worker_conf() == WORKER_ENABLE) ? ru_fep_full_2thread : fep_full;
ru->feprx(ru,subframe);
+ if (n_frames==1) lte_eNB_I0_measurements(eNB,(subframe+1)%10,0,1);
+
phy_procedures_eNB_uespec_RX(eNB,proc_rxtx);
stop_meas(&eNB->phy_proc_rx);
-
if (cqi_flag > 0) {
cqi_error = 0;
@@ -1206,6 +1215,9 @@ int main(int argc, char **argv) {
eNB->ulsch[0]->harq_processes[harq_pid]->uci_format,0,eNB->frame_parms.N_RB_DL);
dump_ulsch(eNB,eNB->proc.frame_rx,subframe,0,round);
+ dump_I0_stats(stdout,eNB);
+ dump_ulsch_stats(stdout,eNB,0);
+
exit(-1);
}
@@ -1266,14 +1278,16 @@ int main(int argc, char **argv) {
if (t_rx > 2000 )
n_rx_dropped++;
- appendVarArray(table_tx, &t_tx);
- appendVarArray(table_tx_ifft, &t_tx_ifft);
- appendVarArray(table_tx_mod, &t_tx_mod );
- appendVarArray(table_tx_enc, &t_tx_enc );
- appendVarArray(table_rx, &t_rx );
- appendVarArray(table_rx_fft, &t_rx_fft );
- appendVarArray(table_rx_demod, &t_rx_demod );
- appendVarArray(table_rx_dec, &t_rx_dec );
+ if (trials < 1000) {
+ appendVarArray(table_tx, &t_tx);
+ appendVarArray(table_tx_ifft, &t_tx_ifft);
+ appendVarArray(table_tx_mod, &t_tx_mod );
+ appendVarArray(table_tx_enc, &t_tx_enc );
+ appendVarArray(table_rx, &t_rx );
+ appendVarArray(table_rx_fft, &t_rx_fft );
+ appendVarArray(table_rx_demod, &t_rx_demod );
+ appendVarArray(table_rx_dec, &t_rx_dec );
+ }
} //trials
// sort table
@@ -1292,6 +1306,7 @@ int main(int argc, char **argv) {
LOG_UDUMPMSG(SIM,dataArray(table_rx),table_rx->size,LOG_DUMP_DOUBLE,"The receiver raw data: \n");
}
+ dump_ulsch_stats(stdout,eNB,0);
printf("\n**********rb: %d ***mcs : %d *********SNR = %f dB (%f): TX %u dB (gain %f dB), N0W %f dB, I0 %u dB, delta_IF %d [ (%d,%d) dB / (%u,%u) dB ]**************************\n",
nb_rb,mcs,SNR,SNR2,
tx_lev_dB,
diff --git a/openair1/SIMULATION/NR_PHY/dlschsim.c b/openair1/SIMULATION/NR_PHY/dlschsim.c
index 12b0b1d1f0..633a214699 100644
--- a/openair1/SIMULATION/NR_PHY/dlschsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlschsim.c
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
frame_parms->Ncp = extended_prefix_flag ? EXTENDED : NORMAL;
crcTableInit();
nr_phy_config_request_sim(gNB, N_RB_DL, N_RB_DL, mu, Nid_cell,SSB_positions);
- phy_init_nr_gNB(gNB, 0, 0);
+ phy_init_nr_gNB(gNB, 0, 1); //lowmem
//init_eNB_afterRU();
frame_length_complex_samples = frame_parms->samples_per_subframe;
//frame_length_complex_samples_no_prefix = frame_parms->samples_per_subframe_wCP;
diff --git a/openair1/SIMULATION/NR_PHY/dlsim.c b/openair1/SIMULATION/NR_PHY/dlsim.c
index 6a636003a4..f962a892bb 100644
--- a/openair1/SIMULATION/NR_PHY/dlsim.c
+++ b/openair1/SIMULATION/NR_PHY/dlsim.c
@@ -69,6 +69,8 @@
#include
#include
+#include
+
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
rlc_info_t Rlc_info_um,Rlc_info_am_config;
@@ -170,6 +172,10 @@ gtpv1u_update_ngu_tunnel(
return 0;
}
+int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+ return 0;
+}
+
int
nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t *const ctxt_pP,
@@ -773,7 +779,7 @@ int main(int argc, char **argv)
// reset preprocessor to the one of DLSIM after it has been set during
// rrc_mac_config_req_gNB
gNB_mac->pre_processor_dl = nr_dlsim_preprocessor;
- phy_init_nr_gNB(gNB,0,0);
+ phy_init_nr_gNB(gNB,0,1);
N_RB_DL = gNB->frame_parms.N_RB_DL;
NR_UE_info_t *UE_info = &RC.nrmac[0]->UE_info;
UE_info->num_UEs=1;
@@ -1416,15 +1422,62 @@ void update_dmrs_config(NR_CellGroupConfig_t *scg,PHY_VARS_NR_UE *ue, int8_t* dm
}
else if (dmrs_arg[0] == 1) {
mapping_type = typeB;
+ } else {
+ AssertFatal(1==0,"Incorrect Mappingtype, valid options 0-typeA, 1-typeB\n");
}
- /* Additional DMRS positions 0 ,1 and 2 */
- if(dmrs_arg[1] >= 0 && dmrs_arg[1] <3 ) {
+
+ /* Additional DMRS positions 0 ,1 ,2 and 3 */
+ if(dmrs_arg[1] >= 0 && dmrs_arg[1] <4 ) {
add_pos = dmrs_arg[1];
+ } else {
+ AssertFatal(1==0,"Incorrect Additional Position, valid options 0-pos1, 1-pos1, 2-pos2, 3-pos3\n");
}
if(scg != NULL) {
NR_BWP_Downlink_t *bwp = scg->spCellConfig->spCellConfigDedicated->downlinkBWP_ToAddModList->list.array[0];
- *bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = add_pos;
+
+ AssertFatal((bwp->bwp_Dedicated->pdsch_Config != NULL && bwp->bwp_Dedicated->pdsch_Config->choice.setup != NULL), "Base RRC reconfig structures are not allocated.\n");
+
+ if (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA == NULL) {
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA));
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->present= NR_SetupRelease_DMRS_DownlinkConfig_PR_setup;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup));
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type=NULL;//calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type));
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->maxLength=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID0=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->scramblingID1=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->phaseTrackingRS=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_AdditionalPosition = NULL;
+ printf("DLSIM: Allocated Mapping TypeA in RRC reconfig message\n");
+ } else if (bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB == NULL) {
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB));
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->present= NR_SetupRelease_DMRS_DownlinkConfig_PR_setup;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup = calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup));
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_Type=NULL;//calloc(1,sizeof(*bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA->choice.setup->dmrs_Type));
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->maxLength=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->scramblingID0=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->scramblingID1=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->phaseTrackingRS=NULL;
+ bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB->choice.setup->dmrs_AdditionalPosition = NULL;
+ printf("DLSIM: Allocated Mapping TypeB in RRC reconfig message\n");
+ }
+
+ struct NR_SetupRelease_DMRS_DownlinkConfig *dmrs_MappingtypeA = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeA;
+ struct NR_SetupRelease_DMRS_DownlinkConfig *dmrs_MappingtypeB = bwp->bwp_Dedicated->pdsch_Config->choice.setup->dmrs_DownlinkForPDSCH_MappingTypeB;
+
+
+ NR_DMRS_DownlinkConfig_t *dmrs_config = (mapping_type == typeA) ? dmrs_MappingtypeA->choice.setup : dmrs_MappingtypeB->choice.setup;
+
+ if (add_pos != 2) { // pos0,pos1,pos3
+ if (dmrs_config->dmrs_AdditionalPosition == NULL) {
+ dmrs_config->dmrs_AdditionalPosition = calloc(1,sizeof(*dmrs_MappingtypeA->choice.setup->dmrs_AdditionalPosition));
+ }
+ *dmrs_config->dmrs_AdditionalPosition = add_pos;
+ } else { // if NULL, Value pos2
+ free(dmrs_config->dmrs_AdditionalPosition);
+ dmrs_config->dmrs_AdditionalPosition = NULL;
+ }
+
for (int i=0;ibwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.count;i++) {
bwp->bwp_Common->pdsch_ConfigCommon->choice.setup->pdsch_TimeDomainAllocationList->list.array[i]->mappingType = mapping_type;
}
diff --git a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
index 629c00eea0..70d65a3dc2 100644
--- a/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
+++ b/openair1/SIMULATION/NR_PHY/nr_dummy_functions.c
@@ -1,3 +1,5 @@
+#include "nfapi/oai_integration/vendor_ext.h"
+
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { return(0); }
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) { return(0); }
int oai_nfapi_dl_config_req(nfapi_dl_config_request_t *dl_config_req) { return(0); }
diff --git a/openair1/SIMULATION/NR_PHY/pbchsim.c b/openair1/SIMULATION/NR_PHY/pbchsim.c
index c24a841c4b..548b76db69 100644
--- a/openair1/SIMULATION/NR_PHY/pbchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pbchsim.c
@@ -47,7 +47,7 @@
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
#include "openair1/PHY/MODULATION/nr_modulation.h"
-
+#include
//#define DEBUG_NR_PBCHSIM
PHY_VARS_gNB *gNB;
@@ -415,7 +415,7 @@ int main(int argc, char **argv)
frame_parms->ssb_type = nr_ssb_type_C;
nr_phy_config_request_sim_pbchsim(gNB,N_RB_DL,N_RB_DL,mu,Nid_cell,SSB_positions);
- phy_init_nr_gNB(gNB,0,0);
+ phy_init_nr_gNB(gNB,0,1);
nr_set_ssb_first_subcarrier(&gNB->gNB_config,frame_parms);
uint8_t n_hf = 0;
diff --git a/openair1/SIMULATION/NR_PHY/prachsim.c b/openair1/SIMULATION/NR_PHY/prachsim.c
index 6ca7a9dde0..93bed5514f 100644
--- a/openair1/SIMULATION/NR_PHY/prachsim.c
+++ b/openair1/SIMULATION/NR_PHY/prachsim.c
@@ -48,10 +48,10 @@
#include "OCG_vars.h"
#include
#include
+#include
#include
//#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
-
#define NR_PRACH_DEBUG 1
#define PRACH_WRITE_OUTPUT_DEBUG 1
@@ -133,6 +133,10 @@ gtpv1u_update_ngu_tunnel(
return 0;
}
+int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+ return 0;
+}
+
int
nr_rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t *const ctxt_pP,
@@ -541,7 +545,8 @@ int main(int argc, char **argv){
ru->if_south = LOCAL_RF;
ru->nb_tx = n_tx;
ru->nb_rx = n_rx;
-
+ ru->num_gNB = 1;
+ ru->gNB_list[0] = gNB;
gNB->gNB_config.carrier_config.num_tx_ant.value = 1;
gNB->gNB_config.carrier_config.num_rx_ant.value = 1;
if (mu==1)
@@ -642,7 +647,7 @@ int main(int argc, char **argv){
memcpy((void*)&ru->config,(void*)&RC.gNB[0]->gNB_config,sizeof(ru->config));
RC.nb_nr_L1_inst=1;
- phy_init_nr_gNB(gNB,0,0);
+ phy_init_nr_gNB(gNB,0,1); //lowmem
nr_phy_init_RU(ru);
gNB->common_vars.rxdata = ru->common.rxdata;
set_tdd_config_nr(&gNB->gNB_config, mu, 7, 6, 2, 4);
diff --git a/openair1/SIMULATION/NR_PHY/pucchsim.c b/openair1/SIMULATION/NR_PHY/pucchsim.c
index 7e2d2b9458..b3a6f112e7 100644
--- a/openair1/SIMULATION/NR_PHY/pucchsim.c
+++ b/openair1/SIMULATION/NR_PHY/pucchsim.c
@@ -46,6 +46,7 @@
#include "openair1/SIMULATION/NR_PHY/nr_unitary_defs.h"
#include "openair1/SIMULATION/NR_PHY/nr_dummy_functions.c"
+
PHY_VARS_gNB *gNB;
PHY_VARS_NR_UE *UE;
RAN_CONTEXT_t RC;
diff --git a/openair1/SIMULATION/NR_PHY/ulschsim.c b/openair1/SIMULATION/NR_PHY/ulschsim.c
index f84e553683..c889e6dcb9 100644
--- a/openair1/SIMULATION/NR_PHY/ulschsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulschsim.c
@@ -394,7 +394,7 @@ int main(int argc, char **argv)
nr_phy_config_request_sim(gNB, N_RB_UL, N_RB_UL, mu, Nid_cell, SSB_positions);
- phy_init_nr_gNB(gNB, 0, 0);
+ phy_init_nr_gNB(gNB, 0, 1); //lowmem
//configure UE
UE = malloc(sizeof(PHY_VARS_NR_UE));
diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index 8aa5e3ab20..6fff778bc0 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -63,8 +63,8 @@
#include
#include
+#include
#include "PHY/NR_REFSIG/ul_ref_seq_nr.h"
-
//#define DEBUG_ULSIM
LCHAN_DESC DCCH_LCHAN_DESC,DTCH_DL_LCHAN_DESC,DTCH_UL_LCHAN_DESC;
@@ -136,6 +136,10 @@ gtpv1u_create_s1u_tunnel(
return 0;
}
+int ocp_gtpv1u_delete_s1u_tunnel(const instance_t instance, const gtpv1u_enb_delete_tunnel_req_t *const req_pP) {
+ return 0;
+}
+
int
rrc_gNB_process_GTPV1U_CREATE_TUNNEL_RESP(
const protocol_ctxt_t *const ctxt_pP,
@@ -240,6 +244,7 @@ double s_re1[122880],s_im1[122880],r_re1[122880],r_im1[122880];
double r_re2[122880],r_im2[122880];
double r_re3[122880],r_im3[122880];
+
int main(int argc, char **argv)
{
char c;
@@ -319,7 +324,7 @@ int main(int argc, char **argv)
if ( load_configmodule(argc,argv,CONFIG_ENABLECMDLINEONLY) == 0 ) {
exit_fun("[NR_ULSIM] Error, configuration module init failed\n");
}
-
+ int ul_proc_error = 0; // uplink processing checking status flag
//logInit();
randominit(0);
@@ -706,7 +711,7 @@ int main(int argc, char **argv)
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, scc, 0, 0, NULL);
// UE dedicated configuration
rrc_mac_config_req_gNB(0,0, n_tx, n_tx, scc, 1, secondaryCellGroup->spCellConfig->reconfigurationWithSync->newUE_Identity,secondaryCellGroup);
- phy_init_nr_gNB(gNB,0,0);
+ phy_init_nr_gNB(gNB,0,1);
N_RB_DL = gNB->frame_parms.N_RB_DL;
@@ -831,7 +836,7 @@ int main(int argc, char **argv)
}
uint8_t length_dmrs = pusch_len1;
- uint16_t l_prime_mask = get_l_prime(nb_symb_sch, mapping_type, add_pos, length_dmrs);
+ uint16_t l_prime_mask = get_l_prime(nb_symb_sch, mapping_type, add_pos, length_dmrs, start_symbol, NR_MIB__dmrs_TypeA_Position_pos2);
uint16_t number_dmrs_symbols = get_dmrs_symbols_in_slot(l_prime_mask, nb_symb_sch);
uint8_t nb_re_dmrs = (dmrs_config_type == pusch_dmrs_type1) ? 6 : 4;
@@ -1017,7 +1022,7 @@ int main(int argc, char **argv)
pusch_pdu->transform_precoding = transform_precoding;
pusch_pdu->data_scrambling_id = *scc->physCellId;
pusch_pdu->nrOfLayers = 1;
- pusch_pdu->ul_dmrs_symb_pos = l_prime_mask << start_symbol;
+ pusch_pdu->ul_dmrs_symb_pos = l_prime_mask;
pusch_pdu->dmrs_config_type = dmrs_config_type;
pusch_pdu->ul_dmrs_scrambling_id = *scc->physCellId;
pusch_pdu->scid = 0;
@@ -1080,7 +1085,7 @@ int main(int argc, char **argv)
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;
ul_config.ul_config_list[0].pusch_config_pdu.start_symbol_index = start_symbol;
- ul_config.ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask << start_symbol;
+ ul_config.ul_config_list[0].pusch_config_pdu.ul_dmrs_symb_pos = l_prime_mask;
ul_config.ul_config_list[0].pusch_config_pdu.dmrs_config_type = dmrs_config_type;
ul_config.ul_config_list[0].pusch_config_pdu.mcs_index = Imcs;
ul_config.ul_config_list[0].pusch_config_pdu.mcs_table = mcs_table;
@@ -1124,6 +1129,11 @@ int main(int argc, char **argv)
phy_procedures_nrUE_TX(UE, &UE_proc, gNB_id);
+ /* We need to call common sending function to send signal */
+ LOG_D(PHY, "Sending Uplink data \n");
+ nr_ue_pusch_common_procedures(UE,
+ slot,
+ &UE->frame_parms,1);
if (n_trials==1) {
LOG_M("txsig0.m","txs0", UE->common_vars.txdata[0],frame_parms->samples_per_subframe*10,1,1);
@@ -1195,7 +1205,7 @@ int main(int argc, char **argv)
phy_procedures_gNB_common_RX(gNB, frame, slot);
- phy_procedures_gNB_uespec_RX(gNB, frame, slot);
+ ul_proc_error = phy_procedures_gNB_uespec_RX(gNB, frame, slot);
if (n_trials==1 && round==0) {
LOG_M("rxsig0.m","rx0",&gNB->common_vars.rxdata[0][slot_offset],slot_length,1,1);
@@ -1225,9 +1235,9 @@ int main(int argc, char **argv)
&gNB->pusch_vars[0]->llr[0],(nb_symb_sch-1)*NR_NB_SC_PER_RB * pusch_pdu->rb_size * mod_order,1,0);
}
////////////////////////////////////////////////////////////
-
- if (gNB->ulsch[0][0]->last_iteration_cnt >=
- gNB->ulsch[0][0]->max_ldpc_iterations+1) {
+
+ if ((gNB->ulsch[0][0]->last_iteration_cnt >=
+ gNB->ulsch[0][0]->max_ldpc_iterations+1) || ul_proc_error == 1) {
error_flag = 1;
n_errors[round]++;
crc_status = 1;
diff --git a/openair1/SIMULATION/TOOLS/multipath_channel.c b/openair1/SIMULATION/TOOLS/multipath_channel.c
index 683526a8f0..3608eb7da2 100644
--- a/openair1/SIMULATION/TOOLS/multipath_channel.c
+++ b/openair1/SIMULATION/TOOLS/multipath_channel.c
@@ -39,13 +39,13 @@ uint8_t multipath_channel_nosigconv(channel_desc_t *desc)
//#define CHANNEL_SSE
#ifdef CHANNEL_SSE
void multipath_channel(channel_desc_t *desc,
- double tx_sig_re[2][30720*2],
- double tx_sig_im[2][30720*2],
- double rx_sig_re[2][30720*2],
- double rx_sig_im[2][30720*2],
+ double tx_sig_re[NB_ANTENNAS_TX][30720*2],
+ double tx_sig_im[NB_ANTENANS_TX][30720*2],
+ double rx_sig_re[NB_ANTENNAS_RX][30720*2],
+ double rx_sig_im[NB_ANTENNAS_RX][30720*2],
uint32_t length,
uint8_t keep_channel,
- int log_channel)
+ int log_channel)
{
int i,ii,j,l;
@@ -146,13 +146,13 @@ void multipath_channel(channel_desc_t *desc,
#else
void multipath_channel(channel_desc_t *desc,
- double *tx_sig_re[2],
- double *tx_sig_im[2],
- double *rx_sig_re[2],
- double *rx_sig_im[2],
+ double *tx_sig_re[NB_ANTENNAS_TX],
+ double *tx_sig_im[NB_ANTENNAS_TX],
+ double *rx_sig_re[NB_ANTENNAS_RX],
+ double *rx_sig_im[NB_ANTENNAS_RX],
uint32_t length,
uint8_t keep_channel,
- int log_channel)
+ int log_channel)
{
int i,ii,j,l;
@@ -198,21 +198,22 @@ void multipath_channel(channel_desc_t *desc,
rx_tmp.x += (tx.x * desc->ch[ii+(j*desc->nb_rx)][l].x) - (tx.y * desc->ch[ii+(j*desc->nb_rx)][l].y);
rx_tmp.y += (tx.y * desc->ch[ii+(j*desc->nb_rx)][l].x) + (tx.x * desc->ch[ii+(j*desc->nb_rx)][l].y);
- if (i==0 && log_channel == 1) {
- printf("channel[%d][%d][%d] = %f dB (%e,%e)\n",ii,j,l,10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].x,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].y,2.0)),
- desc->ch[ii+(j*desc->nb_rx)][l].x,
- desc->ch[ii+(j*desc->nb_rx)][l].y);
- }
+
+ if (i==0 && log_channel == 1) {
+ printf("channel[%d][%d][%d] = %f dB (%e,%e)\n",ii,j,l,10*log10(pow(desc->ch[ii+(j*desc->nb_rx)][l].x,2.0)+pow(desc->ch[ii+(j*desc->nb_rx)][l].y,2.0)),
+ desc->ch[ii+(j*desc->nb_rx)][l].x,
+ desc->ch[ii+(j*desc->nb_rx)][l].y);
+ }
} //l
} // j
rx_sig_re[ii][i+dd] = rx_tmp.x*path_loss;
rx_sig_im[ii][i+dd] = rx_tmp.y*path_loss;
-
- /* if ((ii==0)&&((i%32)==0)) {
- printf("%p %p %f,%f => %e,%e\n",rx_sig_re[ii],rx_sig_im[ii],rx_tmp.x,rx_tmp.y,rx_sig_re[ii][i-dd],rx_sig_im[ii][i-dd]);
- }*/
-
+#ifdef DEBUG_CHANNEL
+ if ((i%32)==0) {
+ printf("rx aa %d: %p %p %f,%f => %e,%e\n",ii,rx_sig_re[ii],rx_sig_im[ii],rx_tmp.x,rx_tmp.y,rx_sig_re[ii][i-dd],rx_sig_im[ii][i-dd]);
+ }
+#endif
//rx_sig_re[ii][i] = sqrt(.5)*(tx_sig_re[0][i] + tx_sig_re[1][i]);
//rx_sig_im[ii][i] = sqrt(.5)*(tx_sig_im[0][i] + tx_sig_im[1][i]);
diff --git a/openair1/SIMULATION/TOOLS/random_channel.c b/openair1/SIMULATION/TOOLS/random_channel.c
index 4e26d9a954..d2339954bd 100644
--- a/openair1/SIMULATION/TOOLS/random_channel.c
+++ b/openair1/SIMULATION/TOOLS/random_channel.c
@@ -2034,7 +2034,6 @@ static int channelmod_modify_cmd(char *buff, int debug, telnet_printfunc_t prnt)
prnt("ERROR: %s, unknown channel parameter\n",param);
return CMDSTATUS_FOUND;
}
-
display_channelmodel(defined_channels[cd_id],debug,prnt);
free(param);
free(value);
diff --git a/openair1/SIMULATION/TOOLS/sim.h b/openair1/SIMULATION/TOOLS/sim.h
index 7696f9202f..78e260b73f 100644
--- a/openair1/SIMULATION/TOOLS/sim.h
+++ b/openair1/SIMULATION/TOOLS/sim.h
@@ -339,10 +339,10 @@ void set_channeldesc_name(channel_desc_t *cdesc,char *modelname);
int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
/**\fn void multipath_channel(channel_desc_t *desc,
- double tx_sig_re[2],
- double tx_sig_im[2],
- double rx_sig_re[2],
- double rx_sig_im[2],
+ double tx_sig_re[NB_ANTENNAS_TX],
+ double tx_sig_im[NB_ANTENANS_TX],
+ double rx_sig_re[NB_ANTENNAS_RX],
+ double rx_sig_im[NB_ANTENNAS_RX],
uint32_t length,
uint8_t keep_channel,
int log_channel)
@@ -359,10 +359,10 @@ int random_channel(channel_desc_t *desc, uint8_t abstraction_flag);
*/
void multipath_channel(channel_desc_t *desc,
- double *tx_sig_re[2],
- double *tx_sig_im[2],
- double *rx_sig_re[2],
- double *rx_sig_im[2],
+ double *tx_sig_re[NB_ANTENNAS_TX],
+ double *tx_sig_im[NB_ANTENNAS_TX],
+ double *rx_sig_re[NB_ANTENNAS_RX],
+ double *rx_sig_im[NB_ANTENNAS_RX],
uint32_t length,
uint8_t keep_channel,
int log_channel);
@@ -510,7 +510,6 @@ double N_RB2channel_bandwidth(uint16_t N_RB);
void InitSinLUT( void );
void phase_noise(double ts, int16_t * InRe, int16_t * InIm);
-#include "targets/RT/USER/rfsim.h"
void do_DL_sig(sim_t *sim,
uint16_t subframe,
diff --git a/openair2/COMMON/f1ap_messages_types.h b/openair2/COMMON/f1ap_messages_types.h
index ecfde8d38b..c2fb4a9cf7 100644
--- a/openair2/COMMON/f1ap_messages_types.h
+++ b/openair2/COMMON/f1ap_messages_types.h
@@ -299,7 +299,7 @@ typedef struct f1ap_initial_ul_rrc_message_s {
uint16_t crnti;
uint8_t *rrc_container;
int rrc_container_length;
- uint8_t *du2cu_rrc_container;
+ int8_t *du2cu_rrc_container;
int du2cu_rrc_container_length;
} f1ap_initial_ul_rrc_message_t;
diff --git a/openair2/COMMON/gtpv1_u_messages_types.h b/openair2/COMMON/gtpv1_u_messages_types.h
index 63911d46cb..75df3253f6 100644
--- a/openair2/COMMON/gtpv1_u_messages_types.h
+++ b/openair2/COMMON/gtpv1_u_messages_types.h
@@ -168,23 +168,23 @@ typedef struct gtpv1u_enb_end_marker_ind_s {
uint32_t sdu_size;
uint8_t *sdu_p;
uint8_t mode;
- uint16_t rnti;
- uint8_t module_id;
+ uint16_t rnti;
+ uint8_t module_id;
uint8_t eNB_index;
} gtpv1u_enb_end_marker_ind_t;
typedef struct {
in_addr_t enb_ip_address_for_S1u_S12_S4_up;
tcp_udp_port_t enb_port_for_S1u_S12_S4_up;
- char addrStr[256];
- char portStr[256];
+ char addrStr[256];
+ char portStr[256];
} Gtpv1uS1Req;
typedef struct {
in_addr_t gnb_ip_address_for_NGu_up;
tcp_udp_port_t gnb_port_for_NGu_up;
- char addrStr[256];
- char portStr[256];
+ char addrStr[256];
+ char portStr[256];
} Gtpv1uNGReq;
typedef struct gtpv1u_gnb_create_tunnel_req_s {
rnti_t rnti;
diff --git a/openair2/COMMON/mac_rrc_primitives.h b/openair2/COMMON/mac_rrc_primitives.h
index 4a0a6027bc..5a45f2f196 100644
--- a/openair2/COMMON/mac_rrc_primitives.h
+++ b/openair2/COMMON/mac_rrc_primitives.h
@@ -189,7 +189,7 @@ typedef struct MEAS_REQ_TABLE_ENTRY {
MAC_MEAS_REQ Mac_meas_req;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
- uint8_t Status;
+ uint8_t StatusMeas;
uint8_t Meas_req_status;
uint8_t Rx_activity;
//uint8_t Meas_Direction;//???
@@ -269,7 +269,7 @@ typedef struct {
char Wideband_sinr;
uint8_t Forg_fact;
unsigned short Rep_interval;
- uint8_t Status;
+ uint8_t StatusMeas;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
uint8_t Active;
@@ -299,7 +299,7 @@ typedef struct {
unsigned short Rep_interval;
unsigned int Last_report_frame;
unsigned int Next_check_frame;
- uint8_t Status; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
+ uint8_t StatusMeas; //IDLE,NEED_rADIO_CONFIG, RADIO_CONFIG_TX, RADIO_CONFIG_ok
uint8_t Active;
} __attribute__ ((__packed__)) DEFAULT_CH_MEAS;
#define DEFAULT_eNB_MEAS_SIZE sizeof(DEFAULT_eNB_MEAS)
diff --git a/openair2/COMMON/platform_constants.h b/openair2/COMMON/platform_constants.h
index be6927ec37..c56a31711a 100644
--- a/openair2/COMMON/platform_constants.h
+++ b/openair2/COMMON/platform_constants.h
@@ -28,12 +28,14 @@
***************************************************************************/
-#include "LTE_asn_constant.h"
-#include "NR_asn_constant.h"
#ifndef __PLATFORM_CONSTANTS_H__
# define __PLATFORM_CONSTANTS_H__
+#include "LTE_asn_constant.h"
+#include "NR_asn_constant.h"
+#define NR_MAXDRB 14
+
#ifdef JUMBO_FRAME
#define NL_MAX_PAYLOAD 18000 /* this should cover the max mtu size*/
#else
@@ -87,14 +89,7 @@
#define MAX_gNB 2
#endif
-#define NUMBER_OF_NR_DLSCH_MAX 2//16
-#define NUMBER_OF_NR_ULSCH_MAX 2//16
-#define NUMBER_OF_NR_SCH_STATS_MAX 16
#define NUMBER_OF_NR_UCI_STATS_MAX 16
-#define NUMBER_OF_NR_PUCCH_MAX 16
-#define NUMBER_OF_NR_SR_MAX 16
-#define NUMBER_OF_NR_PDCCH_MAX 16
-
#define MAX_MANAGED_ENB_PER_MOBILE 2
#define MAX_MANAGED_GNB_PER_MOBILE 2
diff --git a/openair2/COMMON/tasks_def.h b/openair2/COMMON/tasks_def.h
deleted file mode 100644
index 33b6d5f9d4..0000000000
--- a/openair2/COMMON/tasks_def.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*
- * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The OpenAirInterface Software Alliance licenses this file to You under
- * the OAI Public License, Version 1.1 (the "License"); you may not use this file
- * except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.openairinterface.org/?page_id=698
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *-------------------------------------------------------------------------------
- * For more information about the OpenAirInterface (OAI) Software Alliance:
- * contact@openairinterface.org
- */
-
-// This task is mandatory and must always be placed in first position
-TASK_DEF(TASK_TIMER, TASK_PRIORITY_MAX, 10)
-
-// Other possible tasks in the process
-
-// Common tasks:
-
-/// Bearers Manager task
-TASK_DEF(TASK_BM, TASK_PRIORITY_MED, 200)
-
-// eNodeB tasks and sub-tasks:
-
-/// Radio Resource Control task
-TASK_DEF(TASK_RRC_ENB, TASK_PRIORITY_MED, 200)
-
-// Define here for now
-TASK_DEF(TASK_RRC_ENB_NB_IoT, TASK_PRIORITY_MED, 200)
-
-TASK_DEF(TASK_RRC_GNB, TASK_PRIORITY_MED, 200)
-
-/// S1ap task
-/// RAL task for ENB
-TASK_DEF(TASK_RAL_ENB, TASK_PRIORITY_MED, 200)
-
-// UDP TASK
-TASK_DEF(TASK_UDP, TASK_PRIORITY_MED, 1000)
-// GTP_V1U task
-TASK_DEF(TASK_GTPV1_U, TASK_PRIORITY_MED, 1000)
-TASK_DEF(TASK_S1AP, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_CU_F1, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_DU_F1, TASK_PRIORITY_MED, 200)
-/// M3ap task, acts as both source and target
-TASK_DEF(TASK_M3AP, TASK_PRIORITY_MED, 200)
-/// M3ap task, acts as both source and target
-TASK_DEF(TASK_M3AP_MME, TASK_PRIORITY_MED, 200)
-/// M3ap task, acts as both source and target
-TASK_DEF(TASK_M3AP_MCE, TASK_PRIORITY_MED, 200)
-/// M2ap task, acts as both source and target
-TASK_DEF(TASK_M2AP_MCE, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_M2AP_ENB, TASK_PRIORITY_MED, 200)
-/// X2ap task, acts as both source and target
-TASK_DEF(TASK_X2AP, TASK_PRIORITY_MED, 200)
-/// Sctp task (Used by both S1AP and X2AP)
-TASK_DEF(TASK_SCTP, TASK_PRIORITY_MED, 200)
-/// eNB APP task
-TASK_DEF(TASK_ENB_APP, TASK_PRIORITY_MED, 200)
-/// gNB APP task
-TASK_DEF(TASK_GNB_APP, TASK_PRIORITY_MED, 200)
-/// eNB Agent task
-TASK_DEF(TASK_FLEXRAN_AGENT, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_PROTO_AGENT, TASK_PRIORITY_MED, 200)
-// UE tasks and sub-tasks:
-
-/// Radio Resource Control task
-TASK_DEF(TASK_RRC_UE, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_RRC_NRUE, TASK_PRIORITY_MED, 200)
-/// Non Access Stratum task
-TASK_DEF(TASK_NAS_UE, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_RAL_UE, TASK_PRIORITY_MED, 200)
-
-//MESSAGE GENERATOR TASK
-TASK_DEF(TASK_MSC, TASK_PRIORITY_MED, 200)
-
-#ifdef ITTI_SIM
-TASK_DEF(TASK_RRC_GNB_SIM, TASK_PRIORITY_MED, 200)
-TASK_DEF(TASK_RRC_UE_SIM, TASK_PRIORITY_MED, 200)
-#endif
-
diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
index 7ca466e8ff..51e495b027 100644
--- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
+++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac.c
@@ -42,6 +42,9 @@
#include
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
/*Array containing the Agent-MAC interfaces*/
AGENT_MAC_xface *agent_mac_xface[NUM_MAX_ENB];
diff --git a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
index 42246c3ebf..e05fa98854 100644
--- a/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
+++ b/openair2/ENB_APP/CONTROL_MODULES/MAC/flexran_agent_mac_internal.c
@@ -33,6 +33,9 @@
#include "flexran_agent_mac_internal.h"
#include "flexran_agent_mac_slice_verification.h"
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
extern SLIST_HEAD(flexran_so_handle,
flexran_agent_so_handle_s) flexran_handles[NUM_MAX_ENB];
diff --git a/openair2/ENB_APP/MACRLC_paramdef.h b/openair2/ENB_APP/MACRLC_paramdef.h
index fcee6142f0..11cbe445b8 100644
--- a/openair2/ENB_APP/MACRLC_paramdef.h
+++ b/openair2/ENB_APP/MACRLC_paramdef.h
@@ -56,10 +56,14 @@
#define CONFIG_STRING_MACRLC_LOCAL_S_PORTD "local_s_portd"
#define CONFIG_STRING_MACRLC_REMOTE_S_PORTD "remote_s_portd"
#define CONFIG_STRING_MACRLC_SCHED_MODE "scheduler_mode"
-#define CONFIG_MACRLC_PUSCH10xSNR "puSch10xSnr"
-#define CONFIG_MACRLC_PUCCH10xSNR "puCch10xSnr"
+#define CONFIG_STRING_MACRLC_PUSCH10xSNR "puSch10xSnr"
+#define CONFIG_STRING_MACRLC_PUCCH10xSNR "puCch10xSnr"
#define CONFIG_STRING_MACRLC_DEFAULT_SCHED_DL_ALGO "default_sched_dl_algo"
-
+#define CONFIG_STRING_MACRLC_UE_MULTIPLE_MAX "ue_multiple_max"
+#define CONFIG_STRING_MACRLC_USE_MCS_OFFSET "use_mcs_offset"
+#define CONFIG_STRING_MACRLC_BLER_TARGET_LOWER "bler_target_lower"
+#define CONFIG_STRING_MACRLC_BLER_TARGET_UPPER "bler_target_upper"
+#define CONFIG_STRING_MACRLC_MAX_UL_RB_INDEX "max_ul_rb_index"
/*-------------------------------------------------------------------------------------------------------------------------------------------------------*/
/* MacRLC configuration parameters */
/* optname helpstr paramflags XXXptr defXXXval type numelt */
@@ -83,10 +87,15 @@
{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_SCHED_MODE, NULL, 0, strptr:NULL, defstrval:"default", TYPE_STRING, 0}, \
-{CONFIG_MACRLC_PUSCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
-{CONFIG_MACRLC_PUCCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
-{CONFIG_STRING_MACRLC_DEFAULT_SCHED_DL_ALGO, NULL, 0, strptr:NULL, defstrval:"round_robin_dl", TYPE_STRING, 0}, \
-}
+{CONFIG_STRING_MACRLC_PUSCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_PUCCH10xSNR, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_DEFAULT_SCHED_DL_ALGO, NULL, 0, strptr:NULL, defstrval:"round_robin_dl", TYPE_STRING, 0}, \
+{CONFIG_STRING_MACRLC_UE_MULTIPLE_MAX, NULL, 0, iptr:NULL, defintval:4, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_USE_MCS_OFFSET, NULL, 0, iptr:NULL, defintval:1, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_BLER_TARGET_LOWER, NULL, 0, dblptr:NULL, defdblval:.5, TYPE_DOUBLE, 0}, \
+{CONFIG_STRING_MACRLC_BLER_TARGET_UPPER, NULL, 0, dblptr:NULL, defdblval:2, TYPE_DOUBLE, 0}, \
+{CONFIG_STRING_MACRLC_MAX_UL_RB_INDEX, NULL, 0, iptr:NULL, defintval:22, TYPE_INT, 0}}
+
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
#define MACRLC_LOCAL_N_IF_NAME_IDX 2
@@ -108,6 +117,11 @@
#define MACRLC_PUSCH10xSNR_IDX 18
#define MACRLC_PUCCH10xSNR_IDX 19
#define MACRLC_DEFAULT_SCHED_DL_ALGO_IDX 20
+#define MACRLC_UE_MULTIPLE_MAX_IDX 21
+#define MACRLC_USE_MCS_OFFSET_IDX 22
+#define MACRLC_BLER_TARGET_LOWER_IDX 23
+#define MACRLC_BLER_TARGET_UPPER_IDX 24
+#define MACRLC_MAX_UL_RB_INDEX_IDX 25
/*---------------------------------------------------------------------------------------------------------------------------------------------------------*/
#endif
diff --git a/openair2/ENB_APP/NB_IoT_interface.c b/openair2/ENB_APP/NB_IoT_interface.c
index 7355233d71..8fc6de78af 100644
--- a/openair2/ENB_APP/NB_IoT_interface.c
+++ b/openair2/ENB_APP/NB_IoT_interface.c
@@ -35,6 +35,9 @@
#define NBIOT_INTERFACE_SOURCE
#include "NB_IoT_interface.h"
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
diff --git a/openair2/ENB_APP/NB_IoT_interface.h b/openair2/ENB_APP/NB_IoT_interface.h
index b3454b077b..c13f6dd1cb 100644
--- a/openair2/ENB_APP/NB_IoT_interface.h
+++ b/openair2/ENB_APP/NB_IoT_interface.h
@@ -31,6 +31,7 @@
#define NBIOT_MODULENAME "NB_IoT"
+#include "common/ran_context.h"
typedef void(*RCConfig_NbIoT_f_t)(RAN_CONTEXT_t *RC);
#define NBIOT_RCCONFIG_FNAME "RCConfig_NbIoT"
diff --git a/openair2/ENB_APP/enb_app.c b/openair2/ENB_APP/enb_app.c
index 5080157c3f..9f134f826e 100644
--- a/openair2/ENB_APP/enb_app.c
+++ b/openair2/ENB_APP/enb_app.c
@@ -244,6 +244,8 @@ void *eNB_app_task(void *args_p) {
}
+ LOG_I(ENB_APP,"TASK_ENB_APP is ready\n");
+
do {
// Wait for a message
itti_receive_msg (TASK_ENB_APP, &msg_p);
diff --git a/openair2/ENB_APP/enb_config.c b/openair2/ENB_APP/enb_config.c
index ee7b26ff1a..4751596931 100644
--- a/openair2/ENB_APP/enb_config.c
+++ b/openair2/ENB_APP/enb_config.c
@@ -64,6 +64,8 @@ extern uint32_t to_earfcn_UL(int eutra_bandP, uint32_t ul_CarrierFreq, uint32_t
extern char *parallel_config;
extern char *worker_config;
+RAN_CONTEXT_t RC;
+
void RCconfig_flexran() {
/* get number of eNBs */
paramdef_t ENBSParams[] = ENBSPARAMS_DESC;
@@ -218,13 +220,26 @@ void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]) {
for (j = 0; j < RC.nb_macrlc_inst; j++) {
RC.mac[j]->puSch10xSnr = *(MacRLC_ParamList.paramarray[j][MACRLC_PUSCH10xSNR_IDX ].iptr);
RC.mac[j]->puCch10xSnr = *(MacRLC_ParamList.paramarray[j][MACRLC_PUCCH10xSNR_IDX ].iptr);
+ RC.mac[j]->ue_multiple_max = *(MacRLC_ParamList.paramarray[j][MACRLC_UE_MULTIPLE_MAX_IDX ].iptr);
+ RC.mac[j]->use_mcs_offset = *(MacRLC_ParamList.paramarray[j][MACRLC_USE_MCS_OFFSET_IDX ].iptr);
+ RC.mac[j]->bler_lower = *(MacRLC_ParamList.paramarray[j][MACRLC_BLER_TARGET_LOWER_IDX ].dblptr);
+ RC.mac[j]->bler_upper = *(MacRLC_ParamList.paramarray[j][MACRLC_BLER_TARGET_UPPER_IDX ].dblptr);
+ RC.mac[j]->max_ul_rb_index = *(MacRLC_ParamList.paramarray[j][MACRLC_MAX_UL_RB_INDEX_IDX ].iptr);
RC.nb_mac_CC[j] = *(MacRLC_ParamList.paramarray[j][MACRLC_CC_IDX].iptr);
-
+ LOG_I(ENB_APP,"MAC instance %d parameters : pusch_snr %lf, pucch_snr %lf, ue_multiple_max %d, use_mcs_offset %d, bler_lower %lf, bler_upper %lf,max_ul_rb_index %d\n",
+ j,
+ RC.mac[j]->puSch10xSnr/10.0,
+ RC.mac[j]->puCch10xSnr/10.0,
+ RC.mac[j]->ue_multiple_max,
+ RC.mac[j]->use_mcs_offset,
+ RC.mac[j]->bler_lower,
+ RC.mac[j]->bler_upper,
+ RC.mac[j]->max_ul_rb_index);
if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "local_RRC") == 0) {
// check number of instances is same as RRC/PDCP
- printf("Configuring local RRC for MACRLC\n");
+ LOG_I(ENB_APP,"Configuring local RRC for MACRLC\n");
} else if (strcmp(*(MacRLC_ParamList.paramarray[j][MACRLC_TRANSPORT_N_PREFERENCE_IDX].strptr), "f1") == 0) {
- printf("Configuring F1 interfaces for MACRLC\n");
+ LOG_I(ENB_APP,"Configuring F1 interfaces for MACRLC\n");
RC.mac[j]->eth_params_n.local_if_name = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_IF_NAME_IDX].strptr));
RC.mac[j]->eth_params_n.my_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_LOCAL_N_ADDRESS_IDX].strptr));
RC.mac[j]->eth_params_n.remote_addr = strdup(*(MacRLC_ParamList.paramarray[j][MACRLC_REMOTE_N_ADDRESS_IDX].strptr));
@@ -1993,7 +2008,7 @@ int RCconfig_DU_F1(MessageDef *msg_p, uint32_t i) {
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nrb = rrc->carrier[0].mib.message.dl_Bandwidth;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.num_frequency_bands = 1;
F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.nr_band[0] = rrc->carrier[0].sib1->freqBandIndicator;
- F1AP_SETUP_REQ (msg_p).nr_mode_info[k].fdd.sul_active = 0;
+ F1AP_SETUP_REQ (msg_p).nr_mode_info[k].tdd.sul_active = 0;
} else {
LOG_I(ENB_APP,"ngran_DU: Configuring Cell %d for FDD\n",k);
F1AP_SETUP_REQ (msg_p).fdd_flag = 1;
@@ -2779,12 +2794,13 @@ int RCconfig_X2(MessageDef *msg_p, uint32_t i) {
"value of X2ParamList.numelt %d must be lower than X2AP_MAX_NB_ENB_IP_ADDRESS %d value: reconsider to increase X2AP_MAX_NB_ENB_IP_ADDRESS\n",
X2ParamList.numelt,X2AP_MAX_NB_ENB_IP_ADDRESS);
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 = 0;
-
+ LOG_I(X2AP,"X2ParamList.numelt %d\n",X2ParamList.numelt);
for (l = 0; l < X2ParamList.numelt; l++) {
X2AP_REGISTER_ENB_REQ (msg_p).nb_x2 += 1;
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4_address,*(X2ParamList.paramarray[l][ENB_X2_IPV4_ADDRESS_IDX].strptr));
strcpy(X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6_address,*(X2ParamList.paramarray[l][ENB_X2_IPV6_ADDRESS_IDX].strptr));
+ LOG_I(X2AP,"registering with ip : %s\n",*(X2ParamList.paramarray[l][ENB_X2_IPV4_ADDRESS_IDX].strptr));
if (strcmp(*(X2ParamList.paramarray[l][ENB_X2_IP_ADDRESS_PREFERENCE_IDX].strptr), "ipv4") == 0) {
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv4 = 1;
X2AP_REGISTER_ENB_REQ (msg_p).target_enb_x2_ip_address[l].ipv6 = 0;
@@ -2964,7 +2980,7 @@ void extract_and_decode_SI(int inst,int si_ind,uint8_t *si_container,int si_cont
eNB_RRC_INST *rrc = RC.rrc[inst];
rrc_eNB_carrier_data_t *carrier = &rrc->carrier[0];
LTE_BCCH_DL_SCH_Message_t *bcch_message ;
- AssertFatal(si_ind==0,"Can only handle a single SI block for now\n");
+ AssertFatal(si_ind==2,"Can only handle a single SI block for now\n");
LOG_I(ENB_APP, "rrc inst %d: Trying to decode SI block %d @ %p, length %d\n",inst,si_ind,si_container,si_container_length);
// point to first SI block
bcch_message = &carrier->systemInformation;
@@ -3151,15 +3167,19 @@ void handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
(check_plmn_identity(carrier, resp->cells_to_activate[j].mcc, resp->cells_to_activate[j].mnc, resp->cells_to_activate[j].mnc_digit_length)>0 &&
resp->cells_to_activate[j].nrpci == carrier->physCellId)) {
// copy system information and decode it
- for (si_ind=0; si_indcells_to_activate[j].num_SI; si_ind++) {
- //printf("SI %d size %d: ", si_ind, resp->SI_container_length[j][si_ind]);
- //for (int n=0;nSI_container_length[j][si_ind];n++)
- // printf("%02x ",resp->SI_container[j][si_ind][n]);
+ for (si_ind=2; si_indcells_to_activate[j].num_SI + 2; si_ind++) {
+ //printf("SI %d size %d: ", si_ind, resp->cells_to_activate[j].SI_container_length[si_ind]);
+ //for (int n=0;ncells_to_activate[j].SI_container_length[si_ind];n++)
+ // printf("%02x ",resp->cells_to_activate[j].SI_container[si_ind][n]);
//printf("\n");
- extract_and_decode_SI(i,
- si_ind,
- resp->cells_to_activate[j].SI_container[si_ind],
- resp->cells_to_activate[j].SI_container_length[si_ind]);
+ if (si_ind==6) si_ind=9;
+ if (resp->cells_to_activate[j].SI_container[si_ind] != NULL) {
+ extract_and_decode_SI(i,
+ si_ind,
+ resp->cells_to_activate[j].SI_container[si_ind],
+ resp->cells_to_activate[j].SI_container_length[si_ind]);
+ }
+
}
// perform MAC/L1 common configuration
diff --git a/openair2/ENB_APP/enb_config.h b/openair2/ENB_APP/enb_config.h
index 4bc4f5bf22..b95bf90f70 100644
--- a/openair2/ENB_APP/enb_config.h
+++ b/openair2/ENB_APP/enb_config.h
@@ -100,7 +100,6 @@ typedef struct ru_config_s {
uint8_t if_compress;
} ru_config_t;
-extern void RCconfig_RU(void);
extern void RCconfig_flexran(void);
extern void RCconfig_L1(void);
extern void RCconfig_macrlc(int macrlc_has_f1[MAX_MAC_INST]);
diff --git a/openair2/ENB_APP/flexran_agent.c b/openair2/ENB_APP/flexran_agent.c
index 33182f3593..af7ff6ff6f 100644
--- a/openair2/ENB_APP/flexran_agent.c
+++ b/openair2/ENB_APP/flexran_agent.c
@@ -33,6 +33,9 @@
#include
#include
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
int agent_task_created = 0;
/*
* enb agent task mainly wakes up the tx thread for periodic and oneshot messages to the controller
diff --git a/openair2/ENB_APP/flexran_agent_common.c b/openair2/ENB_APP/flexran_agent_common.c
index 1af59eab87..55a1c61b25 100644
--- a/openair2/ENB_APP/flexran_agent_common.c
+++ b/openair2/ENB_APP/flexran_agent_common.c
@@ -53,6 +53,9 @@
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "rrc_eNB_UE_context.h"
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
/*
* message primitives
*/
diff --git a/openair2/ENB_APP/flexran_agent_ran_api.c b/openair2/ENB_APP/flexran_agent_ran_api.c
index ff21971810..68d1f3311f 100644
--- a/openair2/ENB_APP/flexran_agent_ran_api.c
+++ b/openair2/ENB_APP/flexran_agent_ran_api.c
@@ -32,6 +32,9 @@
#include "s1ap_eNB_management_procedures.h"
#include "openair2/LAYER2/MAC/slicing/slicing.h"
+#include "common/ran_context.h"
+extern RAN_CONTEXT_t RC;
+
static inline int phy_is_present(mid_t mod_id, uint8_t cc_id) {
return RC.eNB && RC.eNB[mod_id] && RC.eNB[mod_id][cc_id];
}
@@ -885,7 +888,7 @@ uint8_t flexran_get_rrc_status(mid_t mod_id, rnti_t rnti) {
if (!ue_context_p) return RRC_INACTIVE;
- return ue_context_p->ue_context.Status;
+ return ue_context_p->ue_context.StatusRrc;
}
uint64_t flexran_get_ue_aggregated_max_bitrate_dl(mid_t mod_id, mid_t ue_id) {
diff --git a/openair2/F1AP/dummy_enb.c b/openair2/F1AP/dummy_enb.c
new file mode 100644
index 0000000000..ee98b9ec46
--- /dev/null
+++ b/openair2/F1AP/dummy_enb.c
@@ -0,0 +1,61 @@
+/*
+ * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The OpenAirInterface Software Alliance licenses this file to You under
+ * the OAI Public License, Version 1.1 (the "License"); you may not use this file
+ * except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.openairinterface.org/?page_id=698
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *-------------------------------------------------------------------------------
+ * For more information about the OpenAirInterface (OAI) Software Alliance:
+ * contact@openairinterface.org
+ */
+
+#include "COMMON/platform_types.h"
+#include "COMMON/platform_constants.h"
+#include "common/ran_context.h"
+
+#include "common/utils/LOG/log.h"
+#include "common/utils/LOG/vcd_signal_dumper.h"
+
+#include "NR_BCCH-BCH-Message.h"
+#include "NR_ServingCellConfigCommon.h"
+
+#include "LAYER2/NR_MAC_gNB/mac_proto.h"
+#include "SCHED_NR/phy_frame_config_nr.h"
+
+#include "NR_MIB.h"
+#include "LAYER2/NR_MAC_COMMON/nr_mac_common.h"
+#include "../../../../nfapi/oai_integration/vendor_ext.h"
+/* Softmodem params */
+#include "executables/softmodem-common.h"
+
+
+int rrc_mac_config_req_gNB(module_id_t Mod_idP,
+ int ssb_SubcarrierOffset,
+ int pdsch_AntennaPorts,
+ int pusch_AntennaPorts,
+ NR_ServingCellConfigCommon_t *scc,
+ int add_ue,
+ uint32_t rnti,
+ NR_CellGroupConfig_t *CellGroup){
+abort();
+return 0;
+}
+rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
+ const NR_SRB_ToAddModList_t * const srb2add_listP,
+ const NR_DRB_ToAddModList_t * const drb2add_listP,
+ const NR_DRB_ToReleaseList_t * const drb2release_listP,
+ const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
+ struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list){
+abort();
+return 0;
+}
diff --git a/openair2/F1AP/f1ap_cu_interface_management.c b/openair2/F1AP/f1ap_cu_interface_management.c
index 88d0a8ec59..057d0d97a0 100644
--- a/openair2/F1AP/f1ap_cu_interface_management.c
+++ b/openair2/F1AP/f1ap_cu_interface_management.c
@@ -103,7 +103,11 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
assoc_id, stream);
}
- message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
+ if(RC.nrrrc) {
+ message_p = itti_alloc_new_message(TASK_CU_F1, 0, F1AP_SETUP_REQ);
+ } else {
+ message_p = itti_alloc_new_message(TASK_RRC_ENB, 0, F1AP_SETUP_REQ);
+ }
/* assoc_id */
F1AP_SETUP_REQ(message_p).assoc_id = assoc_id;
@@ -142,8 +146,7 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
/* tac */
if (served_cells_item_p->served_Cell_Information.fiveGS_TAC) {
OCTET_STRING_TO_INT16(served_cells_item_p->served_Cell_Information.fiveGS_TAC, F1AP_SETUP_REQ(message_p).tac[i]);
- LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n",
- i, F1AP_SETUP_REQ(message_p).tac[i]);
+ LOG_D(F1AP, "F1AP_SETUP_REQ(message_p).tac[%d] %d \n", i, F1AP_SETUP_REQ(message_p).tac[i]);
}
/* - nRCGI */
TBCD_TO_MCC_MNC(&(served_cells_item_p->served_Cell_Information.nRCGI.pLMN_Identity), F1AP_SETUP_REQ(message_p).mcc[i],
@@ -247,14 +250,14 @@ int CU_handle_F1_SETUP_REQUEST(instance_t instance,
);
if (num_cells_available > 0) {
- if (RC.nrrrc[0]->node_type == ngran_gNB_CU) {
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
itti_send_msg_to_task(TASK_RRC_GNB, GNB_MODULE_ID_TO_INSTANCE(instance), message_p);
} else {
itti_send_msg_to_task(TASK_RRC_ENB, ENB_MODULE_ID_TO_INSTANCE(instance), message_p);
}
} else {
CU_send_F1_SETUP_FAILURE(instance);
- if (RC.nrrrc[0]->node_type == ngran_gNB_CU) {
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
itti_free(TASK_RRC_GNB,message_p);
} else {
itti_free(TASK_RRC_ENB,message_p);
@@ -322,22 +325,26 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_F1SetupResponseIEs__value_PR_Cells_to_be_Activated_List;
-
-
- for (i=0;
- icells_to_activate[i].mcc,
+ f1ap_setup_resp->cells_to_activate[i].mnc,
+ f1ap_setup_resp->cells_to_activate[i].mnc_digit_length,
+ f1ap_setup_resp->cells_to_activate[i].nr_cellid);
+
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
-
+
/* 3.1 cells to be Activated list item */
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
-
+
/* - nRCGI */
F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
@@ -345,62 +352,59 @@ int CU_send_F1_SETUP_RESPONSE(instance_t instance,
&nRCGI.pLMN_Identity);
NR_CELL_ID_TO_BIT_STRING(f1ap_setup_resp->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
-
+
/* optional */
/* - nRPCI */
if (1) {
- cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
- *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
+ cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
+ *cells_to_be_activated_list_item.nRPCI = f1ap_setup_resp->cells_to_activate[i].nrpci; // int 0..1007
}
-
+
/* optional */
/* - gNB-CU System Information */
if (1) {
- /* 3.1.2 gNB-CUSystem Information */
- F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
- cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
- cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
- cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
- cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
-
- F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
- //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
- //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
- // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
- //printf("\n");
-
- // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
- for (int sIBtype=2;sIBtype<21;sIBtype++) {
- if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
- AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
- F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
- memset((void*)sib_item,0,sizeof(*sib_item));
- sib_item->sIBtype = sIBtype;
- OCTET_STRING_fromBuf(&sib_item->sIBmessage,
- (const char*)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
- f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
-
- LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
- ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
- }
- }
- cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
-
-
- F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
- memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
-
- ASN_SEQUENCE_ADD(&p_154P112_t.list,
- cells_to_be_activated_list_itemExtIEs);
- cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
-
- free(gNB_CUSystemInformation);
- gNB_CUSystemInformation = NULL;
+ /* 3.1.2 gNB-CUSystem Information */
+ F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
+ cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
+ cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
+ cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
+ cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
+
+ F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
+ //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
+ //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
+ // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
+ //printf("\n");
+
+ // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
+ for (int sIBtype=2;sIBtype<21;sIBtype++) {
+ if (f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
+ AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
+ F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
+ memset((void*)sib_item,0,sizeof(*sib_item));
+ sib_item->sIBtype = sIBtype;
+ OCTET_STRING_fromBuf(&sib_item->sIBmessage,
+ (const char*)f1ap_setup_resp->cells_to_activate[i].SI_container[sIBtype],
+ f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
+
+ LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_setup_resp->cells_to_activate[i].SI_container_length[sIBtype]);
+ ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
+ }
+ }
+ cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
+
+ F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
+ memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
+
+ ASN_SEQUENCE_ADD(&p_154P112_t.list, cells_to_be_activated_list_itemExtIEs);
+ cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
+
+ free(gNB_CUSystemInformation);
+ gNB_CUSystemInformation = NULL;
}
/* ADD */
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
- cells_to_be_activated_list_item_ies);
+ ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list, cells_to_be_activated_list_item_ies);
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
@@ -548,7 +552,7 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
pdu.present = F1AP_F1AP_PDU_PR_initiatingMessage;
pdu.choice.initiatingMessage = (F1AP_InitiatingMessage_t *)calloc(1, sizeof(F1AP_InitiatingMessage_t));
pdu.choice.initiatingMessage->procedureCode = F1AP_ProcedureCode_id_gNBCUConfigurationUpdate;
- pdu.choice.initiatingMessage->criticality = F1AP_Criticality_reject;
+ pdu.choice.initiatingMessage->criticality = F1AP_Criticality_ignore;
pdu.choice.initiatingMessage->value.present = F1AP_InitiatingMessage__value_PR_GNBCUConfigurationUpdate;
out = &pdu.choice.initiatingMessage->value.choice.GNBCUConfigurationUpdate;
@@ -562,345 +566,351 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+
// mandatory
- // c2. Cells_to_be_Activated_List
+ // c2. Cells_to_be_Activated_List
if (f1ap_gnb_cu_configuration_update->num_cells_to_activate > 0) {
ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Activated_List;
-
- for (i=0;
- inum_cells_to_activate;
- i++) {
-
+
+ for (i=0; inum_cells_to_activate; i++) {
+
+ LOG_D(F1AP, "[c2] (cell %d) mcc = %d, mnc = %d, mnc_digit_length = %d, nr_cellid = %lu\n",
+ i,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid);
+
F1AP_Cells_to_be_Activated_List_ItemIEs_t *cells_to_be_activated_list_item_ies;
cells_to_be_activated_list_item_ies = (F1AP_Cells_to_be_Activated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemIEs_t));
cells_to_be_activated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
cells_to_be_activated_list_item_ies->criticality = F1AP_Criticality_reject;
cells_to_be_activated_list_item_ies->value.present = F1AP_Cells_to_be_Activated_List_ItemIEs__value_PR_Cells_to_be_Activated_List_Item;
-
+
// 2.1 cells to be Activated list item
F1AP_Cells_to_be_Activated_List_Item_t cells_to_be_activated_list_item;
memset((void *)&cells_to_be_activated_list_item, 0, sizeof(F1AP_Cells_to_be_Activated_List_Item_t));
-
- // - nRCGI
+
+ // - nRCGI
F1AP_NRCGI_t nRCGI;
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
+ MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
&nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
+ NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid,
&nRCGI.nRCellIdentity);
cells_to_be_activated_list_item.nRCGI = nRCGI;
-
- // optional
- // -nRPCI
- cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
- *cells_to_be_activated_list_item.nRPCI = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
-
- // optional
- // 3.1.2 gNB-CUSystem Information
- F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
- cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
- cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
- cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
- cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
- if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
- F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
- //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
- //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
- // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
- //printf("\n");
-
- // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
- for (int sIBtype=2;sIBtype<21;sIBtype++) {
- if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
- AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
- F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
- memset((void*)sib_item,0,sizeof(*sib_item));
- sib_item->sIBtype = sIBtype;
- OCTET_STRING_fromBuf(&sib_item->sIBmessage,
- (const char*)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
- f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
-
- LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
- ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
- }
- }
- cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
-
-
- F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
- memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
-
- ASN_SEQUENCE_ADD(&p_154P112_t.list,
- cells_to_be_activated_list_itemExtIEs);
- cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
-
- free(gNB_CUSystemInformation);
- gNB_CUSystemInformation = NULL;
- }
+ if(RC.nrrrc) {
+
+ // optional
+ // -nRPCI
+ cells_to_be_activated_list_item.nRPCI = (F1AP_NRPCI_t *)calloc(1, sizeof(F1AP_NRPCI_t));
+ *cells_to_be_activated_list_item.nRPCI = f1ap_gnb_cu_configuration_update->cells_to_activate[i].nrpci; // int 0..1007
+
+ // optional
+ // 3.1.2 gNB-CUSystem Information
+ F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs;
+ cells_to_be_activated_list_itemExtIEs = (F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t));
+ cells_to_be_activated_list_itemExtIEs->id = F1AP_ProtocolIE_ID_id_gNB_CUSystemInformation;
+ cells_to_be_activated_list_itemExtIEs->criticality = F1AP_Criticality_reject;
+ cells_to_be_activated_list_itemExtIEs->extensionValue.present = F1AP_Cells_to_be_Activated_List_ItemExtIEs__extensionValue_PR_GNB_CUSystemInformation;
+
+ if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].num_SI > 0) {
+ F1AP_GNB_CUSystemInformation_t *gNB_CUSystemInformation = (F1AP_GNB_CUSystemInformation_t *)calloc(1, sizeof(F1AP_GNB_CUSystemInformation_t));
+ //LOG_I(F1AP, "%s() SI %d size %d: ", __func__, i, f1ap_setup_resp->SI_container_length[i][0]);
+ //for (int n = 0; n < f1ap_setup_resp->SI_container_length[i][0]; n++)
+ // printf("%02x ", f1ap_setup_resp->SI_container[i][0][n]);
+ //printf("\n");
+
+ // for (int sIBtype=2;sIBtype<33;sIBtype++) { //21 ? 33 ?
+ for (int sIBtype=2;sIBtype<21;sIBtype++) {
+ if (f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype]!=NULL) {
+ AssertFatal(sIBtype < 6 || sIBtype == 9, "Illegal SI type %d\n",sIBtype);
+ F1AP_SibtypetobeupdatedListItem_t *sib_item = calloc(1,sizeof(*sib_item));
+ memset((void*)sib_item,0,sizeof(*sib_item));
+ sib_item->sIBtype = sIBtype;
+ OCTET_STRING_fromBuf(&sib_item->sIBmessage,
+ (const char*)f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container[sIBtype],
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
+
+ LOG_D(F1AP, "f1ap_setup_resp->SI_container_length[%d][%d] = %d \n", i,sIBtype,f1ap_gnb_cu_configuration_update->cells_to_activate[i].SI_container_length[sIBtype]);
+ ASN_SEQUENCE_ADD(&gNB_CUSystemInformation->sibtypetobeupdatedlist.list,sib_item);
+ }
+ }
+ cells_to_be_activated_list_itemExtIEs->extensionValue.choice.GNB_CUSystemInformation = *gNB_CUSystemInformation;
+
+
+ F1AP_ProtocolExtensionContainer_154P112_t p_154P112_t;
+ memset((void *)&p_154P112_t, 0, sizeof(F1AP_ProtocolExtensionContainer_154P112_t));
+
+ ASN_SEQUENCE_ADD(&p_154P112_t.list,
+ cells_to_be_activated_list_itemExtIEs);
+ cells_to_be_activated_list_item.iE_Extensions = (struct F1AP_ProtocolExtensionContainer*)&p_154P112_t;
+
+ free(gNB_CUSystemInformation);
+ gNB_CUSystemInformation = NULL;
+ }
+ }
// ADD
cells_to_be_activated_list_item_ies->value.choice.Cells_to_be_Activated_List_Item = cells_to_be_activated_list_item;
ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Activated_List.list,
cells_to_be_activated_list_item_ies);
- }
+ }
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
+
}
-
- /*
-
- // c3. Cells_to_be_Deactivated_List
- //
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
-
- for (i=0;
- i<1;
- i++) {
-
- F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
- cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
- cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
- cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
- cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
-
- // 3.1 cells to be Deactivated list item
- F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
- memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
- cells_to_be_deactivated_list_item.nRCGI = nRCGI;
+ if(!RC.nrrrc) {
- cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
- cells_to_be_deactivated_list_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-*/
+ /* mandatory */
+ /* c3. Cells_to_be_Deactivated_List */
+ ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Deactivated_List;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Deactivated_List;
+
+ for (i=0;
+ i<1;
+ i++) {
+
+ F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *cells_to_be_deactivated_list_item_ies;
+ cells_to_be_deactivated_list_item_ies = (F1AP_Cells_to_be_Deactivated_List_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Deactivated_List_ItemIEs_t));
+ cells_to_be_deactivated_list_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+ cells_to_be_deactivated_list_item_ies->criticality = F1AP_Criticality_reject;
+ cells_to_be_deactivated_list_item_ies->value.present = F1AP_Cells_to_be_Deactivated_List_ItemIEs__value_PR_Cells_to_be_Deactivated_List_Item;
+
+ // 3.1 cells to be Deactivated list item
+ F1AP_Cells_to_be_Deactivated_List_Item_t cells_to_be_deactivated_list_item;
+ memset((void *)&cells_to_be_deactivated_list_item, 0, sizeof(F1AP_Cells_to_be_Deactivated_List_Item_t));
- /*
- // c4. GNB_CU_TNL_Association_To_Add_List
-
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
+ F1AP_NRCGI_t nRCGI;
+ memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
+ MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
+ &nRCGI.pLMN_Identity);
+ NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
+ cells_to_be_deactivated_list_item.nRCGI = nRCGI;
- for (i=0;
- i<1;
- i++) {
-
- F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
- gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
- gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
- gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
- gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
-
- // 4.1 GNB_CU_TNL_Association_To_Add_Item
- F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
- memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
+ cells_to_be_deactivated_list_item_ies->value.choice.Cells_to_be_Deactivated_List_Item = cells_to_be_deactivated_list_item;
+ ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Deactivated_List.list,
+ cells_to_be_deactivated_list_item_ies);
+ }
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- // 4.1.1 tNLAssociationTransportLayerAddress
- F1AP_CP_TransportLayerAddress_t transportLayerAddress;
- memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
-
- // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
- // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
- // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+ /* mandatory */
+ /* c4. GNB_CU_TNL_Association_To_Add_List */
+ ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_List;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Add_List;
- gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
+ for (i=0;
+ i<1;
+ i++) {
- // 4.1.2 tNLAssociationUsage
- gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
-
+ F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *gnb_cu_tnl_association_to_add_item_ies;
+ gnb_cu_tnl_association_to_add_item_ies = (F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs_t));
+ gnb_cu_tnl_association_to_add_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Add_Item;
+ gnb_cu_tnl_association_to_add_item_ies->criticality = F1AP_Criticality_reject;
+ gnb_cu_tnl_association_to_add_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Add_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Add_Item;
-
- gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
- gnb_cu_tnl_association_to_add_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
- */
-
- /*
-
- // c5. GNB_CU_TNL_Association_To_Remove_List
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
- for (i=0;
- i<1;
- i++) {
-
- F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
- gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
- gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
- gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
- gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
-
- // 4.1 GNB_CU_TNL_Association_To_Remove_Item
- F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
- memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
+ // 4.1 GNB_CU_TNL_Association_To_Add_Item
+ F1AP_GNB_CU_TNL_Association_To_Add_Item_t gnb_cu_tnl_association_to_add_item;
+ memset((void *)&gnb_cu_tnl_association_to_add_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Add_Item_t));
- // 4.1.1 tNLAssociationTransportLayerAddress
- F1AP_CP_TransportLayerAddress_t transportLayerAddress;
- memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
-
- // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
- // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
- // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+ // 4.1.1 tNLAssociationTransportLayerAddress
+ F1AP_CP_TransportLayerAddress_t transportLayerAddress;
+ memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
- gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
-
+ // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
+ // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
+ // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+
+ gnb_cu_tnl_association_to_add_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
+
+ // 4.1.2 tNLAssociationUsage
+ gnb_cu_tnl_association_to_add_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
- gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
- gnb_cu_tnl_association_to_remove_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- */
- /*
- //c6. GNB_CU_TNL_Association_To_Update_List
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
- for (i=0;
- i<1;
- i++) {
-
- F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
- gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
- gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
- gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
- gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
-
- // 4.1 GNB_CU_TNL_Association_To_Update_Item
- F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
- memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
+ gnb_cu_tnl_association_to_add_item_ies->value.choice.GNB_CU_TNL_Association_To_Add_Item = gnb_cu_tnl_association_to_add_item;
+ ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Add_List.list,
+ gnb_cu_tnl_association_to_add_item_ies);
+ }
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- // 4.1.1 tNLAssociationTransportLayerAddress
- F1AP_CP_TransportLayerAddress_t transportLayerAddress;
- memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
- TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
-
- // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
- // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
- // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
- // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+ /* mandatory */
+ /* c5. GNB_CU_TNL_Association_To_Remove_List */
+ ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_List;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Remove_List;
+ for (i=0;
+ i<1;
+ i++) {
- gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
-
+ F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *gnb_cu_tnl_association_to_remove_item_ies;
+ gnb_cu_tnl_association_to_remove_item_ies = (F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs_t));
+ gnb_cu_tnl_association_to_remove_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Remove_Item;
+ gnb_cu_tnl_association_to_remove_item_ies->criticality = F1AP_Criticality_reject;
+ gnb_cu_tnl_association_to_remove_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Remove_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Remove_Item;
- // 4.1.2 tNLAssociationUsage
- if (1) {
- gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
- *gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
- }
-
-
- gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
- gnb_cu_tnl_association_to_update_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ // 4.1 GNB_CU_TNL_Association_To_Remove_Item
+ F1AP_GNB_CU_TNL_Association_To_Remove_Item_t gnb_cu_tnl_association_to_remove_item;
+ memset((void *)&gnb_cu_tnl_association_to_remove_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Remove_Item_t));
- */
+ // 4.1.1 tNLAssociationTransportLayerAddress
+ F1AP_CP_TransportLayerAddress_t transportLayerAddress;
+ memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
- /*
- // c7. Cells_to_be_Barred_List
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
- for (i=0;
- i<1;
- i++) {
+ // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
+ // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
+ // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
- F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
- cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
- cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
- cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
- cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
-
- // 7.1 cells to be Deactivated list item
- F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
- memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
-
- // - nRCGI
- F1AP_NRCGI_t nRCGI;
- memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
- MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
- &nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
- cells_to_be_barred_item.nRCGI = nRCGI;
-
- // 7.2 cellBarred
- cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
-
- cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
- ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
- cells_to_be_barred_item_ies);
- }
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-
- */
-
- /*
- // c8. Protected_EUTRA_Resources_List
- ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
-
- for (i=0;
- i<1;
- i++) {
+ gnb_cu_tnl_association_to_remove_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
- F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
- // 8.1 SpectrumSharingGroupID
- protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
- protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
- protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
- protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
- ((F1AP_Protected_EUTRA_Resources_Item_t*)&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
- memset(&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item,0,
- sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
- ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
+ gnb_cu_tnl_association_to_remove_item_ies->value.choice.GNB_CU_TNL_Association_To_Remove_Item = gnb_cu_tnl_association_to_remove_item;
+ ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Remove_List.list,
+ gnb_cu_tnl_association_to_remove_item_ies);
+ }
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ /* mandatory */
+ /* c6. GNB_CU_TNL_Association_To_Update_List */
+ ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_List;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_GNB_CU_TNL_Association_To_Update_List;
+ for (i=0;
+ i<1;
+ i++) {
+
+ F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *gnb_cu_tnl_association_to_update_item_ies;
+ gnb_cu_tnl_association_to_update_item_ies = (F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t *)calloc(1, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs_t));
+ gnb_cu_tnl_association_to_update_item_ies->id = F1AP_ProtocolIE_ID_id_GNB_CU_TNL_Association_To_Update_Item;
+ gnb_cu_tnl_association_to_update_item_ies->criticality = F1AP_Criticality_reject;
+ gnb_cu_tnl_association_to_update_item_ies->value.present = F1AP_GNB_CU_TNL_Association_To_Update_ItemIEs__value_PR_GNB_CU_TNL_Association_To_Update_Item;
+
+ // 4.1 GNB_CU_TNL_Association_To_Update_Item
+ F1AP_GNB_CU_TNL_Association_To_Update_Item_t gnb_cu_tnl_association_to_update_item;
+ memset((void *)&gnb_cu_tnl_association_to_update_item, 0, sizeof(F1AP_GNB_CU_TNL_Association_To_Update_Item_t));
+
+
+ // 4.1.1 tNLAssociationTransportLayerAddress
+ F1AP_CP_TransportLayerAddress_t transportLayerAddress;
+ memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address;
+ TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address);
+
+ // memset((void *)&transportLayerAddress, 0, sizeof(F1AP_CP_TransportLayerAddress_t));
+ // transportLayerAddress.present = F1AP_CP_TransportLayerAddress_PR_endpoint_IP_address_and_port;
+ // transportLayerAddress.choice.endpoint_IP_address_and_port = (F1AP_Endpoint_IP_address_and_port_t *)calloc(1, sizeof(F1AP_Endpoint_IP_address_and_port_t));
+ // TRANSPORT_LAYER_ADDRESS_IPv4_TO_BIT_STRING(1234, &transportLayerAddress.choice.endpoint_IP_address_and_port.endpoint_IP_address);
+
+ gnb_cu_tnl_association_to_update_item.tNLAssociationTransportLayerAddress = transportLayerAddress;
+
+
+ // 4.1.2 tNLAssociationUsage
+ if (1) {
+ gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = (F1AP_TNLAssociationUsage_t *)calloc(1, sizeof(F1AP_TNLAssociationUsage_t));
+ *gnb_cu_tnl_association_to_update_item.tNLAssociationUsage = F1AP_TNLAssociationUsage_non_ue;
+ }
+
+
+ gnb_cu_tnl_association_to_update_item_ies->value.choice.GNB_CU_TNL_Association_To_Update_Item = gnb_cu_tnl_association_to_update_item;
+ ASN_SEQUENCE_ADD(&ie->value.choice.GNB_CU_TNL_Association_To_Update_List.list,
+ gnb_cu_tnl_association_to_update_item_ies);
+ }
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+
+
+ /* mandatory */
+ /* c7. Cells_to_be_Barred_List */
+ ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Barred_List;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Cells_to_be_Barred_List;
+ for (i=0;
+ i<1;
+ i++) {
+
+ F1AP_Cells_to_be_Barred_ItemIEs_t *cells_to_be_barred_item_ies;
+ cells_to_be_barred_item_ies = (F1AP_Cells_to_be_Barred_ItemIEs_t *)calloc(1, sizeof(F1AP_Cells_to_be_Barred_ItemIEs_t));
+ cells_to_be_barred_item_ies->id = F1AP_ProtocolIE_ID_id_Cells_to_be_Activated_List_Item;
+ cells_to_be_barred_item_ies->criticality = F1AP_Criticality_reject;
+ cells_to_be_barred_item_ies->value.present = F1AP_Cells_to_be_Barred_ItemIEs__value_PR_Cells_to_be_Barred_Item;
+
+ // 7.1 cells to be Deactivated list item
+ F1AP_Cells_to_be_Barred_Item_t cells_to_be_barred_item;
+ memset((void *)&cells_to_be_barred_item, 0, sizeof(F1AP_Cells_to_be_Barred_Item_t));
+
+ // - nRCGI
+ F1AP_NRCGI_t nRCGI;
+ memset(&nRCGI,0,sizeof(F1AP_NRCGI_t));
+ MCC_MNC_TO_PLMNID(f1ap_gnb_cu_configuration_update->cells_to_activate[i].mcc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc,
+ f1ap_gnb_cu_configuration_update->cells_to_activate[i].mnc_digit_length,
+ &nRCGI.pLMN_Identity);
+ NR_CELL_ID_TO_BIT_STRING(f1ap_gnb_cu_configuration_update->cells_to_activate[i].nr_cellid, &nRCGI.nRCellIdentity);
+ cells_to_be_barred_item.nRCGI = nRCGI;
+
+ // 7.2 cellBarred
+ cells_to_be_barred_item.cellBarred = F1AP_CellBarred_not_barred;
+
+ cells_to_be_barred_item_ies->value.choice.Cells_to_be_Barred_Item = cells_to_be_barred_item;
+ ASN_SEQUENCE_ADD(&ie->value.choice.Cells_to_be_Barred_List.list,
+ cells_to_be_barred_item_ies);
+ }
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+
+
+ /* mandatory */
+ /* c8. Protected_EUTRA_Resources_List */
+ ie = (F1AP_GNBCUConfigurationUpdateIEs_t *)calloc(1, sizeof(F1AP_GNBCUConfigurationUpdateIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_GNBCUConfigurationUpdateIEs__value_PR_Protected_EUTRA_Resources_List;
+
+ for (i=0;
+ i<1;
+ i++) {
+
+
+ F1AP_Protected_EUTRA_Resources_ItemIEs_t *protected_eutra_resources_item_ies;
+
+ // 8.1 SpectrumSharingGroupID
+ protected_eutra_resources_item_ies = (F1AP_Protected_EUTRA_Resources_ItemIEs_t *)calloc(1, sizeof(F1AP_Protected_EUTRA_Resources_ItemIEs_t));
+ protected_eutra_resources_item_ies->id = F1AP_ProtocolIE_ID_id_Protected_EUTRA_Resources_List;
+ protected_eutra_resources_item_ies->criticality = F1AP_Criticality_reject;
+ protected_eutra_resources_item_ies->value.present = F1AP_Protected_EUTRA_Resources_ItemIEs__value_PR_Protected_EUTRA_Resources_Item;
+ ((F1AP_Protected_EUTRA_Resources_Item_t*)&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item)->spectrumSharingGroupID = 123L;
+ memset(&protected_eutra_resources_item_ies->value.choice.Protected_EUTRA_Resources_Item,0,
+ sizeof(F1AP_Protected_EUTRA_Resources_Item_t));
+ ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
+
+ /*
F1AP_Served_EUTRA_Cells_Information_t served_eutra_cells_information;
memset((void *)&served_eutra_cells_information, 0, sizeof(F1AP_Served_EUTRA_Cells_Information_t));
@@ -931,10 +941,10 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
ASN_SEQUENCE_ADD(&protected_eutra_resources_item_ies->value.choice.ListofEUTRACellsinGNBDUCoordination.list, &served_eutra_cells_information);
ASN_SEQUENCE_ADD(&ie->value.choice.Protected_EUTRA_Resources_List.list, protected_eutra_resources_item_ies);
-
+ */
+ }
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- */
/* encode */
@@ -942,10 +952,11 @@ int CU_send_gNB_CU_CONFIGURATION_UPDATE(instance_t instance, f1ap_gnb_cu_configu
LOG_E(F1AP, "Failed to encode F1 gNB-CU CONFIGURATION UPDATE\n");
return -1;
}
-
- printf("F1AP gNB-CU CONFIGURATION UPDATE : ");
- for (int i=0;iassoc_id, buffer, len, 0);
return 0;
}
@@ -961,7 +972,7 @@ int CU_handle_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
uint32_t assoc_id,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
- LOG_I(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
+ LOG_D(F1AP,"Cell Configuration ok (assoc_id %d)\n",assoc_id);
return(0);
}
diff --git a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
index 2a029a3ac5..03cfcc7329 100644
--- a/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
+++ b/openair2/F1AP/f1ap_cu_rrc_message_transfer.c
@@ -116,7 +116,7 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_ProtocolIE_ID_id_RRCContainer, true);
AssertFatal(ie!=NULL,"RRCContainer is missing\n");
// create an ITTI message and copy SDU
- if (RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
+ if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
message_p = itti_alloc_new_message (TASK_CU_F1, 0, NR_RRC_MAC_CCCH_DATA_IND);
memset (NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu, 0, CCCH_SDU_SIZE);
ccch_sdu_len = ie->value.choice.RRCContainer.size;
@@ -130,32 +130,35 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
ccch_sdu_len);
}
- LOG_I(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__,
- ie->value.choice.RRCContainer.size);
- for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
- printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
- printf("\n");
+ if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
- /* DUtoCURRCContainer */
- F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
- if (ie) {
- NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
- NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(ie->value.choice.DUtoCURRCContainer.size);
- memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
- ie->value.choice.DUtoCURRCContainer.buf,
- ie->value.choice.DUtoCURRCContainer.size);
+ LOG_D(F1AP, "%s() RRCContainer (CCCH) size %ld: ", __func__, ie->value.choice.RRCContainer.size);
+ //for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
+ // printf("%02x ", RRC_MAC_CCCH_DATA_IND (message_p).sdu[i]);
+ //printf("\n");
+ /* DUtoCURRCContainer */
+ F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_InitialULRRCMessageTransferIEs_t, ie, container,
+ F1AP_ProtocolIE_ID_id_DUtoCURRCContainer, true);
+ if (ie) {
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container = malloc(sizeof(OCTET_STRING_t));
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->size = ie->value.choice.DUtoCURRCContainer.size;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf = malloc(
+ ie->value.choice.DUtoCURRCContainer.size);
+ memcpy(NR_RRC_MAC_CCCH_DATA_IND (message_p).du_to_cu_rrc_container->buf,
+ ie->value.choice.DUtoCURRCContainer.buf,
+ ie->value.choice.DUtoCURRCContainer.size);
+ }
}
+
// Find instance from nr_cellid
int rrc_inst = -1;
- if (RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
+ if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
for (int i=0;inr_cellid == nr_cellid) {
- rrc_inst = i;
+ rrc_inst = i;
break;
}
}
@@ -164,12 +167,11 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
// first get RRC instance (note, no the ITTI instance)
eNB_RRC_INST *rrc = RC.rrc[i];
if (rrc->nr_cellid == nr_cellid) {
- rrc_inst = i;
+ rrc_inst = i;
break;
}
}
}
-
AssertFatal(rrc_inst>=0,"couldn't find an RRC instance for nr_cell %llu\n",(unsigned long long int)nr_cellid);
int f1ap_uid = f1ap_add_ue(&f1ap_cu_inst[rrc_inst], rrc_inst, CC_id, 0, rnti);
@@ -180,21 +182,21 @@ int CU_handle_INITIAL_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
}
f1ap_cu_inst[rrc_inst].f1ap_ue[f1ap_uid].du_ue_f1ap_id = du_ue_f1ap_id;
- if (RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
- NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
+ if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
NR_RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
NR_RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = rrc_inst; // CU instance
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).gnb_index = rrc_inst; // CU instance
NR_RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
- NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
+ NR_RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
itti_send_msg_to_task (TASK_RRC_GNB, instance, message_p);
} else {
- RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
+ RRC_MAC_CCCH_DATA_IND (message_p).frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sub_frame = 0;
RRC_MAC_CCCH_DATA_IND (message_p).sdu_size = ccch_sdu_len;
- RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
+ RRC_MAC_CCCH_DATA_IND (message_p).enb_index = rrc_inst; // CU instance
RRC_MAC_CCCH_DATA_IND (message_p).rnti = rnti;
- RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
+ RRC_MAC_CCCH_DATA_IND (message_p).CC_id = CC_id;
itti_send_msg_to_task (TASK_RRC_ENB, instance, message_p);
}
@@ -212,7 +214,7 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
{
LOG_D(F1AP, "CU send DL_RRC_MESSAGE_TRANSFER \n");
- F1AP_F1AP_PDU_t pdu;
+ F1AP_F1AP_PDU_t pdu;
F1AP_DLRRCMessageTransfer_t *out;
F1AP_DLRRCMessageTransferIEs_t *ie;
@@ -293,33 +295,33 @@ int CU_send_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_dl_rrc->rrc_container, f1ap_dl_rrc->rrc_container_length);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
- LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
- for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
- printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
- printf("\n");
+ if (RC.nrrrc && RC.nrrrc[GNB_INSTANCE_TO_MODULE_ID(instance)]->node_type == ngran_gNB_CU) {
+ LOG_I(F1AP, "%s() RRCContainer size %d: ", __func__, f1ap_dl_rrc->rrc_container_length);
+ for (int i = 0; i < ie->value.choice.RRCContainer.size; i++)
+ printf("%02x ", f1ap_dl_rrc->rrc_container[i]);
+ printf("\n");
+ }
/* optional */
/* c7. RAT_FrequencyPriorityInformation */
/* TODO */
- if (0) {
- int endc=1;
- ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
- if (endc==1) {
- ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
- ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
- }
- else {
- ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
- ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
- }
- //ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
- //ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ int endc=1;
+ ie = (F1AP_DLRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_DLRRCMessageTransferIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_RAT_FrequencyPriorityInformation;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_DLRRCMessageTransferIEs__value_PR_RAT_FrequencyPriorityInformation;
+ if (endc==1) {
+ ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
+ ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 123L;
}
-
+ else {
+ ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_nGRAN;
+ ie->value.choice.RAT_FrequencyPriorityInformation.choice.nGRAN = 11L;
+ }
+ //ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_rAT_FrequencySelectionPriority;
+ //ie->value.choice.RAT_FrequencyPriorityInformation.choice.rAT_FrequencySelectionPriority = 123L;
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 DL RRC MESSAGE TRANSFER \n");
@@ -344,7 +346,7 @@ int CU_handle_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
F1AP_ULRRCMessageTransfer_t *container;
F1AP_ULRRCMessageTransferIEs_t *ie;
-
+
uint64_t cu_ue_f1ap_id;
uint64_t du_ue_f1ap_id;
uint64_t srb_id;
diff --git a/openair2/F1AP/f1ap_cu_task.c b/openair2/F1AP/f1ap_cu_task.c
index 24aec70b57..b261d8e85b 100644
--- a/openair2/F1AP/f1ap_cu_task.c
+++ b/openair2/F1AP/f1ap_cu_task.c
@@ -72,11 +72,16 @@ void cu_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data_from_du->sctp_out_streams = sctp_new_association_resp->out_streams;
/* setup parameters for F1U and start the server */
- const cudu_params_t params = {
+ const cudu_params_t params = (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_CU) ? (cudu_params_t){
.local_ipv4_address = RC.nrrrc[instance]->eth_params_s.my_addr,
.local_port = RC.nrrrc[instance]->eth_params_s.my_portd,
.remote_ipv4_address = RC.nrrrc[instance]->eth_params_s.remote_addr,
.remote_port = RC.nrrrc[instance]->eth_params_s.remote_portd
+ } : (cudu_params_t){
+ .local_ipv4_address = RC.rrc[instance]->eth_params_s.my_addr,
+ .local_port = RC.rrc[instance]->eth_params_s.my_portd,
+ .remote_ipv4_address = RC.rrc[instance]->eth_params_s.remote_addr,
+ .remote_port = RC.rrc[instance]->eth_params_s.remote_portd
};
AssertFatal(proto_agent_start(instance, ¶ms) == 0,
"could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
@@ -109,7 +114,7 @@ void cu_task_send_sctp_init_req(instance_t enb_id) {
message_p->ittiMsg.sctp_init.ipv4 = 1;
message_p->ittiMsg.sctp_init.ipv6 = 0;
message_p->ittiMsg.sctp_init.nb_ipv4_addr = 1;
- if (RC.nrrrc[0]->node_type == ngran_gNB_CU) {
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_CU) {
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.nrrrc[enb_id]->eth_params_s.my_addr);
} else{
message_p->ittiMsg.sctp_init.ipv4_address[0] = inet_addr(RC.rrc[enb_id]->eth_params_s.my_addr);
diff --git a/openair2/F1AP/f1ap_cu_ue_context_management.c b/openair2/F1AP/f1ap_cu_ue_context_management.c
index 85c992f757..317f0058b2 100644
--- a/openair2/F1AP/f1ap_cu_ue_context_management.c
+++ b/openair2/F1AP/f1ap_cu_ue_context_management.c
@@ -151,7 +151,7 @@ int CU_send_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-if (0) {
+
/* mandatory */
/* c7. Candidate_SpCell_List */
ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
@@ -264,7 +264,7 @@ if (0) {
f1ap_ue_context_setup_req->mnc,
f1ap_ue_context_setup_req->mnc_digit_length,
&nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+ NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
scell_toBeSetup_item.sCell_ID = nRCGI;
/* 10.1.2 sCellIndex */
@@ -476,7 +476,7 @@ if (0) {
/* OPTIONAL */
/* gBR_QoS_Flow_Information */
if (0) {
- DRB_Information->dRB_QoS.gBR_QoS_Flow_Information = (F1AP_GBR_QoSFlowInformation_t *)calloc(1, sizeof(F1AP_GBR_QoSFlowInformation_t));
+ DRB_Information->dRB_QoS.gBR_QoS_Flow_Information = (F1AP_GBR_QoSFlowInformation_t *)calloc(1, sizeof(F1AP_GBR_QoSFlowInformation_t));
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateDownlink, 1L);
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxFlowBitRateUplink, 1L);
asn_long2INTEGER(&DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->guaranteedFlowBitRateDownlink, 1L);
@@ -485,14 +485,14 @@ if (0) {
/* OPTIONAL */
/* maxPacketLossRateDownlink */
if (0) {
- DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
+ DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
*DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateDownlink = 1L;
}
/* OPTIONAL */
/* maxPacketLossRateUplink */
if (0) {
- DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
+ DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = (F1AP_MaxPacketLossRate_t *)calloc(1, sizeof(F1AP_MaxPacketLossRate_t));
*DRB_Information->dRB_QoS.gBR_QoS_Flow_Information->maxPacketLossRateUplink = 1L;
}
@@ -501,7 +501,7 @@ if (0) {
/* OPTIONAL */
/* reflective_QoS_Attribute */
if (0) {
- DRB_Information->dRB_QoS.reflective_QoS_Attribute = (long *)calloc(1, sizeof(long));
+ DRB_Information->dRB_QoS.reflective_QoS_Attribute = (long *)calloc(1, sizeof(long));
*DRB_Information->dRB_QoS.reflective_QoS_Attribute = 1L;
}
@@ -582,8 +582,9 @@ if (0) {
/* packetErrorRate */
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Scalar = 1L;
- flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Exponent = 6L;
- /* OPTIONAL */
+ flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->packetErrorRate.pER_Exponent = 6L;
+
+ /* OPTIONAL */
/* delayCritical */
if (0) {
flows_mapped_to_drb_item.qoSFlowLevelQoSParameters.qoS_Characteristics.choice.dynamic_5QI->delayCritical = (long *)calloc(1, sizeof(long));
@@ -708,7 +709,7 @@ if (0) {
}
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
-}
+
/* OPTIONAL */
/* InactivityMonitoringRequest */
if (0) {
@@ -728,7 +729,7 @@ if (0) {
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RAT_FrequencyPriorityInformation;
- int endc = 1; // RK: Get this from somewhere ...
+ int endc = 1; // RK: Get this from somewhere ...
if (endc) {
ie->value.choice.RAT_FrequencyPriorityInformation.present = F1AP_RAT_FrequencyPriorityInformation_PR_eNDC;
ie->value.choice.RAT_FrequencyPriorityInformation.choice.eNDC = 11L;
@@ -741,13 +742,15 @@ if (0) {
/* OPTIONAL */
/* RRCContainer */
- ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
- OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container,
- f1ap_ue_context_setup_req->rrc_container_length);
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ if(RC.nrrrc) {
+ ie = (F1AP_UEContextSetupRequestIEs_t *)calloc(1, sizeof(F1AP_UEContextSetupRequestIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_RRCContainer;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_UEContextSetupRequestIEs__value_PR_RRCContainer;
+ OCTET_STRING_fromBuf(&ie->value.choice.RRCContainer, (const char*)f1ap_ue_context_setup_req->rrc_container,
+ f1ap_ue_context_setup_req->rrc_container_length);
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ }
/* OPTIONAL */
/* MaskedIMEISV */
@@ -780,7 +783,9 @@ if (0) {
LOG_D(F1AP,"F1AP UEContextSetupRequest Encoded %u bits\n", len);
- cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
+ if(RC.nrrrc) {
+ cu_f1ap_itti_send_sctp_data_req(instance, f1ap_assoc_id /* BK: fix me*/ , buffer, len, 0 /* BK: fix me*/);
+ }
return 0;
}
@@ -1080,8 +1085,8 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
// for test
int mcc = 208;
- int mnc = 93;
- int mnc_digit_length = 8;
+ int mnc = 92;
+ int mnc_digit_length = 2;
/* Create */
/* 0. Message Type */
@@ -1122,7 +1127,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
F1AP_NRCGI_t nRCGI;
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+ NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
ie->value.choice.NRCGI = nRCGI;
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
@@ -1247,7 +1252,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+ NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
scell_toBeSetupMod_item.sCell_ID = nRCGI;
/* sCellIndex */
@@ -1287,7 +1292,7 @@ int CU_send_UE_CONTEXT_MODIFICATION_REQUEST(instance_t instance) {
memset(&nRCGI, 0, sizeof(F1AP_NRCGI_t));
MCC_MNC_TO_PLMNID(mcc, mnc, mnc_digit_length,
&nRCGI.pLMN_Identity);
- NR_CELL_ID_TO_BIT_STRING(123456, &nRCGI.nRCellIdentity);
+ NR_CELL_ID_TO_BIT_STRING(12345678, &nRCGI.nRCellIdentity);
scell_toBeRemoved_item.sCell_ID = nRCGI;
/* ADD */
diff --git a/openair2/F1AP/f1ap_decoder.c b/openair2/F1AP/f1ap_decoder.c
index 1b35ca6ccf..ac55db7fda 100644
--- a/openair2/F1AP/f1ap_decoder.c
+++ b/openair2/F1AP/f1ap_decoder.c
@@ -161,7 +161,7 @@ int f1ap_decode_pdu(F1AP_F1AP_PDU_t *pdu, const uint8_t *const buffer, uint32_t
0,
0);
- if (1 /*asn1_decoder_xer_print*/) {
+ if (asn1_decoder_xer_print) {
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT START----------------- \n");
xer_fprint(stdout, &asn_DEF_F1AP_F1AP_PDU, pdu);
LOG_E(F1AP, "----------------- ASN1 DECODER PRINT END ----------------- \n");
diff --git a/openair2/F1AP/f1ap_du_interface_management.c b/openair2/F1AP/f1ap_du_interface_management.c
index 6f43240e66..b6ece9b13f 100644
--- a/openair2/F1AP/f1ap_du_interface_management.c
+++ b/openair2/F1AP/f1ap_du_interface_management.c
@@ -43,8 +43,12 @@ extern RAN_CONTEXT_t RC;
int nrb_lut[29] = {11, 18, 24, 25, 31, 32, 38, 51, 52, 65, 66, 78, 79, 93, 106, 107, 121, 132, 133, 135, 160, 162, 189, 216, 217, 245, 264, 270, 273};
int to_NRNRB(int nrb) {
- for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i;
- AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb);
+ if (RC.nrrrc) {
+ for (int i=0;i<29;i++) if (nrb_lut[i] == nrb) return i;
+ AssertFatal(1==0,"nrb %d is not in the list of possible NRNRB\n",nrb);
+ } else {
+ return nrb;
+ }
}
int DU_handle_RESET(instance_t instance,
@@ -195,14 +199,19 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
served_cell_information.nRPCI = f1ap_du_data->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */
- uint8_t fiveGS_TAC[3];
- served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
- fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2];
- fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1];
- fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0];
- OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
- (const char *)fiveGS_TAC,
- 3);
+ if (RC.nrrrc) {
+ uint8_t fiveGS_TAC[3];
+ fiveGS_TAC[0] = ((uint8_t*)&f1ap_du_data->tac[i])[2];
+ fiveGS_TAC[1] = ((uint8_t*)&f1ap_du_data->tac[i])[1];
+ fiveGS_TAC[2] = ((uint8_t*)&f1ap_du_data->tac[i])[0];
+ OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
+ (const char *)fiveGS_TAC,
+ 3);
+ } else {
+ OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
+ (const char*)&f1ap_du_data->tac[i],
+ 3);
+ }
/* - Configured_EPS_TAC */
if(0){
@@ -240,7 +249,7 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* FDD.1.3 freqBandListNr */
int fdd_ul_num_available_freq_Bands = f1ap_du_data->nr_mode_info[i].fdd.ul_num_frequency_bands;
- LOG_D(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
+ LOG_I(F1AP, "fdd_ul_num_available_freq_Bands = %d \n", fdd_ul_num_available_freq_Bands);
int fdd_ul_j;
for (fdd_ul_j=0;
fdd_ul_jnr_mode_info[i].fdd.dl_num_frequency_bands;
- LOG_D(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
+ LOG_I(F1AP, "fdd_dl_num_available_freq_Bands = %d \n", fdd_dl_num_available_freq_Bands);
int fdd_dl_j;
for (fdd_dl_j=0;
fdd_dl_jnr_mode_info[i].tdd.num_frequency_bands;
- LOG_D(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
+ LOG_I(F1AP, "tdd_num_available_freq_Bands = %d \n", tdd_num_available_freq_Bands);
+ AssertFatal(tdd_num_available_freq_Bands > 0, "should have at least one TDD band available\n");
int j;
for (j=0;
jmib[i],//f1ap_du_data->mib,
f1ap_du_data->mib_length[i]);
+ LOG_D(F1AP,"Filling SIB1_message for cell %d, length %d\n",i,f1ap_du_data->sib1_length[i]);
OCTET_STRING_fromBuf(&gNB_DU_System_Information->sIB1_message, // sept. 2018
(const char*)f1ap_du_data->sib1[i],
f1ap_du_data->sib1_length[i]);
@@ -404,15 +415,17 @@ int DU_send_F1_SETUP_REQUEST(instance_t instance) {
/* mandatory */
/* c5. RRC VERSION */
- ie = (F1AP_F1SetupRequestIEs_t *)calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
- ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
- ie->criticality = F1AP_Criticality_reject;
- ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
- ie->value.choice.RRC_Version.latest_RRC_Version.buf=calloc(1,sizeof(char));
- ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
- ie->value.choice.RRC_Version.latest_RRC_Version.size = 1;
- ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
- ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ if(RC.nrrrc) {
+ ie = (F1AP_F1SetupRequestIEs_t *) calloc(1, sizeof(F1AP_F1SetupRequestIEs_t));
+ ie->id = F1AP_ProtocolIE_ID_id_GNB_DU_RRC_Version;
+ ie->criticality = F1AP_Criticality_reject;
+ ie->value.present = F1AP_F1SetupRequestIEs__value_PR_RRC_Version;
+ ie->value.choice.RRC_Version.latest_RRC_Version.buf = calloc(1, sizeof(char));
+ ie->value.choice.RRC_Version.latest_RRC_Version.buf[0] = 0xe0;
+ ie->value.choice.RRC_Version.latest_RRC_Version.size = 1;
+ ie->value.choice.RRC_Version.latest_RRC_Version.bits_unused = 5;
+ ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
+ }
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
@@ -518,10 +531,12 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
cell->nRCGI.nRCellIdentity.buf[2],
cell->nRCGI.nRCellIdentity.buf[3],
cell->nRCGI.nRCellIdentity.buf[4]);
+
BIT_STRING_TO_NR_CELL_IDENTITY(&cell->nRCGI.nRCellIdentity,
F1AP_SETUP_RESP (msg_p).cells_to_activate[i].nr_cellid);
- F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
- if (ext==NULL) continue;
+ F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
+
+ if (ext==NULL) continue;
for (int cnt=0;cntlist.count;cnt++) {
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
@@ -546,10 +561,10 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size;
- F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si] = size;
- LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
- F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[si]);
- memcpy((void*)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[si],
+ F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container_length[sib_item->sIBtype] = size;
+ LOG_I(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
+ F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype] = malloc(size);
+ memcpy((void*)F1AP_SETUP_RESP (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype],
(void*)sib_item->sIBmessage.buf,
size);
}
@@ -582,10 +597,8 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
} // switch ie
} // for IE
AssertFatal(TransactionId!=-1,"TransactionId was not sent\n");
- LOG_D(F1AP,"F1AP: num_cells_to_activate %d\n",num_cells_to_activate);
F1AP_SETUP_RESP (msg_p).num_cells_to_activate = num_cells_to_activate;
- // tmp
- // F1AP_SETUP_RESP (msg_p).num_SI[0] = 1;
+
for (int i=0;i 0, "System Information %d is missing",i);
@@ -598,14 +611,14 @@ int DU_handle_F1_SETUP_RESPONSE(instance_t instance,
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
assoc_id);
- if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to GNB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
} else {
LOG_D(F1AP, "Sending F1AP_SETUP_RESP ITTI message to ENB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
- itti_send_msg_to_task(TASK_ENB_APP, ENB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
+ itti_send_msg_to_task(TASK_ENB_APP, instance, msg_p);
}
return 0;
@@ -719,13 +732,19 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */
- uint8_t fiveGS_TAC[3];
- fiveGS_TAC[0] = ((uint8_t*)&f1ap_setup_req->tac[i])[2];
- fiveGS_TAC[1] = ((uint8_t*)&f1ap_setup_req->tac[i])[1];
- fiveGS_TAC[2] = ((uint8_t*)&f1ap_setup_req->tac[i])[0];
- OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
- (const char *)fiveGS_TAC,
- 3);
+ if (RC.nrrrc) {
+ uint8_t fiveGS_TAC[3];
+ fiveGS_TAC[0] = ((uint8_t*)&f1ap_setup_req->tac[i])[2];
+ fiveGS_TAC[1] = ((uint8_t*)&f1ap_setup_req->tac[i])[1];
+ fiveGS_TAC[2] = ((uint8_t*)&f1ap_setup_req->tac[i])[0];
+ OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
+ (const char *)fiveGS_TAC,
+ 3);
+ } else {
+ OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
+ (const char *) &f1ap_setup_req->tac[i],
+ 3);
+ }
/* - Configured_EPS_TAC */
if(1){
@@ -740,7 +759,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
-
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info;
@@ -885,7 +903,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
served_cell_information.nRPCI = f1ap_setup_req->nr_pci[i]; // int 0..1007
/* - fiveGS_TAC */
- served_cell_information.fiveGS_TAC=calloc(1,sizeof(*served_cell_information.fiveGS_TAC));
OCTET_STRING_fromBuf(served_cell_information.fiveGS_TAC,
(const char *) &f1ap_setup_req->tac[i],
3);
@@ -903,8 +920,6 @@ int DU_send_gNB_DU_CONFIGURATION_UPDATE(instance_t instance,
MCC_MNC_TO_PLMNID(f1ap_du_data->mcc[i], f1ap_du_data->mnc[i], f1ap_du_data->mnc_digit_length[i], &servedPLMN_item->pLMN_Identity);
ASN_SEQUENCE_ADD(&served_cell_information.servedPLMNs.list, servedPLMN_item);
-
-
// // /* - CHOICE NR-MODE-Info */
F1AP_NR_Mode_Info_t nR_Mode_Info;
@@ -1072,6 +1087,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
+ if(!RC.nrrrc) {
+ return 0;
+ }
+
LOG_D(F1AP, "DU_handle_gNB_CU_CONFIGURATION_UPDATE\n");
AssertFatal(pdu->present == F1AP_F1AP_PDU_PR_initiatingMessage,
@@ -1141,7 +1160,7 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
F1AP_ProtocolExtensionContainer_154P112_t *ext = (F1AP_ProtocolExtensionContainer_154P112_t *)cell->iE_Extensions;
if (ext==NULL) continue;
-
+
for (int cnt=0;cntlist.count;cnt++) {
F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *cells_to_be_activated_list_itemExtIEs=(F1AP_Cells_to_be_Activated_List_ItemExtIEs_t *)ext->list.array[cnt];
switch (cells_to_be_activated_list_itemExtIEs->id) {
@@ -1165,10 +1184,10 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
for (int si = 0;si < gNB_CUSystemInformation->sibtypetobeupdatedlist.list.count;si++) {
F1AP_SibtypetobeupdatedListItem_t *sib_item = gNB_CUSystemInformation->sibtypetobeupdatedlist.list.array[si];
size_t size = sib_item->sIBmessage.size;
- F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si] = size;
- LOG_D(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
- F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si] = malloc(F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[si]);
- memcpy((void*)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[si],
+ F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container_length[sib_item->sIBtype] = size;
+ LOG_I(F1AP, "F1AP: SI_container_length[%d][%d] %ld bytes\n", i, (int)sib_item->sIBtype, size);
+ F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype] = malloc(size);
+ memcpy((void*)F1AP_GNB_CU_CONFIGURATION_UPDATE (msg_p).cells_to_activate[i].SI_container[sib_item->sIBtype],
(void*)sib_item->sIBmessage.buf,
size);
}
@@ -1213,7 +1232,7 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
0,0,//MSC_AS_TIME_ARGS(ctxt_pP),
assoc_id);
- if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
LOG_D(F1AP, "Sending F1AP_GNB_CU_CONFIGURATION_UPDATE ITTI message to GNB_APP with assoc_id (%d->%d)\n",
assoc_id,ENB_MODULE_ID_TO_INSTANCE(assoc_id));
itti_send_msg_to_task(TASK_GNB_APP, GNB_MODULE_ID_TO_INSTANCE(assoc_id), msg_p);
@@ -1235,6 +1254,10 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge) {
+ if(!RC.nrrrc) {
+ return 0;
+ }
+
AssertFatal(GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated == 0,
"%d cells failed to activate\n",
GNBCUConfigurationUpdateAcknowledge->num_cells_failed_to_be_activated);
@@ -1247,7 +1270,7 @@ int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed == 0,
"%d TNLAssociations failed\n",
GNBCUConfigurationUpdateAcknowledge->noofTNLAssociations_failed);
-
+
AssertFatal(GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs == 0,
"%d DedicatedSIDeliveryNeededUEs\n",
GNBCUConfigurationUpdateAcknowledge->noofDedicatedSIDeliveryNeededUEs);
diff --git a/openair2/F1AP/f1ap_du_interface_management.h b/openair2/F1AP/f1ap_du_interface_management.h
index f15decb6f5..619b725f38 100644
--- a/openair2/F1AP/f1ap_du_interface_management.h
+++ b/openair2/F1AP/f1ap_du_interface_management.h
@@ -98,17 +98,17 @@ int DU_handle_gNB_CU_CONFIGURATION_UPDATE(instance_t instance,
F1AP_F1AP_PDU_t *pdu);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(instance_t instance,
- f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
+ f1ap_gnb_cu_configuration_update_failure_t *GNBCUConfigurationUpdateFailure);
int DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(instance_t instance,
- f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
+ f1ap_gnb_cu_configuration_update_acknowledge_t *GNBCUConfigurationUpdateAcknowledge);
/*
* gNB-DU Resource Coordination
*/
int DU_send_gNB_DU_RESOURCE_COORDINATION_REQUEST(instance_t instance,
- F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
+ F1AP_GNBDUResourceCoordinationRequest_t *GNBDUResourceCoordinationRequest);
int DU_handle_gNB_DU_RESOURCE_COORDINATION_RESPONSE(instance_t instance,
uint32_t assoc_id,
diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.c b/openair2/F1AP/f1ap_du_rrc_message_transfer.c
index a5bb50547e..07df0b4a78 100644
--- a/openair2/F1AP/f1ap_du_rrc_message_transfer.c
+++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.c
@@ -88,10 +88,9 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
uint32_t stream,
F1AP_F1AP_PDU_t *pdu) {
- if (RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
+ if (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) {
LOG_I(F1AP, "node is gNB DU, call DU_handle_DL_NR_RRC_MESSAGE_TRANSFER \n");
- DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance, assoc_id, stream, pdu);
- return 0;
+ return DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance, assoc_id, stream, pdu);
}
LOG_D(F1AP, "DU_handle_DL_RRC_MESSAGE_TRANSFER \n");
@@ -480,36 +479,36 @@ int DU_handle_DL_RRC_MESSAGE_TRANSFER(instance_t instance,
DRB2LCHAN[i] = (uint8_t) * DRB_configList->list.array[i]->logicalChannelIdentity;
}
- rrc_mac_config_req_eNB(
- ctxt.module_id,
- 0,0,0,0,0,0,
- 0,
- ue_context_p->ue_context.rnti,
- (LTE_BCCH_BCH_Message_t *) NULL,
- (LTE_RadioResourceConfigCommonSIB_t *) NULL,
- (LTE_RadioResourceConfigCommonSIB_t *) NULL,
- physicalConfigDedicated,
- (LTE_SCellToAddMod_r10_t *)NULL,
- //(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
- (LTE_MeasObjectToAddMod_t **) NULL,
- mac_MainConfig,
- DRB2LCHAN[i],
- DRB_configList->list.array[i]->logicalChannelConfig,
- measGapConfig,
- (LTE_TDD_Config_t *) NULL,
- NULL,
- (LTE_SchedulingInfoList_t *) NULL,
- 0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
- , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL,
- (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
- 0,
- (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
- (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
- (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
- (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
- (LTE_MBSFN_AreaInfoList_r9_t *) NULL,
- (LTE_MBSFNAreaConfiguration_r9_t*) NULL
- );
+ rrc_mac_config_req_eNB(
+ ctxt.module_id,
+ 0,0,0,0,0,0,
+ 0,
+ ue_context_p->ue_context.rnti,
+ (LTE_BCCH_BCH_Message_t *) NULL,
+ (LTE_RadioResourceConfigCommonSIB_t *) NULL,
+ (LTE_RadioResourceConfigCommonSIB_t *) NULL,
+ physicalConfigDedicated,
+ (LTE_SCellToAddMod_r10_t *)NULL,
+ //(struct PhysicalConfigDedicatedSCell_r10 *)NULL,
+ (LTE_MeasObjectToAddMod_t **) NULL,
+ mac_MainConfig,
+ DRB2LCHAN[i],
+ DRB_configList->list.array[i]->logicalChannelConfig,
+ measGapConfig,
+ (LTE_TDD_Config_t *) NULL,
+ NULL,
+ (LTE_SchedulingInfoList_t *) NULL,
+ 0, NULL, NULL, (LTE_MBSFN_SubframeConfigList_t *) NULL
+ , 0, (LTE_MBSFN_AreaInfoList_r9_t *) NULL, (LTE_PMCH_InfoList_r9_t *) NULL,
+ (LTE_SystemInformationBlockType1_v1310_IEs_t *)NULL,
+ 0,
+ (LTE_BCCH_DL_SCH_Message_MBMS_t *) NULL,
+ (LTE_SchedulingInfo_MBMS_r14_t *) NULL,
+ (struct LTE_NonMBSFN_SubframeConfig_r14 *) NULL,
+ (LTE_SystemInformationBlockType1_MBMS_r14_t *) NULL,
+ (LTE_MBSFN_AreaInfoList_r9_t *) NULL,
+ (LTE_MBSFNAreaConfiguration_r9_t*) NULL
+ );
}
} else { // remove LCHAN from MAC/PHY
@@ -747,7 +746,7 @@ int DU_send_UL_RRC_MESSAGE_TRANSFER(instance_t instance,
} else {
LOG_I(F1AP, "Processing RRCConnectionSetupComplete UE %x\n", rnti);
- ue_context_p->ue_context.Status = RRC_CONNECTED;
+ ue_context_p->ue_context.StatusRrc = RRC_CONNECTED;
}
break;
@@ -807,7 +806,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
rnti_t rntiP,
const uint8_t *sduP,
sdu_size_t sdu_lenP,
- const uint8_t *sdu2P,
+ const int8_t *sdu2P,
sdu_size_t sdu2_lenP) {
F1AP_F1AP_PDU_t pdu;
@@ -879,25 +878,22 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
/* optional */
/* c5. DUtoCURRCContainer */
- if (sdu2P) {
+ if (sdu2P && RC.nrrrc) {
ie = (F1AP_InitialULRRCMessageTransferIEs_t *)calloc(1, sizeof(F1AP_InitialULRRCMessageTransferIEs_t));
ie->id = F1AP_ProtocolIE_ID_id_DUtoCURRCContainer;
ie->criticality = F1AP_Criticality_reject;
ie->value.present = F1AP_InitialULRRCMessageTransferIEs__value_PR_DUtoCURRCContainer;
- OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCContainer,
- (char *)sdu2P,
- sdu2_lenP);
+ OCTET_STRING_fromBuf(&ie->value.choice.DUtoCURRCContainer, (char *)sdu2P, sdu2_lenP);
ASN_SEQUENCE_ADD(&out->protocolIEs.list, ie);
}
-
/* encode */
if (f1ap_encode_pdu(&pdu, &buffer, &len) < 0) {
LOG_E(F1AP, "Failed to encode F1 INITIAL UL RRC MESSAGE TRANSFER\n");
return -1;
}
- if (RC.nrrrc[module_idP]->node_type == ngran_gNB_DU) {
+ if (RC.nrrrc && RC.nrrrc[module_idP]->node_type == ngran_gNB_DU) {
struct rrc_gNB_ue_context_s* ue_context_p = rrc_gNB_allocate_new_UE_context(RC.nrrrc[module_idP]);
ue_context_p->ue_id_rnti = rntiP;
ue_context_p->ue_context.rnti = rntiP;
@@ -997,7 +993,7 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
if (msg->srb_id == 1 || msg->srb_id == 2) {
struct rrc_gNB_ue_context_s* ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[instance], rnti);
-
+
NR_UL_DCCH_Message_t* ul_dcch_msg=NULL;
asn_dec_rval_t dec_rval;
dec_rval = uper_decode(NULL,
@@ -1005,7 +1001,7 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
(void**)&ul_dcch_msg,
&ie->value.choice.RRCContainer.buf[1], // buf[0] includes the pdcp header
msg->rrc_container_length, 0, 0);
-
+
if ((dec_rval.code != RC_OK) && (dec_rval.consumed == 0)) {
LOG_E(F1AP, " Failed to decode UL-DCCH (%zu bytes)\n",dec_rval.consumed);
/* for rfsim, because UE send RRCSetupRequest in SRB1 */
@@ -1045,18 +1041,18 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
case NR_UL_DCCH_MessageType__c1_PR_rrcReconfigurationComplete:
LOG_I(F1AP, "[MSG] RRC UL rrcReconfigurationComplete\n");
-
+
/* CDRX: activated when RRC Connection Reconfiguration Complete is received */
#if(0)
int UE_id_mac = find_nr_UE_id(instance, rnti);
-
+
if (UE_id_mac == -1) {
LOG_E(F1AP, "Can't find UE_id(MAC) of UE rnti %x\n", rnti);
break;
}
-
+
UE_sched_ctrl_t *UE_scheduling_control = &(RC.nrmac[instance]->UE_info.UE_sched_ctrl[UE_id_mac]);
-
+
if (UE_scheduling_control->cdrx_waiting_ack == TRUE) {
UE_scheduling_control->cdrx_waiting_ack = FALSE;
UE_scheduling_control->cdrx_configured = TRUE; // Set to TRUE when RRC Connection Reconfiguration Complete is received
@@ -1068,13 +1064,13 @@ int DU_send_UL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
case NR_UL_DCCH_MessageType__c1_PR_rrcSetupComplete:
LOG_I(F1AP, "[MSG] RRC UL rrcSetupComplete \n");
-
+
if(!ue_context_p){
LOG_E(F1AP, "Did not find the UE context associated with UE RNTOI %x, ue_context_p is NULL\n", rnti);
} else {
LOG_I(F1AP, "Processing RRCSetupComplete UE %x\n", rnti);
- ue_context_p->ue_context.Status = NR_RRC_CONNECTED;
+ ue_context_p->ue_context.StatusRrc = NR_RRC_CONNECTED;
}
break;
@@ -1299,10 +1295,8 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
rrcSetup_ies->masterCellGroup.size,0,0);
AssertFatal(dec_rval.code == RC_OK, "could not decode masterCellGroup\n");
-#if NR
- gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
-
// configure MAC
+ gNB_RRC_INST *rrc = RC.nrrrc[ctxt.module_id];
rrc_mac_config_req_gNB(ctxt.module_id,
rrc->carrier.ssb_SubcarrierOffset,
rrc->carrier.pdsch_AntennaPorts,
@@ -1312,6 +1306,7 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
ue_context_p->ue_context.rnti,
ue_context_p->ue_context.masterCellGroup
);
+
// rrc_rlc_config_asn1_req
nr_rrc_rlc_config_asn1_req(&ctxt,
ue_context_p->ue_context.SRB_configList,
@@ -1320,15 +1315,14 @@ int DU_handle_DL_NR_RRC_MESSAGE_TRANSFER(instance_t instance,
NULL,
NULL,
NULL);
-#endif
// This should be somewhere in the f1ap_cudu_ue_inst_t
- /*int macrlc_instance = 0;
+ /*int macrlc_instance = 0;
rnti_t rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[0], du_ue_f1ap_id);
struct rrc_gNB_ue_context_s *ue_context_p = rrc_gNB_get_ue_context(RC.nrrrc[macrlc_instance],rnti);
- */
- gNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
+ */
+ gNB_RRC_UE_t *ue_p = &ue_context_p->ue_context;
AssertFatal(ue_p->Srb0.Active == 1,"SRB0 is not active\n");
memcpy((void*)ue_p->Srb0.Tx_buffer.Payload,
diff --git a/openair2/F1AP/f1ap_du_rrc_message_transfer.h b/openair2/F1AP/f1ap_du_rrc_message_transfer.h
index 0bb6371fe8..3036c66d70 100644
--- a/openair2/F1AP/f1ap_du_rrc_message_transfer.h
+++ b/openair2/F1AP/f1ap_du_rrc_message_transfer.h
@@ -50,7 +50,7 @@ int DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(module_id_t module_idP,
rnti_t rntiP,
const uint8_t *sduP,
sdu_size_t sdu_lenP,
- const uint8_t *sdu2P,
- sdu_size_t sdu2_lenP);
+ const int8_t *sdu2P,
+ sdu_size_t sdu2_lenP);
#endif /* F1AP_DU_RRC_MESSAGE_TRANSFER_H_ */
diff --git a/openair2/F1AP/f1ap_du_task.c b/openair2/F1AP/f1ap_du_task.c
index 726d5629f8..50f7cdff80 100644
--- a/openair2/F1AP/f1ap_du_task.c
+++ b/openair2/F1AP/f1ap_du_task.c
@@ -86,9 +86,9 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
DevAssert(sctp_new_association_resp != NULL);
if (sctp_new_association_resp->sctp_state != SCTP_STATE_ESTABLISHED) {
- LOG_W(F1AP, "Received unsuccessful result for SCTP association (%u), instance %ld, cnx_id %u\n",
+ LOG_E(F1AP, "Received unsuccessful result for SCTP association (%u), instance %d, cnx_id %u\n",
sctp_new_association_resp->sctp_state,
- instance,
+ (int)instance,
sctp_new_association_resp->ulp_cnx_id);
//f1ap_handle_setup_message(instance, sctp_new_association_resp->sctp_state == SCTP_STATE_SHUTDOWN);
@@ -102,11 +102,16 @@ void du_task_handle_sctp_association_resp(instance_t instance, sctp_new_associat
f1ap_du_data->default_sctp_stream_id = 0;
/* setup parameters for F1U and start the server */
- const cudu_params_t params = {
+ const cudu_params_t params = (RC.nrrrc && RC.nrrrc[instance]->node_type == ngran_gNB_DU) ? (cudu_params_t){
.local_ipv4_address = RC.nrmac[instance]->eth_params_n.my_addr,
.local_port = RC.nrmac[instance]->eth_params_n.my_portd,
.remote_ipv4_address = RC.nrmac[instance]->eth_params_n.remote_addr,
.remote_port = RC.nrmac[instance]->eth_params_n.remote_portd
+ } : (cudu_params_t){
+ .local_ipv4_address = RC.mac[instance]->eth_params_n.my_addr,
+ .local_port = RC.mac[instance]->eth_params_n.my_portd,
+ .remote_ipv4_address = RC.mac[instance]->eth_params_n.remote_addr,
+ .remote_port = RC.mac[instance]->eth_params_n.remote_portd
};
AssertFatal(proto_agent_start(instance, ¶ms) == 0,
"could not start PROTO_AGENT for F1U on instance %ld!\n", instance);
@@ -160,13 +165,13 @@ void *F1AP_DU_task(void *arg) {
&F1AP_SETUP_REQ(received_msg));
break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE:
- DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
+ DU_send_gNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_ACKNOWLEDGE(received_msg));
- break;
+ break;
case F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE:
- DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
+ DU_send_gNB_CU_CONFIGURATION_UPDATE_FAILURE(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_GNB_CU_CONFIGURATION_UPDATE_FAILURE(received_msg));
- break;
+ break;
case SCTP_NEW_ASSOCIATION_RESP:
// 1. store the respon
@@ -190,14 +195,13 @@ void *F1AP_DU_task(void *arg) {
DU_send_INITIAL_UL_RRC_MESSAGE_TRANSFER(0,0,0,msg->crnti,
msg->rrc_container,
msg->rrc_container_length,
- msg->du2cu_rrc_container,
- msg->du2cu_rrc_container_length
- );
+ (const int8_t*)msg->du2cu_rrc_container,
+ msg->du2cu_rrc_container_length);
break;
case F1AP_UL_RRC_MESSAGE: // to rrc
LOG_I(F1AP, "DU Task Received F1AP_UL_RRC_MESSAGE\n");
- if (RC.nrrrc[0]->node_type == ngran_gNB_DU) {
+ if (RC.nrrrc && RC.nrrrc[0]->node_type == ngran_gNB_DU) {
DU_send_UL_NR_RRC_MESSAGE_TRANSFER(ITTI_MSG_DESTINATION_INSTANCE(received_msg),
&F1AP_UL_RRC_MESSAGE(received_msg));
} else {
diff --git a/openair2/F1AP/f1ap_du_ue_context_management.c b/openair2/F1AP/f1ap_du_ue_context_management.c
index 51bf7da32d..b79e9feb58 100644
--- a/openair2/F1AP/f1ap_du_ue_context_management.c
+++ b/openair2/F1AP/f1ap_du_ue_context_management.c
@@ -108,22 +108,52 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
f1ap_ue_context_setup_req->cellULConfigured = NULL;
}
- /* CUtoDURRCInformation */
- /* Candidate_SpCell_List */
- /* optional */
- /* DRXCycle */
- /* optional */
- /* ResourceCoordinationTransferContainer */
- /* SCell_ToBeSetup_List */
- /* SRBs_ToBeSetup_List */
- /* DRBs_ToBeSetup_List */
- /* Decode DRBs_ToBeSetup_List */
- if(0) {
+ if (RC.nrrrc) {
+ /* RRCContainer */
F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List, true);
+ F1AP_ProtocolIE_ID_id_RRCContainer, false);
+ if (ie) {
+ /* correct here */
+ f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size);
+ memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
+ } else {
+ LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
+ }
+
+ // AssertFatal(0, "check configuration, send to appropriate handler\n");
+
+ protocol_ctxt_t ctxt;
+ // ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
+ ctxt.rnti = 0x1234;
+ ctxt.module_id = instance;
+ ctxt.instance = instance;
+ ctxt.enb_flag = 1;
+
+ mem_block_t *pdcp_pdu_p = NULL;
+ pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
+ if (pdcp_pdu_p != NULL) {
+ memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
+ memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
+
+ /* for rfsim */
+ du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
+ }
+ } else {
+ /* CUtoDURRCInformation */
+ /* Candidate_SpCell_List */
+ /* optional */
+ /* DRXCycle */
+ /* optional */
+ /* ResourceCoordinationTransferContainer */
+ /* SCell_ToBeSetup_List */
+ /* SRBs_ToBeSetup_List */
+ /* DRBs_ToBeSetup_List */
+ /* Decode DRBs_ToBeSetup_List */
+ F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
+ F1AP_ProtocolIE_ID_id_DRBs_ToBeSetup_List, true);
f1ap_ue_context_setup_req->drbs_to_be_setup_length = ie->value.choice.DRBs_ToBeSetup_List.list.count;
f1ap_ue_context_setup_req->drbs_to_be_setup = calloc(f1ap_ue_context_setup_req->drbs_to_be_setup_length,
- sizeof(f1ap_drb_to_be_setup_t));
+ sizeof(f1ap_drb_to_be_setup_t));
AssertFatal(f1ap_ue_context_setup_req->drbs_to_be_setup,
"could not allocate memory for f1ap_ue_context_setup_req->drbs_to_be_setup\n");
@@ -153,35 +183,7 @@ int DU_handle_UE_CONTEXT_SETUP_REQUEST(instance_t instance,
}
}
}
- /* RRCContainer */
- F1AP_FIND_PROTOCOLIE_BY_ID(F1AP_UEContextSetupRequestIEs_t, ie, container,
- F1AP_ProtocolIE_ID_id_RRCContainer, false);
- if (ie) {
- /* correct here */
- f1ap_ue_context_setup_req->rrc_container = malloc(ie->value.choice.RRCContainer.size);
- memcpy(f1ap_ue_context_setup_req->rrc_container, ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
- } else {
- LOG_E(F1AP, "can't find RRCContainer in UEContextSetupRequestIEs by id %ld \n", F1AP_ProtocolIE_ID_id_RRCContainer);
- }
- // AssertFatal(0, "check configuration, send to appropriate handler\n");
-
- protocol_ctxt_t ctxt;
- // ctxt.rnti = f1ap_get_rnti_by_du_id(&f1ap_du_inst[instance], ie->value.choice.GNB_DU_UE_F1AP_ID);
- ctxt.rnti = 0x1234;
- ctxt.module_id = instance;
- ctxt.instance = instance;
- ctxt.enb_flag = 1;
-
- mem_block_t *pdcp_pdu_p = NULL;
- pdcp_pdu_p = get_free_mem_block(ie->value.choice.RRCContainer.size, __func__);
- if (pdcp_pdu_p != NULL) {
- memset(pdcp_pdu_p->data, 0, ie->value.choice.RRCContainer.size);
- memcpy(&pdcp_pdu_p->data[0], ie->value.choice.RRCContainer.buf, ie->value.choice.RRCContainer.size);
-
- /* for rfsim */
- du_rlc_data_req(&ctxt, 1, 0x00, 1, 1, 0, ie->value.choice.RRCContainer.size, pdcp_pdu_p);
- }
return 0;
}
diff --git a/openair2/F1AP/f1ap_encoder.c b/openair2/F1AP/f1ap_encoder.c
index 1dbfd707c0..6e5f0f4e49 100644
--- a/openair2/F1AP/f1ap_encoder.c
+++ b/openair2/F1AP/f1ap_encoder.c
@@ -33,7 +33,7 @@
#include "f1ap_common.h"
#include "f1ap_encoder.h"
-int asn1_encoder_xer_print = 1;
+int asn1_encoder_xer_print = 0;
/*
static inline int f1ap_encode_initiating(f1ap_message *message,
@@ -84,12 +84,8 @@ int f1ap_encode_pdu(F1AP_F1AP_PDU_t *pdu, uint8_t **buffer, uint32_t *length)
LOG_E(F1AP, "----------------- ASN1 ENCODER PRINT END----------------- \n");
}
- encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer);
-
- if (encoded < 0) {
- LOG_E(F1AP, "Failed to encode F1AP message\n");
- return -1;
- }
+ AssertFatal((encoded = aper_encode_to_new_buffer(&asn_DEF_F1AP_F1AP_PDU, 0, pdu, (void **)buffer))>0,
+ "Failed to encode F1AP message\n");
*length = encoded;
diff --git a/openair2/GNB_APP/MACRLC_nr_paramdef.h b/openair2/GNB_APP/MACRLC_nr_paramdef.h
index 0dcb4829f4..bf8b32f591 100644
--- a/openair2/GNB_APP/MACRLC_nr_paramdef.h
+++ b/openair2/GNB_APP/MACRLC_nr_paramdef.h
@@ -84,10 +84,10 @@
{CONFIG_STRING_MACRLC_LOCAL_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_REMOTE_S_PORTD, NULL, 0, uptr:NULL, defintval:50021, TYPE_UINT, 0}, \
{CONFIG_STRING_MACRLC_ULSCH_MAX_SLOTS_INACTIVITY, "Maximum number of slots before a UE is scheduled ULSCH due to inactivity", 0, uptr:NULL, defintval:200, TYPE_UINT, 0}, \
-{CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
-{CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:150, TYPE_INT, 0}, \
-{CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
-{CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_PUSCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:200, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_PUCCHTARGETSNRX10, NULL, 0, iptr:NULL, defintval:150, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_PUCCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
+{CONFIG_STRING_MACRLC_PUSCHFAILURETHRES, NULL, 0, iptr:NULL, defintval:10, TYPE_INT, 0}, \
}
#define MACRLC_CC_IDX 0
#define MACRLC_TRANSPORT_N_PREFERENCE_IDX 1
diff --git a/openair2/GNB_APP/gnb_app.c b/openair2/GNB_APP/gnb_app.c
index b5c5efa244..66302d056b 100644
--- a/openair2/GNB_APP/gnb_app.c
+++ b/openair2/GNB_APP/gnb_app.c
@@ -135,12 +135,11 @@ static uint32_t gNB_app_register_x2(uint32_t gnb_id_start, uint32_t gnb_id_end)
static void init_pdcp(void) {
if (!NODE_IS_DU(RC.nrrrc[0]->node_type)) {
- // pdcp_layer_init();
- // pdcp_layer_init_for_CU();
+ pdcp_layer_init();
uint32_t pdcp_initmask = (IS_SOFTMODEM_NOS1) ?
(PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT;
if (IS_SOFTMODEM_NOS1) {
- printf("IS_SOFTMODEM_NOS1 option enabled \n");
+ LOG_I(PDCP, "IS_SOFTMODEM_NOS1 option enabled\n");
pdcp_initmask = pdcp_initmask | ENB_NAS_USE_TUN_BIT | SOFTMODEM_NOKRNMOD_BIT;
}
@@ -176,12 +175,11 @@ void *gNB_app_task(void *args_p)
/* for no gcc warnings */
(void)instance;
- int cell_to_activate = 0;
+ int cell_to_activate = 0;
itti_mark_task_ready (TASK_GNB_APP);
LOG_I(PHY, "%s() Task ready initialize structures\n", __FUNCTION__);
-
if (RC.nb_nr_macrlc_inst>0) RCconfig_nr_macrlc();
LOG_I(PHY, "%s() RC.nb_nr_L1_inst:%d\n", __FUNCTION__, RC.nb_nr_L1_inst);
@@ -214,8 +212,8 @@ void *gNB_app_task(void *args_p)
}
/* For the CU case the gNB registration with the AMF might have to take place after the F1 setup, as the PLMN info
- * can originate from the DU. */
- if (AMF_MODE_ENABLED && !NODE_IS_DU(RC.nrrrc[0]->node_type) && !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
+ * can originate from the DU. Add check on whether x2ap is enabled to account for ENDC NSA scenario.*/
+ if ((AMF_MODE_ENABLED || is_x2ap_enabled()) && !NODE_IS_DU(RC.nrrrc[0]->node_type) && !NODE_IS_CU(RC.nrrrc[0]->node_type)) {
/* Try to register each gNB */
//registered_gnb = 0;
__attribute__((unused)) uint32_t register_gnb_pending = gNB_app_register (gnb_id_start, gnb_id_end);
@@ -227,7 +225,6 @@ void *gNB_app_task(void *args_p)
LOG_E(F1AP, "Create task for F1AP CU failed\n");
AssertFatal(1==0,"exiting");
}
- pdcp_layer_init_for_CU();
}
if (NODE_IS_DU(RC.nrrrc[0]->node_type)) {
diff --git a/openair2/GNB_APP/gnb_config.c b/openair2/GNB_APP/gnb_config.c
index a589797f9b..456d7cd6de 100644
--- a/openair2/GNB_APP/gnb_config.c
+++ b/openair2/GNB_APP/gnb_config.c
@@ -35,6 +35,7 @@
#include "assertions.h"
#include "gnb_config.h"
#include "gnb_paramdef.h"
+#include "enb_paramdef.h"
#include "UTIL/OTG/otg.h"
#include "UTIL/OTG/otg_externs.h"
#include "intertask_interface.h"
@@ -726,7 +727,7 @@ void RCconfig_nr_macrlc() {
RC.nrmac[j]->ulsch_max_slots_inactivity = *(MacRLC_ParamList.paramarray[j][MACRLC_ULSCH_MAX_SLOTS_INACTIVITY].uptr);
}// for (j=0;j 0
- printf("No %s configuration found \n", CONFIG_STRING_MACRLC_LIST);
+ LOG_E(PHY,"No %s configuration found\n", CONFIG_STRING_MACRLC_LIST);
// AssertFatal (0,"No " CONFIG_STRING_MACRLC_LIST " configuration found");
}
@@ -1300,13 +1301,14 @@ int RCconfig_NR_NG(MessageDef *msg_p, uint32_t i) {
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv4 = 1;
NGAP_REGISTER_GNB_REQ (msg_p).amf_ip_address[j].ipv6 = 1;
}
-/* not in configuration yet ...
+ /* not in configuration yet ...
if (NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].iptr)
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = NGParamList.paramarray[l][GNB_AMF_BROADCAST_PLMN_INDEX].numelt;
else
NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] = 0;
-*/
+ */
+
AssertFatal(NGAP_REGISTER_GNB_REQ(msg_p).broadcast_plmn_num[l] <= NGAP_REGISTER_GNB_REQ(msg_p).num_plmn,
"List of broadcast PLMN to be sent to AMF can not be longer than actual "
"PLMN list (max %d, but is %d)\n",
@@ -1950,8 +1952,8 @@ int gNB_app_handle_f1ap_setup_resp(f1ap_setup_resp_t *resp) {
du_extract_and_decode_SI(i,
si_ind,
- resp->cells_to_activate[j].SI_container[si_ind],
- resp->cells_to_activate[j].SI_container_length[si_ind]);
+ resp->cells_to_activate[j].SI_container[2+si_ind],
+ resp->cells_to_activate[j].SI_container_length[2+si_ind]);
}
// perform MAC/L1 common configuration
@@ -1985,8 +1987,8 @@ int gNB_app_handle_f1ap_gnb_cu_configuration_update(f1ap_gnb_cu_configuration_up
du_extract_and_decode_SI(i,
si_ind,
- gnb_cu_cfg_update->cells_to_activate[j].SI_container[si_ind],
- gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[si_ind]);
+ gnb_cu_cfg_update->cells_to_activate[j].SI_container[2+si_ind],
+ gnb_cu_cfg_update->cells_to_activate[j].SI_container_length[2+si_ind]);
}
// perform MAC/L1 common configuration
@@ -2084,7 +2086,7 @@ void nr_read_config_and_init(void) {
}
if (NODE_IS_CU(RC.nrrrc[0]->node_type)) {
- pdcp_layer_init_for_CU();
+ pdcp_layer_init();
// nr_DRB_preconfiguration(0x1234);
rrc_init_nr_global_param();
}
diff --git a/openair2/GNB_APP/gnb_config.h b/openair2/GNB_APP/gnb_config.h
index 035a3ce76c..46102e4488 100644
--- a/openair2/GNB_APP/gnb_config.h
+++ b/openair2/GNB_APP/gnb_config.h
@@ -93,7 +93,7 @@ typedef struct ru_config_s {
uint8_t if_compress;
} ru_config_t;
*/
-extern void RCconfig_RU(void);
+extern void NRRCconfig_RU(void);
extern void RCconfig_nr_flexran(void);
extern void RCconfig_NR_L1(void);
extern void RCconfig_nr_macrlc(void);
diff --git a/openair2/LAYER2/MAC/eNB_scheduler.c b/openair2/LAYER2/MAC/eNB_scheduler.c
index ccbff6a5eb..4e063d2207 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler.c
@@ -595,6 +595,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
CC_id = UE_PCCID(module_idP, UE_id);
UE_scheduling_control = &(UE_info->UE_sched_ctrl[UE_id]);
+/* to be merged with MAC_stats.log generation. probably redundant
if (((frameP & 127) == 0) && (subframeP == 0)) {
double total_bler;
if(UE_scheduling_control->pusch_rx_num[CC_id] == 0 && UE_scheduling_control->pusch_rx_error_num[CC_id] == 0) {
@@ -632,7 +633,7 @@ eNB_dlsch_ulsch_scheduler(module_id_t module_idP,
UE_scheduling_control->aperiodic_ri_received[CC_id]
);
}
-
+*/
RC.eNB[module_idP][CC_id]->pusch_stats_bsr[UE_id][(frameP * 10) + subframeP] = -63;
if (UE_id == UE_info->list.head) {
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_RA.c b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
index 3dea211dbc..8a400af1f3 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_RA.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_RA.c
@@ -476,8 +476,8 @@ void generate_Msg2(module_id_t module_idP,
first_rb = 0;
vrb_map[first_rb] = 1;
vrb_map[first_rb + 1] = 1;
- vrb_map[first_rb + 2] = 1;
- vrb_map[first_rb + 3] = 1;
+ //vrb_map[first_rb + 2] = 1;
+ //vrb_map[first_rb + 3] = 1;
memset((void *) dl_config_pdu, 0, sizeof(nfapi_dl_config_request_pdu_t));
dl_config_pdu->pdu_type = NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE;
dl_config_pdu->pdu_size = (uint8_t) (2 + sizeof(nfapi_dl_config_dci_dl_pdu));
@@ -488,12 +488,12 @@ void generate_Msg2(module_id_t module_idP,
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.rnti_type = 2; // RA-RNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.transmission_power = 6000; // equal to RS power
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.harq_process = 0;
- dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 1; // no TPC
+ dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.tpc = 0; // no TPC
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.new_data_indicator_1 = 1;
- dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 0;
+ dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.mcs_1 = 1;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.redundancy_version_1 = 0;
dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.virtual_resource_block_assignment_flag = 0;
- dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
+ dl_config_pdu->dci_dl_pdu.dci_dl_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 2);
// This checks if the above DCI allocation is feasible in current subframe
if (!CCE_allocation_infeasible(module_idP, CC_idP, 0, subframeP,
@@ -512,7 +512,7 @@ void generate_Msg2(module_id_t module_idP,
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.rnti = ra->RA_rnti;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_allocation_type = 2; // format 1A/1B/1D
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.virtual_resource_block_assignment_flag = 0; // localized
- dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 4);
+ dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.resource_block_coding = getRIV(N_RB_DL, first_rb, 2);
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.modulation = 2; //QPSK
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.redundancy_version = 0;
dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.transport_blocks = 1; // first block
@@ -901,7 +901,7 @@ generate_Msg4(module_id_t module_idP,
} // rach_resource_type > 0
else {
// This is normal LTE case
- LOG_I(MAC, "generate_Msg4 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
+ LOG_D(MAC, "generate_Msg4 ra->Msg4_frame SFN/SF: %d.%d, frameP SFN/SF: %d.%d FOR eNB_Mod: %d \n", ra->Msg4_frame, ra->Msg4_subframe, frameP, subframeP, module_idP);
if ((ra->Msg4_frame == frameP) && (ra->Msg4_subframe == subframeP)) {
// Get RRCConnectionSetup for Piggyback
@@ -918,7 +918,7 @@ generate_Msg4(module_id_t module_idP,
module_idP, CC_idP, frameP, subframeP, UE_id, rrc_sdu_length);
// AssertFatal(rrc_sdu_length > 0,
// "[MAC][eNB Scheduler] CCCH not allocated, rrc_sdu_length: %d\n", rrc_sdu_length);
- LOG_I(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n",
+ LOG_D(MAC,"[eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Generating Msg4 with RRC Piggyback (RNTI %x)\n",
module_idP, CC_idP, frameP, subframeP, ra->rnti);
/// Choose first 4 RBs for Msg4, should really check that these are free!
first_rb = 0;
@@ -1086,7 +1086,7 @@ generate_Msg4(module_id_t module_idP,
}
} // CCE Allocation feasible
} else {
- LOG_I(MAC,
+ LOG_D(MAC,
"eNB %d][RAPROC] CC_id %d Frame %d, subframeP %d: Delaying Msg4 for RRC Piggyback (RNTI %x)\n",
module_idP, CC_idP, frameP, subframeP, ra->rnti);
ra->Msg4_subframe ++;
@@ -1289,8 +1289,8 @@ initiate_ra_proc(module_id_t module_idP,
}
LOG_D(MAC,
- "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d\n",
- module_idP, CC_id, frameP, subframeP, preamble_index);
+ "[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d Initiating RA procedure for preamble index %d, timing offset %d\n",
+ module_idP, CC_id, frameP, subframeP, preamble_index, timing_offset);
LOG_D(MAC,
"[eNB %d][RAPROC] CC_id %d Frame %d, Subframe %d PRACH resource type %d\n",
module_idP, CC_id, frameP, subframeP, rach_resource_type);
@@ -1332,6 +1332,9 @@ initiate_ra_proc(module_id_t module_idP,
abort();
case 1 :
+ case 3 :
+ case 4 :
+ case 5 :
offset = 6;
break;
}
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
index b516b04e03..596d978a98 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
@@ -651,7 +651,7 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats->rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
eNB_UE_stats->harq_pid = harq_pid;
eNB_UE_stats->harq_round = round_DL;
-
+ eNB_UE_stats->dlsch_rounds[round_DL&7]++;
if (eNB_UE_stats->rrc_status < RRC_RECONFIGURED) {
ue_sched_ctrl->uplane_inactivity_timer = 0;
}
@@ -792,7 +792,6 @@ schedule_ue_spec(module_id_t module_idP,
// No TX request for retransmission (check if null request for FAPI)
}
- //eNB_UE_stats->dlsch_trials[round]++;
eNB_UE_stats->num_retransmission += 1;
eNB_UE_stats->rbs_used_retx = nb_rb;
eNB_UE_stats->total_rbs_used_retx += nb_rb;
@@ -1065,20 +1064,23 @@ schedule_ue_spec(module_id_t module_idP,
ue_template->pucch_tpc_tx_frame = frameP;
ue_template->pucch_tpc_tx_subframe = subframeP;
- if (snr > target_snr + 4) {
+ if (snr > target_snr + PUCCH_PCHYST) {
tpc = 0; //-1
- } else if (snr < target_snr - 4) {
+ ue_sched_ctrl->pucch_tpc_accumulated[CC_id]--;
+ } else if (snr < target_snr - PUCCH_PCHYST) {
tpc = 2; //+1
+ ue_sched_ctrl->pucch_tpc_accumulated[CC_id]--;
} else {
tpc = 1; //0
}
- LOG_D(MAC, "[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, snr/target snr %d/%d (normal case)\n",
+ LOG_D(MAC, "[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d (accumulated %d), snr/target snr %d/%d (normal case)\n",
module_idP,
frameP,
subframeP,
harq_pid,
tpc,
+ ue_sched_ctrl->pucch_tpc_accumulated[CC_id],
snr,
target_snr);
} // Po_PUCCH has been updated
@@ -1700,9 +1702,9 @@ schedule_ue_spec_br(module_id_t module_idP,
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_frame = frameP;
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe = subframeP;
- if (snr > target_snr + 4) {
+ if (snr > target_snr + PUCCH_PCHYST) {
tpc = 0; //-1
- } else if (snr < target_snr - 4) {
+ } else if (snr < target_snr - PUCCH_PCHYST) {
tpc = 2; //+1
} else {
tpc = 1; //0
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
index 23137b7887..e9f0b807c4 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_fairRR.c
@@ -47,7 +47,7 @@
#include "OCG_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "rlc.h"
-
+#include "common/utils/lte/prach_utils.h"
#include "T.h"
@@ -195,7 +195,7 @@ void dlsch_scheduler_pre_ue_select_fairRR(
// Initialization
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
- dlsch_ue_max_num[CC_id] = (uint16_t)RC.rrc[module_idP]->configuration.radioresourceconfig[CC_id].ue_multiple_max;
+ dlsch_ue_max_num[CC_id] = eNB->ue_multiple_max;
// save origin DL PDU number
DL_req = &eNB->DL_req[CC_id].dl_config_request_body;
saved_dlsch_dci[CC_id] = DL_req->number_pdu;
@@ -1044,48 +1044,6 @@ void dlsch_scheduler_pre_processor_fairRR (module_id_t Mod_id,
}
}
-#ifdef TM5
-
- // This has to be revisited!!!!
- for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
- i1 = 0;
- i2 = 0;
- i3 = 0;
-
- for (j = 0; j < N_RBG[CC_id]; j++) {
- if (MIMO_mode_indicator[CC_id][j] == 2) {
- i1 = i1 + 1;
- } else if (MIMO_mode_indicator[CC_id][j] == 1) {
- i2 = i2 + 1;
- } else if (MIMO_mode_indicator[CC_id][j] == 0) {
- i3 = i3 + 1;
- }
- }
-
- if ((i1 < N_RBG[CC_id]) && (i2 > 0) && (i3 == 0)) {
- PHY_vars_eNB_g[Mod_id][CC_id]->check_for_SUMIMO_transmissions =
- PHY_vars_eNB_g[Mod_id][CC_id]->
- check_for_SUMIMO_transmissions + 1;
- }
-
- if (i3 == N_RBG[CC_id] && i1 == 0 && i2 == 0) {
- PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions =
- PHY_vars_eNB_g[Mod_id][CC_id]->FULL_MUMIMO_transmissions +
- 1;
- }
-
- if((i1 < N_RBG[CC_id]) && (i3 > 0)) {
- PHY_vars_eNB_g[Mod_id][CC_id]->
- check_for_MUMIMO_transmissions + 1;
- }
-
- PHY_vars_eNB_g[Mod_id][CC_id]->check_for_total_transmissions =
- PHY_vars_eNB_g[Mod_id][CC_id]->check_for_total_transmissions +
- 1;
- }
-
-#endif
-
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (i = 0; i < dlsch_ue_select[CC_id].ue_num; i++) {
if(dlsch_ue_select[CC_id].list[i].ue_priority == SCH_DL_MSG2) {
@@ -1154,7 +1112,6 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
// int continue_flag = 0;
int32_t snr, target_snr;
int32_t tpc = 1;
- static int32_t tpc_accumulated = 0;
UE_sched_ctrl_t *ue_sched_ctl;
int mcs;
int i;
@@ -1540,7 +1497,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
subframeP,
S_DL_SCHEDULED,
rnti);
- //eNB_UE_stats->dlsch_trials[round]++;
+ UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[round]++;
UE_info->eNB_UE_stats[CC_id][UE_id].num_retransmission += 1;
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used_retx = nb_rb;
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used_retx += nb_rb;
@@ -1982,6 +1939,7 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
// store stats
eNB->eNB_stats[CC_id].dlsch_bytes_tx+=sdu_length_total;
eNB->eNB_stats[CC_id].dlsch_pdus_tx+=1;
+ UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_rounds[0]++;
UE_info->eNB_UE_stats[CC_id][UE_id].rbs_used = nb_rb;
UE_info->eNB_UE_stats[CC_id][UE_id].total_rbs_used += nb_rb;
UE_info->eNB_UE_stats[CC_id][UE_id].dlsch_mcs1=eNB_UE_stats->dlsch_mcs1;
@@ -2015,19 +1973,19 @@ schedule_ue_spec_fairRR(module_id_t module_idP,
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_frame=frameP;
UE_info->UE_template[CC_id][UE_id].pucch_tpc_tx_subframe=subframeP;
- if (snr > target_snr + 4) {
+ if (snr > target_snr + PUCCH_PCHYST) {
tpc = 0; //-1
- tpc_accumulated--;
- } else if (snr < target_snr - 4) {
+ ue_sched_ctl->pucch_tpc_accumulated[CC_id]--;
+ } else if (snr < target_snr - PUCCH_PCHYST) {
tpc = 2; //+1
- tpc_accumulated++;
+ ue_sched_ctl->pucch_tpc_accumulated[CC_id]++;
} else {
tpc = 1; //0
}
LOG_D(MAC,"[eNB %d] DLSCH scheduler: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, snr/target snr %d/%d\n",
module_idP,frameP, subframeP,harq_pid,tpc,
- tpc_accumulated,snr,target_snr);
+ ue_sched_ctl->pucch_tpc_accumulated[CC_id],snr,target_snr);
} // Po_PUCCH has been updated
else {
tpc = 1; //0
@@ -2245,7 +2203,6 @@ void ulsch_scheduler_pre_ue_select_fairRR(
uint8_t first_ue_id[MAX_NUM_CCs][20];
uint8_t ul_inactivity_num[MAX_NUM_CCs];
uint8_t ul_inactivity_id[MAX_NUM_CCs][20]={{0}};
- // LTE_DL_FRAME_PARMS *frame_parms;
uint8_t ulsch_ue_max_num[MAX_NUM_CCs];
uint16_t saved_ulsch_dci[MAX_NUM_CCs];
rnti_t rnti;
@@ -2263,7 +2220,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
//save ulsch dci number
saved_ulsch_dci[CC_id] = eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body.number_of_dci;
// maximum multiplicity number
- ulsch_ue_max_num[CC_id] =RC.rrc[module_idP]->configuration.radioresourceconfig[CC_id].ue_multiple_max;
+ ulsch_ue_max_num[CC_id] =eNB->ue_multiple_max;
cc_id_flag[CC_id] = 0;
ue_first_num[CC_id] = 0;
ul_inactivity_num[CC_id] = 0;
@@ -2290,6 +2247,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
// UL DCI
HI_DCI0_req = &eNB->HI_DCI0_req[CC_id][subframeP].hi_dci0_request_body;
+
if ( (ulsch_ue_select[CC_id].ue_num >= ulsch_ue_max_num[CC_id]) || (cc_id_flag[CC_id] == 1) ) {
cc_id_flag[CC_id] = 1;
HI_DCI0_req->number_of_dci = saved_ulsch_dci[CC_id];
@@ -2322,6 +2280,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
//round
round = UE_info->UE_sched_ctrl[UE_id].round_UL[CC_id][harq_pid];
+
if ( round > 0 ) {
hi_dci0_pdu = &HI_DCI0_req->hi_dci0_pdu_list[HI_DCI0_req->number_of_dci+HI_DCI0_req->number_of_hi];
format_flag = 2;
@@ -2352,6 +2311,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
UE_info->UE_template[CC_id][UE_id].scheduled_ul_bytes = 0;
}
+
if ( UE_id > last_ulsch_ue_id[CC_id] && ((ulsch_ue_select[CC_id].ue_num+ue_first_num[CC_id]) < ulsch_ue_max_num[CC_id]) ) {
if ( bytes_to_schedule > 0 ) {
first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id;
@@ -2369,9 +2329,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
UE_sched_ctl = &UE_info->UE_sched_ctrl[UE_id];
rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
-
- if ( ((UE_sched_ctl->ul_inactivity_timer>64)&&(UE_sched_ctl->ul_scheduled==0)) ||
- ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) ||
+ if ( ((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) ||
((UE_sched_ctl->cqi_req_timer>64)&&((rrc_status >= RRC_CONNECTED))) ) {
first_ue_id[CC_id][ue_first_num[CC_id]]= UE_id;
first_ue_total[CC_id] [ue_first_num[CC_id]] = 0;
@@ -2482,6 +2440,7 @@ void ulsch_scheduler_pre_ue_select_fairRR(
}
rrc_status = mac_eNB_get_rrc_status(module_idP, rnti);
+
if ( (bytes_to_schedule > 0) || (UE_info->UE_template[CC_id][UE_id].ul_SR > 0) ||
((UE_sched_ctl->ul_inactivity_timer>64)&&(UE_sched_ctl->ul_scheduled==0)) ||
((UE_sched_ctl->ul_inactivity_timer>10)&&(UE_sched_ctl->ul_scheduled==0)&&(rrc_status < RRC_CONNECTED)) ||
@@ -2595,7 +2554,6 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
eNB_MAC_INST *eNB = RC.mac[module_idP];
UE_info_t *UE_info= &eNB->UE_info;
UE_TEMPLATE *UE_template = NULL;
- LTE_DL_FRAME_PARMS *frame_parms = NULL;
uint8_t ue_num_temp;
uint8_t total_rbs=0;
uint8_t average_rbs;
@@ -2617,18 +2575,17 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
// MCS and RB assgin
for ( CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++ ) {
cc = &RC.mac[module_idP]->common_channels[CC_id];
- frame_parms = &(RC.eNB[module_idP][CC_id]->frame_parms);
-
+ int N_RB_UL = to_prb(cc->ul_Bandwidth);
if (cc->tdd_Config) { //TDD
- if (frame_parms->N_RB_UL == 25) {
+ if (N_RB_UL == 25) {
num_pucch_rb = 1;
- } else if (frame_parms->N_RB_UL == 50) {
+ } else if (N_RB_UL == 50) {
num_pucch_rb = 2;
} else {
num_pucch_rb = 3;
}
} else {//FDD
- if (frame_parms->N_RB_UL == 25) {
+ if (N_RB_UL == 25) {
num_pucch_rb = 1;
} else {
num_pucch_rb = 2;
@@ -2653,13 +2610,13 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
continue;
}
- if (first_rb[CC_id] >= frame_parms->N_RB_UL-num_pucch_rb ) {
+ if (first_rb[CC_id] >= N_RB_UL-num_pucch_rb ) {
LOG_W(MAC,"[eNB %d] frame %d subframe %d, UE %d/%x CC %d: dropping, not enough RBs\n",
module_idP,frameP,subframeP,UE_id,UE_RNTI(CC_id,UE_id),CC_id);
break;
}
- total_rbs = frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id];
+ total_rbs = N_RB_UL-num_pucch_rb-first_rb[CC_id];
average_rbs = (int)round((double)total_rbs/(double)ue_num_temp);
if ( average_rbs < 3 ) {
@@ -2727,19 +2684,20 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
UE_info->UE_sched_ctrl[UE_id].pusch_rx_num_old[CC_id] = UE_info->UE_sched_ctrl[UE_id].pusch_rx_num[CC_id];
UE_info->UE_sched_ctrl[UE_id].pusch_rx_error_num_old[CC_id] = UE_info->UE_sched_ctrl[UE_id].pusch_rx_error_num[CC_id];
- if(bler < 0.5) {
- if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] !=0) {
- UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]--;
+ if (eNB->use_mcs_offset == 1) {
+ if(bler < eNB->bler_lower) {
+ if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] !=0) {
+ UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]--;
+ }
}
- }
- if(bler >= 2) {
- UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]++;
- if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] >= 20) {
- UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]=20;
+ if(bler >= eNB->bler_upper) {
+ UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]++;
+ if(UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id] >= 20) {
+ UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id]=20;
+ }
}
}
}
-
snr = UE_info->UE_sched_ctrl[UE_id].pusch_snr_avg[CC_id];
mcs = 20 - UE_info->UE_sched_ctrl[UE_id].mcs_offset[CC_id];
@@ -2758,15 +2716,20 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ul_total_buffer > 0 ) {
rb_table_index = 2;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index]);
- tx_power = (int8_t)(hundred_times_log10_NPRB[rb_table[rb_table_index] - 1] / 100);
+ tx_power= estimate_ue_tx_power(0,tbs*8,rb_table[rb_table_index],0,cc->Ncp,0);
- while ( (tbs < bytes_to_schedule) && (rb_table[rb_table_index]<(frame_parms->N_RB_UL-num_pucch_rb-first_rb[CC_id])) &&
- ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < 32 )) {
- rb_table_index++;
+ while ( (((UE_template->phr_info - tx_power) < 0 ) || (tbs > bytes_to_schedule)) && (mcs > 3) ) {
+ mcs--;
tbs = get_TBS_UL(mcs,rb_table[rb_table_index]);
- tx_power = (int8_t)(hundred_times_log10_NPRB[rb_table[rb_table_index] - 1] / 100);
+ tx_power= estimate_ue_tx_power(0,tbs*8,rb_table[rb_table_index],0,cc->Ncp,0);
}
+ while ( (tbs < bytes_to_schedule) && (rb_table[rb_table_index]<(N_RB_UL-num_pucch_rb-first_rb[CC_id])) &&
+ ((UE_template->phr_info - tx_power) > 0) && (rb_table_index < eNB->max_ul_rb_index )) {
+ rb_table_index++;
+ tbs = get_TBS_UL(mcs,rb_table[rb_table_index]);
+ tx_power= estimate_ue_tx_power(0,tbs*8,rb_table[rb_table_index],0,cc->Ncp,0);
+ }
if ( rb_table[rb_table_index]<3 ) {
rb_table_index=2;
}
@@ -2807,11 +2770,12 @@ void ulsch_scheduler_pre_processor_fairRR(module_id_t module_idP,
UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
} else {
// assigne RBS( 3 RBs)
+/*
first_rb[CC_id] = first_rb[CC_id] + 3;
UE_info->UE_template[CC_id][UE_id].pre_allocated_nb_rb_ul = 3;
UE_info->UE_template[CC_id][UE_id].pre_allocated_rb_table_index_ul = 2;
- UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
- }
+ UE_info->UE_template[CC_id][UE_id].pre_assigned_mcs_ul = 10;
+*/ }
}
} else if ( ulsch_ue_select[CC_id].list[ulsch_ue_num].ue_priority == SCH_UL_INACTIVE ) {
// assigne RBS( 3 RBs)
@@ -2913,12 +2877,10 @@ schedule_ulsch_fairRR(module_id_t module_idP, frame_t frameP,
ULSCH_UE_SELECT ulsch_ue_select[MAX_NUM_CCs];
memset(ulsch_ue_select, 0, sizeof(ulsch_ue_select));
- LTE_DL_FRAME_PARMS *frame_parms ;
for (CC_id=0; CC_idcommon_channels[CC_id];
- frame_parms= &RC.eNB[module_idP][CC_id]->frame_parms;
-
+ int N_RB_UL=to_prb(cc->ul_Bandwidth);
// output of scheduling, the UE numbers in RBs, where it is in the code???
// check if RA (Msg3) is active in this subframeP, if so skip the PRBs used for Msg3
// Msg3 is using 1 PRB so we need to increase first_rb accordingly
@@ -2928,13 +2890,13 @@ schedule_ulsch_fairRR(module_id_t module_idP, frame_t frameP,
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_MSG3;
if (cc->tdd_Config == NULL) {
- if(frame_parms->N_RB_UL == 25) {
+ if(N_RB_UL == 25) {
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1;
} else {
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 2;
}
} else {
- switch(frame_parms->N_RB_UL) {
+ switch(N_RB_UL) {
case 25:
default:
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = 1;
@@ -2958,14 +2920,18 @@ schedule_ulsch_fairRR(module_id_t module_idP, frame_t frameP,
}
//PRACH
- if (is_prach_subframe(frame_parms,sched_frame,sched_subframe)==1) {
+ if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0,
+ cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
+ sched_frame,sched_subframe)==1) {
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].ue_priority = SCH_UL_PRACH;
- ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb = get_prach_prb_offset(
- frame_parms,
- frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex,
- frame_parms->prach_config_common.prach_ConfigInfo.prach_FreqOffset,
- 0,//tdd_mapindex
- frameP); //Nf --> shouldn't it be sched_frame ???
+ ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].start_rb =
+ get_prach_prb_offset(cc->tdd_Config!=NULL ? 1 : 0,
+ cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,
+ to_prb(cc->ul_Bandwidth),
+ cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
+ cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_FreqOffset,
+ 0,
+ sched_frame);
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].nb_rb = 6;
ulsch_ue_select[CC_id].list[ulsch_ue_select[CC_id].ue_num].UE_id = -1;
ulsch_ue_select[CC_id].ue_num++;
@@ -2993,7 +2959,6 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
uint32_t cqi_req,cshift,ndi,tpc;
int32_t snr;
int32_t target_snr=0;
- static int32_t tpc_accumulated=0;
int CC_id,ulsch_ue_num;
int N_RB_UL;
eNB_MAC_INST *eNB = RC.mac[module_idP];
@@ -3012,7 +2977,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
nfapi_hi_dci0_request_pdu_t *hi_dci0_pdu;
nfapi_ul_config_request_body_t *ul_req_tmp;
nfapi_ul_config_ulsch_harq_information *ulsch_harq_information;
- LOG_D(MAC,"entering ulsch preprocesor\n");
+ LOG_D(MAC,"entering ulsch preprocesor for %d.%d\n",sched_frame,sched_subframeP);
ulsch_scheduler_pre_processor_fairRR(module_idP,
frameP,
subframeP,
@@ -3185,12 +3150,12 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
UE_template->pusch_tpc_tx_frame=frameP;
UE_template->pusch_tpc_tx_subframe=subframeP;
- if (snr > target_snr + 4) {
+ if (snr > target_snr + PUSCH_PCHYST) {
tpc = 0; //-1
- tpc_accumulated--;
- } else if (snr < target_snr - 4) {
+ UE_sched_ctrl->pusch_tpc_accumulated[CC_id]--;
+ } else if (snr < target_snr - PUSCH_PCHYST) {
tpc = 2; //+1
- tpc_accumulated++;
+ UE_sched_ctrl->pusch_tpc_accumulated[CC_id]++;
} else {
tpc = 1; //0
}
@@ -3201,7 +3166,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
if (tpc!=1) {
LOG_D(MAC,"[eNB %d] ULSCH schedulerRR: frame %d, subframe %d, harq_pid %d, tpc %d, accumulated %d, snr/target snr %d/%d\n",
module_idP,frameP,subframeP,harq_pid,tpc,
- tpc_accumulated,snr,target_snr);
+ UE_sched_ctrl->pusch_tpc_accumulated[CC_id],snr,target_snr);
}
// new transmission
@@ -3214,6 +3179,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
UE_sched_ctrl->cqi_req_timer);
ndi = 1-UE_template->oldNDI_UL[harq_pid];
UE_template->oldNDI_UL[harq_pid]=ndi;
+ UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_rounds[0]++;
UE_info->eNB_UE_stats[CC_id][UE_id].snr = snr;
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
UE_info->eNB_UE_stats[CC_id][UE_id].ulsch_mcs1=UE_template->pre_assigned_mcs_ul;
@@ -3402,6 +3368,7 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
T_INT(round));
UE_info->eNB_UE_stats[CC_id][UE_id].snr = snr;
UE_info->eNB_UE_stats[CC_id][UE_id].target_snr = target_snr;
+
uint8_t mcs_rv = 0;
if(rvidx_tab[round&3]==1) {
diff --git a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
index 47c27798bf..d4f486f761 100644
--- a/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
+++ b/openair2/LAYER2/MAC/eNB_scheduler_ulsch.c
@@ -57,7 +57,7 @@
#include "flexran_agent_mac.h"
#include
#include |