Commit 89af6986 authored by nikaeinn's avatar nikaeinn

* adding options to OAI build scripts


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5787 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 1c976a0b
......@@ -130,7 +130,7 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
PL = get_PL(phy_vars_ue->Mod_id,phy_vars_ue->CC_id,eNB_id);
phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH = (hundred_times_log10_NPRB[nb_rb-1]+
get_hundred_times_delta_IF(phy_vars_ue,eNB_id,harq_pid) +
get_hundred_times_delta_IF(phy_vars_ue,eNB_id,harq_pid) +
100*phy_vars_ue->ulsch_ue[eNB_id]->f_pusch)/100;
if( phy_vars_ue->ulsch_ue_Msg3_active[eNB_id] == 1) { // Msg3 PUSCH
......@@ -158,9 +158,10 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
else if (phy_vars_ue->ulsch_ue[eNB_id]->PHR > 40)
phy_vars_ue->ulsch_ue[eNB_id]->PHR = 40;
LOG_I(PHY,"[UE %d][PUSCH %d] frame %d, subframe %d: Po_PUSCH %d dBm : Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
LOG_I(PHY,"[UE %d][PUSCH %d] frame %d, subframe %d: Po_PUSCH %d dBm : tx power %d, Po_NOMINAL_PUSCH %d,log10(NPRB) %f,PHR %d, PL %d, alpha*PL %f,delta_IF %f,f_pusch %d\n",
phy_vars_ue->Mod_id,harq_pid,phy_vars_ue->frame_tx,subframe,
phy_vars_ue->ulsch_ue[eNB_id]->Po_PUSCH,
phy_vars_ue->tx_power_max_dBm,
phy_vars_ue->lte_frame_parms.ul_power_control_config_common.p0_NominalPUSCH,
hundred_times_log10_NPRB[nb_rb-1]/100.0,
phy_vars_ue->ulsch_ue[eNB_id]->PHR,
......
......@@ -539,8 +539,9 @@ void schedule_ulsch_rnti(module_id_t module_idP,
if (round==0)
#endif
{
LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframeP %d Scheduling UE %d round %d (SR %d)\n",
LOG_I(MAC,"[eNB %d][PUSCH %d] Frame %d subframeP %d Scheduling UE %d round %d, PHR %d (SR %d)\n",
module_idP,harq_pid,frameP,subframeP,UE_id,round,
UE_template->phr_info,
UE_template->ul_SR);
// reset the scheduling request
......
build:
./build_oai.bash 1
./build_oai.bash -c -m
build_rtai:
./build_oai.bash -c -b -eRTAI -tSOFTMODEM -m
rebuild:
./build_oai.bash 0
build_usrp_rtai:
./build_oai.bash -c -b -eRTAI -tSOFTMODEM -hUSRP -m
help:
@echo make check1 performs a simple sanity check
@echo make check2 performs another simple sanity check
@echo make check does both the above checks
all: help
check1:
......
......@@ -35,9 +35,9 @@
<MOBILITY>
<UE_MOBILITY>
<RANDOM_UE_DISTRIBUTION>
<NUMBER_OF_NODES>10</NUMBER_OF_NODES>
<NUMBER_OF_NODES>1</NUMBER_OF_NODES>
</RANDOM_UE_DISTRIBUTION>
<UE_MOBILITY_TYPE>STATIC</UE_MOBILITY_TYPE>
<UE_MOBILITY_TYPE>RWP</UE_MOBILITY_TYPE>
</UE_MOBILITY>
<eNB_MOBILITY>
<eNB_INITIAL_DISTRIBUTION>random</eNB_INITIAL_DISTRIBUTION>
......@@ -60,16 +60,16 @@
-->
<!-- UL -->
<PREDEFINED_TRAFFIC>
<SOURCE_ID>1:9</SOURCE_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
<SOURCE_ID>1</SOURCE_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
<FLOW_START_ms>200</FLOW_START_ms> <!-- indicates the start time of the app or the actual duration of the traffic-->
<FLOW_DURATION_ms>5000</FLOW_DURATION_ms>
<FLOW_DURATION_ms>500</FLOW_DURATION_ms>
<APPLICATION_TYPE>scbr</APPLICATION_TYPE>
<DESTINATION_ID>0</DESTINATION_ID> <!-- valid formats are "n:m" and "n,m" and "n" -->
</PREDEFINED_TRAFFIC>
</APPLICATION_CONFIG>
<EMULATION_CONFIG>
<EMULATION_TIME_ms>10000</EMULATION_TIME_ms> <!--set to infinity-->
<EMULATION_TIME_ms>1000</EMULATION_TIME_ms> <!--set to infinity-->
<CURVE>disable</CURVE>
<PERFORMANCE_METRICS>
<THROUGHPUT>1</THROUGHPUT>
......
......@@ -41,10 +41,21 @@ E_NOTROOT=67
NUM_CPU=`cat /proc/cpuinfo | grep processor | wc -l`
OAI_INSTALLED=1
PWD=`pwd`
USER=`whoami`
BUILD_FROM_MAKEFILE=0
SUDO=''
PW=''
set_build_from_makefile(){
BUILD_FROM_MAKEFILE=$1
}
check_for_root_rights() {
if [[ $EUID -eq 0 ]]; then
echo "Run as a sudoers"
# if [[ $EUID -ne $ROOT_EUID ]]; then
if [ $USER != "root" ]; then
SUDO="sudo -S -E "
echo "Run as a sudoers"
return 1
else
echo "Run as a root"
......@@ -52,19 +63,6 @@ check_for_root_rights() {
fi
}
output=$(check_for_root_rights)
result=$?
SUDO=''
PW=''
if [ $result -ne 1 ]; then
# echo "Please provide your password :"
# read -s PW
# SUDO="echo $PW | sudo -S -E "
SUDO="sudo -S -E "
else
echo "root"
fi
test_install_package() {
# usage: test_install_package package_name
......@@ -512,8 +510,7 @@ compile_epc() {
compile_ltesoftmodem() {
cd $OPENAIR_TARGETS/RT/USER
if [ -f Makefile ]; then
echo "Compiling for EXMIMO target (default)..."
echo "Compiling directives: $SOFTMODEM_DIRECTIVES"
echo "Compiling directives: $SOFTMODEM_DIRECTIVES"
if [ $1 = 1 ]; then
make cleanall > /dev/null 2>&1
fi
......@@ -587,7 +584,7 @@ compile_unisim() {
check_for_ltesoftmodem_executable() {
if [ ! -f $OPENAIR_TARGETS/RT/USER/lte-softmodem ]; then
echo_error "Cannot find lte-softmodem executable object in directory $OPENAIR_TARGETS/RT/USER"
echo_error "Please make sure you have compiled OAI lte-softmodem"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
......@@ -608,56 +605,56 @@ check_for_sgw_executable() {
check_for_oaisim_executable() {
if [ ! -f $OPENAIR_TARGETS/SIMU/USER/oaisim ]; then
echo_error "Cannot find oaisim executable object in directory $OPENAIR_TARGETS/SIMU/USER"
echo_error "Please make sure that the OAI oaisim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_dlsim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/dlsim ]; then
echo_error "Cannot find dlsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI dlsim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_ulsim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/ulsim ]; then
echo_error "Cannot find ulsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI ulsim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_pucchsim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/pucchsim ]; then
echo_error "Cannot find pucchsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI pucchsim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_prachsim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/prachsim ]; then
echo_error "Cannot find prachsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI prachsim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_pdcchsim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/pdcchsim ]; then
echo_error "Cannot find pdcchsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI pdcchsim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_pbchsim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/pbchsim ]; then
echo_error "Cannot find pbchsim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI pbchsim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
check_for_mbmssim_executable() {
if [ ! -f $OPENAIR1_DIR/SIMULATION/LTE_PHY/mbmssim ]; then
echo_error "Cannot find mbmssim executable object in directory $OPENAIR1_DIR/SIMULATION/LTE_PHY"
echo_error "Please make sure that the OAI mbmssim is compiled"
echo_error "Check the compilation logs in bin/install_log.txt"
fi
}
......@@ -723,6 +720,7 @@ install_oaisim() {
fi
}
###############################
## echo and family
###############################
......@@ -744,18 +742,12 @@ cecho() # Color-echo
local default_msg="No Message."
message=${1:-$default_msg}
color=${2:-$green}
echo -e -n "$color$message$reset_color"
echo
return
}
cecho2() # Color-echo
# arg1 = message
# arg2 = color
{
local default_msg="No Message."
message=${1:-$default_msg}
echo "$message"
if [ $BUILD_FROM_MAKEFILE = 0 ]; then
echo -e -n "$color$message$reset_color"
echo
else
echo "$message"
fi
return
}
......
......@@ -40,50 +40,26 @@
THIS_SCRIPT_PATH=$(dirname $(readlink -f $0))
. $THIS_SCRIPT_PATH/build_helper.bash
#####################
# create a bin dir
#####################
echo_info "1. Creating the bin dir ..."
rm -rf bin
mkdir -m 777 -p bin
build_date=`date +%Y_%m_%d`
oai_build_date="oai_built_${build_date}"
touch bin/${oai_build_date}
################################
# cleanup first
################################
echo_info "2. Cleaning ..."
$SUDO kill -9 `ps -ef | grep oaisim | awk '{print $2}'`
$SUDO kill -9 `ps -ef | grep lte-softmodem | awk '{print $2}'`
$SUDO kill -9 `ps -ef | grep dlsim | awk '{print $2}'`
$SUDO kill -9 `ps -ef | grep ulsim | awk '{print $2}'`
check_for_root_rights
#######################################
# process PARAMETERS
# Default PARAMETERS
######################################
echo_info "3. Process the parameters"
HW="EXMIMO" # EXMIMO, USRP, NONE
TARGET="ALL" # ALL, SOFTMODEM, OAISIM, UNISIM, NONE
ENB_S1=1
REL="REL8" # REL8, REL10
RT="RTAI" # RTAI, RT_PREMPT or RT_DISABLED
DEBUG=0
ENB_CONFIG_FILE=$OPENAIR_TARGETS/"PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.conf"
OAI_TEST=0
XFORMS=0
# script is not currently handling these params
EPC=0 # flag to build EPC
XFORMS=0
ITTI_ANALYZER=0
VCD_TIMING=0
WIRESHARK=0
......@@ -97,46 +73,116 @@ EMULATION_DEV_ADDRESS=`ifconfig $EMULATION_DEV_INTERFACE | grep 'inet addr:'| gr
############## script params #####################
if [ -f ./.lock_oaibuild ]; then
CLEAN=0
OAI_CLEAN=0
else
CLEAN=1
OAI_CLEAN=1
fi
while [[ $# > 0 ]]
do
key="$1"
shift
case $key in
c|-c|--clean)
rm -rf ./.lock_oaibuild
CLEAN=1
;;
t)
TEST=$1
shift
;;
--default)
DEFAULT=1
CLEAN=0
shift
;;
*)
#for i in "$@"
#do
# echo "i is : $i"
# case $i in
while getopts "bcdmsxze:f:h:r:t:" OPTION; do
case "$OPTION" in
b)
ENB_S1=1
echo "setting eNB S1 flag to: $ENB_S1"
;;
c)
rm -rf ./.lock_oaibuild
OAI_CLEAN=1
echo "setting clean flag to: $OAI_CLEAN"
;;
d)
DEBUG=1
echo "setting debug flag to: $DEBUG"
;;
e)
RT="$OPTARG"
echo "setting realtime flag to: $RT"
;;
f)
ENB_CONFIG_FILE="$OPTARG"
echo "setting enb config file path to: $ENB_CONFIG_FILE"
;;
h)
HW="$OPTARG" #"${i#*=}"
echo "setting hardware to: $HW"
;;
m)
BUILD_FROM_MAKEFILE=1
set_build_from_makefile $BUILD_FROM_MAKEFILE
echo "setting build from make to: $BUILD_FROM_MAKEFILE"
;;
r)
REL="$OPTARG"
echo "setting release to: $REL"
;;
s)
OAI_TEST=1
echo "setting sanity check to: $OAI_TEST"
;;
t)
TARGET="$OPTARG"
echo "setting target to: $TARGET"
;;
x)
XFORMS=1
echo "setting xforms to: $XFORMS"
;;
z)
echo "setting all parameters to: default"
rm -rf ./.lock_oaibuild
OAI_CLEAN=1
HW="EXMIMO"
TARGET="ALL"
ENB_S1=1
REL="REL8"
RT="RTAI"
DEBUG=0
ENB_CONFIG_FILE=$OPENAIR_TARGETS/"PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.conf"
OAI_TEST=0
;;
*)
# unknown option
;;
esac
;;
esac
done
echo_info "CLEAN=$CLEAN, TEST=$TEST"
#####################
# create a bin dir
#####################
echo_info "3. Creating the bin dir ..."
rm -rf bin
mkdir -m 777 -p bin
build_date=`date +%Y_%m_%d`
oai_build_date="oai_built_${build_date}"
touch bin/${oai_build_date}
################################
# cleanup first
################################
echo_info "3. Cleaning ..."
$SUDO kill -9 `ps -ef | grep oaisim | awk '{print $2}'`
$SUDO kill -9 `ps -ef | grep lte-softmodem | awk '{print $2}'`
$SUDO kill -9 `ps -ef | grep dlsim | awk '{print $2}'`
$SUDO kill -9 `ps -ef | grep ulsim | awk '{print $2}'`
########## print the PARAMETERS############
##########################################
# process parameters
#########################################
echo_info "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG"
echo_info "3. Process the parameters"
echo_info "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS"
echo_info "ENB_CONFIG_FILE: $ENB_CONFIG_FILE"
echo "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG" >> bin/${oai_build_date}
echo "User-defined Parameters : HW=$HW, TARGET=$TARGET, ENB_S1=$ENB_S1, REL=$REL, RT=$RT, DEBUG=$DEBUG XFORMS=$XFORMS" >> bin/${oai_build_date}
echo "ENB_CONFIG_FILE: $ENB_CONFIG_FILE" >> bin/${oai_build_date}
############################################
# compilation directives
......@@ -148,6 +194,10 @@ SOFTMODEM_DIRECTIVES="ENB_S1=$ENB_S1 DEBUG=$DEBUG XFORMS=$XFORMS "
OAISIM_DIRECTIVES="ENB_S1=$ENB_S1 DEBUG=$DEBUG XFORMS=$XFORMS "
if [ $HW = "USRP" ]; then
SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES USRP=1 "
else
if [ $HW != "EXMIMO" ]; then
HW="NONE"
fi
fi
if [ $ENB_S1 -eq 0 ]; then
SOFTMODEM_DIRECTIVES="$SOFTMODEM_DIRECTIVES NAS=1 "
......@@ -171,8 +221,8 @@ if [ $RT = "RTAI" ]; then
fi
if [ $TARGET != "ALL" ]; then
if [$TARGET != "SOFTMODEM" ]; then
$HW="NONE"
if [ $TARGET != "SOFTMODEM" ]; then
HW="NONE"
fi
fi
......@@ -230,15 +280,18 @@ oaisim_compiled=1
unisim_compiled=1
if [ $TARGET = "ALL" ]; then
output=$(compile_ltesoftmodem $CLEAN >> bin/install_log.txt 2>&1 )
echo "############# compile_ltesoftmodem #############" >> bin/install_log.txt
output=$(compile_ltesoftmodem $OAI_CLEAN >> bin/install_log.txt 2>&1 )
softmodem_compiled=$?
check_for_ltesoftmodem_executable
output=$(compile_oaisim $CLEAN >> bin/install_log.txt 2>&1 )
echo "################ compile_oaisim #################" >> bin/install_log.txt
output=$(compile_oaisim $OAI_CLEAN >> bin/install_log.txt 2>&1 )
oaisim_compiled=$?
check_for_oaisim_executable
output=$(compile_unisim $CLEAN >> bin/install_log.txt 2>&1 )
echo "################## compile_unisim ##################" >> bin/install_log.txt
output=$(compile_unisim $OAI_CLEAN >> bin/install_log.txt 2>&1 )
unisim_compiled=$?
check_for_dlsim_executable
check_for_ulsim_executable
......@@ -251,17 +304,20 @@ if [ $TARGET = "ALL" ]; then
else
if [ $TARGET = "SOFTMODEM" ]; then
output=$(compile_ltesoftmodem >> bin/install_log.txt 2>&1 )
echo "################ compile_ltesoftmodem #################" >> bin/install_log.txt
output=$(compile_ltesoftmodem $OAI_CLEAN >> bin/install_log.txt 2>&1 )
softmodem_compiled=$?
check_for_ltesoftmodem_executable
fi
if [ $TARGET = "OAISIM" ]; then
output=$(compile_oaisim >> bin/install_log.txt 2>&1 )
echo "################ compile_oaisim ###############" >> bin/install_log.txt
output=$(compile_oaisim $OAI_CLEAN >> bin/install_log.txt 2>&1 )
oaisim_compiled=$?
check_for_oaisim_executable
fi
if [ $TARGET = "UNISIM" ]; then
output=$(compile_unisim >> bin/install_log.txt 2>&1 )
echo "################ compile_unisim ###############" >> bin/install_log.txt
output=$(compile_unisim $OAI_CLEAN >> bin/install_log.txt 2>&1 )
unisim_compiled=$?
check_for_dlsim_executable
check_for_ulsim_executable
......@@ -295,8 +351,7 @@ if [ $unisim_compiled = 0 ]; then
echo "target unisim built " >> bin/${oai_build_date}
fi
echo "build terminated, see logs is $OPENAIR_TARGETS/bin/install_log.txt"
echo_info "build terminated, see logs is $OPENAIR_TARGETS/bin/install_log.txt"
......
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