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,
////////////////////////////////////////////////////////////////////////
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,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
......@@ -220,10 +221,16 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
{
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
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
// 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;
uint8_t eutra_control_region = 3;
uint8_t eutra_control_region = 3;
uint32_t counter_rep = RAR->counter_repetition_number;
uint32_t counter_sf_rep = RAR->counter_current_sf_repetition; /// for identifiying when to trigger new scrambling
......@@ -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) )
{
dlsch_encoding_NB_IoT(RAR_pdu,
RAR,
Nsf, ///// number_of_subframes_required
......
......@@ -413,6 +413,8 @@ typedef struct {
uint32_t rnti;
/// Active flag for baseband transmitter processing
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.
uint8_t subframe_tx[10];
/// First CCE of last PDSCH scheduling per subframe. Again used during PUCCH detection for ACK/NAK.
......
......@@ -107,13 +107,14 @@ int allocate_REs_in_RB_NB_IoT(LTE_DL_FRAME_PARMS *frame_parms,
uint8_t pilot_shift,
uint32_t *re_allocated);
int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
int32_t **txdataF,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame,
uint32_t subframe,
int RB_IoT_ID);
int generate_NDLSCH_NB_IoT(PHY_VARS_eNB *eNB,
NB_IoT_eNB_NDLSCH_t *RAR,
int32_t **txdataF,
int16_t amp,
LTE_DL_FRAME_PARMS *frame_parms,
uint32_t frame,
uint32_t subframe,
int RB_IoT_ID);
int generate_NPDCCH_NB_IoT(NB_IoT_eNB_NPDCCH_t *DCI,
int32_t **txdataF,
......
......@@ -203,33 +203,11 @@ void handle_nfapi_dlsch_pdu_NB_IoT(PHY_VARS_eNB *eNB,
//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;
/*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->active_msg2 = 1; /// activated only when NPDSCH is transmitting msg2
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->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,
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);
eNB->ndlsch_RAR->harq_process->TBS = rel13->length;
eNB->ndlsch_RAR->harq_process->pdu = sdu;
}
else
{ //this for ue data
......@@ -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->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->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)
......
......@@ -348,7 +348,8 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
/////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// NPDSCH ////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
generate_NDLSCH_NB_IoT(RAR,
generate_NDLSCH_NB_IoT(eNB,
RAR,
txdataF,
AMP,
fp,
......@@ -358,7 +359,7 @@ void common_signal_procedures_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
///////////////////////////////////////////////////////////////////////////////////
}
generate_pilots_NB_IoT(eNB,
generate_pilots_NB_IoT(eNB,
txdataF,
AMP,
subframe,
......
......@@ -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
// ******* sc_spacing issues to be fixed next *******////
uint8_t sc_spacing = 1;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.handle = sc_spacing; // 1 for 15 KHz , 0 for 3.75 KHz
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;
//(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];
// 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