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

sucarrier spacing issue

parent d82ea721
...@@ -219,6 +219,7 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR, ...@@ -219,6 +219,7 @@ int generate_NDLSCH_NB_IoT(NB_IoT_eNB_NDLSCH_t *RAR,
if( RAR->active == 1 ) if( RAR->active == 1 )
{ {
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
uint32_t rep = RAR->repetition_number; uint32_t rep = RAR->repetition_number;
uint8_t eutra_control_region = 3; uint8_t eutra_control_region = 3;
......
...@@ -489,7 +489,7 @@ typedef struct { ...@@ -489,7 +489,7 @@ typedef struct {
uint8_t new_data_indication; uint8_t new_data_indication;
/// Determined the subcarrier spacing for NPUSCH (15 kHz or 3.75 KHz) /// Determined the subcarrier spacing for NPUSCH (15 kHz or 3.75 KHz)
uint8_t subcarrier_spacing; uint8_t subcarrier_spacing; /////////////////////////TODO: to be set using msg2 PDU content
/// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz) /// Determined the subcarrier allocation for the NPUSCH.(15, 3.75 KHz)
uint8_t subcarrier_indication; uint8_t subcarrier_indication;
/// Determined the number of resource unit for the NPUSCH /// Determined the number of resource unit for the NPUSCH
......
...@@ -466,7 +466,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO) ...@@ -466,7 +466,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; // 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; //* 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_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)
......
...@@ -50,7 +50,7 @@ uint32_t is_SIB1_NB_IoT(const frame_t frameP, ...@@ -50,7 +50,7 @@ uint32_t is_SIB1_NB_IoT(const frame_t frameP,
uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance); uint32_t rx_nprach_NB_IoT(PHY_VARS_eNB *eNB,int frame, uint8_t subframe, uint16_t *rnti, uint16_t *preamble_index, uint16_t *timing_advance);
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control); void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc);
////////////////// NB-IoT testing //////////////////// ////////////////// NB-IoT testing ////////////////////
void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control); void fill_rx_indication_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control);
......
...@@ -396,9 +396,9 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc ...@@ -396,9 +396,9 @@ void phy_procedures_eNB_uespec_RX_NB_IoT(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc
eNB->rb_mask_ul[3] = 0; eNB->rb_mask_ul[3] = 0;
//////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////
*/ */
uint8_t data_or_control=0; // get this info from UL_config_request
npusch_procedures(eNB,proc,data_or_control); npusch_procedures(eNB,proc);
pthread_mutex_lock(&eNB->UL_INFO_mutex); pthread_mutex_lock(&eNB->UL_INFO_mutex);
...@@ -1580,7 +1580,7 @@ void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subfra ...@@ -1580,7 +1580,7 @@ void fill_crc_indication_NB_IoT(PHY_VARS_eNB *eNB,int UE_id,int frame,int subfra
} }
void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_control) void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
{ {
uint32_t i; uint32_t i;
...@@ -1634,6 +1634,7 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_c ...@@ -1634,6 +1634,7 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc,uint8_t data_or_c
N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU
get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format), get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format),
get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU
//if 0<get_numb_UL_sc_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format),// Nsc,
nulsch_harq->mcs, // I_mcs nulsch_harq->mcs, // I_mcs
nulsch_harq->TBS, // A = TBS nulsch_harq->TBS, // A = TBS
N_slots/2, ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3 N_slots/2, ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3
......
...@@ -995,6 +995,39 @@ uint8_t get_UL_I_TBS_from_MCS_NB_IoT(uint8_t I_mcs, uint8_t N_sc_RU, uint8_t Msg ...@@ -995,6 +995,39 @@ uint8_t get_UL_I_TBS_from_MCS_NB_IoT(uint8_t I_mcs, uint8_t N_sc_RU, uint8_t Msg
} }
} }
/////////////////
///////////////////////////////////////////////
//// function to test if configuration is single or multi-tone //// 1 for single and 0 for multi-tone
uint8_t test_signle_tone_UL_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format)
{
if(npush_format == 0) // format 1
{
if(subcarrier_spacing == 0) // 15 KHz
{
if(I_sc >= 0 && I_sc < 12)
{
return 1;
} else if (I_sc >= 12 && I_sc < 16) {
return 0;
} else if (I_sc >= 16 && I_sc < 18) {
return 0;
} else if (I_sc == 18) {
return 0;
} else {
return 1;
}
} else {
return 1;
}
} else { /// format 2
return 1;
}
}
//////////////////
/*Get MCS index*/ /*Get MCS index*/
uint32_t get_I_mcs(int CE_level) uint32_t get_I_mcs(int CE_level)
......
...@@ -289,11 +289,13 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -289,11 +289,13 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.nulsch_format = 0; (ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.nulsch_format = 0;
//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 *******////
uint8_t sc_spacing = 0;
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.handle = sc_spacing; // 0 for 15 KHz , 1 for 3.75 KHz
//(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(), 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(), 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
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table_msg3[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, 1, 1)]; // for the case of MSG3 (ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size = UL_TBS_Table_msg3[get_UL_I_TBS_from_MCS_NB_IoT(((DCIFormatN0_t *)DCI_pdu)->mcs, test_signle_tone_UL_NB_IoT(sc_spacing,((DCIFormatN0_t *)DCI_pdu)->scind, 0), 1)]/8; // for the case of MSG3
//LOG_D(MAC,"test\n"); //LOG_D(MAC,"test\n");
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti; //TODO : check if it is the right rnti // get from msg2 (ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.rnti = schedule_result_list_UL->rnti; //TODO : check if it is the right rnti // get from msg2
......
...@@ -189,6 +189,8 @@ uint32_t get_num_sf(uint32_t I_sf); ...@@ -189,6 +189,8 @@ uint32_t get_num_sf(uint32_t I_sf);
////// //////
uint8_t get_UL_I_TBS_from_MCS_NB_IoT(uint8_t I_mcs, uint8_t N_sc_RU, uint8_t Msg3_flag); uint8_t get_UL_I_TBS_from_MCS_NB_IoT(uint8_t I_mcs, uint8_t N_sc_RU, uint8_t Msg3_flag);
uint8_t test_signle_tone_UL_NB_IoT(uint8_t subcarrier_spacing, uint8_t I_sc, uint8_t npush_format);
////// //////
uint32_t get_scheduling_delay(uint32_t I_delay, uint32_t R_max); uint32_t get_scheduling_delay(uint32_t I_delay, uint32_t R_max);
......
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