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

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5645 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 90c9df89
...@@ -151,7 +151,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -151,7 +151,7 @@ int lte_est_timing_advance(LTE_DL_FRAME_PARMS *frame_parms,
} }
int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_t subframe) int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_t sched_subframe)
{ {
static int first_run=1; static int first_run=1;
static int max_pos_fil2=0; static int max_pos_fil2=0;
...@@ -162,14 +162,14 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_ ...@@ -162,14 +162,14 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id]; LTE_eNB_PUSCH *eNB_pusch_vars = phy_vars_eNB->lte_eNB_pusch_vars[UE_id];
int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0]; int32_t **ul_ch_estimates_time= eNB_pusch_vars->drs_ch_estimates_time[0];
int subframe_sched = (subframe==9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
uint8_t harq_pid; uint8_t harq_pid;
uint8_t Ns = 1; //we take the estimate from the second slot uint8_t Ns = 1; //we take the estimate from the second slot
uint8_t cyclic_shift = 0;//(frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift + uint8_t cyclic_shift = 0;//(frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.cyclicShift +
//phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS2 + //phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS2 +
//frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12; //frame_parms->pusch_config_common.ul_ReferenceSignalsPUSCH.nPRS[(subframe<<1)+Ns]) % 12;
harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[subframe_sched].frame_rx,subframe); harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size); int sync_pos = (frame_parms->ofdm_symbol_size-cyclic_shift*frame_parms->ofdm_symbol_size/12)%(frame_parms->ofdm_symbol_size);
...@@ -197,7 +197,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_ ...@@ -197,7 +197,7 @@ int lte_est_timing_advance_pusch(PHY_VARS_eNB* phy_vars_eNB,uint8_t UE_id,uint8_
max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15; max_pos_fil2 = ((max_pos_fil2 * coef) + (max_pos * ncoef)) >> 15;
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
LOG_I(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",phy_vars_eNB->proc[subframe_sched].frame_rx,max_pos,max_pos_fil2,sync_pos); LOG_I(PHY,"frame %d: max_pos = %d, max_pos_fil = %d, sync_pos=%d\n",phy_vars_eNB->proc[sched_subframe].frame_rx,max_pos,max_pos_fil2,sync_pos);
#endif //DEBUG_PHY #endif //DEBUG_PHY
return(max_pos_fil2-sync_pos); return(max_pos_fil2-sync_pos);
......
...@@ -34,7 +34,7 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32 ...@@ -34,7 +34,7 @@ static int16_t ru_90c[2*128] = {32767, 0,32766, -402,32758, -804,32746, -1206,32
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
uint8_t eNB_id, uint8_t eNB_id,
uint8_t UE_id, uint8_t UE_id,
uint8_t subframe, uint8_t sched_subframe,
unsigned char l, unsigned char l,
unsigned char Ns, unsigned char Ns,
uint8_t cooperation_flag) { uint8_t cooperation_flag) {
...@@ -46,8 +46,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB, ...@@ -46,8 +46,8 @@ int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
int32_t **ul_ch_estimates_0= eNB_pusch_vars->drs_ch_estimates_0[eNB_id]; int32_t **ul_ch_estimates_0= eNB_pusch_vars->drs_ch_estimates_0[eNB_id];
int32_t **ul_ch_estimates_1= eNB_pusch_vars->drs_ch_estimates_1[eNB_id]; int32_t **ul_ch_estimates_1= eNB_pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= eNB_pusch_vars->rxdataF_ext[eNB_id]; int32_t **rxdataF_ext= eNB_pusch_vars->rxdataF_ext[eNB_id];
int subframe_sched = (subframe == 9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[subframe_sched].frame_rx,subframe); uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
int16_t delta_phase = 0; int16_t delta_phase = 0;
int16_t *ru1 = ru_90; int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90; int16_t *ru2 = ru_90;
......
...@@ -4482,7 +4482,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -4482,7 +4482,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
int generate_eNB_ulsch_params_from_dci(void *dci_pdu, int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
uint16_t rnti, uint16_t rnti,
uint8_t subframe, uint8_t sched_subframe,
DCI_format_t dci_format, DCI_format_t dci_format,
uint8_t UE_id, uint8_t UE_id,
PHY_VARS_eNB *phy_vars_eNB, PHY_VARS_eNB *phy_vars_eNB,
...@@ -4498,7 +4498,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -4498,7 +4498,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
ANFBmode_t AckNackFBMode = phy_vars_eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode; ANFBmode_t AckNackFBMode = phy_vars_eNB->pucch_config_dedicated[UE_id].tdd_AckNackFeedbackMode;
LTE_eNB_ULSCH_t *ulsch=phy_vars_eNB->ulsch_eNB[UE_id]; LTE_eNB_ULSCH_t *ulsch=phy_vars_eNB->ulsch_eNB[UE_id];
LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &phy_vars_eNB->lte_frame_parms;
int subframe_sched = (subframe == 0) ? 9 : (subframe-1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
uint32_t cqi_req = 0; uint32_t cqi_req = 0;
uint32_t dai = 0; uint32_t dai = 0;
...@@ -4520,7 +4520,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -4520,7 +4520,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
harq_pid = subframe2harq_pid(frame_parms, harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms, pdcch_alloc2ul_frame(frame_parms,
phy_vars_eNB->proc[subframe_sched].frame_tx, phy_vars_eNB->proc[sched_subframe].frame_tx,
subframe), subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe)); pdcch_alloc2ul_subframe(frame_parms,subframe));
...@@ -4786,8 +4786,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu, ...@@ -4786,8 +4786,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n", LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d, subframe %d : Programming PUSCH with n_DMRS2 %d (cshift %d)\n",
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift); phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,ulsch->harq_processes[harq_pid]->n_DMRS2,cshift);
......
...@@ -1313,7 +1313,7 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue, ...@@ -1313,7 +1313,7 @@ void rx_phich(PHY_VARS_UE *phy_vars_ue,
} }
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
unsigned char subframe, unsigned char sched_subframe,
int16_t amp, int16_t amp,
uint8_t sect_id, uint8_t sect_id,
uint8_t abstraction_flag) { uint8_t abstraction_flag) {
...@@ -1328,7 +1328,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1328,7 +1328,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
uint8_t pusch_subframe; uint8_t pusch_subframe;
uint8_t UE_id; uint8_t UE_id;
uint32_t pusch_frame; uint32_t pusch_frame;
int subframe_sched = (subframe == 0) ? 9 : (subframe-1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
// compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211 // compute Ngroup_PHICH (see formula at beginning of Section 6.9 in 36-211
...@@ -1338,7 +1338,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1338,7 +1338,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
if (frame_parms->Ncp == 1) if (frame_parms->Ncp == 1)
NSF_PHICH = 2; NSF_PHICH = 2;
pusch_frame = phich_frame2_pusch_frame(frame_parms,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe); pusch_frame = phich_frame2_pusch_frame(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe); pusch_subframe = phich_subframe2_pusch_subframe(frame_parms,subframe);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe); harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
...@@ -1348,7 +1348,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1348,7 +1348,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
if (ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active == 1) { if (ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active == 1) {
LOG_D(PHY,"[eNB][PUSCH %x/%d] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n", LOG_D(PHY,"[eNB][PUSCH %x/%d] Frame %d subframe %d (pusch_subframe %d,pusch_frame %d) phich active %d\n",
ulsch_eNB[UE_id]->rnti,harq_pid,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe,pusch_subframe,pusch_frame,ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active); ulsch_eNB[UE_id]->rnti,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,pusch_subframe,pusch_frame,ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_active);
ngroup_PHICH = (ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb + ngroup_PHICH = (ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb +
ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH; ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%Ngroup_PHICH;
...@@ -1361,7 +1361,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1361,7 +1361,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH); ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_PHICH);
#ifdef DEBUG_PHICH #ifdef DEBUG_PHICH
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n", LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d dci_alloc %d)\n",
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[subframe_sched].frame_tx, phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,
subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH, subframe,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK, ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb, ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb,
...@@ -1370,7 +1370,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1370,7 +1370,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
#endif #endif
if (ulsch_eNB[UE_id]->Msg3_active == 1) { if (ulsch_eNB[UE_id]->Msg3_active == 1) {
LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n", LOG_D(PHY,"[eNB %d][PUSCH %d][RAPROC] Frame %d, subframe %d: Generating Msg3 PHICH for UE %d, ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d\n",
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe, phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe,
UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK, UE_id,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb); ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb);
} }
...@@ -1399,7 +1399,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1399,7 +1399,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
(ulsch_eNB[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ){ (ulsch_eNB[UE_id]->harq_processes[harq_pid]->rar_alloc == 0) ){
if (ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ){ if (ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK==0 ){
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH ACK / (no format0 DCI) Setting subframe_scheduling_flag\n", LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d, subframe %d : PHICH ACK / (no format0 DCI) Setting subframe_scheduling_flag\n",
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe); phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1; ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
// ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0; // ulsch_eNB[UE_id]->harq_processes[harq_pid]->Ndi = 0;
// ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures // ulsch_eNB[UE_id]->harq_processes[harq_pid]->round++; //this is already done in phy_procedures
...@@ -1407,7 +1407,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1407,7 +1407,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
} }
else { else {
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n", LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d PHICH ACK (no format0 DCI) Clearing subframe_scheduling_flag, setting round to 0\n",
phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe); phy_vars_eNB->Mod_id,harq_pid,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0; ulsch_eNB[UE_id]->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ulsch_eNB[UE_id]->harq_processes[harq_pid]->round=0; ulsch_eNB[UE_id]->harq_processes[harq_pid]->round=0;
} }
......
...@@ -224,10 +224,10 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN ...@@ -224,10 +224,10 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
} }
} }
void generate_mch(PHY_VARS_eNB *phy_vars_eNB,int subframe,uint8_t *a,int abstraction_flag) { void generate_mch(PHY_VARS_eNB *phy_vars_eNB,int sched_subframe,uint8_t *a,int abstraction_flag) {
int G; int G;
int subframe_sched = (subframe==0) ? 9 : (subframe-1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
if (abstraction_flag != 0) { if (abstraction_flag != 0) {
if (eNB_transport_info_TB_index[phy_vars_eNB->Mod_id]!=0) if (eNB_transport_info_TB_index[phy_vars_eNB->Mod_id]!=0)
...@@ -249,7 +249,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN ...@@ -249,7 +249,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
phy_vars_eNB->lte_frame_parms.N_RB_DL, phy_vars_eNB->lte_frame_parms.N_RB_DL,
phy_vars_eNB->dlsch_eNB_MCH->rb_alloc, phy_vars_eNB->dlsch_eNB_MCH->rb_alloc,
get_Qm(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->mcs),1, get_Qm(phy_vars_eNB->dlsch_eNB_MCH->harq_processes[0]->mcs),1,
2,phy_vars_eNB->proc[subframe_sched].frame_tx,subframe); 2,phy_vars_eNB->proc[sched_subframe].frame_tx,subframe);
generate_mbsfn_pilot(phy_vars_eNB, generate_mbsfn_pilot(phy_vars_eNB,
phy_vars_eNB->lte_eNB_common_vars.txdataF[0], phy_vars_eNB->lte_eNB_common_vars.txdataF[0],
...@@ -260,7 +260,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN ...@@ -260,7 +260,7 @@ void fill_UE_dlsch_MCH(PHY_VARS_UE *phy_vars_ue,int mcs,int ndi,int rvidx,int eN
&phy_vars_eNB->lte_frame_parms, &phy_vars_eNB->lte_frame_parms,
1, 1,
phy_vars_eNB->dlsch_eNB_MCH, phy_vars_eNB->dlsch_eNB_MCH,
phy_vars_eNB->proc[subframe_sched].frame_tx, phy_vars_eNB->proc[sched_subframe].frame_tx,
subframe, subframe,
&phy_vars_eNB->dlsch_rate_matching_stats, &phy_vars_eNB->dlsch_rate_matching_stats,
&phy_vars_eNB->dlsch_turbo_encoding_stats, &phy_vars_eNB->dlsch_turbo_encoding_stats,
......
...@@ -254,7 +254,7 @@ int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t su ...@@ -254,7 +254,7 @@ int is_prach_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t su
uint8_t t1_ra; uint8_t t1_ra;
uint8_t t2_ra; uint8_t t2_ra;
// printf("In is_prach_subframe ..., prach_ConfigIndex %d\n",prach_ConfigIndex);
if (frame_parms->frame_type == FDD) { //FDD if (frame_parms->frame_type == FDD) { //FDD
//implement Table 5.7.1-2 from 36.211 (Rel-10, p.41) //implement Table 5.7.1-2 from 36.211 (Rel-10, p.41)
if ((((frame&1) == 1) && (subframe < 9)) || if ((((frame&1) == 1) && (subframe < 9)) ||
......
...@@ -948,10 +948,10 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -948,10 +948,10 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
PUCCH_FMT_t fmt, PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel, uint8_t n1_pucch_sel,
uint8_t *payload, uint8_t *payload,
uint8_t subframe) { uint8_t sched_subframe) {
uint8_t UE_id; uint8_t UE_id;
uint16_t rnti; uint16_t rnti;
int subframe_sched = (subframe==0)?9:(subframe-1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
rnti = phy_vars_eNB->ulsch_eNB[UE_index]->rnti; rnti = phy_vars_eNB->ulsch_eNB[UE_index]->rnti;
for (UE_id=0;UE_id<NB_UE_INST;UE_id++) { for (UE_id=0;UE_id<NB_UE_INST;UE_id++) {
...@@ -974,7 +974,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -974,7 +974,7 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
payload[1] = PHY_vars_UE_g[UE_id]->pucch_payload[1]; payload[1] = PHY_vars_UE_g[UE_id]->pucch_payload[1];
} }
else else
LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",phy_vars_eNB->proc[subframe_sched].frame_rx); LOG_E(PHY,"[eNB] Frame %d: Can't handle formats 2/2a/2b\n",phy_vars_eNB->proc[sched_subframe].frame_rx);
if (PHY_vars_UE_g[UE_id]->pucch_sel[subframe] == n1_pucch_sel) if (PHY_vars_UE_g[UE_id]->pucch_sel[subframe] == n1_pucch_sel)
return(99); return(99);
......
...@@ -210,7 +210,7 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH) { ...@@ -210,7 +210,7 @@ uint8_t extract_cqi_crc(uint8_t *cqi,uint8_t CQI_LENGTH) {
unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
uint8_t UE_id, uint8_t UE_id,
uint8_t subframe, uint8_t sched_subframe,
uint8_t control_only_flag, uint8_t control_only_flag,
uint8_t Nbundled, uint8_t Nbundled,
uint8_t llr8_flag) { uint8_t llr8_flag) {
...@@ -249,7 +249,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -249,7 +249,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
int16_t cseq[6*14*1200]; int16_t cseq[6*14*1200];
int off; int off;
int status[20]; int status[20];
int subframe_sched = (subframe == 9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
uint8_t (*tc)(int16_t *y, uint8_t (*tc)(int16_t *y,
uint8_t *, uint8_t *,
...@@ -273,7 +273,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB, ...@@ -273,7 +273,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1 x2 = ((uint32_t)ulsch->rnti<<14) + ((uint32_t)subframe<<9) + frame_parms->Nid_cell; //this is c_init in 36.211 Sec 6.3.1
// harq_pid = (ulsch->RRCConnRequest_flag == 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0; // harq_pid = (ulsch->RRCConnRequest_flag == 0) ? subframe2harq_pid_tdd(frame_parms->tdd_config,subframe) : 0;
harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[subframe_sched].frame_rx,subframe); harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
if (harq_pid==255) { if (harq_pid==255) {
LOG_E(PHY, "ulsch_decoding.c: FATAL ERROR: illegal harq_pid, returning\n"); LOG_E(PHY, "ulsch_decoding.c: FATAL ERROR: illegal harq_pid, returning\n");
...@@ -1669,16 +1669,16 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb ...@@ -1669,16 +1669,16 @@ int ulsch_abstraction_MIESM(double* sinr_dB,uint8_t TM, uint8_t mcs,uint16_t nrb
#endif #endif
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB, uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe, uint8_t sched_subframe,
uint8_t UE_index, uint8_t UE_index,
uint16_t *crnti) { uint16_t *crnti) {
uint8_t UE_id; uint8_t UE_id;
uint16_t rnti; uint16_t rnti;
int subframe_sched = (subframe == 9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
uint8_t harq_pid; uint8_t harq_pid;
harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms,phy_vars_eNB->proc[subframe_sched].frame_rx,subframe); harq_pid = subframe2harq_pid(&phy_vars_eNB->lte_frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
rnti = phy_vars_eNB->ulsch_eNB[UE_index]->rnti; rnti = phy_vars_eNB->ulsch_eNB[UE_index]->rnti;
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
......
...@@ -1258,7 +1258,7 @@ int32_t ulsch_power_0[2],ulsch_power_1[2];// For the distributed Alamouti Scheme ...@@ -1258,7 +1258,7 @@ int32_t ulsch_power_0[2],ulsch_power_1[2];// For the distributed Alamouti Scheme
*/ */
void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
uint32_t subframe, uint32_t sched_subframe,
uint8_t eNB_id, // this is the effective sector id uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id, uint8_t UE_id,
LTE_eNB_ULSCH_t **ulsch, LTE_eNB_ULSCH_t **ulsch,
...@@ -1283,9 +1283,9 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1283,9 +1283,9 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Qm; uint8_t Qm;
uint16_t rx_power_correction; uint16_t rx_power_correction;
int16_t *llrp; int16_t *llrp;
int subframe_sched = (subframe == 9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[subframe_sched].frame_rx,subframe); harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
Qm = get_Qm_ul(ulsch[UE_id]->harq_processes[harq_pid]->mcs); Qm = get_Qm_ul(ulsch[UE_id]->harq_processes[harq_pid]->mcs);
#ifdef DEBUG_ULSCH #ifdef DEBUG_ULSCH
msg("rx_ulsch: eNB_id %d, harq_pid %d, nb_rb %d first_rb %d, cooperation %d\n",eNB_id,harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb, cooperation_flag); msg("rx_ulsch: eNB_id %d, harq_pid %d, nb_rb %d first_rb %d, cooperation %d\n",eNB_id,harq_pid,ulsch[UE_id]->harq_processes[harq_pid]->nb_rb,ulsch[UE_id]->harq_processes[harq_pid]->first_rb, cooperation_flag);
...@@ -1314,7 +1314,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1314,7 +1314,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
lte_ul_channel_estimation(phy_vars_eNB, lte_ul_channel_estimation(phy_vars_eNB,
eNB_id, eNB_id,
UE_id, UE_id,
subframe, sched_subframe,
l%(frame_parms->symbols_per_tti/2), l%(frame_parms->symbols_per_tti/2),
l/(frame_parms->symbols_per_tti/2), l/(frame_parms->symbols_per_tti/2),
cooperation_flag); cooperation_flag);
...@@ -1556,13 +1556,13 @@ void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB, ...@@ -1556,13 +1556,13 @@ void rx_ulsch_emul(PHY_VARS_eNB *phy_vars_eNB,
} }
void dump_ulsch(PHY_VARS_eNB *PHY_vars_eNB,uint8_t subframe, uint8_t UE_id) { void dump_ulsch(PHY_VARS_eNB *PHY_vars_eNB,uint8_t sched_subframe, uint8_t UE_id) {
uint32_t nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12; uint32_t nsymb = (PHY_vars_eNB->lte_frame_parms.Ncp == 0) ? 14 : 12;
uint8_t harq_pid; uint8_t harq_pid;
int subframe_sched = (subframe==9)?0 : (subframe+1); int subframe = PHY_vars_eNB->proc[sched_subframe].subframe_rx;
harq_pid = subframe2harq_pid(&PHY_vars_eNB->lte_frame_parms,PHY_vars_eNB->proc[subframe_sched].frame_rx,subframe); harq_pid = subframe2harq_pid(&PHY_vars_eNB->lte_frame_parms,PHY_vars_eNB->proc[sched_subframe].frame_rx,subframe);
printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d\n", subframe,harq_pid,PHY_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb,PHY_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->mcs,get_Qm_ul(PHY_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->mcs),PHY_vars_eNB->ulsch_eNB[UE_id]->Nsymb_pusch); printf("Dumping ULSCH in subframe %d with harq_pid %d, for NB_rb %d, mcs %d, Qm %d, N_symb %d\n", subframe,harq_pid,PHY_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->nb_rb,PHY_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->mcs,get_Qm_ul(PHY_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->mcs),PHY_vars_eNB->ulsch_eNB[UE_id]->Nsymb_pusch);
#ifndef OAI_EMU #ifndef OAI_EMU
......
...@@ -138,18 +138,34 @@ enum transmission_access_mode{ ...@@ -138,18 +138,34 @@ enum transmission_access_mode{
}ral_threshold_phy_t; }ral_threshold_phy_t;
#endif #endif
/// Context data structure for eNB subframe processing
typedef struct { typedef struct {
/// subframe index
int subframe;
/// subframe to act upon for transmission
int subframe_tx;
/// subframe to act upon for reception
int subframe_rx;
/// frame to act upon for transmission
int frame_tx;
/// frame to act upon for reception
int frame_rx;
/// instance count for tx processing thread
int instance_cnt_tx; int instance_cnt_tx;
/// instance count for rx processing thread
int instance_cnt_rx; int instance_cnt_rx;
/// pthread structure for tx processing thread
pthread_t pthread_tx; pthread_t pthread_tx;
/// pthread structure for rx processing thread
pthread_t pthread_rx; pthread_t pthread_rx;
/// condition variable for tx processing thread
pthread_cond_t cond_tx; pthread_cond_t cond_tx;
/// condition variable for rx processing thread
pthread_cond_t cond_rx; pthread_cond_t cond_rx;
/// mutex for tx processing thread
pthread_mutex_t mutex_tx; pthread_mutex_t mutex_tx;
/// mutex for tx processing thread
pthread_mutex_t mutex_rx; pthread_mutex_t mutex_rx;
int subframe;
int frame_rx;
int frame_tx;
} eNB_proc_t; } eNB_proc_t;
/// Top-level PHY Data Structure for eNB /// Top-level PHY Data Structure for eNB
......
...@@ -258,7 +258,7 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig ...@@ -258,7 +258,7 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig
return(4); // To be updated return(4); // To be updated
} }
else { else {
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n", LOG_E(PHY,"phy_procedures_lte_common.c/ul_ACK_subframe2_dl_subframe: illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config); subframe,frame_parms->tdd_config);
return(0); return(0);
} }
......
...@@ -423,10 +423,11 @@ void phy_procedures_emos_eNB_TX(unsigned char next_slot, PHY_VARS_eNB *phy_vars_ ...@@ -423,10 +423,11 @@ void phy_procedures_emos_eNB_TX(unsigned char next_slot, PHY_VARS_eNB *phy_vars_
} }
*/ */
void phy_procedures_eNB_S_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) { void phy_procedures_eNB_S_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) {
// unsigned char sect_id=0; // unsigned char sect_id=0;
int subframe = phy_vars_eNB->proc[subframe].subframe_rx;
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[subframe].frame_rx, subframe); LOG_D(PHY,"[eNB %d] Frame %d: Doing phy_procedures_eNB_S_RX(%d)\n", phy_vars_eNB->Mod_id,phy_vars_eNB->proc[subframe].frame_rx, subframe);
#endif #endif
...@@ -502,7 +503,7 @@ void phy_procedures_emos_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eN ...@@ -502,7 +503,7 @@ void phy_procedures_emos_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eN
#endif #endif
#ifndef OPENAIR2 #ifndef OPENAIR2
void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) { void fill_dci(DCI_PDU *DCI_pdu, uint8_t sched_subframe, PHY_VARS_eNB *phy_vars_eNB) {
int i; int i;
uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag; uint8_t cooperation_flag = phy_vars_eNB->cooperation_flag;
...@@ -510,7 +511,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) { ...@@ -510,7 +511,7 @@ void fill_dci(DCI_PDU *DCI_pdu, uint8_t subframe, PHY_VARS_eNB *phy_vars_eNB) {
uint32_t rballoc = 0x7FFF; uint32_t rballoc = 0x7FFF;
uint32_t rballoc2 = 0x000F; uint32_t rballoc2 = 0x000F;
int sched_subframe = (subframe == 0) ? 9 : (subframe-1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
/* /*
uint32_t rand = taus(); uint32_t rand = taus();
if ((subframe==8) || (subframe==9) || (subframe==0)) if ((subframe==8) || (subframe==9) || (subframe==0))
...@@ -1005,7 +1006,7 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol ...@@ -1005,7 +1006,7 @@ void phy_eNB_lte_check_measurement_thresholds(instance_t instanceP, ral_threshol
void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag, void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,
relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) { relaying_type_t r_type,PHY_VARS_RN *phy_vars_rn) {
uint8_t *pbch_pdu=&phy_vars_eNB->pbch_pdu[0]; uint8_t *pbch_pdu=&phy_vars_eNB->pbch_pdu[0];
// unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0; // unsigned int nb_dci_ue_spec = 0, nb_dci_common = 0;
...@@ -1036,7 +1037,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -1036,7 +1037,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
// there is at least one allocation for PDCCH // there is at least one allocation for PDCCH
uint8_t smbv_alloc_cnt = 1; uint8_t smbv_alloc_cnt = 1;
#endif #endif
int sched_subframe = (subframe==0)?9:(subframe-1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_TX,1);
start_meas(&phy_vars_eNB->phy_proc_tx); start_meas(&phy_vars_eNB->phy_proc_tx);
...@@ -1125,7 +1126,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -1125,7 +1126,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
if (mch_pduP){ if (mch_pduP){
fill_eNB_dlsch_MCH(phy_vars_eNB,mch_pduP->mcs,1,0, abstraction_flag); fill_eNB_dlsch_MCH(phy_vars_eNB,mch_pduP->mcs,1,0, abstraction_flag);
// Generate PMCH // Generate PMCH
generate_mch(phy_vars_eNB,subframe,(uint8_t*)mch_pduP->payload,abstraction_flag); generate_mch(phy_vars_eNB,sched_subframe,(uint8_t*)mch_pduP->payload,abstraction_flag);
#ifdef DEBUG_PHY #ifdef DEBUG_PHY
for (i=0;i<mch_pduP->Pdu_size;i++) for (i=0;i<mch_pduP->Pdu_size;i++)
msg("%2x.",(uint8_t)mch_pduP->payload[i]); msg("%2x.",(uint8_t)mch_pduP->payload[i]);
...@@ -1614,7 +1615,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -1614,7 +1615,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
//LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti); //LOG_D(PHY,"[eNB] cba generate_eNB_ulsch_params_from_dci for ue %d for dci rnti %x\n", UE_id, DCI_pdu->dci_alloc[i].rnti);
generate_eNB_ulsch_params_from_dci(&DCI_pdu->dci_alloc[i].dci_pdu[0], generate_eNB_ulsch_params_from_dci(&DCI_pdu->dci_alloc[i].dci_pdu[0],
DCI_pdu->dci_alloc[i].rnti, DCI_pdu->dci_alloc[i].rnti,
(subframe), sched_subframe,
format0, format0,
UE_id, UE_id,
phy_vars_eNB, phy_vars_eNB,
...@@ -2072,7 +2073,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2072,7 +2073,7 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
#endif #endif
// for (sect_id=0;sect_id<number_of_cards;sect_id++) { // for (sect_id=0;sect_id<number_of_cards;sect_id++) {
generate_phich_top(phy_vars_eNB, generate_phich_top(phy_vars_eNB,
subframe, sched_subframe,
AMP, AMP,
0, 0,
abstraction_flag); abstraction_flag);
...@@ -2090,10 +2091,10 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2090,10 +2091,10 @@ void phy_procedures_eNB_TX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
} }
void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint8_t UE_id, uint8_t harq_pid) { void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t UE_id, uint8_t harq_pid) {
// this prepares the demodulation of the first PUSCH of a new user, containing Msg3 // this prepares the demodulation of the first PUSCH of a new user, containing Msg3
int sched_subframe = (subframe==9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
LOG_D(PHY,"[eNB %d][RAPROC] frame %d : subframe %d : process_Msg3 UE_id %d (active %d, subframe %d, frame %d)\n", LOG_D(PHY,"[eNB %d][RAPROC] frame %d : subframe %d : process_Msg3 UE_id %d (active %d, subframe %d, frame %d)\n",
...@@ -2126,7 +2127,7 @@ void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint8_t UE_id, uin ...@@ -2126,7 +2127,7 @@ void process_Msg3(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint8_t UE_id, uin
// rate-adaptation based on the error statistics derived from the ACK/NAK process // rate-adaptation based on the error statistics derived from the ACK/NAK process
void process_HARQ_feedback(uint8_t UE_id, void process_HARQ_feedback(uint8_t UE_id,
uint8_t subframe, uint8_t sched_subframe,
PHY_VARS_eNB *phy_vars_eNB, PHY_VARS_eNB *phy_vars_eNB,
uint8_t pusch_flag, uint8_t pusch_flag,
uint8_t *pucch_payload, uint8_t *pucch_payload,
...@@ -2140,7 +2141,8 @@ void process_HARQ_feedback(uint8_t UE_id, ...@@ -2140,7 +2141,8 @@ void process_HARQ_feedback(uint8_t UE_id,
uint8_t subframe_m4,M,m; uint8_t subframe_m4,M,m;
int mp; int mp;
int all_ACKed=1,nb_alloc=0,nb_ACK=0; int all_ACKed=1,nb_alloc=0,nb_ACK=0;
int frame = phy_vars_eNB->proc[subframe].frame_rx; int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
if (phy_vars_eNB->lte_frame_parms.frame_type == 0){ //FDD if (phy_vars_eNB->lte_frame_parms.frame_type == 0){ //FDD
subframe_m4 = (subframe<4) ? subframe+6 : subframe-4; subframe_m4 = (subframe<4) ? subframe+6 : subframe-4;
...@@ -2507,21 +2509,21 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB, ...@@ -2507,21 +2509,21 @@ void get_n1_pucch_eNB(PHY_VARS_eNB *phy_vars_eNB,
} }
void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t subframe,uint8_t abstraction_flag) { void prach_procedures(PHY_VARS_eNB *phy_vars_eNB,uint8_t sched_subframe,uint8_t abstraction_flag) {
uint16_t preamble_energy_list[64],preamble_delay_list[64]; uint16_t preamble_energy_list[64],preamble_delay_list[64];
uint16_t preamble_max,preamble_energy_max; uint16_t preamble_max,preamble_energy_max;
uint16_t i; uint16_t i;
int8_t UE_id; int8_t UE_id;
int sched_subframe = (subframe == 9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
memset(&preamble_energy_list[0],0,64*sizeof(uint16_t)); memset(&preamble_energy_list[0],0,64*sizeof(uint16_t));
memset(&preamble_delay_list[0],0,64*sizeof(uint16_t)); memset(&preamble_delay_list[0],0,64*sizeof(uint16_t));
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
/* LOG_I(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id, LOG_I(PHY,"[eNB %d][RAPROC] Frame %d, Subframe %d : PRACH RX Signal Power : %d dBm\n",phy_vars_eNB->Mod_id,
frame,subframe,dB_fixed(signal_energy(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],512)) - phy_vars_eNB->rx_total_gain_eNB_dB); frame,subframe,dB_fixed(signal_energy(&phy_vars_eNB->lte_eNB_common_vars.rxdata[0][0][subframe*phy_vars_eNB->lte_frame_parms.samples_per_tti],512)) - phy_vars_eNB->rx_total_gain_eNB_dB);
*/
// LOG_I(PHY,"[eNB %d][RAPROC] PRACH: rootSequenceIndex %d, prach_ConfigIndex %d, zeroCorrelationZoneConfig %d, highSpeedFlag %d, prach_FreqOffset %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset); // LOG_I(PHY,"[eNB %d][RAPROC] PRACH: rootSequenceIndex %d, prach_ConfigIndex %d, zeroCorrelationZoneConfig %d, highSpeedFlag %d, prach_FreqOffset %d\n",phy_vars_eNB->Mod_id,phy_vars_eNB->lte_frame_parms.prach_config_common.rootSequenceIndex,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_ConfigIndex, phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.zeroCorrelationZoneConfig,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.highSpeedFlag,phy_vars_eNB->lte_frame_parms.prach_config_common.prach_ConfigInfo.prach_FreqOffset);
rx_prach(phy_vars_eNB, rx_prach(phy_vars_eNB,
...@@ -2598,7 +2600,7 @@ void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_ ...@@ -2598,7 +2600,7 @@ void ulsch_decoding_procedures(unsigned char subframe, unsigned int i, PHY_VARS_
} }
void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) { void phy_procedures_eNB_RX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_eNB,uint8_t abstraction_flag,relaying_type_t r_type) {
//RX processing //RX processing
uint32_t l, ret=0,i,j; uint32_t l, ret=0,i,j;
uint32_t sect_id=0; uint32_t sect_id=0;
...@@ -2618,7 +2620,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2618,7 +2620,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
uint16_t rnti=0; uint16_t rnti=0;
uint8_t access_mode; uint8_t access_mode;
int num_active_cba_groups; int num_active_cba_groups;
int sched_subframe = (subframe == 9) ? 0 : (subframe+1); int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
int frame = phy_vars_eNB->proc[sched_subframe].frame_rx; int frame = phy_vars_eNB->proc[sched_subframe].frame_rx;
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_ENB_RX,1);
...@@ -2634,7 +2636,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2634,7 +2636,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
// check if we have to detect PRACH first // check if we have to detect PRACH first
if (is_prach_subframe(&phy_vars_eNB->lte_frame_parms,frame,subframe)>0) { if (is_prach_subframe(&phy_vars_eNB->lte_frame_parms,frame,subframe)>0) {
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,1);
prach_procedures(phy_vars_eNB,subframe,abstraction_flag); prach_procedures(phy_vars_eNB,sched_subframe,abstraction_flag);
vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0); vcd_signal_dumper_dump_function_by_name(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_PRACH_RX,0);
} }
...@@ -2744,7 +2746,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2744,7 +2746,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
*/ */
#ifdef OPENAIR2 #ifdef OPENAIR2
if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE) if (phy_vars_eNB->eNB_UE_stats[i].mode == RA_RESPONSE)
process_Msg3(phy_vars_eNB,subframe,i,harq_pid); process_Msg3(phy_vars_eNB,sched_subframe,i,harq_pid);
#endif #endif
/* /*
...@@ -2827,7 +2829,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2827,7 +2829,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
start_meas(&phy_vars_eNB->ulsch_demodulation_stats); start_meas(&phy_vars_eNB->ulsch_demodulation_stats);
if (abstraction_flag==0) { if (abstraction_flag==0) {
rx_ulsch(phy_vars_eNB, rx_ulsch(phy_vars_eNB,
subframe, sched_subframe,
phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id
i, i,
phy_vars_eNB->ulsch_eNB, phy_vars_eNB->ulsch_eNB,
...@@ -2851,7 +2853,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2851,7 +2853,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
ret = ulsch_decoding(phy_vars_eNB, ret = ulsch_decoding(phy_vars_eNB,
i, i,
subframe, sched_subframe,
0, // control_only_flag 0, // control_only_flag
0, //Nbundled, to be updated!!!! 0, //Nbundled, to be updated!!!!
0); 0);
...@@ -2859,7 +2861,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2859,7 +2861,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
ret = ulsch_decoding_emul(phy_vars_eNB, ret = ulsch_decoding_emul(phy_vars_eNB,
subframe, sched_subframe,
i, i,
&rnti); &rnti);
} }
...@@ -2934,7 +2936,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2934,7 +2936,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round++;
LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round); LOG_D(PHY,"[eNB][PUSCH %d] Increasing to round %d\n",harq_pid,phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round);
// dump_ulsch(phy_vars_eNB, subframe, i); // dump_ulsch(phy_vars_eNB, sched_subframe, i);
// exit(-1); // exit(-1);
if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) { if (phy_vars_eNB->ulsch_eNB[i]->Msg3_flag == 1) {
...@@ -2974,7 +2976,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2974,7 +2976,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++) for (j=0;j<phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->TBS>>3;j++)
printf("%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]); printf("%x.",phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->c[0][j]);
printf("\n"); printf("\n");
dump_ulsch(phy_vars_eNB,subframe,i);*/ dump_ulsch(phy_vars_eNB,sched_subframe,i);*/
//#ifndef EXMIMO_IOT //#ifndef EXMIMO_IOT
LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error\n", frame,subframe); LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error\n", frame,subframe);
//#else //#else
...@@ -2999,7 +3001,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -2999,7 +3001,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
} }
// dump_ulsch(phy_vars_eNB,subframe,i); // dump_ulsch(phy_vars_eNB,sched_subframe,i);
if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mdlharq) { if (phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->round== phy_vars_eNB->ulsch_eNB[i]->Mdlharq) {
LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mdlharq %d reached\n", LOG_I(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d ULSCH Mdlharq %d reached\n",
...@@ -3011,7 +3013,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3011,7 +3013,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0; phy_vars_eNB->ulsch_eNB[i]->harq_processes[harq_pid]->phich_active=0;
phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++; phy_vars_eNB->eNB_UE_stats[i].ulsch_errors[harq_pid]++;
phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors[harq_pid]++; phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors[harq_pid]++;
//dump_ulsch(phy_vars_eNB, subframe, i); //dump_ulsch(phy_vars_eNB, sched_subframe, i);
} }
// If we've dropped the UE, go back to PRACH mode for this UE // If we've dropped the UE, go back to PRACH mode for this UE
...@@ -3087,7 +3089,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3087,7 +3089,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
LOG_T(PHY,"\n"); LOG_T(PHY,"\n");
#endif #endif
#endif #endif
//dump_ulsch(phy_vars_eNB,subframe,i); //dump_ulsch(phy_vars_eNB,sched_subframe,i);
#ifdef OPENAIR2 #ifdef OPENAIR2
...@@ -3109,7 +3111,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3109,7 +3111,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
// estimate timing advance for MAC // estimate timing advance for MAC
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
sync_pos = lte_est_timing_advance_pusch(phy_vars_eNB,i,subframe); sync_pos = lte_est_timing_advance_pusch(phy_vars_eNB,i,sched_subframe);
phy_vars_eNB->eNB_UE_stats[i].timing_advance_update = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/8; //to check phy_vars_eNB->eNB_UE_stats[i].timing_advance_update = sync_pos - phy_vars_eNB->lte_frame_parms.nb_prefix_samples/8; //to check
} }
...@@ -3132,7 +3134,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3132,7 +3134,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
i); i);
#endif #endif
process_HARQ_feedback(i, process_HARQ_feedback(i,
subframe, sched_subframe,
phy_vars_eNB, phy_vars_eNB,
1, // pusch_flag 1, // pusch_flag
0, 0,
...@@ -3220,7 +3222,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3220,7 +3222,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
pucch_format1, pucch_format1,
0, 0,
&SR_payload, &SR_payload,
subframe); sched_subframe);
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id, LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR (UE SR %d/%d)\n",phy_vars_eNB->Mod_id,
phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex); phy_vars_eNB->ulsch_eNB[i]->rnti,frame,subframe,SR_payload,phy_vars_eNB->scheduling_request_config[i].sr_PUCCH_ResourceIndex);
} }
...@@ -3277,7 +3279,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3277,7 +3279,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
pucch_payload0[0],metric0); pucch_payload0[0],metric0);
#endif #endif
process_HARQ_feedback(i,subframe,phy_vars_eNB, process_HARQ_feedback(i,sched_subframe,phy_vars_eNB,
0,// pusch_flag 0,// pusch_flag
pucch_payload0, pucch_payload0,
2, 2,
...@@ -3410,7 +3412,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3410,7 +3412,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
frame,subframe, frame,subframe,
metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]); metric0,metric1,pucch_sel,pucch_payload[0],pucch_payload[1]);
#endif #endif
process_HARQ_feedback(i,subframe,phy_vars_eNB, process_HARQ_feedback(i,sched_subframe,phy_vars_eNB,
0,// pusch_flag 0,// pusch_flag
pucch_payload, pucch_payload,
pucch_sel, pucch_sel,
...@@ -3448,7 +3450,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3448,7 +3450,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
#endif #endif
if (abstraction_flag==0) { if (abstraction_flag==0) {
rx_ulsch(phy_vars_eNB, rx_ulsch(phy_vars_eNB,
subframe, sched_subframe,
phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id phy_vars_eNB->eNB_UE_stats[i].sector, // this is the effective sector id
i, i,
phy_vars_eNB->ulsch_eNB, phy_vars_eNB->ulsch_eNB,
...@@ -3466,7 +3468,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3466,7 +3468,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
if (abstraction_flag == 0) { if (abstraction_flag == 0) {
ret = ulsch_decoding(phy_vars_eNB, ret = ulsch_decoding(phy_vars_eNB,
i, i,
subframe, sched_subframe,
0, // control_only_flag 0, // control_only_flag
0, //Nbundled, to be updated!!!! 0, //Nbundled, to be updated!!!!
0); 0);
...@@ -3474,7 +3476,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3474,7 +3476,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
else { else {
ret = ulsch_decoding_emul(phy_vars_eNB, ret = ulsch_decoding_emul(phy_vars_eNB,
subframe, sched_subframe,
i, i,
&rnti); &rnti);
} }
...@@ -3500,7 +3502,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin ...@@ -3500,7 +3502,7 @@ void phy_procedures_eNB_RX(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,uin
(phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->cba_rnti[i%num_active_cba_groups] > 0 ) && (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->cba_rnti[i%num_active_cba_groups] > 0 ) &&
(phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->num_active_cba_groups> 0)) { (phy_vars_eNB->ulsch_eNB[i+num_active_cba_groups]->num_active_cba_groups> 0)) {
#ifdef DEBUG_PHY_PROC #ifdef DEBUG_PHY_PROC
LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the sched_subframeuling_flag for Ue %d cba groups %d members\n", LOG_D(PHY,"[eNB %d][PUSCH %d] frame %d subframe %d UE %d harq_pid %d resetting the subframe_scheduling_flag for Ue %d cba groups %d members\n",
phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid, phy_vars_eNB->Mod_id,harq_pid,frame,subframe,i,harq_pid,
i+num_active_cba_groups, i%phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups); i+num_active_cba_groups, i%phy_vars_eNB->ulsch_eNB[i]->num_active_cba_groups);
#endif #endif
...@@ -3625,11 +3627,6 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,ui ...@@ -3625,11 +3627,6 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,ui
int result; int result;
#endif #endif
int subframe_rx,subframe_tx;
subframe_rx = (subframe == 0) ? 9 : (subframe-1);
subframe_tx = (subframe == 9) ? 0 : (subframe+1);
/* /*
if (phy_vars_eNB->proc[sched_subframe].frame_tx >= 1000) if (phy_vars_eNB->proc[sched_subframe].frame_tx >= 1000)
mac_xface->macphy_exit("Exiting after 1000 Frames\n"); mac_xface->macphy_exit("Exiting after 1000 Frames\n");
...@@ -3774,25 +3771,27 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,ui ...@@ -3774,25 +3771,27 @@ void phy_procedures_eNB_lte(unsigned char subframe,PHY_VARS_eNB *phy_vars_eNB,ui
} while(msg_p != NULL); } while(msg_p != NULL);
#endif #endif
if ((((phy_vars_eNB->lte_frame_parms.frame_type == TDD)&&(subframe_select(&phy_vars_eNB->lte_frame_parms,subframe_tx)==SF_DL))|| if ((((phy_vars_eNB->lte_frame_parms.frame_type == TDD)&&
(subframe_select(&phy_vars_eNB->lte_frame_parms,phy_vars_eNB->proc[subframe].subframe_tx)==SF_DL))||
(phy_vars_eNB->lte_frame_parms.frame_type == FDD))) { (phy_vars_eNB->lte_frame_parms.frame_type == FDD))) {
#ifdef Rel10 #ifdef Rel10
if (phy_procedures_RN_eNB_TX(subframe_rx, subframe_tx, r_type) != 0 ) if (phy_procedures_RN_eNB_TX(phy_vars_eNB->proc[subframe].subframe_rx, phy_vars_eNB->proc[subframe].subframe_tx, r_type) != 0 )
#endif #endif
phy_procedures_eNB_TX(subframe_tx,phy_vars_eNB,abstraction_flag,r_type,phy_vars_rn); phy_procedures_eNB_TX(subframe,phy_vars_eNB,abstraction_flag,r_type,phy_vars_rn);
} }
if ((((phy_vars_eNB->lte_frame_parms.frame_type == TDD )&&(subframe_select(&phy_vars_eNB->lte_frame_parms,subframe_rx)==SF_UL)) || if ((((phy_vars_eNB->lte_frame_parms.frame_type == TDD )&&
(subframe_select(&phy_vars_eNB->lte_frame_parms,phy_vars_eNB->proc[subframe].subframe_rx)==SF_UL)) ||
(phy_vars_eNB->lte_frame_parms.frame_type == FDD))){ (phy_vars_eNB->lte_frame_parms.frame_type == FDD))){
phy_procedures_eNB_RX(subframe_rx,phy_vars_eNB,abstraction_flag,r_type); phy_procedures_eNB_RX(subframe,phy_vars_eNB,abstraction_flag,r_type);
} }
if (subframe_select(&phy_vars_eNB->lte_frame_parms,subframe_tx)==SF_S) { if (subframe_select(&phy_vars_eNB->lte_frame_parms,phy_vars_eNB->proc[subframe].subframe_tx)==SF_S) {
#ifdef Rel10 #ifdef Rel10
if (phy_procedures_RN_eNB_TX(subframe_rx, subframe_tx, r_type) != 0 ) if (phy_procedures_RN_eNB_TX(subframe, subframe, r_type) != 0 )
#endif #endif
phy_procedures_eNB_TX(subframe_tx,phy_vars_eNB,abstraction_flag,r_type,phy_vars_rn); phy_procedures_eNB_TX(subframe,phy_vars_eNB,abstraction_flag,r_type,phy_vars_rn);
} }
if ((subframe_select(&phy_vars_eNB->lte_frame_parms,subframe_rx)==SF_S)){ if ((subframe_select(&phy_vars_eNB->lte_frame_parms,phy_vars_eNB->proc[subframe].subframe_rx)==SF_S)){
phy_procedures_eNB_S_RX(subframe_rx,phy_vars_eNB,abstraction_flag,r_type); phy_procedures_eNB_S_RX(subframe,phy_vars_eNB,abstraction_flag,r_type);
} }
......
...@@ -71,6 +71,7 @@ uint8_t alpha_lut[8] = {0,40,50,60,70,80,90,100}; ...@@ -71,6 +71,7 @@ uint8_t alpha_lut[8] = {0,40,50,60,70,80,90,100};
void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag) { void pusch_power_cntl(PHY_VARS_UE *phy_vars_ue,uint8_t subframe,uint8_t eNB_id,uint8_t j, uint8_t abstraction_flag) {
uint8_t harq_pid = subframe2harq_pid(&phy_vars_ue->lte_frame_parms, uint8_t harq_pid = subframe2harq_pid(&phy_vars_ue->lte_frame_parms,
((subframe==0)?1:0) + phy_vars_ue->frame, ((subframe==0)?1:0) + phy_vars_ue->frame,
subframe); subframe);
......
...@@ -807,6 +807,9 @@ int main(int argc, char **argv) { ...@@ -807,6 +807,9 @@ int main(int argc, char **argv) {
PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0); PHY_vars_UE->ulsch_ue[0] = new_ue_ulsch(8,N_RB_DL,0);
PHY_vars_eNB->proc[subframe].frame_tx = 0;
PHY_vars_eNB->proc[subframe].subframe_tx = subframe;
if (input_fd==NULL) { if (input_fd==NULL) {
msg("No input file, so starting TX\n"); msg("No input file, so starting TX\n");
} }
...@@ -947,7 +950,7 @@ int main(int argc, char **argv) { ...@@ -947,7 +950,7 @@ int main(int argc, char **argv) {
if (n_frames==1) if (n_frames==1)
printf("generating PHICH\n"); printf("generating PHICH\n");
harq_pid = phich_subframe_to_harq_pid(&PHY_vars_eNB->lte_frame_parms, PHY_vars_eNB->proc[(subframe+9)%10].frame_tx, subframe); harq_pid = phich_subframe_to_harq_pid(&PHY_vars_eNB->lte_frame_parms, PHY_vars_eNB->proc[subframe].frame_tx, subframe);
phich_ACK = taus()&1; phich_ACK = taus()&1;
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->phich_active = 1; PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->phich_active = 1;
......
...@@ -27,7 +27,6 @@ int current_dlsch_cqi; //FIXME! ...@@ -27,7 +27,6 @@ int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB; PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE; PHY_VARS_UE *PHY_vars_UE;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
......
...@@ -28,7 +28,6 @@ int current_dlsch_cqi; //FIXME! ...@@ -28,7 +28,6 @@ int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB; PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE; PHY_VARS_UE *PHY_vars_UE;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13 #define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
......
...@@ -728,16 +728,22 @@ int main(int argc, char **argv) { ...@@ -728,16 +728,22 @@ int main(int argc, char **argv) {
PHY_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0; PHY_vars_eNB->lte_frame_parms.pusch_config_common.ul_ReferenceSignalsPUSCH.groupAssignmentPUSCH = 0;
PHY_vars_UE->frame=1; PHY_vars_UE->frame=1;
for (sf=0;sf<10;sf++) PHY_vars_eNB->proc[sf].frame_tx=1; for (sf=0;sf<10;sf++) {
for (sf=0;sf<10;sf++) PHY_vars_eNB->proc[sf].frame_rx=1; PHY_vars_eNB->proc[sf].frame_tx=1;
PHY_vars_eNB->proc[0].frame_rx = 0; PHY_vars_eNB->proc[sf].subframe_tx=sf;
PHY_vars_eNB->proc[9].frame_tx = 2; PHY_vars_eNB->proc[sf].frame_rx=1;
PHY_vars_eNB->proc[sf].subframe_rx=sf;
}
msg("Init UL hopping UE\n"); msg("Init UL hopping UE\n");
init_ul_hopping(&PHY_vars_UE->lte_frame_parms); init_ul_hopping(&PHY_vars_UE->lte_frame_parms);
msg("Init UL hopping eNB\n"); msg("Init UL hopping eNB\n");
init_ul_hopping(&PHY_vars_eNB->lte_frame_parms); init_ul_hopping(&PHY_vars_eNB->lte_frame_parms);
PHY_vars_eNB->proc[subframe].frame_rx = PHY_vars_UE->frame;
if (ul_subframe2pdcch_alloc_subframe(&PHY_vars_eNB->lte_frame_parms,subframe) > subframe) // allocation was in previous frame
PHY_vars_eNB->proc[ul_subframe2pdcch_alloc_subframe(&PHY_vars_eNB->lte_frame_parms,subframe)].frame_tx = (PHY_vars_UE->frame-1)&1023;
generate_ue_ulsch_params_from_dci((void *)&UL_alloc_pdu, generate_ue_ulsch_params_from_dci((void *)&UL_alloc_pdu,
14, 14,
...@@ -805,13 +811,9 @@ int main(int argc, char **argv) { ...@@ -805,13 +811,9 @@ int main(int argc, char **argv) {
//randominit(0); //randominit(0);
if (subframe==0)
PHY_vars_eNB->proc[9].frame_rx = PHY_vars_UE->frame;
else
PHY_vars_eNB->proc[subframe-1].frame_rx = PHY_vars_UE->frame;
harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame,subframe); harq_pid = subframe2harq_pid(&PHY_vars_UE->lte_frame_parms,PHY_vars_UE->frame,subframe);
printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid); // printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
if (input_fdUL == NULL) { if (input_fdUL == NULL) {
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8; input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
input_buffer = (unsigned char *)malloc(input_buffer_length+4); input_buffer = (unsigned char *)malloc(input_buffer_length+4);
......
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