Commit ba403ee0 authored by lfarizav's avatar lfarizav

Multiple RRUs works. Case UE0->eNB0 and UE1->eNB0 in the frequency domain

parent 36311386
......@@ -1138,7 +1138,7 @@ int phy_init_lte_ue(PHY_VARS_UE *ue,
}
ue->n_connected_eNB = nb_connected_eNB;
printf("lte_init: n_connected_eNB = %d,%d\n",ue->n_connected_eNB,nb_connected_eNB);
//printf("lte_init: n_connected_eNB = %d,%d\n",ue->n_connected_eNB,nb_connected_eNB);
for(eNB_id = 0; eNB_id < ue->n_connected_eNB; eNB_id++) {
ue->total_TBS[eNB_id] = 0;
ue->total_TBS_last[eNB_id] = 0;
......
......@@ -33,12 +33,12 @@ phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
ue->measurements.rssi,
ue->measurements.rx_power_avg_dB[eNB_id]
);
printf("[UE %d] Gain control: rssi %d (%d,%d)\n",
/*printf("[UE %d] Gain control: rssi %d (%d,%d)\n",
ue->Mod_id,
rx_power_fil_dB,
ue->measurements.rssi,
ue->measurements.rx_power_avg_dB[eNB_id]
);
);*/
// Gain control with hysterisis
// Adjust gain in ue->rx_vars[0].rx_total_gain_dB
......
......@@ -88,7 +88,7 @@ int16_t get_PL(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index)
uint8_t get_n_adj_cells (uint8_t Mod_id,uint8_t CC_id)
{
printf("get_n_adj_cells: if ue%d = %d. n_adj_cells %d\n",PHY_vars_UE_g[Mod_id][CC_id]->Mod_id,PHY_vars_UE_g[Mod_id][CC_id],(PHY_vars_UE_g[Mod_id][CC_id])?PHY_vars_UE_g[Mod_id][CC_id]->measurements.n_adj_cells:0);
//printf("get_n_adj_cells: if ue%d = %d. n_adj_cells %d\n",PHY_vars_UE_g[Mod_id][CC_id]->Mod_id,PHY_vars_UE_g[Mod_id][CC_id],(PHY_vars_UE_g[Mod_id][CC_id])?PHY_vars_UE_g[Mod_id][CC_id]->measurements.n_adj_cells:0);
PHY_VARS_UE *ue = PHY_vars_UE_g[Mod_id][CC_id];
if (ue)
......@@ -200,7 +200,7 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
//printf("previous_thread_id %d\n",previous_thread_id);
//printf("[UE %d] ue->current_thread_id[%d] %d, subframe %d\n",ue->Mod_id,subframe,ue->current_thread_id[subframe], subframe);
for (eNB_offset = 0; eNB_offset<1+ue->measurements.n_adj_cells; eNB_offset++) {
printf("ue_rrc_measurements: UE%d, eNB_offset %d,n_adj_cells %d\n",ue->Mod_id,eNB_offset,ue->measurements.n_adj_cells);
//printf("ue_rrc_measurements: UE%d, eNB_offset %d,n_adj_cells %d\n",ue->Mod_id,eNB_offset,ue->measurements.n_adj_cells);
if (eNB_offset==0) {
ue->measurements.rssi = 0;
//ue->measurements.n0_power_tot = 0;
......@@ -353,8 +353,8 @@ void ue_rrc_measurements(PHY_VARS_UE *ue,
LOG_I(PHY,"[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d, nu %d, subframe %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l,nu,subframe);
#endif
printf("[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d, nu %d, subframe %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l,nu,subframe);
/*printf("[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d, nu %d, subframe %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l,nu,subframe);*/
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)];
off = (ue->frame_parms.first_carrier_offset+k)<<1;
......@@ -491,7 +491,7 @@ void ue_rrc_measurements_freq(PHY_VARS_UE *ue,
//printf("previous_thread_id %d\n",previous_thread_id);
for (eNB_offset = 0; eNB_offset<1+ue->measurements.n_adj_cells; eNB_offset++) {
printf("ue_rrc_measurements_freq: UE%d, eNB_offset %d,n_adj_cells %d, ofdm_symbol_size %d, symbols_per_tti %d\n",ue->Mod_id,eNB_offset,ue->measurements.n_adj_cells,ue->frame_parms.ofdm_symbol_size,ue->frame_parms.symbols_per_tti);
//printf("ue_rrc_measurements_freq: UE%d, eNB_offset %d,n_adj_cells %d, ofdm_symbol_size %d, symbols_per_tti %d\n",ue->Mod_id,eNB_offset,ue->measurements.n_adj_cells,ue->frame_parms.ofdm_symbol_size,ue->frame_parms.symbols_per_tti);
if (eNB_offset==0) {
ue->measurements.rssi = 0;
//ue->measurements.n0_power_tot = 0;
......@@ -507,13 +507,13 @@ void ue_rrc_measurements_freq(PHY_VARS_UE *ue,
if(ue->frame_parms.frame_type == FDD)
{
printf("ue_rrc_measurements_freq: FDD\n");
//printf("ue_rrc_measurements_freq: FDD\n");
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(5*ue->frame_parms.ofdm_symbol_size)+subframe*(ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti)];
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(6*ue->frame_parms.ofdm_symbol_size)+subframe*(ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti)];
}
else
{
printf("ue_rrc_measurements_freq: TDD\n");
//printf("ue_rrc_measurements_freq: TDD\n");
rxF_sss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[previous_thread_id].rxdataF[aarx][(13*ue->frame_parms.ofdm_symbol_size)+subframe*(ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti)];
rxF_pss = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(2*ue->frame_parms.ofdm_symbol_size)+subframe*(ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti)];
}
......@@ -555,14 +555,14 @@ void ue_rrc_measurements_freq(PHY_VARS_UE *ue,
// printf("pssm32 %d\n",ue->measurements.n0_power[aarx]);
ue->measurements.n0_power_dB[aarx] = (unsigned short) dB_fixed(ue->measurements.n0_power[aarx]/12);
ue->measurements.n0_power_tot /*+=*/ = ue->measurements.n0_power[aarx];
printf("UE%d,eNB%d.subframe 0 or 5 FDD: n0_power_dB %d, n0_power_tot %d\n",ue->Mod_id,ue->common_vars.eNb_id,ue->measurements.n0_power_dB[aarx],ue->measurements.n0_power_tot);
//printf("UE%d,eNB%d.subframe 0 or 5 FDD: n0_power_dB %d, n0_power_tot %d\n",ue->Mod_id,ue->common_vars.eNb_id,ue->measurements.n0_power_dB[aarx],ue->measurements.n0_power_tot);
}
//LOG_I(PHY,"Subframe %d RRC UE MEAS Noise Level %d \n", subframe, ue->measurements.n0_power_tot);
ue->measurements.n0_power_tot_dB = (unsigned short) dB_fixed(ue->measurements.n0_power_tot/(12*aarx));
ue->measurements.n0_power_tot_dBm = ue->measurements.n0_power_tot_dB - ue->rx_total_gain_dB - dB_fixed(ue->frame_parms.ofdm_symbol_size);
printf("UE%d,eNB%d.outside subframe 0 or 5 FDD: n0_power_tot_dB %d, n0_power_tot_dBm %d\n",ue->Mod_id,ue->common_vars.eNb_id,ue->measurements.n0_power_tot_dB,ue->measurements.n0_power_tot_dBm);
//printf("UE%d,eNB%d.outside subframe 0 or 5 FDD: n0_power_tot_dB %d, n0_power_tot_dBm %d\n",ue->Mod_id,ue->common_vars.eNb_id,ue->measurements.n0_power_tot_dB,ue->measurements.n0_power_tot_dBm);
} else {
LOG_E(PHY, "Not yet implemented: noise power calculation when prefix length = EXTENDED\n");
}
......@@ -648,8 +648,8 @@ void ue_rrc_measurements_freq(PHY_VARS_UE *ue,
LOG_I(PHY,"[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d, nu %d, subframe %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l,nu,subframe);
#endif
printf("[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d, nu %d, subframe %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l,nu,subframe);
/*printf("[UE %d] Frame %d subframe %d Doing ue_rrc_measurements rsrp/rssi (Nid_cell %d, nushift %d, eNB_offset %d, k %d, l %d, nu %d, subframe %d)\n",ue->Mod_id,ue->proc.proc_rxtx[subframe&1].frame_rx,subframe,Nid_cell,nushift,
eNB_offset,k,l,nu,subframe);*/
for (aarx=0; aarx<ue->frame_parms.nb_antennas_rx; aarx++) {
rxF = (int16_t *)&ue->common_vars.common_vars_rx_data_per_thread[ue->current_thread_id[subframe]].rxdataF[aarx][(l*ue->frame_parms.ofdm_symbol_size)+subframe*(ue->frame_parms.ofdm_symbol_size*ue->frame_parms.symbols_per_tti)];
off = (ue->frame_parms.first_carrier_offset+k)<<1;
......@@ -702,24 +702,24 @@ void ue_rrc_measurements_freq(PHY_VARS_UE *ue,
// 2 RE per PRB
// ue->measurements.rsrp[eNB_offset]/=(24*ue->frame_parms.N_RB_DL);
ue->measurements.rsrp[eNB_offset]/=(2*ue->frame_parms.N_RB_DL*ue->frame_parms.ofdm_symbol_size);
printf("UE%d. rsrp %d\n",ue->Mod_id,ue->measurements.rsrp[0]);
//printf("UE%d. rsrp %d\n",ue->Mod_id,ue->measurements.rsrp[0]);
// LOG_I(PHY,"eNB: %d, RSRP: %d \n",eNB_offset,ue->measurements.rsrp[eNB_offset]);
if (eNB_offset == 0) {
// ue->measurements.rssi/=(24*ue->frame_parms.N_RB_DL);
// ue->measurements.rssi*=rx_power_correction;
// ue->measurements.rssi=ue->measurements.rsrp[0]*24/2;
ue->measurements.rssi=ue->measurements.rsrp[0]*(12*ue->frame_parms.N_RB_DL);
printf("UE%d:rssi %d. rsrp %d\n",ue->Mod_id,ue->measurements.rssi,ue->measurements.rsrp[0]);
//printf("UE%d:rssi %d. rsrp %d\n",ue->Mod_id,ue->measurements.rssi,ue->measurements.rsrp[0]);
//printf("ue->measurements.rsrp[0] %d\n",ue->measurements.rsrp[0]);
}
if (ue->measurements.rssi>0){
ue->measurements.rsrq[eNB_offset] = 100*ue->measurements.rsrp[eNB_offset]*ue->frame_parms.N_RB_DL/ue->measurements.rssi;
printf("rssi>0: UE%d:rssi %d. rsrp %d\n",ue->Mod_id,ue->measurements.rssi,ue->measurements.rsrp[0]);
//printf("rssi>0: UE%d:rssi %d. rsrp %d\n",ue->Mod_id,ue->measurements.rssi,ue->measurements.rsrp[0]);
}
else{
ue->measurements.rsrq[eNB_offset] = -12000;
printf("else rssi: UE%d:rssi %d. rsrp %d\n",ue->Mod_id,ue->measurements.rssi,ue->measurements.rsrp[0]);
//printf("else rssi: UE%d:rssi %d. rsrp %d\n",ue->Mod_id,ue->measurements.rssi,ue->measurements.rsrp[0]);
}
//printf("after ue->measurements.rssi %d\n",ue->measurements.rssi);
//((200*ue->measurements.rsrq[eNB_offset]) + ((1024-200)*100*ue->measurements.rsrp[eNB_offset]*ue->frame_parms.N_RB_DL/ue->measurements.rssi))>>10;
......@@ -1192,7 +1192,7 @@ void lte_ue_measurements_freq(PHY_VARS_UE *ue,
}
// signal measurements
printf("lte_ue_measurements_freq: ue->n_connected_eNB %d\n",ue->n_connected_eNB);
//printf("lte_ue_measurements_freq: ue->n_connected_eNB %d\n",ue->n_connected_eNB);
for (eNB_id=0; eNB_id<1/*ue->n_connected_eNB*/; eNB_id++) {
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
for (aatx=0; aatx<frame_parms->nb_antenna_ports_eNB; aatx++) {
......
......@@ -127,7 +127,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[0],
frame_parms,
ue->common_vars.eNb_id,
0,
SISO,
ue->high_speed_flag,
frame_mod4);
......@@ -140,7 +140,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[0],
frame_parms,
ue->common_vars.eNb_id,
0,
ALAMOUTI,
ue->high_speed_flag,
frame_mod4);
......@@ -236,7 +236,7 @@ int pbch_detection(PHY_VARS_UE *ue, runmode_t mode)
for(int i=0; i<RX_NB_TH;i++)
{
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2;
//ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2;
ue->proc.proc_rxtx[i].frame_rx = (((ue->pbch_vars[0]->decoded_output[2]&3)<<6) + (ue->pbch_vars[0]->decoded_output[1]>>2))<<2;
#ifndef USER_MODE
// one frame delay
......@@ -504,6 +504,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
frame_parms->frame_type=FDD;
printf("Inside initial_sync: FDD\n");
init_frame_parms(frame_parms,1);
int *tmp;
/*
write_output("rxdata0.m","rxd0",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
exit(-1);
......@@ -511,7 +512,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
printf("before lte_sync_time, ue->common_vars.eNb_id %d\n",ue->common_vars.eNb_id);
sync_pos = lte_sync_time(ue->common_vars.rxdata,
frame_parms,
(int *)&ue->common_vars.eNb_id);
(int *)&tmp);
printf("after lte_sync_time, ue->common_vars.eNb_id %d\n",ue->common_vars.eNb_id);
// write_output("rxdata1.m","rxd1",ue->common_vars.rxdata[0],10*frame_parms->samples_per_tti,1,1);
if (sync_pos >= frame_parms->nb_prefix_samples)
......@@ -522,7 +523,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
#ifdef DEBUG_INITIAL_SYNCH
LOG_I(PHY,"[UE%d] Initial sync : Estimated PSS position %d, Nid2 %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
#endif
printf("[UE%d] Initial sync : Estimated PSS position %d, Nid2(eNB_id) %d\n",ue->Mod_id,sync_pos,ue->common_vars.eNb_id);
// SSS detection
// PSS is hypothesized in last symbol of first slot in Frame
......
......@@ -155,7 +155,7 @@ void phy_scope_eNB(FD_lte_phy_scope_enb *form,
int UE_id)
{
//int eNB_id = 0;
printf("phy_scope_eNB: eNB_id %d, UE %d\n",eNB_id, UE_id);
//printf("phy_scope_eNB: eNB_id %d, UE %d\n",eNB_id, UE_id);
int i,i2,arx,atx,ind,k;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_enb->frame_parms;
int nsymb_ce = 12*frame_parms->N_RB_UL*frame_parms->symbols_per_tti;
......@@ -488,7 +488,7 @@ void phy_scope_UE(FD_lte_phy_scope_ue *form,
int UE_id,
uint8_t subframe)
{
printf("phy_scope_UE: eNB_id %d, UE %d\n",eNB_id, UE_id);
//printf("phy_scope_UE: eNB_id %d, UE %d\n",eNB_id, UE_id);
int i,arx,atx,ind,k;
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_ue->frame_parms;
int nsymb_ce = frame_parms->ofdm_symbol_size;//*frame_parms->symbols_per_tti;
......
......@@ -2457,7 +2457,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
}
}
if (ue->UE_mode[0] != PRACH) {
if (ue->UE_mode[eNB_id] != PRACH) {
// check cell srs subframe and ue srs subframe. This has an impact on pusch encoding
isSubframeSRS = is_srs_occasion_common(&ue->frame_parms,proc->frame_tx,proc->subframe_tx);
......@@ -2467,7 +2467,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
}
if (ue->UE_mode[0] == PUSCH) {
if (ue->UE_mode[eNB_id] == PUSCH) {
// check if we need to use PUCCH 1a/1b
ue_pucch_procedures(ue,proc,eNB_id,abstraction_flag);
// check if we need to use SRS
......@@ -2539,7 +2539,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
} // mode != PRACH
if ((ue->UE_mode[0] == PRACH) &&
if ((ue->UE_mode[eNB_id] == PRACH) &&
(ue->frame_parms.prach_config_common.prach_Config_enabled==1)) {
// check if we have PRACH opportunity
......@@ -2782,7 +2782,7 @@ void phy_procedures_emos_UE_RX(PHY_VARS_UE *ue,uint8_t last_slot,uint8_t eNB_id)
if (last_slot==0) {
emos_dump_UE.timestamp = rt_get_time_ns();
emos_dump_UE.frame_rx = proc->frame_rx;
emos_dump_UE.UE_mode = ue->UE_mode[0];
emos_dump_UE.UE_mode = ue->UE_mode[eNB_id];
emos_dump_UE.mimo_mode = ue->transmission_mode[eNB_id];
emos_dump_UE.freq_offset = ue->common_vars.freq_offset;
emos_dump_UE.timing_advance = ue->timing_advance;
......@@ -2840,9 +2840,9 @@ void restart_phy(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uint8_t eNB_id,uint8_t ab
// first_run = 1;
if (abstraction_flag ==0 ) {
ue->UE_mode[0] = NOT_SYNCHED;
ue->UE_mode[eNB_id] = NOT_SYNCHED;
} else {
ue->UE_mode[0] = PRACH;
ue->UE_mode[eNB_id] = PRACH;
ue->prach_resources[eNB_id]=NULL;
}
......@@ -2983,9 +2983,9 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
frame_tx += pbch_phase;
if (ue->mac_enabled==1) {
printf("[UE%d] if mac_enabled? then dl_phy_sync_success. UE_mode %s\n",ue->Mod_id,ue->UE_mode[0]==NOT_SYNCHED?"NOT_SYNCHED":ue->UE_mode[0]==NOT_SYNCHED?"SYNCHED":"OTHER CHOICE");
//printf("[UE%d] if mac_enabled? then dl_phy_sync_success. UE_mode %s\n",ue->Mod_id,ue->UE_mode[eNB_id]==NOT_SYNCHED?"NOT_SYNCHED":ue->UE_mode[eNB_id]==NOT_SYNCHED?"SYNCHED":"OTHER CHOICE");
mac_xface->dl_phy_sync_success(ue->Mod_id,frame_rx,eNB_id,
ue->UE_mode[0]==NOT_SYNCHED ? 1 : 0);
ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
}
#ifdef EMOS
......@@ -3575,31 +3575,31 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
for (l=2; l<12; l++) {
rx_pmch(ue,
eNB_id,
0,
subframe_rx,
l);
}
ue->dlsch_MCH[eNB_id]->harq_processes[0]->G = get_G(&ue->frame_parms,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->nb_rb,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->rb_alloc_even,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->Qm,
ue->dlsch_MCH[0]->harq_processes[0]->G = get_G(&ue->frame_parms,
ue->dlsch_MCH[0]->harq_processes[0]->nb_rb,
ue->dlsch_MCH[0]->harq_processes[0]->rb_alloc_even,
ue->dlsch_MCH[0]->harq_processes[0]->Qm,
1,
2,
frame_rx,
subframe_rx,
0);
dlsch_unscrambling(&ue->frame_parms,1,ue->dlsch_MCH[eNB_id],
ue->dlsch_MCH[eNB_id]->harq_processes[0]->G,
ue->pdsch_vars_MCH[eNB_id]->llr[0],0,subframe_rx<<1);
dlsch_unscrambling(&ue->frame_parms,1,ue->dlsch_MCH[0],
ue->dlsch_MCH[0]->harq_processes[0]->G,
ue->pdsch_vars_MCH[0]->llr[0],0,subframe_rx<<1);
ret = dlsch_decoding(ue,
ue->pdsch_vars_MCH[eNB_id]->llr[0],
ue->pdsch_vars_MCH[0]->llr[0],
&ue->frame_parms,
ue->dlsch_MCH[eNB_id],
ue->dlsch_MCH[eNB_id]->harq_processes[0],
ue->dlsch_MCH[0],
ue->dlsch_MCH[0]->harq_processes[0],
frame_rx,
subframe_rx,
0,
......@@ -3614,29 +3614,29 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
}
if (mcch_active == 1)
ue->dlsch_mcch_trials[sync_area][eNB_id]++;
ue->dlsch_mcch_trials[sync_area][0]++;
else
ue->dlsch_mtch_trials[sync_area][eNB_id]++;
ue->dlsch_mtch_trials[sync_area][0]++;
if (ret == (1+ue->dlsch_MCH[eNB_id]->max_turbo_iterations)) {
if (ret == (1+ue->dlsch_MCH[0]->max_turbo_iterations)) {
if (mcch_active == 1)
ue->dlsch_mcch_errors[sync_area][eNB_id]++;
ue->dlsch_mcch_errors[sync_area][0]++;
else
ue->dlsch_mtch_errors[sync_area][eNB_id]++;
ue->dlsch_mtch_errors[sync_area][0]++;
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: PMCH in error (%d,%d), not passing to L2 (TBS %d, iter %d,G %d)\n",
ue->Mod_id,
frame_rx,subframe_rx,
ue->dlsch_mcch_errors[sync_area][eNB_id],
ue->dlsch_mtch_errors[sync_area][eNB_id],
ue->dlsch_MCH[eNB_id]->harq_processes[0]->TBS>>3,
ue->dlsch_MCH[eNB_id]->max_turbo_iterations,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->G);
dump_mch(ue,eNB_id,ue->dlsch_MCH[eNB_id]->harq_processes[0]->G,subframe_rx);
ue->dlsch_mcch_errors[sync_area][0],
ue->dlsch_mtch_errors[sync_area][0],
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
ue->dlsch_MCH[0]->max_turbo_iterations,
ue->dlsch_MCH[0]->harq_processes[0]->G);
dump_mch(ue,eNB_id,ue->dlsch_MCH[0]->harq_processes[0]->G,subframe_rx);
#ifdef DEBUG_DLSCH
for (int i=0; i<ue->dlsch_MCH[eNB_id]->harq_processes[0]->TBS>>3; i++) {
LOG_T(PHY,"%02x.",ue->dlsch_MCH[eNB_id]->harq_processes[0]->c[0][i]);
for (int i=0; i<ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3; i++) {
LOG_T(PHY,"%02x.",ue->dlsch_MCH[0]->harq_processes[0]->c[0][i]);
}
LOG_T(PHY,"\n");
......@@ -3651,18 +3651,18 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
mac_xface->ue_send_mch_sdu(ue->Mod_id,
CC_id,
frame_rx,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->b,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->TBS>>3,
ue->dlsch_MCH[0]->harq_processes[0]->b,
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
eNB_id,// not relevant in eMBMS context
sync_area);
ue->dlsch_mcch_received[sync_area][eNB_id]++;
ue->dlsch_mcch_received[sync_area][0]++;
if (ue->dlsch_mch_received_sf[subframe_rx%5][eNB_id] == 1 ) {
ue->dlsch_mch_received_sf[subframe_rx%5][eNB_id]=0;
if (ue->dlsch_mch_received_sf[subframe_rx%5][0] == 1 ) {
ue->dlsch_mch_received_sf[subframe_rx%5][0]=0;
} else {
ue->dlsch_mch_received[eNB_id]+=1;
ue->dlsch_mch_received_sf[subframe_rx][eNB_id]=1;
ue->dlsch_mch_received[0]+=1;
ue->dlsch_mch_received_sf[subframe_rx][0]=1;
}
......@@ -3822,11 +3822,11 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo
LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Received RAR mode %d\n",
ue->Mod_id,
frame_rx,
subframe_rx, ue->UE_mode[0]);
subframe_rx, ue->UE_mode[eNB_id]);
if (ue->mac_enabled == 1) {
if ((ue->UE_mode[0] != PUSCH) &&
if ((ue->UE_mode[eNB_id] != PUSCH) &&
(ue->prach_resources[eNB_id]->Msg3!=NULL)) {
LOG_D(PHY,"[UE %d][RAPROC] Frame %d subframe %d Invoking MAC for RAR (current preamble %d)\n",
ue->Mod_id,frame_rx,
......@@ -3880,7 +3880,7 @@ void process_rar(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, runmode_t mo
ue->ulsch_Msg3_subframe[eNB_id]);
ue->ulsch[eNB_id]->harq_processes[harq_pid]->round = 0;
ue->UE_mode[0] = RA_RESPONSE;
ue->UE_mode[eNB_id] = RA_RESPONSE;
// ue->Msg3_timer[eNB_id] = 10;
ue->ulsch[eNB_id]->power_offset = 6;
ue->ulsch_no_allocation_counter[eNB_id] = 0;
......@@ -4185,7 +4185,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
mac_xface->ue_decode_si(ue->Mod_id,
CC_id,
frame_rx,
eNB_id,
ue->common_vars.eNb_id,
ue->dlsch_SI[eNB_id]->harq_processes[0]->b,
ue->dlsch_SI[eNB_id]->harq_processes[0]->TBS>>3);
break;
......@@ -5690,7 +5690,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u
int slot;
if (ue->mac_enabled == 0) {
ue->UE_mode[0]=PUSCH;
ue->UE_mode[eNB_id]=PUSCH;
}
......
......@@ -451,6 +451,7 @@ ue_send_sdu(
LOG_T(MAC,"\n");
#endif
//printf("ue_send_sdu\n");
mac_rrc_data_ind(module_idP,
CC_id,
frameP,subframeP,
......
......@@ -347,7 +347,7 @@ mac_rrc_data_ind(
SRB_INFO *Srb_info;
protocol_ctxt_t ctxt;
sdu_size_t sdu_size = 0;
printf("mac_rrc_data_ind\n");
/* for no gcc warnings */
(void)sdu_size;
......
......@@ -4324,7 +4324,7 @@ NAS_KENB_REFRESH_REQ,NAS_CELL_SELECTION_REQ,RRC_STATE_INACTIVE,RRC_STATE_IDLE,RR
// PROTOCOL_CTXT_SET_BY_INSTANCE(&ctxt, instance, ENB_FLAG_NO, NOT_A_RNTI, RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, ue_mod_id, ENB_FLAG_NO, NOT_A_RNTI, RRC_MAC_BCCH_DATA_IND (msg_p).frame, 0,RRC_MAC_BCCH_DATA_IND (msg_p).enb_index);
//printf("decode_BCCH_DLSCH_Message for ue %d \n",ue_mod_id);
printf("decode_BCCH_DLSCH_Message for ue %d, enb %d \n",ue_mod_id,RRC_MAC_BCCH_DATA_IND (msg_p).enb_index);
decode_BCCH_DLSCH_Message (&ctxt,
RRC_MAC_BCCH_DATA_IND (msg_p).enb_index,
RRC_MAC_BCCH_DATA_IND (msg_p).sdu,
......@@ -4444,7 +4444,7 @@ NAS_KENB_REFRESH_REQ,NAS_CELL_SELECTION_REQ,RRC_STATE_INACTIVE,RRC_STATE_IDLE,RR
if (rrc_get_state(ue_mod_id) == RRC_STATE_INACTIVE) {
// have a look at MAC/main.c void dl_phy_sync_success(...)
printf("openair_rrc_ue_init: UE %d\n",ue_mod_id);
openair_rrc_ue_init(ue_mod_id,0/*PHY_vars_UE_g[ue_mod_id][0]->common_vars.eNb_id*/);
openair_rrc_ue_init(ue_mod_id,PHY_vars_UE_g[ue_mod_id][0]->common_vars.eNb_id);
}
/* Save cell selection criterion */
......
......@@ -848,7 +848,7 @@ static void *UE_thread_rxn_txnp4(void *arg) {
proc->frame_tx,
proc->subframe_tx,
subframe_select(&UE->frame_parms,proc->subframe_tx),
0,
UE->common_vars.eNb_id,
0/*FIXME CC_id*/);
if ( ret != CONNECTION_OK) {
char *txt;
......
......@@ -237,7 +237,7 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
} // hold channel
}
else { //abstraction_flag
eNB_id = PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id;
//eNB_id = PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id;
pthread_mutex_lock(&eNB_output_mutex[UE_id]);
if (eNB_output_mask[UE_id] == 0) { // This is the first eNodeB for this UE, clear the buffer
......@@ -249,7 +249,7 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
}
pthread_mutex_unlock(&eNB_output_mutex[UE_id]);
//for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
txdata = PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.txdata[0];
sf_offset = subframe*frame_parms->samples_per_tti;
//for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d, eNB_id %d: txdata[%d] = (%d,%d)\n", subframe,eNB_id, idx, ((short*)&txdata[0][sf_offset+idx])[0], ((short*)&txdata[0][sf_offset+idx])[1]);
......@@ -386,7 +386,7 @@ void do_DL_sig(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][MAX_N
} // eNB_output_mask
pthread_mutex_unlock(&eNB_output_mutex[UE_id]);
//} // eNB_id
} // eNB_id
}
}
......@@ -480,7 +480,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
}
else { //abstraction_flag = 0
printf("UE association: (UE%d->eNB%d)\n",UE_id,PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id);
//printf("UE association: (UE%d->eNB%d)\n",UE_id,PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id);
eNB_id = PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id;
pthread_mutex_lock(&eNB_output_mutex[UE_id]);
//printf("eNB_output_mask[UE_id] is %d\n",eNB_output_mask[UE_id]);
......@@ -535,10 +535,10 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
//for (x=0;x<frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti;x++){
// fprintf(file1,"%d\t%e\t%e\n",x,s_re_f[0][x],s_im_f[0][x]);
//}
if (eNB_id==0 && subframe ==9)
/*if (eNB_id==0 && subframe ==9)
write_output("txsigF0.m","txF0", PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.txdataF[0][0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
else if (eNB_id==1 && subframe ==9)
write_output("txsigF1.m","txF1", PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.txdataF[0][0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
write_output("txsigF1.m","txF1", PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.txdataF[0][0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);*/
#ifdef DEBUG_SIM
LOG_D(OCM,"[SIM][DL] eNB %d (CCid %d): tx_pwr %.1f dBm/RE (target %d dBm/RE), for subframe %d\n",
eNB_id,CC_id,
......@@ -579,16 +579,16 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
rx_pwr = signal_energy_fp2(eNB2UE[eNB_id][UE_id][CC_id]->chF[0],
frame_parms->N_RB_DL*12+1)*(frame_parms->N_RB_DL*12+1);
printf("[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);
//printf("[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);
//#ifdef DEBUG_SIM
if (eNB_id==0 && UE_id ==0 && subframe ==9)
/*if (eNB_id==0 && UE_id ==0 && subframe ==9)
write_output_chFf("channelF00.m","chF00", eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y,frame_parms->ofdm_symbol_size,1);
else if (eNB_id==1 && UE_id ==0 && subframe ==9)
write_output_chFf("channelF10.m","chF10", eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y,frame_parms->ofdm_symbol_size,1);
else if (eNB_id==0 && UE_id ==1 && subframe ==9)
write_output_chFf("channelF01.m","chF01", eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y,frame_parms->ofdm_symbol_size,1);
else if (eNB_id==1 && UE_id ==1 && subframe ==9)
write_output_chFf("channelF11.m","chF11", eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y,frame_parms->ofdm_symbol_size,1);
write_output_chFf("channelF11.m","chF11", eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y,frame_parms->ofdm_symbol_size,1);*/
/*for (i=0; i<frame_parms->N_RB_DL*12; i++){
printf("do_DL_sig channel(eNB%d,UE%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,[i],eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y[i]);
}*/
......@@ -736,7 +736,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
12);
stop_meas(&eNB2UE[eNB_id][UE_id][CC_id]->DL_adc_freq);
#endif
if (eNB_id==0 && subframe ==9){
/*if (eNB_id==0 && subframe ==9){
if (UE_id==0)
write_output("rxsigF00.m","rxF00", PHY_vars_UE_g[UE_id][CC_id]->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
else if (UE_id==1)
......@@ -747,7 +747,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
write_output("rxsigF10.m","rxF10", PHY_vars_UE_g[UE_id][CC_id]->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
else if (UE_id==1)
write_output("rxsigF11.m","rxF11", PHY_vars_UE_g[UE_id][CC_id]->common_vars.common_vars_rx_data_per_thread[subframe&0x1].rxdataF[0],10*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti,1,16);
}
}*/
//for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d: r_re_p_f[%d] = (%e,%e)\n", subframe, idx, r_re_p_f[0][idx], r_im_p_f[0][idx]);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d,UE %d, eNB_id %d: rxdataF0[%d] = (%d,%d)\n", subframe,UE_id,eNB_id, idx, ((short*)&rxdataF[0][sf_offset+idx])[0], ((short*)&rxdataF[0][sf_offset+idx])[1]);
//print_meas (&eNB2UE[eNB_id][UE_id][CC_id]->DL_adc,"[DL][adc]", &eNB2UE[eNB_id][UE_id][CC_id]->DL_adc, &eNB2UE[eNB_id][UE_id][CC_id]->DL_adc);
......@@ -873,8 +873,8 @@ void do_UL_sig(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB_MAX][MAX_N
// Compute RX signal for eNB = eNB_id
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
//printf("ue->generate_ul_signal[%d] %d\n",eNB_id,PHY_vars_UE_g[UE_id][CC_id]->generate_ul_signal[eNB_id]);
if (PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id != eNB_id)
continue;
//if (PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id != eNB_id)
// continue;
//printf("[channel_sim_UL_time] subframe %d\n",subframe);
txdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.txdata;
sf_offset = subframe*frame_parms->samples_per_tti;
......
......@@ -51,17 +51,17 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->Mod_id=eNB_id;
PHY_vars_eNB->cooperation_flag=0;//cooperation_flag;
memcpy(&(PHY_vars_eNB->frame_parms), frame_parms, sizeof(LTE_DL_FRAME_PARMS));
//PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell;
//PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
PHY_vars_eNB->frame_parms.Nid_cell = Nid_cell;
PHY_vars_eNB->frame_parms.nushift = PHY_vars_eNB->frame_parms.Nid_cell%6;
phy_init_lte_eNB(PHY_vars_eNB,0,abstraction_flag);
LOG_I(PHY,"init eNB: Node Function %d\n",node_function);
LOG_I(PHY,"init eNB: Nid_cell %d\n", frame_parms->Nid_cell);
LOG_I(PHY,"init eNB: frame_type %d,tdd_config %d\n", frame_parms->frame_type,frame_parms->tdd_config);
LOG_I(PHY,"init eNB: number of ue max %d number of enb max %d number of harq pid max %d\n",
LOG_I(PHY,"init eNB%d: Node Function %d\n",eNB_id,node_function);
LOG_I(PHY,"init eNB%d: Nid_cell %d\n",eNB_id, frame_parms->Nid_cell);
LOG_I(PHY,"init eNB%d: frame_type %d,tdd_config %d\n",eNB_id, frame_parms->frame_type,frame_parms->tdd_config);
LOG_I(PHY,"init eNB%d: number of ue max %d number of enb max %d number of harq pid max %d\n",eNB_id,
NUMBER_OF_UE_MAX, NUMBER_OF_eNB_MAX, NUMBER_OF_HARQ_PID_MAX);
LOG_I(PHY,"init eNB: N_RB_DL %d\n", frame_parms->N_RB_DL);
LOG_I(PHY,"init eNB: prach_config_index %d\n", frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
LOG_I(PHY,"init eNB%d: N_RB_DL %d\n",eNB_id, frame_parms->N_RB_DL);
LOG_I(PHY,"init eNB%d: prach_config_index %d\n",eNB_id, frame_parms->prach_config_common.prach_ConfigInfo.prach_ConfigIndex);
if (node_function >= NGFI_RRU_IF5)
// For RRU, don't allocate DLSCH/ULSCH Transport channel buffers
......@@ -235,49 +235,43 @@ void init_lte_vars(LTE_DL_FRAME_PARMS *frame_parms[MAX_NUM_CCs],
memset(mac_xface, 0, sizeof(MAC_xface));
LOG_I(PHY,"init lte parms: Nid_cell %d, Frame type %d, N_RB_DL %d\n",Nid_cell,frame_type,N_RB_DL);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id] = calloc(1, sizeof(LTE_DL_FRAME_PARMS));
(frame_parms[CC_id])->frame_type = frame_type;
(frame_parms[CC_id])->tdd_config = tdd_config;
(frame_parms[CC_id])->tdd_config_S = tdd_config_S;
(frame_parms[CC_id])->N_RB_DL = N_RB_DL;
(frame_parms[CC_id])->N_RB_UL = (frame_parms[CC_id])->N_RB_DL;
(frame_parms[CC_id])->phich_config_common.phich_resource = oneSixth;
(frame_parms[CC_id])->phich_config_common.phich_duration = normal;
(frame_parms[CC_id])->Ncp = extended_prefix_flag;
(frame_parms[CC_id])->Ncp_UL = extended_prefix_flag;
(frame_parms[CC_id])->Nid_cell = Nid_cell;
(frame_parms[CC_id])->nushift = (Nid_cell%6);
(frame_parms[CC_id])->nb_antennas_tx = nb_antennas_tx;
(frame_parms[CC_id])->nb_antennas_rx = nb_antennas_rx;
(frame_parms[CC_id])->nb_antenna_ports_eNB = nb_antenna_ports;
(frame_parms[CC_id])->mode1_flag = (frame_parms[CC_id])->nb_antenna_ports_eNB==1 ? 1 : 0;
init_frame_parms(frame_parms[CC_id],1);
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
init_ul_hopping(frame_parms[CC_id]);
}
// phy_init_top(frame_parms[0]);
phy_init_lte_top(frame_parms[0]);
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] = (PHY_VARS_eNB**) malloc(MAX_NUM_CCs*sizeof(PHY_VARS_eNB*));
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
frame_parms[CC_id] = calloc(1, sizeof(LTE_DL_FRAME_PARMS));
(frame_parms[CC_id])->frame_type = frame_type;
(frame_parms[CC_id])->tdd_config = tdd_config;
(frame_parms[CC_id])->tdd_config_S = tdd_config_S;
(frame_parms[CC_id])->N_RB_DL = N_RB_DL;
(frame_parms[CC_id])->N_RB_UL = (frame_parms[CC_id])->N_RB_DL;
(frame_parms[CC_id])->phich_config_common.phich_resource = oneSixth;
(frame_parms[CC_id])->phich_config_common.phich_duration = normal;
(frame_parms[CC_id])->Ncp = extended_prefix_flag;
(frame_parms[CC_id])->Ncp_UL = extended_prefix_flag;
(frame_parms[CC_id])->Nid_cell = Nid_cell+eNB_id;
(frame_parms[CC_id])->nushift = ((Nid_cell+eNB_id)%6);
(frame_parms[CC_id])->nb_antennas_tx = nb_antennas_tx;
(frame_parms[CC_id])->nb_antennas_rx = nb_antennas_rx;
(frame_parms[CC_id])->nb_antenna_ports_eNB = nb_antenna_ports;
(frame_parms[CC_id])->mode1_flag = (frame_parms[CC_id])->nb_antenna_ports_eNB==1 ? 1 : 0;
init_frame_parms(frame_parms[CC_id],1);
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift = 0;//n_DMRS1 set to 0
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.groupHoppingEnabled = 1;
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.sequenceHoppingEnabled = 0;
(frame_parms[CC_id])->pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
init_ul_hopping(frame_parms[CC_id]);
phy_init_lte_top(frame_parms[CC_id]);
LOG_I(PHY,"init lte parms: Nid_cell %d, Frame type %d, N_RB_DL %d, nushift %d\n",(frame_parms[CC_id])->Nid_cell,(frame_parms[CC_id])->frame_type,(frame_parms[CC_id])->N_RB_DL,(frame_parms[CC_id])->nushift);
PHY_vars_eNB_g[eNB_id][CC_id] = init_lte_eNB(frame_parms[CC_id],eNB_id,Nid_cell+eNB_id,eNodeB_3GPP,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;
PHY_vars_eNB_g[eNB_id][CC_id] = init_lte_eNB(frame_parms[CC_id],eNB_id,Nid_cell,eNodeB_3GPP,abstraction_flag);
}
}
......
......@@ -507,11 +507,11 @@ l2l1_task (void *args_p)
xargv[0] = xname;
fl_initialize (&xargc, xargv, NULL, 0, 0);
//eNB_inst = 0;
for (eNB_inst = 0; eNB_inst < NB_eNB_INST; eNB_inst++) {
for (eNB_inst = 0; eNB_inst < 1/*NB_eNB_INST*/; eNB_inst++) {
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
// DL scope at UEs
printf("Creating form_ue and form_enb: xforms = %d, eNB (%d,%d), UE (%d,%d)\n",xforms,eNB_inst,PHY_vars_eNB_g[eNB_inst][0]->Mod_id,UE_inst,PHY_vars_UE_g[UE_inst][0]->Mod_id);
//printf("Creating form_ue and form_enb: xforms = %d, eNB (%d,%d), UE (%d,%d)\n",xforms,eNB_inst,PHY_vars_eNB_g[eNB_inst][0]->Mod_id,UE_inst,PHY_vars_UE_g[UE_inst][0]->Mod_id);
form_ue[CC_id][UE_inst] = create_lte_phy_scope_ue();
sprintf (title, "LTE DL SCOPE eNB %d to UE %d CC_id %d", eNB_inst, UE_inst, CC_id);
fl_show_form (form_ue[CC_id][UE_inst]->lte_phy_scope_ue, FL_PLACE_HOTSPOT, FL_FULLBORDER, title);
......@@ -1133,10 +1133,10 @@ l2l1_task (void *args_p)
//#ifdef XFORMS
if (xforms==1) {
//eNB_inst = 0;
for (eNB_inst = 0; eNB_inst < NB_eNB_INST; eNB_inst++) {
for (eNB_inst = 0; eNB_inst < 1/*NB_eNB_INST*/; eNB_inst++) {
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) {
//for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) {
printf("Using phy_scope_UE_and_eNB: xforms = %d, eNB (%d,%d), UE (%d,%d)\n",xforms,eNB_inst,PHY_vars_eNB_g[eNB_inst][0]->Mod_id,UE_inst,PHY_vars_UE_g[UE_inst][0]->Mod_id);
//printf("Using phy_scope_UE_and_eNB: xforms = %d, eNB (%d,%d), UE (%d,%d)\n",xforms,eNB_inst,PHY_vars_eNB_g[eNB_inst][0]->Mod_id,UE_inst,PHY_vars_UE_g[UE_inst][0]->Mod_id);
phy_scope_UE(form_ue[0][UE_inst],
PHY_vars_UE_g[UE_inst][0],
eNB_inst,
......
......@@ -1456,7 +1456,7 @@ void init_openair1(void)
#endif
// change the nb_connected_eNB
mac_xface = malloc(sizeof(MAC_xface));
/*mac_xface = malloc(sizeof(MAC_xface));
memset(mac_xface, 0, sizeof(MAC_xface));
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++) {
......@@ -1510,8 +1510,8 @@ void init_openair1(void)
for (RN_id=0; RN_id<NB_RN_INST; RN_id++) {
PHY_vars_RN_g[RN_id] = init_lte_RN(*frame_parms,RN_id,oai_emulation.info.eMBMS_active_state);
}
}
/*init_lte_vars (&frame_parms[CC_id],
}*/
init_lte_vars (&frame_parms[CC_id],
oai_emulation.info.frame_type[CC_id],
oai_emulation.info.tdd_config[CC_id],
oai_emulation.info.tdd_config_S[CC_id],
......@@ -1524,7 +1524,7 @@ void init_openair1(void)
enb_properties->properties[eNB_id]->nb_antennas_rx[CC_id],
enb_properties->properties[eNB_id]->nb_antennas_tx[CC_id],
nb_antennas_rx_ue,
oai_emulation.info.eMBMS_active_state);*/
oai_emulation.info.eMBMS_active_state);
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
for (eNB_id=0;eNB_id<enb_properties->number;eNB_id++) {
......@@ -1917,7 +1917,7 @@ void update_ocm()
UE_id, ue_data[UE_id]->x,ue_data[UE_id]->y,
distance);*/
}
printf("UE %d is associated to eNB %d based on pathloss\n",UE_id,PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id);
printf("UE %d is associated to eNB %d based on pathloss (%s domain)\n",UE_id,PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id,(PHY_vars_UE_g[UE_id][CC_id]->do_ofdm_mod)?"Frequency":"Time");
}
}
}
......
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