Commit 662822ab authored by Raymond Knopp's avatar Raymond Knopp

Merge branch 'rru-txwrite-modification' of...

Merge branch 'rru-txwrite-modification' of https://gitlab.eurecom.fr/oai/openairinterface5g into rru-txwrite-modification
parents 749bbb2e f0f88a9e
...@@ -25,7 +25,7 @@ reset_color="$(tput sgr0)" ...@@ -25,7 +25,7 @@ reset_color="$(tput sgr0)"
function error() function error()
{ {
echo -e "$red_color"ERROR: "$@""$reset_color" echo -e "$red_color"ERROR: "$@""$reset_color"
exit 1 1
} }
function check_sha1() function check_sha1()
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
#include "PHY/defs.h" #include "PHY/defs.h"
#include "PHY/TOOLS/alaw_lut.h" #include "PHY/TOOLS/alaw_lut.h"
#include "PHY/extern.h" #include "PHY/extern.h"
#include "PHY/defs.h"
#include "SCHED/defs.h" #include "SCHED/defs.h"
//#include "targets/ARCH/ETHERNET/USERSPACE/LIB/if_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 ...@@ -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); eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv);
int nsym = fp->symbols_per_tti; 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 (packet_type == IF4p5_PDLFFT) {
if (subframe_select(fp,subframe)==SF_S) if (subframe_select(fp,subframe)==SF_S)
...@@ -88,18 +92,22 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -88,18 +92,22 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
if (eNB->CC_id==1) LOG_I(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,frame,subframe,symbol_id); if (eNB->CC_id==1) LOG_I(PHY,"DL_IF4p5: CC_id %d : frame %d, subframe %d, symbol %d\n",eNB->CC_id,frame,subframe,symbol_id);
for (element_id=0; element_id<db_halflength; element_id++) { for (element_id=0; element_id<db_halflength; element_id++) {
i = (uint16_t*) &txdataF[eNB->CC_id][blockoffsetF+element_id]; start_meas(&eNB->send_if4p5_comp_stats);
i = (uint16_t*) &txdataF[eNB->CC_id][blockoffsetF+element_id];
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8); data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
i = (uint16_t*) &txdataF[eNB->CC_id][slotoffsetF+element_id]; i = (uint16_t*) &txdataF[eNB->CC_id][slotoffsetF+element_id];
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8); data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | (lin2alaw_if4p5[*(i+1)]<<8);
stop_meas(&eNB->send_if4p5_comp_stats);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
packet_header->frame_status &= ~(0x000f<<26); packet_header->frame_status &= ~(0x000f<<26);
packet_header->frame_status |= (symbol_id&0x000f)<<26; packet_header->frame_status |= (symbol_id&0x000f)<<26;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
start_meas(&eNB->trx_write_if4p5_stats);
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
symbol_id, symbol_id,
&tx_buffer, &tx_buffer,
db_fulllength, db_fulllength,
...@@ -107,6 +115,8 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -107,6 +115,8 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
IF4p5_PDLFFT)) < 0) { IF4p5_PDLFFT)) < 0) {
perror("ETHERNET write for IF4p5_PDLFFT\n"); perror("ETHERNET write for IF4p5_PDLFFT\n");
} }
stop_meas(&eNB->trx_write_if4p5_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
slotoffsetF += fp->ofdm_symbol_size; slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size; blockoffsetF += fp->ofdm_symbol_size;
...@@ -139,18 +149,20 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -139,18 +149,20 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 1 );
LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id); LOG_D(PHY,"IF4p5_PULFFT: frame %d, subframe %d, symbol %d\n",frame,subframe,symbol_id);
for (element_id=0; element_id<db_halflength; element_id++) { for (element_id=0; element_id<db_halflength; element_id++) {
start_meas(&eNB->send_if4p5_comp_stats);
i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id]; i = (uint16_t*) &rxdataF[0][blockoffsetF+element_id];
data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | ((uint16_t)(lin2alaw_if4p5[*(i+1)]<<8)); data_block[element_id] = ((uint16_t) lin2alaw_if4p5[*i]) | ((uint16_t)(lin2alaw_if4p5[*(i+1)]<<8));
i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id]; i = (uint16_t*) &rxdataF[0][slotoffsetF+element_id];
data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | ((uint16_t)(lin2alaw_if4p5[*(i+1)]<<8)); data_block[element_id+db_halflength] = ((uint16_t) lin2alaw_if4p5[*i]) | ((uint16_t)(lin2alaw_if4p5[*(i+1)]<<8));
//if (element_id==0) LOG_I(PHY,"send_if4p5: symbol %d rxdata0 = (%d,%d)\n",symbol_id,*i,*(i+1)); //if (element_id==0) LOG_I(PHY,"send_if4p5: symbol %d rxdata0 = (%d,%d)\n",symbol_id,*i,*(i+1));
stop_meas(&eNB->send_if4p5_comp_stats);
} }
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_COMPR_IF, 0 );
packet_header->frame_status &= ~(0x000f<<26); packet_header->frame_status &= ~(0x000f<<26);
packet_header->frame_status |= (symbol_id&0x000f)<<26; packet_header->frame_status |= (symbol_id&0x000f)<<26;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 1 );
start_meas(&eNB->trx_write_if4p5_stats);
if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice, if ((eNB->ifdevice.trx_write_func(&eNB->ifdevice,
symbol_id, symbol_id,
&tx_buffer, &tx_buffer,
...@@ -159,6 +171,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -159,6 +171,7 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type
IF4p5_PULFFT)) < 0) { IF4p5_PULFFT)) < 0) {
perror("ETHERNET write for IF4p5_PULFFT\n"); perror("ETHERNET write for IF4p5_PULFFT\n");
} }
stop_meas(&eNB->trx_write_if4p5_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_WRITE_IF, 0 );
slotoffsetF += fp->ofdm_symbol_size; slotoffsetF += fp->ofdm_symbol_size;
blockoffsetF += fp->ofdm_symbol_size; blockoffsetF += fp->ofdm_symbol_size;
...@@ -211,7 +224,10 @@ void send_IF4p5(PHY_VARS_eNB *eNB, int frame, int subframe, uint16_t packet_type ...@@ -211,7 +224,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); 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; return;
} }
...@@ -228,7 +244,11 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t ...@@ -228,7 +244,11 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
int slotoffsetF=0, blockoffsetF=0; int slotoffsetF=0, blockoffsetF=0;
eth_state_t *eth = (eth_state_t*) (eNB->ifdevice.priv); 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) { if (eNB->node_function == NGFI_RRU_IF4p5) {
db_fulllength = (12*fp->N_RB_DL); db_fulllength = (12*fp->N_RB_DL);
...@@ -241,6 +261,8 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t ...@@ -241,6 +261,8 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
uint16_t *data_block=NULL, *i=NULL; uint16_t *data_block=NULL, *i=NULL;
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 1 );
start_meas(&eNB->trx_read_if4p5_stats);
if (eNB->ifdevice.trx_read_func(&eNB->ifdevice, if (eNB->ifdevice.trx_read_func(&eNB->ifdevice,
(int64_t*) packet_type, (int64_t*) packet_type,
&rx_buffer, &rx_buffer,
...@@ -248,6 +270,8 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t ...@@ -248,6 +270,8 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t
0) < 0) { 0) < 0) {
perror("ETHERNET read"); perror("ETHERNET read");
} }
stop_meas(&eNB->trx_read_if4p5_stats);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_TRX_READ_IF, 0 );
if (eth->flags == ETH_RAW_IF4p5_MODE) { if (eth->flags == ETH_RAW_IF4p5_MODE) {
packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES); packet_header = (IF4p5_header_t*) (rx_buffer+MAC_HEADER_SIZE_BYTES);
...@@ -325,7 +349,11 @@ void recv_IF4p5(PHY_VARS_eNB *eNB, int *frame, int *subframe, uint16_t *packet_t ...@@ -325,7 +349,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); 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; return;
} }
......
...@@ -632,6 +632,14 @@ typedef struct PHY_VARS_eNB_s { ...@@ -632,6 +632,14 @@ typedef struct PHY_VARS_eNB_s {
time_stats_t ulsch_tc_intl1_stats; time_stats_t ulsch_tc_intl1_stats;
time_stats_t ulsch_tc_intl2_stats; time_stats_t ulsch_tc_intl2_stats;
// IF4 stats
time_stats_t send_if4p5_stats;
time_stats_t recv_if4p5_stats;
time_stats_t trx_write_if4p5_stats;
time_stats_t trx_read_if4p5_stats;
time_stats_t send_if4p5_comp_stats;
#ifdef LOCALIZATION #ifdef LOCALIZATION
/// time state for localization /// time state for localization
time_stats_t localization_stats; time_stats_t localization_stats;
......
...@@ -17,7 +17,7 @@ eNBs = ...@@ -17,7 +17,7 @@ eNBs =
mobile_country_code = "208"; mobile_country_code = "208";
mobile_network_code = "93"; mobile_network_code = "92";
////////// Physical parameters: ////////// Physical parameters:
...@@ -31,7 +31,7 @@ eNBs = ...@@ -31,7 +31,7 @@ eNBs =
tdd_config_s = 0; tdd_config_s = 0;
prefix_type = "NORMAL"; prefix_type = "NORMAL";
eutra_band = 7; eutra_band = 7;
downlink_frequency = 2685000000L; downlink_frequency = 2660000000L;
uplink_frequency_offset = -120000000; uplink_frequency_offset = -120000000;
Nid_cell = 0; Nid_cell = 0;
N_RB_DL = 50; N_RB_DL = 50;
...@@ -159,8 +159,8 @@ eNBs = ...@@ -159,8 +159,8 @@ eNBs =
rrh_gw_config = ( rrh_gw_config = (
{ {
local_if_name = "eth0"; local_if_name = "eth0";
remote_address = "10.10.10.155"; remote_address = "10.10.10.18";
local_address = "10.10.10.60"; local_address = "10.10.10.157";
local_port = 50000; #for raw option local port must be the same to remote local_port = 50000; #for raw option local port must be the same to remote
remote_port = 50000; remote_port = 50000;
rrh_gw_active = "yes"; rrh_gw_active = "yes";
......
...@@ -135,6 +135,7 @@ extern int transmission_mode; ...@@ -135,6 +135,7 @@ extern int transmission_mode;
extern int oaisim_flag; extern int oaisim_flag;
//pthread_t main_eNB_thread; //pthread_t main_eNB_thread;
pthread_t if_stats_thread;
time_stats_t softmodem_stats_mt; // main thread time_stats_t softmodem_stats_mt; // main thread
time_stats_t softmodem_stats_hw; // hw acquisition time_stats_t softmodem_stats_hw; // hw acquisition
...@@ -668,6 +669,33 @@ static void wait_system_ready (char *message, volatile int *start_flag) { ...@@ -668,6 +669,33 @@ static void wait_system_ready (char *message, volatile int *start_flag) {
} }
#endif #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);
reset_meas(&eNB->recv_if4p5_stats);
reset_meas(&eNB->trx_write_if4p5_stats);
reset_meas(&eNB->trx_read_if4p5_stats);
reset_meas(&eNB->send_if4p5_comp_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);
print_meas(&eNB->trx_write_if4p5_stats, "trx_write_if4p5_stats", NULL, NULL);
print_meas(&eNB->trx_read_if4p5_stats, "trx_read_if4p5_stats", NULL, NULL);
print_meas(&eNB->send_if4p5_comp_stats, "send_if4p5_comp_stats", NULL, NULL);
printf("\n");
}
}
// asynchronous UL with IF5 (RCC,RAU,eNodeB_BBU) // asynchronous UL with IF5 (RCC,RAU,eNodeB_BBU)
void fh_if5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) { void fh_if5_asynch_UL(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
...@@ -967,7 +995,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) { ...@@ -967,7 +995,7 @@ void rx_rf(PHY_VARS_eNB *eNB,int *frame,int *subframe) {
else { else {
if (proc->timestamp_rx - old_ts != fp->samples_per_tti) { 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); eNB->ts_offset += (proc->timestamp_rx - old_ts - fp->samples_per_tti);
proc->timestamp_rx = ts-eNB->ts_offset; proc->timestamp_rx = ts-eNB->ts_offset;
} }
...@@ -1808,9 +1836,11 @@ void init_eNB_proc(int inst) { ...@@ -1808,9 +1836,11 @@ void init_eNB_proc(int inst) {
if ((eNB->node_timing == synch_to_other) || if ((eNB->node_timing == synch_to_other) ||
(eNB->node_function == NGFI_RRU_IF5) || (eNB->node_function == NGFI_RRU_IF5) ||
(eNB->node_function == NGFI_RRU_IF4p5)) (eNB->node_function == NGFI_RRU_IF4p5))
pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, eNB_thread_asynch_rxtx, &eNB->proc );
pthread_create( &proc->pthread_asynch_rxtx, attr_asynch, eNB_thread_asynch_rxtx, &eNB->proc ); if(eNB->node_function == NGFI_RRU_IF4p5 || eNB->node_function == NGFI_RCC_IF4p5)
pthread_create( &if_stats_thread, NULL, print_stats_thread, &eNB->proc);
char name[16]; char name[16];
if (eNB->single_thread_flag == 0) { if (eNB->single_thread_flag == 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