Commit 2b64cb8f authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'develop' into feature-34-test_framework

parents c2598500 e2fbe8be
......@@ -32,8 +32,8 @@ job1:
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $NFS_TEST_RESULTS_DIR/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest.log. Please check the logs\e[0m" ; fi
- exce_log=`egrep -i 'warning|error|critical|exception' $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log `
- if [ -n "$exce_log" ]; then echo -e "\e[31mThere are errors in $OPENAIR_DIR/cmake_targets/autotests/log/python_autotest_cleanup.log. Please check the logs\e[0m" ; fi
......@@ -1013,6 +1013,13 @@ def handle_testcaseclass_softmodem (testcase, oldprogramList, logdirOAI5GRepo ,
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(Assert)'
#If there is thread busy error, we mark the test case as failure as most likely eNB crashed
cmd = "grep -ilr \"thread busy\" " + logdir_local_testcase + " | cat "
cmd_out = subprocess.check_output ([cmd], shell=True)
if not cmd_out:
run_result=0
run_result_string = ' RUN_'+str(run) + ' = FAIL(Thread_Busy)'
run_result_string = run_result_string + tput_run_string
test_result=test_result & run_result
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -60,6 +60,8 @@ function help()
echo_error " -f, --rf-config-file filename RF specific configuration file"
echo_error " -K, --itti-dump-file filename ITTI dump file containing all ITTI events occuring during EPC runtime.(can omit file name if last argument)"
echo_error " -M, --target-dl-mcs mcs Downlink target MCS."
echo_error " -n, --T-no-wait don't wait for tracer, start immediately"
echo_error " -p, --T-port port use given port"
echo_error " -m, --mscgen directory Generate mscgen output files in a directory"
echo_error " -s, --show-stdout Do not redirect stdout and stderr to file /tmp/lte_softmodem.stdout.txt."
echo_error " -S, --enable-missed-slot Continue execution in case of missed slot."
......@@ -188,6 +190,16 @@ function main()
exe_arguments="$exe_arguments -m $2"
shift 2;
;;
-n | --T-no-wait)
echo "setting T tracer operation"
exe_arguments="$exe_arguments --T_nowait"
shift ;
;;
-p | --T-port)
echo "setting T tracer port"
exe_arguments="$exe_arguments --T_port $2"
shift 2;
;;
-V | --vcd)
echo "setting gtk-wave output"
exe_arguments="$exe_arguments -V /tmp/oai_gtk_wave.vcd"
......
......@@ -1126,12 +1126,8 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch[0]->harq_ids[subframe] = harq_pid;
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
if (dlsch0_harq->round == 0)
dlsch0_harq->status = ACTIVE;
}
break;
......@@ -1265,9 +1261,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch[0], harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
// MCS and TBS don't change across HARQ rounds
......@@ -1635,19 +1628,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
}
// reset HARQ process if this is the first transmission
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
if (dlsch0_harq->round == 0)
dlsch0_harq->status = ACTIVE;
}
if (dlsch1_harq->round == 0) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
if (dlsch1_harq->round == 0)
dlsch1_harq->status = ACTIVE;
}
dlsch0->rnti = rnti;
dlsch1->rnti = rnti;
......@@ -2022,19 +2007,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
}
// reset HARQ process if this is the first transmission
if ((dlsch0->active==1) && (dlsch0_harq->round == 0)) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
if ((dlsch0->active==1) && (dlsch0_harq->round == 0))
dlsch0_harq->status = ACTIVE;
}
if ((dlsch1->active==1) && (dlsch1_harq->round == 0)) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
if ((dlsch1->active==1) && (dlsch1_harq->round == 0))
dlsch1_harq->status = ACTIVE;
}
dlsch0->rnti = rnti;
dlsch1->rnti = rnti;
......@@ -2174,23 +2151,16 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// check if either TB is disabled (see 36-213 V8.6 p. 26)
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0))
dlsch0_harq->status = DISABLED;
}
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
LOG_W(PHY, "what to do with respect to remove_harq_pid_from_freelist?\n");
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0))
dlsch1_harq->status = DISABLED;
}
dlsch0_harq->Nl = 1;
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
......@@ -2355,17 +2325,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if ((dlsch0_harq->round == 0) && (dlsch0->active == 1) ) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
dlsch0_harq->mcs = mcs1;
}
if ((dlsch1_harq->round == 0) && (dlsch1->active == 1) ) {
/* necessary test? */
if (dlsch1_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch1, harq_pid);
dlsch1_harq->status = ACTIVE;
dlsch1_harq->mcs = mcs2;
}
......@@ -2529,9 +2493,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
......@@ -2661,9 +2622,6 @@ int generate_eNB_dlsch_params_from_dci(int frame,
// dlsch0_harq->Ndi = ((DCI1E_5MHz_2A_M10PRB_TDD_t *)dci_pdu)->ndi;
if (dlsch0_harq->round == 0) {
/* necessary test? */
if (dlsch0_harq->status == SCH_IDLE)
remove_harq_pid_from_freelist(dlsch0, harq_pid);
dlsch0_harq->status = ACTIVE;
// printf("Setting DLSCH process %d to ACTIVE\n",harq_pid);
}
......
......@@ -258,13 +258,6 @@ typedef struct {
uint8_t error_threshold;
/// Pointers to 8 HARQ processes for the DLSCH
LTE_DL_eNB_HARQ_t *harq_processes[8];
/// circular list of free harq PIDs (the oldest come first)
/// (10 is arbitrary value, must be > to max number of DL HARQ processes in LTE)
int harq_pid_freelist[10];
/// the head position of the free list (if list is free then head=tail)
int head_freelist;
/// the tail position of the free list
int tail_freelist;
/// Number of soft channel bits
uint32_t G;
/// Codebook index for this dlsch (0,1,2,3)
......
......@@ -156,9 +156,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
for (i=0; i<10; i++)
dlsch->harq_ids[i] = Mdlharq;
dlsch->head_freelist = 0;
dlsch->tail_freelist = 0;
for (i=0; i<Mdlharq; i++) {
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
LOG_T(PHY, "Required mem size %d (bw scaling %d), dlsch->harq_processes[%d] %p\n",
......@@ -199,8 +196,6 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
msg("Can't get harq_p %d\n",i);
exit_flag=3;
}
put_harq_pid_in_freelist(dlsch, i);
}
if (exit_flag==0) {
......
......@@ -55,7 +55,7 @@ int slot_fep(PHY_VARS_UE *phy_vars_ue,
unsigned int rx_offset;
void (*dft)(int16_t *,int16_t *, int);
int tmp_dft_in[2048]; // This is for misalignment issues for 6 and 15 PRBs
int tmp_dft_in[2048] __attribute__ ((aligned (32))); // This is for misalignment issues for 6 and 15 PRBs
switch (frame_parms->ofdm_symbol_size) {
case 128:
......
......@@ -400,9 +400,6 @@ uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, ui
uint16_t get_Np(uint8_t N_RB_DL,uint8_t nCCE,uint8_t plus1);
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid);
int8_t find_ue(uint16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB);
int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rnti);
......
This diff is collapsed.
......@@ -133,30 +133,6 @@ uint8_t is_SR_subframe(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t sched_su
return(0);
}
void put_harq_pid_in_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
{
DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->tail_freelist] = harq_pid;
DLSCH_ptr->tail_freelist = (DLSCH_ptr->tail_freelist + 1) % 10;
}
void remove_harq_pid_from_freelist(LTE_eNB_DLSCH_t *DLSCH_ptr, int harq_pid)
{
if (DLSCH_ptr->head_freelist == DLSCH_ptr->tail_freelist) {
LOG_E(PHY, "%s:%d: you cannot read this!\n", __FILE__, __LINE__);
abort();
}
/* basic check, in case several threads deal with the free list at the same time
* in normal situations it should not happen, that's also why we don't use any
* locking mechanism to protect the free list
* to be refined in case things don't work properly
*/
if (harq_pid != DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist]) {
LOG_E(PHY, "%s:%d: critical error, get in touch with the authors\n", __FILE__, __LINE__);
abort();
}
DLSCH_ptr->head_freelist = (DLSCH_ptr->head_freelist + 1) % 10;
}
int32_t add_ue(int16_t rnti, PHY_VARS_eNB *phy_vars_eNB)
{
uint8_t i;
......@@ -221,12 +197,6 @@ int mac_phy_remove_ue(module_id_t Mod_idP,rnti_t rntiP) {
memset(&phy_vars_eNB->eNB_UE_stats[i],0,sizeof(LTE_eNB_UE_stats));
// mac_exit_wrapper("Removing UE");
/* clear the harq pid freelist */
phy_vars_eNB->dlsch_eNB[i][0]->head_freelist = 0;
phy_vars_eNB->dlsch_eNB[i][0]->tail_freelist = 0;
for (j = 0; j < 8; j++)
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[i][0], j);
return(i);
}
}
......@@ -258,9 +228,8 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
LTE_eNB_DLSCH_t *DLSCH_ptr;
LTE_eNB_ULSCH_t *ULSCH_ptr;
uint8_t ulsch_subframe,ulsch_frame;
uint8_t i;
int i;
int8_t UE_id = find_ue(rnti,PHY_vars_eNB_g[Mod_id][CC_id]);
int sf1=(10*frame)+subframe,sf2,sfdiff,sfdiff_max=7;
if (UE_id==-1) {
LOG_D(PHY,"Cannot find UE with rnti %x (Mod_id %d, CC_id %d)\n",rnti, Mod_id, CC_id);
......@@ -271,40 +240,19 @@ int get_ue_active_harq_pid(const uint8_t Mod_id,const uint8_t CC_id,const uint16
if (ul_flag == 0) {// this is a DL request
DLSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->dlsch_eNB[(uint32_t)UE_id][0];
// set to no available process first
*harq_pid = -1;
/* let's go synchronous for the moment - maybe we can change at some point */
i = (frame * 10 + subframe) % 8;
for (i=0; i<DLSCH_ptr->Mdlharq; i++) {
if (DLSCH_ptr->harq_processes[i]!=NULL) {
if (DLSCH_ptr->harq_processes[i]->status == ACTIVE) {
sf2 = (DLSCH_ptr->harq_processes[i]->frame*10) + DLSCH_ptr->harq_processes[i]->subframe;
if (sf2<=sf1)
sfdiff = sf1-sf2;
else // this happens when wrapping around 1024 frame barrier
sfdiff = 10240 + sf1-sf2;
LOG_D(PHY,"process %d is active, round %d (waiting %d)\n",i,DLSCH_ptr->harq_processes[i]->round,sfdiff);
if (sfdiff>sfdiff_max) { // this is an active process that is waiting longer than the others (and longer than 7 ms)
sfdiff_max = sfdiff;
*harq_pid = i;
*round = DLSCH_ptr->harq_processes[i]->round;
}
}
} else { // a process is not defined
LOG_E(PHY,"[eNB %d] DLSCH process %d for rnti %x (UE_id %d) not allocated\n",Mod_id,i,rnti,UE_id);
return(-1);
}
}
/* if no active harq pid, get the oldest in the freelist, if any */
if (*harq_pid == 255 && DLSCH_ptr->head_freelist != DLSCH_ptr->tail_freelist) {
*harq_pid = DLSCH_ptr->harq_pid_freelist[DLSCH_ptr->head_freelist];
} else if (DLSCH_ptr->harq_processes[i]->status == SCH_IDLE) {
*harq_pid = i;
*round = 0;
LOG_D(PHY,"process %d is first free process\n", *harq_pid);
} else {
printf("%s:%d: bad state for harq process - PLEASE REPORT!!\n", __FILE__, __LINE__);
abort();
}
LOG_D(PHY,"get_ue_active_harq_pid DL => Frame %d, Subframe %d : harq_pid %d\n",
frame,subframe,*harq_pid);
} else { // This is a UL request
ULSCH_ptr = PHY_vars_eNB_g[Mod_id][CC_id]->ulsch_eNB[(uint32_t)UE_id];
......@@ -1906,7 +1854,6 @@ void process_HARQ_feedback(uint8_t UE_id,
dlsch_harq_proc->round = 0;
ue_stats->dlsch_l2_errors[dl_harq_pid[m]]++;
dlsch_harq_proc->status = SCH_IDLE;
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
}
} else {
......@@ -1923,7 +1870,6 @@ void process_HARQ_feedback(uint8_t UE_id,
// Received ACK so set round to 0 and set dlsch_harq_pid IDLE
dlsch_harq_proc->round = 0;
dlsch_harq_proc->status = SCH_IDLE;
put_harq_pid_in_freelist(dlsch, dl_harq_pid[m]);
dlsch->harq_ids[dl_subframe] = dlsch->Mdlharq;
ue_stats->total_TBS = ue_stats->total_TBS +
......@@ -2345,9 +2291,6 @@ void pucch_procedures(const unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_
phy_vars_eNB->eNB_UE_stats[UE_id].sr_received++;
if (phy_vars_eNB->first_sr[UE_id] == 1) { // this is the first request for uplink after Connection Setup, so clear HARQ process 0 use for Msg4
/* is this test necessary? */
if (phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status != SCH_IDLE)
put_harq_pid_in_freelist(phy_vars_eNB->dlsch_eNB[UE_id][0], 0);
phy_vars_eNB->first_sr[UE_id] = 0;
phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->round=0;
phy_vars_eNB->dlsch_eNB[UE_id][0]->harq_processes[0]->status=SCH_IDLE;
......
......@@ -137,27 +137,15 @@ typedef guint8 gboolean;
//static unsigned char g_PDUBuffer[1600];
//static unsigned int g_PDUOffset;
#ifdef JUMBO_FRAME
static unsigned char g_frameBuffer[9000];
#else
static unsigned char g_frameBuffer[1600];
#endif
//static unsigned char g_fileBuffer[1600];
static unsigned int g_frameOffset;
char in_ip[40];
char in_path[100];
static uint16_t in_port;
FILE *file_fd = NULL;
trace_mode_t opt_type = OPT_NONE;
static radio_type_t radio_type;
static unsigned int subframesSinceCaptureStart;
// double timing_perf[250];
// clock_t timing_in[250];
// clock_t timing_out[250];
int test=0;
int init_value=0;
static int g_socksd = -1;/* UDP socket used for sending frames */
static struct sockaddr_in g_serv_addr;
......@@ -277,66 +265,73 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
guint8 oob_event, guint8 oob_event_value,
uint8_t *pdu_buffer, unsigned int pdu_buffer_size)
{
#ifdef JUMBO_FRAME
static unsigned char frameBuffer[9000];
#else
static unsigned char frameBuffer[1600];
#endif
static unsigned int frameOffset;
ssize_t bytesSent;
g_frameOffset = 0;
frameOffset = 0;
uint16_t tmp16;
/********************************************************************/
/* Fixed start to each frame (allowing heuristic dissector to work) */
/* Not NULL terminated */
memset(g_frameBuffer+g_frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
memset(frameBuffer+frameOffset, 0, sizeof(mac_lte_info)+pdu_buffer_size + 8);
memcpy(g_frameBuffer+g_frameOffset, MAC_LTE_START_STRING,
memcpy(frameBuffer+frameOffset, MAC_LTE_START_STRING,
strlen(MAC_LTE_START_STRING));
g_frameOffset += strlen(MAC_LTE_START_STRING);
frameOffset += strlen(MAC_LTE_START_STRING);
/******************************************************************************/
/* Now write out fixed fields (the mandatory elements of struct mac_lte_info) */
g_frameBuffer[g_frameOffset++] = radioType;
g_frameBuffer[g_frameOffset++] = direction;
g_frameBuffer[g_frameOffset++] = rntiType;
frameBuffer[frameOffset++] = radioType;
frameBuffer[frameOffset++] = direction;
frameBuffer[frameOffset++] = rntiType;
/*************************************/
/* Now optional fields */
/* RNTI */
g_frameBuffer[g_frameOffset++] = MAC_LTE_RNTI_TAG;
frameBuffer[frameOffset++] = MAC_LTE_RNTI_TAG;
tmp16 = htons(rnti);
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
/* UEId */
g_frameBuffer[g_frameOffset++] = MAC_LTE_UEID_TAG;
frameBuffer[frameOffset++] = MAC_LTE_UEID_TAG;
tmp16 = htons(ueid);
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
/* Subframe number */
g_frameBuffer[g_frameOffset++] = MAC_LTE_SUBFRAME_TAG;
frameBuffer[frameOffset++] = MAC_LTE_SUBFRAME_TAG;
tmp16 = htons(subframeNumber); // frame counter : this will give an expert info as wireshark expects SF and not F
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
g_frameBuffer[g_frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
g_frameBuffer[g_frameOffset++] = crcStatus;
frameBuffer[frameOffset++] = MAC_LTE_CRC_STATUS_TAG;
frameBuffer[frameOffset++] = crcStatus;
#ifdef WIRESHARK_DEV
g_frameOffset += 2;
frameOffset += 2;
tmp16 = htons(subframeNumber); // subframe
memcpy(g_frameBuffer+g_frameOffset, &tmp16, 2);
g_frameOffset += 2;
memcpy(frameBuffer+frameOffset, &tmp16, 2);
frameOffset += 2;
#endif
/***********************************************************/
/* For these optional fields, no need to encode if value is default */
if (!isPredefinedData) {
g_frameBuffer[g_frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
g_frameBuffer[g_frameOffset++] = isPredefinedData;
frameBuffer[frameOffset++] = MAC_LTE_PREDEFINED_DATA_TAG;
frameBuffer[frameOffset++] = isPredefinedData;
}
if (retx != 0) {
g_frameBuffer[g_frameOffset++] = MAC_LTE_RETX_TAG;
g_frameBuffer[g_frameOffset++] = retx;
frameBuffer[frameOffset++] = MAC_LTE_RETX_TAG;
frameBuffer[frameOffset++] = retx;
}
#ifdef WIRESHARK_DEV
......@@ -347,19 +342,19 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
switch (oob_event) {
case ltemac_send_preamble :
LOG_D(OPT,"oob event %d %d\n",ltemac_send_preamble );
//g_frameBuffer[g_frameOffset++]=0;
//g_frameBuffer[g_frameOffset++]=0;
//g_frameBuffer[g_frameOffset++]=0;
g_frameBuffer[g_frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
g_frameBuffer[g_frameOffset++]=ltemac_send_preamble;
g_frameBuffer[g_frameOffset++]=rnti; // is the preamble
g_frameBuffer[g_frameOffset++]=oob_event_value;
//frameBuffer[frameOffset++]=0;
//frameBuffer[frameOffset++]=0;
//frameBuffer[frameOffset++]=0;
frameBuffer[frameOffset++] = MAC_LTE_OOB_EVENT_TAG;
frameBuffer[frameOffset++]=ltemac_send_preamble;
frameBuffer[frameOffset++]=rnti; // is the preamble
frameBuffer[frameOffset++]=oob_event_value;
break;
case ltemac_send_sr:
g_frameBuffer[g_frameOffset++]=ltemac_send_sr;
g_frameOffset+=2;
g_frameBuffer[g_frameOffset++]=oob_event_value;
frameBuffer[frameOffset++]=ltemac_send_sr;
frameOffset+=2;
frameBuffer[frameOffset++]=oob_event_value;
break;
case ltemac_sr_failure:
......@@ -372,23 +367,23 @@ static void SendFrame(guint8 radioType, guint8 direction, guint8 rntiType,
#endif
/***************************************/
/* Now write the MAC PDU */
g_frameBuffer[g_frameOffset++] = MAC_LTE_PAYLOAD_TAG;
frameBuffer[frameOffset++] = MAC_LTE_PAYLOAD_TAG;
/* Append actual PDU */
//memcpy(g_frameBuffer+g_frameOffset, g_PDUBuffer, g_PDUOffset);
//g_frameOffset += g_PDUOffset;
//memcpy(frameBuffer+frameOffset, g_PDUBuffer, g_PDUOffset);
//frameOffset += g_PDUOffset;
if (pdu_buffer != NULL) {
memcpy(g_frameBuffer+g_frameOffset, (void*)pdu_buffer, pdu_buffer_size);
g_frameOffset += pdu_buffer_size;
memcpy(frameBuffer+frameOffset, (void*)pdu_buffer, pdu_buffer_size);
frameOffset += pdu_buffer_size;
}
/* Send out the data over the UDP socket */
bytesSent = sendto(g_socksd, g_frameBuffer, g_frameOffset, 0,
bytesSent = sendto(g_socksd, frameBuffer, frameOffset, 0,
(const struct sockaddr *)&g_serv_addr, sizeof(g_serv_addr));
if (bytesSent != g_frameOffset) {
if (bytesSent != frameOffset) {
LOG_W(OPT, "sendto() failed (not a thread-safe func)- expected %d bytes, got %d (errno=%d)\n",
g_frameOffset, bytesSent, errno);
frameOffset, bytesSent, errno);
//exit(1);
}
}
......@@ -509,6 +504,7 @@ void trace_pdu(int direction, uint8_t *pdu_buffer, unsigned int pdu_buffer_size,
/*---------------------------------------------------*/
int init_opt(char *path, char *ip, char *port, radio_type_t radio_type_p)
{
uint16_t in_port;
subframesSinceCaptureStart = 0;
if (path != NULL) {
......@@ -612,37 +608,4 @@ void terminate_opt(void)
break;
}
}
/*
double *timing_analyzer(int index, int direction ){
//
int i;
if (direction==0)// in
{
timing_in[index]=clock();
//if(timing_out[index+100]>timing_in[index+100]);
//timing_perf[index+100] +=(double)((double)(timing_out[index+100]-timing_in[index+100])/(double)CLOCKS_PER_SEC);
}
else
{
timing_out[index]=clock();
if(index==5)timing_perf[index]=0;
timing_perf[index] +=(double)((double)(timing_out[index]-timing_in[index])/(((double)CLOCKS_PER_SEC)/1000000));
//LOG_I(OPT,"timing_analyser index %d =%f\n",index,timing_perf[index]);
init_value++;
if(init_value==500)
{
for(i=0;i<6;i++)
{
LOG_I(OPT,"timing_analyser index %d =%f\n",i,timing_perf[i]);
}
init_value=0;
}
return(&timing_perf[0]);
}
}
*/
......@@ -49,15 +49,16 @@ NUM_eNB=1
NUM_TRIALS=3
PRB=[25,50,100]
MCS=[0,4,9,10,13,16,17,22,27]
MCS=[3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28]
#MCS=[0,4,9,10,13,16,17,22,27]
#PRB=[100]
#MCS=[16]
ANT_TX=1 # 2
ANT_TX=2 # 2
ANT_RX=2 # 2
CHANNEL=["N"]
#CHANNEL=["C","E","F","G","H","I","L","M"] # A,B,C,D,E,F,
TX_MODE=2 # 2,
MIN_SNR=0
MIN_SNR=10
MAX_SNR=40
PERF=75
OPT="-L"
......@@ -69,9 +70,9 @@ FRAME=2000
def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
case = '10'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
oai.send('cd $OPENAIR_TARGETS;')
oai.send('cd bin;')
oai.send('cp ./ulsim.Rel10 ./ulsim.Rel10.'+host)
try:
log.start()
test = '300'
......@@ -80,13 +81,13 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
diag = 'ulsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + host + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + host + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'Exiting', 30)
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + host + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8.'+ host + ' ' + conf + tee, 'FATAL', 30)
oai.send_expect_false('./ulsim.Rel10.'+ host + ' ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
......@@ -100,27 +101,32 @@ def execute(oai, user, pw, host,logfile,logdir,debug,cpu):
diag = 'no diagnostic is available, check the log file'
for i in range(len(PRB)):
for o in range(len(CHANNEL)):
MIN_SNR=0
MIN_SNR=10
for j in range(len(MCS)):
for m in range (1,ANT_RX):
for p in range(1,TX_MODE):
for r in range(5,PRB[i]):
for q in range(MIN_SNR,MAX_SNR):
#if if PRB[i] :
conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
if r ==7 or r ==11 or r ==14 or r == 17 or r==19 or r == 21 or r == 23 or r == 26 or r == 28 :
continue
conf = '-B' + str(PRB[i]) + ' -r'+str(r) + ' -m'+str(MCS[j]) + ' -y'+str(m) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -e.1 -P -n'+str(FRAME)+' -O'+str(PERF)+' '+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+ '_rb'+str(r)+'_mcs'+ str(MCS[j])+ '_antrx' + str(m) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
tee = ' 2>&1 | tee ' + trace
if cpu > -1 :
cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.rel8.'+ host + ' ' + conf + tee
cmd = 'taskset -c ' + str(cpu) + ' ./ulsim.Rel10.'+ host + ' ' + conf + tee
else :
cmd = './ulsim.rel8.'+ host + ' ' + conf + tee
cmd = './ulsim.Rel10.'+ host + ' ' + conf + tee
if debug :
print cmd
# match = oai.send_expect_re(cmd, 'passed', 0, 1000)
match =1
match = oai.send_expect_re(cmd, 'passed', 0, 1000)
#match =1
if match :
log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q - 1 # just to speed up the test
test+=1
......
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