Commit f5d3fda2 authored by Lionel Gauthier's avatar Lionel Gauthier

Not tested

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6328 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7d0df005
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/ *******************************************************************************/
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
...@@ -113,7 +113,7 @@ char smbv_ip[16]; ...@@ -113,7 +113,7 @@ char smbv_ip[16];
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu; DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1; DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2; DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
*/ */
#define UL_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,24) #define UL_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,24)
#define CCCH_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,3) #define CCCH_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,3)
...@@ -169,34 +169,25 @@ time_stats_t dl_chan_stats; ...@@ -169,34 +169,25 @@ time_stats_t dl_chan_stats;
time_stats_t ul_chan_stats; time_stats_t ul_chan_stats;
// this should reflect the channel models in openair1/SIMULATION/TOOLS/defs.h // this should reflect the channel models in openair1/SIMULATION/TOOLS/defs.h
mapping small_scale_names[] = { mapping small_scale_names[] = { { "custom", custom }, { "SCM_A", SCM_A }, {
{"custom", custom}, "SCM_B", SCM_B }, { "SCM_C", SCM_C }, { "SCM_D", SCM_D }, {
{"SCM_A", SCM_A}, "EPA", EPA }, { "EVA", EVA }, { "ETU", ETU },
{"SCM_B", SCM_B}, { "MBSFN", MBSFN }, { "Rayleigh8", Rayleigh8 }, { "Rayleigh1",
{"SCM_C", SCM_C}, Rayleigh1 }, { "Rayleigh1_800", Rayleigh1_800 },
{"SCM_D", SCM_D}, { "Rayleigh1_corr", Rayleigh1_corr }, { "Rayleigh1_anticorr",
{"EPA", EPA}, Rayleigh1_anticorr }, { "Rice8", Rice8 }, {
{"EVA", EVA}, "Rice1", Rice1 }, { "Rice1_corr", Rice1_corr },
{"ETU", ETU}, { "Rice1_anticorr", Rice1_anticorr }, { "AWGN", AWGN }, { NULL,
{"MBSFN", MBSFN}, -1 } };
{"Rayleigh8", Rayleigh8},
{"Rayleigh1", Rayleigh1},
{"Rayleigh1_800", Rayleigh1_800},
{"Rayleigh1_corr", Rayleigh1_corr},
{"Rayleigh1_anticorr", Rayleigh1_anticorr},
{"Rice8", Rice8},
{"Rice1", Rice1},
{"Rice1_corr", Rice1_corr},
{"Rice1_anticorr", Rice1_anticorr},
{"AWGN", AWGN},
{NULL, -1}
};
#if !defined(ENABLE_ITTI) #if !defined(ENABLE_ITTI)
static void *sigh(void *arg); static void *
sigh (void *arg);
#endif #endif
void oai_shutdown(void); void
oai_shutdown (void);
void help(void) { void
help (void) {
printf ("Usage: oaisim -h -a -F -C tdd_config -K [log_file] -V [vcd_file] -R N_RB_DL -e -x transmission_mode -m target_dl_mcs -r(ate_adaptation) -n n_frames -s snr_dB -k ricean_factor -t max_delay -f forgetting factor -A channel_model -z cooperation_flag -u nb_local_ue -U UE mobility -b nb_local_enb -B eNB_mobility -M ethernet_flag -p nb_master -g multicast_group -l log_level -c ocg_enable -T traffic model -D multicast network device\n"); printf ("Usage: oaisim -h -a -F -C tdd_config -K [log_file] -V [vcd_file] -R N_RB_DL -e -x transmission_mode -m target_dl_mcs -r(ate_adaptation) -n n_frames -s snr_dB -k ricean_factor -t max_delay -f forgetting factor -A channel_model -z cooperation_flag -u nb_local_ue -U UE mobility -b nb_local_enb -B eNB_mobility -M ethernet_flag -p nb_master -g multicast_group -l log_level -c ocg_enable -T traffic model -D multicast network device\n");
printf ("-h provides this help message!\n"); printf ("-h provides this help message!\n");
...@@ -248,18 +239,21 @@ void help(void) { ...@@ -248,18 +239,21 @@ void help(void) {
pthread_t log_thread; pthread_t log_thread;
void log_thread_init() { void
log_thread_init () {
//create log_list //create log_list
//log_list_init(&log_list); //log_list_init(&log_list);
#ifndef LOG_NO_THREAD #ifndef LOG_NO_THREAD
log_shutdown = 0; log_shutdown = 0;
if ((pthread_mutex_init (&log_lock, NULL) != 0) || (pthread_cond_init (&log_notify, NULL) != 0)) { if ((pthread_mutex_init (&log_lock, NULL) != 0)
|| (pthread_cond_init (&log_notify, NULL) != 0)) {
return; return;
} }
if (pthread_create (&log_thread, NULL, log_thread_function, (void*) NULL) != 0) { if (pthread_create (&log_thread, NULL, log_thread_function, (void*) NULL)
!= 0) {
log_thread_finalize (); log_thread_finalize ();
return; return;
} }
...@@ -268,7 +262,8 @@ void log_thread_init() { ...@@ -268,7 +262,8 @@ void log_thread_init() {
} }
//Call it after the last LOG call //Call it after the last LOG call
int log_thread_finalize() { int
log_thread_finalize () {
int err = 0; int err = 0;
#ifndef LOG_NO_THREAD #ifndef LOG_NO_THREAD
...@@ -280,7 +275,8 @@ int log_thread_finalize() { ...@@ -280,7 +275,8 @@ int log_thread_finalize() {
log_shutdown = 1; log_shutdown = 1;
/* Wake up LOG thread */ /* Wake up LOG thread */
if ((pthread_cond_broadcast (&log_notify) != 0) || (pthread_mutex_unlock (&log_lock) != 0)) { if ((pthread_cond_broadcast (&log_notify) != 0)
|| (pthread_mutex_unlock (&log_lock) != 0)) {
err = -1; err = -1;
} }
if (pthread_join (log_thread, NULL) != 0) { if (pthread_join (log_thread, NULL) != 0) {
...@@ -398,17 +394,15 @@ static module_id_t RN_id = 0; ...@@ -398,17 +394,15 @@ static module_id_t RN_id = 0;
Packet_OTG_List_t *otg_pdcp_buffer; Packet_OTG_List_t *otg_pdcp_buffer;
typedef enum l2l1_task_state_e typedef enum l2l1_task_state_e {
{ L2L1_WAITTING, L2L1_RUNNING, L2L1_TERMINATED,
L2L1_WAITTING, } l2l1_task_state_t;
L2L1_RUNNING,
L2L1_TERMINATED,
} l2l1_task_state_t;
l2l1_task_state_t l2l1_state = L2L1_WAITTING; l2l1_task_state_t l2l1_state = L2L1_WAITTING;
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void *l2l1_task(void *args_p) { void *
l2l1_task (void *args_p) {
clock_t t; clock_t t;
int CC_id; int CC_id;
...@@ -424,7 +418,7 @@ void *l2l1_task(void *args_p) { ...@@ -424,7 +418,7 @@ void *l2l1_task(void *args_p) {
char fname[64], vname[64]; char fname[64], vname[64];
int sf; int sf;
protocol_ctxt_t ctxt;
#ifdef XFORMS #ifdef XFORMS
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
// at eNB 0, an UL scope for every UE // at eNB 0, an UL scope for every UE
...@@ -449,13 +443,15 @@ void *l2l1_task(void *args_p) { ...@@ -449,13 +443,15 @@ void *l2l1_task(void *args_p) {
char eNB_stats_th_filename[255]; char eNB_stats_th_filename[255];
#endif #endif
for (CC_id = 0;CC_id<MAX_NUM_CCs;CC_id++) for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++)
for (eNB_inst=0;eNB_inst<NB_eNB_INST;eNB_inst++) { for (eNB_inst = 0; eNB_inst < NB_eNB_INST; eNB_inst++) {
for (sf=0;sf<10;sf++) { for (sf = 0; sf < 10; sf++) {
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].frame_tx = 0; PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].frame_tx = 0;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].frame_rx = 0; PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].frame_rx = 0;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].subframe_tx = (sf+1)%10; PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].subframe_tx = (sf + 1)
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].subframe_rx = (sf+9)%10; % 10;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].subframe_rx = (sf + 9)
% 10;
} }
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[0].frame_rx = 1023; PHY_vars_eNB_g[eNB_inst][CC_id]->proc[0].frame_rx = 1023;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[9].frame_tx = 1; PHY_vars_eNB_g[eNB_inst][CC_id]->proc[9].frame_tx = 1;
...@@ -557,14 +553,16 @@ void *l2l1_task(void *args_p) { ...@@ -557,14 +553,16 @@ void *l2l1_task(void *args_p) {
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p)); LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
break; break;
} }
} while (l2l1_state == L2L1_WAITTING); }while (l2l1_state == L2L1_WAITTING);
result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} }
#endif #endif
start_meas(&oaisim_stats); start_meas (&oaisim_stats);
for (frame = 0; (l2l1_state != L2L1_TERMINATED) && (frame < oai_emulation.info.n_frames); frame++) { for (frame = 0;
(l2l1_state != L2L1_TERMINATED)
&& (frame < oai_emulation.info.n_frames);
frame++) {
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
do { do {
...@@ -590,7 +588,6 @@ void *l2l1_task(void *args_p) { ...@@ -590,7 +588,6 @@ void *l2l1_task(void *args_p) {
case MESSAGE_TEST: case MESSAGE_TEST:
break; break;
default: default:
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p)); LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
break; break;
...@@ -599,12 +596,12 @@ void *l2l1_task(void *args_p) { ...@@ -599,12 +596,12 @@ void *l2l1_task(void *args_p) {
result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p); result = itti_free (ITTI_MSG_ORIGIN_ID(message_p), message_p);
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result); AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
} }
} while(message_p != NULL); }while(message_p != NULL);
#endif #endif
//Run the aperiodic user-defined events //Run the aperiodic user-defined events
if (oai_emulation.info.oeh_enabled == 1) if (oai_emulation.info.oeh_enabled == 1)
execute_events(frame); execute_events (frame);
/* /*
// Handling the cooperation Flag // Handling the cooperation Flag
...@@ -621,8 +618,7 @@ void *l2l1_task(void *args_p) { ...@@ -621,8 +618,7 @@ void *l2l1_task(void *args_p) {
} }
if (snr_dB == -20) { if (snr_dB == -20) {
snr_direction = snr_step; snr_direction = snr_step;
} } else
else
if (snr_dB == 20) { if (snr_dB == 20) {
snr_direction = -snr_step; snr_direction = -snr_step;
} }
...@@ -632,7 +628,8 @@ void *l2l1_task(void *args_p) { ...@@ -632,7 +628,8 @@ void *l2l1_task(void *args_p) {
//oai_emulation.info.time_ms += 1; //oai_emulation.info.time_ms += 1;
oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01) oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01)
// if n_frames not set by the user or is greater than max num frame then set adjust the frame counter // if n_frames not set by the user or is greater than max num frame then set adjust the frame counter
if ((oai_emulation.info.n_frames_flag == 0) || (oai_emulation.info.n_frames >= 0xffff)) { if ((oai_emulation.info.n_frames_flag == 0)
|| (oai_emulation.info.n_frames >= 0xffff)) {
frame %= (oai_emulation.info.n_frames - 1); frame %= (oai_emulation.info.n_frames - 1);
} }
...@@ -659,8 +656,8 @@ void *l2l1_task(void *args_p) { ...@@ -659,8 +656,8 @@ void *l2l1_task(void *args_p) {
update_ocm (); update_ocm ();
for (slot = 0; slot < 20; slot++) { for (slot = 0; slot < 20; slot++) {
if (slot%2==0) if (slot % 2 == 0)
start_meas(&oaisim_stats_f); start_meas (&oaisim_stats_f);
wait_for_slot_isr (); wait_for_slot_isr ();
...@@ -689,14 +686,17 @@ void *l2l1_task(void *args_p) { ...@@ -689,14 +686,17 @@ void *l2l1_task(void *args_p) {
#endif #endif
// if ((next_slot % 2) == 0) // if ((next_slot % 2) == 0)
if ((slot&1) == 0) if ((slot & 1) == 0)
clear_eNB_transport_info (oai_emulation.info.nb_enb_local); clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
for (eNB_inst = oai_emulation.info.first_enb_local; (eNB_inst < (oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local)); eNB_inst++) { for (eNB_inst = oai_emulation.info.first_enb_local;
(eNB_inst
< (oai_emulation.info.first_enb_local
+ oai_emulation.info.nb_enb_local));
eNB_inst++) {
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) { if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
if ((slot&1) == 0) if ((slot & 1) == 0)
LOG_D( LOG_D(EMU,
EMU,
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n", "PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
eNB_inst, eNB_inst,
frame, frame,
...@@ -716,8 +716,11 @@ void *l2l1_task(void *args_p) { ...@@ -716,8 +716,11 @@ void *l2l1_task(void *args_p) {
#endif #endif
// PHY_vars_eNB_g[eNB_id]->frame = frame; // PHY_vars_eNB_g[eNB_id]->frame = frame;
if ((slot&1) == 0) if ((slot & 1) == 0)
phy_procedures_eNB_lte (slot>>1,PHY_vars_eNB_g[eNB_inst], abstraction_flag, no_relay, NULL); phy_procedures_eNB_lte (slot >> 1,
PHY_vars_eNB_g[eNB_inst],
abstraction_flag, no_relay,
NULL);
#ifdef PRINT_STATS #ifdef PRINT_STATS
if(last_slot==9 && frame%10==0) if(last_slot==9 && frame%10==0)
if(eNB_avg_thr) if(eNB_avg_thr)
...@@ -752,7 +755,8 @@ void *l2l1_task(void *args_p) { ...@@ -752,7 +755,8 @@ void *l2l1_task(void *args_p) {
// if ((slot&1) == 0) // if ((slot&1) == 0)
clear_UE_transport_info (oai_emulation.info.nb_ue_local); clear_UE_transport_info (oai_emulation.info.nb_ue_local);
for (UE_inst = oai_emulation.info.first_ue_local; for (UE_inst = oai_emulation.info.first_ue_local;
(UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local)); UE_inst++) { (UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local));
UE_inst++) {
if (oai_emulation.info.cli_start_ue[UE_inst] != 0) { if (oai_emulation.info.cli_start_ue[UE_inst] != 0) {
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME) #if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
...@@ -760,45 +764,61 @@ void *l2l1_task(void *args_p) { ...@@ -760,45 +764,61 @@ void *l2l1_task(void *args_p) {
if (frame >= (UE_inst * 20)) // activate UE only after 20*UE_id frames so that different UEs turn on separately if (frame >= (UE_inst * 20)) // activate UE only after 20*UE_id frames so that different UEs turn on separately
#endif #endif
{ {
LOG_D(EMU, "PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", LOG_D(EMU,
UE_inst, "PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
frame, UE_inst, frame, slot, next_slot >> 1,
slot, last_slot >> 1);
next_slot >> 1,
last_slot>>1);
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) { if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0]
!= NOT_SYNCHED) {
if (frame > 0) { if (frame > 0) {
PHY_vars_UE_g[UE_inst][0]->frame_rx = frame; PHY_vars_UE_g[UE_inst][0]->frame_rx = frame;
PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot; PHY_vars_UE_g[UE_inst][0]->slot_rx =
PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot; last_slot;
PHY_vars_UE_g[UE_inst][0]->slot_tx =
next_slot;
if (next_slot > 1) if (next_slot > 1)
PHY_vars_UE_g[UE_inst][0]->frame_tx = frame; PHY_vars_UE_g[UE_inst][0]->frame_tx =
frame;
else else
PHY_vars_UE_g[UE_inst][0]->frame_tx = frame+1; PHY_vars_UE_g[UE_inst][0]->frame_tx =
frame + 1;
#ifdef OPENAIR2 #ifdef OPENAIR2
//Application //Application
update_otg_UE (UE_inst, oai_emulation.info.time_ms); update_otg_UE (UE_inst, oai_emulation.info.time_ms);
//Access layer //Access layer
pdcp_run (frame, 0, UE_inst, 0); ctxt.enb_module_id = 0;
ctxt.ue_module_id = UE_inst;
ctxt.frame = frame;
ctxt.enb_flag = ENB_FLAG_NO;
pdcp_run (&ctxt);
#endif #endif
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs;
phy_procedures_UE_lte (PHY_vars_UE_g[UE_inst][CC_id], 0, abstraction_flag, normal_txrx, CC_id++) {
no_relay, NULL); phy_procedures_UE_lte (
PHY_vars_UE_g[UE_inst][CC_id],
0, abstraction_flag,
normal_txrx, no_relay,
NULL);
} }
ue_data[UE_inst]->tx_power_dBm = PHY_vars_UE_g[UE_inst][0]->tx_power_dBm; ue_data[UE_inst]->tx_power_dBm =
PHY_vars_UE_g[UE_inst][0]->tx_power_dBm;
} }
} } else {
else {
if (abstraction_flag == 1) { if (abstraction_flag == 1) {
LOG_E( LOG_E(EMU,
EMU, "sync not supported in abstraction mode (UE%d,mode%d)\n",
"sync not supported in abstraction mode (UE%d,mode%d)\n", UE_inst, PHY_vars_UE_g[UE_inst][0]->UE_mode[0]); UE_inst,
PHY_vars_UE_g[UE_inst][0]->UE_mode[0]);
exit (-1); exit (-1);
} }
if ((frame > 0) && (last_slot == (LTE_SLOTS_PER_FRAME - 2))) { if ((frame > 0)
initial_sync (PHY_vars_UE_g[UE_inst][0], normal_txrx); && (last_slot
== (LTE_SLOTS_PER_FRAME
- 2))) {
initial_sync (PHY_vars_UE_g[UE_inst][0],
normal_txrx);
/* /*
write_output("dlchan00.m","dlch00",&(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),(6*(PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)),1,1); write_output("dlchan00.m","dlch00",&(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),(6*(PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)),1,1);
...@@ -879,8 +899,10 @@ void *l2l1_task(void *args_p) { ...@@ -879,8 +899,10 @@ void *l2l1_task(void *args_p) {
} }
} }
#endif #endif
emu_transport (frame, last_slot, next_slot, direction, oai_emulation.info.frame_type[0], ethernet_flag); emu_transport (frame, last_slot, next_slot, direction,
if ((direction == SF_DL) || (frame_parms[0]->frame_type == FDD)) { oai_emulation.info.frame_type[0], ethernet_flag);
if ((direction == SF_DL)
|| (frame_parms[0]->frame_type == FDD)) {
// consider only sec id 0 // consider only sec id 0
/* for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { /* for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
...@@ -890,21 +912,37 @@ void *l2l1_task(void *args_p) { ...@@ -890,21 +912,37 @@ void *l2l1_task(void *args_p) {
frame_parms); frame_parms);
} }
}*/ }*/
start_meas(&dl_chan_stats); start_meas (&dl_chan_stats);
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning figure out what to do with UE frame_parms during initial_sync #warning figure out what to do with UE frame_parms during initial_sync
do_DL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, eNB2UE, enb_data, ue_data, next_slot, abstraction_flag,&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,UE_inst,CC_id); do_DL_sig (r_re0,
} r_im0,
stop_meas(&dl_chan_stats); r_re,
r_im,
s_re,
s_im,
eNB2UE,
enb_data,
ue_data,
next_slot,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
UE_inst, CC_id);
}
stop_meas (&dl_chan_stats);
} }
if ((direction == SF_UL) || (frame_parms[0]->frame_type == 0)) { //if ((subframe<2) || (subframe>4)) if ((direction == SF_UL) || (frame_parms[0]->frame_type == 0)) { //if ((subframe<2) || (subframe>4))
start_meas(&ul_chan_stats); start_meas (&ul_chan_stats);
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning figure out what to do with UE frame_parms during initial_sync #warning figure out what to do with UE frame_parms during initial_sync
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB, enb_data, ue_data, next_slot, abstraction_flag,&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, frame,CC_id); do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
enb_data, ue_data, next_slot,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
frame, CC_id);
} }
stop_meas(&ul_chan_stats); stop_meas (&ul_chan_stats);
/* /*
int ccc; int ccc;
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n "); fprintf(SINRpost,"SINRdb For eNB New Subframe : \n ");
...@@ -925,27 +963,50 @@ void *l2l1_task(void *args_p) { ...@@ -925,27 +963,50 @@ void *l2l1_task(void *args_p) {
frame_parms); frame_parms);
} }
}*/ }*/
start_meas(&dl_chan_stats); start_meas (&dl_chan_stats);
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
#warning check dimensions of r_reN,r_imN for multiple CCs #warning check dimensions of r_reN,r_imN for multiple CCs
do_DL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, eNB2UE, enb_data, ue_data, next_slot, abstraction_flag,&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, UE_inst,CC_id); do_DL_sig (r_re0,
} r_im0,
stop_meas(&dl_chan_stats); r_re,
r_im,
s_re,
s_im,
eNB2UE,
enb_data,
ue_data,
next_slot,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
UE_inst, CC_id);
}
stop_meas (&dl_chan_stats);
/* /*
for (aarx=0;aarx<UE2eNB[1][0]->nb_rx;aarx++) for (aarx=0;aarx<UE2eNB[1][0]->nb_rx;aarx++)
for (aatx=0;aatx<UE2eNB[1][0]->nb_tx;aatx++) for (aatx=0;aatx<UE2eNB[1][0]->nb_tx;aatx++)
for (k=0;k<UE2eNB[1][0]->channel_length;k++) for (k=0;k<UE2eNB[1][0]->channel_length;k++)
printf("SB(%d,%d,%d)->(%f,%f)\n",k,aarx,aatx,UE2eNB[1][0]->ch[aarx+(aatx*UE2eNB[1][0]->nb_rx)][k].r,UE2eNB[1][0]->ch[aarx+(aatx*UE2eNB[1][0]->nb_rx)][k].i); printf("SB(%d,%d,%d)->(%f,%f)\n",k,aarx,aatx,UE2eNB[1][0]->ch[aarx+(aatx*UE2eNB[1][0]->nb_rx)][k].r,UE2eNB[1][0]->ch[aarx+(aatx*UE2eNB[1][0]->nb_rx)][k].i);
*/ */
} } else { // UL part
else { // UL part start_meas (&ul_chan_stats);
start_meas(&ul_chan_stats); for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
#warning check dimensions of r_reN,r_imN for multiple CCs #warning check dimensions of r_reN,r_imN for multiple CCs
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB, enb_data, ue_data, next_slot, abstraction_flag,&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, frame,CC_id); do_UL_sig (r_re0,
} r_im0,
stop_meas(&ul_chan_stats); r_re,
r_im,
s_re,
s_im,
UE2eNB,
enb_data,
ue_data,
next_slot,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
frame, CC_id);
}
stop_meas (&ul_chan_stats);
/* int ccc; /* int ccc;
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n "); fprintf(SINRpost,"SINRdb For eNB New Subframe : \n ");
...@@ -958,18 +1019,35 @@ void *l2l1_task(void *args_p) { ...@@ -958,18 +1019,35 @@ void *l2l1_task(void *args_p) {
*/ */
} }
} }
if ((last_slot == 1) && (frame == 0) && (abstraction_flag == 0) && (oai_emulation.info.n_frames == 1)) { if ((last_slot == 1) && (frame == 0) && (abstraction_flag == 0)
&& (oai_emulation.info.n_frames == 1)) {
write_output ("dlchan0.m", "dlch0", &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),
(6 * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)), 1, 1); write_output ("dlchan0.m",
write_output ("dlchan1.m", "dlch1", &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[1][0][0]), "dlch0",
(6 * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)), 1, 1); &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),
write_output ("dlchan2.m", "dlch2", &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[2][0][0]), (6
(6 * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)), 1, 1); * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)),
write_output ("pbch_rxF_comp0.m", "pbch_comp0", PHY_vars_UE_g[0][0]->lte_ue_pbch_vars[0]->rxdataF_comp[0], 1, 1);
write_output ("dlchan1.m",
"dlch1",
&(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[1][0][0]),
(6
* (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)),
1, 1);
write_output ("dlchan2.m",
"dlch2",
&(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[2][0][0]),
(6
* (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)),
1, 1);
write_output ("pbch_rxF_comp0.m",
"pbch_comp0",
PHY_vars_UE_g[0][0]->lte_ue_pbch_vars[0]->rxdataF_comp[0],
6 * 12 * 4, 1, 1); 6 * 12 * 4, 1, 1);
write_output ("pbch_rxF_llr.m", "pbch_llr", PHY_vars_UE_g[0][0]->lte_ue_pbch_vars[0]->llr, write_output ("pbch_rxF_llr.m", "pbch_llr",
(frame_parms[0]->Ncp == 0) ? 1920 : 1728, 1, 4); PHY_vars_UE_g[0][0]->lte_ue_pbch_vars[0]->llr,
(frame_parms[0]->Ncp == 0) ? 1920 : 1728, 1,
4);
} }
/* /*
if ((last_slot==1) && (frame==1)) { if ((last_slot==1) && (frame==1)) {
...@@ -978,9 +1056,9 @@ void *l2l1_task(void *args_p) { ...@@ -978,9 +1056,9 @@ void *l2l1_task(void *args_p) {
} }
*/ */
} // if Channel_Flag==0 } // if Channel_Flag==0
if (slot%2==1) if (slot % 2 == 1)
stop_meas(&oaisim_stats_f); stop_meas (&oaisim_stats_f);
}//end of slot } //end of slot
if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0) if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0)
#ifdef PROC #ifdef PROC
...@@ -989,24 +1067,44 @@ void *l2l1_task(void *args_p) { ...@@ -989,24 +1067,44 @@ void *l2l1_task(void *args_p) {
) { ) {
sprintf (fname, "UEtxsig%d.m", frame); sprintf (fname, "UEtxsig%d.m", frame);
sprintf (vname, "txs%d", frame); sprintf (vname, "txs%d", frame);
write_output (fname, vname, PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0], write_output (fname,
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti*10,1,1); vname,
PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
* 10,
1, 1);
sprintf (fname, "eNBtxsig%d.m", frame); sprintf (fname, "eNBtxsig%d.m", frame);
sprintf (vname, "txs%d", frame); sprintf (vname, "txs%d", frame);
write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0], write_output (fname,
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti*10,1,1); vname,
PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
* 10,
1, 1);
sprintf (fname, "eNBtxsigF%d.m", frame); sprintf (fname, "eNBtxsigF%d.m", frame);
sprintf (vname, "txsF%d", frame); sprintf (vname, "txsF%d", frame);
write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0], write_output (fname,
PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti * PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size,1,1); vname,
PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0],
PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti
* PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size,
1, 1);
sprintf (fname, "UErxsig%d.m", frame); sprintf (fname, "UErxsig%d.m", frame);
sprintf (vname, "rxs%d", frame); sprintf (vname, "rxs%d", frame);
write_output (fname, vname, PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0], write_output (fname,
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti*10,1,1); vname,
PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
* 10,
1, 1);
sprintf (fname, "eNBrxsig%d.m", frame); sprintf (fname, "eNBrxsig%d.m", frame);
sprintf (vname, "rxs%d", frame); sprintf (vname, "rxs%d", frame);
write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0], write_output (fname,
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti*10,1,1); vname,
PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti
* 10,
1, 1);
} }
#ifdef XFORMS #ifdef XFORMS
...@@ -1035,7 +1133,7 @@ void *l2l1_task(void *args_p) { ...@@ -1035,7 +1133,7 @@ void *l2l1_task(void *args_p) {
//end of frame //end of frame
stop_meas(&oaisim_stats); stop_meas (&oaisim_stats);
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
itti_terminate_tasks(TASK_L2L1); itti_terminate_tasks(TASK_L2L1);
...@@ -1062,8 +1160,9 @@ void *l2l1_task(void *args_p) { ...@@ -1062,8 +1160,9 @@ void *l2l1_task(void *args_p) {
return NULL; return NULL;
} }
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
int main(int argc, char **argv) { int
main (int argc, char **argv) {
int32_t i; int32_t i;
// pointers signal buffers (s = transmit, r,r0 = receive) // pointers signal buffers (s = transmit, r,r0 = receive)
...@@ -1114,22 +1213,22 @@ void *l2l1_task(void *args_p) { ...@@ -1114,22 +1213,22 @@ void *l2l1_task(void *args_p) {
pthread_t tid; pthread_t tid;
int err; int err;
sigset_t sigblock; sigset_t sigblock;
sigemptyset(&sigblock); sigemptyset (&sigblock);
sigaddset(&sigblock, SIGHUP); sigaddset (&sigblock, SIGHUP);
sigaddset(&sigblock, SIGINT); sigaddset (&sigblock, SIGINT);
sigaddset(&sigblock, SIGTERM); sigaddset (&sigblock, SIGTERM);
sigaddset(&sigblock, SIGQUIT); sigaddset (&sigblock, SIGQUIT);
//sigaddset(&sigblock, SIGKILL); //sigaddset(&sigblock, SIGKILL);
if ((err= pthread_sigmask(SIG_BLOCK, &sigblock, NULL)) != 0){ if ((err = pthread_sigmask (SIG_BLOCK, &sigblock, NULL)) != 0) {
printf("SIG_BLOCK error\n"); printf ("SIG_BLOCK error\n");
return -1; return -1;
} }
if (pthread_create(&tid, NULL, sigh, NULL)) { if (pthread_create (&tid, NULL, sigh, NULL)) {
printf("Pthread for tracing Signals is not created!\n"); printf ("Pthread for tracing Signals is not created!\n");
return -1; return -1;
} else { } else {
printf("Pthread for tracing Signals is created!\n"); printf ("Pthread for tracing Signals is created!\n");
} }
#endif #endif
// configure oaisim with OCG // configure oaisim with OCG
...@@ -1166,11 +1265,11 @@ void *l2l1_task(void *args_p) { ...@@ -1166,11 +1265,11 @@ void *l2l1_task(void *args_p) {
// add events to future event list: Currently not used // add events to future event list: Currently not used
//oai_emulation.info.oeh_enabled = 1; //oai_emulation.info.oeh_enabled = 1;
if (oai_emulation.info.oeh_enabled == 1) if (oai_emulation.info.oeh_enabled == 1)
schedule_events(); schedule_events ();
// oai performance profiler is enabled // oai performance profiler is enabled
if (oai_emulation.info.opp_enabled == 1) if (oai_emulation.info.opp_enabled == 1)
reset_opp_meas(); reset_opp_meas ();
init_time (); init_time ();
...@@ -1178,7 +1277,8 @@ void *l2l1_task(void *args_p) { ...@@ -1178,7 +1277,8 @@ void *l2l1_task(void *args_p) {
t = clock (); t = clock ();
LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); LOG_N(EMU,
">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
// Handle signals until all tasks are terminated // Handle signals until all tasks are terminated
...@@ -1189,133 +1289,134 @@ void *l2l1_task(void *args_p) { ...@@ -1189,133 +1289,134 @@ void *l2l1_task(void *args_p) {
} }
#else #else
if (oai_emulation.info.nb_enb_local > 0) { if (oai_emulation.info.nb_enb_local > 0) {
eNB_app_task(NULL); // do nothing for the moment eNB_app_task (NULL); // do nothing for the moment
} }
l2l1_task (NULL); l2l1_task (NULL);
#endif #endif
t = clock () - t; t = clock () - t;
LOG_I (EMU,"Duration of the simulation: %f seconds\n", ((float) t) / CLOCKS_PER_SEC); LOG_I(EMU, "Duration of the simulation: %f seconds\n",
((float) t) / CLOCKS_PER_SEC);
// fclose(SINRpost); // fclose(SINRpost);
LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU Ending <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); LOG_N(EMU,
">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU Ending <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
raise(SIGINT); raise (SIGINT);
oai_shutdown(); oai_shutdown ();
return (0); return (0);
} }
void reset_opp_meas(void){ void
uint8_t eNB_id=0,UE_id=0; reset_opp_meas (void) {
uint8_t eNB_id = 0, UE_id = 0;
reset_meas(&oaisim_stats); reset_meas (&oaisim_stats);
reset_meas(&oaisim_stats_f); // frame reset_meas (&oaisim_stats_f); // frame
// init time stats here (including channel) // init time stats here (including channel)
reset_meas(&dl_chan_stats); reset_meas (&dl_chan_stats);
reset_meas(&ul_chan_stats); reset_meas (&ul_chan_stats);
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
reset_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc); reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc);
reset_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc_rx); reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx);
reset_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc_tx); reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_tx);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->rx_dft_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->rx_dft_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_channel_estimation_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_channel_estimation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_freq_offset_estimation_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_freq_offset_estimation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_rate_unmatching_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_rate_unmatching_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_turbo_decoding_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_turbo_decoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_deinterleaving_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_deinterleaving_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_llr_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_llr_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_unscrambling_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_unscrambling_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_init_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_init_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_alpha_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_alpha_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_beta_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_beta_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_gamma_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_gamma_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_ext_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_ext_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl1_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl1_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl2_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl2_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->tx_prach); reset_meas (&PHY_vars_UE_g[UE_id][0]->tx_prach);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_mod_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_mod_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_encoding_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_encoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_modulation_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_modulation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_segmentation_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_segmentation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_rate_matching_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_rate_matching_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_multiplexing_stats); reset_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_multiplexing_stats);
/* /*
* L2 functions * L2 functions
*/ */
// UE MAC // UE MAC
reset_meas(&UE_mac_inst[UE_id].ue_scheduler); // total reset_meas (&UE_mac_inst[UE_id].ue_scheduler); // total
reset_meas(&UE_mac_inst[UE_id].tx_ulsch_sdu); // inlcude rlc_data_req + mac header gen reset_meas (&UE_mac_inst[UE_id].tx_ulsch_sdu); // inlcude rlc_data_req + mac header gen
reset_meas(&UE_mac_inst[UE_id].rx_dlsch_sdu); // include mac_rrc_data_ind or mac_rlc_status_ind+mac_rlc_data_ind and mac header parser reset_meas (&UE_mac_inst[UE_id].rx_dlsch_sdu); // include mac_rrc_data_ind or mac_rlc_status_ind+mac_rlc_data_ind and mac header parser
reset_meas(&UE_mac_inst[UE_id].ue_query_mch); reset_meas (&UE_mac_inst[UE_id].ue_query_mch);
reset_meas(&UE_mac_inst[UE_id].rx_mch_sdu); // include rld_data_ind+ parse mch header reset_meas (&UE_mac_inst[UE_id].rx_mch_sdu); // include rld_data_ind+ parse mch header
reset_meas(&UE_mac_inst[UE_id].rx_si); // include rlc_data_ind + mac header parser reset_meas (&UE_mac_inst[UE_id].rx_si); // include rlc_data_ind + mac header parser
reset_meas(&UE_pdcp_stats[UE_id].pdcp_run); reset_meas (&UE_pdcp_stats[UE_id].pdcp_run);
reset_meas(&UE_pdcp_stats[UE_id].data_req); reset_meas (&UE_pdcp_stats[UE_id].data_req);
reset_meas(&UE_pdcp_stats[UE_id].data_ind); reset_meas (&UE_pdcp_stats[UE_id].data_ind);
reset_meas(&UE_pdcp_stats[UE_id].apply_security); reset_meas (&UE_pdcp_stats[UE_id].apply_security);
reset_meas(&UE_pdcp_stats[UE_id].validate_security); reset_meas (&UE_pdcp_stats[UE_id].validate_security);
reset_meas(&UE_pdcp_stats[UE_id].pdcp_ip); reset_meas (&UE_pdcp_stats[UE_id].pdcp_ip);
reset_meas(&UE_pdcp_stats[UE_id].ip_pdcp); reset_meas (&UE_pdcp_stats[UE_id].ip_pdcp);
}
} for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { reset_meas (&eNB2UE[eNB_id][UE_id][0]->random_channel);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->random_channel); reset_meas (&eNB2UE[eNB_id][UE_id][0]->interp_time);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->interp_time); reset_meas (&eNB2UE[eNB_id][UE_id][0]->interp_freq);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->interp_freq); reset_meas (&eNB2UE[eNB_id][UE_id][0]->convolution);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->convolution); reset_meas (&UE2eNB[UE_id][eNB_id][0]->random_channel);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->random_channel); reset_meas (&UE2eNB[UE_id][eNB_id][0]->interp_time);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->interp_time); reset_meas (&UE2eNB[UE_id][eNB_id][0]->interp_freq);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->interp_freq); reset_meas (&UE2eNB[UE_id][eNB_id][0]->convolution);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->convolution); }
}
reset_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->rx_prach);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_prach);
reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats);
reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->rx_dft_stats); //reset_meas(&PHY_vars_eNB_g[eNB_id]->rx_dft_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_channel_estimation_stats); //reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_channel_estimation_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_freq_offset_estimation_stats); //reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_freq_offset_estimation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_llr_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_llr_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats); reset_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats);
#ifdef LOCALIZATION #ifdef LOCALIZATION
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->localization_stats); reset_meas(&PHY_vars_eNB_g[eNB_id][0]->localization_stats);
#endif #endif
...@@ -1324,205 +1425,302 @@ void *l2l1_task(void *args_p) { ...@@ -1324,205 +1425,302 @@ void *l2l1_task(void *args_p) {
* L2 functions * L2 functions
*/ */
// eNB MAC // eNB MAC
reset_meas(&eNB_mac_inst[eNB_id].eNB_scheduler); // total reset_meas (&eNB_mac_inst[eNB_id].eNB_scheduler); // total
reset_meas(&eNB_mac_inst[eNB_id].schedule_si); // only schedule + tx reset_meas (&eNB_mac_inst[eNB_id].schedule_si); // only schedule + tx
reset_meas(&eNB_mac_inst[eNB_id].schedule_ra); // only ra reset_meas (&eNB_mac_inst[eNB_id].schedule_ra); // only ra
reset_meas(&eNB_mac_inst[eNB_id].schedule_ulsch); // onlu ulsch reset_meas (&eNB_mac_inst[eNB_id].schedule_ulsch); // onlu ulsch
reset_meas(&eNB_mac_inst[eNB_id].fill_DLSCH_dci);// only dci reset_meas (&eNB_mac_inst[eNB_id].fill_DLSCH_dci); // only dci
reset_meas(&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor); // include rlc_data_req + MAC header gen reset_meas (&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor); // include rlc_data_req + MAC header gen
reset_meas(&eNB_mac_inst[eNB_id].schedule_dlsch); // include rlc_data_req + MAC header gen + pre-processor reset_meas (&eNB_mac_inst[eNB_id].schedule_dlsch); // include rlc_data_req + MAC header gen + pre-processor
reset_meas(&eNB_mac_inst[eNB_id].schedule_mch); // only embms reset_meas (&eNB_mac_inst[eNB_id].schedule_mch); // only embms
reset_meas(&eNB_mac_inst[eNB_id].rx_ulsch_sdu); // include rlc_data_ind + mac header parser reset_meas (&eNB_mac_inst[eNB_id].rx_ulsch_sdu); // include rlc_data_ind + mac header parser
reset_meas(&eNB_pdcp_stats[eNB_id].pdcp_run); reset_meas (&eNB_pdcp_stats[eNB_id].pdcp_run);
reset_meas(&eNB_pdcp_stats[eNB_id].data_req); reset_meas (&eNB_pdcp_stats[eNB_id].data_req);
reset_meas(&eNB_pdcp_stats[eNB_id].data_ind); reset_meas (&eNB_pdcp_stats[eNB_id].data_ind);
reset_meas(&eNB_pdcp_stats[eNB_id].apply_security); reset_meas (&eNB_pdcp_stats[eNB_id].apply_security);
reset_meas(&eNB_pdcp_stats[eNB_id].validate_security); reset_meas (&eNB_pdcp_stats[eNB_id].validate_security);
reset_meas(&eNB_pdcp_stats[eNB_id].pdcp_ip); reset_meas (&eNB_pdcp_stats[eNB_id].pdcp_ip);
reset_meas(&eNB_pdcp_stats[eNB_id].ip_pdcp); reset_meas (&eNB_pdcp_stats[eNB_id].ip_pdcp);
} }
} }
void print_opp_meas(void){ void
print_opp_meas (void) {
uint8_t eNB_id=0,UE_id=0;
uint8_t eNB_id = 0, UE_id = 0;
print_meas(&oaisim_stats,"[OAI][total_exec_time]", &oaisim_stats,&oaisim_stats);
print_meas(&oaisim_stats_f,"[OAI][SF_exec_time]", &oaisim_stats,&oaisim_stats_f); print_meas (&oaisim_stats, "[OAI][total_exec_time]", &oaisim_stats,
&oaisim_stats);
print_meas(&dl_chan_stats,"[DL][chan_stats]",&oaisim_stats,&oaisim_stats_f); print_meas (&oaisim_stats_f, "[OAI][SF_exec_time]", &oaisim_stats,
print_meas(&ul_chan_stats,"[UL][chan_stats]", &oaisim_stats,&oaisim_stats_f); &oaisim_stats_f);
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) { print_meas (&dl_chan_stats, "[DL][chan_stats]", &oaisim_stats,
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) { &oaisim_stats_f);
print_meas(&eNB2UE[eNB_id][UE_id][0]->random_channel,"[DL][random_channel]",&oaisim_stats,&oaisim_stats_f); print_meas (&ul_chan_stats, "[UL][chan_stats]", &oaisim_stats,
print_meas(&eNB2UE[eNB_id][UE_id][0]->interp_time,"[DL][interp_time]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats_f);
print_meas(&eNB2UE[eNB_id][UE_id][0]->interp_freq,"[DL][interp_freq]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB2UE[eNB_id][UE_id][0]->convolution,"[DL][convolution]",&oaisim_stats,&oaisim_stats_f); for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
print_meas(&UE2eNB[UE_id][eNB_id][0]->random_channel,"[UL][random_channel]",&oaisim_stats,&oaisim_stats_f); print_meas (&eNB2UE[eNB_id][UE_id][0]->random_channel,
print_meas(&UE2eNB[UE_id][eNB_id][0]->interp_time,"[UL][interp_time]",&oaisim_stats,&oaisim_stats_f); "[DL][random_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas(&UE2eNB[UE_id][eNB_id][0]->interp_freq,"[UL][interp_freq]",&oaisim_stats,&oaisim_stats_f); print_meas (&eNB2UE[eNB_id][UE_id][0]->interp_time,
print_meas(&UE2eNB[UE_id][eNB_id][0]->convolution,"[UL][convolution]",&oaisim_stats,&oaisim_stats_f); "[DL][interp_time]", &oaisim_stats, &oaisim_stats_f);
} print_meas (&eNB2UE[eNB_id][UE_id][0]->interp_freq,
} "[DL][interp_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB2UE[eNB_id][UE_id][0]->convolution,
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) { "[DL][convolution]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc,"[UE][total_phy_proc]",&oaisim_stats,&oaisim_stats_f);
print_meas (&UE2eNB[UE_id][eNB_id][0]->random_channel,
print_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc_rx,"[UE][total_phy_proc_rx]",&oaisim_stats,&oaisim_stats_f); "[UL][random_channel]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats,"[UE][ofdm_demod]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE2eNB[UE_id][eNB_id][0]->interp_time,
print_meas(&PHY_vars_UE_g[UE_id][0]->rx_dft_stats,"[UE][rx_dft]",&oaisim_stats,&oaisim_stats_f); "[UL][interp_time]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_channel_estimation_stats,"[UE][channel_est]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE2eNB[UE_id][eNB_id][0]->interp_freq,
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_freq_offset_estimation_stats,"[UE][freq_offset]",&oaisim_stats,&oaisim_stats_f); "[UL][interp_freq]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_llr_stats,"[UE][llr]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE2eNB[UE_id][eNB_id][0]->convolution,
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_unscrambling_stats,"[UE][unscrambling]",&oaisim_stats,&oaisim_stats_f); "[UL][convolution]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats,"[UE][decoding]",&oaisim_stats,&oaisim_stats_f); }
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_rate_unmatching_stats,"[UE][rate_unmatching]",&oaisim_stats,&oaisim_stats_f); }
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_deinterleaving_stats,"[UE][deinterleaving]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_turbo_decoding_stats,"[UE][turbo_decoding]",&oaisim_stats,&oaisim_stats_f); for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_init_stats,"[UE][ |_tc_init]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc, "[UE][total_phy_proc]",
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_alpha_stats,"[UE][ |_tc_alpha]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_beta_stats,"[UE][ |_tc_beta]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_gamma_stats,"[UE][ |_tc_gamma]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx,
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_ext_stats,"[UE][ |_tc_ext]",&oaisim_stats,&oaisim_stats_f); "[UE][total_phy_proc_rx]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl1_stats,"[UE][ |_tc_intl1]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats,
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl2_stats,"[UE][ |_tc_intl2]",&oaisim_stats,&oaisim_stats_f); "[UE][ofdm_demod]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->rx_dft_stats, "[UE][rx_dft]",
print_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc_tx,"[UE][total_phy_proc_tx]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_mod_stats,"[UE][ofdm_mod]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_channel_estimation_stats,
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_modulation_stats,"[UE][modulation]",&oaisim_stats,&oaisim_stats_f); "[UE][channel_est]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_encoding_stats,"[UE][encoding]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_freq_offset_estimation_stats,
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_segmentation_stats,"[UE][segmentation]",&oaisim_stats,&oaisim_stats_f); "[UE][freq_offset]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_rate_matching_stats,"[UE][rate_matching]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_llr_stats, "[UE][llr]",
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats,"[UE][turbo_encoding]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats,"[UE][interleaving]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_unscrambling_stats,
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_multiplexing_stats,"[UE][multiplexing]",&oaisim_stats,&oaisim_stats_f); "[UE][unscrambling]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats,
} "[UE][decoding]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_rate_unmatching_stats,
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) { "[UE][rate_unmatching]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc,"[eNB][total_phy_proc]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_deinterleaving_stats,
"[UE][deinterleaving]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx,"[eNB][total_phy_proc_tx]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_turbo_decoding_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats,"[eNB][ofdm_mod]",&oaisim_stats,&oaisim_stats_f); "[UE][turbo_decoding]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats,"[eNB][modulation]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_init_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats,"[eNB][scrambling]",&oaisim_stats,&oaisim_stats_f); "[UE][ |_tc_init]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats,"[eNB][encoding]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_alpha_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats,"[eNB][|_interleaving]",&oaisim_stats,&oaisim_stats_f); "[UE][ |_tc_alpha]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats,"[eNB][|_rate_matching]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_beta_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats,"[eNB][|_turbo_encoding]",&oaisim_stats,&oaisim_stats_f); "[UE][ |_tc_beta]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_gamma_stats,
"[UE][ |_tc_gamma]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx,"[eNB][total_phy_proc_rx]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_ext_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats,"[eNB][ofdm_demod]",&oaisim_stats,&oaisim_stats_f); "[UE][ |_tc_ext]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl1_stats,
"[UE][ |_tc_intl1]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl2_stats,
"[UE][ |_tc_intl2]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_tx,
"[UE][total_phy_proc_tx]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_mod_stats, "[UE][ofdm_mod]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_modulation_stats,
"[UE][modulation]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_encoding_stats,
"[UE][encoding]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_segmentation_stats,
"[UE][segmentation]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_rate_matching_stats,
"[UE][rate_matching]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats,
"[UE][turbo_encoding]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats,
"[UE][interleaving]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_UE_g[UE_id][0]->ulsch_multiplexing_stats,
"[UE][multiplexing]", &oaisim_stats, &oaisim_stats_f);
}
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
print_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc,
"[eNB][total_phy_proc]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx,
"[eNB][total_phy_proc_tx]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats,
"[eNB][ofdm_mod]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats,
"[eNB][modulation]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats,
"[eNB][scrambling]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats,
"[eNB][encoding]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats,
"[eNB][|_interleaving]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats,
"[eNB][|_rate_matching]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats,
"[eNB][|_turbo_encoding]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx,
"[eNB][total_phy_proc_rx]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats,
"[eNB][ofdm_demod]", &oaisim_stats, &oaisim_stats_f);
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_channel_estimation_stats,"[eNB][channel_est]"); //print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_channel_estimation_stats,"[eNB][channel_est]");
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_freq_offset_estimation_stats,"[eNB][freq_offset]"); //print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_freq_offset_estimation_stats,"[eNB][freq_offset]");
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_dft_stats,"[eNB][rx_dft]"); //print_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_dft_stats,"[eNB][rx_dft]");
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats,"[eNB][demodulation]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats,"[eNB][decoding]",&oaisim_stats,&oaisim_stats_f); "[eNB][demodulation]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats,"[eNB][|_deinterleaving]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats,"[eNB][|_demultiplexing]",&oaisim_stats,&oaisim_stats_f); "[eNB][decoding]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats,"[eNB][|_rate_unmatching]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats,"[eNB][|_turbo_decoding]",&oaisim_stats,&oaisim_stats_f); "[eNB][|_deinterleaving]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats,"[eNB][ |_tc_init]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats,"[eNB][ |_tc_alpha]",&oaisim_stats,&oaisim_stats_f); "[eNB][|_demultiplexing]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats,"[eNB][ |_tc_beta]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats,"[eNB][ |_tc_gamma]",&oaisim_stats,&oaisim_stats_f); "[eNB][|_rate_unmatching]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats,"[eNB][ |_tc_ext]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats,
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats,"[eNB][ |_tc_intl1]",&oaisim_stats,&oaisim_stats_f); "[eNB][|_turbo_decoding]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats,"[eNB][ |_tc_intl2]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats,
"[eNB][ |_tc_init]", &oaisim_stats, &oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_prach,"[eNB][rx_prach]",&oaisim_stats,&oaisim_stats_f); print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats,
"[eNB][ |_tc_alpha]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats,
"[eNB][ |_tc_beta]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats,
"[eNB][ |_tc_gamma]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats,
"[eNB][ |_tc_ext]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats,
"[eNB][ |_tc_intl1]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats,
"[eNB][ |_tc_intl2]", &oaisim_stats, &oaisim_stats_f);
print_meas (&PHY_vars_eNB_g[eNB_id][0]->rx_prach, "[eNB][rx_prach]",
&oaisim_stats, &oaisim_stats_f);
#ifdef LOCALIZATION #ifdef LOCALIZATION
print_meas(&PHY_vars_eNB_g[eNB_id][0]->localization_stats, "[eNB][LOCALIZATION]",&oaisim_stats,&oaisim_stats_f); print_meas(&PHY_vars_eNB_g[eNB_id][0]->localization_stats, "[eNB][LOCALIZATION]",&oaisim_stats,&oaisim_stats_f);
#endif #endif
} }
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) { for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
print_meas(&UE_mac_inst[UE_id].ue_scheduler,"[UE][mac_scheduler]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE_mac_inst[UE_id].ue_scheduler, "[UE][mac_scheduler]",
print_meas(&UE_mac_inst[UE_id].tx_ulsch_sdu,"[UE][tx_ulsch_sdu]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas(&UE_mac_inst[UE_id].rx_dlsch_sdu,"[UE][rx_dlsch_sdu]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE_mac_inst[UE_id].tx_ulsch_sdu, "[UE][tx_ulsch_sdu]",
print_meas(&UE_mac_inst[UE_id].ue_query_mch,"[UE][query_MCH]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas(&UE_mac_inst[UE_id].rx_mch_sdu,"[UE][rx_mch_sdu]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE_mac_inst[UE_id].rx_dlsch_sdu, "[UE][rx_dlsch_sdu]",
print_meas(&UE_mac_inst[UE_id].rx_si,"[UE][rx_si]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas (&UE_mac_inst[UE_id].ue_query_mch, "[UE][query_MCH]",
print_meas(&UE_pdcp_stats[UE_id].pdcp_run,"[UE][total_pdcp_run]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas(&UE_pdcp_stats[UE_id].data_req,"[UE][DL][pdcp_data_req]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE_mac_inst[UE_id].rx_mch_sdu, "[UE][rx_mch_sdu]",
print_meas(&UE_pdcp_stats[UE_id].data_ind,"[UE][UL][pdcp_data_ind]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas (&UE_mac_inst[UE_id].rx_si, "[UE][rx_si]", &oaisim_stats,
print_meas(&UE_pdcp_stats[UE_id].apply_security,"[UE][DL][apply_security]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats_f);
print_meas(&UE_pdcp_stats[UE_id].validate_security,"[UE][UL][validate_security]",&oaisim_stats,&oaisim_stats_f);
print_meas(&UE_pdcp_stats[UE_id].ip_pdcp,"[UE][DL][ip_pdcp]",&oaisim_stats,&oaisim_stats_f); print_meas (&UE_pdcp_stats[UE_id].pdcp_run, "[UE][total_pdcp_run]",
print_meas(&UE_pdcp_stats[UE_id].pdcp_ip,"[UE][UL][pdcp_ip]",&oaisim_stats,&oaisim_stats_f); &oaisim_stats, &oaisim_stats_f);
print_meas (&UE_pdcp_stats[UE_id].data_req, "[UE][DL][pdcp_data_req]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&UE_pdcp_stats[UE_id].data_ind, "[UE][UL][pdcp_data_ind]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&UE_pdcp_stats[UE_id].apply_security,
"[UE][DL][apply_security]", &oaisim_stats, &oaisim_stats_f);
print_meas (&UE_pdcp_stats[UE_id].validate_security,
"[UE][UL][validate_security]", &oaisim_stats,
&oaisim_stats_f);
print_meas (&UE_pdcp_stats[UE_id].ip_pdcp, "[UE][DL][ip_pdcp]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&UE_pdcp_stats[UE_id].pdcp_ip, "[UE][UL][pdcp_ip]",
&oaisim_stats, &oaisim_stats_f);
}
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
print_meas (&eNB_mac_inst[eNB_id].eNB_scheduler, "[eNB][mac_scheduler]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].schedule_si, "[eNB][DL][SI]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].schedule_ra, "[eNB][DL][RA]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].fill_DLSCH_dci,
"[eNB][DL/UL][fill_DCI]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor,
"[eNB][DL][preprocessor]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].schedule_dlsch,
"[eNB][DL][schedule_tx_dlsch]", &oaisim_stats,
&oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].schedule_mch, "[eNB][DL][mch]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].schedule_ulsch, "[eNB][UL][ULSCH]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_mac_inst[eNB_id].rx_ulsch_sdu,
"[eNB][UL][rx_ulsch_sdu]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].pdcp_run, "[eNB][pdcp_run]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].data_req,
"[eNB][DL][pdcp_data_req]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].data_ind,
"[eNB][UL][pdcp_data_ind]", &oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].apply_security,
"[eNB][DL][apply_security]", &oaisim_stats,
&oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].validate_security,
"[eNB][UL][validate_security]", &oaisim_stats,
&oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].ip_pdcp, "[eNB][DL][ip_pdcp]",
&oaisim_stats, &oaisim_stats_f);
print_meas (&eNB_pdcp_stats[eNB_id].pdcp_ip, "[eNB][UL][pdcp_ip]",
&oaisim_stats, &oaisim_stats_f);
} }
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) { }
print_meas(&eNB_mac_inst[eNB_id].eNB_scheduler,"[eNB][mac_scheduler]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].schedule_si,"[eNB][DL][SI]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].schedule_ra,"[eNB][DL][RA]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].fill_DLSCH_dci,"[eNB][DL/UL][fill_DCI]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor,"[eNB][DL][preprocessor]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].schedule_dlsch,"[eNB][DL][schedule_tx_dlsch]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].schedule_mch,"[eNB][DL][mch]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].schedule_ulsch,"[eNB][UL][ULSCH]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_mac_inst[eNB_id].rx_ulsch_sdu,"[eNB][UL][rx_ulsch_sdu]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].pdcp_run,"[eNB][pdcp_run]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].data_req,"[eNB][DL][pdcp_data_req]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].data_ind,"[eNB][UL][pdcp_data_ind]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].apply_security,"[eNB][DL][apply_security]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].validate_security,"[eNB][UL][validate_security]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].ip_pdcp,"[eNB][DL][ip_pdcp]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB_pdcp_stats[eNB_id].pdcp_ip,"[eNB][UL][pdcp_ip]",&oaisim_stats,&oaisim_stats_f);
}
}
static void *sigh(void *arg) { static void *
sigh (void *arg) {
int signum; int signum;
sigset_t sigcatch; sigset_t sigcatch;
sigemptyset(&sigcatch); sigemptyset (&sigcatch);
sigaddset(&sigcatch, SIGHUP); sigaddset (&sigcatch, SIGHUP);
sigaddset(&sigcatch, SIGINT); sigaddset (&sigcatch, SIGINT);
sigaddset(&sigcatch, SIGTERM); sigaddset (&sigcatch, SIGTERM);
sigaddset(&sigcatch, SIGQUIT); sigaddset (&sigcatch, SIGQUIT);
for (;;) { for (;;) {
sigwait(&sigcatch, &signum); sigwait (&sigcatch, &signum);
//sigwait(&sigblock, &signum); //sigwait(&sigblock, &signum);
switch (signum) { switch (signum) {
case SIGHUP: case SIGHUP:
case SIGINT: case SIGINT:
case SIGTERM: case SIGTERM:
case SIGQUIT: case SIGQUIT:
fprintf(stderr,"received signal %d \n", signum); fprintf (stderr, "received signal %d \n", signum);
// no need for mutx: when ITTI not used, this variable is only accessed by this function // no need for mutx: when ITTI not used, this variable is only accessed by this function
l2l1_state = L2L1_TERMINATED; l2l1_state = L2L1_TERMINATED;
break; break;
default: default:
fprintf(stderr,"Unexpected signal %d \n",signum); fprintf (stderr, "Unexpected signal %d \n", signum);
exit(-1); exit (-1);
break; break;
} }
} }
pthread_exit(NULL); pthread_exit (NULL);
} }
void oai_shutdown(void) { void
static int done=0; oai_shutdown (void) {
static int done = 0;
int i; int i;
char interfaceName[8]; char interfaceName[8];
...@@ -1542,7 +1740,7 @@ void *l2l1_task(void *args_p) { ...@@ -1542,7 +1740,7 @@ void *l2l1_task(void *args_p) {
kpi_gen (); kpi_gen ();
if (oai_emulation.info.opp_enabled == 1) if (oai_emulation.info.opp_enabled == 1)
print_opp_meas(); print_opp_meas ();
// relase all rx state // relase all rx state
if (ethernet_flag == 1) { if (ethernet_flag == 1) {
...@@ -1600,7 +1798,8 @@ void *l2l1_task(void *args_p) { ...@@ -1600,7 +1798,8 @@ void *l2l1_task(void *args_p) {
if (oai_emulation.info.omv_enabled == 1) if (oai_emulation.info.omv_enabled == 1)
omv_end (pfd[1], omv_data); omv_end (pfd[1], omv_data);
#endif #endif
if ((oai_emulation.info.ocm_enabled == 1) && (ethernet_flag == 0) && (ShaF != NULL)) if ((oai_emulation.info.ocm_enabled == 1) && (ethernet_flag == 0)
&& (ShaF != NULL))
destroyMat (ShaF, map1, map2); destroyMat (ShaF, map1, map2);
if ((oai_emulation.info.opt_enabled == 1)) if ((oai_emulation.info.opt_enabled == 1))
...@@ -1618,17 +1817,18 @@ void *l2l1_task(void *args_p) { ...@@ -1618,17 +1817,18 @@ void *l2l1_task(void *args_p) {
log_thread_finalize (); log_thread_finalize ();
logClean (); logClean ();
vcd_signal_dumper_close (); vcd_signal_dumper_close ();
done =1; done = 1;
LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU shutdown <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); LOG_N(EMU,
} ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU shutdown <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
}
eNB_MAC_INST* get_eNB_mac_inst(module_id_t module_idP) eNB_MAC_INST*
{ get_eNB_mac_inst (module_id_t module_idP) {
return (&eNB_mac_inst[module_idP]); return (&eNB_mac_inst[module_idP]);
} }
OAI_Emulation* get_OAI_emulation() OAI_Emulation*
{ get_OAI_emulation () {
return &oai_emulation; return &oai_emulation;
} }
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