Commit 1581fcb5 authored by Rohit Gupta's avatar Rohit Gupta

Merge branch 'develop' into feature-34-test_framework

parents 6bb3a001 4ea0121c
...@@ -996,79 +996,71 @@ int allocate_CCEs(int module_idP, ...@@ -996,79 +996,71 @@ int allocate_CCEs(int module_idP,
int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP); int nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,1,subframeP);
int fCCE; int fCCE;
int i,j; int i,j;
int allocation_is_feasible = 1;
DCI_ALLOC_t *dci_alloc; DCI_ALLOC_t *dci_alloc;
int nCCE=0; int nCCE=0;
LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); LOG_D(MAC,"Allocate CCEs subframe %d, test %d : (common %d,uspec %d)\n",subframeP,test_onlyP,DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci);
DCI_pdu->num_pdcch_symbols=1; DCI_pdu->num_pdcch_symbols=1;
while (allocation_is_feasible == 1) { try_again:
init_CCE_table(module_idP,CC_idP); init_CCE_table(module_idP,CC_idP);
nCCE=0; nCCE=0;
for (i=0;i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci;i++) { for (i=0;i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci;i++) {
dci_alloc = &DCI_pdu->dci_alloc[i]; dci_alloc = &DCI_pdu->dci_alloc[i];
LOG_D(MAC,"Trying to allocate DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n", LOG_D(MAC,"Trying to allocate DCI %d/%d (%d,%d) : rnti %x, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci, DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
dci_alloc->rnti,1<<dci_alloc->L, dci_alloc->rnti,1<<dci_alloc->L,
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
if (nCCE + (1<<dci_alloc->L) > nCCE_max) { if (nCCE + (1<<dci_alloc->L) > nCCE_max) {
if (DCI_pdu->num_pdcch_symbols == 3) if (DCI_pdu->num_pdcch_symbols == 3)
allocation_is_feasible = 0; goto failed;
else { DCI_pdu->num_pdcch_symbols++;
DCI_pdu->num_pdcch_symbols++; nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP);
nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP); goto try_again;
} }
break;
// number of CCEs left can potentially hold this allocation
fCCE = get_nCCE_offset(CCE_table,
1<<(dci_alloc->L),
nCCE_max,
(i<DCI_pdu->Num_common_dci) ? 1 : 0,
dci_alloc->rnti,
subframeP);
if (fCCE == -1) {
if (DCI_pdu->num_pdcch_symbols == 3) {
LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n",
subframeP,dci_alloc->rnti);
for (j=0;j<=i;j++){
LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format,
1<<DCI_pdu->dci_alloc[j].L,
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
}
goto failed;
} }
else { // number of CCEs left can potentially hold this allocation DCI_pdu->num_pdcch_symbols++;
if ((fCCE = get_nCCE_offset(CCE_table, nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP);
1<<(dci_alloc->L), goto try_again;
nCCE_max, } // fCCE==-1
(i<DCI_pdu->Num_common_dci) ? 1 : 0,
dci_alloc->rnti, // the allocation is feasible, rnti rule passes
subframeP))>=0) {// the allocation is feasible, rnti rule passes nCCE += (1<<dci_alloc->L);
LOG_D(MAC,"Allocating at nCCE %d\n",fCCE);
LOG_D(MAC,"Allocating at nCCE %d\n",fCCE); if (test_onlyP == 0) {
if (test_onlyP == 0) { dci_alloc->firstCCE=fCCE;
nCCE += (1<<dci_alloc->L); LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP);
dci_alloc->firstCCE=fCCE; }
LOG_D(MAC,"Allocate CCEs subframe %d, test %d\n",subframeP,test_onlyP); } // for i = 0 ... num_dcis
}
} // fCCE>=0
else {
if (DCI_pdu->num_pdcch_symbols == 3) {
allocation_is_feasible = 0;
LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x\n",
subframeP,dci_alloc->rnti);
for (j=0;j<=i;j++){
LOG_I(MAC,"DCI %d/%d (%d,%d) : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format,
1<<DCI_pdu->dci_alloc[j].L,
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
}
}
else {
DCI_pdu->num_pdcch_symbols++;
nCCE_max = mac_xface->get_nCCE_max(module_idP,CC_idP,DCI_pdu->num_pdcch_symbols,subframeP);
}
break;
} // fCCE==-1
} // nCCE <= nCCE_max
} // for i = 0 ... num_dcis
if (allocation_is_feasible==1)
return (0);
} // allocation_is_feasible == 1
return(-1); return 0;
failed:
return -1;
} }
boolean_t CCE_allocation_infeasible(int module_idP, boolean_t CCE_allocation_infeasible(int module_idP,
......
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