diff --git a/openair1/SIMULATION/LTE_PHY/Makefile b/openair1/SIMULATION/LTE_PHY/Makefile index 4b471c768a3cdf129009ecb8daa9c5106f578347..f662c1172ad67c79f7a3415c9aa498741a1bfa4f 100644 --- a/openair1/SIMULATION/LTE_PHY/Makefile +++ b/openair1/SIMULATION/LTE_PHY/Makefile @@ -6,7 +6,7 @@ OPENAIR1_TOP = $(OPENAIR1_DIR) OPENAIR2_TOP = $(OPENAIR2_DIR) OPENAIR3 = $(OPENAIR3_DIR) -CFLAGS += -DMAX_NUM_CCs=1 -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -DMALLOC_CHECK_=1 -DENABLE_VCD_FIFO # -Wno-packed-bitfield-compat +CFLAGS += -DMAX_NUM_CCs=1 -Wall -DPHYSIM -DNODE_RG -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 -DPHY_CONTEXT=1 -DMALLOC_CHECK_=1 -DENABLE_VCD_FIFO -DLOG_NO_THREAD # -Wno-packed-bitfield-compat # DCI Debug diff --git a/openair1/SIMULATION/LTE_PHY/dlsim.c b/openair1/SIMULATION/LTE_PHY/dlsim.c index fa4400c18fbdeb742c1b909842b7a7936d558196..a34af5b49d7de639465c1d600c20b8e2a000688c 100644 --- a/openair1/SIMULATION/LTE_PHY/dlsim.c +++ b/openair1/SIMULATION/LTE_PHY/dlsim.c @@ -337,7 +337,7 @@ int main(int argc, char **argv) { int rballocset=0; int print_perf=0; int test_perf=0; - + int dump_table=0; int llr8_flag=0; double effective_rate=0.0; @@ -366,7 +366,7 @@ int main(int argc, char **argv) { snr0 = 0; num_layers = 1; - while ((c = getopt (argc, argv, "ahdpDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:")) != -1) { + while ((c = getopt (argc, argv, "ahdpXDe:m:n:o:s:f:t:c:g:r:F:x:y:z:AM:N:I:i:O:R:S:C:T:b:u:v:w:B:PLl:")) != -1) { switch (c) { case 'a': @@ -561,6 +561,9 @@ int main(int argc, char **argv) { test_perf=atoi(optarg); //print_perf =1; break; + case 'X': + dump_table=1; + break; case 'h': default: printf("%s -h(elp) -a(wgn on) -d(ci decoding on) -p(extended prefix on) -m mcs1 -M mcs2 -n n_frames -s snr0 -x transmission mode (1,2,5,6) -y TXant -z RXant -I trch_file\n",argv[0]); @@ -3298,17 +3301,22 @@ PHY_vars_UE->lte_ue_pdcch_vars[0]->num_pdcch_symbols, // sort table qsort (table_tx, time_vector_tx.size, sizeof(double), &compare); qsort (table_rx, time_vector_rx.size, sizeof(double), &compare); -#ifdef DEBUG - int n; - printf("The transmitter raw data: \n"); - for (n=0; n< time_vector_tx.size; n++) - printf("%f ", table_tx[n]); - printf("\n"); - printf("The receiver raw data: \n"); - for (n=0; n< time_vector_rx.size; n++) - printf("%f ", table_rx[n]); - printf("\n"); -#endif + if (dump_table == 1 ) { + set_component_filelog(USIM); // file located in /tmp/usim.txt + int n; + LOG_F(USIM,"The transmitter raw data: \n"); + for (n=0; n< time_vector_tx.size; n++){ + printf("%f ", table_tx[n]); + LOG_F(USIM,"%f ", table_tx[n]); + } + LOG_F(USIM,"\n"); + LOG_F(USIM,"The receiver raw data: \n"); + for (n=0; n< time_vector_rx.size; n++){ + // printf("%f ", table_rx[n]); + LOG_F(USIM,"%f ", table_rx[n]); + } + LOG_F(USIM,"\n"); + } double tx_median = table_tx[time_vector_tx.size/2]; double tx_q1 = table_tx[time_vector_tx.size/4]; double tx_q3 = table_tx[3*time_vector_tx.size/4]; diff --git a/openair1/SIMULATION/LTE_PHY/ulsim.c b/openair1/SIMULATION/LTE_PHY/ulsim.c index f949d4f5b86344fc310994aadbac8b35423ba609..c95d847bb46c299b5e592beb2a4628d0affbf5b6 100644 --- a/openair1/SIMULATION/LTE_PHY/ulsim.c +++ b/openair1/SIMULATION/LTE_PHY/ulsim.c @@ -258,6 +258,7 @@ int main(int argc, char **argv) { int s,Kr,Kr_bytes; int dump_perf=0; int test_perf=0; + int dump_table=0; double effective_rate=0.0; char channel_model_input[10]; @@ -276,7 +277,7 @@ int main(int argc, char **argv) { logInit(); - while ((c = getopt (argc, argv, "hapbm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) { + while ((c = getopt (argc, argv, "hapbXm:n:Y:X:x:s:w:e:q:d:D:O:c:r:i:f:y:c:oA:C:R:g:N:l:S:T:QB:PI:L")) != -1) { switch (c) { case 'a': channel_model = AWGN; @@ -1313,17 +1314,22 @@ int main(int argc, char **argv) { // sort table qsort (table_tx, time_vector_tx.size, sizeof(double), &compare); qsort (table_rx, time_vector_rx.size, sizeof(double), &compare); -#ifdef DEBUG - int n; - printf("The transmitter raw data: \n"); - for (n=0; n< time_vector_tx.size; n++) - printf("%f ", table_tx[n]); - printf("\n"); - printf("The receiver raw data: \n"); - for (n=0; n< time_vector_rx.size; n++) - printf("%f ", table_rx[n]); - printf("\n"); -#endif + if (dump_table == 1 ) { + int n; + set_component_filelog(USIM); // file located in /tmp/usim.txt + LOG_F(USIM,"The transmitter raw data: \n"); + for (n=0; n< time_vector_tx.size; n++){ + // printf("%f ", table_tx[n]); + LOG_F(USIM,"%f ", table_tx[n]); + } + LOG_F(USIM,"\n"); + LOG_F(USIM,"The receiver raw data: \n"); + for (n=0; n< time_vector_rx.size; n++){ + // printf("%f ", table_rx[n]); + LOG_F(USIM,"%f ", table_rx[n]); + } + LOG_F(USIM,"\n"); + } double tx_median = table_tx[time_vector_tx.size/2]; double tx_q1 = table_tx[time_vector_tx.size/4]; double tx_q3 = table_tx[3*time_vector_tx.size/4]; diff --git a/openair2/UTIL/LOG/log.c b/openair2/UTIL/LOG/log.c index 8c27285798fe316e0807a6f559de910262d202d2..d84ade04f197fb617eb8fffd59bd30fe6fb4df44 100755 --- a/openair2/UTIL/LOG/log.c +++ b/openair2/UTIL/LOG/log.c @@ -381,13 +381,21 @@ int logInit (void) g_log->log_component[TMR].filelog = 0; g_log->log_component[TMR].filelog_name = ""; + g_log->log_component[USIM].name = "USIM"; + g_log->log_component[USIM].level = LOG_DEBUG; + g_log->log_component[USIM].flag = LOG_NONE; + g_log->log_component[USIM].interval = 1; + g_log->log_component[USIM].fd = 0; + g_log->log_component[USIM].filelog = 0; + g_log->log_component[USIM].filelog_name = "/tmp/usim.txt"; + /* following log component are used for the localization*/ g_log->log_component[LOCALIZE].name = "LOCALIZE"; g_log->log_component[LOCALIZE].level = LOG_EMERG; g_log->log_component[LOCALIZE].flag = LOG_MED; g_log->log_component[LOCALIZE].interval = 1; g_log->log_component[LOCALIZE].fd = 0; - g_log->log_component[LOCALIZE].filelog = 1; + g_log->log_component[LOCALIZE].filelog = 0; g_log->log_component[LOCALIZE].filelog_name = "/tmp/localize.log"; g_log->level2string[LOG_EMERG] = "G"; //EMERG @@ -587,7 +595,7 @@ void logRecord_thread_safe(const char *file, const char *func, } if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) { if (write(g_log->log_component[comp].fd, log_buffer, total_len) < total_len) { - // TODO assert ? + // TODO assert ? } } #endif @@ -750,7 +758,7 @@ void logRecord_mt(const char *file, const char *func, int line, int comp, } if ((g_log->log_component[comp].filelog) && (level == LOG_FILE)) { if (write(g_log->log_component[comp].fd, c->log_buffer, len) < len) { - // TODO assert ? + // TODO assert ? } } #else diff --git a/openair2/UTIL/LOG/log.h b/openair2/UTIL/LOG/log.h index a30b51ff47210418c54eefeaa246491d8d376262..b5517c5b33675019039ade5fccbcc85b830b1b18 100755 --- a/openair2/UTIL/LOG/log.h +++ b/openair2/UTIL/LOG/log.h @@ -265,6 +265,7 @@ typedef enum { RAL_UE, ENB_APP, TMR, + USIM, LOCALIZE, MAX_LOG_COMPONENTS, } comp_name_t;