* add oaisim performance profiler OPP (enabled with option q )
* fix the bug for IP connectivity when more than 1 UE is connected (test with iperf: ok) * set target ul/dl mcs in the eNB scheduler to hardwire the desired MCS (option t for UL and m for DL) * add the code related to abstraction from http://svn.eurecom.fr/openairsvn/openair4G/tags/asilomar2013 * cleanup the code * pre-ci passed for all except for eMBMS git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5093 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
@@ -17,7 +17,13 @@ CPUFLAGS += $(shell if grep --silent ssse3 /proc/cpuinfo ; then echo "-mssse3" ;
|
||||
CPUFLAGS += $(shell if grep --silent -w sse4 /proc/cpuinfo ; then echo "-msse4" ; else echo ""; fi)
|
||||
linux = $(shell if [ `uname` = "Linux" ] ; then echo "1" ; else echo "0" ; fi)
|
||||
|
||||
CFLAGS += -g -ggdb -Wstrict-prototypes -Wpointer-sign
|
||||
ifdef DEBUG
|
||||
CFLAGS += -g -ggdb -DDEBUG_PHY
|
||||
else
|
||||
CFLAGE += -O2
|
||||
endif
|
||||
|
||||
CFLAGS += -Wstrict-prototypes -Wpointer-sign
|
||||
CFLAGS += -DUSER_MODE -DNB_ANTENNAS_RX=2 -DNB_ANTENNAS_TXRX=2 -DNB_ANTENNAS_TX=2 $(CPUFLAGS) -I/usr/include/X11 #-Wno-packed-bitfield-compat
|
||||
|
||||
# Check if GCC version is greater or equal to 4.4
|
||||
@@ -94,10 +100,6 @@ else
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef DEBUG_PHY
|
||||
CFLAGS += -DDEBUG_PHY
|
||||
endif
|
||||
|
||||
ifdef JF
|
||||
CFLAGS += -DJUMBO_FRAME
|
||||
endif
|
||||
|
||||
@@ -140,9 +140,10 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
if (abstraction_flag != 0) {
|
||||
//for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
|
||||
|
||||
if (!hold_channel) {
|
||||
// calculate the random channel from each eNB
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
|
||||
random_channel(eNB2UE[eNB_id][UE_id]);
|
||||
random_channel(eNB2UE[eNB_id][UE_id],abstraction_flag);
|
||||
/*
|
||||
for (i=0;i<eNB2UE[eNB_id][UE_id]->nb_taps;i++)
|
||||
printf("eNB2UE[%d][%d]->a[0][%d] = (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id]->a[0][i].x,eNB2UE[eNB_id][UE_id]->a[0][i].y);
|
||||
@@ -175,13 +176,14 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
return; //exit(-1);
|
||||
}
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp2(eNB2UE[att_eNB_id][UE_id]->ch[0],
|
||||
eNB2UE[att_eNB_id][UE_id]->channel_length)*eNB2UE[att_eNB_id][UE_id]->channel_length;
|
||||
LOG_D(OCM,"Channel eNB %d => UE %d : tx_power %d dBm, path_loss %f dB\n",
|
||||
att_eNB_id,UE_id,
|
||||
PHY_vars_eNB_g[att_eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower,
|
||||
eNB2UE[att_eNB_id][UE_id]->path_loss_dB);
|
||||
|
||||
#endif
|
||||
|
||||
//dlsch_abstraction(PHY_vars_UE_g[UE_id]->sinr_dB, rb_alloc, 8);
|
||||
// fill in perfect channel estimates
|
||||
@@ -189,7 +191,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
s32 **dl_channel_est = PHY_vars_UE_g[UE_id]->lte_ue_common_vars.dl_ch_estimates[0];
|
||||
// double scale = pow(10.0,(enb_data[att_eNB_id]->tx_power_dBm + eNB2UE[att_eNB_id][UE_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id]->rx_total_gain_dB)/20.0);
|
||||
double scale = pow(10.0,(PHY_vars_eNB_g[att_eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower+eNB2UE[att_eNB_id][UE_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id]->rx_total_gain_dB)/20.0);
|
||||
scale = scale * sqrt(512.0/300.0); //TODO: make this variable for all BWs
|
||||
//this factor is not really needed (it was actually wrong in the non abstraction mode)
|
||||
//scale = scale * sqrt(512.0/300.0); //TODO: make this variable for all BWs
|
||||
LOG_D(OCM,"scale =%lf (%d dB)\n",scale,(int) (20*log10(scale)));
|
||||
// freq_channel(desc1,frame_parms->N_RB_DL,nb_samples);
|
||||
//write_output("channel.m","ch",desc1->ch[0],desc1->channel_length,1,8);
|
||||
@@ -211,19 +214,21 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if(PHY_vars_UE_g[UE_id]->transmission_mode[att_eNB_id]>=5)
|
||||
{
|
||||
/* lte_ue_measurements(PHY_vars_UE_g[UE_id],
|
||||
lte_ue_measurements(PHY_vars_UE_g[UE_id],
|
||||
((next_slot-1)>>1)*frame_parms->samples_per_tti,
|
||||
1,
|
||||
abstraction_flag);
|
||||
*/
|
||||
|
||||
PHY_vars_eNB_g[att_eNB_id]->dlsch_eNB[0][0]->pmi_alloc = quantize_subband_pmi(&PHY_vars_UE_g[UE_id]->PHY_measurements,0);
|
||||
// printf("pmi_alloc in channel sim: %d",PHY_vars_eNB_g[att_eNB_id]->dlsch_eNB[0][0]->pmi_alloc);
|
||||
}
|
||||
|
||||
// calculate the SNR for the attached eNB
|
||||
init_snr(eNB2UE[att_eNB_id][UE_id], enb_data[att_eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id]->sinr_dB, &PHY_vars_UE_g[UE_id]->N0, PHY_vars_UE_g[UE_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id]->dlsch_eNB[UE_id][0]->pmi_alloc,PHY_vars_eNB_g[att_eNB_id]->mu_mimo_mode[UE_id].dl_pow_off);
|
||||
}
|
||||
*/
|
||||
|
||||
// calculate the SNR for the attached eNB (this assumes eNB always uses PMI stored in eNB_UE_stats; to be improved)
|
||||
init_snr(eNB2UE[att_eNB_id][UE_id], enb_data[att_eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id]->sinr_dB, &PHY_vars_UE_g[UE_id]->N0, PHY_vars_UE_g[UE_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id]->eNB_UE_stats[UE_id].DL_pmi_single,PHY_vars_eNB_g[att_eNB_id]->mu_mimo_mode[UE_id].dl_pow_off);
|
||||
|
||||
// calculate sinr here
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
@@ -231,9 +236,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
calculate_sinr(eNB2UE[eNB_id][UE_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id]->sinr_dB);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//} //UE_id
|
||||
} // hold channel
|
||||
}
|
||||
|
||||
else { //abstraction_flag
|
||||
@@ -241,11 +244,13 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
Call do_OFDM_mod from phy_procedures_eNB_TX function
|
||||
*/
|
||||
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
|
||||
start_meas(&PHY_vars_eNB_g[eNB_id]->ofdm_mod_stats);
|
||||
do_OFDM_mod(PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdataF[0],
|
||||
PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdata[0],
|
||||
((next_slot==19) ? -1 : 0 ) + PHY_vars_eNB_g[eNB_id]->frame,next_slot,
|
||||
&PHY_vars_eNB_g[eNB_id]->lte_frame_parms);
|
||||
stop_meas(&PHY_vars_eNB_g[eNB_id]->ofdm_mod_stats);
|
||||
}
|
||||
|
||||
//for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
|
||||
@@ -288,7 +293,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
LOG_D(OCM,"eNB %d: tx_pwr %f dBm, for slot %d (subframe %d)\n",
|
||||
LOG_D(OCM,"[SIM][DL] eNB %d: tx_pwr %f dBm, for slot %d (subframe %d)\n",
|
||||
eNB_id,
|
||||
10*log10(tx_pwr),
|
||||
next_slot,
|
||||
@@ -300,13 +305,13 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp2(eNB2UE[eNB_id][UE_id]->ch[0],
|
||||
eNB2UE[eNB_id][UE_id]->channel_length)*eNB2UE[eNB_id][UE_id]->channel_length;
|
||||
LOG_D(OCM,"Channel eNB %d => UE %d : Channel gain %f dB (%f)\n",eNB_id,UE_id,10*log10(rx_pwr),rx_pwr);
|
||||
LOG_D(OCM,"[SIM][DL] Channel eNB %d => UE %d : Channel gain %f dB (%f)\n",eNB_id,UE_id,10*log10(rx_pwr),rx_pwr);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
for (i=0;i<eNB2UE[eNB_id][UE_id]->channel_length;i++)
|
||||
printf("ch(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id]->ch[0][i]);
|
||||
printf("ch(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id]->ch[0][i].x,eNB2UE[eNB_id][UE_id]->ch[0][i].y);
|
||||
#endif
|
||||
|
||||
LOG_D(OCM,"[SIM][DL] Channel eNB %d => UE %d : tx_power %f dBm, path_loss %f dB\n",
|
||||
@@ -316,8 +321,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
eNB2UE[eNB_id][UE_id]->path_loss_dB);
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,512,0);
|
||||
printf("[SIM][DL] UE %d : rx_pwr %f dBm for slot %d (subframe %d)\n",UE_id,10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,512,0)*512.0/300.0;
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr %f dBm for slot %d (subframe %d)\n",UE_id,10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
#endif
|
||||
|
||||
if (eNB2UE[eNB_id][UE_id]->first_run == 1)
|
||||
@@ -356,9 +361,9 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
1e3/eNB2UE[eNB_id][UE_id]->BW, // sampling time (ns)
|
||||
(double)PHY_vars_UE_g[UE_id]->rx_total_gain_dB - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,frame_parms->ofdm_symbol_size,0);
|
||||
#ifdef DEBUG_SIM
|
||||
printf("[SIM][DL] UE %d : ADC in (eNB %d) %f dB for slot %d (subframe %d)\n",
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,frame_parms->ofdm_symbol_size,0)*512.0/300;
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in (eNB %d) %f dB for slot %d (subframe %d)\n",
|
||||
UE_id,eNB_id,
|
||||
10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
#endif
|
||||
@@ -370,9 +375,9 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
}
|
||||
|
||||
}
|
||||
rx_pwr = signal_energy_fp(r_re,r_im,nb_antennas_rx,frame_parms->ofdm_symbol_size,0);
|
||||
#ifdef DEBUG_SIM
|
||||
printf("[SIM][DL] UE %d : ADC in %f dB for slot %d (subframe %d)\n",UE_id,10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
rx_pwr = signal_energy_fp(r_re,r_im,nb_antennas_rx,frame_parms->ofdm_symbol_size,0)*512.0/300.0;
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dB for slot %d (subframe %d)\n",UE_id,10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
#endif
|
||||
|
||||
rxdata = PHY_vars_UE_g[UE_id]->lte_ue_common_vars.rxdata;
|
||||
@@ -387,8 +392,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
|
||||
frame_parms->samples_per_tti>>1,
|
||||
12);
|
||||
|
||||
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,512);
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,512)*512.0/300.0;
|
||||
LOG_D(OCM,"[SIM][DL] UE %d : rx_pwr (ADC out) %f dB (%d) for slot %d (subframe %d), writing to %p\n",UE_id, 10*log10((double)rx_pwr2),rx_pwr2,next_slot,next_slot>>1,rxdata);
|
||||
#else
|
||||
UNUSED_VARIABLE(rx_pwr2);
|
||||
@@ -421,81 +426,57 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
|
||||
#ifdef PHY_ABSTRACTION_UL
|
||||
double min_path_loss=-200;
|
||||
|
||||
int subframe = (next_slot>>1);
|
||||
|
||||
u8 harq_pid;
|
||||
u16 ul_nb_rb=0;
|
||||
u16 ul_nb_rb=0 ;
|
||||
u16 ul_fr_rb=0;
|
||||
#endif
|
||||
int ulnbrb2 ;
|
||||
int ulfrrb2 ;
|
||||
u8 harq_pid;
|
||||
int subframe = (next_slot>>1);
|
||||
#endif
|
||||
|
||||
/*
|
||||
if (next_slot==4)
|
||||
{
|
||||
hold_channel = 0;
|
||||
}
|
||||
else
|
||||
hold_channel = 1;
|
||||
*/
|
||||
|
||||
if (abstraction_flag!=0) {
|
||||
#ifdef PHY_ABSTRACTION_UL
|
||||
if (abstraction_flag!=0)
|
||||
{
|
||||
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++)
|
||||
{
|
||||
random_channel(UE2eNB[UE_id][eNB_id]);
|
||||
freq_channel(UE2eNB[UE_id][eNB_id], frame_parms->N_RB_UL,frame_parms->N_RB_UL*12+1);
|
||||
}
|
||||
}
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++)
|
||||
{
|
||||
//channel now is ready for uplink,now find out which UEs are connected to you
|
||||
for (UE_id=0;UE_id<NB_UE_INST;UE_id++)
|
||||
{
|
||||
att_eNB_id=0;
|
||||
// if UE is not attached yet, find assume its the eNB with the smallest pathloss
|
||||
if (att_eNB_id >= 0)
|
||||
{
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++)
|
||||
{
|
||||
if (min_path_loss<UE2eNB[UE_id][eNB_id]->path_loss_dB)
|
||||
{
|
||||
min_path_loss = UE2eNB[UE_id][eNB_id]->path_loss_dB;
|
||||
att_eNB_id=eNB_id;
|
||||
LOG_D(OCM,"UE attached to eNB (UE%d->eNB%d)\n",UE_id,eNB_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (att_eNB_id<0)
|
||||
{
|
||||
LOG_E(OCM,"Cannot find eNB for UE %d, return\n",UE_id);
|
||||
return; //exit(-1);
|
||||
}
|
||||
// If the UE is attached to you, perform the uplink / abstraction procedure:
|
||||
if(att_eNB_id >= 0)
|
||||
{
|
||||
//{ // REceived power at the eNB
|
||||
rx_pwr = signal_energy_fp2(UE2eNB[UE_id][att_eNB_id]->ch[0],
|
||||
UE2eNB[UE_id][att_eNB_id]->channel_length)*UE2eNB[UE_id][att_eNB_id]->channel_length; // calculate the rx power at the eNB
|
||||
if (!hold_channel) {
|
||||
random_channel(UE2eNB[UE_id][eNB_id],abstraction_flag);
|
||||
freq_channel(UE2eNB[UE_id][eNB_id], frame_parms->N_RB_UL,frame_parms->N_RB_UL*12+1);
|
||||
|
||||
// REceived power at the eNB
|
||||
rx_pwr = signal_energy_fp2(UE2eNB[UE_id][eNB_id]->ch[0],
|
||||
UE2eNB[UE_id][eNB_id]->channel_length)*UE2eNB[UE_id][att_eNB_id]->channel_length; // calculate the rx power at the eNB
|
||||
}
|
||||
|
||||
// write_output("SINRch.m","SINRch",PHY_vars_eNB_g[att_eNB_id]->sinr_dB_eNB,frame_parms->N_RB_UL*12+1,1,1);
|
||||
if(subframe>1 && subframe <5)
|
||||
// write_output("SINRch.m","SINRch",PHY_vars_eNB_g[att_eNB_id]->sinr_dB_eNB,frame_parms->N_RB_UL*12+1,1,1);
|
||||
if(subframe>1 && subframe <5)
|
||||
{
|
||||
harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
|
||||
ul_nb_rb = PHY_vars_eNB_g[att_eNB_id]->ulsch_eNB[(u8)UE_id]->harq_processes[harq_pid]->nb_rb;
|
||||
ul_fr_rb = PHY_vars_eNB_g[att_eNB_id]->ulsch_eNB[(u8)UE_id]->harq_processes[harq_pid]->first_rb;
|
||||
}
|
||||
|
||||
if(ul_nb_rb>1 && (ul_fr_rb < 25 && ul_fr_rb > -1))
|
||||
|
||||
if(ul_nb_rb>1 && (ul_fr_rb < 25 && ul_fr_rb > -1))
|
||||
{
|
||||
number_rb_ul = ul_nb_rb;
|
||||
first_rbUL = ul_fr_rb;
|
||||
init_snr_up(UE2eNB[UE_id][att_eNB_id],enb_data[att_eNB_id], ue_data[UE_id],PHY_vars_eNB_g[att_eNB_id]->sinr_dB,&PHY_vars_UE_g[att_eNB_id]->N0,ul_nb_rb,ul_fr_rb);
|
||||
|
||||
|
||||
}
|
||||
} // If this UE is attached to you(means perform Uplink abstraction procedure)
|
||||
} //uE_id
|
||||
}
|
||||
}
|
||||
} //UE_id
|
||||
} //eNB_id
|
||||
#else
|
||||
if (abstraction_flag!=0) {
|
||||
/* the following functions are not needed */
|
||||
/*
|
||||
if (abstraction_flag!=0) {
|
||||
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
|
||||
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
|
||||
random_channel(UE2eNB[UE_id][eNB_id]);
|
||||
@@ -503,7 +484,9 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
else { //without abstraction
|
||||
|
||||
/*
|
||||
@@ -548,7 +531,7 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
PHY_vars_UE_g[UE_id]->tx_power_dBm);
|
||||
//ue_data[UE_id]->tx_power_dBm);
|
||||
#ifdef DEBUG_SIM
|
||||
printf("[SIM][UL] UE %d tx_pwr %f dBm (target %d dBm) for slot %d (subframe %d, slot_offset %d, slot_offset_meas %d)\n",UE_id,10*log10(tx_pwr),PHY_vars_UE_g[UE_id]->tx_power_dBm,next_slot,next_slot>>1,slot_offset,slot_offset_meas);
|
||||
LOG_D(OCM,"[SIM][UL] UE %d tx_pwr %f dBm (target %d dBm) for slot %d (subframe %d, slot_offset %d, slot_offset_meas %d)\n",UE_id,10*log10(tx_pwr),PHY_vars_UE_g[UE_id]->tx_power_dBm,next_slot,next_slot>>1,slot_offset,slot_offset_meas);
|
||||
#endif
|
||||
|
||||
multipath_channel(UE2eNB[UE_id][eNB_id],s_re,s_im,r_re0,r_im0,
|
||||
@@ -557,12 +540,12 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp2(UE2eNB[UE_id][eNB_id]->ch[0],
|
||||
UE2eNB[UE_id][eNB_id]->channel_length)*UE2eNB[UE_id][eNB_id]->channel_length;
|
||||
printf("[SIM][UL] slot %d Channel UE %d => eNB %d : %f dB (hold %d)\n",next_slot,UE_id,eNB_id,10*log10(rx_pwr),hold_channel);
|
||||
LOG_D(OCM,"[SIM][UL] slot %d Channel UE %d => eNB %d : %f dB (hold %d)\n",next_slot,UE_id,eNB_id,10*log10(rx_pwr),hold_channel);
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SIM
|
||||
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,frame_parms->samples_per_tti>>1,0);
|
||||
printf("[SIM][UL] eNB %d : rx_pwr %f dB (%f) for slot %d (subframe %d), sptti %d\n",
|
||||
LOG_D(OCM,"[SIM][UL] eNB %d : rx_pwr %f dB (%f) for slot %d (subframe %d), sptti %d\n",
|
||||
eNB_id,10*log10(rx_pwr),rx_pwr,next_slot,next_slot>>1,frame_parms->samples_per_tti);
|
||||
#endif
|
||||
|
||||
@@ -610,9 +593,9 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
1e3/UE2eNB[0][eNB_id]->BW, // sampling time (ns)
|
||||
(double)PHY_vars_eNB_g[eNB_id]->rx_total_gain_eNB_dB - 66.227); // rx_gain (dB) (66.227 = 20*log10(pow2(11)) = gain from the adc that will be applied later)
|
||||
|
||||
rx_pwr = signal_energy_fp(r_re,r_im,nb_antennas_rx,frame_parms->samples_per_tti>>1,0);
|
||||
#ifdef DEBUG_SIM
|
||||
printf("[SIM][UL] rx_pwr (ADC in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
rx_pwr = signal_energy_fp(r_re,r_im,nb_antennas_rx,frame_parms->samples_per_tti>>1,0);
|
||||
LOG_D(OCM,"[SIM][UL] rx_pwr (ADC in) %f dB for slot %d (subframe %d)\n",10*log10(rx_pwr),next_slot,next_slot>>1);
|
||||
#endif
|
||||
|
||||
rxdata = PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.rxdata[0];
|
||||
@@ -627,10 +610,9 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
|
||||
frame_parms->samples_per_tti>>1,
|
||||
12);
|
||||
|
||||
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,frame_parms->samples_per_tti>>1);
|
||||
#ifdef DEBUG_SIM
|
||||
printf("[SIM][UL] eNB %d rx_pwr (ADC out) %f dB (%d) for slot %d (subframe %d)\n",
|
||||
eNB_id,10*log10((double)rx_pwr2),rx_pwr2,next_slot,next_slot>>1);
|
||||
rx_pwr2 = signal_energy(rxdata[0]+slot_offset,frame_parms->samples_per_tti>>1);
|
||||
LOG_D(OCM,"[SIM][UL] eNB %d rx_pwr (ADC out) %f dB (%d) for slot %d (subframe %d)\n",eNB_id,10*log10((double)rx_pwr2),rx_pwr2,next_slot,next_slot>>1);
|
||||
#else
|
||||
UNUSED_VARIABLE(tx_pwr);
|
||||
UNUSED_VARIABLE(rx_pwr);
|
||||
|
||||
+306
-62
@@ -95,10 +95,10 @@ char smbv_ip[16];
|
||||
#define SF_VAR 10
|
||||
|
||||
//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 */
|
||||
#define K 2 /* averaging coefficient */
|
||||
#define TARGET_SF_TIME_NS 1000000 /* 1ms = 1000000 ns */
|
||||
//#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 */
|
||||
//#define K 2 /* averaging coefficient */
|
||||
//#define TARGET_SF_TIME_NS 1000000 /* 1ms = 1000000 ns */
|
||||
|
||||
frame_t frame = 0;
|
||||
char stats_buffer[16384];
|
||||
@@ -127,18 +127,18 @@ u8 rate_adaptation_flag;
|
||||
extern u8 abstraction_flag;
|
||||
extern u8 ethernet_flag;
|
||||
extern u16 Nid_cell;
|
||||
extern struct timespec time_spec;
|
||||
extern unsigned long time_last;
|
||||
extern unsigned long time_now;
|
||||
extern int td;
|
||||
extern int td_avg;
|
||||
extern int sleep_time_us;
|
||||
|
||||
extern LTE_DL_FRAME_PARMS *frame_parms;
|
||||
|
||||
#ifdef XFORMS
|
||||
int otg_enabled;
|
||||
#endif
|
||||
|
||||
time_stats_t oaisim_stats;
|
||||
time_stats_t oaisim_stats_f;
|
||||
time_stats_t dl_chan_stats;
|
||||
time_stats_t ul_chan_stats;
|
||||
|
||||
// this should reflect the channel models in openair1/SIMULATION/TOOLS/defs.h
|
||||
mapping small_scale_names[] = {
|
||||
{"custom", custom},
|
||||
@@ -188,7 +188,7 @@ void help(void) {
|
||||
printf ("-K [log_file] Enable ITTI logging into log_file\n");
|
||||
printf ("-l Set the global log level (8:trace, 7:debug, 6:info, 4:warn, 3:error) \n");
|
||||
printf ("-L [0-1] 0 to disable new link adaptation, 1 to enable new link adapatation\n");
|
||||
printf ("-m Gives a fixed DL mcs\n");
|
||||
printf ("-m Gives a fixed DL mcs for eNB scheduler\n");
|
||||
printf ("-M Set the machine ID for Ethernet-based emulation\n");
|
||||
printf ("-n Set the number of frames for the simulation\n");
|
||||
printf ("-O [enb_conf_file] eNB configuration file name\n");
|
||||
@@ -197,12 +197,13 @@ void help(void) {
|
||||
printf (" - wireshark: Enable tracing of layers above PHY using an UDP socket\n");
|
||||
printf (" - pcap: Enable tracing of layers above PHY to a pcap file\n");
|
||||
printf (" - tshark: Not implemented yet\n");
|
||||
printf ("-q Enable Openair performance profiler \n");
|
||||
printf ("-Q Activate and set the MBMS service: 0 : not used (default eMBMS disabled), 1: eMBMS and RRC Connection enabled, 2: eMBMS relaying and RRC Connection enabled, 3: eMBMS enabled, RRC Connection disabled, 4: eMBMS relaying enabled, RRC Connection disabled\n");
|
||||
printf ("-R [6,15,25,50,75,100] Sets N_RB_DL\n");
|
||||
printf ("-r Activates rate adaptation (DL for now)\n");
|
||||
printf ("-s snr_dB set a fixed (average) SNR, this deactivates the openair channel model generator (OCM)\n");
|
||||
printf ("-S snir_dB set a fixed (average) SNIR, this deactivates the openair channel model generator (OCM)\n");
|
||||
printf ("-t Set the delay spread (microseconds)\n");
|
||||
printf ("-t Gives a fixed UL mcs for eNB scheduler\n");
|
||||
printf ("-T activate the traffic generator: cbr, mcbr, bcbr, mscbr\n");
|
||||
printf ("-u Set the number of local UE\n");
|
||||
printf ("-U Set the mobility model for UE, options are: STATIC, RWP, RWALK\n");
|
||||
@@ -513,9 +514,11 @@ void *l2l1_task(void *args_p) {
|
||||
AssertFatal (result == EXIT_SUCCESS, "Failed to free memory (%d)!\n", result);
|
||||
}
|
||||
#endif
|
||||
|
||||
start_meas(&oaisim_stats);
|
||||
for (frame = 0; (l2l1_state != L2L1_TERMINATED) && (frame < oai_emulation.info.n_frames); frame++) {
|
||||
|
||||
start_meas(&oaisim_stats_f);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
do {
|
||||
// Checks if a message has been sent to L2L1 task
|
||||
@@ -602,7 +605,7 @@ void *l2l1_task(void *args_p) {
|
||||
update_ocm ();
|
||||
|
||||
for (slot = 0; slot < 20; slot++) {
|
||||
|
||||
|
||||
wait_for_slot_isr ();
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
@@ -815,14 +818,16 @@ void *l2l1_task(void *args_p) {
|
||||
frame_parms);
|
||||
}
|
||||
}*/
|
||||
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
|
||||
do_DL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, eNB2UE, enb_data, ue_data, next_slot, abstraction_flag,
|
||||
frame_parms, UE_inst);
|
||||
start_meas(&dl_chan_stats);
|
||||
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
|
||||
do_DL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, eNB2UE, enb_data, ue_data, next_slot, abstraction_flag,frame_parms, UE_inst);
|
||||
}
|
||||
stop_meas(&dl_chan_stats);
|
||||
}
|
||||
if ((direction == SF_UL) || (frame_parms->frame_type == 0)) { //if ((subframe<2) || (subframe>4))
|
||||
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB, enb_data, ue_data, next_slot, abstraction_flag,
|
||||
frame_parms, frame);
|
||||
start_meas(&ul_chan_stats);
|
||||
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB, enb_data, ue_data, next_slot, abstraction_flag,frame_parms, frame);
|
||||
stop_meas(&ul_chan_stats);
|
||||
/*
|
||||
int ccc;
|
||||
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n ");
|
||||
@@ -842,11 +847,12 @@ void *l2l1_task(void *args_p) {
|
||||
frame,next_slot,
|
||||
frame_parms);
|
||||
}
|
||||
}*/
|
||||
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
|
||||
do_DL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, eNB2UE, enb_data, ue_data, next_slot, abstraction_flag,
|
||||
frame_parms, UE_inst);
|
||||
}
|
||||
}*/
|
||||
start_meas(&dl_chan_stats);
|
||||
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
|
||||
do_DL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, eNB2UE, enb_data, ue_data, next_slot, abstraction_flag,frame_parms, UE_inst);
|
||||
}
|
||||
stop_meas(&dl_chan_stats);
|
||||
/*
|
||||
for (aarx=0;aarx<UE2eNB[1][0]->nb_rx;aarx++)
|
||||
for (aatx=0;aatx<UE2eNB[1][0]->nb_tx;aatx++)
|
||||
@@ -855,8 +861,9 @@ void *l2l1_task(void *args_p) {
|
||||
*/
|
||||
}
|
||||
else { // UL part
|
||||
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB, enb_data, ue_data, next_slot, abstraction_flag,
|
||||
frame_parms, frame);
|
||||
start_meas(&ul_chan_stats);
|
||||
do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB, enb_data, ue_data, next_slot, abstraction_flag,frame_parms, frame);
|
||||
stop_meas(&ul_chan_stats);
|
||||
|
||||
/* int ccc;
|
||||
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n ");
|
||||
@@ -887,33 +894,7 @@ void *l2l1_task(void *args_p) {
|
||||
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",PHY_vars_UE->lte_ue_pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
|
||||
}
|
||||
*/
|
||||
|
||||
if (next_slot % 2 == 0) {
|
||||
clock_gettime (CLOCK_REALTIME, &time_spec);
|
||||
time_last = time_now;
|
||||
time_now = (unsigned long) time_spec.tv_nsec;
|
||||
td = (int) (time_now - time_last);
|
||||
if (td > 0) {
|
||||
td_avg = (int) (((K * (long) td) + (((1 << 3) - K) * ((long) td_avg))) >> 3); // in us
|
||||
LOG_T(
|
||||
EMU,
|
||||
"sleep frame %d, time_now %ldus,time_last %ldus,average time difference %ldns, CURRENT TIME DIFF %dus, avgerage difference from the target %dus\n", frame, time_now, time_last, td_avg, td/1000, (td_avg-TARGET_SF_TIME_NS)/1000);
|
||||
}
|
||||
if (td_avg < (TARGET_SF_TIME_NS - SF_DEVIATION_OFFSET_NS)) {
|
||||
sleep_time_us += SLEEP_STEP_US;
|
||||
LOG_D(EMU, "Faster than realtime increase the avg sleep time for %d us, frame %d\n", sleep_time_us, frame);
|
||||
// LOG_D(EMU,"Faster than realtime increase the avg sleep time for %d us, frame %d, time_now %ldus,time_last %ldus,average time difference %ldns, CURRENT TIME DIFF %dus, avgerage difference from the target %dus\n", sleep_time_us,frame, time_now,time_last,td_avg, td/1000,(td_avg-TARGET_SF_TIME_NS)/1000);
|
||||
}
|
||||
else
|
||||
if (td_avg > (TARGET_SF_TIME_NS + SF_DEVIATION_OFFSET_NS)) {
|
||||
sleep_time_us -= SLEEP_STEP_US;
|
||||
LOG_D(
|
||||
EMU,
|
||||
"Slower than realtime reduce the avg sleep time for %d us, frame %d, time_now\n", sleep_time_us, frame);
|
||||
//LOG_T(EMU,"Slower than realtime reduce the avg sleep time for %d us, frame %d, time_now %ldus,time_last %ldus,average time difference %ldns, CURRENT TIME DIFF %dus, avgerage difference from the target %dus\n", sleep_time_us,frame, time_now,time_last,td_avg, td/1000,(td_avg-TARGET_SF_TIME_NS)/1000);
|
||||
}
|
||||
} // end if next_slot%2
|
||||
} // if Channel_Flag==0
|
||||
} // if Channel_Flag==0
|
||||
|
||||
} //end of slot
|
||||
|
||||
@@ -955,19 +936,16 @@ void *l2l1_task(void *args_p) {
|
||||
}
|
||||
#endif
|
||||
|
||||
// calibrate at the end of each frame if there is some time left
|
||||
if ((sleep_time_us > 0) && (ethernet_flag == 0)) {
|
||||
LOG_I(EMU, "[TIMING] Adjust average frame duration, sleep for %d us\n", sleep_time_us);
|
||||
//usleep (sleep_time_us);
|
||||
sleep_time_us = 0; // reset the timer, could be done per n SF
|
||||
}
|
||||
#ifdef SMBV
|
||||
if ((frame == config_frames[0]) || (frame == config_frames[1]) || (frame == config_frames[2]) || (frame == config_frames[3])) {
|
||||
smbv_frame_cnt++;
|
||||
}
|
||||
#endif
|
||||
stop_meas(&oaisim_stats_f);
|
||||
} //end of frame
|
||||
|
||||
stop_meas(&oaisim_stats);
|
||||
|
||||
#if defined(ENABLE_ITTI)
|
||||
itti_terminate_tasks(TASK_L2L1);
|
||||
#endif
|
||||
@@ -1011,8 +989,8 @@ int main(int argc, char **argv) {
|
||||
#endif
|
||||
|
||||
// time calibration for soft realtime mode
|
||||
//time_t t0,t1;
|
||||
//clock_t start, stop;
|
||||
char pbch_file_path[512];
|
||||
FILE *pbch_file_fd;
|
||||
|
||||
#ifdef PROC
|
||||
int node_id;
|
||||
@@ -1085,7 +1063,10 @@ int main(int argc, char **argv) {
|
||||
smbv_init_config(smbv_fname, smbv_nframes);
|
||||
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0]->lte_frame_parms);
|
||||
#endif
|
||||
|
||||
// oai performance profiler is enabled
|
||||
if (oai_emulation.info.opp_enabled == 1)
|
||||
reset_opp_meas();
|
||||
|
||||
init_time ();
|
||||
|
||||
init_slot_isr ();
|
||||
@@ -1125,6 +1106,9 @@ int main(int argc, char **argv) {
|
||||
if (oai_emulation.info.otg_enabled == 1)
|
||||
kpi_gen ();
|
||||
|
||||
if (oai_emulation.info.opp_enabled == 1)
|
||||
print_opp_meas();
|
||||
|
||||
// relase all rx state
|
||||
if (ethernet_flag == 1) {
|
||||
emu_transport_release ();
|
||||
@@ -1200,6 +1184,266 @@ int main(int argc, char **argv) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
void reset_opp_meas(void){
|
||||
u8 eNB_id=0,UE_id=0;
|
||||
|
||||
reset_meas(&oaisim_stats);
|
||||
reset_meas(&oaisim_stats_f); // frame
|
||||
|
||||
// init time stats here (including channel)
|
||||
reset_meas(&dl_chan_stats);
|
||||
reset_meas(&ul_chan_stats);
|
||||
|
||||
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->phy_proc);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->phy_proc_rx);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->phy_proc_tx);
|
||||
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ofdm_demod_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->rx_dft_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_channel_estimation_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_freq_offset_estimation_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_decoding_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_rate_unmatching_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_turbo_decoding_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_deinterleaving_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_llr_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_unscrambling_stats);
|
||||
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_init_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_alpha_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_beta_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_gamma_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_ext_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_intl1_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_intl2_stats);
|
||||
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->tx_prach);
|
||||
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ofdm_mod_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_encoding_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_modulation_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_segmentation_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_rate_matching_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_turbo_encoding_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_interleaving_stats);
|
||||
reset_meas(&PHY_vars_UE_g[UE_id]->ulsch_multiplexing_stats);
|
||||
/*
|
||||
* L2 functions
|
||||
*/
|
||||
|
||||
// UE MAC
|
||||
reset_meas(&UE_mac_inst[UE_id].ue_scheduler); // total
|
||||
reset_meas(&UE_mac_inst[UE_id].tx_ulsch_sdu); // inlcude rlc_data_req + mac header gen
|
||||
reset_meas(&UE_mac_inst[UE_id].rx_dlsch_sdu); // include mac_rrc_data_ind or mac_rlc_status_ind+mac_rlc_data_ind and mac header parser
|
||||
reset_meas(&UE_mac_inst[UE_id].ue_query_mch);
|
||||
reset_meas(&UE_mac_inst[UE_id].rx_mch_sdu); // include rld_data_ind+ parse mch header
|
||||
reset_meas(&UE_mac_inst[UE_id].rx_si); // include rlc_data_ind + mac header parser
|
||||
|
||||
reset_meas(&UE_pdcp_stats[UE_id].pdcp_run);
|
||||
reset_meas(&UE_pdcp_stats[UE_id].data_req);
|
||||
reset_meas(&UE_pdcp_stats[UE_id].data_ind);
|
||||
/* reset_meas(&UE_pdcp_stats[UE_id].encrption);
|
||||
reset_meas(&UE_pdcp_stats[UE_id].decrption);
|
||||
reset_meas(&UE_pdcp_stats[UE_id].pdcp_ip);
|
||||
reset_meas(&UE_pdcp_stats[UE_id].ip_pdcp);
|
||||
*/
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->phy_proc);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->phy_proc_rx);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->phy_proc_tx);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->rx_prach);
|
||||
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ofdm_mod_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_encoding_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_modulation_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_scrambling_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_rate_matching_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_turbo_encoding_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_interleaving_stats);
|
||||
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->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]->ulsch_decoding_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_demodulation_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_rate_unmatching_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_turbo_decoding_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_deinterleaving_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_demultiplexing_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_llr_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_init_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_alpha_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_beta_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_gamma_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_ext_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_intl1_stats);
|
||||
reset_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_intl2_stats);
|
||||
|
||||
reset_meas(&eNB2UE[eNB_id][UE_id]->random_channel);
|
||||
reset_meas(&eNB2UE[eNB_id][UE_id]->interp_time);
|
||||
reset_meas(&eNB2UE[eNB_id][UE_id]->interp_freq);
|
||||
reset_meas(&eNB2UE[eNB_id][UE_id]->convolution);
|
||||
reset_meas(&UE2eNB[UE_id][eNB_id]->random_channel);
|
||||
reset_meas(&UE2eNB[UE_id][eNB_id]->interp_time);
|
||||
reset_meas(&UE2eNB[UE_id][eNB_id]->interp_freq);
|
||||
reset_meas(&UE2eNB[UE_id][eNB_id]->convolution);
|
||||
/*
|
||||
* 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[UE_id].pdcp_run);
|
||||
reset_meas(&eNB_pdcp_stats[UE_id].data_req);
|
||||
reset_meas(&eNB_pdcp_stats[UE_id].data_ind);
|
||||
/*
|
||||
reset_meas(&eNB_pdcp_stats[UE_id].encrption);
|
||||
reset_meas(&eNB_pdcp_stats[UE_id].decrption);
|
||||
reset_meas(&eNB_pdcp_stats[UE_id].pdcp_ip);
|
||||
reset_meas(&eNB_pdcp_stats[UE_id].ip_pdcp);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void print_opp_meas(void){
|
||||
u8 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);
|
||||
|
||||
print_meas(&dl_chan_stats,"[DL][chan_stats]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&ul_chan_stats,"[UL][chan_stats]", &oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) {
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
print_meas(&eNB2UE[eNB_id][UE_id]->random_channel,"[DL][random_channel]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB2UE[eNB_id][UE_id]->interp_time,"[DL][interp_time]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB2UE[eNB_id][UE_id]->interp_freq,"[DL][interp_freq]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB2UE[eNB_id][UE_id]->convolution,"[DL][convolution]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&UE2eNB[UE_id][eNB_id]->random_channel,"[UL][random_channel]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE2eNB[UE_id][eNB_id]->interp_time,"[UL][interp_time]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE2eNB[UE_id][eNB_id]->interp_freq,"[UL][interp_freq]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE2eNB[UE_id][eNB_id]->convolution,"[UL][convolution]",&oaisim_stats,&oaisim_stats_f);
|
||||
}
|
||||
}
|
||||
|
||||
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) {
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->phy_proc,"[UE][total_phy_proc]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->phy_proc_rx,"[UE][total_phy_proc_rx]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ofdm_demod_stats,"[UE][ofdm_demod]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->rx_dft_stats,"[UE][rx_dft]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_channel_estimation_stats,"[UE][channel_est]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_freq_offset_estimation_stats,"[UE][freq_offset]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_llr_stats,"[UE][llr]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_unscrambling_stats,"[UE][unscrambling]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_decoding_stats,"[UE][decoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_rate_unmatching_stats,"[UE][rate_unmatching]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_deinterleaving_stats,"[UE][deinterleaving]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_turbo_decoding_stats,"[UE][turbo_decoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_init_stats,"[UE][ |_tc_init]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_alpha_stats,"[UE][ |_tc_alpha]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_beta_stats,"[UE][ |_tc_beta]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_gamma_stats,"[UE][ |_tc_gamma]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_ext_stats,"[UE][ |_tc_ext]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_intl1_stats,"[UE][ |_tc_intl1]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->dlsch_tc_intl2_stats,"[UE][ |_tc_intl2]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->phy_proc_tx,"[UE][total_phy_proc_tx]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ofdm_mod_stats,"[UE][ofdm_mod]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_modulation_stats,"[UE][modulation]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_encoding_stats,"[UE][encoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_segmentation_stats,"[UE][segmentation]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_rate_matching_stats,"[UE][rate_matching]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_turbo_encoding_stats,"[UE][turbo_encoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_interleaving_stats,"[UE][interleaving]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_UE_g[UE_id]->ulsch_multiplexing_stats,"[UE][multiplexing]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
}
|
||||
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->phy_proc,"[eNB][total_phy_proc]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->phy_proc_rx,"[eNB][total_phy_proc_rx]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ofdm_mod_stats,"[eNB][ofdm_mod]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_modulation_stats,"[eNB][modulation]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_scrambling_stats,"[eNB][scrambling]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_encoding_stats,"[eNB][encoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_interleaving_stats,"[eNB][|_interleaving]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_rate_matching_stats,"[eNB][|_rate_matching]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->dlsch_turbo_encoding_stats,"[eNB][|_turbo_encoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->phy_proc_tx,"[eNB][total_phy_proc_tx]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ofdm_demod_stats,"[eNB][ofdm_demod]",&oaisim_stats,&oaisim_stats_f);
|
||||
//print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_channel_estimation_stats,"[eNB][channel_est]");
|
||||
//print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_freq_offset_estimation_stats,"[eNB][freq_offset]");
|
||||
//print_meas(&PHY_vars_eNB_g[eNB_id]->rx_dft_stats,"[eNB][rx_dft]");
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_demodulation_stats,"[eNB][demodulation]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_decoding_stats,"[eNB][decoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_deinterleaving_stats,"[eNB][|_deinterleaving]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_demultiplexing_stats,"[eNB][|_demultiplexing]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_rate_unmatching_stats,"[eNB][|_rate_unmatching]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_turbo_decoding_stats,"[eNB][|_turbo_decoding]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_init_stats,"[eNB][ |_tc_init]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_alpha_stats,"[eNB][ |_tc_alpha]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_beta_stats,"[eNB][ |_tc_beta]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_gamma_stats,"[eNB][ |_tc_gamma]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_ext_stats,"[eNB][ |_tc_ext]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_intl1_stats,"[eNB][ |_tc_intl1]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->ulsch_tc_intl2_stats,"[eNB][ |_tc_intl2]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&PHY_vars_eNB_g[eNB_id]->rx_prach,"[eNB][rx_prach]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
}
|
||||
|
||||
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) {
|
||||
|
||||
print_meas(&UE_mac_inst[UE_id].ue_scheduler,"[UE][mac_scheduler]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_mac_inst[UE_id].tx_ulsch_sdu,"[UE][tx_ulsch_sdu]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_mac_inst[UE_id].rx_dlsch_sdu,"[UE][rx_dlsch_sdu]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_mac_inst[UE_id].ue_query_mch,"[UE][query_MCH]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_mac_inst[UE_id].rx_mch_sdu,"[UE][rx_mch_sdu]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_mac_inst[UE_id].rx_si,"[UE][rx_si]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&UE_pdcp_stats[UE_id].pdcp_run,"[UE][total_pdcp_run]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_pdcp_stats[UE_id].data_req,"[UE][DL][pdcp_data_req]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&UE_pdcp_stats[UE_id].data_ind,"[UE][UL][pdcp_data_ind]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
}
|
||||
|
||||
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
|
||||
|
||||
print_meas(&eNB_mac_inst[eNB_id].eNB_scheduler,"[eNB][mac_scheduler]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].schedule_si,"[eNB][DL][SI]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].schedule_ra,"[eNB][DL][RA]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].fill_DLSCH_dci,"[eNB][DL/UL][fill_DCI]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].schedule_dlsch_preprocessor,"[eNB][DL][preprocessor]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].schedule_dlsch,"[eNB][DL][schedule_tx_dlsch]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].schedule_mch,"[eNB][DL][mch]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].schedule_ulsch,"[eNB][UL][ULSCH]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_mac_inst[eNB_id].rx_ulsch_sdu,"[eNB][UL][rx_ulsch_sdu]",&oaisim_stats,&oaisim_stats_f);
|
||||
|
||||
print_meas(&eNB_pdcp_stats[UE_id].pdcp_run,"[eNB][pdcp_run]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_pdcp_stats[UE_id].data_req,"[eNB][DL][pdcp_data_req]",&oaisim_stats,&oaisim_stats_f);
|
||||
print_meas(&eNB_pdcp_stats[UE_id].data_ind,"[eNB][UL][pdcp_data_ind]",&oaisim_stats,&oaisim_stats_f);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static void *sigh(void *arg) {
|
||||
|
||||
|
||||
@@ -45,4 +45,16 @@ void do_OFDM_mod(mod_sym_t **txdataF, s32 **txdata, frame_t frame, u16 next_slot
|
||||
#ifdef OPENAIR2
|
||||
int omv_write (int pfd, Node_list enb_node_list, Node_list ue_node_list, Data_Flow_Unit omv_data);
|
||||
void omv_end (int pfd, Data_Flow_Unit omv_data);
|
||||
|
||||
void reset_opp_meas(void);
|
||||
void print_opp_meas(void);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -337,6 +337,8 @@ void init_oai_emulation() {
|
||||
oai_emulation.info.cli_enabled=0;// I flag
|
||||
oai_emulation.info.omv_enabled =0; // v flag
|
||||
oai_emulation.info.vcd_enabled=0;
|
||||
oai_emulation.info.opp_enabled=0;
|
||||
|
||||
oai_emulation.info.cba_group_active=0;
|
||||
oai_emulation.info.eMBMS_active_state=0;
|
||||
oai_emulation.info.handover_active=0;
|
||||
|
||||
@@ -58,7 +58,7 @@ int for_times = 0;
|
||||
static char *conf_config_file_name = NULL;
|
||||
u16 Nid_cell = 0; //needed by init_lte_vars
|
||||
int nb_antennas_rx = 2; // //
|
||||
u8 target_dl_mcs = 0;
|
||||
u8 target_dl_mcs = 0; // not set
|
||||
u8 rate_adaptation_flag = 0;
|
||||
u8 set_sinr = 0;
|
||||
double snr_dB, sinr_dB;
|
||||
@@ -72,7 +72,7 @@ double forgetting_factor = 0.0;
|
||||
u8 beta_ACK = 0;
|
||||
u8 beta_RI = 0;
|
||||
u8 beta_CQI = 2;
|
||||
u8 target_ul_mcs = 2;
|
||||
u8 target_ul_mcs = 4;
|
||||
LTE_DL_FRAME_PARMS *frame_parms = NULL;
|
||||
int map1,map2;
|
||||
double **ShaF = NULL;
|
||||
@@ -123,7 +123,8 @@ extern pdcp_mbms_t pdcp_mbms_array_ue[NUMBER_OF_UE_MAX][maxServiceCount][maxSess
|
||||
extern pdcp_mbms_t pdcp_mbms_array_eNB[NUMBER_OF_eNB_MAX][maxServiceCount][maxSessionPerPMCH];
|
||||
#endif
|
||||
|
||||
extern void help (void);
|
||||
extern time_stats_t dl_chan_stats;
|
||||
extern time_stats_t ul_chan_stats;
|
||||
|
||||
void get_simulation_options(int argc, char *argv[]) {
|
||||
int option;
|
||||
@@ -182,7 +183,7 @@ void get_simulation_options(int argc, char *argv[]) {
|
||||
{NULL, 0, NULL, 0}
|
||||
};
|
||||
|
||||
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:qQ:rR:s:S:t:T:u:U:vV:w:W:x:X:y:Y:z:Z:", long_options, NULL)) != -1) {
|
||||
switch (option) {
|
||||
case LONG_OPTION_ENB_CONF:
|
||||
if (optarg) {
|
||||
@@ -474,7 +475,11 @@ void get_simulation_options(int argc, char *argv[]) {
|
||||
}
|
||||
oai_emulation.info.opt_mode = opt_type;
|
||||
break;
|
||||
|
||||
case 'q':
|
||||
// openair performane profiler
|
||||
oai_emulation.info.opp_enabled = 1; // this var is used for OCG
|
||||
opp_enabled = 1; // this is the global var used by oaisim
|
||||
break;
|
||||
case 'Q':
|
||||
//eMBMS_active=1;
|
||||
// 0 : not used (default), 1: eMBMS and RRC enabled, 2: eMBMS relaying and RRC enabled, 3: eMBMS enabled, RRC disabled, 4: eMBMS relaying enabled, RRC disabled
|
||||
@@ -507,9 +512,7 @@ void get_simulation_options(int argc, char *argv[]) {
|
||||
break;
|
||||
|
||||
case 't':
|
||||
//Td = atof (optarg);
|
||||
printf("[SIM] Option t is no longer supported on the command line. Please specify your channel model in the xml template\n");
|
||||
exit(-1);
|
||||
target_ul_mcs = atoi (optarg);
|
||||
break;
|
||||
|
||||
case 'T':
|
||||
@@ -856,7 +859,10 @@ void init_ocm() {
|
||||
get_beta_map_up();
|
||||
#endif
|
||||
get_MIESM_param();
|
||||
|
||||
//load_pbch_desc();
|
||||
}
|
||||
|
||||
|
||||
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
|
||||
enb_data[eNB_id] = (node_desc_t *)malloc(sizeof(node_desc_t));
|
||||
@@ -912,7 +918,7 @@ void init_ocm() {
|
||||
forgetting_factor,
|
||||
0,
|
||||
0);
|
||||
random_channel(eNB2UE[eNB_id][UE_id]);
|
||||
random_channel(eNB2UE[eNB_id][UE_id],abstraction_flag);
|
||||
LOG_D(OCM,"[SIM] Initializing channel (%s, %d) from UE %d to eNB %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
|
||||
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),UE_id, eNB_id);
|
||||
|
||||
@@ -924,15 +930,12 @@ void init_ocm() {
|
||||
0,
|
||||
0);
|
||||
|
||||
random_channel(UE2eNB[UE_id][eNB_id]);
|
||||
}
|
||||
random_channel(UE2eNB[UE_id][eNB_id],abstraction_flag);
|
||||
|
||||
// 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.
|
||||
//UE2eNB[UE_id][eNB_id] = eNB2UE[eNB_id][UE_id];
|
||||
}
|
||||
}
|
||||
|
||||
// Not needed anymore, done automatically in init_freq_channel upon first call to the function
|
||||
|
||||
// if (abstraction_flag==1)
|
||||
// init_freq_channel(eNB2UE[0][0],PHY_vars_UE_g[0]->lte_frame_parms.N_RB_DL,PHY_vars_UE_g[0]->lte_frame_parms.N_RB_DL*12+1);
|
||||
freq_channel(eNB2UE[0][0],PHY_vars_UE_g[0]->lte_frame_parms.N_RB_DL,PHY_vars_UE_g[0]->lte_frame_parms.N_RB_DL*12+1);
|
||||
}
|
||||
|
||||
void init_otg_pdcp_buffer() {
|
||||
|
||||
@@ -40,6 +40,8 @@ void init_time();
|
||||
|
||||
void init_pad();
|
||||
|
||||
void help(void);
|
||||
|
||||
int init_slot_isr(void);
|
||||
|
||||
void wait_for_slot_isr(void);
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
#define PI 3.1416
|
||||
#define Am 20
|
||||
#define MCS_COUNT 24
|
||||
|
||||
#define MCL (-70) /*minimum coupling loss (MCL) in dB*/
|
||||
//double sinr[NUMBER_OF_eNB_MAX][2*25];
|
||||
/*
|
||||
@@ -169,7 +169,7 @@ void calc_path_loss(node_desc_t* enb_data, node_desc_t* ue_data, channel_desc_t
|
||||
|
||||
path_loss = env_desc.fading.free_space_model_parameters.pathloss_0_dB -
|
||||
10*env_desc.fading.free_space_model_parameters.pathloss_exponent * log10(dist/1000);
|
||||
//printf("dist %f, Path loss %f\n",dist,ch_desc->path_loss_dB);
|
||||
LOG_D(OCM,"dist %f, Path loss %f\n",dist,ch_desc->path_loss_dB);
|
||||
|
||||
/* Calculating the angle in the range -pi to pi from the slope */
|
||||
alpha = atan2((ue_data->x - enb_data->x), (ue_data->y - enb_data->y));
|
||||
@@ -522,20 +522,13 @@ void get_beta_map() {
|
||||
file_path = (char*) malloc(512);
|
||||
|
||||
for (mcs = 0; mcs < MCS_COUNT; mcs++) {
|
||||
sprintf(file_path,"%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/Perf_Curves_Abs/awgn_bler_tx1_mcs%d.csv",getenv("OPENAIR1_DIR"),mcs);
|
||||
sprintf(file_path,"%s/SIMULATION/LTE_PHY/BLER_SIMULATIONS/AWGN/AWGN_results/bler_tx1_chan18_nrx1_mcs%d.csv",getenv("OPENAIR1_DIR"),mcs);
|
||||
fp = fopen(file_path,"r");
|
||||
if (fp == NULL) {
|
||||
LOG_W(OCM,"ERROR: Unable to open the file %s, try an alternative path\n", file_path);
|
||||
memset(file_path, 0, 512);
|
||||
sprintf(file_path,"AWGN/awgn_snr_bler_mcs%d.csv",mcs);
|
||||
LOG_I(OCM,"Opening the alternative path %s\n", file_path);
|
||||
fp = fopen(file_path,"r");
|
||||
if (fp == NULL) {
|
||||
LOG_E(OCM,"ERROR: Unable to open the file %s, exisitng\n", file_path);
|
||||
LOG_E(OCM,"ERROR: Unable to open the file %s! Exitng.\n", file_path);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
// else {
|
||||
// else {
|
||||
if (fgets (buffer, 1000, fp) != NULL) {
|
||||
if (fgets (buffer, 1000, fp) != NULL) {
|
||||
table_length[mcs] = 0;
|
||||
@@ -551,6 +544,10 @@ void get_beta_map() {
|
||||
sinr_bler_map[mcs][0][table_length[mcs]] = perf_array[0];
|
||||
sinr_bler_map[mcs][1][table_length[mcs]] = (perf_array[4] / perf_array[5]);
|
||||
table_length[mcs]++;
|
||||
if (table_length[mcs]>MCS_TABLE_LENGTH_MAX) {
|
||||
LOG_E(OCM,"Error reading MCS table. Increase MCS_TABLE_LENGTH_MAX (mcs %d)!\n",mcs);
|
||||
exit(-1);
|
||||
}
|
||||
}
|
||||
if (fgets (buffer, 1000, fp) != NULL) {
|
||||
}
|
||||
@@ -560,10 +557,8 @@ void get_beta_map() {
|
||||
fclose(fp);
|
||||
// }
|
||||
LOG_D(OCM,"Print the table for mcs %d\n",mcs);
|
||||
// printf("Print the table for mcs %d\n",mcs);
|
||||
for (t = 0; t<table_length[mcs]; t++)
|
||||
LOG_D(OCM,"%lf %lf \n ",sinr_bler_map[mcs][0][t],sinr_bler_map[mcs][1][t]);
|
||||
// printf("%lf %lf \n ",sinr_bler_map[mcs][0][t],sinr_bler_map[mcs][1][t]);
|
||||
}
|
||||
free(file_path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user