diff --git a/openair1/PHY/CODING/lte_segmentation.c b/openair1/PHY/CODING/lte_segmentation.c index 746344a6acb6e29e3c124e7b0cc81244de2ccd55..04056c4c9eb919e5bccfdb1ee05e72e2ea8003a7 100644 --- a/openair1/PHY/CODING/lte_segmentation.c +++ b/openair1/PHY/CODING/lte_segmentation.c @@ -60,7 +60,7 @@ int lte_segmentation(unsigned char *input_buffer, } if ((*C)>MAX_NUM_DLSCH_SEGMENTS) { - msg("lte_segmentation.c: too many segments %d\n",*C); + LOG_E(PHY,"lte_segmentation.c: too many segments %d, B %d, L %d, Bprime %d\n",*C,B,L,Bprime); return(-1); } diff --git a/openair1/PHY/LTE_TRANSPORT/dci.c b/openair1/PHY/LTE_TRANSPORT/dci.c index bd2f1623122798b702ea5d424874127740d34da8..38cfc2c8c9f2712e670eadbc1d6b9c569f7b8cfc 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci.c +++ b/openair1/PHY/LTE_TRANSPORT/dci.c @@ -3248,7 +3248,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, SI_RNTI, ra_rnti, P_RNTI, - 3, + 0, format1A, format1A, format1A, @@ -3277,7 +3277,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, SI_RNTI, ra_rnti, P_RNTI, - 2, + 1, format1A, format1A, format1A, @@ -3310,7 +3310,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, SI_RNTI, ra_rnti, P_RNTI, - 1, + 2, format1A, format1A, format1A, @@ -3339,7 +3339,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, SI_RNTI, ra_rnti, P_RNTI, - 0, + 3, format1A, format1A, format1A, diff --git a/openair1/PHY/LTE_TRANSPORT/dci_tools.c b/openair1/PHY/LTE_TRANSPORT/dci_tools.c index 107fa042a6892e99e5015cdc541c11a080b3681c..92836ebcf951e134f6998b86e2768c26dc535282 100644 --- a/openair1/PHY/LTE_TRANSPORT/dci_tools.c +++ b/openair1/PHY/LTE_TRANSPORT/dci_tools.c @@ -4456,6 +4456,7 @@ int generate_ue_dlsch_params_from_dci(int frame, dlsch0_harq->status = ACTIVE; dlsch0_harq->DCINdi = ndi; + dlsch[0]->harq_ack[subframe].send_harq_status = 1; if (dlsch0_harq->first_tx==1) { LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n"); dlsch0_harq->first_tx = 0; @@ -5556,7 +5557,7 @@ int generate_ue_dlsch_params_from_dci(int frame, #ifdef DEBUG_DCI if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) { - printf("dci_format:%d \n",dci_format); + printf("dci_format:%d Abssubframe: %d.%d \n",dci_format,frame,subframe); printf("PDSCH dlsch0 UE: rnti %x\n",dlsch[0]->rnti); printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); @@ -6231,13 +6232,22 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, uint8_t harq_pid; uint8_t transmission_mode = ue->transmission_mode[eNB_id]; - ANFBmode_t AckNackFBMode = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode; + ANFBmode_t AckNackFBMode; LTE_UE_ULSCH_t *ulsch = ue->ulsch[eNB_id]; // LTE_UE_DLSCH_t **dlsch = ue->dlsch[0]; PHY_MEASUREMENTS *meas = &ue->measurements; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; // uint32_t current_dlsch_cqi = ue->current_dlsch_cqi[eNB_id]; + if(frame_parms->frame_type == TDD) + { + AckNackFBMode = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode; + } + else + { + AckNackFBMode = 1; // 1: multiplexing for FDD + } + uint32_t cqi_req; uint32_t dai=0; uint32_t cshift; diff --git a/openair1/PHY/LTE_TRANSPORT/phich.c b/openair1/PHY/LTE_TRANSPORT/phich.c index 2d07ba948a6f0a9e665e2e7bed8ca67d66551da8..9a3287660264316dbaa334534beb88a648ff64c3 100644 --- a/openair1/PHY/LTE_TRANSPORT/phich.c +++ b/openair1/PHY/LTE_TRANSPORT/phich.c @@ -1050,7 +1050,6 @@ void generate_phich(LTE_DL_FRAME_PARMS *frame_parms, // This routine demodulates the PHICH and updates PUSCH/ULSCH parameters - void rx_phich(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc, uint8_t subframe, @@ -1085,8 +1084,10 @@ void rx_phich(PHY_VARS_UE *ue, if (!ulsch) return; + LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX Status: %d \n",ue->Mod_id,harq_pid,proc->frame_rx,subframe, ulsch->harq_processes[harq_pid]->status); + if (ulsch->harq_processes[harq_pid]->status == ACTIVE) { - LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX ACTIVE\n",ue->Mod_id,harq_pid,proc->frame_rx,subframe); + LOG_D(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d PHICH RX ACTIVE\n",ue->Mod_id,harq_pid,proc->frame_rx,subframe); Ngroup_PHICH = (frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)/48; if (((frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)%48) > 0) diff --git a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c index 6d2d6232cb41abc740be70d2602d45dca8752feb..fe4e05747a0b738b223e8ab0fa02bf4971d5541f 100644 --- a/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c +++ b/openair1/PHY/LTE_TRANSPORT/ulsch_coding.c @@ -501,7 +501,7 @@ uint32_t ulsch_encoding(uint8_t *a, ulsch->harq_processes[harq_pid]->G = G; /* - LOG_I(PHY,"ULSCH Encoding G %d, Q_RI %d (O_RI%d, Msc_initial %d, Nsymb_initial%d, beta_offset_ri_times8 %d), Q_CQI %d \n",G,Q_RI,ulsch->O_RI,ulsch->harq_processes[harq_pid]->Msc_initial,ulsch->harq_processes[harq_pid]->Nsymb_initial,ulsch->beta_offset_ri_times8,Q_CQI); + LOG_I(PHY,"ULSCH Encoding G %d, Q_RI %d (O_RI%d, Msc_initial %d, Nsymb_initial%d, beta_offset_ri_times8 %d), Q_CQI %d, Q_ACK %d \n",G,Q_RI,ulsch->O_RI,ulsch->harq_processes[harq_pid]->Msc_initial,ulsch->harq_processes[harq_pid]->Nsymb_initial,ulsch->beta_offset_ri_times8,Q_CQI,Q_ACK); LOG_I(PHY,"ULSCH Encoding (Nid_cell %d, rnti %x): harq_pid %d round %d, RV %d, mcs %d, O_RI %d, O_ACK %d, G %d\n", frame_parms->Nid_cell,ulsch->rnti, diff --git a/openair1/SCHED/phy_procedures_lte_ue.c b/openair1/SCHED/phy_procedures_lte_ue.c index 6e7354f883e39cc4a0a2b1fe24b73688867a9c8d..5dc629b90bb34eb71da27385e1694bbbebb8d4db 100644 --- a/openair1/SCHED/phy_procedures_lte_ue.c +++ b/openair1/SCHED/phy_procedures_lte_ue.c @@ -61,6 +61,9 @@ fifo_dump_emos_UE emos_dump_UE; # include "intertask_interface.h" #endif +#include "PHY/defs.h" + +#include "PHY/CODING/extern.h" #define DLSCH_RB_ALLOC 0x1fbf // skip DC RB (total 23/25 RBs) #define DLSCH_RB_ALLOC_12 0x0aaa // skip DC RB (total 23/25 RBs) @@ -1026,6 +1029,15 @@ void ulsch_common_procedures(PHY_VARS_UE *ue, UE_rxtx_proc_t *proc) { } #endif #endif + /* + only for debug + LOG_I(PHY,"ul-signal [subframe: %d, ulsch_start %d, TA: %d, rxOffset: %d, timing_advance: %d, hw_timing_advance: %d]\n",subframe_tx, ulsch_start, ue->N_TA_offset, ue->rx_offset, ue->timing_advance, ue->hw_timing_advance); + if( (crash == 1) && (subframe_tx == 0) ) + { + LOG_E(PHY,"***** DUMP TX Signal [ulsch_start %d] *****\n",ulsch_start); + write_output("txBuff.m","txSignal",&ue->common_vars.txdata[aa][ulsch_start],frame_parms->samples_per_tti,1,1); + } + */ } //nb_antennas_tx @@ -1242,6 +1254,27 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB + + if (ack_status > 0) { + + // check if we received a PDSCH at subframe_tx - 4 + // ==> send ACK/NACK on PUSCH + if( (ue->dlsch[eNB_id][0]->harq_ack[proc->subframe_rx].send_harq_status) == 1) + { + ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = 1; + } + else + { + ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK = 0; + } + LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating ACK (%d,%d) for %d bits on PUSCH\n", + Mod_id, + ue->ulsch[eNB_id]->rnti, + frame_tx,subframe_tx, + ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1], + ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK); + } + #ifdef DEBUG_PHY_PROC LOG_D(PHY, "[UE %d][PUSCH %d] Frame %d subframe %d Generating PUSCH : first_rb %d, nb_rb %d, round %d, mcs %d, rv %d, cyclic_shift %d (cyclic_shift_common %d,n_DMRS2 %d,n_PRS %d), ACK (%d,%d), O_ACK %d\n", @@ -1260,15 +1293,6 @@ void ue_ulsch_uespec_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK); #endif - if (ack_status > 0) { - LOG_D(PHY,"[UE %d][PDSCH %x] Frame %d subframe %d Generating ACK (%d,%d) for %d bits on PUSCH\n", - Mod_id, - ue->ulsch[eNB_id]->rnti, - frame_tx,subframe_tx, - ue->ulsch[eNB_id]->o_ACK[0],ue->ulsch[eNB_id]->o_ACK[1], - ue->ulsch[eNB_id]->harq_processes[harq_pid]->O_ACK); - } - @@ -1535,6 +1559,17 @@ void ue_pucch_procedures(PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint8_t eNB_id,uin ACK/NACK and SR using the shortened PUCCH format. This shortened PUCCH format shall be used in a cell specific SRS subframe even if the UE does not transmit SRS in that subframe */ + + int harq_pid = subframe2harq_pid(&ue->frame_parms, + frame_tx, + subframe_tx); + + if(ue->ulsch[eNB_id]->harq_processes[harq_pid]->subframe_scheduling_flag) + { + LOG_D(PHY,"PUSCH is programmed on this subframe [pid %d] AbsSuframe %d.%d ==> Skip PUCCH transmission \n",harq_pid,frame_tx,subframe_tx); + return; + } + uint8_t isShortenPucch = (pSoundingrs_ul_config_dedicated->srsCellSubframe && frame_parms->soundingrs_ul_config_common.ackNackSRS_SimultaneousTransmission); bundling_flag = ue->pucch_config_dedicated[eNB_id].tdd_AckNackFeedbackMode;