Commit 6040f662 authored by Nick Ho's avatar Nick Ho

fixed scheduling optimized

parent 5111eafd
......@@ -313,8 +313,14 @@ int generate_eNB_dlsch_params_from_dci_NB_IoT(PHY_VARS_eNB *eNB,
//ndlcch->status[ncce_index] = ACTIVE_NB_IoT;
ndlcch->mcs[ncce_index] = mcs;
ndlcch->pdu[ncce_index] = DLSCH_DCI_NB_IoT;
//ndlcch->pdu[ncce_index] = DLSCH_DCI_NB_IoT;
DCI_tmp = (uint8_t*)DLSCH_DCI_NB_IoT;
//DCI_tmp[0] = 128;
//DCI_tmp[1] = 66;
//DCI_tmp[2] = 4;
ndlcch->pdu[ncce_index] = DCI_tmp;
int tmp = 0;
printf("DCI PDU content:");
......
......@@ -48,7 +48,7 @@ void init_RA_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, uint8_t preamble_index, ce_le
}
migrate_node->active = 1;
migrate_node->preamble_index = preamble_index;
migrate_node->preamble_index = 0;
migrate_node->ce_level = ce_level;
migrate_node->ra_rnti = (sfn_id>>2) + 1;
migrate_node->ta = ta;
......@@ -226,7 +226,7 @@ void schedule_rar_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst, int abs_subframe){
dci_n1_rar->RepNum = msg2_nodes->ce_level; // 36.213 table 16.4.1.3-2, 8 candidates
dci_n1_rar->ndi = 0; // ndi is useless in RAR 36.212 says the feild is reserved
dci_n1_rar->HARQackRes = 0; // no HARQ procedure in RAR 36.212 says the feild is reserved
dci_n1_rar->DCIRep = 0; // 36.213 table 16.6-1 R=Rmax/8
dci_n1_rar->DCIRep = 2; // 36.213 table 16.6-1 R=Rmax/8
//printf("I_sf = %d,I_mcs = %d, RepNum = %d\n",dci_n1_rar->ResAssign,I_mcs,msg2_nodes->ce_level);
// for dci
......
......@@ -980,11 +980,11 @@ uint32_t get_I_mcs(int CE_level)
}
else if(CE_level==1)
{
return 12;
return 10;
}
else
{
return 11;
return 4;
}
}
......
......@@ -132,7 +132,7 @@ extern const int BSR_table[64];
extern const int dl_rep[3];
extern const uint32_t dci_rep[3];
extern const uint32_t harq_rep[3];
extern int cooooount;
//SIBs
extern int extend_space[2];
extern int extend_alpha_offset[2];
......
......@@ -145,6 +145,7 @@ void init_mac_NB_IoT(eNB_MAC_INST_NB_IoT *mac_inst)
Initialize_Resource();
//add_UL_Resource(mac_inst);
extend_available_resource_DL(mac_inst, mac_inst->current_subframe + 1 + 160);
cooooount = 0;
}
......
......@@ -37,11 +37,18 @@
#define fixed_scheduling 1
int init_time=0;
int fixed_scheduler(uint32_t frame, uint32_t subframe, Sched_Rsp_NB_IoT_t *SCHED_info)
{
nfapi_dl_config_request_pdu_t *dl_config_pdu;
if(cooooount==1)
{
init_time++;
}
if(frame==529&&subframe==8)
if(cooooount==1 && init_time==6)
{
//DCI
LOG_I(MAC,"[frame:%2d][subframe:%2d]NB-IoT fill DL_DCI\n",frame,subframe);
......@@ -68,7 +75,7 @@ int fixed_scheduler(uint32_t frame, uint32_t subframe, Sched_Rsp_NB_IoT_t *SCHED
dl_config_pdu->npdcch_pdu.npdcch_pdu_rel13.dci_subframe_repetition_number = 2;
return 1;
}
if(frame==530 && subframe==7)
if(cooooount==1 && init_time==15)
{
LOG_I(MAC,"[frame:%2d][subframe:%2d]NB-IoT fill DL Data\n",frame,subframe);
uint8_t *rar_pdu;
......@@ -94,6 +101,8 @@ int fixed_scheduler(uint32_t frame, uint32_t subframe, Sched_Rsp_NB_IoT_t *SCHED
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.modulation = 2;
dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.number_of_subframes_for_resource_assignment = get_num_sf(dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.resource_assignment);
SCHED_info->TX_req->tx_request_body.tx_pdu_list[dl_config_pdu->ndlsch_pdu.ndlsch_pdu_rel13.pdu_index].segments[0].segment_data = rar_pdu;
cooooount =0;
init_time =0;
return 1;
}
return 0;
......
......@@ -39,7 +39,7 @@
//#include "PHY_INTERFACE/defs.h"
//#include "COMMON/mac_rrc_primitives.h"
int cooooount;
//IF_Module_NB_IoT_t *if_inst_NB_IoT;
//NB-IoT--------------------------------------
......
......@@ -46,28 +46,31 @@ void UL_indication_NB_IoT(UL_IND_NB_IoT_t *UL_INFO)
//UE_TEMPLATE_NB_IoT *UE_info;
enable_preamble_simulation(UL_INFO,0);
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0)
{
// only use one preamble now
//for(i=0;i<UL_INFO->nrach_ind.number_of_initial_scs_detected;i++)
for(i=0;i<1;i++)
{
// initiate_ra here, some useful inforamtion :
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance
LOG_D(MAC,"Init_RA_NB_IoT in, index of sc = %d\n",(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc);
init_RA_NB_IoT(mac_inst,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame,
//timing_offset = Timing_advance * 16
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
);
LOG_D(MAC,"Init_RA_NB_IoT Out\n");
}
}
if(cooooount==0)
{
//If there is a preamble, do the initiate RA procedure
if(UL_INFO->nrach_ind.number_of_initial_scs_detected>0)
{
// only use one preamble now
//for(i=0;i<UL_INFO->nrach_ind.number_of_initial_scs_detected;i++)
for(i=0;i<1;i++)
{
// initiate_ra here, some useful inforamtion :
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc
//(UL_INFO->NRACH.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance
LOG_D(MAC,"Init_RA_NB_IoT in, index of sc = %d\n",(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc);
/*init_RA_NB_IoT(mac_inst,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.initial_sc,
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.nrach_ce_level,
UL_INFO->frame,
//timing_offset = Timing_advance * 16
(UL_INFO->nrach_ind.nrach_pdu_list+i)->nrach_indication_rel13.timing_advance*16
);*/
LOG_D(MAC,"Init_RA_NB_IoT Out\n");
cooooount=1;
}
}
}
UL_INFO->nrach_ind.number_of_initial_scs_detected = 0;
......
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