Commit ea57f564 authored by Rohit Gupta's avatar Rohit Gupta

merge selected commits from enhancement-10-harmony-rgu test branch

parent 4f2e5d35
......@@ -126,6 +126,7 @@ endmacro(add_list_string_option)
if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
message("CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." Debug Release RelWithDebInfo MinSizeRel)
Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
......
......@@ -1020,6 +1020,13 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(Thread_Busy)'
#If there is Segmentation fault, we mark the test case as failure as most likely eNB crashed
cmd = "grep -ilr \"segmentation fault\" " + logdir_local_testcase + " | cat "
cmd_out = subprocess.check_output ([cmd], shell=True)
if len(cmd_out) !=0:
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(SEGFAULT)'
run_result_string = run_result_string + tput_run_string
test_result=test_result & run_result
......
This diff is collapsed.
......@@ -35,6 +35,10 @@ $SUDO echo "set pagination off" >> $gdb_file
$SUDO echo "handle SIG33 pass nostop noprint" >> $gdb_file
$SUDO echo "echo backtrace:\n" >> $gdb_file
$SUDO echo "backtrace full" >> $gdb_file
$SUDO echo "echo \n\nVariables:\n" >> $gdb_file
$SUDO echo "info variables" >> $gdb_file
$SUDO echo "echo \n\nlocals:\n" >> $gdb_file
$SUDO echo "info locals" >> $gdb_file
$SUDO echo "echo \n\nregisters:\n" >> $gdb_file
$SUDO echo "info registers" >> $gdb_file
$SUDO echo "echo \n\ncurrent instructions:\n" >> $gdb_file
......
......@@ -61,6 +61,7 @@ TEST_CASE_GROUP=""
BUILD_DOXYGEN=0
T_TRACER="False"
DISABLE_HARDWARE_DEPENDENCY="False"
CMAKE_BUILD_TYPE=""
trap handle_ctrl_c INT
function print_help() {
......@@ -82,7 +83,7 @@ Options
--install-optional-packages
Install useful but not mandatory packages such as valgrind
-g | --run-with-gdb
Add debugging symbols to compilation directives
Add debugging symbols to compilation directives. It also disables any compiler optimization.
-h | --help
Print this help
--eNB
......@@ -170,7 +171,8 @@ function main() {
shift;;
-g | --run-with-gdb)
GDB=1
echo_info "Will Compile with gdb symbols"
CMAKE_BUILD_TYPE="Debug"
echo_info "Will Compile with gdb symbols and disable compiler optimization"
shift;;
--eNB)
eNB=1
......@@ -443,6 +445,7 @@ function main() {
if [ "$NOS1" = "1" ] ; then
cat $DIR/$lte_build_dir/CMakeLists.template >> $cmake_file
fi
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
......@@ -568,6 +571,8 @@ function main() {
cp $OPENAIR_DIR/cmake_targets/tools/init_exmimo2 $dbin
fi
# oaisim compilation
###############
if [ "$oaisim" = "1" ] ; then
dconf=$OPENAIR_DIR/targets/bin
if [ "$NOS1" = "1" ] ; then
......@@ -581,6 +586,7 @@ function main() {
echo_info "Compiling $oaisim_exec ($oaisim_build_dir)"
cmake_file=$DIR/$oaisim_build_dir/CMakeLists.txt
cp $DIR/$oaisim_build_dir/CMakeLists.template $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( CFLAGS_PROCESSOR_USER \"$CFLAGS_PROCESSOR_USER\" )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( PRINT_STATS $PRINT_STATS )" >> $cmake_file
......@@ -649,9 +655,10 @@ function main() {
cmake_file=$DIR/oaisim_mme_build_oai/CMakeLists.txt
cp $DIR/oaisim_mme_build_oai/CMakeLists.template $cmake_file
echo "set(XFORMS $XFORMS )" >> $cmake_file
echo "set(RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( XFORMS $XFORMS )" >> $cmake_file
echo "set ( RRC_ASN1_VERSION \"${REL}\")" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
#[ "$CLEAN" = "1" ] && rm -rf $DIR/oaisim_mme_build_oai/build
......@@ -676,13 +683,14 @@ function main() {
mkdir -p $DIR/$rrh_build_dir/build
cmake_file=$DIR/$rrh_build_dir/CMakeLists.txt
echo "cmake_minimum_required(VERSION 2.8)" > $cmake_file
echo "set(ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set(ENABLE_ITTI False )" >> $cmake_file
echo "set(RF_BOARD \"${HW}\")" >> $cmake_file
echo "set(TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set(PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo "set (DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set (CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo "set ( CMAKE_BUILD_TYPE $CMAKE_BUILD_TYPE )" >> $cmake_file
echo "set ( ENABLE_VCD_FIFO $VCD_TIMING )" >> $cmake_file
echo "set ( ENABLE_ITTI False )" >> $cmake_file
echo "set ( RF_BOARD \"${HW}\")" >> $cmake_file
echo "set ( TRANSP_PRO \"${TP}\")" >> $cmake_file
echo 'set ( PACKAGE_NAME "\"rrh_gw\"")' >> $cmake_file
echo "set ( DEADLINE_SCHEDULER \"${DEADLINE_SCHEDULER_FLAG_USER}\" )" >>$cmake_file
echo "set ( CPU_AFFINITY \"${CPU_AFFINITY_FLAG_USER}\" )" >>$cmake_file
echo "set ( T_TRACER $T_TRACER )" >> $cmake_file
echo 'include(${CMAKE_CURRENT_SOURCE_DIR}/../CMakeLists.txt)' >> $cmake_file
cd $DIR/$rrh_build_dir/build
......
......@@ -45,7 +45,7 @@
#include <complex>
#include <fstream>
#include <cmath>
#include <time.h>
#include "common_lib.h"
#ifdef __SSE4_1__
# include <smmintrin.h>
......@@ -172,7 +172,13 @@ static void trx_usrp_end(openair0_device *device)
*/
static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, void **buff, int nsamps, int cc, int flags)
{
int ret;
static long long int loop=0;
static long time_min=0, time_max=0, time_avg=0;
struct timespec tp_start, tp_end;
long time_diff;
clock_gettime(CLOCK_MONOTONIC_RAW, &tp_start);
int ret=0, ret_i=0;
usrp_state_t *s = (usrp_state_t*)device->priv;
s->tx_md.time_spec = uhd::time_spec_t::from_ticks(timestamp, s->sample_rate);
......@@ -197,6 +203,20 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
printf("[xmit] tx samples %d != %d\n",ret,nsamps);
}
clock_gettime(CLOCK_MONOTONIC_RAW, &tp_end);
time_diff = (tp_end.tv_sec - tp_start.tv_sec) *1E09 + (tp_end.tv_nsec - tp_start.tv_nsec);
if (time_min==0 ||loop==1 || time_min > time_diff)
time_min=time_diff;
if (time_max==0 ||loop==1 || time_max < time_diff)
time_max=time_diff;
if (time_avg ==0 ||loop==1)
time_avg= time_diff;
else
time_avg=(time_diff+time_avg) /2.0;
if ( loop%10000 ==0)
printf("\n usrp_write: min(ns)=%d, max(ns)=%d, avg(ns)=%d", (int)time_min, (int)time_max,(int)time_avg);
loop++;
return ret;
}
......@@ -213,6 +233,11 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
*/
static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
{
static long long int loop=0;
static long time_min=0, time_max=0, time_avg=0;
struct timespec tp_start, tp_end;
long time_diff;
clock_gettime(CLOCK_MONOTONIC_RAW, &tp_start);
usrp_state_t *s = (usrp_state_t*)device->priv;
int samples_received=0,i,j;
int nsamps2; // aligned to upper 32 or 16 byte boundary
......@@ -293,6 +318,19 @@ static int trx_usrp_read(openair0_device *device, openair0_timestamp *ptimestamp
s->rx_timestamp = s->rx_md.time_spec.to_ticks(s->sample_rate);
*ptimestamp = s->rx_timestamp;
clock_gettime(CLOCK_MONOTONIC_RAW, &tp_end);
time_diff = (tp_end.tv_sec - tp_start.tv_sec) *1E09 + (tp_end.tv_nsec - tp_start.tv_nsec);
if (time_min==0 ||loop==1 || time_min > time_diff)
time_min=time_diff;
if (time_max==0 || loop==1|| time_max < time_diff)
time_max=time_diff;
if (time_avg ==0 ||loop==1)
time_avg= time_diff;
else
time_avg=(time_diff+time_avg) /2.0;
if ( loop % 10000==0)
printf("\n usrp_read: min(ns)=%d, max(ns)=%d, avg(ns)=%d", (int)time_min, (int)time_max,(int)time_avg);
loop++;
return samples_received;
}
......@@ -500,6 +538,7 @@ extern "C" {
// Initialize USRP device
device->openair0_cfg = openair0_cfg;
std::string args = "type=b200";
......@@ -523,6 +562,8 @@ extern "C" {
// workaround for an api problem, master clock has to be set with the constructor not via set_master_clock_rate
args += boost::str(boost::format(",master_clock_rate=%f") % usrp_master_clock);
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096";
uhd::device_addrs_t device_adds = uhd::device::find(args);
if(device_adds.size() == 0)
......@@ -554,25 +595,25 @@ extern "C" {
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
// from usrp_time_offset
openair0_cfg[0].samples_per_packet = 2048;
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 15;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 15360000:
openair0_cfg[0].samples_per_packet = 2048;
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 45;
openair0_cfg[0].tx_bw = 10e6;
openair0_cfg[0].rx_bw = 10e6;
break;
case 7680000:
openair0_cfg[0].samples_per_packet = 1024;
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 50;
openair0_cfg[0].tx_bw = 5e6;
openair0_cfg[0].rx_bw = 5e6;
break;
case 1920000:
openair0_cfg[0].samples_per_packet = 256;
//openair0_cfg[0].samples_per_packet = 2048;
openair0_cfg[0].tx_sample_advance = 50;
openair0_cfg[0].tx_bw = 1.25e6;
openair0_cfg[0].rx_bw = 1.25e6;
......@@ -585,7 +626,7 @@ extern "C" {
} else {
printf("Found USRP B200");
args += ",num_recv_frames=256" ;
args += ",num_send_frames=256,num_recv_frames=256, send_frame_size=4096, recv_frame_size=4096" ;
s->usrp = uhd::usrp::multi_usrp::make(args);
// s->usrp->set_rx_subdev_spec(rx_subdev);
......@@ -611,30 +652,35 @@ extern "C" {
switch ((int)openair0_cfg[0].sample_rate) {
case 30720000:
s->usrp->set_master_clock_rate(30.72e6);
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 115;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 23040000:
s->usrp->set_master_clock_rate(23.04e6); //to be checked
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 113;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 15360000:
s->usrp->set_master_clock_rate(30.72e06);
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 103;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 7680000:
s->usrp->set_master_clock_rate(30.72e6);
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 80;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
break;
case 1920000:
s->usrp->set_master_clock_rate(30.72e6);
//openair0_cfg[0].samples_per_packet = 1024;
openair0_cfg[0].tx_sample_advance = 40;
openair0_cfg[0].tx_bw = 20e6;
openair0_cfg[0].rx_bw = 20e6;
......@@ -758,6 +804,7 @@ extern "C" {
device->trx_stop_func = trx_usrp_stop;
device->trx_set_freq_func = trx_usrp_set_freq;
device->trx_set_gains_func = trx_usrp_set_gains;
device->openair0_cfg = openair0_cfg;
s->sample_rate = openair0_cfg[0].sample_rate;
// TODO:
......
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