Commit 10c9d899 authored by Cedric Roux's avatar Cedric Roux

Merge remote-tracking branch 'origin/bugfix-258-unknown-ue-id-for-rnti' into...

Merge remote-tracking branch 'origin/bugfix-258-unknown-ue-id-for-rnti' into develop_integration_w30
parents a2f37668 8d5901c8
...@@ -2179,8 +2179,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci, ...@@ -2179,8 +2179,7 @@ uint8_t get_num_pdcch_symbols(uint8_t num_dci,
return(0); return(0);
} }
uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint8_t generate_dci_top(int num_dci,
uint8_t num_common_dci,
DCI_ALLOC_t *dci_alloc, DCI_ALLOC_t *dci_alloc,
uint32_t n_rnti, uint32_t n_rnti,
int16_t amp, int16_t amp,
...@@ -2190,7 +2189,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2190,7 +2189,6 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
{ {
uint8_t *e_ptr,num_pdcch_symbols; uint8_t *e_ptr,num_pdcch_symbols;
int8_t L;
uint32_t i, lprime; uint32_t i, lprime;
uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset; uint32_t gain_lin_QPSK,kprime,kprime_mod12,mprime,nsymb,symbol_offset,tti_offset;
int16_t re_offset; int16_t re_offset;
...@@ -2236,9 +2234,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2236,9 +2234,9 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
break; break;
} }
num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci,dci_alloc,frame_parms,subframe); num_pdcch_symbols = get_num_pdcch_symbols(num_dci,dci_alloc,frame_parms,subframe);
// printf("subframe %d in generate_dci_top num_pdcch_symbols = %d, num_dci %d\n", // printf("subframe %d in generate_dci_top num_pdcch_symbols = %d, num_dci %d\n",
// subframe,num_pdcch_symbols,num_ue_spec_dci+num_common_dci); // subframe,num_pdcch_symbols,num_dci);
generate_pcfich(num_pdcch_symbols, generate_pcfich(num_pdcch_symbols,
amp, amp,
frame_parms, frame_parms,
...@@ -2257,50 +2255,22 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2257,50 +2255,22 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
e_ptr = e; e_ptr = e;
// generate DCIs in order of decreasing aggregation level, then common/ue spec // generate DCIs
// MAC is assumed to have ordered the UE spec DCI according to the RNTI-based randomization for (i=0; i<num_dci; i++) {
for (L=3; L>=0; L--) {
for (i=0; i<num_common_dci; i++) {
if (dci_alloc[i].L == (uint8_t)L) {
#ifdef DEBUG_DCI_ENCODING
printf("Generating common DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",i,num_common_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
*(unsigned int*)dci_alloc[i].dci_pdu);
dump_dci(frame_parms,&dci_alloc[i]);
#endif
if (dci_alloc[i].firstCCE>=0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length,
dci_alloc[i].L,
dci_alloc[i].rnti);
}
}
}
for (; i<num_ue_spec_dci + num_common_dci; i++) {
if (dci_alloc[i].L == (uint8_t)L) {
#ifdef DEBUG_DCI_ENCODING #ifdef DEBUG_DCI_ENCODING
printf(" Generating UE (rnti %x) (nCCE %d) specific DCI %d of length %d, aggregation %d, format %d (%x)\n",dci_alloc[i].rnti,dci_alloc[i].firstCCE,i,dci_alloc[i].dci_length,1<<dci_alloc[i].L,dci_alloc[i].format, printf("Generating %s DCI %d/%d (nCCE %d) of length %d, aggregation %d (%x)\n",
dci_alloc[i].dci_pdu); dci_alloc[i].search_space == DCI_COMMON_SPACE ? "common" : "UE",
dump_dci(frame_parms,&dci_alloc[i]); i,num_dci,dci_alloc[i].firstCCE,dci_alloc[i].dci_length,1<<dci_alloc[i].L,
*(unsigned int*)dci_alloc[i].dci_pdu);
dump_dci(frame_parms,&dci_alloc[i]);
#endif #endif
if (dci_alloc[i].firstCCE >= 0) { if (dci_alloc[i].firstCCE>=0) {
e_ptr = generate_dci0(dci_alloc[i].dci_pdu, e_ptr = generate_dci0(dci_alloc[i].dci_pdu,
e+(72*dci_alloc[i].firstCCE), e+(72*dci_alloc[i].firstCCE),
dci_alloc[i].dci_length, dci_alloc[i].dci_length,
dci_alloc[i].L, dci_alloc[i].L,
dci_alloc[i].rnti); dci_alloc[i].rnti);
}
else {
}
}
} }
} }
...@@ -2511,21 +2481,34 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -2511,21 +2481,34 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
#ifdef PHY_ABSTRACTION #ifdef PHY_ABSTRACTION
uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t num_ue_spec_dci, int num_dci,
uint8_t num_common_dci,
DCI_ALLOC_t *dci_alloc, DCI_ALLOC_t *dci_alloc,
uint8_t subframe) uint8_t subframe)
{ {
int n_dci, n_dci_dl; int n_dci, n_dci_dl;
uint8_t ue_id; uint8_t ue_id;
LTE_eNB_DLSCH_t *dlsch_eNB; LTE_eNB_DLSCH_t *dlsch_eNB;
uint8_t num_pdcch_symbols = get_num_pdcch_symbols(num_ue_spec_dci+num_common_dci, int num_ue_spec_dci;
int num_common_dci;
int i;
uint8_t num_pdcch_symbols = get_num_pdcch_symbols(num_dci,
dci_alloc, dci_alloc,
&phy_vars_eNB->frame_parms, &phy_vars_eNB->frame_parms,
subframe); subframe);
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].cntl.cfi=num_pdcch_symbols; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].cntl.cfi=num_pdcch_symbols;
memcpy(phy_vars_eNB->dci_alloc[subframe&1],dci_alloc,sizeof(DCI_ALLOC_t)*(num_ue_spec_dci+num_common_dci)); num_ue_spec_dci = 0;
num_common_dci = 0;
for (i = 0; i < num_dci; i++) {
/* TODO: maybe useless test, to remove? */
if (!(dci_alloc[i].firstCCE>=0)) abort();
if (dci_alloc[i].search_space == DCI_COMMON_SPACE)
num_common_dci++;
else
num_ue_spec_dci++;
}
memcpy(phy_vars_eNB->dci_alloc[subframe&1],dci_alloc,sizeof(DCI_ALLOC_t)*(num_dci));
phy_vars_eNB->num_ue_spec_dci[subframe&1]=num_ue_spec_dci; phy_vars_eNB->num_ue_spec_dci[subframe&1]=num_ue_spec_dci;
phy_vars_eNB->num_common_dci[subframe&1]=num_common_dci; phy_vars_eNB->num_common_dci[subframe&1]=num_common_dci;
eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].num_ue_spec_dci = num_ue_spec_dci; eNB_transport_info[phy_vars_eNB->Mod_id][phy_vars_eNB->CC_id].num_ue_spec_dci = num_ue_spec_dci;
......
...@@ -781,6 +781,10 @@ typedef enum { ...@@ -781,6 +781,10 @@ typedef enum {
pucch_format3 // PUCCH format3 pucch_format3 // PUCCH format3
} PUCCH_FMT_t; } PUCCH_FMT_t;
typedef enum {
DCI_COMMON_SPACE,
DCI_UE_SPACE
} dci_space_t;
typedef struct { typedef struct {
/// Length of DCI in bits /// Length of DCI in bits
...@@ -795,6 +799,8 @@ typedef struct { ...@@ -795,6 +799,8 @@ typedef struct {
rnti_t rnti; rnti_t rnti;
/// Format /// Format
DCI_format_t format; DCI_format_t format;
/// search space
dci_space_t search_space;
/// DCI pdu /// DCI pdu
uint8_t dci_pdu[8]; uint8_t dci_pdu[8];
} DCI_ALLOC_t; } DCI_ALLOC_t;
......
...@@ -1454,8 +1454,7 @@ void dci_encoding(uint8_t *a, ...@@ -1454,8 +1454,7 @@ void dci_encoding(uint8_t *a,
uint16_t rnti); uint16_t rnti);
/*! \brief Top-level DCI entry point. This routine codes an set of DCI PDUs and performs PDCCH modulation, interleaving and mapping. /*! \brief Top-level DCI entry point. This routine codes an set of DCI PDUs and performs PDCCH modulation, interleaving and mapping.
\param num_ue_spec_dci Number of UE specific DCI pdus to encode \param num_dci Number of DCI pdus to encode
\param num_common_dci Number of Common DCI pdus to encode
\param dci_alloc Allocation vectors for each DCI pdu \param dci_alloc Allocation vectors for each DCI pdu
\param n_rnti n_RNTI (see ) \param n_rnti n_RNTI (see )
\param amp Amplitude of QPSK symbols \param amp Amplitude of QPSK symbols
...@@ -1464,8 +1463,7 @@ void dci_encoding(uint8_t *a, ...@@ -1464,8 +1463,7 @@ void dci_encoding(uint8_t *a,
\param sub_frame_offset subframe offset in frame \param sub_frame_offset subframe offset in frame
@returns Number of PDCCH symbols @returns Number of PDCCH symbols
*/ */
uint8_t generate_dci_top(uint8_t num_ue_spec_dci, uint8_t generate_dci_top(int num_dci,
uint8_t num_common_dci,
DCI_ALLOC_t *dci_alloc, DCI_ALLOC_t *dci_alloc,
uint32_t n_rnti, uint32_t n_rnti,
int16_t amp, int16_t amp,
...@@ -1474,8 +1472,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci, ...@@ -1474,8 +1472,7 @@ uint8_t generate_dci_top(uint8_t num_ue_spec_dci,
uint32_t sub_frame_offset); uint32_t sub_frame_offset);
uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB, uint8_t generate_dci_top_emul(PHY_VARS_eNB *phy_vars_eNB,
uint8_t num_ue_spec_dci, int num_dci,
uint8_t num_common_dci,
DCI_ALLOC_t *dci_alloc, DCI_ALLOC_t *dci_alloc,
uint8_t subframe); uint8_t subframe);
......
This diff is collapsed.
...@@ -1319,8 +1319,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1319,8 +1319,8 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
// loop over all DCIs for this subframe to generate DLSCH allocations // loop over all DCIs for this subframe to generate DLSCH allocations
for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { for (i=0; i<DCI_pdu->Num_dci; i++) {
LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE); LOG_D(PHY,"[eNB] Subframe %d: DCI %d/%d : rnti %x, CCEind %d\n",subframe,i,DCI_pdu->Num_dci,DCI_pdu->dci_alloc[i].rnti,DCI_pdu->dci_alloc[i].firstCCE);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].rnti); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].rnti);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].format); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].format);
VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].firstCCE); VCD_SIGNAL_DUMPER_DUMP_VARIABLE_BY_NAME(VCD_SIGNAL_DUMPER_VARIABLES_DCI_INFO,DCI_pdu->dci_alloc[i].firstCCE);
...@@ -1346,7 +1346,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1346,7 +1346,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
phy_config_dedicated_eNB_step2(eNB); phy_config_dedicated_eNB_step2(eNB);
// Now loop again over the DCIs for UL configuration // Now loop again over the DCIs for UL configuration
for (i=0; i<DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci ; i++) { for (i=0; i<DCI_pdu->Num_dci; i++) {
dci_alloc = &DCI_pdu->dci_alloc[i]; dci_alloc = &DCI_pdu->dci_alloc[i];
if (dci_alloc->format == format0) { // this is a ULSCH allocation if (dci_alloc->format == format0) { // this is a ULSCH allocation
...@@ -1368,7 +1368,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1368,7 +1368,7 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
// if we have DCI to generate do it now // if we have DCI to generate do it now
if ((DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci)>0) { if (DCI_pdu->Num_dci>0) {
} else { // for emulation!! } else { // for emulation!!
...@@ -1379,13 +1379,12 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1379,13 +1379,12 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
if (eNB->abstraction_flag == 0) { if (eNB->abstraction_flag == 0) {
if (do_pdcch_flag) { if (do_pdcch_flag) {
if (DCI_pdu->Num_ue_spec_dci+DCI_pdu->Num_common_dci > 0) { if (DCI_pdu->Num_dci > 0) {
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (common %"PRIu8",ue_spec %"PRIu8")\n",eNB->Mod_id,frame, subframe, LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_top (pdcch) (Num_dci=%d)\n",eNB->Mod_id,frame, subframe,
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); DCI_pdu->Num_dci);
} }
num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_ue_spec_dci, num_pdcch_symbols = generate_dci_top(DCI_pdu->Num_dci,
DCI_pdu->Num_common_dci,
DCI_pdu->dci_alloc, DCI_pdu->dci_alloc,
0, 0,
AMP, AMP,
...@@ -1395,15 +1394,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1395,15 +1394,15 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
} }
else { else {
num_pdcch_symbols = DCI_pdu->num_pdcch_symbols; num_pdcch_symbols = DCI_pdu->num_pdcch_symbols;
LOG_D(PHY,"num_pdcch_symbols %"PRIu8" (dci common %"PRIu8", dci uespec %"PRIu8")\n",num_pdcch_symbols, LOG_D(PHY,"num_pdcch_symbols %"PRIu8" (Num_dci %d)\n",num_pdcch_symbols,
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci); DCI_pdu->Num_dci);
} }
} }
#ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious #ifdef PHY_ABSTRACTION // FIXME this ifdef seems suspicious
else { else {
LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_to_emul\n",eNB->Mod_id,frame, subframe); LOG_D(PHY,"[eNB %"PRIu8"] Frame %d, subframe %d: Calling generate_dci_to_emul\n",eNB->Mod_id,frame, subframe);
num_pdcch_symbols = generate_dci_top_emul(eNB,DCI_pdu->Num_ue_spec_dci,DCI_pdu->Num_common_dci,DCI_pdu->dci_alloc,subframe); num_pdcch_symbols = generate_dci_top_emul(eNB,DCI_pdu->Num_dci,DCI_pdu->dci_alloc,subframe);
} }
#endif #endif
...@@ -1414,10 +1413,10 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB, ...@@ -1414,10 +1413,10 @@ void phy_procedures_eNB_TX(PHY_VARS_eNB *eNB,
#if defined(SMBV) #if defined(SMBV)
// Sets up PDCCH and DCI table // Sets up PDCCH and DCI table
if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && ((DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci)>0)) { if (smbv_is_config_frame(frame) && (smbv_frame_cnt < 4) && (DCI_pdu->Num_dci>0)) {
LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); LOG_D(PHY,"[SMBV] Frame %3d, SF %d PDCCH, number of DCIs %d\n",frame,subframe,DCI_pdu->Num_dci);
dump_dci(fp,&DCI_pdu->dci_alloc[0]); dump_dci(fp,&DCI_pdu->dci_alloc[0]);
smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci); smbv_configure_pdcch(smbv_fname,(smbv_frame_cnt*10) + (subframe),num_pdcch_symbols,DCI_pdu->Num_dci);
} }
#endif #endif
......
...@@ -390,10 +390,11 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -390,10 +390,11 @@ void fill_DCI(PHY_VARS_eNB *eNB,
} }
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[*num_dci].dci_length = dci_length; dci_alloc[*num_dci].dci_length = dci_length;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = n_rnti+k; dci_alloc[*num_dci].rnti = n_rnti+k;
dci_alloc[*num_dci].format = format1; dci_alloc[*num_dci].format = format1;
dci_alloc[*num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]);
// printf("Generating dlsch params for user %d\n",k); // printf("Generating dlsch params for user %d\n",k);
...@@ -530,11 +531,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -530,11 +531,12 @@ void fill_DCI(PHY_VARS_eNB *eNB,
} }
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[*num_dci].dci_length = dci_length; dci_alloc[*num_dci].dci_length = dci_length;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = SI_RNTI; dci_alloc[*num_dci].rnti = SI_RNTI;
dci_alloc[*num_dci].format = format1A; dci_alloc[*num_dci].format = format1A;
dci_alloc[*num_dci].firstCCE = 0; dci_alloc[*num_dci].firstCCE = 0;
dci_alloc[*num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -699,10 +701,11 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -699,10 +701,11 @@ void fill_DCI(PHY_VARS_eNB *eNB,
} }
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[*num_dci].dci_length = dci_length; dci_alloc[*num_dci].dci_length = dci_length;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = n_rnti+k; dci_alloc[*num_dci].rnti = n_rnti+k;
dci_alloc[*num_dci].format = format2A; dci_alloc[*num_dci].format = format2A;
dci_alloc[*num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]);
//printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A); //printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A);
...@@ -839,11 +842,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -839,11 +842,12 @@ void fill_DCI(PHY_VARS_eNB *eNB,
} }
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[*num_dci].dci_length = dci_length; dci_alloc[*num_dci].dci_length = dci_length;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = SI_RNTI; dci_alloc[*num_dci].rnti = SI_RNTI;
dci_alloc[*num_dci].format = format1A; dci_alloc[*num_dci].format = format1A;
dci_alloc[*num_dci].firstCCE = 0; dci_alloc[*num_dci].firstCCE = 0;
dci_alloc[*num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]);
//printf("Generating dlsch params for user %d\n",k); //printf("Generating dlsch params for user %d\n",k);
...@@ -1009,10 +1013,11 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -1009,10 +1013,11 @@ void fill_DCI(PHY_VARS_eNB *eNB,
} }
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[*num_dci].dci_length = dci_length; dci_alloc[*num_dci].dci_length = dci_length;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = n_rnti+k; dci_alloc[*num_dci].rnti = n_rnti+k;
dci_alloc[*num_dci].format = format2; dci_alloc[*num_dci].format = format2;
dci_alloc[*num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1149,11 +1154,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -1149,11 +1154,12 @@ void fill_DCI(PHY_VARS_eNB *eNB,
} }
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[*num_dci].dci_length = dci_length; dci_alloc[*num_dci].dci_length = dci_length;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = SI_RNTI; dci_alloc[*num_dci].rnti = SI_RNTI;
dci_alloc[*num_dci].format = format1A; dci_alloc[*num_dci].format = format1A;
dci_alloc[*num_dci].firstCCE = 0; dci_alloc[*num_dci].firstCCE = 0;
dci_alloc[*num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[*num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1181,11 +1187,12 @@ void fill_DCI(PHY_VARS_eNB *eNB, ...@@ -1181,11 +1187,12 @@ void fill_DCI(PHY_VARS_eNB *eNB,
case 5: case 5:
case 6: case 6:
memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); memcpy(&dci_alloc[*num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
dci_alloc[*num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; dci_alloc[*num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
dci_alloc[*num_dci].L = 1; dci_alloc[*num_dci].L = 1;
dci_alloc[*num_dci].rnti = n_rnti+k; dci_alloc[*num_dci].rnti = n_rnti+k;
dci_alloc[*num_dci].format = format1E_2A_M10PRB; dci_alloc[*num_dci].format = format1E_2A_M10PRB;
dci_alloc[*num_dci].firstCCE = 4*k; dci_alloc[*num_dci].firstCCE = 4*k;
dci_alloc[*num_dci].search_space = DCI_UE_SPACE;
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
generate_eNB_dlsch_params_from_dci(0, generate_eNB_dlsch_params_from_dci(0,
subframe, subframe,
...@@ -1224,12 +1231,10 @@ int num_common_dci=0,num_ue_spec_dci=0,num_dci=0,num_pdcch_symbols=1; ...@@ -1224,12 +1231,10 @@ int num_common_dci=0,num_ue_spec_dci=0,num_dci=0,num_pdcch_symbols=1;
DCI_PDU *get_dci_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) { DCI_PDU *get_dci_sdu(module_id_t module_idP,int CC_id,frame_t frameP,sub_frame_t subframeP) {
if (subframeP == subframe) { if (subframeP == subframe) {
DCI_pdu.Num_ue_spec_dci = num_ue_spec_dci; DCI_pdu.Num_dci = num_ue_spec_dci + num_common_dci;
DCI_pdu.Num_common_dci = num_common_dci;
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols; DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
} else { } else {
DCI_pdu.Num_ue_spec_dci = 0; DCI_pdu.Num_dci = 0;
DCI_pdu.Num_common_dci = 0;
DCI_pdu.num_pdcch_symbols = num_pdcch_symbols; DCI_pdu.num_pdcch_symbols = num_pdcch_symbols;
} }
......
...@@ -1197,10 +1197,11 @@ int main(int argc, char **argv) ...@@ -1197,10 +1197,11 @@ int main(int argc, char **argv)
} }
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format1; dci_alloc[num_dci].format = format1;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
...@@ -1334,11 +1335,12 @@ int main(int argc, char **argv) ...@@ -1334,11 +1335,12 @@ int main(int argc, char **argv)
} }
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A; dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].firstCCE = 0; dci_alloc[num_dci].firstCCE = 0;
dci_alloc[num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
generate_eNB_dlsch_params_from_dci(0, generate_eNB_dlsch_params_from_dci(0,
...@@ -1496,10 +1498,11 @@ int main(int argc, char **argv) ...@@ -1496,10 +1498,11 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format2A; dci_alloc[num_dci].format = format2A;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
...@@ -1633,11 +1636,12 @@ int main(int argc, char **argv) ...@@ -1633,11 +1636,12 @@ int main(int argc, char **argv)
} }
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A; dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].firstCCE = 0; dci_alloc[num_dci].firstCCE = 0;
dci_alloc[num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1827,10 +1831,11 @@ int main(int argc, char **argv) ...@@ -1827,10 +1831,11 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format2; dci_alloc[num_dci].format = format2;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
...@@ -1964,11 +1969,12 @@ int main(int argc, char **argv) ...@@ -1964,11 +1969,12 @@ int main(int argc, char **argv)
} }
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A; dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].firstCCE = 0; dci_alloc[num_dci].firstCCE = 0;
dci_alloc[num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1995,11 +2001,12 @@ int main(int argc, char **argv) ...@@ -1995,11 +2001,12 @@ int main(int argc, char **argv)
case 5: case 5:
case 6: case 6:
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format1E_2A_M10PRB; dci_alloc[num_dci].format = format1E_2A_M10PRB;
dci_alloc[num_dci].firstCCE = 4*k; dci_alloc[num_dci].firstCCE = 4*k;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
generate_eNB_dlsch_params_from_dci(0, generate_eNB_dlsch_params_from_dci(0,
subframe, subframe,
...@@ -3217,8 +3224,7 @@ int main(int argc, char **argv) ...@@ -3217,8 +3224,7 @@ int main(int argc, char **argv)
} }
} }
} }
num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci, num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci + num_common_dci,
num_common_dci,
dci_alloc, dci_alloc,
0, 0,
AMP, AMP,
......
...@@ -1112,10 +1112,11 @@ int main(int argc, char **argv) ...@@ -1112,10 +1112,11 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format1; dci_alloc[num_dci].format = format1;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1255,11 +1256,12 @@ int main(int argc, char **argv) ...@@ -1255,11 +1256,12 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A; dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].firstCCE = 0; dci_alloc[num_dci].firstCCE = 0;
dci_alloc[num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1424,10 +1426,11 @@ int main(int argc, char **argv) ...@@ -1424,10 +1426,11 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format2A; dci_alloc[num_dci].format = format2A;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A); printf("Generating dlsch params for user %d / format 2A (%d)\n",k,format2A);
...@@ -1564,11 +1567,12 @@ int main(int argc, char **argv) ...@@ -1564,11 +1567,12 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A; dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].firstCCE = 0; dci_alloc[num_dci].firstCCE = 0;
dci_alloc[num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1734,10 +1738,11 @@ int main(int argc, char **argv) ...@@ -1734,10 +1738,11 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format2; dci_alloc[num_dci].format = format2;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1874,11 +1879,12 @@ int main(int argc, char **argv) ...@@ -1874,11 +1879,12 @@ int main(int argc, char **argv)
} }
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu_1[k],dci_length_bytes);
dci_alloc[num_dci].dci_length = dci_length; dci_alloc[num_dci].dci_length = dci_length;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = SI_RNTI; dci_alloc[num_dci].rnti = SI_RNTI;
dci_alloc[num_dci].format = format1A; dci_alloc[num_dci].format = format1A;
dci_alloc[num_dci].firstCCE = 0; dci_alloc[num_dci].firstCCE = 0;
dci_alloc[num_dci].search_space = DCI_COMMON_SPACE;
dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]); dump_dci(&eNB->frame_parms,&dci_alloc[num_dci]);
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
...@@ -1906,11 +1912,12 @@ int main(int argc, char **argv) ...@@ -1906,11 +1912,12 @@ int main(int argc, char **argv)
case 5: case 5:
case 6: case 6:
memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); memcpy(&dci_alloc[num_dci].dci_pdu[0],&DLSCH_alloc_pdu2_1E[k],sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; dci_alloc[num_dci].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
dci_alloc[num_dci].L = 1; dci_alloc[num_dci].L = 1;
dci_alloc[num_dci].rnti = n_rnti+k; dci_alloc[num_dci].rnti = n_rnti+k;
dci_alloc[num_dci].format = format1E_2A_M10PRB; dci_alloc[num_dci].format = format1E_2A_M10PRB;
dci_alloc[num_dci].firstCCE = 4*k; dci_alloc[num_dci].firstCCE = 4*k;
dci_alloc[num_dci].search_space = DCI_UE_SPACE;
printf("Generating dlsch params for user %d\n",k); printf("Generating dlsch params for user %d\n",k);
generate_eNB_dlsch_params_from_dci(0, generate_eNB_dlsch_params_from_dci(0,
subframe, subframe,
...@@ -2556,8 +2563,7 @@ PMI_FEEDBACK: ...@@ -2556,8 +2563,7 @@ PMI_FEEDBACK:
} }
} }
num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci, num_pdcch_symbols_2 = generate_dci_top(num_ue_spec_dci + num_common_dci,
num_common_dci,
dci_alloc, dci_alloc,
0, 0,
AMP, AMP,
......
...@@ -66,8 +66,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) ...@@ -66,8 +66,7 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe)
int dci_length_bytes,dci_length; int dci_length_bytes,dci_length;
int BCCH_pdu_size_bits, BCCH_pdu_size_bytes; int BCCH_pdu_size_bits, BCCH_pdu_size_bytes;
DCI_pdu.Num_ue_spec_dci = 0; DCI_pdu.Num_dci = 0;
DCI_pdu.Num_common_dci = 0;
if (subframe_select(&PHY_vars_eNB_g[0]->lte_frame_parms, subframe) == SF_S) { if (subframe_select(&PHY_vars_eNB_g[0]->lte_frame_parms, subframe) == SF_S) {
return (&DCI_pdu); return (&DCI_pdu);
...@@ -281,28 +280,30 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe) ...@@ -281,28 +280,30 @@ DCI_PDU *get_dci(uint8_t Mod_id, uint8_t frame, uint8_t subframe)
} }
// add common dci // add common dci
DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits; DCI_pdu.dci_alloc[0].dci_length = BCCH_pdu_size_bits;
DCI_pdu.dci_alloc[0].L = 2; DCI_pdu.dci_alloc[0].L = 2;
DCI_pdu.dci_alloc[0].rnti = SI_RNTI; DCI_pdu.dci_alloc[0].rnti = SI_RNTI;
DCI_pdu.dci_alloc[0].format = format1A; DCI_pdu.dci_alloc[0].format = format1A;
DCI_pdu.dci_alloc[0].ra_flag = 0; DCI_pdu.dci_alloc[0].ra_flag = 0;
DCI_pdu.dci_alloc[0].search_space = DCI_COMMON_SPACE;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes); memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
DCI_pdu.Num_common_dci++; DCI_pdu.Num_dci++;
// add ue specific dci // add ue specific dci
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].dci_length = dci_length; DCI_pdu.dci_alloc[DCI_pdu.Num_dci].dci_length = dci_length;
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].L = 0; DCI_pdu.dci_alloc[DCI_pdu.Num_dci].L = 0;
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].rnti = n_rnti+k; DCI_pdu.dci_alloc[DCI_pdu.Num_dci].rnti = n_rnti+k;
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].format = format1; DCI_pdu.dci_alloc[DCI_pdu.Num_dci].format = format1;
DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].ra_flag = 0; DCI_pdu.dci_alloc[DCI_pdu.Num_dci].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[k+DCI_pdu.Num_common_dci].dci_pdu[0], &DLSCH_alloc_pdu_1[k], dci_length_bytes); DCI_pdu.dci_alloc[DCI_pdu.Num_dci].search_space = DCI_UE_SPACE;
DCI_pdu.Num_ue_spec_dci++; memcpy((void*)&DCI_pdu.dci_alloc[DCI_pdu.Num_dci].dci_pdu[0], &DLSCH_alloc_pdu_1[k], dci_length_bytes);
DCI_pdu.Num_dci++;
} }
DCI_pdu.nCCE = 0; DCI_pdu.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_dci; i++) {
DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L)); DCI_pdu.nCCE += (1<<(DCI_pdu.dci_alloc[i].L));
} }
......
...@@ -570,7 +570,6 @@ int main(int argc, char **argv) ...@@ -570,7 +570,6 @@ int main(int argc, char **argv)
/* /*
num_pdcch_symbols = generate_dci_top(1, num_pdcch_symbols = generate_dci_top(1,
0,
dci_alloc, dci_alloc,
0, 0,
1024, 1024,
......
...@@ -66,8 +66,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 ...@@ -66,8 +66,7 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
int UL_pdu_size_bits=0, UL_pdu_size_bytes=0; int UL_pdu_size_bits=0, UL_pdu_size_bytes=0;
int mcs = 3; int mcs = 3;
DCI_pdu.Num_ue_spec_dci = 0; DCI_pdu.Num_dci = 0;
DCI_pdu.Num_common_dci = 0;
if (lte_frame_parms->frame_type == TDD) { if (lte_frame_parms->frame_type == TDD) {
switch (lte_frame_parms->N_RB_DL) { switch (lte_frame_parms->N_RB_DL) {
...@@ -358,35 +357,38 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2 ...@@ -358,35 +357,38 @@ DCI_PDU *get_dci(LTE_DL_FRAME_PARMS *lte_frame_parms,uint8_t log2L, uint8_t log2
for (ind = 0; ind<num_dci; ind++) { for (ind = 0; ind<num_dci; ind++) {
if (format_selector[ind]==format1A) { if (format_selector[ind]==format1A) {
// add common dci // add common dci
DCI_pdu.dci_alloc[ind].dci_length = BCCH_pdu_size_bits; DCI_pdu.dci_alloc[ind].dci_length = BCCH_pdu_size_bits;
DCI_pdu.dci_alloc[ind].L = log2Lcommon; DCI_pdu.dci_alloc[ind].L = log2Lcommon;
DCI_pdu.dci_alloc[ind].rnti = SI_RNTI; DCI_pdu.dci_alloc[ind].rnti = SI_RNTI;
DCI_pdu.dci_alloc[ind].format = format1A; DCI_pdu.dci_alloc[ind].format = format1A;
DCI_pdu.dci_alloc[ind].ra_flag = 0; DCI_pdu.dci_alloc[ind].ra_flag = 0;
memcpy((void*)&DCI_pdu.dci_alloc[0].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes); DCI_pdu.dci_alloc[ind].search_space = DCI_COMMON_SPACE;
DCI_pdu.Num_common_dci++; memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &BCCH_alloc_pdu[0], BCCH_pdu_size_bytes);
DCI_pdu.Num_dci++;
printf("Added common dci (%d) for rnti %x\n",ind,SI_RNTI); printf("Added common dci (%d) for rnti %x\n",ind,SI_RNTI);
} }
if (format_selector[ind]==format1) { if (format_selector[ind]==format1) {
DCI_pdu.dci_alloc[ind].dci_length = dci_length; DCI_pdu.dci_alloc[ind].dci_length = dci_length;
DCI_pdu.dci_alloc[ind].L = log2L; DCI_pdu.dci_alloc[ind].L = log2L;
DCI_pdu.dci_alloc[ind].rnti = rnti; DCI_pdu.dci_alloc[ind].rnti = rnti;
DCI_pdu.dci_alloc[ind].format = format1; DCI_pdu.dci_alloc[ind].format = format1;
DCI_pdu.dci_alloc[ind].ra_flag = 0; DCI_pdu.dci_alloc[ind].ra_flag = 0;
DCI_pdu.dci_alloc[ind].search_space = DCI_UE_SPACE;
memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes); memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &DLSCH_alloc_pdu[0], dci_length_bytes);
DCI_pdu.Num_ue_spec_dci++; DCI_pdu.Num_dci++;
} }
if (format_selector[ind]==format0) { if (format_selector[ind]==format0) {
DCI_pdu.dci_alloc[ind].dci_length = UL_pdu_size_bits; DCI_pdu.dci_alloc[ind].dci_length = UL_pdu_size_bits;
DCI_pdu.dci_alloc[ind].L = log2L; DCI_pdu.dci_alloc[ind].L = log2L;
DCI_pdu.dci_alloc[ind].rnti = rnti; DCI_pdu.dci_alloc[ind].rnti = rnti;
DCI_pdu.dci_alloc[ind].format = format0; DCI_pdu.dci_alloc[ind].format = format0;
DCI_pdu.dci_alloc[ind].ra_flag = 0; DCI_pdu.dci_alloc[ind].ra_flag = 0;
DCI_pdu.dci_alloc[ind].search_space = DCI_UE_SPACE;
memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes); memcpy((void*)&DCI_pdu.dci_alloc[ind].dci_pdu[0], &UL_alloc_pdu[0], UL_pdu_size_bytes);
DCI_pdu.Num_ue_spec_dci++; DCI_pdu.Num_dci++;
} }
} }
...@@ -849,20 +851,20 @@ int main(int argc, char **argv) ...@@ -849,20 +851,20 @@ int main(int argc, char **argv)
n_trials_dl++; n_trials_dl++;
} }
} }
num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci, num_pdcch_symbols = get_num_pdcch_symbols(DCI_pdu.Num_dci,
DCI_pdu.dci_alloc, frame_parms, subframe); DCI_pdu.dci_alloc, frame_parms, subframe);
numCCE = get_nCCE(num_pdcch_symbols,&eNB->frame_parms,get_mi(&eNB->frame_parms,subframe)); numCCE = get_nCCE(num_pdcch_symbols,&eNB->frame_parms,get_mi(&eNB->frame_parms,subframe));
if (n_frames==1) { if (n_frames==1) {
printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n", printf("num_dci %d, num_pddch_symbols %d, nCCE %d\n",
DCI_pdu.Num_common_dci+DCI_pdu.Num_ue_spec_dci, DCI_pdu.Num_dci,
num_pdcch_symbols,numCCE); num_pdcch_symbols,numCCE);
} }
// apply RNTI-based nCCE allocation // apply RNTI-based nCCE allocation
memset(CCE_table,0,800*sizeof(int)); memset(CCE_table,0,800*sizeof(int));
for (i = 0; i < DCI_pdu.Num_common_dci + DCI_pdu.Num_ue_spec_dci; i++) { for (i = 0; i < DCI_pdu.Num_dci; i++) {
// SI RNTI // SI RNTI
if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) { if (DCI_pdu.dci_alloc[i].rnti == SI_RNTI) {
DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table, DCI_pdu.dci_alloc[i].firstCCE = get_nCCE_offset_l1(CCE_table,
...@@ -899,8 +901,7 @@ int main(int argc, char **argv) ...@@ -899,8 +901,7 @@ int main(int argc, char **argv)
exit(-1); exit(-1);
} }
num_pdcch_symbols = generate_dci_top(DCI_pdu.Num_ue_spec_dci, num_pdcch_symbols = generate_dci_top(DCI_pdu.Num_dci,
DCI_pdu.Num_common_dci,
DCI_pdu.dci_alloc, DCI_pdu.dci_alloc,
0, 0,
AMP, AMP,
......
...@@ -493,7 +493,6 @@ int main(int argc, char **argv) ...@@ -493,7 +493,6 @@ int main(int argc, char **argv)
num_pdcch_symbols = generate_dci_top(1, num_pdcch_symbols = generate_dci_top(1,
0,
dci_alloc, dci_alloc,
0, 0,
1024, 1024,
......
...@@ -1101,11 +1101,12 @@ int main(int argc, char **argv) ...@@ -1101,11 +1101,12 @@ int main(int argc, char **argv)
((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->mcs = 0; ((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->mcs = 0;
((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->ndi = 1; ((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->ndi = 1;
((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->rv = 0; ((DCI1_5MHz_FDD_t*)&DLSCH_alloc_pdu)->rv = 0;
dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t; dci_alloc[0].dci_length = sizeof_DCI1_5MHz_FDD_t;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_FDD_t)); memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu,sizeof(DCI1_5MHz_FDD_t));
dci_alloc[0].L = 2; dci_alloc[0].L = 2;
dci_alloc[0].rnti = n_rnti; dci_alloc[0].rnti = n_rnti;
dci_alloc[0].format = format1; dci_alloc[0].format = format1;
dci_alloc[0].search_space = DCI_UE_SPACE;
} else { } else {
((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rah = 0; ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rah = 0;
((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rballoc = DLSCH_RB_ALLOC; ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rballoc = DLSCH_RB_ALLOC;
...@@ -1117,15 +1118,15 @@ int main(int argc, char **argv) ...@@ -1117,15 +1118,15 @@ int main(int argc, char **argv)
((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rv = 0; ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->rv = 0;
((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->tpmi = (transmission_mode>=5 ? 5 : 0); // precoding ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->tpmi = (transmission_mode>=5 ? 5 : 0); // precoding
((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->dl_power_off = (transmission_mode==5 ? 0 : 1); ((DCI1E_5MHz_2A_M10PRB_TDD_t*)&DLSCH_alloc_pdu)->dl_power_off = (transmission_mode==5 ? 0 : 1);
dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t; dci_alloc[0].dci_length = sizeof_DCI1E_5MHz_2A_M10PRB_TDD_t;
memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t)); memcpy(&dci_alloc[0].dci_pdu[0],&DLSCH_alloc_pdu,sizeof(DCI1E_5MHz_2A_M10PRB_TDD_t));
dci_alloc[0].L = 2; dci_alloc[0].L = 2;
dci_alloc[0].rnti = n_rnti; dci_alloc[0].rnti = n_rnti;
dci_alloc[0].format = format1E_2A_M10PRB; dci_alloc[0].format = format1E_2A_M10PRB;
dci_alloc[0].search_space = DCI_UE_SPACE;
} }
num_pdcch_symbols = generate_dci_top(1, num_pdcch_symbols = generate_dci_top(1,
0,
dci_alloc, dci_alloc,
0, 0,
AMP, AMP,
...@@ -1134,7 +1135,6 @@ int main(int argc, char **argv) ...@@ -1134,7 +1135,6 @@ int main(int argc, char **argv)
subframe); subframe);
/* /*
num_pdcch_symbols = generate_dci_top(1, num_pdcch_symbols = generate_dci_top(1,
0,
dci_alloc, dci_alloc,
0, 0,
AMP, AMP,
......
...@@ -257,8 +257,7 @@ typedef struct { ...@@ -257,8 +257,7 @@ typedef struct {
/*!\brief DCI PDU filled by MAC for the PHY */ /*!\brief DCI PDU filled by MAC for the PHY */
typedef struct { typedef struct {
uint8_t Num_ue_spec_dci ; int Num_dci;
uint8_t Num_common_dci ;
// uint32_t nCCE; // uint32_t nCCE;
uint32_t num_pdcch_symbols; uint32_t num_pdcch_symbols;
DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ; DCI_ALLOC_t dci_alloc[NUM_DCI_MAX] ;
......
...@@ -125,8 +125,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -125,8 +125,7 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
// clear DCI and BCCH contents before scheduling // clear DCI and BCCH contents before scheduling
for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) { for (CC_id=0; CC_id<MAX_NUM_CCs; CC_id++) {
DCI_pdu[CC_id]->Num_common_dci = 0; DCI_pdu[CC_id]->Num_dci = 0;
DCI_pdu[CC_id]->Num_ue_spec_dci = 0;
#if defined(Rel10) || defined(Rel14) #if defined(Rel10) || defined(Rel14)
eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0; eNB_mac_inst[module_idP].common_channels[CC_id].mcch_active =0;
#endif #endif
...@@ -172,7 +171,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -172,7 +171,11 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
else { else {
// check uplink failure // check uplink failure
if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&& if ((UE_list->UE_sched_ctrl[i].ul_failure_timer>0)&&
(UE_list->UE_sched_ctrl[i].ul_out_of_sync==0)) { (UE_list->UE_sched_ctrl[i].ul_out_of_sync==0) &&
/* do nothing if CCE allocation is impossible */
!CCE_allocation_infeasible(module_idP, CC_id, 0, subframeP,
get_aggregation(get_bw_index(module_idP,CC_id),eNB_UE_stats->DL_cqi[0],format1A),
rnti)) {
LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer); LOG_D(MAC,"UE %d rnti %x: UL Failure timer %d \n",i,rnti,UE_list->UE_sched_ctrl[i].ul_failure_timer);
if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) { if (UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent==0) {
UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1; UE_list->UE_sched_ctrl[i].ra_pdcch_order_sent=1;
...@@ -1098,17 +1101,17 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag, ...@@ -1098,17 +1101,17 @@ void eNB_dlsch_ulsch_scheduler(module_id_t module_idP,uint8_t cooperation_flag,
/* /*
int dummy=0; int dummy=0;
for (i=0; for (i=0;
i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; i<DCI_pdu[CC_id]->Num_dci;
i++) i++)
if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2) if (DCI_pdu[CC_id]->dci_alloc[i].rnti==2)
dummy=1; dummy=1;
if (dummy==1) if (dummy==1)
for (i=0; for (i=0;
i<DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci; i<DCI_pdu[CC_id]->Num_dci;
i++) i++)
LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n", LOG_I(MAC,"Frame %d, subframe %d: DCI %d/%d, format %d, rnti %x, NCCE %d(num_pdcch_symb %d)\n",
frameP,subframeP,i,DCI_pdu[CC_id]->Num_common_dci+DCI_pdu[CC_id]->Num_ue_spec_dci, frameP,subframeP,i,DCI_pdu[CC_id]->Num_dci,
DCI_pdu[CC_id]->dci_alloc[i].format, DCI_pdu[CC_id]->dci_alloc[i].format,
DCI_pdu[CC_id]->dci_alloc[i].rnti, DCI_pdu[CC_id]->dci_alloc[i].rnti,
DCI_pdu[CC_id]->dci_alloc[i].firstCCE, DCI_pdu[CC_id]->dci_alloc[i].firstCCE,
......
...@@ -2016,7 +2016,7 @@ update_ul_dci( ...@@ -2016,7 +2016,7 @@ update_ul_dci(
DCI0_5MHz_TDD_1_6_t *ULSCH_dci = NULL;; DCI0_5MHz_TDD_1_6_t *ULSCH_dci = NULL;;
if (mac_xface->frame_parms->frame_type == TDD) { if (mac_xface->frame_parms->frame_type == TDD) {
for (i=0; i<DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci; i++) { for (i=0; i<DCI_pdu->Num_dci; i++) {
ULSCH_dci = (DCI0_5MHz_TDD_1_6_t *)DCI_pdu->dci_alloc[i].dci_pdu; ULSCH_dci = (DCI0_5MHz_TDD_1_6_t *)DCI_pdu->dci_alloc[i].dci_pdu;
if ((DCI_pdu->dci_alloc[i].format == format0) && (DCI_pdu->dci_alloc[i].rnti == rnti)) { if ((DCI_pdu->dci_alloc[i].format == format0) && (DCI_pdu->dci_alloc[i].rnti == rnti)) {
......
...@@ -645,30 +645,34 @@ void add_common_dci(DCI_PDU *DCI_pdu, ...@@ -645,30 +645,34 @@ void add_common_dci(DCI_PDU *DCI_pdu,
unsigned char dci_fmt, unsigned char dci_fmt,
uint8_t ra_flag) uint8_t ra_flag)
{ {
if (DCI_pdu->Num_dci == NUM_DCI_MAX) { printf("%s: DCI FULL, fatal!\n", __FUNCTION__); abort(); }
memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].dci_pdu[0],pdu,dci_size_bytes); memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_pdu[0],pdu,dci_size_bytes);
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].dci_length = dci_size_bits; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_length = dci_size_bits;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].L = aggregation; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].rnti = rnti; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].format = dci_fmt; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].format = dci_fmt;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci].ra_flag = ra_flag; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].ra_flag = ra_flag;
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].search_space = DCI_COMMON_SPACE;
DCI_pdu->Num_common_dci++; DCI_pdu->Num_dci++;
LOG_D(MAC,"add common dci format %d for rnti %x \n",dci_fmt,rnti); LOG_D(MAC,"add common dci format %d for rnti %x \n",dci_fmt,rnti);
} }
void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt,uint8_t ra_flag) void add_ue_spec_dci(DCI_PDU *DCI_pdu,void *pdu,rnti_t rnti,unsigned char dci_size_bytes,unsigned char aggregation,unsigned char dci_size_bits,unsigned char dci_fmt,uint8_t ra_flag)
{ {
if (DCI_pdu->Num_dci == NUM_DCI_MAX) { printf("%s: DCI FULL, fatal!\n", __FUNCTION__); abort(); }
memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].dci_pdu[0],pdu,dci_size_bytes); memcpy(&DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_pdu[0],pdu,dci_size_bytes);
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].dci_length = dci_size_bits; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].dci_length = dci_size_bits;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].L = aggregation; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].rnti = rnti; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].format = dci_fmt; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].format = dci_fmt;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci].ra_flag = ra_flag; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].ra_flag = ra_flag;
DCI_pdu->dci_alloc[DCI_pdu->Num_dci].search_space = DCI_UE_SPACE;
DCI_pdu->Num_ue_spec_dci++; DCI_pdu->Num_dci++;
LOG_D(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti); LOG_D(MAC,"add ue specific dci format %d for rnti %x \n",dci_fmt,rnti);
} }
...@@ -1065,18 +1069,17 @@ int allocate_CCEs(int module_idP, ...@@ -1065,18 +1069,17 @@ int allocate_CCEs(int module_idP,
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 : (Num_dci %d)\n",subframeP,test_onlyP,DCI_pdu->Num_dci);
DCI_pdu->num_pdcch_symbols=1; DCI_pdu->num_pdcch_symbols=1;
try_again: 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_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 : 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_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);
...@@ -1087,7 +1090,7 @@ try_again: ...@@ -1087,7 +1090,7 @@ try_again:
fCCE = get_nCCE_offset(CCE_table, fCCE = get_nCCE_offset(CCE_table,
1<<(dci_alloc->L), 1<<(dci_alloc->L),
nCCE_max, nCCE_max,
(i<DCI_pdu->Num_common_dci) ? 1 : 0, dci_alloc->search_space == DCI_COMMON_SPACE ? 1 : 0,
dci_alloc->rnti, dci_alloc->rnti,
subframeP); subframeP);
if (fCCE == -1) { if (fCCE == -1) {
...@@ -1095,11 +1098,10 @@ failed: ...@@ -1095,11 +1098,10 @@ failed:
if (DCI_pdu->num_pdcch_symbols == 3) { if (DCI_pdu->num_pdcch_symbols == 3) {
LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x (DCI %d/%d)\n", LOG_I(MAC,"subframe %d: Dropping Allocation for RNTI %x (DCI %d/%d)\n",
subframeP,dci_alloc->rnti, subframeP,dci_alloc->rnti,
i, DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci); i, DCI_pdu->Num_dci);
for (j=0;j<=i;j++){ 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", LOG_I(MAC,"DCI %d/%d : rnti %x dci format %d, aggreg %d nCCE %d / %d (num_pdcch_symbols %d)\n",
j,DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci, j,DCI_pdu->Num_dci,
DCI_pdu->Num_common_dci,DCI_pdu->Num_ue_spec_dci,
DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format, DCI_pdu->dci_alloc[j].rnti,DCI_pdu->dci_alloc[j].format,
1<<DCI_pdu->dci_alloc[j].L, 1<<DCI_pdu->dci_alloc[j].L,
nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols); nCCE,nCCE_max,DCI_pdu->num_pdcch_symbols);
...@@ -1128,37 +1130,29 @@ fatal: ...@@ -1128,37 +1130,29 @@ fatal:
} }
boolean_t CCE_allocation_infeasible(int module_idP, boolean_t CCE_allocation_infeasible(int module_idP,
int CC_idP, int CC_idP,
int common_flag, int common_flag,
int subframe, int subframe,
int aggregation, int aggregation,
int rnti) { int rnti)
{
DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu; DCI_PDU *DCI_pdu = &eNB_mac_inst[module_idP].common_channels[CC_idP].DCI_pdu;
//DCI_ALLOC_t *dci_alloc; //DCI_ALLOC_t *dci_alloc;
int ret; int ret;
boolean_t res=FALSE; boolean_t res=FALSE;
if (common_flag==1) { if (DCI_pdu->Num_dci == NUM_DCI_MAX) return TRUE;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].rnti = rnti;
DCI_pdu->Num_common_dci++; DCI_pdu->dci_alloc[DCI_pdu->Num_dci].L = aggregation;
ret = allocate_CCEs(module_idP,CC_idP,subframe,1); DCI_pdu->dci_alloc[DCI_pdu->Num_dci].search_space = common_flag == 1 ? DCI_COMMON_SPACE : DCI_UE_SPACE;
if (ret==-1) DCI_pdu->Num_dci++;
res = TRUE; ret = allocate_CCEs(module_idP,CC_idP,subframe,1);
DCI_pdu->Num_common_dci--; if (ret==-1)
} res = TRUE;
else { DCI_pdu->Num_dci--;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].rnti = rnti;
DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci + DCI_pdu->Num_ue_spec_dci].L = aggregation; return res;
DCI_pdu->Num_ue_spec_dci++;
ret = allocate_CCEs(module_idP,CC_idP,subframe,1);
if (ret==-1)
res = TRUE;
DCI_pdu->Num_ue_spec_dci--;
}
return(res);
} }
void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP) void SR_indication(module_id_t mod_idP, int cc_idP, frame_t frameP, rnti_t rntiP, sub_frame_t subframeP)
......
...@@ -1142,7 +1142,7 @@ abort(); ...@@ -1142,7 +1142,7 @@ abort();
LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id); LOG_D(MAC,"[eNB %d] CC_id %d Frame %d, subframeP %d: Generated ULSCH DCI for next UE_id %d, format 0\n", module_idP,CC_id,frameP,subframeP,UE_id);
#ifdef DEBUG #ifdef DEBUG
dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_common_dci+DCI_pdu->Num_ue_spec_dci-1]); dump_dci(frame_parms, &DCI_pdu->dci_alloc[DCI_pdu->Num_dci-1]);
#endif #endif
} }
......
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