comparison src/cs/riviera/rvt/ti_profiler/ti_profiler.h @ 0:4e78acac3d88

src/{condat,cs,gpf,nucleus}: import from Selenite
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 16 Oct 2020 06:23:26 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4e78acac3d88
1 /************************************************************************************
2 * ti_profiler.h : contains ti profiling and Nucleus Monitoring module header *
3 * *
4 * *
5 * Author: Philippe Martinez *
6 * *
7 * version: 1.1 *
8 * *
9 * Date: 07/16/2001 *
10 * (C) Copyright 2001 by Texas Instruments Incorporated, All Rights Reserved *
11 ************************************************************************************/
12
13
14 #ifndef _TI_PROFILER_H_
15 #define _TI_PROFILER_H_
16
17 #define INFINITE_LOOP ( 1 )
18 #define L1_TRACER ( 1 ) // Add debug traces into Layer 1 stream
19
20 // Log buffer size in 32 bit words (profiler only)
21 #define PR_BUFFER_SIZE ( 20000 )
22 #define PR_BUFFER_THRESHOLD ( PR_BUFFER_SIZE - 95 )
23
24
25 // buffer OP code (profiler only)
26 #define C_OP_CODE_START_PR ( 0xfffffff0 )
27 #define C_OP_CODE_STOP_PR ( 0xfffffffe )
28
29 #define C_OP_CODE_BEGIN_BUFFER ( 0xfffffff0 )
30 #define C_OP_CODE_TDMA_BEGIN ( 0xfffffff2 )
31 #define C_OP_CODE_TDMA_END ( 0xfffffff4 )
32 #define C_OP_CODE_END_BUFFER ( 0xfffffff8 )
33
34 // Rx message ID code (profiler only)
35 #define TI_PROFILER_END_PROFILING ( 0x0000 )
36 #define TI_PROFILER_START_PROFILING ( 0x0001 )
37
38 #define TI_PROFILER_OUTPUT_BUFFER ( 0xffff )
39
40
41 // Timer used (profiler only)
42 #define PR_TIMER_NUM ( 1 )
43
44 #define PR_TIMER_RESET_VALUE ( 21 ) // load value 50 us
45
46 // define the length of cutted element buffer in order to
47 // Generate rvt messages. (profiler only)
48 #define TRACE_MESSAGE_SIZE ( 50 ) // x4 = n bytes
49
50 // Nucleus monitoring buffer size (bytes) for rvt (Nucleus Monitoring only)
51 #define NUC_MONITOR_BUFFER_SIZE ( 240 )
52
53 // Nucleus Monitoring Buffer (Nucleus Monitoring only)
54 #define C_OP_CODE_NUC_MON_THREAD_IDS ( 0xff )
55 #define C_OP_CODE_FN_LOG ( 0x00 )
56 #define C_OP_CODE_LISR_FLAG ( 0xC0 )
57 #define C_OP_CODE_THREAD_FLAG ( 0x80 )
58 #define C_OP_CODE_QUEUE_FLAG ( 0x40 )
59
60 // Rx message ID code (Nucleus Monitoring only)
61 #define TI_NUC_MONITOR_OUTPUT_BUFFER ( 0xfff0 )
62 #define TI_NUC_MONITOR_START ( 0x0002 )
63 #define TI_NUC_MONITOR_STOP ( 0x0003 )
64
65 // ID Thread NULL (Nucleus Monitoring only)
66 #define NUC_MONITOR_ID_IDLE ( 0xff )
67
68 // Nuleus monitoring : Number max of component of same type
69 // that can be monitored (Nucleus Monitoring only)
70 #define NUC_MONITOR_MAX_ID ( 64 )
71
72 // Define LISR doubled buffer Size (Nucleus Monitoring only)
73 #define C_NUC_LISR_BUF_PG_NB ( 2 )
74 #define C_NUC_LISR_LOG_SZ ( 5 ) // bytes
75
76 // Must be strickly < NUC_MONITOR_BUFFER_SIZE (Nucleus Monitoring only)
77 #define C_NUC_MAX_LISR ( 20 * C_NUC_LISR_LOG_SZ )
78
79 // Define LISR doubled buffer Size (Nucleus Monitoring only)
80 #define C_NUC_THREAD_BUF_PG_NB ( 2 )
81 #define C_NUC_THREAD_LOG_SZ ( 3 ) // bytes
82
83 // Must be strickly < NUC_MONITOR_BUFFER_SIZE (Nucleus Monitoring only)
84 #define C_NUC_MAX_THREAD ( 30 * C_NUC_THREAD_LOG_SZ )
85
86 // Differents state of profiling
87 typedef enum
88 {
89 PROFILER_STOPPED,
90 PROFILER_RUNNING,
91 PROFILER_FREEZED,
92 PROFILER_TO_BE_RAN,
93 PROFILER_TO_BE_UNFREEZED,
94 PROFILER_TO_BE_STOPPED
95 } T_PROFILER_STATE;
96
97 // Differents state of nucleus monitoring (Nucleus Monitoring only)
98 typedef enum
99 {
100 NUC_MONITOR_STOPPED,
101 NUC_MONITOR_RUNNING,
102 NUC_MONITOR_TO_BE_RUN,
103 NUC_MONITOR_TO_BE_STARTED,
104 NUC_MONITOR_TO_BE_STOP,
105 NUC_MONITOR_WAITING
106 } T_NUC_MONITOR_STATE;
107
108 typedef enum
109 {
110 LOGGING,
111 FLUSH
112 } T_PROFILER_BUFFER_STATE;
113
114 typedef enum
115 {
116 NOT_ACTIVE,
117 ACTIVE_BY_TI,
118 ACTIVE_BY_EXT,
119 ACTIVE_BY_HOST
120 } T_PROFILER_HANDLER;
121
122 typedef enum
123 {
124 NO_EVENT,
125 NO_SLEEP_EVENT,
126 EVENT2,
127 EVENT3,
128 EVENT4
129 } T_PROFILER_EVENTS;
130
131 typedef struct
132 {
133 SYS_UWORD16 msg_id;
134 SYS_UWORD8 event_number;
135 SYS_UWORD8 arg1;
136 SYS_UWORD8 *p_buffer;
137 SYS_UWORD8 buffer_size;
138 } T_PROFILER_MSG_UART;
139
140 typedef struct
141 {
142 T_RV_HDR header;
143 SYS_UWORD16 msg_id;
144 SYS_UWORD8 event_number;
145 SYS_UWORD8 arg1;
146 SYS_UWORD8 *p_buffer;
147 SYS_UWORD8 buffer_size;
148 } T_PROFILER_MSG;
149
150 #endif
151