Commit 33e242de authored by Gabriel's avatar Gabriel

PDCCH optimisation to read only the DCI / agregation we have preconfigured

parent 08b8b314
......@@ -764,6 +764,7 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
struct PhysicalConfigDedicated *physicalConfigDedicated )
{
static uint8_t first_dedicated_configuration = 0;
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
phy_vars_ue->total_TBS[eNB_id]=0;
......@@ -954,9 +955,13 @@ void phy_config_dedicated_ue(uint8_t Mod_id,int CC_id,uint8_t eNB_id,
get_cqipmiri_params(phy_vars_ue,eNB_id);
// disable MIB SIB decoding once we are on connected mode
LOG_I(PHY,"Disabling SIB MIB decoding \n");
phy_vars_ue->decode_SIB = 0;
phy_vars_ue->decode_MIB = 0;
first_dedicated_configuration ++;
if(first_dedicated_configuration > 1)
{
LOG_I(PHY,"Disable SIB MIB decoding \n");
phy_vars_ue->decode_SIB = 0;
phy_vars_ue->decode_MIB = 0;
}
//phy_vars_ue->pdcch_vars[1][eNB_id]->crnti = phy_vars_ue->pdcch_vars[0][eNB_id]->crnti;
if(phy_vars_ue->pdcch_vars[0][eNB_id]->crnti == 0x1234)
phy_vars_ue->pdcch_vars[0][eNB_id]->crnti = phy_vars_ue->pdcch_vars[1][eNB_id]->crnti;
......
......@@ -2937,6 +2937,309 @@ void dci_decoding_procedure0(LTE_UE_PDCCH **pdcch_vars,
} // candidate loop
}
uint16_t dci_CRNTI_decoding_procedure(PHY_VARS_UE *ue,
DCI_ALLOC_t *dci_alloc,
uint8_t DCIFormat,
uint8_t agregationLevel,
int16_t eNB_id,
uint8_t subframe)
{
uint8_t dci_cnt=0,old_dci_cnt=0;
uint32_t CCEmap0=0,CCEmap1=0,CCEmap2=0;
LTE_UE_PDCCH **pdcch_vars = ue->pdcch_vars[subframe%RX_NB_TH];
LTE_DL_FRAME_PARMS *frame_parms = &ue->frame_parms;
uint8_t mi = get_mi(&ue->frame_parms,subframe);
uint16_t ra_rnti=99;
uint8_t format0_found=0,format_c_found=0;
uint8_t tmode = ue->transmission_mode[eNB_id];
uint8_t frame_type = frame_parms->frame_type;
uint8_t format1A_size_bits=0,format1A_size_bytes=0;
uint8_t format1C_size_bits=0,format1C_size_bytes=0;
uint8_t format0_size_bits=0,format0_size_bytes=0;
uint8_t format1_size_bits=0,format1_size_bytes=0;
uint8_t format2_size_bits=0,format2_size_bytes=0;
uint8_t format2A_size_bits=0,format2A_size_bytes=0;
dci_detect_mode_t mode = dci_detect_mode_select(&ue->frame_parms,subframe);
switch (frame_parms->N_RB_DL) {
case 6:
if (frame_type == TDD) {
format1A_size_bits = sizeof_DCI1A_1_5MHz_TDD_1_6_t;
format1A_size_bytes = sizeof(DCI1A_1_5MHz_TDD_1_6_t);
format1C_size_bits = sizeof_DCI1C_1_5MHz_t;
format1C_size_bytes = sizeof(DCI1C_1_5MHz_t);
format0_size_bits = sizeof_DCI0_1_5MHz_TDD_1_6_t;
format0_size_bytes = sizeof(DCI0_1_5MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_1_5MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_1_5MHz_TDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_1_5MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_2A_TDD_t);
format2A_size_bits = sizeof_DCI2A_1_5MHz_2A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_1_5MHz_2A_TDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_1_5MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_4A_TDD_t);
format2A_size_bits = sizeof_DCI2A_1_5MHz_4A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_1_5MHz_4A_TDD_t);
}
} else {
format1A_size_bits = sizeof_DCI1A_1_5MHz_FDD_t;
format1A_size_bytes = sizeof(DCI1A_1_5MHz_FDD_t);
format1C_size_bits = sizeof_DCI1C_1_5MHz_t;
format1C_size_bytes = sizeof(DCI1C_1_5MHz_t);
format0_size_bits = sizeof_DCI0_1_5MHz_FDD_t;
format0_size_bytes = sizeof(DCI0_1_5MHz_FDD_t);
format1_size_bits = sizeof_DCI1_1_5MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_1_5MHz_FDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_1_5MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_2A_FDD_t);
format2A_size_bits = sizeof_DCI2A_1_5MHz_2A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_1_5MHz_2A_FDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_1_5MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_1_5MHz_4A_FDD_t);
format2A_size_bits = sizeof_DCI2A_1_5MHz_4A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_1_5MHz_4A_FDD_t);
}
}
break;
case 25:
default:
if (frame_type == TDD) {
format1A_size_bits = sizeof_DCI1A_5MHz_TDD_1_6_t;
format1A_size_bytes = sizeof(DCI1A_5MHz_TDD_1_6_t);
format1C_size_bits = sizeof_DCI1C_5MHz_t;
format1C_size_bytes = sizeof(DCI1C_5MHz_t);
format0_size_bits = sizeof_DCI0_5MHz_TDD_1_6_t;
format0_size_bytes = sizeof(DCI0_5MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_5MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_5MHz_TDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_5MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_2A_TDD_t);
format2A_size_bits = sizeof_DCI2A_5MHz_2A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_5MHz_2A_TDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_5MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_4A_TDD_t);
format2A_size_bits = sizeof_DCI2A_5MHz_4A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_5MHz_4A_TDD_t);
}
} else {
format1A_size_bits = sizeof_DCI1A_5MHz_FDD_t;
format1A_size_bytes = sizeof(DCI1A_5MHz_FDD_t);
format1C_size_bits = sizeof_DCI1C_5MHz_t;
format1C_size_bytes = sizeof(DCI1C_5MHz_t);
format0_size_bits = sizeof_DCI0_5MHz_FDD_t;
format0_size_bytes = sizeof(DCI0_5MHz_FDD_t);
format1_size_bits = sizeof_DCI1_5MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_5MHz_FDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_5MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_2A_FDD_t);
format2A_size_bits = sizeof_DCI2A_5MHz_2A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_5MHz_2A_FDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_5MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_5MHz_4A_FDD_t);
format2A_size_bits = sizeof_DCI2A_5MHz_4A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_5MHz_4A_FDD_t);
}
}
break;
case 50:
if (frame_type == TDD) {
format1A_size_bits = sizeof_DCI1A_10MHz_TDD_1_6_t;
format1A_size_bytes = sizeof(DCI1A_10MHz_TDD_1_6_t);
format1C_size_bits = sizeof_DCI1C_10MHz_t;
format1C_size_bytes = sizeof(DCI1C_10MHz_t);
format0_size_bits = sizeof_DCI0_10MHz_TDD_1_6_t;
format0_size_bytes = sizeof(DCI0_10MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_10MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_10MHz_TDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_10MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_2A_TDD_t);
format2A_size_bits = sizeof_DCI2A_10MHz_2A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_10MHz_2A_TDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_10MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_4A_TDD_t);
format2A_size_bits = sizeof_DCI2A_10MHz_4A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_10MHz_4A_TDD_t);
}
} else {
format1A_size_bits = sizeof_DCI1A_10MHz_FDD_t;
format1A_size_bytes = sizeof(DCI1A_10MHz_FDD_t);
format1C_size_bits = sizeof_DCI1C_10MHz_t;
format1C_size_bytes = sizeof(DCI1C_10MHz_t);
format0_size_bits = sizeof_DCI0_10MHz_FDD_t;
format0_size_bytes = sizeof(DCI0_10MHz_FDD_t);
format1_size_bits = sizeof_DCI1_10MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_10MHz_FDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_10MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_2A_FDD_t);
format2A_size_bits = sizeof_DCI2A_10MHz_2A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_10MHz_2A_FDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_10MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_10MHz_4A_FDD_t);
format2A_size_bits = sizeof_DCI2A_10MHz_4A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_10MHz_4A_FDD_t);
}
}
break;
case 100:
if (frame_type == TDD) {
format1A_size_bits = sizeof_DCI1A_20MHz_TDD_1_6_t;
format1A_size_bytes = sizeof(DCI1A_20MHz_TDD_1_6_t);
format1C_size_bits = sizeof_DCI1C_20MHz_t;
format1C_size_bytes = sizeof(DCI1C_20MHz_t);
format0_size_bits = sizeof_DCI0_20MHz_TDD_1_6_t;
format0_size_bytes = sizeof(DCI0_20MHz_TDD_1_6_t);
format1_size_bits = sizeof_DCI1_20MHz_TDD_t;
format1_size_bytes = sizeof(DCI1_20MHz_TDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_20MHz_2A_TDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_2A_TDD_t);
format2A_size_bits = sizeof_DCI2A_20MHz_2A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_20MHz_2A_TDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_20MHz_4A_TDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_4A_TDD_t);
format2A_size_bits = sizeof_DCI2A_20MHz_4A_TDD_t;
format2A_size_bytes = sizeof(DCI2A_20MHz_4A_TDD_t);
}
} else {
format1A_size_bits = sizeof_DCI1A_20MHz_FDD_t;
format1A_size_bytes = sizeof(DCI1A_20MHz_FDD_t);
format1C_size_bits = sizeof_DCI1C_20MHz_t;
format1C_size_bytes = sizeof(DCI1C_20MHz_t);
format0_size_bits = sizeof_DCI0_20MHz_FDD_t;
format0_size_bytes = sizeof(DCI0_20MHz_FDD_t);
format1_size_bits = sizeof_DCI1_20MHz_FDD_t;
format1_size_bytes = sizeof(DCI1_20MHz_FDD_t);
if (frame_parms->nb_antenna_ports_eNB == 2) {
format2_size_bits = sizeof_DCI2_20MHz_2A_FDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_2A_FDD_t);
format2A_size_bits = sizeof_DCI2A_20MHz_2A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_20MHz_2A_FDD_t);
} else if (frame_parms->nb_antenna_ports_eNB == 4) {
format2_size_bits = sizeof_DCI2_20MHz_4A_FDD_t;
format2_size_bytes = sizeof(DCI2_20MHz_4A_FDD_t);
format2A_size_bits = sizeof_DCI2A_20MHz_4A_FDD_t;
format2A_size_bytes = sizeof(DCI2A_20MHz_4A_FDD_t);
}
}
break;
}
if (ue->prach_resources[eNB_id])
ra_rnti = ue->prach_resources[eNB_id]->ra_RNTI;
// Now check UE_SPEC format0/1A ue_spec search spaces at aggregation 8
dci_decoding_procedure0(pdcch_vars,0,mode,
subframe,
dci_alloc,
eNB_id,
frame_parms,
mi,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
agregationLevel,
format1A,
format1A,
format1A,
format0,
format0_size_bits,
format0_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
&CCEmap0,
&CCEmap1,
&CCEmap2);
if ((CCEmap0==0xffff)||
((format0_found==1)&&(format_c_found==1)))
return(dci_cnt);
if (DCIFormat == 1)
{
if ((tmode < 3) || (tmode == 7)) {
//printf("Crnti decoding frame param agregation %d DCI %d \n",agregationLevel,DCIFormat);
// Now check UE_SPEC format 1 search spaces at aggregation 1
//printf("[DCI search] Format 1/1A aggregation 1\n");
old_dci_cnt=dci_cnt;
dci_decoding_procedure0(pdcch_vars,0,mode,subframe,
dci_alloc,
eNB_id,
frame_parms,
mi,
((ue->decode_SIB == 1) ? SI_RNTI : 0),
ra_rnti,
P_RNTI,
0,
format1A,
format1A,
format1A,
format1,
format1_size_bits,
format1_size_bytes,
&dci_cnt,
&format0_found,
&format_c_found,
&CCEmap0,
&CCEmap1,
&CCEmap2);
if ((CCEmap0==0xffff) ||
(format_c_found==1))
return(dci_cnt);
if (dci_cnt>old_dci_cnt)
return(dci_cnt);
//printf("Crnti 1 decoding frame param agregation %d DCI %d \n",agregationLevel,DCIFormat);
}
else
{
AssertFatal(0,"Other Transmission mode not yet coded\n");
}
}
else
{
AssertFatal(0,"DCI format %d not yet implemented \n",DCIFormat);
}
return(dci_cnt);
}
uint16_t dci_decoding_procedure(PHY_VARS_UE *ue,
DCI_ALLOC_t *dci_alloc,
int do_common,
......
......@@ -75,6 +75,9 @@
#define RX_NB_TH_MAX 2
#define RX_NB_TH 2
extern uint8_t dciFormat;
extern uint8_t agregationLevel;
//#ifdef SHRLIBDEV
//extern int rxrescale;
......
......@@ -78,6 +78,9 @@ unsigned char NB_INST=0;
unsigned int ULSCH_max_consecutive_errors = 20;
int number_of_cards;
uint8_t dciFormat;
uint8_t agregationLevel;
int flag_LA=0;
int flagMag;
......
......@@ -3083,11 +3083,37 @@ int ue_pdcch_procedures(uint8_t eNB_id,PHY_VARS_UE *ue,UE_rxtx_proc_t *proc,uint
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_RX_PDCCH, VCD_FUNCTION_OUT);
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_IN);
dci_cnt = dci_decoding_procedure(ue,
dci_alloc_rx,
(ue->UE_mode[eNB_id] < PUSCH)? 1 : 0, // if we're in PUSCH don't listen to common search space,
// later when we need paging or RA during connection, update this ...
eNB_id,subframe_rx);
start_meas(&ue->dlsch_decoding_stats[subframe_rx]);
//printf("Decode SIB frame param agregation + DCI %d %d \n",agregationLevel,dciFormat);
//agregation level == FF means no configuration on
if(agregationLevel == 0xFF || ue->decode_SIB)
{
// search all possible dcis
dci_cnt = dci_decoding_procedure(ue,
dci_alloc_rx,
(ue->UE_mode[eNB_id] < PUSCH)? 1 : 0, // if we're in PUSCH don't listen to common search space,
// later when we need paging or RA during connection, update this ...
eNB_id,subframe_rx);
}
else
{
// search only preconfigured dcis
// search C RNTI dci
dci_cnt = dci_CRNTI_decoding_procedure(ue,
dci_alloc_rx,
dciFormat,
agregationLevel,
eNB_id,
subframe_rx);
}
stop_meas(&ue->dlsch_decoding_stats[subframe_rx]);
printf("subframe_rx %d dci_decoding procedure %5.3f\n",
subframe_rx,
(ue->dlsch_unscrambling_stats.p_time)/(cpuf*1000.0));
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_DCI_DECODING, VCD_FUNCTION_OUT);
//LOG_D(PHY,"[UE %d][PUSCH] Frame %d subframe %d PHICH RX\n",ue->Mod_id,frame_rx,subframe_rx);
......
......@@ -150,6 +150,9 @@ int chain_offset=0;
int phy_test = 0;
uint8_t usim_test = 0;
uint8_t dci_Format = 0;
uint8_t agregation_Level =0xFF;
uint8_t nb_antenna_tx = 1;
uint8_t nb_antenna_rx = 1;
......@@ -640,6 +643,8 @@ static void get_options (int argc, char **argv) {
LONG_OPTION_THREADONESUBFRAME,
LONG_OPTION_THREADTWOSUBFRAME,
LONG_OPTION_THREADTHREESUBFRAME,
LONG_OPTION_DCIFORMAT,
LONG_OPTION_AGREGATIONLEVEL,
LONG_OPTION_DEMOD_SHIFT,
#if T_TRACER
LONG_OPTION_T_PORT,
......@@ -677,6 +682,8 @@ static void get_options (int argc, char **argv) {
{"threadOneSubframe", required_argument, NULL, LONG_OPTION_THREADONESUBFRAME},
{"threadTwoSubframe", required_argument, NULL, LONG_OPTION_THREADTWOSUBFRAME},
{"threadThreeSubframe", required_argument, NULL, LONG_OPTION_THREADTHREESUBFRAME},
{"DCIformat", required_argument, NULL, LONG_OPTION_DCIFORMAT},
{"AgregationLevel", required_argument, NULL, LONG_OPTION_AGREGATIONLEVEL},
{"dlsch-demod-shift", required_argument, NULL, LONG_OPTION_DEMOD_SHIFT},
#if T_TRACER
{"T_port", required_argument, 0, LONG_OPTION_T_PORT},
......@@ -811,6 +818,12 @@ static void get_options (int argc, char **argv) {
case LONG_OPTION_THREADTHREESUBFRAME:
threads.three=atoi(optarg);
break;
case LONG_OPTION_DCIFORMAT:
dci_Format = atoi(optarg);
break;
case LONG_OPTION_AGREGATIONLEVEL:
agregation_Level = atoi(optarg);
break;
case LONG_OPTION_DEMOD_SHIFT: {
extern int16_t dlsch_demod_shift;
dlsch_demod_shift = atof(optarg);
......@@ -1560,6 +1573,11 @@ int main( int argc, char **argv ) {
NB_UE_INST=1;
NB_INST=1;
dciFormat = dci_Format;
agregationLevel = agregation_Level;
LOG_I(PHY,"Set dciFormat %d , agregationLevel %d \n",dciFormat, agregationLevel);
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE**));
PHY_vars_UE_g[0] = malloc(sizeof(PHY_VARS_UE*)*MAX_NUM_CCs);
......
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