Commit 6ba02668 authored by Matthieu Kanj's avatar Matthieu Kanj

function calls for NPDCCH and NPDSCH

parent 5506e79f
...@@ -214,7 +214,7 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -214,7 +214,7 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
{ {
int done = 0; int done = 0;
if( (RAR->active == 1) && (frame_parms->flag_free_sf == 0)) if( RAR->active == 1 )
{ {
uint8_t *RAR_pdu = RAR->harq_process->pdu; uint8_t *RAR_pdu = RAR->harq_process->pdu;
uint32_t rep = RAR->repetition_number; uint32_t rep = RAR->repetition_number;
...@@ -337,7 +337,7 @@ int generate_NPDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI, ...@@ -337,7 +337,7 @@ int generate_NPDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI,
uint8_t ncce_index = 0; /// = DCI->ncce_index[i]; uint8_t ncce_index = 0; /// = DCI->ncce_index[i];
uint8_t agr_level = 2; /// = DCI->aggregation_level[i]; uint8_t agr_level = 2; /// = DCI->aggregation_level[i];
if( (DCI->active[i] == 1) && (frame_parms->flag_free_sf == 0)) if( DCI->active[i] == 1)
{ {
uint8_t *DCI_pdu = DCI->pdu[i]; uint8_t *DCI_pdu = DCI->pdu[i];
......
...@@ -84,6 +84,19 @@ void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch) ...@@ -84,6 +84,19 @@ void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch)
} }
void free_eNB_dlcch_NB_IoT(NB_IoT_eNB_NPDCCH_t *dlcch)
{
if (dlcch) {
free16(dlcch,sizeof(NB_IoT_eNB_NPDCCH_t));
dlcch = NULL;
}
}
void ccode_encode_npdsch_NB_IoT (int32_t numbits, void ccode_encode_npdsch_NB_IoT (int32_t numbits,
uint8_t *inPtr, uint8_t *inPtr,
...@@ -202,23 +215,7 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t type, LTE_DL_FRAME_PARMS* fram ...@@ -202,23 +215,7 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t type, LTE_DL_FRAME_PARMS* fram
exit_flag=1; exit_flag=1;
} }
// if (abstraction_flag==0) {
// account for filler in first segment and CRCs for multiple segment case
// dlsch->harq_process->c[0] = (uint8_t*)malloc16(3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24));
// dlsch->harq_process->d[0] = (uint8_t*)malloc(96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
/// dlsch->harq_process->e[0] = (uint8_t*)malloc(MAX_NUM_DL_CHANNEL_BITS_NB_IoT);
// dlsch->harq_process->s_e[0] = (uint8_t*)malloc(MAX_NUM_DL_CHANNEL_BITS_NB_IoT);
/* if (dlsch->harq_process->c[0]) {
bzero(dlsch->harq_process->c[0],3*3*(MAX_TBS_DL_SIZE_BITS_NB_IoT+24));
} else {
printf("Can't get c\n");
exit_flag=2;
}
*/
if (dlsch->harq_process->d) { if (dlsch->harq_process->d) {
bzero((void *)dlsch->harq_process->d,96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT))); bzero((void *)dlsch->harq_process->d,96+(3*(24+MAX_TBS_DL_SIZE_BITS_NB_IoT)));
...@@ -259,6 +256,31 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t type, LTE_DL_FRAME_PARMS* fram ...@@ -259,6 +256,31 @@ NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t type, LTE_DL_FRAME_PARMS* fram
} }
///////////////////////////////////////////////////////////////////////////
NB_IoT_eNB_NPDCCH_t *new_eNB_dlcch_NB_IoT(LTE_DL_FRAME_PARMS* frame_parms)
{
NB_IoT_eNB_NPDCCH_t *dlcch;
dlcch = (NB_IoT_eNB_NPDCCH_t *)malloc16(sizeof(NB_IoT_eNB_NPDCCH_t));
if (dlcch) {
bzero(dlcch,sizeof(NB_IoT_eNB_NPDCCH_t));
return(dlcch);
}
/// LOG_D(PHY,"new_eNB_dlsch exit flag %d, size of %ld\n",
// exit_flag, sizeof(NB_IoT_eNB_NDLSCH_t));
free_eNB_dlcch_NB_IoT(dlcch);
return(NULL);
}
/************************************************************************* /*************************************************************************
......
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
//NPSS //NPSS
void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch); void free_eNB_dlsch_NB_IoT(NB_IoT_eNB_NDLSCH_t *dlsch);
void free_eNB_dlcch_NB_IoT(NB_IoT_eNB_NPDCCH_t *dlcch);
void init_unscrambling_lut_NB_IoT(void); void init_unscrambling_lut_NB_IoT(void);
...@@ -154,6 +155,8 @@ void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -154,6 +155,8 @@ void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t length, LTE_DL_FRAME_PARMS* frame_parms); NB_IoT_eNB_NDLSCH_t *new_eNB_dlsch_NB_IoT(uint8_t length, LTE_DL_FRAME_PARMS* frame_parms);
NB_IoT_eNB_NPDCCH_t *new_eNB_dlcch_NB_IoT(LTE_DL_FRAME_PARMS* frame_parms);
/*void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, /*void dlsch_scrambling_Gen_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
NB_IoT_eNB_NDLSCH_t *dlsch, NB_IoT_eNB_NDLSCH_t *dlsch,
int tot_bits, // total number of bits to transmit int tot_bits, // total number of bits to transmit
......
...@@ -517,7 +517,7 @@ NB_IoT_eNB_NDLSCH_t *ndlsch_SIB23; ...@@ -517,7 +517,7 @@ NB_IoT_eNB_NDLSCH_t *ndlsch_SIB23;
NB_IoT_eNB_NDLSCH_t *ndlsch_RAR; NB_IoT_eNB_NDLSCH_t *ndlsch_RAR;
NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT]; NB_IoT_eNB_NPDCCH_t *npdcch[NUMBER_OF_UE_MAX_NB_IoT];
//NB_IoT_eNB_NDLSCH_t ndlsch_rar; //NB_IoT_eNB_NDLSCH_t ndlsch_rar;
NB_IoT_eNB_NPDCCH_t npdcch_DCI; NB_IoT_eNB_NPDCCH_t *npdcch_DCI;
NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT[NUMBER_OF_UE_MAX+1]; NB_IoT_eNB_NULSCH_t *ulsch_NB_IoT[NUMBER_OF_UE_MAX+1];
////////////// For IF Module ///////////////////////////// ////////////// For IF Module /////////////////////////////
......
...@@ -199,6 +199,10 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -199,6 +199,10 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//check if the PDU is for RAR //check if the PDU is for RAR
if(eNB->ndlsch_RAR != NULL && rel13->rnti == eNB->ndlsch_RAR->rnti) //rnti for the RAR should have been set priviously by the DCI if(eNB->ndlsch_RAR != NULL && rel13->rnti == eNB->ndlsch_RAR->rnti) //rnti for the RAR should have been set priviously by the DCI
{ {
eNB->ndlsch_RAR->active = 1;
eNB->ndlsch_RAR->harq_process->TBS = rel13->length;
eNB->ndlsch_RAR->harq_process->pdu = sdu; eNB->ndlsch_RAR->harq_process->pdu = sdu;
eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol; eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
eNB->ndlsch_RAR->active = 1; eNB->ndlsch_RAR->active = 1;
......
...@@ -330,7 +330,33 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -330,7 +330,33 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
subframe, subframe,
RB_IoT_ID); RB_IoT_ID);
} }
///////////////////////////////// END ///////////////////////////////////////////
if( (subframe != 0) && (subframe != 5) && (nsss_state != 1) && (fp->flag_free_sf == 0) )
{
NB_IoT_eNB_NPDCCH_t *npdcch_str = eNB->npdcch_DCI;
NB_IoT_eNB_NDLSCH_t *RAR = eNB->ndlsch_RAR;
/////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// NPDCCH ////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
generate_NPDCCH_NB_IoT(npdcch_str,
txdataF,
AMP,
fp,
frame,
subframe,
RB_IoT_ID);
/////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// NPDSCH ////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
generate_NDLSCH_NB_IoT(RAR,
txdataF,
AMP,
fp,
frame,
subframe,
RB_IoT_ID);
///////////////////////////////////////////////////////////////////////////////////
}
generate_pilots_NB_IoT(eNB, generate_pilots_NB_IoT(eNB,
txdataF, txdataF,
......
...@@ -147,6 +147,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -147,6 +147,8 @@ PHY_VARS_eNB* init_lte_eNB(LTE_DL_FRAME_PARMS *frame_parms,
PHY_vars_eNB->ndlsch_SIB23 = new_eNB_dlsch_NB_IoT(1,frame_parms); PHY_vars_eNB->ndlsch_SIB23 = new_eNB_dlsch_NB_IoT(1,frame_parms);
PHY_vars_eNB->ndlsch_RAR = new_eNB_dlsch_NB_IoT(1,frame_parms); PHY_vars_eNB->ndlsch_RAR = new_eNB_dlsch_NB_IoT(1,frame_parms);
PHY_vars_eNB->npdcch_DCI = new_eNB_dlcch_NB_IoT(frame_parms);
PHY_vars_eNB->UL_INFO.nrach_ind.nrach_pdu_list = (nfapi_nrach_indication_pdu_t *)malloc16(sizeof(nfapi_nrach_indication_pdu_t)); PHY_vars_eNB->UL_INFO.nrach_ind.nrach_pdu_list = (nfapi_nrach_indication_pdu_t *)malloc16(sizeof(nfapi_nrach_indication_pdu_t));
PHY_vars_eNB->ndlsch_SIB1->rnti = 0xffff; PHY_vars_eNB->ndlsch_SIB1->rnti = 0xffff;
......
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