full IF4p5 simulation working

This commit is contained in:
Raymond Knopp
2018-04-29 09:35:23 -07:00
parent 596736afae
commit ea784f2b4b
82 changed files with 711 additions and 849 deletions
+4 -1
View File
@@ -72,7 +72,10 @@
#include "PHY/phy_extern.h"
#include "LAYER2/MAC/mac_extern.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "SCHED/sched_eNB.h"
#include "PHY/LTE_ESTIMATION/lte_estimation.h"
#include "PHY/INIT/phy_init.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
+3 -1
View File
@@ -90,6 +90,8 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "create_tasks.h"
#endif
#include "PHY/INIT/phy_init.h"
#include "system.h"
#ifdef XFORMS
@@ -1092,7 +1094,7 @@ int main( int argc, char **argv )
// init UE_PF_PO and mutex lock
pthread_mutex_init(&ue_pf_po_mutex, NULL);
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*NUMBER_OF_UE_MAX*MAX_NUM_CCs);
memset (&UE_PF_PO[0][0], 0, sizeof(UE_PF_PO_t)*MAX_MOBILES_PER_ENB*MAX_NUM_CCs);
mlockall(MCL_CURRENT | MCL_FUTURE);
+9 -17
View File
@@ -26,32 +26,24 @@
#include <stdio.h>
#include <time.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
#include "PHY/phy_extern_ue.h"
#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log_if.h"
#include "UTIL/LOG/log_extern.h"
#include "RRC/LITE/extern.h"
#include "PHY_INTERFACE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface_extern.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OPT/opt.h" // to test OPT
#endif
#include "UTIL/FIFO/types.h"
#ifdef IFFT_FPGA
#include "PHY/LTE_REFSIG/mod_table.h"
#endif
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#ifdef XFORMS
#include "forms.h"
#include "phy_procedures_sim_form.h"
+52 -60
View File
@@ -41,24 +41,23 @@
#include <execinfo.h>
#include "event_handler.h"
#include "SIMULATION/RF/defs.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/LTE_TRANSPORT/proto.h"
#include "PHY/vars.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/LTE_TRANSPORT/transport_proto.h"
#include "PHY/LTE_UE_TRANSPORT/transport_proto_ue.h"
#include "PHY/phy_vars.h"
#include "PHY/phy_vars_ue.h"
#include "SCHED/sched_common_vars.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
//#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/proto.h"
#include "LAYER2/MAC/vars.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/MAC/mac_vars.h"
#include "pdcp.h"
#include "RRC/LITE/vars.h"
#include "RRC/LTE/rrc_vars.h"
#include "RRC/NAS/nas_config.h"
#include "SCHED/defs.h"
#include "SCHED/vars.h"
#include "system.h"
@@ -101,6 +100,7 @@ char smbv_ip[16];
#if defined(ENABLE_ITTI)
# include "intertask_interface.h"
# include "create_tasks.h"
# include "intertask_interface_init.h"
#endif
#include "T.h"
@@ -627,12 +627,8 @@ l2l1_task (void *args_p)
}
#endif
module_id_t UE_id;
if (abstraction_flag == 1) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
dl_phy_sync_success (UE_id, 0, 0,1); //UE_id%NB_eNB_INST);
}
start_meas (&oaisim_stats);
@@ -701,8 +697,8 @@ l2l1_task (void *args_p)
//oai_emulation.info.time_ms += 1;
oai_emulation.info.time_s += 0.01; // emu time in s, each frame lasts for 10 ms // JNote: TODO check the coherency of the time and frame (I corrected it to 10 (instead of 0.01)
update_omg (frame); // frequency is defined in the omg_global params configurable by the user
update_omg_ocm ();
//update_omg (frame); // frequency is defined in the omg_global params configurable by the user
//update_omg_ocm ();
#ifdef OPENAIR2
@@ -796,15 +792,6 @@ l2l1_task (void *args_p)
PHY_vars_eNB_g[eNB_inst][0]->frame_parms.Nid_cell);
*/
#ifdef OPENAIR2
//Application: traffic gen
update_otg_eNB (eNB_inst, oai_emulation.info.time_ms);
//IP/OTG to PDCP and PDCP to IP operation
// pdcp_run (frame, 1, 0, eNB_inst); //PHY_vars_eNB_g[eNB_id]->Mod_id
#endif
#ifdef PRINT_STATS
if((sf==9) && frame%10==0)
@@ -874,7 +861,7 @@ l2l1_task (void *args_p)
}
update_ocm ();
//update_ocm ();
/*
if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0)
#ifdef PROC
@@ -1110,6 +1097,7 @@ int main (int argc, char **argv)
oai_emulation.info.n_frames = MAX_FRAME_NUMBER; //1024; //10;
oai_emulation.info.n_frames_flag = 0; //fixme
snr_dB = 30;
NB_UE_INST = 1;
//Default values if not changed by the user in get_simulation_options();
pdcp_period = 1;
@@ -1126,7 +1114,7 @@ int main (int argc, char **argv)
// start thread for log gen
log_thread_init ();
init_oai_emulation (); // to initialize everything !!!
//init_oai_emulation (); // to initialize everything !!!
// get command-line options
get_simulation_options (argc, argv); //Command-line options
@@ -1163,7 +1151,37 @@ int main (int argc, char **argv)
#endif
// configure oaisim with OCG
oaisim_config (); // config OMG and OCG, OPT, OTG, OLG
//oaisim_config (); // config OMG and OCG, OPT, OTG, OLG
logInit();
#if defined(ENABLE_ITTI)
itti_init(TASK_MAX, THREAD_MAX, MESSAGES_ID_MAX, tasks_info, messages_info, messages_definition_xml, oai_emulation.info.itti_dump_file);
MSC_INIT(MSC_E_UTRAN, THREAD_MAX+TASK_MAX);
#endif
set_glog(LOG_INFO, 0x15);
//set_log(OCG, LOG_DEBUG, 1);
//set_log(EMU, LOG_INFO, 20);
set_log(MAC, LOG_DEBUG, 1);
set_log(RLC, LOG_TRACE, 1);
//set_log(PHY, LOG_DEBUG, 1);
set_log(PDCP, LOG_TRACE, 1);
set_log(RRC, LOG_DEBUG, 1);
//set_log(OCM, LOG_INFO, 20);
//set_log(OTG, LOG_INFO, 1);
set_comp_log(OCG, LOG_ERR, 0x15,1);
set_comp_log(EMU, LOG_DEBUG, 0x15,20);
set_comp_log(MAC, LOG_TRACE, 0x15,1);
set_comp_log(RLC, LOG_TRACE, 0x15,1);
set_comp_log(PHY, LOG_TRACE, 0x15, 1);
set_comp_log(PDCP, LOG_DEBUG, 0x15,1);
set_comp_log(RRC, LOG_DEBUG, 0x15,1);
set_comp_log(OCM, LOG_DEBUG, 0x15,20);
set_comp_log(OTG, LOG_DEBUG, 0x15,1);
set_comp_log(OMG, LOG_NOTICE, 0x15,1);
set_comp_log(OPT, LOG_ERR, 0x15,1);
if (ue_connection_test == 1) {
snr_direction = -snr_step;
@@ -1175,15 +1193,11 @@ int main (int argc, char **argv)
pthread_mutex_init(&sync_mutex, NULL);
pthread_mutex_init(&subframe_mutex, NULL);
#ifdef OPENAIR2
init_omv ();
#endif
//Before this call, NB_UE_INST and NB_eNB_INST are not set correctly
check_and_adjust_params ();
set_seed = oai_emulation.emulation_config.seed.value;
init_otg_pdcp_buffer ();
init_seed (set_seed);
@@ -1198,7 +1212,7 @@ int main (int argc, char **argv)
if (create_tasks_ue(oai_emulation.info.nb_ue_local) < 0)
if (create_tasks_ue(NB_UE_INST) < 0)
exit(-1); // need a softer mode
@@ -1211,6 +1225,7 @@ int main (int argc, char **argv)
init_ocm ();
printf("Sending sync to all threads\n");
@@ -1219,12 +1234,6 @@ int main (int argc, char **argv)
pthread_cond_broadcast(&sync_cond);
pthread_mutex_unlock(&sync_mutex);
#ifdef SMBV
// Rohde&Schwarz SMBV100A vector signal generator
smbv_init_config(smbv_fname, smbv_nframes);
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0][0]->frame_parms);
#endif
/* #if defined (FLEXRAN_AGENT_SB_IF)
flexran_agent_start();
#endif */
@@ -1733,11 +1742,6 @@ oai_shutdown (void)
#endif
//Perform KPI measurements
if (oai_emulation.info.otg_enabled == 1){
LOG_N(EMU,"calling OTG kpi gen .... \n");
kpi_gen ();
}
if (oai_emulation.info.opp_enabled == 1)
print_opp_meas_oaisim ();
@@ -1793,15 +1797,6 @@ oai_shutdown (void)
} //End of PHY abstraction changes
// stop OMG
stop_mobility_generator (omg_param_list); //omg_param_list.mobility_type
#ifdef OPENAIR2
if (oai_emulation.info.omv_enabled == 1)
omv_end (pfd[1], omv_data);
#endif
if ((oai_emulation.info.ocm_enabled == 1) && (ethernet_flag == 0)
&& (ShaF != NULL)) {
destroyMat (ShaF, map1, map2);
@@ -1811,9 +1806,6 @@ oai_shutdown (void)
if (opt_enabled == 1)
terminate_opt ();
if (oai_emulation.info.cli_enabled)
cli_server_cleanup ();
for (int i = 0; i < NUMBER_OF_eNB_MAX + NUMBER_OF_UE_MAX; i++)
if (oai_emulation.info.oai_ifup[i] == 1) {
char interfaceName[8];
+5 -4
View File
@@ -26,15 +26,16 @@
#include <stdio.h>
#include <time.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "oaisim_config.h"
#include "init_lte.h"
#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/mac.h"
#include "UTIL/OMV/structures.h"
#endif
+2 -4
View File
@@ -49,10 +49,8 @@ The current sturcture of oaisim is shown by the figure.
#include "UTIL/OPT/opt.h" // to test OPT
#include "UTIL/OMG/omg.h"
#include "UTIL/CLI/cli_if.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "SIMULATION/ETH_TRANSPORT/defs.h"
#include "PHY/defs.h"
#include "PHY/defs_eNB.h"
#include "PHY/phy_extern.h"
/** @defgroup _init_oai Initial oaisim
* @ingroup _fn
+54 -193
View File
@@ -43,29 +43,22 @@
#include "assertions.h"
#include "oaisim_functions.h"
#include "PHY/extern.h"
#include "LAYER2/MAC/extern.h"
#ifdef OPENAIR2
#include "LAYER2/MAC/proto.h"
#endif
#include "PHY/phy_extern.h"
#include "PHY/phy_extern_ue.h"
#include "LAYER2/MAC/mac_extern.h"
#include "LAYER2/MAC/mac_proto.h"
#include "LAYER2/PDCP_v10.1.0/pdcp.h"
#include "LAYER2/PDCP_v10.1.0/pdcp_primitives.h"
#include "RRC/LITE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "PHY_INTERFACE/extern.h"
#include "PHY_INTERFACE/phy_interface_extern.h"
//#include "ARCH/CBMIMO1/DEVICE_DRIVER/extern.h"
#include "SCHED/extern.h"
#include "SIMULATION/ETH_TRANSPORT/proto.h"
#include "UTIL/OCG/OCG_extern.h"
#include "UTIL/LOG/vcd_signal_dumper.h"
#include "UTIL/OPT/opt.h"
#include "UTIL/OTG/otg_config.h"
#include "UTIL/OTG/otg_tx.h"
#if ENABLE_RAL
#include "lteRALenb.h"
#include "lteRALue.h"
#endif
#include "cor_SF_sim.h"
#include "enb_config.h"
@@ -83,11 +76,6 @@
#include "ENB_APP/enb_paramdef.h"
#include "common/config/config_userapi.h"
#ifdef SMBV
extern uint8_t config_smbv;
extern char smbv_ip[16];
#endif
//constant for OAISIM soft realtime calibration
#define SF_DEVIATION_OFFSET_NS 100000 //= 0.1ms : should be as a number of UE
#define SLEEP_STEP_US 100 // = 0.01ms could be adaptive, should be as a number of UE
@@ -137,34 +125,14 @@ int sleep_time_us = 0;
int phy_test = 0;
#ifdef OPENAIR2
// omv related info
//pid_t omv_pid;
char full_name[200];
extern int pfd[2]; // fd for omv : fixme: this could be a local var
char fdstr[10];
char frames[10];
char num_enb[10];
char num_ue[10];
//area_x, area_y and area_z for omv
char x_area[20];
char y_area[20];
char z_area[20];
char nb_antenna[20];
char frame_type[10];
char tdd_config[10];
#endif
Packet_OTG_List_t *otg_pdcp_buffer = NULL;
extern node_desc_t *enb_data[NUMBER_OF_RU_MAX];
extern node_desc_t *ue_data[NUMBER_OF_UE_MAX];
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 node_desc_t *ue_data[MAX_MOBILES_PER_ENB];
extern channel_desc_t *RU2UE[NUMBER_OF_RU_MAX][MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
extern channel_desc_t *UE2RU[MAX_MOBILES_PER_ENB][NUMBER_OF_RU_MAX][MAX_NUM_CCs];
extern mapping small_scale_names[];
#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_ue[MAX_MOBILES_PER_ENB][maxServiceCount][maxSessionPerPMCH];
extern pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];
#endif
@@ -701,7 +669,7 @@ void get_simulation_options(int argc, char *argv[])
break;
case 'u':
oai_emulation.info.nb_ue_local = atoi (optarg);
NB_UE_INST = atoi (optarg);
break;
case 'U':
@@ -870,13 +838,13 @@ void check_and_adjust_params(void)
int32_t ret;
//int i,j;
if (oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local > NUMBER_OF_UE_MAX) {
LOG_E(EMU,"Enter fewer than %d UEs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_UE_MAX);
if (oai_emulation.info.nb_ue_local + oai_emulation.info.nb_rn_local > MAX_MOBILES_PER_ENB) {
LOG_E(EMU,"Enter fewer than %d UEs/RNs for the moment or change the MAX_MOBILES_PER_ENB\n", MAX_MOBILES_PER_ENB);
exit(EXIT_FAILURE);
}
if (oai_emulation.info.nb_enb_local + oai_emulation.info.nb_rn_local > NUMBER_OF_eNB_MAX) {
LOG_E(EMU,"Enter fewer than %d eNBs/RNs for the moment or change the NUMBER_OF_UE_MAX\n", NUMBER_OF_eNB_MAX);
LOG_E(EMU,"Enter fewer than %d eNBs/RNs for the moment or change the MAX_MOBILES_PER_ENB\n", NUMBER_OF_eNB_MAX);
exit(EXIT_FAILURE);
}
@@ -931,80 +899,15 @@ void check_and_adjust_params(void)
} // ethernet flag
*/
//
NB_UE_INST = oai_emulation.info.nb_ue_local + oai_emulation.info.nb_ue_remote;
NB_eNB_INST = oai_emulation.info.nb_enb_local + oai_emulation.info.nb_enb_remote;
NB_RN_INST = oai_emulation.info.nb_rn_local + oai_emulation.info.nb_rn_remote;
NB_RU = oai_emulation.info.nb_ru_local + oai_emulation.info.nb_ru_remote;
NB_RU = RC.nb_RU;
#if defined(PDCP_USE_NETLINK_QUEUES) && defined(OPENAIR2)
pdcp_netlink_init();
#endif
if (NB_RN_INST > 0 ) {
LOG_N(EMU,"Total number of RN %d (local %d, remote %d) mobility (the same as eNB) %s \n", NB_RN_INST,oai_emulation.info.nb_rn_local,oai_emulation.info.nb_rn_remote,
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
LOG_N(EMU,"Adjust the number of eNB inst (%d->%d) and UE inst (%d->%d)\n ",
NB_eNB_INST, NB_eNB_INST+NB_RN_INST,
NB_UE_INST, NB_UE_INST+NB_RN_INST);
NB_eNB_INST+=NB_RN_INST;
NB_UE_INST+=NB_RN_INST;
}
LOG_I(EMU,"Total number of UE %d (first local %d , num local %d, remote %d, relay %d) mobility %s \n",
NB_UE_INST,oai_emulation.info.first_ue_local, oai_emulation.info.nb_ue_local,oai_emulation.info.nb_ue_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.UE_mobility.UE_mobility_type.selected_option);
LOG_I(EMU,"Total number of eNB %d (local %d, remote %d, relay %d) mobility %s \n",
NB_eNB_INST,oai_emulation.info.nb_enb_local,oai_emulation.info.nb_enb_remote,
NB_RN_INST,
oai_emulation.topology_config.mobility.eNB_mobility.eNB_mobility_type.selected_option);
}
#ifdef OPENAIR2
void init_omv(void)
{
if (oai_emulation.info.omv_enabled == 1) {
if(pipe(pfd) == -1)
perror("pipe error \n");
snprintf( full_name, sizeof(full_name), "%s/UTIL/OMV/OMV",getenv("OPENAIR2_DIR") );
LOG_I(EMU,"Stating the OMV path %s pfd[0] %d pfd[1] %d \n", full_name, pfd[0],pfd[1]);
switch(fork()) {
case -1 :
perror("fork failed \n");
break;
case 0 : // child is going to be the omv, it is the reader
if(close(pfd[1]) == -1 ) // we close the write desc.
perror("close on write\n" );
sprintf(fdstr, "%d", pfd[0] );
sprintf(num_enb, "%d", NB_eNB_INST);
sprintf(num_ue, "%d", NB_UE_INST);
sprintf(x_area, "%f", oai_emulation.topology_config.area.x_m );
sprintf(y_area, "%f", oai_emulation.topology_config.area.y_m );
sprintf(z_area, "%f", 200.0 );
sprintf(frames, "%d", oai_emulation.info.n_frames);
sprintf(nb_antenna, "%d", 4);
sprintf(frame_type, "%s", (oai_emulation.info.frame_type[0] == 0) ? "FDD" : "TDD");
sprintf(tdd_config, "%d", oai_emulation.info.tdd_config[0]);
// execl is used to launch the visualisor
execl(full_name,"OMV", fdstr, frames, num_enb, num_ue, x_area, y_area, z_area, nb_antenna, frame_type, tdd_config,NULL );
perror( "error in execl the OMV" );
}
//parent
if(close( pfd[0] ) == -1 ) // we close the write desc.
perror("close on read\n" );
}
}
#endif
void init_seed(uint8_t set_seed)
{
@@ -1020,9 +923,9 @@ void init_seed(uint8_t set_seed)
}
openair0_timestamp current_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
openair0_timestamp current_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
openair0_timestamp current_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
openair0_timestamp last_ru_rx_timestamp[NUMBER_OF_RU_MAX][MAX_NUM_CCs];
openair0_timestamp last_UE_rx_timestamp[NUMBER_OF_UE_MAX][MAX_NUM_CCs];
openair0_timestamp last_UE_rx_timestamp[MAX_MOBILES_PER_ENB][MAX_NUM_CCs];
int ru_trx_start(openair0_device *device) {
return(0);
@@ -1369,63 +1272,16 @@ void init_ocm(void)
//char* frame_type = "unknown";
LTE_DL_FRAME_PARMS *fp = &RC.ru[0]->frame_parms;
#if 0
switch (fp->frame_type) {
case FDD:
frame_type = "FDD";
break;
case TDD:
frame_type = "TDD";
break;
}
#endif
if (abstraction_flag) {
get_beta_map();
get_MIESM_param();
//load_pbch_desc();
}
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
enb_data[ru_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
init_enb(enb_data[ru_id],oai_emulation.environment_system_config.antenna.eNB_antenna);
}
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
ue_data[UE_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
init_ue(ue_data[UE_id],oai_emulation.environment_system_config.antenna.UE_antenna);
}
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 ) &&
(oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m>0) &&
(oai_emulation.environment_system_config.fading.shadowing.variance_dB>0)) {
// init SF map here!!!
map1 =(int)oai_emulation.topology_config.area.x_m;
map2 =(int)oai_emulation.topology_config.area.y_m;
ShaF = init_SF(map1,map2,oai_emulation.environment_system_config.fading.shadowing.decorrelation_distance_m,oai_emulation.environment_system_config.fading.shadowing.variance_dB);
// size of area to generate shadow fading map
LOG_D(EMU,"Simulation area x=%f, y=%f\n",
oai_emulation.topology_config.area.x_m,
oai_emulation.topology_config.area.y_m);
}
if (abstraction_flag == 0)
init_channel_vars (fp, &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
init_channel_vars (fp, &s_re, &s_im, &r_re, &r_im, &r_re0, &r_im0);
// initialize channel descriptors
LOG_I(PHY,"Initializing channel descriptors (nb_RU %d, nb_UE %d)\n",RC.nb_RU,NB_UE_INST);
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
LOG_I(OCM,"Initializing channel (%s, %d) from RU %d to UE %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), ru_id, UE_id);
LOG_I(PHY,"Initializing channel descriptors (RU %d, UE %d) for N_RB_DL %d\n",ru_id,UE_id,
RC.ru[ru_id]->frame_parms.N_RB_DL);
RU2UE[ru_id][UE_id][CC_id] =
new_channel_desc_scm(RC.ru[ru_id]->nb_tx,
PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx,
@@ -1454,22 +1310,29 @@ void init_ocm(void)
// to make channel reciprocal uncomment following line instead of previous. However this only works for SISO at the moment. For MIMO the channel would need to be transposed.
//UE2RU[UE_id][ru_id] = RU2UE[ru_id][UE_id];
AssertFatal(RU2UE[ru_id][UE_id][CC_id]!=NULL,"RU2UE[%d][%d][%d] is null\n",ru_id,UE_id,CC_id);
AssertFatal(UE2RU[UE_id][ru_id][CC_id]!=NULL,"UE2RU[%d][%d][%d] is null\n",UE_id,ru_id,CC_id);
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
if (ru_id == (UE_id % RC.nb_RU)) {
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + snr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
} else {
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
UE2RU[UE_id][ru_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower;
}
LOG_D(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",ru_id,UE_id,CC_id,
RU2UE[ru_id][UE_id][CC_id]->path_loss_dB,
RC.ru[ru_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
}
}
}
}
void init_otg_pdcp_buffer(void)
{
module_id_t i;
otg_pdcp_buffer = malloc((NB_UE_INST + NB_eNB_INST) * sizeof(Packet_OTG_List_t));
for (i = 0; i < NB_UE_INST + NB_eNB_INST; i++) {
pkt_list_init(&(otg_pdcp_buffer[i]));
//LOG_I(EMU,"HEAD of otg_pdcp_buffer[%d] is %p\n", i, pkt_list_get_head(&(otg_pdcp_buffer[i])));
}
}
/*
void update_omg (frame_t frameP)
{
module_id_t UE_id, eNB_id;
@@ -1515,7 +1378,7 @@ void update_ocm()
/* check if the openair channel model is activated used for PHY abstraction : path loss*/
// check if the openair channel model is activated used for PHY abstraction : path loss
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 )) {
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++)
@@ -1533,9 +1396,6 @@ void update_ocm()
// if (oai_emulation.info.omg_model_ue == TRACE)
//extract_position(ue_node_list, ue_data, NB_UE_INST);
/* if (frame % 50 == 0)
LOG_N(OCM,"Path loss for TTI %d : \n", frame);
*/
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
for (ru_id = 0; ru_id < RC.nb_RU; ru_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
@@ -1550,10 +1410,10 @@ void update_ocm()
//dx = enb_data[ru_id]->x - ue_data[UE_id]->x;
//dy = enb_data[ru_id]->y - ue_data[UE_id]->y;
//distance = sqrt(dx * dx + dy * dy);
/*LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
ru_id, enb_data[ru_id]->x,enb_data[ru_id]->y,
UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
distance);*/
///LOG_D(LOCALIZE, " OCM distance between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f \n",
// ru_id, enb_data[ru_id]->x,enb_data[ru_id]->y,
// UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
// distance);
}
}
}
@@ -1585,6 +1445,7 @@ void update_ocm()
}
}
#ifdef OPENAIR2
void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
{
@@ -1592,13 +1453,12 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
#if defined(USER_MODE) && defined(OAI_EMU)
//int rrc_state=0;
/*
if (oai_emulation.info.otg_enabled ==1 ) {
int dst_id, app_id;
Packet_otg_elt_t *otg_pkt;
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
for (dst_id = 0; dst_id < MAX_MOBILES_PER_ENB; dst_id++) {
for_times += 1;
// generate traffic if the ue is rrc reconfigured state
@@ -1663,9 +1523,9 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
otg_pkt=NULL;
}
*/
// old version
/* // MBSM multicast traffic
// MBSM multicast traffic
#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
@@ -1688,15 +1548,15 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
}
} // end multicast traffic
#endif
*/
/*
}
}
}
} // end multicast traffic
*/
#endif
}
@@ -1706,7 +1566,7 @@ void update_otg_eNB(module_id_t enb_module_idP, unsigned int ctime)
if (otg_enabled==1) {
ctime = frame * 100;
for (dst_id = 0; dst_id < NUMBER_OF_UE_MAX; dst_id++) {
for (dst_id = 0; dst_id < MAX_MOBILES_PER_ENB; dst_id++) {
if (mac_get_rrc_status(eNB_index, eNB_flag, dst_id ) > 2) {
otg_pkt = malloc (sizeof(Packet_otg_elt_t));
(otg_pkt->otg_pkt).sdu_buffer = packet_gen(module_instP, dst_id, ctime, &pkt_size);
@@ -1735,6 +1595,7 @@ void update_otg_UE(module_id_t ue_mod_idP, unsigned int ctime)
{
}
#endif
*/
int init_slot_isr(void)
{
+9 -10
View File
@@ -27,27 +27,26 @@
#include <time.h>
#include <cblas.h>
#include "SIMULATION/TOOLS/defs.h"
#include "SIMULATION/RF/defs.h"
#include "SIMULATION/TOOLS/sim.h"
#include "SIMULATION/RF/rf.h"
#include "PHY/types.h"
#include "PHY/defs.h"
#include "PHY/extern.h"
#include "PHY/defs_eNB.h"
#include "PHY/defs_UE.h"
#include "PHY/phy_extern.h"
#include "oaisim_config.h"
#ifdef OPENAIR2
#include "LAYER2/MAC/defs.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/mac.h"
#include "LAYER2/MAC/mac_extern.h"
#include "UTIL/LOG/log_if.h"
#include "UTIL/LOG/log_extern.h"
#include "RRC/LITE/extern.h"
#include "PHY_INTERFACE/extern.h"
#include "RRC/LTE/rrc_extern.h"
#include "PHY_INTERFACE/phy_interface_extern.h"
#include "UTIL/OCG/OCG.h"
#include "UTIL/OMG/omg.h"
#include "UTIL/OPT/opt.h" // to test OPT
#endif
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#include "oaisim.h"