Commit f5d3fda2 authored by gauthier's avatar gauthier
Browse files

Not tested

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6328 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 7d0df005
/*******************************************************************************
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface
Copyright(c) 1999 - 2014 Eurecom
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
OpenAirInterface is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with OpenAirInterface.The full GNU General Public License is
included in this distribution in the file called "COPYING". If not,
see <http://www.gnu.org/licenses/>.
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
Contact Information
OpenAirInterface Admin: openair_admin@eurecom.fr
OpenAirInterface Tech : openair_tech@eurecom.fr
OpenAirInterface Dev : openair4g-devel@eurecom.fr
*******************************************************************************/
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/
#include <string.h>
#include <math.h>
......@@ -71,12 +71,12 @@
#ifdef SMBV
#include "PHY/TOOLS/smbv.h"
char smbv_fname[] = "smbv_config_file.smbv";
char smbv_fname[] = "smbv_config_file.smbv";
unsigned short smbv_nframes = 4; // how many frames to configure 1,..,4
unsigned short config_frames[4] = {2,9,11,13};
unsigned char smbv_frame_cnt = 0;
uint8_t config_smbv = 0;
char smbv_ip[16];
unsigned char smbv_frame_cnt = 0;
uint8_t config_smbv = 0;
char smbv_ip[16];
#endif
#include "oaisim_functions.h"
......@@ -109,11 +109,11 @@ char smbv_ip[16];
#define N_TRIALS 1
/*
DCI0_5MHz_TDD0_t UL_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
*/
DCI0_5MHz_TDD0_t UL_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
*/
#define UL_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,24)
#define CCCH_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,3)
......@@ -129,33 +129,33 @@ char smbv_ip[16];
//#define K 2 /* averaging coefficient */
//#define TARGET_SF_TIME_NS 1000000 /* 1ms = 1000000 ns */
frame_t frame = 0;
char stats_buffer[16384];
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
frame_t frame = 0;
char stats_buffer[16384];
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
//Added for PHY abstraction
node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
node_desc_t *ue_data[NUMBER_OF_UE_MAX];
node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
node_desc_t *ue_data[NUMBER_OF_UE_MAX];
// Added for PHY abstraction
extern node_list* ue_node_list;
extern node_list* enb_node_list;
extern int pdcp_period, omg_period;
extern double **s_re, **s_im, **r_re, **r_im, **r_re0, **r_im0;
int map1, map2;
extern double **ShaF;
double snr_dB, sinr_dB, snr_direction; //,sinr_direction;
extern double snr_step;
extern uint8_t set_sinr;
extern uint8_t ue_connection_test;
extern uint8_t set_seed;
uint8_t cooperation_flag; // for cooperative communication
extern uint8_t target_dl_mcs;
extern uint8_t target_ul_mcs;
uint8_t rate_adaptation_flag;
extern uint8_t abstraction_flag;
extern uint8_t ethernet_flag;
extern uint16_t Nid_cell;
extern node_list* ue_node_list;
extern node_list* enb_node_list;
extern int pdcp_period, omg_period;
extern double **s_re, **s_im, **r_re, **r_im, **r_re0, **r_im0;
int map1, map2;
extern double **ShaF;
double snr_dB, sinr_dB, snr_direction; //,sinr_direction;
extern double snr_step;
extern uint8_t set_sinr;
extern uint8_t ue_connection_test;
extern uint8_t set_seed;
uint8_t cooperation_flag; // for cooperative communication
extern uint8_t target_dl_mcs;
extern uint8_t target_ul_mcs;
uint8_t rate_adaptation_flag;
extern uint8_t abstraction_flag;
extern uint8_t ethernet_flag;
extern uint16_t Nid_cell;
extern LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs];
......@@ -169,216 +169,212 @@ time_stats_t dl_chan_stats;
time_stats_t ul_chan_stats;
// this should reflect the channel models in openair1/SIMULATION/TOOLS/defs.h
mapping small_scale_names[] = {
{"custom", custom},
{"SCM_A", SCM_A},
{"SCM_B", SCM_B},
{"SCM_C", SCM_C},
{"SCM_D", SCM_D},
{"EPA", EPA},
{"EVA", EVA},
{"ETU", ETU},
{"MBSFN", MBSFN},
{"Rayleigh8", Rayleigh8},
{"Rayleigh1", Rayleigh1},
{"Rayleigh1_800", Rayleigh1_800},
{"Rayleigh1_corr", Rayleigh1_corr},
{"Rayleigh1_anticorr", Rayleigh1_anticorr},
{"Rice8", Rice8},
{"Rice1", Rice1},
{"Rice1_corr", Rice1_corr},
{"Rice1_anticorr", Rice1_anticorr},
{"AWGN", AWGN},
{NULL, -1}
};
mapping small_scale_names[] = { { "custom", custom }, { "SCM_A", SCM_A }, {
"SCM_B", SCM_B }, { "SCM_C", SCM_C }, { "SCM_D", SCM_D }, {
"EPA", EPA }, { "EVA", EVA }, { "ETU", ETU },
{ "MBSFN", MBSFN }, { "Rayleigh8", Rayleigh8 }, { "Rayleigh1",
Rayleigh1 }, { "Rayleigh1_800", Rayleigh1_800 },
{ "Rayleigh1_corr", Rayleigh1_corr }, { "Rayleigh1_anticorr",
Rayleigh1_anticorr }, { "Rice8", Rice8 }, {
"Rice1", Rice1 }, { "Rice1_corr", Rice1_corr },
{ "Rice1_anticorr", Rice1_anticorr }, { "AWGN", AWGN }, { NULL,
-1 } };
#if !defined(ENABLE_ITTI)
static void *sigh(void *arg);
static void *
sigh (void *arg);
#endif
void oai_shutdown(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 ("-h provides this help message!\n");
printf ("-a Activates PHY abstraction mode\n");
printf ("-A set the multipath channel simulation, options are: SCM_A, SCM_B, SCM_C, SCM_D, EPA, EVA, ETU, Rayleigh8, Rayleigh1, Rayleigh1_corr,Rayleigh1_anticorr, Rice8,, Rice1, AWGN \n");
printf ("-b Set the number of local eNB\n");
printf ("-B Set the mobility model for eNB, options are: STATIC, RWP, RWALK, \n");
printf ("-c [1,2,3,4] Activate the config generator (OCG) to process the scenario descriptor, or give the scenario manually: -c template_1.xml \n");
printf ("-C [0-6] Sets TDD configuration\n");
printf ("-e Activates extended prefix mode\n");
printf ("-E Random number generator seed\n");
printf ("-f Set the forgetting factor for time-variation\n");
printf ("-F Activates FDD transmission (TDD is default)\n");
printf ("-g Set multicast group ID (0,1,2,3) - valid if M is set\n");
printf ("-G Enable background traffic \n");
printf ("-H Enable handover operation (default disabled) \n");
printf ("-I Enable CLI interface (to connect use telnet localhost 1352)\n");
printf ("-k Set the Ricean factor (linear)\n");
printf ("-K [log_file] Enable ITTI logging into log_file\n");
printf ("-l Set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error) \n");
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 ("-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");
printf (" - wireshark: Enable tracing of layers above PHY using an UDP socket\n");
printf (" - pcap: Enable tracing of layers above PHY to a pcap file\n");
printf (" - tshark: Not implemented yet\n");
printf ("-q Enable Openair performance profiler \n");
printf ("-Q Activate and set the MBMS service: 0 : not used (default eMBMS disabled), 1: eMBMS and RRC Connection enabled, 2: eMBMS relaying and RRC Connection enabled, 3: eMBMS enabled, RRC Connection disabled, 4: eMBMS relaying enabled, RRC Connection disabled\n");
printf ("-R [6,15,25,50,75,100] Sets N_RB_DL\n");
printf ("-r Activates rate adaptation (DL for now)\n");
printf ("-s snr_dB set a fixed (average) SNR, this deactivates the openair channel model generator (OCM)\n");
printf ("-S snir_dB set a fixed (average) SNIR, this deactivates the openair channel model generator (OCM)\n");
printf ("-t Gives a fixed UL mcs for eNB scheduler\n");
printf ("-T activate the traffic generator: cbr, scbr, mcbr, bcbr, mscbr\n");
printf ("-u Set the number of local UE\n");
printf ("-U Set the mobility model for UE, options are: STATIC, RWP, RWALK\n");
printf ("-V [vcd_file] Enable VCD dump into vcd_file\n");
printf ("-w number of CBA groups, if not specified or zero, CBA is inactive\n");
printf ("-W IP address to connect to SMBV and configure SMBV from config file. Requires compilation with SMBV=1, -W0 uses default IP 192.168.12.201\n");
printf ("-x Set the transmission mode (1,2,5,6 supported for now)\n");
printf ("-Y Set the global log verbosity (none, low, medium, high, full) \n");
printf ("-z Set the cooperation flag (0 for no cooperation, 1 for delay diversity and 2 for distributed alamouti\n");
printf ("-Z Reserved\n");
void
oai_shutdown (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 ("-h provides this help message!\n");
printf ("-a Activates PHY abstraction mode\n");
printf ("-A set the multipath channel simulation, options are: SCM_A, SCM_B, SCM_C, SCM_D, EPA, EVA, ETU, Rayleigh8, Rayleigh1, Rayleigh1_corr,Rayleigh1_anticorr, Rice8,, Rice1, AWGN \n");
printf ("-b Set the number of local eNB\n");
printf ("-B Set the mobility model for eNB, options are: STATIC, RWP, RWALK, \n");
printf ("-c [1,2,3,4] Activate the config generator (OCG) to process the scenario descriptor, or give the scenario manually: -c template_1.xml \n");
printf ("-C [0-6] Sets TDD configuration\n");
printf ("-e Activates extended prefix mode\n");
printf ("-E Random number generator seed\n");
printf ("-f Set the forgetting factor for time-variation\n");
printf ("-F Activates FDD transmission (TDD is default)\n");
printf ("-g Set multicast group ID (0,1,2,3) - valid if M is set\n");
printf ("-G Enable background traffic \n");
printf ("-H Enable handover operation (default disabled) \n");
printf ("-I Enable CLI interface (to connect use telnet localhost 1352)\n");
printf ("-k Set the Ricean factor (linear)\n");
printf ("-K [log_file] Enable ITTI logging into log_file\n");
printf ("-l Set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error) \n");
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 ("-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");
printf (" - wireshark: Enable tracing of layers above PHY using an UDP socket\n");
printf (" - pcap: Enable tracing of layers above PHY to a pcap file\n");
printf (" - tshark: Not implemented yet\n");
printf ("-q Enable Openair performance profiler \n");
printf ("-Q Activate and set the MBMS service: 0 : not used (default eMBMS disabled), 1: eMBMS and RRC Connection enabled, 2: eMBMS relaying and RRC Connection enabled, 3: eMBMS enabled, RRC Connection disabled, 4: eMBMS relaying enabled, RRC Connection disabled\n");
printf ("-R [6,15,25,50,75,100] Sets N_RB_DL\n");
printf ("-r Activates rate adaptation (DL for now)\n");
printf ("-s snr_dB set a fixed (average) SNR, this deactivates the openair channel model generator (OCM)\n");
printf ("-S snir_dB set a fixed (average) SNIR, this deactivates the openair channel model generator (OCM)\n");
printf ("-t Gives a fixed UL mcs for eNB scheduler\n");
printf ("-T activate the traffic generator: cbr, scbr, mcbr, bcbr, mscbr\n");
printf ("-u Set the number of local UE\n");
printf ("-U Set the mobility model for UE, options are: STATIC, RWP, RWALK\n");
printf ("-V [vcd_file] Enable VCD dump into vcd_file\n");
printf ("-w number of CBA groups, if not specified or zero, CBA is inactive\n");
printf ("-W IP address to connect to SMBV and configure SMBV from config file. Requires compilation with SMBV=1, -W0 uses default IP 192.168.12.201\n");
printf ("-x Set the transmission mode (1,2,5,6 supported for now)\n");
printf ("-Y Set the global log verbosity (none, low, medium, high, full) \n");
printf ("-z Set the cooperation flag (0 for no cooperation, 1 for delay diversity and 2 for distributed alamouti\n");
printf ("-Z Reserved\n");
}
pthread_t log_thread;
void log_thread_init() {
//create log_list
//log_list_init(&log_list);
void
log_thread_init () {
//create log_list
//log_list_init(&log_list);
#ifndef LOG_NO_THREAD
log_shutdown = 0;
log_shutdown = 0;
if ((pthread_mutex_init (&log_lock, NULL) != 0) || (pthread_cond_init (&log_notify, NULL) != 0)) {
return;
}
if ((pthread_mutex_init (&log_lock, NULL) != 0)
|| (pthread_cond_init (&log_notify, NULL) != 0)) {
return;
}
if (pthread_create (&log_thread, NULL, log_thread_function, (void*) NULL) != 0) {
log_thread_finalize ();
return;
}
if (pthread_create (&log_thread, NULL, log_thread_function, (void*) NULL)
!= 0) {
log_thread_finalize ();
return;
}
#endif
}
//Call it after the last LOG call
int log_thread_finalize() {
int err = 0;
int
log_thread_finalize () {
int err = 0;
#ifndef LOG_NO_THREAD
if (pthread_mutex_lock (&log_lock) != 0) {
return -1;
}
log_shutdown = 1;
/* Wake up LOG thread */
if ((pthread_cond_broadcast (&log_notify) != 0) || (pthread_mutex_unlock (&log_lock) != 0)) {
err = -1;
}
if (pthread_join (log_thread, NULL) != 0) {
err = -1;
}
if (pthread_mutex_unlock (&log_lock) != 0) {
err = -1;
}
if (!err) {
//log_list_free(&log_list);
pthread_mutex_lock (&log_lock);
pthread_mutex_destroy (&log_lock);
pthread_cond_destroy (&log_notify);
}
if (pthread_mutex_lock (&log_lock) != 0) {
return -1;
}
log_shutdown = 1;
/* Wake up LOG thread */
if ((pthread_cond_broadcast (&log_notify) != 0)
|| (pthread_mutex_unlock (&log_lock) != 0)) {
err = -1;
}
if (pthread_join (log_thread, NULL) != 0) {
err = -1;
}
if (pthread_mutex_unlock (&log_lock) != 0) {
err = -1;
}
if (!err) {
//log_list_free(&log_list);
pthread_mutex_lock (&log_lock);
pthread_mutex_destroy (&log_lock);
pthread_cond_destroy (&log_notify);
}
#endif
return err;
return err;
}
#if defined(ENABLE_ITTI)
static void set_cli_start(module_id_t module_idP, uint8_t start) {
if (module_idP < NB_eNB_INST) {
oai_emulation.info.cli_start_enb[module_idP] = start;
} else {
oai_emulation.info.cli_start_ue[module_idP - NB_eNB_INST] = start;
}
if (module_idP < NB_eNB_INST) {
oai_emulation.info.cli_start_enb[module_idP] = start;
} else {
oai_emulation.info.cli_start_ue[module_idP - NB_eNB_INST] = start;
}
}
#endif
#ifdef OPENAIR2
int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_Flow_Unit omv_data) {
module_id_t i, j;
omv_data.end = 0;
//omv_data.total_num_nodes = NB_UE_INST + NB_eNB_INST;
for (i = 0; i < NB_eNB_INST; i++) {
if (enb_node_list != NULL) {
omv_data.geo[i].x = (enb_node_list->node->x_pos < 0.0) ? 0.0 : enb_node_list->node->x_pos;
omv_data.geo[i].y = (enb_node_list->node->y_pos < 0.0) ? 0.0 : enb_node_list->node->y_pos;
omv_data.geo[i].z = 1.0;
omv_data.geo[i].mobility_type = oai_emulation.info.omg_model_enb;
omv_data.geo[i].node_type = 0; //eNB
enb_node_list = enb_node_list->next;
omv_data.geo[i].Neighbors = 0;
for (j = NB_eNB_INST; j < NB_UE_INST + NB_eNB_INST; j++) {
if (is_UE_active (i, j - NB_eNB_INST) == 1) {
omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j;
omv_data.geo[i].Neighbors++;
LOG_D(
OMG,
"[eNB %d][UE %d] is_UE_active(i,j) %d geo (x%d, y%d) num neighbors %d\n", i, j-NB_eNB_INST, is_UE_active(i,j-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors);
}
}
module_id_t i, j;
omv_data.end = 0;
//omv_data.total_num_nodes = NB_UE_INST + NB_eNB_INST;
for (i = 0; i < NB_eNB_INST; i++) {
if (enb_node_list != NULL) {
omv_data.geo[i].x = (enb_node_list->node->x_pos < 0.0) ? 0.0 : enb_node_list->node->x_pos;
omv_data.geo[i].y = (enb_node_list->node->y_pos < 0.0) ? 0.0 : enb_node_list->node->y_pos;
omv_data.geo[i].z = 1.0;
omv_data.geo[i].mobility_type = oai_emulation.info.omg_model_enb;
omv_data.geo[i].node_type = 0; //eNB
enb_node_list = enb_node_list->next;
omv_data.geo[i].Neighbors = 0;
for (j = NB_eNB_INST; j < NB_UE_INST + NB_eNB_INST; j++) {
if (is_UE_active (i, j - NB_eNB_INST) == 1) {
omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j;
omv_data.geo[i].Neighbors++;
LOG_D(
OMG,
"[eNB %d][UE %d] is_UE_active(i,j) %d geo (x%d, y%d) num neighbors %d\n", i, j-NB_eNB_INST, is_UE_active(i,j-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors);
}
}
}
}
}
for (i = NB_eNB_INST; i < NB_UE_INST + NB_eNB_INST; i++) {
if (ue_node_list != NULL) {
omv_data.geo[i].x = (ue_node_list->node->x_pos < 0.0) ? 0.0 : ue_node_list->node->x_pos;
omv_data.geo[i].y = (ue_node_list->node->y_pos < 0.0) ? 0.0 : ue_node_list->node->y_pos;
omv_data.geo[i].z = 1.0;
omv_data.geo[i].mobility_type = oai_emulation.info.omg_model_ue;
omv_data.geo[i].node_type = 1; //UE
//trial
omv_data.geo[i].state = 1;
omv_data.geo[i].rnti = 88;
omv_data.geo[i].connected_eNB = 0;
omv_data.geo[i].RSRP = 66;
omv_data.geo[i].RSRQ = 55;
omv_data.geo[i].Pathloss = 44;
omv_data.geo[i].RSSI[0] = 33;
omv_data.geo[i].RSSI[1] = 22;
if ((sizeof(omv_data.geo[0].RSSI) / sizeof(omv_data.geo[0].RSSI[0])) > 2)
{
omv_data.geo[i].RSSI[2] = 11;
}
ue_node_list = ue_node_list->next;
omv_data.geo[i].Neighbors = 0;
for (j = 0; j < NB_eNB_INST; j++) {
if (is_UE_active (j, i - NB_eNB_INST) == 1) {
omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j;
omv_data.geo[i].Neighbors++;
LOG_D(
OMG,
"[UE %d][eNB %d] is_UE_active %d geo (x%d, y%d) num neighbors %d\n", i-NB_eNB_INST, j, is_UE_active(j,i-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors);
}
}
for (i = NB_eNB_INST; i < NB_UE_INST + NB_eNB_INST; i++) {
if (ue_node_list != NULL) {
omv_data.geo[i].x = (ue_node_list->node->x_pos < 0.0) ? 0.0 : ue_node_list->node->x_pos;
omv_data.geo[i].y = (ue_node_list->node->y_pos < 0.0) ? 0.0 : ue_node_list->node->y_pos;
omv_data.geo[i].z = 1.0;
omv_data.geo[i].mobility_type = oai_emulation.info.omg_model_ue;
omv_data.geo[i].node_type = 1; //UE
//trial
omv_data.geo[i].state = 1;
omv_data.geo[i].rnti = 88;
omv_data.geo[i].connected_eNB = 0;
omv_data.geo[i].RSRP = 66;
omv_data.geo[i].RSRQ = 55;
omv_data.geo[i].Pathloss = 44;
omv_data.geo[i].RSSI[0] = 33;
omv_data.geo[i].RSSI[1] = 22;
if ((sizeof(omv_data.geo[0].RSSI) / sizeof(omv_data.geo[0].RSSI[0])) > 2)
{
omv_data.geo[i].RSSI[2] = 11;
}
ue_node_list = ue_node_list->next;
omv_data.geo[i].Neighbors = 0;
for (j = 0; j < NB_eNB_INST; j++) {
if (is_UE_active (j, i - NB_eNB_INST) == 1) {
omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j;
omv_data.geo[i].Neighbors++;
LOG_D(
OMG,
"[UE %d][eNB %d] is_UE_active %d geo (x%d, y%d) num neighbors %d\n", i-NB_eNB_INST, j, is_UE_active(j,i-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors);
}
}
}
}
}
LOG_E(OMG, "pfd %d \n", pfd);
if (write (pfd, &omv_data, sizeof(struct Data_Flow_Unit)) == -1)
LOG_E(OMG, "pfd %d \n", pfd);
if (write (pfd, &omv_data, sizeof(struct Data_Flow_Unit)) == -1)
perror ("write omv failed");
return 1;
return 1;
}
void omv_end(int pfd, Data_Flow_Unit omv_data) {
omv_data.end = 1;
if (write (pfd, &omv_data, sizeof(struct Data_Flow_Unit)) == -1)
omv_data.end = 1;
if (write (pfd, &omv_data, sizeof(struct Data_Flow_Unit)) == -1)
perror ("write omv failed");
}
#endif
......@@ -390,680 +386,783 @@ int pfd[2]; // fd for omv : fixme: this could be a local var
#ifdef OPENAIR2
static Data_Flow_Unit omv_data;
#endif //ALU
static module_id_t UE_inst = 0;
static module_id_t UE_inst = 0;
static module_id_t eNB_inst = 0;
#ifdef Rel10
static module_id_t RN_id = 0;
static module_id_t RN_id = 0;
#endif
Packet_OTG_List_t *otg_pdcp_buffer;
typedef enum l2l1_task_state_e
{
L2L1_WAITTING,
L2L1_RUNNING,
L2L1_TERMINATED,
} l2l1_task_state_t;
typedef enum l2l1_task_state_e {
L2L1_WAITTING, L2L1_RUNNING, L2L1_TERMINATED,
} l2l1_task_state_t;
l2l1_task_state_t l2l1_state = L2L1_WAITTING;
l2l1_task_state_t l2l1_state = L2L1_WAITTING;
/*------------------------------------------------------------------------------*/
void *l2l1_task(void *args_p) {
clock_t t;
int CC_id;
void *
l2l1_task (void *args_p) {
clock_t t;
int CC_id;
// Framing variables
int32_t slot, last_slot, next_slot;
// Framing variables
int32_t slot, last_slot, next_slot;
#ifdef Rel10
relaying_type_t r_type = no_relay; // no relaying
relaying_type_t r_type = no_relay; // no relaying
#endif
lte_subframe_t direction;
char fname[64], vname[64];
int sf;
lte_subframe_t direction;
char fname[64], vname[64];
int sf;
protocol_ctxt_t ctxt;
#ifdef XFORMS
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
// at eNB 0, an UL scope for every UE
FD_lte_phy_scope_ue *form_ue[NUMBER_OF_UE_MAX];
FD_lte_phy_scope_enb *form_enb[NUMBER_OF_UE_MAX];
char title[255];