Merge commit '8471bd14e2e400887e7419d3307921a1401e2823' into mu_with_tdd1
# Conflicts: # common/utils/itti/intertask_interface.c # openair1/SCHED/phy_procedures_lte_eNb.c
This commit is contained in:
@@ -256,7 +256,7 @@ void phy_config_request(PHY_Config_t *phy_config) {
|
||||
AssertFatal(fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0] > 0,
|
||||
"prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]==0\n");
|
||||
#else
|
||||
LOG_E(PHY,"***DJP*** removed assert on preamble fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]:%d expecting >0 %s:%d\n\n\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], __FILE__, __LINE__);
|
||||
LOG_D(PHY,"***DJP*** removed assert on preamble fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0]:%d expecting >0 %s:%d\n\n\n", fp->prach_emtc_config_common.prach_ConfigInfo.prach_numRepetitionPerPreambleAttempt[0], __FILE__, __LINE__);
|
||||
#endif
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_ConfigIndex[0] = cfg->emtc_config.prach_ce_level_0_configuration_index.value;
|
||||
fp->prach_emtc_config_common.prach_ConfigInfo.prach_FreqOffset[0] = cfg->emtc_config.prach_ce_level_0_frequency_offset.value;
|
||||
@@ -649,11 +649,7 @@ void phy_config_sib13_eNB(module_id_t Mod_id,int CC_id,int mbsfn_Area_idx,
|
||||
|
||||
void phy_config_dedicated_eNB_step2(PHY_VARS_eNB *eNB)
|
||||
{
|
||||
#ifndef UE_EXPANSION
|
||||
uint8_t UE_id;
|
||||
#else
|
||||
uint16_t UE_id;
|
||||
#endif
|
||||
struct PhysicalConfigDedicated *physicalConfigDedicated;
|
||||
LTE_DL_FRAME_PARMS *fp=&eNB->frame_parms;
|
||||
|
||||
@@ -1779,7 +1775,7 @@ int phy_init_RU(RU_t *ru) {
|
||||
AssertFatal(RC.nb_L1_inst <= NUMBER_OF_eNB_MAX,"eNB instances %d > %d\n",
|
||||
RC.nb_L1_inst,NUMBER_OF_eNB_MAX);
|
||||
|
||||
LOG_E(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
|
||||
LOG_D(PHY,"[INIT] %s() RC.nb_L1_inst:%d \n", __FUNCTION__, RC.nb_L1_inst);
|
||||
|
||||
for (i=0; i<RC.nb_L1_inst; i++) {
|
||||
for (p=0;p<15;p++) {
|
||||
|
||||
@@ -800,19 +800,11 @@ void generate_RIV_tables()
|
||||
// n_tilde_PRB(2,3) = (3,5)
|
||||
// n_tilde_PRB(0,1) = (0,2)
|
||||
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
|
||||
#else
|
||||
|
||||
int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
|
||||
#endif
|
||||
{
|
||||
#ifndef UE_EXPANSION
|
||||
uint8_t i;
|
||||
int8_t first_free_index=-1;
|
||||
#else
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
#endif
|
||||
|
||||
AssertFatal(eNB!=NULL,"eNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
@@ -829,19 +821,10 @@ int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
|
||||
return first_free_index;
|
||||
}
|
||||
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
|
||||
#else
|
||||
int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type)
|
||||
#endif
|
||||
{
|
||||
#ifndef UE_EXPANSION
|
||||
uint8_t i;
|
||||
int8_t first_free_index=-1;
|
||||
#else
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
#endif
|
||||
|
||||
AssertFatal(eNB!=NULL,"eNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
@@ -1089,7 +1072,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
}
|
||||
dlsch0_harq->ndi = rel8->new_data_indicator_1;
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -1270,14 +1253,14 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
dlsch0_harq->mcs = rel8->mcs_1;
|
||||
dlsch0_harq->Qm = 2;
|
||||
dlsch0_harq->TBS = TBStable[I_mcs][NPRB-1];
|
||||
dlsch0->harq_ids[subframe] = rel8->harq_process;
|
||||
#ifdef UE_EXPANSION
|
||||
dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process;
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
#endif
|
||||
dlsch0->rnti = rel8->rnti;
|
||||
dlsch0->harq_ids[subframe] = rel8->harq_process;
|
||||
//dlsch0->harq_ids[subframe] = rel8->harq_process;
|
||||
if (dlsch0_harq->round == 0)
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
|
||||
@@ -1289,7 +1272,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
case NFAPI_DL_DCI_FORMAT_1:
|
||||
|
||||
dci_alloc->format = format1;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -1438,7 +1421,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
|
||||
dlsch0_harq->dl_power_off = 1;
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -1458,7 +1441,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
}
|
||||
|
||||
LOG_D(PHY,"DCI: Set harq_ids[%d] to %d (%p)\n",subframe,rel8->harq_process,dlsch0);
|
||||
dlsch0->harq_ids[subframe] = rel8->harq_process;
|
||||
dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process;
|
||||
|
||||
dlsch0->harq_mask |= (1<<rel8->harq_process);
|
||||
|
||||
@@ -1625,8 +1608,8 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
|
||||
dlsch0->subframe_tx[subframe] = 1;
|
||||
|
||||
dlsch0->harq_ids[subframe] = rel8->harq_process;
|
||||
dlsch1->harq_ids[subframe] = rel8->harq_process;
|
||||
dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process;
|
||||
dlsch1->harq_ids[frame%2][subframe] = rel8->harq_process;
|
||||
// printf("Setting DLSCH harq id %d to subframe %d\n",harq_pid,subframe);
|
||||
|
||||
|
||||
@@ -1653,7 +1636,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
// assume both TBs are active
|
||||
dlsch0_harq->Nl = 1;
|
||||
dlsch1_harq->Nl = 1;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
dlsch1->active[subframe] = 1;
|
||||
#else
|
||||
@@ -1665,7 +1648,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
|
||||
// check if either TB is disabled (see 36-213 V11.3 Section )
|
||||
if ((dlsch0_harq->rvidx == 1) && (dlsch0_harq->mcs == 0)) {
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 0;
|
||||
#else
|
||||
dlsch0->active = 0;
|
||||
@@ -1674,7 +1657,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
}
|
||||
|
||||
if ((dlsch1_harq->rvidx == 1) && (dlsch1_harq->mcs == 0)) {
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch1->active[subframe]= 0;
|
||||
#else
|
||||
dlsch1->active = 0;
|
||||
@@ -1690,7 +1673,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
dlsch0_harq->TBS = TBStable[get_I_TBS(dlsch0_harq->mcs)][dlsch0_harq->nb_rb-1];
|
||||
dlsch1_harq->TBS = TBStable[get_I_TBS(dlsch1_harq->mcs)][dlsch0_harq->nb_rb-1];
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if ((dlsch0->active[subframe]==1) && (dlsch1->active[subframe]==1)) {
|
||||
#else
|
||||
if ((dlsch0->active==1) && (dlsch1->active==1)) {
|
||||
@@ -1704,7 +1687,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
dlsch1_harq->mimo_mode = ALAMOUTI;
|
||||
}
|
||||
} else if (fp->nb_antenna_ports_eNB == 4) { // 4 antenna case
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if ((dlsch0->active[subframe]==1) && (dlsch1->active[subframe]==1)) {
|
||||
#else
|
||||
if ((dlsch0->active==1) && (dlsch1->active==1)) {
|
||||
@@ -1748,7 +1731,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
LOG_E(PHY,"Illegal value (3) for TPMI in Format 2A DCI\n");
|
||||
break;
|
||||
}
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
} else if (dlsch0->active[subframe] == 1) {
|
||||
#else
|
||||
} else if (dlsch0->active == 1) {
|
||||
@@ -1772,7 +1755,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
LOG_E(PHY,"Illegal value %d for TPMI in Format 2A DCI with one transport block enabled\n",rel8->precoding_information);
|
||||
break;
|
||||
}
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
} else if (dlsch1->active[subframe] == 1) {
|
||||
#else
|
||||
} else if (dlsch1->active == 1) {
|
||||
@@ -1802,14 +1785,14 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
}
|
||||
|
||||
// reset HARQ process if this is the first transmission
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if ((dlsch0->active[subframe]==1) && (dlsch0_harq->round == 0))
|
||||
#else
|
||||
if ((dlsch0->active==1) && (dlsch0_harq->round == 0))
|
||||
#endif
|
||||
dlsch0_harq->status = ACTIVE;
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if ((dlsch1->active[subframe]==1) && (dlsch1_harq->round == 0))
|
||||
#else
|
||||
if ((dlsch1->active==1) && (dlsch1_harq->round == 0))
|
||||
@@ -1987,7 +1970,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
printf("RV0 = %d, RV1 = %d. MCS0 = %d, MCS1=%d\n", rel8->redundancy_version_1, rel8->redundancy_version_2, rel8->mcs_1, rel8->mcs_2);
|
||||
#endif
|
||||
if (TB0_active && TB1_active && rel8->transport_block_to_codeword_swap_flag==0) {
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
dlsch1->active[subframe] = 1;
|
||||
#else
|
||||
@@ -2015,7 +1998,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
else if (TB0_active && TB1_active && rel8->transport_block_to_codeword_swap_flag==1) {
|
||||
dlsch0 = eNB->dlsch[UE_id][1];
|
||||
dlsch1 = eNB->dlsch[UE_id][0];
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
dlsch1->active[subframe] = 1;
|
||||
#else
|
||||
@@ -2039,7 +2022,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
dlsch1_harq->codeword=0;
|
||||
}
|
||||
else if (TB0_active && (TB1_active==0)) {
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -2058,7 +2041,7 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
#endif
|
||||
}
|
||||
else if ((TB0_active==0) && TB1_active) {
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch1->active[subframe] = 1;
|
||||
#else
|
||||
dlsch1->active = 1;
|
||||
@@ -2080,11 +2063,11 @@ void fill_dci_and_dlsch(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t
|
||||
if (dlsch0 != NULL){
|
||||
dlsch0->subframe_tx[subframe] = 1;
|
||||
|
||||
dlsch0->harq_ids[subframe] = rel8->harq_process;
|
||||
dlsch0->harq_ids[frame%2][subframe] = rel8->harq_process;
|
||||
}
|
||||
|
||||
if (dlsch1_harq != NULL){
|
||||
dlsch1->harq_ids[subframe] = rel8->harq_process;
|
||||
dlsch1->harq_ids[frame%2][subframe] = rel8->harq_process;
|
||||
}
|
||||
|
||||
|
||||
@@ -2294,6 +2277,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
|
||||
LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL;
|
||||
int UE_id;
|
||||
int subframe = proc->subframe_tx;
|
||||
int frame = proc->frame_tx;
|
||||
|
||||
dci_alloc->firstCCE = rel13->ecce_index;
|
||||
dci_alloc->L = rel13->aggregation_level;
|
||||
@@ -2329,7 +2313,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
|
||||
|
||||
case 10: // Format 6-1A
|
||||
dci_alloc->format = format6_1A;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -2389,7 +2373,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
|
||||
break;
|
||||
case 11: // Format 6-1B
|
||||
dci_alloc->format = format6_1B;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -2436,7 +2420,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
|
||||
}
|
||||
case 12: // Format 6-2
|
||||
dci_alloc->format = format6_2;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -2524,7 +2508,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
|
||||
|
||||
dlsch0_harq->dl_power_off = 1;
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[subframe] = 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -2541,7 +2525,7 @@ void fill_mdci_and_dlsch(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,mDCI_ALLOC_t *d
|
||||
|
||||
}
|
||||
|
||||
dlsch0->harq_ids[subframe] = rel13->harq_process;
|
||||
dlsch0->harq_ids[frame%2][subframe] = rel13->harq_process;
|
||||
|
||||
|
||||
|
||||
@@ -2572,6 +2556,8 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
|
||||
|
||||
uint32_t ndi = pdu->dci_pdu_rel8.new_data_indication_1;
|
||||
|
||||
uint16_t UE_id = -1;
|
||||
|
||||
#ifdef T_TRACER
|
||||
T(T_ENB_PHY_ULSCH_UE_DCI, T_INT(eNB->Mod_id), T_INT(frame), T_INT(subframe),
|
||||
T_INT(pdu->dci_pdu_rel8.rnti), T_INT(((frame*10+subframe+4) % 8) /* TODO: correct harq pid */),
|
||||
@@ -2717,6 +2703,13 @@ void fill_dci0(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_proc_t *proc,
|
||||
DevParam (frame_parms->N_RB_DL, 0, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
if(frame_parms->frame_type == TDD){
|
||||
UE_id = find_ulsch(pdu->dci_pdu_rel8.rnti, eNB,SEARCH_EXIST_OR_FREE);
|
||||
if(UE_id != -1){
|
||||
eNB->ulsch[UE_id]->harq_processes[pdu->dci_pdu_rel8.harq_pid]->V_UL_DAI = dai +1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu,int frame,int subframe)
|
||||
@@ -2781,6 +2774,7 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
ulsch->harq_processes[harq_pid]->ndi, ulsch_pdu->ulsch_pdu_rel8.new_data_indication, new_ulsch, ulsch->harq_processes[harq_pid]->status);
|
||||
|
||||
ulsch->harq_processes[harq_pid]->rvidx = ulsch_pdu->ulsch_pdu_rel8.redundancy_version;
|
||||
if(ulsch_pdu->ulsch_pdu_rel8.modulation_type!=0)
|
||||
ulsch->harq_processes[harq_pid]->Qm = ulsch_pdu->ulsch_pdu_rel8.modulation_type;
|
||||
// Set O_ACK to 0 by default, will be set of DLSCH is scheduled and needs to be
|
||||
ulsch->harq_processes[harq_pid]->O_ACK = 0;
|
||||
@@ -2802,15 +2796,11 @@ void fill_ulsch(PHY_VARS_eNB *eNB,int UE_id,nfapi_ul_config_ulsch_pdu *ulsch_pdu
|
||||
ulsch->harq_processes[harq_pid]->Or1 = 0;
|
||||
ulsch->harq_processes[harq_pid]->Or2 = 0;
|
||||
}
|
||||
#ifndef UE_EXPANSION
|
||||
else ulsch->harq_processes[harq_pid]->round++;
|
||||
#else
|
||||
else {
|
||||
ulsch->harq_processes[harq_pid]->round++;
|
||||
ulsch->harq_processes[harq_pid]->TBS = ulsch_pdu->ulsch_pdu_rel8.size<<3;
|
||||
ulsch->harq_processes[harq_pid]->Msc_initial = 12*ulsch_pdu->ulsch_pdu_rel8.number_of_resource_blocks;
|
||||
}
|
||||
#endif
|
||||
ulsch->rnti = ulsch_pdu->ulsch_pdu_rel8.rnti;
|
||||
LOG_D(PHY,"Filling ULSCH %x (UE_id %d) (new_ulsch %d) for Frame %d, Subframe %d : harq_pid %d, status %d, handled %d, first_rb %d, nb_rb %d, rvidx %d, Qm %d, TBS %d, round %d \n",
|
||||
ulsch->rnti,
|
||||
@@ -6594,12 +6584,7 @@ uint8_t subframe2harq_pid(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame,uint8_t
|
||||
} else {
|
||||
|
||||
switch (frame_parms->tdd_config) {
|
||||
|
||||
case 1:
|
||||
if ((subframe==2) ||
|
||||
(subframe==3) ||
|
||||
(subframe==7) ||
|
||||
(subframe==8))
|
||||
switch (subframe) {
|
||||
case 2:
|
||||
case 3:
|
||||
@@ -6667,10 +6652,13 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n)
|
||||
uint8_t ul_subframe = 255;
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1) &&
|
||||
((n==1)||(n==6))) // tdd_config 0,1 SF 1,5
|
||||
ul_subframe = ((n+6)%10);
|
||||
else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1)) {
|
||||
if ((n==1)||(n==6)) { // tdd_config 0,1 SF 1,5
|
||||
ul_subframe = ((n+6)%10);
|
||||
} else if ((n==4)||(n==9)) {
|
||||
ul_subframe = ((n+4)%10);
|
||||
}
|
||||
} else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 6) &&
|
||||
((n==0)||(n==1)||(n==5)||(n==6)))
|
||||
ul_subframe = ((n+7)%10);
|
||||
@@ -6690,10 +6678,13 @@ uint8_t pdcch_alloc2ul_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n)
|
||||
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n)
|
||||
{
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1) &&
|
||||
((n==7)||(n==2))) // tdd_config 0,1 SF 1,5
|
||||
return((n==7)? 1 : 6);
|
||||
else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1)) {
|
||||
if ((n==7)||(n==2)) { // tdd_config 0,1 SF 1,5
|
||||
return((n==7)? 1 : 6);
|
||||
} else if ((n==3)||(n==8)) {
|
||||
return((n==3)? 9 : 4);
|
||||
}
|
||||
} else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 6) &&
|
||||
((n==7)||(n==8)||(n==2)||(n==3)))
|
||||
return((n+3)%10);
|
||||
@@ -6707,13 +6698,14 @@ uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t
|
||||
|
||||
uint32_t pdcch_alloc2ul_frame(LTE_DL_FRAME_PARMS *frame_parms,uint32_t frame, uint8_t n)
|
||||
{
|
||||
uint32_t ul_frame;
|
||||
uint32_t ul_frame = frame;
|
||||
|
||||
if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1) &&
|
||||
((n==1)||(n==6))) // tdd_config 0,1 SF 1,5
|
||||
ul_frame = (frame + (n==1 ? 0 : 1));
|
||||
else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 1)) {
|
||||
if ((n==1)||(n==6)||(n==4)||(n==9)) { // tdd_config 0,1 SF 1,5
|
||||
ul_frame = (frame + (n < 5 ? 0 : 1));
|
||||
}
|
||||
} else if ((frame_parms->frame_type == TDD) &&
|
||||
(frame_parms->tdd_config == 6) &&
|
||||
((n==0)||(n==1)||(n==5)||(n==6)))
|
||||
ul_frame = (frame + (n>=5 ? 1 : 0));
|
||||
|
||||
@@ -184,7 +184,7 @@ typedef struct {
|
||||
uint8_t first_layer;
|
||||
/// codeword this transport block is mapped to
|
||||
uint8_t codeword;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
#ifdef Rel14
|
||||
/// indicator that this DLSCH corresponds to SIB1-BR, needed for c_init for scrambling
|
||||
uint8_t sib1_br_flag;
|
||||
@@ -279,7 +279,7 @@ typedef struct {
|
||||
/// Allocated RNTI (0 means DLSCH_t is not currently used)
|
||||
uint16_t rnti;
|
||||
/// Active flag for baseband transmitter processing
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
uint8_t active[10];
|
||||
#else
|
||||
uint8_t active;
|
||||
@@ -291,7 +291,7 @@ typedef struct {
|
||||
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
|
||||
uint8_t nCCE[10];
|
||||
/// Process ID's per subframe. Used to associate received ACKs on PUSCH/PUCCH to DLSCH harq process ids
|
||||
uint8_t harq_ids[10];
|
||||
uint8_t harq_ids[2][10];
|
||||
/// Window size (in outgoing transport blocks) for fine-grain rate adaptation
|
||||
uint8_t ra_window_size;
|
||||
/// First-round error threshold for fine-grain rate adaptation
|
||||
@@ -314,7 +314,7 @@ typedef struct {
|
||||
int16_t sqrt_rho_a;
|
||||
/// amplitude of PDSCH (compared to RS) in symbols containing pilots
|
||||
int16_t sqrt_rho_b;
|
||||
#ifndef UE_EXPANSION
|
||||
#ifndef PHY_TX_THREAD
|
||||
#ifdef Rel14
|
||||
/// indicator that this DLSCH corresponds to SIB1-BR, needed for c_init for scrambling
|
||||
uint8_t sib1_br_flag;
|
||||
|
||||
@@ -167,8 +167,8 @@ LTE_eNB_DLSCH_t *new_eNB_dlsch(unsigned char Kmimo,unsigned char Mdlharq,uint32_
|
||||
|
||||
}*/
|
||||
|
||||
for (i=0; i<10; i++)
|
||||
dlsch->harq_ids[i] = Mdlharq;
|
||||
for (i=0; i<20; i++)
|
||||
dlsch->harq_ids[i/10][i%10] = Mdlharq;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
dlsch->harq_processes[i] = (LTE_DL_eNB_HARQ_t *)malloc16(sizeof(LTE_DL_eNB_HARQ_t));
|
||||
@@ -246,7 +246,7 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
if (dlsch) {
|
||||
Mdlharq = dlsch->Mdlharq;
|
||||
dlsch->rnti = 0;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
for (i=0; i<10; i++)
|
||||
dlsch->active[i] = 0;
|
||||
#else
|
||||
@@ -254,8 +254,8 @@ void clean_eNb_dlsch(LTE_eNB_DLSCH_t *dlsch)
|
||||
#endif
|
||||
dlsch->harq_mask = 0;
|
||||
|
||||
for (i=0; i<10; i++)
|
||||
dlsch->harq_ids[i] = Mdlharq;
|
||||
for (i=0; i<20; i++)
|
||||
dlsch->harq_ids[i/10][i%10] = Mdlharq;
|
||||
|
||||
for (i=0; i<Mdlharq; i++) {
|
||||
if (dlsch->harq_processes[i]) {
|
||||
@@ -399,7 +399,11 @@ int dlsch_encoding_2threads(PHY_VARS_eNB *eNB,
|
||||
unsigned int crc=1;
|
||||
unsigned short iind;
|
||||
|
||||
unsigned char harq_pid = dlsch->harq_ids[subframe];
|
||||
unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
if(harq_pid >= dlsch->Mdlharq) {
|
||||
LOG_E(PHY,"dlsch_encoding_2threads illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
}
|
||||
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
|
||||
unsigned int A;
|
||||
unsigned char mod_order;
|
||||
@@ -583,7 +587,11 @@ int dlsch_encoding(PHY_VARS_eNB *eNB,
|
||||
unsigned short iind;
|
||||
|
||||
LTE_DL_FRAME_PARMS *frame_parms = &eNB->frame_parms;
|
||||
unsigned char harq_pid = dlsch->harq_ids[subframe];
|
||||
unsigned char harq_pid = dlsch->harq_ids[frame%2][subframe];
|
||||
if(harq_pid >= dlsch->Mdlharq) {
|
||||
LOG_E(PHY,"dlsch_encoding illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
}
|
||||
unsigned short nb_rb = dlsch->harq_processes[harq_pid]->nb_rb;
|
||||
unsigned int A;
|
||||
unsigned char mod_order;
|
||||
|
||||
@@ -1990,6 +1990,7 @@ inline int check_skip_dc(int rb,LTE_DL_FRAME_PARMS *frame_parms) {
|
||||
int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
int frame,
|
||||
uint32_t subframe_offset,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch0,
|
||||
@@ -2062,7 +2063,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
|
||||
if ((dlsch0 != NULL) && (dlsch1 != NULL)){
|
||||
|
||||
harq_pid = dlsch0->harq_ids[subframe_offset];
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe_offset];
|
||||
if(harq_pid >= dlsch0->Mdlharq) {
|
||||
LOG_E(PHY,"illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
@@ -2083,7 +2084,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
|
||||
}else if ((dlsch0 != NULL) && (dlsch1 == NULL)){
|
||||
|
||||
harq_pid = dlsch0->harq_ids[subframe_offset];
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe_offset];
|
||||
if(harq_pid >= dlsch0->Mdlharq) {
|
||||
LOG_E(PHY,"illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
@@ -2104,7 +2105,7 @@ int dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
|
||||
}else if ((dlsch0 == NULL) && (dlsch1 != NULL)){
|
||||
|
||||
harq_pid = dlsch1->harq_ids[subframe_offset];
|
||||
harq_pid = dlsch1->harq_ids[frame%2][subframe_offset];
|
||||
if(harq_pid >= dlsch1->Mdlharq) {
|
||||
LOG_E(PHY,"illegal harq_pid %d\n", harq_pid);
|
||||
return(-1);
|
||||
|
||||
@@ -92,19 +92,19 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
uint8_t Nacc=4;
|
||||
uint16_t j0,j,idelta;
|
||||
uint16_t i = (Ns>>1) + (10*frame);
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
uint16_t i0 = dlsch->harq_processes[harq_pid]->i0;
|
||||
#else
|
||||
uint16_t i0 = dlsch->i0;
|
||||
#endif
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (dlsch->harq_processes[harq_pid]->sib1_br_flag==1) Nacc=1;
|
||||
#else
|
||||
if (dlsch->sib1_br_flag==1) Nacc=1;
|
||||
#endif
|
||||
else if (dlsch->rnti == 0xFFFF || dlsch->rnti == 0xFFFE) Nacc = (frame_parms->frame_type == TDD) ? 10 : 4;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
// Note: above SC-RNTI will also have to be added when/if implemented
|
||||
else if (dlsch->harq_processes[harq_pid]->CEmode == CEmodeA) Nacc=1;
|
||||
else if (dlsch->harq_processes[harq_pid]->CEmode == CEmodeB) Nacc = (frame_parms->frame_type == TDD) ? 10 : 4;
|
||||
@@ -125,7 +125,7 @@ void dlsch_scrambling(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
// x1 is set in lte_gold_generic
|
||||
if (mbsfn_flag == 0) {
|
||||
#ifdef Rel14
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (dlsch->harq_processes[harq_pid]->i0 != 0xFFFF) {
|
||||
#else
|
||||
if (dlsch->i0 != 0xFFFF) {
|
||||
|
||||
@@ -290,6 +290,7 @@ int32_t allocate_REs_in_RB(PHY_VARS_eNB* phy_vars_eNB,
|
||||
int32_t dlsch_modulation(PHY_VARS_eNB* phy_vars_eNB,
|
||||
int32_t **txdataF,
|
||||
int16_t amp,
|
||||
int frame,
|
||||
uint32_t sub_frame_offset,
|
||||
uint8_t num_pdcch_symbols,
|
||||
LTE_eNB_DLSCH_t *dlsch0,
|
||||
@@ -2259,18 +2260,10 @@ uint8_t get_prach_prb_offset(LTE_DL_FRAME_PARMS *frame_parms,
|
||||
|
||||
uint8_t ul_subframe2pdcch_alloc_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t n);
|
||||
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
|
||||
int8_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
|
||||
int8_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
#else
|
||||
int16_t find_dlsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
|
||||
int16_t find_ulsch(uint16_t rnti, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
|
||||
int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type);
|
||||
#endif
|
||||
/**@}*/
|
||||
#endif
|
||||
|
||||
@@ -788,18 +788,10 @@ void print_CQI(void *o,UCI_format_t uci_format,unsigned char eNB_id,int N_RB_DL)
|
||||
|
||||
}
|
||||
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) {
|
||||
#else
|
||||
|
||||
int16_t find_uci(uint16_t rnti, int frame, int subframe, PHY_VARS_eNB *eNB,find_type_t type) {
|
||||
#endif
|
||||
#ifndef UE_EXPANSION
|
||||
uint8_t i;
|
||||
int8_t first_free_index=-1;
|
||||
#else
|
||||
uint16_t i;
|
||||
int16_t first_free_index=-1;
|
||||
#endif
|
||||
AssertFatal(eNB!=NULL,"eNB is null\n");
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
if ((eNB->uci_vars[i].active >0) &&
|
||||
|
||||
@@ -934,9 +934,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
||||
nb_rb);
|
||||
|
||||
//#endif
|
||||
#ifndef UE_EXPANSION
|
||||
if (ulsch_harq->round == 0) {
|
||||
#endif
|
||||
//if (ulsch_harq->round == 0) { // delete for RB shortage pattern
|
||||
// This is a new packet, so compute quantities regarding segmentation
|
||||
ulsch_harq->B = A+24;
|
||||
lte_segmentation(NULL,
|
||||
@@ -949,9 +947,7 @@ unsigned int ulsch_decoding(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
||||
&ulsch_harq->Kminus,
|
||||
&ulsch_harq->F);
|
||||
// CLEAR LLR's HERE for first packet in process
|
||||
#ifndef UE_EXPANSION
|
||||
}
|
||||
#endif
|
||||
//}
|
||||
// printf("after segmentation c[%d] = %p\n",0,ulsch_harq->c[0]);
|
||||
|
||||
sumKr = 0;
|
||||
|
||||
@@ -1035,6 +1035,11 @@ void ulsch_channel_compensation(int32_t **rxdataF_ext,
|
||||
|
||||
|
||||
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128 avg128U;
|
||||
#elif defined(__arm__)
|
||||
int32x4_t avg128U;
|
||||
#endif
|
||||
|
||||
void ulsch_channel_level(int32_t **drs_ch_estimates_ext,
|
||||
LTE_DL_FRAME_PARMS *frame_parms,
|
||||
@@ -1045,24 +1050,21 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext,
|
||||
int16_t rb;
|
||||
uint8_t aarx;
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
__m128i avg128U;
|
||||
__m128i *ul_ch128;
|
||||
#elif defined(__arm__)
|
||||
int16x4_t *ul_ch128;
|
||||
int32x4_t avg128U;
|
||||
#endif
|
||||
|
||||
for (aarx=0; aarx<frame_parms->nb_antennas_rx; aarx++) {
|
||||
//clear average level
|
||||
#if defined(__x86_64__) || defined(__i386__)
|
||||
avg128U = _mm_setzero_si128();
|
||||
avg128U = _mm_setzero_ps();
|
||||
ul_ch128=(__m128i *)drs_ch_estimates_ext[aarx];
|
||||
|
||||
for (rb=0; rb<nb_rb; rb++) {
|
||||
|
||||
avg128U = _mm_add_epi32(avg128U,_mm_madd_epi16(ul_ch128[0],ul_ch128[0]));
|
||||
avg128U = _mm_add_epi32(avg128U,_mm_madd_epi16(ul_ch128[1],ul_ch128[1]));
|
||||
avg128U = _mm_add_epi32(avg128U,_mm_madd_epi16(ul_ch128[2],ul_ch128[2]));
|
||||
avg128U = _mm_add_ps(avg128U,_mm_cvtepi32_ps(_mm_madd_epi16(ul_ch128[0],ul_ch128[0])));
|
||||
avg128U = _mm_add_ps(avg128U,_mm_cvtepi32_ps(_mm_madd_epi16(ul_ch128[1],ul_ch128[1])));
|
||||
avg128U = _mm_add_ps(avg128U,_mm_cvtepi32_ps(_mm_madd_epi16(ul_ch128[2],ul_ch128[2])));
|
||||
|
||||
ul_ch128+=3;
|
||||
|
||||
@@ -1089,10 +1091,10 @@ void ulsch_channel_level(int32_t **drs_ch_estimates_ext,
|
||||
#endif
|
||||
|
||||
DevAssert( nb_rb );
|
||||
avg[aarx] = (((int*)&avg128U)[0] +
|
||||
((int*)&avg128U)[1] +
|
||||
((int*)&avg128U)[2] +
|
||||
((int*)&avg128U)[3])/(nb_rb*12);
|
||||
avg[aarx] = (int)((((float*)&avg128U)[0] +
|
||||
((float*)&avg128U)[1] +
|
||||
((float*)&avg128U)[2] +
|
||||
((float*)&avg128U)[3])/(float)(nb_rb*12));
|
||||
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -422,7 +422,7 @@ typedef struct RU_proc_t_s {
|
||||
int num_slaves;
|
||||
/// array of pointers to slaves
|
||||
struct RU_proc_t_s **slave_proc;
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
/// pthread structure for PRACH thread
|
||||
pthread_t pthread_phy_tx;
|
||||
pthread_mutex_t mutex_phy_tx;
|
||||
@@ -442,7 +442,7 @@ typedef struct RU_proc_t_s {
|
||||
/// \internal This variable is protected by \ref mutex_rf_tx.
|
||||
int instance_cnt_rf_tx;
|
||||
#endif
|
||||
#if defined(UE_EXPANSION) || defined(UE_EXPANSION_SIM2)
|
||||
#if defined(PRE_SCD_THREAD)
|
||||
pthread_t pthread_pre_scd;
|
||||
/// condition variable for time processing thread
|
||||
pthread_cond_t cond_pre_scd;
|
||||
|
||||
@@ -637,9 +637,8 @@ typedef struct {
|
||||
uint16_t phich_reg[MAX_NUM_PHICH_GROUPS][3];
|
||||
|
||||
struct MBSFN_SubframeConfig *mbsfn_SubframeConfig[MAX_MBSFN_AREA];
|
||||
#ifdef UE_EXPANSION
|
||||
/// for fair RR scheduler
|
||||
uint32_t ue_multiple_max;
|
||||
#endif
|
||||
} LTE_DL_FRAME_PARMS;
|
||||
|
||||
typedef enum {
|
||||
|
||||
@@ -511,11 +511,7 @@ LTE_DL_FRAME_PARMS *get_lte_frame_parms(module_id_t Mod_id, uint8_t CC_id);
|
||||
MU_MIMO_mode* get_mu_mimo_mode (module_id_t Mod_id, uint8_t CC_id, rnti_t rnti);
|
||||
|
||||
int16_t get_hundred_times_delta_IF(PHY_VARS_UE *phy_vars_ue,uint8_t eNB_id,uint8_t harq_pid);
|
||||
#ifndef UE_EXPANSION
|
||||
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor);
|
||||
#else
|
||||
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor);
|
||||
#endif
|
||||
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid);
|
||||
|
||||
int16_t get_target_pusch_rx_power(module_id_t module_idP, uint8_t CC_id);
|
||||
|
||||
+36
-31
@@ -165,24 +165,24 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
dlsch1 = eNB->dlsch[UE_id][1];
|
||||
|
||||
#ifdef Rel14
|
||||
if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[subframe] = 0;
|
||||
if ((rel13->pdsch_payload_type < 2) && (rel13->ue_type>0)) dlsch0->harq_ids[frame%2][subframe] = 0;
|
||||
#endif
|
||||
|
||||
harq_pid = dlsch0->harq_ids[subframe];
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe];
|
||||
AssertFatal((harq_pid>=0) && (harq_pid<8),"harq_pid %d not in 0...7 frame:%d subframe:%d subframe(TX):%d rnti:%x UE_id:%d dlsch0[harq_ids:%d:%d:%d:%d:%d:%d:%d:%d:%d:%d]\n",
|
||||
harq_pid,
|
||||
frame,subframe,
|
||||
proc->subframe_tx,rel8->rnti,UE_id,
|
||||
dlsch0->harq_ids[0],
|
||||
dlsch0->harq_ids[1],
|
||||
dlsch0->harq_ids[2],
|
||||
dlsch0->harq_ids[3],
|
||||
dlsch0->harq_ids[4],
|
||||
dlsch0->harq_ids[5],
|
||||
dlsch0->harq_ids[6],
|
||||
dlsch0->harq_ids[7],
|
||||
dlsch0->harq_ids[8],
|
||||
dlsch0->harq_ids[9]
|
||||
dlsch0->harq_ids[frame%2][0],
|
||||
dlsch0->harq_ids[frame%2][1],
|
||||
dlsch0->harq_ids[frame%2][2],
|
||||
dlsch0->harq_ids[frame%2][3],
|
||||
dlsch0->harq_ids[frame%2][4],
|
||||
dlsch0->harq_ids[frame%2][5],
|
||||
dlsch0->harq_ids[frame%2][6],
|
||||
dlsch0->harq_ids[frame%2][7],
|
||||
dlsch0->harq_ids[frame%2][8],
|
||||
dlsch0->harq_ids[frame%2][9]
|
||||
);
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
@@ -191,7 +191,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
// compute DL power control parameters
|
||||
eNB->pdsch_config_dedicated[UE_id].p_a = rel8->pa;
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (dlsch0->active[proc->subframe_tx]){
|
||||
# else
|
||||
if (dlsch0->active){
|
||||
@@ -199,7 +199,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
computeRhoA_eNB(&eNB->pdsch_config_dedicated[UE_id], dlsch0,dlsch0_harq->dl_power_off, eNB->frame_parms.nb_antenna_ports_eNB);
|
||||
computeRhoB_eNB(&eNB->pdsch_config_dedicated[UE_id],&(eNB->frame_parms.pdsch_config_common),eNB->frame_parms.nb_antenna_ports_eNB,dlsch0,dlsch0_harq->dl_power_off);
|
||||
}
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (dlsch1->active[proc->subframe_tx]){
|
||||
#else
|
||||
if (dlsch1->active){
|
||||
@@ -231,7 +231,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
}
|
||||
|
||||
#ifdef Rel14
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->sib1_br_flag=0;
|
||||
#else
|
||||
dlsch0->sib1_br_flag=0;
|
||||
@@ -243,7 +243,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
dlsch0->Mdlharq = 4;
|
||||
dlsch0->Nsoft = 25344;
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
if (rel13->pdsch_payload_type == 0) dlsch0_harq->sib1_br_flag=1;
|
||||
#else
|
||||
if (rel13->pdsch_payload_type == 0) dlsch0->sib1_br_flag=1;
|
||||
@@ -274,7 +274,7 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
dlsch0_harq->rb_alloc[3] = localRIV2alloc_LUT100_3[rel8->resource_block_coding];
|
||||
}
|
||||
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0->active[proc->subframe_tx]= 1;
|
||||
#else
|
||||
dlsch0->active = 1;
|
||||
@@ -294,21 +294,21 @@ void handle_nfapi_dlsch_pdu(PHY_VARS_eNB *eNB,int frame,int subframe,eNB_rxtx_pr
|
||||
dlsch0_harq->pdsch_start = rel10->pdsch_start;
|
||||
}
|
||||
else {
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->i0 = 0xFFFF;
|
||||
#else
|
||||
dlsch0->i0 = 0xFFFF;
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->i0 = rel13->initial_transmission_sf_io;
|
||||
#else
|
||||
dlsch0->i0 = rel13->initial_transmission_sf_io;
|
||||
#endif
|
||||
|
||||
LOG_D(PHY,"dlsch->i0:%04x dlsch0_harq[pdsch_start:%d nb_rb:%d vrb_type:%d rvidx:%d Nl:%d mimo_mode:%d dl_power_off:%d round:%d status:%d TBS:%d Qm:%d codeword:%d rb_alloc:%d] rel8[length:%d]\n",
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch0_harq->i0,
|
||||
#else
|
||||
dlsch0->i0,
|
||||
@@ -339,6 +339,9 @@ void handle_ulsch_harq_pdu(
|
||||
ulsch_harq->subframe = subframe;
|
||||
ulsch_harq->O_ACK = harq_information->harq_information_rel10.harq_size;
|
||||
ulsch->beta_offset_harqack_times8 = to_beta_offset_harqack[harq_information->harq_information_rel10.delta_offset_harq];
|
||||
if (harq_information->harq_information_rel10.ack_nack_mode==0) //bundling
|
||||
ulsch->bundling = 1;
|
||||
|
||||
}
|
||||
|
||||
uint16_t to_beta_offset_ri[16]={9,13,16,20,25,32,40,50,64,80,101,127,160,0,0,0};
|
||||
@@ -563,11 +566,7 @@ void handle_nfapi_ul_pdu(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,
|
||||
uint16_t frame,uint8_t subframe,uint8_t srs_present)
|
||||
{
|
||||
nfapi_ul_config_ulsch_pdu_rel8_t *rel8 = &ul_config_pdu->ulsch_pdu.ulsch_pdu_rel8;
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t UE_id;
|
||||
#else
|
||||
int16_t UE_id;
|
||||
#endif
|
||||
|
||||
// check if we have received a dci for this ue and ulsch descriptor is configured
|
||||
|
||||
@@ -686,13 +685,19 @@ void schedule_response(Sched_Rsp_t *Sched_INFO)
|
||||
eNB->pdcch_vars[subframe&1].num_dci = 0;
|
||||
eNB->phich_vars[subframe&1].num_hi = 0;
|
||||
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d hi_dci0:SFN/SF:%04d%d:pdus:%d ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n",
|
||||
frame,subframe,
|
||||
NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu,
|
||||
NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus,
|
||||
NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu,
|
||||
NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu,
|
||||
eNB->pdcch_vars[subframe&1].num_pdcch_symbols);
|
||||
LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%04d%d DL_req:SFN/SF:%04d%d:dl_pdu:%d tx_req:SFN/SF:%04d%d:pdus:%d\n",
|
||||
frame,subframe,
|
||||
NFAPI_SFNSF2SFN(DL_req->sfn_sf),NFAPI_SFNSF2SF(DL_req->sfn_sf),number_dl_pdu,
|
||||
NFAPI_SFNSF2SFN(TX_req->sfn_sf),NFAPI_SFNSF2SF(TX_req->sfn_sf),TX_req->tx_request_body.number_of_pdus
|
||||
);
|
||||
LOG_D(PHY,"NFAPI: hi_dci0:SFN/SF:%04d%d:pdus:%d\n",
|
||||
NFAPI_SFNSF2SFN(HI_DCI0_req->sfn_sf),NFAPI_SFNSF2SF(HI_DCI0_req->sfn_sf),number_hi_dci0_pdu
|
||||
);
|
||||
if(UL_req!=NULL)
|
||||
LOG_D(PHY,"NFAPI: ul_cfg:SFN/SF:%04d%d:pdus:%d num_pdcch_symbols:%d\n",
|
||||
NFAPI_SFNSF2SFN(UL_req->sfn_sf),NFAPI_SFNSF2SF(UL_req->sfn_sf),number_ul_pdu,
|
||||
eNB->pdcch_vars[subframe&1].num_pdcch_symbols);
|
||||
|
||||
|
||||
int do_oai =0;
|
||||
int dont_send =0;
|
||||
|
||||
@@ -336,6 +336,29 @@ unsigned char ul_ACK_subframe2_dl_subframe(LTE_DL_FRAME_PARMS *frame_parms,unsig
|
||||
return(0);
|
||||
}
|
||||
|
||||
int ul_ACK_subframe2_dl_frame(LTE_DL_FRAME_PARMS *frame_parms,int frame, unsigned char subframe,unsigned char subframe_tx)
|
||||
{
|
||||
|
||||
if (frame_parms->frame_type == FDD) {
|
||||
return (((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024;
|
||||
} else {
|
||||
switch (frame_parms->tdd_config) {
|
||||
case 1:
|
||||
return(((subframe_tx > subframe ) ? frame-1 : frame)+1024)%1024;
|
||||
break;
|
||||
case 3:
|
||||
//TODO
|
||||
break;
|
||||
case 4:
|
||||
//TODO
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char subframe)
|
||||
{
|
||||
|
||||
@@ -343,6 +366,23 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
|
||||
return(1);
|
||||
} else {
|
||||
switch (frame_parms->tdd_config) {
|
||||
case 1:
|
||||
return 1; // don't ACK special subframe for now
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(2);
|
||||
} else if (subframe == 3) { // ACK subframe 9
|
||||
return(1); // To be updated
|
||||
} else if (subframe == 7) { // ACK subframes 0 and 1
|
||||
return(2); // To be updated
|
||||
} else if (subframe == 8) { // ACK subframe 4
|
||||
return(1); // To be updated
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
break;
|
||||
case 3:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(2); // should be 3
|
||||
@@ -381,23 +421,6 @@ unsigned char ul_ACK_subframe2_M(LTE_DL_FRAME_PARMS *frame_parms,unsigned char s
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 1:
|
||||
if (subframe == 2) { // ACK subframes 5 and 6
|
||||
return(2);
|
||||
} else if (subframe == 3) { // ACK subframe 9
|
||||
return(1); // To be updated
|
||||
} else if (subframe == 7) { // ACK subframes 0 and 1
|
||||
return(2); // To be updated
|
||||
} else if (subframe == 8) { // ACK subframe 4
|
||||
return(1); // To be updated
|
||||
} else {
|
||||
LOG_E(PHY,"phy_procedures_lte_common.c/subframe2_dl_harq_pid: illegal subframe %d for tdd_config %d\n",
|
||||
subframe,frame_parms->tdd_config);
|
||||
return(0);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -149,10 +149,20 @@ void common_signal_procedures (PHY_VARS_eNB *eNB,int frame, int subframe) {
|
||||
|
||||
// generate Cell-Specific Reference Signals for both slots
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_ENB_RS_TX,1);
|
||||
|
||||
if(subframe_select(fp,subframe) == SF_S)
|
||||
generate_pilots_slot(eNB,
|
||||
txdataF,
|
||||
AMP,
|
||||
subframe<<1,1);
|
||||
else
|
||||
generate_pilots_slot(eNB,
|
||||
txdataF,
|
||||
AMP,
|
||||
subframe<<1,0);
|
||||
|
||||
// check that 2nd slot is for DL
|
||||
|
||||
// check that 2nd slot is for DL
|
||||
if (subframe_select(fp,subframe) == SF_DL)
|
||||
generate_pilots_slot(eNB,
|
||||
@@ -379,6 +389,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
dlsch_modulation(eNB,
|
||||
eNB->common_vars.txdataF,
|
||||
AMP,
|
||||
frame,
|
||||
subframe,
|
||||
dlsch_harq->pdsch_start,
|
||||
dlsch,
|
||||
@@ -386,7 +397,7 @@ void pdsch_procedures(PHY_VARS_eNB *eNB,
|
||||
|
||||
stop_meas(&eNB->dlsch_modulation_stats);
|
||||
}
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
dlsch->active[subframe] = 0;
|
||||
#else
|
||||
dlsch->active = 0;
|
||||
@@ -409,11 +420,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
int subframe=proc->subframe_tx;
|
||||
uint32_t i,aa;
|
||||
uint8_t harq_pid;
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t UE_id=0;
|
||||
#else
|
||||
int16_t UE_id=0;
|
||||
#endif
|
||||
uint8_t num_pdcch_symbols=0;
|
||||
uint8_t num_dci=0;
|
||||
uint8_t ul_subframe;
|
||||
@@ -533,14 +540,14 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
|
||||
if ((dlsch0)&&
|
||||
(dlsch0->rnti>0)&&
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
(dlsch0->active[subframe] == 1)) {
|
||||
#else
|
||||
(dlsch0->active == 1)) {
|
||||
#endif
|
||||
|
||||
// get harq_pid
|
||||
harq_pid = dlsch0->harq_ids[subframe];
|
||||
harq_pid = dlsch0->harq_ids[frame%2][subframe];
|
||||
AssertFatal(harq_pid>=0,"harq_pid is negative\n");
|
||||
|
||||
if (harq_pid>=8)
|
||||
@@ -565,7 +572,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
|
||||
|
||||
else if ((dlsch0)&&
|
||||
(dlsch0->rnti>0)&&
|
||||
#ifdef UE_EXPANSION
|
||||
#ifdef PHY_TX_THREAD
|
||||
(dlsch0->active[subframe] == 0)) {
|
||||
#else
|
||||
(dlsch0->active == 0)) {
|
||||
@@ -878,7 +885,7 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
LOG_E(PHY,"Unknown number for N_RB_UL %d\n",fp->N_RB_UL);
|
||||
break;
|
||||
}
|
||||
|
||||
SR_payload = 0;
|
||||
switch (uci->type) {
|
||||
case SR:
|
||||
case HARQ_SR:
|
||||
@@ -893,12 +900,13 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1_THRES);
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (SR n1pucch is %d)\n",
|
||||
LOG_D(PHY,"[eNB %d][SR %x] Frame %d subframe %d Checking SR is %d (uci.type %d SR n1pucch is %d)\n",
|
||||
eNB->Mod_id,
|
||||
uci->rnti,
|
||||
frame,
|
||||
subframe,
|
||||
SR_payload,
|
||||
uci->type,
|
||||
uci->n_pucch_1_0_sr[0]);
|
||||
if (uci->type == SR) {
|
||||
if (SR_payload == 1) {
|
||||
@@ -961,8 +969,34 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
|
||||
}
|
||||
else { // frame_type == TDD
|
||||
#if 1
|
||||
metric[0] = rx_pucch(eNB,
|
||||
uci->pucch_fmt,
|
||||
i,
|
||||
uci->n_pucch_1[0][0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
if (uci->type==HARQ_SR && metric[0] > metric_SR) SR_payload = 0;
|
||||
else if (SR_payload == 1) fill_sr_indication(eNB,uci->rnti,frame,subframe,metric_SR);
|
||||
|
||||
|
||||
if (uci->type==HARQ_SR && metric[0] <= metric_SR) {
|
||||
SR_payload = 1;
|
||||
metric[0] = rx_pucch(eNB,
|
||||
pucch_format1b,
|
||||
i,
|
||||
uci->n_pucch_1_0_sr[0],
|
||||
0, //n2_pucch
|
||||
uci->srs_active, // shortened format
|
||||
pucch_b0b1[0],
|
||||
frame,
|
||||
subframe,
|
||||
PUCCH1a_THRES);
|
||||
}
|
||||
#else
|
||||
// if SR was detected, use the n1_pucch from SR
|
||||
if (SR_payload==1) {
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
@@ -1009,22 +1043,25 @@ void uci_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
#ifdef DEBUG_PHY_PROC
|
||||
LOG_D(PHY,"RNTI %x type %d SR_payload %d Frame %d Subframe %d pucch_b0b1[0][0] %d pucch_b0b1[0][1] %d pucch_b0b1[1][0] %d pucch_b0b1[1][1] %d \n",
|
||||
uci->rnti,uci->type,SR_payload,frame,subframe,pucch_b0b1[0][0],pucch_b0b1[0][1],pucch_b0b1[1][0],pucch_b0b1[1][1]);
|
||||
#endif
|
||||
#endif
|
||||
if (SR_payload == 1) { // this implements Table 7.3.1 from 36.213
|
||||
if (pucch_b0b1[0][0] == 4) { // there isn't a likely transmission
|
||||
harq_ack[0] = 4; // DTX
|
||||
}
|
||||
else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] == 1) { // 1/4/7 ACKs
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] == 1) { // 1/4/7 ACKs
|
||||
harq_ack[0] = 1;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] == 1 && pucch_b0b1[1][1] != 1) { // 2/5/8 ACKs
|
||||
else if (pucch_b0b1[0][0] == 1 && pucch_b0b1[0][1] != 1) { // 2/5/8 ACKs
|
||||
harq_ack[0] = 2;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] == 1) { // 3/6/9 ACKs
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] == 1) { // 3/6/9 ACKs
|
||||
harq_ack[0] = 3;
|
||||
}
|
||||
else if (pucch_b0b1[1][0] != 1 && pucch_b0b1[1][1] != 1) { // 0 ACKs, or at least one DL assignment missed
|
||||
else if (pucch_b0b1[0][0] != 1 && pucch_b0b1[0][1] != 1) { // 0 ACKs, or at least one DL assignment missed
|
||||
harq_ack[0] = 0;
|
||||
}
|
||||
uci->stat = metric[0];
|
||||
@@ -1340,8 +1377,7 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
const int subframe = proc->subframe_rx;
|
||||
const int frame = proc->frame_rx;
|
||||
|
||||
if (fp->frame_type == FDD) harq_pid = ((10*frame) + subframe)&7;
|
||||
else harq_pid = subframe%10;
|
||||
harq_pid = subframe2harq_pid(&eNB->frame_parms,frame,subframe);
|
||||
|
||||
for (i=0; i<NUMBER_OF_UE_MAX; i++) {
|
||||
ulsch = eNB->ulsch[i];
|
||||
@@ -1433,6 +1469,13 @@ void pusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
|
||||
fill_ulsch_cqi_indication(eNB,frame,subframe,
|
||||
ulsch_harq,
|
||||
ulsch->rnti);
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
}else{
|
||||
if(RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag & (1 << subframe) ){
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_flag &= (~(1 << subframe));
|
||||
RC.mac[eNB->Mod_id]->UE_list.UE_sched_ctrl[i].cqi_req_timer=30;
|
||||
LOG_D(PHY,"Frame %d,Subframe %d, We're supposed to get a cqi here. Set cqi_req_timer to 30.\n",frame,subframe);
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == (1+MAX_TURBO_ITERATIONS)) {
|
||||
@@ -1638,7 +1681,7 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf
|
||||
LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL;
|
||||
LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
|
||||
int harq_pid;
|
||||
int subframe_tx;
|
||||
int subframe_tx,frame_tx;
|
||||
int M,m;
|
||||
|
||||
AssertFatal(UE_id!=-1,"no existing dlsch context\n");
|
||||
@@ -1648,7 +1691,9 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf
|
||||
|
||||
if (eNB->frame_parms.frame_type == FDD) {
|
||||
subframe_tx = (subframe+6)%10;
|
||||
harq_pid = dlsch0->harq_ids[subframe_tx];
|
||||
frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,subframe,subframe_tx);
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx]; // or just use 0 for fdd?
|
||||
|
||||
AssertFatal((harq_pid>=0) && (harq_pid<10),"harq_pid %d not in 0...9\n",harq_pid);
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
@@ -1671,9 +1716,10 @@ void release_harq(PHY_VARS_eNB *eNB,int UE_id,int tb,uint16_t frame,uint8_t subf
|
||||
subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms,
|
||||
subframe,
|
||||
m);
|
||||
frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,subframe,subframe_tx);
|
||||
if (((1<<m)&mask) > 0) {
|
||||
harq_pid = dlsch0->harq_ids[subframe_tx];
|
||||
if ((harq_pid>=0) && (harq_pid<10)) {
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
if ((harq_pid>=0) && (harq_pid<dlsch0->Mdlharq)) {
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
AssertFatal(dlsch0_harq!=NULL,"dlsch0_harq is null\n");
|
||||
@@ -1695,7 +1741,7 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||
LTE_eNB_DLSCH_t *dlsch0=NULL,*dlsch1=NULL;
|
||||
LTE_DL_eNB_HARQ_t *dlsch0_harq=NULL,*dlsch1_harq=NULL;
|
||||
int harq_pid;
|
||||
int subframe_tx;
|
||||
int subframe_tx,frame_tx;
|
||||
int m;
|
||||
|
||||
M=ul_ACK_subframe2_M(&eNB->frame_parms,
|
||||
@@ -1705,7 +1751,10 @@ int getM(PHY_VARS_eNB *eNB,int frame,int subframe) {
|
||||
subframe_tx = ul_ACK_subframe2_dl_subframe(&eNB->frame_parms,
|
||||
subframe,
|
||||
m);
|
||||
harq_pid = dlsch0->harq_ids[subframe_tx];
|
||||
frame_tx = ul_ACK_subframe2_dl_frame(&eNB->frame_parms,frame,
|
||||
subframe,subframe_tx);
|
||||
harq_pid = dlsch0->harq_ids[frame_tx%2][subframe_tx];
|
||||
|
||||
if (harq_pid>=0 && harq_pid<10) {
|
||||
dlsch0_harq = dlsch0->harq_processes[harq_pid];
|
||||
dlsch1_harq = dlsch1->harq_processes[harq_pid];
|
||||
@@ -1809,7 +1858,7 @@ void fill_ulsch_harq_indication(PHY_VARS_eNB *eNB,LTE_UL_eNB_HARQ_t *ulsch_harq,
|
||||
for (i=0;i<ulsch_harq->O_ACK;i++) {
|
||||
AssertFatal(ulsch_harq->o_ACK[i] == 0 || ulsch_harq->o_ACK[i] == 1, "harq_ack[%d] is %d, should be 1,2 or 4\n",i,ulsch_harq->o_ACK[i]);
|
||||
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].multiplex.value_0 = 2-ulsch_harq->o_ACK[i];
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 2-ulsch_harq->o_ACK[i];
|
||||
// release DLSCH if needed
|
||||
if (ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,i,frame,subframe,0xffff);
|
||||
if (M==1 && ulsch_harq->O_ACK==1 && ulsch_harq->o_ACK[i] == 1) release_harq(eNB,UE_id,0,frame,subframe,0xffff);
|
||||
@@ -1911,7 +1960,7 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
|
||||
|
||||
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
|
||||
pdu->harq_indication_tdd_rel13.mode = tdd_mapping_mode;
|
||||
|
||||
LOG_D(PHY,"%s(eNB, uci_harq format %d, rnti:%04x, frame:%d, subframe:%d, tdd_mapping_mode:%d) harq_ack[0]:%d harq_ack[1]:%d\n", __FUNCTION__, uci->pucch_fmt,uci->rnti, frame, subframe, tdd_mapping_mode,harq_ack[0],harq_ack[1]);
|
||||
switch (tdd_mapping_mode) {
|
||||
case 0: // bundling
|
||||
|
||||
@@ -1973,31 +2022,43 @@ void fill_uci_harq_indication(PHY_VARS_eNB *eNB,
|
||||
case 2: // special bundling (SR collision)
|
||||
pdu->harq_indication_tdd_rel13.tl.tag = NFAPI_HARQ_INDICATION_TDD_REL13_TAG;
|
||||
pdu->harq_indication_tdd_rel13.number_of_ack_nack = 1;
|
||||
pdu->harq_indication_tdd_rel13.mode = 0;
|
||||
int tdd_config5_sf2scheds=0;
|
||||
if (eNB->frame_parms.tdd_config==5) tdd_config5_sf2scheds = getM(eNB,frame,subframe);
|
||||
|
||||
switch (harq_ack[0]) {
|
||||
case 0:
|
||||
case 4:
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
|
||||
break;
|
||||
case 1: // check if M=1,4,7
|
||||
if (uci->num_pucch_resources == 1 || uci->num_pucch_resources == 4 ||
|
||||
tdd_config5_sf2scheds == 1 || tdd_config5_sf2scheds == 4 || tdd_config5_sf2scheds == 7) {
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
|
||||
release_harq(eNB,UE_id,0,frame,subframe,0xffff);
|
||||
release_harq(eNB,UE_id,1,frame,subframe,0xffff);
|
||||
}else{
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
|
||||
}
|
||||
break;
|
||||
case 2: // check if M=2,5,8
|
||||
if (uci->num_pucch_resources == 2 || tdd_config5_sf2scheds == 2 ||
|
||||
tdd_config5_sf2scheds == 5 || tdd_config5_sf2scheds == 8) {
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
|
||||
release_harq(eNB,UE_id,0,frame,subframe,0xffff);
|
||||
release_harq(eNB,UE_id,1,frame,subframe,0xffff);
|
||||
}else{
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
|
||||
}
|
||||
break;
|
||||
case 3: // check if M=3,6,9
|
||||
if (uci->num_pucch_resources == 3 || tdd_config5_sf2scheds == 3 ||
|
||||
tdd_config5_sf2scheds == 6 || tdd_config5_sf2scheds == 9) {
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 1;
|
||||
release_harq(eNB,UE_id,0,frame,subframe,0xffff);
|
||||
release_harq(eNB,UE_id,1,frame,subframe,0xffff);
|
||||
}else{
|
||||
pdu->harq_indication_tdd_rel13.harq_data[0].bundling.value_0 = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -38,11 +38,7 @@
|
||||
// This is the formula from Section 5.1.1.1 in 36.213 100*10*log10((2^(MPR*Ks)-1)), where MPR is in the range [0,6] and Ks=1.25
|
||||
int16_t hundred_times_delta_TF[100] = {-32768,-1268,-956,-768,-631,-523,-431,-352,-282,-219,-161,-107,-57,-9,36,79,120,159,197,234,269,304,337,370,402,434,465,495,525,555,583,612,640,668,696,723,750,777,803,829,856,881,907,933,958,983,1008,1033,1058,1083,1108,1132,1157,1181,1205,1229,1254,1278,1302,1325,1349,1373,1397,1421,1444,1468,1491,1515,1538,1562,1585,1609,1632,1655,1679,1702,1725,1748,1772,1795,1818,1841,1864,1887,1910,1933,1956,1980,2003,2026,2049,2072,2095,2118,2141,2164,2186,2209,2232,2255};
|
||||
uint16_t hundred_times_log10_NPRB[100] = {0,301,477,602,698,778,845,903,954,1000,1041,1079,1113,1146,1176,1204,1230,1255,1278,1301,1322,1342,1361,1380,1397,1414,1431,1447,1462,1477,1491,1505,1518,1531,1544,1556,1568,1579,1591,1602,1612,1623,1633,1643,1653,1662,1672,1681,1690,1698,1707,1716,1724,1732,1740,1748,1755,1763,1770,1778,1785,1792,1799,1806,1812,1819,1826,1832,1838,1845,1851,1857,1863,1869,1875,1880,1886,1892,1897,1903,1908,1913,1919,1924,1929,1934,1939,1944,1949,1954,1959,1963,1968,1973,1977,1982,1986,1991,1995,2000};
|
||||
#ifndef UE_EXPANSION
|
||||
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint8_t UE_id,uint8_t harq_pid, uint8_t bw_factor)
|
||||
#else
|
||||
int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t harq_pid, uint8_t bw_factor)
|
||||
#endif
|
||||
{
|
||||
|
||||
uint32_t Nre,sumKr,MPR_x100,Kr,r;
|
||||
@@ -93,11 +89,7 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *eNB,uint16_t UE_id,uint8_t
|
||||
|
||||
int16_t get_hundred_times_delta_IF_mac(module_id_t module_idP, uint8_t CC_id, rnti_t rnti, uint8_t harq_pid)
|
||||
{
|
||||
#ifndef UE_EXPANSION
|
||||
int8_t UE_id;
|
||||
#else
|
||||
int16_t UE_id;
|
||||
#endif
|
||||
if ((RC.eNB == NULL) || (module_idP > RC.nb_inst) || (CC_id > RC.nb_CC[module_idP])) {
|
||||
LOG_E(PHY,"get_UE_stats: No eNB found (or not allocated) for Mod_id %d,CC_id %d\n",module_idP,CC_id);
|
||||
return -1;
|
||||
|
||||
@@ -112,7 +112,7 @@ void feptx0(RU_t *ru,int slot) {
|
||||
}
|
||||
*/
|
||||
// TDD: turn on tx switch N_TA_offset before by setting buffer in these samples to 0
|
||||
if ((slot == 0) &&
|
||||
/* if ((slot == 0) &&
|
||||
(fp->frame_type == TDD) &&
|
||||
((fp->tdd_config==0) ||
|
||||
(fp->tdd_config==1) ||
|
||||
@@ -129,7 +129,7 @@ void feptx0(RU_t *ru,int slot) {
|
||||
|
||||
ru->common.txdata[aa][tx_offset] = 0x00000000;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_RU_FEPTX_OFDM+slot , 0);
|
||||
}
|
||||
|
||||
@@ -3426,6 +3426,7 @@ int main(int argc, char **argv)
|
||||
re_allocated = dlsch_modulation(eNB,
|
||||
eNB->common_vars.txdataF[eNB_id],
|
||||
AMP,
|
||||
frame,
|
||||
subframe,
|
||||
num_pdcch_symbols,
|
||||
((TB0_active == 1)? eNB->dlsch[k][0]: NULL),
|
||||
|
||||
@@ -2679,6 +2679,7 @@ PMI_FEEDBACK:
|
||||
re_allocated = dlsch_modulation(eNB,
|
||||
eNB->common_vars.txdataF[eNB_id],
|
||||
AMP,
|
||||
frame,
|
||||
subframe,
|
||||
num_pdcch_symbols,
|
||||
eNB->dlsch[k][0],
|
||||
|
||||
Reference in New Issue
Block a user