Commit d8ad650f authored by lfarizav's avatar lfarizav

Multiple RRUs. PRACH successful

parent ba403ee0
...@@ -68,7 +68,7 @@ phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id) ...@@ -68,7 +68,7 @@ phy_adjust_gain (PHY_VARS_UE *ue, uint32_t rx_power_fil_dB, uint8_t eNB_id)
} }
LOG_D(PHY,"[UE %d] Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",ue->Mod_id,ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB); LOG_D(PHY,"[UE %d] Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",ue->Mod_id,ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB);
printf("[UE %d] Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",ue->Mod_id,ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB); //printf("[UE %d] Gain control: rx_total_gain_dB = %d (max %d,rxpf %d)\n",ue->Mod_id,ue->rx_total_gain_dB,MAX_RF_GAIN,rx_power_fil_dB);
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
/* if ((ue->frame%100==0) || (ue->frame < 10)) /* if ((ue->frame%100==0) || (ue->frame < 10))
msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n", msg("[PHY][ADJUST_GAIN] frame %d, rx_power = %d, rx_power_fil = %d, rx_power_fil_dB = %d, coef=%d, ncoef=%d, rx_total_gain_dB = %d (%d,%d,%d)\n",
......
...@@ -101,7 +101,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -101,7 +101,7 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
if (ue->mac_enabled==1) { if (ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch(); //mac_resynch();
mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id); mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,ue->common_vars.eNb_id,1);//ue->common_vars.eNb_id);
ue->UE_mode[0] = PRACH; ue->UE_mode[0] = PRACH;
} }
else { else {
......
...@@ -721,7 +721,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ...@@ -721,7 +721,7 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
if (ue->mac_enabled==1) { if (ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch(); //mac_resynch();
mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id); mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,ue->common_vars.eNb_id,1);//ue->common_vars.eNb_id);
ue->UE_mode[0] = PRACH; ue->UE_mode[0] = PRACH;
} }
else { else {
...@@ -963,7 +963,7 @@ int initial_sync_freq(PHY_VARS_UE *ue, runmode_t mode) ...@@ -963,7 +963,7 @@ int initial_sync_freq(PHY_VARS_UE *ue, runmode_t mode)
if (ue->mac_enabled==1) { if (ue->mac_enabled==1) {
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id); LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch(); //mac_resynch();
mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,0,1);//ue->common_vars.eNb_id); mac_xface->dl_phy_sync_success(ue->Mod_id,ue->proc.proc_rxtx[0].frame_rx,ue->common_vars.eNb_id,1);//ue->common_vars.eNb_id);
ue->UE_mode[0] = PRACH; ue->UE_mode[0] = PRACH;
} }
else { else {
......
...@@ -193,7 +193,7 @@ int slot_fep(PHY_VARS_UE *ue, ...@@ -193,7 +193,7 @@ int slot_fep(PHY_VARS_UE *ue,
#if UE_TIMING_TRACE #if UE_TIMING_TRACE
start_meas(&ue->dlsch_channel_estimation_stats); start_meas(&ue->dlsch_channel_estimation_stats);
#endif #endif
lte_dl_channel_estimation(ue,eNB_id,0, lte_dl_channel_estimation(ue,0,0,
Ns, Ns,
aa, aa,
l, l,
...@@ -203,7 +203,7 @@ int slot_fep(PHY_VARS_UE *ue, ...@@ -203,7 +203,7 @@ int slot_fep(PHY_VARS_UE *ue,
#endif #endif
for (i=0; i<ue->measurements.n_adj_cells; i++) { for (i=0; i<ue->measurements.n_adj_cells; i++) {
lte_dl_channel_estimation(ue,eNB_id,i+1, lte_dl_channel_estimation(ue,0,i+1,
Ns, Ns,
aa, aa,
l, l,
...@@ -224,7 +224,7 @@ int slot_fep(PHY_VARS_UE *ue, ...@@ -224,7 +224,7 @@ int slot_fep(PHY_VARS_UE *ue,
start_meas(&ue->dlsch_freq_offset_estimation_stats); start_meas(&ue->dlsch_freq_offset_estimation_stats);
#endif #endif
lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[current_thread_id[Ns>>1]].dl_ch_estimates[eNB_id], lte_est_freq_offset(common_vars->common_vars_rx_data_per_thread[current_thread_id[Ns>>1]].dl_ch_estimates[0],
frame_parms, frame_parms,
l, l,
&common_vars->freq_offset, &common_vars->freq_offset,
......
...@@ -1402,7 +1402,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt ...@@ -1402,7 +1402,7 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t empt
} }
void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode) { void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uint8_t abstraction_flag,runmode_t mode) {
printf("ue_prach_procedures: eNB_id %d, ue->common_vars.eNb.id %d, mac enabled %d\n",eNB_id,ue->common_vars.eNb_id,ue->mac_enabled==1);
int frame_tx = proc->frame_tx; int frame_tx = proc->frame_tx;
int subframe_tx = proc->subframe_tx; int subframe_tx = proc->subframe_tx;
int prach_power; int prach_power;
...@@ -1420,6 +1420,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1420,6 +1420,7 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
if (ue->mac_enabled==1){ if (ue->mac_enabled==1){
// ask L2 for RACH transport // ask L2 for RACH transport
printf("ue_prach_procedures: ask L2 for RACH transport: %d,%d,%d\n",mode != rx_calib_ue,mode != rx_calib_ue_med,mode != no_L2_connect);
if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) { if ((mode != rx_calib_ue) && (mode != rx_calib_ue_med) && (mode != rx_calib_ue_byp) && (mode != no_L2_connect) ) {
LOG_D(PHY,"Getting PRACH resources\n"); LOG_D(PHY,"Getting PRACH resources\n");
ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(ue->Mod_id, ue->prach_resources[eNB_id] = mac_xface->ue_get_rach(ue->Mod_id,
...@@ -1429,6 +1430,8 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1429,6 +1430,8 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
subframe_tx); subframe_tx);
LOG_D(PHY,"Got prach_resources for eNB %d address %p, RRCCommon %p\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon); LOG_D(PHY,"Got prach_resources for eNB %d address %p, RRCCommon %p\n",eNB_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]); LOG_D(PHY,"Prach resources %p\n",ue->prach_resources[eNB_id]);
printf("Got prach_resources for eNB %d address %p, RRCCommon %p\n",ue->common_vars.eNb_id,ue->prach_resources[eNB_id],UE_mac_inst[ue->Mod_id].radioResourceConfigCommon);
printf("Prach resources %p\n",ue->prach_resources[eNB_id]);
} }
} }
...@@ -1508,11 +1511,11 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1508,11 +1511,11 @@ void ue_prach_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
mac_xface->Msg1_transmitted(ue->Mod_id, mac_xface->Msg1_transmitted(ue->Mod_id,
ue->CC_id, ue->CC_id,
frame_tx, frame_tx,
eNB_id); ue->common_vars.eNb_id);
} }
LOG_I(PHY,"[UE %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n", LOG_I(PHY,"[UE %d][RAPROC] Frame %d, subframe %d: Generating PRACH (eNB %d (ue->common_vars.eNb_id %d)) preamble index %d for UL, TX power %d dBm (PL %d dB), l3msg \n",
ue->Mod_id,frame_tx,subframe_tx,eNB_id, ue->Mod_id,frame_tx,subframe_tx,eNB_id,ue->common_vars.eNb_id,
ue->prach_resources[eNB_id]->ra_PreambleIndex, ue->prach_resources[eNB_id]->ra_PreambleIndex,
ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id), ue->prach_resources[eNB_id]->ra_PREAMBLE_RECEIVED_TARGET_POWER+get_PL(ue->Mod_id,ue->CC_id,eNB_id),
get_PL(ue->Mod_id,ue->CC_id,eNB_id)); get_PL(ue->Mod_id,ue->CC_id,eNB_id));
...@@ -2448,7 +2451,6 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui ...@@ -2448,7 +2451,6 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
#endif #endif
ue->tx_power_dBm[subframe_tx]=-127; ue->tx_power_dBm[subframe_tx]=-127;
if (abstraction_flag==0) { if (abstraction_flag==0) {
for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) { for (aa=0; aa<frame_parms->nb_antennas_tx; aa++) {
memset(&ue->common_vars.txdataF[aa][subframe_tx*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti], memset(&ue->common_vars.txdataF[aa][subframe_tx*frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti],
...@@ -2495,7 +2497,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui ...@@ -2495,7 +2497,7 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
CC_id, CC_id,
frame_tx, frame_tx,
subframe_tx, subframe_tx,
eNB_id, ue->common_vars.eNb_id,
ulsch_input_buffer, ulsch_input_buffer,
input_buffer_length, input_buffer_length,
&access_mode); &access_mode);
...@@ -2538,14 +2540,14 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui ...@@ -2538,14 +2540,14 @@ void phy_procedures_UE_TX(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,ui
ulsch_common_procedures(ue,proc, (ue->generate_ul_signal[eNB_id] == 0)); ulsch_common_procedures(ue,proc, (ue->generate_ul_signal[eNB_id] == 0));
} // mode != PRACH } // mode != PRACH
printf("phy_procedures_UE_TX: ue->UE_mode[eNB_id] == PRACH? %d,%d\n",ue->UE_mode[eNB_id] == PRACH,ue->frame_parms.prach_config_common.prach_Config_enabled==1);
if ((ue->UE_mode[eNB_id] == PRACH) && if ((ue->UE_mode[eNB_id] == PRACH) &&
(ue->frame_parms.prach_config_common.prach_Config_enabled==1)) { (ue->frame_parms.prach_config_common.prach_Config_enabled==1)) {
// check if we have PRACH opportunity // check if we have PRACH opportunity
if (is_prach_subframe(&ue->frame_parms,frame_tx,subframe_tx)) { if (is_prach_subframe(&ue->frame_parms,frame_tx,subframe_tx)) {
printf("is there a PRACH opportunity? %d\n",is_prach_subframe(&ue->frame_parms,frame_tx,subframe_tx));
ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode); ue_prach_procedures(ue,proc,eNB_id,abstraction_flag,mode);
} }
} // mode is PRACH } // mode is PRACH
...@@ -2899,6 +2901,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2899,6 +2901,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
{ {
//printf("PBCH: id %d\n",ue->Mod_id); //printf("PBCH: id %d\n",ue->Mod_id);
// int i; // int i;
printf("ue_pbch_procedures: eNB_id %d, ue->common_vars.eNb.id %d\n",eNB_id,ue->common_vars.eNb_id);
int pbch_tx_ant=0; int pbch_tx_ant=0;
uint8_t pbch_phase; uint8_t pbch_phase;
uint16_t frame_tx; uint16_t frame_tx;
...@@ -2922,7 +2925,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2922,7 +2925,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
for (pbch_trials=0; pbch_trials<4; pbch_trials++) { for (pbch_trials=0; pbch_trials<4; pbch_trials++) {
//for (pbch_phase=0;pbch_phase<4;pbch_phase++) { //for (pbch_phase=0;pbch_phase<4;pbch_phase++) {
printf("[UE %d] Frame %d, Trying PBCH %d (NidCell %d, eNB_id %d)\n",ue->Mod_id,frame_rx,pbch_phase,ue->frame_parms.Nid_cell,eNB_id); printf("[UE %d] Frame %d, Trying PBCH %d (NidCell %d, eNB_id %d)\n",ue->Mod_id,frame_rx,pbch_phase,ue->frame_parms.Nid_cell,ue->common_vars.eNb_id);
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
pbch_tx_ant = rx_pbch(&ue->common_vars, pbch_tx_ant = rx_pbch(&ue->common_vars,
ue->pbch_vars[eNB_id], ue->pbch_vars[eNB_id],
...@@ -2984,7 +2987,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -2984,7 +2987,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
if (ue->mac_enabled==1) { 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[eNB_id]==NOT_SYNCHED?"NOT_SYNCHED":ue->UE_mode[eNB_id]==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, mac_xface->dl_phy_sync_success(ue->Mod_id,frame_rx,ue->common_vars.eNb_id,
ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0); ue->UE_mode[eNB_id]==NOT_SYNCHED ? 1 : 0);
} }
...@@ -3103,7 +3106,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin ...@@ -3103,7 +3106,7 @@ void ue_pbch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc, uin
int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t abstraction_flag) int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t abstraction_flag)
{ {
printf("ue_pdcch_procedures: eNB_id %d, ue->common_vars.eNb.id %d\n",eNB_id,ue->common_vars.eNb_id);
unsigned int dci_cnt=0, i; unsigned int dci_cnt=0, i;
int frame_rx = proc->frame_rx; int frame_rx = proc->frame_rx;
...@@ -3722,7 +3725,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC ...@@ -3722,7 +3725,7 @@ void ue_pdsch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, int eNB_id, PDSC
int harq_pid; int harq_pid;
int i_mod,eNB_id_i,dual_stream_UE; int i_mod,eNB_id_i,dual_stream_UE;
int first_symbol_flag=0; int first_symbol_flag=0;
printf("ue_pdsch_procedures: eNB_id %d, ue->common_vars.eNb.id %d\n",eNB_id,ue->common_vars.eNb_id);
if (dlsch0->active == 0) if (dlsch0->active == 0)
return; return;
...@@ -5767,7 +5770,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u ...@@ -5767,7 +5770,7 @@ void phy_procedures_UE_lte(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,u
frame_tx, frame_tx,
subframe_tx, subframe_tx,
subframe_select(&ue->frame_parms,subframe_tx), subframe_select(&ue->frame_parms,subframe_tx),
eNB_id, ue->common_vars.eNb_id,
0/*FIXME CC_id*/); 0/*FIXME CC_id*/);
if (ret == CONNECTION_LOST) { if (ret == CONNECTION_LOST) {
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
#endif #endif
#include "SIMULATION/TOOLS/defs.h" // for taus #include "SIMULATION/TOOLS/defs.h" // for taus
#include "PHY/extern.h"
int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id) int8_t get_DELTA_PREAMBLE(module_id_t module_idP,int CC_id)
{ {
...@@ -324,7 +324,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -324,7 +324,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
mac_xface->macphy_exit("MAC FATAL CC_id>0"); mac_xface->macphy_exit("MAC FATAL CC_id>0");
return 0; // not reached return 0; // not reached
} }
printf("ue_get_rach:UE_mode == PRACH? %d\n",UE_mode == PRACH);
if (UE_mode == PRACH) { if (UE_mode == PRACH) {
if (UE_mac_inst[module_idP].radioResourceConfigCommon) { if (UE_mac_inst[module_idP].radioResourceConfigCommon) {
rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon; rach_ConfigCommon = &UE_mac_inst[module_idP].radioResourceConfigCommon->rach_ConfigCommon;
...@@ -333,7 +333,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -333,7 +333,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
} }
if (Is_rrc_registered == 1) { if (Is_rrc_registered == 1) {
printf("ue_get_rach:Is_rrc_registered? %d\n",Is_rrc_registered == 1);
if (UE_mac_inst[module_idP].RA_active == 0) { if (UE_mac_inst[module_idP].RA_active == 0) {
LOG_D(MAC,"RA not active\n"); LOG_D(MAC,"RA not active\n");
// check if RRC is ready to initiate the RA procedure // check if RRC is ready to initiate the RA procedure
...@@ -342,10 +342,10 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -342,10 +342,10 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
frameP, frameP,
CCCH,1, CCCH,1,
&UE_mac_inst[module_idP].CCCH_pdu.payload[sizeof(SCH_SUBHEADER_SHORT)+1],0, &UE_mac_inst[module_idP].CCCH_pdu.payload[sizeof(SCH_SUBHEADER_SHORT)+1],0,
eNB_indexP, PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id,
0); 0);
Size16 = (uint16_t)Size; Size16 = (uint16_t)Size;
printf("ue_get_rach:Size16 %d\n",Size16);
// LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size); // LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size);
LOG_D(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n", LOG_D(RRC, "[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n",
frameP, module_idP, eNB_indexP, module_idP); frameP, module_idP, eNB_indexP, module_idP);
...@@ -394,7 +394,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -394,7 +394,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
} else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] > 0) { } else if (UE_mac_inst[module_idP].scheduling_info.BSR_bytes[UE_mac_inst[module_idP].scheduling_info.LCGID[DCCH]] > 0) {
// This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example) // This is for triggering a transmission on DCCH using PRACH (during handover, or sending SR for example)
dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element dcch_header_len = 2 + 2; /// SHORT Subheader + C-RNTI control element
rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, eNB_indexP,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO, rlc_status = mac_rlc_status_ind(module_idP,UE_mac_inst[module_idP].crnti, /*eNB_indexP*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id,frameP,subframeP,ENB_FLAG_NO,MBMS_FLAG_NO,
DCCH, DCCH,
6); 6);
...@@ -407,7 +407,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -407,7 +407,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
module_idP,frameP, rlc_status.bytes_in_buffer,dcch_header_len); module_idP,frameP, rlc_status.bytes_in_buffer,dcch_header_len);
sdu_lengths[0] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti, sdu_lengths[0] = mac_rlc_data_req(module_idP, UE_mac_inst[module_idP].crnti,
eNB_indexP, frameP,ENB_FLAG_NO, MBMS_FLAG_NO, /*eNB_indexP*/PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id, frameP,ENB_FLAG_NO, MBMS_FLAG_NO,
DCCH, DCCH,
6, //not used 6, //not used
(char *)&ulsch_buff[0]); (char *)&ulsch_buff[0]);
...@@ -443,7 +443,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -443,7 +443,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
UE_mac_inst[module_idP].RA_backoff_frame = frameP; UE_mac_inst[module_idP].RA_backoff_frame = frameP;
UE_mac_inst[module_idP].RA_backoff_subframe = subframeP; UE_mac_inst[module_idP].RA_backoff_subframe = subframeP;
// Fill in preamble and PRACH resource // Fill in preamble and PRACH resource
get_prach_resources(module_idP,CC_id,eNB_indexP,subframeP,1,NULL); get_prach_resources(module_idP,CC_id,eNB_indexP,subframeP,1,NULL);//not necessary change eNB_indexP by PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id
generate_ulsch_header((uint8_t*)ulsch_buff, // mac header generate_ulsch_header((uint8_t*)ulsch_buff, // mac header
1, // num sdus 1, // num sdus
0, // short pading 0, // short pading
...@@ -546,7 +546,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP, ...@@ -546,7 +546,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP,int CC_id,frame_t frameP,
UE_mac_inst[module_idP].RA_backoff_cnt = 0; UE_mac_inst[module_idP].RA_backoff_cnt = 0;
// Fill in preamble and PRACH resource // Fill in preamble and PRACH resource
get_prach_resources(module_idP,CC_id,eNB_indexP,subframeP,0,NULL); get_prach_resources(module_idP,CC_id,eNB_indexP,subframeP,0,NULL);//not necessary change eNB_indexP by PHY_vars_UE_g[module_idP][0]->common_vars.eNb_id
return(&UE_mac_inst[module_idP].RA_prach_resources); return(&UE_mac_inst[module_idP].RA_prach_resources);
} }
} }
......
...@@ -2752,7 +2752,7 @@ int decode_BCCH_DLSCH_Message( ...@@ -2752,7 +2752,7 @@ int decode_BCCH_DLSCH_Message(
&& (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL) && (UE_rrc_inst[ctxt_pP->module_id].initialNasMsg.data != NULL)
#endif #endif
) { ) {
rrc_ue_generate_RRCConnectionRequest(ctxt_pP, 0); rrc_ue_generate_RRCConnectionRequest(ctxt_pP, eNB_index);
rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING ); rrc_set_sub_state( ctxt_pP->module_id, RRC_SUB_STATE_IDLE_CONNECTING );
} }
......
...@@ -513,7 +513,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][ ...@@ -513,7 +513,7 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE frame_parms->pdsch_config_common.referenceSignalPower, // dBm/RE
frame_parms->N_RB_DL*12); frame_parms->N_RB_DL*12);
stop_meas(&eNB2UE[eNB_id][UE_id][CC_id]->DL_dac_fixed_gain_freq); stop_meas(&eNB2UE[eNB_id][UE_id][CC_id]->DL_dac_fixed_gain_freq);
printf("UE%d,eNB%d: dac_fixed_gain: referenceSignalPower %d\n",UE_id,eNB_id,frame_parms->pdsch_config_common.referenceSignalPower); //printf("UE%d,eNB%d: dac_fixed_gain: referenceSignalPower %d\n",UE_id,eNB_id,frame_parms->pdsch_config_common.referenceSignalPower);
#else #else
start_meas(&eNB2UE[eNB_id][UE_id][CC_id]->DL_dac_fixed_gain_freq); start_meas(&eNB2UE[eNB_id][UE_id][CC_id]->DL_dac_fixed_gain_freq);
tx_pwr = dac_fixed_gain(s_re_f, tx_pwr = dac_fixed_gain(s_re_f,
...@@ -1431,14 +1431,12 @@ void do_UL_sig_freq_prach(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB ...@@ -1431,14 +1431,12 @@ void do_UL_sig_freq_prach(channel_desc_t *UE2eNB[NUMBER_OF_UE_MAX][NUMBER_OF_eNB
//for (int i=0;i<NB_UE_INST;i++) //for (int i=0;i<NB_UE_INST;i++)
// Compute RX signal for eNB = eNB_id // Compute RX signal for eNB = eNB_id
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
if (PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id != eNB_id)
continue;
lte_frame_type_t frame_type = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.frame_type; lte_frame_type_t frame_type = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.frame_type;
prach_ConfigIndex = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex; prach_ConfigIndex = PHY_vars_UE_g[UE_id][CC_id]->frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex;
prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type); prach_fmt = get_prach_fmt(prach_ConfigIndex,frame_type);
n_ra_prb = get_prach_prb_offset(frame_parms, PHY_vars_UE_g[UE_id][CC_id]->prach_resources[eNB_id]->ra_TDD_map_index, PHY_vars_UE_g[UE_id][CC_id]->proc.proc_rxtx[subframe&0x1].frame_tx); n_ra_prb = get_prach_prb_offset(frame_parms, PHY_vars_UE_g[UE_id][CC_id]->prach_resources[0]->ra_TDD_map_index, PHY_vars_UE_g[UE_id][CC_id]->proc.proc_rxtx[subframe&0x1].frame_tx);
tx_prachF = PHY_vars_UE_g[UE_id][CC_id]->prach_vars[eNB_id]->prachF; tx_prachF = PHY_vars_UE_g[UE_id][CC_id]->prach_vars[0]->prachF;
//write_output("txprachF.m","prach_txF", PHY_vars_UE_g[0][0]->prach_vars[0]->prachF,frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*12,1,1); //write_output("txprachF.m","prach_txF", PHY_vars_UE_g[0][0]->prach_vars[0]->prachF,frame_parms->ofdm_symbol_size*frame_parms->symbols_per_tti*12,1,1);
//for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d: txdataF[%d] = (%d,%d)\n", subframe, idx, ((short*)&txdataF[0][sf_offset+idx])[0], ((short*)&txdataF[0][sf_offset+idx])[1]); //for (int idx=0;idx<10;idx++) printf("dumping DL raw subframe %d: txdataF[%d] = (%d,%d)\n", subframe, idx, ((short*)&txdataF[0][sf_offset+idx])[0], ((short*)&txdataF[0][sf_offset+idx])[1]);
......
...@@ -631,7 +631,8 @@ l2l1_task (void *args_p) ...@@ -631,7 +631,8 @@ l2l1_task (void *args_p)
if (abstraction_flag == 1) { if (abstraction_flag == 1) {
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
mac_xface->dl_phy_sync_success (UE_id, 0, 0,1); //UE_id%NB_eNB_INST); for (enb_id = 0; enb_id < NB_eNB_INST; enb_id++)
mac_xface->dl_phy_sync_success (UE_id, 0, enb_id,1); //UE_id%NB_eNB_INST);
} }
start_meas (&oaisim_stats); start_meas (&oaisim_stats);
......
...@@ -1130,10 +1130,13 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void * ...@@ -1130,10 +1130,13 @@ int eNB_trx_read(openair0_device *device, openair0_timestamp *ptimestamp, void *
if (do_ofdm_mod) if (do_ofdm_mod)
{ {
for (UE_id=0; UE_id<NB_UE_INST; UE_id++){ for (UE_id=0; UE_id<NB_UE_INST; UE_id++){
if (eNB_id!=PHY_vars_UE_g[UE_id][CC_id]->common_vars.eNb_id)
continue;
if (is_prach_subframe(&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,frame,subframe) && PHY_vars_UE_g[UE_id][CC_id]->generate_prach) if (is_prach_subframe(&PHY_vars_UE_g[UE_id][CC_id]->frame_parms,frame,subframe) && PHY_vars_UE_g[UE_id][CC_id]->generate_prach)
{ {
//clock_t start=clock(); //clock_t start=clock();
//printf("subframe UL PRACH: %d\n",subframe); //printf("subframe UL PRACH: %d\n",subframe);
printf("prach is generated for UE %d, eNB %d\n",UE_id,eNB_id);
start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel_freq); start_meas(&UE2eNB[UE_id][eNB_id][CC_id]->UL_PRACH_channel_freq);
do_UL_sig_freq_prach(UE2eNB, do_UL_sig_freq_prach(UE2eNB,
enb_data, enb_data,
......
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