Commit d8773fda authored by winckel's avatar winckel

Changed eNB configuration file reading position to update earlier physical parameters.

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5025 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 659786c3
...@@ -49,7 +49,6 @@ ...@@ -49,7 +49,6 @@
# endif # endif
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
extern char *g_conf_config_file_name;
#endif #endif
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
...@@ -185,11 +184,11 @@ void *eNB_app_task(void *args_p) ...@@ -185,11 +184,11 @@ void *eNB_app_task(void *args_p)
# endif # endif
# endif # endif
enb_properties = enb_config_init(g_conf_config_file_name); enb_properties = enb_config_get();
AssertFatal (enb_nb <= enb_properties->number, AssertFatal (enb_nb <= enb_properties->number,
"Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!", "Number of eNB is greater than eNB defined in configuration file (%d/%d)!",
g_conf_config_file_name, enb_nb, enb_properties->number); enb_nb, enb_properties->number);
for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++) for (enb_id = enb_id_start; (enb_id < enb_id_end) ; enb_id++)
{ {
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
#include "UTIL/OTG/otg_vars.h" #include "UTIL/OTG/otg_vars.h"
#include "UTIL/MATH/oml.h" #include "UTIL/MATH/oml.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "enb_config.h"
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface_init.h" # include "intertask_interface_init.h"
...@@ -166,7 +167,7 @@ u8 eNB_id=0; ...@@ -166,7 +167,7 @@ u8 eNB_id=0;
u32 carrier_freq_fdd[4]= {2680e6,0,0,0}; u32 carrier_freq_fdd[4]= {2680e6,0,0,0};
u32 carrier_freq_tdd[4]= {2590e6-4000,0,0,0}; u32 carrier_freq_tdd[4]= {2590e6-4000,0,0,0};
u32 carrier_freq[4]; u32 carrier_freq[4];
char *g_conf_config_file_name = NULL; static char *conf_config_file_name = NULL;
struct timing_info_t { struct timing_info_t {
//unsigned int frame, hw_slot, last_slot, next_slot; //unsigned int frame, hw_slot, last_slot, next_slot;
...@@ -636,6 +637,7 @@ static void *eNB_thread(void *arg) ...@@ -636,6 +637,7 @@ static void *eNB_thread(void *arg)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
const Enb_properties_array_t *enb_properties;
#ifdef RTAI #ifdef RTAI
RT_TASK *task; RT_TASK *task;
#endif #endif
...@@ -722,7 +724,7 @@ int main(int argc, char **argv) ...@@ -722,7 +724,7 @@ int main(int argc, char **argv)
#endif #endif
break; break;
case 'O': case 'O':
g_conf_config_file_name = optarg; conf_config_file_name = optarg;
break; break;
case 'R': case 'R':
N_RB_DL = atoi(optarg); N_RB_DL = atoi(optarg);
...@@ -743,6 +745,26 @@ int main(int argc, char **argv) ...@@ -743,6 +745,26 @@ int main(int argc, char **argv)
} }
} }
NB_eNB_INST=1;
NB_INST=1;
if ((UE_flag == 0) && (conf_config_file_name != NULL)) {
int i;
/* Read eNB configuration file */
enb_properties = enb_config_init(conf_config_file_name);
AssertFatal (NB_eNB_INST <= enb_properties->number,
"Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!",
conf_config_file_name, NB_eNB_INST, enb_properties->number);
/* Update some simulation parameters */
frame_type = enb_properties->properties[0]->frame_type;
for (i = 0 ; i < (sizeof(carrier_freq) / sizeof (carrier_freq[0])); i++) {
carrier_freq[i] = enb_properties->properties[0]->downlink_frequency;
}
}
set_taus_seed (0); set_taus_seed (0);
// initialize the log (see log.h for details) // initialize the log (see log.h for details)
...@@ -778,15 +800,16 @@ int main(int argc, char **argv) ...@@ -778,15 +800,16 @@ int main(int argc, char **argv)
Nid_cell, cooperation_flag, transmission_mode, abstraction_flag, Nid_cell, cooperation_flag, transmission_mode, abstraction_flag,
nb_antennas_rx,0); nb_antennas_rx,0);
g_log->log_component[HW].level = LOG_INFO; g_log->level = LOG_WARNING;
g_log->log_component[HW].level = LOG_WARNING;
g_log->log_component[HW].flag = LOG_LOW; g_log->log_component[HW].flag = LOG_LOW;
g_log->log_component[PHY].level = LOG_INFO; g_log->log_component[PHY].level = LOG_WARNING;
g_log->log_component[PHY].flag = LOG_LOW; g_log->log_component[PHY].flag = LOG_LOW;
g_log->log_component[MAC].level = LOG_INFO; g_log->log_component[MAC].level = LOG_INFO;
g_log->log_component[MAC].flag = LOG_LOW; g_log->log_component[MAC].flag = LOG_LOW;
g_log->log_component[RLC].level = LOG_INFO; g_log->log_component[RLC].level = LOG_WARNING;
g_log->log_component[RLC].flag = LOG_LOW; g_log->log_component[RLC].flag = LOG_LOW;
g_log->log_component[PDCP].level = LOG_INFO; g_log->log_component[PDCP].level = LOG_WARNING;
g_log->log_component[PDCP].flag = LOG_LOW; g_log->log_component[PDCP].flag = LOG_LOW;
g_log->log_component[RRC].level = LOG_INFO; g_log->log_component[RRC].level = LOG_INFO;
g_log->log_component[RRC].flag = LOG_LOW; g_log->log_component[RRC].flag = LOG_LOW;
...@@ -824,17 +847,11 @@ int main(int argc, char **argv) ...@@ -824,17 +847,11 @@ int main(int argc, char **argv)
} }
#endif #endif
NB_eNB_INST=1;
NB_INST=1;
openair_daq_vars.ue_dl_rb_alloc=0x1fff; openair_daq_vars.ue_dl_rb_alloc=0x1fff;
openair_daq_vars.target_ue_dl_mcs=16; openair_daq_vars.target_ue_dl_mcs=16;
openair_daq_vars.ue_ul_nb_rb=6; openair_daq_vars.ue_ul_nb_rb=6;
openair_daq_vars.target_ue_ul_mcs=9; openair_daq_vars.target_ue_ul_mcs=9;
// set eNB to max gain // set eNB to max gain
PHY_vars_eNB_g[0]->rx_total_gain_eNB_dB = rxg_max[0] + rxgain[0] - PHY_vars_eNB_g[0]->rx_total_gain_eNB_dB = rxg_max[0] + rxgain[0] -
30; //was measured at rxgain=30; 30; //was measured at rxgain=30;
......
...@@ -100,6 +100,7 @@ unsigned short config_frames[4] = {2,9,11,13}; ...@@ -100,6 +100,7 @@ unsigned short config_frames[4] = {2,9,11,13};
#include "UTIL/OTG/otg_vars.h" #include "UTIL/OTG/otg_vars.h"
#include "UTIL/MATH/oml.h" #include "UTIL/MATH/oml.h"
#include "UTIL/LOG/vcd_signal_dumper.h" #include "UTIL/LOG/vcd_signal_dumper.h"
#include "enb_config.h"
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface_init.h" # include "intertask_interface_init.h"
...@@ -167,8 +168,10 @@ int fs4_test=0; ...@@ -167,8 +168,10 @@ int fs4_test=0;
char UE_flag=0; char UE_flag=0;
u8 eNB_id=0,UE_id=0; u8 eNB_id=0,UE_id=0;
u32 carrier_freq[4]= {1907600000,1907600000,1907600000,1907600000}; u32 carrier_freq[4] = {1907600000,1907600000,1907600000,1907600000}; /* For UE! */
char *g_conf_config_file_name = NULL; u32 downlink_frequency[4] = {1907600000,1907600000,1907600000,1907600000};
s32 uplink_frequency_offset[4]= {-120000000,-120000000,-120000000,-120000000};
static char *conf_config_file_name = NULL;
struct timing_info_t { struct timing_info_t {
//unsigned int frame, hw_slot, last_slot, next_slot; //unsigned int frame, hw_slot, last_slot, next_slot;
...@@ -1013,6 +1016,7 @@ static void *UE_thread(void *arg) ...@@ -1013,6 +1016,7 @@ static void *UE_thread(void *arg)
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
const Enb_properties_array_t *enb_properties;
#ifdef RTAI #ifdef RTAI
// RT_TASK *task; // RT_TASK *task;
...@@ -1106,10 +1110,14 @@ int main(int argc, char **argv) { ...@@ -1106,10 +1110,14 @@ int main(int argc, char **argv) {
UE_flag = 1; UE_flag = 1;
break; break;
case 'C': case 'C':
carrier_freq[0] = atoi(optarg); downlink_frequency[0] = atoi(optarg);
carrier_freq[1] = atoi(optarg); downlink_frequency[1] = atoi(optarg);
carrier_freq[2] = atoi(optarg); downlink_frequency[2] = atoi(optarg);
carrier_freq[3] = atoi(optarg); downlink_frequency[3] = atoi(optarg);
carrier_freq[0] = downlink_frequency[0];
carrier_freq[1] = downlink_frequency[1];
carrier_freq[2] = downlink_frequency[2];
carrier_freq[3] = downlink_frequency[3];
break; break;
case 'S': case 'S':
fs4_test=1; fs4_test=1;
...@@ -1127,7 +1135,7 @@ int main(int argc, char **argv) { ...@@ -1127,7 +1135,7 @@ int main(int argc, char **argv) {
#endif #endif
break; break;
case 'O': case 'O':
g_conf_config_file_name = optarg; conf_config_file_name = optarg;
break; break;
case 'F': case 'F':
sprintf(rxg_fname,"%srxg.lime",optarg); sprintf(rxg_fname,"%srxg.lime",optarg);
...@@ -1214,6 +1222,28 @@ int main(int argc, char **argv) { ...@@ -1214,6 +1222,28 @@ int main(int argc, char **argv) {
} }
} }
frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
if ((UE_flag == 0) && (conf_config_file_name != NULL)) {
int i;
NB_eNB_INST = 1;
/* Read eNB configuration file */
enb_properties = enb_config_init(conf_config_file_name);
AssertFatal (NB_eNB_INST <= enb_properties->number,
"Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!",
conf_config_file_name, NB_eNB_INST, enb_properties->number);
/* Update some simulation parameters */
frame_parms->frame_type = enb_properties->properties[0]->frame_type;
for (i = 0 ; i < (sizeof(downlink_frequency) / sizeof (downlink_frequency[0])); i++) {
downlink_frequency[i] = enb_properties->properties[0]->downlink_frequency;
uplink_frequency_offset[i] = enb_properties->properties[0]->uplink_frequency_offset;
}
}
if (UE_flag==1) if (UE_flag==1)
printf("configuring for UE\n"); printf("configuring for UE\n");
else else
...@@ -1258,7 +1288,6 @@ int main(int argc, char **argv) { ...@@ -1258,7 +1288,6 @@ int main(int argc, char **argv) {
#endif #endif
// init the parameters // init the parameters
frame_parms = (LTE_DL_FRAME_PARMS*) malloc(sizeof(LTE_DL_FRAME_PARMS));
frame_parms->N_RB_DL = 25; frame_parms->N_RB_DL = 25;
frame_parms->N_RB_UL = 25; frame_parms->N_RB_UL = 25;
frame_parms->Ncp = 0; frame_parms->Ncp = 0;
...@@ -1288,7 +1317,6 @@ int main(int argc, char **argv) { ...@@ -1288,7 +1317,6 @@ int main(int argc, char **argv) {
} }
frame_parms->nb_antennas_tx_eNB = (transmission_mode == 1) ? 1 : 2; //initial value overwritten by initial sync later frame_parms->nb_antennas_tx_eNB = (transmission_mode == 1) ? 1 : 2; //initial value overwritten by initial sync later
frame_parms->mode1_flag = (transmission_mode == 1) ? 1 : 0; frame_parms->mode1_flag = (transmission_mode == 1) ? 1 : 0;
frame_parms->frame_type = 1;
frame_parms->tdd_config = 3; frame_parms->tdd_config = 3;
frame_parms->tdd_config_S = 0; frame_parms->tdd_config_S = 0;
frame_parms->phich_config_common.phich_resource = oneSixth; frame_parms->phich_config_common.phich_resource = oneSixth;
...@@ -1314,6 +1342,7 @@ int main(int argc, char **argv) { ...@@ -1314,6 +1342,7 @@ int main(int argc, char **argv) {
// prach_fmt = get_prach_fmt(frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, frame_parms->frame_type); // prach_fmt = get_prach_fmt(frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex, frame_parms->frame_type);
// N_ZC = (prach_fmt <4)?839:139; // N_ZC = (prach_fmt <4)?839:139;
g_log->level = LOG_WARNING;
if (UE_flag==1) { if (UE_flag==1) {
g_log->log_component[HW].level = LOG_DEBUG; g_log->log_component[HW].level = LOG_DEBUG;
g_log->log_component[HW].flag = LOG_HIGH; g_log->log_component[HW].flag = LOG_HIGH;
...@@ -1532,6 +1561,8 @@ int main(int argc, char **argv) { ...@@ -1532,6 +1561,8 @@ int main(int argc, char **argv) {
for (ant=max(frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);ant<4;ant++) { for (ant=max(frame_parms->nb_antennas_tx,frame_parms->nb_antennas_rx);ant<4;ant++) {
p_exmimo_config->rf.rf_mode[ant] = 0; p_exmimo_config->rf.rf_mode[ant] = 0;
carrier_freq[ant] = 0; //this turns off all other LIMEs carrier_freq[ant] = 0; //this turns off all other LIMEs
downlink_frequency[ant] = 0; //this turns off all other LIMEs
uplink_frequency_offset[ant] = 0;
} }
/* /*
...@@ -1545,26 +1576,42 @@ int main(int argc, char **argv) { ...@@ -1545,26 +1576,42 @@ int main(int argc, char **argv) {
} }
else { else {
p_exmimo_config->rf.rf_mode[ant] = 0; p_exmimo_config->rf.rf_mode[ant] = 0;
carrier_freq[ant] = 0; //this turns off all other LIMEs downlink_frequency[ant] = 0; //this turns off all other LIMEs
} }
} }
*/ */
for (ant = 0; ant<4; ant++) { for (ant = 0; ant<4; ant++) {
p_exmimo_config->rf.do_autocal[ant] = 1; p_exmimo_config->rf.do_autocal[ant] = 1;
p_exmimo_config->rf.rf_freq_rx[ant] = carrier_freq[ant]; if (UE_flag==0) {
p_exmimo_config->rf.rf_freq_tx[ant] = carrier_freq[ant]; /* eNB */
if (frame_parms->frame_type == FDD) {
p_exmimo_config->rf.rf_freq_rx[ant] = downlink_frequency[ant] + uplink_frequency_offset[ant];
} else {
p_exmimo_config->rf.rf_freq_rx[ant] = downlink_frequency[ant];
}
p_exmimo_config->rf.rf_freq_tx[ant] = downlink_frequency[ant];
} else {
/* UE */
p_exmimo_config->rf.rf_freq_rx[ant] = carrier_freq[ant];
if (frame_parms->frame_type == FDD) {
p_exmimo_config->rf.rf_freq_tx[ant] = carrier_freq[ant] + uplink_frequency_offset[ant];
} else {
p_exmimo_config->rf.rf_freq_tx[ant] = carrier_freq[ant];
}
}
p_exmimo_config->rf.rx_gain[ant][0] = rxgain[ant]; p_exmimo_config->rf.rx_gain[ant][0] = rxgain[ant];
p_exmimo_config->rf.tx_gain[ant][0] = txgain[ant]; p_exmimo_config->rf.tx_gain[ant][0] = txgain[ant];
p_exmimo_config->rf.rf_local[ant] = rf_local[ant]; p_exmimo_config->rf.rf_local[ant] = rf_local[ant];
p_exmimo_config->rf.rf_rxdc[ant] = rf_rxdc[ant]; p_exmimo_config->rf.rf_rxdc[ant] = rf_rxdc[ant];
if ((carrier_freq[ant] >= 850000000) && (carrier_freq[ant] <= 865000000)) { if ((downlink_frequency[ant] >= 850000000) && (downlink_frequency[ant] <= 865000000)) {
p_exmimo_config->rf.rf_vcocal[ant] = rf_vcocal_850[ant]; p_exmimo_config->rf.rf_vcocal[ant] = rf_vcocal_850[ant];
p_exmimo_config->rf.rffe_band_mode[ant] = DD_TDD; p_exmimo_config->rf.rffe_band_mode[ant] = DD_TDD;
} }
else if ((carrier_freq[ant] >= 1900000000) && (carrier_freq[ant] <= 2000000000)) { else if ((downlink_frequency[ant] >= 1900000000) && (downlink_frequency[ant] <= 2000000000)) {
p_exmimo_config->rf.rf_vcocal[ant] = rf_vcocal[ant]; p_exmimo_config->rf.rf_vcocal[ant] = rf_vcocal[ant];
p_exmimo_config->rf.rffe_band_mode[ant] = B19G_TDD; p_exmimo_config->rf.rffe_band_mode[ant] = B19G_TDD;
} }
...@@ -1579,7 +1626,6 @@ int main(int argc, char **argv) { ...@@ -1579,7 +1626,6 @@ int main(int argc, char **argv) {
p_exmimo_config->rf.rffe_gain_rxlow[ant] = 31; p_exmimo_config->rf.rffe_gain_rxlow[ant] = 31;
} }
dump_frame_parms(frame_parms); dump_frame_parms(frame_parms);
mac_xface = malloc(sizeof(MAC_xface)); mac_xface = malloc(sizeof(MAC_xface));
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <sys/timerfd.h> #include <sys/timerfd.h>
#include "assertions.h"
#include "oaisim_functions.h" #include "oaisim_functions.h"
#include "PHY/extern.h" #include "PHY/extern.h"
...@@ -29,6 +30,7 @@ ...@@ -29,6 +30,7 @@
#include "lteRALue.h" #include "lteRALue.h"
#include "cor_SF_sim.h" #include "cor_SF_sim.h"
#include "enb_config.h"
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
# include "intertask_interface.h" # include "intertask_interface.h"
...@@ -53,7 +55,7 @@ int otg_times = 0; ...@@ -53,7 +55,7 @@ int otg_times = 0;
int if_times = 0; int if_times = 0;
int for_times = 0; int for_times = 0;
char *g_conf_config_file_name = NULL; static char *conf_config_file_name = NULL;
u16 Nid_cell = 0; //needed by init_lte_vars u16 Nid_cell = 0; //needed by init_lte_vars
int nb_antennas_rx=2; // // int nb_antennas_rx=2; // //
u8 target_dl_mcs = 0; u8 target_dl_mcs = 0;
...@@ -168,14 +170,15 @@ static struct option long_options[] = { ...@@ -168,14 +170,15 @@ static struct option long_options[] = {
}; };
void get_simulation_options(int argc, char *argv[]) { void get_simulation_options(int argc, char *argv[]) {
int option; int option;
const Enb_properties_array_t *enb_properties;
while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:Q:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) { while ((option = getopt_long (argc, argv, "aA:b:B:c:C:D:d:eE:f:FGg:hHi:IJ:j:k:K:l:L:m:M:n:N:oO:p:P:Q:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) {
switch (option) { switch (option) {
case LONG_OPTION_ENB_CONF: case LONG_OPTION_ENB_CONF:
if (optarg) { if (optarg) {
g_conf_config_file_name = strdup(optarg); conf_config_file_name = strdup(optarg);
printf("eNB configuration file is %s\n", g_conf_config_file_name); printf("eNB configuration file is %s\n", conf_config_file_name);
} }
break; break;
...@@ -436,7 +439,7 @@ void get_simulation_options(int argc, char *argv[]) { ...@@ -436,7 +439,7 @@ void get_simulation_options(int argc, char *argv[]) {
break; break;
case 'O': case 'O':
g_conf_config_file_name = optarg; conf_config_file_name = optarg;
break; break;
case 'o': case 'o':
...@@ -586,6 +589,21 @@ void get_simulation_options(int argc, char *argv[]) { ...@@ -586,6 +589,21 @@ void get_simulation_options(int argc, char *argv[]) {
break; break;
} }
} }
if ((oai_emulation.info.nb_enb_local > 0) && (conf_config_file_name != NULL))
{
/* Read eNB configuration file */
enb_properties = enb_config_init(conf_config_file_name);
AssertFatal (oai_emulation.info.nb_enb_local <= enb_properties->number,
"Number of eNB is greater than eNB defined in configuration file %s (%d/%d)!",
conf_config_file_name, oai_emulation.info.nb_enb_local, enb_properties->number);
/* Update some simulation parameters */
oai_emulation.info.frame_type = enb_properties->properties[0]->frame_type;
oai_emulation.info.extended_prefix_flag = enb_properties->properties[0]->prefix_type;
}
} }
void check_and_adjust_params() { void check_and_adjust_params() {
......
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