Commit be2b2ca2 authored by Navid Nikaein's avatar Navid Nikaein

* catch CTRL^C in oaisim, and handle oaisim shutdown (not fully tested)

* fix few pre-ci issues
 


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5231 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 55d0134e
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include <stdint.h> #include <stdint.h>
#include <stddef.h> #include <stddef.h>
#include "collection/hashtable/hashtable.h" //#include "collection/hashtable/hashtable.h"
#include "hashtable.h"
typedef struct obj_hash_node_s { typedef struct obj_hash_node_s {
int key_size; int key_size;
......
...@@ -424,7 +424,8 @@ mac_rlc_status_resp_t mac_rlc_status_ind( ...@@ -424,7 +424,8 @@ mac_rlc_status_resp_t mac_rlc_status_ind(
rlc_mode = rlc_union_p->mode; rlc_mode = rlc_union_p->mode;
} else { } else {
rlc_mode = RLC_MODE_NONE; rlc_mode = RLC_MODE_NONE;
LOG_E(RLC , "RLC not configured rb id %u lcid %u module %u!\n", rb_id, channel_idP, ue_module_idP); //LOG_W(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
LOG_D(RLC , "[%s] RLC not configured rb id %u lcid %u module %u!\n", __FUNCTION__, rb_id, channel_idP, ue_module_idP);
} }
switch (rlc_mode) { switch (rlc_mode) {
......
<? <?
// PLEASE ADAPT THE OPENAIR_HOMER VARIABLE TO YOUR CORRECT PATH // PLEASE ADAPT THE OPENAIR_HOME VARIABLE TO YOUR CORRECT PATH
$OPENAIR_HOME = "/home/navid/openair4G"; $OPENAIR_HOME = "/home/$USER/openair4G";
// //
......
...@@ -57,7 +57,9 @@ ...@@ -57,7 +57,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lteRALenb.h" #include "lteRALenb.h"
#include "commonDef.h" #include "commonDef.h"
#include "collection/hashtable/hashtable.h" #include "hashtable.h"
//#include "collection/hashtable/hashtable.h"
public_lteralenb_main(char* g_conf_enb_ral_listening_port;) public_lteralenb_main(char* g_conf_enb_ral_listening_port;)
public_lteralenb_main(char* g_conf_enb_ral_ip_address;) public_lteralenb_main(char* g_conf_enb_ral_ip_address;)
public_lteralenb_main(char* g_conf_enb_ral_link_id;) public_lteralenb_main(char* g_conf_enb_ral_link_id;)
......
...@@ -71,7 +71,9 @@ ...@@ -71,7 +71,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "lteRALue.h" #include "lteRALue.h"
#include "commonDef.h" #include "commonDef.h"
#include "collection/hashtable/hashtable.h" #include "hashtable.h"
//#include "collection/hashtable/hashtable.h"
public_mrallte_main(char* g_conf_ue_ral_listening_port;) public_mrallte_main(char* g_conf_ue_ral_listening_port;)
public_mrallte_main(char* g_conf_ue_ral_ip_address;) public_mrallte_main(char* g_conf_ue_ral_ip_address;)
public_mrallte_main(char* g_conf_ue_ral_link_id;) public_mrallte_main(char* g_conf_ue_ral_link_id;)
......
...@@ -11,11 +11,11 @@ eNBs = ...@@ -11,11 +11,11 @@ eNBs =
eNB_name = "eNB_Eurecom_0"; eNB_name = "eNB_Eurecom_0";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = "1";
mobile_country_code = 208; mobile_country_code = "208";
mobile_network_code = 10; mobile_network_code = "10";
////////// Channel parameters: ////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304 // Default Paging DRX of the eNB as defined in TS 36.304
...@@ -50,11 +50,11 @@ eNBs = ...@@ -50,11 +50,11 @@ eNBs =
eNB_name = "eNB_Eurecom_1"; eNB_name = "eNB_Eurecom_1";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = "1";
mobile_country_code = 208; mobile_country_code = "208";
mobile_network_code = 92; mobile_network_code = "92";
////////// Channel parameters: ////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304 // Default Paging DRX of the eNB as defined in TS 36.304
...@@ -87,11 +87,11 @@ eNBs = ...@@ -87,11 +87,11 @@ eNBs =
eNB_name = "eNB_Eurecom_2"; eNB_name = "eNB_Eurecom_2";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = "1";
mobile_country_code = 208; mobile_country_code = "208";
mobile_network_code = 92; mobile_network_code = "92";
////////// Channel parameters: ////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304 // Default Paging DRX of the eNB as defined in TS 36.304
...@@ -126,12 +126,11 @@ eNBs = ...@@ -126,12 +126,11 @@ eNBs =
eNB_name = "eNB_Eurecom_3"; eNB_name = "eNB_Eurecom_3";
// Tracking area code, 0x0000 and 0xfffe are reserved values // Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = 1; tracking_area_code = "1";
mobile_country_code = 208; mobile_country_code = "208";
// EXMIMO_IOT mobile_network_code = 92; mobile_network_code = "92";
mobile_network_code = 92;
////////// Channel parameters: ////////// Channel parameters:
// Default Paging DRX of the eNB as defined in TS 36.304 // Default Paging DRX of the eNB as defined in TS 36.304
......
...@@ -101,8 +101,9 @@ OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o ...@@ -101,8 +101,9 @@ OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1 CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1
endif endif
ifdef ENABLE_ITTI
RTAI_OBJ += $(UTILS_OBJS) RTAI_OBJ += $(UTILS_OBJS)
ifdef ENABLE_ITTI
CFLAGS += -DEXMIMO_IOT CFLAGS += -DEXMIMO_IOT
endif endif
......
...@@ -111,10 +111,6 @@ endif ...@@ -111,10 +111,6 @@ endif
# make cleanasn1 # make cleanasn1
#make all Rel10=1 #make all Rel10=1
#export IS_REL10=$(shell if [ -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10 ] ; then echo "1" ; else echo "0" ; fi)
#export IS_REL8=$(shell if [ -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8 ] ; then echo "1" ; else echo "0" ; fi)
ifdef CBA ifdef CBA
CFLAGS += -DRel10 CFLAGS += -DRel10
CFLAGS += -DCBA CFLAGS += -DCBA
...@@ -123,15 +119,9 @@ CFLAGS += -DCBA ...@@ -123,15 +119,9 @@ CFLAGS += -DCBA
else ifdef Rel10 else ifdef Rel10
CFLAGS += -DRel10 CFLAGS += -DRel10
@echo "Rel10=1" @echo "Rel10=1"
#ifeq ($(IS_REL10), 0)
# $(/bin/bash cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/ ; rm EUTRA-RRC-Definitions.asn ln -s EUTRA-RRC-Definitions-a20.asn EUTRA-RRC-Definitions.asn ; cd $(OPENAIR_TARGETS)/SIMU/USER/ ; rm -f $(ASN1_MSG_OBJS1) ; rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated ; rm -f $(L2_OBJS) ; rm -f *.o ; rm -f oaisim ; rm -f oaisim_pad; touch $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10 ; rm $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8 ; $(OPENAIR_TARGETS)/SCRIPTS/asn1_generate_rrc_messaging_c_code.bash )
#endif
else # default is rel 8 else # default is rel 8
@echo "Rel8=1" @echo "Rel8=1"
CFLAGS += -DRel8 CFLAGS += -DRel8
#ifeq ($(IS_REL8), 0)
# $(/bin/bash cd $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/ ; rm EUTRA-RRC-Definitions.asn ln -s EUTRA-RRC-Definitions-86.asn EUTRA-RRC-Definitions.asn ; cd $(OPENAIR_TARGETS)/SIMU/USER/ ; rm -f $(ASN1_MSG_OBJS1) ; rm -f $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc.generated ; rm -f $(L2_OBJS); rm -f *.o ; rm -f oaisim ; touch $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel8 ; rm $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/asn1c/ASN1_files/.lock-rel10 ; $(OPENAIR_TARGETS)/SCRIPTS/asn1_generate_rrc_messaging_c_code.bash )
#endif
endif endif
ifeq ($(RLC_STOP_ON_LOST_PDU), 1) ifeq ($(RLC_STOP_ON_LOST_PDU), 1)
......
...@@ -162,9 +162,10 @@ mapping small_scale_names[] = { ...@@ -162,9 +162,10 @@ mapping small_scale_names[] = {
{"AWGN", AWGN}, {"AWGN", AWGN},
{NULL, -1} {NULL, -1}
}; };
#if !defined(ENABLE_ITTI)
//static void *sigh(void *arg); static void *sigh(void *arg);
void terminate(void); #endif
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");
...@@ -375,9 +376,11 @@ typedef enum l2l1_task_state_e ...@@ -375,9 +376,11 @@ typedef enum l2l1_task_state_e
L2L1_TERMINATED, L2L1_TERMINATED,
} l2l1_task_state_t; } l2l1_task_state_t;
l2l1_task_state_t l2l1_state = L2L1_WAITTING;
/*------------------------------------------------------------------------------*/ /*------------------------------------------------------------------------------*/
void *l2l1_task(void *args_p) { void *l2l1_task(void *args_p) {
l2l1_task_state_t l2l1_state = L2L1_WAITTING;
clock_t t; clock_t t;
// Framing variables // Framing variables
...@@ -1019,19 +1022,28 @@ int main(int argc, char **argv) { ...@@ -1019,19 +1022,28 @@ int main(int argc, char **argv) {
// Initialize VCD LOG module // Initialize VCD LOG module
vcd_signal_dumper_init (oai_emulation.info.vcd_file); vcd_signal_dumper_init (oai_emulation.info.vcd_file);
/* pthread_t sigth; #if !defined(ENABLE_ITTI)
pthread_t tid;
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);
pthread_sigmask(SIG_BLOCK, &sigblock, NULL); sigaddset(&sigblock, SIGQUIT);
if (pthread_create(&sigth, NULL, sigh, NULL)) { //sigaddset(&sigblock, SIGKILL);
msg("Pthread for tracing Signals is not created!\n");
if ((err= pthread_sigmask(SIG_BLOCK, &sigblock, NULL)) != 0){
printf("SIG_BLOCK error\n");
return -1;
}
if (pthread_create(&tid, NULL, sigh, NULL)) {
printf("Pthread for tracing Signals is not created!\n");
return -1; return -1;
} else { } else {
msg("Pthread for tracing Signals is created!\n"); printf("Pthread for tracing Signals is created!\n");
}*/ }
#endif
// configure oaisim with OCG // configure oaisim with OCG
oaisim_config (); // config OMG and OCG, OPT, OTG, OLG oaisim_config (); // config OMG and OCG, OPT, OTG, OLG
...@@ -1094,92 +1106,9 @@ int main(int argc, char **argv) { ...@@ -1094,92 +1106,9 @@ int main(int argc, char **argv) {
// fclose(SINRpost); // fclose(SINRpost);
LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU Ending <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n"); LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU Ending <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
free (otg_pdcp_buffer);
#ifdef SMBV
if (config_smbv) {
smbv_send_config (smbv_fname,smbv_ip);
}
#endif
//Perform KPI measurements
if (oai_emulation.info.otg_enabled == 1)
kpi_gen ();
if (oai_emulation.info.opp_enabled == 1)
print_opp_meas();
// relase all rx state
if (ethernet_flag == 1) {
emu_transport_release ();
}
#ifdef PROC
if (abstraction_flag == 0 && Channel_Flag==0 && Process_Flag==0)
#else
if (abstraction_flag == 0)
#endif
{
/*
#ifdef IFFT_FPGA
free(txdataF2[0]);
free(txdataF2[1]);
free(txdataF2);
free(txdata[0]);
free(txdata[1]);
free(txdata);
#endif
*/
for (i = 0; i < 2; i++) {
free (s_re[i]);
free (s_im[i]);
free (r_re[i]);
free (r_im[i]);
}
free (s_re);
free (s_im);
free (r_re);
free (r_im);
lte_sync_time_free ();
}
// pthread_join(sigth, NULL);
// added for PHY abstraction raise(SIGINT);
if (oai_emulation.info.ocm_enabled == 1) { oai_shutdown();
for (eNB_inst = 0; eNB_inst < NUMBER_OF_eNB_MAX; eNB_inst++) {
free (enb_data[eNB_inst]);
}
for (UE_inst = 0; UE_inst < NUMBER_OF_UE_MAX; UE_inst++) {
free (ue_data[UE_inst]);
}
} //End of PHY abstraction changes
#ifdef OPENAIR2
mac_top_cleanup ();
#endif
// stop OMG
stop_mobility_generator (oai_emulation.info.omg_model_ue); //omg_param_list.mobility_type
#ifdef OPENAIR2
if (oai_emulation.info.omv_enabled == 1)
omv_end (pfd[1], omv_data);
#endif
if ((oai_emulation.info.ocm_enabled == 1) && (ethernet_flag == 0) && (ShaF != NULL))
destroyMat (ShaF, map1, map2);
if ((oai_emulation.info.opt_enabled == 1))
terminate_opt ();
if (oai_emulation.info.cli_enabled)
cli_server_cleanup ();
//bring oai if down
terminate ();
log_thread_finalize ();
logClean ();
vcd_signal_dumper_close ();
return (0); return (0);
} }
...@@ -1444,7 +1373,7 @@ void print_opp_meas(void){ ...@@ -1444,7 +1373,7 @@ void print_opp_meas(void){
} }
/*
static void *sigh(void *arg) { static void *sigh(void *arg) {
int signum; int signum;
...@@ -1453,29 +1382,129 @@ void print_opp_meas(void){ ...@@ -1453,29 +1382,129 @@ void print_opp_meas(void){
sigaddset(&sigcatch, SIGHUP); sigaddset(&sigcatch, SIGHUP);
sigaddset(&sigcatch, SIGINT); sigaddset(&sigcatch, SIGINT);
sigaddset(&sigcatch, SIGTERM); sigaddset(&sigcatch, SIGTERM);
sigaddset(&sigcatch, SIGQUIT);
for (;;) { for (;;) {
sigwait(&sigcatch, &signum); sigwait(&sigcatch, &signum);
//sigwait(&sigblock, &signum);
switch (signum) { switch (signum) {
case SIGHUP: case SIGHUP:
case SIGINT: case SIGINT:
case SIGTERM: case SIGTERM:
terminate(); case SIGQUIT:
fprintf(stderr,"received signal %d \n", signum);
// no need for mutx: when ITTI not used, this variable is only accessed by this function
l2l1_state = L2L1_TERMINATED;
break;
default: default:
fprintf(stderr,"Unexpected signal %d \n",signum);
exit(-1);
break; break;
} }
} }
pthread_exit(NULL); pthread_exit(NULL);
} }
*/
void terminate(void) {
void oai_shutdown(void) {
static int done=0;
int i; int i;
char interfaceName[8]; char interfaceName[8];
if (done)
return;
free (otg_pdcp_buffer);
#ifdef SMBV
if (config_smbv) {
smbv_send_config (smbv_fname,smbv_ip);
}
#endif
//Perform KPI measurements
if (oai_emulation.info.otg_enabled == 1)
kpi_gen ();
if (oai_emulation.info.opp_enabled == 1)
print_opp_meas();
// relase all rx state
if (ethernet_flag == 1) {
emu_transport_release ();
}
#ifdef PROC
if (abstraction_flag == 0 && Channel_Flag==0 && Process_Flag==0)
#else
if (abstraction_flag == 0)
#endif
{
/*
#ifdef IFFT_FPGA
free(txdataF2[0]);
free(txdataF2[1]);
free(txdataF2);
free(txdata[0]);
free(txdata[1]);
free(txdata);
#endif
*/
for (i = 0; i < 2; i++) {
free (s_re[i]);
free (s_im[i]);
free (r_re[i]);
free (r_im[i]);
}
free (s_re);
free (s_im);
free (r_re);
free (r_im);
lte_sync_time_free ();
}
// added for PHY abstraction
if (oai_emulation.info.ocm_enabled == 1) {
for (eNB_inst = 0; eNB_inst < NUMBER_OF_eNB_MAX; eNB_inst++) {
free (enb_data[eNB_inst]);
}
for (UE_inst = 0; UE_inst < NUMBER_OF_UE_MAX; UE_inst++) {
free (ue_data[UE_inst]);
}
} //End of PHY abstraction changes
#ifdef OPENAIR2
mac_top_cleanup ();
#endif
// stop OMG
stop_mobility_generator (oai_emulation.info.omg_model_ue); //omg_param_list.mobility_type
#ifdef OPENAIR2
if (oai_emulation.info.omv_enabled == 1)
omv_end (pfd[1], omv_data);
#endif
if ((oai_emulation.info.ocm_enabled == 1) && (ethernet_flag == 0) && (ShaF != NULL))
destroyMat (ShaF, map1, map2);
if ((oai_emulation.info.opt_enabled == 1))
terminate_opt ();
if (oai_emulation.info.cli_enabled)
cli_server_cleanup ();
for (i = 0; i < NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++) for (i = 0; i < NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++)
if (oai_emulation.info.oai_ifup[i] == 1) { if (oai_emulation.info.oai_ifup[i] == 1) {
sprintf (interfaceName, "oai%d", i); sprintf (interfaceName, "oai%d", i);
bringInterfaceUp (interfaceName, 0); bringInterfaceUp (interfaceName, 0);
} }
log_thread_finalize ();
logClean ();
vcd_signal_dumper_close ();
done =1;
LOG_N(EMU, ">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU shutdown <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
} }
...@@ -460,7 +460,7 @@ int olg_config() { ...@@ -460,7 +460,7 @@ int olg_config() {
oai_emulation.info.g_log_verbosity, oai_emulation.info.g_log_verbosity,
oai_emulation.emulation_config.log_emu.interval ); oai_emulation.emulation_config.log_emu.interval );
/*
// if perf eval then reset the otg log level // if perf eval then reset the otg log level
set_comp_log(PHY, LOG_EMERG, 0x15,1); set_comp_log(PHY, LOG_EMERG, 0x15,1);
set_comp_log(EMU, LOG_EMERG, 0x15,1); set_comp_log(EMU, LOG_EMERG, 0x15,1);
...@@ -473,6 +473,7 @@ int olg_config() { ...@@ -473,6 +473,7 @@ int olg_config() {
set_comp_log(PDCP, LOG_DEBUG, LOG_MED,1); set_comp_log(PDCP, LOG_DEBUG, LOG_MED,1);
set_comp_log(RLC, LOG_DEBUG, LOG_MED,1); set_comp_log(RLC, LOG_DEBUG, LOG_MED,1);
set_comp_log(RRC, LOG_DEBUG, LOG_MED,1); set_comp_log(RRC, LOG_DEBUG, LOG_MED,1);
*/
#if defined(ENABLE_RAL) #if defined(ENABLE_RAL)
set_comp_log(RAL_ENB, LOG_TRACE, LOG_MED,1); set_comp_log(RAL_ENB, LOG_TRACE, LOG_MED,1);
set_comp_log(RAL_UE, LOG_TRACE, LOG_MED,1); set_comp_log(RAL_UE, LOG_TRACE, LOG_MED,1);
......
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