Commit cc243196 authored by Nick Ho's avatar Nick Ho

Fix DCI PDU value bug

parent 8ee092a5
......@@ -216,7 +216,6 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
if( RAR->active == 1 )
{
LOG_I(PHY,"[Frame: %d][Subframe: %d]sent RAR\n",frame,subframe);
uint8_t *RAR_pdu = RAR->harq_process->pdu;
uint32_t rep = RAR->repetition_number;
uint8_t eutra_control_region = 3;
......@@ -228,6 +227,8 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
int G = get_G_NB_IoT(frame_parms);
uint8_t Nsf = RAR->number_of_subframes_for_resource_assignment;
LOG_I(PHY,"[Frame: %d][Subframe: %d]sent RAR, rep : %d, counter_rep:%d, Num_res:%d\n",frame,subframe,rep,counter_rep,Nsf);
if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
{
......
......@@ -216,6 +216,8 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
// NB_IoT_eNB_NPDCCH_t *ndlcch = ;
void *DLSCH_DCI_NB_IoT = NULL;
uint8_t *DCI_tmp = NULL;
//eNB->DCI_pdu = (DCI_PDU_NB_IoT*) malloc(sizeof(DCI_PDU_NB_IoT));
//N1 parameters
......@@ -283,7 +285,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
((DCIN1_RAR_t *)DLSCH_DCI_NB_IoT)->HARQackRes =HARQackRes;
((DCIN1_RAR_t *)DLSCH_DCI_NB_IoT)->DCIRep =DCIRep;
printf("DUMP: DCI N1 RAR : type = %d, orderIndicator = %d, Sched_delay = %d, ResAssign = %d, mcs = %d, RepNum = %d, ndi = %d, HARQackRes = %d, DCIRep = %d\n", type, orderIndicator, Sched_delay, ResAssign, mcs, RepNum, ndi, HARQackRes, 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);
......@@ -304,7 +306,7 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
ndlcch->repetition_number[ncce_index] = Irep_to_Nrep[RepNum]; // repetition number for NPDSCH
ndlcch->dci_repetitions[ncce_index] = DCIrep_to_real_rep(DCIRep,32); ////??????? should be repalce by the value in spec table 16.6-3, check also Rmax
//printf("dci_repetitions: %d\n",ndlcch->dci_repetitions[ncce_index]);
printf("dci_repetitions: %d\n",ndlcch->dci_repetitions[ncce_index]);
ndlcch->modulation[ncce_index] = 2; //QPSK
//// ////////////////////////////////////////////////if(ndlcch->round == 0) //this should be set from initialization (init-lte)
......@@ -312,6 +314,13 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
ndlcch->mcs[ncce_index] = mcs;
ndlcch->pdu[ncce_index] = DLSCH_DCI_NB_IoT;
DCI_tmp = (uint8_t*)DLSCH_DCI_NB_IoT;
int tmp = 0;
printf("DCI PDU content\n");
for (tmp =0;tmp<3;tmp++)
printf("%02x ",DCI_tmp[tmp]);
printf("\n");
/*
* TS 36.213 ch 16.4.1.5
* ITBS is always set equivalent to IMCS for data
......
......@@ -222,6 +222,7 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
eNB->ndlsch_RAR->counter_repetition_number = Irep_to_Nrep_x[rel13->repetition_number];
eNB->ndlsch_RAR->counter_current_sf_repetition = 0;
eNB->ndlsch_RAR->pointer_to_subframe = 0;
printf("number of subframe : %d, Rep of subframe : %d\n",eNB->ndlsch_RAR->number_of_subframes_for_resource_assignment,eNB->ndlsch_RAR->counter_repetition_number);
}
else
......@@ -254,7 +255,6 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
eNB->ndlsch_RAR->counter_repetition_number = Irep_to_Nrep_x[rel13->repetition_number];
eNB->ndlsch_RAR->counter_current_sf_repetition = 0;
eNB->ndlsch_RAR->pointer_to_subframe = 0;
}
}
......
......@@ -775,6 +775,7 @@ void generate_eNB_dlsch_params_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t * proc,n
DCI_Content->DCIN1_RAR.HARQackRes = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.harq_ack_resource;
DCI_Content->DCIN1_RAR.DCIRep = dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number;
//TODO calculate the number of common repetitions
//fp->nprach_config_common.number_repetition_RA = see TS 36.213 Table 16.1-3
......
......@@ -220,13 +220,14 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
dci_n1_rar->type = 1;
dci_n1_rar->orderIndicator = 0;
dci_n1_rar->Scheddly = msg2_i_delay;
dci_n1_rar->ResAssign = 0;
dci_n1_rar->mcs = 0;
dci_n1_rar->RepNum = 0; // 36.213 table 16.4.1.3-2, 8 candidates
dci_n1_rar->ResAssign = I_sf;
dci_n1_rar->mcs = I_mcs;
dci_n1_rar->RepNum = msg2_nodes->ce_level; // 36.213 table 16.4.1.3-2, 8 candidates
dci_n1_rar->ndi = 0; // ndi is useless in RAR 36.212 says the feild is reserved
dci_n1_rar->HARQackRes = 0; // no HARQ procedure in RAR 36.212 says the feild is reserved
dci_n1_rar->DCIRep = 0; // 36.213 table 16.6-1 R=Rmax/8
//printf("I_sf = %d,I_mcs = %d, RepNum = %d\n",dci_n1_rar->ResAssign,I_mcs,msg2_nodes->ce_level);
// for dci
dci_result->output_subframe = dci_first_subframe;//dci_subframe;
dci_result->end_subframe = dci_end_subframe;
......
......@@ -43,7 +43,7 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
Sched_Rsp_NB_IoT_t *SCHED_info = &mac_inst->Sched_INFO;
//UE_TEMPLATE_NB_IoT *UE_info;
//enable_preamble_simulation(UL_INFO,1);
enable_preamble_simulation(UL_INFO,1);
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0)
......
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