o-du/phy
Intel O-RAN/X-RAN Generated Doxygen Documentation
Macros | Functions | Variables
xran_timer.c File Reference

This file provides implementation to Timing for XRAN. More...

#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "xran_timer.h"
#include "xran_printf.h"
#include "xran_mlog_lnx.h"
#include "xran_lib_mlog_tasks_id.h"
#include "ethdi.h"
#include "xran_fh_o_du.h"
#include "xran_common.h"
Include dependency graph for xran_timer.c:

Go to the source code of this file.

Macros

#define NSEC_PER_SEC   1000000000L
 
#define NSEC_PER_USEC   1000L
 
#define THRESHOLD   35
 
#define TIMECOMPENSATION   2
 
#define SEC_MOD_STOP   (60)
 

Functions

uint64_t timing_get_current_second (void)
 
int timing_set_numerology (uint8_t value)
 
int timing_set_debug_stop (int value, int count)
 
int timing_get_debug_stop (void)
 
void timing_adjust_gps_second (struct timespec *p_time)
 
uint64_t xran_tick (void)
 
unsigned long get_ticks_diff (unsigned long curr_tick, unsigned long last_tick)
 
long poll_next_tick (long interval_ns, unsigned long *used_tick)
 
long sleep_next_tick (long interval)
 

Variables

uint32_t xran_lib_ota_sym
 
uint32_t xran_lib_ota_tti
 
uint32_t xran_lib_ota_sym_idx
 

Detailed Description

This file provides implementation to Timing for XRAN.

Author
Intel Corporation

Definition in file xran_timer.c.

Macro Definition Documentation

◆ NSEC_PER_SEC

#define NSEC_PER_SEC   1000000000L

Definition at line 41 of file xran_timer.c.

◆ NSEC_PER_USEC

#define NSEC_PER_USEC   1000L

Definition at line 42 of file xran_timer.c.

◆ SEC_MOD_STOP

#define SEC_MOD_STOP   (60)

Definition at line 46 of file xran_timer.c.

◆ THRESHOLD

#define THRESHOLD   35

the avg cost of clock_gettime() in ns

Definition at line 43 of file xran_timer.c.

◆ TIMECOMPENSATION

#define TIMECOMPENSATION   2

time compensation in us, avg latency of clock_nanosleep

Definition at line 44 of file xran_timer.c.

Function Documentation

◆ get_ticks_diff()

unsigned long get_ticks_diff ( unsigned long  curr_tick,
unsigned long  last_tick 
)

Definition at line 138 of file xran_timer.c.

Here is the caller graph for this function:

◆ poll_next_tick()

long poll_next_tick ( long  interval_ns,
unsigned long *  used_tick 
)

Definition at line 146 of file xran_timer.c.

Here is the call graph for this function:

◆ sleep_next_tick()

long sleep_next_tick ( long  interval)

Definition at line 246 of file xran_timer.c.

◆ timing_adjust_gps_second()

void timing_adjust_gps_second ( struct timespec *  p_time)

Definition at line 116 of file xran_timer.c.

Here is the call graph for this function:

◆ timing_get_current_second()

uint64_t timing_get_current_second ( void  )
inline

Definition at line 88 of file xran_timer.c.

Here is the caller graph for this function:

◆ timing_get_debug_stop()

int timing_get_debug_stop ( void  )

Definition at line 111 of file xran_timer.c.

◆ timing_set_debug_stop()

int timing_set_debug_stop ( int  value,
int  count 
)

Definition at line 99 of file xran_timer.c.

◆ timing_set_numerology()

int timing_set_numerology ( uint8_t  value)

Definition at line 93 of file xran_timer.c.

Here is the caller graph for this function:

◆ xran_tick()

uint64_t xran_tick ( void  )

Definition at line 131 of file xran_timer.c.

Here is the caller graph for this function:

Variable Documentation

◆ xran_lib_ota_sym

uint32_t xran_lib_ota_sym

Symbol index in a slot [0:13]

Definition at line 112 of file xran_main.c.

◆ xran_lib_ota_sym_idx

uint32_t xran_lib_ota_sym_idx

Symbol index in a second [0 : 14*(1000000/TTI)-1] where TTI is TTI interval in microseconds

Definition at line 113 of file xran_main.c.

◆ xran_lib_ota_tti

uint32_t xran_lib_ota_tti

Slot index in a second [0:(1000000/TTI-1)]

Definition at line 111 of file xran_main.c.