Commit 4171dcc0 authored by Maud Tribaudeau's avatar Maud Tribaudeau Committed by Laurent THOMAS

Add full tdd 6 - cleanup not used function

parent c5aeaf03
......@@ -414,8 +414,8 @@ int phy_init_lte_eNB(PHY_VARS_eNB *eNB,
eNB->Mod_id, fp->N_RB_DL, fp->phich_config_common.phich_resource, fp->phich_config_common.phich_duration);
crcTableInit();
lte_gold (fp, eNB->lte_gold_table, fp->Nid_cell);
generate_pcfich_reg_mapping (fp);
generate_phich_reg_mapping (fp);
generate_pcfich_reg_mapping(fp);
generate_phich_reg_mapping(fp);
init_sss();
init_fde();
......
......@@ -723,6 +723,9 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
if (((frame_parms->phich_config_common.phich_resource*frame_parms->N_RB_DL)%48) > 0)
Ngroup_PHICH++;
uint8_t mi = get_mi(frame_parms, subframe);
Ngroup_PHICH *= mi;
if (frame_parms->Ncp == 1)
NSF_PHICH = 2;
......@@ -750,28 +753,42 @@ void generate_phich_top(PHY_VARS_eNB *eNB,
LOG_E(PHY,"FATAL ERROR: illegal harq_pid, returning\n");
return;
}
LOG_D(PHY,"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI %d, first_rb %d)\n",
eNB->Mod_id,harq_pid,proc->frame_tx,
subframe,amp,ngroup_PHICH,Ngroup_PHICH,nseq_PHICH,
phich->hi,
phich->first_rb);
T(T_ENB_PHY_PHICH, T_INT(eNB->Mod_id), T_INT(proc->frame_tx), T_INT(subframe),
T_INT(-1 /* TODO: rnti */),
T_INT(harq_pid),
T_INT(Ngroup_PHICH), T_INT(NSF_PHICH),
T_INT(ngroup_PHICH), T_INT(nseq_PHICH),
T_INT(phich->hi),
T_INT(phich->first_rb),
T_INT(phich->n_DMRS));
generate_phich(frame_parms,
amp,//amp*2,
nseq_PHICH,
ngroup_PHICH,
phich->hi,
subframe,
txdataF);
LOG_D(PHY,
"[eNB %d][PUSCH %d] Frame %d subframe %d Generating PHICH for PUSCH slot %d, AMP %d ngroup_PHICH %d/%d, nseq_PHICH %d : HI "
"%d, first_rb %d)\n",
eNB->Mod_id,
harq_pid,
proc->frame_tx,
subframe,
pusch_subframe,
amp,
ngroup_PHICH,
Ngroup_PHICH,
nseq_PHICH,
phich->hi,
phich->first_rb);
T(T_ENB_PHY_PHICH,
T_INT(eNB->Mod_id),
T_INT(proc->frame_tx),
T_INT(subframe),
T_INT(-1 /* TODO: rnti */),
T_INT(harq_pid),
T_INT(Ngroup_PHICH),
T_INT(NSF_PHICH),
T_INT(ngroup_PHICH),
T_INT(nseq_PHICH),
T_INT(phich->hi),
T_INT(phich->first_rb),
T_INT(phich->n_DMRS));
generate_phich(frame_parms,
amp, // amp*2,
nseq_PHICH,
ngroup_PHICH,
phich->hi,
subframe,
txdataF);
}// for (i=0; i<eNB->phich_vars[subframe&1].num_hi; i++) {
eNB->phich_vars[subframe&1].num_hi=0;
}
......
......@@ -32,13 +32,12 @@
#include "PHY/defs_eNB.h"
// Refer to Table PHICH factor for TDD transmissions - 3GPP 36211, Table 6.9-1
uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
{
// for FeMBMS
if(frame_parms->FeMBMS_active!=0){
return(0);
}
if (frame_parms->FeMBMS_active != 0)
return (0);
// for FDD
if (frame_parms->frame_type == FDD)
......@@ -47,9 +46,12 @@ uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
// for TDD
switch (frame_parms->tdd_config) {
case 0:
if ((subframe==0) || (subframe==5))
return(2);
else return(1);
if ((subframe == 0) || (subframe == 5)) {
return 2;
} else if ((subframe == 1) || (subframe == 6)) {
return 1;
} else
return 0;
break;
......@@ -89,7 +91,10 @@ uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
break;
case 6:
return(1);
if ((subframe == 0) || (subframe == 1) || (subframe == 5) || (subframe == 6) || (subframe == 9))
return 1;
else
return 0;
break;
default:
......@@ -97,82 +102,51 @@ uint8_t get_mi(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe)
}
}
unsigned char subframe2_ul_harq(LTE_DL_FRAME_PARMS *frame_parms,unsigned char subframe) {
if (frame_parms->frame_type == FDD)
return(subframe&7);
switch (frame_parms->tdd_config) {
case 1:
if (subframe == 6) {
return(0);
} else if (subframe==9){
return(1);
} else if (subframe==1){
return(2);
} else if (subframe==4){
return(3);
} else {
LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
case 2:
if (subframe == 3) {
return(1);
} else if (subframe==8){
return(0);
} else {
LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
case 3:
if ( (subframe == 8) || (subframe == 9) ) {
return(subframe-8);
} else if (subframe==0)
return(2);
else {
LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
case 4:
if ( (subframe == 8) || (subframe == 9) ) {
return(subframe-8);
} else {
LOG_E(PHY,"phich.c: subframe2_ul_harq, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
return(0);
}
break;
}
return(0);
}
int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int subframe) {
int pusch_frame;
// Refer to 3GPP TS 36213, Table 8.3-1
// In therory, Frame is not needed for other TDD modes than 0 and 6
int phich_frame2_pusch_frame(LTE_DL_FRAME_PARMS *frame_parms, int frame, int subframe)
{
int pusch_frame = frame;
if (frame_parms->frame_type == FDD) {
pusch_frame = subframe<4 ? frame + 1024 - 1 : frame;
pusch_frame = subframe < 4 ? frame + 1023 : frame;
} else {
// Note this is not true, but it doesn't matter, the frame number is irrelevant for TDD!
pusch_frame = (frame);
switch (frame_parms->tdd_config) {
case 0:
if ((subframe == 0) || (subframe == 5) || (subframe == 7))
pusch_frame = frame + 1023;
break;
case 1:
if ((subframe == 1) || (subframe == 4))
pusch_frame = frame + 1023;
break;
case 2:
if (subframe == 3)
pusch_frame = frame + 1023;
break;
case 3:
if (subframe == 0)
pusch_frame = frame + 1023;
break;
case 4:
break;
case 5:
break;
case 6:
if ((subframe == 0) || (subframe == 1) || (subframe == 5))
pusch_frame = frame + 1023;
break;
}
}
//LOG_D(PHY, "frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
LOG_D(PHY, "phich_frame2_pusch_frame frame %d subframe %d: PUSCH frame = %d\n", frame, subframe, pusch_frame);
return pusch_frame % 1024;
}
uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t subframe) {
// Refer to 3GPP TS 36213, Table 8.3-1 - K factor application to find which PUSCH
// the PHICH will ACK/NACK
uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms, uint8_t subframe)
{
uint8_t pusch_subframe = 255;
if (frame_parms->frame_type == FDD)
......@@ -181,13 +155,13 @@ uint8_t phich_subframe2_pusch_subframe(LTE_DL_FRAME_PARMS *frame_parms,uint8_t s
switch (frame_parms->tdd_config) {
case 0:
if (subframe == 0)
pusch_subframe = (3);
pusch_subframe = 4;
else if (subframe == 5) {
pusch_subframe = (8);
pusch_subframe = 9;
} else if (subframe == 6)
pusch_subframe = (2);
pusch_subframe = 2;
else if (subframe == 1)
pusch_subframe = (7);
pusch_subframe = 7;
else {
AssertFatal(1==0,"phich.c: phich_subframe2_pusch_subframe, illegal subframe %d for tdd_config %d\n",
subframe,frame_parms->tdd_config);
......
This diff is collapsed.
......@@ -1124,6 +1124,64 @@ uint16_t get_n1_pucch(PHY_VARS_UE *ue,
}
break;
case 6: // DL:S:UL:UL:UL:DL:S:UL:UL:DL
harq_ack0 = 2; // DTX
M = 1;
if (subframe == 2) {
candidate_dl[0] = 5;
} else if (subframe == 3) {
candidate_dl[0] = 6;
} else if (subframe == 4) {
candidate_dl[0] = 9;
} else if (subframe == 7) {
candidate_dl[0] = 0;
} else if (subframe == 8) {
candidate_dl[0] = 1;
} else {
LOG_E(PHY,
"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal tx-subframe %d for tdd_config %d\n",
ue->Mod_id,
proc->frame_tx,
subframe,
frame_parms->tdd_config);
return (0);
}
if (harq_ack[candidate_dl[0]].send_harq_status > 0) {
last_dl = candidate_dl[0];
}
if (last_dl >= 10) {
LOG_E(PHY,
"[UE%d] : Frame %d phy_procedures_lte.c: get_n1pucch, illegal rx-subframe %d (tx-subframe %d) for tdd_config %d\n",
ue->Mod_id,
proc->frame_tx,
last_dl,
subframe,
frame_parms->tdd_config);
return (0);
}
LOG_D(PHY, "SFN/SF %d/%d calculating n1_pucch0 from last_dl=%d\n", proc->frame_tx % 1024, proc->subframe_tx, last_dl);
// i=0
nCCE0 = ue->pdcch_vars[ue->current_thread_id[proc->subframe_rx]][eNB_id]->nCCE[last_dl];
n1_pucch0 = get_Np(frame_parms->N_RB_DL, nCCE0, 0) + nCCE0 + frame_parms->pucch_config_common.n1PUCCH_AN;
harq_ack0 = b[0];
if (harq_ack0 != 2) { // DTX
if (SR == 0) {
b[0] = harq_ack0;
b[1] = harq_ack0;
ue->pucch_sel[subframe] = 0;
return (n1_pucch0);
} else {
b[0] = harq_ack0;
b[1] = harq_ack0;
return (ue->scheduling_request_config[eNB_id].sr_PUCCH_ResourceIndex);
}
}
break;
} // switch tdd_config
}
......
......@@ -1329,9 +1329,10 @@ initiate_ra_proc(module_id_t module_idP,
abort();
case 1 :
case 3 :
case 4 :
case 3:
case 4:
case 5 :
case 6:
offset = 6;
break;
}
......
......@@ -264,6 +264,7 @@ generate_dlsch_header(unsigned char *mac_header,
}
//------------------------------------------------------------------------------
// For Dl subframe, we allocate the DAI of UL subframe accorting table (3GPP TS 36213, Table 10.1.3.1-1 K PDSCH)
void
set_ul_DAI(int module_idP,
int UE_idP,
......@@ -318,7 +319,23 @@ set_ul_DAI(int module_idP,
case 2:
// if ((subframeP==3)||(subframeP==8))
// UE_info->UE_template[CC_idP][UE_idP].DAI_ul = DAI;
// UE_list->UE_template[CC_idP][UE_idP].DAI_ul = DAI;
switch (subframeP) {
case 0:
case 1:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[7] = DAI;
break;
case 4:
case 5:
case 8:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[2] = DAI;
break;
case 9:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[7] = DAI;
break;
}
break;
case 3:
......@@ -361,8 +378,27 @@ set_ul_DAI(int module_idP,
break;
case 6:
// if ((subframeP==1)||(subframeP==4)||(subframeP==6)||(subframeP==9))
// UE_info->UE_template[CC_idP][UE_idP].DAI_ul = DAI;
switch (subframeP) {
case 0:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[7] = DAI;
break;
case 1:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[8] = DAI;
break;
case 5:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[2] = DAI;
break;
case 6:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[3] = DAI;
break;
case 9:
UE_info->UE_template[CC_idP][UE_idP].DAI_ul[4] = DAI;
break;
}
break;
default:
......
......@@ -3097,11 +3097,16 @@ void schedule_ulsch_rnti_fairRR(module_id_t module_idP,
if (cc->tdd_Config) {
switch (cc->tdd_Config->subframeAssignment) {
case 1:
case 0:
case 2:
case 6:
if( subframeP == 1 || subframeP == 6 ) cqi_req=0;
break;
case 3:
case 4:
case 5:
if( subframeP == 1 ) cqi_req=0;
break;
......
......@@ -792,15 +792,36 @@ rx_sdu(const module_id_t enb_mod_idP,
if(mac->common_channels[CC_idP].tdd_Config != NULL) {
switch(mac->common_channels[CC_idP].tdd_Config->subframeAssignment) {
case 0:
ra->Msg4_frame = frameP + 1;
ra->Msg4_subframe = ((subframeP < 5) ? 0 : 5);
break;
case 1:
ra->Msg4_frame = frameP + ((subframeP > 2) ? 1 : 0);
ra->Msg4_subframe = (subframeP + 7) % 10;
break;
case 2:
ra->Msg4_frame = (frameP + ((subframeP > 2) ? 1 : 0)) % 1024;
ra->Msg4_subframe = (subframeP + 6) % 10;
break;
case 3:
case 4:
case 5:
ra->Msg4_frame = frameP;
ra->Msg4_subframe = subframeP + 4;
break;
case 6:
ra->Msg4_frame = frameP + ((subframeP < 5) ? 0 : 1);
ra->Msg4_subframe = ((subframeP < 5) ? 9 : 5);
break;
default:
printf("%s:%d: TODO\n", __FILE__, __LINE__);
abort();
// TODO need to be complete for other tdd configs.
}
} else {
/* Program Msg4 PDCCH+DLSCH/MPDCCH transmission 4 subframes from now,
......@@ -1562,12 +1583,17 @@ schedule_ulsch_rnti(module_id_t module_idP,
* Subframes:36.213/7.2.3 CQI definition */
if (cc[CC_id].tdd_Config) {
switch (cc[CC_id].tdd_Config->subframeAssignment) {
case 0:
case 1:
case 2:
case 6:
if (subframeP == 1 || subframeP == 6)
cqi_req = 0;
break;
case 3:
case 4:
case 5:
if (subframeP == 1)
cqi_req = 0;
break;
......
......@@ -1051,14 +1051,6 @@ uint8_t ul_subframe2_k_phich(COMMON_channels_t *cc, sub_frame_t ul_subframe);
unsigned char ul_ACK_subframe2M(LTE_TDD_Config_t *tdd_Config,unsigned char subframe);
uint8_t get_Msg3harqpid(COMMON_channels_t *cc,
frame_t frame, sub_frame_t current_subframe);
uint32_t pdcchalloc2ulframe(COMMON_channels_t *ccP, uint32_t frame,
uint8_t n);
uint8_t pdcchalloc2ulsubframe(COMMON_channels_t *ccP, uint8_t n);
int is_UL_sf(COMMON_channels_t *ccP, sub_frame_t subframeP);
uint8_t getQm(uint8_t mcs);
......
......@@ -2738,6 +2738,8 @@ do_RRCConnectionSetup(
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_PUCCH_ResourceIndex = 71 - ue_context_pP->local_uid/10;//ue_context_pP->local_uid;
} else {
switch (carrier->sib1->tdd_Config->subframeAssignment) {
case 0:
case 6:
case 1:
switch(frame_parms->N_RB_UL) {
case 25:
......@@ -2779,6 +2781,12 @@ do_RRCConnectionSetup(
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7+
(ue_context_pP->local_uid&1); // Isr = 5 (every 10 subframes, offset=2 for UE0, 3 for UE1, 3 for UE2, 2 for UE3 , etc..)
break;
case 6: // To be checked : Multi UE
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex =
18
+ (ue_context_pP->local_uid & 3)
* 5; // Isr = 18 (every 20 subframes, offset=3 for UE0, 7 for UE1, 2 for UE2, 7 for UE3 , 2 for UE4 etc..)
break;
default:
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7; // Isr = 5 (every 10 subframes, offset=2 for all UE0 etc..)
......
......@@ -4477,6 +4477,12 @@ rrc_eNB_generate_HO_RRCConnectionReconfiguration(const protocol_ctxt_t *const ct
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7 + (ue_context_pP->local_uid &
1); // Isr = 5 (every 10 subframes, offset=2 for UE0, 3 for UE1, 3 for UE2, 2 for UE3 , etc..)
break;
case 6:
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex =
18
+ (ue_context_pP->local_uid & 3)
* 5; // Isr = 18 (every 20 subframes, offset=3 for UE0, 7 for UE1, 2 for UE2, 7 for UE3 , 2 for UE4 etc..)
break;
default:
physicalConfigDedicated2->schedulingRequestConfig->choice.setup.sr_ConfigIndex = 7; // Isr = 5 (every 10 subframes, offset=2 for all UE0 etc..)
......
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