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,
}
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 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_
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];
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 Ns = 1; //we take the estimate from the second slot
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 +
//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);
......@@ -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;
#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
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
int32_t lte_ul_channel_estimation(PHY_VARS_eNB *phy_vars_eNB,
uint8_t eNB_id,
uint8_t UE_id,
uint8_t subframe,
uint8_t sched_subframe,
unsigned char l,
unsigned char Ns,
uint8_t cooperation_flag) {
......@@ -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_1= eNB_pusch_vars->drs_ch_estimates_1[eNB_id];
int32_t **rxdataF_ext= eNB_pusch_vars->rxdataF_ext[eNB_id];
int subframe_sched = (subframe == 9) ? 0 : (subframe+1);
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[subframe_sched].frame_rx,subframe);
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_rx;
uint8_t harq_pid = subframe2harq_pid(frame_parms,phy_vars_eNB->proc[sched_subframe].frame_rx,subframe);
int16_t delta_phase = 0;
int16_t *ru1 = ru_90;
int16_t *ru2 = ru_90;
......
......@@ -4482,7 +4482,7 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
uint16_t rnti,
uint8_t subframe,
uint8_t sched_subframe,
DCI_format_t dci_format,
uint8_t UE_id,
PHY_VARS_eNB *phy_vars_eNB,
......@@ -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;
LTE_eNB_ULSCH_t *ulsch=phy_vars_eNB->ulsch_eNB[UE_id];
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 dai = 0;
......@@ -4520,7 +4520,7 @@ int generate_eNB_ulsch_params_from_dci(void *dci_pdu,
harq_pid = subframe2harq_pid(frame_parms,
pdcch_alloc2ul_frame(frame_parms,
phy_vars_eNB->proc[subframe_sched].frame_tx,
phy_vars_eNB->proc[sched_subframe].frame_tx,
subframe),
pdcch_alloc2ul_subframe(frame_parms,subframe));
......@@ -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",
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,
}
void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
unsigned char subframe,
unsigned char sched_subframe,
int16_t amp,
uint8_t sect_id,
uint8_t abstraction_flag) {
......@@ -1328,7 +1328,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
uint8_t pusch_subframe;
uint8_t UE_id;
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
......@@ -1338,7 +1338,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
if (frame_parms->Ncp == 1)
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);
harq_pid = subframe2harq_pid(frame_parms,pusch_frame,pusch_subframe);
......@@ -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) {
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 +
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,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->n_DMRS)%(2*NSF_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",
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,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->phich_ACK,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb,
......@@ -1370,7 +1370,7 @@ void generate_phich_top(PHY_VARS_eNB *phy_vars_eNB,
#endif
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",
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,
ulsch_eNB[UE_id]->harq_processes[harq_pid]->first_rb);
}
......@@ -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) ){
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",
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]->Ndi = 0;
// 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,
}
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",
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]->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
}
}
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 subframe_sched = (subframe==0) ? 9 : (subframe-1);
int subframe = phy_vars_eNB->proc[sched_subframe].subframe_tx;
if (abstraction_flag != 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
phy_vars_eNB->lte_frame_parms.N_RB_DL,
phy_vars_eNB->dlsch_eNB_MCH->rb_alloc,
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,
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
&phy_vars_eNB->lte_frame_parms,
1,
phy_vars_eNB->dlsch_eNB_MCH,
phy_vars_eNB->proc[subframe_sched].frame_tx,
phy_vars_eNB->proc[sched_subframe].frame_tx,
subframe,
&phy_vars_eNB->dlsch_rate_matching_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
uint8_t t1_ra;
uint8_t t2_ra;
// printf("In is_prach_subframe ..., prach_ConfigIndex %d\n",prach_ConfigIndex);
if (frame_parms->frame_type == FDD) { //FDD
//implement Table 5.7.1-2 from 36.211 (Rel-10, p.41)
if ((((frame&1) == 1) && (subframe < 9)) ||
......
......@@ -948,10 +948,10 @@ int32_t rx_pucch_emul(PHY_VARS_eNB *phy_vars_eNB,
PUCCH_FMT_t fmt,
uint8_t n1_pucch_sel,
uint8_t *payload,
uint8_t subframe) {
uint8_t sched_subframe) {
uint8_t UE_id;
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;
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,
payload[1] = PHY_vars_UE_g[UE_id]->pucch_payload[1];
}
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)
return(99);
......
......@@ -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,
uint8_t UE_id,
uint8_t subframe,
uint8_t sched_subframe,
uint8_t control_only_flag,
uint8_t Nbundled,
uint8_t llr8_flag) {
......@@ -249,7 +249,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *phy_vars_eNB,
int16_t cseq[6*14*1200];
int off;
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 *,
......@@ -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
// 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) {
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
#endif
uint32_t ulsch_decoding_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t subframe,
uint8_t sched_subframe,
uint8_t UE_index,
uint16_t *crnti) {
uint8_t UE_id;
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;
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;
#ifdef DEBUG_PHY
......
......@@ -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,
uint32_t subframe,
uint32_t sched_subframe,
uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id,
LTE_eNB_ULSCH_t **ulsch,
......@@ -1283,9 +1283,9 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
uint8_t Qm;
uint16_t rx_power_correction;
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);
#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);
......@@ -1314,7 +1314,7 @@ void rx_ulsch(PHY_VARS_eNB *phy_vars_eNB,
lte_ul_channel_estimation(phy_vars_eNB,
eNB_id,
UE_id,
subframe,
sched_subframe,
l%(frame_parms->symbols_per_tti/2),
l/(frame_parms->symbols_per_tti/2),
cooperation_flag);
......@@ -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;
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);
#ifndef OAI_EMU
......
......@@ -138,18 +138,34 @@ enum transmission_access_mode{
}ral_threshold_phy_t;
#endif
/// Context data structure for eNB subframe processing
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;
/// instance count for rx processing thread
int instance_cnt_rx;
/// pthread structure for tx processing thread
pthread_t pthread_tx;
/// pthread structure for rx processing thread
pthread_t pthread_rx;
/// condition variable for tx processing thread
pthread_cond_t cond_tx;
/// condition variable for rx processing thread
pthread_cond_t cond_rx;
/// mutex for tx processing thread
pthread_mutex_t mutex_tx;
/// mutex for tx processing thread
pthread_mutex_t mutex_rx;
int subframe;
int frame_rx;
int frame_tx;
} eNB_proc_t;
/// 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
return(4); // To be updated
}
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);
return(0);
}
......
This diff is collapsed.
......@@ -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) {
uint8_t harq_pid = subframe2harq_pid(&phy_vars_ue->lte_frame_parms,
((subframe==0)?1:0) + phy_vars_ue->frame,
subframe);
......
......@@ -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_eNB->proc[subframe].frame_tx = 0;
PHY_vars_eNB->proc[subframe].subframe_tx = subframe;
if (input_fd==NULL) {
msg("No input file, so starting TX\n");
}
......@@ -947,7 +950,7 @@ int main(int argc, char **argv) {
if (n_frames==1)
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;
PHY_vars_eNB->ulsch_eNB[0]->harq_processes[harq_pid]->phich_active = 1;
......
......@@ -27,7 +27,6 @@ int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
......
......@@ -28,7 +28,6 @@ int current_dlsch_cqi; //FIXME!
PHY_VARS_eNB *PHY_vars_eNB;
PHY_VARS_UE *PHY_vars_UE;
DCI2_5MHz_2A_M10PRB_TDD_t DLSCH_alloc_pdu2;
#define DLSCH_RB_ALLOC 0x1fbf // igore DC component,RB13
......
......@@ -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_UE->frame=1;
for (sf=0;sf<10;sf++) PHY_vars_eNB->proc[sf].frame_tx=1;
for (sf=0;sf<10;sf++) PHY_vars_eNB->proc[sf].frame_rx=1;
PHY_vars_eNB->proc[0].frame_rx = 0;
PHY_vars_eNB->proc[9].frame_tx = 2;
for (sf=0;sf<10;sf++) {
PHY_vars_eNB->proc[sf].frame_tx=1;
PHY_vars_eNB->proc[sf].subframe_tx=sf;
PHY_vars_eNB->proc[sf].frame_rx=1;
PHY_vars_eNB->proc[sf].subframe_rx=sf;
}
msg("Init UL hopping UE\n");
init_ul_hopping(&PHY_vars_UE->lte_frame_parms);
msg("Init UL hopping eNB\n");
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,
14,
......@@ -805,13 +811,9 @@ int main(int argc, char **argv) {
//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);
printf("UL frame %d/subframe %d, harq_pid %d\n",PHY_vars_UE->frame,subframe,harq_pid);
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);
if (input_fdUL == NULL) {
input_buffer_length = PHY_vars_UE->ulsch_ue[0]->harq_processes[harq_pid]->TBS/8;
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