Commit ee3d4064 authored by Navid Nikaein's avatar Navid Nikaein

* add some functions for terminal localizations

* fix few issues with the pre-ci tests



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6253 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 80eca142
......@@ -42,6 +42,7 @@
#include "PHY/defs.h"
#include "dci.h"
#include "uci.h"
#include "UTIL/LISTS/list.h"
#define MOD_TABLE_QPSK_OFFSET 1
#define MOD_TABLE_16QAM_OFFSET 5
......@@ -470,6 +471,14 @@ typedef struct {
uint8_t num_active_cba_groups;
/// allocated CBA RNTI for this ulsch
uint16_t cba_rnti[4];//NUM_MAX_CBA_GROUP];
#ifdef LOCALIZATION
/// epoch timestamp in millisecond
int32_t reference_timestamp_ms;
/// aggregate physical states every n millisecond
int32_t aggregation_period_ms;
/// a set of lists used for localization
struct list loc_rss_list, loc_rssi_list, loc_subcarrier_rss_list, loc_timing_advance_list, loc_timing_update_list;
#endif
} LTE_eNB_ULSCH_t;
typedef struct {
......@@ -531,6 +540,12 @@ typedef struct {
uint8_t dl_power_off;
} LTE_DL_UE_HARQ_t;
typedef struct {
/// time-based localization, relying on TA and TOA
double time_based;
/// power-based localization, relying on RSS and RSSI
double power_based;
} eNB_UE_estimated_distances;
typedef struct {
/// UL RSSI per receive antenna
......@@ -555,7 +570,7 @@ typedef struct {
UE_MODE_t mode;
/// Current sector where UE is attached
uint8_t sector;
/// dlsch l2 errors
uint32_t dlsch_l2_errors[8];
/// dlsch trials per harq and round
......@@ -595,6 +610,10 @@ typedef struct {
/// Bitrate on the PDSCH [bps]
unsigned int dlsch_bitrate;
// unsigned int total_transmitted_bits;
#ifdef LOCALIZATION
eNB_UE_estimated_distances distance;
int32_t *subcarrier_rssi;
#endif
} LTE_eNB_UE_stats;
typedef struct {
......
......@@ -1326,14 +1326,20 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
eNB_pusch_vars->ulsch_power_0[i] = signal_energy(eNB_pusch_vars->drs_ch_estimates_0[eNB_id][i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
eNB_pusch_vars->ulsch_power_1[i] = signal_energy(eNB_pusch_vars->drs_ch_estimates_1[eNB_id][i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
}
}
else
{
for (i=0;i<frame_parms->nb_antennas_rx;i++)
for (i=0;i<frame_parms->nb_antennas_rx;i++) {
eNB_pusch_vars->ulsch_power[i] = signal_energy_nodc(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12)*rx_power_correction;
#ifdef LOCALIZATION
eNB_pusch_vars->subcarrier_power = (int32_t *)malloc(ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12*sizeof(int32_t));
eNB_pusch_vars->active_subcarrier = subcarrier_energy(eNB_pusch_vars->drs_ch_estimates[eNB_id][i],
ulsch[UE_id]->harq_processes[harq_pid]->nb_rb*12, eNB_pusch_vars->subcarrier_power, rx_power_correction);
#endif
}
}
//write_output("rxdataF_ext.m","rxF_ext",eNB_pusch_vars->rxdataF_ext[eNB_id][0],300*(frame_parms->symbols_per_tti-ulsch[UE_id]->srs_active),1,1);
......
......@@ -486,6 +486,13 @@ void mmxcopy(void *dest,void *src,int size);
*/
int32_t signal_energy(int32_t *,uint32_t);
#ifdef LOCALIZATION
/*!\fn int32_t signal_energy(int *,uint32_t);
\brief Computes the signal energy per subcarrier
*/
int32_t subcarrier_energy(int32_t *,uint32_t, int32_t* subcarrier_energy, uint16_t rx_power_correction);
#endif
/*!\fn int32_t signal_energy_nodc(int32_t *,uint32_t);
\brief Computes the signal energy per subcarrier, without DC removal
*/
......
......@@ -41,6 +41,36 @@
#ifndef EXPRESSMIMO_TARGET
#ifdef LOCALIZATION
int32_t subcarrier_energy(int32_t *input,uint32_t length, int32_t *subcarrier_energy, uint16_t rx_power_correction) {
int32_t i, subcarrier_pwr;
register __m64 mm0,mm1, subcarrier;
subcarrier = _m_pxor(subcarrier,subcarrier);
__m64 *in = (__m64 *)input;
#ifdef MAIN
int16_t *printb;
#endif
mm0 = _m_pxor(mm0,mm0);
for (i=0;i<length>>1;i++) {
mm1 = in[i];
mm1 = _m_pmaddwd(mm1,mm1);
mm1 = _m_psradi(mm1,shift);// shift any 32 bits blocs of the word by the value shift
subcarrier = mm1;
subcarrier = _m_psrlqi(subcarrier,32);
subcarrier = _m_paddd(subcarrier,mm1);
subcarrier_pwr = _m_to_int(subcarrier);
subcarrier_pwr<<=shift;
subcarrier_pwr = (unsigned short) dB_fixed(subcarrier_pwr);
subcarrier_energy[i] = subcarrier_pwr*rx_power_correction;
}
return i;
}
#endif
int32_t signal_energy(int32_t *input,uint32_t length) {
int32_t i;
......
......@@ -336,6 +336,11 @@ typedef struct PHY_VARS_eNB_s{
time_stats_t ulsch_tc_intl1_stats;
time_stats_t ulsch_tc_intl2_stats;
#ifdef LOCALIZATION
/// time state for localization
time_stats_t localization_stats;
#endif
#if defined(ENABLE_RAL)
hash_table_t *ral_thresholds_timed;
SLIST_HEAD(ral_thresholds_gen_poll_enb_s, ral_threshold_phy_t) ral_thresholds_gen_polled[RAL_LINK_PARAM_GEN_MAX];
......
......@@ -602,6 +602,12 @@ typedef struct{
int ulsch_power_1[2];
/// llr values
int16_t *llr;
#ifdef LOCALIZATION
/// number of active subcarrier for a specific UE
int32_t active_subcarrier;
/// subcarrier power in dBm
int32_t *subcarrier_power;
#endif
} LTE_eNB_PUSCH;
typedef struct {
......
......@@ -519,6 +519,17 @@ void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,u
int8_t get_PHR(uint8_t Mod_id, uint8_t CC_id, uint8_t eNB_index);
#ifdef LOCALIZATION
/** \brief This function collects eNB_UE stats and aggregate them in lists for localization
@param phy_vars_ue PHY variables
@param UE_id Index of UE
@param frame Index of frame
@param subframe Index of subframe
@param UE_tx_power_dB estimated UE Tx power
@returns -1 if updated list, 0 if calculated median
*/
double aggregate_eNB_UE_localization_stats(PHY_VARS_eNB *phy_vars_eNB, int8_t UE_id, frame_t frameP, sub_frame_t subframeP, int32_t UE_tx_power_dB);
#endif
LTE_eNB_UE_stats* get_eNB_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti);
LTE_DL_FRAME_PARMS *get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id);
......@@ -527,7 +538,7 @@ MU_MIMO_mode* get_mu_mimo_mode (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
int16_t get_hundred_times_delta_IF(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t harq_pid);
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid);
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor);
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
......
......@@ -44,6 +44,9 @@
#include "SCHED/defs.h"
#include "SCHED/extern.h"
#ifdef LOCALIZATION
#include <sys/time.h>
#endif
void get_Msg3_alloc(LTE_DL_FRAME_PARMS *frame_parms,
unsigned char current_subframe,
......@@ -548,6 +551,148 @@ unsigned int is_phich_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsigned char sub
}
#ifdef LOCALIZATION
double aggregate_eNB_UE_localization_stats(PHY_VARS_eNB *phy_vars_eNB, int8_t UE_id, frame_t frame, sub_frame_t subframe, int32_t UE_tx_power_dB){
// parameters declaration
int8_t Mod_id, CC_id;
int32_t harq_pid, avg_power, avg_rssi, median_power, median_rssi, median_subcarrier_rss, median_TA, median_TA_update, ref_timestamp_ms, current_timestamp_ms;
char cqis[100], sub_powers[2048];
int len = 0, i;
struct timeval ts;
double sys_bw = 0;
uint8_t N_RB_DL;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
Mod_id = phy_vars_eNB->Mod_id;
CC_id = phy_vars_eNB->CC_id;
ref_timestamp_ms = phy_vars_eNB->ulsch_eNB[UE_id+1]->reference_timestamp_ms;
for (i=0;i<13;i++) {
len += sprintf(&cqis[len]," %d ", phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].DL_subband_cqi[0][i]);
}
len = 0;
for (i=0;i<phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->active_subcarrier;i++) {
len += sprintf(&sub_powers[len]," %d ", phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->subcarrier_power[i]);
}
gettimeofday(&ts, NULL);
current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
LOG_F(LOCALIZE, "PHY: [UE %x/%d -> eNB %d], timestamp %d, "
"frame %d, subframe %d"
"UE Tx power %d dBm, "
"RSSI ant1 %d dBm, "
"RSSI ant2 %d dBm, "
"pwr ant1 %d dBm, "
"pwr ant2 %d dBm, "
"Rx gain %d dBm, "
"TA %d, "
"TA update %d, "
"DL_CQI (%d,%d), "
"Wideband CQI (%d,%d), "
"DL Subband CQI[13] %s \n"
"timestamp %d, (%d active subcarrier) %s \n"
,phy_vars_eNB->dlsch_eNB[(uint32_t)UE_id][0]->rnti, UE_id, Mod_id, current_timestamp_ms,
frame,subframe,
UE_tx_power_dB,
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UL_rssi[0],
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UL_rssi[1],
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->ulsch_power[0]),
dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->ulsch_power[1]),
phy_vars_eNB->rx_total_gain_eNB_dB,
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset, // raw timing advance 1/sampling rate
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].timing_advance_update,
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].DL_cqi[0],phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].DL_cqi[1],
phy_vars_eNB->PHY_measurements_eNB[Mod_id].wideband_cqi_dB[(uint32_t)UE_id][0],
phy_vars_eNB->PHY_measurements_eNB[Mod_id].wideband_cqi_dB[(uint32_t)UE_id][1],
cqis,
current_timestamp_ms,
phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->active_subcarrier,
sub_powers);
N_RB_DL = frame_parms->N_RB_DL;
switch (N_RB_DL)
{
case 6:
sys_bw = 1.92;
break;
case 25:
sys_bw = 7.68;
break;
case 50:
sys_bw = 15.36;
break;
case 100:
sys_bw = 30.72;
break;
}
if ((current_timestamp_ms - ref_timestamp_ms > phy_vars_eNB->ulsch_eNB[UE_id+1]->aggregation_period_ms) &&
(phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rss_list.size != 0)) {
// check the size of one list to be sure there was a message transmitted during the defined aggregation period
median_power = calculate_median(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rss_list);
del(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rss_list);
median_rssi = calculate_median(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rssi_list);
del(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rssi_list);
median_subcarrier_rss = calculate_median(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_subcarrier_rss_list);
del(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_subcarrier_rss_list);
median_TA = calculate_median(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_advance_list);
del(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_advance_list);
median_TA_update = calculate_median(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_update_list);
del(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_update_list);
double alpha = 2, power_distance, time_distance;
power_distance = pow(10, ((UE_tx_power_dB - (median_subcarrier_rss - phy_vars_eNB->rx_total_gain_eNB_dB))/(20.0*alpha)));
time_distance = (double) 299792458*(phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset)/(sys_bw*1000000);
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].distance.time_based = time_distance;
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].distance.power_based = power_distance;
LOG_D(LOCALIZE, " PHY [UE %x/%d -> eNB %d], timestamp %d, "
"frame %d, subframe %d "
"UE Tx power %d dBm, "
"median RSSI %d dBm, "
"median Power %d dBm, "
"Rx gain %d dBm, "
"power estimated r = %0.3f, "
" TA %d, update %d "
"TA estimated r = %0.3f\n"
,phy_vars_eNB->dlsch_eNB[(uint32_t)UE_id][0]->rnti, UE_id, Mod_id, current_timestamp_ms,
frame, subframe,
UE_tx_power_dB,
median_rssi,
median_power,
phy_vars_eNB->rx_total_gain_eNB_dB,
power_distance,
phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset, median_TA_update,
time_distance);
initialize(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rss_list);
initialize(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_subcarrier_rss_list);
initialize(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rssi_list);
initialize(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_advance_list);
initialize(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_update_list);
// make the reference timestamp == current timestamp
phy_vars_eNB->ulsch_eNB[UE_id+1]->reference_timestamp_ms = current_timestamp_ms;
return 0;
}
else {
avg_power = (dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->ulsch_power[0]) + dB_fixed(phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->ulsch_power[1]))/2;
avg_rssi = (phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UL_rssi[0] + phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UL_rssi[1])/2;
push_front(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rss_list,avg_power);
push_front(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_rssi_list,avg_rssi);
for (i=0;i<phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->active_subcarrier;i++) {
push_front(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_subcarrier_rss_list, phy_vars_eNB->lte_eNB_pusch_vars[(uint32_t)UE_id]->subcarrier_power[i]);
}
push_front(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_advance_list, phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].UE_timing_offset);
push_front(&phy_vars_eNB->ulsch_eNB[UE_id+1]->loc_timing_update_list, phy_vars_eNB->eNB_UE_stats[(uint32_t)UE_id].timing_advance_update);
return -1;
}
}
#endif
LTE_eNB_UE_stats* get_eNB_UE_stats(uint8_t Mod_id, uint8_t CC_id,uint16_t rnti) {
int8_t UE_id;
if ((PHY_vars_eNB_g == NULL) || (PHY_vars_eNB_g[Mod_id] == NULL) || (PHY_vars_eNB_g[Mod_id][CC_id]==NULL)) {
......
......@@ -2974,7 +2974,7 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
//compute the expected ULSCH RX power (for the stats)
phy_vars_eNB->ulsch_eNB[(uint32_t)i]->harq_processes[harq_pid]->delta_TF =
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid);
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0); // 0 means bw_factor is not considered
//dump_ulsch(phy_vars_eNB, sched_subframe, i);
......@@ -3125,7 +3125,7 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
phy_vars_eNB->lte_frame_parms.ofdm_symbol_size) -
phy_vars_eNB->rx_total_gain_eNB_dB -
hundred_times_log10_NPRB[phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->nb_rb-1]/100 -
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid)/100;
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 0)/100;
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active = 1;
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_ACK = 1;
......@@ -3226,6 +3226,16 @@ void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
LOG_D(PHY,"[eNB][Auto-Calibration] Frame %d, Subframe %d : ULSCH PDU (RX) %d bytes\n",phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3);
}
*/
#ifdef LOCALIZATION
start_meas(&phy_vars_eNB->localization_stats);
aggregate_eNB_UE_localization_stats(phy_vars_eNB,
i,
frame,
subframe,
get_hundred_times_delta_IF_eNB(phy_vars_eNB,i,harq_pid, 1)/100);
stop_meas(&phy_vars_eNB->localization_stats);
#endif
#endif
}
......
......@@ -45,8 +45,9 @@
// This is the formula from Section 5.1.1.1 in 36.213 100*10*log10((2^(MPR*Ks)-1)), where MPR is in the range [0,6] and Ks=1.25
int16_t hundred_times_delta_TF[100] = {-32768,-1268,-956,-768,-631,-523,-431,-352,-282,-219,-161,-107,-57,-9,36,79,120,159,197,234,269,304,337,370,402,434,465,495,525,555,583,612,640,668,696,723,750,777,803,829,856,881,907,933,958,983,1008,1033,1058,1083,1108,1132,1157,1181,1205,1229,1254,1278,1302,1325,1349,1373,1397,1421,1444,1468,1491,1515,1538,1562,1585,1609,1632,1655,1679,1702,1725,1748,1772,1795,1818,1841,1864,1887,1910,1933,1956,1980,2003,2026,2049,2072,2095,2118,2141,2164,2186,2209,2232,2255};
uint16_t hundred_times_log10_NPRB[100] = {0,301,477,602,698,778,845,903,954,1000,1041,1079,1113,1146,1176,1204,1230,1255,1278,1301,1322,1342,1361,1380,1397,1414,1431,1447,1462,1477,1491,1505,1518,1531,1544,1556,1568,1579,1591,1602,1612,1623,1633,1643,1653,1662,1672,1681,1690,1698,1707,1716,1724,1732,1740,1748,1755,1763,1770,1778,1785,1792,1799,1806,1812,1819,1826,1832,1838,1845,1851,1857,1863,1869,1875,1880,1886,1892,1897,1903,1908,1913,1919,1924,1929,1934,1939,1944,1949,1954,1959,1963,1968,1973,1977,1982,1986,1991,1995,2000};
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid) {
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor) {
uint32_t Nre,sumKr,MPR_x100,Kr,r;
uint16_t beta_offset_pusch;
......@@ -75,7 +76,12 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,
if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3));
if (bw_factor == 1) {
uint8_t nb_rb = phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb;
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3)) + hundred_times_log10_NPRB[nb_rb-1];
}
else
return(hundred_times_delta_TF[MPR_x100/6]+10*dB_fixed_times10((beta_offset_pusch)>>3));
}
else {
return(0);
......@@ -83,7 +89,7 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,
}
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid) {
return get_hundred_times_delta_IF_eNB(PHY_vars_eNB_g[module_idP][CC_id],find_ue(rnti,PHY_vars_eNB_g[module_idP][CC_id]),harq_pid);
return get_hundred_times_delta_IF_eNB(PHY_vars_eNB_g[module_idP][CC_id],find_ue(rnti,PHY_vars_eNB_g[module_idP][CC_id]),harq_pid, 0);
}
int16_t get_hundred_times_delta_IF(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t harq_pid) {
......@@ -110,7 +116,6 @@ int16_t get_hundred_times_delta_IF(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8
}
}
uint16_t hundred_times_log10_NPRB[100] = {0,301,477,602,698,778,845,903,954,1000,1041,1079,1113,1146,1176,1204,1230,1255,1278,1301,1322,1342,1361,1380,1397,1414,1431,1447,1462,1477,1491,1505,1518,1531,1544,1556,1568,1579,1591,1602,1612,1623,1633,1643,1653,1662,1672,1681,1690,1698,1707,1716,1724,1732,1740,1748,1755,1763,1770,1778,1785,1792,1799,1806,1812,1819,1826,1832,1838,1845,1851,1857,1863,1869,1875,1880,1886,1892,1897,1903,1908,1913,1919,1924,1929,1934,1939,1944,1949,1954,1959,1963,1968,1973,1977,1982,1986,1991,1995,2000};
uint8_t alpha_lut[8] = {0,40,50,60,70,80,90,100};
......
......@@ -362,6 +362,7 @@ typedef struct{ //RRC_INTERFACE_FUNCTIONS
void (*rrc_data_indP) (module_id_t , rb_id_t , sdu_size_t , char*);
void (*fn_rrc) (void);
uint8_t (*get_rrc_status)(uint8_t Mod_id,uint8_t eNB_flag,uint8_t eNB_index);
double (*rrc_get_estimated_ue_distance) (module_id_t Mod_id, uint8_t UE_id, uint8_t CC_id, uint8_t loc_type);
}RRC_XFACE;
......
......@@ -468,3 +468,36 @@ int rrc_mac_config_req(module_id_t Mod_id, eNB_flag_t eNB_flagP,uint8_t UE_id,ui
return(0);
}
#ifdef LOCALIZATION
double
rrc_get_estimated_ue_distance(module_id_t Mod_id, const frame_t frameP, uint8_t UE_id, int CC_id, uint8_t loc_type){
// localization types:
// 0: power based
// 1: time based
LTE_eNB_UE_stats *eNB_UE_stats = NULL;
UE_list_t *UE_list = &eNB_mac_inst[Mod_id].UE_list;
int pCCid;
uint16_t rnti;
//for (UE_id=UE_list->head;UE_id>=0;UE_id=UE_list->next[UE_id]) {
pCCid = UE_PCCID(Mod_id,UE_id);
rnti = UE_list->UE_template[pCCid][UE_id].rnti;
if(rnti == 0)
return -1;
eNB_UE_stats = mac_xface->get_eNB_UE_stats(Mod_id,pCCid,rnti);
switch (loc_type) {
case 0:
return eNB_UE_stats->distance.power_based;
break;
case 1:
return eNB_UE_stats->distance.time_based;
break;
default:
return eNB_UE_stats->distance.power_based;
}
// LOG_D(LOCALIZE, "DEBUG ME, dist = %d\n", &eNB_mac_inst[Mod_id].UE_list.UE_template[CC_id][UE_id].distance.power_based);
}
#endif
......@@ -567,6 +567,12 @@ typedef struct{
uint32_t ul_buffer_info[MAX_NUM_LCGID];
/// UE tx power
int32_t ue_tx_power;
#ifdef LOCALIZATION
eNB_UE_estimated_distances distance;
#endif
} UE_TEMPLATE;
typedef struct{
......@@ -919,91 +925,7 @@ typedef struct {
uint8_t n_adj_cells;
} neigh_cell_id_t;
/* \brief Generate header for DL-SCH. This function parses the desired control elements and sdus and generates the header as described
in 36-321 MAC layer specifications. It returns the number of bytes used for the header to be used as an offset for the payload
in the DLSCH buffer.
@param mac_header Pointer to the first byte of the MAC header (DL-SCH buffer)
@param num_sdus Number of SDUs in the payload
@param sdu_lengths Pointer to array of SDU lengths
@param sdu_lcids Pointer to array of LCIDs (the order must be the same as the SDU length array)
@param drx_cmd dicontinous reception command
@param timing_advancd_cmd timing advanced command
@param ue_cont_res_id Pointer to contention resolution identifier (NULL means not present in payload)
@param short_padding Number of bytes for short padding (0,1,2)
@param post_padding number of bytes for padding at the end of MAC PDU
@returns Number of bytes used for header
*/
unsigned char generate_dlsch_header(unsigned char *mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char drx_cmd,
short timing_advance_cmd,
unsigned char *ue_cont_res_id,
unsigned char short_padding,
unsigned short post_padding);
/** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of eNB
@param eNB_flag Indicates if this is a eNB or UE configuration
@param UE_id Index of UE if this is an eNB configuration
@param eNB_id Index of eNB if this is a UE configuration
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
@param measObj Structure from RRCConnectionReconfiguration for UE measurement procedures
@param mac_MainConfig Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated MAC parameters (if NULL keep existing configuration)
@param logicalChannelIdentity Logical channel identity index of corresponding logical channel config
@param logicalChannelConfig Pointer to logical channel configuration
@param measGapConfig Measurement Gap configuration for MAC (if NULL keep existing configuration)
@param tdd_Config TDD Configuration from SIB1 (if NULL keep existing configuration)
@param mobilityControlInfo mobility control info received for Handover
@param SIwindowsize SI Windowsize from SIB1 (if NULL keep existing configuration)
@param SIperiod SI Period from SIB1 (if NULL keep existing configuration)
@param MBMS_Flag indicates MBMS transmission
@param mbsfn_SubframeConfigList pointer to mbsfn subframe configuration list from SIB2
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
*/
int rrc_mac_config_req(module_id_t module_idP,
eNB_flag_t eNB_flag,
uint8_t UE_id,
uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
#ifdef Rel10
SCellToAddMod_r10_t *sCellToAddMod_r10,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
MeasObjectToAddMod_t **measObj,
MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t *SIwindowsize,
uint16_t *SIperiod,
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
#ifdef Rel10
,
uint8_t MBMS_Flag,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
PMCH_InfoList_r9_t *pmch_InfoList
#endif
#ifdef CBA
,
uint8_t num_active_cba_groups,
uint16_t cba_rnti
#endif
);
#include "proto.h"
/*@}*/
#endif /*__LAYER2_MAC_DEFS_H__ */
......
......@@ -188,7 +188,8 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
rrc_rx_tx(module_idP,
frameP,
1,
module_idP);
module_idP,
CC_id);
#ifdef Rel10
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
......
......@@ -392,7 +392,7 @@ void schedule_ue_spec(module_id_t module_idP,
uint8_t dl_pow_off[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
unsigned char rballoc_sub_UE[MAX_NUM_CCs][NUMBER_OF_UE_MAX][N_RBG_MAX];
uint16_t pre_nb_available_rbs[MAX_NUM_CCs][NUMBER_OF_UE_MAX];
int mcs,mcs2;
int mcs;
uint16_t min_rb_unit[MAX_NUM_CCs];
short ta_update = 0;
eNB_MAC_INST *eNB = &eNB_mac_inst[module_idP];
......@@ -708,7 +708,24 @@ void schedule_ue_spec(module_id_t module_idP,
// check first for RLC data on DCCH
// add the length for all the control elements (timing adv, drx, etc) : header + payload
#ifndef EXMIMO_IOT
ta_len = ((eNB_UE_stats->timing_advance_update/4)!=0) ? 2 : 0;
// to be checked by RK, NN, FK
uint8_t update_TA;
switch (frame_parms[CC_id]->N_RB_DL)
{
case 6:
update_TA = 1;
break;
case 25:
update_TA = 4;
break;
case 50:
update_TA = 8;
break;
case 100:
update_TA = 16;
break;
}
ta_len = ((eNB_UE_stats->timing_advance_update/update_TA)!=0) ? 2 : 0;
#else
ta_len = 0;
#endif
......@@ -936,7 +953,7 @@ void schedule_ue_spec(module_id_t module_idP,
post_padding = TBS - sdu_length_total - header_len_dcch - header_len_dtch - ta_len ; // 1 is for the postpadding header
}
#ifndef EXMIMO_IOT
ta_update = eNB_UE_stats->timing_advance_update/4;
ta_update = eNB_UE_stats->timing_advance_update/update_TA;
#else
ta_update = 0;
#endif
......
......@@ -961,6 +961,9 @@ void assign_max_mcs_min_rb(module_id_t module_idP,int frameP, sub_frame_t subfra
tbs = mac_xface->get_TBS_UL(mcs,rb_table[rb_table_index]);
tx_power = mac_xface->estimate_ue_tx_power(tbs,rb_table[rb_table_index],0,frame_parms->Ncp,0);
}
UE_template->ue_tx_power = tx_power;
if (rb_table[rb_table_index]>(frame_parms->N_RB_UL-first_rb[CC_id]-1)) {
rb_table_index--;
}
......
......@@ -498,7 +498,7 @@ void adjust_bsr_info(int buffer_occupancy, uint16_t TBS, UE_TEMPLATE *UE_templat
\param[in] eNB_index instance of eNB
@returns L2 state (CONNETION_OK or CONNECTION_LOST or PHY_RESYNCH)
*/
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index);
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframe, lte_subframe_t direction,uint8_t eNB_index,int CC_id);
/*! \fn int use_cba_access(module_id_t module_idP,frame_t frameP,sub_frame_t subframe, uint8_t eNB_index);
\brief determine whether to use cba resource to transmit or not
......@@ -656,5 +656,101 @@ void update_ul_dci(module_id_t module_idP,uint8_t CC_id,rnti_t rnti,uint8_t dai)
int get_min_rb_unit(module_id_t module_idP, uint8_t CC_id);
/* \brief Generate header for DL-SCH. This function parses the desired control elements and sdus and generates the header as described
in 36-321 MAC layer specifications. It returns the number of bytes used for the header to be used as an offset for the payload
in the DLSCH buffer.
@param mac_header Pointer to the first byte of the MAC header (DL-SCH buffer)
@param num_sdus Number of SDUs in the payload
@param sdu_lengths Pointer to array of SDU lengths
@param sdu_lcids Pointer to array of LCIDs (the order must be the same as the SDU length array)
@param drx_cmd dicontinous reception command
@param timing_advancd_cmd timing advanced command
@param ue_cont_res_id Pointer to contention resolution identifier (NULL means not present in payload)
@param short_padding Number of bytes for short padding (0,1,2)
@param post_padding number of bytes for padding at the end of MAC PDU
@returns Number of bytes used for header
*/
unsigned char generate_dlsch_header(unsigned char *mac_header,
unsigned char num_sdus,
unsigned short *sdu_lengths,
unsigned char *sdu_lcids,
unsigned char drx_cmd,
short timing_advance_cmd,
unsigned char *ue_cont_res_id,
unsigned char short_padding,
unsigned short post_padding);
/** \brief RRC Configuration primitive for PHY/MAC. Allows configuration of PHY/MAC resources based on System Information (SI), RRCConnectionSetup and RRCConnectionReconfiguration messages.
@param Mod_id Instance ID of eNB
@param eNB_flag Indicates if this is a eNB or UE configuration
@param UE_id Index of UE if this is an eNB configuration
@param eNB_id Index of eNB if this is a UE configuration
@param radioResourceConfigCommon Structure from SIB2 for common radio parameters (if NULL keep existing configuration)
@param physcialConfigDedicated Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated PHY parameters (if NULL keep existing configuration)
@param measObj Structure from RRCConnectionReconfiguration for UE measurement procedures
@param mac_MainConfig Structure from RRCConnectionSetup or RRCConnectionReconfiguration for dedicated MAC parameters (if NULL keep existing configuration)
@param logicalChannelIdentity Logical channel identity index of corresponding logical channel config
@param logicalChannelConfig Pointer to logical channel configuration
@param measGapConfig Measurement Gap configuration for MAC (if NULL keep existing configuration)
@param tdd_Config TDD Configuration from SIB1 (if NULL keep existing configuration)
@param mobilityControlInfo mobility control info received for Handover
@param SIwindowsize SI Windowsize from SIB1 (if NULL keep existing configuration)
@param SIperiod SI Period from SIB1 (if NULL keep existing configuration)
@param MBMS_Flag indicates MBMS transmission
@param mbsfn_SubframeConfigList pointer to mbsfn subframe configuration list from SIB2
@param mbsfn_AreaInfoList pointer to MBSFN Area Info list from SIB13
@param pmch_InfoList pointer to PMCH_InfoList from MBSFNAreaConfiguration Message (MCCH Message)
*/
int rrc_mac_config_req(module_id_t module_idP,
eNB_flag_t eNB_flag,
uint8_t UE_id,
uint8_t eNB_index,
RadioResourceConfigCommonSIB_t *radioResourceConfigCommon,
struct PhysicalConfigDedicated *physicalConfigDedicated,
#ifdef Rel10
SCellToAddMod_r10_t *sCellToAddMod_r10,
//struct PhysicalConfigDedicatedSCell_r10 *physicalConfigDedicatedSCell_r10,
#endif
MeasObjectToAddMod_t **measObj,
MAC_MainConfig_t *mac_MainConfig,
long logicalChannelIdentity,
LogicalChannelConfig_t *logicalChannelConfig,
MeasGapConfig_t *measGapConfig,
TDD_Config_t *tdd_Config,
MobilityControlInfo_t *mobilityControlInfo,
uint8_t *SIwindowsize,
uint16_t *SIperiod,
ARFCN_ValueEUTRA_t *ul_CarrierFreq,
long *ul_Bandwidth,
AdditionalSpectrumEmission_t *additionalSpectrumEmission,
struct MBSFN_SubframeConfigList *mbsfn_SubframeConfigList
#ifdef Rel10
,
uint8_t MBMS_Flag,
MBSFN_AreaInfoList_r9_t *mbsfn_AreaInfoList,
PMCH_InfoList_r9_t *pmch_InfoList
#endif
#ifdef CBA
,
uint8_t num_active_cba_groups,
uint16_t cba_rnti
#endif
);
/** \brief get the estimated UE distance from the PHY->MAC layer.
@param Mod_id Instance ID of eNB
@param UE_id Index of UE if this is an eNB configuration
@param CC_id Component Carrier Index
@param loc_type localization type: time-based or power-based
@return the estimated distance in meters
*/
double
rrc_get_estimated_ue_distance(module_id_t Mod_id,
const frame_t frameP,
uint8_t UE_id,
int CC_id,
uint8_t loc_type);
#endif
......@@ -1311,7 +1311,7 @@ void ue_get_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subf
// 3. Perform SR/BSR procedures for scheduling feedback
// 4. Perform PHR procedures
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP, lte_subframe_t directionP,uint8_t eNB_indexP) {
UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t subframeP, lte_subframe_t directionP,uint8_t eNB_indexP,int CC_id) {
int lcid; // lcid index
int TTI= 1;
......@@ -1377,7 +1377,8 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
switch (rrc_rx_tx(module_idP,
frameP,
0,
eNB_indexP)) {
eNB_indexP,
CC_id)) {
case RRC_OK:
break;
case RRC_ConnSetup_failed:
......
This diff is collapsed.
This diff is collapsed.
......@@ -258,6 +258,17 @@ void openair_rrc_top_init(int eMBMS_active, uint8_t cba_group_active,uint8_t HO_
for (module_id=0;module_id<NB_eNB_INST;module_id++) {
eNB_rrc_inst[module_id].num_active_cba_groups = cba_group_active;
}
#endif
#ifdef LOCALIZATION
/* later set this from xml or enb.config file*/
struct timeval ts; // time struct
gettimeofday(&ts, NULL); // get the current epoch timestamp
for (module_id=0;module_id<NB_eNB_INST;module_id++) {
eNB_rrc_inst[module_id].reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
initialize(&eNB_rrc_inst[module_id].loc_list);
eNB_rrc_inst[module_id].loc_type=0;
eNB_rrc_inst[module_id].aggregation_period_ms = 5000;
}
#endif
LOG_D(RRC,
"ALLOCATE %d Bytes for eNB_RRC_INST @ %p\n", (unsigned int)(NB_eNB_INST*sizeof(eNB_RRC_INST)), eNB_rrc_inst);
......@@ -318,8 +329,12 @@ void rrc_t310_expiration(const frame_t frameP, uint8_t Mod_id, uint8_t eNB_index
}
}
RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eNB_flagP,uint8_t index){
RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eNB_flagP,uint8_t index,int CC_id){
uint8_t UE_id;
int32_t current_timestamp_ms, ref_timestamp_ms;
struct timeval ts;
if(eNB_flagP == 0) {
// check timers
......@@ -393,8 +408,34 @@ RRC_status_t rrc_rx_tx(uint8_t Mod_id, const frame_t frameP, const eNB_flag_t eN
}
}
else {
else { // eNB
check_handovers(Mod_id,frameP);
// counetr, and get the value and aggregate
#ifdef LOCALIZATION
/* for the localization, only primary CC_id might be relevant*/
gettimeofday(&ts, NULL);
current_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
ref_timestamp_ms = eNB_rrc_inst[Mod_id].reference_timestamp_ms;
for (UE_id=0; UE_id < NUMBER_OF_UE_MAX; UE_id++) {
if ((current_timestamp_ms - ref_timestamp_ms > eNB_rrc_inst[Mod_id].aggregation_period_ms) &&
rrc_get_estimated_ue_distance(Mod_id,frameP,UE_id, CC_id,eNB_rrc_inst[Mod_id].loc_type) != -1) {
LOG_D(LOCALIZE, " RRC [UE/id %d -> eNB/id %d] timestamp %d frame %d estimated r = %f\n",
UE_id,
Mod_id,
current_timestamp_ms,
frameP,
rrc_get_estimated_ue_distance(Mod_id,frameP,UE_id, CC_id,eNB_rrc_inst[Mod_id].loc_type));
LOG_D(LOCALIZE, " RRC status %d\n", eNB_rrc_inst[Mod_id].Info.UE[UE_id].Status);
push_front(&eNB_rrc_inst[Mod_id].loc_list,
rrc_get_estimated_ue_distance(Mod_id,frameP,UE_id, CC_id,eNB_rrc_inst[Mod_id].loc_type));
eNB_rrc_inst[Mod_id].reference_timestamp_ms = current_timestamp_ms;
}
}
#endif
}
return (RRC_OK);
......
......@@ -142,7 +142,7 @@ int logInit (void)
g_log->log_component[PHY].filelog_name = "/tmp/phy.log";
g_log->log_component[MAC].name = "MAC";
g_log->log_component[MAC].level = LOG_DEBUG;
g_log->log_component[MAC].level = LOG_EMERG;
g_log->log_component[MAC].flag = LOG_MED;
g_log->log_component[MAC].interval = 1;
g_log->log_component[MAC].fd = 0;
......@@ -158,7 +158,7 @@ int logInit (void)
g_log->log_component[OPT].filelog_name = "";
g_log->log_component[RLC].name = "RLC";
g_log->log_component[RLC].level = LOG_DEBUG;
g_log->log_component[RLC].level = LOG_INFO;
g_log->log_component[RLC].flag = LOG_MED;
g_log->log_component[RLC].interval = 1;
g_log->log_component[RLC].fd = 0;
......@@ -166,7 +166,7 @@ int logInit (void)
g_log->log_component[RLC].filelog_name = "/tmp/rlc.log";
g_log->log_component[PDCP].name = "PDCP";
g_log->log_component[PDCP].level = LOG_DEBUG;
g_log->log_component[PDCP].level = LOG_INFO;
g_log->log_component[PDCP].flag = LOG_MED;
g_log->log_component[PDCP].interval = 1;
g_log->log_component[PDCP].fd = 0;
......@@ -212,7 +212,7 @@ int logInit (void)
g_log->log_component[OTG].fd = 0;
g_log->log_component[OTG].filelog = 0;
g_log->log_component[OTG].filelog_name = "/tmp/otg.log";
g_log->log_component[OTG_LATENCY].name = "OTG_LATENCY";
g_log->log_component[OTG_LATENCY].level = LOG_EMERG;
g_log->log_component[OTG_LATENCY].flag = LOG_MED;
......@@ -380,7 +380,16 @@ int logInit (void)
g_log->log_component[TMR].fd = 0;
g_log->log_component[TMR].filelog = 0;
g_log->log_component[TMR].filelog_name = "";
/* following log component are used for the localization*/
g_log->log_component[LOCALIZE].name = "LOCALIZE";
g_log->log_component[LOCALIZE].level = LOG_EMERG;
g_log->log_component[LOCALIZE].flag = LOG_MED;
g_log->log_component[LOCALIZE].interval = 1;
g_log->log_component[LOCALIZE].fd = 0;
g_log->log_component[LOCALIZE].filelog = 1;
g_log->log_component[LOCALIZE].filelog_name = "/tmp/localize.log";
g_log->level2string[LOG_EMERG] = "G"; //EMERG
g_log->level2string[LOG_ALERT] = "A"; // ALERT
g_log->level2string[LOG_CRIT] = "C"; // CRITIC
......
......@@ -265,6 +265,7 @@ typedef enum {
RAL_UE,
ENB_APP,
TMR,
LOCALIZE,
MAX_LOG_COMPONENTS,
} comp_name_t;
......
Active_eNBs = ( "eNB_Eurecom_LTEBox");
# Asn1_verbosity, choice in: none, info, annoying
Asn1_verbosity = "none";
eNBs =
(
{
# real_time choice in {hard, rt-preempt, no}
real_time = "no";
////////// Identification parameters:
eNB_ID = 0xe00;
cell_type = "CELL_MACRO_ENB";
eNB_name = "eNB_Eurecom_LTEBox";
// Tracking area code, 0x0000 and 0xfffe are reserved values
tracking_area_code = "1";
mobile_country_code = "208";
mobile_network_code = "92";
////////// Physical parameters:
component_carriers = (
{
frame_type = "FDD";
tdd_config = 3;
tdd_config_s = 0;
prefix_type = "NORMAL";
eutra_band = 7;
downlink_frequency = 2680000000L;
uplink_frequency_offset = -120000000;
Nid_cell = 0;
N_RB_DL = 25;
Nid_cell_mbsfn = 0;
nb_antennas_tx = 1;
nb_antennas_rx = 1;
tx_gain = 25;
rx_gain = 20;
prach_root = 0;
prach_config_index = 0;
prach_high_speed = "DISABLE";
prach_zero_correlation = 1;
prach_freq_offset = 2;
pucch_delta_shift = 1;
pucch_nRB_CQI = 1;
pucch_nCS_AN = 0;
pucch_n1_AN = 32;
pdsch_referenceSignalPower = 0;
pdsch_p_b = 0;
pusch_n_SB = 1;
pusch_enable64QAM = "DISABLE";
pusch_hoppingMode = "interSubFrame";
pusch_hoppingOffset = 0;
pusch_groupHoppingEnabled = "ENABLE";
pusch_groupAssignment = 0;
pusch_sequenceHoppingEnabled = "DISABLE";
pusch_nDMRS1 = 0;
phich_duration = "NORMAL";
phich_resource = "ONESIXTH";
srs_enable = "DISABLE";
/* srs_BandwidthConfig =;
srs_SubframeConfig =;
srs_ackNackST =;
srs_MaxUpPts =;*/
pusch_p0_Nominal = -108;
pusch_alpha = "AL1";
pucch_p0_Nominal = -108;
msg3_delta_Preamble = 6;
pucch_deltaF_Format1 = "deltaF2";
pucch_deltaF_Format1b = "deltaF3";
pucch_deltaF_Format2 = "deltaF0";
pucch_deltaF_Format2a = "deltaF0";
pucch_deltaF_Format2b = "deltaF0";
rach_numberOfRA_Preambles = 64;
rach_preamblesGroupAConfig = "DISABLE";
/*
rach_sizeOfRA_PreamblesGroupA = ;
rach_messageSizeGroupA = ;
rach_messagePowerOffsetGroupB = ;
*/
rach_powerRampingStep = 2;
rach_preambleInitialReceivedTargetPower = -100;
rach_preambleTransMax = 10;
rach_raResponseWindowSize = 10;
rach_macContentionResolutionTimer = 48;
rach_maxHARQ_Msg3Tx = 4;
pcch_default_PagingCycle = 128;
pcch_nB = "oneT";
bcch_modificationPeriodCoeff = 2;
ue_TimersAndConstants_t300 = 1000;
ue_TimersAndConstants_t301 = 1000;
ue_TimersAndConstants_t310 = 1000;
ue_TimersAndConstants_t311 = 10000;
ue_TimersAndConstants_n310 = 20;
ue_TimersAndConstants_n311 = 1;
}
);
////////// MME parameters:
mme_ip_address = ( { ipv4 = "192.168.13.11";
ipv6 = "192:168:30::17";
active = "yes";
preference = "ipv4";
}
);
NETWORK_INTERFACES :
{
ENB_INTERFACE_NAME_FOR_S1_MME = "eth0";
ENB_IPV4_ADDRESS_FOR_S1_MME = "192.168.13.10/24";
ENB_INTERFACE_NAME_FOR_S1U = "eth0";
ENB_IPV4_ADDRESS_FOR_S1U = "192.168.13.10/24";
ENB_PORT_FOR_S1U = 2152; # Spec 2152
};
/*
otg_config = (
{
ue_id =1;
app_type ="scbr";
bg_traffic ="disable";
},
{
ue_id =2;
app_type ="bcbr";
bg_traffic ="enable";
}
);
*/
log_config :
{
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="debug";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="debug";
rrc_log_verbosity ="medium";
gtpu_log_level ="error";
gtpu_log_verbosity ="medium";
udp_log_level ="error";
udp_log_verbosity ="medium";
osa_log_level ="warn";
osa_log_verbosity ="low";
};
}
);
......@@ -3,11 +3,14 @@
<FADING>
<FREE_SPACE_MODEL_PARAMETERS>
<PATHLOSS_EXPONENT>2.0</PATHLOSS_EXPONENT>
<PATHLOSS_0_dB>-100</PATHLOSS_0_dB><!--pathloss at 1km -->
</FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>AWGN</SMALL_SCALE>
</FADING>
<SYSTEM_FREQUENCY_GHz>1.9</SYSTEM_FREQUENCY_GHz>
</ENVIRONMENT_SYSTEM_CONFIG>
<SYSTEM_FREQUENCY_GHz>1.9</SYSTEM_FREQUENCY_GHz>
<TRANSMISSION_MODE>1</TRANSMISSION_MODE> <!-- validavalue: 1, 2, 5, 6 -->
</ENVIRONMENT_SYSTEM_CONFIG>
<TOPOLOGY_CONFIG>
<AREA>
......@@ -77,8 +80,8 @@
<OWD_RADIO_ACCESS>enable</OWD_RADIO_ACCESS> <!-- option: enable, disable. If enable owd curve shows the one way radio access delay, else it shows end to end owd -->
</PERFORMANCE_METRICS>
<LOG> <!-- set the global log level -->
<LEVEL>debug</LEVEL>
<VERBOSITY>medium</VERBOSITY>
<LEVEL>info</LEVEL>
<VERBOSITY>low</VERBOSITY>
<INTERVAL>1</INTERVAL>
</LOG>
<SEED_VALUE>0</SEED_VALUE> <!-- value 0 means randomly generated by OAI -->
......
......@@ -52,6 +52,14 @@ ifdef EMOS
CFLAGS+=-DEMOS
endif
ifeq ($(LOCALIZATION), 1)
CFLAGS += -DLOCALIZATION
endif
ifeq ($(LINUX_LIST), 1)
CFLAGS += -DLINUX_LIST
endif
ifdef TRAFFIC_TM5
CFLAGS += -DRLC_UM_TEST_TRAFFIC=1 #-DFULL_BUFFER=1
endif
......
......@@ -93,7 +93,17 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
// this is the transmission mode for the signalling channels
// this will be overwritten with the real transmission mode by the RRC once the UE is connected
PHY_vars_eNB->transmission_mode[i] = transmission_mode;
#ifdef LOCALIZATION
PHY_vars_eNB->ulsch_eNB[1+i]->aggregation_period_ms = 5000; // 5000 milliseconds // could be given as an argument (TBD))
struct timeval ts;
gettimeofday(&ts, NULL);
PHY_vars_eNB->ulsch_eNB[1+i]->reference_timestamp_ms = ts.tv_sec * 1000 + ts.tv_usec / 1000;
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_rss_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_rssi_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_subcarrier_rss_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_timing_advance_list);
initialize(&PHY_vars_eNB->ulsch_eNB[1+i]->loc_timing_update_list);
#endif
}
// ULSCH for RA
......@@ -125,7 +135,7 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->check_for_SUMIMO_transmissions = 0;
PHY_vars_eNB->lte_frame_parms.pucch_config_common.deltaPUCCH_Shift = 1;
return (PHY_vars_eNB);
}
......
......@@ -565,7 +565,7 @@ void *l2l1_task(void *args_p) {
start_meas(&oaisim_stats);
for (frame = 0; (l2l1_state != L2L1_TERMINATED) && (frame < oai_emulation.info.n_frames); frame++) {
#if defined(ENABLE_ITTI)
do {
// Checks if a message has been sent to L2L1 task
......@@ -661,7 +661,7 @@ void *l2l1_task(void *args_p) {
for (slot = 0; slot < 20; slot++) {
if (slot%2==0)
start_meas(&oaisim_stats_f);
wait_for_slot_isr ();
#if defined(ENABLE_ITTI)
......@@ -1272,7 +1272,7 @@ void *l2l1_task(void *args_p) {
}
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
reset_meas(&eNB2UE[eNB_id][UE_id][0]->random_channel);
......@@ -1285,66 +1285,69 @@ void *l2l1_task(void *args_p) {
reset_meas(&UE2eNB[UE_id][eNB_id][0]->convolution);
}
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_prach);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->rx_dft_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_channel_estimation_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_freq_offset_estimation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_llr_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats);
/*
* L2 functions
*/
// eNB MAC
reset_meas(&eNB_mac_inst[eNB_id].eNB_scheduler); // total
reset_meas(&eNB_mac_inst[eNB_id].schedule_si); // only schedule + tx
reset_meas(&eNB_mac_inst[eNB_id].schedule_ra); // only ra
reset_meas(&eNB_mac_inst[eNB_id].schedule_ulsch); // onlu ulsch
reset_meas(&eNB_mac_inst[eNB_id].fill_DLSCH_dci);// only dci
reset_meas(&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor); // include rlc_data_req + MAC header gen
reset_meas(&eNB_mac_inst[eNB_id].schedule_dlsch); // include rlc_data_req + MAC header gen + pre-processor
reset_meas(&eNB_mac_inst[eNB_id].schedule_mch); // only embms
reset_meas(&eNB_mac_inst[eNB_id].rx_ulsch_sdu); // include rlc_data_ind + mac header parser
reset_meas(&eNB_pdcp_stats[eNB_id].pdcp_run);
reset_meas(&eNB_pdcp_stats[eNB_id].data_req);
reset_meas(&eNB_pdcp_stats[eNB_id].data_ind);
reset_meas(&eNB_pdcp_stats[eNB_id].apply_security);
reset_meas(&eNB_pdcp_stats[eNB_id].validate_security);
reset_meas(&eNB_pdcp_stats[eNB_id].pdcp_ip);
reset_meas(&eNB_pdcp_stats[eNB_id].ip_pdcp);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_rx);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_prach);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->rx_dft_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_channel_estimation_stats);
//reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_freq_offset_estimation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_llr_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats);
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats);
#ifdef LOCALIZATION
reset_meas(&PHY_vars_eNB_g[eNB_id][0]->localization_stats);
#endif
/*
* L2 functions
*/
// eNB MAC
reset_meas(&eNB_mac_inst[eNB_id].eNB_scheduler); // total
reset_meas(&eNB_mac_inst[eNB_id].schedule_si); // only schedule + tx
reset_meas(&eNB_mac_inst[eNB_id].schedule_ra); // only ra
reset_meas(&eNB_mac_inst[eNB_id].schedule_ulsch); // onlu ulsch
reset_meas(&eNB_mac_inst[eNB_id].fill_DLSCH_dci);// only dci
reset_meas(&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor); // include rlc_data_req + MAC header gen
reset_meas(&eNB_mac_inst[eNB_id].schedule_dlsch); // include rlc_data_req + MAC header gen + pre-processor
reset_meas(&eNB_mac_inst[eNB_id].schedule_mch); // only embms
reset_meas(&eNB_mac_inst[eNB_id].rx_ulsch_sdu); // include rlc_data_ind + mac header parser
reset_meas(&eNB_pdcp_stats[eNB_id].pdcp_run);
reset_meas(&eNB_pdcp_stats[eNB_id].data_req);
reset_meas(&eNB_pdcp_stats[eNB_id].data_ind);
reset_meas(&eNB_pdcp_stats[eNB_id].apply_security);
reset_meas(&eNB_pdcp_stats[eNB_id].validate_security);
reset_meas(&eNB_pdcp_stats[eNB_id].pdcp_ip);
reset_meas(&eNB_pdcp_stats[eNB_id].ip_pdcp);
}
}
}
void print_opp_meas(void){
void print_opp_meas(void){
uint8_t eNB_id=0,UE_id=0;
uint8_t eNB_id=0,UE_id=0;
print_meas(&oaisim_stats,"[OAI][total_exec_time]", &oaisim_stats,&oaisim_stats);
print_meas(&oaisim_stats_f,"[OAI][SF_exec_time]", &oaisim_stats,&oaisim_stats_f);
......@@ -1433,7 +1436,10 @@ void print_opp_meas(void){
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl2_stats,"[eNB][ |_tc_intl2]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_prach,"[eNB][rx_prach]",&oaisim_stats,&oaisim_stats_f);
#ifdef LOCALIZATION
print_meas(&PHY_vars_eNB_g[eNB_id][0]->localization_stats, "[eNB][LOCALIZATION]",&oaisim_stats,&oaisim_stats_f);
#endif
}
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) {
......
......@@ -51,6 +51,7 @@
#include "RRC/LITE/extern.h"
#include "RRC/L2_INTERFACE/openair_rrc_L2_interface.h"
#include "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"
......@@ -811,18 +812,7 @@ void init_openair1(void) {
#endif
// change the nb_connected_eNB
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
init_lte_vars (&frame_parms[CC_id],
oai_emulation.info.frame_type[CC_id],
oai_emulation.info.tdd_config[CC_id],
oai_emulation.info.tdd_config_S[CC_id],
oai_emulation.info.extended_prefix_flag[CC_id],
oai_emulation.info.N_RB_DL[CC_id],
Nid_cell,
cooperation_flag,
oai_emulation.info.transmission_mode[CC_id],
abstraction_flag,
nb_antennas_rx,
oai_emulation.info.eMBMS_active_state);
init_lte_vars (&frame_parms[CC_id], oai_emulation.info.frame_type[CC_id], oai_emulation.info.tdd_config[CC_id], oai_emulation.info.tdd_config_S[CC_id],oai_emulation.info.extended_prefix_flag[CC_id],oai_emulation.info.N_RB_DL[CC_id], Nid_cell, cooperation_flag, oai_emulation.info.transmission_mode[CC_id], abstraction_flag,nb_antennas_rx, oai_emulation.info.eMBMS_active_state);
}
for (eNB_id=0; eNB_id<NB_eNB_INST;eNB_id++){
......@@ -844,8 +834,8 @@ void init_openair1(void) {
printf ("AFTER init: MAX_NUM_CCs %d, Nid_cell %d frame_type %d,tdd_config %d\n",
MAX_NUM_CCs,
PHY_vars_eNB_g[0][0]->lte_frame_parms.Nid_cell,
PHY_vars_eNB_g[0][0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[0][0]->lte_frame_parms.tdd_config);
PHY_vars_eNB_g[0][0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[0][0]->lte_frame_parms.tdd_config);
number_of_cards = 1;
......@@ -1120,6 +1110,14 @@ void update_ocm() {
LOG_I(OCM,"Path loss (CCid %d) between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %f\n",
CC_id,eNB_id,enb_data[eNB_id]->x,enb_data[eNB_id]->y,UE_id,ue_data[UE_id]->x,ue_data[UE_id]->y,
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB, eNB2UE[eNB_id][UE_id][CC_id]->aoa);
double dx, dy, distance;
dx = enb_data[eNB_id]->x - ue_data[UE_id]->x;
dy = enb_data[eNB_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",
eNB_id, enb_data[eNB_id]->x,enb_data[eNB_id]->y,
UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
distance);*/
}
}
}
......
......@@ -170,13 +170,13 @@ def execute(oai, user, pw, host, logfile,logdir,debug):
try:
test = '06'
name = 'Run oai.rel8.itti.abs.rrc'
diag = 'RRC procedure is not finished completely, check the eNB config file (default is enb.sfr.sud.conf), in addition to the execution logs and trace BCCH, CCCH, and DCCH channels'
diag = 'RRC procedure is not finished completely, check the eNB config file (default is enb.band7.generic.conf), in addition to the execution logs and trace BCCH, CCCH, and DCCH channels'
for i in range(NUM_UE) :
for j in range(NUM_eNB) :
log_name = logdir + '/log_' + host + case + test + '_' + str(i) + str(j)
itti_name = log_name + '.log'
trace_name = log_name + '.txt'
conf = '-a -l7 -A AWGN --enb-conf ../../PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.exmimo2.conf -n' + str((i+1+j) * 50) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -K' + itti_name
conf = '-a -l7 -A AWGN --enb-conf ../../PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.conf -n' + str((i+1+j) * 50) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -K' + itti_name
tee = ' 2>&1 | tee -a ' + trace_name
command = './oaisim.rel8.itti.' + host + ' ' + conf
oai.send('echo ' + command + ' > ' + trace_name + ';')
......
......@@ -189,13 +189,13 @@ def execute(oai, user, pw, host, logfile,logdir,debug):
# try:
# test = '09'
# name = 'Run oai.rel10.itti.phy.eMBMS.MCCH'
# diag = 'eMBMS procedure is not finished completely, check the eNB config file (enb.sfr.sud.conf), and make sure that the SIB13/MCCH have been correclty received by UEs'
# diag = 'eMBMS procedure is not finished completely, check the eNB config file (enb.band7.generic.conf), and make sure that the SIB13/MCCH have been correclty received by UEs'
# for i in range(NUM_UE) :
# for j in range(NUM_eNB) :
# log_name = logdir + '/log_' + host + case + test + '_' + str(i) + str(j)
# itti_name = log_name + '.log'
# trace_name = log_name + '.txt'
# conf = '-A AWGN -l7 -x 1 -Q3 --enb-conf ../../PROJECTS/GENERIC-LTE-EPC/CONF/enb.sfr.sud.conf -n' + str((i+1+j) * 50) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -K' + itti_name
# conf = '-A AWGN -l7 -x 1 -Q3 --enb-conf ../../PROJECTS/GENERIC-LTE-EPC/CONF/enb.band7.generic.conf -n' + str((i+1+j) * 50) + ' -u' + str(i+1) +' -b'+ str(j+1) + ' -K' + itti_name
# tee = ' 2>&1 | tee -a ' + trace_name
# command = './oaisim.rel10.itti.' + host + ' ' + conf
# oai.send('echo ' + command + ' > ' + trace_name + ';')
......
......@@ -101,7 +101,39 @@ class openair(core):
except Error, val :
print "Error: can't connect to"+username+"@"+self.address
def connect2(self, username, password, prompt='$'):
self.prompt1 = prompt
self.prompt2 = prompt
while 1:
try:
if not username:
username = root
if not password:
password = username
self.oai = pexpect.spawn('ssh -o "UserKnownHostsFile=/dev/null" -o "StrictHostKeyChecking=no" -o "ConnectionAttempts=1" ' \
+ username + '@' + self.address)
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=40)
if index == 0 :
return 'Ok'
else :
index = self.oai.expect(['password:', pexpect.TIMEOUT], timeout=40)
if index == 0 :
self.oai.sendline(password)
index = self.oai.expect([re.escape(self.prompt1), re.escape(self.prompt2), pexpect.TIMEOUT], timeout=10)
if index != 0:
print 'ERROR! could not login with SSH.'
print 'Expected ' + self.prompt1 + ', received >>>>' + self.oai.before + '<<<<'
sys.exit(1)
return 'Ok'
except Exception, val:
time.sleep(5)
print "Error:", val
def disconnect(self):
print 'disconnecting the ssh connection to ' + self.address + '\n'
self.oai.send('exit')
......
......@@ -111,7 +111,9 @@ try:
print "username: " + user
#print "password: " + pw
oai.connect(user,pw)
# issues in ubuntu 12.04
# oai.connect(user,pw)
oai.connect2(user,pw)
#oai.get_shell()
except :
print 'Fail to connect to the local host'
......
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