Commit b08cf2ee authored by Nick Ho's avatar Nick Ho

fix problem at PHY DCI procedure (haven't test with UE yet)

parent 9d1737f2
...@@ -153,7 +153,8 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -153,7 +153,8 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
NB_IoT_eNB_NPDCCH_t *ndlcch, NB_IoT_eNB_NPDCCH_t *ndlcch,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation, //////????? maybe add the ncce index ?????????? uint8_t aggregation, //////????? maybe add the ncce index ??????????
uint8_t npdcch_start_symbol) uint8_t npdcch_start_symbol,
uint8_t ncce_index)
{ {
// NB_IoT_eNB_NPDCCH_t *ndlcch = ; // NB_IoT_eNB_NPDCCH_t *ndlcch = ;
...@@ -162,7 +163,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -162,7 +163,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//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; //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;
...@@ -227,10 +228,10 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -227,10 +228,10 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
((DCIN1_RAR_t *)DLSCH_DCI_NB_IoT)->DCIRep =DCIRep; ((DCIN1_RAR_t *)DLSCH_DCI_NB_IoT)->DCIRep =DCIRep;
add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN1_RAR_t),aggregation,sizeof_DCIN1_RAR_t,DCIFormatN1_RAR, npdcch_start_symbol); //add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN1_RAR_t),aggregation,sizeof_DCIN1_RAR_t,DCIFormatN1_RAR, npdcch_start_symbol);
/*Now configure the ndlsch structure*/ /*Now configure the npdcch structure*/
// ndlcch->ncce_index = NCCE_index; // ndlcch->ncce_index = NCCE_index;
// ndlcch->aggregation_level = aggregation; // ndlcch->aggregation_level = aggregation;
...@@ -239,7 +240,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -239,7 +240,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlcch->subframe_tx[subframe] = 1; // check if it's OK //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->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 ndlcch->active[ncce_index] = 1; //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.
ndlcch->scheduling_delay[ncce_index] = Sched_delay; ndlcch->scheduling_delay[ncce_index] = Sched_delay;
...@@ -251,7 +252,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -251,7 +252,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT; //ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
ndlcch->mcs[ncce_index] = mcs; ndlcch->mcs[ncce_index] = mcs;
ndlcch->pdu[ncce_index] = DLSCH_DCI_NB_IoT;
/* /*
* TS 36.213 ch 16.4.1.5 * TS 36.213 ch 16.4.1.5
* ITBS is always set equivalent to IMCS for data * ITBS is always set equivalent to IMCS for data
...@@ -268,7 +269,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -268,7 +269,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlsch-> sqrt_rho_a?? set in dlsch_modulation //ndlsch-> sqrt_rho_a?? set in dlsch_modulation
//ndlsch-> sqrt_rho_b??? set in dlsch_modulation //ndlsch-> sqrt_rho_b??? set in dlsch_modulation
LOG_D(PHY,"DCI packing for N1RAR done \n"); LOG_I(PHY,"DCI packing for N1RAR done \n");
//set in new_eNB_dlsch (initialization) //set in new_eNB_dlsch (initialization)
/* /*
...@@ -306,9 +307,9 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -306,9 +307,9 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
((DCIN1_t *)DLSCH_DCI_NB_IoT)->DCIRep =DCIRep; ((DCIN1_t *)DLSCH_DCI_NB_IoT)->DCIRep =DCIRep;
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 npdcch structure*/
ndlcch->A[ncce_index] = sizeof(DCIN1_t); // number of bits in DCI ndlcch->A[ncce_index] = sizeof(DCIN1_t); // number of bits in DCI
// ndlcch->ncce_index = NCCE_index; // ndlcch->ncce_index = NCCE_index;
...@@ -316,7 +317,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -316,7 +317,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlcch->subframe_tx[subframe] = 1; // check if it's OK //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->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 ndlcch->active[ncce_index] = 1;//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.
ndlcch->scheduling_delay[ncce_index] = Sched_delay; ndlcch->scheduling_delay[ncce_index] = Sched_delay;
...@@ -329,6 +330,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -329,6 +330,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT; //ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
ndlcch->mcs[ncce_index] = mcs; ndlcch->mcs[ncce_index] = mcs;
ndlcch->TBS[ncce_index] = TBStable_NB_IoT[mcs][ResAssign]; // this table should be rewritten for nb-iot ndlcch->TBS[ncce_index] = TBStable_NB_IoT[mcs][ResAssign]; // this table should be rewritten for nb-iot
ndlcch->pdu[ncce_index] = DLSCH_DCI_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->counter_repetition_number[ncce_index] = DCIRep; ////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
...@@ -351,7 +353,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -351,7 +353,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
((DCIN2_Ind_t *)DLSCH_DCI_NB_IoT)->resInfoBits =resInfoBits; ((DCIN2_Ind_t *)DLSCH_DCI_NB_IoT)->resInfoBits =resInfoBits;
add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN2_Ind_t),aggregation,sizeof_DCIN2_Ind_t,DCIFormatN2_Ind,npdcch_start_symbol); //add_dci_NB_IoT(eNB->DCI_pdu,DLSCH_DCI_NB_IoT,rnti,sizeof(DCIN2_Ind_t),aggregation,sizeof_DCIN2_Ind_t,DCIFormatN2_Ind,npdcch_start_symbol);
// use this value to configure PHY both harq_processes and resource mapping. // use this value to configure PHY both harq_processes and resource mapping.
break; break;
......
...@@ -721,7 +721,7 @@ typedef struct { ...@@ -721,7 +721,7 @@ typedef struct {
uint8_t npdcch_w[2][3*3*(16+NPDCCH_A)]; uint8_t npdcch_w[2][3*3*(16+NPDCCH_A)];
uint8_t npdcch_e[2][MAX_BITS_IN_SF]; uint8_t npdcch_e[2][MAX_BITS_IN_SF];
///pdu of the npbch message ///pdu of the npbch message
uint8_t pdu[2][3]; uint8_t *pdu[2];
} NB_IoT_eNB_NPDCCH_t; } NB_IoT_eNB_NPDCCH_t;
......
...@@ -212,7 +212,8 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -212,7 +212,8 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
NB_IoT_eNB_NPDCCH_t *ndlcch, NB_IoT_eNB_NPDCCH_t *ndlcch,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
uint8_t aggregation, uint8_t aggregation,
uint8_t npdcch_start_symbol); uint8_t npdcch_start_symbol,
uint8_t ncce_index);
/*Function for DCI encoding, scrambling, modulation*/ /*Function for DCI encoding, scrambling, modulation*/
......
...@@ -197,7 +197,8 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -197,7 +197,8 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//printf("rel13->rnti: %d, eNB->ndlsch_RAR->rnti: %d\n",rel13->rnti,eNB->ndlsch_RAR->rnti); //printf("rel13->rnti: %d, eNB->ndlsch_RAR->rnti: %d\n",rel13->rnti,eNB->ndlsch_RAR->rnti);
//eNB->ndlsch_RAR->rnti = rel13->rnti; //eNB->ndlsch_RAR->rnti = rel13->rnti;
//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 && eNB->ndlsch_RAR->ndlsch_type == RAR) //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->active = 1;
......
...@@ -783,6 +783,10 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n ...@@ -783,6 +783,10 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n
ndlsch = eNB->ndlsch_RAR; ndlsch = eNB->ndlsch_RAR;
ndlsch->ndlsch_type = RAR; ndlsch->ndlsch_type = RAR;
ndlsch->rnti = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti;
npdcch = eNB->npdcch_DCI;
//LOG_I(PHY,"Generating dlsch params for RA_RNTI and packing DCI\n"); //LOG_I(PHY,"Generating dlsch params for RA_RNTI and packing DCI\n");
generate_eNB_dlsch_params_from_dci_NB_IoT(eNB, generate_eNB_dlsch_params_from_dci_NB_IoT(eNB,
frame, frame,
...@@ -790,10 +794,11 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n ...@@ -790,10 +794,11 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n
DCI_Content, DCI_Content,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti, dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti,
DCI_format, DCI_format,
ndlsch, npdcch,
fp, fp,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level, dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.start_symbol); dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.start_symbol,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.ncce_index);
//printf("PHY_vars_eNB_g[0][0]->ndlsch_RAR->rnti = %d\n",PHY_vars_eNB_g[0][0]->ndlsch_RAR->rnti); //printf("PHY_vars_eNB_g[0][0]->ndlsch_RAR->rnti = %d\n",PHY_vars_eNB_g[0][0]->ndlsch_RAR->rnti);
//eNB->dlsch_ra_NB->nCCE[subframe] = eNB->DCI_pdu->dci_alloc.firstCCE; //eNB->dlsch_ra_NB->nCCE[subframe] = eNB->DCI_pdu->dci_alloc.firstCCE;
...@@ -849,10 +854,11 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n ...@@ -849,10 +854,11 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n
DCI_Content, DCI_Content,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti, dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.rnti,
DCI_format, DCI_format,
ndlsch, npdcch,
fp, fp,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level, dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.aggregation_level,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.start_symbol); dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.start_symbol,
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.ncce_index);
//eNB->ndlsch[(uint8_t)UE_id]->nCCE[subframe] = eNB->DCI_pdu->dci_alloc[i].firstCCE; //eNB->ndlsch[(uint8_t)UE_id]->nCCE[subframe] = eNB->DCI_pdu->dci_alloc[i].firstCCE;
......
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