Commit a623d444 authored by younes's avatar younes

Addeed a thread for if stats

parent 8f6c9ff7
......@@ -33,6 +33,7 @@
#include "PHY/defs.h"
#include "PHY/TOOLS/alaw_lut.h"
#include "PHY/extern.h"
#include "PHY/defs.h"
#include "SCHED/defs.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h"
......@@ -62,7 +63,10 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
int nsym = fp->symbols_per_tti;
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
if (eNB->CC_id==0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 1 );
start_meas(&eNB->send_if4p5_stats);
}
if (packet_type == IF4p5_PDLFFT) {
if (subframe_select(fp,subframe)==SF_S)
......@@ -211,7 +215,10 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
AssertFatal(1==0, "send_IF4p5 - Unknown packet_type %x", packet_type);
}
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
if (eNB->CC_id==0) {
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_SEND_IF4, 0 );
stop_meas(&eNB->send_if4p5_stats);
}
return;
}
......@@ -228,7 +235,11 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
int slotoffsetF=0, blockoffsetF=0;
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
if (eNB->CC_id==0)
{
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 1 );
start_meas(&eNB->recv_if4p5_stats);
}
if (eNB->node_function == NGFI_RRU_IF4p5) {
db_fulllength = (12*fp->N_RB_DL);
......@@ -325,7 +336,11 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
AssertFatal(1==0, "recv_IF4p5 - Unknown packet_type %x", *packet_type);
}
if (eNB->CC_id==0) VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
if (eNB->CC_id==0) {
stop_meas(&eNB->recv_if4p5_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RECV_IF4, 0 );
}
return;
}
......
......@@ -632,6 +632,10 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t ulsch_tc_intl1_stats;
time_stats_t ulsch_tc_intl2_stats;
// IF4 stats
time_stats_t send_if4p5_stats;
time_stats_t recv_if4p5_stats;
#ifdef LOCALIZATION
/// time state for localization
time_stats_t localization_stats;
......
......@@ -135,6 +135,7 @@ extern int transmission_mode;
extern int oaisim_flag;
//pthread_t main_eNB_thread;
pthread_t if_stats_thread;
time_stats_t softmodem_stats_mt; // main thread
time_stats_t softmodem_stats_hw; // hw acquisition
......@@ -668,6 +669,24 @@ static void wait_system_ready (char *message, volatile int *start_flag) {
}
#endif
//Thread for printing stats
static void* print_stats_thread( void* param ) {
eNB_rxtx_proc_t *proc = (eNB_rxtx_proc_t*)param;
PHY_VARS_eNB *eNB = PHY_vars_eNB_g[0][proc->CC_id];
printf("[eNB] Launching print_stats thread...\n");
reset_meas(&eNB->send_if4p5_stats);
while (!oai_exit) {
sleep(2);
print_meas(&eNB->send_if4p5_stats, "send_if4p5_stats", NULL, NULL);
print_meas(&eNB->recv_if4p5_stats, "recv_if4p5_stats", NULL, NULL);
}
}
// asynchronous UL with IF5 (RCC,RAU,eNodeB_BBU)
void fh_if5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
......@@ -967,7 +986,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
else {
if (proc->timestamp_rx - old_ts != fp->samples_per_tti) {
LOG_I(PHY,"rx_rf: rfdevice timing drift of %"PRId64" samples\n",proc->timestamp_rx - old_ts - fp->samples_per_tti);
LOG_I(PHY,"xx_rf: rfdevice timing drift of %"PRId64" samples\n",proc->timestamp_rx - old_ts - fp->samples_per_tti);
eNB->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
proc->timestamp_rx = ts-eNB->ts_offset;
}
......@@ -1809,6 +1828,8 @@ void init_eNB_proc(int inst) {
(eNB->node_function == NGFI_RRU_IF5) ||
(eNB->node_function == NGFI_RRU_IF4p5))
if(eNB->node_function == NGFI_RRU_IF4p5)
pthread_create( &if_stats_thread, NULL, print_stats_thread, &eNB->proc);
pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, eNB_thread_asynch_rxtx, &eNB->proc );
......
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