Commit a7721ae2 authored by Raymond Knopp's avatar Raymond Knopp

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5700 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 83c3acd0
......@@ -191,6 +191,7 @@ endif
endif
endif
CFLAGS += -DMAX_NUM_CCs=1
include $(OPENAIR1_DIR)/PHY/Makefile.inc
include $(OPENAIR1_DIR)/SCHED/Makefile.inc
include $(OPENAIR2_DIR)/RRC/LITE/MESSAGES/Makefile.inc
......
......@@ -111,11 +111,12 @@ void do_OFDM_mod(mod_sym_t **txdataF, int32_t **txdata, uint32_t frame,uint16_t
void do_DL_sig(double **r_re0,double **r_im0,
double **r_re,double **r_im,
double **s_re,double **s_im,
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX],
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs],
node_desc_t *enb_data[NUMBER_OF_eNB_MAX],
node_desc_t *ue_data[NUMBER_OF_UE_MAX],
uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,
uint8_t UE_id) {
uint8_t UE_id,
int CC_id) {
int32_t att_eNB_id=-1;
int32_t **txdata,**rxdata;
......@@ -129,8 +130,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
double min_path_loss=-200;
uint8_t hold_channel=0;
// uint8_t aatx,aarx;
uint8_t nb_antennas_rx = eNB2UE[0][0]->nb_rx; // number of rx antennas at UE
uint8_t nb_antennas_tx = eNB2UE[0][0]->nb_tx; // number of tx antennas at eNB
uint8_t nb_antennas_rx = eNB2UE[0][0][CC_id]->nb_rx; // number of rx antennas at UE
uint8_t nb_antennas_tx = eNB2UE[0][0][CC_id]->nb_tx; // number of tx antennas at eNB
int subframe_sched = ((next_slot>>1) == 0) ? 9 : ((next_slot>>1)-1);
......@@ -146,17 +147,17 @@ void do_DL_sig(double **r_re0,double **r_im0,
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],abstraction_flag);
random_channel(eNB2UE[eNB_id][UE_id][CC_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);
*/
freq_channel(eNB2UE[eNB_id][UE_id], frame_parms->N_RB_DL,frame_parms->N_RB_DL*12+1);
freq_channel(eNB2UE[eNB_id][UE_id][CC_id], frame_parms->N_RB_DL,frame_parms->N_RB_DL*12+1);
}
// find out which eNB the UE is attached to
for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) {
if (find_ue(PHY_vars_UE_g[UE_id]->lte_ue_pdcch_vars[0]->crnti,PHY_vars_eNB_g[eNB_id])>=0) {
if (find_ue(PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti,PHY_vars_eNB_g[eNB_id][CC_id])>=0) {
// UE with UE_id is connected to eNb with eNB_id
att_eNB_id=eNB_id;
LOG_D(OCM,"A: UE attached to eNB (UE%d->eNB%d)\n",UE_id,eNB_id);
......@@ -166,8 +167,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
// 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<eNB2UE[eNB_id][UE_id]->path_loss_dB) {
min_path_loss = eNB2UE[eNB_id][UE_id]->path_loss_dB;
if (min_path_loss<eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB) {
min_path_loss = eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB;
att_eNB_id=eNB_id;
LOG_D(OCM,"B: UE attached to eNB (UE%d->eNB%d)\n",UE_id,eNB_id);
}
......@@ -180,20 +181,20 @@ void do_DL_sig(double **r_re0,double **r_im0,
}
#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);
rx_pwr = signal_energy_fp2(eNB2UE[att_eNB_id][UE_id][CC_id]->ch[0],
eNB2UE[att_eNB_id][UE_id][CC_id]->channel_length)*eNB2UE[att_eNB_id][UE_id][CC_id]->channel_length;
LOG_D(OCM,"Channel (CCid %d) eNB %d => UE %d : tx_power %d dBm, path_loss %f dB\n",
CC_id,att_eNB_id,UE_id,
PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower,
eNB2UE[att_eNB_id][UE_id][CC_id]->path_loss_dB);
#endif
//dlsch_abstraction(PHY_vars_UE_g[UE_id]->sinr_dB, rb_alloc, 8);
// fill in perfect channel estimates
channel_desc_t *desc1 = eNB2UE[att_eNB_id][UE_id];
int32_t **dl_channel_est = PHY_vars_UE_g[UE_id]->lte_ue_common_vars.dl_ch_estimates[0];
channel_desc_t *desc1 = eNB2UE[att_eNB_id][UE_id][CC_id];
int32_t **dl_channel_est = PHY_vars_UE_g[UE_id][CC_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);
double scale = pow(10.0,(PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower+eNB2UE[att_eNB_id][UE_id][CC_id]->path_loss_dB + (double) PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB)/20.0);
//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)));
......@@ -231,12 +232,12 @@ void do_DL_sig(double **r_re0,double **r_im0,
*/
// 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);
init_snr(eNB2UE[att_eNB_id][UE_id][CC_id], enb_data[att_eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB, &PHY_vars_UE_g[UE_id][CC_id]->N0, PHY_vars_UE_g[UE_id][CC_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id][CC_id]->eNB_UE_stats[UE_id].DL_pmi_single,PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off);
// calculate sinr here
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
if (att_eNB_id != eNB_id) {
calculate_sinr(eNB2UE[eNB_id][UE_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id]->sinr_dB);
calculate_sinr(eNB2UE[eNB_id][UE_id][CC_id], enb_data[eNB_id], ue_data[UE_id], PHY_vars_UE_g[UE_id][CC_id]->sinr_dB);
}
}
} // hold channel
......@@ -248,12 +249,12 @@ void do_DL_sig(double **r_re0,double **r_im0,
*/
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],
PHY_vars_eNB_g[eNB_id]->proc[subframe_sched].frame_tx,next_slot,
&PHY_vars_eNB_g[eNB_id]->lte_frame_parms);
stop_meas(&PHY_vars_eNB_g[eNB_id]->ofdm_mod_stats);
start_meas(&PHY_vars_eNB_g[eNB_id][CC_id]->ofdm_mod_stats);
do_OFDM_mod(PHY_vars_eNB_g[eNB_id][CC_id]->lte_eNB_common_vars.txdataF[0],
PHY_vars_eNB_g[eNB_id][CC_id]->lte_eNB_common_vars.txdata[0],
PHY_vars_eNB_g[eNB_id][CC_id]->proc[subframe_sched].frame_tx,next_slot,
&PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms);
stop_meas(&PHY_vars_eNB_g[eNB_id][CC_id]->ofdm_mod_stats);
}
//for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
......@@ -279,8 +280,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
// if (((double)PHY_vars_UE_g[UE_id]->tx_power_dBm +
// eNB2UE[eNB_id][UE_id]->path_loss_dB) <= -107.0)
// break;
frame_parms = &PHY_vars_eNB_g[eNB_id]->lte_frame_parms;
txdata = PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdata[0];
frame_parms = &PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms;
txdata = PHY_vars_eNB_g[eNB_id][CC_id]->lte_eNB_common_vars.txdata[0];
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
slot_offset_meas = ((next_slot&1)==0) ? slot_offset : (slot_offset-(frame_parms->samples_per_tti>>1));
tx_pwr = dac_fixed_gain(s_re,
......@@ -293,48 +294,48 @@ void do_DL_sig(double **r_re0,double **r_im0,
frame_parms->ofdm_symbol_size,
14,
// enb_data[eNB_id]->tx_power_dBm);
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower);
PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower);
#ifdef DEBUG_SIM
LOG_D(OCM,"[SIM][DL] eNB %d: tx_pwr %f dBm, for slot %d (subframe %d)\n",
eNB_id,
LOG_D(OCM,"[SIM][DL] eNB %d (CCid %d): tx_pwr %f dBm, for slot %d (subframe %d)\n",
eNB_id,CC_id,
10*log10(tx_pwr),
next_slot,
next_slot>>1);
#endif
//eNB2UE[eNB_id][UE_id]->path_loss_dB = 0;
multipath_channel(eNB2UE[eNB_id][UE_id],s_re,s_im,r_re0,r_im0,
multipath_channel(eNB2UE[eNB_id][UE_id][CC_id],s_re,s_im,r_re0,r_im0,
frame_parms->samples_per_tti>>1,hold_channel);
#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,"[SIM][DL] Channel eNB %d => UE %d : Channel gain %f dB (%f)\n",eNB_id,UE_id,10*log10(rx_pwr),rx_pwr);
rx_pwr = signal_energy_fp2(eNB2UE[eNB_id][UE_id][CC_id]->ch[0],
eNB2UE[eNB_id][UE_id][CC_id]->channel_length)*eNB2UE[eNB_id][UE_id][CC_id]->channel_length;
LOG_D(OCM,"[SIM][DL] Channel eNB %d => UE %d (CCid %d): Channel gain %f dB (%f)\n",eNB_id,UE_id,CC_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].x,eNB2UE[eNB_id][UE_id]->ch[0][i].y);
for (i=0;i<eNB2UE[eNB_id][UE_id][CC_id]->channel_length;i++)
printf("ch(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id][CC_id]->ch[0][i].x,eNB2UE[eNB_id][UE_id][CC_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",
eNB_id,UE_id,
(double)PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower,
LOG_D(OCM,"[SIM][DL] Channel eNB %d => UE %d (CCid %d): tx_power %f dBm, path_loss %f dB\n",
eNB_id,UE_id,CC_id,
(double)PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower,
// enb_data[eNB_id]->tx_power_dBm,
eNB2UE[eNB_id][UE_id]->path_loss_dB);
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB);
#ifdef DEBUG_SIM
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)
eNB2UE[eNB_id][UE_id]->first_run = 0;
if (eNB2UE[eNB_id][UE_id][CC_id]->first_run == 1)
eNB2UE[eNB_id][UE_id][CC_id]->first_run = 0;
// RF model
#ifdef DEBUG_SIM
LOG_D(OCM,"[SIM][DL] UE %d : rx_gain %d dB for slot %d (subframe %d)\n",UE_id,PHY_vars_UE_g[UE_id]->rx_total_gain_dB,next_slot,next_slot>>1);
LOG_D(OCM,"[SIM][DL] UE %d (CCid %d): rx_gain %d dB for slot %d (subframe %d)\n",UE_id,CC_id,PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB,next_slot,next_slot>>1);
#endif
/*
rf_rx(r_re0,
......@@ -361,8 +362,8 @@ void do_DL_sig(double **r_re0,double **r_im0,
r_im0,
nb_antennas_rx,
frame_parms->samples_per_tti>>1,
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)
1e3/eNB2UE[eNB_id][UE_id][CC_id]->BW, // sampling time (ns)
(double)PHY_vars_UE_g[UE_id][CC_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)
#ifdef DEBUG_SIM
rx_pwr = signal_energy_fp(r_re0,r_im0,nb_antennas_rx,frame_parms->ofdm_symbol_size,0)*512.0/300;
......@@ -383,7 +384,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
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;
rxdata = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.rxdata;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
adc(r_re,
......@@ -409,7 +410,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
}
void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame) {
void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, uint32_t frame,uint8_t CC_id) {
int32_t **txdata,**rxdata;
#ifdef PHY_ABSTRACTION_UL
......@@ -417,8 +418,8 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
#endif
uint8_t eNB_id=0,UE_id=0;
uint8_t nb_antennas_rx = UE2eNB[0][0]->nb_rx; // number of rx antennas at eNB
uint8_t nb_antennas_tx = UE2eNB[0][0]->nb_tx; // number of tx antennas at UE
uint8_t nb_antennas_rx = UE2eNB[0][0][CC_id]->nb_rx; // number of rx antennas at eNB
uint8_t nb_antennas_tx = UE2eNB[0][0][CC_id]->nb_tx; // number of tx antennas at UE
double tx_pwr, rx_pwr;
int32_t rx_pwr2;
......@@ -451,27 +452,27 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
for (UE_id=0;UE_id<NB_UE_INST;UE_id++)
{
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);
random_channel(UE2eNB[UE_id][eNB_id][CC_id],abstraction_flag);
freq_channel(UE2eNB[UE_id][eNB_id][CC_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
rx_pwr = signal_energy_fp2(UE2eNB[UE_id][eNB_id][CC_id]->ch[0],
UE2eNB[UE_id][eNB_id][CC_id]->channel_length)*UE2eNB[UE_id][att_eNB_id][CC_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)
{
harq_pid = subframe2harq_pid(frame_parms,frame,subframe);
ul_nb_rb = PHY_vars_eNB_g[att_eNB_id]->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->nb_rb;
ul_fr_rb = PHY_vars_eNB_g[att_eNB_id]->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->first_rb;
ul_nb_rb = PHY_vars_eNB_g[att_eNB_id][CC_id]->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->nb_rb;
ul_fr_rb = PHY_vars_eNB_g[att_eNB_id][CC_id]->ulsch_eNB[(uint8_t)UE_id]->harq_processes[harq_pid]->first_rb;
}
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);
init_snr_up(UE2eNB[UE_id][att_eNB_id][CC_id],enb_data[att_eNB_id], ue_data[UE_id],PHY_vars_eNB_g[att_eNB_id][CC_id]->sinr_dB,&PHY_vars_UE_g[att_eNB_id][CC_id]->N0,ul_nb_rb,ul_fr_rb);
}
} //UE_id
......@@ -510,13 +511,13 @@ if (abstraction_flag!=0) {
// Compute RX signal for eNB = eNB_id
for (UE_id=0;UE_id<NB_UE_INST;UE_id++){
txdata = PHY_vars_UE_g[UE_id]->lte_ue_common_vars.txdata;
frame_parms = &PHY_vars_UE_g[UE_id]->lte_frame_parms;
txdata = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.txdata;
frame_parms = &PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
slot_offset_meas = ((next_slot&1)==0) ? slot_offset : (slot_offset-(frame_parms->samples_per_tti>>1));
if (((double)PHY_vars_UE_g[UE_id]->tx_power_dBm +
UE2eNB[UE_id][eNB_id]->path_loss_dB) <= -125.0) {
if (((double)PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm +
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB) <= -125.0) {
// don't simulate a UE that is too weak
}
......@@ -531,18 +532,18 @@ if (abstraction_flag!=0) {
slot_offset_meas,
frame_parms->ofdm_symbol_size,
14,
PHY_vars_UE_g[UE_id]->tx_power_dBm);
PHY_vars_UE_g[UE_id][CC_id]->tx_power_dBm);
//ue_data[UE_id]->tx_power_dBm);
#ifdef DEBUG_SIM
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,
multipath_channel(UE2eNB[UE_id][eNB_id][CC_id],s_re,s_im,r_re0,r_im0,
frame_parms->samples_per_tti>>1,hold_channel);
#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;
rx_pwr = signal_energy_fp2(UE2eNB[UE_id][eNB_id][CC_id]->ch[0],
UE2eNB[UE_id][eNB_id][CC_id]->channel_length)*UE2eNB[UE_id][eNB_id][CC_id]->channel_length;
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
......@@ -553,8 +554,8 @@ if (abstraction_flag!=0) {
#endif
if (UE2eNB[UE_id][eNB_id]->first_run == 1)
UE2eNB[UE_id][eNB_id]->first_run = 0;
if (UE2eNB[UE_id][eNB_id][CC_id]->first_run == 1)
UE2eNB[UE_id][eNB_id][CC_id]->first_run = 0;
......@@ -593,15 +594,15 @@ if (abstraction_flag!=0) {
r_im,
nb_antennas_rx,
frame_parms->samples_per_tti>>1,
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)
1e3/UE2eNB[0][eNB_id][CC_id]->BW, // sampling time (ns)
(double)PHY_vars_eNB_g[eNB_id][CC_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)
#ifdef DEBUG_SIM
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];
rxdata = PHY_vars_eNB_g[eNB_id][CC_id]->lte_eNB_common_vars.rxdata[0];
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
adc(r_re,
......
......@@ -334,7 +334,7 @@ void execute_events(frame_t frame){
void update_mac(Event_t event) {
LOG_I(EMU,"A NEW MAC MODEL\n");
int i = 0;
UE_list_t *UE_list;
if(event.optype == READ)
{
......@@ -456,23 +456,24 @@ void update_mac(Event_t event) {
LOG_I(EMU,"update complete mac params \n");
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
if(&mac_config[i].DCI_aggregation_min)
{
LOG_I(EMU,"update dci aggregation min\n");
oai_emulation->mac_config[i].DCI_aggregation_min= mac_config[i].DCI_aggregation_min;
eNB_mac_inst->UE_template[i].DCI_aggregation_min = oai_emulation->mac_config[i].DCI_aggregation_min;
UE_list->UE_template[0][i].DCI_aggregation_min = oai_emulation->mac_config[i].DCI_aggregation_min;
LOG_I(EMU,"DCI_aggregation_min UE %d: \n",i);
LOG_I(EMU,"%" PRIu8,eNB_mac_inst->UE_template[i].DCI_aggregation_min);
LOG_I(EMU,"%" PRIu8,UE_list->UE_template[0][i].DCI_aggregation_min);
}
if(&mac_config[i].DLSCH_dci_size_bits !=NULL)
{
oai_emulation->mac_config[i].DLSCH_dci_size_bits= mac_config[i].DLSCH_dci_size_bits;
eNB_mac_inst->UE_template[i].DLSCH_dci_size_bits = oai_emulation->mac_config[i].DLSCH_dci_size_bits;
UE_list->UE_template[0][i].DLSCH_dci_size_bits = oai_emulation->mac_config[i].DLSCH_dci_size_bits;
LOG_I(EMU,"DLSCH_dci_size_bits UE %d: \n",i);
LOG_I(EMU,"%" PRIu8,eNB_mac_inst->UE_template[i].DLSCH_dci_size_bits);
LOG_I(EMU,"%" PRIu8,UE_list->UE_template[0][i].DLSCH_dci_size_bits);
}
if(mac_config[i].priority !=NULL)
{
......@@ -484,9 +485,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].priority[j]!=NULL)
{
oai_emulation->mac_config[i].priority[j]= mac_config[i].priority[j];
eNB_mac_inst->UE_sched_ctrl[i].priority[j] = oai_emulation->mac_config[i].priority[j];
UE_list->UE_sched_ctrl[i].priority[j] = oai_emulation->mac_config[i].priority[j];
LOG_I(EMU,"priority UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].priority[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].priority[j]);
}
}
}
......@@ -498,9 +499,9 @@ void update_mac(Event_t event) {
{
oai_emulation->mac_config[i].ul_bandwidth[j]= mac_config[i].ul_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].ul_bandwidth[j] = oai_emulation->mac_config[i].ul_bandwidth[j];
UE_list->UE_sched_ctrl[i].ul_bandwidth[j] = oai_emulation->mac_config[i].ul_bandwidth[j];
LOG_I(EMU,"ul_bandwidth UE %d LCID %d:", i, j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].ul_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].ul_bandwidth[j]);
}
}
if(&mac_config[i].dl_bandwidth !=NULL)
......@@ -510,38 +511,38 @@ void update_mac(Event_t event) {
{
oai_emulation->mac_config[i].dl_bandwidth[j]= mac_config[i].dl_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].dl_bandwidth[j] = oai_emulation->mac_config[i].dl_bandwidth[j];
UE_list->UE_sched_ctrl[i].dl_bandwidth[j] = oai_emulation->mac_config[i].dl_bandwidth[j];
LOG_I(EMU,"ul_bandwidth UE %d LCID %d:", i, j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].dl_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].dl_bandwidth[j]);
}
}
if(&mac_config[i].ue_AggregatedMaximumBitrateDL !=NULL)
{
oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL= mac_config[i].ue_AggregatedMaximumBitrateDL;
eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL;
UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateDL UE %d:",i );
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL);
}
if(&mac_config[i].ue_AggregatedMaximumBitrateUL !=NULL)
{
oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL= mac_config[i].ue_AggregatedMaximumBitrateUL;
eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL;
UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateUL UE %d:",i);
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL);
}
if(&mac_config[i].cqiSchedInterval !=NULL)
{
oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval;
eNB_mac_inst->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
LOG_I(EMU,"cqiSchedInterval UE %d:",i);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].cqiSchedInterval);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval);
}
if(&mac_config[i].mac_ContentionResolutionTimer !=NULL)
{
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
eNB_mac_inst->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
}
if(mac_config->max_allowed_rbs !=NULL)
{
......@@ -549,9 +550,9 @@ void update_mac(Event_t event) {
for(j=0;j<MAX_NUM_LCID;j++)
{
oai_emulation->mac_config[i].max_allowed_rbs[j]= mac_config[i].max_allowed_rbs[j];
eNB_mac_inst->UE_sched_ctrl[i].max_allowed_rbs[j] = oai_emulation->mac_config[i].max_allowed_rbs[j];
UE_list->UE_sched_ctrl[i].max_allowed_rbs[j] = oai_emulation->mac_config[i].max_allowed_rbs[j];
LOG_I(EMU,"max_allowed_rbs UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].max_allowed_rbs[j]);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].max_allowed_rbs[j]);
}
}
if(mac_config[i].max_mcs !=NULL)
......@@ -560,9 +561,9 @@ void update_mac(Event_t event) {
for(j=0;j<MAX_NUM_LCID;j++)
{
oai_emulation->mac_config[i].max_mcs[j]= mac_config[i].max_mcs[j];
eNB_mac_inst->UE_sched_ctrl[i].max_mcs[j] = oai_emulation->mac_config[i].max_mcs[j];
UE_list->UE_sched_ctrl[i].max_mcs[j] = oai_emulation->mac_config[i].max_mcs[j];
LOG_I(EMU,"max_mcs UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].max_mcs[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].max_mcs[j]);
}
}
......@@ -581,16 +582,16 @@ void update_mac(Event_t event) {
LOG_I(EMU,"update dci aggregation min\n");
oai_emulation->mac_config[i].DCI_aggregation_min= mac_config[i].DCI_aggregation_min;
// duplication dans le ue template, vérifier la validité avant
eNB_mac_inst->UE_template[i].DCI_aggregation_min = oai_emulation->mac_config[i].DCI_aggregation_min;
UE_list->UE_template[0][i].DCI_aggregation_min = oai_emulation->mac_config[i].DCI_aggregation_min;
LOG_I(EMU,"DCI_aggregation_min UE %d: \n",i);
LOG_I(EMU,"%" PRIu8,eNB_mac_inst->UE_template[i].DCI_aggregation_min);
LOG_I(EMU,"%" PRIu8,UE_list->UE_template[0][i].DCI_aggregation_min);
}
if(&mac_config[i].DLSCH_dci_size_bits !=NULL)
{
oai_emulation->mac_config[i].DLSCH_dci_size_bits= mac_config[i].DLSCH_dci_size_bits;
eNB_mac_inst->UE_template[i].DLSCH_dci_size_bits = oai_emulation->mac_config[i].DLSCH_dci_size_bits;
UE_list->UE_template[0][i].DLSCH_dci_size_bits = oai_emulation->mac_config[i].DLSCH_dci_size_bits;
LOG_I(EMU,"DLSCH_dci_size_bits UE %d: \n",i);
LOG_I(EMU,"%" PRIu8,eNB_mac_inst->UE_template[i].DLSCH_dci_size_bits);
LOG_I(EMU,"%" PRIu8,UE_list->UE_template[0][i].DLSCH_dci_size_bits);
}
if(mac_config[i].priority !=NULL)
{
......@@ -600,9 +601,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].priority[j]!=NULL)
{
oai_emulation->mac_config[i].priority[j]= mac_config[i].priority[j];
eNB_mac_inst->UE_sched_ctrl[i].priority[j] = oai_emulation->mac_config[i].priority[j];
UE_list->UE_sched_ctrl[i].priority[j] = oai_emulation->mac_config[i].priority[j];
LOG_I(EMU,"priority UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].priority[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].priority[j]);
}
}
......@@ -613,79 +614,79 @@ void update_mac(Event_t event) {
oai_emulation->mac_config[i].ul_bandwidth[j]= mac_config[i].ul_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].ul_bandwidth[j] = oai_emulation->mac_config[i].ul_bandwidth[j];
UE_list->UE_sched_ctrl[i].ul_bandwidth[j] = oai_emulation->mac_config[i].ul_bandwidth[j];
LOG_I(EMU,"ul_bandwidth UE %d LCID %d:", i, j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].ul_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].ul_bandwidth[j]);
}
if(&mac_config[i].dl_bandwidth !=NULL)
{
oai_emulation->mac_config[i].dl_bandwidth[j]= mac_config[i].dl_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].dl_bandwidth[j] = oai_emulation->mac_config[i].dl_bandwidth[j];
UE_list->UE_sched_ctrl[i].dl_bandwidth[j] = oai_emulation->mac_config[i].dl_bandwidth[j];
LOG_I(EMU,"ul_bandwidth UE %d LCID %d:", i, j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].dl_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].dl_bandwidth[j]);
}
if(&mac_config[i].min_ul_bandwidth !=NULL)
{
// faire boucle par ue puis par lcid
oai_emulation->mac_config[i].min_ul_bandwidth[j]= mac_config[i].min_ul_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].min_ul_bandwidth[j] = oai_emulation->mac_config[i].min_ul_bandwidth[j];
UE_list->UE_sched_ctrl[i].min_ul_bandwidth[j] = oai_emulation->mac_config[i].min_ul_bandwidth[j];
LOG_I(EMU,"min_ul_bandwidth UE %d LCID %d:", i, j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].min_ul_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].min_ul_bandwidth[j]);
}
if(&mac_config[i].min_dl_bandwidth !=NULL)
{
oai_emulation->mac_config[i].min_dl_bandwidth[j]= mac_config[i].min_dl_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].min_dl_bandwidth[j] = oai_emulation->mac_config[i].min_dl_bandwidth[j];
UE_list->UE_sched_ctrl[i].min_dl_bandwidth[j] = oai_emulation->mac_config[i].min_dl_bandwidth[j];
LOG_I(EMU,"min_dl_bandwidth UE %d LCID %d:", i, j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].min_dl_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].min_dl_bandwidth[j]);
}
if(&mac_config[i].ue_AggregatedMaximumBitrateDL !=NULL)
{
oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL= mac_config[i].ue_AggregatedMaximumBitrateDL;
eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL;
UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateDL UE %d:",i );
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL);
}
if(&mac_config[i].ue_AggregatedMaximumBitrateUL !=NULL)
{
oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL= mac_config[i].ue_AggregatedMaximumBitrateUL;
eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL;
UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateUL UE %d:",i);
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL);
}
if(&mac_config[i].cqiSchedInterval !=NULL)
{
oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval;
eNB_mac_inst->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
LOG_I(EMU,"cqiSchedInterval UE %d:",i);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].cqiSchedInterval);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval);
}
if(&mac_config[i].mac_ContentionResolutionTimer !=NULL)
{
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
eNB_mac_inst->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
LOG_I(EMU,"mac_ContentionResolutionTimer UE %:", i);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
}
if(mac_config->max_allowed_rbs !=NULL)
{
oai_emulation->mac_config[i].max_allowed_rbs[j]= mac_config[i].max_allowed_rbs[j];
eNB_mac_inst->UE_sched_ctrl[i].max_allowed_rbs[j] = oai_emulation->mac_config[i].max_allowed_rbs[j];
UE_list->UE_sched_ctrl[i].max_allowed_rbs[j] = oai_emulation->mac_config[i].max_allowed_rbs[j];
LOG_I(EMU,"max_allowed_rbs UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].max_allowed_rbs[j]);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].max_allowed_rbs[j]);
}
if(mac_config[i].max_mcs !=NULL)
{
oai_emulation->mac_config[i].max_mcs[j]= mac_config[i].max_mcs[j];
eNB_mac_inst->UE_sched_ctrl[i].max_mcs[j] = oai_emulation->mac_config[i].max_mcs[j];
UE_list->UE_sched_ctrl[i].max_mcs[j] = oai_emulation->mac_config[i].max_mcs[j];
LOG_I(EMU,"max_mcs UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].max_mcs[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].max_mcs[j]);
}
}
......@@ -707,9 +708,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].priority[j]!=NULL)
{
oai_emulation->mac_config[i].priority[j]= mac_config[i].priority[j];
eNB_mac_inst->UE_sched_ctrl[i].priority[j] = oai_emulation->mac_config[i].priority[j];
UE_list->UE_sched_ctrl[i].priority[j] = oai_emulation->mac_config[i].priority[j];
LOG_I(EMU,"priority UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].priority[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].priority[j]);
}
}
}
......@@ -717,9 +718,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].priority[event.lcid]= mac_config[event.ue].priority[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].priority[event.lcid] = oai_emulation->mac_config[event.ue].priority[event.lcid];
UE_list->UE_sched_ctrl[event.ue].priority[event.lcid] = oai_emulation->mac_config[event.ue].priority[event.lcid];
LOG_I(EMU,"priority UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].priority[event.lcid]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].priority[event.lcid]);
}
}
else if(!strcmp((char *) event.key, "DCI_aggregation_min") && event.value!=NULL && validate_mac(event))
......@@ -730,20 +731,21 @@ void update_mac(Event_t event) {
LOG_I(EMU,"DCI_aggregation_min update \n");
if(event.ue == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
oai_emulation->mac_config[i].DCI_aggregation_min=mac_config[i].DCI_aggregation_min;
eNB_mac_inst->UE_template[i].DCI_aggregation_min = oai_emulation->mac_config[i].DCI_aggregation_min;
UE_list->UE_template[0][i].DCI_aggregation_min = oai_emulation->mac_config[i].DCI_aggregation_min;
LOG_I(EMU,"DCI_aggregation_min UE %d : \n", i);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_template[i].DCI_aggregation_min);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_template[0][i].DCI_aggregation_min);
}
}
else
{
oai_emulation->mac_config[event.ue].DCI_aggregation_min=mac_config[event.ue].DCI_aggregation_min;
eNB_mac_inst->UE_template[event.ue].DCI_aggregation_min = oai_emulation->mac_config[event.ue].DCI_aggregation_min;
UE_list->UE_template[0][event.ue].DCI_aggregation_min = oai_emulation->mac_config[event.ue].DCI_aggregation_min;
LOG_I(EMU,"DCI_aggregation_min UE %d : \n", event.ue);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_template[event.ue].DCI_aggregation_min);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_template[0][event.ue].DCI_aggregation_min);
}
}
else if(!strcmp((char *) event.key, "DLSCH_dci_size_bits") && event.value!=NULL && validate_mac(event))
......@@ -755,20 +757,21 @@ void update_mac(Event_t event) {
LOG_I(EMU,"DLSCH_dci_size_bits update \n");
if(event.ue == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
oai_emulation->mac_config[i].DLSCH_dci_size_bits=mac_config[i].DLSCH_dci_size_bits;
eNB_mac_inst->UE_template[i].DLSCH_dci_size_bits = oai_emulation->mac_config[i].DLSCH_dci_size_bits;
UE_list->UE_template[0][i].DLSCH_dci_size_bits = oai_emulation->mac_config[i].DLSCH_dci_size_bits;
LOG_I(EMU,"DLSCH_dci_size_bits UE %d: \n", i);
LOG_I(EMU,"%" PRIu8,eNB_mac_inst->UE_template[i].DLSCH_dci_size_bits);
LOG_I(EMU,"%" PRIu8,UE_list->UE_template[0][i].DLSCH_dci_size_bits);
}
}
else
{
oai_emulation->mac_config[event.ue].DLSCH_dci_size_bits=mac_config[event.ue].DLSCH_dci_size_bits;
eNB_mac_inst->UE_template[event.ue].DLSCH_dci_size_bits = oai_emulation->mac_config[event.ue].DLSCH_dci_size_bits;
UE_list->UE_template[0][event.ue].DLSCH_dci_size_bits = oai_emulation->mac_config[event.ue].DLSCH_dci_size_bits;
LOG_I(EMU,"DLSCH_dci_size_bits UE %d: \n", event.ue);
LOG_I(EMU,"%" PRIu8,eNB_mac_inst->UE_template[event.ue].DLSCH_dci_size_bits);
LOG_I(EMU,"%" PRIu8,UE_list->UE_template[0][event.ue].DLSCH_dci_size_bits);
}
}
......@@ -781,7 +784,8 @@ void update_mac(Event_t event) {
int j=0;
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
......@@ -791,9 +795,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].ul_bandwidth[j]!=NULL)
{
oai_emulation->mac_config[i].ul_bandwidth[j]= mac_config[i].ul_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].ul_bandwidth[j] = oai_emulation->mac_config[i].ul_bandwidth[j];
UE_list->UE_sched_ctrl[i].ul_bandwidth[j] = oai_emulation->mac_config[i].ul_bandwidth[j];
LOG_I(EMU,"ul_bandwidth UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].ul_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].ul_bandwidth[j]);
}
}
......@@ -802,9 +806,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].ul_bandwidth[event.lcid]= mac_config[event.ue].ul_bandwidth[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].ul_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].ul_bandwidth[event.lcid];
UE_list->UE_sched_ctrl[event.ue].ul_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].ul_bandwidth[event.lcid];
LOG_I(EMU,"ul_bandwidth UE %d LCID %d:",event.ue, event.lcid);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].ul_bandwidth[event.lcid]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].ul_bandwidth[event.lcid]);
}
}
......@@ -816,7 +820,8 @@ void update_mac(Event_t event) {
int j=0;
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
if(event.value + i !=NULL)
{
......@@ -827,9 +832,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].dl_bandwidth[j]!=NULL)
{
oai_emulation->mac_config[i].dl_bandwidth[j]= mac_config[i].dl_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].dl_bandwidth[j] = oai_emulation->mac_config[i].dl_bandwidth[j];
UE_list->UE_sched_ctrl[i].dl_bandwidth[j] = oai_emulation->mac_config[i].dl_bandwidth[j];
LOG_I(EMU,"dl_bandwidth UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].dl_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].dl_bandwidth[j]);
}
}
}
......@@ -838,9 +843,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].dl_bandwidth[event.lcid]= mac_config[event.ue].dl_bandwidth[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].dl_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].dl_bandwidth[event.lcid];
UE_list->UE_sched_ctrl[event.ue].dl_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].dl_bandwidth[event.lcid];
LOG_I(EMU,"dl_bandwidth UE %d LCID %d:",event.ue, event.lcid);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].dl_bandwidth[event.lcid]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].dl_bandwidth[event.lcid]);
}
}
else if(!strcmp((char *) event.key, "min_ul_bandwidth") && event.value!=NULL)
......@@ -852,7 +857,8 @@ void update_mac(Event_t event) {
int j=0;
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
......@@ -862,9 +868,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].min_ul_bandwidth[j]!=NULL)
{
oai_emulation->mac_config[i].min_ul_bandwidth[j]= mac_config[i].min_ul_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].min_ul_bandwidth[j] = oai_emulation->mac_config[i].min_ul_bandwidth[j];
UE_list->UE_sched_ctrl[i].min_ul_bandwidth[j] = oai_emulation->mac_config[i].min_ul_bandwidth[j];
LOG_I(EMU,"min_ul_bandwidth UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].min_ul_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].min_ul_bandwidth[j]);
}
}
......@@ -873,9 +879,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].min_ul_bandwidth[event.lcid]= mac_config[event.ue].min_ul_bandwidth[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].min_ul_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].min_ul_bandwidth[event.lcid];
UE_list->UE_sched_ctrl[event.ue].min_ul_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].min_ul_bandwidth[event.lcid];
LOG_I(EMU,"min_ul_bandwidth UE %d LCID %d:",event.ue, event.lcid);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].min_ul_bandwidth[event.lcid]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].min_ul_bandwidth[event.lcid]);
}
}
......@@ -887,7 +893,8 @@ void update_mac(Event_t event) {
int j=0;
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
if(event.value + i !=NULL)
{
......@@ -898,9 +905,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].min_dl_bandwidth[j]!=NULL)
{
oai_emulation->mac_config[i].min_dl_bandwidth[j]= mac_config[i].min_dl_bandwidth[j];
eNB_mac_inst->UE_sched_ctrl[i].min_dl_bandwidth[j] = oai_emulation->mac_config[i].min_dl_bandwidth[j];
UE_list->UE_sched_ctrl[i].min_dl_bandwidth[j] = oai_emulation->mac_config[i].min_dl_bandwidth[j];
LOG_I(EMU,"dl_bandwidth UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].min_dl_bandwidth[j]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].min_dl_bandwidth[j]);
}
}
}
......@@ -909,9 +916,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].min_dl_bandwidth[event.lcid]= mac_config[event.ue].min_dl_bandwidth[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].min_dl_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].min_dl_bandwidth[event.lcid];
UE_list->UE_sched_ctrl[event.ue].min_dl_bandwidth[event.lcid] = oai_emulation->mac_config[event.ue].min_dl_bandwidth[event.lcid];
LOG_I(EMU,"min_dl_bandwidth UE %d LCID %d:",event.ue, event.lcid);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].min_dl_bandwidth[event.lcid]);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].min_dl_bandwidth[event.lcid]);
}
}
else if(!strcmp((char *) event.key, "ue_AggregatedMaximumBitrateDL") && event.value!=NULL && validate_mac(event))
......@@ -922,20 +929,21 @@ void update_mac(Event_t event) {
LOG_I(EMU,"ue_AggregatedMaximumBitrateDL update \n");
if(event.ue == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL= mac_config[i].ue_AggregatedMaximumBitrateDL;
eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL;
UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateDL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateDL UE %d:\n",event.ue);
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateDL);
}
}
else
{
oai_emulation->mac_config[event.ue].ue_AggregatedMaximumBitrateDL= mac_config[event.ue].ue_AggregatedMaximumBitrateDL;
eNB_mac_inst->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[event.ue].ue_AggregatedMaximumBitrateDL;
UE_list->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateDL = oai_emulation->mac_config[event.ue].ue_AggregatedMaximumBitrateDL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateDL UE %d:\n",event.ue);
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateDL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateDL);
}
}
......@@ -948,20 +956,21 @@ void update_mac(Event_t event) {
LOG_I(EMU,"ue_AggregatedMaximumBitrateUL update \n");
if(event.ue == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL= mac_config[i].ue_AggregatedMaximumBitrateUL;
eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL;
UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[i].ue_AggregatedMaximumBitrateUL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateUL UE %d:\n",i);
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[i].ue_AggregatedMaximumBitrateUL);
}
}
else
{
oai_emulation->mac_config[event.ue].ue_AggregatedMaximumBitrateUL= mac_config[event.ue].ue_AggregatedMaximumBitrateUL;
eNB_mac_inst->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[event.ue].ue_AggregatedMaximumBitrateUL;
UE_list->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateUL = oai_emulation->mac_config[event.ue].ue_AggregatedMaximumBitrateUL;
LOG_I(EMU,"ue_AggregatedMaximumBitrateUL UE %d:\n",event.ue);
LOG_I(EMU,"%" PRIu64 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateUL);
LOG_I(EMU,"%" PRIu64 "\n",UE_list->UE_sched_ctrl[event.ue].ue_AggregatedMaximumBitrateUL);
}
}
......@@ -973,20 +982,21 @@ void update_mac(Event_t event) {
LOG_I(EMU,"cqiSchedInterval update \n");
if(event.ue == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
oai_emulation->mac_config[i].cqiSchedInterval= mac_config[i].cqiSchedInterval;
eNB_mac_inst->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
UE_list->UE_sched_ctrl[i].cqiSchedInterval = oai_emulation->mac_config[i].cqiSchedInterval;
LOG_I(EMU,"cqiSchedInterval UE :\n", i);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].cqiSchedInterval);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].cqiSchedInterval);
}
}
else
{
oai_emulation->mac_config[event.ue].cqiSchedInterval= mac_config[event.ue].cqiSchedInterval;
eNB_mac_inst->UE_sched_ctrl[event.ue].cqiSchedInterval = oai_emulation->mac_config[event.ue].cqiSchedInterval;
UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval = oai_emulation->mac_config[event.ue].cqiSchedInterval;
LOG_I(EMU,"cqiSchedInterval UE :\n", event.ue);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].cqiSchedInterval);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].cqiSchedInterval);
}
}
else if(!strcmp((char *) event.key, "mac_ContentionResolutionTimer") && event.value!=NULL && validate_mac(event))
......@@ -996,20 +1006,21 @@ void update_mac(Event_t event) {
LOG_I(EMU,"mac_ContentionResolutionTimer update \n");
if(event.ue == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
oai_emulation->mac_config[i].mac_ContentionResolutionTimer= mac_config[i].mac_ContentionResolutionTimer;
eNB_mac_inst->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer = oai_emulation->mac_config[i].mac_ContentionResolutionTimer;
LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", i);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[i].mac_ContentionResolutionTimer);
}
}
else
{
oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer= mac_config[event.ue].mac_ContentionResolutionTimer;
eNB_mac_inst->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer = oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer;
UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer = oai_emulation->mac_config[event.ue].mac_ContentionResolutionTimer;
LOG_I(EMU,"mac_ContentionResolutionTimer UE :\n", event.ue);
LOG_I(EMU,"%" PRIu8 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer);
LOG_I(EMU,"%" PRIu8 "\n",UE_list->UE_sched_ctrl[event.ue].mac_ContentionResolutionTimer);
}
}
else if(!strcmp((char *) event.key, "max_allowed_rbs") && event.value!=NULL && validate_mac(event))
......@@ -1021,7 +1032,8 @@ void update_mac(Event_t event) {
int j=0;
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
if(event.value + i !=NULL)
{
......@@ -1032,9 +1044,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].max_allowed_rbs[j]!=NULL)
{
oai_emulation->mac_config[i].max_allowed_rbs[j]= mac_config[i].max_allowed_rbs[j];
eNB_mac_inst->UE_sched_ctrl[i].max_allowed_rbs[j] = oai_emulation->mac_config[i].max_allowed_rbs[j];
UE_list->UE_sched_ctrl[i].max_allowed_rbs[j] = oai_emulation->mac_config[i].max_allowed_rbs[j];
LOG_I(EMU,"max_allowed_rbs UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].max_allowed_rbs[j]);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].max_allowed_rbs[j]);
}
}
}
......@@ -1043,9 +1055,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].max_allowed_rbs[event.lcid]= mac_config[event.ue].max_allowed_rbs[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].max_allowed_rbs[event.lcid] = oai_emulation->mac_config[event.ue].max_allowed_rbs[event.lcid];
UE_list->UE_sched_ctrl[event.ue].max_allowed_rbs[event.lcid] = oai_emulation->mac_config[event.ue].max_allowed_rbs[event.lcid];
LOG_I(EMU,"max_allowed_rbs UE %d LCID %d:",event.ue,event.lcid);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].max_allowed_rbs[event.lcid]);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].max_allowed_rbs[event.lcid]);
}
}
......@@ -1059,7 +1071,8 @@ void update_mac(Event_t event) {
int j=0;
if(event.ue == -1 && event.lcid == -1)
{
for(i=0;i<NUMBER_OF_UE_MAX;i++)
UE_list = &eNB_mac_inst->UE_list;
for(i=UE_list->head;i>=0;i=UE_list->next[i])
{
for(j=0;j<MAX_NUM_LCID;j++)
......@@ -1068,9 +1081,9 @@ void update_mac(Event_t event) {
if(&mac_config[i].max_mcs[j]!=NULL)
{
oai_emulation->mac_config[i].max_mcs[j]= mac_config[i].max_mcs[j];
eNB_mac_inst->UE_sched_ctrl[i].max_mcs[j] = oai_emulation->mac_config[i].max_mcs[j];
UE_list->UE_sched_ctrl[i].max_mcs[j] = oai_emulation->mac_config[i].max_mcs[j];
LOG_I(EMU,"max_mcs UE %d LCID %d:",i,j);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[i].max_mcs[j]);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[i].max_mcs[j]);
}
}
......@@ -1079,9 +1092,9 @@ void update_mac(Event_t event) {
else
{
oai_emulation->mac_config[event.ue].max_mcs[event.lcid]= mac_config[event.ue].max_mcs[event.lcid];
eNB_mac_inst->UE_sched_ctrl[event.ue].max_mcs[event.lcid] = oai_emulation->mac_config[event.ue].max_mcs[event.lcid];
UE_list->UE_sched_ctrl[event.ue].max_mcs[event.lcid] = oai_emulation->mac_config[event.ue].max_mcs[event.lcid];
LOG_I(EMU,"max_mcs UE %d LCID %d:",event.ue,event.lcid);
LOG_I(EMU,"%" PRIu16 "\n",eNB_mac_inst->UE_sched_ctrl[event.ue].max_mcs[event.lcid]);
LOG_I(EMU,"%" PRIu16 "\n",UE_list->UE_sched_ctrl[event.ue].max_mcs[event.lcid]);
}
}
}
......
......@@ -169,7 +169,7 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
uint8_t cooperation_flag,uint8_t transmission_mode,uint8_t abstraction_flag,
int nb_antennas_rx, uint8_t eMBMS_active_state) {
uint8_t eNB_id,UE_id,RN_id;
uint8_t eNB_id,UE_id,RN_id,CC_id;
mac_xface = malloc(sizeof(MAC_xface));
......@@ -205,17 +205,27 @@ void init_lte_vars(LTE_DL_FRAME_PARMS **frame_parms,
phy_init_lte_top(*frame_parms);
PHY_vars_eNB_g = malloc(NB_eNB_INST*sizeof(PHY_VARS_eNB*));
PHY_vars_eNB_g = (PHY_VARS_eNB***)malloc(NB_eNB_INST*sizeof(PHY_VARS_eNB**));
for (eNB_id=0; eNB_id<NB_eNB_INST;eNB_id++){
PHY_vars_eNB_g[eNB_id] = init_lte_eNB(*frame_parms,eNB_id,Nid_cell,cooperation_flag,transmission_mode,abstraction_flag);
PHY_vars_eNB_g[eNB_id] = (PHY_VARS_eNB**) malloc(MAX_NUM_CCs*sizeof(PHY_VARS_eNB*));
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_eNB_g[eNB_id][CC_id] = init_lte_eNB(*frame_parms,eNB_id,Nid_cell,cooperation_flag,transmission_mode,abstraction_flag);
PHY_vars_eNB_g[eNB_id][CC_id]->Mod_id=eNB_id;
PHY_vars_eNB_g[eNB_id][CC_id]->CC_id=CC_id;
}
}
(*frame_parms)->nb_antennas_tx = 1;
(*frame_parms)->nb_antennas_rx = nb_antennas_rx;
PHY_vars_UE_g = malloc(NB_UE_INST*sizeof(PHY_VARS_UE*));
PHY_vars_UE_g = (PHY_VARS_UE***)malloc(NB_UE_INST*sizeof(PHY_VARS_UE**));
for (UE_id=0; UE_id<NB_UE_INST;UE_id++){
PHY_vars_UE_g[UE_id] = init_lte_UE(*frame_parms, UE_id,abstraction_flag,transmission_mode);
PHY_vars_UE_g[UE_id] = (PHY_VARS_UE**) malloc(MAX_NUM_CCs*sizeof(PHY_VARS_UE*));
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
PHY_vars_UE_g[UE_id][CC_id] = init_lte_UE(*frame_parms, UE_id,abstraction_flag,transmission_mode);
PHY_vars_UE_g[UE_id][CC_id]->Mod_id=UE_id;
PHY_vars_UE_g[UE_id][CC_id]->CC_id=CC_id;
}
}
if (NB_RN_INST > 0) {
......
......@@ -133,8 +133,8 @@ char smbv_ip[16];
frame_t frame = 0;
char stats_buffer[16384];
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
//Added for PHY abstraction
node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
node_desc_t *ue_data[NUMBER_OF_UE_MAX];
......@@ -413,6 +413,7 @@ l2l1_task_state_t l2l1_state = L2L1_WAITTING;
void *l2l1_task(void *args_p) {
clock_t t;
int CC_id;
// Framing variables
int32_t slot, last_slot, next_slot;
......@@ -450,16 +451,17 @@ void *l2l1_task(void *args_p) {
char eNB_stats_th_filename[255];
#endif
for (eNB_inst=0;eNB_inst<NB_eNB_INST;eNB_inst++) {
for (sf=0;sf<10;sf++) {
PHY_vars_eNB_g[eNB_inst]->proc[sf].frame_tx = 0;
PHY_vars_eNB_g[eNB_inst]->proc[sf].frame_rx = 0;
PHY_vars_eNB_g[eNB_inst]->proc[sf].subframe_tx = (sf+1)%10;
PHY_vars_eNB_g[eNB_inst]->proc[sf].subframe_rx = (sf+9)%10;
for (CC_id = 0;CC_id<MAX_NUM_CCs;CC_id++)
for (eNB_inst=0;eNB_inst<NB_eNB_INST;eNB_inst++) {
for (sf=0;sf<10;sf++) {
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].frame_tx = 0;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].frame_rx = 0;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].subframe_tx = (sf+1)%10;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[sf].subframe_rx = (sf+9)%10;
}
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[0].frame_rx = 1023;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc[9].frame_tx = 1;
}
PHY_vars_eNB_g[eNB_inst]->proc[0].frame_rx = 1023;
PHY_vars_eNB_g[eNB_inst]->proc[9].frame_tx = 1;
}
#ifdef XFORMS
xargv[0] = xname;
fl_initialize (&xargc, xargv, NULL, 0, 0);
......@@ -691,18 +693,18 @@ void *l2l1_task(void *args_p) {
clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
for (eNB_inst = oai_emulation.info.first_enb_local; (eNB_inst < (oai_emulation.info.first_enb_local + oai_emulation.info.nb_enb_local)); eNB_inst++) {
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
LOG_D(
EMU,
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
eNB_inst,
frame,
slot,
next_slot >> 1,
last_slot>>1,
PHY_vars_eNB_g[eNB_inst]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[eNB_inst]->lte_frame_parms.tdd_config,
PHY_vars_eNB_g[eNB_inst]->lte_frame_parms.Nid_cell);
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
LOG_D(
EMU,
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n",
eNB_inst,
frame,
slot,
next_slot >> 1,
last_slot>>1,
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.tdd_config,
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.Nid_cell);
#ifdef OPENAIR2
//Appliation: traffic gen
......@@ -719,9 +721,9 @@ void *l2l1_task(void *args_p) {
#ifdef PRINT_STATS
if(last_slot==9 && frame%10==0)
if(eNB_avg_thr)
fprintf(eNB_avg_thr,"%d %d\n",PHY_vars_eNB_g[eNB_inst]->frame,(PHY_vars_eNB_g[eNB_inst]->total_system_throughput)/((PHY_vars_eNB_g[eNB_inst]->frame+1)*10));
fprintf(eNB_avg_thr,"%d %d\n",PHY_vars_eNB_g[eNB_inst][0]->frame,(PHY_vars_eNB_g[eNB_inst][0]->total_system_throughput)/((PHY_vars_eNB_g[eNB_inst][0]->frame+1)*10));
if (eNB_stats[eNB_inst]) {
len = dump_eNB_stats(PHY_vars_eNB_g[eNB_inst], stats_buffer, 0);
len = dump_eNB_stats(PHY_vars_eNB_g[eNB_inst][0], stats_buffer, 0);
rewind (eNB_stats[eNB_inst]);
fwrite (stats_buffer, 1, len, eNB_stats[eNB_inst]);
fflush(eNB_stats[eNB_inst]);
......@@ -735,8 +737,9 @@ void *l2l1_task(void *args_p) {
}
#endif
#endif
}
}
}
}
// Call ETHERNET emulation here
//emu_transport (frame, last_slot, next_slot, direction, oai_emulation.info.frame_type, ethernet_flag);
......@@ -747,8 +750,8 @@ void *l2l1_task(void *args_p) {
if ((next_slot % 2) == 0)
clear_UE_transport_info (oai_emulation.info.nb_ue_local);
for (UE_inst = oai_emulation.info.first_ue_local;
(UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local)); UE_inst++) {
if (oai_emulation.info.cli_start_ue[UE_inst] != 0) {
(UE_inst < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local)); UE_inst++)
if (oai_emulation.info.cli_start_ue[UE_inst] != 0) {
#if defined(ENABLE_ITTI) && defined(ENABLE_USE_MME)
#else
......@@ -762,9 +765,9 @@ void *l2l1_task(void *args_p) {
next_slot >> 1,
last_slot>>1);
if (PHY_vars_UE_g[UE_inst]->UE_mode[0] != NOT_SYNCHED) {
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) {
if (frame > 0) {
PHY_vars_UE_g[UE_inst]->frame = frame;
PHY_vars_UE_g[UE_inst][0]->frame = frame;
#ifdef OPENAIR2
//Application
......@@ -773,21 +776,22 @@ void *l2l1_task(void *args_p) {
//Access layer
pdcp_run (frame, 0, UE_inst, 0);
#endif
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_inst], 0, abstraction_flag, normal_txrx,
no_relay, NULL);
ue_data[UE_inst]->tx_power_dBm = PHY_vars_UE_g[UE_inst]->tx_power_dBm;
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_inst][CC_id], 0, abstraction_flag, normal_txrx,
no_relay, NULL);
}
ue_data[UE_inst]->tx_power_dBm = PHY_vars_UE_g[UE_inst][0]->tx_power_dBm;
}
}
else {
if (abstraction_flag == 1) {
LOG_E(
EMU,
"sync not supported in abstraction mode (UE%d,mode%d)\n", UE_inst, PHY_vars_UE_g[UE_inst]->UE_mode[0]);
"sync not supported in abstraction mode (UE%d,mode%d)\n", UE_inst, PHY_vars_UE_g[UE_inst][0]->UE_mode[0]);
exit (-1);
}
if ((frame > 0) && (last_slot == (LTE_SLOTS_PER_FRAME - 2))) {
initial_sync (PHY_vars_UE_g[UE_inst], normal_txrx);
initial_sync (PHY_vars_UE_g[UE_inst][0], normal_txrx);
/*
write_output("dlchan00.m","dlch00",&(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),(6*(PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)),1,1);
......@@ -807,11 +811,11 @@ void *l2l1_task(void *args_p) {
#ifdef PRINT_STATS
if(last_slot==2 && frame%10==0) {
if (UE_stats_th[UE_inst]) {
fprintf(UE_stats_th[UE_inst],"%d %d\n",frame, PHY_vars_UE_g[UE_inst]->bitrate[0]/1000);
fprintf(UE_stats_th[UE_inst],"%d %d\n",frame, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000);
}
}
if (UE_stats[UE_inst]) {
len = dump_ue_stats (PHY_vars_UE_g[UE_inst], stats_buffer, 0, normal_txrx, 0);
len = dump_ue_stats (PHY_vars_UE_g[UE_inst][0], stats_buffer, 0, normal_txrx, 0);
rewind (UE_stats[UE_inst]);
fwrite (stats_buffer, 1, len, UE_stats[UE_inst]);
fflush(UE_stats[UE_inst]);
......@@ -840,21 +844,21 @@ void *l2l1_task(void *args_p) {
if ( oai_emulation.info.frame_type == 0) {
// RN == UE
if (frame>0) {
if (PHY_vars_UE_g[UE_inst]->UE_mode[0] != NOT_SYNCHED) {
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) {
LOG_D(EMU,"[RN %d] PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, UE_inst, frame, slot, next_slot >> 1,last_slot>>1);
PHY_vars_UE_g[UE_inst]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_inst], 0, abstraction_flag,normal_txrx,
PHY_vars_UE_g[UE_inst][0]->frame = frame;
phy_procedures_UE_lte (last_slot, next_slot, PHY_vars_UE_g[UE_inst][0], 0, abstraction_flag,normal_txrx,
r_type, PHY_vars_RN_g[RN_id]);
}
else if (last_slot == (LTE_SLOTS_PER_FRAME-2)) {
initial_sync(PHY_vars_UE_g[UE_inst],normal_txrx);
initial_sync(PHY_vars_UE_g[UE_inst][0],normal_txrx);
}
}
// RN == eNB
LOG_D(EMU,"[RN %d] PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d)\n",
RN_id, eNB_inst, frame, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte(slot>>1, PHY_vars_eNB_g[eNB_inst], abstraction_flag,
phy_procedures_eNB_lte(slot>>1, PHY_vars_eNB_g[eNB_inst][0], abstraction_flag,
r_type, PHY_vars_RN_g[RN_id]);
}
else {
......@@ -875,14 +879,17 @@ void *l2l1_task(void *args_p) {
}
}*/
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);
}
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
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,CC_id);
}
stop_meas(&dl_chan_stats);
}
if ((direction == SF_UL) || (frame_parms->frame_type == 0)) { //if ((subframe<2) || (subframe>4))
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);
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
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,CC_id);
}
stop_meas(&ul_chan_stats);
/*
int ccc;
......@@ -905,9 +912,10 @@ void *l2l1_task(void *args_p) {
}
}*/
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);
}
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
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,CC_id);
}
stop_meas(&dl_chan_stats);
/*
for (aarx=0;aarx<UE2eNB[1][0]->nb_rx;aarx++)
......@@ -918,8 +926,10 @@ void *l2l1_task(void *args_p) {
}
else { // UL part
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);
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
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,CC_id);
}
stop_meas(&ul_chan_stats);
/* int ccc;
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n ");
......@@ -933,15 +943,15 @@ void *l2l1_task(void *args_p) {
}
if ((last_slot == 1) && (frame == 0) && (abstraction_flag == 0) && (oai_emulation.info.n_frames == 1)) {
write_output ("dlchan0.m", "dlch0", &(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),
(6 * (PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)), 1, 1);
write_output ("dlchan1.m", "dlch1", &(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[1][0][0]),
(6 * (PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)), 1, 1);
write_output ("dlchan2.m", "dlch2", &(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[2][0][0]),
(6 * (PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)), 1, 1);
write_output ("pbch_rxF_comp0.m", "pbch_comp0", PHY_vars_UE_g[0]->lte_ue_pbch_vars[0]->rxdataF_comp[0],
write_output ("dlchan0.m", "dlch0", &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[0][0][0]),
(6 * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)), 1, 1);
write_output ("dlchan1.m", "dlch1", &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[1][0][0]),
(6 * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)), 1, 1);
write_output ("dlchan2.m", "dlch2", &(PHY_vars_UE_g[0][0]->lte_ue_common_vars.dl_ch_estimates[2][0][0]),
(6 * (PHY_vars_UE_g[0][0]->lte_frame_parms.ofdm_symbol_size)), 1, 1);
write_output ("pbch_rxF_comp0.m", "pbch_comp0", PHY_vars_UE_g[0][0]->lte_ue_pbch_vars[0]->rxdataF_comp[0],
6 * 12 * 4, 1, 1);
write_output ("pbch_rxF_llr.m", "pbch_llr", PHY_vars_UE_g[0]->lte_ue_pbch_vars[0]->llr,
write_output ("pbch_rxF_llr.m", "pbch_llr", PHY_vars_UE_g[0][0]->lte_ue_pbch_vars[0]->llr,
(frame_parms->Ncp == 0) ? 1920 : 1728, 1, 4);
}
/*
......@@ -959,20 +969,20 @@ void *l2l1_task(void *args_p) {
&&(Channel_Flag==0)
#endif
) {
write_output ("UEtxsig0.m", "txs0", PHY_vars_UE_g[0]->lte_ue_common_vars.txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,
write_output ("UEtxsig0.m", "txs0", PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,
1, 1);
sprintf (fname, "eNBtxsig%d.m", frame);
sprintf (vname, "txs%d", frame);
write_output (fname, vname, PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdata[0][0], FRAME_LENGTH_COMPLEX_SAMPLES, 1,
write_output (fname, vname, PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0], FRAME_LENGTH_COMPLEX_SAMPLES, 1,
1);
write_output (
"eNBtxsigF0.m", "txsF0", PHY_vars_eNB_g[0]->lte_eNB_common_vars.txdataF[0][0],
PHY_vars_eNB_g[0]->lte_frame_parms.symbols_per_tti * PHY_vars_eNB_g[0]->lte_frame_parms.ofdm_symbol_size, 1,
"eNBtxsigF0.m", "txsF0", PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0],
PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti * PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size, 1,
1);
write_output ("UErxsig0.m", "rxs0", PHY_vars_UE_g[0]->lte_ue_common_vars.rxdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,
write_output ("UErxsig0.m", "rxs0", PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0], FRAME_LENGTH_COMPLEX_SAMPLES,
1, 1);
write_output ("eNBrxsig0.m", "rxs0", PHY_vars_eNB_g[0]->lte_eNB_common_vars.rxdata[0][0],
write_output ("eNBrxsig0.m", "rxs0", PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0],
FRAME_LENGTH_COMPLEX_SAMPLES, 1, 1);
}
......@@ -980,13 +990,13 @@ void *l2l1_task(void *args_p) {
eNB_inst = 0;
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
phy_scope_UE(form_ue[UE_inst],
PHY_vars_UE_g[UE_inst],
PHY_vars_UE_g[UE_inst][0],
eNB_inst,
UE_inst,
7);
phy_scope_eNB(form_enb[UE_inst],
PHY_vars_eNB_g[eNB_inst],
PHY_vars_eNB_g[eNB_inst][0],
UE_inst);
}
......@@ -998,7 +1008,7 @@ void *l2l1_task(void *args_p) {
}
#endif
stop_meas(&oaisim_stats_f);
} //end of frame
//end of frame
stop_meas(&oaisim_stats);
......@@ -1126,7 +1136,7 @@ int main(int argc, char **argv) {
#ifdef SMBV
smbv_init_config(smbv_fname, smbv_nframes);
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0]->lte_frame_parms);
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0][0]->lte_frame_parms);
#endif
// add events to future event list: Currently not used
//oai_emulation.info.oeh_enabled = 1;
......@@ -1182,39 +1192,39 @@ void reset_opp_meas(void){
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][0]->phy_proc);
reset_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc_rx);
reset_meas(&PHY_vars_UE_g[UE_id][0]->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][0]->ofdm_demod_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->rx_dft_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_channel_estimation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_freq_offset_estimation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_rate_unmatching_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_turbo_decoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_deinterleaving_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_llr_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->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][0]->dlsch_tc_init_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_alpha_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_beta_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_gamma_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_ext_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl1_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl2_stats);
reset_meas(&PHY_vars_UE_g[UE_id]->tx_prach);
reset_meas(&PHY_vars_UE_g[UE_id][0]->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);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_mod_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_encoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_modulation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_segmentation_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_rate_matching_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats);
reset_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_multiplexing_stats);
/*
* L2 functions
*/
......@@ -1236,46 +1246,46 @@ void reset_opp_meas(void){
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][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]->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][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]->ofdm_demod_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]->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(&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);
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);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->random_channel);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->interp_time);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->interp_freq);
reset_meas(&eNB2UE[eNB_id][UE_id][0]->convolution);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->random_channel);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->interp_time);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->interp_freq);
reset_meas(&UE2eNB[UE_id][eNB_id][0]->convolution);
/*
* L2 functions
*/
......@@ -1313,85 +1323,85 @@ void print_opp_meas(void){
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);
print_meas(&eNB2UE[eNB_id][UE_id][0]->random_channel,"[DL][random_channel]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB2UE[eNB_id][UE_id][0]->interp_time,"[DL][interp_time]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB2UE[eNB_id][UE_id][0]->interp_freq,"[DL][interp_freq]",&oaisim_stats,&oaisim_stats_f);
print_meas(&eNB2UE[eNB_id][UE_id][0]->convolution,"[DL][convolution]",&oaisim_stats,&oaisim_stats_f);
print_meas(&UE2eNB[UE_id][eNB_id][0]->random_channel,"[UL][random_channel]",&oaisim_stats,&oaisim_stats_f);
print_meas(&UE2eNB[UE_id][eNB_id][0]->interp_time,"[UL][interp_time]",&oaisim_stats,&oaisim_stats_f);
print_meas(&UE2eNB[UE_id][eNB_id][0]->interp_freq,"[UL][interp_freq]",&oaisim_stats,&oaisim_stats_f);
print_meas(&UE2eNB[UE_id][eNB_id][0]->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][0]->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][0]->phy_proc_rx,"[UE][total_phy_proc_rx]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_demod_stats,"[UE][ofdm_demod]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->rx_dft_stats,"[UE][rx_dft]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_channel_estimation_stats,"[UE][channel_est]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_freq_offset_estimation_stats,"[UE][freq_offset]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_llr_stats,"[UE][llr]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_unscrambling_stats,"[UE][unscrambling]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_decoding_stats,"[UE][decoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_rate_unmatching_stats,"[UE][rate_unmatching]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_deinterleaving_stats,"[UE][deinterleaving]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_turbo_decoding_stats,"[UE][turbo_decoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_init_stats,"[UE][ |_tc_init]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_alpha_stats,"[UE][ |_tc_alpha]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_beta_stats,"[UE][ |_tc_beta]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_gamma_stats,"[UE][ |_tc_gamma]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_ext_stats,"[UE][ |_tc_ext]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->dlsch_tc_intl1_stats,"[UE][ |_tc_intl1]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->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);
print_meas(&PHY_vars_UE_g[UE_id][0]->phy_proc_tx,"[UE][total_phy_proc_tx]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ofdm_mod_stats,"[UE][ofdm_mod]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_modulation_stats,"[UE][modulation]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_encoding_stats,"[UE][encoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_segmentation_stats,"[UE][segmentation]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_rate_matching_stats,"[UE][rate_matching]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_turbo_encoding_stats,"[UE][turbo_encoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->ulsch_interleaving_stats,"[UE][interleaving]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_UE_g[UE_id][0]->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_tx,"[eNB][total_phy_proc_tx]",&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][0]->phy_proc,"[eNB][total_phy_proc]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->phy_proc_tx,"[eNB][total_phy_proc_tx]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_mod_stats,"[eNB][ofdm_mod]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_modulation_stats,"[eNB][modulation]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_scrambling_stats,"[eNB][scrambling]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_encoding_stats,"[eNB][encoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_interleaving_stats,"[eNB][|_interleaving]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_rate_matching_stats,"[eNB][|_rate_matching]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->dlsch_turbo_encoding_stats,"[eNB][|_turbo_encoding]",&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_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][0]->phy_proc_rx,"[eNB][total_phy_proc_rx]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ofdm_demod_stats,"[eNB][ofdm_demod]",&oaisim_stats,&oaisim_stats_f);
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_channel_estimation_stats,"[eNB][channel_est]");
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_freq_offset_estimation_stats,"[eNB][freq_offset]");
//print_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_dft_stats,"[eNB][rx_dft]");
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demodulation_stats,"[eNB][demodulation]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_decoding_stats,"[eNB][decoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_deinterleaving_stats,"[eNB][|_deinterleaving]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_demultiplexing_stats,"[eNB][|_demultiplexing]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_rate_unmatching_stats,"[eNB][|_rate_unmatching]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_turbo_decoding_stats,"[eNB][|_turbo_decoding]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_init_stats,"[eNB][ |_tc_init]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_alpha_stats,"[eNB][ |_tc_alpha]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_beta_stats,"[eNB][ |_tc_beta]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_gamma_stats,"[eNB][ |_tc_gamma]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_ext_stats,"[eNB][ |_tc_ext]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->ulsch_tc_intl1_stats,"[eNB][ |_tc_intl1]",&oaisim_stats,&oaisim_stats_f);
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]->rx_prach,"[eNB][rx_prach]",&oaisim_stats,&oaisim_stats_f);
print_meas(&PHY_vars_eNB_g[eNB_id][0]->rx_prach,"[eNB][rx_prach]",&oaisim_stats,&oaisim_stats_f);
}
......
......@@ -21,9 +21,9 @@ eNB_MAC_INST* get_eNB_mac_inst(void);
OAI_Emulation* get_OAI_emulation(void);
void init_channel_vars(LTE_DL_FRAME_PARMS *frame_parms, double ***s_re,double ***s_im,double ***r_re,double ***r_im,double ***r_re0,double ***r_im0);
void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, uint32_t);
void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms, uint32_t,uint8_t);
void do_DL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,uint8_t UE_id);
void do_DL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double **s_re,double **s_im,channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs],node_desc_t *enb_data[NUMBER_OF_eNB_MAX],node_desc_t *ue_data[NUMBER_OF_UE_MAX],uint16_t next_slot,uint8_t abstraction_flag,LTE_DL_FRAME_PARMS *frame_parms,uint8_t UE_id,int CC_id);
void init_ue(node_desc_t *ue_data, UE_Antenna ue_ant);//Abstraction changes
void init_enb(node_desc_t *enb_data, eNB_Antenna enb_ant);//Abstraction changes
......
......@@ -146,8 +146,8 @@ Packet_OTG_List_t *otg_pdcp_buffer = NULL;
extern node_desc_t *enb_data[NUMBER_OF_eNB_MAX];
extern node_desc_t *ue_data[NUMBER_OF_UE_MAX];
extern channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX];
extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX];
extern channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_NUM_CCs];
extern channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_NUM_CCs];
extern mapping small_scale_names[];
#if defined(Rel10)
......@@ -803,6 +803,7 @@ void init_seed(uint8_t set_seed) {
void init_openair1(void) {
module_id_t UE_id, eNB_id;
uint8_t CC_id;
#if defined(ENABLE_RAL)
int list_index;
#endif
......@@ -811,22 +812,23 @@ void init_openair1(void) {
for (eNB_id=0; eNB_id<NB_eNB_INST;eNB_id++){
for (UE_id=0; UE_id<NB_UE_INST;UE_id++){
PHY_vars_eNB_g[eNB_id]->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = beta_ACK;
PHY_vars_eNB_g[eNB_id]->pusch_config_dedicated[UE_id].betaOffset_RI_Index = beta_RI;
PHY_vars_eNB_g[eNB_id]->pusch_config_dedicated[UE_id].betaOffset_CQI_Index = beta_CQI;
PHY_vars_UE_g[UE_id]->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index = beta_ACK;
PHY_vars_UE_g[UE_id]->pusch_config_dedicated[eNB_id].betaOffset_RI_Index = beta_RI;
PHY_vars_UE_g[UE_id]->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index = beta_CQI;
((PHY_vars_UE_g[UE_id]->lte_frame_parms).pdsch_config_common).p_b = (frame_parms->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_a = rhob
((PHY_vars_eNB_g[eNB_id]->lte_frame_parms).pdsch_config_common).p_b = (frame_parms->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_a = rhob
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
PHY_vars_eNB_g[eNB_id][CC_id]->pusch_config_dedicated[UE_id].betaOffset_ACK_Index = beta_ACK;
PHY_vars_eNB_g[eNB_id][CC_id]->pusch_config_dedicated[UE_id].betaOffset_RI_Index = beta_RI;
PHY_vars_eNB_g[eNB_id][CC_id]->pusch_config_dedicated[UE_id].betaOffset_CQI_Index = beta_CQI;
((PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms).pdsch_config_common).p_b = (frame_parms->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_a = rhob
}
PHY_vars_UE_g[UE_id][CC_id]->pusch_config_dedicated[eNB_id].betaOffset_ACK_Index = beta_ACK;
PHY_vars_UE_g[UE_id][CC_id]->pusch_config_dedicated[eNB_id].betaOffset_RI_Index = beta_RI;
PHY_vars_UE_g[UE_id][CC_id]->pusch_config_dedicated[eNB_id].betaOffset_CQI_Index = beta_CQI;
((PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms).pdsch_config_common).p_b = (frame_parms->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_a = rhob
}
}
printf ("AFTER init: Nid_cell %d\n", PHY_vars_eNB_g[0]->lte_frame_parms.Nid_cell);
printf ("AFTER init: Nid_cell %d\n", PHY_vars_eNB_g[0][0]->lte_frame_parms.Nid_cell);
printf ("AFTER init: frame_type %d,tdd_config %d\n",
PHY_vars_eNB_g[0]->lte_frame_parms.frame_type,
PHY_vars_eNB_g[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;
......@@ -844,26 +846,27 @@ void init_openair1(void) {
openair_daq_vars.use_ia_receiver = 0;
// init_ue_status();
for (UE_id=0; UE_id<NB_UE_INST;UE_id++) {
PHY_vars_UE_g[UE_id]->rx_total_gain_dB=130;
for (UE_id=0; UE_id<NB_UE_INST;UE_id++)
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++){
PHY_vars_UE_g[UE_id][CC_id]->rx_total_gain_dB=130;
// update UE_mode for each eNB_id not just 0
if (abstraction_flag == 0)
PHY_vars_UE_g[UE_id]->UE_mode[0] = NOT_SYNCHED;
PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = NOT_SYNCHED;
else {
// 0 is the index of the connected eNB
PHY_vars_UE_g[UE_id]->UE_mode[0] = PRACH;
PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] = PRACH;
}
PHY_vars_UE_g[UE_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235 + UE_id;
PHY_vars_UE_g[UE_id]->current_dlsch_cqi[0] = 10;
PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti = 0x1235 + UE_id;
PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10;
LOG_I(EMU, "UE %d mode is initialized to %d\n", UE_id, PHY_vars_UE_g[UE_id]->UE_mode[0] );
LOG_I(EMU, "UE %d mode is initialized to %d\n", UE_id, PHY_vars_UE_g[UE_id][CC_id]->UE_mode[0] );
#if defined(ENABLE_RAL)
PHY_vars_UE_g[UE_id]->ral_thresholds_timed = hashtable_create (64, NULL, NULL);
PHY_vars_UE_g[UE_id][CC_id]->ral_thresholds_timed = hashtable_create (64, NULL, NULL);
for (list_index = 0; list_index < RAL_LINK_PARAM_GEN_MAX; list_index++) {
SLIST_INIT(&PHY_vars_UE_g[UE_id]->ral_thresholds_gen_polled[list_index]);
SLIST_INIT(&PHY_vars_UE_g[UE_id][CC_id]->ral_thresholds_gen_polled[list_index]);
}
for (list_index = 0; list_index < RAL_LINK_PARAM_LTE_MAX; list_index++) {
SLIST_INIT(&PHY_vars_UE_g[UE_id]->ral_thresholds_lte_polled[list_index]);
SLIST_INIT(&PHY_vars_UE_g[UE_id][CC_id]->ral_thresholds_lte_polled[list_index]);
}
#endif
......@@ -874,12 +877,14 @@ void init_openair2(void) {
#ifdef OPENAIR2
module_id_t enb_id;
module_id_t UE_id;
int CC_id;
l2_init (&PHY_vars_eNB_g[0]->lte_frame_parms,
oai_emulation.info.eMBMS_active_state,
oai_emulation.info.cba_group_active,
oai_emulation.info.handover_active);
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++)
l2_init (&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
oai_emulation.info.eMBMS_active_state,
oai_emulation.info.cba_group_active,
oai_emulation.info.handover_active);
for (enb_id = 0; enb_id < NB_eNB_INST; enb_id++)
mac_xface->mrbch_phy_sync_failure (enb_id, 0, enb_id);
......@@ -895,6 +900,7 @@ void init_openair2(void) {
void init_ocm(void) {
module_id_t UE_id, eNB_id;
int CC_id;
/* Added for PHY abstraction */
LOG_I(OCM,"Running with frame_type %d, Nid_cell %d, N_RB_DL %d, EP %d, mode %d, target dl_mcs %d, rate adaptation %d, nframes %d, abstraction %d, channel %s\n", oai_emulation.info.frame_type, Nid_cell, oai_emulation.info.N_RB_DL, oai_emulation.info.extended_prefix_flag, oai_emulation.info.transmission_mode,target_dl_mcs,rate_adaptation_flag,oai_emulation.info.n_frames,abstraction_flag,oai_emulation.environment_system_config.fading.small_scale.selected_option);
......@@ -940,9 +946,9 @@ void init_ocm(void) {
// initialize channel descriptors
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
LOG_D(OCM,"Initializing channel (%s, %d) from eNB %d to UE %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
LOG_D(OCM,"Initializing channel (%s, %d) from eNB %d to UE %d\n", oai_emulation.environment_system_config.fading.small_scale.selected_option,
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), eNB_id, UE_id);
/* if (oai_emulation.info.transmission_mode == 5)
......@@ -957,29 +963,30 @@ void init_ocm(void) {
else
*/
eNB2UE[eNB_id][UE_id] = new_channel_desc_scm(PHY_vars_eNB_g[eNB_id]->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE_g[UE_id]->lte_frame_parms.nb_antennas_rx,
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option),
oai_emulation.environment_system_config.system_bandwidth_MB,
forgetting_factor,
0,
0);
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,
eNB2UE[eNB_id][UE_id][CC_id] = new_channel_desc_scm(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_tx,
PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.nb_antennas_rx,
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option),
oai_emulation.environment_system_config.system_bandwidth_MB,
forgetting_factor,
0,
0);
random_channel(eNB2UE[eNB_id][UE_id][CC_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);
UE2eNB[UE_id][eNB_id] = new_channel_desc_scm(PHY_vars_UE_g[UE_id]->lte_frame_parms.nb_antennas_tx,
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.nb_antennas_rx,
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),
oai_emulation.environment_system_config.system_bandwidth_MB,
forgetting_factor,
0,
0);
random_channel(UE2eNB[UE_id][eNB_id],abstraction_flag);
UE2eNB[UE_id][eNB_id][CC_id] = new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.nb_antennas_tx,
PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_rx,
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),
oai_emulation.environment_system_config.system_bandwidth_MB,
forgetting_factor,
0,
0);
random_channel(UE2eNB[UE_id][eNB_id][CC_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];
}
}
}
}
......@@ -1031,10 +1038,13 @@ void update_omg_ocm() {
void update_ocm() {
module_id_t UE_id, eNB_id;
int CC_id;
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++)
enb_data[eNB_id]->tx_power_dBm = PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
enb_data[eNB_id]->tx_power_dBm = PHY_vars_eNB_g[eNB_id][0]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id]->tx_power_dBm;
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm;
/* check if the openair channel model is activated used for PHY abstraction : path loss*/
if ((oai_emulation.info.ocm_enabled == 1)&& (ethernet_flag == 0 )) {
......@@ -1045,42 +1055,47 @@ void update_ocm() {
//extract_position_fixed_enb(enb_data, NB_eNB_INST,frame);
//LOG_D(OMG," extracting position of UE...\n");
// if (oai_emulation.info.omg_model_ue == TRACE)
extract_position(ue_node_list, ue_data, NB_UE_INST);
/* if (frame % 50 == 0)
LOG_N(OCM,"Path loss for TTI %d : \n", frame);
*/
extract_position(ue_node_list, ue_data, NB_UE_INST);
/* if (frame % 50 == 0)
LOG_N(OCM,"Path loss for TTI %d : \n", frame);
*/
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id], oai_emulation.environment_system_config,ShaF);
//calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id], oai_emulation.environment_system_config,0);
UE2eNB[UE_id][eNB_id]->path_loss_dB = eNB2UE[eNB_id][UE_id]->path_loss_dB;
// if (frame % 50 == 0)
LOG_I(OCM,"Path loss between eNB %d at (%f,%f) and UE %d at (%f,%f) is %f, angle %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,
eNB2UE[eNB_id][UE_id]->path_loss_dB, eNB2UE[eNB_id][UE_id]->aoa);
}
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id][CC_id], oai_emulation.environment_system_config,ShaF);
//calc_path_loss (enb_data[eNB_id], ue_data[UE_id], eNB2UE[eNB_id][UE_id], oai_emulation.environment_system_config,0);
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB;
// if (frame % 50 == 0)
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);
}
}
}
}
}
else {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
//UE2eNB[UE_id][eNB_id]->path_loss_dB = -105 + snr_dB;
if (eNB_id == (UE_id % NB_eNB_INST)) {
eNB2UE[eNB_id][UE_id]->path_loss_dB = -105 + snr_dB - PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id]->path_loss_dB = -105 + snr_dB - PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower; //+20 to offset the difference in tx power of the UE wrt eNB
}
else {
eNB2UE[eNB_id][UE_id]->path_loss_dB = -105 + sinr_dB - PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id]->path_loss_dB = -105 + sinr_dB - PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
}
LOG_I(OCM,"Path loss from eNB %d to UE %d => %f dB (eNB TX %d)\n",eNB_id,UE_id,eNB2UE[eNB_id][UE_id]->path_loss_dB,
PHY_vars_eNB_g[eNB_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower);
// printf("[SIM] Path loss from UE %d to eNB %d => %f dB\n",UE_id,eNB_id,UE2eNB[UE_id][eNB_id]->path_loss_dB);
}
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) {
//UE2eNB[UE_id][eNB_id]->path_loss_dB = -105 + snr_dB;
if (eNB_id == (UE_id % NB_eNB_INST)) {
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -105 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -105 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower; //+20 to offset the difference in tx power of the UE wrt eNB
}
else {
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -105 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -105 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower;
}
LOG_I(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d)\n",eNB_id,UE_id,CC_id,
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB,
PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower);
// printf("[SIM] Path loss from UE %d to eNB %d => %f dB\n",UE_id,eNB_id,UE2eNB[UE_id][eNB_id]->path_loss_dB);
}
}
}
}
}
......
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