Commit 7d361758 authored by Matthieu Kanj's avatar Matthieu Kanj

handling NPUSCH repetitions + NPUSCH optimization

parent 8814974e
...@@ -614,7 +614,7 @@ typedef struct { ...@@ -614,7 +614,7 @@ typedef struct {
/// Flag to indicate that eNB should decode UE Msg3 /// Flag to indicate that eNB should decode UE Msg3
uint8_t Msg3_flag; uint8_t Msg3_flag;
/// Subframe for Msg3 /// Subframe for Msg3
uint8_t Msg3_subframe; uint32_t Msg3_subframe;
/// Frame for Msg3 /// Frame for Msg3
uint32_t Msg3_frame; uint32_t Msg3_frame;
/// RNTI attributed to this ULSCH /// RNTI attributed to this ULSCH
...@@ -635,9 +635,14 @@ typedef struct { ...@@ -635,9 +635,14 @@ typedef struct {
uint16_t SF_idx; uint16_t SF_idx;
/// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2 /// Determined the ACK/NACK delay and the subcarrier allocation TS 36.213 Table 16.4.2
uint8_t HARQ_ACK_resource; uint8_t HARQ_ACK_resource;
/// Flag to trigger the storage of frame & subframe values for scrambling
uint8_t flag_scramble; //////////////////////////////////////////////////////////////////
/// Flag to trigger the storage of values
uint8_t flag_vars;
uint16_t counter_sf;
uint16_t counter_repetitions;
// uint16_t sf_number;
// uint16_t rep_number;
///////////// kept from LTE /////////////////////////////////////////////////// ///////////// kept from LTE ///////////////////////////////////////////////////
/// Maximum number of iterations used in eNB turbo decoder /// Maximum number of iterations used in eNB turbo decoder
......
...@@ -39,6 +39,7 @@ uint8_t tab_ack_3_75khz[16]= {38,39,40,41,42,43,44,45,38,39,40,41,42,43,44,45}; ...@@ -39,6 +39,7 @@ uint8_t tab_ack_3_75khz[16]= {38,39,40,41,42,43,44,45,38,39,40,41,42,43,44,45};
uint8_t tab_I_ru_N_ru_UL[8]= {1,2,3,4,5,6,8,10}; uint8_t tab_I_ru_N_ru_UL[8]= {1,2,3,4,5,6,8,10};
uint8_t tab_I_rep_N_rep_UL[8]={1,2,4,8,16,32,64,128}; uint8_t tab_I_rep_N_rep_UL[8]={1,2,4,8,16,32,64,128};
/*
// Section 16.5.1.1 in 36.213 // Section 16.5.1.1 in 36.213
uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc) uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc)
{ {
...@@ -69,6 +70,7 @@ uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc) ...@@ -69,6 +70,7 @@ uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc)
} }
} }
*/
uint16_t get_UL_N_rep_NB_IoT(uint8_t I_rep) uint16_t get_UL_N_rep_NB_IoT(uint8_t I_rep)
{ {
......
...@@ -353,25 +353,13 @@ int32_t dlsch_encoding_NB_IoT(unsigned char *a, ...@@ -353,25 +353,13 @@ int32_t dlsch_encoding_NB_IoT(unsigned char *a,
uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB, uint8_t rx_ulsch_Gen_NB_IoT(PHY_VARS_eNB *eNB,
eNB_rxtx_proc_t *proc, eNB_rxtx_proc_t *proc,
uint8_t eNB_id, // this is the effective sector id uint8_t eNB_id, // this is the effective sector id
uint8_t UE_id, uint8_t UE_id,
// NB_IoT_eNB_NULSCH_t **ulsch, uint16_t UL_RB_ID_NB_IoT, // 22 , to be included in // to be replaced by NB_IoT_start ??
//uint8_t npusch_format, // 1, 2 uint8_t subframe,
uint16_t UL_RB_ID_NB_IoT, // 22 , to be included in // to be replaced by NB_IoT_start ?? uint32_t frame);
// uint8_t subcarrier_spacing, // 0 (3.75 KHz) or 1 (15 KHz)
uint8_t scrambling_subframe_msg3,
uint32_t scrambling_frame_msg3,
uint16_t nb_slot, // total number of occupied slots
//uint16_t I_sc,
uint16_t Nsc_RU,
uint16_t Mcs,
unsigned int A,
uint16_t counter_msg,
uint8_t subframerx,
uint8_t rvdx,
uint8_t msg3_flag);
void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF, void ulsch_extract_rbs_single_NB_IoT(int32_t **rxdataF,
int32_t **rxdataF_ext, int32_t **rxdataF_ext,
...@@ -424,7 +412,7 @@ void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t ...@@ -424,7 +412,7 @@ void filtering_signal(int16_t *input_buffer, int16_t *filtered_buffer, uint32_t
uint8_t get_Qm_UL_NB_IoT(unsigned char I_mcs, uint8_t N_sc_RU, uint8_t I_sc, uint8_t Msg3_flag); uint8_t get_Qm_UL_NB_IoT(unsigned char I_mcs, uint8_t N_sc_RU, uint8_t I_sc, uint8_t Msg3_flag);
uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc); //uint16_t get_UL_sc_start_NB_IoT(uint16_t I_sc);
uint16_t get_UL_sc_index_start_NB_IoT(uint8_t subcarrier_spacing, uint16_t I_sc, uint8_t npush_format); uint16_t get_UL_sc_index_start_NB_IoT(uint8_t subcarrier_spacing, uint16_t I_sc, uint8_t npush_format);
...@@ -456,7 +444,8 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -456,7 +444,8 @@ void rotate_single_carrier_NB_IoT(PHY_VARS_eNB *eNB,
void fill_rbs_zeros_NB_IoT(PHY_VARS_eNB *eNB, void fill_rbs_zeros_NB_IoT(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
uint16_t ul_sc_start,
uint8_t UE_id, uint8_t UE_id,
uint8_t symbol); uint8_t symbol);
...@@ -465,7 +454,8 @@ int32_t ulsch_bpsk_llr_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -465,7 +454,8 @@ int32_t ulsch_bpsk_llr_NB_IoT(PHY_VARS_eNB *eNB,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint8_t symbol, uint8_t symbol,
uint8_t uint8_t, uint16_t ul_sc_start,
uint8_t UE_id,
int16_t **llrp); int16_t **llrp);
int32_t ulsch_qpsk_llr_NB_IoT(PHY_VARS_eNB *eNB, int32_t ulsch_qpsk_llr_NB_IoT(PHY_VARS_eNB *eNB,
...@@ -474,13 +464,14 @@ int32_t ulsch_qpsk_llr_NB_IoT(PHY_VARS_eNB *eNB, ...@@ -474,13 +464,14 @@ int32_t ulsch_qpsk_llr_NB_IoT(PHY_VARS_eNB *eNB,
int16_t *ulsch_llr, int16_t *ulsch_llr,
uint8_t symbol, uint8_t symbol,
uint8_t UE_id, uint8_t UE_id,
uint32_t I_sc, uint16_t ul_sc_start,
uint8_t Nsc_RU, uint8_t Nsc_RU,
int16_t *llrp); int16_t *llrp);
void rotate_bpsk_NB_IoT(PHY_VARS_eNB *eNB, void rotate_bpsk_NB_IoT(PHY_VARS_eNB *eNB,
LTE_DL_FRAME_PARMS *frame_parms, LTE_DL_FRAME_PARMS *frame_parms,
int32_t **rxdataF_comp, int32_t **rxdataF_comp,
uint16_t ul_sc_start,
uint8_t UE_id, uint8_t UE_id,
uint8_t symbol); uint8_t symbol);
//************************************************************// //************************************************************//
......
...@@ -458,7 +458,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO) ...@@ -458,7 +458,7 @@ void schedule_response_NB_IoT(Sched_Rsp_NB_IoT_t *Sched_INFO)
nulsch->Msg3_active = 1; nulsch->Msg3_active = 1;
nulsch->Msg3_flag = 1; nulsch->Msg3_flag = 1;
nulsch->flag_scramble = 1; nulsch->flag_vars = 1;
nulsch->rnti = nfapi_parameters_rel13->rnti; nulsch->rnti = nfapi_parameters_rel13->rnti;
nulsch->npusch_format = nfapi_parameters_rel13->nulsch_format; nulsch->npusch_format = nfapi_parameters_rel13->nulsch_format;
nulsch->N_srs = nfapi_parameters_rel13->n_srs; nulsch->N_srs = nfapi_parameters_rel13->n_srs;
......
...@@ -1584,9 +1584,10 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1584,9 +1584,10 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
nulsch = eNB->ulsch_NB_IoT[0]; nulsch = eNB->ulsch_NB_IoT[0];
nulsch_harq = nulsch->harq_process; nulsch_harq = nulsch->harq_process;
const int subframerx = proc->subframe_rx; const int rx_subframe = proc->subframe_rx;
const int framerx = proc->frame_rx; const int rx_frame = proc->frame_rx;
int RB_IoT_ID = 22;
//for (i=0; i<NUMBER_OF_UE_MAX; i++) //for (i=0; i<NUMBER_OF_UE_MAX; i++)
for (i=0; i<1; i++) for (i=0; i<1; i++)
{ {
...@@ -1595,64 +1596,40 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc) ...@@ -1595,64 +1596,40 @@ void npusch_procedures(PHY_VARS_eNB *eNB,eNB_rxtx_proc_t *proc)
// if eNB is ready to receive UL data // if eNB is ready to receive UL data
// define a flag to trigger on or off the decoding process // define a flag to trigger on or off the decoding process
//if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0)) //if ((ulsch) && (ulsch->rnti>0) && (ulsch_harq->status == ACTIVE) && (ulsch_harq->frame == frame) && (ulsch_harq->subframe == subframe) && (ulsch_harq->handled == 0))
uint16_t N_slots = get_UL_slots_per_RU_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); //uint16_t N_slots = get_UL_slots_per_RU_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);
if ((nulsch->Msg3_active == 1) && (nulsch->Msg3_flag == 1)) // && (ulsch_harq->frame == framerx) && (ulsch_harq->subframe == subframerx)) // if ((nulsch->Msg3_active == 1) && (nulsch->Msg3_flag == 1)) // && (ulsch_harq->frame == framerx) && (ulsch_harq->subframe == subframerx))
{ // {
if(nulsch->flag_scramble == 1) /* if(nulsch->flag_scramble == 1)
{ {
nulsch->Msg3_frame = framerx; nulsch->Msg3_frame = framerx;
nulsch->Msg3_subframe = subframerx; nulsch->Msg3_subframe = subframerx;
nulsch->flag_scramble = 0; nulsch->flag_scramble = 0;
} }*/
rx_ulsch_Gen_NB_IoT(eNB, rx_ulsch_Gen_NB_IoT(eNB,
proc, proc,
0, // this is the effective sector id 0, // this is the effective sector id
0, 0,
// nulsch, RB_IoT_ID, // 22 , to be included in // to be replaced by NB_IoT_start ??
// nulsch->npusch_format, //npusch_format, // 1, 2 rx_subframe, // first received subframe
22, // 22 , to be included in // to be replaced by NB_IoT_start ?? rx_frame); // first received frame
// 1, // 0 (3.75 KHz) or 1 (15 KHz) ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3
nulsch->Msg3_subframe, // first received subframe
nulsch->Msg3_frame, // first received frame
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_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->TBS, // A = TBS
N_slots/2, ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3
subframerx,
0,
nulsch->Msg3_flag);
} else if((nulsch->Msg3_active == 1) && (nulsch->Msg3_flag == 0)){ //// case of NPUSCH other than Msg3
// } else if((nulsch->Msg3_active == 1) && (nulsch->Msg3_flag == 0)){ //// case of NPUSCH other than Msg3
/*
rx_ulsch_Gen_NB_IoT(eNB, rx_ulsch_Gen_NB_IoT(eNB,
proc, proc,
0, // this is the effective sector id 0, // this is the effective sector id
0, 0,
// nulsch,
// nulsch->npusch_format, //npusch_format, // 1, 2
22, // 22 , to be included in // to be replaced by NB_IoT_start ?? 22, // 22 , to be included in // to be replaced by NB_IoT_start ??
// 1, // 0 (3.75 KHz) or 1 (15 KHz)
nulsch->Msg3_subframe, // first received subframe nulsch->Msg3_subframe, // first received subframe
nulsch->Msg3_frame, // first received frame nulsch->Msg3_frame, // first received frame
N_slots, // total number of occupied slots = get_nb_slot_per_RU * NB_of_RU N_slots/2, ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3
// get_UL_sc_index_start_NB_IoT(nulsch_harq->subcarrier_spacing,nulsch_harq->subcarrier_indication,nulsch->npusch_format), subframerx); */
get_UL_N_ru_NB_IoT(nulsch_harq->mcs,nulsch_harq->resource_assignment,nulsch->Msg3_flag), // N_RU // }
nulsch_harq->mcs, // I_mcs
nulsch_harq->TBS, // A = TBS
N_slots/2, ///proc->counter_msg3, // this represents the number of Subframe after encoding the msg3 // proc->counter_msg3
subframerx,
0,
nulsch->Msg3_flag);
}
} // for UE loop } // for UE loop
......
...@@ -293,7 +293,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -293,7 +293,7 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_
uint8_t sc_spacing = 0; 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.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(((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
(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 (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
......
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