mirror of
https://gitlab.eurecom.fr/oai/openairinterface5g.git
synced 2026-07-16 14:10:28 +00:00
Compare commits
8 Commits
pre-commit
...
more_time_
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a427bdaf2 | ||
|
|
ea80c586b3 | ||
|
|
c4d3413022 | ||
|
|
35de2d99c1 | ||
|
|
6a4f1b00a6 | ||
|
|
eb583d3591 | ||
|
|
3bcf086272 | ||
|
|
f7f1aeb878 |
@@ -51,6 +51,11 @@ double get_cpu_freq_GHz(void)
|
||||
}
|
||||
|
||||
|
||||
static double StdDev(time_stats_t *ptr)
|
||||
{
|
||||
return sqrt((double)ptr->diff_square * 1e-6 / ptr->trials - pow((double)ptr->diff / ptr->trials / 1000, 2));
|
||||
}
|
||||
|
||||
|
||||
void print_meas_now(time_stats_t *ts,
|
||||
const char *name,
|
||||
@@ -110,6 +115,45 @@ void print_meas(time_stats_t *ts,
|
||||
}
|
||||
}
|
||||
|
||||
size_t print_meas_log_header(time_stats_t *total_exec_time,
|
||||
time_stats_t *sf_exec_time,
|
||||
char *output,
|
||||
size_t outputlen)
|
||||
{
|
||||
const char *begin = output;
|
||||
const char *end = output + outputlen;
|
||||
|
||||
if ((total_exec_time == NULL) || (sf_exec_time== NULL))
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s %18s %18s %18s %15s %18s %18s %18s %18s %18s %18s %9s %6f\n",
|
||||
"Name",
|
||||
"Total",
|
||||
"Max",
|
||||
"Std",
|
||||
"Num Trials",
|
||||
"min",
|
||||
"d1",
|
||||
"q1",
|
||||
"median",
|
||||
"q3",
|
||||
"d9",
|
||||
"CPU_F_GHz",
|
||||
cpu_freq_GHz);
|
||||
else
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s %18s %18s %15s %9s %6f\n",
|
||||
"Name",
|
||||
"Total",
|
||||
"Average/Frame",
|
||||
"Trials",
|
||||
"CPU_F_GHz",
|
||||
cpu_freq_GHz);
|
||||
|
||||
return output - begin;
|
||||
}
|
||||
|
||||
size_t print_meas_log(time_stats_t *ts,
|
||||
const char *name,
|
||||
time_stats_t *total_exec_time,
|
||||
@@ -119,46 +163,38 @@ size_t print_meas_log(time_stats_t *ts,
|
||||
{
|
||||
const char *begin = output;
|
||||
const char *end = output + outputlen;
|
||||
static int first_time = 0;
|
||||
static double cpu_freq_GHz = 0.0;
|
||||
|
||||
if (cpu_freq_GHz == 0.0)
|
||||
cpu_freq_GHz = get_cpu_freq_GHz();
|
||||
|
||||
if (first_time == 0) {
|
||||
first_time=1;
|
||||
|
||||
if ((total_exec_time == NULL) || (sf_exec_time== NULL))
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s %25s %25s %25s %25s %6f\n",
|
||||
"Name",
|
||||
"Total",
|
||||
"Per Trials",
|
||||
"Num Trials",
|
||||
"CPU_F_GHz",
|
||||
cpu_freq_GHz);
|
||||
else
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s %25s %25s %20s %15s %6f\n",
|
||||
"Name",
|
||||
"Total",
|
||||
"Average/Frame",
|
||||
"Trials",
|
||||
"CPU_F_GHz",
|
||||
cpu_freq_GHz);
|
||||
}
|
||||
|
||||
if (ts->trials>0) {
|
||||
if ((total_exec_time == NULL) || (sf_exec_time== NULL)) {
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s: %15.3f us; %15d; %15.3f us;\n",
|
||||
name,
|
||||
ts->diff / ts->trials / cpu_freq_GHz / 1000.0,
|
||||
ts->trials,
|
||||
ts->max / cpu_freq_GHz / 1000.0);
|
||||
if (is_enabled_time_stats_sorted_list(&ts->time_stats_sorted_list)) {
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s: %15.3f us; %15.3f us; %15.3f us; %15d; %15.3f us; %15.3f us; %15.3f us; %15.3f us; %15.3f us; %15.3f us;\n",
|
||||
name,
|
||||
ts->diff / ts->trials / 1000.0,
|
||||
ts->max / 1000.0,
|
||||
StdDev(ts),
|
||||
ts->trials,
|
||||
get_min(&ts->time_stats_sorted_list) / 1000.0,
|
||||
get_d1(&ts->time_stats_sorted_list) / 1000.0,
|
||||
get_q1(&ts->time_stats_sorted_list) / 1000.0,
|
||||
get_median(&ts->time_stats_sorted_list) / 1000.0,
|
||||
get_q3(&ts->time_stats_sorted_list) / 1000.0,
|
||||
get_d9(&ts->time_stats_sorted_list) / 1000.0);
|
||||
} else {
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
"%25s: %15.3f us; %15.3f us; %15.3f us; %15d;\n",
|
||||
name,
|
||||
ts->diff / ts->trials / 1000.0,
|
||||
ts->max / 1000.0,
|
||||
StdDev(ts),
|
||||
ts->trials);
|
||||
}
|
||||
} else {
|
||||
output += snprintf(output,
|
||||
end - output,
|
||||
@@ -302,3 +338,196 @@ void end_meas(void) {
|
||||
msg->msgid = TIMESTAT_MSGID_END ;
|
||||
pushNotifiedFIFO(&measur_fifo, nfe);
|
||||
}
|
||||
|
||||
/**
|
||||
* \brief initializes sorted list
|
||||
* if dst is already initialized then asserts
|
||||
* \param time_stats_sorted_list sorted list to be initialized
|
||||
* \param size size of the sorted list
|
||||
*/
|
||||
void init_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list, unsigned int size)
|
||||
{
|
||||
if (time_stats_sorted_list->size == 0) {
|
||||
time_stats_sorted_list->list = calloc(size, sizeof(oai_cputime_t));
|
||||
time_stats_sorted_list->size = size;
|
||||
time_stats_sorted_list->nb_elm = 0;
|
||||
} else {
|
||||
AssertFatal(time_stats_sorted_list->size == 0, "Calling init_time_stats_sorted_list on initialized sorted list\n");
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief free sorted list
|
||||
* if dst is already free then does nothing
|
||||
* \param time_stats_sorted_list sorted list to be freed
|
||||
*/
|
||||
void free_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0) {
|
||||
free(time_stats_sorted_list->list);
|
||||
time_stats_sorted_list->size = 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief returns true if the sorted list is enabled and false otherwise
|
||||
* \param time_stats_sorted_list sorted list to be tested
|
||||
*/
|
||||
int is_enabled_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
return (time_stats_sorted_list->size > 0);
|
||||
}
|
||||
/**
|
||||
* \brief empties sorted list
|
||||
* if dst is not initialized then does nothing
|
||||
* \param time_stats_sorted_list sorted list to be emptied
|
||||
*/
|
||||
void reset_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0) {
|
||||
time_stats_sorted_list->nb_elm = 0;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief inserts value sorted list
|
||||
* if dst is not initialized then does nothing
|
||||
* if dst is full then does nothing
|
||||
* \param time_stats_sorted_list sorted list to insert in
|
||||
* \param time time value to insert
|
||||
*/
|
||||
void insert_in_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list, oai_cputime_t time)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0) {
|
||||
if (time_stats_sorted_list->nb_elm < time_stats_sorted_list->size) {
|
||||
unsigned int i = 0;
|
||||
#ifdef DICHOTOMY
|
||||
//TODO
|
||||
#else
|
||||
for (; i < time_stats_sorted_list->nb_elm && time_stats_sorted_list->list[i] < time; i++);
|
||||
#endif
|
||||
memcpy(&time_stats_sorted_list->list[i+1], &time_stats_sorted_list->list[i], (time_stats_sorted_list->nb_elm - i) * sizeof(oai_cputime_t));
|
||||
time_stats_sorted_list->list[i] = time;
|
||||
time_stats_sorted_list->nb_elm++;
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief copy sorted list src into dst, freeing and replacing dst
|
||||
* dst and src should be initialized, otherwise does nothing
|
||||
* \param dst destination sorted list
|
||||
* should be intitialized even with a dummy size 1 buffer to make sure that copying the list there is expected by the caller
|
||||
* \param src source sorted list
|
||||
*/
|
||||
void copy_time_stats_sorted_list(time_stats_sorted_list_t *dst, const time_stats_sorted_list_t *src)
|
||||
{
|
||||
if (dst->size > 0 && src->size > 0) {
|
||||
if (dst->size != src->size) {
|
||||
free_time_stats_sorted_list(dst);
|
||||
init_time_stats_sorted_list(dst, src->size);
|
||||
}
|
||||
memcpy(dst->list, src->list, src->nb_elm * sizeof(oai_cputime_t));
|
||||
dst->nb_elm = src->nb_elm;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief inserts the content of sorted list src into dst
|
||||
* dst and src should be initialized, otherwise does nothing
|
||||
* if dst is not large enough to copy src then does nothing
|
||||
* \param dst destination sorted list
|
||||
* \param src source sorted list
|
||||
*/
|
||||
void merge_time_stats_sorted_list(time_stats_sorted_list_t *dst, const time_stats_sorted_list_t *src)
|
||||
{
|
||||
if (dst->size > 0 && src->size > 0) {
|
||||
if ((dst->size - dst->nb_elm) >= src->nb_elm) {
|
||||
unsigned int j = 0;
|
||||
for (unsigned int i = 0; i < src->nb_elm; i++) {
|
||||
#ifdef DICHOTOMY
|
||||
//TODO
|
||||
#else
|
||||
for (; j < dst->nb_elm && dst->list[j] < src->list[i]; j++);
|
||||
#endif
|
||||
memcpy(&dst->list[j+1], &dst->list[j], (dst->nb_elm - j) * sizeof(oai_cputime_t));
|
||||
dst->list[j] = src->list[i];
|
||||
dst->nb_elm++;
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief get the minimum from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_min(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0 && time_stats_sorted_list->nb_elm > 0) {
|
||||
return time_stats_sorted_list->list[0];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief get the median from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_median(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0 && time_stats_sorted_list->nb_elm > 0) {
|
||||
return time_stats_sorted_list->list[time_stats_sorted_list->nb_elm / 2];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief get the first quartile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_q1(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0 && time_stats_sorted_list->nb_elm > 0) {
|
||||
return time_stats_sorted_list->list[time_stats_sorted_list->nb_elm / 4];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief get the third quartile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_q3(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0 && time_stats_sorted_list->nb_elm > 0) {
|
||||
return time_stats_sorted_list->list[3 * time_stats_sorted_list->nb_elm / 4];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief get the first decile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_d1(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0 && time_stats_sorted_list->nb_elm > 0) {
|
||||
return time_stats_sorted_list->list[time_stats_sorted_list->nb_elm / 10];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* \brief get the nineth decile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_d9(time_stats_sorted_list_t *time_stats_sorted_list)
|
||||
{
|
||||
if (time_stats_sorted_list->size > 0 && time_stats_sorted_list->nb_elm > 0) {
|
||||
return time_stats_sorted_list->list[9 * time_stats_sorted_list->nb_elm / 10];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,20 +55,121 @@ typedef struct {
|
||||
meas_printfunc_t displayFunc; /*!< \brief function to call when DISPLAY message is received*/
|
||||
} time_stats_msg_t;
|
||||
|
||||
/**
|
||||
* \typedef time_stats_sorted_list_t
|
||||
* \brief sorted list of time stats to get med, q1, q2
|
||||
* it can be left disabled by leaving size equal to 0
|
||||
* \var size allocated size of the list
|
||||
* 0 is the sorted list is disabled
|
||||
* \var nb_elm number of elements in the list
|
||||
* \var list pointer to the list
|
||||
*/
|
||||
typedef struct {
|
||||
unsigned int size;
|
||||
unsigned int nb_elm;
|
||||
oai_cputime_t *list;
|
||||
} time_stats_sorted_list_t;
|
||||
|
||||
/**
|
||||
* \brief initializes sorted list
|
||||
* if dst is already initialized then asserts
|
||||
* \param time_stats_sorted_list sorted list to be initialized
|
||||
* \param size size of the sorted list
|
||||
*/
|
||||
void init_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list, unsigned int size);
|
||||
/**
|
||||
* \brief free sorted list
|
||||
* if dst is already free then does nothing
|
||||
* \param time_stats_sorted_list sorted list to be freed
|
||||
*/
|
||||
void free_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief returns true if the sorted list is enabled and false otherwise
|
||||
* \param time_stats_sorted_list sorted list to be tested
|
||||
*/
|
||||
int is_enabled_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief empties sorted list
|
||||
* if dst is not initialized then does nothing
|
||||
* \param time_stats_sorted_list sorted list to be emptied
|
||||
*/
|
||||
void reset_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief inserts value sorted list
|
||||
* if dst is not initialized then does nothing
|
||||
* if dst is full then does nothing
|
||||
* \param time_stats_sorted_list sorted list to insert in
|
||||
* \param time time value to insert
|
||||
*/
|
||||
void insert_in_time_stats_sorted_list(time_stats_sorted_list_t *time_stats_sorted_list, oai_cputime_t time);
|
||||
/**
|
||||
* \brief copy sorted list src into dst, freeing and replacing dst
|
||||
* dst and src should be initialized, otherwise does nothing
|
||||
* \param dst destination sorted list
|
||||
* should be intitialized even with a dummy size 1 buffer to make sure that copying the list there is expected by the caller
|
||||
* \param src source sorted list
|
||||
*/
|
||||
void copy_time_stats_sorted_list(time_stats_sorted_list_t *dst, const time_stats_sorted_list_t *src);
|
||||
/**
|
||||
* \brief inserts the content of sorted list src into dst
|
||||
* dst and src should be initialized, otherwise does nothing
|
||||
* if dst is not large enough to copy src then does nothing
|
||||
* \param dst destination sorted list
|
||||
* \param src source sorted list
|
||||
*/
|
||||
void merge_time_stats_sorted_list(time_stats_sorted_list_t *dst, const time_stats_sorted_list_t *src);
|
||||
/**
|
||||
* \brief get the minimum from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_min(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief get the median from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_median(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief get the first quartile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_q1(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief get the third quartile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_q3(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief get the first decile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_d1(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
/**
|
||||
* \brief get the nineth decile from a sorted list
|
||||
* if the sorted list is not initialized or empty then returns -1
|
||||
* \param time_stats_sorted_list sorted list to query
|
||||
*/
|
||||
oai_cputime_t get_d9(time_stats_sorted_list_t *time_stats_sorted_list);
|
||||
|
||||
struct notifiedFIFO_elt_s;
|
||||
typedef struct time_stats {
|
||||
oai_cputime_t in; /*!< \brief time at measure starting point */
|
||||
oai_cputime_t diff; /*!< \brief average difference between time at starting point and time at endpoint*/
|
||||
oai_cputime_t p_time; /*!< \brief absolute process duration */
|
||||
double diff_square; /*!< \brief process duration square */
|
||||
oai_cputime_t max; /*!< \brief maximum difference between time at starting point and time at endpoint*/
|
||||
int trials; /*!< \brief number of start point - end point iterations */
|
||||
int meas_flag; /*!< \brief 1: stop_meas not called (consecutive calls of start_meas) */
|
||||
char *meas_name; /*!< \brief name to use when printing the measure (not used for PHY simulators)*/
|
||||
int meas_index; /*!< \brief index of this measure in the measure array (not used for PHY simulators)*/
|
||||
int meas_enabled; /*!< \brief per measure enablement flag. send_meas tests this flag, unused today in start_meas and stop_meas*/
|
||||
struct notifiedFIFO_elt_s *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */
|
||||
time_stats_msg_t *tstatptr; /*!< \brief pointer to the time_stats_msg_t data in the tpoolmsg, stored here for perf considerations*/
|
||||
oai_cputime_t in; /*!< \brief time at measure starting point */
|
||||
oai_cputime_t diff; /*!< \brief average difference between time at starting point and time at endpoint*/
|
||||
oai_cputime_t p_time; /*!< \brief absolute process duration */
|
||||
double diff_square; /*!< \brief process duration square */
|
||||
oai_cputime_t max; /*!< \brief maximum difference between time at starting point and time at endpoint*/
|
||||
int trials; /*!< \brief number of start point - end point iterations */
|
||||
int meas_flag; /*!< \brief 1: stop_meas not called (consecutive calls of start_meas) */
|
||||
char *meas_name; /*!< \brief name to use when printing the measure (not used for PHY simulators)*/
|
||||
int meas_index; /*!< \brief index of this measure in the measure array (not used for PHY simulators)*/
|
||||
int meas_enabled; /*!< \brief per measure enablement flag. send_meas tests this flag, unused today in start_meas and stop_meas*/
|
||||
struct notifiedFIFO_elt_s *tpoolmsg; /*!< \brief message pushed to the cpu measurment queue to report a measure START or STOP */
|
||||
time_stats_msg_t *tstatptr; /*!< \brief pointer to the time_stats_msg_t data in the tpoolmsg, stored here for perf considerations */
|
||||
time_stats_sorted_list_t time_stats_sorted_list; /*!< \brief optional sorted list to get med, q1, q2 */
|
||||
} time_stats_t;
|
||||
#define MEASURE_ENABLED(X) (X->meas_enabled)
|
||||
|
||||
@@ -77,6 +178,10 @@ static inline void stop_meas(time_stats_t *ts) __attribute__((always_inline));
|
||||
|
||||
void print_meas_now(time_stats_t *ts, const char *name, 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);
|
||||
size_t print_meas_log_header(time_stats_t *total_exec_time,
|
||||
time_stats_t *sf_exec_time,
|
||||
char *output,
|
||||
size_t outputlen);
|
||||
size_t print_meas_log(time_stats_t *ts,
|
||||
const char *name,
|
||||
time_stats_t *total_exec_time,
|
||||
@@ -118,6 +223,13 @@ static inline uint32_t rdtsc_oai(void) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static inline long long clock_gettime_oai()
|
||||
{
|
||||
struct timespec time;
|
||||
clock_gettime(CLOCK_MONOTONIC_RAW, &time);
|
||||
return 1e+9 * time.tv_sec + time.tv_nsec;
|
||||
}
|
||||
|
||||
#define CPUMEAS_DISABLE 0
|
||||
#define CPUMEAS_ENABLE 1
|
||||
#define CPUMEAS_GETSTATE 2
|
||||
@@ -143,10 +255,10 @@ static inline void start_meas(time_stats_t *ts) {
|
||||
if (cpu_meas_enabled) {
|
||||
if (ts->meas_flag==0) {
|
||||
ts->trials++;
|
||||
ts->in = rdtsc_oai();
|
||||
ts->in = clock_gettime_oai();
|
||||
ts->meas_flag=1;
|
||||
} else {
|
||||
ts->in = rdtsc_oai();
|
||||
ts->in = clock_gettime_oai();
|
||||
}
|
||||
if ((ts->trials&16383)<10) ts->max=0;
|
||||
}
|
||||
@@ -154,7 +266,7 @@ static inline void start_meas(time_stats_t *ts) {
|
||||
|
||||
static inline void stop_meas(time_stats_t *ts) {
|
||||
if (cpu_meas_enabled) {
|
||||
long long out = rdtsc_oai();
|
||||
long long out = clock_gettime_oai();
|
||||
if (ts->in) {
|
||||
ts->diff += (out - ts->in);
|
||||
/// process duration is the difference between two clock points
|
||||
@@ -164,6 +276,7 @@ static inline void stop_meas(time_stats_t *ts) {
|
||||
if ((out - ts->in) > ts->max)
|
||||
ts->max = out - ts->in;
|
||||
|
||||
insert_in_time_stats_sorted_list(&ts->time_stats_sorted_list, (out - ts->in));
|
||||
ts->meas_flag = 0;
|
||||
}
|
||||
}
|
||||
@@ -177,6 +290,7 @@ static inline void reset_meas(time_stats_t *ts) {
|
||||
ts->max=0;
|
||||
ts->trials=0;
|
||||
ts->meas_flag=0;
|
||||
reset_time_stats_sorted_list(&ts->time_stats_sorted_list);
|
||||
}
|
||||
|
||||
static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) {
|
||||
@@ -184,6 +298,7 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) {
|
||||
dst_ts->trials=src_ts->trials;
|
||||
dst_ts->diff=src_ts->diff;
|
||||
dst_ts->max=src_ts->max;
|
||||
copy_time_stats_sorted_list(&dst_ts->time_stats_sorted_list, &src_ts->time_stats_sorted_list);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -196,6 +311,17 @@ static inline void merge_meas(time_stats_t *dst_ts, const time_stats_t *src_ts)
|
||||
dst_ts->diff_square += src_ts->diff_square;
|
||||
if (src_ts->max > dst_ts->max)
|
||||
dst_ts->max = src_ts->max;
|
||||
merge_time_stats_sorted_list(&dst_ts->time_stats_sorted_list, &src_ts->time_stats_sorted_list);
|
||||
}
|
||||
|
||||
static inline void init_sorted_list_meas(time_stats_t *ts, unsigned int size)
|
||||
{
|
||||
init_time_stats_sorted_list(&ts->time_stats_sorted_list, size);
|
||||
}
|
||||
|
||||
static inline void free_sorted_list_meas(time_stats_t *ts)
|
||||
{
|
||||
free_time_stats_sorted_list(&ts->time_stats_sorted_list);
|
||||
}
|
||||
|
||||
#define CPUMEASUR_SECTION "cpumeasur"
|
||||
|
||||
@@ -121,7 +121,9 @@ static void tx_func(processingData_L1tx_t *info)
|
||||
// selection is implemented
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT || tx_slot_type == NR_MIXED_SLOT || get_softmodem_params()->continuous_tx || IS_SOFTMODEM_RFSIM
|
||||
|| cfg->analog_beamforming_ve.analog_beam_list) {
|
||||
start_meas(&info->gNB->phy_proc_tx);
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(&info->gNB->phy_proc_tx);
|
||||
}
|
||||
phy_procedures_gNB_TX(info->gNB,
|
||||
&sched_response.DL_req,
|
||||
&sched_response.TX_req,
|
||||
@@ -138,7 +140,9 @@ static void tx_func(processingData_L1tx_t *info)
|
||||
syncMsgRU.timestamp_tx = info->timestamp_tx;
|
||||
LOG_D(PHY, "gNB: %d.%d : calling RU TX function\n", syncMsgRU.frame_tx, syncMsgRU.slot_tx);
|
||||
ru_tx_func((void *)&syncMsgRU);
|
||||
stop_meas(&info->gNB->phy_proc_tx);
|
||||
if (tx_slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(&info->gNB->phy_proc_tx);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,9 +219,13 @@ static void rx_func(processingData_L1_t *info)
|
||||
phy_procedures_gNB_uespec_RX(gNB, frame_rx, slot_rx, &UL_INFO);
|
||||
|
||||
// Call the scheduler
|
||||
start_meas(&gNB->ul_indication_stats);
|
||||
if (rx_slot_type == NR_UPLINK_SLOT) {
|
||||
start_meas(&gNB->ul_indication_stats);
|
||||
}
|
||||
gNB->if_inst->NR_UL_indication(&UL_INFO);
|
||||
stop_meas(&gNB->ul_indication_stats);
|
||||
if (rx_slot_type == NR_UPLINK_SLOT) {
|
||||
stop_meas(&gNB->ul_indication_stats);
|
||||
}
|
||||
|
||||
notifiedFIFO_elt_t *res = newNotifiedFIFO_elt(sizeof(processingData_L1_t), 0, &gNB->L1_rx_out, NULL);
|
||||
processingData_L1_t *syncMsg = NotifiedFifoData(res);
|
||||
@@ -234,15 +242,24 @@ static void rx_func(processingData_L1_t *info)
|
||||
static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size_t outputlen) {
|
||||
const char *begin = output;
|
||||
const char *end = output + outputlen;
|
||||
output += print_meas_log_header(NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->l1_tx_proc, "L1 Tx job", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->l1_rx_proc, "L1 Rx job", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->phy_proc_tx, "L1 Tx processing", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->dlsch_encoding_stats, "DLSCH encoding", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->dlsch_segmentation_stats, "DL segment segmentation", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->tinput, "DL encoding input", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->tprep, "DL encoding preparation", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->tparity, "DL encoding parity", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->toutput, "DL encoding output", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->dlsch_rate_matching_stats, "DL rate matching", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->dlsch_interleaving_stats, "DL interleaving", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->dlsch_scrambling_stats, "DLSCH scrambling", NULL, NULL, output, end-output);
|
||||
output += print_meas_log(&gNB->dlsch_modulation_stats, "DLSCH modulation", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->dlsch_resource_mapping_stats, "DLSCH resource mapping", NULL, NULL, output,end-output);
|
||||
output += print_meas_log(&gNB->dlsch_precoding_stats, "DLSCH precoding", NULL, NULL, output,end-output);
|
||||
output += print_meas_log(&gNB->dlsch_pdsch_generation_stats, "DLSCH generation", NULL, NULL, output,end-output);
|
||||
output += print_meas_log(&gNB->phy_proc_rx, "L1 Rx processing", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->ulsch_decoding_stats, "ULSCH decoding", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->ts_deinterleave, "UL segment deinterleaving", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->ts_rate_unmatch, "UL segment rate recovery", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->ts_ldpc_decode, "UL segments decoding", NULL, NULL, output, end - output);
|
||||
@@ -250,8 +267,34 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
|
||||
output += print_meas_log(&gNB->slot_indication_stats, "Slot Indication", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->rx_pusch_stats, "PUSCH inner-receiver", NULL, NULL, output, end - output);
|
||||
output += print_meas_log(&gNB->rx_prach, "PRACH RX", NULL, NULL, output, end - output);
|
||||
if (ru->feprx)
|
||||
reset_meas(&gNB->l1_tx_proc);
|
||||
reset_meas(&gNB->l1_rx_proc);
|
||||
reset_meas(&gNB->phy_proc_tx);
|
||||
reset_meas(&gNB->dlsch_encoding_stats);
|
||||
reset_meas(&gNB->dlsch_segmentation_stats);
|
||||
reset_meas(&gNB->tinput);
|
||||
reset_meas(&gNB->tprep);
|
||||
reset_meas(&gNB->tparity);
|
||||
reset_meas(&gNB->toutput);
|
||||
reset_meas(&gNB->dlsch_rate_matching_stats);
|
||||
reset_meas(&gNB->dlsch_interleaving_stats);
|
||||
reset_meas(&gNB->dlsch_scrambling_stats);
|
||||
reset_meas(&gNB->dlsch_modulation_stats);
|
||||
reset_meas(&gNB->dlsch_resource_mapping_stats);
|
||||
reset_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
reset_meas(&gNB->ts_deinterleave);
|
||||
reset_meas(&gNB->ts_rate_unmatch);
|
||||
reset_meas(&gNB->ts_ldpc_decode);
|
||||
reset_meas(&gNB->ul_indication_stats);
|
||||
reset_meas(&gNB->slot_indication_stats);
|
||||
reset_meas(&gNB->rx_pusch_stats);
|
||||
reset_meas(&gNB->rx_prach);
|
||||
if (ru->feprx) {
|
||||
output += print_meas_log(&ru->ofdm_demod_stats, "feprx", NULL, NULL, output, end - output);
|
||||
reset_meas(&ru->ofdm_demod_stats);
|
||||
}
|
||||
|
||||
bool full_slot = ru->half_slot_parallelization == 0;
|
||||
if (ru->feptx_prec) {
|
||||
@@ -261,6 +304,7 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
|
||||
NULL,
|
||||
output,
|
||||
end - output);
|
||||
reset_meas(&ru->precoding_stats);
|
||||
}
|
||||
|
||||
if (ru->feptx_ofdm) {
|
||||
@@ -273,20 +317,30 @@ static size_t dump_L1_meas_stats(PHY_VARS_gNB *gNB, RU_t *ru, char *output, size
|
||||
end - output);
|
||||
output += print_meas_log(&ru->ofdm_total_stats,"feptx_total",NULL,NULL, output, end - output);
|
||||
output += print_meas_log(&ru->txdataF_copy_stats, "txdataF_copy", NULL, NULL, output, end - output);
|
||||
reset_meas(&ru->txdataF_copy_stats);
|
||||
reset_meas(&ru->ofdm_mod_stats);
|
||||
reset_meas(&ru->ofdm_total_stats);
|
||||
reset_meas(&ru->txdataF_copy_stats);
|
||||
}
|
||||
|
||||
if (ru->fh_north_asynch_in)
|
||||
if (ru->fh_north_asynch_in) {
|
||||
output += print_meas_log(&ru->rx_fhaul,"rx_fhaul",NULL,NULL, output, end - output);
|
||||
reset_meas(&ru->rx_fhaul);
|
||||
}
|
||||
|
||||
output += print_meas_log(&ru->tx_fhaul,"tx_fhaul",NULL,NULL, output, end - output);
|
||||
reset_meas(&ru->tx_fhaul);
|
||||
|
||||
if (ru->fh_north_out) {
|
||||
output += print_meas_log(&ru->compression,"compression",NULL,NULL, output, end - output);
|
||||
output += print_meas_log(&ru->transport,"transport",NULL,NULL, output, end - output);
|
||||
reset_meas(&ru->compression);
|
||||
reset_meas(&ru->transport);
|
||||
}
|
||||
return output - begin;
|
||||
}
|
||||
|
||||
#define SORTED_LIST_SIZE 2048
|
||||
void *nrL1_stats_thread(void *param) {
|
||||
PHY_VARS_gNB *gNB = (PHY_VARS_gNB *)param;
|
||||
RU_t *ru = RC.ru[0];
|
||||
@@ -299,21 +353,83 @@ void *nrL1_stats_thread(void *param) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
init_sorted_list_meas(&gNB->l1_tx_proc, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->l1_rx_proc, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->phy_proc_tx, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_encoding_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->tinput, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->tprep, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->tparity, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->toutput, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_segmentation_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_rate_matching_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_interleaving_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_scrambling_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_modulation_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->dlsch_pdsch_generation_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->phy_proc_rx, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->ulsch_decoding_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->ts_deinterleave, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->ts_rate_unmatch, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->ts_ldpc_decode, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->ul_indication_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->slot_indication_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->rx_pusch_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&gNB->rx_prach, SORTED_LIST_SIZE);
|
||||
|
||||
reset_meas(&gNB->l1_tx_proc);
|
||||
reset_meas(&gNB->l1_rx_proc);
|
||||
reset_meas(&gNB->phy_proc_tx);
|
||||
reset_meas(&gNB->dlsch_encoding_stats);
|
||||
reset_meas(&gNB->dlsch_segmentation_stats);
|
||||
reset_meas(&gNB->tinput);
|
||||
reset_meas(&gNB->tprep);
|
||||
reset_meas(&gNB->tparity);
|
||||
reset_meas(&gNB->toutput);
|
||||
reset_meas(&gNB->dlsch_rate_matching_stats);
|
||||
reset_meas(&gNB->dlsch_interleaving_stats);
|
||||
reset_meas(&gNB->dlsch_scrambling_stats);
|
||||
reset_meas(&gNB->dlsch_modulation_stats);
|
||||
reset_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
reset_meas(&gNB->phy_proc_rx);
|
||||
reset_meas(&gNB->ulsch_decoding_stats);
|
||||
reset_meas(&gNB->ts_deinterleave);
|
||||
reset_meas(&gNB->ts_rate_unmatch);
|
||||
reset_meas(&gNB->ts_ldpc_decode);
|
||||
reset_meas(&gNB->ul_indication_stats);
|
||||
reset_meas(&gNB->slot_indication_stats);
|
||||
reset_meas(&gNB->rx_pusch_stats);
|
||||
reset_meas(&gNB->dlsch_scrambling_stats);
|
||||
reset_meas(&gNB->dlsch_modulation_stats);
|
||||
reset_meas(&gNB->dlsch_resource_mapping_stats);
|
||||
reset_meas(&gNB->dlsch_precoding_stats);
|
||||
reset_meas(&gNB->rx_prach);
|
||||
|
||||
if (ru->feprx) {
|
||||
init_sorted_list_meas(&ru->ofdm_demod_stats, SORTED_LIST_SIZE);
|
||||
reset_meas(&ru->ofdm_demod_stats);
|
||||
}
|
||||
if (ru->feptx_prec) {
|
||||
init_sorted_list_meas(&ru->precoding_stats, SORTED_LIST_SIZE);
|
||||
reset_meas(&ru->precoding_stats);
|
||||
}
|
||||
if (ru->feptx_ofdm) {
|
||||
init_sorted_list_meas(&ru->txdataF_copy_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&ru->ofdm_mod_stats, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&ru->ofdm_total_stats, SORTED_LIST_SIZE);
|
||||
reset_meas(&ru->txdataF_copy_stats);
|
||||
reset_meas(&ru->ofdm_mod_stats);
|
||||
reset_meas(&ru->ofdm_total_stats);
|
||||
}
|
||||
if (ru->fh_north_asynch_in) {
|
||||
init_sorted_list_meas(&ru->rx_fhaul, SORTED_LIST_SIZE);
|
||||
reset_meas(&ru->rx_fhaul);
|
||||
}
|
||||
init_sorted_list_meas(&ru->tx_fhaul, SORTED_LIST_SIZE);
|
||||
reset_meas(&ru->tx_fhaul);
|
||||
if (ru->fh_north_out) {
|
||||
init_sorted_list_meas(&ru->compression, SORTED_LIST_SIZE);
|
||||
init_sorted_list_meas(&ru->transport, SORTED_LIST_SIZE);
|
||||
reset_meas(&ru->compression);
|
||||
reset_meas(&ru->transport);
|
||||
}
|
||||
|
||||
while (!oai_exit) {
|
||||
sleep(1);
|
||||
if (ftruncate(fileno(fd), 0) != 0 || fseek(fd, 0, SEEK_SET) != 0) {
|
||||
@@ -327,6 +443,52 @@ void *nrL1_stats_thread(void *param) {
|
||||
fprintf(fd,"%s\n",output);
|
||||
fflush(fd);
|
||||
}
|
||||
|
||||
free_sorted_list_meas(&gNB->l1_tx_proc);
|
||||
free_sorted_list_meas(&gNB->l1_rx_proc);
|
||||
free_sorted_list_meas(&gNB->phy_proc_tx);
|
||||
free_sorted_list_meas(&gNB->dlsch_encoding_stats);
|
||||
free_sorted_list_meas(&gNB->dlsch_segmentation_stats);
|
||||
free_sorted_list_meas(&gNB->tinput);
|
||||
free_sorted_list_meas(&gNB->tprep);
|
||||
free_sorted_list_meas(&gNB->tparity);
|
||||
free_sorted_list_meas(&gNB->toutput);
|
||||
free_sorted_list_meas(&gNB->dlsch_rate_matching_stats);
|
||||
free_sorted_list_meas(&gNB->dlsch_interleaving_stats);
|
||||
free_sorted_list_meas(&gNB->dlsch_scrambling_stats);
|
||||
free_sorted_list_meas(&gNB->dlsch_modulation_stats);
|
||||
free_sorted_list_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
free_sorted_list_meas(&gNB->phy_proc_rx);
|
||||
free_sorted_list_meas(&gNB->ulsch_decoding_stats);
|
||||
free_sorted_list_meas(&gNB->ts_deinterleave);
|
||||
free_sorted_list_meas(&gNB->ts_rate_unmatch);
|
||||
free_sorted_list_meas(&gNB->ts_ldpc_decode);
|
||||
free_sorted_list_meas(&gNB->ul_indication_stats);
|
||||
free_sorted_list_meas(&gNB->slot_indication_stats);
|
||||
free_sorted_list_meas(&gNB->rx_pusch_stats);
|
||||
free_sorted_list_meas(&gNB->rx_prach);
|
||||
|
||||
if (ru->feprx) {
|
||||
free_sorted_list_meas(&ru->ofdm_demod_stats);
|
||||
}
|
||||
if (ru->feptx_prec) {
|
||||
free_sorted_list_meas(&ru->precoding_stats);
|
||||
}
|
||||
if (ru->feptx_ofdm) {
|
||||
free_sorted_list_meas(&ru->txdataF_copy_stats);
|
||||
free_sorted_list_meas(&ru->ofdm_mod_stats);
|
||||
free_sorted_list_meas(&ru->ofdm_total_stats);
|
||||
free_sorted_list_meas(&ru->txdataF_copy_stats);
|
||||
}
|
||||
if (ru->fh_north_asynch_in) {
|
||||
free_sorted_list_meas(&ru->rx_fhaul);
|
||||
}
|
||||
free_sorted_list_meas(&ru->tx_fhaul);
|
||||
if (ru->fh_north_out) {
|
||||
free_sorted_list_meas(&ru->compression);
|
||||
free_sorted_list_meas(&ru->transport);
|
||||
}
|
||||
|
||||
fclose(fd);
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
@@ -56,8 +56,9 @@
|
||||
#define CONFIG_HLP_SOFTS "Enable soft scope and L1 and L2 stats (Xforms)\n"
|
||||
#define CONFIG_HLP_ITTIL "Generate ITTI analyzser logs (similar to wireshark logs but with more details)\n"
|
||||
#define CONFIG_HLP_DLMCS_PHYTEST "Set the downlink MCS for PHYTEST mode\n"
|
||||
#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
|
||||
#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
|
||||
#define CONFIG_HLP_DLNL_PHYTEST "Set the downlink nrOfLayers for PHYTEST mode\n"
|
||||
#define CONFIG_HLP_ULNL_PHYTEST "Set the uplink nrOfLayers for PHYTEST mode\n"
|
||||
#define CONFIG_HLP_DLPMI_PHYTEST "Set the downlink Precoding Matrix Index for PHYTEST mode\n"
|
||||
#define CONFIG_HLP_STMON "Enable processing timing measurement of lte softmodem on per subframe basis \n"
|
||||
#define CONFIG_HLP_MSLOTS "Skip the missed slots/subframes \n"
|
||||
#define CONFIG_HLP_ULMCS_PHYTEST "Set the uplink MCS for PHYTEST mode\n"
|
||||
|
||||
@@ -17,9 +17,10 @@
|
||||
/*----------------------------------------------------------------------------------------------------------------------------------------------------------------------*/
|
||||
// clang-format off
|
||||
#define CMDLINE_PARAMS_DESC_GNB { \
|
||||
{"m" , CONFIG_HLP_DLMCS_PHYTEST, 0, .uptr=&target_dl_mcs, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"l" , CONFIG_HLP_DLNL_PHYTEST, 0, .uptr=&target_dl_Nl, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"L" , CONFIG_HLP_ULNL_PHYTEST, 0, .uptr=&target_ul_Nl, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"p" , CONFIG_HLP_DLPMI_PHYTEST, 0, .uptr=&target_dl_pmi, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"m" , CONFIG_HLP_DLMCS_PHYTEST, 0, .uptr=&target_dl_mcs, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"t" , CONFIG_HLP_ULMCS_PHYTEST, 0, .uptr=&target_ul_mcs, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"M" , CONFIG_HLP_DLBW_PHYTEST, 0, .uptr=&target_dl_bw, .defintval=0, TYPE_UINT, 0}, \
|
||||
{"T" , CONFIG_HLP_ULBW_PHYTEST, 0, .uptr=&target_ul_bw, .defintval=0, TYPE_UINT, 0}, \
|
||||
@@ -30,9 +31,10 @@
|
||||
}
|
||||
// clang-format on
|
||||
|
||||
extern uint32_t target_dl_mcs;
|
||||
extern uint32_t target_dl_Nl;
|
||||
extern uint32_t target_ul_Nl;
|
||||
extern uint32_t target_dl_pmi;
|
||||
extern uint32_t target_dl_mcs;
|
||||
extern uint32_t target_ul_mcs;
|
||||
extern uint32_t target_dl_bw;
|
||||
extern uint32_t target_ul_bw;
|
||||
|
||||
@@ -893,10 +893,8 @@ static int pmd_lcore_ldpc_enc(void *arg)
|
||||
AssertFatal(ret == 0, "Allocation failed for %d ops", num_segments);
|
||||
set_ldpc_enc_op(ops_enq, bufs->inputs, bufs->hard_outputs, nrLDPC_slot_encoding_parameters);
|
||||
|
||||
if (nrLDPC_slot_encoding_parameters->tprep != NULL)
|
||||
stop_meas(nrLDPC_slot_encoding_parameters->tprep);
|
||||
if (nrLDPC_slot_encoding_parameters->tparity != NULL)
|
||||
start_meas(nrLDPC_slot_encoding_parameters->tparity);
|
||||
stop_meas(&nrLDPC_slot_encoding_parameters->TBs[0].segments[0].tprep);
|
||||
start_meas(&nrLDPC_slot_encoding_parameters->TBs[0].segments[0].tparity);
|
||||
|
||||
uint16_t enq = 0, deq = 0;
|
||||
while (enq < num_segments) {
|
||||
@@ -910,14 +908,11 @@ static int pmd_lcore_ldpc_enc(void *arg)
|
||||
time_out++;
|
||||
DevAssert(time_out <= TIME_OUT_POLL);
|
||||
}
|
||||
if (nrLDPC_slot_encoding_parameters->tparity != NULL)
|
||||
stop_meas(nrLDPC_slot_encoding_parameters->tparity);
|
||||
if (nrLDPC_slot_encoding_parameters->toutput != NULL)
|
||||
start_meas(nrLDPC_slot_encoding_parameters->toutput);
|
||||
stop_meas(&nrLDPC_slot_encoding_parameters->TBs[0].segments[0].tparity);
|
||||
start_meas(&nrLDPC_slot_encoding_parameters->TBs[0].segments[0].toutput);
|
||||
ret = retrieve_ldpc_enc_op(ops_deq, nrLDPC_slot_encoding_parameters);
|
||||
AssertFatal(ret == 0, "Failed to retrieve LDPC encoding op!");
|
||||
if (nrLDPC_slot_encoding_parameters->toutput != NULL)
|
||||
stop_meas(nrLDPC_slot_encoding_parameters->toutput);
|
||||
stop_meas(&nrLDPC_slot_encoding_parameters->TBs[0].segments[0].toutput);
|
||||
rte_bbdev_enc_op_free_bulk(ops_enq, num_segments);
|
||||
return ret;
|
||||
}
|
||||
@@ -1332,8 +1327,7 @@ int32_t nrLDPC_coding_decoder(nrLDPC_slot_decoding_parameters_t *nrLDPC_slot_dec
|
||||
int32_t nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encoding_parameters)
|
||||
{
|
||||
pthread_mutex_lock(&encode_mutex);
|
||||
if (nrLDPC_slot_encoding_parameters->tprep != NULL)
|
||||
start_meas(nrLDPC_slot_encoding_parameters->tprep);
|
||||
start_meas(&nrLDPC_slot_encoding_parameters->TBs[0].segments[0].tprep);
|
||||
|
||||
const uint16_t num_segments = nb_segments_encoding(nrLDPC_slot_encoding_parameters);
|
||||
|
||||
|
||||
@@ -152,6 +152,10 @@ typedef struct nrLDPC_segment_encoding_parameters_s{
|
||||
time_stats_t ts_interleave;
|
||||
time_stats_t ts_rate_match;
|
||||
time_stats_t ts_ldpc_encode;
|
||||
time_stats_t tinput;
|
||||
time_stats_t tprep;
|
||||
time_stats_t tparity;
|
||||
time_stats_t toutput;
|
||||
} nrLDPC_segment_encoding_parameters_t;
|
||||
|
||||
/**
|
||||
@@ -225,10 +229,6 @@ typedef struct nrLDPC_slot_encoding_parameters_s{
|
||||
int slot;
|
||||
int nb_TBs;
|
||||
tpool_t *threadPool;
|
||||
time_stats_t *tinput;
|
||||
time_stats_t *tprep;
|
||||
time_stats_t *tparity;
|
||||
time_stats_t *toutput;
|
||||
nrLDPC_TB_encoding_parameters_t *TBs;
|
||||
} nrLDPC_slot_encoding_parameters_t;
|
||||
|
||||
|
||||
@@ -366,10 +366,6 @@ static int nrLDPC_launch_TB_encoding(nrLDPC_slot_encoding_parameters_t *nrLDPC_s
|
||||
|
||||
encoder_implemparams_t common_segment_params = {
|
||||
.n_segments = nrLDPC_TB_encoding_parameters->C,
|
||||
.tinput = nrLDPC_slot_encoding_parameters->tinput,
|
||||
.tprep = nrLDPC_slot_encoding_parameters->tprep,
|
||||
.tparity = nrLDPC_slot_encoding_parameters->tparity,
|
||||
.toutput = nrLDPC_slot_encoding_parameters->toutput,
|
||||
.Kb = nrLDPC_TB_encoding_parameters->Kb,
|
||||
.Zc = nrLDPC_TB_encoding_parameters->Z,
|
||||
.BG = nrLDPC_TB_encoding_parameters->BG,
|
||||
@@ -458,8 +454,6 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
|
||||
uint32_t C = nrLDPC_TB_encoding_parameters->C;
|
||||
size_t n_seg = (C / 8 + ((C & 7) == 0 ? 0 : 1));
|
||||
|
||||
time_stats_t *toutput = nrLDPC_slot_encoding_parameters->toutput;
|
||||
|
||||
for (int j = 0; j < n_seg; j++) {
|
||||
unsigned int macro_segment = j * 8;
|
||||
unsigned int macro_segment_end = (C > macro_segment + 8) ? macro_segment + 8 : C;
|
||||
@@ -478,7 +472,8 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
|
||||
}
|
||||
}
|
||||
|
||||
if(toutput != NULL) start_meas(toutput);
|
||||
time_stats_t *toutput = &nrLDPC_TB_encoding_parameters->segments[macro_segment].toutput;
|
||||
start_meas(toutput);
|
||||
|
||||
uint32_t Eoffset=0;
|
||||
for (int s=0; s<macro_segment; s++)
|
||||
@@ -494,7 +489,7 @@ int nrLDPC_coding_encoder(nrLDPC_slot_encoding_parameters_t *nrLDPC_slot_encodin
|
||||
nrLDPC_TB_encoding_parameters->output,
|
||||
Eoffset);
|
||||
|
||||
if(toutput != NULL) stop_meas(toutput);
|
||||
stop_meas(toutput);
|
||||
}
|
||||
nbTasks += n_seg;
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ static inline void do_txdataF(c16_t **txdataF,
|
||||
rb += rb_step;
|
||||
} // RB loop: while(rb < rel15->rbSize)
|
||||
}
|
||||
static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSCH_t *dlsch, int slot)
|
||||
static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSCH_t *dlsch, int frame, int slot)
|
||||
{
|
||||
const int16_t amp = gNB->TX_AMP;
|
||||
NR_DL_FRAME_PARMS *frame_parms = &gNB->frame_parms;
|
||||
@@ -608,9 +608,12 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
memcpy(dlsch->f, input_ptr, (encoded_length + 7) >> 3);
|
||||
|
||||
c16_t mod_symbs[rel15->NrOfCodewords][encoded_length] __attribute__((aligned(64)));
|
||||
int slot_type = nr_slot_select(&gNB->gNB_config, frame, slot);
|
||||
for (int codeWord = 0; codeWord < rel15->NrOfCodewords; codeWord++) {
|
||||
/// scrambling
|
||||
start_meas(dlsch_scrambling_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(dlsch_scrambling_stats);
|
||||
}
|
||||
uint32_t scrambled_output[(encoded_length >> 5) + 4]; // modulator acces by 4 bytes in some cases
|
||||
memset(scrambled_output, 0, sizeof(scrambled_output));
|
||||
nr_pdsch_codeword_scrambling(input_ptr, encoded_length, codeWord, rel15->dataScramblingId, rel15->rnti, scrambled_output);
|
||||
@@ -624,12 +627,18 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
}
|
||||
#endif
|
||||
|
||||
stop_meas(dlsch_scrambling_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(dlsch_scrambling_stats);
|
||||
}
|
||||
/// Modulation
|
||||
start_meas(dlsch_modulation_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(dlsch_modulation_stats);
|
||||
}
|
||||
nr_modulation(scrambled_output, encoded_length, Qm, (int16_t *)mod_symbs[codeWord]);
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_gNB_PDSCH_MODULATION, 0);
|
||||
stop_meas(dlsch_modulation_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(dlsch_modulation_stats);
|
||||
}
|
||||
#ifdef DEBUG_DLSCH
|
||||
printf("PDSCH Modulation: Qm %d(%d)\n", Qm, nb_re);
|
||||
for (int i = 0; i < nb_re; i += 8) {
|
||||
@@ -641,7 +650,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
#endif
|
||||
}
|
||||
|
||||
start_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
}
|
||||
/// Resource mapping
|
||||
// Non interleaved VRB to PRB mapping
|
||||
uint16_t start_sc = frame_parms->first_carrier_offset + (rel15->rbStart + rel15->BWPStart) * NR_NB_SC_PER_RB;
|
||||
@@ -663,7 +674,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
c16_t mod_dmrs[(n_dmrs+63)&~63] __attribute__((aligned(64)));
|
||||
unsigned int re_beginning_of_symbol = 0;
|
||||
|
||||
start_meas(&gNB->dlsch_layer_mapping_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(&gNB->dlsch_layer_mapping_stats);
|
||||
}
|
||||
int layerSz2 = (layerSz + 63) & ~63;
|
||||
c16_t tx_layers[rel15->nrOfLayers][layerSz2] __attribute__((aligned(64)));
|
||||
memset(tx_layers, 0, sizeof(tx_layers));
|
||||
@@ -688,7 +701,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
bitmap);
|
||||
|
||||
c16_t **txdataF = gNB->common_vars.txdataF[beam_nb];
|
||||
stop_meas(&gNB->dlsch_layer_mapping_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(&gNB->dlsch_layer_mapping_stats);
|
||||
}
|
||||
// Loop Over OFDM symbols:
|
||||
for (int l_symbol = rel15->StartSymbolIndex; l_symbol < rel15->StartSymbolIndex + rel15->NrOfSymbols; l_symbol++) {
|
||||
start_meas(&gNB->dlsch_resource_mapping_stats);
|
||||
@@ -765,7 +780,9 @@ static int do_one_dlsch(unsigned char *input_ptr, PHY_VARS_gNB *gNB, NR_gNB_DLSC
|
||||
}
|
||||
stop_meas(&gNB->dlsch_precoding_stats);
|
||||
}
|
||||
stop_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(&gNB->dlsch_pdsch_generation_stats);
|
||||
}
|
||||
/* output and its parts for each dlsch should be aligned on 64 bytes (or 8 * 64 bits)
|
||||
* should remain a multiple of 8 * 64 with enough offset to fit each dlsch
|
||||
*/
|
||||
@@ -828,7 +845,10 @@ void nr_generate_pdsch(PHY_VARS_gNB *gNB, int n_dlsch, NR_gNB_DLSCH_t *dlsch_arr
|
||||
unsigned char output[size_output >> 3] __attribute__((aligned(64)));
|
||||
bzero(output, sizeof(output));
|
||||
|
||||
start_meas(dlsch_encoding_stats);
|
||||
int slot_type = nr_slot_select(&gNB->gNB_config, frame, slot);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(dlsch_encoding_stats);
|
||||
}
|
||||
if (nr_dlsch_encoding(gNB,
|
||||
n_dlsch,
|
||||
dlsch_array,
|
||||
@@ -846,11 +866,13 @@ void nr_generate_pdsch(PHY_VARS_gNB *gNB, int n_dlsch, NR_gNB_DLSCH_t *dlsch_arr
|
||||
== -1) {
|
||||
return;
|
||||
}
|
||||
stop_meas(dlsch_encoding_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(dlsch_encoding_stats);
|
||||
}
|
||||
|
||||
unsigned char *output_ptr = output;
|
||||
for (int i = 0; i < n_dlsch; i++) {
|
||||
output_ptr += do_one_dlsch(output_ptr, gNB, &dlsch_array[i], slot);
|
||||
output_ptr += do_one_dlsch(output_ptr, gNB, &dlsch_array[i], frame, slot);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -125,6 +125,7 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
|
||||
int num_segments = 0;
|
||||
|
||||
int slot_type = nr_slot_select(&gNB->gNB_config, frame, slot);
|
||||
for (int i = 0; i < n_dlsch; i++) {
|
||||
NR_gNB_DLSCH_t *dlsch = &dlsch_array[i];
|
||||
|
||||
@@ -190,7 +191,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
TB_parameters->harq_unique_pid = i;
|
||||
TB_parameters->BG = rel15->maintenance_parms_v3.ldpcBaseGraph;
|
||||
TB_parameters->A = A;
|
||||
start_meas(dlsch_segmentation_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(dlsch_segmentation_stats);
|
||||
}
|
||||
TB_parameters->Kb = nr_segmentation(dlsch->b,
|
||||
dlsch->c,
|
||||
B,
|
||||
@@ -199,7 +202,9 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
&TB_parameters->Z,
|
||||
&TB_parameters->F,
|
||||
TB_parameters->BG);
|
||||
stop_meas(dlsch_segmentation_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(dlsch_segmentation_stats);
|
||||
}
|
||||
|
||||
if (TB_parameters->C > MAX_NUM_NR_DLSCH_SEGMENTS_PER_LAYER * rel15->nrOfLayers) {
|
||||
LOG_E(PHY, "nr_segmentation.c: too many segments %d, B %d\n", TB_parameters->C, B);
|
||||
@@ -257,9 +262,20 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
segment_parameters->c = dlsch->c[r];
|
||||
segment_parameters->E = nr_get_E(TB_parameters->G, TB_parameters->C, TB_parameters->Qm, rel15->nrOfLayers, r);
|
||||
|
||||
init_sorted_list_meas(&segment_parameters->ts_interleave, 1);
|
||||
init_sorted_list_meas(&segment_parameters->ts_rate_match, 1);
|
||||
init_sorted_list_meas(&segment_parameters->ts_ldpc_encode, 1);
|
||||
init_sorted_list_meas(&segment_parameters->tinput, 1);
|
||||
init_sorted_list_meas(&segment_parameters->tprep, 1);
|
||||
init_sorted_list_meas(&segment_parameters->tparity, 1);
|
||||
init_sorted_list_meas(&segment_parameters->toutput, 1);
|
||||
reset_meas(&segment_parameters->ts_interleave);
|
||||
reset_meas(&segment_parameters->ts_rate_match);
|
||||
reset_meas(&segment_parameters->ts_ldpc_encode);
|
||||
reset_meas(&segment_parameters->tinput);
|
||||
reset_meas(&segment_parameters->tprep);
|
||||
reset_meas(&segment_parameters->tparity);
|
||||
reset_meas(&segment_parameters->toutput);
|
||||
}
|
||||
|
||||
segments_offset += TB_parameters->C;
|
||||
@@ -275,10 +291,6 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
.slot = slot,
|
||||
.nb_TBs = n_dlsch,
|
||||
.threadPool = &gNB->threadPool,
|
||||
.tinput = tinput,
|
||||
.tprep = tprep,
|
||||
.tparity = tparity,
|
||||
.toutput = toutput,
|
||||
.TBs = TBs};
|
||||
gNB->nrLDPC_coding_interface.nrLDPC_coding_encoder(&slot_parameters);
|
||||
|
||||
@@ -286,9 +298,22 @@ int nr_dlsch_encoding(PHY_VARS_gNB *gNB,
|
||||
nrLDPC_TB_encoding_parameters_t *TB_parameters = &TBs[i];
|
||||
for (int r = 0; r < TB_parameters->C; r++) {
|
||||
nrLDPC_segment_encoding_parameters_t *segment_parameters = &TB_parameters->segments[r];
|
||||
merge_meas(dlsch_interleaving_stats, &segment_parameters->ts_interleave);
|
||||
merge_meas(dlsch_rate_matching_stats, &segment_parameters->ts_rate_match);
|
||||
// merge_meas(, &segment_parameters->ts_ldpc_encode);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
merge_meas(dlsch_interleaving_stats, &segment_parameters->ts_interleave);
|
||||
merge_meas(dlsch_rate_matching_stats, &segment_parameters->ts_rate_match);
|
||||
// merge_meas(, &segment_parameters->ts_ldpc_encode);
|
||||
merge_meas(tinput, &segment_parameters->tinput);
|
||||
merge_meas(tprep, &segment_parameters->tprep);
|
||||
merge_meas(tparity, &segment_parameters->tparity);
|
||||
merge_meas(toutput, &segment_parameters->toutput);
|
||||
}
|
||||
free_sorted_list_meas(&segment_parameters->ts_interleave);
|
||||
free_sorted_list_meas(&segment_parameters->ts_rate_match);
|
||||
free_sorted_list_meas(&segment_parameters->ts_ldpc_encode);
|
||||
free_sorted_list_meas(&segment_parameters->tinput);
|
||||
free_sorted_list_meas(&segment_parameters->tprep);
|
||||
free_sorted_list_meas(&segment_parameters->tparity);
|
||||
free_sorted_list_meas(&segment_parameters->toutput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -267,6 +267,9 @@ int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
segment_parameters->c = harq_process->c[r];
|
||||
segment_parameters->decodeSuccess = false;
|
||||
|
||||
init_sorted_list_meas(&segment_parameters->ts_deinterleave, 1);
|
||||
init_sorted_list_meas(&segment_parameters->ts_rate_unmatch, 1);
|
||||
init_sorted_list_meas(&segment_parameters->ts_ldpc_decode, 1);
|
||||
reset_meas(&segment_parameters->ts_deinterleave);
|
||||
reset_meas(&segment_parameters->ts_rate_unmatch);
|
||||
reset_meas(&segment_parameters->ts_ldpc_decode);
|
||||
@@ -281,7 +284,14 @@ int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
}
|
||||
}
|
||||
|
||||
int slot_type = nr_slot_select(&phy_vars_gNB->gNB_config, frame, nr_tti_rx);
|
||||
if (slot_type == NR_UPLINK_SLOT) {
|
||||
start_meas(&phy_vars_gNB->ulsch_decoding_stats);
|
||||
}
|
||||
int ret_decoder = phy_vars_gNB->nrLDPC_coding_interface.nrLDPC_coding_decoder(&slot_parameters);
|
||||
if (slot_type == NR_UPLINK_SLOT) {
|
||||
stop_meas(&phy_vars_gNB->ulsch_decoding_stats);
|
||||
}
|
||||
|
||||
// post decode
|
||||
for (uint8_t pusch_id = 0; pusch_id < nb_pusch; pusch_id++) {
|
||||
@@ -305,9 +315,14 @@ int nr_ulsch_decoding(PHY_VARS_gNB *phy_vars_gNB,
|
||||
}
|
||||
offset += ((harq_process->K >> 3) - (harq_process->F >> 3) - ((harq_process->C > 1) ? 3 : 0));
|
||||
|
||||
merge_meas(&phy_vars_gNB->ts_deinterleave, &nrLDPC_segment_decoding_parameters.ts_deinterleave);
|
||||
merge_meas(&phy_vars_gNB->ts_rate_unmatch, &nrLDPC_segment_decoding_parameters.ts_rate_unmatch);
|
||||
merge_meas(&phy_vars_gNB->ts_ldpc_decode, &nrLDPC_segment_decoding_parameters.ts_ldpc_decode);
|
||||
if (slot_type == NR_UPLINK_SLOT) {
|
||||
merge_meas(&phy_vars_gNB->ts_deinterleave, &nrLDPC_segment_decoding_parameters.ts_deinterleave);
|
||||
merge_meas(&phy_vars_gNB->ts_rate_unmatch, &nrLDPC_segment_decoding_parameters.ts_rate_unmatch);
|
||||
merge_meas(&phy_vars_gNB->ts_ldpc_decode, &nrLDPC_segment_decoding_parameters.ts_ldpc_decode);
|
||||
}
|
||||
free_sorted_list_meas(&nrLDPC_segment_decoding_parameters.ts_deinterleave);
|
||||
free_sorted_list_meas(&nrLDPC_segment_decoding_parameters.ts_rate_unmatch);
|
||||
free_sorted_list_meas(&nrLDPC_segment_decoding_parameters.ts_ldpc_decode);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,10 +175,6 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
.slot = slot,
|
||||
.nb_TBs = nb_ulsch,
|
||||
.threadPool = &get_nrUE_params()->Tpool,
|
||||
.tinput = NULL,
|
||||
.tprep = NULL,
|
||||
.tparity = NULL,
|
||||
.toutput = NULL,
|
||||
.TBs = TBs};
|
||||
|
||||
int max_num_segments = 0;
|
||||
@@ -232,6 +228,10 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
reset_meas(&segment_parameters->ts_interleave);
|
||||
reset_meas(&segment_parameters->ts_rate_match);
|
||||
reset_meas(&segment_parameters->ts_ldpc_encode);
|
||||
reset_meas(&segment_parameters->tinput);
|
||||
reset_meas(&segment_parameters->tprep);
|
||||
reset_meas(&segment_parameters->tparity);
|
||||
reset_meas(&segment_parameters->toutput);
|
||||
|
||||
} // TB_parameters->C
|
||||
} // pusch_id
|
||||
@@ -249,6 +249,10 @@ int nr_ulsch_encoding(PHY_VARS_NR_UE *ue,
|
||||
merge_meas(&ue->phy_cpu_stats.cpu_time_stats[ULSCH_INTERLEAVING_STATS], &segment_parameters->ts_interleave);
|
||||
merge_meas(&ue->phy_cpu_stats.cpu_time_stats[ULSCH_RATE_MATCHING_STATS], &segment_parameters->ts_rate_match);
|
||||
merge_meas(&ue->phy_cpu_stats.cpu_time_stats[ULSCH_LDPC_ENCODING_STATS], &segment_parameters->ts_ldpc_encode);
|
||||
// merge_meas(, &segment_parameters->tinput);
|
||||
// merge_meas(, &segment_parameters->tprep);
|
||||
// merge_meas(, &segment_parameters->tparity);
|
||||
// merge_meas(, &segment_parameters->toutput);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -335,7 +335,10 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
}
|
||||
|
||||
//apply the OFDM symbol rotation here
|
||||
start_meas(&gNB->phase_comp_stats);
|
||||
int slot_type = nr_slot_select(&gNB->gNB_config, frame, slot);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
start_meas(&gNB->phase_comp_stats);
|
||||
}
|
||||
for (int i = 0; i < gNB->common_vars.num_beams_period; ++i) {
|
||||
for (int aa = 0; aa < cfg->carrier_config.num_tx_ant.value; aa++) {
|
||||
if (gNB->phase_comp) {
|
||||
@@ -355,7 +358,9 @@ void phy_procedures_gNB_TX(PHY_VARS_gNB *gNB,
|
||||
T_BUFFER(&gNB->common_vars.txdataF[i][aa][txdataF_offset], fp->samples_per_slot_wCP * sizeof(int32_t)));
|
||||
}
|
||||
}
|
||||
stop_meas(&gNB->phase_comp_stats);
|
||||
if (slot_type == NR_DOWNLINK_SLOT) {
|
||||
stop_meas(&gNB->phase_comp_stats);
|
||||
}
|
||||
|
||||
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME(VCD_SIGNAL_DUMPER_FUNCTIONS_PHY_PROCEDURES_gNB_TX + gNB->CC_id, 0);
|
||||
}
|
||||
@@ -895,7 +900,10 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
}
|
||||
|
||||
const int soffset = (slot_rx & 3) * nb_symb * symb_sz;
|
||||
start_meas(&gNB->phy_proc_rx);
|
||||
int slot_type = nr_slot_select(&gNB->gNB_config, frame_rx, slot_rx);
|
||||
if (slot_type == NR_UPLINK_SLOT) {
|
||||
start_meas(&gNB->phy_proc_rx);
|
||||
}
|
||||
|
||||
for (int i = 0; i < gNB->max_nb_pucch; i++) {
|
||||
NR_gNB_PUCCH_t *pucch = &gNB->pucch[i];
|
||||
@@ -1305,7 +1313,9 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx, N
|
||||
stop_meas(&gNB->rx_srs_stats);
|
||||
}
|
||||
|
||||
stop_meas(&gNB->phy_proc_rx);
|
||||
if (slot_type == NR_UPLINK_SLOT) {
|
||||
stop_meas(&gNB->phy_proc_rx);
|
||||
}
|
||||
|
||||
if (pucch_decode_done || pusch_decode_done) {
|
||||
T(T_GNB_PHY_PUCCH_PUSCH_IQ,
|
||||
|
||||
@@ -51,6 +51,7 @@ static bool is_xlsch_in_slot(uint64_t bitmap, slot_t slot)
|
||||
|
||||
uint32_t target_dl_mcs = 9;
|
||||
uint32_t target_dl_Nl = 1;
|
||||
uint32_t target_dl_pmi = 0;
|
||||
uint32_t target_dl_bw = 50;
|
||||
uint64_t dlsch_slot_bitmap = (1<<1);
|
||||
|
||||
@@ -172,7 +173,7 @@ void nr_preprocessor_phytest(gNB_MAC_INST *mac, post_process_pdsch_t *pp_pdsch)
|
||||
// tbSize further below
|
||||
.dl_harq_pid = sched_ctrl->retrans_dl_harq.head, // PID of HARQ awaiting retransmission, or -1 otherwise
|
||||
.pucch_allocation = alloc,
|
||||
.pm_index = 0,
|
||||
.pm_index = target_dl_pmi,
|
||||
.nrOfLayers = target_dl_Nl,
|
||||
.bwp_info = get_pdsch_bwp_start_size(mac, UE),
|
||||
.dmrs_parms = get_dl_dmrs_params(scc, dl_bwp, &tda_info, target_dl_Nl),
|
||||
|
||||
Reference in New Issue
Block a user