Commit 7e2a3973 authored by knopp's avatar 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,6 +1539,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1539,6 +1539,7 @@ 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,
eNB_rxtx_proc_t *proc,
uint8_t UE_index, uint8_t UE_index,
uint16_t *crnti); uint16_t *crnti);
......
...@@ -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