* add time measurement for lte softmodem

* bug fixe when missed slots happens
* bug fix in mac ULSCH preprocessor


git-svn-id: http://svn.eurecom.fr/openair4G/trunk@7490 818b1a75-f10b-46b9-bf7c-635c3b92a50f
This commit is contained in:
Navid Nikaein
2015-05-28 15:14:00 +00:00
parent ffd422df60
commit 2ae01b5273
13 changed files with 303 additions and 57 deletions
+29
View File
@@ -44,6 +44,35 @@ int opp_enabled = 0;
return (double)ts.diff/1000000000;
}*/
double get_cpu_freq_GHz(void) {
time_stats_t ts = {0};
reset_meas(&ts);
start_meas(&ts);
sleep(1);
stop_meas(&ts);
cpu_freq_GHz = (double)ts.diff/1000000000;
return cpu_freq_GHz;
}
void print_meas_now(time_stats_t *ts, const char* name, int subframe, FILE* file_name){
if (opp_enabled) {
//static double cpu_freq_GHz = 3.2;
//if (cpu_freq_GHz == 0.0)
//cpu_freq_GHz = get_cpu_freq_GHz(); // super slow
if (ts->trials>0) {
//fprintf(file_name,"Name %25s: Processing %15.3f ms for SF %d, diff_now %15.3f \n", name,(ts->diff_now/(cpu_freq_GHz*1000000.0)),subframe,ts->diff_now);
fprintf(file_name,"%15.3f ms, diff_now %15.3f \n",(ts->diff_now/(cpu_freq_GHz*1000000.0)),ts->diff_now);
}
}
}
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time)
{
+19 -12
View File
@@ -34,9 +34,12 @@
// global var to enable openair performance profiler
extern int opp_enabled;
double cpu_freq_GHz;
typedef struct {
long long in;
long long diff_now;
long long diff;
long long p_time; /*!< \brief absolute process duration */
long long diff_square; /*!< \brief process duration square */
@@ -47,8 +50,11 @@ typedef struct {
static inline void start_meas(time_stats_t *ts) __attribute__((always_inline));
static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
void print_meas_now(time_stats_t *ts, const char* name, int subframe, FILE* file_name);
void print_meas(time_stats_t *ts, const char* name, time_stats_t * total_exec_time, time_stats_t * sf_exec_time);
double get_time_meas_us(time_stats_t *ts);
double get_cpu_freq_GHz(void);
#if defined(__i386__)
static inline unsigned long long rdtsc_oai(void) __attribute__((always_inline));
@@ -109,6 +115,8 @@ static inline void stop_meas(time_stats_t *ts)
if (tid==0)
#endif
{
ts->diff_now = (out-ts->in);
ts->diff += (out-ts->in);
/// process duration is the difference between two clock points
ts->p_time = (out-ts->in);
@@ -121,16 +129,25 @@ static inline void stop_meas(time_stats_t *ts)
}
}
static inline void reset_meas(time_stats_t *ts)
{
static inline void reset_meas(time_stats_t *ts) {
static cpu_freq_set=0;
if (opp_enabled) {
ts->trials=0;
ts->diff_now=0;
ts->diff=0;
ts->p_time=0;
ts->diff_square=0;
ts->max=0;
if (cpu_freq_set == 0 ){
cpu_freq_set = 1;
get_cpu_freq_GHz();
printf("CPU Freq is %f \n", cpu_freq_GHz);
}
}
}
static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
{
@@ -148,14 +165,4 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts)
}
*/
static inline double get_cpu_freq_GHz(void)
{
time_stats_t ts = {0};
reset_meas(&ts);
start_meas(&ts);
sleep(1);
stop_meas(&ts);
return (double)ts.diff/1000000000;
}
+2 -2
View File
@@ -1394,7 +1394,7 @@ void phy_procedures_eNB_TX(unsigned char sched_subframe,PHY_VARS_eNB *phy_vars_e
// If we've dropped the UE, go back to PRACH mode for this UE
//#if !defined(EXMIMO_IOT)
if (phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors == ULSCH_max_consecutive_errors) {
LOG_I(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n",
LOG_W(PHY,"[eNB %d, CC %d] frame %d, subframe %d, UE %d: ULSCH consecutive error count reached %u, removing UE\n",
phy_vars_eNB->Mod_id,phy_vars_eNB->CC_id,frame,subframe, i, phy_vars_eNB->eNB_UE_stats[i].ulsch_consecutive_errors);
phy_vars_eNB->eNB_UE_stats[i].mode = PRACH;
remove_ue(phy_vars_eNB->eNB_UE_stats[i].crnti,phy_vars_eNB,abstraction_flag);
@@ -3549,7 +3549,7 @@ void phy_procedures_eNB_RX(const unsigned char sched_subframe,PHY_VARS_eNB *phy_
*/
// dump_ulsch(phy_vars_eNB,sched_subframe,i);
//#ifndef EXMIMO_IOT
LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error\n", frame,subframe);
LOG_W(PHY,"[eNB] Frame %d, Subframe %d: Msg3 in error, i = %d \n", frame,subframe,i);
//#else
//mac_exit_wrapper("Msg3 error");
//#endif
+2 -1
View File
@@ -81,7 +81,8 @@ int16_t get_hundred_times_delta_IF_eNB(PHY_VARS_eNB *phy_vars_eNB,uint8_t UE_id,
//(phy_vars_eNB->ulsch_eNB[UE_id]->harq_processes[harq_pid]->control_only == 1) ? phy_vars_eNB->ulsch_eNB[UE_id]->beta_offset_cqi_times8:8;
DevAssert( UE_id < NUMBER_OF_UE_MAX );
DevAssert( MPR_x100/6 < 100 );
#warning "This condition happens sometimes. Need more investigation" // navid
//DevAssert( MPR_x100/6 < 100 );
if (phy_vars_eNB->ul_power_control_dedicated[UE_id].deltaMCS_Enabled == 1) {
// This is the formula from Section 5.1.1.1 in 36.213 10*log10(deltaIF_PUSCH = (2^(MPR*Ks)-1)*beta_offset_pusch)