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

Subversion Repositories c0or1k

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 drasko
/*
2
 * Debug/performance measurements for mm0
3
 *
4
 * Copyright (C) 2010 B Labs Ltd.
5
 */
6
#ifndef __ARCH_DEBUG_H__
7
#define __ARCH_DEBUG_H__
8
 
9
#if !defined(CONFIG_DEBUG_PERFMON_USER)
10
 
11
#include <l4lib/types.h>
12
 
13
/* Common empty definitions for all arches */
14
static inline u32 perfmon_read_cyccnt() { return 0; }
15
 
16
static inline void perfmon_reset_start_cyccnt() { }
17
static inline u32 perfmon_read_reset_start_cyccnt() { return 0; }
18
 
19
#define debug_record_cycles(str)
20
 
21
#else /* End of CONFIG_DEBUG_PERFMON_USER */
22
 
23
/* Architecture specific perfmon cycle counting */
24
#include L4LIB_INC_SUBARCH(perfmon.h)
25
 
26
extern u64 perfmon_total_cycles;
27
extern u64 current_cycles;
28
 
29
/*
30
 * This is for Cortex-A9 running at 400Mhz. 25 / 100000 is
31
 * a rewriting of 2.5 nanosec / 1,000,000
32
 */
33
#define debug_record_cycles(str)                        \
34
{                                                       \
35
        current_cycles = perfmon_read_cyccnt();         \
36
        perfmon_total_cycles += current_cycles;         \
37
        printf("%s: took %llu milliseconds\n", str,     \
38
               current_cycles * 64 * 25 / 100000);      \
39
        perfmon_reset_start_cyccnt();                   \
40
}
41
 
42
#endif /* End of !CONFIG_DEBUG_PERFMON_USER */
43
 
44
#endif /* __ARCH_DEBUG_H__ */

powered by: WebSVN 2.1.0

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