Commit af68b397 authored by Gabriel's avatar Gabriel

Merge branch 'Enhancement-142-OAI_UE_autotest_framework', tag '2016.w49' of...

Merge branch 'Enhancement-142-OAI_UE_autotest_framework', tag '2016.w49' of https://gitlab.eurecom.fr/oai/openairinterface5g into Enhancement-142-OAI_UE_autotest_framework
parents 3750ebc2 8f6746be
...@@ -34,4 +34,5 @@ job1: ...@@ -34,4 +34,5 @@ job1:
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $NFS_TEST_RESULTS_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$NFS_TEST_RESULTS_DIR
- sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR - sshpass -p "$OAI_PASS" rsync -az -e "ssh -o StrictHostKeyChecking=no " --rsync-path="mkdir -p $EXTERNAL_SHARE_DIR && rsync" $OPENAIR_DIR/cmake_targets/autotests/log $OAI_USER@localhost:$EXTERNAL_SHARE_DIR
- cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml - cat $OPENAIR_DIR/cmake_targets/autotests/log/results_autotests.xml
when: manual only:
- triggers
...@@ -1021,6 +1021,7 @@ set(SCHED_SRC ...@@ -1021,6 +1021,7 @@ set(SCHED_SRC
${OPENAIR1_DIR}/SCHED/phy_mac_stub.c ${OPENAIR1_DIR}/SCHED/phy_mac_stub.c
${OPENAIR1_DIR}/SCHED/pucch_pc.c ${OPENAIR1_DIR}/SCHED/pucch_pc.c
${OPENAIR1_DIR}/SCHED/pusch_pc.c ${OPENAIR1_DIR}/SCHED/pusch_pc.c
${OPENAIR1_DIR}/SCHED/srs_pc.c
) )
add_library(SCHED_LIB ${SCHED_SRC}) add_library(SCHED_LIB ${SCHED_SRC})
......
...@@ -60,7 +60,7 @@ int lte_segmentation(unsigned char *input_buffer, ...@@ -60,7 +60,7 @@ int lte_segmentation(unsigned char *input_buffer,
} }
if ((*C)>MAX_NUM_DLSCH_SEGMENTS) { 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); return(-1);
} }
......
...@@ -206,7 +206,19 @@ void phy_config_dedicated_ue(module_id_t Mod_id, ...@@ -206,7 +206,19 @@ void phy_config_dedicated_ue(module_id_t Mod_id,
uint8_t CH_index, uint8_t CH_index,
struct PhysicalConfigDedicated *physicalConfigDedicated); struct PhysicalConfigDedicated *physicalConfigDedicated);
/*!
\fn void phy_config_harq_ue(module_id_t Mod_id,uint8_t CC_id,uint8_t CH_index,
uint16_t max_harq_tx)
\brief Configure UE UL max harq Tx.
\details Invoked upon reception of RRCConnectionSetup or RRCConnectionReconfiguration from eNB.
@param Mod_id Instance ID for eNB
@param CC_id Component Carrier index
@param CH_index Index of eNB for this configuration
@param max_harq_tx max harq tx information
*/
void phy_config_harq_ue(module_id_t Mod_id,int CC_id,uint8_t CH_index,
uint16_t max_harq_tx);
/** /**
\brief Configure UE MBSFN common parameters. \brief Configure UE MBSFN common parameters.
\details Invoked upon reception of SIB13 from eNB. \details Invoked upon reception of SIB13 from eNB.
......
...@@ -482,6 +482,26 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB) ...@@ -482,6 +482,26 @@ void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
} }
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) {
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
eNB->soundingrs_ul_config_dedicated[UE_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration;
eNB->soundingrs_ul_config_dedicated[UE_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift;
eNB->soundingrs_ul_config_dedicated[UE_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
eNB->soundingrs_ul_config_dedicated[UE_id].srs_Bandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
eNB->soundingrs_ul_config_dedicated[UE_id].srs_HoppingBandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;
eNB->soundingrs_ul_config_dedicated[UE_id].transmissionComb = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
LOG_D(PHY,"soundingrs_ul_config_dedicated.srs_ConfigIndex %d\n",eNB->soundingrs_ul_config_dedicated[UE_id].srs_ConfigIndex);
}
LOG_D(PHY,"------------------------------------------------------------\n");
}
eNB->physicalConfigDedicated[UE_id] = NULL; eNB->physicalConfigDedicated[UE_id] = NULL;
} }
} }
...@@ -726,6 +746,14 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id, ...@@ -726,6 +746,14 @@ void phy_config_dedicated_scell_eNB(uint8_t Mod_id,
} }
#endif #endif
void phy_config_harq_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
uint16_t max_harq_tx )
{
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
phy_vars_ue->ulsch[eNB_id]->Mlimit = max_harq_tx;
}
void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
struct PhysicalConfigDedicated *physicalConfigDedicated ) struct PhysicalConfigDedicated *physicalConfigDedicated )
{ {
...@@ -742,7 +770,8 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -742,7 +770,8 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
phy_vars_ue->dlsch_received_last[eNB_id]=0; phy_vars_ue->dlsch_received_last[eNB_id]=0;
phy_vars_ue->dlsch_fer[eNB_id]=0; phy_vars_ue->dlsch_fer[eNB_id]=0;
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
if (physicalConfigDedicated) { if (physicalConfigDedicated) {
LOG_D(PHY,"[UE %d] Received physicalConfigDedicated from eNB %d\n",Mod_id, eNB_id); LOG_D(PHY,"[UE %d] Received physicalConfigDedicated from eNB %d\n",Mod_id, eNB_id);
...@@ -852,6 +881,53 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -852,6 +881,53 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
} }
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated) {
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = 0;
if (physicalConfigDedicated->soundingRS_UL_ConfigDedicated->present == SoundingRS_UL_ConfigDedicated_PR_setup) {
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srsConfigDedicatedSetup = 1;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].duration = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.duration;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].cyclicShift = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.cyclicShift;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].freqDomainPosition = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.freqDomainPosition;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_Bandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_Bandwidth;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_ConfigIndex = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_ConfigIndex;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_HoppingBandwidth = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.srs_HoppingBandwidth;
phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].transmissionComb = physicalConfigDedicated->soundingRS_UL_ConfigDedicated->choice.setup.transmissionComb;
LOG_D(PHY,"soundingrs_ul_config_dedicated.srs_ConfigIndex %d\n",phy_vars_ue->soundingrs_ul_config_dedicated[eNB_id].srs_ConfigIndex);
}
LOG_D(PHY,"------------------------------------------------------------\n");
}
if (physicalConfigDedicated->cqi_ReportConfig) {
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic) {
// configure PUSCH CQI reporting
phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportModeAperiodic;
if ((phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm12) &&
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm30) &&
(phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic != rm31))
LOG_E(PHY,"Unsupported Aperiodic CQI Feedback Mode : %d\n",phy_vars_ue->cqi_report_config[eNB_id].cqi_ReportModeAperiodic);
}
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic) {
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_setup) {
// configure PUCCH CQI reporting
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PUCCH_ResourceIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_PUCCH_ResourceIndex;
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.cqi_pmi_ConfigIndex;
if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex)
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = *physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->choice.setup.ri_ConfigIndex;
}
else if (physicalConfigDedicated->cqi_ReportConfig->cqi_ReportPeriodic->present == CQI_ReportPeriodic_PR_release) {
// handle release
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.ri_ConfigIndex = -1;
phy_vars_ue->cqi_report_config[eNB_id].CQI_ReportPeriodic.cqi_PMI_ConfigIndex = -1;
}
}
}
#ifdef CBA #ifdef CBA
if (physicalConfigDedicated->pusch_CBAConfigDedicated_vlola) { if (physicalConfigDedicated->pusch_CBAConfigDedicated_vlola) {
...@@ -868,6 +944,9 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id, ...@@ -868,6 +944,9 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
return; return;
} }
// fill cqi parameters for periodic CQI reporting
get_cqipmiri_params(phy_vars_ue,eNB_id);
} }
void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups) void phy_config_cba_rnti (module_id_t Mod_id,int CC_id,eNB_flag_t eNB_flag, uint8_t index, rnti_t cba_rnti, uint8_t cba_group_id, uint8_t num_active_cba_groups)
......
...@@ -102,7 +102,7 @@ int lte_est_freq_offset(int **dl_ch_estimates, ...@@ -102,7 +102,7 @@ int lte_est_freq_offset(int **dl_ch_estimates,
{ {
int ch_offset, omega, dl_ch_shift; int ch_offset, omega, dl_ch_shift;
struct complex16 *omega_cpx; struct complex16 omega_cpx;
double phase_offset; double phase_offset;
int freq_offset_est; int freq_offset_est;
unsigned char aa; unsigned char aa;
...@@ -142,9 +142,8 @@ int lte_est_freq_offset(int **dl_ch_estimates, ...@@ -142,9 +142,8 @@ int lte_est_freq_offset(int **dl_ch_estimates,
// printf("Computing freq_offset\n"); // printf("Computing freq_offset\n");
omega = dot_product(dl_ch,dl_ch_prev,(frame_parms->N_RB_DL/2 - 1)*12,dl_ch_shift); omega = dot_product(dl_ch,dl_ch_prev,(frame_parms->N_RB_DL/2 - 1)*12,dl_ch_shift);
//omega = dot_product(dl_ch,dl_ch_prev,frame_parms->ofdm_symbol_size,15); //omega = dot_product(dl_ch,dl_ch_prev,frame_parms->ofdm_symbol_size,15);
omega_cpx = (struct complex16*) ω omega_cpx.r = ((struct complex16*) &omega)->r;
omega_cpx.i = ((struct complex16*) &omega)->i;
// printf("omega (%d,%d)\n",omega_cpx->r,omega_cpx->i);
dl_ch = (int16_t *)&dl_ch_estimates[aa][(((frame_parms->N_RB_DL/2) + 1)*12) + ch_offset]; dl_ch = (int16_t *)&dl_ch_estimates[aa][(((frame_parms->N_RB_DL/2) + 1)*12) + ch_offset];
...@@ -155,10 +154,12 @@ int lte_est_freq_offset(int **dl_ch_estimates, ...@@ -155,10 +154,12 @@ int lte_est_freq_offset(int **dl_ch_estimates,
// calculate omega = angle(conj(dl_ch)*dl_ch_prev)) // calculate omega = angle(conj(dl_ch)*dl_ch_prev))
omega = dot_product(dl_ch,dl_ch_prev,((frame_parms->N_RB_DL/2) - 1)*12,dl_ch_shift); omega = dot_product(dl_ch,dl_ch_prev,((frame_parms->N_RB_DL/2) - 1)*12,dl_ch_shift);
omega_cpx->r += ((struct complex16*) &omega)->r;
omega_cpx->i += ((struct complex16*) &omega)->i; omega_cpx.r += ((struct complex16*) &omega)->r;
omega_cpx.i += ((struct complex16*) &omega)->i;
// phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); // phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r);
phase_offset += atan2((double)omega_cpx->i,(double)omega_cpx->r); phase_offset += atan2((double)omega_cpx.i,(double)omega_cpx.r);
// LOG_I(PHY,"omega (%d,%d) -> %f\n",omega_cpx->r,omega_cpx->i,phase_offset); // LOG_I(PHY,"omega (%d,%d) -> %f\n",omega_cpx->r,omega_cpx->i,phase_offset);
} }
......
...@@ -2857,7 +2857,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars, ...@@ -2857,7 +2857,7 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
} }
} }
LOG_D(PHY,"DCI decoding CRNTI [format_c: %d, nCCE[subframe: %d]: %d ]\n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe]); LOG_D(PHY,"DCI decoding CRNTI [format: %d, nCCE[subframe: %d]: %d ], AggregationLevel %d \n",format_c, subframe, pdcch_vars[eNB_id]->nCCE[subframe],L2);
// memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes); // memcpy(&dci_alloc[*dci_cnt].dci_pdu[0],dci_decoded_output,sizeof_bytes);
...@@ -3248,7 +3248,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3248,7 +3248,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
SI_RNTI, SI_RNTI,
ra_rnti, ra_rnti,
P_RNTI, P_RNTI,
3, 0,
format1A, format1A,
format1A, format1A,
format1A, format1A,
...@@ -3277,7 +3277,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3277,7 +3277,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
SI_RNTI, SI_RNTI,
ra_rnti, ra_rnti,
P_RNTI, P_RNTI,
2, 1,
format1A, format1A,
format1A, format1A,
format1A, format1A,
...@@ -3310,7 +3310,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3310,7 +3310,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
SI_RNTI, SI_RNTI,
ra_rnti, ra_rnti,
P_RNTI, P_RNTI,
1, 2,
format1A, format1A,
format1A, format1A,
format1A, format1A,
...@@ -3339,7 +3339,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue, ...@@ -3339,7 +3339,7 @@ uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
SI_RNTI, SI_RNTI,
ra_rnti, ra_rnti,
P_RNTI, P_RNTI,
0, 3,
format1A, format1A,
format1A, format1A,
format1A, format1A,
......
...@@ -36,7 +36,10 @@ ...@@ -36,7 +36,10 @@
#include "PHY/vars.h" #include "PHY/vars.h"
#endif #endif
#include "assertions.h" #include "assertions.h"
#include "LAYER2/MAC/extern.h"
#include "LAYER2/MAC/defs.h"
//#define DEBUG_DCI //#define DEBUG_DCI
uint32_t localRIV2alloc_LUT6[32]; uint32_t localRIV2alloc_LUT6[32];
...@@ -1260,6 +1263,11 @@ int generate_eNB_dlsch_params_from_dci(int frame, ...@@ -1260,6 +1263,11 @@ int generate_eNB_dlsch_params_from_dci(int frame,
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][NPRB-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][NPRB-1];
} }
else
{
LOG_E(PHY,"DL Received HarqReTx round=%d mcs=%d rballoc=%d rv=%d \n",
dlsch0_harq->round,mcs,rballoc,rv);
}
dlsch[0]->current_harq_pid = harq_pid; dlsch[0]->current_harq_pid = harq_pid;
...@@ -3917,10 +3925,10 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -3917,10 +3925,10 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
} else { } else {
if (harq_pid>1) { //if (harq_pid>1) {
LOG_E(PHY,"Format 1A: harq_pid > 1\n"); // LOG_E(PHY,"Format 1A: harq_pid > 1\n");
return(-1); // return(-1);
} //}
dlsch0_harq = dlsch[0]->harq_processes[harq_pid]; dlsch0_harq = dlsch[0]->harq_processes[harq_pid];
NPRB = RIV2nb_rb_LUT25[rballoc]; NPRB = RIV2nb_rb_LUT25[rballoc];
...@@ -4143,6 +4151,20 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -4143,6 +4151,20 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq->DCINdi = ndi; dlsch0_harq->DCINdi = ndi;
// this a retransmission
if(dlsch0_harq->round)
{
// compare old TBS to new TBS
if(dlsch0_harq->TBS != TBStable[get_I_TBS(mcs)][NPRB-1])
{
// this is an eNB issue
// retransmisison but old and new TBS are different !!!
// work around, consider it as a new transmission
LOG_E(PHY,"Format1A Retransmission but TBS are different: consider it as new transmission !!! \n");
dlsch0_harq->round = 0;
}
}
dlsch0_harq->mcs = mcs; dlsch0_harq->mcs = mcs;
if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) { if ((rnti==si_rnti) || (rnti==p_rnti) || (rnti==ra_rnti)) {
dlsch0_harq->TBS = TBStable[mcs][NPRB-1]; dlsch0_harq->TBS = TBStable[mcs][NPRB-1];
...@@ -4434,6 +4456,7 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -4434,6 +4456,7 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq->status = ACTIVE; dlsch0_harq->status = ACTIVE;
dlsch0_harq->DCINdi = ndi; dlsch0_harq->DCINdi = ndi;
dlsch[0]->harq_ack[subframe].send_harq_status = 1;
if (dlsch0_harq->first_tx==1) { if (dlsch0_harq->first_tx==1) {
LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n"); LOG_D(PHY,"[PDSCH %x/%d] Format 1 DCI First TX: Clearing flag\n");
dlsch0_harq->first_tx = 0; dlsch0_harq->first_tx = 0;
...@@ -4452,6 +4475,20 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -4452,6 +4475,20 @@ int generate_ue_dlsch_params_from_dci(int frame,
dlsch0_harq->mcs = mcs; dlsch0_harq->mcs = mcs;
// this a retransmission
if(dlsch0_harq->round)
{
// compare old TBS to new TBS
if(dlsch0_harq->TBS != TBStable[get_I_TBS(mcs)][NPRB-1])
{
// this is an eNB issue
// retransmisison but old and new TBS are different !!!
// work around, consider it as a new transmission
LOG_E(PHY,"Format1 Retransmission but TBS are different: consider it as new transmission !!! \n");
dlsch0_harq->round = 0;
}
}
dlsch0_harq->TBS = TBStable[get_I_TBS(mcs)][NPRB-1]; dlsch0_harq->TBS = TBStable[get_I_TBS(mcs)][NPRB-1];
if (mcs <= 28) if (mcs <= 28)
dlsch0_harq->Qm = get_Qm(mcs); dlsch0_harq->Qm = get_Qm(mcs);
...@@ -5519,7 +5556,8 @@ int generate_ue_dlsch_params_from_dci(int frame, ...@@ -5519,7 +5556,8 @@ int generate_ue_dlsch_params_from_dci(int frame,
#ifdef DEBUG_DCI #ifdef DEBUG_DCI
if (dlsch[0]) { if (dlsch[0] && (dlsch[0]->rnti != 0xffff)) {
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: rnti %x\n",dlsch[0]->rnti);
printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb); printf("PDSCH dlsch0 UE: NBRB %d\n",dlsch0_harq->nb_rb);
printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]); printf("PDSCH dlsch0 UE: rballoc %x\n",dlsch0_harq->rb_alloc_even[0]);
...@@ -6194,13 +6232,22 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -6194,13 +6232,22 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
uint8_t harq_pid; uint8_t harq_pid;
uint8_t transmission_mode = ue->transmission_mode[eNB_id]; 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_ULSCH_t *ulsch = ue->ulsch[eNB_id];
// LTE_UE_DLSCH_t **dlsch = ue->dlsch[0]; // LTE_UE_DLSCH_t **dlsch = ue->dlsch[0];
PHY_MEASUREMENTS *meas = &ue->measurements; PHY_MEASUREMENTS *meas = &ue->measurements;
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms; LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
// uint32_t current_dlsch_cqi = ue->current_dlsch_cqi[eNB_id]; // 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 cqi_req;
uint32_t dai=0; uint32_t dai=0;
uint32_t cshift; uint32_t cshift;
...@@ -6351,8 +6398,10 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -6351,8 +6398,10 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
if (rballoc > RIV_max) { if (rballoc > RIV_max) {
LOG_E(PHY,"frame %d, subframe %d, rnti %x, format %d: FATAL ERROR: generate_ue_ulsch_params_from_dci, rb_alloc > RIV_max\n", LOG_E(PHY,"frame %d, subframe %d, rnti %x, format %d: FATAL ERROR: generate_ue_ulsch_params_from_dci, rb_alloc[%d] > RIV_max[%d]\n",
proc->frame_rx, subframe, rnti, dci_format); proc->frame_rx, subframe, rnti, dci_format,rballoc,RIV_max);
LOG_E(PHY,"Wrong DCI0 detection, do not transmit PUSCH for HARQID: %d\n",harq_pid);
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
return(-1); return(-1);
} }
...@@ -6361,7 +6410,11 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -6361,7 +6410,11 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
if ((rnti >= cba_rnti) && (rnti < p_rnti)) if ((rnti >= cba_rnti) && (rnti < p_rnti))
ulsch->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1; //+=1 this indicates the number of dci / cba group: not supported in the data struct ulsch->harq_processes[harq_pid]->subframe_cba_scheduling_flag = 1; //+=1 this indicates the number of dci / cba group: not supported in the data struct
else else
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1; {
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
//LOG_I(PHY,"[HARQ-UL harqId: %d] DCI0 ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round);
}
ulsch->harq_processes[harq_pid]->TPC = TPC; ulsch->harq_processes[harq_pid]->TPC = TPC;
...@@ -6391,7 +6444,42 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -6391,7 +6444,42 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,
ulsch->harq_processes[harq_pid]->round = 0; ulsch->harq_processes[harq_pid]->round = 0;
} else { } else {
// ulsch->harq_processes[harq_pid]->Ndi = 0; // ulsch->harq_processes[harq_pid]->Ndi = 0;
// ulsch->harq_processes[harq_pid]->round++; // This is done in phich RX //ulsch->harq_processes[harq_pid]->round++; // This is done in phich RX
//#ifdef DEBUG_PHICH
//LOG_I(PHY,"[UE %d][PUSCH %d] Frame %d subframe %d Adaptative Retrans, NDI not toggled => Nack. maxHARQ_Tx %d \n",
// ue->Mod_id,harq_pid,
// proc->frame_rx,
// subframe,
// ulsch->Mlimit);
//#endif
/*
if (ulsch->harq_processes[harq_pid]->round > 0) // NACK detected on phich
{
// ulsch->harq_processes[harq_pid]->round++; already done on phich_rx
// ulsch->harq_processes[harq_pid] = ulsch->harq_processes[8];
// LOG_I(PHY," Adaptative retransmission - copy temporary harq Process to current harq process. [harqId %d round %d] \n",harq_pid, ulsch->harq_processes[8]->round);
if (ulsch->harq_processes[harq_pid]->round >= ulsch->Mlimit) //UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx)
{
ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 0;
ulsch->harq_processes[harq_pid]->round = 0;
ulsch->harq_processes[harq_pid]->status = IDLE;
//LOG_I(PHY," PUSCH MAX Retransmission acheived ==> flush harq buff (%d) \n",harq_pid);
//LOG_I(PHY," [HARQ-UL harqId: %d] Adaptative retransmission NACK MAX RETRANS(%d) ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, UE_mac_inst[eNB_id].scheduling_info.maxHARQ_Tx, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag, ulsch->harq_processes[harq_pid]->round);
}
else
{
// ulsch->harq_processes[harq_pid]->subframe_scheduling_flag = 1;
uint8_t rv_table[4] = {0, 2, 3, 1};
ulsch->harq_processes[harq_pid]->rvidx = rv_table[ulsch->harq_processes[harq_pid]->round&3];
ulsch->O_RI = 0;
ulsch->O = 0;
ulsch->uci_format = HLC_subband_cqi_nopmi;
//LOG_I(PHY," [HARQ-UL harqId: %d] Adaptative retransmission NACK ==> subframe_scheduling_flag = %d round: %d\n", harq_pid, ulsch->harq_processes[harq_pid]->subframe_scheduling_flag,ulsch->harq_processes[harq_pid]->round);
}
}
*/
} }
} }
...@@ -6441,7 +6529,16 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu, ...@@ -6441,7 +6529,16 @@ int generate_ue_ulsch_params_from_dci(void *dci_pdu,