Commit 388ad205 authored by Navid Nikaein's avatar Navid Nikaein

*update dlsim to capture overall timing

*add performance measurment test cases
*update the start_one_eNB_multi_UE_nas script



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5151 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 3dfe046c
...@@ -233,7 +233,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN ...@@ -233,7 +233,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
memcpy(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->b, memcpy(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->b,
a, a,
phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3); phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3);
LOG_D(PHY, "eNB %d dlsch_encoding_emul pmch , tbs is %d \n", LOG_D(PHY, "[eNB %d] dlsch_encoding_emul pmch , tbs is %d \n",
phy_vars_eNB->Mod_id, phy_vars_eNB->Mod_id,
phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3); phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->TBS>>3);
......
...@@ -32,3 +32,15 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti ...@@ -32,3 +32,15 @@ void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_ti
} }
} }
double get_time_meas_us(time_stats_t *ts){
static double cpu_freq_GHz = 0.0;
if (cpu_freq_GHz == 0.0)
cpu_freq_GHz = get_cpu_freq_GHz();
if (ts->trials>0)
return (ts->diff/ts->trials/cpu_freq_GHz/1000.0);
}
...@@ -17,6 +17,7 @@ static inline void start_meas(time_stats_t *ts) __attribute__((always_inline)); ...@@ -17,6 +17,7 @@ static inline void start_meas(time_stats_t *ts) __attribute__((always_inline));
static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline)); static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time); void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
double get_time_meas_us(time_stats_t *ts);
#if defined(__i386__) #if defined(__i386__)
static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline)); static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline));
......
...@@ -512,6 +512,7 @@ typedef struct ...@@ -512,6 +512,7 @@ typedef struct
time_stats_t ulsch_multiplexing_stats; time_stats_t ulsch_multiplexing_stats;
time_stats_t ofdm_demod_stats; time_stats_t ofdm_demod_stats;
time_stats_t dlsch_rx_pdcch_stats;
time_stats_t rx_dft_stats; time_stats_t rx_dft_stats;
time_stats_t dlsch_channel_estimation_stats; time_stats_t dlsch_channel_estimation_stats;
time_stats_t dlsch_freq_offset_estimation_stats; time_stats_t dlsch_freq_offset_estimation_stats;
......
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
*******************************************************************************/
/*! \file dlsim.c
\brief Top-level DL simulator
\author R. Knopp
\date 2011
\version 0.1
\company Eurecom
\email: knopp@eurecom.fr
\note
\warning
*/
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <unistd.h> #include <unistd.h>
...@@ -217,6 +257,8 @@ int main(int argc, char **argv) { ...@@ -217,6 +257,8 @@ int main(int argc, char **argv) {
int re_allocated; int re_allocated;
FILE *bler_fd; FILE *bler_fd;
char bler_fname[256]; char bler_fname[256];
FILE *time_meas_fd;
char time_meas_fname[256];
FILE *tikz_fd; FILE *tikz_fd;
char tikz_fname[256]; char tikz_fname[256];
...@@ -274,12 +316,16 @@ int main(int argc, char **argv) { ...@@ -274,12 +316,16 @@ int main(int argc, char **argv) {
int common_flag=0,TPC=0; int common_flag=0,TPC=0;
double cpu_freq_GHz; double cpu_freq_GHz;
time_stats_t ts,sts,usts; time_stats_t ts;//,sts,usts;
int avg_iter,iter_trials; int avg_iter,iter_trials;
int rballocset=0; int rballocset=0;
int print_perf=0; int print_perf=0;
int test_perf=0;
int llr8_flag=0; int llr8_flag=0;
double effective_rate=0.0;
char channel_model_input[10];
opp_enabled=1; // to enable the time meas opp_enabled=1; // to enable the time meas
cpu_freq_GHz = (double)get_cpu_freq_GHz(); cpu_freq_GHz = (double)get_cpu_freq_GHz();
...@@ -296,7 +342,7 @@ int main(int argc, char **argv) { ...@@ -296,7 +342,7 @@ int main(int argc, char **argv) {
snr0 = 0; snr0 = 0;
num_layers = 1; num_layers = 1;
while ((c = getopt (argc, argv, "hadpDe:m:n:o:s:f:t:c:g:r:F:x:y:z:MN:I:i:R:S:C:T:b:u:v:w:B:PLl:")) != -1) { while ((c = getopt (argc, argv, "hadpDe:m:n:o:s:f:t:c:g:r:F:x:y:z:MN:I:i:O:R:S:C:T:b:u:v:w:B:PLl:")) != -1) {
switch (c) switch (c)
{ {
case 'a': case 'a':
...@@ -360,6 +406,7 @@ int main(int argc, char **argv) { ...@@ -360,6 +406,7 @@ int main(int argc, char **argv) {
num_pdcch_symbols=atoi(optarg); num_pdcch_symbols=atoi(optarg);
break; break;
case 'g': case 'g':
sprintf(channel_model_input,optarg,10);
switch((char)*optarg) { switch((char)*optarg) {
case 'A': case 'A':
channel_model=SCM_A; channel_model=SCM_A;
...@@ -481,7 +528,6 @@ int main(int argc, char **argv) { ...@@ -481,7 +528,6 @@ int main(int argc, char **argv) {
break; break;
case 'P': case 'P':
print_perf=1; print_perf=1;
break; break;
case 'L': case 'L':
llr8_flag=1; llr8_flag=1;
...@@ -489,6 +535,10 @@ int main(int argc, char **argv) { ...@@ -489,6 +535,10 @@ int main(int argc, char **argv) {
case 'l': case 'l':
offset_mumimo_llr_drange_fix=atoi(optarg); offset_mumimo_llr_drange_fix=atoi(optarg);
break; break;
case 'O':
test_perf=atoi(optarg);
//print_perf =1;
break;
case 'h': case 'h':
default: default:
printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs -n n_frames -s snr0 -x transmission mode (1,2,5,6) -y TXant -z RXant -I trch_file\n",argv[0]); printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs -n n_frames -s snr0 -x transmission mode (1,2,5,6) -y TXant -z RXant -I trch_file\n",argv[0]);
...@@ -512,6 +562,7 @@ int main(int argc, char **argv) { ...@@ -512,6 +562,7 @@ int main(int argc, char **argv) {
printf("-R Number of HARQ rounds (fixed)\n"); printf("-R Number of HARQ rounds (fixed)\n");
printf("-M Turns on calibration mode for abstraction.\n"); printf("-M Turns on calibration mode for abstraction.\n");
printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n"); printf("-N Determines the number of Channel Realizations in Abstraction mode. Default value is 1. \n");
printf("-O Set the percenatge of effective rate to testbench the modem performance (typically 30 and 70, range 1-100) \n");
printf("-I Input filename for TrCH data (binary)\n"); printf("-I Input filename for TrCH data (binary)\n");
printf("-u Determines if the 2 streams at the UE are decoded or not. 0-->U2 is interference only and 1-->U2 is detected\n"); printf("-u Determines if the 2 streams at the UE are decoded or not. 0-->U2 is interference only and 1-->U2 is detected\n");
exit(1); exit(1);
...@@ -598,7 +649,7 @@ int main(int argc, char **argv) { ...@@ -598,7 +649,7 @@ int main(int argc, char **argv) {
nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12; nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12;
printf("Channel Model=%d\n",channel_model); printf("Channel Model= (%s,%d)\n",channel_model_input, channel_model);
printf("SCM-A=%d, SCM-B=%d, SCM-C=%d, SCM-D=%d, EPA=%d, EVA=%d, ETU=%d, Rayleigh8=%d, Rayleigh1=%d, Rayleigh1_corr=%d, Rayleigh1_anticorr=%d, Rice1=%d, Rice8=%d\n", printf("SCM-A=%d, SCM-B=%d, SCM-C=%d, SCM-D=%d, EPA=%d, EVA=%d, ETU=%d, Rayleigh8=%d, Rayleigh1=%d, Rayleigh1_corr=%d, Rayleigh1_anticorr=%d, Rice1=%d, Rice8=%d\n",
SCM_A, SCM_B, SCM_C, SCM_D, EPA, EVA, ETU, Rayleigh8, Rayleigh1, Rayleigh1_corr, Rayleigh1_anticorr, Rice1, Rice8); SCM_A, SCM_B, SCM_C, SCM_D, EPA, EVA, ETU, Rayleigh8, Rayleigh1, Rayleigh1_corr, Rayleigh1_anticorr, Rice1, Rice8);
...@@ -610,6 +661,12 @@ int main(int argc, char **argv) { ...@@ -610,6 +661,12 @@ int main(int argc, char **argv) {
bler_fd = fopen(bler_fname,"w"); bler_fd = fopen(bler_fname,"w");
fprintf(bler_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n"); fprintf(bler_fd,"SNR; MCS; TBS; rate; err0; trials0; err1; trials1; err2; trials2; err3; trials3; dci_err\n");
if (test_perf != 0) {
sprintf(time_meas_fname,"%s/TEST/OAI/PERF/time_meas_prb%d_mcs%d_anttx%d_antrx%d_pdcch%d_channel%s_tx%d.csv",
getenv("OPENAIR_TARGETS"),
N_RB_DL,mcs,n_tx,n_rx,num_pdcch_symbols,channel_model_input,transmission_mode);
time_meas_fd = fopen(time_meas_fname,"w");
}
if(abstx){ if(abstx){
// CSV file // CSV file
...@@ -1231,14 +1288,17 @@ int main(int argc, char **argv) { ...@@ -1231,14 +1288,17 @@ int main(int argc, char **argv) {
round=0; round=0;
avg_iter = 0; iter_trials=0; avg_iter = 0; iter_trials=0;
reset_meas(&sts); reset_meas(&PHY_vars_eNB->phy_proc_tx); // total eNB tx
reset_meas(&usts); reset_meas(&PHY_vars_eNB->dlsch_scrambling_stats);
reset_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
reset_meas(&PHY_vars_eNB->ofdm_mod_stats); reset_meas(&PHY_vars_eNB->ofdm_mod_stats);
reset_meas(&PHY_vars_eNB->dlsch_modulation_stats); reset_meas(&PHY_vars_eNB->dlsch_modulation_stats);
reset_meas(&PHY_vars_eNB->dlsch_encoding_stats); reset_meas(&PHY_vars_eNB->dlsch_encoding_stats);
reset_meas(&PHY_vars_eNB->dlsch_interleaving_stats); reset_meas(&PHY_vars_eNB->dlsch_interleaving_stats);
reset_meas(&PHY_vars_eNB->dlsch_rate_matching_stats); reset_meas(&PHY_vars_eNB->dlsch_rate_matching_stats);
reset_meas(&PHY_vars_eNB->dlsch_turbo_encoding_stats); reset_meas(&PHY_vars_eNB->dlsch_turbo_encoding_stats);
reset_meas(&PHY_vars_UE->phy_proc_rx); // total UE rx
reset_meas(&PHY_vars_UE->ofdm_demod_stats); reset_meas(&PHY_vars_UE->ofdm_demod_stats);
reset_meas(&PHY_vars_UE->dlsch_channel_estimation_stats); reset_meas(&PHY_vars_UE->dlsch_channel_estimation_stats);
reset_meas(&PHY_vars_UE->dlsch_freq_offset_estimation_stats); reset_meas(&PHY_vars_UE->dlsch_freq_offset_estimation_stats);
...@@ -1288,6 +1348,8 @@ int main(int argc, char **argv) { ...@@ -1288,6 +1348,8 @@ int main(int argc, char **argv) {
if (input_fd==NULL) { if (input_fd==NULL) {
start_meas(&PHY_vars_eNB->phy_proc_tx);
// Simulate HARQ procedures!!! // Simulate HARQ procedures!!!
if (common_flag == 0) { if (common_flag == 0) {
...@@ -1511,14 +1573,14 @@ int main(int argc, char **argv) { ...@@ -1511,14 +1573,14 @@ int main(int argc, char **argv) {
stop_meas(&PHY_vars_eNB->dlsch_encoding_stats); stop_meas(&PHY_vars_eNB->dlsch_encoding_stats);
PHY_vars_eNB->dlsch_eNB[k][0]->rnti = (common_flag==0) ? n_rnti+k : SI_RNTI; PHY_vars_eNB->dlsch_eNB[k][0]->rnti = (common_flag==0) ? n_rnti+k : SI_RNTI;
start_meas(&sts); start_meas(&PHY_vars_eNB->dlsch_scrambling_stats);
dlsch_scrambling(&PHY_vars_eNB->lte_frame_parms, dlsch_scrambling(&PHY_vars_eNB->lte_frame_parms,
0, 0,
PHY_vars_eNB->dlsch_eNB[k][0], PHY_vars_eNB->dlsch_eNB[k][0],
coded_bits_per_codeword, coded_bits_per_codeword,
0, 0,
subframe<<1); subframe<<1);
stop_meas(&sts); stop_meas(&PHY_vars_eNB->dlsch_scrambling_stats);
if (n_frames==1) { if (n_frames==1) {
for (s=0;s<PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->C;s++) { for (s=0;s<PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->C;s++) {
if (s<PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->Cminus) if (s<PHY_vars_eNB->dlsch_eNB[k][0]->harq_processes[0]->Cminus)
...@@ -1573,6 +1635,7 @@ int main(int argc, char **argv) { ...@@ -1573,6 +1635,7 @@ int main(int argc, char **argv) {
&PHY_vars_eNB->lte_frame_parms); &PHY_vars_eNB->lte_frame_parms);
stop_meas(&PHY_vars_eNB->ofdm_mod_stats); stop_meas(&PHY_vars_eNB->ofdm_mod_stats);
stop_meas(&PHY_vars_eNB->phy_proc_tx);
do_OFDM_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id], do_OFDM_mod(PHY_vars_eNB->lte_eNB_common_vars.txdataF[eNB_id],
PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id], PHY_vars_eNB->lte_eNB_common_vars.txdata[eNB_id],
...@@ -1773,6 +1836,7 @@ int main(int argc, char **argv) { ...@@ -1773,6 +1836,7 @@ int main(int argc, char **argv) {
pilot3 = 9; pilot3 = 9;
} }
start_meas(&PHY_vars_UE->phy_proc_rx);
// Inner receiver scheduling for 3 slots // Inner receiver scheduling for 3 slots
for (Ns=(2*subframe);Ns<((2*subframe)+3);Ns++) { for (Ns=(2*subframe);Ns<((2*subframe)+3);Ns++) {
for (l=0;l<pilot2;l++) { for (l=0;l<pilot2;l++) {
...@@ -1790,6 +1854,7 @@ int main(int argc, char **argv) { ...@@ -1790,6 +1854,7 @@ int main(int argc, char **argv) {
no_prefix if 1 prefix is removed by HW no_prefix if 1 prefix is removed by HW
*/ */
start_meas(&PHY_vars_UE->ofdm_demod_stats); start_meas(&PHY_vars_UE->ofdm_demod_stats);
slot_fep(PHY_vars_UE, slot_fep(PHY_vars_UE,
l, l,
...@@ -1876,7 +1941,7 @@ int main(int argc, char **argv) { ...@@ -1876,7 +1941,7 @@ int main(int argc, char **argv) {
if (dci_flag == 1) { if (dci_flag == 1) {
PHY_vars_UE->UE_mode[0] = PUSCH; PHY_vars_UE->UE_mode[0] = PUSCH;
start_meas(&PHY_vars_UE->dlsch_rx_pdcch_stats);
rx_pdcch(&PHY_vars_UE->lte_ue_common_vars, rx_pdcch(&PHY_vars_UE->lte_ue_common_vars,
PHY_vars_UE->lte_ue_pdcch_vars, PHY_vars_UE->lte_ue_pdcch_vars,
&PHY_vars_UE->lte_frame_parms, &PHY_vars_UE->lte_frame_parms,
...@@ -1884,7 +1949,7 @@ int main(int argc, char **argv) { ...@@ -1884,7 +1949,7 @@ int main(int argc, char **argv) {
0, 0,
(PHY_vars_UE->lte_frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI, (PHY_vars_UE->lte_frame_parms.mode1_flag == 1) ? SISO : ALAMOUTI,
0); 0);
stop_meas(&PHY_vars_UE->dlsch_rx_pdcch_stats);
// overwrite number of pdcch symbols // overwrite number of pdcch symbols
PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols; PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols = num_pdcch_symbols;
...@@ -2076,7 +2141,7 @@ int main(int argc, char **argv) { ...@@ -2076,7 +2141,7 @@ int main(int argc, char **argv) {
} }
stop_meas(&PHY_vars_UE->dlsch_llr_stats); stop_meas(&PHY_vars_UE->dlsch_llr_stats);
} }
if (test_perf ==0 ) {
if ((n_frames==1) && (Ns==(2+(2*subframe))) && (l==0)) { if ((n_frames==1) && (Ns==(2+(2*subframe))) && (l==0)) {
write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8); write_output("ch0.m","ch0",eNB2UE[0]->ch[0],eNB2UE[0]->channel_length,1,8);
if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1) if (PHY_vars_eNB->lte_frame_parms.nb_antennas_tx>1)
...@@ -2119,7 +2184,7 @@ int main(int argc, char **argv) { ...@@ -2119,7 +2184,7 @@ int main(int argc, char **argv) {
write_output("pdcch_rxF_llr.m","pdcch_llr",PHY_vars_UE->lte_ue_pdcch_vars[eNB_id]->llr,2400,1,4); write_output("pdcch_rxF_llr.m","pdcch_llr",PHY_vars_UE->lte_ue_pdcch_vars[eNB_id]->llr,2400,1,4);
} }
}
} }
} }
} }
...@@ -2163,7 +2228,7 @@ int main(int argc, char **argv) { ...@@ -2163,7 +2228,7 @@ int main(int argc, char **argv) {
write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0); write_output("uncoded_ber_bit.m","uncoded_ber_bit",uncoded_ber_bit,coded_bits_per_codeword,1,0);
start_meas(&usts); start_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms, dlsch_unscrambling(&PHY_vars_UE->lte_frame_parms,
0, 0,
PHY_vars_UE->dlsch_ue[0][0], PHY_vars_UE->dlsch_ue[0][0],
...@@ -2171,7 +2236,7 @@ int main(int argc, char **argv) { ...@@ -2171,7 +2236,7 @@ int main(int argc, char **argv) {
PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[0], PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->llr[0],
0, 0,
subframe<<1); subframe<<1);
stop_meas(&usts); stop_meas(&PHY_vars_UE->dlsch_unscrambling_stats);
start_meas(&PHY_vars_UE->dlsch_decoding_stats); start_meas(&PHY_vars_UE->dlsch_decoding_stats);
ret = dlsch_decoding(PHY_vars_UE, ret = dlsch_decoding(PHY_vars_UE,
...@@ -2184,6 +2249,8 @@ int main(int argc, char **argv) { ...@@ -2184,6 +2249,8 @@ int main(int argc, char **argv) {
1,llr8_flag); 1,llr8_flag);
stop_meas(&PHY_vars_UE->dlsch_decoding_stats); stop_meas(&PHY_vars_UE->dlsch_decoding_stats);
stop_meas(&PHY_vars_UE->phy_proc_rx);
if (ret <= PHY_vars_UE->dlsch_ue[0][0]->max_turbo_iterations) { if (ret <= PHY_vars_UE->dlsch_ue[0][0]->max_turbo_iterations) {
avg_iter += ret; avg_iter += ret;
...@@ -2285,6 +2352,9 @@ int main(int argc, char **argv) { ...@@ -2285,6 +2352,9 @@ int main(int argc, char **argv) {
PHY_vars_UE->frame++; PHY_vars_UE->frame++;
} //trials } //trials
effective_rate = ((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3]));
printf("\n**********************SNR = %f dB (tx_lev %f, sigma2_dB %f)**************************\n", printf("\n**********************SNR = %f dB (tx_lev %f, sigma2_dB %f)**************************\n",
SNR, SNR,
(double)tx_lev_dB+10*log10(PHY_vars_UE->lte_frame_parms.ofdm_symbol_size/(NB_RB*12)), (double)tx_lev_dB+10*log10(PHY_vars_UE->lte_frame_parms.ofdm_symbol_size/(NB_RB*12)),
...@@ -2306,28 +2376,32 @@ int main(int argc, char **argv) { ...@@ -2306,28 +2376,32 @@ int main(int argc, char **argv) {
dci_errors, dci_errors,
round_trials[0], round_trials[0],
(double)dci_errors/(round_trials[0]), (double)dci_errors/(round_trials[0]),
rate*((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3])), rate*effective_rate,
100*((double)(round_trials[0]-dci_errors)/((double)round_trials[0] + round_trials[1] + round_trials[2] + round_trials[3])), 100*effective_rate,
rate, rate,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS, (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])); (1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
if (print_perf==1) { if (print_perf==1) {
printf("eNB TX function statistics (per 1ms subframe)\n\n"); printf("eNB TX function statistics (per 1ms subframe)\n\n");
printf("Total PHY proc tx :%f us (%d trials)\n",(double)PHY_vars_eNB->phy_proc_tx.diff/PHY_vars_eNB->phy_proc_tx.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->phy_proc_tx.trials);
printf("OFDM_mod time :%f us (%d trials)\n",(double)PHY_vars_eNB->ofdm_mod_stats.diff/PHY_vars_eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->ofdm_mod_stats.trials); printf("OFDM_mod time :%f us (%d trials)\n",(double)PHY_vars_eNB->ofdm_mod_stats.diff/PHY_vars_eNB->ofdm_mod_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->ofdm_mod_stats.trials);
printf("DLSCH modulation time :%f us (%d trials)\n",(double)PHY_vars_eNB->dlsch_modulation_stats.diff/PHY_vars_eNB->dlsch_modulation_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_modulation_stats.trials); printf("DLSCH modulation time :%f us (%d trials)\n",(double)PHY_vars_eNB->dlsch_modulation_stats.diff/PHY_vars_eNB->dlsch_modulation_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_modulation_stats.trials);
printf("DLSCH scrambling time :%f us (%d trials)\n",(double)sts.diff/sts.trials/cpu_freq_GHz/1000.0,sts.trials); printf("DLSCH scrambling time :%f us (%d trials)\n",(double)PHY_vars_eNB->dlsch_scrambling_stats.diff/PHY_vars_eNB->dlsch_scrambling_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_scrambling_stats.trials);
printf("DLSCH encoding time :%f us (%d trials)\n",(double)PHY_vars_eNB->dlsch_encoding_stats.diff/PHY_vars_eNB->dlsch_encoding_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_modulation_stats.trials); printf("DLSCH encoding time :%f us (%d trials)\n",(double)PHY_vars_eNB->dlsch_encoding_stats.diff/PHY_vars_eNB->dlsch_encoding_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_modulation_stats.trials);
printf("|__ DLSCH turbo encoding time :%f us (%d trials)\n",((double)PHY_vars_eNB->dlsch_turbo_encoding_stats.trials/PHY_vars_eNB->dlsch_encoding_stats.trials)*(double)PHY_vars_eNB->dlsch_turbo_encoding_stats.diff/PHY_vars_eNB->dlsch_turbo_encoding_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_turbo_encoding_stats.trials); printf("|__ DLSCH turbo encoding time :%f us (%d trials)\n",((double)PHY_vars_eNB->dlsch_turbo_encoding_stats.trials/PHY_vars_eNB->dlsch_encoding_stats.trials)*(double)PHY_vars_eNB->dlsch_turbo_encoding_stats.diff/PHY_vars_eNB->dlsch_turbo_encoding_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_turbo_encoding_stats.trials);
printf("|__ DLSCH rate-matching time :%f us (%d trials)\n",((double)PHY_vars_eNB->dlsch_rate_matching_stats.trials/PHY_vars_eNB->dlsch_encoding_stats.trials)*(double)PHY_vars_eNB->dlsch_rate_matching_stats.diff/PHY_vars_eNB->dlsch_rate_matching_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_rate_matching_stats.trials); printf("|__ DLSCH rate-matching time :%f us (%d trials)\n",((double)PHY_vars_eNB->dlsch_rate_matching_stats.trials/PHY_vars_eNB->dlsch_encoding_stats.trials)*(double)PHY_vars_eNB->dlsch_rate_matching_stats.diff/PHY_vars_eNB->dlsch_rate_matching_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_rate_matching_stats.trials);
printf("|__ DLSCH sub-block interleaving time :%f us (%d trials)\n",((double)PHY_vars_eNB->dlsch_interleaving_stats.trials/PHY_vars_eNB->dlsch_encoding_stats.trials)*(double)PHY_vars_eNB->dlsch_interleaving_stats.diff/PHY_vars_eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_interleaving_stats.trials); printf("|__ DLSCH sub-block interleaving time :%f us (%d trials)\n",((double)PHY_vars_eNB->dlsch_interleaving_stats.trials/PHY_vars_eNB->dlsch_encoding_stats.trials)*(double)PHY_vars_eNB->dlsch_interleaving_stats.diff/PHY_vars_eNB->dlsch_interleaving_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_eNB->dlsch_interleaving_stats.trials);
printf("\n\nUE RX function statistics (per 1ms subframe)\n\n"); printf("\n\nUE RX function statistics (per 1ms subframe)\n\n");
printf("Total PHY proc rx :%f us (%d trials)\n",(double)PHY_vars_UE->phy_proc_rx.diff/PHY_vars_UE->phy_proc_rx.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->phy_proc_rx.trials*2/3);
printf("DLSCH OFDM demodulation and channel_estimation time :%f us (%d trials)\n",(nsymb)*(double)PHY_vars_UE->ofdm_demod_stats.diff/PHY_vars_UE->ofdm_demod_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->ofdm_demod_stats.trials*2/3); printf("DLSCH OFDM demodulation and channel_estimation time :%f us (%d trials)\n",(nsymb)*(double)PHY_vars_UE->ofdm_demod_stats.diff/PHY_vars_UE->ofdm_demod_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->ofdm_demod_stats.trials*2/3);
printf("|__ DLSCH rx dft :%f us (%d trials)\n",(nsymb*PHY_vars_UE->lte_frame_parms.nb_antennas_rx)*(double)PHY_vars_UE->rx_dft_stats.diff/PHY_vars_UE->rx_dft_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->rx_dft_stats.trials*2/3); printf("|__ DLSCH rx dft :%f us (%d trials)\n",(nsymb*PHY_vars_UE->lte_frame_parms.nb_antennas_rx)*(double)PHY_vars_UE->rx_dft_stats.diff/PHY_vars_UE->rx_dft_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->rx_dft_stats.trials*2/3);
printf("|__ DLSCH channel estimation time :%f us (%d trials)\n",(4.0)*(double)PHY_vars_UE->dlsch_channel_estimation_stats.diff/PHY_vars_UE->dlsch_channel_estimation_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_channel_estimation_stats.trials*2/3); printf("|__ DLSCH channel estimation time :%f us (%d trials)\n",(4.0)*(double)PHY_vars_UE->dlsch_channel_estimation_stats.diff/PHY_vars_UE->dlsch_channel_estimation_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_channel_estimation_stats.trials*2/3);
printf("|__ DLSCH frequency offset estimation time :%f us (%d trials)\n",(4.0)*(double)PHY_vars_UE->dlsch_freq_offset_estimation_stats.diff/PHY_vars_UE->dlsch_freq_offset_estimation_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_freq_offset_estimation_stats.trials*2/3); printf("|__ DLSCH frequency offset estimation time :%f us (%d trials)\n",(4.0)*(double)PHY_vars_UE->dlsch_freq_offset_estimation_stats.diff/PHY_vars_UE->dlsch_freq_offset_estimation_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_freq_offset_estimation_stats.trials*2/3);
printf("DLSCH rx pdcch :%f us (%d trials)\n",(double)PHY_vars_UE->dlsch_rx_pdcch_stats.diff/PHY_vars_UE->dlsch_rx_pdcch_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_rx_pdcch_stats.trials);
printf("DLSCH Channel Compensation and LLR generation time :%f us (%d trials)\n",(3)*(double)PHY_vars_UE->dlsch_llr_stats.diff/PHY_vars_UE->dlsch_llr_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_llr_stats.trials/3); printf("DLSCH Channel Compensation and LLR generation time :%f us (%d trials)\n",(3)*(double)PHY_vars_UE->dlsch_llr_stats.diff/PHY_vars_UE->dlsch_llr_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_llr_stats.trials/3);
printf("DLSCH unscrambling time :%f us (%d trials)\n",(double)usts.diff/usts.trials/cpu_freq_GHz/1000.0,usts.trials); printf("DLSCH unscrambling time :%f us (%d trials)\n",(double)PHY_vars_UE->dlsch_unscrambling_stats.diff/PHY_vars_UE->dlsch_unscrambling_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_unscrambling_stats.trials);
printf("DLSCH Decoding time (%02.2f Mbit/s, avg iter %1.2f) :%f us (%d trials, max %f)\n", printf("DLSCH Decoding time (%02.2f Mbit/s, avg iter %1.2f) :%f us (%d trials, max %f)\n",
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS/1000.0,(double)avg_iter/iter_trials, PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS/1000.0,(double)avg_iter/iter_trials,
(double)PHY_vars_UE->dlsch_decoding_stats.diff/PHY_vars_UE->dlsch_decoding_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_decoding_stats.trials, (double)PHY_vars_UE->dlsch_decoding_stats.diff/PHY_vars_UE->dlsch_decoding_stats.trials/cpu_freq_GHz/1000.0,PHY_vars_UE->dlsch_decoding_stats.trials,
...@@ -2364,8 +2438,6 @@ int main(int argc, char **argv) { ...@@ -2364,8 +2438,6 @@ int main(int argc, char **argv) {
PHY_vars_UE->dlsch_tc_intl2_stats.trials); PHY_vars_UE->dlsch_tc_intl2_stats.trials);
} }
fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n", fprintf(bler_fd,"%f;%d;%d;%f;%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
SNR, SNR,
mcs, mcs,
...@@ -2395,6 +2467,80 @@ int main(int argc, char **argv) { ...@@ -2395,6 +2467,80 @@ int main(int argc, char **argv) {
} }
} //ABStraction } //ABStraction
if ( (test_perf != 0) && (100 * effective_rate > test_perf )) {
fprintf(time_meas_fd,"SNR; MCS; TBS; rate; DL_DECOD_ITER; err0; trials0; err1; trials1; err2; trials2; err3; trials3; PE; dci_err;PE;ND;\n");
fprintf(time_meas_fd,"%f;%d;%d;%f(%2.1f%%,%f);%f;%d;%d;%d;%d;%d;%d;%d;%d;(%e,%e,%e,%e);%d/%d;%e;%f(%f);\n",
SNR,
mcs,
PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
rate*effective_rate,
100*effective_rate,
rate,
(double)avg_iter/iter_trials,
errs[0],
round_trials[0],
errs[1],
round_trials[1],
errs[2],
round_trials[2],
errs[3],
round_trials[3],
(double)errs[0]/(round_trials[0]),
(double)errs[1]/(round_trials[0]),
(double)errs[2]/(round_trials[0]),
(double)errs[3]/(round_trials[0]),
dci_errors,
round_trials[0],
(double)dci_errors/(round_trials[0]),
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0])/(double)PHY_vars_eNB->dlsch_eNB[0][0]->harq_processes[0]->TBS,
(1.0*(round_trials[0]-errs[0])+2.0*(round_trials[1]-errs[1])+3.0*(round_trials[2]-errs[2])+4.0*(round_trials[3]-errs[3]))/((double)round_trials[0]));
fprintf(time_meas_fd,"eNB_PROC_TX(%d); OFDM_MOD(%d); DL_MOD(%d); DL_SCR(%d); DL_ENC(%d); UE_PROC_RX(%d); OFDM_DEMOD_CH_EST(%d); RX_PDCCH(%d); CH_COMP_LLR(%d); DL_DECOD(%d);\n",
PHY_vars_eNB->phy_proc_tx.trials,
PHY_vars_eNB->ofdm_mod_stats.trials,
PHY_vars_eNB->dlsch_modulation_stats.trials,
PHY_vars_eNB->dlsch_scrambling_stats.trials,
PHY_vars_eNB->dlsch_encoding_stats.trials,
PHY_vars_UE->phy_proc_rx.trials,
PHY_vars_UE->ofdm_demod_stats.trials,
PHY_vars_UE->dlsch_rx_pdcch_stats.trials,
PHY_vars_UE->dlsch_llr_stats.trials,
PHY_vars_UE->dlsch_unscrambling_stats.trials,
PHY_vars_UE->dlsch_decoding_stats.trials
);
fprintf(time_meas_fd,"%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;%f;",
get_time_meas_us(&PHY_vars_eNB->phy_proc_tx),
get_time_meas_us(&PHY_vars_eNB->ofdm_mod_stats),
get_time_meas_us(&PHY_vars_eNB->dlsch_modulation_stats),
get_time_meas_us(&PHY_vars_eNB->dlsch_scrambling_stats),
get_time_meas_us(&PHY_vars_eNB->dlsch_encoding_stats),
get_time_meas_us(&PHY_vars_UE->phy_proc_rx),
nsymb*get_time_meas_us(&PHY_vars_UE->ofdm_demod_stats),
get_time_meas_us(&PHY_vars_UE->dlsch_rx_pdcch_stats),
3*get_time_meas_us(&PHY_vars_UE->dlsch_llr_stats),
get_time_meas_us(&PHY_vars_UE->dlsch_unscrambling_stats),
get_time_meas_us(&PHY_vars_UE->dlsch_decoding_stats)
);
/*
fprintf(time_meas_fd,"%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;%d;",
PHY_vars_eNB->phy_proc_tx.trials,
PHY_vars_eNB->ofdm_mod_stats.trials,
PHY_vars_eNB->dlsch_modulation_stats.trials,
PHY_vars_eNB->dlsch_scrambling_stats.trials,
PHY_vars_eNB->dlsch_encoding_stats.trials,
PHY_vars_UE->phy_proc_rx.trials,
PHY_vars_UE->ofdm_demod_stats.trials,
PHY_vars_UE->dlsch_rx_pdcch_stats.trials,
PHY_vars_UE->dlsch_llr_stats.trials,
PHY_vars_UE->dlsch_unscrambling_stats.trials,
PHY_vars_UE->dlsch_decoding_stats.trials);
*/
printf("[passed] effective rate : %f (%2.1f%%,%f)): log and break \n",rate*effective_rate, 100*effective_rate, rate );
break;
} else if (test_perf !=0 ){
printf("[continue] effective rate : %f (%2.1f%%,%f)): increase snr \n",rate*effective_rate, 100*effective_rate, rate);
}
if (((double)errs[0]/(round_trials[0]))<1e-2) if (((double)errs[0]/(round_trials[0]))<1e-2)
break; break;
}// SNR }// SNR
...@@ -2404,6 +2550,8 @@ int main(int argc, char **argv) { ...@@ -2404,6 +2550,8 @@ int main(int argc, char **argv) {
fclose(bler_fd); fclose(bler_fd);
if (test_perf !=0)
fclose (time_meas_fd);
//fprintf(tikz_fd,"};\n"); //fprintf(tikz_fd,"};\n");
//fclose(tikz_fd); //fclose(tikz_fd);
......
/*******************************************************************************
Eurecom OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
This program is free software; you can redistribute it and/or modify it
under the terms and conditions of the GNU General Public License,
version 2, as published by the Free Software Foundation.
This program is distributed in the hope it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
The full GNU General Public License is included in this distribution in
the file called "COPYING".
Contact Information
Openair Admin: openair_admin@eurecom.fr
Openair Tech : openair_tech@eurecom.fr
Forums : http://forums.eurecom.fsr/openairinterface
Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
*******************************************************************************/
/*! \file ulsim.c
\brief Top-level DL simulator
\author R. Knopp
\date 2011
\version 0.1
\company Eurecom
\email: knopp@eurecom.fr
\note
\warning
*/
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
#include <unistd.h> #include <unistd.h>
......
...@@ -1087,8 +1087,13 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint ...@@ -1087,8 +1087,13 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint
bsr_len = bsr_ce_len + bsr_header_len; bsr_len = bsr_ce_len + bsr_header_len;
LOG_D(MAC,"[UE %d] header size info: dcch %d, dcch1 %d, dtch %d, bsr (ce%d,hdr%d) buff_len %d\n", LOG_D(MAC,"[UE %d] header size info: dcch %d, dcch1 %d, dtch %d, bsr (ce%d,hdr%d) buff_len %d\n",
module_idP, dcch_header_len,dcch1_header_len,dtch_header_len, bsr_ce_len, bsr_header_len, buflen); module_idP, dcch_header_len,dcch1_header_len,dtch_header_len, bsr_ce_len, bsr_header_len, buflen);
} else } else {
bsr_len = 0; bsr_len=0;
//LOG_D(MAC,"[UE %d] Empty buffers, send a long BSR to reset the bsr at eNB \n ",Mod_id);
// bsr_ce_len = sizeof(BSR_LONG);
//bsr_len = bsr_ce_len + bsr_header_len;
}
// check for UL bandwidth requests and add SR control element
// check for UL bandwidth requests and add SR control element // check for UL bandwidth requests and add SR control element
...@@ -1259,6 +1264,7 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint ...@@ -1259,6 +1264,7 @@ void ue_get_sdu(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint
bsr_s, // short bsr bsr_s, // short bsr
bsr_l, bsr_l,
post_padding); // long_bsr post_padding); // long_bsr
LOG_I(MAC,"[UE %d] Generate header :bufflen %d sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d, dcch_header_len %d, dtch_header_len %d, padding %d,post_padding %d, bsr len %d, phr len %d, reminder %d \n", LOG_I(MAC,"[UE %d] Generate header :bufflen %d sdu_length_total %d, num_sdus %d, sdu_lengths[0] %d, sdu_lcids[0] %d => payload offset %d, dcch_header_len %d, dtch_header_len %d, padding %d,post_padding %d, bsr len %d, phr len %d, reminder %d \n",
module_idP,buflen, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],payload_offset, dcch_header_len, dtch_header_len, module_idP,buflen, sdu_length_total,num_sdus,sdu_lengths[0],sdu_lcids[0],payload_offset, dcch_header_len, dtch_header_len,
short_padding,post_padding, bsr_len, phr_len,buflen-sdu_length_total-payload_offset); short_padding,post_padding, bsr_len, phr_len,buflen-sdu_length_total-payload_offset);
......
...@@ -157,6 +157,12 @@ boolean_t pdcp_data_req( ...@@ -157,6 +157,12 @@ boolean_t pdcp_data_req(
rlc_status = rlc_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p); rlc_status = rlc_data_req(enb_mod_idP, ue_mod_idP, frameP, enb_flagP, MBMS_FLAG_YES, rb_idP, muiP, confirmP, sdu_buffer_sizeP, pdcp_pdu_p);
} else { } else {
rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES; rlc_status = RLC_OP_STATUS_OUT_OF_RESSOURCES;
LOG_W(PDCP,"[FRAME %5u][%s][PDCP][MOD %u/%u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
frameP,
(enb_flagP) ? "eNB" : "UE",
enb_mod_idP,
ue_mod_idP,
rb_idP);
#if defined(STOP_ON_IP_TRAFFIC_OVERLOAD) #if defined(STOP_ON_IP_TRAFFIC_OVERLOAD)
AssertFatal(0, "[FRAME %5u][%s][PDCP][MOD %u/%u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n", AssertFatal(0, "[FRAME %5u][%s][PDCP][MOD %u/%u][RB %u] PDCP_DATA_REQ SDU DROPPED, OUT OF MEMORY \n",
frameP, frameP,
......
...@@ -24,7 +24,7 @@ if [ $1 -ge 2 ]; then ...@@ -24,7 +24,7 @@ if [ $1 -ge 2 ]; then
sudo ifconfig oai2 10.0.3.3 netmask 255.255.255.0 broadcast 10.0.3.255 sudo ifconfig oai2 10.0.3.3 netmask 255.255.255.0 broadcast 10.0.3.255
# enb -> ue2 # enb -> ue2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.1.1 -t 10.0.1.3 -r 14 $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i0 -z0 -s 10.0.1.1 -t 10.0.1.3 -r 17
# ue2 -> enb # ue2 -> enb
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i2 -z0 -s 10.0.3.3 -t 10.0.3.1 -r 3 $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c1 -i2 -z0 -s 10.0.3.3 -t 10.0.3.1 -r 3
fi fi
...@@ -34,7 +34,7 @@ if [ $1 -ge 3 ]; then ...@@ -34,7 +34,7 @@ if [ $1 -ge 3 ]; then
sudo ifconfig oai3 10.0.4.4 netmask 255.255.255.0 broadcast 10.0.4.255 sudo ifconfig oai3 10.0.4.4 netmask 255.255.255.0 broadcast 10.0.4.255
# enb -> ue2 # enb -> ue2
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s 10.0.1.1 -t 10.0.1.4 -r 25 $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i0 -z0 -s 10.0.1.1 -t 10.0.1.4 -r 31
# ue2 -> enb # ue2 -> enb
$OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i3 -z0 -s 10.0.4.4 -t 10.0.4.1 -r 3 $OPENAIR2_DIR/NAS/DRIVER/MESH/RB_TOOL/rb_tool -a -c2 -i3 -z0 -s 10.0.4.4 -t 10.0.4.1 -r 3
fi fi
......
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case02.py
# \brief test case 02 for OAI: executions
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import time
import random
import log
import openair
import core
NUM_UE=2
NUM_eNB=1
NUM_TRIALS=3
def execute(oai, user, pw, logfile,logdir):
case = '04'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '00'
name = 'Run oai.dlsim.sanity'
conf = '-a -A AWGN -n 100'
diag = 'dlsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '01'
name = 'Run oai.dlsim.test1'
diag = 'Test 1, 10 MHz, R2.FDD (MCS 5), EVA5, -1dB'
conf = '-m5 -gF -s-3.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test +'.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.dlsim.test5'
diag = 'Test 5, 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)'
conf = '-m4 -gF -s-2 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.dlsim.test6'
diag = 'Test 6, 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m15 -gF -s4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06b'
name = 'Run oai.dlsim.test6b'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m14 -gF -s4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '07'
name = 'Run oai.dlsim.test7'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)'
conf = '-m15 -gG -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '07b'
name = 'Run oai.dlsim.test7b'
diag = 'Test 7b, 5 MHz, R3-1.FDD (MCS 15), ETU70, 1.4 dB (30%)'
conf = '-m14 -gG -s-1 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O30'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10'
name = 'Run oai.dlsim.test10'
diag = 'Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)'
conf = '-m25 -gF -s13 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10b'
name = 'Run oai.dlsim.test10b'
diag = 'Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)'
conf = '-m25 -gF -s15.2 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '11'
name = 'Run oai.dlsim.test11'
diag = 'Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)'
conf = '-m26 -gF -s14.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
oai.send_expect('./dlsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case02.py
# \brief test case 02 for OAI: executions
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import time
import random
import log
import openair
import core
NUM_UE=2
NUM_eNB=1
NUM_TRIALS=3
def execute(oai, user, pw, logfile,logdir):
case = '04'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '00'
name = 'Run oai.dlsim.sanity'
conf = '-a -A AWGN -n 100'
diag = 'ulsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8 ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8 ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./ulsim.rel8 ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '01'
name = 'Run oai.ulsim.test1'
diag = 'Test 1, 10 MHz, R2.FDD (MCS 5), EVA5, -1dB'
conf = '-m5 -gF -s-3.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test +'.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.ulsim.test5'
diag = 'Test 5, 1.4 MHz, R4.FDD (MCS 4), EVA5, 0dB (70%)'
conf = '-m4 -gF -s-2 -w1.0 -f.2 -n500 -B6 -c4 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06'
name = 'Run oai.ulsim.test6'
diag = 'Test 6, 10 MHz, R3.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m15 -gF -s4 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '06b'
name = 'Run oai.ulsim.test6b'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (70%)'
conf = '-m14 -gF -s4 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '07'
name = 'Run oai.ulsim.test7'
diag = 'Test 6b, 5 MHz, R3-1.FDD (MCS 15), EVA5, 6.7dB (30%)'
conf = '-m15 -gG -s-1 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O30'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10'
name = 'Run oai.ulsim.test10'
diag = 'Test 10, 5 MHz, R6.FDD (MCS 25), EVA5, 17.4 dB (70%)'
conf = '-m25 -gF -s13 -w1.0 -f.2 -n500 -B25 -c3 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '10b'
name = 'Run oai.ulsim.test10b'
diag = 'Test 10b, 5 MHz, R6-1.FDD (MCS 24,18 PRB), EVA5, 17.5dB (70%)'
conf = '-m25 -gF -s15.2 -w1.0 -f.2 -n500 -B25 -c3 -z2 -r1022 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '11'
name = 'Run oai.ulsim.test11'
diag = 'Test 11, 10 MHz, R7.FDD (MCS 25), EVA5, 17.7dB (70%)'
conf = '-m26 -gF -s14.2 -w1.0 -f.2 -n500 -B50 -c2 -z2 -O70'
trace = logdir + '/log_' + case + test + '.txt'
tee = ' 2>&1 | tee ' + trace
print test + 'not performed'
#oai.send_expect('./ulsim.rel8 ' + conf + tee, ' effective rate passed', 150)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case01.py
# \brief test case 01 for OAI: compilations
# \author Navid Nikaein
# \date 2014
# \version 0.1
# @ingroup _test
import log
import openair
import core
makerr1 = '***'
makerr2 = 'Error 1'
def execute(oai, user, pw, logfile,logdir):
case = '101'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '01'
name = 'Compile oai.rel8.phy.dlsim.make'
conf = 'make dlsim'
trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for dlsim in $OPENAIR1_DIR/SIMULATION/LTE_PHY'
oai.send('make clean;')
oai.send('rm -f ./dlsim.rel8;')
oai.send_expect_false('make dlsim -j4' + tee, makerr1, 1500)
oai.send('cp ./dlsim ./dlsim.rel8;')
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = '02'
name = 'Compile oai.rel8.phy.ulsim.make'
conf = 'make ulsim'
trace = logdir + '/log_' + case + test + '.txt;'
tee = ' 2>&1 | tee ' + trace
diag = 'check the compilation errors for ulsim in $OPENAIR1_DIR/SIMULATION/LTE_PHY'
oai.send('make clean;')
oai.send('rm -f ./ulsim.rel8;')
oai.send_expect_false('make ulsim -j4' + tee, makerr1, 1500)
oai.send('cp ./ulsim ./ulsim.rel8;')
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file case02.py
# \brief test case 02 for OAI: executions
# \author Navid Nikaein
# \date 2013
# \version 0.1
# @ingroup _test
import time
import random
import log
import openair
import core
import os
import shutil # copy file
NUM_UE=2
NUM_eNB=1
NUM_TRIALS=3
PRB=[25,50,75,100]
MCS=[4,5,7,9,12,15,18,21,24,27]
ANT_TX=2 # 2
ANT_RX=2 # 2
PDCCH=2 #, 2, 3, 4
CHANNEL=["N"] # A,B,C,D,E,F,
TX_MODE=2 # 2,
MIN_SNR=2
MAX_SNR=18
#OPT="-L -d" # 8bit decoder , activate dci decoding at UE
def execute(oai, user, pw, logfile,logdir):
case = '102'
oai.send('cd $OPENAIR1_DIR;')
oai.send('cd SIMULATION/LTE_PHY;')
try:
test = '0'
name = 'Run oai.dlsim.sanity'
conf = '-a -n 100'
diag = 'dlsim is not running normally (Segmentation fault / Exiting / FATAL), debugging might be needed'
trace = logdir + '/log_' + case + test + '_1.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Segmentation fault', 30)
trace = logdir + '/log_' + case + test + '_2.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'Exiting', 30)
trace = logdir + '/log_' + case + test + '_3.txt;'
tee = ' 2>&1 | tee ' + trace
oai.send_expect_false('./dlsim.rel8 ' + conf + tee, 'FATAL', 30)
except log.err, e:
log.fail(case, test, name, conf, e.value, diag, logfile,trace)
else:
log.ok(case, test, name, conf, '', logfile)
try:
test = 1
MIN_SNR = 2
name = 'Run oai.dlsim.perf.70%'
diag = 'no diagnostic is available, check the log file'
for i in range(len(PRB)):
for j in range(len(MCS)):
for k in range(1,ANT_TX):
for m in range (1,ANT_RX):
for n in range(1,PDCCH):
for o in range(len(CHANNEL)):
for p in range(1,TX_MODE):
for q in range(MIN_SNR,MAX_SNR):
#if if PRB[i] :
conf = '-B' + str(PRB[i]) + ' -m'+str(MCS[j]) + ' -y'+str(k) + ' -z'+str(m) +' -c'+str(n) + ' -g'+str(CHANNEL[o]) + ' -x'+str(p) + ' -s'+str(q) + ' -w1.0 -f.1 -n500 -P -O80' #+ OPT
trace = logdir + '/time_meas' + '_prb'+str(PRB[i])+'_mcs'+ str(MCS[j])+ '_anttx' + str(k)+ '_antrx' + str(m) + '_pdcch' + str(n) + '_channel' +str(CHANNEL[o]) + '_tx' +str(p) + '_snr' +str(q)+'.'+case+str(test)+ '.log'
tee = ' 2>&1 | tee ' + trace
match = oai.send_expect_re('./dlsim.rel8 ' + conf + tee, 'passed', 0, 1000)
#print conf
if match :
log.ok(case, str(test), name, conf, '', logfile)
MIN_SNR = q # just to speed up the test
test+=1
break; # found smallest snr
else :
try:
if os.path.isfile(trace) :
os.remove(trace)
except OSError, e: ## if failed, report it back to the user ##
print ("Error: %s - %s." % (e.filename,e.strerror))
except log.err, e:
log.fail(case, str(test), name, conf, e.value, diag, logfile,trace)
#else:
# log.ok(case, test, name, conf, '', logfile)
...@@ -201,16 +201,18 @@ class core: ...@@ -201,16 +201,18 @@ class core:
# **************************send_expect_re************************* # **************************send_expect_re*************************
# 1) send a command, and optionally specify a the time to wait # 1) send a command, and optionally specify a the time to wait
# 2) search for an expected pattern defined by a regular expression in the response # 2) search for an expected pattern defined by a regular expression in the response
# 3) return a error if not found # 3) return a error if raise_err flag is set and re not found, otherwise return 'Ok'
# ***************************************************************** # *****************************************************************
def send_expect_re(self, command, expect, delay = 5, rsp1=None, rsp2=None,debug=0): def send_expect_re(self, command, expect, raise_err=1, delay = 50, rsp1=None, rsp2=None,debug=0):
rsp = self.send_recv(command, delay, rsp1, rsp2) rsp = self.send_recv(command, delay, rsp1, rsp2)
# print rsp # print rsp
match = re.compile(expect).search(rsp) match = re.compile(expect).search(rsp)
if match: if match:
return match return match
if raise_err:
raise log.err(self.failed(command, expect,debug)) raise log.err(self.failed(command, expect,debug))
else :
return None
# **************************send_expect************************* # **************************send_expect*************************
# 1) send a command, and optionally specify a the time to wait # 1) send a command, and optionally specify a the time to wait
......
...@@ -50,6 +50,7 @@ class openair(core): ...@@ -50,6 +50,7 @@ class openair(core):
self.error = '% ' self.error = '% '
self.hostname = hostname self.hostname = hostname
self.address = address self.address = address
self.localhost = None
self.shell_prompt = '$' self.shell_prompt = '$'
core.__init__(self) core.__init__(self)
...@@ -66,6 +67,30 @@ class openair(core): ...@@ -66,6 +67,30 @@ class openair(core):
except Exception, val: except Exception, val:
print "Error:", val print "Error:", val
@property
def localhost(self):
if self.localhost :
return self.localhost
elif self.hostname in ['localhost', '127.0.0.7', '::1'] :
self.localhost = self.hostname
return self.localhost
@localhost.setter
def localhost(self,localhost):
self.localhost = localhost
def shcmd(self,cmd,sudo=False):
if sudo:
cmd = "sudo %s" % command
proc = subprocess.Popen(command, shell=True,
stdout = subprocess.PIPE,
stderr = subprocess.PIPE)
stdout, stderr = proc.communicate()
return (stdout, stderr)
def connect(self, username, password, prompt): def connect(self, username, password, prompt):
self.prompt1 = self.shell_prompt self.prompt1 = self.shell_prompt
if not prompt : if not prompt :
......
...@@ -47,6 +47,8 @@ import log ...@@ -47,6 +47,8 @@ import log
import case01 import case01
import case02 import case02
import case03 import case03
import case04
import case05
from openair import * from openair import *
...@@ -54,6 +56,8 @@ debug = 0 ...@@ -54,6 +56,8 @@ debug = 0
prompt = '$' prompt = '$'
pw ='' pw =''
i = 0 i = 0
dlsim=0
for arg in sys.argv: for arg in sys.argv:
if arg == '-d': if arg == '-d':
debug = 1 debug = 1
...@@ -63,6 +67,8 @@ for arg in sys.argv: ...@@ -63,6 +67,8 @@ for arg in sys.argv:
prompt = sys.argv[i+1] prompt = sys.argv[i+1]
elif arg == '-w' : elif arg == '-w' :
pw = sys.argv[i+1] pw = sys.argv[i+1]
elif arg == '-P' :
dlsim = 1
elif arg == '-h' : elif arg == '-h' :
print "-d: low debug level" print "-d: low debug level"
print "-dd: high debug level" print "-dd: high debug level"
...@@ -112,6 +118,9 @@ oai.rm_driver(oai,user,pw) ...@@ -112,6 +118,9 @@ oai.rm_driver(oai,user,pw)
case01.execute(oai, user, pw, logfile,logdir) case01.execute(oai, user, pw, logfile,logdir)
case02.execute(oai, user, pw, logfile,logdir) case02.execute(oai, user, pw, logfile,logdir)
case03.execute(oai, user, pw, logfile,logdir) case03.execute(oai, user, pw, logfile,logdir)
if dlsim != 0 :
case04.execute(oai, user, pw, logfile,logdir)
case05.execute(oai, user, pw, logfile,logdir)
oai.kill(user, pw) oai.kill(user, pw)
oai.rm_driver(oai,user,pw) oai.rm_driver(oai,user,pw)
......
#******************************************************************************
# Eurecom OpenAirInterface
# Copyright(c) 1999 - 2013 Eurecom
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
# This program is distributed in the hope it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
# more details.
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
# The full GNU General Public License is included in this distribution in
# the file called "COPYING".
# Contact Information
# Openair Admin: openair_admin@eurecom.fr
# Openair Tech : openair_tech@eurecom.fr
# Forums : http://forums.eurecom.fsr/openairinterface
# Address : Eurecom, Compus SophiaTech 450, route des chappes, 06451 Biot, France
#*****************************************************************************
# \file test01.py
# \brief test 02 for OAI: downlink and uplink performance and profiler
# \author Navid Nikaein
# \date 2014
# \version 0.1
# @ingroup _test
import sys
import wave
import os
import time
import datetime
import getpass
import math #from time import clock
import log
import case11
import case12
from openair import *
debug = 0
prompt = '$'
pw =''
i = 0
for arg in sys.argv:
if arg == '-d':
debug = 1
elif arg == '-dd':
debug = 2
elif arg == '-p' :
prompt = sys.argv[i+1]
elif arg == '-w' :
pw = sys.argv[i+1]
elif arg == '-h' :
print "-d: low debug level"
print "-dd: high debug level"
print "-p: set the prompt"
print "-w: set the password for ssh to localhost"
sys.exit()
i= i + 1
# get the oai object
oai = openair('localdomain','localhost')
#start_time = time.time() # datetime.datetime.now()
try:
user = getpass.getuser()
print '\n******* Note that the user <'+user+'> should be a sudoer *******\n'
print '******* Connecting to the localhost to perform the test *******\n'
if not pw :
print "username: " + user
pw = getpass.getpass()
else :
print "username: " + user
#print "password: " + pw
print "prompt: " + prompt
oai.connect(user,pw,prompt)
#oai.get_shell()
except :
print 'Fail to connect to the local host'
sys.exit(1)
test = 'test02'
ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d.%Hh%M")
logdir = os.getcwd() + '/PERF';
logfile = logdir+'/'+user+'.'+test+'.'+ctime+'.txt'
oai.send_nowait('mkdir -p -m 755' + logdir + ';')
#print '=================start the ' + test + ' at ' + ctime + '=================\n'
#print 'Results will be reported in log file : ' + logfile
log.writefile(logfile,'====================start'+test+' at ' + ctime + '=======================\n')
log.set_debug_level(debug)
oai.kill(user, pw)
#oai.rm_driver(oai,user,pw)
# start te test cases
case11.execute(oai, user, pw, logfile,logdir)
case12.execute(oai, user, pw, logfile,logdir)
oai.kill(user, pw)
#oai.rm_driver(oai,user,pw)
# perform the stats
log.statistics(logfile)
oai.disconnect()
ctime=datetime.datetime.utcnow().strftime("%Y-%m-%d_%Hh%M")
log.writefile(logfile,'====================end the '+ test + ' at ' + ctime +'====================')
print 'Test results can be found in : ' + logfile
#print '\nThis test took %f minutes\n' % math.ceil((time.time() - start_time)/60)
#print '\n=====================end the '+ test + ' at ' + ctime + '====================='
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