Commit 87a8cb28 authored by frtabu's avatar frtabu

basic and rf simulators as config option to allow noS1 datapath debug.

parent b6296d8d
......@@ -21,7 +21,7 @@
# Author: laurent THOMAS, Lionel GAUTHIER
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.0)
#############################################
# Base directories, compatible with legacy OAI building
......@@ -169,11 +169,12 @@ endif()
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ")
# add autotools definitions that were maybe used!
set(MKVER "'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'")
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP -D${MKVER}"
)
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D'MAKE_VERSION(a,b,c)=((a)*256+(b)*16+c)'"
"${CMAKE_CXX_FLAGS} ${C_FLAGS_PROCESSOR} -std=c++11 -D${MKVER}"
)
add_definitions("-DASN_DISABLE_OER_SUPPORT")
......@@ -477,7 +478,8 @@ add_dependencies(X2AP_ENB rrc_flag x2_flag)
add_list1_option(NB_ANTENNAS_RX "2" "Number of antennas in reception" "1" "2" "4")
add_list1_option(NB_ANTENNAS_TX "4" "Number of antennas in transmission" "1" "2" "4")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR")
add_list2_option(RF_BOARD "EXMIMO" "RF head type" "None" "EXMIMO" "OAI_USRP" "OAI_BLADERF" "CPRIGW" "OAI_LMSSDR" "OAI_SIMU")
add_list2_option(TRANSP_PRO "None" "Transport protocol type" "None" "ETHERNET")
#NOKIA config enhancement
......@@ -585,6 +587,8 @@ set(HWLIB_TCP_BRIDGE_OAI_SOURCE
add_library(tcp_bridge_oai MODULE ${HWLIB_TCP_BRIDGE_OAI_SOURCE} )
set_target_properties(tcp_bridge_oai PROPERTIES COMPILE_FLAGS "-fvisibility=hidden")
add_library(rfsimulator MODULE ${OPENAIR_TARGETS}/ARCH/rfsimulator/simulator.c)
##########################################################
include_directories ("${OPENAIR_TARGETS}/ARCH/COMMON")
......@@ -1949,6 +1953,8 @@ add_executable(lte-softmodem
${OPENAIR1_DIR}/SIMULATION/TOOLS/taus.c
${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR2_DIR}/RRC/NAS/nas_config.c
${OPENAIR2_DIR}/RRC/NAS/rb_config.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/multicast_link.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/socket.c
......
This diff is collapsed.
......@@ -33,7 +33,7 @@
#include "phy_init.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "PHY/LTE_TRANSPORT/transport_common_proto.h"
#include "targets/RT/USER/lte-softmodem.h"
extern PHY_VARS_eNB *eNB;
extern PHY_VARS_UE *UE;
extern RU_t *ru;
......@@ -169,12 +169,12 @@ void lte_param_init(PHY_VARS_eNB **eNBp,
}
else ru->N_TA_offset=0;
#if BASIC_SIMULATOR
if (IS_SOFTMODEM_BASICSIM)
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE->N_TA_offset = 0;
#endif
UE->N_TA_offset = 0;
printf("Done lte_param_init\n");
......
......@@ -45,7 +45,7 @@
#include "common/utils/LOG/vcd_signal_dumper.h"
#include "PHY/LTE_TRANSPORT/transport_extern.h"
#include "PHY/LTE_REFSIG/lte_refsig.h"
#include "targets/RT/USER/lte-softmodem.h"
//#define DEBUG_DCI_ENCODING 1
//#define DEBUG_DCI_DECODING 1
//#define DEBUG_PHY
......@@ -328,26 +328,25 @@ uint8_t generate_dci_top(uint8_t num_pdcch_symbols,
y[0] = &yseq0[0];
y[1] = &yseq1[0];
#if BASIC_SIMULATOR
if (IS_SOFTMODEM_BASICSIM){
/* this should be the normal case
* but it has to be validated for all the various cases
* so let's just do it for the basic simulator
*/
memset(e, 2, DCI_BITS_MAX);
#else
#if 1
// memset(e, 2, DCI_BITS_MAX);
} else {
// reset all bits to <NIL>, here we set <NIL> elements as 2
// memset(e, 2, DCI_BITS_MAX);
// here we interpret NIL as a random QPSK sequence. That makes power estimation easier.
for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1;
#endif
for (i=0; i<DCI_BITS_MAX; i++)
e[i]=taus()&1;
/* clear all bits, the above code may generate too much false detections
* (not sure about this, to be checked somehow)
*/
//memset(e, 0, DCI_BITS_MAX);
#endif /* BASIC_SIMULATOR */
}/* BASIC_SIMULATOR */
e_ptr = e;
......
......@@ -38,6 +38,7 @@
//#include "defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "targets/RT/USER/lte-softmodem.h"
int generate_pss(int32_t **txdataF,
short amp,
......@@ -75,10 +76,9 @@ int generate_pss(int32_t **txdataF,
a = (frame_parms->nb_antenna_ports_eNB == 1) ? amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
//printf("[PSS] amp=%d, a=%d\n",amp,a);
#if BASIC_SIMULATOR
if (IS_SOFTMODEM_BASICSIM)
/* a hack to remove at some point (the UE doesn't synch with 100 RBs) */
a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
#endif
a = (frame_parms->nb_antenna_ports_eNB == 1) ? 4*amp: (amp*ONE_OVER_SQRT2_Q15)>>15;
Nsymb = (frame_parms->Ncp==NORMAL)?14:12;
......
......@@ -2139,5 +2139,7 @@ int main(int argc, char **argv) {
else
return(0);
}
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
uint64_t get_softmodem_optmask(void) {
return 0;
}
......@@ -1509,5 +1509,7 @@ int main(int argc, char **argv) {
return(0);
}
/* temporary dummy implem of get_softmodem_optmask, till basic simulators implemented as device */
uint64_t get_softmodem_optmask(void) {
return 0;
}
......@@ -810,32 +810,33 @@ rrc_ue_establish_drb(
(eNB_index * NB_RB_MAX) + *DRB_config->logicalChannelIdentity,
RADIO_ACCESS_BEARER,Rlc_info_um);
*/
if(PDCP_USE_NETLINK) {
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
if(!EPC_MODE_ENABLED) {
//# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET) && !defined(LINK_ENB_PDCP_TO_GTPV1U)
ip_addr_offset3 = 0;
ip_addr_offset4 = 1;
LOG_I(OIP,"[UE %d] trying to bring up the OAI interface oai%d, IP 10.0.%d.%d\n", ue_mod_idP, ip_addr_offset3+ue_mod_idP,
ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1);
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP, // interface_id
oip_ifup=nas_config(ip_addr_offset3+ue_mod_idP+1, // interface_id
ip_addr_offset3+ue_mod_idP+1, // third_octet
ip_addr_offset4+ue_mod_idP+1); // fourth_octet
ip_addr_offset4+ue_mod_idP+1, // fourth_octet
"ue"); // interface suffix
if (oip_ifup == 0 ) { // interface is up --> send a config the DRB
LOG_I(OIP,"[UE %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
if (oip_ifup == 0 && (!IS_SOFTMODEM_NOKRNMOD)) { // interface is up --> send a config the DRB
LOG_I(OIP,"[UE %d] Config the ue net interface %d to send/receive pkt on DRB %ld to/from the protocol stack\n",
ue_mod_idP,
ip_addr_offset3+ue_mod_idP,
(long int)((eNB_index * maxDRB) + DRB_config->drb_Identity));
(long int)((eNB_index * LTE_maxDRB) + DRB_config->drb_Identity));
rb_conf_ipv4(0,//add
ue_mod_idP,//cx align with the UE index
ip_addr_offset3+ue_mod_idP,//inst num_enb+ue_index
(eNB_index * maxDRB) + DRB_config->drb_Identity,//rb
(eNB_index * LTE_maxDRB) + DRB_config->drb_Identity,//rb
0,//dscp
ipv4_address(ip_addr_offset3+ue_mod_idP+1,ip_addr_offset4+ue_mod_idP+1),//saddr
ipv4_address(ip_addr_offset3+ue_mod_idP+1,eNB_index+1));//daddr
LOG_D(RRC,"[UE %d] State = Attached (eNB %d)\n",ue_mod_idP,eNB_index);
}
# endif
//# endif
}
return(0);
......@@ -1930,7 +1931,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
for (i=0; (
i<rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
&& (i < maxDRB); i++) {
&& (i < LTE_maxDRB); i++) {
// why minus 1 in RRC code for drb_identity ?
connection_reestablishment_ind.drb_id[i] =
rrcConnectionReconfiguration->criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
......@@ -2241,7 +2242,7 @@ rrc_ue_decode_dcch(
for (i=0; (
i<dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
&& (i < maxDRB); i++) {
&& (i < LTE_maxDRB); i++) {
// why minus 1 in RRC code for drb_identity ?
connection_reconfiguration_ho_ind.drb_id[i] =
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
......@@ -2295,7 +2296,7 @@ rrc_ue_decode_dcch(
for (i=0; (
i<dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.count)
&& (i < maxDRB); i++) {
&& (i < LTE_maxDRB); i++) {
// why minus 1 in RRC code for drb_identity ?
connection_reconfiguration_ind.drb_id[i] =
dl_dcch_msg->message.choice.c1.choice.rrcConnectionReconfiguration.criticalExtensions.choice.c1.choice.rrcConnectionReconfiguration_r8.radioResourceConfigDedicated->drb_ToAddModList->list.array[i]->drb_Identity;
......
......@@ -6272,30 +6272,30 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
LOG_D(RRC,
"[eNB %d] Frame %d: Establish RLC UM Bidirectional, DRB %d Active\n",
ctxt_pP->module_id, ctxt_pP->frame, (int)DRB_configList->list.array[i]->drb_Identity);
if (PDCP_USE_NETLINK && (!LINK_ENB_PDCP_TO_GTPV1U)) {
if (!EPC_MODE_ENABLED) {
// if (PDCP_USE_NETLINK && (!LINK_ENB_PDCP_TO_GTPV1U)) {
// can mean also IPV6 since ether -> ipv6 autoconf
# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET)
//# if !defined(OAI_NW_DRIVER_TYPE_ETHERNET) && !defined(EXMIMO) && !defined(OAI_USRP) && !defined(OAI_BLADERF) && !defined(ETHERNET)
LOG_I(OIP, "[eNB %d] trying to bring up the OAI interface oai%d\n",
ctxt_pP->module_id,
ctxt_pP->module_id);
oip_ifup = nas_config(
ctxt_pP->module_id, // interface index
ctxtReportConfigToAddMod__reportConfig_PR_reportConfigEUTRA_pP->module_id + 1, // thrid octet
ctxt_pP->module_id + 1); // fourth octet
ctxt_pP->module_id + 1, // thrid octet
ctxt_pP->module_id + 1, // fourth octet
"enb");
if (oip_ifup == 0) { // interface is up --> send a config the DRB
module_id_t ue_module_id;
dest_ip_offset = 8;
LOG_I(OIP,
"[eNB %d] Config the oai%d to send/receive pkt on DRB %ld to/from the protocol stack\n",
ctxt_pP->module_id, ctxt_pP->module_id,
(long int)((ue_context_pP->local_uid * maxDRB) + DRB_configList->list.array[i]->drb_Identity));
(long int)((ue_context_pP->local_uid * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity));
ue_module_id = oai_emulation.info.eNB_ue_local_uid_to_ue_module_id[ctxt_pP->module_id][ue_context_pP->local_uid];
rb_conf_ipv4(0, //add
ue_module_id, //cx
ctxt_pP->module_id, //inst
(ue_module_id * maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB
(ue_module_id * LTE_maxDRB) + DRB_configList->list.array[i]->drb_Identity, // RB
0, //dscp
ipv4_address(ctxt_pP->module_id + 1, ctxt_pP->module_id + 1), //saddr
ipv4_address(ctxt_pP->module_id + 1, dest_ip_offset + ue_module_id + 1)); //daddr
......@@ -6303,7 +6303,7 @@ rrc_eNB_process_RRCConnectionReconfigurationComplete(
ctxt_pP->module_id, ue_context_pP->ue_context.rnti, ue_module_id);
}
# endif
//# endif
}
LOG_D(RRC,
......
......@@ -44,7 +44,7 @@
#include "nas_config.h"
#include "common/utils/LOG/log.h"
#include "targets/RT/USER/lte-softmodem.h"
//default values according to the examples,
......@@ -236,18 +236,20 @@ int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *br
}
// non blocking full configuration of the interface (address, and the two lest octets of the address)
int nas_config(int interface_id, int thirdOctet, int fourthOctet)
int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifsuffix)
{
//char buf[5];
char ipAddress[20];
char broadcastAddress[20];
char interfaceName[8];
char interfaceName[20];
int returnValue;
sprintf(ipAddress, "10.0.%d.%d", thirdOctet,fourthOctet);
sprintf(broadcastAddress, "10.0.%d.255", thirdOctet);
sprintf(interfaceName, "oai%d", interface_id);
sprintf(interfaceName, "%s%s%d", UE_NAS_USE_TUN?"oaitun_":"oip",
UE_NAS_USE_TUN?ifsuffix:"",interface_id);
bringInterfaceUp(interfaceName, 0);
// sets the machine address
......
......@@ -54,7 +54,7 @@ int NAS_config(char *interfaceName, char *ipAddress, char *networkMask, char *br
* \note
* @ingroup ?????
*/
int nas_config(int interface_id, int thirdOctet, int fourthOctet);
int nas_config(int interface_id, int thirdOctet, int fourthOctet, char *ifsuffix);
/*! \fn int blocking_NAS_config(char*, char*, char*, char*)
* \brief This function initializes the nasmesh interface, in a blocking way,
......
......@@ -37,6 +37,7 @@
#include "common_lib.h"
#include "common/utils/load_module_shlib.h"
#include "targets/RT/USER/lte-softmodem.h"
int set_device(openair0_device *device) {
......@@ -96,13 +97,20 @@ int load_lib(openair0_device *device, openair0_config_t *openair0_cfg, eth_param
loader_shlibfunc_t shlib_fdesc[1];
int ret=0;
char *libname;
if (flag == RAU_LOCAL_RADIO_HEAD) {
if ( IS_SOFTMODEM_BASICSIM ) {
libname=OAI_BASICSIM_LIBNAME;
shlib_fdesc[0].fname="device_init";
} else
if ( IS_SOFTMODEM_RFSIM ) {
libname=OAI_RFSIM_LIBNAME;
shlib_fdesc[0].fname="device_init";
} else if (flag == RAU_LOCAL_RADIO_HEAD) {
libname=OAI_RF_LIBNAME;
shlib_fdesc[0].fname="device_init";
} else {
} else {
libname=OAI_TP_LIBNAME;
shlib_fdesc[0].fname="transport_init";
}
}
ret=load_module_shlib(libname,shlib_fdesc,1,NULL);
if (ret < 0) {
fprintf(stderr,"Library %s couldn't be loaded\n",libname);
......
......@@ -39,7 +39,10 @@
#define OAI_RF_LIBNAME "oai_device"
/* name of shared library implementing the transport */
#define OAI_TP_LIBNAME "oai_transpro"
/* name of shared library implementing the basic/rf simulator */
#define OAI_RFSIM_LIBNAME "rfsimulator"
/* name of shared library implementing the basic/rf simulator */
#define OAI_BASICSIM_LIBNAME "tcp_bridge_oai"
/* flags for BBU to determine whether the attached radio head is local or remote */
#define RAU_LOCAL_RADIO_HEAD 0
#define RAU_REMOTE_RADIO_HEAD 1
......
......@@ -1381,12 +1381,12 @@ int setup_RU_buffers(RU_t *ru) {
else if (frame_parms->N_RB_DL == 50) ru->N_TA_offset = 624/2;
else if (frame_parms->N_RB_DL == 25) ru->N_TA_offset = 624/4;
#if BASIC_SIMULATOR
if(IS_SOFTMODEM_BASICSIM)
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
ru->N_TA_offset = 0;
#endif
}
if (ru->openair0_cfg.mmapped_dma == 1) {
......
......@@ -58,6 +58,8 @@ void get_common_options(void) {
uint32_t noS1;
uint32_t nokrnmod;
uint32_t nonbiot;
uint32_t rfsim;
uint32_t basicsim;
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
checkedparam_t cmdline_log_CheckParams[] = CMDLINE_LOGPARAMS_CHECK_DESC;
......@@ -90,6 +92,16 @@ void get_common_options(void) {
set_softmodem_optmask(SOFTMODEM_NONBIOT_BIT);
}
if (rfsim) {
set_softmodem_optmask(SOFTMODEM_RFSIM_BIT);
}
if (basicsim) {
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT);
}
#if BASIC_SIMULATOR
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT);
#endif
if(parallel_config != NULL) set_parallel_conf(parallel_config);
if(worker_config != NULL) set_worker_conf(worker_config);
......
......@@ -653,7 +653,7 @@ int main( int argc, char **argv ) {
LOG_I(HW, "Version: %s\n", PACKAGE_VERSION);
printf("Runtime table\n");
fill_modeled_runtime_table(runtime_phy_rx,runtime_phy_tx);
pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? (PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT);
pdcp_module_init( ( IS_SOFTMODEM_NOS1 && !(IS_SOFTMODEM_NOKRNMOD))? ( PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT) : LINK_ENB_PDCP_TO_GTPV1U_BIT);
#
if (RC.nb_inst > 0) {
......
......@@ -87,6 +87,7 @@
#define CONFIG_HLP_PARALLEL_CMD "three config for level of parallelism 'PARALLEL_SINGLE_THREAD', 'PARALLEL_RU_L1_SPLIT', or 'PARALLEL_RU_L1_TRX_SPLIT'\n"
#define CONFIG_HLP_WORKER_CMD "two option for worker 'WORKER_DISABLE' or 'WORKER_ENABLE'\n"
#define CONFIG_HLP_NOS1 "Disable s1 interface\n"
#define CONFIG_HLP_RFSIM "Run in rf simulator mode (also known as basic simulator)\n"
#define CONFIG_HLP_NOKRNMOD "(noS1 only): Use tun instead of namesh module \n"
#define CONFIG_HLP_DISABLNBIOT "disable nb-iot, even if defined in config\n"
......@@ -199,7 +200,9 @@
{"numerology" , CONFIG_HLP_NUMEROLOGY, PARAMFLAG_BOOL, iptr:&NUMEROLOGY, defintval:0, TYPE_INT, 0}, \
{"parallel-config", CONFIG_HLP_PARALLEL_CMD,0, strptr:(char **)&parallel_config, defstrval:NULL, TYPE_STRING, 0}, \
{"worker-config", CONFIG_HLP_WORKER_CMD, 0, strptr:(char **)&worker_config, defstrval:NULL, TYPE_STRING, 0}, \
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \
{"noS1", CONFIG_HLP_NOS1, PARAMFLAG_BOOL, uptr:&noS1, defintval:0, TYPE_INT, 0}, \
{"rfsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&rfsim, defintval:0, TYPE_INT, 0}, \
{"basicsim", CONFIG_HLP_RFSIM, PARAMFLAG_BOOL, uptr:&basicsim, defintval:0, TYPE_INT, 0}, \
{"nokrnmod", CONFIG_HLP_NOKRNMOD, PARAMFLAG_BOOL, uptr:&nokrnmod, defintval:0, TYPE_INT, 0}, \
{"nbiot-disable", CONFIG_HLP_DISABLNBIOT, PARAMFLAG_BOOL, uptr:&nonbiot, defuintval:0, TYPE_INT, 0}, \
}
......@@ -238,8 +241,8 @@
#define SOFTMODEM_NOS1_BIT (1<<0)
#define SOFTMODEM_NOKRNMOD_BIT (1<<1)
#define SOFTMODEM_NONBIOT_BIT (1<<2)
#define SOFTMODEM_BASICSIM_BIT (1<<10)
#define SOFTMODEM_RFSIM_BIT (1<<10)
#define SOFTMODEM_BASICSIM_BIT (1<<11)
typedef struct {
uint64_t optmask;
THREAD_STRUCT thread_struct;
......@@ -260,6 +263,7 @@ typedef struct {
#define IS_SOFTMODEM_NOS1 ( get_softmodem_optmask() & SOFTMODEM_NOS1_BIT)
#define IS_SOFTMODEM_NOKRNMOD ( get_softmodem_optmask() & SOFTMODEM_NOKRNMOD_BIT)
#define IS_SOFTMODEM_NONBIOT ( get_softmodem_optmask() & SOFTMODEM_NONBIOT_BIT)
#define IS_SOFTMODEM_RFSIM ( get_softmodem_optmask() & SOFTMODEM_RFSIM_BIT)
#define IS_SOFTMODEM_BASICSIM ( get_softmodem_optmask() & SOFTMODEM_BASICSIM_BIT)
extern uint64_t get_softmodem_optmask(void);
extern uint64_t set_softmodem_optmask(uint64_t bitmask);
......
......@@ -344,12 +344,12 @@ void init_UE(int nb_inst,int eMBMS_active, int uecap_xer_in, int timing_correcti
}
else UE->N_TA_offset = 0;
#if BASIC_SIMULATOR
if( IS_SOFTMODEM_BASICSIM)
/* this is required for the basic simulator in TDD mode
* TODO: find a proper cleaner solution
*/
UE->N_TA_offset = 0;
#endif
UE->N_TA_offset = 0;
if (simL1flag == 1) init_ue_devices(UE);
LOG_I(PHY,"Intializing UE Threads for instance %d (%p,%p)...\n",inst,PHY_vars_UE_g[inst],PHY_vars_UE_g[inst][0]);
......@@ -875,9 +875,9 @@ static void *UE_thread_rxn_txnp4(void *arg) {
exit_fun("noting to add");
}
proc->instance_cnt_rxtx--;
#if BASIC_SIMULATOR
if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort();
#endif
if ( IS_SOFTMODEM_BASICSIM ) {
if (pthread_cond_signal(&proc->cond_rxtx) != 0) abort();
}
if (pthread_mutex_unlock(&proc->mutex_rxtx) != 0) {
LOG_E( PHY, "[SCHED][UE] error unlocking mutex for UE RXTX\n" );
exit_fun("noting to add");
......@@ -1570,12 +1570,12 @@ void *UE_thread(void *arg) {
}
while (!oai_exit) {
#if BASIC_SIMULATOR
while (!(UE->proc.instance_cnt_synch < 0)) {
printf("ue sync not ready\n");
usleep(500*1000);
}
#endif
if (IS_SOFTMODEM_BASICSIM)
while (!(UE->proc.instance_cnt_synch < 0)) {
printf("ue sync not ready\n");
usleep(500*1000);
}
AssertFatal ( 0== pthread_mutex_lock(&UE->proc.mutex_synch), "");
int instance_cnt_synch = UE->proc.instance_cnt_synch;
......@@ -1665,17 +1665,15 @@ void *UE_thread(void *arg) {
// update thread index for received subframe
UE->current_thread_id[sub_frame] = thread_idx;
#if BASIC_SIMULATOR
{
int t;
for (t = 0; t < 2; t++) {
UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[t];
pthread_mutex_lock(&proc->mutex_rxtx);
while (proc->instance_cnt_rxtx >= 0) pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx );
pthread_mutex_unlock(&proc->mutex_rxtx);
}
}
#endif
if (IS_SOFTMODEM_BASICSIM) {
int t;
for (t = 0; t < 2; t++) {
UE_rxtx_proc_t *proc = &UE->proc.proc_rxtx[t];
pthread_mutex_lock(&proc->mutex_rxtx);
while (proc->instance_cnt_rxtx >= 0) pthread_cond_wait( &proc->cond_rxtx, &proc->mutex_rxtx );
pthread_mutex_unlock(&proc->mutex_rxtx);
}
}
LOG_D(PHY,"Process Subframe %d thread Idx %d \n", sub_frame, UE->current_thread_id[sub_frame]);
thread_idx++;
......
......@@ -441,10 +441,6 @@ static void get_options(void) {
if (dumpframe > 0) mode = rx_dump_frame;
# if BASIC_SIMULATOR
set_softmodem_optmask(SOFTMODEM_BASICSIM_BIT); //this BASIC_SIMULATOR should be a config option
# endif
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id]->dl_CarrierFreq = downlink_frequency[0][0];
}
......@@ -769,10 +765,11 @@ int main( int argc, char **argv ) {
init_opt();
uint32_t pdcp_initmask = ((!IS_SOFTMODEM_NOS1) || IS_SOFTMODEM_NOKRNMOD)? LINK_ENB_PDCP_TO_GTPV1U_BIT : (LINK_ENB_PDCP_TO_GTPV1U_BIT | PDCP_USE_NETLINK_BIT | LINK_ENB_PDCP_TO_IP_DRIVER_BIT);
if ( IS_SOFTMODEM_BASICSIM || (nfapi_mode == 3) ) {
if ( IS_SOFTMODEM_BASICSIM || IS_SOFTMODEM_RFSIM || (nfapi_mode == 3) ) {
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
}
if ( IS_SOFTMODEM_NOKRNMOD)
pdcp_initmask = pdcp_initmask | UE_NAS_USE_TUN_BIT;
pdcp_module_init( pdcp_initmask );
//TTN for D2D
#if (LTE_RRC_VERSION >= MAKE_VERSION(14, 0, 0))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment