Commit adcf9e9f authored by Remi Hardy's avatar Remi Hardy

Merge branch 'integration_2020_wk45' into 'develop'

MR902 Nr mac ssb ro ue idcc
- Construction of SSB-RO mapping table on the UE
- RO selection based on SSB index
- RACH preamble selection based on SSB index in a selected RO
- RA-RNTI calculation
  

MR928 nr: add MAC PDU traces for wireshark
- The T tracer macpdu2wireshark has been modified to handle the new traces. The usage is the same as for LTE.  

MR929 RA fixes for NR UE  

MR938 CI: Parse UE TUN interface correctly in S1 mode
- The TUN interface configuration is changed to use program "ip" only. 
- The CI script parsing is changed accordingly: the pipeline will recognize the attempt to bring up the interface of the first UE.

MR933 nr rlc: bugfix 
- ret.next was not set in a particular case
parents 68619cae caa31696
...@@ -45,8 +45,8 @@ gNBs = ...@@ -45,8 +45,8 @@ gNBs =
dl_carrierBandwidth = 106; dl_carrierBandwidth = 106;
#initialDownlinkBWP #initialDownlinkBWP
#genericParameters #genericParameters
# this is RBstart=0,L=50 (275*(L-1))+RBstart # this is RBstart=41,L=24 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 13475; initialDLBWPlocationAndBandwidth = 6366;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialDLBWPsubcarrierSpacing = 1; initialDLBWPsubcarrierSpacing = 1;
...@@ -59,7 +59,7 @@ gNBs = ...@@ -59,7 +59,7 @@ gNBs =
#initialULBWPmappingType #initialULBWPmappingType
#0=typeA,1=typeB #0=typeA,1=typeB
initialDLBWPmappingType_0 = 0; initialDLBWPmappingType_0 = 0;
#this is SS=2,L=3 #this is SS=1,L=13
initialDLBWPstartSymbolAndLength_0 = 40; initialDLBWPstartSymbolAndLength_0 = 40;
initialDLBWPk0_1 = 0; initialDLBWPk0_1 = 0;
...@@ -74,7 +74,7 @@ gNBs = ...@@ -74,7 +74,7 @@ gNBs =
initialDLBWPk0_3 = 0; initialDLBWPk0_3 = 0;
initialDLBWPmappingType_3 = 0; initialDLBWPmappingType_3 = 0;
#this is SS=1,L=4 #this is SS=1,L=5
initialDLBWPstartSymbolAndLength_3 = 57; initialDLBWPstartSymbolAndLength_3 = 57;
#uplinkConfigCommon #uplinkConfigCommon
...@@ -89,7 +89,7 @@ gNBs = ...@@ -89,7 +89,7 @@ gNBs =
pMax = 20; pMax = 20;
#initialUplinkBWP #initialUplinkBWP
#genericParameters #genericParameters
initialULBWPlocationAndBandwidth = 13475; initialULBWPlocationAndBandwidth = 6366;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
initialULBWPsubcarrierSpacing = 1; initialULBWPsubcarrierSpacing = 1;
...@@ -135,8 +135,8 @@ gNBs = ...@@ -135,8 +135,8 @@ gNBs =
initialULBWPmappingType_0 = 1 initialULBWPmappingType_0 = 1
# this is SS=0 L=11 # this is SS=0 L=11
initialULBWPstartSymbolAndLength_0 = 55; initialULBWPstartSymbolAndLength_0 = 55;
initialULBWPk2_1 = 6; initialULBWPk2_1 = 6;
initialULBWPmappingType_1 = 1; initialULBWPmappingType_1 = 1;
# this is SS=0 L=12 # this is SS=0 L=12
initialULBWPstartSymbolAndLength_1 = 69; initialULBWPstartSymbolAndLength_1 = 69;
...@@ -145,7 +145,7 @@ gNBs = ...@@ -145,7 +145,7 @@ gNBs =
initialULBWPmappingType_2 = 1; initialULBWPmappingType_2 = 1;
# this is SS=10 L=4 # this is SS=10 L=4
initialULBWPstartSymbolAndLength_2 = 52; initialULBWPstartSymbolAndLength_2 = 52;
msg3_DeltaPreamble = 1; msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90; p0_NominalWithGrant =-90;
...@@ -249,7 +249,7 @@ RUs = ( ...@@ -249,7 +249,7 @@ RUs = (
eNB_instances = [0]; eNB_instances = [0];
#beamforming 1x4 matrix: #beamforming 1x4 matrix:
bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000]; bf_weights = [0x00007fff, 0x0000, 0x0000, 0x0000];
sdr_addrs = "addr=192.168.10.2,second_addr=192.168.20.2"; sdr_addrs = "addr=192.168.10.2,mgmt_addr=192.168.10.2,second_addr=192.168.20.2";
clock_src = "external"; clock_src = "external";
} }
); );
......
...@@ -470,7 +470,7 @@ function report_test { ...@@ -470,7 +470,7 @@ function report_test {
then then
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG` NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfully configured" $UE_LOG`
else else
NB_UE_TUNNEL_UP=`egrep -c "executing ifconfig oaitun_ue1" $UE_LOG` NB_UE_TUNNEL_UP=`egrep -c "ip link set oaitun_ue1 up" $UE_LOG`
fi fi
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ] if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
then then
...@@ -768,55 +768,47 @@ function report_test { ...@@ -768,55 +768,47 @@ function report_test {
#RA test (--do-ra option) #RA test (--do-ra option)
# Currently disabled #build log files names
# #build log files names RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_test.log
# RA_ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb_ra_test.log RA_UE_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_test.log
# RA_UE_LOG=$ARCHIVES_LOC/ra_check_${TMODE}_${BW}prb_${CN_CONFIG}_ue_ra_test.log if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ]
# if [ -f $RA_ENB_LOG ] && [ -f $RA_UE_LOG ] then
# then #get rid of full path
# #get rid of full path NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
# NAME_ENB=`echo $RA_ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"` NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
# NAME_UE=`echo $RA_UE_LOG | sed -e "s#$ARCHIVES_LOC/##"` echo " <tr>" >> ./test_simulator_results.html
# echo " <tr>" >> ./test_simulator_results.html echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
# echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html echo " <td>Check if RA proc succeeded</td>" >> ./test_simulator_results.html
# echo " <td>Check if RA proc succeeded</td>" >> ./test_simulator_results.html
# #gNB RA check
# #gNB RA check GNB_RECEIVED=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $RA_ENB_LOG`
# GNB_RECEIVED=`egrep -c "received correctly" $RA_ENB_LOG` #UE RA check
# GNB_CONNECTED=`egrep -c "now 5G connected" $RA_ENB_LOG` UE_RA_PROC_OK=`egrep -c "\[RAPROC\] RA procedure succeeded" $RA_UE_LOG`
# #UE RA check
# UE_RA_PROC_OK=`egrep -c "RA procedure succeeded" $RA_UE_LOG`
# if [ $GNB_RECEIVED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ]
# then
# if [ $GNB_RECEIVED -gt 0 ] && [ $GNB_CONNECTED -gt 0 ] && [ $UE_RA_PROC_OK -gt 0 ] echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
# then else
# echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
# else fi
# echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
# fi echo " <td><pre>" >> ./test_simulator_results.html
# if [ $GNB_RECEIVED -gt 0 ]
# echo " <td><pre>" >> ./test_simulator_results.html then
# if [ $GNB_RECEIVED -gt 0 ] echo "<font color = \"blue\">- gNB --> RA received</font>" >> ./test_simulator_results.html
# then else
# echo "<font color = \"blue\">- gNB --> RA received</font>" >> ./test_simulator_results.html echo "<font color = \"red\"><b>- gNB RA NOT RECEIVED</b></font>" >> ./test_simulator_results.html
# else fi
# echo "<font color = \"red\"><b>- gNB RA NOT RECEIVED</b></font>" >> ./test_simulator_results.html if [ $UE_RA_PROC_OK -gt 0 ]
# fi then
# if [ $GNB_CONNECTED -gt 0 ] echo "<font color = \"blue\">- NR UE --> RA procedure succeded</font>" >> ./test_simulator_results.html
# then else
# echo "<font color = \"blue\">- gNB --> 5G connected</font>" >> ./test_simulator_results.html echo "<font color = \"red\"><b>- NR UE RA procedure failed</b></font>" >> ./test_simulator_results.html
# else fi
# echo "<font color = \"red\"><b>- gNB NOT 5G CONNECTED</b></font>" >> ./test_simulator_results.html echo " </pre></td>" >> ./test_simulator_results.html
# fi echo " </tr>" >> ./test_simulator_results.html
# if [ $UE_RA_PROC_OK -gt 0 ] fi
# then
# echo "<font color = \"blue\">- NR UE --> RA procedure succeded</font>" >> ./test_simulator_results.html
# else
# echo "<font color = \"red\"><b>- NR UE RA procedure failed</b></font>" >> ./test_simulator_results.html
# fi
# echo " </pre></td>" >> ./test_simulator_results.html
# echo " </tr>" >> ./test_simulator_results.html
# fi
#SYNC test #SYNC test
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
......
...@@ -281,14 +281,35 @@ function check_ra_result { ...@@ -281,14 +281,35 @@ function check_ra_result {
local LOC_GNB_LOG=$1 local LOC_GNB_LOG=$1
local LOC_UE_LOG=$2 local LOC_UE_LOG=$2
#gNB RA test #if log files exist
echo "Checking gNB Log for RA success" if [ -f $LOC_GNB_LOG ] && [ -f $LOC_UE_LOG ]
egrep "received correctly" $1 then
egrep "now 5G connected" $1
#gNB RA test
#UE RA test #console check
echo 'Checking UE Log for RA success' echo "Checking gNB Log for RA success"
egrep "RA procedure succeeded" $2 egrep "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $1
#script check
local GNB_COMPLETE=`egrep -c "\[RAPROC\] PUSCH with TC_RNTI (.+) received correctly" $1`
#UE RA test
#console check
echo 'Checking UE Log for RA success'
egrep "\[RAPROC\] RA procedure succeeded" $2
#script check
local UE_COMPLETE=`egrep -c "\[RAPROC\] RA procedure succeeded" $2`
#generate status
if [ $GNB_COMPLETE -eq 0 ] || [ $UE_COMPLETE -eq 0 ]
then
RA_STATUS=-1
echo "RA test FAILED, could not find the markers"
fi
#case where log files do not exist
else
echo "RA test log files not present"
RA_STATUS=-1
fi
} }
...@@ -1225,16 +1246,6 @@ function start_rf_sim_gnb { ...@@ -1225,16 +1246,6 @@ function start_rf_sim_gnb {
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
rm $1 rm $1
# For the moment, in RA test, no check and no copy of generated raw files
if [ $LOC_RA_TEST -eq 1 ] # RA test
then
sleep 30
echo "echo \"free -m\"" > $1
echo "free -m" >> $1
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
rm $1
return 0
fi
local i="0" local i="0"
echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
...@@ -1258,7 +1269,9 @@ function start_rf_sim_gnb { ...@@ -1258,7 +1269,9 @@ function start_rf_sim_gnb {
GNB_SYNC=1 GNB_SYNC=1
echo "RF-SIM gNB is sync'ed: waiting for UE(s) to connect" echo "RF-SIM gNB is sync'ed: waiting for UE(s) to connect"
fi fi
if [ $LOC_S1_CONFIGURATION -eq 0 ]
# check noS1 config only outside RA test (as it does not support noS1)
if [ $LOC_S1_CONFIGURATION -eq 0 ] && [ $LOC_RA_TEST -eq 0 ]
then then
echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1 echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
# Checking oaitun_enb1 interface has now an IP address # Checking oaitun_enb1 interface has now an IP address
...@@ -1341,14 +1354,6 @@ function start_rf_sim_nr_ue { ...@@ -1341,14 +1354,6 @@ function start_rf_sim_nr_ue {
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
rm $1 rm $1
# In case of RA test mode, no UE sync check for the moment.
# To be removed later?
if [ $LOC_RA_TEST -eq 1 ] # RA test
then
sleep 30
NR_UE_SYNC=1
return 0
fi
local i="0" local i="0"
echo "egrep -c \"Initial sync: pbch decoded sucessfully\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1 echo "egrep -c \"Initial sync: pbch decoded sucessfully\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
while [ $i -lt 10 ] while [ $i -lt 10 ]
...@@ -1372,11 +1377,13 @@ function start_rf_sim_nr_ue { ...@@ -1372,11 +1377,13 @@ function start_rf_sim_nr_ue {
else else
echo "RF-SIM NR-UE is sync'ed w/ gNB" echo "RF-SIM NR-UE is sync'ed w/ gNB"
fi fi
# Checking oaitun_ue1 interface has now an IP address # Checking oaitun_ue1 interface has now an IP address (only outside RA test)
i="0" if [ $LOC_RA_TEST -eq 0 ]
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1 then
while [ $i -lt 10 ] i="0"
do echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
while [ $i -lt 10 ]
do
sleep 5 sleep 5
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1` CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1`
if [ $CONNECTED -eq 1 ] if [ $CONNECTED -eq 1 ]
...@@ -1385,21 +1392,20 @@ function start_rf_sim_nr_ue { ...@@ -1385,21 +1392,20 @@ function start_rf_sim_nr_ue {
else else
i=$[$i+1] i=$[$i+1]
fi fi
done done
echo "echo \"free -m\"" > $1 echo "echo \"free -m\"" > $1
echo "free -m" >> $1 echo "free -m" >> $1
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1 ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
rm $1 rm $1
if [ $i -lt 50 ] if [ $i -lt 50 ]
then then
NR_UE_SYNC=0 NR_UE_SYNC=0
echo "RF-SIM NR-UE oaitun_ue1 is DOWN or NOT CONFIGURED" echo "RF-SIM NR-UE oaitun_ue1 is DOWN or NOT CONFIGURED"
else else
echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED" echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED"
fi fi
sleep 10 sleep 10
fi
} }
...@@ -2196,10 +2202,11 @@ function run_test_on_vm { ...@@ -2196,10 +2202,11 @@ function run_test_on_vm {
NR_STATUS=0 NR_STATUS=0
######### start of RA TEST loop ######### start of RA TEST loop
while [ $try_cnt -lt 1 ] while [ $try_cnt -lt 10 ] #10 because it hardly succeed within CI
do do
SYNC_STATUS=0 SYNC_STATUS=0
RA_STATUS=0
echo "############################################################" echo "############################################################"
echo "${CN_CONFIG} : Starting the gNB" echo "${CN_CONFIG} : Starting the gNB"
...@@ -2241,71 +2248,25 @@ function run_test_on_vm { ...@@ -2241,71 +2248,25 @@ function run_test_on_vm {
echo "############################################################" echo "############################################################"
# Proper check to be done when RA test is working! # Proper check to be done when RA test is working!
#check_ra_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE check_ra_result $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE
if [ $RA_STATUS -ne 0 ]
try_cnt=$[$try_cnt+1]
########### end RA test
done
sleep 10
try_cnt="0"
######### start of PHY TEST loop
while [ $try_cnt -lt 4 ]
do
#start RA test
SYNC_STATUS=0
PING_STATUS=0
IPERF_STATUS=0
echo "############################################################"
echo "${CN_CONFIG} : Starting the gNB"
echo "############################################################"
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
#last argument = 1 is to enable --do-ra for RA test
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG 1
echo "############################################################"
echo "${CN_CONFIG} : Starting the NR-UE"
echo "############################################################"
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
#last argument = 1 is to enable --do-ra for RA test
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG 1
if [ $NR_UE_SYNC -eq 0 ]
then then
echo "Problem w/ gNB and NR-UE not syncing" echo "RA test NOT OK"
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] try_cnt=$[$try_cnt+1]
continue else
try_cnt=$[$try_cnt+10]
fi fi
done
########### end RA test
sleep 30
echo "############################################################"
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
echo "############################################################"
sleep 20
terminate_enb_ue_basic_sim $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 2
terminate_enb_ue_basic_sim $GNB_VM_CMDS $GNB_VM_IP_ADDR 1
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/tmp/cmake_targets/log/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC
#check RA markers in gNB and NR UE log files
echo "############################################################"
echo "${CN_CONFIG} : Checking RA on gNB / NR-UE"
echo "############################################################"
mv $ARCHIVES_LOC/$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_GNB_LOG_FILE
mv $ARCHIVES_LOC/$CURRENT_NR_UE_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_NR_UE_LOG_FILE
# Proper check to be done when RA test is working!
#check_ra_result $ARCHIVES_LOC/ra_check_$CURRENT_GNB_LOG_FILE $ARCHIVES_LOC/ra_check_$CURRENT_NR_UE_LOG_FILE
######### start of PHY TEST loop
try_cnt="0"
while [ $try_cnt -lt 4 ]
do
#end RA test
sleep 30
SYNC_STATUS=0 SYNC_STATUS=0
PING_STATUS=0 PING_STATUS=0
...@@ -2409,6 +2370,7 @@ function run_test_on_vm { ...@@ -2409,6 +2370,7 @@ function run_test_on_vm {
echo "Checking run status" echo "Checking run status"
echo "############################################################" echo "############################################################"
if [ $RA_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $SYNC_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $PING_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $PING_STATUS -ne 0 ]; then NR_STATUS=-1; fi
if [ $IPERF_STATUS -ne 0 ]; then NR_STATUS=-1; fi if [ $IPERF_STATUS -ne 0 ]; then NR_STATUS=-1; fi
......
...@@ -85,6 +85,10 @@ ID = ENB_PHY_MIB ...@@ -85,6 +85,10 @@ ID = ENB_PHY_MIB
DESC = MIB data DESC = MIB data
GROUP = ALL:PHY:ENB:WIRESHARK GROUP = ALL:PHY:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,frame : int,subframe : buffer,data FORMAT = int,eNB_ID : int,frame : int,subframe : buffer,data
ID = GNB_PHY_MIB
DESC = NR MIB data
GROUP = ALL:PHY:GNB:WIRESHARK
FORMAT = int,gNB_ID : int,frame : int,slot : buffer,data
#MAC logs #MAC logs
ID = ENB_MAC_UE_DL_SDU ID = ENB_MAC_UE_DL_SDU
...@@ -131,6 +135,18 @@ ID = ENB_MAC_UE_DL_RAR_PDU_WITH_DATA ...@@ -131,6 +135,18 @@ ID = ENB_MAC_UE_DL_RAR_PDU_WITH_DATA
DESC = MAC downlink PDU for an UE DESC = MAC downlink PDU for an UE
GROUP = ALL:MAC:ENB:WIRESHARK GROUP = ALL:MAC:ENB:WIRESHARK
FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data FORMAT = int,eNB_ID : int,CC_id : int,rnti : int,frame : int,subframe : int,harq_pid : buffer,data
ID = GNB_MAC_DL_PDU_WITH_DATA
DESC = NR MAC downlink PDU for an UE
GROUP = ALL:MAC:GNB:WIRESHARK
FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data
ID = GNB_MAC_UL_PDU_WITH_DATA
DESC = NR MAC uplink PDU for an UE
GROUP = ALL:MAC:GNB:WIRESHARK
FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data
ID = GNB_MAC_DL_RAR_PDU_WITH_DATA
DESC = NR MAC downlink PDU for RAR
GROUP = ALL:MAC:GNB:WIRESHARK
FORMAT = int,gNB_ID : int,CC_id : int,rnti : int,frame : int,slot : int,harq_pid : buffer,data
#RLC logs #RLC logs
ID = ENB_RLC_DL ID = ENB_RLC_DL
......
This diff is collapsed.
...@@ -101,11 +101,11 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) { ...@@ -101,11 +101,11 @@ static inline uint64_t BIT_STRING_to_uint64(BIT_STRING_t *asn) {
shift = ((asn->size - 1) * 8) - asn->bits_unused; shift = ((asn->size - 1) * 8) - asn->bits_unused;
for (index = 0; index < (asn->size - 1); index++) { for (index = 0; index < (asn->size - 1); index++) {
result |= asn->buf[index] << shift; result |= ((uint64_t)asn->buf[index]) << shift;
shift -= 8; shift -= 8;
} }
result |= asn->buf[index] >> asn->bits_unused; result |= ((uint64_t)asn->buf[index]) >> asn->bits_unused;
return result; return result;
} }
......
...@@ -121,9 +121,11 @@ char toksep[2]; ...@@ -121,9 +121,11 @@ char toksep[2];
case SCHED_RR: case SCHED_RR:
lptr+=sprintf(lptr,"%s ","rt: rr"); lptr+=sprintf(lptr,"%s ","rt: rr");
break; break;
#ifdef SCHED_DEADLINE
case SCHED_DEADLINE: case SCHED_DEADLINE:
lptr+=sprintf(lptr,"%s ","rt: deadline"); lptr+=sprintf(lptr,"%s ","rt: deadline");
break; break;
#endif
default: default:
lptr+=sprintf(lptr,"%s ","????"); lptr+=sprintf(lptr,"%s ","????");
break; break;
......
...@@ -170,6 +170,7 @@ typedef struct { ...@@ -170,6 +170,7 @@ typedef struct {
uint8_t prach_format; uint8_t prach_format;
/// Num RA /// Num RA
uint8_t num_ra; uint8_t num_ra;
uint8_t prach_slot;
uint8_t prach_start_symbol; uint8_t prach_start_symbol;
/// 38.211 (NCS 38.211 6.3.3.1). /// 38.211 (NCS 38.211 6.3.3.1).
uint16_t num_cs; uint16_t num_cs;
...@@ -179,6 +180,8 @@ typedef struct { ...@@ -179,6 +180,8 @@ typedef struct {
uint8_t restricted_set; uint8_t restricted_set;
/// see TS 38.211 (6.3.3.2). /// see TS 38.211 (6.3.3.2).
uint16_t freq_msg1; uint16_t freq_msg1;
// When multiple SSBs per RO is configured, this indicates which one is selected in this RO -> this is used to properly compute the PRACH preamble
uint8_t ssb_nb_in_ro;
// nfapi_nr_ul_beamforming_t beamforming; // nfapi_nr_ul_beamforming_t beamforming;
} fapi_nr_ul_config_prach_pdu; } fapi_nr_ul_config_prach_pdu;
......
...@@ -385,7 +385,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp, ...@@ -385,7 +385,7 @@ int nr_init_frame_parms_ue(NR_DL_FRAME_PARMS *fp,
fp->Lmax = 64; fp->Lmax = 64;
} }
fp->L_ssb = (((uint64_t) config->ssb_table.ssb_mask_list[1].ssb_mask)<<32) | config->ssb_table.ssb_mask_list[1].ssb_mask; fp->L_ssb = (((uint64_t) config->ssb_table.ssb_mask_list[0].ssb_mask)<<32) | config->ssb_table.ssb_mask_list[1].ssb_mask;
fp->N_ssb = 0; fp->N_ssb = 0;
for (int p=0; p<fp->Lmax; p++) for (int p=0; p<fp->Lmax; p++)
......
...@@ -478,7 +478,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -478,7 +478,12 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[UE_id][0]; NR_gNB_ULSCH_t *ulsch = phy_vars_gNB->ulsch[UE_id][0];
NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid]; NR_UL_gNB_HARQ_t *harq_process = ulsch->harq_processes[harq_pid];
if (!harq_process) {
LOG_E(PHY,"ulsch_decoding.c: NULL harq_process pointer\n");
return 1;
}
t_nrLDPC_dec_params decParams; t_nrLDPC_dec_params decParams;
t_nrLDPC_dec_params* p_decParams = &decParams; t_nrLDPC_dec_params* p_decParams = &decParams;
...@@ -488,11 +493,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB, ...@@ -488,11 +493,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
phy_vars_gNB->nbDecode = 0; phy_vars_gNB->nbDecode = 0;
harq_process->processedSegments = 0; harq_process->processedSegments = 0;
if (!harq_process) {
LOG_E(PHY,"ulsch_decoding.c: NULL harq_process pointer\n");
return 1;
}
double Coderate = 0.0; double Coderate = 0.0;
// ------------------------------------------------------------------ // ------------------------------------------------------------------
......
...@@ -71,7 +71,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -71,7 +71,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
int16_t Ncp = 0, amp, *prach, *prach2, *prachF, *Xu; int16_t Ncp = 0, amp, *prach, *prach2, *prachF, *Xu;
int32_t Xu_re, Xu_im; int32_t Xu_re, Xu_im;
int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, n_ra_prb, k; int prach_start, prach_sequence_length, i, prach_len, dftlen, mu, kbar, K, n_ra_prb, k, prachStartSymbol, sample_offset_slot;
//int restricted_Type; //int restricted_Type;
prach = prach_tmp; prach = prach_tmp;
...@@ -94,7 +94,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -94,7 +94,7 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
kbar = 1; kbar = 1;
K = 24; K = 24;
k = 12*n_ra_prb - 6*fp->N_RB_UL; k = 12*n_ra_prb - 6*fp->N_RB_UL;
//prachStartSymbol = prach_config_pdu->prach_start_symbol prachStartSymbol = prach_pdu->prach_start_symbol;
//restricted_Type = 0; //restricted_Type = 0;
compute_nr_prach_seq(nrUE_config->prach_config.prach_sequence_length, compute_nr_prach_seq(nrUE_config->prach_config.prach_sequence_length,
...@@ -102,7 +102,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){ ...@@ -102,7 +102,8 @@ int32_t generate_nr_prach(PHY_VARS_NR_UE *ue, uint8_t gNB_id, uint8_t slot){
nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index, nrUE_config->prach_config.num_prach_fd_occasions_list[fd_occasion].prach_root_sequence_index,
ue->X_u); ue->X_u);
prach_start = fp->get_samples_slot_timestamp(slot, fp, 0); sample_offset_slot = (prachStartSymbol==0?0:fp->ofdm_symbol_size*prachStartSymbol+fp->nb_prefix_samples0+fp->nb_prefix_samples*(prachStartSymbol-1));
prach_start = fp->get_samples_slot_timestamp(slot, fp, 0) + sample_offset_slot;
// First compute physical root sequence // First compute physical root sequence
/************************************************************************ /************************************************************************
......
...@@ -113,7 +113,15 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) { ...@@ -113,7 +113,15 @@ void nr_common_signal_procedures (PHY_VARS_gNB *gNB,int frame, int slot) {
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[n_hf][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
else else
nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp); nr_generate_pbch_dmrs(gNB->nr_gold_pbch_dmrs[0][ssb_index&7],&txdataF[0][txdataF_offset], AMP, ssb_start_symbol, cfg, fp);
if (T_ACTIVE(T_GNB_PHY_MIB)) {
unsigned char bch[3];
bch[0] = gNB->ssb_pdu.ssb_pdu_rel15.bchPayload & 0xff;
bch[1] = (gNB->ssb_pdu.ssb_pdu_rel15.bchPayload >> 8) & 0xff;
bch[2] = (gNB->ssb_pdu.ssb_pdu_rel15.bchPayload >> 16) & 0xff;
T(T_GNB_PHY_MIB, T_INT(0) /* module ID */, T_INT(frame), T_INT(slot), T_BUFFER(bch, 3));
}
nr_generate_pbch(&gNB->pbch, nr_generate_pbch(&gNB->pbch,
&gNB->ssb_pdu, &gNB->ssb_pdu,
gNB->nr_pbch_interleaver, gNB->nr_pbch_interleaver,
......
...@@ -218,7 +218,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue, ...@@ -218,7 +218,7 @@ void phy_procedures_nrUE_TX(PHY_VARS_NR_UE *ue,
/* RACH */ /* RACH */
if (get_softmodem_params()->do_ra==1) { if (get_softmodem_params()->do_ra==1) {
if ((ue->UE_mode[gNB_id] < PUSCH) && (ue->prach_vars[gNB_id]->prach_Config_enabled == 1)) { if ((ue->UE_mode[gNB_id] > NOT_SYNCHED && ue->UE_mode[gNB_id] < PUSCH) && (ue->prach_vars[gNB_id]->prach_Config_enabled == 1)) {
nr_ue_prach_procedures(ue, proc, gNB_id, mode); nr_ue_prach_procedures(ue, proc, gNB_id, mode);
} }
} }
...@@ -896,6 +896,9 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -896,6 +896,9 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
int *dlsch_errors, int *dlsch_errors,
runmode_t mode) { runmode_t mode) {
if (dlsch0==NULL)
AssertFatal(0,"dlsch0 should be defined at this level \n");
int harq_pid = dlsch0->current_harq_pid; int harq_pid = dlsch0->current_harq_pid;
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
int nr_tti_rx = proc->nr_tti_rx; int nr_tti_rx = proc->nr_tti_rx;
...@@ -923,9 +926,6 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -923,9 +926,6 @@ void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
uint16_t bw_scaling, start_symbol; uint16_t bw_scaling, start_symbol;
float tc_factor; float tc_factor;
if (dlsch0==NULL)
AssertFatal(0,"dlsch0 should be defined at this level \n");
is_cw0_active = dlsch0->harq_processes[harq_pid]->status; is_cw0_active = dlsch0->harq_processes[harq_pid]->status;
nb_symb_sch = dlsch0->harq_processes[harq_pid]->nb_symbols; nb_symb_sch = dlsch0->harq_processes[harq_pid]->nb_symbols;
start_symbol = dlsch0->harq_processes[harq_pid]->start_symbol; start_symbol = dlsch0->harq_processes[harq_pid]->start_symbol;
...@@ -1354,9 +1354,9 @@ void *UE_thread_slot1_dl_processing(void *arg) { ...@@ -1354,9 +1354,9 @@ void *UE_thread_slot1_dl_processing(void *arg) {
CPU_ZERO(&cpuset); CPU_ZERO(&cpuset);
if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.slot1_proc_one != -1 ) if ( (proc->sub_frame_start+1)%RX_NB_TH == 0 && threads.slot1_proc_one != -1 )
CPU_SET(threads.slot1_proc_one, &cpuset); CPU_SET(threads.slot1_proc_one, &cpuset);
if ( (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.slot1_proc_two != -1 ) if ( RX_NB_TH > 1 && (proc->sub_frame_start+1)%RX_NB_TH == 1 && threads.slot1_proc_two != -1 )
CPU_SET(threads.slot1_proc_two, &cpuset); CPU_SET(threads.slot1_proc_two, &cpuset);
if ( (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.slot1_proc_three != -1 ) if ( RX_NB_TH > 2 && (proc->sub_frame_start+1)%RX_NB_TH == 2 && threads.slot1_proc_three != -1 )
CPU_SET(threads.slot1_proc_three, &cpuset); CPU_SET(threads.slot1_proc_three, &cpuset);
init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset, init_thread(900000,1000000 , FIFO_PRIORITY-1, &cpuset,
...@@ -1823,24 +1823,48 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1823,24 +1823,48 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if ((ue->dlsch_SI[gNB_id]) && (ue->dlsch_SI[gNB_id]->active == 1)) { if ((ue->dlsch_SI[gNB_id]) && (ue->dlsch_SI[gNB_id]->active == 1)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
gNB_id, gNB_id,
SI_PDSCH, SI_PDSCH,
ue->dlsch_SI[gNB_id], ue->dlsch_SI[gNB_id],
NULL); NULL);
nr_ue_dlsch_procedures(ue,
proc,
gNB_id,
SI_PDSCH,
ue->dlsch_SI[gNB_id],
NULL,
&ue->dlsch_SI_errors[gNB_id],
mode);
// deactivate dlsch once dlsch proc is done
ue->dlsch_SI[gNB_id]->active = 0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_SI, VCD_FUNCTION_OUT);
} }
// do procedures for SI-RNTI // do procedures for P-RNTI
if ((ue->dlsch_p[gNB_id]) && (ue->dlsch_p[gNB_id]->active == 1)) { if ((ue->dlsch_p[gNB_id]) && (ue->dlsch_p[gNB_id]->active == 1)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
gNB_id, gNB_id,
P_PDSCH, P_PDSCH,
ue->dlsch_p[gNB_id], ue->dlsch_p[gNB_id],
NULL); NULL);
nr_ue_dlsch_procedures(ue,
proc,
gNB_id,
P_PDSCH,
ue->dlsch_p[gNB_id],
NULL,
&ue->dlsch_p_errors[gNB_id],
mode);
// deactivate dlsch once dlsch proc is done
ue->dlsch_p[gNB_id]->active = 0;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_P, VCD_FUNCTION_OUT);
} }
...@@ -1849,15 +1873,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1849,15 +1873,11 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
if ((ue->dlsch_ra[gNB_id]) && (ue->dlsch_ra[gNB_id]->active == 1)) { if ((ue->dlsch_ra[gNB_id]) && (ue->dlsch_ra[gNB_id]->active == 1)) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_IN);
nr_ue_pdsch_procedures(ue, nr_ue_pdsch_procedures(ue,
proc, proc,
gNB_id, gNB_id,
RA_PDSCH, RA_PDSCH,
ue->dlsch_ra[gNB_id], ue->dlsch_ra[gNB_id],
NULL); NULL);
// #if UE_TIMING_TRACE
// start_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[nr_tti_rx]]);
// #endif
nr_ue_dlsch_procedures(ue, nr_ue_dlsch_procedures(ue,
proc, proc,
...@@ -1868,18 +1888,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue, ...@@ -1868,18 +1888,10 @@ int phy_procedures_nrUE_RX(PHY_VARS_NR_UE *ue,
&ue->dlsch_ra_errors[gNB_id], &ue->dlsch_ra_errors[gNB_id],
mode); mode);
// #if UE_TIMING_TRACE // deactivate dlsch once dlsch proc is done
// stop_meas(&ue->dlsch_procedures_stat[ue->current_thread_id[nr_tti_rx]]); ue->dlsch_ra[gNB_id]->active = 0;
#if DISABLE_LOG_X
printf("[SFN %d] Slot1: Pdsch Proc %5.2f\n", nr_tti_rx, ue->pdsch_procedures_stat[ue->current_thread_id[nr_tti_rx]].p_time/(cpuf*1000.0)); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT);
printf("[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n", nr_tti_rx, ue->dlsch_procedures_stat[ue->current_thread_id[ nr_tti_rx]].p_time/(cpuf*1000.0));
#else
LOG_D(PHY, "[SFN %d] Slot1: Pdsch Proc %5.2f\n", nr_tti_rx, ue->pdsch_procedures_stat[ue->current_thread_id[ nr_tti_rx]].p_time/(cpuf*1000.0));
LOG_D(PHY, "[SFN %d] Slot0 Slot1: Dlsch Proc %5.2f\n", nr_tti_rx, ue->dlsch_procedures_stat[ue->current_thread_id[ nr_tti_rx]].p_time/(cpuf*1000.0));
#endif
// #endif
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PDSCH_PROC_RA, VCD_FUNCTION_OUT);
} }
// do procedures for C-RNTI // do procedures for C-RNTI
...@@ -1946,71 +1958,8 @@ start_meas(&ue->generic_stat); ...@@ -1946,71 +1958,8 @@ start_meas(&ue->generic_stat);
} }
#endif #endif
// do procedures for SI-RNTI
if ((ue->dlsch_SI[gNB_id]) && (ue->dlsch_SI[gNB_id]->active == 1)) {
nr_ue_pdsch_procedures(ue,
proc,
gNB_id,
SI_PDSCH,
ue->dlsch_SI[gNB_id],
NULL);
/*ue_dlsch_procedures(ue,
proc,
gNB_id,
SI_PDSCH,
ue->dlsch_SI[gNB_id],
NULL,
&ue->dlsch_SI_errors[gNB_id],
mode,
abstraction_flag);
ue->dlsch_SI[gNB_id]->active = 0;*/
}
// do procedures for P-RNTI
if ((ue->dlsch_p[gNB_id]) && (ue->dlsch_p[gNB_id]->active == 1)) {
nr_ue_pdsch_procedures(ue,
proc,
gNB_id,
P_PDSCH,
ue->dlsch_p[gNB_id],
NULL);
/*ue_dlsch_procedures(ue,
proc,
gNB_id,
P_PDSCH,
ue->dlsch_p[gNB_id],
NULL,
&ue->dlsch_p_errors[gNB_id],
mode,
abstraction_flag);*/
ue->dlsch_p[gNB_id]->active = 0;
}
// do procedures for RA-RNTI
if ((ue->dlsch_ra[gNB_id]) && (ue->dlsch_ra[gNB_id]->active == 1)) {
nr_ue_pdsch_procedures(ue,
proc,
gNB_id,
RA_PDSCH,
ue->dlsch_ra[gNB_id],
NULL);
/*ue_dlsch_procedures(ue,
proc,
gNB_id,
RA_PDSCH,
ue->dlsch_ra[gNB_id],
NULL,
&ue->dlsch_ra_errors[gNB_id],
mode,
abstraction_flag);*/
ue->dlsch_ra[gNB_id]->active = 0;
}
// duplicate harq structure // duplicate harq structure
/* /*
uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->current_harq_pid; uint8_t current_harq_pid = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->current_harq_pid;
NR_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *current_harq_processes = ue->dlsch[ue->current_thread_id[nr_tti_rx]][gNB_id][0]->harq_processes[current_harq_pid];
NR_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[next1_thread_id][gNB_id][0]->harq_processes[current_harq_pid]; NR_DL_UE_HARQ_t *harq_processes_dest = ue->dlsch[next1_thread_id][gNB_id][0]->harq_processes[current_harq_pid];
...@@ -2138,6 +2087,11 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -2138,6 +2087,11 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_IN); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_UE_TX_PRACH, VCD_FUNCTION_IN);
if (!prach_resources->init_msg1 && (frame_tx == (ue->prach_resources[gNB_id]->sync_frame + 150) % MAX_FRAME_NUMBER)){
ue->prach_cnt = 0;
prach_resources->init_msg1 = 1;
}
if (ue->mac_enabled == 0){ if (ue->mac_enabled == 0){
// prach_resources->ra_PreambleIndex = preamble_tx; // prach_resources->ra_PreambleIndex = preamble_tx;
prach_resources->ra_TDD_map_index = 0; prach_resources->ra_TDD_map_index = 0;
...@@ -2154,15 +2108,10 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -2154,15 +2108,10 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
ue->ulsch_Msg3_active[i] = 0; ue->ulsch_Msg3_active[i] = 0;
} }
} }
nr_prach = nr_ue_get_rach(ue->prach_resources[gNB_id], mod_id, ue->CC_id, UE_mode, frame_tx, gNB_id, nr_tti_tx); nr_prach = nr_ue_get_rach(ue->prach_resources[gNB_id], &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, UE_mode, frame_tx, gNB_id, nr_tti_tx);
} }
} }
if (!prach_resources->init_msg1 && (frame_tx > ue->prach_resources[gNB_id]->sync_frame + 150)){
ue->prach_cnt = 0;
prach_resources->init_msg1 = 1;
}
if (ue->prach_resources[gNB_id] != NULL && nr_prach == 1 && prach_resources->init_msg1) { if (ue->prach_resources[gNB_id] != NULL && nr_prach == 1 && prach_resources->init_msg1) {
pathloss = get_nr_PL(mod_id, ue->CC_id, gNB_id); pathloss = get_nr_PL(mod_id, ue->CC_id, gNB_id);
......
...@@ -947,6 +947,24 @@ int get_format0(uint8_t index, ...@@ -947,6 +947,24 @@ int get_format0(uint8_t index,
return format; return format;
} }
int64_t *get_prach_config_info(uint32_t pointa,
uint8_t index,
uint8_t unpaired) {
int64_t *prach_config_info_p;
if (pointa > 2016666) { //FR2
prach_config_info_p = table_6_3_3_2_4_prachConfig_Index[index];
}
else { // FR1
if (unpaired)
prach_config_info_p = table_6_3_3_2_3_prachConfig_Index[index];
else
prach_config_info_p = table_6_3_3_2_2_prachConfig_Index[index];
} // FR2 / FR1
return prach_config_info_p;
}
void find_monitoring_periodicity_offset_common(NR_SearchSpace_t *ss, void find_monitoring_periodicity_offset_common(NR_SearchSpace_t *ss,
uint16_t *slot_period, uint16_t *slot_period,
uint16_t *offset) { uint16_t *offset) {
......
...@@ -36,6 +36,36 @@ ...@@ -36,6 +36,36 @@
#include "NR_CellGroupConfig.h" #include "NR_CellGroupConfig.h"
#include "nr_mac.h" #include "nr_mac.h"
// ===============================================
// SSB to RO mapping public defines and structures
// ===============================================
#define MAX_SSB_PER_RO (16) // Maximum number of SSBs that can be mapped to a single RO
#define MAX_TDM (7) // Maximum nb of PRACH occasions TDMed in a slot
#define MAX_FDM (8) // Maximum nb of PRACH occasions FDMed in a slot
// PRACH occasion details
typedef struct prach_occasion_info {
uint8_t start_symbol; // 0 - 13 (14 symbols in a slot)
uint8_t fdm; // 0-7 (possible values of msg1-FDM: 1, 2, 4 or 8)
uint8_t slot; // 0 - 159 (maximum number of slots in a 10ms frame - @ 240kHz)
uint8_t frame; // 0 - 15 (maximum number of frames in a 160ms association pattern)
uint8_t mapped_ssb_idx[MAX_SSB_PER_RO]; // List of mapped SSBs
uint8_t nb_mapped_ssb;
uint16_t format; // RO preamble format
} prach_occasion_info_t;
// PRACH occasion slot details
// A PRACH occasion slot is a series of PRACH occasions in time (symbols) and frequency
typedef struct prach_occasion_slot {
prach_occasion_info_t prach_occasion[MAX_TDM][MAX_FDM]; // Starting symbol of each PRACH occasions in a slot
uint8_t nb_of_prach_occasion_in_time;
uint8_t nb_of_prach_occasion_in_freq;
} prach_occasion_slot_t;
// ========================================
typedef enum { typedef enum {
NR_DL_DCI_FORMAT_1_0 = 0, NR_DL_DCI_FORMAT_1_0 = 0,
NR_DL_DCI_FORMAT_1_1, NR_DL_DCI_FORMAT_1_1,
...@@ -133,6 +163,10 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco ...@@ -133,6 +163,10 @@ int ul_ant_bits(NR_DMRS_UplinkConfig_t *NR_DMRS_UplinkConfig,long transformPreco
int get_format0(uint8_t index, uint8_t unpaired); int get_format0(uint8_t index, uint8_t unpaired);
int64_t *get_prach_config_info(uint32_t pointa,
uint8_t index,
uint8_t unpaired);
uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config); uint16_t get_NCS(uint8_t index, uint16_t format, uint8_t restricted_set_config);
int get_num_dmrs(uint16_t dmrs_mask ); int get_num_dmrs(uint16_t dmrs_mask );
......
...@@ -204,7 +204,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, ...@@ -204,7 +204,7 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
uint16_t band; uint16_t band;
int32_t offset; int32_t offset;
get_band((cfg->carrier_config.dl_frequency)*1000, get_band((uint64_t)(cfg->carrier_config.dl_frequency)*1000,
&band, &band,
&offset, &offset,
&frame_type); &frame_type);
...@@ -243,8 +243,8 @@ void config_common_ue(NR_UE_MAC_INST_t *mac, ...@@ -243,8 +243,8 @@ void config_common_ue(NR_UE_MAC_INST_t *mac,
cfg->ssb_table.ssb_mask_list[0].ssb_mask = 0; cfg->ssb_table.ssb_mask_list[0].ssb_mask = 0;
cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0; cfg->ssb_table.ssb_mask_list[1].ssb_mask = 0;
for (i=0; i<4; i++) { for (i=0; i<4; i++) {
cfg->ssb_table.ssb_mask_list[0].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i+4]<<i*8); cfg->ssb_table.ssb_mask_list[0].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i]<<i*8);
cfg->ssb_table.ssb_mask_list[1].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i]<<i*8); cfg->ssb_table.ssb_mask_list[1].ssb_mask += (scc->ssb_PositionsInBurst->choice.longBitmap.buf[i+4]<<i*8);
} }
break; break;
default: default:
...@@ -433,6 +433,9 @@ int nr_rrc_mac_config_req_ue( ...@@ -433,6 +433,9 @@ int nr_rrc_mac_config_req_ue(
LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti); LOG_I(MAC,"Configuring CRNTI %x\n",mac->crnti);
} }
// Setup the SSB to Rach Occasions mapping according to the config
build_ssb_to_ro_map(mac->scc, mac->phy_config.config_req.cell_config.frame_duplex_type);
/* /*
if(mac_cell_group_configP != NULL){ if(mac_cell_group_configP != NULL){
if(mac_cell_group_configP->drx_Config != NULL ){ if(mac_cell_group_configP->drx_Config != NULL ){
......
...@@ -267,6 +267,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4 ...@@ -267,6 +267,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4
@param nr_tti_tx slot for PRACH transmission @param nr_tti_tx slot for PRACH transmission
@returns indication to generate PRACH to phy */ @returns indication to generate PRACH to phy */
uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
fapi_nr_ul_config_prach_pdu *prach_pdu,
module_id_t mod_id, module_id_t mod_id,
int CC_id, int CC_id,
UE_MODE_t UE_mode, UE_MODE_t UE_mode,
...@@ -278,15 +279,14 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -278,15 +279,14 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
@param module_idP Index of UE instance @param module_idP Index of UE instance
@param CC_id Component Carrier Index @param CC_id Component Carrier Index
@param gNB_index gNB index @param gNB_index gNB index
@param t_id
@param rach_ConfigDedicated @param rach_ConfigDedicated
@returns void */ @returns void */
void nr_get_prach_resources(module_id_t mod_id, void nr_get_prach_resources(module_id_t mod_id,
int CC_id, int CC_id,
uint8_t gNB_id, uint8_t gNB_id,
uint8_t t_id,
uint8_t first_Msg3, uint8_t first_Msg3,
NR_PRACH_RESOURCES_t *prach_resources, NR_PRACH_RESOURCES_t *prach_resources,
fapi_nr_ul_config_prach_pdu *prach_pdu,
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated); NR_RACH_ConfigDedicated_t * rach_ConfigDedicated);
void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id); void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id);
...@@ -305,5 +305,8 @@ void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu, ...@@ -305,5 +305,8 @@ void get_num_re_dmrs(nfapi_nr_ue_pusch_pdu_t *pusch_pdu,
uint8_t *nb_dmrs_re_per_rb, uint8_t *nb_dmrs_re_per_rb,
uint16_t *number_dmrs_symbols); uint16_t *number_dmrs_symbols);
void build_ssb_to_ro_map(NR_ServingCellConfigCommon_t *scc, uint8_t unpaired);
#endif #endif
/** @}*/ /** @}*/
...@@ -274,15 +274,22 @@ uint16_t nr_ue_process_rar(module_id_t mod_id, ...@@ -274,15 +274,22 @@ uint16_t nr_ue_process_rar(module_id_t mod_id,
if (ue_mac->RA_RAPID_found) { if (ue_mac->RA_RAPID_found) {
uint8_t freq_hopping, mcs, Msg3_t_alloc, Msg3_f_alloc; uint8_t freq_hopping, mcs, Msg3_t_alloc, Msg3_f_alloc;
unsigned char tpc_command, csi_req; unsigned char tpc_command;
#ifdef DEBUG_RAR
unsigned char csi_req;
#endif
// TC-RNTI // TC-RNTI
*t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8); *t_crnti = rar->TCRNTI_2 + (rar->TCRNTI_1 << 8);
ue_mac->t_crnti = *t_crnti; ue_mac->t_crnti = *t_crnti;
// TA command // TA command
ta_command = rar->TA2 + (rar->TA1 << 5); ta_command = rar->TA2 + (rar->TA1 << 5);
#ifdef DEBUG_RAR
// CSI // CSI
csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01); csi_req = (unsigned char) (rar->UL_GRANT_4 & 0x01);
#endif
// TPC // TPC
tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07); tpc_command = (unsigned char) ((rar->UL_GRANT_4 >> 1) & 0x07);
switch (tpc_command){ switch (tpc_command){
......
...@@ -128,7 +128,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm ...@@ -128,7 +128,7 @@ void config_common(int Mod_idP, int pdsch_AntennaPorts, NR_ServingCellConfigComm
uint16_t band; uint16_t band;
int32_t offset; int32_t offset;
get_band((cfg->carrier_config.dl_frequency.value)*1000, get_band((uint64_t)(cfg->carrier_config.dl_frequency.value)*1000,
&band, &band,
&offset, &offset,
&frame_type); &frame_type);
......
...@@ -921,6 +921,10 @@ void nr_generate_Msg2(module_id_t module_idP, ...@@ -921,6 +921,10 @@ void nr_generate_Msg2(module_id_t module_idP,
nr_mac->TX_req[CC_id].Slot = slotP; nr_mac->TX_req[CC_id].Slot = slotP;
memcpy((void*)&tx_req->TLVs[0].value.direct[0], (void*)&cc[CC_id].RAR_pdu.payload[0], tx_req->TLVs[0].length); memcpy((void*)&tx_req->TLVs[0].value.direct[0], (void*)&cc[CC_id].RAR_pdu.payload[0], tx_req->TLVs[0].length);
T(T_GNB_MAC_DL_RAR_PDU_WITH_DATA, T_INT(module_idP), T_INT(CC_id),
T_INT(RA_rnti), T_INT(frameP), T_INT(slotP), T_INT(0) /* harq pid, meaningful? */,
T_BUFFER(&cc[CC_id].RAR_pdu.payload[0], tx_req->TLVs[0].length));
/* mark the corresponding RBs as used */ /* mark the corresponding RBs as used */
uint8_t *vrb_map = cc[CC_id].vrb_map; uint8_t *vrb_map = cc[CC_id].vrb_map;
for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++) for (int rb = 0; rb < pdsch_pdu_rel15->rbSize; rb++)
......
...@@ -840,6 +840,9 @@ void nr_schedule_ue_spec(module_id_t module_id, ...@@ -840,6 +840,9 @@ void nr_schedule_ue_spec(module_id_t module_id,
retInfo->mcs = sched_ctrl->mcs; retInfo->mcs = sched_ctrl->mcs;
retInfo->numDmrsCdmGrpsNoData = sched_ctrl->numDmrsCdmGrpsNoData; retInfo->numDmrsCdmGrpsNoData = sched_ctrl->numDmrsCdmGrpsNoData;
T(T_GNB_MAC_DL_PDU_WITH_DATA, T_INT(module_id), T_INT(CC_id), T_INT(rnti),
T_INT(frame), T_INT(slot), T_INT(current_harq_pid), T_BUFFER(buf, TBS));
#if defined(ENABLE_MAC_PAYLOAD_DEBUG) #if defined(ENABLE_MAC_PAYLOAD_DEBUG)
if (frame%100 == 0) { if (frame%100 == 0) {
LOG_I(MAC, LOG_I(MAC,
......
...@@ -324,6 +324,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP, ...@@ -324,6 +324,12 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[0]; NR_RA_t *ra = &gNB_mac->common_channels[CC_idP].ra[0];
if (sduP != NULL) {
T(T_GNB_MAC_UL_PDU_WITH_DATA, T_INT(gnb_mod_idP), T_INT(CC_idP),
T_INT(rntiP), T_INT(frameP), T_INT(slotP), T_INT(-1) /* harq_pid */,
T_BUFFER(sduP, sdu_lenP));
}
// random access pusch with TC-RNTI // random access pusch with TC-RNTI
if (ra->state == WAIT_Msg3) { if (ra->state == WAIT_Msg3) {
if (sduP != NULL) { // if the CRC passed if (sduP != NULL) { // if the CRC passed
......
...@@ -922,6 +922,7 @@ static missing_data_t next_missing(nr_rlc_entity_am_t *entity, ...@@ -922,6 +922,7 @@ static missing_data_t next_missing(nr_rlc_entity_am_t *entity,
*/ */
ret.sn_start = entity->rx_next; ret.sn_start = entity->rx_next;
ret.so_start = 0; ret.so_start = 0;
ret.next = cur;
goto set_end_different_sdu; goto set_end_different_sdu;
} }
} }
......
...@@ -45,7 +45,7 @@ gNBs = ...@@ -45,7 +45,7 @@ gNBs =
dl_carrierBandwidth = 106; dl_carrierBandwidth = 106;
#initialDownlinkBWP #initialDownlinkBWP
#genericParameters #genericParameters
# this is RBstart=0,L=50 (275*(L-1))+RBstart # this is RBstart=41,L=24 (275*(L-1))+RBstart
initialDLBWPlocationAndBandwidth = 6366; initialDLBWPlocationAndBandwidth = 6366;
# subcarrierSpacing # subcarrierSpacing
# 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120 # 0=kHz15, 1=kHz30, 2=kHz60, 3=kHz120
...@@ -74,7 +74,7 @@ gNBs = ...@@ -74,7 +74,7 @@ gNBs =
initialDLBWPk0_3 = 0; initialDLBWPk0_3 = 0;
initialDLBWPmappingType_3 = 0; initialDLBWPmappingType_3 = 0;
#this is SS=1,L=4 #this is SS=1,L=5
initialDLBWPstartSymbolAndLength_3 = 57; initialDLBWPstartSymbolAndLength_3 = 57;
#uplinkConfigCommon #uplinkConfigCommon
...@@ -126,27 +126,26 @@ gNBs = ...@@ -126,27 +126,26 @@ gNBs =
# SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex # SCS for msg1, can only be 15 for 30 kHz < 6 GHz, takes precendence over the one derived from prach-ConfigIndex
# #
msg1_SubcarrierSpacing = 1, msg1_SubcarrierSpacing = 1,
# restrictedSetConfig # restrictedSetConfig
# 0=unrestricted, 1=restricted type A, 2=restricted type B # 0=unrestricted, 1=restricted type A, 2=restricted type B
restrictedSetConfig = 0, restrictedSetConfig = 0,
# pusch-ConfigCommon (up to 16 elements) # pusch-ConfigCommon (up to 16 elements)
initialULBWPk2_0 = 6; initialULBWPk2_0 = 6;
initialULBWPmappingType_0 = 1 initialULBWPmappingType_0 = 1
# this is SS=0 L=11 # this is SS=0 L=11
initialULBWPstartSymbolAndLength_0 = 55; initialULBWPstartSymbolAndLength_0 = 55;
initialULBWPk2_1 = 6; initialULBWPk2_1 = 6;
initialULBWPmappingType_1 = 1; initialULBWPmappingType_1 = 1;
# this is SS=0 L=12 # this is SS=0 L=12
initialULBWPstartSymbolAndLength_1 = 69; initialULBWPstartSymbolAndLength_1 = 69;
initialULBWPk2_2 = 7; initialULBWPk2_2 = 7;
initialULBWPmappingType_2 = 1; initialULBWPmappingType_2 = 1;
# this is SS=10 L=4 # this is SS=10 L=4
initialULBWPstartSymbolAndLength_2 = 52; initialULBWPstartSymbolAndLength_2 = 52;
msg3_DeltaPreamble = 1; msg3_DeltaPreamble = 1;
p0_NominalWithGrant =-90; p0_NominalWithGrant =-90;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment