Commit 9ec2d964 authored by Nick Ho's avatar Nick Ho

Scheduling DL timing already debugged

parent b6eafe59
......@@ -1794,13 +1794,13 @@ void decode_NPUSCH_msg_NB_IoT(PHY_VARS_eNB *eNB,
{
//fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,1); // indicate ACK to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,1);
printf(" decoded ACK of msg4: ACK \n");
printf(" decoded ACK of DL Data (include MSG4): ACK \n");
} else if (counter_ack<8) { //hard decision
//fill_crc_indication_NB_IoT(eNB,0,rx_frame,rx_subframe,0); // indicate NAK to MAC
fill_rx_indication_NB_IoT(eNB,proc,npusch_format,0);
printf(" decoded ACK of msg4: NACK \n");
printf(" decoded ACK of DL Data (include MSG4): NACK \n");
} else { //when equality (8 bits 0 vs 8 bits 1), soft decision
......
......@@ -293,6 +293,7 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u
UE_template_temp->DLSCH_pdu_size=UE_sched_ctrl_info->TBS;
if(UE_template_temp->HARQ_round==0)
UE_template_temp->oldNDI_DL=(UE_template_temp->oldNDI_DL+1)%2;
UE_template_temp->direction = 3;
break;
case 0: // Uplink
LOG_D(MAC,"[%04d][schedule_uss_NB_IoT][UE%d] USS UL Final scheduling\n", mac_inst->current_subframe, UE_template_temp->rnti);
......@@ -313,6 +314,9 @@ void schedule_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, u
UE_template_temp->direction = -1;
break;
case 3:
LOG_D(MAC,"This UE is already scheduled, wait for the response\n");
break;
case -1: // Idle
//DEBUG("current idle.. \n");
break;
......@@ -416,6 +420,9 @@ void preprocessor_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_ins
break;
case -1: // Idle state, no data wait to send
//sDEBUG("current idle.. \n");
case 3:
LOG_D(MAC,"This UE is already scheduled, wait for the response\n");
break;
default:
break;
}
......
......@@ -153,8 +153,8 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
//(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G = mac_inst->rrc_config.npdcch_ConfigDedicated[i].G;
//(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset = mac_inst->rrc_config.npdcch_ConfigDedicated[i].a_offset;
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.R_max = 4;
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G = 4;
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset = 0;
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G = 2;
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset = 0.25f;
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.T = (uint32_t)((double)(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.R_max * (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G);
(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.ss_start_uss = (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.T * (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset;
//SCHEDULE_LOG("[init_mac_NB_IoT][CE%d] Rmax %d G %d, a_offset %d, PP %d search space start %d\n", i, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.R_max, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.G, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.a_offset, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.T, (mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.ss_start_uss);
......
......@@ -78,6 +78,8 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
int i=0;
uint32_t abs_subframe;
Sched_Rsp_NB_IoT_t *SCHED_info = &mac_inst->Sched_INFO;
UE_TEMPLATE_NB_IoT *ue_info = (UE_TEMPLATE_NB_IoT *)0;
enable_preamble_simulation(UL_INFO,0);
......@@ -122,8 +124,26 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
// Check if there is any feed back of HARQ
if(UL_INFO->nb_harq_ind.nb_harq_indication_body.number_of_harqs>0)
{
LOG_I(MAC,"Recieved Ack of DL Data, rnti : %x\n",UL_INFO->nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.rnti);
receive_msg4_ack_NB_IoT(mac_inst,UL_INFO->nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.rnti);
//LOG_I(MAC,"Recieved Ack of DL Data, rnti : %x\n",UL_INFO->nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.rnti);
ue_info = get_ue_from_rnti(mac_inst,UL_INFO->nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.rnti);
if (ue_info->direction==3)
{
if(UL_INFO->nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0].nb_harq_indication_fdd_rel13.harq_tb1==1)
{
LOG_I(MAC,"This UE get the response of HARQ DL : ACK\n");
ue_info->direction=0;
}else
{
ue_info->direction=1;
ue_info->HARQ_round++;
LOG_I(MAC,"This UE get the response of HARQ DL : NACK, and will start the next harq round : %d\n",ue_info->HARQ_round);
}
}
else
{
receive_msg4_ack_NB_IoT(mac_inst,UL_INFO->nb_harq_ind.nb_harq_indication_body.nb_harq_pdu_list[0].rx_ue_information.rnti);
}
}
UL_INFO->nb_harq_ind.nb_harq_indication_body.number_of_harqs = 0;
......
......@@ -1077,9 +1077,9 @@ uint8_t do_RRCConnectionSetup_NB_IoT(
#endif
// NPDCCH
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13 =NPDCCH_ConfigDedicated_NB_r13__npdcch_NumRepetitions_r13_r16;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13 =NPDCCH_ConfigDedicated_NB_r13__npdcch_Offset_USS_r13_zero;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13=NPDCCH_ConfigDedicated_NB_r13__npdcch_StartSF_USS_r13_v4;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_NumRepetitions_r13 =NPDCCH_ConfigDedicated_NB_r13__npdcch_NumRepetitions_r13_r4;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_Offset_USS_r13 =NPDCCH_ConfigDedicated_NB_r13__npdcch_Offset_USS_r13_oneFourth;
physicalConfigDedicated2_NB_IoT->npdcch_ConfigDedicated_r13->npdcch_StartSF_USS_r13=NPDCCH_ConfigDedicated_NB_r13__npdcch_StartSF_USS_r13_v2;
// NPUSCH
npusch_repetitions = CALLOC(1, sizeof(long));
......
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