Commit 03fbb652 authored by Luis Ariza's avatar Luis Ariza 💬
Browse files

pmch multiple RRUs

parent d2a5b4ef
......@@ -102,10 +102,10 @@ void lte_adjust_synch(LTE_DL_FRAME_PARMS *frame_parms,
LOG_I(PHY,"[UE%d] Sending synch status to higher layers\n",ue->Mod_id);
//mac_resynch();
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[eNB_id] = PRACH;
}
else {
ue->UE_mode[0] = PUSCH;
ue->UE_mode[eNB_id] = PUSCH;
}
}
......
......@@ -7355,7 +7355,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
uint8_t transmission_mode = ue->transmission_mode[eNB_id];
ANFBmode_t AckNackFBMode;
LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[ue->current_thread_id[subframe]][0];
LTE_UE_DLSCH_t **dlsch = ue->dlsch[ue->current_thread_id[subframe]][eNB_id];
PHY_MEASUREMENTS *meas = &ue->measurements;
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
// uint32_t current_dlsch_cqi = ue->current_dlsch_cqi[eNB_id];
......
......@@ -155,6 +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);
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;
......@@ -487,6 +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);
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;
......
......@@ -3556,7 +3556,7 @@ void ue_pmch_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc,int eNB_id,int abs
if (pmch_mcs>=0) {
LOG_D(PHY,"[UE %d] Frame %d, subframe %d: Programming PMCH demodulation for mcs %d\n",ue->Mod_id,frame_rx,subframe_rx,pmch_mcs);
fill_UE_dlsch_MCH(ue,pmch_mcs,1,0,0);
fill_UE_dlsch_MCH(ue,pmch_mcs,1,0,eNB_id);
if (abstraction_flag == 0 ) {
for (l=2; l<12; l++) {
......@@ -3574,31 +3574,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,
0,
eNB_id,
subframe_rx,
l);
}
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,
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,
1,
2,
frame_rx,
subframe_rx,
0);
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);
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);
ret = dlsch_decoding(ue,
ue->pdsch_vars_MCH[0]->llr[0],
ue->pdsch_vars_MCH[eNB_id]->llr[0],
&ue->frame_parms,
ue->dlsch_MCH[0],
ue->dlsch_MCH[0]->harq_processes[0],
ue->dlsch_MCH[eNB_id],
ue->dlsch_MCH[eNB_id]->harq_processes[0],
frame_rx,
subframe_rx,
0,
......@@ -3613,29 +3613,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][0]++;
ue->dlsch_mcch_trials[sync_area][eNB_id]++;
else
ue->dlsch_mtch_trials[sync_area][0]++;
ue->dlsch_mtch_trials[sync_area][eNB_id]++;
if (ret == (1+ue->dlsch_MCH[0]->max_turbo_iterations)) {
if (ret == (1+ue->dlsch_MCH[eNB_id]->max_turbo_iterations)) {
if (mcch_active == 1)
ue->dlsch_mcch_errors[sync_area][0]++;
ue->dlsch_mcch_errors[sync_area][eNB_id]++;
else
ue->dlsch_mtch_errors[sync_area][0]++;
ue->dlsch_mtch_errors[sync_area][eNB_id]++;
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][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,0,ue->dlsch_MCH[0]->harq_processes[0]->G,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);
#ifdef DEBUG_DLSCH
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]);
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]);
}
LOG_T(PHY,"\n");
......@@ -3650,18 +3650,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[0]->harq_processes[0]->b,
ue->dlsch_MCH[0]->harq_processes[0]->TBS>>3,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->b,
ue->dlsch_MCH[eNB_id]->harq_processes[0]->TBS>>3,
eNB_id,// not relevant in eMBMS context
sync_area);
ue->dlsch_mcch_received[sync_area][0]++;
ue->dlsch_mcch_received[sync_area][eNB_id]++;
if (ue->dlsch_mch_received_sf[subframe_rx%5][0] == 1 ) {
ue->dlsch_mch_received_sf[subframe_rx%5][0]=0;
if (ue->dlsch_mch_received_sf[subframe_rx%5][eNB_id] == 1 ) {
ue->dlsch_mch_received_sf[subframe_rx%5][eNB_id]=0;
} else {
ue->dlsch_mch_received[0]+=1;
ue->dlsch_mch_received_sf[subframe_rx][0]=1;
ue->dlsch_mch_received[eNB_id]+=1;
ue->dlsch_mch_received_sf[subframe_rx][eNB_id]=1;
}
......
......@@ -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;
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
}
}
......@@ -417,8 +417,8 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
#else
double tx_pwr;
#endif
//double rx_pwr;
//int32_t rx_pwr0,rx_pwr1,rx_pwr2, rx_pwr3;
double rx_pwr;
int32_t rx_pwr0,rx_pwr1,rx_pwr2, rx_pwr3;
uint32_t i,aa;
uint32_t sf_offset;
......@@ -575,15 +575,15 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
#endif
#ifdef DEBUG_SIM
for (i=0; i<10; i++){
LOG_D(OCM,"do_DL_sig channel(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id][CC_id]->chF[0][i].x,eNB2UE[eNB_id][UE_id][CC_id]->chF[0][i].y);
}
for (i=frame_parms->N_RB_DL*12-10; i<frame_parms->N_RB_DL*12; i++){
LOG_D(OCM,"do_DL_sig channel(%d,%d)[%d] : (%f,%f)\n",eNB_id,UE_id,i,eNB2UE[eNB_id][UE_id][CC_id]->chF[0][i].x,eNB2UE[eNB_id][UE_id][CC_id]->chF[0][i].y);
}
//#ifdef DEBUG_SIM
/*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,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x[i],eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y[i]);
}*/
/*for (i=frame_parms->N_RB_DL*12-10; 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,eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].x[i],eNB2UE[eNB_id][UE_id][CC_id]->chFf[0].y[i]);
}*/
#endif
//#endif
LOG_D(OCM,"[SIM][DL] Channel eNB %d => UE %d (CCid %d): tx_power %.1f dBm/RE, path_loss %1.f dB\n",
eNB_id,UE_id,CC_id,
......@@ -659,18 +659,11 @@ void do_DL_sig_freq(channel_desc_t *eNB2UE[NUMBER_OF_eNB_MAX][NUMBER_OF_UE_MAX][
fprintf(file1,"%d\t%e\t%e\n",x,r_re0_f[0][x],r_im0_f[0][x]);
}*/
#ifdef DEBUG_SIM
#ifdef __AVX2__
rx_pwr = signal_energy_fp_AVX_float((r_re0_f,r_im0_f,
nb_antennas_rx,
frame_parms->ofdm_symbol_size,//?
sf_offset)/(12.0*frame_parms->N_RB_DL);
#else
rx_pwr = signal_energy_fp(r_re0_f,r_im0_f,
nb_antennas_rx,
frame_parms->ofdm_symbol_size,//?
sf_offset)/(12.0*frame_parms->N_RB_DL);
(sf_offset)/(12.0*frame_parms->N_RB_DL));
#endif
LOG_D(OCM,"[SIM][DL] UE %d : ADC in (eNB %d) %f dBm/RE for subframe %d\n",
UE_id,eNB_id,
10*log10(rx_pwr),subframe);
......@@ -859,6 +852,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;
//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;
......
......@@ -506,11 +506,12 @@ l2l1_task (void *args_p)
if (xforms==1) {
xargv[0] = xname;
fl_initialize (&xargc, xargv, NULL, 0, 0);
eNB_inst = 0;
//eNB_inst = 0;
for (eNB_inst = 0; eNB_inst < 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);
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);
......@@ -1131,23 +1132,22 @@ l2l1_task (void *args_p)
//#ifdef XFORMS
if (xforms==1) {
eNB_inst = 0;
//eNB_inst = 0;
for (eNB_inst = 0; eNB_inst < 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++) {
phy_scope_UE(form_ue[CC_id][UE_inst],
PHY_vars_UE_g[UE_inst][CC_id],
//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);
phy_scope_UE(form_ue[0][UE_inst],
PHY_vars_UE_g[UE_inst][0],
eNB_inst,
UE_inst,
7);
}
phy_scope_eNB(form_enb[UE_inst],
phy_scope_eNB(form_enb[UE_inst],
PHY_vars_eNB_g[eNB_inst][0],
PHY_vars_UE_g[0][0],
0,
PHY_vars_UE_g[UE_inst][0],
eNB_inst,
UE_inst);
//}
}
}
}
......
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