Commit 5661cba0 authored by alexandr's avatar alexandr

* update the function prototypes and vars for RSRP and RSRQ

* change the trigger functions for handover



git-svn-id: http://svn.eurecom.fr/openair4G/trunk@5704 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent 8a8fcf1b
...@@ -156,11 +156,11 @@ void lte_ue_measurements_emul(PHY_VARS_UE *phy_vars_ue,uint8_t last_slot,uint8_t ...@@ -156,11 +156,11 @@ void lte_ue_measurements_emul(PHY_VARS_UE *phy_vars_ue,uint8_t last_slot,uint8_t
@returns Path loss in dB @returns Path loss in dB
*/ */
int16_t get_PL(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); int16_t get_PL(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); uint32_t get_RSRP(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_RSRQ(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index); uint32_t get_RSRQ(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
uint8_t get_n_adj_cells(module_id_t Mod_id,uint8_t CC_id); uint8_t get_n_adj_cells(module_id_t Mod_id,uint8_t CC_id);
int8_t get_rx_total_gain_dB(module_id_t Mod_id,uint8_t CC_id); uint32_t get_rx_total_gain_dB(module_id_t Mod_id,uint8_t CC_id);
int8_t get_RSSI(module_id_t Mod_id,uint8_t CC_id); uint32_t get_RSSI(module_id_t Mod_id,uint8_t CC_id);
int8_t set_RSRP_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp); int8_t set_RSRP_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rstq); int8_t set_RSRQ_filtered(module_id_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rstq);
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "PHY/extern.h" #include "PHY/extern.h"
#include "SCHED/defs.h" #include "SCHED/defs.h"
#include "SCHED/extern.h" #include "SCHED/extern.h"
#include "log.h"
#include "emmintrin.h" #include "emmintrin.h"
...@@ -20,7 +21,7 @@ __m128i zeroPMI; ...@@ -20,7 +21,7 @@ __m128i zeroPMI;
#define k1 ((long long int) 1000) #define k1 ((long long int) 1000)
#define k2 ((long long int) (1024-k1)) #define k2 ((long long int) (1024-k1))
//#define DEBUG_MEAS #define DEBUG_MEAS
#ifdef USER_MODE #ifdef USER_MODE
void print_shorts(char *s,__m128i *x) { void print_shorts(char *s,__m128i *x) {
...@@ -78,36 +79,34 @@ uint8_t get_n_adj_cells (uint8_t Mod_id,uint8_t CC_id){ ...@@ -78,36 +79,34 @@ uint8_t get_n_adj_cells (uint8_t Mod_id,uint8_t CC_id){
return 0; return 0;
} }
int8_t get_rx_total_gain_dB (uint8_t Mod_id,uint8_t CC_id){ uint32_t get_rx_total_gain_dB (uint8_t Mod_id,uint8_t CC_id){
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
if (phy_vars_ue) if (phy_vars_ue)
return phy_vars_ue->rx_total_gain_dB; return phy_vars_ue->rx_total_gain_dB;
else return 0xFFFFFFFF;
return -1;
} }
int8_t get_RSSI (uint8_t Mod_id,uint8_t CC_id){ uint32_t get_RSSI (uint8_t Mod_id,uint8_t CC_id){
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
if (phy_vars_ue) if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.rssi; return phy_vars_ue->PHY_measurements.rssi;
else return 0xFFFFFFFF;
return -1;
} }
uint8_t get_RSRP(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) { uint32_t get_RSRP(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
if (phy_vars_ue) if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.rsrp[eNB_index]; return phy_vars_ue->PHY_measurements.rsrp[eNB_index];
return 0; return 0xFFFFFFFF;
} }
uint8_t get_RSRQ(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) { uint32_t get_RSRQ(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index) {
PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id]; PHY_VARS_UE *phy_vars_ue = PHY_vars_UE_g[Mod_id][CC_id];
if (phy_vars_ue) if (phy_vars_ue)
return phy_vars_ue->PHY_measurements.rsrq[eNB_index]; return phy_vars_ue->PHY_measurements.rsrq[eNB_index];
return 0; return 0xFFFFFFFF;
} }
int8_t set_RSRP_filtered(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp) { int8_t set_RSRP_filtered(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp) {
...@@ -268,9 +267,9 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -268,9 +267,9 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
phy_vars_ue->PHY_measurements.rsrq[eNB_offset] = 3; phy_vars_ue->PHY_measurements.rsrq[eNB_offset] = 3;
} }
if (((phy_vars_ue->frame %10) == 0) && (slot == 1)) { //if (((phy_vars_ue->frame %10) == 0) && (slot == 1)) {
#ifdef DEBUG_MEAS #ifdef DEBUG_MEAS
if (eNB_offset == 0) //if (eNB_offset == 0)
LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\n",phy_vars_ue->Mod_id, LOG_D(PHY,"[UE %d] Frame %d, slot %d RRC Measurements => rssi %3.1f dBm (digital: %3.1f dB)\n",phy_vars_ue->Mod_id,
phy_vars_ue->frame,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB, phy_vars_ue->frame,slot,10*log10(phy_vars_ue->PHY_measurements.rssi)-phy_vars_ue->rx_total_gain_dB,
10*log10(phy_vars_ue->PHY_measurements.rssi)); 10*log10(phy_vars_ue->PHY_measurements.rssi));
...@@ -281,10 +280,13 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue, ...@@ -281,10 +280,13 @@ void ue_rrc_measurements(PHY_VARS_UE *phy_vars_ue,
(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12), (dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
(10*log10(phy_vars_ue->PHY_measurements.rx_power_avg[0])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12), (10*log10(phy_vars_ue->PHY_measurements.rx_power_avg[0])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12),
(10*log10(phy_vars_ue->PHY_measurements.rsrq[eNB_offset]))-20); (10*log10(phy_vars_ue->PHY_measurements.rsrq[eNB_offset]))-20);
#endif //LOG_D(PHY,"RSRP_total_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0)-phy_vars_ue->rx_total_gain_dB-dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12));
//LOG_D(PHY,"RSRP_dB: %3.2f \n",(dB_fixed_times10(phy_vars_ue->PHY_measurements.rsrp[eNB_offset])/10.0));
} //LOG_D(PHY,"gain_loss_dB: %d \n",phy_vars_ue->rx_total_gain_dB);
//LOG_D(PHY,"gain_fixed_dB: %d \n",dB_fixed(phy_vars_ue->lte_frame_parms.N_RB_DL*12));
#endif
//}
} }
} }
......
...@@ -349,11 +349,11 @@ typedef struct ...@@ -349,11 +349,11 @@ typedef struct
//unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB) //unsigned short rx_avg_power_dB[NUMBER_OF_CONNECTED_eNB_MAX]; //! estimated avg received signal power (dB)
// RRC measurements // RRC measurements
int rssi; uint32_t rssi;
int n_adj_cells; int n_adj_cells;
unsigned int adj_cell_id[6]; unsigned int adj_cell_id[6];
int rsrq[7]; uint32_t rsrq[7];
int rsrp[7]; uint32_t rsrp[7];
float rsrp_filtered[7]; // after layer 3 filtering float rsrp_filtered[7]; // after layer 3 filtering
float rsrq_filtered[7]; float rsrq_filtered[7];
// common measurements // common measurements
......
...@@ -155,7 +155,7 @@ void get_prach_resources(module_id_t module_idP, ...@@ -155,7 +155,7 @@ void get_prach_resources(module_id_t module_idP,
UE_mac_inst[module_idP].RA_usedGroupA = 1; UE_mac_inst[module_idP].RA_usedGroupA = 1;
} }
else if ((Msg3_size < rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->messageSizeGroupA) || else if ((Msg3_size < rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->messageSizeGroupA) ||
(mac_xface->get_PL(module_idP,eNB_index) > UE_mac_inst[module_idP].RA_maxPL)) { (mac_xface->get_PL(module_idP,0,eNB_index) > UE_mac_inst[module_idP].RA_maxPL)) {
// use Group A procedure // use Group A procedure
UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = (taus())%rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA; UE_mac_inst[module_idP].RA_prach_resources.ra_PreambleIndex = (taus())%rach_ConfigCommon->preambleInfo.preamblesGroupAConfig->sizeOfRA_PreamblesGroupA;
UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0; UE_mac_inst[module_idP].RA_prach_resources.ra_RACH_MaskIndex = 0;
......
...@@ -1494,7 +1494,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su ...@@ -1494,7 +1494,7 @@ UE_L2_STATE_t ue_scheduler(module_id_t module_idP,frame_t frameP, sub_frame_t su
} else { } else {
//LOG_D(MAC,"PHR normal operation %d active %d \n", UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF, UE_mac_inst[module_idP].PHR_reporting_active); //LOG_D(MAC,"PHR normal operation %d active %d \n", UE_mac_inst[module_idP].scheduling_info.periodicPHR_SF, UE_mac_inst[module_idP].PHR_reporting_active);
if ((UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF <= 0) && if ((UE_mac_inst[module_idP].scheduling_info.prohibitPHR_SF <= 0) &&
((mac_xface->get_PL(module_idP,eNB_indexP) < UE_mac_inst[module_idP].scheduling_info.PathlossChange_db) || ((mac_xface->get_PL(module_idP,0,eNB_indexP) < UE_mac_inst[module_idP].scheduling_info.PathlossChange_db) ||
(UE_mac_inst[module_idP].power_backoff_db[eNB_indexP] > UE_mac_inst[module_idP].scheduling_info.PathlossChange_db))) (UE_mac_inst[module_idP].power_backoff_db[eNB_indexP] > UE_mac_inst[module_idP].scheduling_info.PathlossChange_db)))
// trigger PHR and reset the timer later when the PHR report is sent // trigger PHR and reset the timer later when the PHR report is sent
UE_mac_inst[module_idP].PHR_reporting_active = 1; UE_mac_inst[module_idP].PHR_reporting_active = 1;
......
...@@ -244,28 +244,28 @@ typedef struct ...@@ -244,28 +244,28 @@ typedef struct
UE_MODE_t (*get_ue_mode)(module_id_t Mod_id,int CC_id,uint8_t eNB_index); UE_MODE_t (*get_ue_mode)(module_id_t Mod_id,int CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve measured Path Loss /// Function for UE MAC to retrieve measured Path Loss
int16_t (*get_PL)(module_id_t Mod_id,uint8_t eNB_index); int16_t (*get_PL)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve the rssi /// Function for UE MAC to retrieve the rssi
int8_t (*get_RSSI)(module_id_t Mod_id); uint32_t (*get_RSSI)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve the total gain /// Function for UE MAC to retrieve the total gain
int8_t (*get_rx_total_gain_dB)(module_id_t Mod_id); uint32_t (*get_rx_total_gain_dB)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve the number of adjustent cells /// Function for UE MAC to retrieve the number of adjustent cells
uint8_t (*get_n_adj_cells)(module_id_t Mod_id); uint8_t (*get_n_adj_cells)(uint8_t Mod_id,uint8_t CC_id);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements /// Function for UE MAC to retrieve RSRP/RSRQ measurements
uint8_t (*get_RSRP)(module_id_t Mod_id,uint8_t eNB_index); uint32_t (*get_RSRP)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to retrieve RSRP/RSRQ measurements /// Function for UE MAC to retrieve RSRP/RSRQ measurements
uint8_t (*get_RSRQ)(module_id_t Mod_id,uint8_t eNB_index); uint32_t (*get_RSRQ)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements /// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRP_filtered)(module_id_t Mod_id,uint8_t eNB_index,float rsrp); uint8_t (*set_RSRP_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
/// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements /// Function for UE MAC to set the layer3 filtered RSRP/RSRQ measurements
uint8_t (*set_RSRQ_filtered)(module_id_t Mod_id,uint8_t eNB_index,float rsrq); uint8_t (*set_RSRQ_filtered)(uint8_t Mod_id,uint8_t CC_id,uint8_t eNB_index,float rsrp);
/// Function for UE/eNB MAC to retrieve number of PRACH in TDD /// Function for UE/eNB MAC to retrieve number of PRACH in TDD
uint8_t (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms); uint8_t (*get_num_prach_tdd)(LTE_DL_FRAME_PARMS *frame_parms);
......
...@@ -2196,9 +2196,10 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_ ...@@ -2196,9 +2196,10 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
struct MeasResultEUTRA__measResult meas2; struct MeasResultEUTRA__measResult meas2;
// int rsrp_va=10; // int rsrp_va=10;
meas2.rsrpResult=&rsrp_t;
meas2.rsrpResult=&(rsrp_t);
//&rsrp_va; //&rsrp_va;
meas2.rsrqResult=&rsrq_t; meas2.rsrqResult=&(rsrq_t);
measresulteutra2->measResult=meas2; measresulteutra2->measResult=meas2;
...@@ -2210,6 +2211,9 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_ ...@@ -2210,6 +2211,9 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer,int measid,int phy_
(void*)&ul_dcch_msg, (void*)&ul_dcch_msg,
buffer, buffer,
100); 100);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n", AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %d)!\n",
enc_rval.failed_type->name, enc_rval.encoded); enc_rval.failed_type->name, enc_rval.encoded);
......
This diff is collapsed.
...@@ -495,6 +495,9 @@ static module_id_t rrc_eNB_get_next_free_UE_index( ...@@ -495,6 +495,9 @@ static module_id_t rrc_eNB_get_next_free_UE_index(
boolean_t reg = FALSE; boolean_t reg = FALSE;
module_id_t i, first_index = UE_MODULE_INVALID; module_id_t i, first_index = UE_MODULE_INVALID;
LOG_D(RRC,"ENB_ID= %d \n",enb_mod_idP);
LOG_D(RRC,"N_ID= %d \n",NB_eNB_INST);
AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB index invalid (%d/%d)!", enb_mod_idP, NB_eNB_INST); AssertFatal(enb_mod_idP < NB_eNB_INST, "eNB index invalid (%d/%d)!", enb_mod_idP, NB_eNB_INST);
for (i = 0; i < NUMBER_OF_UE_MAX; i++) { for (i = 0; i < NUMBER_OF_UE_MAX; i++) {
...@@ -1201,7 +1204,7 @@ void rrc_eNB_process_MeasurementReport( ...@@ -1201,7 +1204,7 @@ void rrc_eNB_process_MeasurementReport(
#endif #endif
if (eNB_rrc_inst[enb_mod_idP].handover_info[ue_mod_idP]->ho_prepare != 0xF0) { if (eNB_rrc_inst[enb_mod_idP].handover_info[ue_mod_idP]->ho_prepare != 0xF0) {
rrc_eNB_generate_HandoverPreparationInformation(enb_mod_idP, rrc_eNB_generate_HandoverPreparationInformation(enb_mod_idP,
frameP, frameP,
ue_mod_idP, ue_mod_idP,
measResults2->measResultNeighCells->choice. measResults2->measResultNeighCells->choice.
......
...@@ -120,7 +120,7 @@ uint32_t T304[8] = {50,100,150,200,500,1000,2000,MAX_U32}; ...@@ -120,7 +120,7 @@ uint32_t T304[8] = {50,100,150,200,500,1000,2000,MAX_U32};
uint32_t timeToTrigger_ms[16] = {0,40,64,80,100,128,160,256,320,480,512,640,1024,1280,2560,5120}; uint32_t timeToTrigger_ms[16] = {0,40,64,80,100,128,160,256,320,480,512,640,1024,1280,2560,5120};
/* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */ /* 36.133 Section 9.1.4 RSRP Measurement Report Mapping, Table: 9.1.4-1 */
float RSRP_meas_mapping[100] = { float RSRP_meas_mapping[98] = {
-140, -140,
-139, -139,
-138, -138,
...@@ -217,10 +217,11 @@ float RSRP_meas_mapping[100] = { ...@@ -217,10 +217,11 @@ float RSRP_meas_mapping[100] = {
-47, -47,
-46, -46,
-45, -45,
-44 -44,
-43
}; };
float RSRQ_meas_mapping[33] = { float RSRQ_meas_mapping[35] = {
-19, -19,
-18.5, -18.5,
-18, -18,
...@@ -253,7 +254,9 @@ float RSRQ_meas_mapping[33] = { ...@@ -253,7 +254,9 @@ float RSRQ_meas_mapping[33] = {
-4.5, -4.5,
-4, -4,
-3.5, -3.5,
-3 -3,
-2.5,
-2
}; };
#endif #endif
...@@ -94,7 +94,7 @@ int nb_antennas_rx = 2; // // ...@@ -94,7 +94,7 @@ int nb_antennas_rx = 2; // //
uint8_t target_dl_mcs = 0; // not set uint8_t target_dl_mcs = 0; // not set
uint8_t rate_adaptation_flag = 0; uint8_t rate_adaptation_flag = 0;
uint8_t set_sinr = 0; uint8_t set_sinr = 0;
double snr_dB, sinr_dB; double snr_dB=0, sinr_dB=0;
uint8_t set_seed = 0; uint8_t set_seed = 0;
uint8_t cooperation_flag; // for cooperative communication uint8_t cooperation_flag; // for cooperative communication
uint8_t abstraction_flag = 0; uint8_t abstraction_flag = 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