Commit a6cc4b39 authored by Nick Ho's avatar Nick Ho

msg3 flag implemented

parent f57e5b4e
...@@ -472,7 +472,8 @@ typedef struct schedule_result{ ...@@ -472,7 +472,8 @@ typedef struct schedule_result{
int16_t num_sf; int16_t num_sf;
int16_t harq_round; int16_t harq_round;
// determine this uplink data is msg3 or not (different TBS table here)
uint8_t msg3_flag;
}schedule_result_t; }schedule_result_t;
......
...@@ -292,7 +292,7 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u ...@@ -292,7 +292,7 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u
DCI_N0 = (DCIFormatN0_t*)malloc(sizeof(DCIFormatN0_t)); DCI_N0 = (DCIFormatN0_t*)malloc(sizeof(DCIFormatN0_t));
//generate DCI-N0 content //generate DCI-N0 content
fill_DCI_N0(DCI_N0, UE_template_temp, UE_sched_ctrl_info); fill_DCI_N0(DCI_N0, UE_template_temp, UE_sched_ctrl_info);
generate_scheduling_result_UL(UE_sched_ctrl_info->NPDCCH_sf_start, UE_sched_ctrl_info->NPDCCH_sf_end,UE_sched_ctrl_info->NPUSCH_sf_start, UE_sched_ctrl_info->NPUSCH_sf_end,DCI_N0, UE_template_temp->rnti, str22, str23); generate_scheduling_result_UL(UE_sched_ctrl_info->NPDCCH_sf_start, UE_sched_ctrl_info->NPDCCH_sf_end,UE_sched_ctrl_info->NPUSCH_sf_start+3, UE_sched_ctrl_info->NPUSCH_sf_end+3,DCI_N0, UE_template_temp->rnti, str22, str23, 0);
//sotre UE_template //sotre UE_template
UE_template_temp->R_dci=UE_sched_ctrl_info->R_dci; UE_template_temp->R_dci=UE_sched_ctrl_info->R_dci;
UE_template_temp->R_ul=UE_sched_ctrl_info->R_ul_data; UE_template_temp->R_ul=UE_sched_ctrl_info->R_ul_data;
......
...@@ -295,7 +295,7 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){ ...@@ -295,7 +295,7 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
fill_resource_DL(mac_inst, msg2_node, msg2_first_subframe, msg2_end_subframe, msg2_result); fill_resource_DL(mac_inst, msg2_node, msg2_first_subframe, msg2_end_subframe, msg2_result);
// fill msg3 resource // fill msg3 resource
generate_scheduling_result_UL(-1, -1, npusch_info.sf_start+3, npusch_info.sf_end+3, dci_n0, tc_rnti, str11, (void *)0); generate_scheduling_result_UL(-1, -1, npusch_info.sf_start+3, npusch_info.sf_end+3, dci_n0, tc_rnti, str11, (void *)0, 1); // the last argument is msg3 flag
adjust_UL_resource_list(&npusch_info); adjust_UL_resource_list(&npusch_info);
//simulate_rx(&simulate_rx_msg3_list, tc_rnti, npusch_info.sf_start); //simulate_rx(&simulate_rx_msg3_list, tc_rnti, npusch_info.sf_start);
...@@ -586,7 +586,7 @@ void schedule_msg3_retransimission_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs ...@@ -586,7 +586,7 @@ void schedule_msg3_retransimission_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs
// fill dci resource // fill dci resource
fill_resource_DL(mac_inst, dci_node, dci_first_subframe, dci_end_subframe, dci_result); fill_resource_DL(mac_inst, dci_node, dci_first_subframe, dci_end_subframe, dci_result);
// fill msg3 resource // fill msg3 resource
generate_scheduling_result_UL(-1, -1, npusch_info.sf_start, npusch_info.sf_end, dci_n0_msg3, msg3_nodes->ue_rnti, str12, (void *)0); // rnti generate_scheduling_result_UL(-1, -1, npusch_info.sf_start, npusch_info.sf_end, dci_n0_msg3, msg3_nodes->ue_rnti, str12, (void *)0, 1); // rnti
adjust_UL_resource_list(&npusch_info); adjust_UL_resource_list(&npusch_info);
LOG_D(MAC,"[%04d][RA scheduler][MSG3 re] MSG3DCI %d-%d MSG3 %d-%d\n", abs_subframe, dci_first_subframe, dci_end_subframe, npusch_info.sf_start, npusch_info.sf_end ); LOG_D(MAC,"[%04d][RA scheduler][MSG3 re] MSG3DCI %d-%d MSG3 %d-%d\n", abs_subframe, dci_first_subframe, dci_end_subframe, npusch_info.sf_start, npusch_info.sf_end );
}else{ }else{
......
...@@ -298,14 +298,16 @@ int output_handler(eNB_MAC_INST_NB_IoT *mac_inst, module_id_t module_id, int CC_ ...@@ -298,14 +298,16 @@ 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.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
// if(msg3_mac_flag ==1) // remove comment after creating a the mac flag for msg3 if(schedule_result_list_UL->msg3_flag ==1)
// { {
(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
// } else { LOG_I(MAC,"process msg3 at output handler, size = %d\n",(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size);
} else
{
//(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]/8; // for the case of other NPUSH msgs //(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]/8; // for the case of other NPUSH msgs
(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,1,0)][((DCIFormatN0_t *)DCI_pdu)->ResAssign]/8; // for the case of other NPUSH msgs (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,1,0)][((DCIFormatN0_t *)DCI_pdu)->ResAssign]/8; // for the case of other NPUSH msgs
LOG_I(MAC,"Process uplink data at output handler, size = %d\n",(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.size);
// } }
//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
(ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.subcarrier_indication = ((DCIFormatN0_t *)DCI_pdu)->scind; (ul_config_pdu + i) ->nulsch_pdu.nulsch_pdu_rel13.subcarrier_indication = ((DCIFormatN0_t *)DCI_pdu)->scind;
......
...@@ -166,7 +166,7 @@ int single_tone_ru_allocation(uint32_t uplink_time, int total_ru, sched_temp_UL_ ...@@ -166,7 +166,7 @@ int single_tone_ru_allocation(uint32_t uplink_time, int total_ru, sched_temp_UL_
/*Check multi tone resource list*/ /*Check multi tone resource list*/
int multi_tone_ru_allocation(uint32_t uplink_time, int total_ru, sched_temp_UL_NB_IoT_t *NPUSCH_info); int multi_tone_ru_allocation(uint32_t uplink_time, int total_ru, sched_temp_UL_NB_IoT_t *NPUSCH_info);
/*Generate scheduling result of DCI N0 and Uplink config*/ /*Generate scheduling result of DCI N0 and Uplink config*/
void generate_scheduling_result_UL(int32_t DCI_subframe, int32_t DCI_end_subframe, uint32_t UL_subframe, uint32_t UL_end_subframe, DCIFormatN0_t *DCI_inst, rnti_t rnti, uint8_t *ul_debug_str, uint8_t *dl_debug_str); void generate_scheduling_result_UL(int32_t DCI_subframe, int32_t DCI_end_subframe, uint32_t UL_subframe, uint32_t UL_end_subframe, DCIFormatN0_t *DCI_inst, rnti_t rnti, uint8_t *ul_debug_str, uint8_t *dl_debug_str, uint8_t msg3_flag);
/*Adjust UL resource by removing the used resource*/ /*Adjust UL resource by removing the used resource*/
void adjust_UL_resource_list(sched_temp_UL_NB_IoT_t *NPUSCH_info); void adjust_UL_resource_list(sched_temp_UL_NB_IoT_t *NPUSCH_info);
/*Initialize resource by nprach configuration*/ /*Initialize resource by nprach configuration*/
......
...@@ -584,7 +584,7 @@ void insert_schedule_result(schedule_result_t **list, int subframe, schedule_res ...@@ -584,7 +584,7 @@ void insert_schedule_result(schedule_result_t **list, int subframe, schedule_res
} }
} }
void generate_scheduling_result_UL(int32_t DCI_subframe, int32_t DCI_end_subframe, uint32_t UL_subframe, uint32_t UL_end_subframe, DCIFormatN0_t *DCI_inst, rnti_t rnti, uint8_t *ul_printf_str, uint8_t *dl_printf_str){ void generate_scheduling_result_UL(int32_t DCI_subframe, int32_t DCI_end_subframe, uint32_t UL_subframe, uint32_t UL_end_subframe, DCIFormatN0_t *DCI_inst, rnti_t rnti, uint8_t *ul_printf_str, uint8_t *dl_printf_str, uint8_t msg3_flag){
// create the schedule result node for this time transmission // create the schedule result node for this time transmission
schedule_result_t *UL_result = (schedule_result_t*)malloc(sizeof(schedule_result_t)); schedule_result_t *UL_result = (schedule_result_t*)malloc(sizeof(schedule_result_t));
...@@ -599,6 +599,7 @@ void generate_scheduling_result_UL(int32_t DCI_subframe, int32_t DCI_end_subfram ...@@ -599,6 +599,7 @@ void generate_scheduling_result_UL(int32_t DCI_subframe, int32_t DCI_end_subfram
UL_result->DCI_release = 1; UL_result->DCI_release = 1;
UL_result->channel = NPUSCH; UL_result->channel = NPUSCH;
UL_result->rnti = rnti; UL_result->rnti = rnti;
UL_result->msg3_flag = msg3_flag;
UL_result->next = NULL; UL_result->next = NULL;
//UL_result->printf_str = ul_printf_str; //UL_result->printf_str = ul_printf_str;
......
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