OpenCores
URL https://opencores.org/ocsvn/c0or1k/c0or1k/trunk

Subversion Repositories c0or1k

[/] [c0or1k/] [trunk/] [conts/] [test_suite0/] [include/] [perf.h] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
#ifndef __PERF_TESTS_H__
2
#define __PERF_TESTS_H__
3
 
4
/* Architecture specific perfmon cycle counting */
5
#include <l4lib/types.h>
6
#include <l4lib/macros.h>
7
#include L4LIB_INC_SUBARCH(perfmon.h)
8
 
9
struct perfmon_cycles {
10
        u64 last;       /* Last op cycles */
11
        u64 min;        /* Minimum cycles */
12
        u64 max;        /* Max cycles */
13
        u64 avg;        /* Average cycles */
14
        u64 total;      /* Total cycles */
15
        u64 ops;        /* Total ops */
16
};
17
 
18
/*
19
 * This is for converting cycle count to timings on
20
 * Cortex-A9 running at 400Mhz. 25 / 100000 is
21
 * a rewriting of 2.5 nanosec / 1,000,000 in millisec
22
 *
23
 * 25 / 100 = 2.5nanosec * 10 / 1000 = microseconds
24
 */
25
 
26
#define CORTEXA9_400MHZ_USEC    25 / 10000
27
#define CORTEXA9_400MHZ_MSEC    25 / 10000000
28
#define USEC_MULTIPLIER         CORTEXA9_400MHZ_USEC
29
#define MSEC_MULTIPLIER         CORTEXA9_400MHZ_MSEC
30
 
31
#if !defined(CONFIG_DEBUG_PERFMON_USER)
32
 
33
 
34
#define perfmon_record_cycles(ptr, str)
35
 
36
#else /* End of CONFIG_DEBUG_PERFMON_USER */
37
 
38
#define perfmon_record_cycles(pcyc, str)                \
39
{                                                       \
40
        (pcyc)->ops++;                                  \
41
        (pcyc)->last = perfmon_read_cyccnt() * 64;      \
42
        (pcyc)->total += (pcyc)->last;                  \
43
        if ((pcyc)->min > (pcyc)->last)                 \
44
                (pcyc)->min = (pcyc)->last;             \
45
        if ((pcyc)->max < (pcyc)->last)                 \
46
                (pcyc)->max = (pcyc)->last;             \
47
}
48
 
49
/* Same as above but restarts counter */
50
#define perfmon_checkpoint_cycles(pcyc, str)            \
51
{                                                       \
52
        (pcyc)->last = perfmon_read_cyccnt();           \
53
        (pcyc)->total += pcyc->last;                    \
54
        perfmon_reset_start_cyccnt();                   \
55
}
56
#endif /* End of !CONFIG_DEBUG_PERFMON_USER */
57
 
58
void platform_measure_cpu_cycles(void);
59
void perf_measure_getid_ticks(void);
60
void perf_measure_cpu_cycles(void);
61
void perf_measure_getid(void);
62
void perf_measure_tctrl(void);
63
int perf_measure_exregs(void);
64
void perf_measure_ipc(void);
65
void perf_measure_map(void);
66
void perf_measure_unmap(void);
67
void perf_measure_mutex(void);
68
 
69
#endif /* __PERF_TESTS_H__ */

powered by: WebSVN 2.1.0

© copyright 1999-2025 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.