Commit 7e2a3973 authored by Raymond Knopp's avatar Raymond Knopp

modifications for oaisim. oaisim_noS1 compiles at this point.

parent d9501248
...@@ -2390,14 +2390,14 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -2390,14 +2390,14 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
if (dci_alloc[n_dci].format > 0) { // exclude the uplink dci if (dci_alloc[n_dci].format > 0) { // exclude the uplink dci
if (dci_alloc[n_dci].rnti == SI_RNTI) { if (dci_alloc[n_dci].rnti == SI_RNTI) {
dlsch_eNB = PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]->dlsch_eNB_SI; dlsch_eNB = PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]->dlsch_SI;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].dlsch_type[n_dci_dl] = 0;//SI; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].dlsch_type[n_dci_dl] = 0;//SI;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl] = 0; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl] = 0;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].tbs[n_dci_dl] = dlsch_eNB->harq_processes[0]->TBS>>3; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].tbs[n_dci_dl] = dlsch_eNB->harq_processes[0]->TBS>>3;
LOG_D(PHY,"[DCI][EMUL]SI tbs is %d and dci index %d harq pid is %d \n",eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].tbs[n_dci_dl],n_dci_dl, LOG_D(PHY,"[DCI][EMUL]SI tbs is %d and dci index %d harq pid is %d \n",eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].tbs[n_dci_dl],n_dci_dl,
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl]); eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl]);
} else if (dci_alloc[n_dci_dl].ra_flag == 1) { } else if (dci_alloc[n_dci_dl].ra_flag == 1) {
dlsch_eNB = PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]->dlsch_eNB_ra; dlsch_eNB = PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]->dlsch_ra;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].dlsch_type[n_dci_dl] = 1;//RA; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].dlsch_type[n_dci_dl] = 1;//RA;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl] = 0; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl] = 0;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].tbs[n_dci_dl] = dlsch_eNB->harq_processes[0]->TBS>>3; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].tbs[n_dci_dl] = dlsch_eNB->harq_processes[0]->TBS>>3;
...@@ -2406,7 +2406,7 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -2406,7 +2406,7 @@ uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
} else { } else {
ue_id = find_ue(dci_alloc[n_dci_dl].rnti,PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]); ue_id = find_ue(dci_alloc[n_dci_dl].rnti,PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]);
DevAssert( ue_id != (uint8_t)-1 ); DevAssert( ue_id != (uint8_t)-1 );
dlsch_eNB = PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]->dlsch_eNB[ue_id][0]; dlsch_eNB = PHY_vars_eNB_g[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id]->dlsch[ue_id][0];
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].dlsch_type[n_dci_dl] = 2;//TB0; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].dlsch_type[n_dci_dl] = 2;//TB0;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl] = dlsch_eNB->current_harq_pid; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].harq_pid[n_dci_dl] = dlsch_eNB->current_harq_pid;
......
...@@ -832,7 +832,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -832,7 +832,7 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
// may not be necessary for PMCH?? // may not be necessary for PMCH??
for (eNB_id2=0; eNB_id2<NB_eNB_INST; eNB_id2++) { for (eNB_id2=0; eNB_id2<NB_eNB_INST; eNB_id2++) {
if (PHY_vars_eNB_g[eNB_id2][CC_id]->lte_frame_parms.Nid_cell == phy_vars_ue->lte_frame_parms.Nid_cell) if (PHY_vars_eNB_g[eNB_id2][CC_id]->frame_parms.Nid_cell == phy_vars_ue->frame_parms.Nid_cell)
break; break;
} }
...@@ -847,9 +847,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -847,9 +847,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
switch (dlsch_id) { switch (dlsch_id) {
case PDSCH_SI: // SI case SI_PDSCH: // SI
dlsch_ue = phy_vars_ue->dlsch_ue_SI[eNB_id]; dlsch_ue = phy_vars_ue->dlsch_SI[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_SI; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_SI;
// printf("Doing SI: TBS %d\n",dlsch_ue->harq_processes[0]->TBS>>3); // printf("Doing SI: TBS %d\n",dlsch_ue->harq_processes[0]->TBS>>3);
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3); memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -863,9 +863,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -863,9 +863,9 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
return(1); return(1);
break; break;
case PDSCH_RA: // RA case RA_PDSCH: // RA
dlsch_ue = phy_vars_ue->dlsch_ue_ra[eNB_id]; dlsch_ue = phy_vars_ue->dlsch_ra[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_ra; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_ra;
memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3); memcpy(dlsch_ue->harq_processes[0]->b,dlsch_eNB->harq_processes[0]->b,dlsch_ue->harq_processes[0]->TBS>>3);
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
LOG_D(PHY,"RA Decoded\n"); LOG_D(PHY,"RA Decoded\n");
...@@ -879,11 +879,11 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -879,11 +879,11 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
break; break;
case PDSCH: // TB0 case PDSCH: // TB0
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][0]; dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
harq_pid = dlsch_ue->current_harq_pid; harq_pid = dlsch_ue->current_harq_pid;
ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->lte_ue_pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]); ue_id= (uint32_t)find_ue((int16_t)phy_vars_ue->pdcch_vars[(uint32_t)eNB_id]->crnti,PHY_vars_eNB_g[eNB_id2][CC_id]);
DevAssert( ue_id != (uint32_t)-1 ); DevAssert( ue_id != (uint32_t)-1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB[ue_id][0]; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[ue_id][0];
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -918,18 +918,18 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -918,18 +918,18 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
dlsch_ue->harq_ack[subframe].ack = 0; dlsch_ue->harq_ack[subframe].ack = 0;
dlsch_ue->harq_ack[subframe].harq_id = harq_pid; dlsch_ue->harq_ack[subframe].harq_id = harq_pid;
dlsch_ue->harq_ack[subframe].send_harq_status = 1; dlsch_ue->harq_ack[subframe].send_harq_status = 1;
dlsch->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations; dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations); return(1+dlsch_ue->max_turbo_iterations);
} }
break; break;
case 3: { // TB1 case PDSCH1: { // TB1
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][1]; dlsch_ue = phy_vars_ue->dlsch[eNB_id][1];
harq_pid = dlsch_ue->current_harq_pid; harq_pid = dlsch_ue->current_harq_pid;
int8_t UE_id = find_ue( phy_vars_ue->lte_ue_pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] ); int8_t UE_id = find_ue( phy_vars_ue->pdcch_vars[eNB_id]->crnti, PHY_vars_eNB_g[eNB_id2][CC_id] );
DevAssert( UE_id != -1 ); DevAssert( UE_id != -1 );
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB[UE_id][1]; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch[UE_id][1];
// reset HARQ // reset HARQ
dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE; dlsch_ue->harq_processes[harq_pid]->status = SCH_IDLE;
dlsch_ue->harq_processes[harq_pid]->round = 0; dlsch_ue->harq_processes[harq_pid]->round = 0;
...@@ -945,8 +945,8 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -945,8 +945,8 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
case PMCH: // PMCH case PMCH: // PMCH
dlsch_ue = phy_vars_ue->dlsch_ue_MCH[eNB_id]; dlsch_ue = phy_vars_ue->dlsch_MCH[eNB_id];
dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_eNB_MCH; dlsch_eNB = PHY_vars_eNB_g[eNB_id2][CC_id]->dlsch_MCH;
LOG_D(PHY,"decoding pmch emul (size is %d, enb %d %d)\n", dlsch_ue->harq_processes[0]->TBS>>3, eNB_id, eNB_id2); LOG_D(PHY,"decoding pmch emul (size is %d, enb %d %d)\n", dlsch_ue->harq_processes[0]->TBS>>3, eNB_id, eNB_id2);
#ifdef DEBUG_DLSCH_DECODING #ifdef DEBUG_DLSCH_DECODING
...@@ -968,20 +968,20 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -968,20 +968,20 @@ uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
memcpy(dlsch_ue->harq_processes[0]->b, memcpy(dlsch_ue->harq_processes[0]->b,
dlsch_eNB->harq_processes[0]->b, dlsch_eNB->harq_processes[0]->b,
dlsch_ue->harq_processes[0]->TBS>>3); dlsch_ue->harq_processes[0]->TBS>>3);
dlsch->last_iteration_cnt = 1; dlsch_ue->last_iteration_cnt = 1;
return(1); return(1);
} else { } else {
// retransmission // retransmission
dlsch->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations; dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations); return(1+dlsch_ue->max_turbo_iterations);
} }
break; break;
default: default:
dlsch_ue = phy_vars_ue->dlsch_ue[eNB_id][0]; dlsch_ue = phy_vars_ue->dlsch[eNB_id][0];
LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id); LOG_E(PHY,"dlsch_decoding_emul: FATAL, unknown DLSCH_id %d\n",dlsch_id);
dlsch->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations; dlsch_ue->last_iteration_cnt = 1+dlsch_ue->max_turbo_iterations;
return(1+dlsch_ue->max_turbo_iterations); return(1+dlsch_ue->max_turbo_iterations);
} }
......
...@@ -516,12 +516,13 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode) ...@@ -516,12 +516,13 @@ int initial_sync(PHY_VARS_UE *ue, runmode_t mode)
phich_string[ue->frame_parms.phich_config_common.phich_resource], phich_string[ue->frame_parms.phich_config_common.phich_resource],
ue->frame_parms.nb_antennas_tx_eNB); ue->frame_parms.nb_antennas_tx_eNB);
#if defined(OAI_USRP) || defined(EXMIMO) || defined(OAI_BLADERF) || defined(OAI_LMSSDR)
LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n", LOG_I(PHY,"[UE %d] Frame %d Measured Carrier Frequency %.0f Hz (offset %d Hz)\n",
ue->Mod_id, ue->Mod_id,
ue->proc.proc_rxtx[0].frame_rx, ue->proc.proc_rxtx[0].frame_rx,
openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset, openair0_cfg[0].rx_freq[0]-ue->common_vars.freq_offset,
ue->common_vars.freq_offset); ue->common_vars.freq_offset);
#endif
} else { } else {
#ifdef DEBUG_INITIAL_SYNC #ifdef DEBUG_INITIAL_SYNC
LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id); LOG_I(PHY,"[UE%d] Initial sync : PBCH not ok\n",ue->Mod_id);
......
...@@ -1053,9 +1053,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -1053,9 +1053,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
double bler=0.0;//, x=0.0; double bler=0.0;//, x=0.0;
double sinr=0.0; double sinr=0.0;
uint16_t nb_rb = phy_vars_ue->lte_frame_parms.N_RB_DL; uint16_t nb_rb = phy_vars_ue->frame_parms.N_RB_DL;
int16_t f; int16_t f;
uint8_t CC_id=phy_vars_ue->CC_id; uint8_t CC_id=phy_vars_ue->CC_id;
int frame_rx = phy_vars_ue->proc.proc_rxtx[0].frame_rx;
// compute effective sinr // compute effective sinr
// TODO: adapt this to varible bandwidth // TODO: adapt this to varible bandwidth
...@@ -1074,10 +1075,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue, ...@@ -1074,10 +1075,10 @@ uint16_t rx_pbch_emul(PHY_VARS_UE *phy_vars_ue,
sinr, sinr,
bler); bler);
if (pbch_phase == (phy_vars_ue->frame_rx % 4)) { if (pbch_phase == (frame_rx % 4)) {
if (uniformrandom() >= bler) { if (uniformrandom() >= bler) {
memcpy(phy_vars_ue->lte_ue_pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE); memcpy(phy_vars_ue->pbch_vars[eNB_id]->decoded_output,PHY_vars_eNB_g[eNB_id][CC_id]->pbch_pdu,PBCH_PDU_SIZE);
return(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_tx_eNB); return(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_tx_eNB);
} else } else
return(-1); return(-1);
} else } else
......
...@@ -1039,7 +1039,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue, ...@@ -1039,7 +1039,7 @@ uint32_t dlsch_decoding(PHY_VARS_UE *phy_vars_ue,
uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue, uint32_t dlsch_decoding_emul(PHY_VARS_UE *phy_vars_ue,
uint8_t subframe, uint8_t subframe,
uint8_t dlsch_id, PDSCH_t dlsch_id,
uint8_t eNB_id); uint8_t eNB_id);
/** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel estimation. It performs /** \brief This function is the top-level entry point to PDSCH demodulation, after frequency-domain transformation and channel estimation. It performs
...@@ -1539,7 +1539,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1539,7 +1539,8 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
uint8_t llr8_flag); uint8_t llr8_flag);
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB, uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_index, eNB_rxtx_proc_t *proc,
uint8_t UE_index,
uint16_t *crnti); uint16_t *crnti);
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
......
...@@ -1520,16 +1520,9 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc, ...@@ -1520,16 +1520,9 @@ uint32_t ulsch_decoding_emul(PHY_VARS_eNB *eNB, eNB_rxtx_proc_t *proc,
#endif #endif
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
if (rnti == PHY_vars_UE_g[UE_id][CC_id]->lte_ue_pdcch_vars[0]->crnti) if (rnti == PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[0]->crnti)
break; break;
/*
msg("[PHY] EMUL eNB %d ulsch_decoding_emul : subframe ue id %d crnti %x nb ue %d\n",
eNB->Mod_id,
UE_id,
PHY_vars_UE_g[UE_id]->lte_ue_pdcch_vars[0]->crnti,
NB_UE_INST);
*/
} }
if (UE_id==NB_UE_INST) { if (UE_id==NB_UE_INST) {
......
...@@ -2119,6 +2119,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2119,6 +2119,7 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
metric0_SR = rx_pucch_emul(eNB, metric0_SR = rx_pucch_emul(eNB,
proc,
UE_id, UE_id,
pucch_format1, pucch_format1,
0, 0,
...@@ -2192,11 +2193,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2192,11 +2193,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
} }
else { else {
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
metric0 = rx_pucch_emul(eNB,UE_id, metric0 = rx_pucch_emul(eNB,
proc,
UE_id,
pucch_format1a, pucch_format1a,
0, 0,
pucch_payload0, pucch_payload0);
subframe);
#endif #endif
} }
...@@ -2251,11 +2253,11 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2251,11 +2253,11 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
PUCCH1a_THRES); PUCCH1a_THRES);
else { else {
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
metric0 = rx_pucch_emul(eNB,UE_id, metric0 = rx_pucch_emul(eNB,proc,
UE_id,
format, format,
0, 0,
pucch_payload0, pucch_payload0);
subframe);
#endif #endif
} }
} else { //using n1_pucch0/n1_pucch1 resources } else { //using n1_pucch0/n1_pucch1 resources
...@@ -2283,11 +2285,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2283,11 +2285,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
PUCCH1a_THRES); PUCCH1a_THRES);
else { else {
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
metric0 = rx_pucch_emul(eNB,UE_id, metric0 = rx_pucch_emul(eNB,
proc,
UE_id,
format, format,
0, 0,
pucch_payload0, pucch_payload0);
subframe);
#endif #endif
} }
} }
...@@ -2307,13 +2310,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq ...@@ -2307,13 +2310,12 @@ void pucch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq
PUCCH1a_THRES); PUCCH1a_THRES);
else { else {
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
metric1 = rx_pucch_emul(eNB,UE_id, metric1 = rx_pucch_emul(eNB,
proc,
UE_id,
format, format,
1, 1,
pucch_payload1, pucch_payload1);
subframe);
#endif #endif
} }
} }
...@@ -2389,7 +2391,6 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p ...@@ -2389,7 +2391,6 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
rx_ulsch_emul(eNB,proc, rx_ulsch_emul(eNB,proc,
subframe,
eNB->UE_stats[UE_id].sector, // this is the effective sector id eNB->UE_stats[UE_id].sector, // this is the effective sector id
UE_id); UE_id);
} }
...@@ -2407,6 +2408,7 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p ...@@ -2407,6 +2408,7 @@ void cba_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,int UE_id,int harq_p
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
ret = ulsch_decoding_emul(eNB, ret = ulsch_decoding_emul(eNB,
proc,
UE_id, UE_id,
&rnti); &rnti);
} }
...@@ -2909,7 +2911,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2909,7 +2911,6 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
rx_ulsch_emul(eNB,proc, rx_ulsch_emul(eNB,proc,
subframe,
eNB->UE_stats[i].sector, // this is the effective sector id eNB->UE_stats[i].sector, // this is the effective sector id
i); i);
} }
...@@ -2930,7 +2931,8 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const ...@@ -2930,7 +2931,8 @@ void phy_procedures_eNB_uespec_RX(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,const
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
ret = ulsch_decoding_emul(eNB,proc, ret = ulsch_decoding_emul(eNB,
proc,
i, i,
&rnti); &rnti);
} }
......
...@@ -1209,8 +1209,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ...@@ -1209,8 +1209,7 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin
format, format,
ue->frame_parms.pucch_config_common.nCS_AN, ue->frame_parms.pucch_config_common.nCS_AN,
pucch_ack_payload, pucch_ack_payload,
SR_payload, SR_payload);
subframe_tx);
#endif #endif
} }
} else if (SR_payload==1) { // no ACK/NAK but SR is triggered by MAC } else if (SR_payload==1) { // no ACK/NAK but SR is triggered by MAC
...@@ -2503,7 +2502,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue, ...@@ -2503,7 +2502,7 @@ void ue_dlsch_procedures(PHY_VARS_UE *ue,
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
ret = dlsch_decoding_emul(ue, ret = dlsch_decoding_emul(ue,
subframe_rx, subframe_rx,
dlsch, pdsch,
eNB_id); eNB_id);
#endif #endif
} }
......
...@@ -348,7 +348,7 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot ...@@ -348,7 +348,7 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
switch (eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]) { switch (eNB_transport_info[enb_id][CC_id].dlsch_type[n_dci_dl]) {
case 0: //SI: case 0: //SI:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_SI->harq_processes[0]->b, memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_SI->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset], &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]); eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU #ifdef DEBUG_EMU
...@@ -358,7 +358,7 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot ...@@ -358,7 +358,7 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
break; break;
case 1: //RA: case 1: //RA:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_ra->harq_processes[0]->b, memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_ra->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset], &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]); eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU #ifdef DEBUG_EMU
...@@ -370,9 +370,9 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot ...@@ -370,9 +370,9 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
case 2://TB0: case 2://TB0:
harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl]; harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl]; ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][0]->rnti= PHY_vars_eNB_g[enb_id][CC_id]->dlsch[ue_id][0]->rnti=
eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti; eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][0]; dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch[ue_id][0];
#ifdef DEBUG_EMU #ifdef DEBUG_EMU
LOG_D(EMU, LOG_D(EMU,
" enb_id %d ue id is %d rnti is %x dci index %d, harq_pid %d tbs %d \n", " enb_id %d ue id is %d rnti is %x dci index %d, harq_pid %d tbs %d \n",
...@@ -393,9 +393,9 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot ...@@ -393,9 +393,9 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
case 3://TB1: case 3://TB1:
harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl]; harq_pid = eNB_transport_info[enb_id][CC_id].harq_pid[n_dci_dl];
ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl]; ue_id = eNB_transport_info[enb_id][CC_id].ue_id[n_dci_dl];
PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][1]->rnti= PHY_vars_eNB_g[enb_id][CC_id]->dlsch[ue_id][1]->rnti=
eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti; eNB_transport_info[enb_id][CC_id].dci_alloc[n_dci_dl].rnti;
dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB[ue_id][1]; dlsch_eNB = PHY_vars_eNB_g[enb_id][CC_id]->dlsch[ue_id][1];
memcpy(dlsch_eNB->harq_processes[harq_pid]->b, memcpy(dlsch_eNB->harq_processes[harq_pid]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset], &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
...@@ -403,7 +403,7 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot ...@@ -403,7 +403,7 @@ void fill_phy_enb_vars(unsigned int enb_id, uint8_t CC_id,unsigned int next_slot
break; break;
case 5: case 5:
memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_eNB_MCH->harq_processes[0]->b, memcpy(PHY_vars_eNB_g[enb_id][CC_id]->dlsch_MCH->harq_processes[0]->b,
&eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset], &eNB_transport_info[enb_id][CC_id].transport_blocks[payload_offset],
eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]); eNB_transport_info[enb_id][CC_id].tbs[n_dci_dl]);
#ifdef DEBUG_EMU #ifdef DEBUG_EMU
...@@ -491,52 +491,45 @@ void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot) ...@@ -491,52 +491,45 @@ void fill_phy_ue_vars(unsigned int ue_id, uint8_t CC_id,unsigned int last_slot)
#endif #endif
for (n_enb = 0; n_enb < UE_transport_info[ue_id][CC_id].num_eNB; n_enb++) { for (n_enb = 0; n_enb < UE_transport_info[ue_id][CC_id].num_eNB; n_enb++) {
#ifdef DEBUG_EMU
/* LOG_D(EMU,"Setting ulsch vars for ue %d rnti %x harq pid is %d \n",
ue_id, UE_transport_info[ue_id][CC_id].rnti[n_enb],
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]);
*/
#endif
rnti = UE_transport_info[ue_id][CC_id].rnti[n_enb]; rnti = UE_transport_info[ue_id][CC_id].rnti[n_enb];
enb_id = UE_transport_info[ue_id][CC_id].eNB_id[n_enb]; enb_id = UE_transport_info[ue_id][CC_id].eNB_id[n_enb];
PHY_vars_UE_g[ue_id][CC_id]->lte_ue_pdcch_vars[enb_id]->crnti=rnti; PHY_vars_UE_g[ue_id][CC_id]->pdcch_vars[enb_id]->crnti=rnti;
harq_pid = UE_transport_info[ue_id][CC_id].harq_pid[n_enb]; harq_pid = UE_transport_info[ue_id][CC_id].harq_pid[n_enb];
//ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]; PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_RI[0] =
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_RI[0] =
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri & 0x1; ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_RI[1] = PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_RI[1] =
(ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri>>1) & 0x1; (ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ri>>1) & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_ACK[0]= PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_ACK[0]=
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack & 0x1; ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack & 0x1;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o_ACK[1]= PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o_ACK[1]=
(ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack>>1) & 0x1; (ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_ack>>1) & 0x1;
//*(uint32_t *)ulsch->o = ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci; //*(uint32_t *)ulsch->o = ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci;
if ((last_slot % 2) == 1) { if ((last_slot % 2) == 1) {
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->O = PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->O =
ue_cntl_delay[ue_id][CC_id][last_slot%2].length_uci; ue_cntl_delay[ue_id][CC_id][last_slot%2].length_uci;
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->uci_format = PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->uci_format =
ue_cntl_delay[ue_id][CC_id][last_slot%2].uci_format; ue_cntl_delay[ue_id][CC_id][last_slot%2].uci_format;
memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->o, memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->o,
ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci, ue_cntl_delay[ue_id][CC_id][last_slot%2].pusch_uci,
MAX_CQI_BYTES); MAX_CQI_BYTES);
ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]; ulsch = PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id];
// if (((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1) // if (((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1)
LOG_D(EMU, LOG_D(EMU,
"[UE %d] subframe %d last slot %d copy the payload from eNB %d to UE %d with harq id %d cqi (val %d, length %d) \n", "[UE %d] subframe %d last slot %d copy the payload from eNB %d to UE %d with harq id %d cqi (val %d, length %d) \n",
ue_id, subframe, last_slot, enb_id, ue_id, harq_pid, ue_id, subframe, last_slot, enb_id, ue_id, harq_pid,
((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1, ((HLC_subband_cqi_rank1_2A_5MHz *)ulsch->o)->cqi1,
PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->O); PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->O);
} }
memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch_ue[enb_id]->harq_processes[harq_pid]->b, memcpy(PHY_vars_UE_g[ue_id][CC_id]->ulsch[enb_id]->harq_processes[harq_pid]->b,
UE_transport_info[ue_id][CC_id].transport_blocks, UE_transport_info[ue_id][CC_id].transport_blocks,
UE_transport_info[ue_id][CC_id].tbs[enb_id]); UE_transport_info[ue_id][CC_id].tbs[enb_id]);
......
...@@ -130,7 +130,7 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -130,7 +130,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
// find out which eNB the UE is attached to // find out which eNB the UE is attached to
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) { for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
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) { if (find_ue(PHY_vars_UE_g[UE_id][CC_id]->pdcch_vars[0]->crnti,PHY_vars_eNB_g[eNB_id][CC_id])>=0) {
// UE with UE_id is connected to eNb with eNB_id // UE with UE_id is connected to eNb with eNB_id
att_eNB_id=eNB_id; att_eNB_id=eNB_id;
LOG_D(OCM,"A: UE attached to eNB (UE%d->eNB%d)\n",UE_id,eNB_id); LOG_D(OCM,"A: UE attached to eNB (UE%d->eNB%d)\n",UE_id,eNB_id);
...@@ -165,7 +165,7 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -165,7 +165,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
//dlsch_abstraction(PHY_vars_UE_g[UE_id]->sinr_dB, rb_alloc, 8); //dlsch_abstraction(PHY_vars_UE_g[UE_id]->sinr_dB, rb_alloc, 8);
// fill in perfect channel estimates // fill in perfect channel estimates
channel_desc_t *desc1 = eNB2UE[att_eNB_id][UE_id][CC_id]; 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]; int32_t **dl_channel_est = PHY_vars_UE_g[UE_id][CC_id]->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,(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,(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); double scale = pow(10.0,(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);
LOG_D(OCM,"scale =%lf (%d dB)\n",scale,(int) (20*log10(scale))); LOG_D(OCM,"scale =%lf (%d dB)\n",scale,(int) (20*log10(scale)));
...@@ -201,13 +201,13 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -201,13 +201,13 @@ 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) // 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][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, 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_UE_g[UE_id][CC_id]->transmission_mode[att_eNB_id], PHY_vars_eNB_g[att_eNB_id][CC_id]->UE_stats[UE_id].DL_pmi_single,
PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off,PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.N_RB_DL); PHY_vars_eNB_g[att_eNB_id][CC_id]->mu_mimo_mode[UE_id].dl_pow_off,PHY_vars_eNB_g[att_eNB_id][CC_id]->frame_parms.N_RB_DL);
// calculate sinr here // calculate sinr here
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) { for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_id++) {
if (att_eNB_id != eNB_id) { if (att_eNB_id != eNB_id) {
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,PHY_vars_eNB_g[att_eNB_id][CC_id]->lte_frame_parms.N_RB_DL); 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,PHY_vars_eNB_g[att_eNB_id][CC_id]->frame_parms.N_RB_DL);
} }
} }
} // hold channel } // hold channel
...@@ -233,7 +233,7 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -233,7 +233,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
// eNB2UE[eNB_id][UE_id]->path_loss_dB) <= -107.0) // eNB2UE[eNB_id][UE_id]->path_loss_dB) <= -107.0)
// break; // break;
txdata = PHY_vars_eNB_g[eNB_id][CC_id]->lte_eNB_common_vars.txdata[0]; txdata = PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.txdata[0];
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); 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)); slot_offset_meas = ((next_slot&1)==0) ? slot_offset : (slot_offset-(frame_parms->samples_per_tti>>1));
tx_pwr = dac_fixed_gain(s_re, tx_pwr = dac_fixed_gain(s_re,
...@@ -355,7 +355,7 @@ void do_DL_sig(double **r_re0,double **r_im0, ...@@ -355,7 +355,7 @@ void do_DL_sig(double **r_re0,double **r_im0,
LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dBm for slot %d (subframe %d)\n",UE_id,10*log10(rx_pwr),next_slot,next_slot>>1); LOG_D(OCM,"[SIM][DL] UE %d : ADC in %f dBm for slot %d (subframe %d)\n",UE_id,10*log10(rx_pwr),next_slot,next_slot>>1);
#endif #endif
rxdata = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.rxdata; rxdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.rxdata;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
adc(r_re, adc(r_re,
...@@ -463,12 +463,6 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double ...@@ -463,12 +463,6 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
#endif #endif
} else { //without abstraction } else { //without abstraction
/*
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
do_OFDM_mod(PHY_vars_UE_g[UE_id]->lte_ue_common_vars.txdataF,PHY_vars_UE_g[UE_id]->lte_ue_common_vars.txdata,next_slot,&PHY_vars_UE_g[UE_id]->lte_frame_parms);
}
*/
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) { for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
// Clear RX signal for eNB = eNB_id // Clear RX signal for eNB = eNB_id
for (i=0; i<(frame_parms->samples_per_tti>>1); i++) { for (i=0; i<(frame_parms->samples_per_tti>>1); i++) {
...@@ -481,7 +475,7 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double ...@@ -481,7 +475,7 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
// 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++) {
txdata = PHY_vars_UE_g[UE_id][CC_id]->lte_ue_common_vars.txdata; txdata = PHY_vars_UE_g[UE_id][CC_id]->common_vars.txdata;
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); 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)); slot_offset_meas = ((next_slot&1)==0) ? slot_offset : (slot_offset-(frame_parms->samples_per_tti>>1));
...@@ -571,14 +565,14 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double ...@@ -571,14 +565,14 @@ void do_UL_sig(double **r_re0,double **r_im0,double **r_re,double **r_im,double
nb_antennas_rx, nb_antennas_rx,
frame_parms->samples_per_tti>>1, frame_parms->samples_per_tti>>1,
1e3/UE2eNB[0][eNB_id][CC_id]->sampling_rate, // sampling time (ns) 1e3/UE2eNB[0][eNB_id][CC_id]->sampling_rate, // 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) (double)PHY_vars_eNB_g[eNB_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 #ifdef DEBUG_SIM
rx_pwr = signal_energy_fp(r_re,r_im,nb_antennas_rx,frame_parms->samples_per_tti>>1,0)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL); rx_pwr = signal_energy_fp(r_re,r_im,nb_antennas_rx,frame_parms->samples_per_tti>>1,0)*(double)frame_parms->ofdm_symbol_size/(12.0*frame_parms->N_RB_DL);
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); 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 #endif
rxdata = PHY_vars_eNB_g[eNB_id][CC_id]->lte_eNB_common_vars.rxdata[0]; rxdata = PHY_vars_eNB_g[eNB_id][CC_id]->common_vars.rxdata[0];
slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1); slot_offset = (next_slot)*(frame_parms->samples_per_tti>>1);
adc(r_re, adc(r_re,
......
...@@ -25,17 +25,17 @@ ...@@ -25,17 +25,17 @@
Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE Address : Eurecom, Campus SophiaTech, 450 Route des Chappes, CS 50193 - 06904 Biot Sophia Antipolis cedex, FRANCE
*******************************************************************************/ *******************************************************************************/
/*! \file oaisim.c /*! \file oaisim.c
* \brief oaisim top level * \brief oaisim top level
* \author Navid Nikaein * \author Navid Nikaein
* \date 2013-2015 * \date 2013-2015
* \version 1.0 * \version 1.0
* \company Eurecom * \company Eurecom
* \email: openair_tech@eurecom.fr * \email: openair_tech@eurecom.fr
* \note * \note
* \warning * \warning
*/ */
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
...@@ -116,11 +116,11 @@ char smbv_ip[16]; ...@@ -116,11 +116,11 @@ char smbv_ip[16];
#include "T.h" #include "T.h"
/* /*
DCI0_5MHz_TDD0_t UL_alloc_pdu; DCI0_5MHz_TDD0_t UL_alloc_pdu;
DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu; DCI1A_5MHz_TDD_1_6_t CCCH_alloc_pdu;
DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1; DCI2_5MHz_2A_L10PRB_TDD_t DLSCH_alloc_pdu1;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2; DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
*/ */
#define UL_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,24) #define UL_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,24)
#define CCCH_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,3) #define CCCH_RB_ALLOC computeRIV(lte_frame_parms->N_RB_UL,0,3)
...@@ -352,8 +352,8 @@ int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_F ...@@ -352,8 +352,8 @@ int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_F
omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j; omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j;
omv_data.geo[i].Neighbors++; omv_data.geo[i].Neighbors++;
LOG_D( LOG_D(
OMG, OMG,
"[eNB %d][UE %d] is_UE_active(i,j) %d geo (x%d, y%d) num neighbors %d\n", i, j-NB_eNB_INST, is_UE_active(i,j-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors); "[eNB %d][UE %d] is_UE_active(i,j) %d geo (x%d, y%d) num neighbors %d\n", i, j-NB_eNB_INST, is_UE_active(i,j-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors);
} }
} }
} }
...@@ -388,8 +388,8 @@ int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_F ...@@ -388,8 +388,8 @@ int omv_write(int pfd, node_list* enb_node_list, node_list* ue_node_list, Data_F
omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j; omv_data.geo[i].Neighbor[omv_data.geo[i].Neighbors] = j;
omv_data.geo[i].Neighbors++; omv_data.geo[i].Neighbors++;
LOG_D( LOG_D(
OMG, OMG,
"[UE %d][eNB %d] is_UE_active %d geo (x%d, y%d) num neighbors %d\n", i-NB_eNB_INST, j, is_UE_active(j,i-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors); "[UE %d][eNB %d] is_UE_active %d geo (x%d, y%d) num neighbors %d\n", i-NB_eNB_INST, j, is_UE_active(j,i-NB_eNB_INST), omv_data.geo[i].x, omv_data.geo[i].y, omv_data.geo[i].Neighbors);
} }
} }
} }
...@@ -441,16 +441,14 @@ l2l1_task (void *args_p) ...@@ -441,16 +441,14 @@ l2l1_task (void *args_p)
int CC_id; int CC_id;
// Framing variables // Framing variables
int32_t slot, last_slot, next_slot; int32_t sf;
#ifdef Rel10 #ifdef Rel10
relaying_type_t r_type = no_relay; // no relaying relaying_type_t r_type = no_relay; // no relaying
#endif #endif
lte_subframe_t direction;
char fname[64], vname[64]; char fname[64], vname[64];
int sf;
protocol_ctxt_t ctxt; protocol_ctxt_t ctxt;
//#ifdef XFORMS //#ifdef XFORMS
// current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0) // current status is that every UE has a DL scope for a SINGLE eNB (eNB_id=0)
...@@ -478,22 +476,7 @@ l2l1_task (void *args_p) ...@@ -478,22 +476,7 @@ l2l1_task (void *args_p)
char eNB_stats_th_filename[255]; char eNB_stats_th_filename[255];
#endif #endif
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;
}
//#ifdef XFORMS
if (xforms==1) { if (xforms==1) {
xargv[0] = xname; xargv[0] = xname;
fl_initialize (&xargc, xargv, NULL, 0, 0); fl_initialize (&xargc, xargv, NULL, 0, 0);
...@@ -520,7 +503,7 @@ l2l1_task (void *args_p) ...@@ -520,7 +503,7 @@ l2l1_task (void *args_p)
} }
} }
//#endif
#ifdef PRINT_STATS #ifdef PRINT_STATS
...@@ -689,55 +672,34 @@ l2l1_task (void *args_p) ...@@ -689,55 +672,34 @@ l2l1_task (void *args_p)
omv_write (pfd[1], enb_node_list, ue_node_list, omv_data); omv_write (pfd[1], enb_node_list, ue_node_list, omv_data);
} }
#endif
#ifdef DEBUG_OMG
/*
if ((((int) oai_emulation.info.time_s) % 100) == 0) {
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++) {
get_node_position (UE, UE_inst);
}
}
*/
#endif #endif
update_ocm (); update_ocm ();
for (slot = 0; slot < 20; slot++) { for (sf = 0; sf < 10; sf++) {
if (slot % 2 == 0) start_meas (&oaisim_stats_f);
start_meas (&oaisim_stats_f);
wait_for_slot_isr (); wait_for_slot_isr ();
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
itti_update_lte_time(frame % MAX_FRAME_NUMBER, slot); itti_update_lte_time(frame % MAX_FRAME_NUMBER, sf<<1);
#endif #endif
last_slot = (slot - 1) % 20; oai_emulation.info.time_ms = frame * 10 + sf;
if (last_slot < 0)
last_slot += 20;
next_slot = (slot + 1) % 20;
oai_emulation.info.time_ms = frame * 10 + (slot >> 1);
direction = subframe_select (frame_parms[0], next_slot >> 1);
#ifdef PROC #ifdef PROC
if(Channel_Flag==1) if(Channel_Flag==1)
Channel_Func(s_re2,s_im2,r_re2,r_im2,r_re02,r_im02,r_re0_d,r_im0_d,r_re0_u,r_im0_u,eNB2UE,UE2eNB,enb_data,ue_data,abstraction_flag,frame_parms,slot); Channel_Func(s_re2,s_im2,r_re2,r_im2,r_re02,r_im02,r_re0_d,r_im0_d,r_re0_u,r_im0_u,eNB2UE,UE2eNB,enb_data,ue_data,abstraction_flag,frame_parms,sf<<1);
if(Channel_Flag==0) if(Channel_Flag==0)
#endif #endif
{ { // SUBFRAME INNER PART
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
log_set_instance_type (LOG_INSTANCE_ENB); log_set_instance_type (LOG_INSTANCE_ENB);
#endif #endif
// if ((next_slot % 2) == 0) clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
if ((slot & 1) == 0)
clear_eNB_transport_info (oai_emulation.info.nb_enb_local);
for (eNB_inst = oai_emulation.info.first_enb_local; for (eNB_inst = oai_emulation.info.first_enb_local;
(eNB_inst (eNB_inst
...@@ -745,41 +707,50 @@ l2l1_task (void *args_p) ...@@ -745,41 +707,50 @@ l2l1_task (void *args_p)
+ oai_emulation.info.nb_enb_local)); + oai_emulation.info.nb_enb_local));
eNB_inst++) { eNB_inst++) {
if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) { if (oai_emulation.info.cli_start_enb[eNB_inst] != 0) {
if ((slot & 1) == 0) {
T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(slot/2)); T(T_ENB_MASTER_TICK, T_INT(eNB_inst), T_INT(frame % 1024), T_INT(sf));
LOG_D(EMU, LOG_D(EMU,
"PHY procedures eNB %d for frame %d, slot %d (subframe TX %d, RX %d) TDD %d/%d Nid_cell %d\n", "PHY procedures eNB %d for frame %d, subframe %d TDD %d/%d Nid_cell %d\n",
eNB_inst, eNB_inst,
frame % MAX_FRAME_NUMBER, frame % MAX_FRAME_NUMBER,
slot, sf,
PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_tx, PHY_vars_eNB_g[eNB_inst][0]->frame_parms.frame_type,
PHY_vars_eNB_g[eNB_inst][0]->proc[slot >> 1].subframe_rx, PHY_vars_eNB_g[eNB_inst][0]->frame_parms.tdd_config,
PHY_vars_eNB_g[eNB_inst][0]->lte_frame_parms.frame_type, PHY_vars_eNB_g[eNB_inst][0]->frame_parms.Nid_cell);
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 #ifdef OPENAIR2
//Application: traffic gen //Application: traffic gen
update_otg_eNB (eNB_inst, oai_emulation.info.time_ms); update_otg_eNB (eNB_inst, oai_emulation.info.time_ms);
//IP/OTG to PDCP and PDCP to IP operation //IP/OTG to PDCP and PDCP to IP operation
// pdcp_run (frame, 1, 0, eNB_inst); //PHY_vars_eNB_g[eNB_id]->Mod_id // pdcp_run (frame, 1, 0, eNB_inst); //PHY_vars_eNB_g[eNB_id]->Mod_id
#endif #endif
// PHY_vars_eNB_g[eNB_id]->frame = frame; CC_id=0;
if ((slot & 1) == 0) PHY_vars_eNB_g[eNB_inst][CC_id]->proc.frame_rx = frame;
phy_procedures_eNB_lte (slot >> 1, PHY_vars_eNB_g[eNB_inst][CC_id]->proc.subframe_rx = sf;
PHY_vars_eNB_g[eNB_inst], PHY_vars_eNB_g[eNB_inst][CC_id]->proc.proc_rxtx[sf&1].frame_rx = frame;
abstraction_flag, no_relay, PHY_vars_eNB_g[eNB_inst][CC_id]->proc.proc_rxtx[sf&1].subframe_rx = sf;
NULL); PHY_vars_eNB_g[eNB_inst][CC_id]->proc.proc_rxtx[sf&1].subframe_tx = (sf+4)%10;
PHY_vars_eNB_g[eNB_inst][CC_id]->proc.proc_rxtx[sf&1].frame_tx = (sf<6) ? frame : frame+1;
phy_procedures_eNB_common_RX(PHY_vars_eNB_g[eNB_inst][CC_id],
abstraction_flag);
phy_procedures_eNB_uespec_RX(PHY_vars_eNB_g[eNB_inst][CC_id],
&PHY_vars_eNB_g[eNB_inst][CC_id]->proc.proc_rxtx[sf&1],
abstraction_flag,
no_relay);
phy_procedures_eNB_TX(PHY_vars_eNB_g[eNB_inst][CC_id],
&PHY_vars_eNB_g[eNB_inst][CC_id]->proc.proc_rxtx[sf&1],
0,no_relay,NULL);
#ifdef PRINT_STATS #ifdef PRINT_STATS
if(last_slot==9 && frame%10==0) if((sf==9) && frame%10==0)
if(eNB_avg_thr) if(eNB_avg_thr)
fprintf(eNB_avg_thr,"%d %d\n",PHY_vars_eNB_g[eNB_inst][0]->proc[slot>>1].frame_tx, fprintf(eNB_avg_thr,"%d %d\n",PHY_vars_eNB_g[eNB_inst][0]->proc.proc_rxtx[sf&1].frame_tx,
(PHY_vars_eNB_g[eNB_inst][0]->total_system_throughput)/((PHY_vars_eNB_g[eNB_inst][0]->proc[slot>>1].frame_tx+1)*10)); (PHY_vars_eNB_g[eNB_inst][0]->total_system_throughput)/((PHY_vars_eNB_g[eNB_inst][0]->proc.proc_rxtx[sf&1].frame_tx+1)*10));
if (eNB_stats[eNB_inst]) { if (eNB_stats[eNB_inst]) {
len = dump_eNB_stats(PHY_vars_eNB_g[eNB_inst][0], stats_buffer, 0); len = dump_eNB_stats(PHY_vars_eNB_g[eNB_inst][0], stats_buffer, 0);
...@@ -800,7 +771,7 @@ l2l1_task (void *args_p) ...@@ -800,7 +771,7 @@ l2l1_task (void *args_p)
#endif #endif
#endif #endif
} }
} }// eNB_inst loop
// Call ETHERNET emulation here // Call ETHERNET emulation here
//emu_transport (frame, last_slot, next_slot, direction, oai_emulation.info.frame_type, ethernet_flag); //emu_transport (frame, last_slot, next_slot, direction, oai_emulation.info.frame_type, ethernet_flag);
...@@ -809,9 +780,7 @@ l2l1_task (void *args_p) ...@@ -809,9 +780,7 @@ l2l1_task (void *args_p)
log_set_instance_type (LOG_INSTANCE_UE); log_set_instance_type (LOG_INSTANCE_UE);
#endif #endif
if ((next_slot % 2) == 0) clear_UE_transport_info (oai_emulation.info.nb_ue_local);
// if ((slot&1) == 0)
clear_UE_transport_info (oai_emulation.info.nb_ue_local);
for (UE_inst = oai_emulation.info.first_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 < (oai_emulation.info.first_ue_local + oai_emulation.info.nb_ue_local));
...@@ -823,435 +792,302 @@ l2l1_task (void *args_p) ...@@ -823,435 +792,302 @@ l2l1_task (void *args_p)
if (frame >= (UE_inst * 20)) // activate UE only after 20*UE_id frames so that different UEs turn on separately if (frame >= (UE_inst * 20)) // activate UE only after 20*UE_id frames so that different UEs turn on separately
#endif #endif
{ { // UE_PROCEDURES
LOG_D(EMU, LOG_D(EMU,
"PHY procedures UE %d for frame %d, slot %d (subframe TX %d, RX %d)\n", "PHY procedures UE %d for frame %d, subframe %d\n",
UE_inst, frame % MAX_FRAME_NUMBER, slot, next_slot >> 1, UE_inst, frame % MAX_FRAME_NUMBER, sf);
last_slot >> 1);
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0]
if (PHY_vars_UE_g[UE_inst][0]->UE_mode[0] != NOT_SYNCHED) {
!= NOT_SYNCHED) { if (frame > 0) {
if (frame > 0) { PHY_vars_UE_g[UE_inst][0]->proc.proc_rxtx[sf&1].frame_rx = frame % MAX_FRAME_NUMBER;
PHY_vars_UE_g[UE_inst][0]->frame_rx = frame % MAX_FRAME_NUMBER; PHY_vars_UE_g[UE_inst][0]->proc.proc_rxtx[sf&1].subframe_rx = sf;
PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot; PHY_vars_UE_g[UE_inst][0]->proc.proc_rxtx[sf&1].frame_tx = ((sf<6) ? frame : frame+1)% MAX_FRAME_NUMBER;
PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot; PHY_vars_UE_g[UE_inst][0]->proc.proc_rxtx[sf&1].subframe_tx = (sf+4)%10;
if (next_slot > 1)
PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER;
else
PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame + 1) % MAX_FRAME_NUMBER;
#ifdef OPENAIR2 #ifdef OPENAIR2
//Application //Application
update_otg_UE (UE_inst, oai_emulation.info.time_ms); update_otg_UE (UE_inst, oai_emulation.info.time_ms);
//Access layer //Access layer
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, next_slot); PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, UE_inst, 0, ENB_FLAG_NO, NOT_A_RNTI, frame % MAX_FRAME_NUMBER, sf);
pdcp_run (&ctxt); pdcp_run (&ctxt);
#endif #endif
for (CC_id = 0; CC_id < MAX_NUM_CCs; for (CC_id = 0; CC_id < MAX_NUM_CCs;
CC_id++) { CC_id++) {
phy_procedures_UE_lte ( phy_procedures_UE_RX(PHY_vars_UE_g[UE_inst][CC_id],
PHY_vars_UE_g[UE_inst][CC_id], &PHY_vars_UE_g[UE_inst][CC_id]->proc.proc_rxtx[sf&1],
0, abstraction_flag, 0, abstraction_flag,
normal_txrx, no_relay, normal_txrx, no_relay,
NULL); NULL);
} phy_procedures_UE_TX(PHY_vars_UE_g[UE_inst][CC_id],
&PHY_vars_UE_g[UE_inst][CC_id]->proc.proc_rxtx[sf&1],
ue_data[UE_inst]->tx_power_dBm = 0,
PHY_vars_UE_g[UE_inst][0]->tx_power_dBm; abstraction_flag,
} normal_txrx,
} else { no_relay);
if (abstraction_flag == 1) { }
LOG_E(EMU,
"sync not supported in abstraction mode (UE%d,mode%d)\n", ue_data[UE_inst]->tx_power_dBm =
UE_inst, PHY_vars_UE_g[UE_inst][0]->tx_power_dBm;
PHY_vars_UE_g[UE_inst][0]->UE_mode[0]); }
exit (-1); } else {
} if (abstraction_flag == 1) {
LOG_E(EMU,
if ((frame > 0) "sync not supported in abstraction mode (UE%d,mode%d)\n",
&& (last_slot UE_inst,
== (LTE_SLOTS_PER_FRAME PHY_vars_UE_g[UE_inst][0]->UE_mode[0]);
- 2))) { exit (-1);
initial_sync (PHY_vars_UE_g[UE_inst][0], }
normal_txrx);
if ((frame > 0)
/* && (sf==9)){
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);
if (PHY_vars_UE_g[0]->lte_frame_parms.nb_antennas_rx>1) initial_sync (PHY_vars_UE_g[UE_inst][0],
write_output("dlchan01.m","dlch01",&(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][1][0]),(6*(PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)),1,1); normal_txrx);
write_output("dlchan10.m","dlch10",&(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][2][0]),(6*(PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)),1,1);
if (PHY_vars_UE_g[0]->lte_frame_parms.nb_antennas_rx>1) /*
write_output("dlchan11.m","dlch11",&(PHY_vars_UE_g[0]->lte_ue_common_vars.dl_ch_estimates[0][3][0]),(6*(PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size)),1,1); write_output("dlchan00.m","dlch00",&(PHY_vars_UE_g[0]->common_vars.dl_ch_estimates[0][0][0]),(6*(PHY_vars_UE_g[0]->frame_parms.ofdm_symbol_size)),1,1);
write_output("rxsig.m","rxs",PHY_vars_UE_g[0]->lte_ue_common_vars.rxdata[0],PHY_vars_UE_g[0]->lte_frame_parms.samples_per_tti*10,1,1); if (PHY_vars_UE_g[0]->frame_parms.nb_antennas_rx>1)
write_output("rxsigF.m","rxsF",PHY_vars_UE_g[0]->lte_ue_common_vars.rxdataF[0],2*PHY_vars_UE_g[0]->lte_frame_parms.symbols_per_tti*PHY_vars_UE_g[0]->lte_frame_parms.ofdm_symbol_size,2,1); write_output("dlchan01.m","dlch01",&(PHY_vars_UE_g[0]->common_vars.dl_ch_estimates[0][1][0]),(6*(PHY_vars_UE_g[0]->frame_parms.ofdm_symbol_size)),1,1);
write_output("pbch_rxF_ext0.m","pbch_ext0",PHY_vars_UE_g[0]->lte_ue_pbch_vars[0]->rxdataF_ext[0],6*12*4,1,1); write_output("dlchan10.m","dlch10",&(PHY_vars_UE_g[0]->common_vars.dl_ch_estimates[0][2][0]),(6*(PHY_vars_UE_g[0]->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],6*12*4,1,1); if (PHY_vars_UE_g[0]->frame_parms.nb_antennas_rx>1)
write_output("pbch_rxF_llr.m","pbch_llr",PHY_vars_UE_g[0]->lte_ue_pbch_vars[0]->llr,(frame_parms->Ncp==0) ? 1920 : 1728,1,4); write_output("dlchan11.m","dlch11",&(PHY_vars_UE_g[0]->common_vars.dl_ch_estimates[0][3][0]),(6*(PHY_vars_UE_g[0]->frame_parms.ofdm_symbol_size)),1,1);
*/ write_output("rxsig.m","rxs",PHY_vars_UE_g[0]->common_vars.rxdata[0],PHY_vars_UE_g[0]->frame_parms.samples_per_tti*10,1,1);
} write_output("rxsigF.m","rxsF",PHY_vars_UE_g[0]->common_vars.rxdataF[0],2*PHY_vars_UE_g[0]->frame_parms.symbols_per_tti*PHY_vars_UE_g[0]->frame_parms.ofdm_symbol_size,2,1);
} write_output("pbch_rxF_ext0.m","pbch_ext0",PHY_vars_UE_g[0]->lte_ue_pbch_vars[0]->rxdataF_ext[0],6*12*4,1,1);
write_output("pbch_rxF_comp0.m","pbch_comp0",PHY_vars_UE_g[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,(frame_parms->Ncp==0) ? 1920 : 1728,1,4);
*/
}
}
#ifdef PRINT_STATS #ifdef PRINT_STATS
if(last_slot==2 && frame%10==0) { if((sf==1) && frame%10==0) {
if (UE_stats_th[UE_inst]) { if (UE_stats_th[UE_inst]) {
fprintf(UE_stats_th[UE_inst],"%d %d\n",frame % MAX_FRAME_NUMBER, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000); fprintf(UE_stats_th[UE_inst],"%d %d\n",frame % MAX_FRAME_NUMBER, PHY_vars_UE_g[UE_inst][0]->bitrate[0]/1000);
} }
} }
if (UE_stats[UE_inst]) { if (UE_stats[UE_inst]) {
len = dump_ue_stats (PHY_vars_UE_g[UE_inst][0], stats_buffer, 0, normal_txrx, 0); len = dump_ue_stats (PHY_vars_UE_g[UE_inst][0], &PHY_vars_UE_g[UE_inst][0]->proc.proc_rxtx[sf&1],stats_buffer, 0, normal_txrx, 0);
rewind (UE_stats[UE_inst]); rewind (UE_stats[UE_inst]);
fwrite (stats_buffer, 1, len, UE_stats[UE_inst]); fwrite (stats_buffer, 1, len, UE_stats[UE_inst]);
fflush(UE_stats[UE_inst]); fflush(UE_stats[UE_inst]);
} }
#endif #endif
} } // UE_PROCEDURES
} }
} } // UE_inst
#ifdef Rel10 emu_transport (frame % MAX_FRAME_NUMBER, sf<<1, ((sf+4)%10)<<1, subframe_select(&PHY_vars_eNB_g[0][0]->frame_parms,sf),
for (RN_id=oai_emulation.info.first_rn_local;
RN_id<oai_emulation.info.first_rn_local+oai_emulation.info.nb_rn_local;
RN_id++) {
// UE id and eNB id of the RN
UE_inst= oai_emulation.info.first_ue_local+oai_emulation.info.nb_ue_local + RN_id;// NB_UE_INST + RN_id
eNB_inst= oai_emulation.info.first_enb_local+oai_emulation.info.nb_enb_local + RN_id;// NB_eNB_INST + RN_id
// currently only works in FDD
if (oai_emulation.info.eMBMS_active_state == 4) {
r_type = multicast_relay;
//LOG_I(EMU,"Activating the multicast relaying\n");
} else {
LOG_E(EMU,"Not supported eMBMS option when relaying is enabled %d\n", r_type);
exit(-1);
}
PHY_vars_RN_g[RN_id]->frame = frame % MAX_FRAME_NUMBER;
if ( oai_emulation.info.frame_type == 0) {
// RN == UE
if (frame>0) {
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][0]->frame_rx = frame % MAX_FRAME_NUMBER;
PHY_vars_UE_g[UE_inst][0]->slot_rx = last_slot;
PHY_vars_UE_g[UE_inst][0]->slot_tx = next_slot;
if (next_slot>1) PHY_vars_UE_g[UE_inst][0]->frame_tx = frame % MAX_FRAME_NUMBER;
else PHY_vars_UE_g[UE_inst][0]->frame_tx = (frame+1) % MAX_FRAME_NUMBER;
phy_procedures_UE_lte (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][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 % MAX_FRAME_NUMBER, slot, next_slot >> 1,last_slot>>1);
phy_procedures_eNB_lte(slot>>1, PHY_vars_eNB_g[eNB_inst], abstraction_flag,
r_type, PHY_vars_RN_g[RN_id]);
} else {
LOG_E(EMU,"TDD is not supported for multicast relaying %d\n", r_type);
exit(-1);
}
}
#endif
emu_transport (frame % MAX_FRAME_NUMBER, last_slot, next_slot, direction,
oai_emulation.info.frame_type[0], ethernet_flag); oai_emulation.info.frame_type[0], ethernet_flag);
if ((direction == SF_DL) start_meas (&dl_chan_stats);
|| (frame_parms[0]->frame_type == FDD)) {
// consider only sec id 0 for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++)
/* for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
if (abstraction_flag == 0) { //#warning figure out what to do with UE frame_parms during initial_sync
do_OFDM_mod(PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdataF[0], do_DL_sig (r_re0,
PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdata[0], r_im0,
frame,next_slot, r_re,
frame_parms); r_im,
} s_re,
}*/ s_im,
start_meas (&dl_chan_stats); eNB2UE,
enb_data,
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) ue_data,
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { PHY_vars_eNB_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1,
//#warning figure out what to do with UE frame_parms during initial_sync abstraction_flag,
do_DL_sig (r_re0, &PHY_vars_eNB_g[0][CC_id]->frame_parms,
r_im0, UE_inst, CC_id);
r_re, do_DL_sig (r_re0,
r_im, r_im0,
s_re, r_re,
s_im, r_im,
eNB2UE, s_re,
enb_data, s_im,
ue_data, eNB2UE,
next_slot, enb_data,
abstraction_flag, ue_data,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, (PHY_vars_eNB_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1)+1,
UE_inst, CC_id); abstraction_flag,
} &PHY_vars_eNB_g[0][CC_id]->frame_parms,
UE_inst, CC_id);
stop_meas (&dl_chan_stats); }
}
stop_meas (&dl_chan_stats);
if ((direction == SF_UL) || (frame_parms[0]->frame_type == 0)) { //if ((subframe<2) || (subframe>4))
start_meas (&ul_chan_stats);
start_meas (&ul_chan_stats);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
//#warning figure out what to do with UE frame_parms during initial_sync 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, //#warning figure out what to do with UE frame_parms during initial_sync
enb_data, ue_data, next_slot, do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
abstraction_flag, enb_data, ue_data,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, PHY_vars_UE_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1,
frame % MAX_FRAME_NUMBER, CC_id); abstraction_flag,
} &PHY_vars_eNB_g[0][CC_id]->frame_parms,
frame % MAX_FRAME_NUMBER, CC_id);
stop_meas (&ul_chan_stats); do_UL_sig (r_re0, r_im0, r_re, r_im, s_re, s_im, UE2eNB,
/* enb_data, ue_data,
int ccc; (PHY_vars_UE_g[0][CC_id]->proc.proc_rxtx[sf&1].subframe_tx<<1)+1,
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n "); abstraction_flag,
for(ccc = 0 ; ccc<301; ccc++) &PHY_vars_eNB_g[0][CC_id]->frame_parms,
{ frame % MAX_FRAME_NUMBER, CC_id);
fprintf(SINRpost,"_ %f ", SINRpost_eff[ccc]); }
}
fprintf(SINRpost,"SINRdb For eNB : %f \n ", SINRpost_eff[ccc]); stop_meas (&ul_chan_stats);
*/
}
if ((sf == 0) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0)
if ((direction == SF_S)) { //it must be a special subframe && (oai_emulation.info.n_frames == 1)) {
if (next_slot % 2 == 0) { //DL part
/* for (eNB_id=0;eNB_id<NB_eNB_INST;eNB_id++) { write_output ("dlchan0.m",
if (abstraction_flag == 0) { "dlch0",
do_OFDM_mod(PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdataF[0], &(PHY_vars_UE_g[0][0]->common_vars.dl_ch_estimates[0][0][0]),
PHY_vars_eNB_g[eNB_id]->lte_eNB_common_vars.txdata[0], (6
frame,next_slot, * (PHY_vars_UE_g[0][0]->frame_parms.ofdm_symbol_size)),
frame_parms); 1, 1);
} write_output ("dlchan1.m",
}*/ "dlch1",
start_meas (&dl_chan_stats); &(PHY_vars_UE_g[0][0]->common_vars.dl_ch_estimates[1][0][0]),
(6
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) * (PHY_vars_UE_g[0][0]->frame_parms.ofdm_symbol_size)),
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) { 1, 1);
//#warning check dimensions of r_reN,r_imN for multiple CCs write_output ("dlchan2.m",
do_DL_sig (r_re0, "dlch2",
r_im0, &(PHY_vars_UE_g[0][0]->common_vars.dl_ch_estimates[2][0][0]),
r_re, (6
r_im, * (PHY_vars_UE_g[0][0]->frame_parms.ofdm_symbol_size)),
s_re, 1, 1);
s_im, write_output ("pbch_rxF_comp0.m",
eNB2UE, "pbch_comp0",
enb_data, PHY_vars_UE_g[0][0]->pbch_vars[0]->rxdataF_comp[0],
ue_data, 6 * 12 * 4, 1, 1);
next_slot, write_output ("pbch_rxF_llr.m", "pbch_llr",
abstraction_flag, PHY_vars_UE_g[0][0]->pbch_vars[0]->llr,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, (frame_parms[0]->Ncp == 0) ? 1920 : 1728, 1,
UE_inst, CC_id); 4);
} }
stop_meas (&dl_chan_stats); stop_meas (&oaisim_stats_f);
/* } // SUBFRAME INNER PART
for (aarx=0;aarx<UE2eNB[1][0]->nb_rx;aarx++)
for (aatx=0;aatx<UE2eNB[1][0]->nb_tx;aatx++)
for (k=0;k<UE2eNB[1][0]->channel_length;k++)
printf("SB(%d,%d,%d)->(%f,%f)\n",k,aarx,aatx,UE2eNB[1][0]->ch[aarx+(aatx*UE2eNB[1][0]->nb_rx)][k].r,UE2eNB[1][0]->ch[aarx+(aatx*UE2eNB[1][0]->nb_rx)][k].i);
*/
} else { // UL part
start_meas (&ul_chan_stats);
for (CC_id = 0; CC_id < MAX_NUM_CCs; CC_id++) {
//#warning check dimensions of r_reN,r_imN for multiple CCs
do_UL_sig (r_re0,
r_im0,
r_re,
r_im,
s_re,
s_im,
UE2eNB,
enb_data,
ue_data,
next_slot,
abstraction_flag,
&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms,
frame % MAX_FRAME_NUMBER, CC_id);
}
stop_meas (&ul_chan_stats);
/* int ccc;
fprintf(SINRpost,"SINRdb For eNB New Subframe : \n ");
for(ccc = 0 ; ccc<301; ccc++)
{
fprintf(SINRpost,"_ %f ", SINRpost_eff[ccc]);
}
fprintf(SINRpost,"SINRdb For eNB : %f \n ", SINRpost_eff[ccc]);
}
*/
}
}
if ((last_slot == 1) && ((frame % MAX_FRAME_NUMBER) == 0) && (abstraction_flag == 0)
&& (oai_emulation.info.n_frames == 1)) {
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][0]->lte_ue_pbch_vars[0]->llr,
(frame_parms[0]->Ncp == 0) ? 1920 : 1728, 1,
4);
}
/*
if ((last_slot==1) && (frame==1)) {
write_output("dlsch_rxF_comp0.m","dlsch0_rxF_comp0",PHY_vars_UE->lte_ue_pdsch_vars[eNB_id]->rxdataF_comp[0],300*(-(PHY_vars_UE->lte_frame_parms.Ncp*2)+14),1,1);
write_output("pdcch_rxF_comp0.m","pdcch0_rxF_comp0",PHY_vars_UE->lte_ue_pdcch_vars[eNB_id]->rxdataF_comp[0],4*300,1,1);
}
*/
} // if Channel_Flag==0
if (slot % 2 == 1)
stop_meas (&oaisim_stats_f);
} //end of slot
}
if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0) if ((frame >= 10) && (frame <= 11) && (abstraction_flag == 0)
#ifdef PROC #ifdef PROC
&&(Channel_Flag==0) &&(Channel_Flag==0)
#endif #endif
) { ) {
sprintf (fname, "UEtxsig%d.m", frame % MAX_FRAME_NUMBER); sprintf (fname, "UEtxsig%d.m", frame % MAX_FRAME_NUMBER);
sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER); sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER);
write_output (fname, write_output (fname,
vname, vname,
PHY_vars_UE_g[0][0]->lte_ue_common_vars.txdata[0], PHY_vars_UE_g[0][0]->common_vars.txdata[0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti PHY_vars_UE_g[0][0]->frame_parms.samples_per_tti
* 10, * 10,
1, 1); 1, 1);
sprintf (fname, "eNBtxsig%d.m", frame % MAX_FRAME_NUMBER); sprintf (fname, "eNBtxsig%d.m", frame % MAX_FRAME_NUMBER);
sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER); sprintf (vname, "txs%d", frame % MAX_FRAME_NUMBER);
write_output (fname, write_output (fname,
vname, vname,
PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdata[0][0], PHY_vars_eNB_g[0][0]->common_vars.txdata[0][0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti PHY_vars_UE_g[0][0]->frame_parms.samples_per_tti
* 10, * 10,
1, 1); 1, 1);
sprintf (fname, "eNBtxsigF%d.m", frame % MAX_FRAME_NUMBER); sprintf (fname, "eNBtxsigF%d.m", frame % MAX_FRAME_NUMBER);
sprintf (vname, "txsF%d", frame % MAX_FRAME_NUMBER); sprintf (vname, "txsF%d", frame % MAX_FRAME_NUMBER);
write_output (fname, write_output (fname,
vname, vname,
PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.txdataF[0][0], PHY_vars_eNB_g[0][0]->common_vars.txdataF[0][0],
PHY_vars_eNB_g[0][0]->lte_frame_parms.symbols_per_tti PHY_vars_eNB_g[0][0]->frame_parms.symbols_per_tti
* PHY_vars_eNB_g[0][0]->lte_frame_parms.ofdm_symbol_size, * PHY_vars_eNB_g[0][0]->frame_parms.ofdm_symbol_size,
1, 1); 1, 1);
sprintf (fname, "UErxsig%d.m", frame % MAX_FRAME_NUMBER); sprintf (fname, "UErxsig%d.m", frame % MAX_FRAME_NUMBER);
sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER); sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER);
write_output (fname, write_output (fname,
vname, vname,
PHY_vars_UE_g[0][0]->lte_ue_common_vars.rxdata[0], PHY_vars_UE_g[0][0]->common_vars.rxdata[0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti PHY_vars_UE_g[0][0]->frame_parms.samples_per_tti
* 10, * 10,
1, 1); 1, 1);
sprintf (fname, "eNBrxsig%d.m", frame % MAX_FRAME_NUMBER); sprintf (fname, "eNBrxsig%d.m", frame % MAX_FRAME_NUMBER);
sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER); sprintf (vname, "rxs%d", frame % MAX_FRAME_NUMBER);
write_output (fname, write_output (fname,
vname, vname,
PHY_vars_eNB_g[0][0]->lte_eNB_common_vars.rxdata[0][0], PHY_vars_eNB_g[0][0]->common_vars.rxdata[0][0],
PHY_vars_UE_g[0][0]->lte_frame_parms.samples_per_tti PHY_vars_UE_g[0][0]->frame_parms.samples_per_tti
* 10, * 10,
1, 1); 1, 1);
} }
//#ifdef XFORMS //#ifdef XFORMS
if (xforms==1) { if (xforms==1) {
eNB_inst = 0; eNB_inst = 0;
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],
eNB_inst,
UE_inst,
7);
}
for (UE_inst = 0; UE_inst < NB_UE_INST; UE_inst++) { phy_scope_eNB(form_enb[UE_inst],
for (CC_id=0;CC_id<MAX_NUM_CCs;CC_id++) { PHY_vars_eNB_g[eNB_inst][0],
phy_scope_UE(form_ue[CC_id][UE_inst], UE_inst);
PHY_vars_UE_g[UE_inst][CC_id],
eNB_inst,
UE_inst,
7);
} }
phy_scope_eNB(form_enb[UE_inst],
PHY_vars_eNB_g[eNB_inst][0],
UE_inst);
}
} }
//#endif //#endif
#ifdef SMBV #ifdef SMBV
// Rohde&Schwarz SMBV100A vector signal generator // Rohde&Schwarz SMBV100A vector signal generator
if ((frame % MAX_FRAME_NUMBER == config_frames[0]) || (frame % MAX_FRAME_NUMBER == config_frames[1]) || (frame % MAX_FRAME_NUMBER == config_frames[2]) || (frame % MAX_FRAME_NUMBER == config_frames[3])) { if ((frame % MAX_FRAME_NUMBER == config_frames[0]) || (frame % MAX_FRAME_NUMBER == config_frames[1]) || (frame % MAX_FRAME_NUMBER == config_frames[2]) || (frame % MAX_FRAME_NUMBER == config_frames[3])) {
smbv_frame_cnt++; smbv_frame_cnt++;
} }
#endif #endif
} } // frame loop
//end of frame
stop_meas (&oaisim_stats); stop_meas (&oaisim_stats);
oai_shutdown (); oai_shutdown ();
#ifdef PRINT_STATS #ifdef PRINT_STATS
for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) { for (UE_inst=0; UE_inst<NB_UE_INST; UE_inst++) {
if (UE_stats[UE_inst]) if (UE_stats[UE_inst])
fclose (UE_stats[UE_inst]); fclose (UE_stats[UE_inst]);
if(UE_stats_th[UE_inst]) if(UE_stats_th[UE_inst])
fclose (UE_stats_th[UE_inst]); fclose (UE_stats_th[UE_inst]);
} }
for (eNB_inst=0; eNB_inst<NB_eNB_INST; eNB_inst++) { for (eNB_inst=0; eNB_inst<NB_eNB_INST; eNB_inst++) {
if (eNB_stats[eNB_inst]) if (eNB_stats[eNB_inst])
fclose (eNB_stats[eNB_inst]); fclose (eNB_stats[eNB_inst]);
} }
if (eNB_avg_thr) if (eNB_avg_thr)
fclose (eNB_avg_thr); fclose (eNB_avg_thr);
if (eNB_l2_stats) if (eNB_l2_stats)
fclose (eNB_l2_stats); fclose (eNB_l2_stats);
#endif #endif
#if defined(ENABLE_ITTI) #if defined(ENABLE_ITTI)
itti_terminate_tasks(TASK_L2L1); itti_terminate_tasks(TASK_L2L1);
#endif #endif
return NULL; return NULL;
} }
...@@ -1354,7 +1190,7 @@ main (int argc, char **argv) ...@@ -1354,7 +1190,7 @@ main (int argc, char **argv)
#ifdef SMBV #ifdef SMBV
// Rohde&Schwarz SMBV100A vector signal generator // Rohde&Schwarz SMBV100A vector signal generator
smbv_init_config(smbv_fname, smbv_nframes); smbv_init_config(smbv_fname, smbv_nframes);
smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0][0]->lte_frame_parms); smbv_write_config_from_frame_parms(smbv_fname, &PHY_vars_eNB_g[0][0]->frame_parms);
#endif #endif
// add events to future event list: Currently not used // add events to future event list: Currently not used
...@@ -1862,38 +1698,38 @@ oai_shutdown (void) ...@@ -1862,38 +1698,38 @@ oai_shutdown (void)
if (abstraction_flag == 0 && Channel_Flag==0 && Process_Flag==0) if (abstraction_flag == 0 && Channel_Flag==0 && Process_Flag==0)
#else #else
if (abstraction_flag == 0) if (abstraction_flag == 0)
#endif #endif
{ {
/* /*
#ifdef IFFT_FPGA #ifdef IFFT_FPGA
free(txdataF2[0]); free(txdataF2[0]);
free(txdataF2[1]); free(txdataF2[1]);
free(txdataF2); free(txdataF2);
free(txdata[0]); free(txdata[0]);
free(txdata[1]); free(txdata[1]);
free(txdata); free(txdata);
#endif #endif
*/ */
for (int i = 0; i < 2; i++) { for (int i = 0; i < 2; i++) {
free (s_re[i]); free (s_re[i]);
free (s_im[i]); free (s_im[i]);
free (r_re[i]); free (r_re[i]);
free (r_im[i]); free (r_im[i]);
} }
free (s_re); free (s_re);
free (s_im); free (s_im);
free (r_re); free (r_re);
free (r_im); free (r_im);
s_re = 0; s_re = 0;
s_im = 0; s_im = 0;
r_re = 0; r_re = 0;
r_im = 0; r_im = 0;
lte_sync_time_free (); lte_sync_time_free ();
} }
// added for PHY abstraction // added for PHY abstraction
if (oai_emulation.info.ocm_enabled == 1) { if (oai_emulation.info.ocm_enabled == 1) {
...@@ -1961,3 +1797,5 @@ get_OAI_emulation () ...@@ -1961,3 +1797,5 @@ get_OAI_emulation ()
{ {
return &oai_emulation; return &oai_emulation;
} }
...@@ -958,21 +958,21 @@ void init_openair1(void) ...@@ -958,21 +958,21 @@ void init_openair1(void)
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_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_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]->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[CC_id]->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_A = rho_B PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.p_b = (frame_parms[CC_id]->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_A = rho_B
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_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_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]->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[CC_id]->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_A = rho_B PHY_vars_UE_g[UE_id][CC_id]->frame_parms.pdsch_config_common.p_b = (frame_parms[CC_id]->nb_antennas_tx_eNB>1) ? 1 : 0; // rho_A = rho_B
} }
} }
} }
printf ("AFTER init: MAX_NUM_CCs %d, Nid_cell %d frame_type %d,tdd_config %d\n", printf ("AFTER init: MAX_NUM_CCs %d, Nid_cell %d frame_type %d,tdd_config %d\n",
MAX_NUM_CCs, MAX_NUM_CCs,
PHY_vars_eNB_g[0][0]->lte_frame_parms.Nid_cell, PHY_vars_eNB_g[0][0]->frame_parms.Nid_cell,
PHY_vars_eNB_g[0][0]->lte_frame_parms.frame_type, PHY_vars_eNB_g[0][0]->frame_parms.frame_type,
PHY_vars_eNB_g[0][0]->lte_frame_parms.tdd_config); PHY_vars_eNB_g[0][0]->frame_parms.tdd_config);
number_of_cards = 1; number_of_cards = 1;
...@@ -993,12 +993,12 @@ void init_openair1(void) ...@@ -993,12 +993,12 @@ void init_openair1(void)
for (UE_id=0; UE_id<NB_UE_INST; UE_id++) { for (UE_id=0; UE_id<NB_UE_INST; UE_id++) {
PHY_vars_UE_g[UE_id][CC_id]->use_ia_receiver = 0; PHY_vars_UE_g[UE_id][CC_id]->use_ia_receiver = 0;
if (PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.frame_type == TDD) { if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.frame_type == TDD) {
if (PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.N_RB_DL == 100) if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 100)
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624; PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624;
else if (PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.N_RB_DL == 50) else if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 50)
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624/2; PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624/2;
else if (PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.N_RB_DL == 25) else if (PHY_vars_UE_g[UE_id][CC_id]->frame_parms.N_RB_DL == 25)
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624/4; PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 624/4;
} else { } else {
PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 0; PHY_vars_UE_g[UE_id][CC_id]->N_TA_offset = 0;
...@@ -1006,12 +1006,12 @@ void init_openair1(void) ...@@ -1006,12 +1006,12 @@ void init_openair1(void)
} }
for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) { for (eNB_id=0; eNB_id<NB_eNB_INST; eNB_id++) {
if (PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.frame_type == TDD) { if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.frame_type == TDD) {
if (PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_DL == 100) if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL == 100)
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624; PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624;
else if (PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_DL == 50) else if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL == 50)
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624/2; PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624/2;
else if (PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_DL == 25) else if (PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL == 25)
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624/4; PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 624/4;
} else { } else {
PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 0; PHY_vars_eNB_g[eNB_id][CC_id]->N_TA_offset = 0;
...@@ -1048,7 +1048,7 @@ void init_openair1(void) ...@@ -1048,7 +1048,7 @@ void init_openair1(void)
else else
PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=1; PHY_vars_UE_g[UE_id][CC_id]->mac_enabled=1;
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]->pdcch_vars[0]->crnti = 0x1235 + UE_id;
PHY_vars_UE_g[UE_id][CC_id]->current_dlsch_cqi[0] = 10; 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][CC_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] );
...@@ -1077,7 +1077,7 @@ void init_openair2(void) ...@@ -1077,7 +1077,7 @@ void init_openair2(void)
//#warning "eNB index is hard coded to zero" //#warning "eNB index is hard coded to zero"
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++)
l2_init (&PHY_vars_eNB_g[0][CC_id]->lte_frame_parms, l2_init (&PHY_vars_eNB_g[0][CC_id]->frame_parms,
oai_emulation.info.eMBMS_active_state, oai_emulation.info.eMBMS_active_state,
NULL, NULL,
oai_emulation.info.cba_group_active, oai_emulation.info.cba_group_active,
...@@ -1167,8 +1167,8 @@ void init_ocm(void) ...@@ -1167,8 +1167,8 @@ void init_ocm(void)
map_str_to_int(small_scale_names,oai_emulation.environment_system_config.fading.small_scale.selected_option), eNB_id, UE_id); 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) /* if (oai_emulation.info.transmission_mode == 5)
eNB2UE[eNB_id][UE_id] = new_channel_desc_scm(PHY_vars_eNB_g[eNB_id]->lte_frame_parms.nb_antennas_tx, eNB2UE[eNB_id][UE_id] = new_channel_desc_scm(PHY_vars_eNB_g[eNB_id]->frame_parms.nb_antennas_tx,
PHY_vars_UE_g[UE_id]->lte_frame_parms.nb_antennas_rx, PHY_vars_UE_g[UE_id]->frame_parms.nb_antennas_rx,
(UE_id == 0)? Rice1_corr : Rice1_anticorr, (UE_id == 0)? Rice1_corr : Rice1_anticorr,
oai_emulation.environment_system_config.system_bandwidth_MB, oai_emulation.environment_system_config.system_bandwidth_MB,
forgetting_factor, forgetting_factor,
...@@ -1179,11 +1179,11 @@ void init_ocm(void) ...@@ -1179,11 +1179,11 @@ void init_ocm(void)
*/ */
eNB2UE[eNB_id][UE_id][CC_id] = 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, new_channel_desc_scm(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_tx,
PHY_vars_UE_g[UE_id][CC_id]->lte_frame_parms.nb_antennas_rx, PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_rx,
map_str_to_int(small_scale_names,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),
N_RB2sampling_rate(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_DL), N_RB2sampling_rate(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL),
N_RB2channel_bandwidth(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_DL), N_RB2channel_bandwidth(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_DL),
forgetting_factor, forgetting_factor,
0, 0,
0); 0);
...@@ -1192,11 +1192,11 @@ void init_ocm(void) ...@@ -1192,11 +1192,11 @@ void init_ocm(void)
map_str_to_int(small_scale_names, oai_emulation.environment_system_config.fading.small_scale.selected_option),UE_id, eNB_id); 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][CC_id] = 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, new_channel_desc_scm(PHY_vars_UE_g[UE_id][CC_id]->frame_parms.nb_antennas_tx,
PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.nb_antennas_rx, PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.nb_antennas_rx,
map_str_to_int(small_scale_names, 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),
N_RB2sampling_rate(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_UL), N_RB2sampling_rate(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_UL),
N_RB2channel_bandwidth(PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.N_RB_UL), N_RB2channel_bandwidth(PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.N_RB_UL),
forgetting_factor, forgetting_factor,
0, 0,
0); 0);
...@@ -1265,7 +1265,7 @@ void update_ocm() ...@@ -1265,7 +1265,7 @@ void update_ocm()
int CC_id; int CC_id;
for (eNB_id = 0; eNB_id < NB_eNB_INST; eNB_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][0]->lte_frame_parms.pdsch_config_common.referenceSignalPower; enb_data[eNB_id]->tx_power_dBm = PHY_vars_eNB_g[eNB_id][0]->frame_parms.pdsch_config_common.referenceSignalPower;
for (UE_id = 0; UE_id < NB_UE_INST; UE_id++) for (UE_id = 0; UE_id < NB_UE_INST; UE_id++)
ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm; ue_data[UE_id]->tx_power_dBm = PHY_vars_UE_g[UE_id][0]->tx_power_dBm;
...@@ -1315,16 +1315,16 @@ void update_ocm() ...@@ -1315,16 +1315,16 @@ void update_ocm()
//pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE //pathloss: -132.24 dBm/15kHz RE + target SNR - eNB TX power per RE
if (eNB_id == (UE_id % NB_eNB_INST)) { if (eNB_id == (UE_id % NB_eNB_INST)) {
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower; eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + 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 = -132.24 + snr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
} else { } else {
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->lte_frame_parms.pdsch_config_common.referenceSignalPower; eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
UE2eNB[UE_id][eNB_id][CC_id]->path_loss_dB = -132.24 + 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 = -132.24 + sinr_dB - PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower;
} }
LOG_I(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",eNB_id,UE_id,CC_id, LOG_I(OCM,"Path loss from eNB %d to UE %d (CCid %d)=> %f dB (eNB TX %d, SNR %f)\n",eNB_id,UE_id,CC_id,
eNB2UE[eNB_id][UE_id][CC_id]->path_loss_dB, 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,snr_dB); PHY_vars_eNB_g[eNB_id][CC_id]->frame_parms.pdsch_config_common.referenceSignalPower,snr_dB);
// 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); // 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