Commit 29f6db97 authored by Matthieu Kanj's avatar Matthieu Kanj

NPDCCH generation

parent 901d02ef
This diff is collapsed.
...@@ -57,7 +57,6 @@ void dci_encoding_NB_IoT(uint8_t *a, // Array of tw ...@@ -57,7 +57,6 @@ void dci_encoding_NB_IoT(uint8_t *a, // Array of tw
NB_IoT_eNB_NPDCCH_t *dlcch, ////uint8_t *e[2], // *e should be e[2][G] NB_IoT_eNB_NPDCCH_t *dlcch, ////uint8_t *e[2], // *e should be e[2][G]
uint8_t A, uint8_t A,
uint16_t G, uint16_t G,
uint16_t rnti, // RNTI for UE specific or common search space
uint8_t ncce_index, uint8_t ncce_index,
uint8_t agr_level) // Aggregation level uint8_t agr_level) // Aggregation level
{ {
...@@ -73,7 +72,7 @@ void dci_encoding_NB_IoT(uint8_t *a, // Array of tw ...@@ -73,7 +72,7 @@ void dci_encoding_NB_IoT(uint8_t *a, // Array of tw
} }
memset((void *)dlcch->npdcch_d[ncce_index],LTE_NULL_NB_IoT,96); memset((void *)dlcch->npdcch_d[ncce_index],LTE_NULL_NB_IoT,96);
ccode_encode_NB_IoT(A,2,a,dlcch->npdcch_d[ncce_index]+96,rnti); // CRC attachement & Tail-biting convolutional coding ccode_encode_NB_IoT(A,2,a,dlcch->npdcch_d[ncce_index]+96,dlcch->rnti[ncce_index]); // CRC attachement & Tail-biting convolutional coding
RCC = sub_block_interleaving_cc_NB_IoT(D,dlcch->npdcch_d[ncce_index]+96,dlcch->npdcch_w[ncce_index]); // Interleaving RCC = sub_block_interleaving_cc_NB_IoT(D,dlcch->npdcch_d[ncce_index]+96,dlcch->npdcch_w[ncce_index]); // Interleaving
lte_rate_matching_cc_NB_IoT(RCC,(G/occupation_size),dlcch->npdcch_w[ncce_index],dlcch->npdcch_e[ncce_index]); // Rate Matching lte_rate_matching_cc_NB_IoT(RCC,(G/occupation_size),dlcch->npdcch_w[ncce_index],dlcch->npdcch_e[ncce_index]); // Rate Matching
......
...@@ -150,18 +150,19 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -150,18 +150,19 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
DCI_CONTENT *DCI_Content, DCI_CONTENT *DCI_Content,
uint16_t rnti, uint16_t rnti,
DCI_format_NB_IoT_t dci_format, DCI_format_NB_IoT_t dci_format,
NB_IoT_eNB_NDLSCH_t *ndlsch, NB_IoT_eNB_NPDCCH_t *ndlcch,
NB_IoT_DL_FRAME_PARMS *frame_parms, NB_IoT_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation, uint8_t aggregation, //////????? maybe add the ncce index ??????????
uint8_t npdcch_start_symbol) uint8_t npdcch_start_symbol)
{ {
NB_IoT_DL_eNB_HARQ_t *ndlsch_harq = ndlsch->harq_process; // NB_IoT_eNB_NPDCCH_t *ndlcch = ;
void *DLSCH_DCI_NB_IoT = NULL; void *DLSCH_DCI_NB_IoT = NULL;
eNB->DCI_pdu = (DCI_PDU_NB_IoT*) malloc(sizeof(DCI_PDU_NB_IoT)); eNB->DCI_pdu = (DCI_PDU_NB_IoT*) malloc(sizeof(DCI_PDU_NB_IoT));
//N1 parameters //N1 parameters
uint8_t ncce_index = 0;
/// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits /// type = 0 => DCI Format N0, type = 1 => DCI Format N1, 1 bits
uint8_t type = 0; uint8_t type = 0;
...@@ -229,20 +230,25 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -229,20 +230,25 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
/*Now configure the ndlsch structure*/ /*Now configure the ndlsch structure*/
ndlsch->subframe_tx[subframe] = 1; // check if it's OK // ndlcch->ncce_index = NCCE_index;
ndlsch->rnti = rnti; //we store the RNTI (e.g. for RNTI will be used later) // ndlcch->aggregation_level = aggregation;
ndlsch->active = 0; //will be activated by the corresponding NDSLCH pdu
ndlcch->A[ncce_index] = sizeof(DCIN1_RAR_t); // number of bits in DCI
//ndlcch->subframe_tx[subframe] = 1; // check if it's OK
ndlcch->rnti[ncce_index] = rnti; //we store the RNTI (e.g. for RNTI will be used later)
ndlcch->active[ncce_index] = 0; //will be activated by the corresponding NDSLCH pdu
// use this value to configure PHY both harq_processes and resource mapping. // use this value to configure PHY both harq_processes and resource mapping.
ndlsch_harq->scheduling_delay = Sched_delay; ndlcch->scheduling_delay[ncce_index] = Sched_delay;
ndlsch_harq->resource_assignment = resource_to_subframe[ResAssign]; //from Isf of DCI to the number of subframe ndlcch->resource_assignment[ncce_index] = resource_to_subframe[ResAssign]; //from Isf of DCI to the number of subframe
ndlsch_harq->repetition_number = RepNum; ndlcch->repetition_number[ncce_index] = RepNum; // repetition number for NPDSCH
ndlsch_harq->dci_subframe_repetitions = DCIRep; ndlcch->dci_repetitions[ncce_index] = DCIRep; ////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
ndlsch_harq->modulation = 2; //QPSK ndlcch->modulation[ncce_index] = 2; //QPSK
if(ndlsch_harq->round == 0) //this should be set from initialization (init-lte) //// ////////////////////////////////////////////////if(ndlcch->round == 0) //this should be set from initialization (init-lte)
ndlsch_harq->status = ACTIVE_NB_IoT; //ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
ndlsch_harq->mcs = mcs; ndlcch->mcs[ncce_index] = mcs;
/* /*
* TS 36.213 ch 16.4.1.5 * TS 36.213 ch 16.4.1.5
...@@ -250,9 +256,9 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -250,9 +256,9 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
* ISF = ResAssign * ISF = ResAssign
*/ */
ndlsch_harq->TBS = TBStable_NB_IoT[mcs][ResAssign]; ndlcch->TBS[ncce_index] = TBStable_NB_IoT[mcs][ResAssign];
ndlsch_harq->subframe = subframe; //ndlcch->subframe[ncce_index] = subframe;
ndlcch->counter_repetition_number[ncce_index] = DCIRep; ////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
//ndlsch_harq->B; we don-t have now my is given when we receive the dlsch data //ndlsch_harq->B; we don-t have now my is given when we receive the dlsch data
//ndlsch->error_treshold //ndlsch->error_treshold
//ndlsch->G?? //ndlsch->G??
...@@ -298,27 +304,32 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -298,27 +304,32 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN1_t),aggregation,sizeof_DCIN1_t,DCIFormatN1,npdcch_start_symbol); add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN1_t),aggregation,sizeof_DCIN1_t,DCIFormatN1,npdcch_start_symbol);
/*Now configure the ndlsch structure*/ /*Now configure the ndlsch structure*/
ndlcch->A[ncce_index] = sizeof(DCIN1_t); // number of bits in DCI
ndlsch->subframe_tx[subframe] = 1; // check if it's OK // ndlcch->ncce_index = NCCE_index;
ndlsch->rnti = rnti; //we store the RNTI (e.g. for RNTI will be used later) // ndlcch->aggregation_level = aggregation;
ndlsch->active = 0;//will be activated by the corresponding NDSLCH pdu
// use this value to configure PHY both harq_processes and resource mapping.
ndlsch_harq->scheduling_delay = Sched_delay;
ndlsch_harq->resource_assignment = resource_to_subframe[ResAssign]; //from Isf of DCI to the number of subframe
ndlsch_harq->repetition_number = RepNum;
ndlsch_harq->dci_subframe_repetitions = DCIRep;
ndlsch_harq->modulation = 2; //QPSK
if(ndlsch_harq->round == 0){ //this should be set from initialization (init-lte)
ndlsch_harq->status = ACTIVE_NB_IoT;
ndlsch_harq->mcs = mcs;
ndlsch_harq->TBS = TBStable_NB_IoT[mcs][ResAssign]; // this table should be rewritten for nb-iot
}
ndlsch_harq->frame = frame;
ndlsch_harq->subframe = subframe;
//ndlcch->subframe_tx[subframe] = 1; // check if it's OK
ndlcch->rnti[ncce_index] = rnti; //we store the RNTI (e.g. for RNTI will be used later)
ndlcch->active[ncce_index] = 0;//will be activated by the corresponding NDSLCH pdu
// use this value to configure PHY both harq_processes and resource mapping.
ndlcch->scheduling_delay[ncce_index] = Sched_delay;
ndlcch->resource_assignment[ncce_index] = resource_to_subframe[ResAssign]; //from Isf of DCI to the number of subframe
ndlcch->repetition_number[ncce_index] = RepNum;
ndlcch->dci_repetitions[ncce_index] = DCIRep; // ????????????? mapping with the table in spec, take into account Rmax
ndlcch->modulation[ncce_index] = 2; //QPSK
//if(ndlcch->round == 0){ //this should be set from initialization (init-lte)
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
ndlcch->mcs[ncce_index] = mcs;
ndlcch->TBS[ncce_index] = TBStable_NB_IoT[mcs][ResAssign]; // this table should be rewritten for nb-iot
ndlcch->counter_repetition_number[ncce_index] = DCIRep; ////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
//}
//ndlcch->frame[ncce_index] = frame;
//ndlcch->subframe[ncce_index] = subframe;
break; break;
......
...@@ -681,8 +681,12 @@ typedef struct { ...@@ -681,8 +681,12 @@ typedef struct {
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
/// Active flag for baseband transmitter processing /// Active flag for baseband transmitter processing
uint8_t A[2]; // DCI length in bits
uint8_t active[2]; uint8_t active[2];
uint8_t modulation[2];
uint32_t length[2]; uint32_t length[2];
uint32_t ncce_index[2]; uint32_t ncce_index[2];
uint32_t aggregation_level[2]; uint32_t aggregation_level[2];
...@@ -690,14 +694,16 @@ typedef struct { ...@@ -690,14 +694,16 @@ typedef struct {
uint32_t dci_format[2]; uint32_t dci_format[2];
uint32_t scheduling_delay[2]; uint32_t scheduling_delay[2];
uint32_t resource_assignment[2]; uint32_t resource_assignment[2];
// uint32_t repetition_number[2]; // uint32_t repetition_number[2];
uint32_t mcs[2]; uint32_t mcs[2];
uint32_t TBS[2];
uint32_t new_data_indicator[2]; uint32_t new_data_indicator[2];
uint32_t harq_ack_resource[2]; uint32_t harq_ack_resource[2];
uint32_t npdcch_order_indication[2]; uint32_t npdcch_order_indication[2];
uint32_t dci_subframe_repetition_number[2]; uint32_t dci_subframe_repetition_number[2];
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
//UE specific parameters //UE specific parameters
uint16_t dci_repetitions[2];
uint16_t npdcch_NumRepetitions[2]; uint16_t npdcch_NumRepetitions[2];
uint16_t repetition_number[2]; uint16_t repetition_number[2];
...@@ -706,8 +712,8 @@ typedef struct { ...@@ -706,8 +712,8 @@ typedef struct {
////////////////////////////////////// //////////////////////////////////////
uint32_t counter_repetition_number[2]; uint32_t counter_repetition_number[2];
// uint32_t counter_current_sf_repetition[2]; // uint32_t counter_current_sf_repetition[2];
// uint32_t pointer_to_subframe[2]; // uint32_t pointer_to_subframe[2];
////////////////////////////////////// //////////////////////////////////////
uint16_t h_sfn_lsb; uint16_t h_sfn_lsb;
......
...@@ -206,7 +206,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB, ...@@ -206,7 +206,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB_NB_IoT *eNB,
DCI_CONTENT *DCI_Content, DCI_CONTENT *DCI_Content,
uint16_t rnti, uint16_t rnti,
DCI_format_NB_IoT_t dci_format, DCI_format_NB_IoT_t dci_format,
NB_IoT_eNB_NDLSCH_t *ndlsch, NB_IoT_eNB_NPDCCH_t *ndlcch,
NB_IoT_DL_FRAME_PARMS *frame_parms, NB_IoT_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation, uint8_t aggregation,
uint8_t npdcch_start_symbol); uint8_t npdcch_start_symbol);
...@@ -307,8 +307,7 @@ int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -307,8 +307,7 @@ int dci_allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
void dci_encoding_NB_IoT(uint8_t *a, void dci_encoding_NB_IoT(uint8_t *a,
NB_IoT_eNB_NPDCCH_t *dlcch, NB_IoT_eNB_NPDCCH_t *dlcch,
uint8_t A, uint8_t A,
uint16_t G, uint16_t G,
uint16_t rnti,
uint8_t ncce_index, uint8_t ncce_index,
uint8_t agr_level); uint8_t agr_level);
......
...@@ -262,7 +262,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -262,7 +262,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
} else { } else {
With_NSSS = 0; With_NSSS = 0;
} }
/////////////////////////////////////////////////////////////////////////////////
//////////////////////////////// NPSS && NSSS //////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
if(subframe == 5) if(subframe == 5)
{ {
...@@ -285,9 +287,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -285,9 +287,9 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
RB_IoT_ID); RB_IoT_ID);
nsss_state = 1; nsss_state = 1;
} }
/////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// MIB //////////////////////////////////////
uint8_t *sib23_pdu = sib23->harq_process->pdu; /////////////////////////////////////////////////////////////////////////////////
if(subframe == 0) if(subframe == 0)
{ {
...@@ -299,31 +301,35 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -299,31 +301,35 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
frame%64, frame%64,
RB_IoT_ID); RB_IoT_ID);
} }
//////////////////////////////// SIB1 ////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
int sib1_state = 0; /////////////////////////////////////// SIB1 ////////////////////////////////////
if(subframe == 4) /////////////////////////////////////////////////////////////////////////////////
{ int sib1_state = 0;
sib1_state = generate_SIB1(sib1, if(subframe == 4)
txdataF, {
AMP, sib1_state = generate_SIB1(sib1,
fp, txdataF,
frame, AMP,
subframe, fp,
RB_IoT_ID, frame,
0); subframe,
} RB_IoT_ID,
//////////////////////////////// SIB23 /////////////////////////////// 0);
if( (subframe != 0) && (subframe != 5) && (sib1_state != 1) && (nsss_state != 1)) }
{ /////////////////////////////////////////////////////////////////////////////////
generate_SIB23(sib23, ///////////////////////////////////// SIB23 ////////////////////////////////////
txdataF, /////////////////////////////////////////////////////////////////////////////////
AMP, if( (subframe != 0) && (subframe != 5) && (sib1_state != 1) && (nsss_state != 1))
fp, {
frame, generate_SIB23(sib23,
subframe, txdataF,
RB_IoT_ID); AMP,
} fp,
//////////////////////////////////////////////////// END //////////////////////////////////////////////////////////////////////// frame,
subframe,
RB_IoT_ID);
}
///////////////////////////////// END ///////////////////////////////////////////
generate_pilots_NB_IoT(eNB, generate_pilots_NB_IoT(eNB,
txdataF, txdataF,
......
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