Merge branch 'develop' into RU-RAU-split
Conflicts: openair1/PHY/INIT/lte_init.c openair1/PHY/LTE_ESTIMATION/lte_ul_channel_estimation.c openair1/PHY/LTE_TRANSPORT/dci.c openair1/PHY/LTE_TRANSPORT/dci_tools.c openair1/PHY/LTE_TRANSPORT/dlsch_coding.c openair1/PHY/LTE_TRANSPORT/dlsch_decoding.c openair1/PHY/LTE_TRANSPORT/dlsch_demodulation.c openair1/PHY/LTE_TRANSPORT/dlsch_llr_computation.c openair1/PHY/LTE_TRANSPORT/dlsch_modulation.c openair1/PHY/LTE_TRANSPORT/if4_tools.c openair1/PHY/LTE_TRANSPORT/if5_tools.c openair1/PHY/LTE_TRANSPORT/if5_tools.h openair1/PHY/LTE_TRANSPORT/pcfich.c openair1/PHY/LTE_TRANSPORT/phich.c openair1/PHY/LTE_TRANSPORT/prach.c openair1/PHY/LTE_TRANSPORT/rar_tools.c openair1/PHY/LTE_TRANSPORT/srs_modulation.c openair1/PHY/defs.h openair1/PHY/impl_defs_lte.h openair1/PHY/impl_defs_top.h openair1/SCHED/phy_procedures_lte_eNb.c openair1/SCHED/phy_procedures_lte_ue.c openair2/COMMON/mac_rrc_primitives.h openair2/ENB_APP/enb_config.c openair2/ENB_APP/enb_config.h openair2/LAYER2/MAC/config.c openair2/LAYER2/MAC/eNB_scheduler.c openair2/LAYER2/MAC/eNB_scheduler_dlsch.c openair2/LAYER2/MAC/eNB_scheduler_mch.c openair2/LAYER2/MAC/eNB_scheduler_primitives.c openair2/LAYER2/MAC/main.c openair2/LAYER2/MAC/proto.h openair2/RRC/LITE/MESSAGES/asn1_msg.c openair2/RRC/LITE/MESSAGES/asn1_msg.h openair2/RRC/LITE/rrc_UE.c openair2/RRC/LITE/rrc_common.c openair2/RRC/LITE/rrc_eNB.c targets/ARCH/COMMON/common_lib.c targets/ARCH/COMMON/common_lib.h targets/ARCH/ETHERNET/USERSPACE/LIB/eth_raw.c targets/ARCH/ETHERNET/USERSPACE/LIB/eth_udp.c targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.c targets/ARCH/ETHERNET/USERSPACE/LIB/ethernet_lib.h targets/ARCH/ETHERNET/USERSPACE/LIB/if_defs.h targets/ARCH/LMSSDR/USERSPACE/LIB/lms_lib.cpp targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.25PRB.lo.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/rcc.band7.tm1.if4p5.50PRB.lo.conf targets/PROJECTS/GENERIC-LTE-EPC/CONF/rru.band7.tm1.if4p5.25PRB.oaisim.conf targets/RT/USER/lte-enb.c targets/RT/USER/lte-softmodem.c targets/RT/USER/lte-ue.c targets/RT/USER/rt_wrapper.h targets/SIMU/USER/channel_sim.c targets/SIMU/USER/init_lte.c targets/SIMU/USER/oaisim.c targets/SIMU/USER/oaisim_functions.c
This commit is contained in:
@@ -150,8 +150,9 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
}
|
||||
|
||||
// find out which eNB the UE is attached to
|
||||
|
||||
for (eNB_id=0; eNB_id<RC.nb_inst; eNB_id++) {
|
||||
if (find_ue(PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[0]->crnti,RC.eNB[eNB_id][CC_id])>=0) {
|
||||
if (find_ue(PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[0][0]->crnti,RC.eNB[eNB_id][CC_id])>=0) {
|
||||
// UE with UE_id is connected to eNb with eNB_id
|
||||
att_eNB_id=eNB_id;
|
||||
LOG_D(OCM,"A: UE attached to eNB (UE%d->eNB%d)\n",UE_id,eNB_id);
|
||||
@@ -354,6 +355,7 @@ void do_DL_sig(channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM
|
||||
RU_output_mask[UE_id]=0;
|
||||
|
||||
|
||||
|
||||
double *r_re_p[2] = {r_re_DL[ru_id][0],r_re_DL[ru_id][1]};
|
||||
double *r_im_p[2] = {r_im_DL[ru_id][0],r_im_DL[ru_id][1]};
|
||||
|
||||
|
||||
@@ -513,7 +513,7 @@ void update_mac(Event_t event)
|
||||
if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) {
|
||||
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
|
||||
}
|
||||
|
||||
@@ -637,7 +637,7 @@ void update_mac(Event_t event)
|
||||
if(&mac_config[i].mac_ContentionResolutionTimer !=NULL) {
|
||||
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:", i);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
|
||||
}
|
||||
|
||||
@@ -903,13 +903,13 @@ void update_mac(Event_t event)
|
||||
for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval;
|
||||
UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
|
||||
LOG_I(EMU,"cqiSchedInterval UE :\n", i);
|
||||
LOG_I(EMU,"cqiSchedInterval UE %d:\n", i);
|
||||
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval);
|
||||
}
|
||||
} else {
|
||||
oai_emulation->mac_config[event.ue].cqiSchedInterval= mac_config[event.ue].cqiSchedInterval;
|
||||
UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval = oai_emulation->mac_config[event.ue].cqiSchedInterval;
|
||||
LOG_I(EMU,"cqiSchedInterval UE :\n", event.ue);
|
||||
LOG_I(EMU,"cqiSchedInterval UE %d:\n", event.ue);
|
||||
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval);
|
||||
}
|
||||
} else if(!strcmp((char *) event.key, "mac_ContentionResolutionTimer") && event.value!=NULL && validate_mac(event)) {
|
||||
@@ -923,13 +923,13 @@ void update_mac(Event_t event)
|
||||
for(i=UE_list->head; i>=0; i=UE_list->next[i]) {
|
||||
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", i);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", i);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
|
||||
}
|
||||
} else {
|
||||
oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer= mac_config[event.ue].mac_ContentionResolutionTimer;
|
||||
UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer = oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer;
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", event.ue);
|
||||
LOG_I(EMU,"mac_ContentionResolutionTimer UE %d:\n", event.ue);
|
||||
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer);
|
||||
}
|
||||
} else if(!strcmp((char *) event.key, "max_allowed_rbs") && event.value!=NULL && validate_mac(event)) {
|
||||
@@ -1040,7 +1040,7 @@ void update_sys_model(Event_t event)
|
||||
LOG_I(EMU,"free_space_model_parameters.pathloss_exponent %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_exponent);
|
||||
LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB);
|
||||
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
|
||||
//Antenna
|
||||
LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors);
|
||||
@@ -1103,7 +1103,7 @@ void update_sys_model(Event_t event)
|
||||
} else if(!strcmp((char *) event.key, "free_space_model_parameters.pathloss_0_dB")) {
|
||||
LOG_I(EMU,"free_space_model_parameters.pathloss_0_dB %G\n",oai_emulation->environment_system_config.fading.free_space_model_parameters.pathloss_0_dB);
|
||||
} else if(!strcmp((char *) event.key, "ricean_8tap.rice_factor_dB")) {
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %G\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
LOG_I(EMU,"ricean_8tap.rice_factor_dB %d\n",oai_emulation->environment_system_config.fading.ricean_8tap.rice_factor_dB);
|
||||
} else if(!strcmp((char *) event.key, "antenna.eNB_antenna.number_of_sectors")) {
|
||||
LOG_I(EMU,"antenna.eNB_antenna.number_of_sectors %d\n",oai_emulation->environment_system_config.antenna.eNB_antenna.number_of_sectors);
|
||||
} else if(!strcmp((char *) event.key, "antenna.eNB_antenna.beam_width_dB")) {
|
||||
@@ -1202,8 +1202,8 @@ void update_topo_model(Event_t event)
|
||||
LOG_I(EMU,"UE_moving_dynamics_max_speed_mps %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_speed_mps);
|
||||
LOG_I(EMU,"UE_moving_dynamics_min_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.min_journey_time_ms);
|
||||
LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms);
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option);
|
||||
LOG_I(EMU,"random_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.random_UE_distribution.number_of_nodes);
|
||||
LOG_I(EMU,"concentrated_UE_distribution_number_of_nodes %d\n",oai_emulation->topology_config.mobility.UE_mobility.concentrated_UE_distribution.number_of_nodes);
|
||||
@@ -1245,9 +1245,9 @@ void update_topo_model(Event_t event)
|
||||
} else if(!strcmp((char *) event.key, "UE_moving_dynamics_max_journey_time_ms")) {
|
||||
LOG_I(EMU,"UE_moving_dynamics_max_journey_time_ms %G\n",oai_emulation->topology_config.mobility.UE_mobility.UE_moving_dynamics.max_journey_time_ms);
|
||||
} else if(!strcmp((char *) event.key, "grid_map_horizontal_grid")) {
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
LOG_I(EMU,"grid_map_horizontal_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.horizontal_grid);
|
||||
} else if(!strcmp((char *) event.key, "grid_map_vertical_grid")) {
|
||||
LOG_I(EMU,"grid_map_vertical_grid %G\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
LOG_I(EMU,"grid_map_vertical_grid %d\n",oai_emulation->topology_config.mobility.UE_mobility.grid_walk.grid_map.vertical_grid);
|
||||
} else if(!strcmp((char *) event.key, "UE_initial_distribution_selected_option")) {
|
||||
LOG_I(EMU,"UE_initial_distribution_selected_option %s\n",oai_emulation->topology_config.mobility.UE_mobility.UE_initial_distribution.selected_option);
|
||||
} else if(!strcmp((char *) event.key, "random_UE_distribution_number_of_nodes")) {
|
||||
|
||||
@@ -80,6 +80,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LOG_I(PHY,"Allocating Transport Channel Buffer for ULSCH, UE %d\n",i);
|
||||
PHY_vars_eNB->ulsch[1+i] = new_eNB_ulsch(MAX_TURBO_ITERATIONS,frame_parms->N_RB_UL, abstraction_flag);
|
||||
|
||||
@@ -148,8 +149,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
PHY_VARS_RN* init_lte_RN(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t RN_id,
|
||||
uint8_t eMBMS_active_state)
|
||||
|
||||
+55
-30
@@ -59,6 +59,7 @@
|
||||
|
||||
#include "SCHED/defs.h"
|
||||
#include "SCHED/vars.h"
|
||||
#include "system.h"
|
||||
|
||||
|
||||
#include "PHY/TOOLS/lte_phy_scope.h"
|
||||
@@ -180,6 +181,9 @@ extern uint8_t ethernet_flag;
|
||||
extern uint16_t Nid_cell;
|
||||
|
||||
|
||||
double cpuf;
|
||||
#include "threads_t.h"
|
||||
threads_t threads= {-1,-1,-1};
|
||||
|
||||
//#ifdef XFORMS
|
||||
int otg_enabled;
|
||||
@@ -238,7 +242,7 @@ help (void)
|
||||
printf ("-L [0-1] 0 to disable new link adaptation, 1 to enable new link adapatation\n");
|
||||
printf ("-m Gives a fixed DL mcs for eNB scheduler\n");
|
||||
printf ("-M Set the machine ID for Ethernet-based emulation\n");
|
||||
printf ("-n Set the number of frames for the simulation\n");
|
||||
printf ("-n Set the number of frames for the simulation. 0 for no limit\n");
|
||||
printf ("-O [enb_conf_file] eNB configuration file name\n");
|
||||
printf ("-p Set the total number of machine in emulation - valid if M is set\n");
|
||||
printf ("-P [trace type] Enable protocol analyzer. Possible values for OPT:\n");
|
||||
@@ -456,7 +460,8 @@ l2l1_task_state_t l2l1_state = L2L1_WAITTING;
|
||||
|
||||
extern openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
extern openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
|
||||
extern openair0_timestamp last_eNB_rx_timestamp[NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
|
||||
extern openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
void *
|
||||
@@ -468,7 +473,7 @@ l2l1_task (void *args_p)
|
||||
// Framing variables
|
||||
int32_t sf;
|
||||
|
||||
char fname[64], vname[64];
|
||||
//char fname[64], vname[64];
|
||||
|
||||
//#ifdef XFORMS
|
||||
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
|
||||
@@ -589,6 +594,7 @@ l2l1_task (void *args_p)
|
||||
switch (ITTI_MSG_ID(message_p)) {
|
||||
case INITIALIZE_MESSAGE:
|
||||
l2l1_state = L2L1_RUNNING;
|
||||
start_eNB = 1;
|
||||
break;
|
||||
|
||||
case ACTIVATE_MESSAGE:
|
||||
@@ -728,11 +734,11 @@ l2l1_task (void *args_p)
|
||||
#endif
|
||||
|
||||
clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
|
||||
|
||||
CC_id=0;
|
||||
CC_id=0;
|
||||
int all_done=0;
|
||||
|
||||
while (all_done==0) {
|
||||
|
||||
pthread_mutex_lock(&subframe_mutex);
|
||||
int subframe_ru_mask_local = subframe_ru_mask;
|
||||
int subframe_UE_mask_local = subframe_UE_mask;
|
||||
@@ -769,23 +775,6 @@ l2l1_task (void *args_p)
|
||||
LOG_D(EMU,"UE %d/%d: TS %llu\n",UE_id,CC_id,current_UE_rx_timestamp[UE_inst][CC_id]);
|
||||
}
|
||||
|
||||
|
||||
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
|
||||
T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(slot/2));
|
||||
/*
|
||||
LOG_D(EMU,
|
||||
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
|
||||
eNB_inst,
|
||||
frame%MAX_FRAME_NUMBER,
|
||||
2*sf,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_tx,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_rx,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.frame_type,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.tdd_config,
|
||||
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.Nid_cell);
|
||||
*/
|
||||
}
|
||||
|
||||
for (eNB_inst = oai_emulation.info.first_enb_local;
|
||||
(eNB_inst
|
||||
< (oai_emulation.info.first_enb_local
|
||||
@@ -793,7 +782,6 @@ l2l1_task (void *args_p)
|
||||
eNB_inst++) {
|
||||
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
|
||||
|
||||
T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(sf));
|
||||
/*
|
||||
LOG_D(EMU,
|
||||
"PHY procedures eNB %d for frame %d, subframe %d TDD %d/%d Nid_cell %d\n",
|
||||
@@ -942,7 +930,7 @@ l2l1_task (void *args_p)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
|
||||
for (RN_id=oai_emulation.info.first_rn_local;
|
||||
RN_id<oai_emulation.info.first_rn_local+oai_emulation.info.nb_rn_local;
|
||||
@@ -1201,6 +1189,7 @@ int T_port = 2021; /* default port to listen to to wait for the tracer */
|
||||
int T_dont_fork = 0; /* default is to fork, see 'T_init' to understand */
|
||||
#endif
|
||||
|
||||
|
||||
void wait_RUs() {
|
||||
|
||||
int i;
|
||||
@@ -1222,6 +1211,7 @@ void wait_RUs() {
|
||||
PHY_vars_UE_g[i][0]->frame_parms.nb_antennas_rx = 1;
|
||||
// set initially to 2, it will be revised after initial synchronization
|
||||
PHY_vars_UE_g[i][0]->frame_parms.nb_antenna_ports_eNB = 2;
|
||||
PHY_vars_UE_g[i][0]->frame_parms.tdd_config = 1;
|
||||
PHY_vars_UE_g[i][0]->frame_parms.dl_CarrierFreq = RC.ru[0]->frame_parms.dl_CarrierFreq;
|
||||
PHY_vars_UE_g[i][0]->frame_parms.ul_CarrierFreq = RC.ru[0]->frame_parms.ul_CarrierFreq;
|
||||
PHY_vars_UE_g[i][0]->frame_parms.eutra_band = RC.ru[0]->frame_parms.eutra_band;
|
||||
@@ -1249,6 +1239,15 @@ void init_UE(int,int,int);
|
||||
void init_RU(const char*);
|
||||
|
||||
|
||||
static void print_current_directory(void)
|
||||
{
|
||||
char dir[8192]; /* arbitrary size (should be big enough) */
|
||||
if (getcwd(dir, 8192) == NULL)
|
||||
printf("ERROR getting working directory\n");
|
||||
else
|
||||
printf("working directory: %s\n", dir);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------------*/
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
@@ -1256,6 +1255,10 @@ main (int argc, char **argv)
|
||||
|
||||
clock_t t;
|
||||
|
||||
print_current_directory();
|
||||
|
||||
start_background_system();
|
||||
|
||||
#ifdef SMBV
|
||||
// Rohde&Schwarz SMBV100A vector signal generator
|
||||
strcpy(smbv_ip,DEFAULT_SMBV_IP);
|
||||
@@ -1275,6 +1278,15 @@ main (int argc, char **argv)
|
||||
//Default values if not changed by the user in get_simulation_options();
|
||||
pdcp_period = 1;
|
||||
omg_period = 1;
|
||||
//Clean ip rule table
|
||||
for(int i =0; i<NUMBER_OF_UE_MAX; i++){
|
||||
char command_line[100];
|
||||
sprintf(command_line, "while ip rule del table %d; do true; done",i+201);
|
||||
/* we don't care about return value from system(), but let's the
|
||||
* compiler be silent, so let's do "if (XX);"
|
||||
*/
|
||||
if (system(command_line)) /* nothing */;
|
||||
}
|
||||
// start thread for log gen
|
||||
log_thread_init ();
|
||||
|
||||
@@ -1343,12 +1355,13 @@ main (int argc, char **argv)
|
||||
init_RU(NULL);
|
||||
|
||||
|
||||
// init_openair2 ();
|
||||
|
||||
// init_openair2 ();
|
||||
// init_openair0();
|
||||
|
||||
|
||||
|
||||
|
||||
if (create_tasks(0,
|
||||
oai_emulation.info.nb_ue_local) < 0)
|
||||
exit(-1); // need a softer mode
|
||||
@@ -1387,6 +1400,8 @@ main (int argc, char **argv)
|
||||
if (oai_emulation.info.opp_enabled == 1)
|
||||
reset_opp_meas_oaisim ();
|
||||
|
||||
cpuf=get_cpu_freq_GHz();
|
||||
|
||||
init_time ();
|
||||
|
||||
init_slot_isr ();
|
||||
@@ -1396,11 +1411,16 @@ main (int argc, char **argv)
|
||||
LOG_N(EMU,
|
||||
">>>>>>>>>>>>>>>>>>>>>>>>>>> OAIEMU initialization done <<<<<<<<<<<<<<<<<<<<<<<<<<\n\n");
|
||||
|
||||
#ifndef PACKAGE_VERSION
|
||||
# define PACKAGE_VERSION "UNKNOWN-EXPERIMENTAL"
|
||||
#endif
|
||||
LOG_I(EMU, "Version: %s\n", PACKAGE_VERSION);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
|
||||
// Handle signals until all tasks are terminated
|
||||
itti_wait_tasks_end();
|
||||
|
||||
|
||||
#else
|
||||
|
||||
if (oai_emulation.info.nb_enb_local > 0) {
|
||||
@@ -1436,14 +1456,16 @@ reset_opp_meas_oaisim (void)
|
||||
|
||||
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_rx);
|
||||
reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[0]);
|
||||
reset_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx[1]);
|
||||
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]->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_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[0]);
|
||||
reset_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats[1]);
|
||||
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_deinterleaving_stats);
|
||||
@@ -1605,6 +1627,7 @@ print_opp_meas_oaisim (void)
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc, "[UE][total_phy_proc]",
|
||||
&oaisim_stats, &oaisim_stats_f);
|
||||
|
||||
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->phy_proc_rx,
|
||||
"[UE][total_phy_proc_rx]", &oaisim_stats, &oaisim_stats_f);
|
||||
// print_meas (&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats,
|
||||
@@ -1619,8 +1642,10 @@ print_opp_meas_oaisim (void)
|
||||
&oaisim_stats, &oaisim_stats_f);
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_unscrambling_stats,
|
||||
"[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_decoding_stats[0],
|
||||
"[UE][decoding[0]]", &oaisim_stats, &oaisim_stats_f);
|
||||
print_meas (&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats[1],
|
||||
"[UE][decoding[1]]", &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,
|
||||
|
||||
@@ -469,7 +469,7 @@ int ocg_config_env(void)
|
||||
oai_emulation.info.frame_type[CC_id] = map_str_to_int(frame_type_names, oai_emulation.info.frame_type_name[CC_id]);
|
||||
|
||||
if (oai_emulation.info.frame_type[CC_id] == -1) {
|
||||
LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name);
|
||||
LOG_E(EMU,"frame type incorrect %s, set it to TDD \n",oai_emulation.info.frame_type_name[CC_id]);
|
||||
oai_emulation.info.frame_type[CC_id]=TDD;
|
||||
} else
|
||||
LOG_I(EMU,"Frame type is %s \n",oai_emulation.info.frame_type_name[CC_id]);
|
||||
@@ -479,7 +479,7 @@ int ocg_config_env(void)
|
||||
LOG_E(EMU,"TDD config %d out of range, set it to 3\n",oai_emulation.info.tdd_config[CC_id]);
|
||||
oai_emulation.info.tdd_config[CC_id]=3;
|
||||
} else
|
||||
LOG_I(EMU,"TDD config is set to \n",oai_emulation.info.tdd_config[CC_id]);
|
||||
LOG_I(EMU,"TDD config is set to %d\n",oai_emulation.info.tdd_config[CC_id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1088,8 +1088,8 @@ int ocg_config_app(void)
|
||||
oai_emulation.application_config.customized_traffic.holding_time_pe_off[customized_traffic_config_index];
|
||||
|
||||
|
||||
LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%d:%d) source = %d, dest = %d, dist type for size = %d start/duration %d/%d\n", source_id_start, source_id_end, source_id_index,
|
||||
destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0],
|
||||
LOG_I(OTG,"customized:: OCG_config_OTG: (2) FORMAT (%s:%s) source = %d, dest = %d, dist type for size = %d [TODO: check code, printed value may not be correct, checks the indexes of the arry access] start/duration %d/%d\n", source_id_start, source_id_end, source_id_index,
|
||||
destination_id_index, g_otg->size_dist[source_id_index][destination_id_index][0][0],
|
||||
g_otg->flow_start[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]],
|
||||
g_otg->flow_duration[source_id_index][destination_id_index][g_otg->application_idx[source_id_index][destination_id_index]]);
|
||||
per_source_id = strtok(NULL, comma);
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/*! \file oaisim_functions.c
|
||||
* \brief function primitives of oaisim
|
||||
* \author Navid Nikaein
|
||||
* \author Navid Nikaein
|
||||
* \date 2013-2015
|
||||
* \version 1.0
|
||||
* \company Eurecom
|
||||
@@ -160,7 +160,7 @@ extern channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
|
||||
extern channel_desc_t *UE2RU[NUMBER_OF_UE_MAX][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
|
||||
|
||||
extern mapping small_scale_names[];
|
||||
#if defined(Rel10)
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
extern pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
extern pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
#endif
|
||||
@@ -721,8 +721,9 @@ void get_simulation_options(int argc, char *argv[])
|
||||
/*
|
||||
oai_emulation.info.transmission_mode[0] = atoi (optarg);
|
||||
|
||||
if ((oai_emulation.info.transmission_mode[0] != 1) && (oai_emulation.info.transmission_mode[0] != 2) && (oai_emulation.info.transmission_mode[0] != 3)
|
||||
&& (oai_emulation.info.transmission_mode[0] != 5) && (oai_emulation.info.transmission_mode[0] != 6) && (oai_emulation.info.transmission_mode[0] !=7)) {
|
||||
if ((oai_emulation.info.transmission_mode[0] != 1) && (oai_emulation.info.transmission_mode[0] != 2) &&
|
||||
(oai_emulation.info.transmission_mode[0] != 3) && (oai_emulation.info.transmission_mode[0] != 4) &&
|
||||
(oai_emulation.info.transmission_mode[0] != 5) && (oai_emulation.info.transmission_mode[0] != 6)) && (oai_emulation.info.transmission_mode[0] !=7)) {
|
||||
printf("Unsupported transmission mode %d\n",oai_emulation.info.transmission_mode[0]);
|
||||
exit(-1);
|
||||
}
|
||||
@@ -1041,6 +1042,7 @@ int UE_trx_set_gains(openair0_device *device, openair0_config_t *openair0_cfg) {
|
||||
extern pthread_mutex_t subframe_mutex;
|
||||
extern int subframe_ru_mask,subframe_UE_mask;
|
||||
|
||||
|
||||
int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
|
||||
int ru_id = device->Mod_id;
|
||||
@@ -1051,6 +1053,7 @@ int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
|
||||
*ptimestamp = last_ru_rx_timestamp[ru_id][CC_id];
|
||||
|
||||
|
||||
LOG_D(EMU,"RU_trx_read nsamps %d TS(%llu,%llu) => subframe %d\n",nsamps,
|
||||
(unsigned long long)current_ru_rx_timestamp[ru_id][CC_id],
|
||||
(unsigned long long)last_ru_rx_timestamp[ru_id][CC_id],
|
||||
@@ -1085,14 +1088,14 @@ int ru_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
}
|
||||
|
||||
|
||||
|
||||
return(nsamps);
|
||||
}
|
||||
|
||||
int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc) {
|
||||
|
||||
int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **buff, int nsamps, int cc)
|
||||
{
|
||||
int UE_id = device->Mod_id;
|
||||
int CC_id = device->CC_id;
|
||||
|
||||
int subframe,new_subframe;
|
||||
int sample_count=0;
|
||||
int read_size;
|
||||
@@ -1104,6 +1107,7 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
(unsigned long long)last_UE_rx_timestamp[UE_id][CC_id],
|
||||
cc);
|
||||
|
||||
|
||||
if (nsamps < PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)
|
||||
read_size = nsamps;
|
||||
else
|
||||
@@ -1113,11 +1117,11 @@ int UE_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void **
|
||||
while (current_UE_rx_timestamp[UE_id][CC_id] <
|
||||
(last_UE_rx_timestamp[UE_id][CC_id]+read_size)) {
|
||||
LOG_D(EMU,"[TXPATH]UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
usleep(500);
|
||||
}
|
||||
|
||||
// LOG_D(EMU,"UE_trx_read : current TS %d, last TS %d, sleeping\n",current_UE_rx_timestamp[UE_id][CC_id],last_UE_rx_timestamp[UE_id][CC_id]);
|
||||
|
||||
// if we cross a subframe-boundary
|
||||
subframe = (last_UE_rx_timestamp[UE_id][CC_id]/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)%10;
|
||||
new_subframe = ((last_UE_rx_timestamp[UE_id][CC_id]+read_size)/PHY_vars_UE_g[UE_id][CC_id]->frame_parms.samples_per_tti)%10;
|
||||
@@ -1281,6 +1285,7 @@ void init_openair0() {
|
||||
|
||||
void init_devices(void){
|
||||
|
||||
|
||||
module_id_t UE_id, ru_id;
|
||||
uint8_t CC_id;
|
||||
RU_t *ru;
|
||||
@@ -1302,10 +1307,12 @@ void init_devices(void){
|
||||
ru->rfdevice.trx_set_freq_func = ru_trx_set_freq;
|
||||
ru->rfdevice.trx_set_gains_func = ru_trx_set_gains;
|
||||
last_ru_rx_timestamp[ru_id][0] = 0;
|
||||
|
||||
}
|
||||
if (PHY_vars_UE_g==NULL) {
|
||||
PHY_vars_UE_g = (PHY_VARS_UE ***)malloc((1+NB_UE_INST)*sizeof(PHY_VARS_UE*));
|
||||
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
|
||||
printf("Initializing UE %d\n",UE_id);
|
||||
PHY_vars_UE_g[UE_id] = (PHY_VARS_UE **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_UE*));
|
||||
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
|
||||
PHY_vars_UE_g[UE_id][CC_id] = (PHY_VARS_UE *)malloc(sizeof(PHY_VARS_UE));
|
||||
@@ -1341,7 +1348,7 @@ void init_ocm(void)
|
||||
break;
|
||||
|
||||
case TDD:
|
||||
frame_type = "FDD";
|
||||
frame_type = "TDD";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1352,7 +1359,7 @@ void init_ocm(void)
|
||||
get_beta_map_up();
|
||||
#endif
|
||||
get_MIESM_param();
|
||||
|
||||
|
||||
//load_pbch_desc();
|
||||
}
|
||||
|
||||
@@ -1406,6 +1413,7 @@ void init_ocm(void)
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s, %d) from UE %d to ru %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),UE_id, ru_id);
|
||||
|
||||
|
||||
UE2RU[UE_id][ru_id][CC_id] =
|
||||
new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx,
|
||||
RC.ru[ru_id]->nb_rx,
|
||||
@@ -1569,9 +1577,9 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
|
||||
// generate traffic if the ue is rrc reconfigured state
|
||||
//if ((rrc_state=mac_eNB_get_rrc_status(enb_module_idP, dst_id)) > 2 /*RRC_CONNECTED*/ ) {
|
||||
if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
|
||||
if (mac_eNB_get_rrc_status(enb_module_idP, oai_emulation.info.eNB_ue_module_id_to_rnti[enb_module_idP][dst_id]) > 2 ){
|
||||
if_times += 1;
|
||||
|
||||
|
||||
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
|
||||
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
|
||||
|
||||
@@ -1596,7 +1604,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef Rel10
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
mbms_service_id_t service_id;
|
||||
mbms_session_id_t session_id;
|
||||
rb_id_t rb_id;
|
||||
@@ -1631,7 +1639,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
|
||||
|
||||
// old version
|
||||
/* // MBSM multicast traffic
|
||||
#ifdef Rel10
|
||||
#if defined(Rel10) || defined(Rel14)
|
||||
if (frame >= 46) {// only generate when UE can receive MTCH (need to control this value)
|
||||
for (service_id = 0; service_id < 2 ; service_id++) { //maxServiceCount
|
||||
for (session_id = 0; session_id < 2; session_id++) { // maxSessionPerPMCH
|
||||
@@ -1713,16 +1721,16 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
|
||||
if (mac_UE_get_rrc_status(ue_mod_idP, dst_id ) > 2 /*RRC_CONNECTED*/) {
|
||||
for (app_id=0; app_id<MAX_NUM_APPLICATION; app_id++) {
|
||||
Packet_otg_elt_t *otg_pkt = malloc (sizeof(Packet_otg_elt_t));
|
||||
|
||||
|
||||
if (otg_pkt!=NULL)
|
||||
memset(otg_pkt,0,sizeof(Packet_otg_elt_t));
|
||||
else {
|
||||
LOG_E(OTG,"not enough memory\n");
|
||||
exit(-1);
|
||||
}// Manage to add this packet to the tail of your list
|
||||
|
||||
|
||||
(otg_pkt->otg_pkt).sdu_buffer = (uint8_t*) packet_gen(src_id, dst_id, app_id, ctime, &((otg_pkt->otg_pkt).sdu_buffer_size));
|
||||
|
||||
|
||||
if ((otg_pkt->otg_pkt).sdu_buffer != NULL) {
|
||||
(otg_pkt->otg_pkt).rb_id = DTCH-2;
|
||||
(otg_pkt->otg_pkt).module_id = module_id;
|
||||
|
||||
Reference in New Issue
Block a user