Commit cc4a0c74 authored by WANG Tsu-Han's avatar WANG Tsu-Han

adding debug message

parent bd672c5f
...@@ -248,7 +248,8 @@ const char* eurecomVariablesNames[] = { ...@@ -248,7 +248,8 @@ const char* eurecomVariablesNames[] = {
"slot_number_TX1_gNB", "slot_number_TX1_gNB",
"slot_number_RX0_gNB", "slot_number_RX0_gNB",
"slot_number_RX1_gNB", "slot_number_RX1_gNB",
"ru_tx_ofdm_mask" "ru_tx_ofdm_mask",
"usrp_send_return"
}; };
const char* eurecomFunctionsNames[] = { const char* eurecomFunctionsNames[] = {
...@@ -282,6 +283,8 @@ const char* eurecomFunctionsNames[] = { ...@@ -282,6 +283,8 @@ const char* eurecomFunctionsNames[] = {
"lock_mutex_ru", "lock_mutex_ru",
"lock_mutex_ru1", "lock_mutex_ru1",
"lock_mutex_ru2", "lock_mutex_ru2",
/* uhd signals */
"trx_write_thread",
/* simulation signals */ /* simulation signals */
"do_DL_sig", "do_DL_sig",
"do_UL_sig", "do_UL_sig",
......
...@@ -226,6 +226,7 @@ typedef enum { ...@@ -226,6 +226,7 @@ typedef enum {
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX0_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB, VCD_SIGNAL_DUMPER_VARIABLES_SLOT_NUMBER_RX1_GNB,
VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK, VCD_SIGNAL_DUMPER_VARIABLES_RU_TX_OFDM_MASK,
VCD_SIGNAL_DUMPER_VARIABLES_USRP_SEND_RETURN,
VCD_SIGNAL_DUMPER_VARIABLES_END VCD_SIGNAL_DUMPER_VARIABLES_END
...@@ -262,6 +263,8 @@ typedef enum { ...@@ -262,6 +263,8 @@ typedef enum {
VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU, VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU,
VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU1, VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU1,
VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU2, VCD_SIGNAL_DUMPER_FUNCTIONS_LOCK_MUTEX_RU2,
/* uhd signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_THREAD,
/* SIMULATION signals */ /* SIMULATION signals */
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_DL_SIGNAL, VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_DL_SIGNAL,
VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL, VCD_SIGNAL_DUMPER_FUNCTIONS_SIM_DO_UL_SIGNAL,
......
...@@ -73,10 +73,10 @@ typedef struct { ...@@ -73,10 +73,10 @@ typedef struct {
} T_cache_t; } T_cache_t;
/* number of VCD functions (to be kept up to date! see in T_messages.txt) */ /* number of VCD functions (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_FUNCTIONS (247) #define VCD_NUM_FUNCTIONS (248)
/* number of VCD variables (to be kept up to date! see in T_messages.txt) */ /* number of VCD variables (to be kept up to date! see in T_messages.txt) */
#define VCD_NUM_VARIABLES (186) #define VCD_NUM_VARIABLES (187)
/* first VCD function (to be kept up to date! see in T_messages.txt) */ /* first VCD function (to be kept up to date! see in T_messages.txt) */
#define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP) #define VCD_FIRST_FUNCTION ((uintptr_t)T_VCD_FUNCTION_RT_SLEEP)
......
...@@ -2138,6 +2138,11 @@ ID = VCD_VARIABLE_RU_TX_OFDM_MASK ...@@ -2138,6 +2138,11 @@ ID = VCD_VARIABLE_RU_TX_OFDM_MASK
GROUP = ALL:VCD:ENB:VCD_VARIABLE GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value FORMAT = ulong,value
VCD_NAME = ru_tx_ofdm_mask VCD_NAME = ru_tx_ofdm_mask
ID = VCD_VARIABLE_USRP_SEND_RETURN
DESC = VCD variable USRP_SEND_RETURN
GROUP = ALL:VCD:ENB:VCD_VARIABLE
FORMAT = ulong,value
VCD_NAME = usrp_send_return
#functions #functions
...@@ -2286,6 +2291,11 @@ ID = VCD_FUNCTION_LOCK_MUTEX_RU2 ...@@ -2286,6 +2291,11 @@ ID = VCD_FUNCTION_LOCK_MUTEX_RU2
GROUP = ALL:VCD:UE:VCD_FUNCTION GROUP = ALL:VCD:UE:VCD_FUNCTION
FORMAT = int,value FORMAT = int,value
VCD_NAME = lock_mutex_ru2 VCD_NAME = lock_mutex_ru2
ID = VCD_FUNCTION_TRX_WRITE_THREAD
DESC = VCD function TRX_WRITE_THREAD
GROUP = ALL:VCD:ENB:VCD_FUNCTION
FORMAT = int,value
VCD_NAME = trx_write_thread
ID = VCD_FUNCTION_SIM_DO_DL_SIGNAL ID = VCD_FUNCTION_SIM_DO_DL_SIGNAL
DESC = VCD function SIM_DO_DL_SIGNAL DESC = VCD function SIM_DO_DL_SIGNAL
GROUP = ALL:VCD:ENB:VCD_FUNCTION GROUP = ALL:VCD:ENB:VCD_FUNCTION
......
...@@ -735,6 +735,8 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) { ...@@ -735,6 +735,8 @@ void tx_rf(RU_t *ru,int frame,int slot, uint64_t timestamp) {
else else
flags=4; flags=4;
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_TRX_WRITE_FLAGS, flags );
/* /*
if (SF_type == SF_S) { if (SF_type == SF_S) {
siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0); siglen = fp->dl_symbols_in_S_subframe*(fp->ofdm_symbol_size+fp->nb_prefix_samples0);
......
...@@ -49,6 +49,8 @@ ...@@ -49,6 +49,8 @@
#include "common_lib.h" #include "common_lib.h"
#include "assertions.h" #include "assertions.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include <sys/resource.h> #include <sys/resource.h>
#include "usrp_lib.h" #include "usrp_lib.h"
...@@ -443,7 +445,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp, ...@@ -443,7 +445,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
pthread_mutex_lock(&write_thread->mutex_write); pthread_mutex_lock(&write_thread->mutex_write);
if(write_thread->count_write >= MAX_WRITE_THREAD_PACKAGE){ if(write_thread->count_write >= MAX_WRITE_THREAD_PACKAGE){
LOG_W(HW,"Buffer overflow, resetting write package\n"); LOG_W("Buffer overflow, count_write = %d, start = %d end = %d, resetting write package\n", write_thread->count_write, write_thread->start, write_thread->end);
write_thread->end = write_thread->start; write_thread->end = write_thread->start;
write_thread->count_write = 0; write_thread->count_write = 0;
} }
...@@ -495,6 +497,7 @@ void *trx_usrp_write_thread(void * arg){ ...@@ -495,6 +497,7 @@ void *trx_usrp_write_thread(void * arg){
while (write_thread->count_write == 0) { while (write_thread->count_write == 0) {
pthread_cond_wait(&write_thread->cond_write,&write_thread->mutex_write); // this unlocks mutex_rxtx while waiting and then locks it again pthread_cond_wait(&write_thread->cond_write,&write_thread->mutex_write); // this unlocks mutex_rxtx while waiting and then locks it again
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_THREAD, 1 );
s = (usrp_state_t *)device->priv; s = (usrp_state_t *)device->priv;
start = write_thread->start; start = write_thread->start;
timestamp = write_package[start].timestamp; timestamp = write_package[start].timestamp;
...@@ -506,6 +509,9 @@ void *trx_usrp_write_thread(void * arg){ ...@@ -506,6 +509,9 @@ void *trx_usrp_write_thread(void * arg){
write_thread->start = (write_thread->start + 1)% MAX_WRITE_THREAD_PACKAGE; write_thread->start = (write_thread->start + 1)% MAX_WRITE_THREAD_PACKAGE;
write_thread->count_write--; write_thread->count_write--;
pthread_mutex_unlock(&write_thread->mutex_write); pthread_mutex_unlock(&write_thread->mutex_write);
if(write_thread->count_write != 0){
LOG_W(HW,"count write = %d, start = %d, end = %d\n", write_thread->count_write, write_thread->start, write_thread->end);
}
#if defined(__x86_64) || defined(__i386__) #if defined(__x86_64) || defined(__i386__)
#ifdef __AVX2__ #ifdef __AVX2__
...@@ -552,6 +558,8 @@ void *trx_usrp_write_thread(void * arg){ ...@@ -552,6 +558,8 @@ void *trx_usrp_write_thread(void * arg){
ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md); ret = (int)s->tx_stream->send(buff_ptrs, nsamps, s->tx_md);
} else ret = (int)s->tx_stream->send(&(((int16_t *)buff_tx[0])[0]), nsamps, s->tx_md); } else ret = (int)s->tx_stream->send(&(((int16_t *)buff_tx[0])[0]), nsamps, s->tx_md);
if (ret != nsamps) LOG_E(HW,"[xmit] tx samples %d != %d\n",ret,nsamps); if (ret != nsamps) LOG_E(HW,"[xmit] tx samples %d != %d\n",ret,nsamps);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME( VCD_SIGNAL_DUMPER_VARIABLES_USRP_SEND_RETURN, ret );
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_THREAD, 0 );
if(0) break; if(0) break;
} }
......
[*] [*]
[*] GTKWave Analyzer v3.3.61 (w)1999-2014 BSI [*] GTKWave Analyzer v3.3.61 (w)1999-2014 BSI
[*] Tue Dec 17 15:31:51 2019 [*] Wed Mar 4 14:05:43 2020
[*] [*]
[dumpfile] "/tmp/gNB.vcd" [dumpfile] "/tmp/gNB_trx_thread.vcd"
[dumpfile_mtime] "Tue Dec 17 15:25:49 2019" [dumpfile_mtime] "Wed Mar 4 14:05:10 2020"
[dumpfile_size] 6343431 [dumpfile_size] 10750468
[savefile] "/home/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw" [savefile] "/home/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw"
[timestart] 1517712000 [timestart] 31148700000
[size] 1920 1018 [size] 1916 1002
[pos] -9 -33 [pos] -1 -25
*-19.276148 1518358451 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 *-23.852516 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
[sst_width] 386 [sst_width] 386
[signals_width] 344 [signals_width] 344
[sst_expanded] 1 [sst_expanded] 1
[sst_vpaned_height] 267 [sst_vpaned_height] 262
@28 @28
functions.trx_read functions.trx_read
functions.trx_write_thread
@25
variables.trx_write_flags[63:0]
@28
functions.trx_write functions.trx_write
@420 @420
variables.frame_number_TX0_UE[63:0] variables.frame_number_TX0_UE[63:0]
......
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