adding debug message

This commit is contained in:
WANG Tsu-Han
2020-03-05 17:38:47 +01:00
parent bd672c5f0f
commit cc4a0c742e
7 changed files with 44 additions and 14 deletions
+10 -2
View File
@@ -49,6 +49,8 @@
#include "common_lib.h"
#include "assertions.h"
#include "common/utils/LOG/vcd_signal_dumper.h"
#include <sys/resource.h>
#include "usrp_lib.h"
@@ -443,7 +445,7 @@ static int trx_usrp_write(openair0_device *device, openair0_timestamp timestamp,
pthread_mutex_lock(&write_thread->mutex_write);
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->count_write = 0;
}
@@ -495,6 +497,7 @@ void *trx_usrp_write_thread(void * arg){
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
}
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_THREAD, 1 );
s = (usrp_state_t *)device->priv;
start = write_thread->start;
timestamp = write_package[start].timestamp;
@@ -506,6 +509,9 @@ void *trx_usrp_write_thread(void * arg){
write_thread->start = (write_thread->start + 1)% MAX_WRITE_THREAD_PACKAGE;
write_thread->count_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__)
#ifdef __AVX2__
@@ -552,6 +558,8 @@ void *trx_usrp_write_thread(void * arg){
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);
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;
}
@@ -567,7 +575,7 @@ int trx_write_init(openair0_device *device){
write_thread->start = 0;
write_thread->end = 0;
write_thread->count_write = 0;
write_thread->count_write = 0;
printf("end of tx write thread\n");
pthread_create(&write_thread->pthread_write,NULL,trx_usrp_write_thread,(void *)device);
+13 -9
View File
@@ -1,21 +1,25 @@
[*]
[*] 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_mtime] "Tue Dec 17 15:25:49 2019"
[dumpfile_size] 6343431
[dumpfile] "/tmp/gNB_trx_thread.vcd"
[dumpfile_mtime] "Wed Mar 4 14:05:10 2020"
[dumpfile_size] 10750468
[savefile] "/home/wangts/openairinterface5g/targets/RT/USER/gNB_usrp.gtkw"
[timestart] 1517712000
[size] 1920 1018
[pos] -9 -33
*-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
[timestart] 31148700000
[size] 1916 1002
[pos] -1 -25
*-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
[signals_width] 344
[sst_expanded] 1
[sst_vpaned_height] 267
[sst_vpaned_height] 262
@28
functions.trx_read
functions.trx_write_thread
@25
variables.trx_write_flags[63:0]
@28
functions.trx_write
@420
variables.frame_number_TX0_UE[63:0]