Commit b6eafe59 authored by Nick Ho's avatar Nick Ho

On Dedicate resource dbg

parent 78b09bed
......@@ -346,10 +346,12 @@ void preprocessor_uss_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_ins
//Set repetition number of downlink transmission
if(UE_template_temp->direction==1)
{
//UE_sched_ctrl_info->R_dci=UE_template_temp->R_dci;
UE_sched_ctrl_info->R_dl_data=UE_template_temp->R_dl;
UE_sched_ctrl_info->R_dl_harq=UE_template_temp->R_harq;
UE_sched_ctrl_info->dci_n1_index_mcs=UE_template_temp->I_mcs_dl;
LOG_D(MAC,"[%04d][preprocessor_uss_NB_IoT][UE%d] Initialze R_dci %d R_data_dl %d R_harq %d \n", mac_inst->current_subframe, UE_template_temp->rnti, UE_sched_ctrl_info->R_dci=UE_template_temp->R_dci, UE_sched_ctrl_info->R_dl_data, UE_sched_ctrl_info->R_dl_harq=UE_template_temp->R_harq);
LOG_N(MAC,"[%04d][preprocessor_uss_NB_IoT][UE%d] Initialze R_dci %d R_data_dl %d R_harq %d \n", mac_inst->current_subframe, UE_template_temp->rnti, UE_sched_ctrl_info->R_dci=UE_template_temp->R_dci, UE_sched_ctrl_info->R_dl_data, UE_sched_ctrl_info->R_dl_harq=UE_template_temp->R_harq);
//determine how many SF for data transmission
//store_rlc_logical_channel_info_dl();
}
......
......@@ -388,9 +388,9 @@ void receive_msg3_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, rnti_t c_rnti, uint32_t
if((RA_TEMPLATE_NB_IoT *)0 != msg3_nodes)
while((RA_TEMPLATE_NB_IoT *)0 != msg3_nodes){
if(msg3_nodes->ue_rnti == c_rnti){
LOG_D(MAC,"add ue in\n");
LOG_I(MAC,"add ue in\n");
add_ue_NB_IoT(mac_inst, c_rnti, msg3_nodes->ce_level, phr, ul_total_buffer);// rnti, ce level
LOG_D(MAC,"[%04d][RA scheduler][MSG3][CE%d] Receive MSG3 T-CRNTI %d Preamble Index %d \n", mac_inst->current_subframe, msg3_nodes->ce_level, msg3_nodes->ue_rnti, msg3_nodes->preamble_index);
LOG_I(MAC,"[%04d][RA scheduler][MSG3][CE%d] Receive MSG3 T-CRNTI %d Preamble Index %d \n", mac_inst->current_subframe, msg3_nodes->ce_level, msg3_nodes->ue_rnti, msg3_nodes->preamble_index);
msg3_nodes->ccch_buffer = ccch_sdu;
msg3_nodes->msg4_rrc_buffer = msg4_rrc_sdu;
migrate_node = msg3_nodes;
......@@ -739,7 +739,7 @@ void schedule_msg4_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
r = rmax/num_candidate;
num_dci_subframe = r;
dci_subframe = abs_subframe;//mac_inst->current_subframe;
LOG_N(MAC,"In Msg4 scheduling, we have rmax:%d, candidiate:%d, r:%d \n",rmax, num_candidate,r);
for(dci_candidate=0; dci_candidate<num_candidate; ++dci_candidate){
while(!is_dlsf(mac_inst, dci_subframe)){
++dci_subframe;
......
......@@ -94,7 +94,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
data_size=UE_info->DLSCH_pdu_size;
}
LOG_D(MAC,"[%04d][DLSchedulerUSS] Max TBS %d MCS index %d TBS index %d\n", mac_inst->current_subframe, TBS, I_mcs, I_tbs);
LOG_I(MAC,"[%04d][DLSchedulerUSS] Max TBS %d MCS index %d TBS index %d\n", mac_inst->current_subframe, TBS, I_mcs, I_tbs);
/*set UE data information*/
/*New transmission*/
#if 1
......@@ -150,19 +150,19 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
if((UE_info->HARQ_round>0)&&(TBS<data_size))
{
LOG_D(MAC,"[%04d][DLSchedulerUSS][Fail] TBS is not enough for retransmission\n", mac_inst->current_subframe);
return;
return -1;
}
}
#endif
//data_size=200; //for testing
LOG_I(MAC,"[%04d][DLSchedulerUSS] UE data size %d\n", mac_inst->current_subframe, data_size);
//LOG_I(MAC,"[%04d][DLSchedulerUSS] UE data size %d\n", mac_inst->current_subframe, data_size);
//Have DCCH data
if(data_size == 0)
{
LOG_D(MAC,"[%04d][DLSchedulerUSS][Fail] No data in DCCH0_NB_IoT\n", mac_inst->current_subframe);
return;
return -1;
}
if(data_size>127)
{
......@@ -180,7 +180,7 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
/*Loop all NPDCCH candidate position*/
for(cdd_num=0;cdd_num<UE_info->R_max/UE_sched_ctrl_info->R_dci;++cdd_num)
{
//LOG_D(MAC,"[%04d][DLSchedulerUSS] Candidate num %d DCI Rep %d\n",mac_inst->current_subframe, cdd_num, UE_sched_ctrl_info->R_dci);
LOG_I(MAC,"[%04d][DLSchedulerUSS] Candidate num %d DCI Rep %d DCI Rmax: %d\n",mac_inst->current_subframe, cdd_num, UE_sched_ctrl_info->R_dci,UE_info->R_max);
/*Check NPDCCH Resource*/
end_flagCCH = check_resource_NPDCCH_NB_IoT(mac_inst, hyperSF_start, frame_start, subframe_start, NPDCCH_info, cdd_num, UE_info->R_dci);
......@@ -190,14 +190,14 @@ int schedule_DL_NB_IoT(module_id_t module_id, eNB_MAC_INST_NB_IoT *mac_inst, UE_
{
//LOG_D(MAC,"[%04d][DLSchedulerUSS] Candidate num %d allocate success\n",mac_inst->current_subframe, cdd_num);
//LOG_D(MAC,"[%04d][DLSchedulerUSS] Allocate NPDCCH subframe %d to subframe %d cdd index %d\n", mac_inst->current_subframe, NPDCCH_info->sf_start, NPDCCH_info->sf_end, cdd_num);
/*
//Max DL TBS
if(TBS > data_size+subheader_length)
{
TBS = get_tbs(data_size, I_tbs, &I_sf);
LOG_D(MAC,"[%04d][DLSchedulerUSS] [%d] data_size %d TBS change to %d \n", mac_inst->current_subframe,UE_info->rnti, data_size, TBS);
}
*/
//Get number of subframe this UE need per repetition
n_sf = get_num_sf(I_sf);
......
......@@ -264,8 +264,6 @@ void rx_sdu_NB_IoT(module_id_t module_id, int CC_id, frame_t frame, sub_frame_t
msg4_rrc_pdu = mac_rrc_msg3_ind_NB_IoT(payload_ptr,rnti,rx_lengths[i]);
receive_msg3_NB_IoT(mac_inst,rnti,PHR,ul_total_buffer,first_6,msg4_rrc_pdu);
LOG_I(MAC,"Contention resolution ID = %02x %02x %02x %02x %02x %02x\n",first_6[0],first_6[1],first_6[2],first_6[3],first_6[4],first_6[5]);
//NB_IoT_mac_rrc_data_ind(payload_ptr,mac_inst,rnti);
//NB_IoT_receive_msg3(mac_inst,rnti,PHR,ul_total_buffer);
break;
case DCCH0_NB_IoT:
case DCCH1_NB_IoT:
......@@ -285,12 +283,12 @@ void rx_sdu_NB_IoT(module_id_t module_id, int CC_id, frame_t frame, sub_frame_t
1,
NULL);//(unsigned int*)crc_status);
// trigger DL scheduler
if (UE_info != NULL){
UE_info->direction = 1; //1 for DL scheduler
}
// UE specific here
//NB_IoT_mac_rlc_data_ind(payload_ptr,mac_inst,rnti);
if (UE_info != NULL)
{
UE_info->direction = 1; //1 for DL scheduler
LOG_I(MAC,"After receive Msg5, change the UE scheduling direction to DL\n");
}
break;
// all the DRBS
case DTCH0_NB_IoT:
......
......@@ -152,7 +152,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
//(mac_inst->UE_list_spec+i)->NPDCCH_config_dedicated.R_max = mac_inst->rrc_config.npdcch_ConfigDedicated[i].R_max;
//(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 = 16;
(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.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);
......
......@@ -747,7 +747,9 @@ void add_ue_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint16_t rnti, ce_level_t ce,
UE_list->UE_template_NB_IoT[i].CE_level = (uint32_t)ce;
//assume random select direction
UE_list->UE_template_NB_IoT[i].R_dci = dci_rep[(uint32_t)ce];
UE_list->UE_template_NB_IoT[i].R_max = UE_list->NPDCCH_config_dedicated.R_max;
//UE_list->UE_template_NB_IoT[i].R_max = UE_list->NPDCCH_config_dedicated.R_max;
UE_list->UE_template_NB_IoT[i].R_max = mac_inst->npdcch_config_common[0].R_max;
//UE_list->UE_template_NB_IoT[i].R_max = 16;
UE_list->UE_template_NB_IoT[i].R_harq = harq_rep[(uint32_t)ce];
UE_list->UE_template_NB_IoT[i].HARQ_round = 0;
......
......@@ -244,7 +244,7 @@ void mac_rlc_data_ind (
hashtable_rc_t h_rc;
srb_flag_t srb_flag = (channel_idP <= 3) ? SRB_FLAG_YES : SRB_FLAG_NO;
protocol_ctxt_t ctxt;
LOG_I(RLC,"NB-IoT: RLC PDU receive\n");
LOG_I(RLC,"NB-IoT: RLC PDU receive\n");
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_idP, enb_flagP, rntiP, frameP, 0, eNB_index);
......
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