Commit ee0dd14d authored by Matthieu Kanj's avatar Matthieu Kanj

sub-carrier spacing

parent 51c66750
...@@ -206,7 +206,8 @@ int generate_SIB23(NB_IoT_eNB_NDLSCH_t *SIB23, ...@@ -206,7 +206,8 @@ int generate_SIB23(NB_IoT_eNB_NDLSCH_t *SIB23,
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
NB_IoT_eNB_NDLSCH_t *RAR,
int32_t **txdataF, int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
...@@ -220,6 +221,12 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -220,6 +221,12 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
{ {
uint8_t *RAR_pdu = RAR->harq_process->pdu; uint8_t *RAR_pdu = RAR->harq_process->pdu;
// TODO: process the RAR PDU to get the subcarrier indication for NPUSCH , Then set value in NPUSCH // TODO: process the RAR PDU to get the subcarrier indication for NPUSCH , Then set value in NPUSCH
if(RAR->active_msg2 == 1)
{
uint8_t one_byte = RAR_pdu[2]>>3;
uint8_t subcarrier_spacing = one_byte^0x01;
eNB->ulsch_NB_IoT[0]->harq_process->subcarrier_spacing = subcarrier_spacing;
}
// to be added at the end of NPDSCH process // to be added at the end of NPDSCH process
// make different between RAR data and NPDSCH data // add a flag in NPDSCH to switch between RA and normal data transmission // make different between RAR data and NPDSCH data // add a flag in NPDSCH to switch between RA and normal data transmission
uint32_t rep = RAR->repetition_number; uint32_t rep = RAR->repetition_number;
...@@ -237,7 +244,6 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -237,7 +244,6 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) ) if( (counter_rep == rep) && (counter_sf_rep == 0) && (pointer_to_sf == 0) )
{ {
dlsch_encoding_NB_IoT(RAR_pdu, dlsch_encoding_NB_IoT(RAR_pdu,
RAR, RAR,
Nsf, ///// number_of_subframes_required Nsf, ///// number_of_subframes_required
......
...@@ -413,6 +413,8 @@ typedef struct { ...@@ -413,6 +413,8 @@ typedef struct {
uint32_t rnti; uint32_t rnti;
/// Active flag for baseband transmitter processing /// Active flag for baseband transmitter processing
uint8_t active; uint8_t active;
/// Active flag when msg2 is transmitted
uint8_t active_msg2;
/// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK. /// Indicator of TX activation per subframe. Used during PUCCH detection for ACK/NAK.
uint8_t subframe_tx[10]; uint8_t subframe_tx[10];
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK. /// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
......
...@@ -107,7 +107,8 @@ int allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms, ...@@ -107,7 +107,8 @@ int allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t pilot_shift, uint8_t pilot_shift,
uint32_t *re_allocated); uint32_t *re_allocated);
int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
NB_IoT_eNB_NDLSCH_t *RAR,
int32_t **txdataF, int32_t **txdataF,
int16_t amp, int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
......
...@@ -204,32 +204,10 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -204,32 +204,10 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
{ {
eNB->ndlsch_RAR->active = 1; eNB->ndlsch_RAR->active = 1;
eNB->ndlsch_RAR->harq_process->TBS = rel13->length; eNB->ndlsch_RAR->active_msg2 = 1; /// activated only when NPDSCH is transmitting msg2
/*uint8_t tab_rar[7];
tab_rar[0]=64;
tab_rar[1]=0;
tab_rar[2]=9;
tab_rar[3]=96;
tab_rar[4]=64;
tab_rar[5]=255; // 16
tab_rar[6]=242; // 5
eNB->ndlsch_RAR->harq_process->pdu = tab_rar;*/
eNB->ndlsch_RAR->harq_process->pdu = sdu;
/*printf("RAR PDU content:");
int fori = 0;
for(fori=0;fori<7;fori++)
{
printf("%d ",eNB->ndlsch_RAR->harq_process->pdu[fori]);
}
printf("\n");*/
eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
eNB->ndlsch_RAR->active = 1;
eNB->ndlsch_RAR->rnti = rel13->rnti; eNB->ndlsch_RAR->rnti = rel13->rnti;
eNB->ndlsch_RAR->npdsch_start_symbol = rel13->start_symbol;
eNB->ndlsch_RAR->rnti_type = rel13->rnti_type; eNB->ndlsch_RAR->rnti_type = rel13->rnti_type;
eNB->ndlsch_RAR->resource_assignment = rel13->resource_assignment; // for NDLSCH // this value point to --> number of subframes needed eNB->ndlsch_RAR->resource_assignment = rel13->resource_assignment; // for NDLSCH // this value point to --> number of subframes needed
...@@ -242,7 +220,8 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -242,7 +220,8 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
eNB->ndlsch_RAR->counter_current_sf_repetition = 0; eNB->ndlsch_RAR->counter_current_sf_repetition = 0;
eNB->ndlsch_RAR->pointer_to_subframe = 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); //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);
eNB->ndlsch_RAR->harq_process->TBS = rel13->length;
eNB->ndlsch_RAR->harq_process->pdu = sdu;
} }
else else
{ //this for ue data { //this for ue data
...@@ -466,7 +445,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO) ...@@ -466,7 +445,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
nulsch->SF_idx = nfapi_parameters_rel13->sf_idx; nulsch->SF_idx = nfapi_parameters_rel13->sf_idx;
nulsch->HARQ_ACK_resource = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource; nulsch->HARQ_ACK_resource = nfapi_parameters_rel13->nb_harq_information.nb_harq_information_rel13_fdd.harq_ack_resource;
nulsch_harq->subcarrier_spacing = nfapi_parameters_rel13->handle; //* TO FIXE*/// // 0 for 15 KHz and 1 for 3.75 KHz// TODO : get the value from the UL_grant of MSG3 //nulsch_harq->subcarrier_spacing = nfapi_parameters_rel13->handle; // get from the UL_grant of MSG3
nulsch_harq->subcarrier_indication = nfapi_parameters_rel13->subcarrier_indication; // Isc =0->18 , or 0->47 // format 2, 0->3 or 0->7 nulsch_harq->subcarrier_indication = nfapi_parameters_rel13->subcarrier_indication; // Isc =0->18 , or 0->47 // format 2, 0->3 or 0->7
nulsch_harq->resource_assignment = nfapi_parameters_rel13->resource_assignment; // valid for format 1 // this should be set by DCI N0 // not used for msg3 // I_RU --> helps to get N_RU nulsch_harq->resource_assignment = nfapi_parameters_rel13->resource_assignment; // valid for format 1 // this should be set by DCI N0 // not used for msg3 // I_RU --> helps to get N_RU
nulsch_harq->mcs = nfapi_parameters_rel13->mcs; // I_mcs = 0->10 (single tone) and 0->12 (multi-tone) nulsch_harq->mcs = nfapi_parameters_rel13->mcs; // I_mcs = 0->10 (single tone) and 0->12 (multi-tone)
......
...@@ -348,7 +348,8 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -348,7 +348,8 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// NPDSCH //////////////////////////////////// ///////////////////////////////////// NPDSCH ////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
generate_NDLSCH_NB_IoT(RAR, generate_NDLSCH_NB_IoT(eNB,
RAR,
txdataF, txdataF,
AMP, AMP,
fp, fp,
......
...@@ -290,8 +290,8 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -290,8 +290,8 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
//contidition should be added to select either the UL_TBS_Table or t UL_TBS_table_msg3 //contidition should be added to select either the UL_TBS_Table or t UL_TBS_table_msg3
// ******* sc_spacing issues to be fixed next *******//// // ******* sc_spacing issues to be fixed next *******////
uint8_t sc_spacing = 1; uint8_t sc_spacing = 1; // 1 for 15 KHz , 0 for 3.75 KHz // TODO, get this value from scheduler
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.handle = sc_spacing; // 1 for 15 KHz , 0 for 3.75 KHz //(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.handle = sc_spacing;
//(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[((DCIFormatN0_t *)DCI_pdu)->mcs][((DCIFormatN0_t *)DCI_pdu)->ResAssign]; //(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[((DCIFormatN0_t *)DCI_pdu)->mcs][((DCIFormatN0_t *)DCI_pdu)->ResAssign];
//(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, get_N_RU(((DCIFormatN0_t *)DCI_pdu)->ResAssign), 0)][((DCIFormatN0_t *)DCI_pdu)->ResAssign]; //(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, get_N_RU(((DCIFormatN0_t *)DCI_pdu)->ResAssign), 0)][((DCIFormatN0_t *)DCI_pdu)->ResAssign];
// get_UL_I_TBS_from_MCS_NB_IoT() to be used to get the I_TBS for any NPUSCH format // get_UL_I_TBS_from_MCS_NB_IoT() to be used to get the I_TBS for any NPUSCH format
......
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