Commit d5a12e3b authored by Cedric Roux's avatar Cedric Roux

- Moved Makerules to OPENAIR_TARGETS

- Created Makefile.common that gathers common definitions for oaisim and lte-softmodem
- Added ITTI capabilities to lte-softmodem (currently not stable)
	* Created dummy l2l1 task
	* Added -K option to output itti messages to file (some RT issues with file flush)
- Added S1AP/SCTP tasks in lte-softmodem

pre-ci ok
lte-softmodem with HARD_RT=1 build ok

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@4514 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent c53171a9
...@@ -6,16 +6,15 @@ libgtpv1u_OBJECTS = \ ...@@ -6,16 +6,15 @@ libgtpv1u_OBJECTS = \
nw-gtpv1u/src/NwGtpv1uMsg.o \ nw-gtpv1u/src/NwGtpv1uMsg.o \
nw-gtpv1u/src/NwGtpv1u.o \ nw-gtpv1u/src/NwGtpv1u.o \
gtpv1u_eNB.o \ gtpv1u_eNB.o \
gtpv1u_teid_pool.o \ gtpv1u_teid_pool.o
CFLAGS = \ CFLAGS = \
-I./nw-gtpv1u/shared \ -I./nw-gtpv1u/shared \
-I./nw-gtpv1u/include \ -I./nw-gtpv1u/include \
-I../UTILS \ -I../UTILS \
-I../UTILS/HASHTABLE \ -I../UTILS/HASHTABLE \
-I../UDP \ -I../UDP \
-I$(OPENAIR2_DIR) \ -I$(OPENAIR2_DIR) \
-DUSER_MODE \ -DUSER_MODE \
-DENABLE_USE_MME \ -DENABLE_USE_MME \
-DUSER_MODE \ -DUSER_MODE \
......
include $(OPENAIR_TARGETS)/SIMU/USER/Makerules # include $(OPENAIR_TARGETS)/SIMU/USER/Makerules
OUTDIR = $(S1AP_DIR)/enb_objs OUTDIR = $(S1AP_DIR)/enb_objs
......
include $(OPENAIR_TARGETS)/SIMU/USER/Makerules # include $(OPENAIR_TARGETS)/SIMU/USER/Makerules
OUTDIR = . OUTDIR = .
......
# This file gathers compilation directive shared between lte-softmodem and oaisim
ITTI_MESSAGES_H = messages_xml.h
ITTI_MESSAGES_XML = messages.xml
ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h
include $(COMMON_UTILS_DIR)/Makefile.inc
$(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE)
@echo "Generating messages.xml ..."
@gccxml $(L2_incl) $(UTILS_incl) $< -fxml=$@
@$(CC) -MM $(L2_incl) $(UTILS_incl) $< > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
@rm -f $(basename $@).d.tmp
$(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
@echo "Generating messages_xml.h ..."
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
ifdef ENABLE_ITTI
SHARED_DEPENDENCIES = $(ITTI_MESSAGES_H)
endif
ifdef USE_MME
CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR)
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt
SHARED_DEPENDENCIES += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a
export S1AP_CFLAGS
ENABLE_ITTI = 1
$(S1AP_OBJ_DIR)/libs1ap.a: force_look
@$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
$(SCTP_OBJ_DIR)/libsctp.a: force_look
@$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
endif
ifdef ENABLE_ITTI
gccxml_available = $(shell if [ `gccxml --version | grep GCC-XML -c` = "0" ]; then echo "0" ; else echo "1" ; fi )
ifeq ($(gccxml_available), 0)
$(error gccxml is missing, please install)
endif
CFLAGS += -I$(OPENAIR2_DIR)/COMMON -DENABLE_ITTI $(UTILS_incl)
ifndef DISABLE_ITTI_EVENT_FD
CFLAGS += -DENABLE_EVENT_FD
endif
endif
force_look:
@true
common-clean:
@$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
@$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean OUTDIR=$(LFDS_OBJ_DIR)
# @if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB clean OUTDIR=$(S1AP_OBJ_DIR); fi
# @if [ -d $(SCTP_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB clean OUTDIR=$(SCTP_OBJ_DIR); fi
...@@ -57,4 +57,13 @@ COMMON_CFLAGS = \ ...@@ -57,4 +57,13 @@ COMMON_CFLAGS = \
-fno-strict-aliasing \ -fno-strict-aliasing \
-g \ -g \
-ggdb \ -ggdb \
-O2 -O2
\ No newline at end of file
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
S1AP_DIR = $(OPENAIR_HOME)/openair-cn/S1AP
SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP
S1AP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR))
SCTP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR))
export S1AP_DIR
export COMMON_UTILS_DIR
\ No newline at end of file
# Include some shared directives
include $(OPENAIR_TARGETS)/Makerules
default: lte-softmodem
all: lte-softmodem
include $(OPENAIR_TARGETS)/Makefile.common
GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g') GCCVERSION = $(shell gcc --version | grep ^gcc | sed 's/^.* //g')
ifeq "$(GCCVERSION)" "4.4.3" ifeq "$(GCCVERSION)" "4.4.3"
CFLAGS += -Wno-packed-bitfield-compat CFLAGS += -Wno-packed-bitfield-compat
...@@ -52,9 +60,6 @@ endif ...@@ -52,9 +60,6 @@ endif
OBJ += $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o OBJ += $(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/openair0_lib.o
CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO CFLAGS += -DDRIVER2013 -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/USERSPACE/LIB/ -I$(OPENAIR_TARGETS)/ARCH/EXMIMO/DEFS -DENABLE_VCD_FIFO
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
include $(COMMON_UTILS_DIR)/Makefile.inc
TOP_DIR = $(OPENAIR1_DIR) TOP_DIR = $(OPENAIR1_DIR)
include $(OPENAIR1_DIR)/PHY/Makefile.inc include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc include $(OPENAIR1_DIR)/SCHED/Makefile.inc
...@@ -66,22 +71,6 @@ else ...@@ -66,22 +71,6 @@ else
OBJ += $(SCHED_OBJS) OBJ += $(SCHED_OBJS)
endif endif
#ifndef rrc_cellular
ifeq ($(rrc_cellular),0)
rrc_cellular = 0
rrc_cellular_eNB = 0
rrc_cellular_UE = 0
else
ifeq ($(eNB_flag),1)
rrc_cellular_eNB=1
endif
ifeq ($(UE_flag),1)
rrc_cellular_UE=1
endif
endif
export rrc_cellular
OPENAIR2_TOP = $(OPENAIR2_DIR) OPENAIR2_TOP = $(OPENAIR2_DIR)
include $(OPENAIR2_DIR)/LAYER2/Makefile.inc include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc include $(OPENAIR2_DIR)/UTIL/Makefile.inc
...@@ -102,12 +91,16 @@ OPENAIR2=1 ...@@ -102,12 +91,16 @@ OPENAIR2=1
endif endif
ifeq ($(OPENAIR2),1) ifeq ($(OPENAIR2),1)
ASN1_MSG_OBJS1=$(addprefix $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/, $(ASN1_MSG_OBJS)) ASN1_MSG_OBJS1=$(addprefix $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/, $(ASN1_MSG_OBJS))
OBJ += $(L2_OBJS) $(LIST_OBJ) $(TIMER_OBJ) $(MEM_OBJ) $(OTG_OBJS) $(MATH_OBJS) OBJ += $(L2_OBJS) $(LIST_OBJ) $(TIMER_OBJ) $(MEM_OBJ) $(OTG_OBJS) $(MATH_OBJS)
OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o OBJ += $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/netlink_init.o
#OBJ += $(PDCP_DIR)/pdcp_thread.o #OBJ += $(PDCP_DIR)/pdcp_thread.o
CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1 CFLAGS += -DOPENAIR2 -DNO_RRM -DPUCCH -DMAC_CONTEXT=1
endif endif
ifdef ENABLE_ITTI
OBJ += $(UTILS_OBJS)
endif
CFLAGS += $(L2_incl) $(UTIL_incl) $(UTILS_incl) CFLAGS += $(L2_incl) $(UTIL_incl) $(UTILS_incl)
CFLAGS += -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES #-I$(OPENAIR3_DIR)/MESH -I$(OPENAIR3_DIR)/MESH/RRM CFLAGS += -I$(OPENAIR1_DIR) -I$(OPENAIR2_DIR)/RRC/LITE/MESSAGES #-I$(OPENAIR3_DIR)/MESH -I$(OPENAIR3_DIR)/MESH/RRM
...@@ -158,7 +151,7 @@ endif ...@@ -158,7 +151,7 @@ endif
RTAI_CFLAGS += $(shell rtai-config --lxrt-cflags) -DRTAI RTAI_CFLAGS += $(shell rtai-config --lxrt-cflags) -DRTAI
LDFLAGS += -lpthread -lm -lforms LDFLAGS += -lpthread -lm -lforms
ifeq ($(RTAI),1) ifeq ($(RTAI),1)
LDFLAGS += $(shell rtai-config --lxrt-ldflags) LDFLAGS += $(shell rtai-config --lxrt-ldflags) -lrt
else else
LDFLAGS += -lrt LDFLAGS += -lrt
endif endif
...@@ -168,19 +161,33 @@ CFLAGS += -I/opt/uhd/include -L/opt/uhd/lib -luhd -lpthread -lstdc++ ...@@ -168,19 +161,33 @@ CFLAGS += -I/opt/uhd/include -L/opt/uhd/lib -luhd -lpthread -lstdc++
endif endif
#CFLAGS += -I/usr/include/c++/4.6 -I/usr/include/c++/4.6/x86_64-linux-gnu -I/usr/include/rtai/ #CFLAGS += -I/usr/include/c++/4.6 -I/usr/include/c++/4.6/x86_64-linux-gnu -I/usr/include/rtai/
all: lte-softmodem LFDS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR))
LFDS_LIB = $(LFDS_OBJ_DIR)/bin/liblfds611.a
$(LFDS_DIR)/bin/liblfds611.a: LIBS += $(LFDS_LIB)
$(MAKE) -C $(LFDS_DIR) -f makefile.linux SHARED_DEPENDENCIES += $(LFDS_LIB)
$(LFDS_LIB):
@if [ ! -d $(LFDS_OBJ_DIR)/bin ]; then mkdir -p $(LFDS_OBJ_DIR)/bin; fi;
@if [ ! -d $(LFDS_OBJ_DIR)/obj ]; then mkdir -p $(LFDS_OBJ_DIR)/obj; fi;
$(MAKE) -C $(LFDS_DIR) -f makefile.linux OUTDIR=$(LFDS_OBJ_DIR)
$(RTAI_OBJ): %.o : %.c $(RTAI_OBJ): %.o : %.c
@echo Compiling $< ... @echo Compiling $< ...
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) -o $@ $< @$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) $(RTAI_CFLAGS) -o $@ $<
ifdef ENABLE_ITTI
$(OBJ) $(RTAI_OBJ): $(ITTI_MESSAGES_H)
endif
$(OBJ) $(ASN1_MSG_OBJS1): %.o : %.c $(OBJ) $(ASN1_MSG_OBJS1): %.o : %.c
@echo Compiling $< ... @echo Compiling $< ...
@$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $< @$(CC) -c $(CFLAGS) $(EXTRA_CFLAGS) -o $@ $<
@$(CC) -MM $(CFLAGS) $(EXTRA_CFLAGS) $< > $*.d
@mv -f $*.d $*.d.tmp
@sed -e 's|.*:|$*.o:|' < $*.d.tmp > $*.d
@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
@rm -f $*.d.tmp
$(USRP_OBJ):$(USRP_FILE_OBJ) $(USRP_OBJ):$(USRP_FILE_OBJ)
@echo Compiling openair_usrp.cpp @echo Compiling openair_usrp.cpp
...@@ -192,19 +199,13 @@ condtest: condtest.c ...@@ -192,19 +199,13 @@ condtest: condtest.c
synctest: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) synctest: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o synctest $(CC) $(CFLAGS) $(LDFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o synctest
lte-softmodem: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(SHARED_DEPENDENCIES)
@echo Linking $@
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem $(LDFLAGS) $(LIBS)
lte-softmodem: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(LFDS_DIR)/bin/liblfds611.a lte-softmodem-usrp: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(USRP_OBJ) $(SHARED_DEPENDENCIES)
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem $(LDFLAGS) $(LFDS_DIR)/bin/liblfds611.a @echo Linking $@
@$(CC) $(USRP_OBJ) $(CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem-usrp $(LDFLAGS) $(LIBS)
lte-softmodem-usrp: $(OBJ) $(ASN1_MSG_OBJS1) $(RTAI_OBJ) $(USRP_OBJ) $(LFDS_DIR)/bin/liblfds611.a
$(CC) $(USRP_OBJ) $(CFLAGS) $(OBJ) $(RTAI_OBJ) $(ASN1_MSG_OBJS1) -o lte-softmodem-usrp $(LDFLAGS) $(LFDS_DIR)/bin/liblfds611.a
ifeq ($(rrc_cellular_eNB),1)
mv lte-softmodem lte-softmodem_eNB
endif
ifeq ($(rrc_cellular_UE),1)
mv lte-softmodem lte-softmodem_UE
endif
synctest_eNB: synctest synctest_eNB: synctest
cp synctest synctest_eNB cp synctest synctest_eNB
...@@ -284,9 +285,10 @@ run_eNB1: ...@@ -284,9 +285,10 @@ run_eNB1:
run_eNB2: run_eNB2:
rtai-load eNB2 --verbose rtai-load eNB2 --verbose
clean: clean: common-clean
rm -rf $(OBJ) $(RTAI_OBJ) @$(RM_F_V) $(OBJ) $(RTAI_OBJ)
rm -f $(ASN1_MSG_INC)/asn1_msg.o @$(RM_F_V) $(OBJ:.o=.d) $(RTAI_OBJ:.o=.d)
@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o $(ASN1_MSG_INC)/asn1_msg.d
cleanasn1: cleanasn1:
rm -f $(ASN1_MSG_OBJS1) rm -f $(ASN1_MSG_OBJS1)
...@@ -318,9 +320,6 @@ show: ...@@ -318,9 +320,6 @@ show:
@echo $(EXTRA_CFLAGS) @echo $(EXTRA_CFLAGS)
@echo $(OBJ) $(RTAI_OBJ) @echo $(OBJ) $(RTAI_OBJ)
@echo $(USRP_OBJ) @echo $(USRP_OBJ)
@echo rrc_cellular variable is $(rrc_cellular)
@echo eNB_flag is $(eNB_flag)
@echo UE_flag is $(UE_flag)
@echo IS_REL8 is $(IS_REL8) @echo IS_REL8 is $(IS_REL8)
@echo IS_REL10 is $(IS_REL10) @echo IS_REL10 is $(IS_REL10)
......
...@@ -92,8 +92,13 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -92,8 +92,13 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/MATH/oml.h" #include "UTIL/MATH/oml.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#if defined(ENABLE_USE_MME) #if defined(ENABLE_ITTI)
# include "s1ap_eNB.h" # include "intertask_interface_init.h"
# include "timer.h"
# if defined(ENABLE_USE_MME)
# include "s1ap_eNB.h"
# include "sctp_eNB_task.h"
# endif
#endif #endif
#ifdef XFORMS #ifdef XFORMS
...@@ -657,6 +662,9 @@ static void *eNB_thread(void *arg) ...@@ -657,6 +662,9 @@ static void *eNB_thread(void *arg)
slot=0; slot=0;
frame++; frame++;
} }
#if defined(ENABLE_ITTI)
itti_update_lte_time(frame, slot);
#endif
} }
LOG_D(HW,"eNB_thread: finished, ran %d times.\n",frame); LOG_D(HW,"eNB_thread: finished, ran %d times.\n",frame);
...@@ -889,6 +897,9 @@ static void *UE_thread(void *arg) ...@@ -889,6 +897,9 @@ static void *UE_thread(void *arg)
slot=0; slot=0;
frame++; frame++;
} }
#if defined(ENABLE_ITTI)
itti_update_lte_time(frame, slot);
#endif
} }
LOG_D(HW,"UE_thread: finished, ran %d times.\n",frame); LOG_D(HW,"UE_thread: finished, ran %d times.\n",frame);
...@@ -904,9 +915,85 @@ static void *UE_thread(void *arg) ...@@ -904,9 +915,85 @@ static void *UE_thread(void *arg)
return 0; return 0;
} }
/* DUmmy l2l1 task */
void *l2l1_task(void *args_p) {
#if defined(ENABLE_ITTI)
MessageDef *message_p;
itti_mark_task_ready (TASK_L2L1);
# if defined(ENABLE_USE_MME)
/* Trying to register each eNB */
{
char *mme_address_v4;
char *mme_address_v6 = "2001:660:5502:12:30da:829a:2343:b6cf";
s1ap_register_eNB_t *s1ap_register_eNB;
uint32_t hash;
if (EPC_MODE_ENABLED)
{
mme_address_v4 = EPC_MODE_MME_ADDRESS;
}
else
{
mme_address_v4 = "192.168.12.87";
}
/* FIXME: following parameters should be setup by eNB applicative layer ? */
message_p = itti_alloc_new_message(TASK_L2L1, S1AP_REGISTER_ENB);
s1ap_register_eNB = &message_p->ittiMsg.s1ap_register_eNB;
hash = s1ap_generate_eNB_id();
/* Some default/random parameters */
s1ap_register_eNB->eNB_id = eNB_id + (hash & 0xFFFF8);
s1ap_register_eNB->cell_type = CELL_MACRO_ENB;
s1ap_register_eNB->tac = 0;
s1ap_register_eNB->mcc = 208;
s1ap_register_eNB->mnc = 34;
s1ap_register_eNB->default_drx = PAGING_DRX_256;
s1ap_register_eNB->nb_mme = 1;
s1ap_register_eNB->mme_ip_address[0].ipv4 = 1;
s1ap_register_eNB->mme_ip_address[0].ipv6 = 0;
memcpy(s1ap_register_eNB->mme_ip_address[0].ipv4_address, mme_address_v4,
strlen(mme_address_v4));
memcpy(s1ap_register_eNB->mme_ip_address[0].ipv6_address, mme_address_v6,
strlen(mme_address_v6));
itti_send_msg_to_task(TASK_S1AP, eNB_id, message_p);
}
# endif
#endif
#if defined(ENABLE_ITTI)
while (1) {
// Checks if a message has been sent to L2L1 task
itti_receive_msg (TASK_L2L1, &message_p);
if (message_p != NULL) {
switch (ITTI_MSG_ID(message_p)) {
case TERMINATE_MESSAGE:
itti_exit_task ();
break;
case MESSAGE_TEST:
LOG_D(EMU, "Received %s\n", ITTI_MSG_NAME(message_p));
break;
default:
LOG_E(EMU, "Received unexpected message %s\n", ITTI_MSG_NAME(message_p));
break;
}
free (message_p);
}
}
#endif
return NULL;
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
...@@ -964,6 +1051,7 @@ int main(int argc, char **argv) { ...@@ -964,6 +1051,7 @@ int main(int argc, char **argv) {
int ant_offset=0; int ant_offset=0;
int error_code; int error_code;
char *itti_dump_file = NULL;
const struct option long_options[] = { const struct option long_options[] = {
{"calib-ue-rx", required_argument, NULL, 256}, {"calib-ue-rx", required_argument, NULL, 256},
...@@ -976,7 +1064,7 @@ int main(int argc, char **argv) { ...@@ -976,7 +1064,7 @@ int main(int argc, char **argv) {
mode = normal_txrx; mode = normal_txrx;
while ((c = getopt_long (argc, argv, "C:O:ST:UdF:V",long_options,NULL)) != -1) while ((c = getopt_long (argc, argv, "C:K:O:ST:UdF:V",long_options,NULL)) != -1)
{ {
switch (c) switch (c)
{ {
...@@ -1001,6 +1089,13 @@ int main(int argc, char **argv) { ...@@ -1001,6 +1089,13 @@ int main(int argc, char **argv) {
case 'T': case 'T':
tcxo=atoi(optarg); tcxo=atoi(optarg);
break; break;
case 'K':
#if defined(ENABLE_ITTI)
itti_dump_file = strdup(optarg);
#else
printf("-K option is disabled when ENABLE_ITTI is not defined\n");
#endif
break;
case 'O': case 'O':
#if defined(ENABLE_USE_MME) #if defined(ENABLE_USE_MME)
EPC_MODE_ENABLED = 1; EPC_MODE_ENABLED = 1;
...@@ -1110,6 +1205,32 @@ int main(int argc, char **argv) { ...@@ -1110,6 +1205,32 @@ int main(int argc, char **argv) {
// initialize the log (see log.h for details) // initialize the log (see log.h for details)
logInit(); logInit();
#if defined(ENABLE_ITTI)
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, itti_dump_file);
# if defined(ENABLE_USE_MME)
if (itti_create_task(TASK_SCTP, sctp_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing SCTP task interface: FAILED\n");
return -1;
}
if (itti_create_task(TASK_S1AP, s1ap_eNB_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing S1AP task interface: FAILED\n");
return -1;
}
# endif
if (itti_create_task(TASK_L2L1, l2l1_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing L2L1 task interface: FAILED\n");
return -1;
}
// Handle signals until all tasks are terminated
// itti_wait_tasks_end();
#endif
if (ouput_vcd) { if (ouput_vcd) {
if (UE_flag==1) if (UE_flag==1)
vcd_signal_dumper_init("/tmp/openair_dump_UE.vcd"); vcd_signal_dumper_init("/tmp/openair_dump_UE.vcd");
...@@ -1431,6 +1552,23 @@ int main(int argc, char **argv) { ...@@ -1431,6 +1552,23 @@ int main(int argc, char **argv) {
#ifdef OPENAIR2 #ifdef OPENAIR2
int eMBMS_active=0; int eMBMS_active=0;
#if defined(ENABLE_ITTI)
if (UE_flag == 1) {
if (itti_create_task (TASK_RRC_UE, rrc_ue_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC UE task interface: FAILED\n");
exit (EXIT_FAILURE);
}
} else {
if (itti_create_task (TASK_RRC_ENB, rrc_enb_task, NULL) < 0) {
LOG_E(EMU, "Create task failed");
LOG_D(EMU, "Initializing RRC eNB task interface: FAILED\n");
exit (EXIT_FAILURE);
}
}
#endif
l2_init(frame_parms,eMBMS_active, l2_init(frame_parms,eMBMS_active,
0,// cba_group_active 0,// cba_group_active
0); // HO flag 0); // HO flag
......
# Include some standard directives # Include some shared directives
include Makerules include $(OPENAIR_TARGETS)/Makerules
default: oaisim
include $(OPENAIR_TARGETS)/Makefile.common
CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native CPUFLAGS = -mmmx -msse -msse2 -msse4.1 -march=native
# FORCE ssse3 for compilation of openair on User Mode Linux # FORCE ssse3 for compilation of openair on User Mode Linux
...@@ -7,29 +11,13 @@ CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ; ...@@ -7,29 +11,13 @@ CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ;
CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi) CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi) linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
COMMON_UTILS_DIR = $(OPENAIR_HOME)/common/utils
TOP_DIR = $(OPENAIR1_DIR) TOP_DIR = $(OPENAIR1_DIR)
OPENAIR1_TOP = $(OPENAIR1_DIR) OPENAIR1_TOP = $(OPENAIR1_DIR)
OPENAIR2_TOP = $(OPENAIR2_DIR) OPENAIR2_TOP = $(OPENAIR2_DIR)
OPENAIR3_TOP = $(OPENAIR3_DIR) OPENAIR3_TOP = $(OPENAIR3_DIR)
OPENAIR3 = $(OPENAIR3_DIR) OPENAIR3 = $(OPENAIR3_DIR)
S1AP_DIR = $(OPENAIR_HOME)/openair-cn/S1AP CFLAGS += $(COMMON_CFLAGS) -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
SCTP_DIR = $(OPENAIR_HOME)/openair-cn/SCTP
S1AP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(S1AP_DIR))
SCTP_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(SCTP_DIR))
export S1AP_DIR
export COMMON_UTILS_DIR
CFLAGS = $(COMMON_CFLAGS) -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
ifdef ENABLE_ITTI
CFLAGS += -DENABLE_ITTI
ifndef DISABLE_ITTI_EVENT_FD
CFLAGS += -DENABLE_EVENT_FD
endif
endif
# Check if GCC version is greater or equal to 4.4 # Check if GCC version is greater or equal to 4.4
GCCVERSIONGTEQ44 := $(shell expr `gcc -dumpversion | cut -f1,2 -d. --output-delimiter=""` \>= 44) GCCVERSIONGTEQ44 := $(shell expr `gcc -dumpversion | cut -f1,2 -d. --output-delimiter=""` \>= 44)
...@@ -175,10 +163,6 @@ ifndef DISABLE_XER_PRINT ...@@ -175,10 +163,6 @@ ifndef DISABLE_XER_PRINT
CFLAGS += -DXER_PRINT CFLAGS += -DXER_PRINT
endif endif
ifneq ($(USE_MME), R8)
UPDATE_RELEASE_9=1
endif
ifdef SECU ifdef SECU
ifeq ($(NETTLE_FOUND), 0) ifeq ($(NETTLE_FOUND), 0)
@echo "Nettle library >= 2.5 is not installed on your system, continuing with security disabled" @echo "Nettle library >= 2.5 is not installed on your system, continuing with security disabled"
...@@ -194,7 +178,6 @@ endif ...@@ -194,7 +178,6 @@ endif
endif endif
endif endif
include $(COMMON_UTILS_DIR)/Makefile.inc
include $(OPENAIR1_DIR)/PHY/Makefile.inc include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
...@@ -202,14 +185,6 @@ include $(OPENAIR2_DIR)/LAYER2/Makefile.inc ...@@ -202,14 +185,6 @@ include $(OPENAIR2_DIR)/LAYER2/Makefile.inc
include $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/Makefile.inc include $(OPENAIR1_DIR)/SIMULATION/ETH_TRANSPORT/Makefile.inc
include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc include $(OPENAIR2_DIR)/RRC/NAS/Makefile.inc
include $(OPENAIR2_DIR)/UTIL/Makefile.inc include $(OPENAIR2_DIR)/UTIL/Makefile.inc
#include $(OPENAIR2_DIR)/S1AP/Makefile.inc
#include $(OPENAIR2_DIR)/S1AP/MESSAGES/Makefile.inc
ITTI_MESSAGES_H = messages_xml.h
ITTI_MESSAGES_XML = messages.xml
ITTI_MESSAGES_FILE = $(ITTI_DIR)/intertask_interface_types.h
SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o SIMULATION_OBJS = $(TOP_DIR)/SIMULATION/TOOLS/gauss.o
SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o SIMULATION_OBJS += $(TOP_DIR)/SIMULATION/TOOLS/random_channel.o
...@@ -230,7 +205,7 @@ OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/sinr_sim.o ...@@ -230,7 +205,7 @@ OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/sinr_sim.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/cor_SF_sim.o OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/cor_SF_sim.o
OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/oaisim_functions.o OAISIM_OBJS_COMMON += $(OPENAIR_TARGETS)/SIMU/USER/oaisim_functions.o
OAISIM_OBJS = oaisim.o OAISIM_OBJS = $(OPENAIR_TARGETS)/SIMU/USER/oaisim.o
ifdef XFORMS ifdef XFORMS
TOOLS_OBJS += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o TOOLS_OBJS += $(OPENAIR1_DIR)/PHY/TOOLS/lte_phy_scope.o
...@@ -264,8 +239,8 @@ endif ...@@ -264,8 +239,8 @@ endif
# Check if libpgm is installed and use it if found instead of the unreliable # Check if libpgm is installed and use it if found instead of the unreliable
# multicast # multicast
ifeq ($(PGM_FOUND), 1) ifeq ($(PGM_FOUND), 1)
CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT CFLAGS += $(PGM_CFLAGS) -DENABLE_PGM_TRANSPORT
LIBS += $(PGM_LIBS) LIBS += $(PGM_LIBS)
endif endif
OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(NAS_OBJS) $(INT_OBJS) $(UTIL_OBJ) $(UTILS_OBJS) $(OAISIM_OBJS_COMMON) OBJ = $(PHY_OBJS) $(SIMULATION_OBJS) $(ETHERNET_TRANSPORT_OBJS) $(TOOLS_OBJS) $(SCHED_OBJS) $(STATS_OBJS) $(NAS_OBJS) $(INT_OBJS) $(UTIL_OBJ) $(UTILS_OBJS) $(OAISIM_OBJS_COMMON)
...@@ -276,9 +251,7 @@ endif ...@@ -276,9 +251,7 @@ endif
LFDS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR)) LFDS_OBJ_DIR = $(subst $(OPENAIR_HOME),$(OBJS_DIR),$(LFDS_DIR))
LFDS_LIB = $(LFDS_OBJ_DIR)/bin/liblfds611.a LFDS_LIB = $(LFDS_OBJ_DIR)/bin/liblfds611.a
LIBS += $(LFDS_LIB) LIBS += $(LFDS_LIB)
OAISIM_DEPENDENCIES = $(LFDS_LIB) SHARED_DEPENDENCIES += $(LFDS_LIB)
default: oaisim
all: oaisim pad all: oaisim pad
...@@ -289,20 +262,6 @@ userclean: cleanall oaisim ...@@ -289,20 +262,6 @@ userclean: cleanall oaisim
objsdir: objsdir:
@if [ ! -d $(OBJS_DIR) ]; then mkdir -p $(OBJS_DIR); fi @if [ ! -d $(OBJS_DIR) ]; then mkdir -p $(OBJS_DIR); fi
ifdef USE_MME
CFLAGS += -DENB_MODE -DENABLE_USE_MME -DENABLE_EVENT_FD -I$(S1AP_DIR) -I$(SCTP_DIR)
S1AP_CFLAGS = $(CFLAGS) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl)
LIBS += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a -lsctp -lcrypt
OAISIM_DEPENDENCIES += $(S1AP_OBJ_DIR)/libs1ap.a $(SCTP_OBJ_DIR)/libsctp.a
export S1AP_CFLAGS
$(S1AP_OBJ_DIR)/libs1ap.a: force_look
@$(MAKE) -C $(S1AP_DIR) -f Makefile.eNB $(S1AP_OBJ_DIR)/libs1ap.a OUTDIR=$(S1AP_OBJ_DIR)
$(SCTP_OBJ_DIR)/libsctp.a: force_look
@$(MAKE) -C $(SCTP_DIR) -f Makefile.eNB $(SCTP_OBJ_DIR)/libsctp.a OUTDIR=$(SCTP_OBJ_DIR)
endif
printvars: printvars:
@echo rrc_cellular variable is $(rrc_cellular) @echo rrc_cellular variable is $(rrc_cellular)
@echo EXTRA_CFLAGS = $(EXTRA_CFLAGS) @echo EXTRA_CFLAGS = $(EXTRA_CFLAGS)
...@@ -323,28 +282,7 @@ OAISIM_COMPILED_OBJECTS = $(subst $(OPENAIR_HOME), $(OBJS_DIR), $(OBJ) $(OAISIM_ ...@@ -323,28 +282,7 @@ OAISIM_COMPILED_OBJECTS = $(subst $(OPENAIR_HOME), $(OBJS_DIR), $(OBJ) $(OAISIM_
-include $(OAISIM_COMPILED_OBJECTS:.o=.d) -include $(OAISIM_COMPILED_OBJECTS:.o=.d)
ifdef ENABLE_ITTI ifdef ENABLE_ITTI
gccxml_available = $(shell if [ `gccxml --version | grep GCC-XML -c` = "0" ]; then echo "0" ; else echo "1" ; fi ) $(OAISIM_COMPILED_OBJECTS): $(ITTI_MESSAGES_H)
ifeq ($(gccxml_available), 0)
$(error gccxml is missing, please install)
endif
endif
$(ITTI_MESSAGES_XML): $(ITTI_MESSAGES_FILE)
@echo "Generating messages.xml ..."
@gccxml $(L2_incl) $(UTILS_incl) $< -fxml=$@
@$(CC) -MM $(L2_incl) $(UTILS_incl) $< > $(basename $@).d
@mv -f $(basename $@).d $(basename $@).d.tmp
@sed -e 's|.*:|$@:|' < $(basename $@).d.tmp > $(basename $@).d
@sed -e 's/.*://' -e 's/\\$$//' < $(basename $@).d.tmp | fmt -1 | \
sed -e 's/^ *//' -e 's/$$/:/' >> $(basename $@).d
@rm -f $(basename $@).d.tmp
$(ITTI_MESSAGES_H): $(ITTI_MESSAGES_XML)
@echo "Generating messages_xml.h ..."
@sed -e 's/[ ]*//' -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n"/' $< > $@
ifdef ENABLE_ITTI
$(OAISIM_OBJS): $(ITTI_MESSAGES_H)
oaisim_pad.o: $(ITTI_MESSAGES_H) oaisim_pad.o: $(ITTI_MESSAGES_H)
endif endif
...@@ -373,7 +311,7 @@ oaisim_pad: $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1) ...@@ -373,7 +311,7 @@ oaisim_pad: $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1)
@$(MPICC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim_pad $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1) \ @$(MPICC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim_pad $(CFLAGS) $(EXTRA_CFLAGS) $(OBJ) $(OAISIM_PAD_OBJS) $(ASN1_MSG_OBJS1) \
-lpthread -llapack_atlas -lforms -lrt $(LIBS) $(DB_LDFLAGS) -lpthread -llapack_atlas -lforms -lrt $(LIBS) $(DB_LDFLAGS)
oaisim: $(OAISIM_COMPILED_OBJECTS) $(OAISIM_DEPENDENCIES) oaisim: $(OAISIM_COMPILED_OBJECTS) $(SHARED_DEPENDENCIES)
@echo "Linking oaisim ..." @echo "Linking oaisim ..."
@$(CC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim $(CFLAGS) $(EXTRA_CFLAGS) $(OAISIM_COMPILED_OBJECTS) \ @$(CC) -I$(TOP_DIR) $(L2_incl) $(UTIL_incl) $(UTILS_incl) -I$(ASN1_MSG_INC) $(S1AP_Incl) -o oaisim $(CFLAGS) $(EXTRA_CFLAGS) $(OAISIM_COMPILED_OBJECTS) \
-lpthread -llapack_atlas -lforms -lrt $(LIBS) $(DB_LDFLAGS) -lpthread -llapack_atlas -lforms -lrt $(LIBS) $(DB_LDFLAGS)
...@@ -425,19 +363,16 @@ cleanall: clean cleanasn1 ...@@ -425,19 +363,16 @@ cleanall: clean cleanasn1
cleanalmostall: clean cleanalmostall: clean
rm -f $(ASN1_MSG_OBJS1) rm -f $(ASN1_MSG_OBJS1)
clean: clean: common-clean
@$(MAKE) -C $(LFDS_DIR) -f makefile.linux clean OUTDIR=$(LFDS_OBJ_DIR)
@$(RM_F_V) oaisim @$(RM_F_V) oaisim
@$(RM_F_V) oaisim_pad @$(RM_F_V) oaisim_pad
@$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d) # @$(RM_F_V) $(ITTI_MESSAGES_H) $(ITTI_MESSAGES_XML) $(ITTI_MESSAGES_XML:.xml=.d)
@$(RM_F_V) $(OAISIM_PAD_OBJS) @$(RM_F_V) $(OAISIM_PAD_OBJS)
@$(RM_F_V) $(OAISIM_PAD_OBJS:.o=.d) @$(RM_F_V) $(OAISIM_PAD_OBJS:.o=.d)
@$(RM_F_V) $(OAISIM_COMPILED_OBJECTS) @$(RM_F_V) $(OAISIM_COMPILED_OBJECTS)
@$(RM_F_V) $(OAISIM_COMPILED_OBJECTS:.o=.d) @$(RM_F_V) $(OAISIM_COMPILED_OBJECTS:.o=.d)
@$(RM_F_V) *.exe* @$(RM_F_V) *.exe*
@$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o @$(RM_F_V) $(ASN1_MSG_INC)/asn1_msg.o
@if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB clean OUTDIR=$(S1AP_OBJ_DIR); fi
@if [ -d $(SCTP_DIR) ]; then $(MAKE) -C $(SCTP_DIR) -f Makefile.eNB clean OUTDIR=$(SCTP_OBJ_DIR); fi
cleanl1: cleanl1:
@$(RM_F_V) LOG_THREAD oaisim @$(RM_F_V) LOG_THREAD oaisim
...@@ -489,9 +424,6 @@ showcflags: ...@@ -489,9 +424,6 @@ showcflags:
@echo oaisim cflags: $(CFLAGS) @echo oaisim cflags: $(CFLAGS)
@if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB showcflags; fi @if [ -d $(S1AP_DIR) ]; then $(MAKE) -C $(S1AP_DIR) -f Makefile.eNB showcflags; fi
force_look:
@true
otg_all: otg_latency otg_gp otg_all: otg_latency otg_gp
# need to check if the file exists before calling otgplot # need to check if the file exists before calling otgplot
......
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