Merge branch 'develop-nr' into NR_RRCConfiguration
This commit is contained in:
+17
-1
@@ -128,6 +128,7 @@ class SSHConnection():
|
||||
self.Build_eNB_args = ''
|
||||
self.backgroundBuild = False
|
||||
self.backgroundBuildTestId = ['', '', '']
|
||||
self.Build_eNB_forced_workspace_cleanup = False
|
||||
self.Initialize_eNB_args = ''
|
||||
self.air_interface = 'lte'
|
||||
self.eNB_instance = ''
|
||||
@@ -370,9 +371,16 @@ class SSHConnection():
|
||||
self.air_interface = 'nr'
|
||||
else:
|
||||
self.air_interface = 'lte'
|
||||
if self.Build_eNB_forced_workspace_cleanup:
|
||||
self.command('echo ' + lPassWord + ' | sudo -S rm -Rf ' + lSourcePath, '\$', 15)
|
||||
result = re.search('([a-zA-Z0-9\:\-\.\/])+\.git', self.ranRepository)
|
||||
if result is not None:
|
||||
full_ran_repo_name = self.ranRepository
|
||||
else:
|
||||
full_ran_repo_name = self.ranRepository + '.git'
|
||||
self.command('mkdir -p ' + lSourcePath, '\$', 5)
|
||||
self.command('cd ' + lSourcePath, '\$', 5)
|
||||
self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + self.ranRepository + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600)
|
||||
self.command('if [ ! -e .git ]; then stdbuf -o0 git clone ' + full_ran_repo_name + ' .; else stdbuf -o0 git fetch --prune; fi', '\$', 600)
|
||||
# Raphael: here add a check if git clone or git fetch went smoothly
|
||||
self.command('git config user.email "jenkins@openairinterface.org"', '\$', 5)
|
||||
self.command('git config user.name "OAI Jenkins"', '\$', 5)
|
||||
@@ -4158,6 +4166,14 @@ def CheckClassValidity(action,id):
|
||||
def GetParametersFromXML(action):
|
||||
if action == 'Build_eNB':
|
||||
SSH.Build_eNB_args = test.findtext('Build_eNB_args')
|
||||
forced_workspace_cleanup = test.findtext('forced_workspace_cleanup')
|
||||
if (forced_workspace_cleanup is None):
|
||||
SSH.Build_eNB_forced_workspace_cleanup = False
|
||||
else:
|
||||
if re.match('true', forced_workspace_cleanup, re.IGNORECASE):
|
||||
SSH.Build_eNB_forced_workspace_cleanup = True
|
||||
else:
|
||||
SSH.Build_eNB_forced_workspace_cleanup = False
|
||||
SSH.eNB_instance = test.findtext('eNB_instance')
|
||||
if (SSH.eNB_instance is None):
|
||||
SSH.eNB_instance = '0'
|
||||
|
||||
@@ -197,11 +197,15 @@ function variant__v4__cppcheck {
|
||||
}
|
||||
|
||||
function variant__v5__gnb_usrp {
|
||||
VM_MEMORY=8192
|
||||
VM_CPU=8
|
||||
NB_PATTERN_FILES=9
|
||||
BUILD_OPTIONS="--gNB -w USRP"
|
||||
}
|
||||
|
||||
function variant__v6__nr_ue_usrp {
|
||||
VM_MEMORY=4096
|
||||
VM_CPU=4
|
||||
NB_PATTERN_FILES=9
|
||||
BUILD_OPTIONS="--nrUE -w USRP"
|
||||
}
|
||||
@@ -234,8 +238,8 @@ function variant__v20__l1_sim {
|
||||
}
|
||||
|
||||
function variant__v21__rf_sim {
|
||||
ARCHIVES_LOC=rf_sim
|
||||
RUN_OPTIONS="complex"
|
||||
EXPERIMENTAL="true"
|
||||
}
|
||||
|
||||
function variant__v22__l2_sim {
|
||||
|
||||
@@ -97,14 +97,20 @@ function analyzeIperfFiles {
|
||||
FILE_COMPLETE=`egrep -c "Server Report" $IPERF_CASE`
|
||||
if [ $FILE_COMPLETE -eq 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
SERVER_FILE=`echo $IPERF_CASE | sed -e "s#client#server#"`
|
||||
FLOAT_EFF_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; printf "%.0f", br}'`
|
||||
EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}}'`
|
||||
EFFECTIVE_BITRATE=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*Bytes *##" -e "s#sec *.*#sec#" | awk 'BEGIN{s=0;n=0}{n++;if ($2 ~/Mbits/){a = $1 * 1000000};if ($2 ~/Kbits/){a = $1 * 1000};s=s+a}END{br=s/n; if(br>1000000){printf "%.2f MBits/sec", br/1000000}else{printf "%.2f KBits/sec", br/1000}}'`
|
||||
PERF=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.2f", $0}'`
|
||||
PERF_INT=`echo "100 * $FLOAT_EFF_BITRATE / $FLOAT_REQ_BITRATE" | bc -l | awk '{printf "%.0f", $0}'`
|
||||
JITTER=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*/sec *##" -e "s# *ms.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{jitter=s/n; printf "%.3f ms", jitter}'`
|
||||
PACKETLOSS_NOSIGN=`grep --color=never sec $SERVER_FILE | sed -e "s#^.*(##" -e "s#%.*##" | awk 'BEGIN{s=0;n=0}{n++;s+=$1}END{per=s/n; printf "%.1f", per}'`
|
||||
PACKETLOSS=`echo "${PACKETLOSS_NOSIGN}%"`
|
||||
if [[ $PERF_INT -lt 80 ]]
|
||||
then
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
else
|
||||
EFFECTIVE_BITRATE=`tail -n3 $IPERF_CASE | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
|
||||
if [[ $EFFECTIVE_BITRATE =~ .*Kbits/sec.* ]]
|
||||
@@ -394,6 +400,126 @@ function report_test {
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
ARCHIVES_LOC=archives/rf_sim/test
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
echo " <h3>5G NR RF Simulator Check</h3>" >> ./test_simulator_results.html
|
||||
|
||||
if [ -f $ARCHIVES_LOC/test_final_status.log ]
|
||||
then
|
||||
if [ `grep -c TEST_OK $ARCHIVES_LOC/test_final_status.log` -eq 1 ]
|
||||
then
|
||||
echo " <div class=\"alert alert-success\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was SUCCESSFUL <span class=\"glyphicon glyphicon-ok-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
|
||||
echo " <strong>TEST was a FAILURE! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
else
|
||||
echo " <div class=\"alert alert-danger\">" >> ./test_simulator_results.html
|
||||
echo " <strong>COULD NOT DETERMINE TEST FINAL STATUS! <span class=\"glyphicon glyphicon-ban-circle\"></span></strong>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
echo " <button data-toggle=\"collapse\" data-target=\"#oai-rf-sim-test-details\">More details on 5G RF Simulator test results</button>" >> ./test_simulator_results.html
|
||||
echo " <div id=\"oai-rf-sim-test-details\" class=\"collapse\">" >> ./test_simulator_results.html
|
||||
echo " <table border = \"1\">" >> ./test_simulator_results.html
|
||||
echo " <tr bgcolor = \"#33CCFF\" >" >> ./test_simulator_results.html
|
||||
echo " <th>Log File Name</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Command</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Status</th>" >> ./test_simulator_results.html
|
||||
echo " <th>Statistics</th>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
|
||||
EPC_CONFIGS=("noS1")
|
||||
TRANS_MODES=("tdd")
|
||||
BW_CASES=(106)
|
||||
for CN_CONFIG in ${EPC_CONFIGS[@]}
|
||||
do
|
||||
for TMODE in ${TRANS_MODES[@]}
|
||||
do
|
||||
for BW in ${BW_CASES[@]}
|
||||
do
|
||||
echo " <tr bgcolor = \"#8FBC8F\" >" >> ./test_simulator_results.html
|
||||
if [[ $CN_CONFIG =~ .*wS1.* ]]
|
||||
then
|
||||
echo " <td align = \"center\" colspan = 4 >Test with EPC (aka withS1): ${TMODE} -- ${BW}PRB </td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td align = \"center\" colspan = 4 >Test without EPC (aka noS1): ${TMODE} -- ${BW}PRB </td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
ENB_LOG=$ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_gnb.log
|
||||
UE_LOG=`echo $ENB_LOG | sed -e "s#gnb#ue#"`
|
||||
if [ -f $ENB_LOG ] && [ -f $UE_LOG ]
|
||||
then
|
||||
NAME_ENB=`echo $ENB_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
NAME_UE=`echo $UE_LOG | sed -e "s#$ARCHIVES_LOC/##"`
|
||||
echo " <tr>" >> ./test_simulator_results.html
|
||||
echo " <td>$NAME_ENB --- $NAME_UE</td>" >> ./test_simulator_results.html
|
||||
echo " <td>N/A</td>" >> ./test_simulator_results.html
|
||||
NB_ENB_GOT_SYNC=`egrep -c "got sync" $ENB_LOG`
|
||||
NB_ENB_TUNNEL_UP=`egrep -c "Interface oaitun_enb1 successfuly configured" $ENB_LOG`
|
||||
NB_UE_GOT_SYNC=`egrep -c "rfsimulator: Success" $UE_LOG`
|
||||
NB_ENB_SYNCED_WITH_UE=`egrep -c "Initial sync: starting PBCH detection" $UE_LOG`
|
||||
NB_UE_TUNNEL_UP=`egrep -c "Interface oaitun_ue1 successfuly configured" $UE_LOG`
|
||||
if [ $NB_ENB_GOT_SYNC -gt 0 ] && [ $NB_UE_GOT_SYNC -gt 0 ] && [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
|
||||
then
|
||||
echo " <td bgcolor = \"green\" >OK</td>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo " <td bgcolor = \"red\" >KO</td>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " <td><pre>" >> ./test_simulator_results.html
|
||||
if [ $NB_ENB_GOT_SYNC -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- gNB --> got sync</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- gNB NEVER got sync</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_ENB_TUNNEL_UP -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- gNB mounted oaitun_enb1 interface</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- gNB NEVER mounted oaitun_enb1 interface</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_UE_GOT_SYNC -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- NR UE --> got sync</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- NR UE NEVER got sync</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_ENB_SYNCED_WITH_UE -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- NR UE attached to gNB</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- NR UE NEVER attached to eNB</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
if [ $NB_UE_TUNNEL_UP -gt 0 ]
|
||||
then
|
||||
echo "<font color = \"blue\">- NR UE mounted oaitun_ue1 interface</font>" >> ./test_simulator_results.html
|
||||
else
|
||||
echo "<font color = \"red\"><b>- NR UE NEVER mounted oaitun_ue1 interface</b></font>" >> ./test_simulator_results.html
|
||||
fi
|
||||
echo " </pre></td>" >> ./test_simulator_results.html
|
||||
echo " </tr>" >> ./test_simulator_results.html
|
||||
fi
|
||||
#PING_LOGS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_ping*.log 2> /dev/null`
|
||||
#analyzePingFiles
|
||||
|
||||
IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}prb_${CN_CONFIG}_iperf_dl*client*txt 2> /dev/null`
|
||||
analyzeIperfFiles
|
||||
|
||||
#IPERF_TESTS=`ls $ARCHIVES_LOC/${TMODE}_${BW}MHz_${UES}users_${CN_CONFIG}_iperf_ul*client*txt 2> /dev/null`
|
||||
#analyzeIperfFiles
|
||||
done
|
||||
done
|
||||
done
|
||||
|
||||
echo " </table>" >> ./test_simulator_results.html
|
||||
echo " </div>" >> ./test_simulator_results.html
|
||||
fi
|
||||
|
||||
ARCHIVES_LOC=archives/l2_sim/test
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
|
||||
+313
-33
@@ -274,21 +274,30 @@ function generic_iperf {
|
||||
local LOC_BASE_LOG_FILE=$8
|
||||
local LOC_PORT_ID=$[$9+5001]
|
||||
local LOC_FG_OR_BG=${10}
|
||||
# By default the requested bandwidth is in Mbits/sec
|
||||
if [[ $LOC_REQ_BANDWIDTH =~ .*K.* ]]
|
||||
then
|
||||
local IPERF_FORMAT="-fk"
|
||||
local FORMATTED_REQ_BW=$LOC_REQ_BANDWIDTH
|
||||
else
|
||||
local IPERF_FORMAT="-fm"
|
||||
local FORMATTED_REQ_BW=${LOC_REQ_BANDWIDTH}"M"
|
||||
fi
|
||||
# Starting Iperf Server
|
||||
echo "iperf -B ${LOC_ISERVER_BOND_IP} -u -s -i 1 -fm -p ${LOC_PORT_ID}"
|
||||
echo "nohup iperf -B ${LOC_ISERVER_BOND_IP} -u -s -i 1 -fm -p ${LOC_PORT_ID} > ${LOC_BASE_LOG_FILE}_server.txt 2>&1 &" > ${LOC_ISERVER_CMD}
|
||||
echo "iperf -B ${LOC_ISERVER_BOND_IP} -u -s -i 1 ${IPERF_FORMAT} -p ${LOC_PORT_ID}"
|
||||
echo "nohup iperf -B ${LOC_ISERVER_BOND_IP} -u -s -i 1 ${IPERF_FORMAT} -p ${LOC_PORT_ID} > ${LOC_BASE_LOG_FILE}_server.txt 2>&1 &" > ${LOC_ISERVER_CMD}
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@${LOC_ISERVER_IP} < ${LOC_ISERVER_CMD}
|
||||
rm ${LOC_ISERVER_CMD}
|
||||
|
||||
# Starting Iperf Client
|
||||
echo "iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${LOC_REQ_BANDWIDTH}M -i 1 -fm -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID}"
|
||||
echo "echo \"COMMAND IS: iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${LOC_REQ_BANDWIDTH}M -i 1 -fm -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID}\" > ${LOC_BASE_LOG_FILE}_client.txt" > ${LOC_ICLIENT_CMD}
|
||||
echo "iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID}"
|
||||
echo "echo \"COMMAND IS: iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID}\" > ${LOC_BASE_LOG_FILE}_client.txt" > ${LOC_ICLIENT_CMD}
|
||||
if [ $LOC_FG_OR_BG -eq 0 ]
|
||||
then
|
||||
echo "iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${LOC_REQ_BANDWIDTH}M -i 1 -fm -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID} >> ${LOC_BASE_LOG_FILE}_client.txt 2>&1" >> ${LOC_ICLIENT_CMD}
|
||||
echo "iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID} >> ${LOC_BASE_LOG_FILE}_client.txt 2>&1" >> ${LOC_ICLIENT_CMD}
|
||||
echo "tail -3 ${LOC_BASE_LOG_FILE}_client.txt | grep -v datagram" >> ${LOC_ICLIENT_CMD}
|
||||
else
|
||||
echo "nohup iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${LOC_REQ_BANDWIDTH}M -i 1 -fm -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID} >> ${LOC_BASE_LOG_FILE}_client.txt 2>&1 &" >> ${LOC_ICLIENT_CMD}
|
||||
echo "nohup iperf -c ${LOC_ISERVER_BOND_IP} -u -t 30 -b ${FORMATTED_REQ_BW} -i 1 ${IPERF_FORMAT} -B ${LOC_ICLIENT_BOND_IP} -p ${LOC_PORT_ID} >> ${LOC_BASE_LOG_FILE}_client.txt 2>&1 &" >> ${LOC_ICLIENT_CMD}
|
||||
fi
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@${LOC_ICLIENT_IP} < ${LOC_ICLIENT_CMD}
|
||||
rm -f ${LOC_ICLIENT_CMD}
|
||||
@@ -305,19 +314,46 @@ function generic_iperf {
|
||||
|
||||
function check_iperf {
|
||||
local LOC_BASE_LOG=$1
|
||||
local LOC_REQ_BW=$2
|
||||
local LOC_REQ_BW=`echo $2 | sed -e "s#K##"`
|
||||
local LOC_REQ_BW_MINUS_ONE=`echo "$LOC_REQ_BW - 1" | bc -l`
|
||||
local LOC_REQ_BW_MINUS_TWO=`echo "$LOC_REQ_BW - 2" | bc -l`
|
||||
local LOC_REQ_BW_MINUS_THREE=`echo "$LOC_REQ_BW - 3" | bc -l`
|
||||
local LOC_IS_DL=`echo $LOC_BASE_LOG | grep -c _dl`
|
||||
local LOC_IS_BASIC_SIM=`echo $LOC_BASE_LOG | grep -c basic_sim`
|
||||
local LOC_IS_RF_SIM=`echo $LOC_BASE_LOG | grep -c rf_sim`
|
||||
local LOC_IS_NR=`echo $LOC_BASE_LOG | grep -c tdd_106prb`
|
||||
if [ -f ${LOC_BASE_LOG}_client.txt ]
|
||||
then
|
||||
local FILE_COMPLETE=`egrep -c "Server Report" ${LOC_BASE_LOG}_client.txt`
|
||||
if [ $FILE_COMPLETE -eq 0 ]
|
||||
then
|
||||
IPERF_STATUS=-1
|
||||
echo "File Report not found"
|
||||
if [[ $LOC_IS_RF_SIM -eq 1 ]] && [[ $LOC_IS_NR -eq 1 ]]
|
||||
then
|
||||
echo "no UL integration right now --> normal to have no server report"
|
||||
if [ -f ${LOC_BASE_LOG}_server.txt ]
|
||||
then
|
||||
local EFFECTIVE_BANDWIDTH=`tail -n1 ${LOC_BASE_LOG}_server.txt | sed -e "s#^.*MBytes *##" -e "s#^.*KBytes *##" -e "s#sec.*#sec#"`
|
||||
if [[ $2 =~ .*K.* ]]
|
||||
then
|
||||
local BW_SUFFIX="K"
|
||||
else
|
||||
local BW_SUFFIX="M"
|
||||
fi
|
||||
if [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW}.*${BW_SUFFIX}bits.* ]] || [[ $EFFECTIVE_BANDWIDTH =~ .*${LOC_REQ_BW_MINUS_ONE}.*${BW_SUFFIX}bits.* ]]
|
||||
then
|
||||
echo "got requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
else
|
||||
echo "got LESS than requested DL bandwidth: $EFFECTIVE_BANDWIDTH"
|
||||
IPERF_STATUS=-1
|
||||
fi
|
||||
else
|
||||
IPERF_STATUS=-1
|
||||
echo "Server File Report not found"
|
||||
fi
|
||||
else
|
||||
IPERF_STATUS=-1
|
||||
echo "File Report not found"
|
||||
fi
|
||||
else
|
||||
local EFFECTIVE_BANDWIDTH=`tail -n3 ${LOC_BASE_LOG}_client.txt | egrep "Mbits/sec" | sed -e "s#^.*MBytes *##" -e "s#sec.*#sec#"`
|
||||
if [ $LOC_IS_DL -eq 1 ] && [ $LOC_IS_BASIC_SIM -eq 1 ]
|
||||
@@ -351,40 +387,26 @@ function check_iperf {
|
||||
}
|
||||
|
||||
function terminate_enb_ue_basic_sim {
|
||||
# mode = 0 : eNB + UE
|
||||
# mode = 1 : eNB
|
||||
# mode = 2 : UE
|
||||
# mode = 0 : eNB + UE or gNB and NR-UE
|
||||
# mode = 1 : eNB or gNB
|
||||
# mode = 2 : UE or NR-UE
|
||||
local LOC_MODE=$3
|
||||
echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" > $1
|
||||
if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 1 ]
|
||||
then
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo daemon --name=enb_daemon --stop\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo daemon --name=enb_daemon --stop; fi" >> $1
|
||||
fi
|
||||
if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 2 ]
|
||||
then
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo daemon --name=ue_daemon --stop\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo daemon --name=ue_daemon --stop; fi" >> $1
|
||||
fi
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1
|
||||
echo "echo \"ps -aux | grep softmodem\"" >> $1
|
||||
echo "ps -aux | grep softmodem | grep -v grep" >> $1
|
||||
echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" >> $1
|
||||
if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 1 ]
|
||||
then
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGINT lte-softmodem\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGINT lte-softmodem; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall -r --signal SIGINT .*-softmodem\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall -r --signal SIGINT .*-softmodem; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1
|
||||
echo "echo \"ps -aux | grep softmodem\"" >> $1
|
||||
echo "ps -aux | grep softmodem | grep -v grep" >> $1
|
||||
echo "NB_OAI_PROCESSES=\`ps -aux | grep modem | grep -v grep | grep -c softmodem\`" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGKILL lte-softmodem\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGKILL lte-softmodem; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall -r --signal SIGKILL .*-softmodem\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall -r --signal SIGKILL .*-softmodem; fi" >> $1
|
||||
fi
|
||||
if [ $LOC_MODE -eq 0 ] || [ $LOC_MODE -eq 2 ]
|
||||
then
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall --signal SIGKILL lte-uesoftmodem\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall --signal SIGKILL lte-uesoftmodem; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then echo \"sudo killall -r --signal SIGKILL .*-uesoftmodem\"; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sudo killall -r --signal SIGKILL .*-uesoftmodem; fi" >> $1
|
||||
echo "if [ \$NB_OAI_PROCESSES -ne 0 ]; then sleep 5; fi" >> $1
|
||||
fi
|
||||
echo "echo \"ps -aux | grep softmodem\"" >> $1
|
||||
@@ -1075,6 +1097,162 @@ function start_rf_sim_ue {
|
||||
}
|
||||
|
||||
|
||||
function start_rf_sim_gnb {
|
||||
local LOC_GNB_VM_IP_ADDR=$2
|
||||
local LOC_LOG_FILE=$3
|
||||
local LOC_NB_RBS=$4
|
||||
local LOC_CONF_FILE=$5
|
||||
# 1 is with S1 and 0 without S1 aka noS1
|
||||
local LOC_S1_CONFIGURATION=$6
|
||||
echo "cd /home/ubuntu/tmp" > $1
|
||||
echo "echo \"sudo apt-get --yes --quiet install daemon \"" >> $1
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"source oaienv\"" >> $1
|
||||
echo "source oaienv" >> $1
|
||||
echo "cd ci-scripts/conf_files/" >> $1
|
||||
echo "cp $LOC_CONF_FILE ci-$LOC_CONF_FILE" >> $1
|
||||
#echo "sed -i -e 's#N_RB_DL.*=.*;#N_RB_DL = $LOC_NB_RBS;#' -e 's#CI_MME_IP_ADDR#$LOC_EPC_IP_ADDR#' -e 's#CI_ENB_IP_ADDR#$LOC_ENB_VM_IP_ADDR#' -e 's#CI_UE_IP_ADDR#$LOC_UE_VM_IP_ADDR#' ci-$LOC_CONF_FILE" >> $1
|
||||
#echo "echo \"grep N_RB_DL ci-$LOC_CONF_FILE\"" >> $1
|
||||
#echo "grep N_RB_DL ci-$LOC_CONF_FILE | sed -e 's#N_RB_DL.*=#N_RB_DL =#'" >> $1
|
||||
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=server ./nr-softmodem -O /home/ubuntu/tmp/ci-scripts/conf_files/ci-$LOC_CONF_FILE --log_config.global_log_options level,nocolor --parallel-config PARALLEL_SINGLE_THREAD --noS1 --nokrnmod 1 --rfsim\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
echo "cat ./my-nr-softmodem-run.sh" >> $1
|
||||
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
|
||||
echo "sudo -E daemon --inherit --unsafe --name=gnb_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-nr-softmodem-run.sh" >> $1
|
||||
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
|
||||
local i="0"
|
||||
echo "egrep -c \"got sync\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -ne 0 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
GNB_SYNC=0
|
||||
echo "RF-SIM gNB is NOT sync'ed: process still alive?"
|
||||
else
|
||||
GNB_SYNC=1
|
||||
echo "RF-SIM gNB is sync'ed: waiting for UE(s) to connect"
|
||||
fi
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
echo "ifconfig oaitun_enb1 | egrep -c \"inet addr\"" > $1
|
||||
# Checking oaitun_enb1 interface has now an IP address
|
||||
i="0"
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_GNB_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -eq 1 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
sleep 5
|
||||
fi
|
||||
done
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
GNB_SYNC=0
|
||||
echo "RF-SIM gNB oaitun_enb1 is DOWN or NOT CONFIGURED"
|
||||
else
|
||||
echo "RF-SIM gNB oaitun_enb1 is UP and CONFIGURED"
|
||||
fi
|
||||
fi
|
||||
sleep 10
|
||||
}
|
||||
|
||||
function start_rf_sim_nr_ue {
|
||||
local LOC_NR_UE_VM_IP_ADDR=$2
|
||||
local LOC_GNB_VM_IP_ADDR=$3
|
||||
local LOC_LOG_FILE=$4
|
||||
local LOC_PRB=$5
|
||||
local LOC_FREQUENCY=$6
|
||||
# 1 is with S1 and 0 without S1 aka noS1
|
||||
local LOC_S1_CONFIGURATION=$7
|
||||
echo "echo \"sudo apt-get --yes --quiet install daemon \"" > $1
|
||||
echo "sudo apt-get --yes install daemon >> /home/ubuntu/tmp/cmake_targets/log/daemon-install.txt 2>&1" >> $1
|
||||
echo "echo \"cd /home/ubuntu/tmp/cmake_targets/ran_build/build/\"" >> $1
|
||||
echo "sudo chmod 777 /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
echo "cd /home/ubuntu/tmp/cmake_targets/ran_build/build/" >> $1
|
||||
if [ $LOC_S1_CONFIGURATION -eq 0 ]
|
||||
then
|
||||
echo "echo \"RFSIMULATOR=${LOC_GNB_VM_IP_ADDR} ./nr-uesoftmodem --numerology 1 -C ${LOC_FREQUENCY}000000 -r $LOC_PRB --nokrnmod 1 --rfsim --log_config.global_log_options level,nocolor --noS1\" > ./my-nr-softmodem-run.sh " >> $1
|
||||
fi
|
||||
echo "chmod 775 ./my-nr-softmodem-run.sh" >> $1
|
||||
echo "cat ./my-nr-softmodem-run.sh" >> $1
|
||||
echo "if [ -e /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ]; then sudo sudo rm -f /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE; fi" >> $1
|
||||
echo "sudo -E daemon --inherit --unsafe --name=nr_ue_daemon --chdir=/home/ubuntu/tmp/cmake_targets/ran_build/build/ -o /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE ./my-nr-softmodem-run.sh" >> $1
|
||||
|
||||
ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1
|
||||
rm $1
|
||||
|
||||
local i="0"
|
||||
echo "egrep -c \"rfsimulator: Success\" /home/ubuntu/tmp/cmake_targets/log/$LOC_LOG_FILE" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -ne 0 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
NR_UE_SYNC=1
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
NR_UE_SYNC=0
|
||||
echo "RF-SIM NR-UE is NOT sync'ed w/ gNB"
|
||||
return
|
||||
else
|
||||
echo "RF-SIM NR-UE is sync'ed w/ gNB"
|
||||
fi
|
||||
# Checking oaitun_ue1 interface has now an IP address
|
||||
i="0"
|
||||
echo "ifconfig oaitun_ue1 | egrep -c \"inet addr\"" > $1
|
||||
while [ $i -lt 10 ]
|
||||
do
|
||||
sleep 5
|
||||
CONNECTED=`ssh -T -o StrictHostKeyChecking=no ubuntu@$LOC_NR_UE_VM_IP_ADDR < $1`
|
||||
if [ $CONNECTED -eq 1 ]
|
||||
then
|
||||
i="100"
|
||||
else
|
||||
i=$[$i+1]
|
||||
fi
|
||||
done
|
||||
rm $1
|
||||
if [ $i -lt 50 ]
|
||||
then
|
||||
NR_UE_SYNC=0
|
||||
echo "RF-SIM NR-UE oaitun_ue1 is DOWN or NOT CONFIGURED"
|
||||
else
|
||||
echo "RF-SIM NR-UE oaitun_ue1 is UP and CONFIGURED"
|
||||
fi
|
||||
sleep 10
|
||||
}
|
||||
|
||||
|
||||
function run_test_on_vm {
|
||||
echo "############################################################"
|
||||
echo "OAI CI VM script"
|
||||
@@ -1089,6 +1267,14 @@ function run_test_on_vm {
|
||||
UE_VM_CMDS=${UE_VM_NAME}_cmds.txt
|
||||
echo "UE_VM_NAME = $UE_VM_NAME"
|
||||
echo "UE_VM_CMD_FILE = $UE_VM_CMDS"
|
||||
GNB_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#gnb-usrp#" -e "s#rf-sim#gnb-usrp#"`
|
||||
GNB_VM_CMDS=${GNB_VM_NAME}_cmds.txt
|
||||
echo "GNB_VM_NAME = $GNB_VM_NAME"
|
||||
echo "GNB_VM_CMD_FILE = $GNB_VM_CMDS"
|
||||
NR_UE_VM_NAME=`echo $VM_NAME | sed -e "s#l2-sim#nr-ue-usrp#" -e "s#rf-sim#nr-ue-usrp#"`
|
||||
NR_UE_VM_CMDS=${UE_VM_NAME}_cmds.txt
|
||||
echo "NR_UE_VM_NAME = $NR_UE_VM_NAME"
|
||||
echo "NR_UE_VM_CMD_FILE = $NR_UE_VM_CMDS"
|
||||
else
|
||||
echo "VM_NAME = $VM_NAME"
|
||||
echo "VM_CMD_FILE = $VM_CMDS"
|
||||
@@ -1113,6 +1299,22 @@ function run_test_on_vm {
|
||||
|
||||
UE_VM_IP_ADDR=`uvt-kvm ip $UE_VM_NAME`
|
||||
echo "$UE_VM_NAME has for IP addr = $UE_VM_IP_ADDR"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Waiting for GNB VM to be started"
|
||||
echo "############################################################"
|
||||
uvt-kvm wait $GNB_VM_NAME --insecure
|
||||
|
||||
GNB_VM_IP_ADDR=`uvt-kvm ip $GNB_VM_NAME`
|
||||
echo "$GNB_VM_NAME has for IP addr = $GNB_VM_IP_ADDR"
|
||||
|
||||
echo "############################################################"
|
||||
echo "Waiting for NR-UE VM to be started"
|
||||
echo "############################################################"
|
||||
uvt-kvm wait $NR_UE_VM_NAME --insecure
|
||||
|
||||
NR_UE_VM_IP_ADDR=`uvt-kvm ip $NR_UE_VM_NAME`
|
||||
echo "$NR_UE_VM_NAME has for IP addr = $NR_UE_VM_IP_ADDR"
|
||||
else
|
||||
echo "############################################################"
|
||||
echo "Waiting for VM to be started"
|
||||
@@ -1466,7 +1668,7 @@ function run_test_on_vm {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-ru-sim.* ]]
|
||||
then
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
@@ -1666,6 +1868,84 @@ function run_test_on_vm {
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-rf-sim.* ]]
|
||||
then
|
||||
PING_STATUS=0
|
||||
IPERF_STATUS=0
|
||||
if [ -d $ARCHIVES_LOC ]
|
||||
then
|
||||
rm -Rf $ARCHIVES_LOC
|
||||
fi
|
||||
mkdir --parents $ARCHIVES_LOC
|
||||
|
||||
CN_CONFIG="noS1"
|
||||
CONF_FILE=gnb.band78.tm1.106PRB.usrpn300.conf
|
||||
S1_NOS1_CFG=0
|
||||
PRB=106
|
||||
FREQUENCY=3510
|
||||
|
||||
######### start of loop
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the gNB"
|
||||
echo "############################################################"
|
||||
CURRENT_GNB_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_gnb.log
|
||||
start_rf_sim_gnb $GNB_VM_CMDS "$GNB_VM_IP_ADDR" $CURRENT_GNB_LOG_FILE $PRB $CONF_FILE $S1_NOS1_CFG
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Starting the NR-UE"
|
||||
echo "############################################################"
|
||||
CURRENT_NR_UE_LOG_FILE=tdd_${PRB}prb_${CN_CONFIG}_ue.log
|
||||
start_rf_sim_nr_ue $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $GNB_VM_IP_ADDR $CURRENT_NR_UE_LOG_FILE $PRB $FREQUENCY $S1_NOS1_CFG
|
||||
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
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
STATUS=-1
|
||||
return
|
||||
fi
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : iperf DL -- UE is server and eNB is client"
|
||||
echo "############################################################"
|
||||
THROUGHPUT="30K"
|
||||
CURR_IPERF_LOG_BASE=tdd_${PRB}prb_${CN_CONFIG}_iperf_dl
|
||||
get_enb_noS1_ip_addr $GNB_VM_CMDS $GNB_VM_IP_ADDR
|
||||
get_ue_ip_addr $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR 1
|
||||
generic_iperf $NR_UE_VM_CMDS $NR_UE_VM_IP_ADDR $UE_IP_ADDR $GNB_VM_CMDS $GNB_VM_IP_ADDR $ENB_IP_ADDR $THROUGHPUT $CURR_IPERF_LOG_BASE 1 0
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$GNB_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_client.txt $ARCHIVES_LOC
|
||||
scp -o StrictHostKeyChecking=no ubuntu@$NR_UE_VM_IP_ADDR:/home/ubuntu/${CURR_IPERF_LOG_BASE}_server.txt $ARCHIVES_LOC
|
||||
check_iperf $ARCHIVES_LOC/$CURR_IPERF_LOG_BASE $THROUGHPUT
|
||||
|
||||
echo "############################################################"
|
||||
echo "${CN_CONFIG} : Terminate gNB/NR-UE simulators"
|
||||
echo "############################################################"
|
||||
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
|
||||
|
||||
######### end of loop
|
||||
full_l2_sim_destroy
|
||||
|
||||
echo "############################################################"
|
||||
echo "Checking run status"
|
||||
echo "############################################################"
|
||||
|
||||
if [ $PING_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $IPERF_STATUS -ne 0 ]; then STATUS=-1; fi
|
||||
if [ $STATUS -eq 0 ]
|
||||
then
|
||||
echo "TEST_OK" > $ARCHIVES_LOC/test_final_status.log
|
||||
else
|
||||
echo "TEST_KO" > $ARCHIVES_LOC/test_final_status.log
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ "$RUN_OPTIONS" == "complex" ]] && [[ $VM_NAME =~ .*-l2-sim.* ]]
|
||||
then
|
||||
PING_STATUS=0
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
<class>Build_eNB</class>
|
||||
<desc>Build gNB (USRP)</desc>
|
||||
<Build_eNB_args>--gNB -w USRP</Build_eNB_args>
|
||||
<forced_workspace_cleanup>True</forced_workspace_cleanup>
|
||||
</testCase>
|
||||
|
||||
</testCaseList>
|
||||
|
||||
@@ -530,6 +530,7 @@ set (SHLIB_LOADER_SOURCES
|
||||
include_directories("${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/")
|
||||
set(HWLIB_USRP_SOURCE
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib.cpp
|
||||
${OPENAIR_TARGETS}/ARCH/USRP/USERSPACE/LIB/usrp_lib_config.c
|
||||
)
|
||||
add_library(oai_usrpdevif MODULE ${HWLIB_USRP_SOURCE} )
|
||||
target_link_libraries(oai_usrpdevif uhd)
|
||||
|
||||
@@ -386,13 +386,12 @@ int config_setdefault_string(paramdef_t *cfgoptions, char *prefix) {
|
||||
status=1;
|
||||
|
||||
if (cfgoptions->numelt == 0 ) {
|
||||
config_check_valptr(cfgoptions, (char **)(cfgoptions->strptr), sizeof(char *));
|
||||
config_check_valptr(cfgoptions, cfgoptions->strptr, strlen(cfgoptions->defstrval)+1);
|
||||
sprintf(*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, *(cfgoptions->strptr));
|
||||
} else {
|
||||
sprintf((char *)*(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (char *)*(cfgoptions->strptr));
|
||||
sprintf((char *)(cfgoptions->strptr), "%s",cfgoptions->defstrval);
|
||||
printf_params("[CONFIG] %s.%s set to default value \"%s\"\n", ((prefix == NULL) ? "" : prefix), cfgoptions->optname, (char *)(cfgoptions->strptr));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2284,6 +2284,9 @@ void RCconfig_RU(void)
|
||||
LOG_E(PHY, "Erroneous RU clock source in the provided configuration file: '%s'\n", *(RUParamList.paramarray[j][RU_SDR_CLK_SRC].strptr));
|
||||
}
|
||||
}
|
||||
else {
|
||||
RC.ru[j]->openair0_cfg.clock_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)) ) {
|
||||
|
||||
@@ -106,7 +106,6 @@ int config_sync_var=-1;
|
||||
#endif
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
static clock_source_t clock_source = internal;
|
||||
static int wait_for_sync = 0;
|
||||
|
||||
unsigned int mmapped_dma=0;
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"wait-for-sync", NULL, PARAMFLAG_BOOL, iptr:&wait_for_sync, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
|
||||
@@ -116,7 +116,7 @@ volatile int start_eNB = 0;
|
||||
volatile int start_UE = 0;
|
||||
volatile int oai_exit = 0;
|
||||
|
||||
static clock_source_t clock_source = internal;
|
||||
static clock_source_t clock_source = unset;
|
||||
int single_thread_flag=1;
|
||||
static double snr_dB=20;
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
{"ulsch-max-errors", CONFIG_HLP_ULMAXE, 0, uptr:&ULSCH_max_consecutive_errors, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"phy-test", CONFIG_HLP_PHYTST, PARAMFLAG_BOOL, iptr:&phy_test, defintval:0, TYPE_INT, 0}, \
|
||||
{"usim-test", CONFIG_HLP_USIM, PARAMFLAG_BOOL, u8ptr:&usim_test, defintval:0, TYPE_UINT8, 0}, \
|
||||
{"external-clock", CONFIG_HLP_EXCCLK, PARAMFLAG_BOOL, uptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"clock-source", CONFIG_HLP_EXCCLK, 0, iptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"single-thread-disable", CONFIG_HLP_NOSNGLT, PARAMFLAG_BOOL, iptr:&single_thread_flag, defintval:1, TYPE_INT, 0}, \
|
||||
{"nr-dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&nr_dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"A" , CONFIG_HLP_TADV, 0, uptr:&timing_advance, defintval:0, TYPE_UINT, 0}, \
|
||||
|
||||
@@ -278,7 +278,7 @@ int nr_dlsch_encoding(unsigned char *a,
|
||||
|
||||
unsigned int G;
|
||||
unsigned int crc=1;
|
||||
uint8_t harq_pid = dlsch->harq_ids[frame&2][slot];
|
||||
uint8_t harq_pid = dlsch->harq_ids[frame%2][slot];
|
||||
AssertFatal(harq_pid<8 && harq_pid>=0,"illegal harq_pid %d\b",harq_pid);
|
||||
nfapi_nr_dl_tti_pdsch_pdu_rel15_t *rel15 = &dlsch->harq_processes[harq_pid]->pdsch_pdu.pdsch_pdu_rel15;
|
||||
uint16_t nb_rb = rel15->rbSize;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include "PHY/defs_gNB.h"
|
||||
|
||||
void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch);
|
||||
void free_gNB_ulsch(NR_gNB_ULSCH_t **ulsch);
|
||||
|
||||
NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8_t abstraction_flag);
|
||||
|
||||
|
||||
@@ -58,10 +58,9 @@ static uint64_t nb_error_decod =0;
|
||||
|
||||
//extern double cpuf;
|
||||
|
||||
void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
{
|
||||
|
||||
void free_gNB_ulsch(NR_gNB_ULSCH_t **ulschptr) {
|
||||
int i,r;
|
||||
NR_gNB_ULSCH_t *ulsch = *ulschptr;
|
||||
|
||||
if (ulsch) {
|
||||
for (i=0; i<NR_MAX_ULSCH_HARQ_PROCESSES; i++) {
|
||||
@@ -92,7 +91,7 @@ void free_gNB_ulsch(NR_gNB_ULSCH_t *ulsch)
|
||||
}
|
||||
}
|
||||
free16(ulsch,sizeof(NR_gNB_ULSCH_t));
|
||||
ulsch = NULL;
|
||||
*ulschptr = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,8 +167,7 @@ NR_gNB_ULSCH_t *new_gNB_ulsch(uint8_t max_ldpc_iterations,uint8_t N_RB_UL, uint8
|
||||
}
|
||||
|
||||
printf("new_gNB_ulsch with size %zu: exit_flag = %u\n",sizeof(NR_UL_gNB_HARQ_t), exit_flag);
|
||||
free_gNB_ulsch(ulsch);
|
||||
|
||||
free_gNB_ulsch(&ulsch);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -307,6 +305,10 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
t_nrLDPC_dec_params* p_decParams = &decParams;
|
||||
t_nrLDPC_time_stats procTime;
|
||||
t_nrLDPC_time_stats* p_procTime = &procTime ;
|
||||
if (!harq_process) {
|
||||
printf("ulsch_decoding.c: NULL harq_process pointer\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
t_nrLDPC_procBuf** p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
|
||||
|
||||
int16_t z [68*384];
|
||||
@@ -338,11 +340,6 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
if (!harq_process) {
|
||||
printf("ulsch_decoding.c: NULL harq_process pointer\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
if (!frame_parms) {
|
||||
printf("ulsch_decoding.c: NULL frame_parms pointer\n");
|
||||
return (ulsch->max_ldpc_iterations + 1);
|
||||
@@ -531,7 +528,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
||||
}
|
||||
|
||||
printf("decoder input(segment %d) :",r);
|
||||
printf("decoder input(segment %u) :",r);
|
||||
int i;
|
||||
for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
printf("%d : %d\n",i,harq_process->d[r][i]);
|
||||
@@ -620,7 +617,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
//printf("output decoder %d %d %d %d %d \n", harq_process->c[r][0], harq_process->c[r][1], harq_process->c[r][2],harq_process->c[r][3], harq_process->c[r][4]);
|
||||
for (int k=0;k<A>>3;k++)
|
||||
printf("output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
|
||||
printf("no_iterations_ldpc %d (ret %d)\n",no_iteration_ldpc,ret);
|
||||
printf("no_iterations_ldpc %d (ret %u)\n",no_iteration_ldpc,ret);
|
||||
//write_output("dec_output.m","dec0",harq_process->c[0],Kr_bytes,1,4);
|
||||
#endif
|
||||
|
||||
@@ -708,7 +705,7 @@ uint32_t nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
|
||||
#ifdef DEBUG_ULSCH_DECODING
|
||||
printf("Segment %d : Kr= %d bytes\n",r,Kr_bytes);
|
||||
printf("Segment %u : Kr= %u bytes\n",r,Kr_bytes);
|
||||
printf("copied %d bytes to b sequence (harq_pid %d)\n",
|
||||
(Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)),harq_pid);
|
||||
printf("b[0] = %x,c[%d] = %x\n",
|
||||
|
||||
@@ -56,11 +56,11 @@ notifiedFIFO_elt_t *msgToPush;
|
||||
|
||||
//extern double cpuf;
|
||||
|
||||
void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch)
|
||||
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlschptr)
|
||||
{
|
||||
|
||||
int i,r;
|
||||
|
||||
NR_UE_DLSCH_t *dlsch=*dlschptr;
|
||||
if (dlsch) {
|
||||
for (i=0; i<dlsch->Mdlharq; i++) {
|
||||
if (dlsch->harq_processes[i]) {
|
||||
@@ -175,7 +175,7 @@ NR_UE_DLSCH_t *new_nr_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint
|
||||
}
|
||||
|
||||
printf("new_ue_dlsch with size %zu: exit_flag = %u\n",sizeof(NR_DL_UE_HARQ_t), exit_flag);
|
||||
free_nr_ue_dlsch(dlsch);
|
||||
free_nr_ue_dlsch(&dlsch);
|
||||
|
||||
return(NULL);
|
||||
}
|
||||
@@ -232,6 +232,11 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
t_nrLDPC_dec_params* p_decParams = &decParams;
|
||||
t_nrLDPC_time_stats procTime;
|
||||
t_nrLDPC_time_stats* p_procTime =&procTime ;
|
||||
|
||||
if (!harq_process) {
|
||||
printf("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(dlsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
t_nrLDPC_procBuf** p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf;
|
||||
|
||||
int16_t z [68*384];
|
||||
@@ -265,11 +270,6 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
return(dlsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
if (!harq_process) {
|
||||
printf("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(dlsch->max_ldpc_iterations + 1);
|
||||
}
|
||||
|
||||
if (!frame_parms) {
|
||||
printf("dlsch_decoding.c: NULL frame_parms pointer\n");
|
||||
return(dlsch->max_ldpc_iterations + 1);
|
||||
@@ -503,7 +503,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
||||
}
|
||||
|
||||
printf("decoder input(segment %d) :",r);
|
||||
printf("decoder input(segment %u) :",r);
|
||||
int i;
|
||||
for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
printf("%d : %d\n",i,harq_process->d[r][i]);
|
||||
@@ -569,7 +569,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
printf("\x1B[34m" "Segment %d CRC OK\n\033[0m",r);
|
||||
printf("\x1B[34m" "Segment %u CRC OK\n\033[0m",r);
|
||||
//Temporary hack
|
||||
no_iteration_ldpc = dlsch->max_ldpc_iterations;
|
||||
ret = no_iteration_ldpc;
|
||||
@@ -599,7 +599,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
//printf("output decoder %d %d %d %d %d \n", harq_process->c[r][0], harq_process->c[r][1], harq_process->c[r][2],harq_process->c[r][3], harq_process->c[r][4]);
|
||||
for (int k=0;k<A>>3;k++)
|
||||
printf("output decoder [%d] = 0x%02x \n", k, harq_process->c[r][k]);
|
||||
printf("no_iterations_ldpc %d (ret %d)\n",no_iteration_ldpc,ret);
|
||||
printf("no_iterations_ldpc %d (ret %u)\n",no_iteration_ldpc,ret);
|
||||
//write_output("dec_output.m","dec0",harq_process->c[0],Kr_bytes,1,4);
|
||||
#endif
|
||||
|
||||
@@ -701,7 +701,7 @@ uint32_t nr_dlsch_decoding(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("Segment %d : Kr= %d bytes\n",r,Kr_bytes);
|
||||
printf("Segment %u : Kr= %u bytes\n",r,Kr_bytes);
|
||||
printf("copied %d bytes to b sequence (harq_pid %d)\n",
|
||||
(Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)),harq_pid);
|
||||
printf("b[0] = %x,c[%d] = %x\n",
|
||||
@@ -771,6 +771,10 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
t_nrLDPC_time_stats procTime;
|
||||
t_nrLDPC_time_stats* p_procTime =&procTime ;
|
||||
int8_t llrProcBuf[OAI_LDPC_MAX_NUM_LLR] __attribute__ ((aligned(32)));
|
||||
if (!harq_process) {
|
||||
printf("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(dlsch->max_ldpc_iterations);
|
||||
}
|
||||
t_nrLDPC_procBuf* p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf[0];
|
||||
uint8_t Nl=4;
|
||||
int16_t z [68*384];
|
||||
@@ -801,10 +805,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
return(dlsch->max_ldpc_iterations);
|
||||
}
|
||||
|
||||
if (!harq_process) {
|
||||
printf("dlsch_decoding.c: NULL harq_process pointer\n");
|
||||
return(dlsch->max_ldpc_iterations);
|
||||
}
|
||||
|
||||
|
||||
if (!frame_parms) {
|
||||
printf("dlsch_decoding.c: NULL frame_parms pointer\n");
|
||||
@@ -1011,7 +1012,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
for (int i =0; i<16; i++)
|
||||
printf("rx output deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||
printf("rx output deinterleaving w[%d]= %d r_offset %u\n", i,harq_process->w[r][i], r_offset);
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -1070,7 +1071,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
for (int i =0; i<16; i++)
|
||||
printf("rx output ratematching d[%d]= %d r_offset %d\n", i,harq_process->d[r][i], r_offset);
|
||||
printf("rx output ratematching d[%d]= %d r_offset %u\n", i,harq_process->d[r][i], r_offset);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
@@ -1080,7 +1081,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
write_output("decoder_in.m","dec",&harq_process->d[0][96],(3*8*Kr_bytes)+12,1,0);
|
||||
}
|
||||
|
||||
printf("decoder input(segment %d) :",r);
|
||||
printf("decoder input(segment %u) :",r);
|
||||
for (int i=0;i<(3*8*Kr_bytes);i++)
|
||||
printf("%d : %d\n",i,harq_process->d[r][i]);
|
||||
printf("\n");
|
||||
@@ -1158,7 +1159,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
printf("Segment %d CRC OK\n",r);
|
||||
printf("Segment %u CRC OK\n",r);
|
||||
ret = 2;
|
||||
}
|
||||
else {
|
||||
@@ -1167,7 +1168,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
}
|
||||
|
||||
//if (!nb_total_decod%10000){
|
||||
printf("Error number of iteration LPDC %d %ld/%ld \n", no_iteration_ldpc, nb_error_decod,nb_total_decod);fflush(stdout);
|
||||
printf("Error number of iteration LPDC %d %lu/%lu \n", no_iteration_ldpc, nb_error_decod,nb_total_decod);fflush(stdout);
|
||||
//}
|
||||
|
||||
//else
|
||||
@@ -1308,7 +1309,7 @@ uint32_t nr_dlsch_decoding_mthread(PHY_VARS_NR_UE *phy_vars_ue,
|
||||
offset += (Kr_bytes - (harq_process->F>>3) - ((harq_process->C>1)?3:0));
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
printf("Segment %d : Kr= %d bytes\n",r,Kr_bytes);
|
||||
printf("Segment %u : Kr= %u bytes\n",r,Kr_bytes);
|
||||
printf("copied %d bytes to b sequence (harq_pid %d)\n",
|
||||
(Kr_bytes - (harq_process->F>>3)-((harq_process->C>1)?3:0)),harq_pid);
|
||||
printf("b[0] = %x,c[%d] = %x\n",
|
||||
@@ -1396,7 +1397,7 @@ void *nr_dlsch_decoding_process(void *arg)
|
||||
//printf("2thread0 llr flag %d tdp flag %d\n",llr8_flag1, tdp->llr8_flag);
|
||||
p_nrLDPC_procBuf = harq_process->p_nrLDPC_procBuf[r];
|
||||
nb_symb_sch = harq_process->nb_symbols;
|
||||
printf("dlsch decoding process frame %d slot %d segment %d r %d nb symb %d \n", frame, proc->nr_tti_rx, proc->num_seg, r, harq_process->nb_symbols);
|
||||
printf("dlsch decoding process frame %d slot %d segment %d r %u nb symb %d \n", frame, proc->nr_tti_rx, proc->num_seg, r, harq_process->nb_symbols);
|
||||
|
||||
|
||||
/*
|
||||
@@ -1559,7 +1560,7 @@ void *nr_dlsch_decoding_process(void *arg)
|
||||
|
||||
#ifdef DEBUG_DLSCH_DECODING
|
||||
for (int i =0; i<16; i++)
|
||||
printf("rx output thread 0 deinterleaving w[%d]= %d r_offset %d\n", i,harq_process->w[r][i], r_offset);
|
||||
printf("rx output thread 0 deinterleaving w[%d]= %d r_offset %u\n", i,harq_process->w[r][i], r_offset);
|
||||
#endif
|
||||
|
||||
#if UE_TIMING_TRACE
|
||||
@@ -1620,7 +1621,7 @@ void *nr_dlsch_decoding_process(void *arg)
|
||||
write_output("decoder_in.m","dec",&harq_process->d[0][0],(3*8*Kr_bytes)+12,1,0);
|
||||
}
|
||||
|
||||
printf("decoder input(segment %d) :",r);
|
||||
printf("decoder input(segment %u) :",r);
|
||||
int i; for (i=0;i<(3*8*Kr_bytes)+12;i++)
|
||||
printf("%d : %d\n",i,harq_process->d[r][i]);
|
||||
printf("\n");
|
||||
@@ -1689,7 +1690,7 @@ void *nr_dlsch_decoding_process(void *arg)
|
||||
|
||||
// Fixme: correct type is unsigned, but nrLDPC_decoder and all called behind use signed int
|
||||
if (check_crc((uint8_t*)llrProcBuf,length_dec,harq_process->F,crc_type)) {
|
||||
printf("Segment %d CRC OK\n",r);
|
||||
printf("Segment %u CRC OK\n",r);
|
||||
ret = 2;
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -71,7 +71,7 @@ uint16_t nr_pbch_extract(int **rxdataF,
|
||||
rxF = &rxdataF[aarx][(symbol+s_offset)*frame_parms->ofdm_symbol_size];
|
||||
rxF_ext = &rxdataF_ext[aarx][symbol*20*12];
|
||||
#ifdef DEBUG_PBCH
|
||||
printf("extract_rbs (nushift %d): rx_offset=%d, symbol %d\n",frame_parms->nushift,
|
||||
printf("extract_rbs (nushift %d): rx_offset=%d, symbol %u\n",frame_parms->nushift,
|
||||
(rx_offset + ((symbol+s_offset)*(frame_parms->ofdm_symbol_size))),symbol);
|
||||
int16_t *p = (int16_t *)rxF;
|
||||
|
||||
@@ -425,7 +425,8 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
int max_h=0;
|
||||
int symbol;
|
||||
//uint8_t pbch_a[64];
|
||||
uint8_t *pbch_a = malloc(sizeof(uint8_t) * 32);
|
||||
//FT ?? cppcheck doesn't like pbch_a allocation because of line 525..and i don't get what this variable is for..
|
||||
//uint8_t *pbch_a = malloc(sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
|
||||
//uint32_t pbch_a_prime;
|
||||
int16_t *pbch_e_rx;
|
||||
uint8_t *decoded_output = nr_ue_pbch_vars->decoded_output;
|
||||
@@ -438,7 +439,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
//uint8_t decoderListSize = 8, pathMetricAppr = 0;
|
||||
//time_stats_t polar_decoder_init,polar_rate_matching,decoding,bit_extraction,deinterleaving;
|
||||
//time_stats_t path_metric,sorting,update_LLR;
|
||||
memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
|
||||
// FT ?? cppcheck fix memset(&pbch_a[0], 0, sizeof(uint8_t) * NR_POLAR_PBCH_PAYLOAD_BITS);
|
||||
//printf("nr_pbch_ue nid_cell %d\n",frame_parms->Nid_cell);
|
||||
|
||||
pbch_e_rx = &nr_ue_pbch_vars->llr[0];
|
||||
@@ -522,7 +523,7 @@ int nr_rx_pbch( PHY_VARS_NR_UE *ue,
|
||||
#endif
|
||||
pbch_e_rx = nr_ue_pbch_vars->llr;
|
||||
//demod_pbch_e = nr_ue_pbch_vars->demod_pbch_e;
|
||||
pbch_a = nr_ue_pbch_vars->pbch_a;
|
||||
// FT?? cppcheck fix - pbch_a = nr_ue_pbch_vars->pbch_a;
|
||||
#ifdef DEBUG_PBCH
|
||||
//pbch_e_rx = &nr_ue_pbch_vars->llr[0];
|
||||
short *p = (short *)&(nr_ue_pbch_vars->rxdataF_comp[0][20*12]);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
\brief This function frees memory allocated for a particular DLSCH at UE
|
||||
@param dlsch Pointer to DLSCH to be removed
|
||||
*/
|
||||
void free_nr_ue_dlsch(NR_UE_DLSCH_t *dlsch);
|
||||
void free_nr_ue_dlsch(NR_UE_DLSCH_t **dlsch);
|
||||
|
||||
/** \fn new_ue_dlsch(uint8_t Kmimo,uint8_t Mdlharq,uint32_t Nsoft,uint8_t abstraction_flag)
|
||||
\brief This function allocates structures for a particular DLSCH at UE
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
uint32_t *pseudo_random_gold_sequence(length M_PN, uint32_t cinit)
|
||||
{
|
||||
int size = M_PN * sizeof(uint32_t);
|
||||
int size_x = (sizeof(int)*M_PN + size;
|
||||
int size_x = sizeof(int)*M_PN + size;
|
||||
int *x1 = malloc(size_x);
|
||||
int *x2 = malloc(size_x);
|
||||
|
||||
|
||||
@@ -42,14 +42,16 @@ extern PHY_VARS_NR_UE ***PHY_vars_UE_g;
|
||||
|
||||
int8_t nr_ue_scheduled_response(nr_scheduled_response_t *scheduled_response)
|
||||
{
|
||||
/// module id
|
||||
module_id_t module_id = scheduled_response->module_id;
|
||||
/// component carrier id
|
||||
uint8_t cc_id = scheduled_response->CC_id;
|
||||
uint32_t i;
|
||||
int slot = scheduled_response->slot;
|
||||
|
||||
|
||||
if(scheduled_response != NULL){
|
||||
/// module id
|
||||
module_id_t module_id = scheduled_response->module_id;
|
||||
/// component carrier id
|
||||
uint8_t cc_id = scheduled_response->CC_id;
|
||||
uint32_t i;
|
||||
int slot = scheduled_response->slot;
|
||||
|
||||
// Note: we have to handle the thread IDs for this. To be revisited completely.
|
||||
uint8_t thread_id = PHY_vars_UE_g[module_id][cc_id]->current_thread_id[slot];
|
||||
NR_UE_PDCCH *pdcch_vars2 = PHY_vars_UE_g[module_id][cc_id]->pdcch_vars[thread_id][0];
|
||||
|
||||
@@ -623,7 +623,7 @@ int main(int argc, char **argv)
|
||||
printf("gNB %d\n", i);
|
||||
free_gNB_dlsch(gNB->dlsch[0][i]);
|
||||
printf("UE %d\n", i);
|
||||
free_nr_ue_dlsch(UE->dlsch[0][0][i]);
|
||||
free_nr_ue_dlsch(&(UE->dlsch[0][0][i]));
|
||||
}
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
|
||||
@@ -302,5 +302,12 @@ typedef struct protocol_ctxt_s {
|
||||
#define CHECK_CTXT_ARGS(CTXT_Pp)
|
||||
|
||||
#define exit_fun(msg) exit_function(__FILE__,__FUNCTION__,__LINE__,msg)
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
void exit_function(const char *file, const char *function, const int line, const char *s);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -221,7 +221,7 @@ rlc_op_status_t rlc_data_req (const protocol_ctxt_t *const ctxt_pP,
|
||||
nr_rlc_ue_t *ue;
|
||||
nr_rlc_entity_t *rb;
|
||||
|
||||
LOG_D(RLC, "%s rnti %d srb_flag %d rb_id %d mui %d confirm %d sdu_size %d MBMS_flag %d\n",
|
||||
LOG_D(RLC, "%s rnti %d srb_flag %d rb_id %ld mui %d confirm %d sdu_size %d MBMS_flag %d\n",
|
||||
__FUNCTION__, rnti, srb_flagP, rb_idP, muiP, confirmP, sdu_sizeP,
|
||||
MBMS_flagP);
|
||||
|
||||
@@ -824,24 +824,24 @@ rlc_op_status_t rrc_rlc_config_req (
|
||||
}
|
||||
if ((srb_flagP && !(rb_idP >= 1 && rb_idP <= 2)) ||
|
||||
(!srb_flagP && !(rb_idP >= 1 && rb_idP <= 5))) {
|
||||
LOG_E(RLC, "%s:%d:%s: bad rb_id (%d) (is_srb %d)\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP);
|
||||
LOG_E(RLC, "%s:%d:%s: bad rb_id (%ld) (is_srb %d)\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP);
|
||||
exit(1);
|
||||
}
|
||||
nr_rlc_manager_lock(nr_rlc_ue_manager);
|
||||
LOG_D(RLC, "%s:%d:%s: remove rb %d (is_srb %d) for UE %d\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP, ctxt_pP->rnti);
|
||||
LOG_D(RLC, "%s:%d:%s: remove rb %ld (is_srb %d) for UE %d\n", __FILE__, __LINE__, __FUNCTION__, rb_idP, srb_flagP, ctxt_pP->rnti);
|
||||
ue = nr_rlc_manager_get_ue(nr_rlc_ue_manager, ctxt_pP->rnti);
|
||||
if (srb_flagP) {
|
||||
if (ue->srb[rb_idP-1] != NULL) {
|
||||
ue->srb[rb_idP-1]->delete(ue->srb[rb_idP-1]);
|
||||
ue->srb[rb_idP-1] = NULL;
|
||||
} else
|
||||
LOG_W(RLC, "removing non allocated SRB %d, do nothing\n", rb_idP);
|
||||
LOG_W(RLC, "removing non allocated SRB %ld, do nothing\n", rb_idP);
|
||||
} else {
|
||||
if (ue->drb[rb_idP-1] != NULL) {
|
||||
ue->drb[rb_idP-1]->delete(ue->drb[rb_idP-1]);
|
||||
ue->drb[rb_idP-1] = NULL;
|
||||
} else
|
||||
LOG_W(RLC, "removing non allocated DRB %d, do nothing\n", rb_idP);
|
||||
LOG_W(RLC, "removing non allocated DRB %ld, do nothing\n", rb_idP);
|
||||
}
|
||||
/* remove UE if it has no more RB configured */
|
||||
for (i = 0; i < 2; i++)
|
||||
|
||||
@@ -193,7 +193,7 @@ ue_ip_common_class_wireless2ip(
|
||||
break;
|
||||
|
||||
default:
|
||||
printk("[UE_IP_DRV][%s] begin RB %d Inst %d Length %d bytes\n",__FUNCTION__,rb_idP,instP,data_lenP);
|
||||
printk("[UE_IP_DRV][%s] begin RB %ld Inst %d Length %d bytes\n",__FUNCTION__,rb_idP,instP,data_lenP);
|
||||
printk("[UE_IP_DRV][%s] Inst %d: receive unknown message (version=%d)\n",__FUNCTION__,instP,ipv_p->version);
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ ue_ip_common_ip2wireless(
|
||||
|
||||
if (bytes_wrote != UE_IP_PDCPH_SIZE) {
|
||||
printk("[UE_IP_DRV][%s] problem while writing PDCP's header (bytes wrote = %d)\n",__FUNCTION__,bytes_wrote);
|
||||
printk("rb_id %d, Wrote %d, Header Size %d \n", pdcph.rb_id, bytes_wrote, UE_IP_PDCPH_SIZE);
|
||||
printk("rb_id %ld, Wrote %d, Header Size %d \n", pdcph.rb_id, bytes_wrote, UE_IP_PDCPH_SIZE);
|
||||
priv_p->stats.tx_dropped ++;
|
||||
return;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ ue_ip_common_ip2wireless(
|
||||
bytes_wrote += ue_ip_netlink_send((char *)skb_pP->data,skb_pP->len);
|
||||
|
||||
if (bytes_wrote != skb_pP->len+UE_IP_PDCPH_SIZE) {
|
||||
printk("[UE_IP_DRV][%s] Inst %d, RB_ID %d: problem while writing PDCP's data, bytes_wrote = %d, Data_len %d, PDCPH_SIZE %d\n",
|
||||
printk("[UE_IP_DRV][%s] Inst %d, RB_ID %ld: problem while writing PDCP's data, bytes_wrote = %d, Data_len %d, PDCPH_SIZE %d\n",
|
||||
__FUNCTION__,
|
||||
instP,
|
||||
pdcph.rb_id,
|
||||
|
||||
@@ -195,7 +195,7 @@ void server_socket_tcp_ip4()
|
||||
|
||||
|
||||
/* create new thread for the new connection */
|
||||
threadCreate(&id, (void *)recv_ip4_tcp, (void*)csock), "OTG", -1, OAI_PRIORITY_RT_LOW);
|
||||
threadCreate(&id, (void *)recv_ip4_tcp, (void*)csock, "OTG", -1, OAI_PRIORITY_RT_LOW);
|
||||
LOG_I(OTG,"SOCKET:: TCP-IP4 :: Client n=%d finish transmission\n", cmpt_cl);
|
||||
cmpt_cl+=1;
|
||||
}
|
||||
|
||||
@@ -135,6 +135,8 @@ typedef struct {
|
||||
|
||||
/*! \brief Clock source types */
|
||||
typedef enum {
|
||||
//! this means the paramter has not been set
|
||||
unset=-1,
|
||||
//! This tells the underlying hardware to use the internal reference
|
||||
internal=0,
|
||||
//! This tells the underlying hardware to use the external reference
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,8 +26,6 @@
|
||||
* \author: bruno.mongazon-cazavet@nokia-bell-labs.com
|
||||
*/
|
||||
|
||||
#if defined (USRP_REC_PLAY)
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -35,6 +33,29 @@
|
||||
#include "common/config/config_paramdesc.h"
|
||||
#include "common/config/config_userapi.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
#define CONFIG_OPT_RECPLAY "enable_recplay"
|
||||
|
||||
#define CONFIG_HLP_RECPLAY "Allow record player"
|
||||
#define USRP_SECTION "device.usrp"
|
||||
/* inclusion for device configuration */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters for USRP record/playback */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define USRP_DEVICE_PARAMS_DESC { \
|
||||
{CONFIG_OPT_RECPLAY, CONFIG_HLP_RECPLAY, PARAMFLAG_BOOL, uptr:&enable_recplay, defuintval:0, TYPE_UINT, 0} \
|
||||
}
|
||||
|
||||
|
||||
/* inclusions for record player */
|
||||
#define RECPLAY_DISABLED 0
|
||||
#define RECPLAY_RECORDMODE 1
|
||||
#define RECPLAY_REPLAYMODE 2
|
||||
|
||||
#define BELL_LABS_IQ_HEADER 0xabababababababab
|
||||
#define BELL_LABS_IQ_PER_SF 7680 // Up to 5MHz bw for now
|
||||
#define BELL_LABS_IQ_BYTES_PER_SF (BELL_LABS_IQ_PER_SF * 4)
|
||||
@@ -46,13 +67,13 @@ typedef struct {
|
||||
unsigned char samples[BELL_LABS_IQ_BYTES_PER_SF]; // iq's for one subframe
|
||||
} iqrec_t;
|
||||
#define DEF_NB_SF 120000 // default nb of sf or ms to capture (2 minutes at 5MHz)
|
||||
#define DEF_SF_FILE "/home/nokia/iqfile" // default subframes file name
|
||||
#define DEF_SF_FILE "/tmp/iqfile" // default subframes file name
|
||||
#define DEF_SF_DELAY_READ 700 // default read delay µs (860=real)
|
||||
#define DEF_SF_DELAY_WRITE 15 // default write delay µs (15=real)
|
||||
#define DEF_SF_NB_LOOP 5 // default nb loops
|
||||
|
||||
|
||||
/* help strings definition for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
|
||||
/* help strings definition for config options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
|
||||
#define CONFIG_HLP_SF_FILE "Path of the file used for subframes record or replay"
|
||||
#define CONFIG_HLP_SF_REC "Record subframes from USRP driver into a file for later replay"
|
||||
#define CONFIG_HLP_SF_REP "Replay subframes into USRP driver from a file"
|
||||
@@ -61,7 +82,7 @@ typedef struct {
|
||||
#define CONFIG_HLP_SF_RDELAY "Delay in microseconds to read a subframe in replay mode"
|
||||
#define CONFIG_HLP_SF_WDELAY "Delay in microseconds to write a subframe in replay mode"
|
||||
|
||||
/* keyword strings for command line options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
|
||||
/* keyword strings for config options, used in CMDLINE_XXX_DESC macros and printed when -h option is used */
|
||||
#define CONFIG_OPT_SF_FILE "subframes-file"
|
||||
#define CONFIG_OPT_SF_REC "subframes-record"
|
||||
#define CONFIG_OPT_SF_REP "subframes-replay"
|
||||
@@ -70,20 +91,41 @@ typedef struct {
|
||||
#define CONFIG_OPT_SF_RDELAY "subframes-read-delay"
|
||||
#define CONFIG_OPT_SF_WDELAY "subframes-write-delay"
|
||||
|
||||
#define USRP_RECPLAY_SECTION "device.recplay"
|
||||
/* For information only - the macro is not usable in C++ */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* command line parameters for USRP record/playback */
|
||||
/* optname helpstr paramflags XXXptr defXXXval type numelt */
|
||||
/*---------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
#define USRP_RECPLAY_PARAMS_DESC { \
|
||||
{"subframes-file", CONFIG_HLP_SF_FILE, 0, strptr:(char **)&u_sf_filename, defstrval:DEF_SF_FILE, TYPE_STRING, sizeof(u_sf_filename)}, \
|
||||
{"subframes-record", CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&u_sf_record, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"subframes-replay", CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&u_sf_replay, defuintval:0, TYPE_UINT, 0}, \
|
||||
{"subframes-max", CONFIG_HLP_SF_MAX, 0, uptr:&u_sf_max, defintval:DEF_NB_SF, TYPE_UINT, 0}, \
|
||||
{"subframes-loops", CONFIG_HLP_SF_LOOPS, 0, uptr:&u_sf_loops, defintval:DEF_SF_NB_LOOP, TYPE_UINT, 0}, \
|
||||
{"subframes-read-delay", CONFIG_HLP_SF_RDELAY, 0, uptr:&u_sf_read_delay, defintval:DEF_SF_DELAY_READ, TYPE_UINT, 0}, \
|
||||
{"subframes-write-delay", CONFIG_HLP_SF_WDELAY, 0, uptr:&u_sf_write_delay, defintval:DEF_SF_DELAY_WRITE, TYPE_UINT, 0}, \
|
||||
{CONFIG_OPT_SF_FILE, CONFIG_HLP_SF_FILE, 0, strptr:(char **)((*recplay_state)->u_sf_filename), defstrval:DEF_SF_FILE, TYPE_STRING, 1024}, \
|
||||
{CONFIG_OPT_SF_REC, CONFIG_HLP_SF_REC, PARAMFLAG_BOOL, uptr:&(u_sf_record), defuintval:0, TYPE_UINT, 0}, \
|
||||
{CONFIG_OPT_SF_REP, CONFIG_HLP_SF_REP, PARAMFLAG_BOOL, uptr:&(u_sf_replay), defuintval:0, TYPE_UINT, 0}, \
|
||||
{CONFIG_OPT_SF_MAX, CONFIG_HLP_SF_MAX, 0, uptr:&((*recplay_state)->u_sf_max), defintval:DEF_NB_SF, TYPE_UINT, 0}, \
|
||||
{CONFIG_OPT_SF_LOOPS, CONFIG_HLP_SF_LOOPS, 0, uptr:&((*recplay_state)->u_sf_loops), defintval:DEF_SF_NB_LOOP, TYPE_UINT, 0}, \
|
||||
{CONFIG_OPT_SF_RDELAY, CONFIG_HLP_SF_RDELAY, 0, uptr:&((*recplay_state)->u_sf_read_delay), defintval:DEF_SF_DELAY_READ, TYPE_UINT, 0}, \
|
||||
{CONFIG_OPT_SF_WDELAY, CONFIG_HLP_SF_WDELAY, 0, uptr:&((*recplay_state)->u_sf_write_delay), defintval:DEF_SF_DELAY_WRITE, TYPE_UINT, 0}, \
|
||||
}/*! \brief USRP Configuration and state */
|
||||
|
||||
typedef struct {
|
||||
FILE *pFile;
|
||||
int mmapfd;
|
||||
int iqfd;
|
||||
int use_mmap; // default is to use mmap
|
||||
size_t mapsize;
|
||||
iqrec_t *ms_sample; // memory for all subframes
|
||||
unsigned int nb_samples;
|
||||
char u_sf_filename[1024]; // subframes file path
|
||||
unsigned int u_sf_max ; // max number of recorded subframes
|
||||
unsigned int u_sf_loops ; // number of loops in replay mode
|
||||
unsigned int u_sf_read_delay; // read delay in replay mode
|
||||
unsigned int u_sf_write_delay ; // write delay in replay mode
|
||||
} recplay_state_t;
|
||||
|
||||
|
||||
extern int read_usrpconfig(uint32_t *recplay_mode, recplay_state_t **recplay_state);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif // BELL_LABS_MUST
|
||||
#endif
|
||||
#endif // __USRP_LIB_H
|
||||
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/** usrp_lib_config.c
|
||||
*
|
||||
* \author: HongliangXU : hong-liang-xu@agilent.com
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/sysinfo.h>
|
||||
#include <sys/resource.h>
|
||||
#include "common/utils/LOG/log.h"
|
||||
#include "assertions.h"
|
||||
#include "common_lib.h"
|
||||
#include "usrp_lib.h"
|
||||
|
||||
|
||||
int read_usrpconfig(uint32_t *recplay_mode, recplay_state_t **recplay_state) {
|
||||
unsigned int u_sf_record = 0; // record mode
|
||||
unsigned int u_sf_replay = 0; // replay mode
|
||||
uint32_t enable_recplay;
|
||||
|
||||
paramdef_t usrp_params[] = USRP_DEVICE_PARAMS_DESC;
|
||||
config_get(usrp_params,sizeof(usrp_params)/sizeof(paramdef_t),USRP_SECTION);
|
||||
if (enable_recplay) {
|
||||
*recplay_state = calloc(sizeof(recplay_state_t),1);
|
||||
paramdef_t usrp_recplay_params[]=USRP_RECPLAY_PARAMS_DESC ;
|
||||
struct sysinfo systeminfo;
|
||||
|
||||
// Use mmap for IQ files for systems with less than 6GB total RAM
|
||||
sysinfo(&systeminfo);
|
||||
|
||||
if (systeminfo.totalram < 6144000000) {
|
||||
(*recplay_state)->use_mmap = 0;
|
||||
} else {
|
||||
(*recplay_state)->use_mmap = 1;
|
||||
}
|
||||
|
||||
memset((*recplay_state)->u_sf_filename, 0, 1024);
|
||||
config_get(usrp_recplay_params,sizeof(usrp_recplay_params)/sizeof(paramdef_t),USRP_RECPLAY_SECTION);
|
||||
|
||||
if (strlen((*recplay_state)->u_sf_filename) == 0) {
|
||||
(void) strcpy((
|
||||
*recplay_state)->u_sf_filename, DEF_SF_FILE);
|
||||
}
|
||||
} /* record player enabled */
|
||||
if (u_sf_replay == 1) *recplay_mode = RECPLAY_REPLAYMODE;
|
||||
|
||||
if (u_sf_record == 1) *recplay_mode = RECPLAY_RECORDMODE;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -146,7 +146,7 @@
|
||||
{"dlsch-demod-shift", CONFIG_HLP_DLSHIFT, 0, iptr:(int32_t *)&dlsch_demod_shift, defintval:0, TYPE_INT, 0}, \
|
||||
{"usrp-args", CONFIG_HLP_USRP_ARGS, 0, strptr:(char **)&usrp_args, defstrval:"type=b200",TYPE_STRING, 0}, \
|
||||
{"mmapped-dma", CONFIG_HLP_DMAMAP, PARAMFLAG_BOOL, uptr:&mmapped_dma, defintval:0, TYPE_INT, 0}, \
|
||||
{"clock", CONFIG_HLP_CLK, 0, uptr:&clock_source, defintval:0, TYPE_UINT, 0}, \
|
||||
{"clock-source", CONFIG_HLP_CLK, 0, iptr:&clock_source, defintval:0, TYPE_INT, 0}, \
|
||||
{"T" , CONFIG_HLP_TDD, PARAMFLAG_BOOL, iptr:&tddflag, defintval:0, TYPE_INT, 0}, \
|
||||
{"A", CONFIG_HLP_TADV, 0, iptr:&(timingadv), defintval:0, TYPE_INT, 0} \
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user