Commit b3064269 authored by Navid Nikaein's avatar Navid Nikaein

merge handover related code from konstantinos

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5945 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent ff1494fd
...@@ -240,7 +240,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -240,7 +240,7 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
} }
} }
LOG_D(PHY,"eNB: %d, RSRP_tmp: %d \n",eNB_offset,phy_vars_ue->PHY_measurements.rsrp[eNB_offset]);
// 2 RE per PRB // 2 RE per PRB
phy_vars_ue->PHY_measurements.rsrp[eNB_offset]/=(24*phy_vars_ue->lte_frame_parms.N_RB_DL); phy_vars_ue->PHY_measurements.rsrp[eNB_offset]/=(24*phy_vars_ue->lte_frame_parms.N_RB_DL);
......
...@@ -2416,11 +2416,11 @@ void ue_meas_filtering(module_id_t ue_mod_idP, frame_t frameP,uint8_t eNB_index) ...@@ -2416,11 +2416,11 @@ void ue_meas_filtering(module_id_t ue_mod_idP, frame_t frameP,uint8_t eNB_index)
//LOG_D(RRC,"RSRP_total_dB: %3.2f \n",(dB_fixed_times10(mac_xface->get_RSRP(ue_mod_idP,0,eNB_offset))/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)-dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12)); //LOG_D(RRC,"RSRP_total_dB: %3.2f \n",(dB_fixed_times10(mac_xface->get_RSRP(ue_mod_idP,0,eNB_offset))/10.0)-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)-dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12));
//LOG_D(RRC,"RSRP_dB: %3.2f \n",(dB_fixed_times10(mac_xface->get_RSRP(ue_mod_idP,0,eNB_offset))/10.0)); LOG_D(RRC,"RSRP_dBm: %3.2f \n",(dB_fixed_times10(mac_xface->get_RSRP(ue_mod_idP,0,eNB_offset))/10.0));
//LOG_D(RRC,"gain_loss_dB: %d \n",mac_xface->get_rx_total_gain_dB(ue_mod_idP,0)); LOG_D(RRC,"gain_loss_dB: %d \n",mac_xface->get_rx_total_gain_dB(ue_mod_idP,0));
//LOG_D(RRC,"gain_fixed_dB: %d \n",dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12)); LOG_D(RRC,"gain_fixed_dB: %d \n",dB_fixed(mac_xface->lte_frame_parms->N_RB_DL*12));
//LOG_D(PHY,"[UE %d] Frame %d, RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\n", LOG_D(PHY,"[UE %d] Frame %d, RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\n",
//ue_mod_idP, frameP, 10*log10(mac_xface->get_RSSI(ue_mod_idP,0))-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0),10*log10(mac_xface->get_RSSI(ue_mod_idP,0))); ue_mod_idP, frameP, 10*log10(mac_xface->get_RSSI(ue_mod_idP,0))-mac_xface->get_rx_total_gain_dB(ue_mod_idP,0),10*log10(mac_xface->get_RSSI(ue_mod_idP,0)));
LOG_D(RRC,"[UE %d] Frame %d: Meas RSRP: eNB_offset: %d rsrp_coef: %3.1f filter_coef: %d before L3 filtering: rsrp: %3.1f after L3 filtering: rsrp: %3.1f \n ", LOG_D(RRC,"[UE %d] Frame %d: Meas RSRP: eNB_offset: %d rsrp_coef: %3.1f filter_coef: %d before L3 filtering: rsrp: %3.1f after L3 filtering: rsrp: %3.1f \n ",
ue_mod_idP, frameP, eNB_offset,a, ue_mod_idP, frameP, eNB_offset,a,
*UE_rrc_inst->QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP, *UE_rrc_inst->QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRP,
...@@ -2444,9 +2444,8 @@ void ue_meas_filtering(module_id_t ue_mod_idP, frame_t frameP,uint8_t eNB_index) ...@@ -2444,9 +2444,8 @@ void ue_meas_filtering(module_id_t ue_mod_idP, frame_t frameP,uint8_t eNB_index)
UE_rrc_inst[ue_mod_idP].rsrq_db_filtered[eNB_offset]=(1-a1)*UE_rrc_inst[ue_mod_idP].rsrq_db_filtered[eNB_offset] + a1 *UE_rrc_inst[ue_mod_idP].rsrq_db[eNB_offset]; UE_rrc_inst[ue_mod_idP].rsrq_db_filtered[eNB_offset]=(1-a1)*UE_rrc_inst[ue_mod_idP].rsrq_db_filtered[eNB_offset] + a1 *UE_rrc_inst[ue_mod_idP].rsrq_db[eNB_offset];
//mac_xface->set_RSRP_filtered(ue_mod_idP,eNB_offset,UE_rrc_inst[ue_mod_idP].rsrp_db_filtered[eNB_offset]); //mac_xface->set_RSRP_filtered(ue_mod_idP,eNB_offset,UE_rrc_inst[ue_mod_idP].rsrp_db_filtered[eNB_offset]);
/* /*
LOG_D(RRC,"[UE %d] meas RSRQ: eNB_offset: %d rsrq_coef: %3.2f filter_coef: %d before L3 filtering: rsrq: %3.1f after L3 filtering: rsrq: %3.1f \n ", LOG_D(RRC,"[UE %d] Frame %d: Meas RSRQ: eNB_offset: %d rsrq_coef: %3.2f filter_coef: %d before L3 filtering: rsrq: %3.1f after L3 filtering: rsrq: %3.1f \n ",
ue_mod_idP, eNB_offset, ue_mod_idP,frameP,eNB_offset,a1,
a1,
*UE_rrc_inst->QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRQ, *UE_rrc_inst->QuantityConfig[0]->quantityConfigEUTRA->filterCoefficientRSRQ,
mac_xface->get_RSRQ(ue_mod_idP,0,eNB_offset), mac_xface->get_RSRQ(ue_mod_idP,0,eNB_offset),
UE_rrc_inst[ue_mod_idP].rsrq_db[eNB_offset], UE_rrc_inst[ue_mod_idP].rsrq_db[eNB_offset],
...@@ -2558,8 +2557,8 @@ void ue_measurement_report_triggering(module_id_t ue_mod_idP, frame_t frameP,uin ...@@ -2558,8 +2557,8 @@ void ue_measurement_report_triggering(module_id_t ue_mod_idP, frame_t frameP,uin
//LOG_N(RRC,"[UE%d] Frame %d Check below lines for segfault :), Fix me \n",ue_mod_idP, frameP); //LOG_N(RRC,"[UE%d] Frame %d Check below lines for segfault :), Fix me \n",ue_mod_idP, frameP);
ttt_ms = timeToTrigger_ms[UE_rrc_inst[ue_mod_idP].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger]; ttt_ms = timeToTrigger_ms[UE_rrc_inst[ue_mod_idP].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.timeToTrigger];
// Freq specific offset of neighbor cell freq // Freq specific offset of neighbor cell freq
ofn = ((UE_rrc_inst[ue_mod_idP].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq != NULL) ? ofn = 5;//((UE_rrc_inst[ue_mod_idP].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq != NULL) ?
*UE_rrc_inst[ue_mod_idP].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq : 15); // /* 15 is the Default */ // *UE_rrc_inst[ue_mod_idP].MeasObj[i][measObjId-1]->measObject.choice.measObjectEUTRA.offsetFreq : 15); // /* 15 is the Default */
// cellIndividualOffset of neighbor cell - not defined yet // cellIndividualOffset of neighbor cell - not defined yet
ocn = 0; ocn = 0;
a3_offset = UE_rrc_inst[ue_mod_idP].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.choice.eventA3.a3_Offset; a3_offset = UE_rrc_inst[ue_mod_idP].ReportConfig[i][reportConfigId-1]->reportConfig.choice.reportConfigEUTRA.triggerType.choice.event.eventId.choice.eventA3.a3_Offset;
...@@ -2637,13 +2636,13 @@ uint8_t check_trigger_meas_event(module_id_t ue_mod_idP,frame_t frameP, uint8_t ...@@ -2637,13 +2636,13 @@ uint8_t check_trigger_meas_event(module_id_t ue_mod_idP,frame_t frameP, uint8_t
} }
if(UE_rrc_inst[ue_mod_idP].rsrp_db_filtered[eNB_offset]+ofn+ocn-hys > UE_rrc_inst[ue_mod_idP].rsrp_db_filtered[eNB_index]+ofs+ocs-1/*+a3_offset*/) { if(UE_rrc_inst[ue_mod_idP].rsrp_db_filtered[eNB_offset]+ofn+ocn-hys > UE_rrc_inst[ue_mod_idP].rsrp_db_filtered[eNB_index]+ofs+ocs-1/*+a3_offset*/) {
UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] += 2; //Called every subframe = 2ms UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] += 2; //Called every subframe = 2ms
LOG_D(RRC,"[UE %d] Frame %d: Entry measTimer[%d][%d]: %d currentCell: %d betterCell: %d \n", LOG_D(RRC,"[UE %d] Frame %d: Entry measTimer[%d][%d][%d]: %d currentCell: %d betterCell: %d \n",
ue_mod_idP, frameP, ue_cnx_index,meas_index,UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset],currentCellIndex,eNB_offset); ue_mod_idP, frameP, ue_cnx_index,meas_index,tmp_offset,UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset],currentCellIndex,eNB_offset);
} }
else { else {
UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] = 0; //Exit condition: Resetting the measurement timer UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] = 0; //Exit condition: Resetting the measurement timer
LOG_D(RRC,"[UE %d] Frame %d: Exit measTimer[%d][%d]: %d currentCell: %d betterCell: %d \n", LOG_D(RRC,"[UE %d] Frame %d: Exit measTimer[%d][%d][%d]: %d currentCell: %d betterCell: %d \n",
ue_mod_idP, frameP, ue_cnx_index,meas_index,UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset],currentCellIndex,eNB_offset); ue_mod_idP, frameP, ue_cnx_index,meas_index,tmp_offset,UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset],currentCellIndex,eNB_offset);
} }
if (UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] >= ttt) { if (UE_rrc_inst->measTimer[ue_cnx_index][meas_index][tmp_offset] >= ttt) {
UE_rrc_inst->HandoverInfoUe.targetCellId = get_adjacent_cell_id(ue_mod_idP,tmp_offset); //WARNING!!!...check this! UE_rrc_inst->HandoverInfoUe.targetCellId = get_adjacent_cell_id(ue_mod_idP,tmp_offset); //WARNING!!!...check this!
...@@ -2656,6 +2655,9 @@ uint8_t check_trigger_meas_event(module_id_t ue_mod_idP,frame_t frameP, uint8_t ...@@ -2656,6 +2655,9 @@ uint8_t check_trigger_meas_event(module_id_t ue_mod_idP,frame_t frameP, uint8_t
//LOG_D(RRC,"PHY_ID: %d \n",UE_rrc_inst->HandoverInfoUe.targetCellId); //LOG_D(RRC,"PHY_ID: %d \n",UE_rrc_inst->HandoverInfoUe.targetCellId);
return 1; return 1;
} }
// else{
// LOG_D(RRC,"Condition does not hold\n");
// }
} }
} }
return 0; return 0;
......
...@@ -1386,7 +1386,7 @@ void rrc_eNB_generate_HandoverPreparationInformation( ...@@ -1386,7 +1386,7 @@ void rrc_eNB_generate_HandoverPreparationInformation(
memcpy((void *)&eNB_rrc_inst[mod_id_target].handover_info[UE_id_target]->as_config, memcpy((void *)&eNB_rrc_inst[mod_id_target].handover_info[UE_id_target]->as_config,
(void *)&eNB_rrc_inst[enb_mod_idP].handover_info[ue_mod_idP]->as_config, sizeof(AS_Config_t)); (void *)&eNB_rrc_inst[enb_mod_idP].handover_info[ue_mod_idP]->as_config, sizeof(AS_Config_t));
eNB_rrc_inst[mod_id_target].handover_info[UE_id_target]->ho_prepare = 0xFF; eNB_rrc_inst[mod_id_target].handover_info[UE_id_target]->ho_prepare = 0x00;// 0xFF;
eNB_rrc_inst[mod_id_target].handover_info[UE_id_target]->ho_complete = 0; eNB_rrc_inst[mod_id_target].handover_info[UE_id_target]->ho_complete = 0;
eNB_rrc_inst[enb_mod_idP].handover_info[ue_mod_idP]->modid_t = mod_id_target; eNB_rrc_inst[enb_mod_idP].handover_info[ue_mod_idP]->modid_t = mod_id_target;
......
0 0 867 1440 40 0 0 1800 4800 200
1 0 887 1460 40 10 0 4700 4840 200
2 0 907 1480 30 20 0 6500 4880 200
3 0 927 1500 30
4 0 947 1520 30
5 0 967 1540 30
6 0 987 1560 30
7 0 1007 1580 30
8 0 1027 1600 30
9 0 1047 1620 30
10 0 1067 1640 30
11 0 1087 1660 30
12 0 1107 1680 30
0 0 670 1200 0 0 0 2680 4800 0
0 1 1162 1800 0 0 1 4648 4800 0
0 2 1162 600 0 0 2 6648 4800 0
\ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
<LARGE_SCALE>urban</LARGE_SCALE> <LARGE_SCALE>urban</LARGE_SCALE>
<FREE_SPACE_MODEL_PARAMETERS> <FREE_SPACE_MODEL_PARAMETERS>
<PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT> <PATHLOSS_EXPONENT>3.67</PATHLOSS_EXPONENT>
<!-- <PATHLOSS_0_dB>-100</PATHLOSS_0_dB> --> <!--pathloss at 1km -->
<PATHLOSS_0_dB>-120</PATHLOSS_0_dB><!--pathloss at 1km --> <PATHLOSS_0_dB>-120</PATHLOSS_0_dB><!--pathloss at 1km -->
</FREE_SPACE_MODEL_PARAMETERS> </FREE_SPACE_MODEL_PARAMETERS>
<SMALL_SCALE>AWGN</SMALL_SCALE> <SMALL_SCALE>AWGN</SMALL_SCALE>
...@@ -29,8 +30,8 @@ ...@@ -29,8 +30,8 @@
<TOPOLOGY_CONFIG> <TOPOLOGY_CONFIG>
<AREA> <AREA>
<X_m>2400</X_m> <X_m>10000</X_m> //2400
<Y_m>2400</Y_m> <Y_m>10000</Y_m> //2400
</AREA> </AREA>
<MOBILITY> <MOBILITY>
<UE_MOBILITY> <UE_MOBILITY>
...@@ -54,7 +55,7 @@ ...@@ -54,7 +55,7 @@
</TOPOLOGY_CONFIG> </TOPOLOGY_CONFIG>
<EMULATION_CONFIG> <EMULATION_CONFIG>
<EMULATION_TIME_ms>3000</EMULATION_TIME_ms> <EMULATION_TIME_ms>10000</EMULATION_TIME_ms>
<LOG> <!-- set the global log level --> <LOG> <!-- set the global log level -->
<LEVEL>debug</LEVEL> <LEVEL>debug</LEVEL>
......
...@@ -93,6 +93,7 @@ uint16_t Nid_cell = 0; //needed by init_lte_vars ...@@ -93,6 +93,7 @@ uint16_t Nid_cell = 0; //needed by init_lte_vars
int nb_antennas_rx = 2; // // int nb_antennas_rx = 2; // //
uint8_t target_dl_mcs = 16; // max mcs used by MAC scheduler uint8_t target_dl_mcs = 16; // max mcs used by MAC scheduler
uint8_t rate_adaptation_flag = 0; uint8_t rate_adaptation_flag = 0;
uint8_t set_snr = 0;
uint8_t set_sinr = 0; uint8_t set_sinr = 0;
double snr_dB=0, sinr_dB=0; double snr_dB=0, sinr_dB=0;
uint8_t set_seed = 0; uint8_t set_seed = 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