OpenCSD - CoreSight Trace Decode Library  0.10.0
trc_pkt_types_etmv4.h
Go to the documentation of this file.
1 /*
2  * \file trc_pkt_types_etmv4.h
3  * \brief OpenCSD :
4  *
5  * \copyright Copyright (c) 2015, ARM Limited. All Rights Reserved.
6  */
7 
8 
9 /*
10  * Redistribution and use in source and binary forms, with or without modification,
11  * are permitted provided that the following conditions are met:
12  *
13  * 1. Redistributions of source code must retain the above copyright notice,
14  * this list of conditions and the following disclaimer.
15  *
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * 3. Neither the name of the copyright holder nor the names of its contributors
21  * may be used to endorse or promote products derived from this software without
22  * specific prior written permission.
23  *
24  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
25  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
27  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
28  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 #ifndef ARM_TRC_PKT_TYPES_ETMV4_H_INCLUDED
37 #define ARM_TRC_PKT_TYPES_ETMV4_H_INCLUDED
38 
39 #include "opencsd/trc_pkt_types.h"
40 
49 {
50 /* state of decode markers */
55 /* markers for unknown/bad packets */
60 /* I stream packet types. */
61  /* extension header. */
64  /* address amd context */
67  /* unused encoding b10000100 */
70  /* unused encoding b10000111 */
71  ETM4_PKT_I_CTXT = 0x80,
75  /* unused encoding b10011100 */
78  /* unused encoding b10011111 */
81  /* unused encoding b10010111
82  unused encoding b10011000
83  unused encoding b10011001 */
84 
85  /* Q packets */
86  ETM4_PKT_I_Q = 0xA0,
88  /* Atom packets */
95 
96  /* conditional instruction tracing */
105 
106  /* cycle count packets */
110  // data synchronisation markers
113  // event trace
115  // Exceptions
118  // timestamp
120  // speculation
126  // Sync
129  // extension packets - follow 0x00 header
133 
135 
136 typedef union _etmv4_trace_info_t {
137  uint32_t val;
138  struct {
139  uint32_t cc_enabled:1;
140  uint32_t cond_enabled:3;
141  uint32_t p0_load:1;
142  uint32_t p0_store:1; //1< 1 if tracing with P0 store elements (for data trace)
143  } bits;
145 
146 typedef struct _etmv4_context_t {
147  struct {
148  uint32_t EL:2;
149  uint32_t SF:1;
150  uint32_t NS:1;
151  uint32_t updated:1;
152  uint32_t updated_c:1;
153  uint32_t updated_v:1;
154  };
155  uint32_t ctxtID;
156  uint32_t VMID;
158 
160 typedef struct _etmv4_addr_val_t {
162  uint8_t isa;
164 
165 typedef struct _ocsd_etmv4_i_pkt
166 {
169  //** intra-packet data - valid across packets.
170 
172  uint8_t v_addr_ISA;
173 
175 
176  struct {
177  uint64_t timestamp;
178  uint8_t bits_changed;
179  } ts;
180 
181  uint32_t cc_threshold;
182 
183  // single packet data - only valid for specific packet types on packet instance.
185  uint32_t cycle_count;
186 
187  uint32_t curr_spec_depth;
188  uint32_t p0_key;
189 
190  uint32_t commit_elements; //<! commit elements indicated by this packet - valid dependent on the packet type.
191  uint32_t cancel_elements; //<! cancel elements indicated by this packet - valid dependent on the packet type.
192 
194 
195  struct {
196  uint32_t exceptionType:10;
197  uint32_t addr_interp:2;
198  uint32_t m_fault_pending:1;
199  uint32_t m_type:1;
200  } exception_info;
201 
202 
204  uint8_t dsm_val;
205  uint8_t event_val;
206 
207  struct {
208  uint32_t cond_c_key;
209  uint8_t num_c_elem;
210  struct {
211  uint32_t cond_key_set:1;
212  uint32_t f3_final_elem:1;
213  uint32_t f2_cond_incr:1;
214  };
215  } cond_instr;
216 
217  struct {
218  uint32_t cond_r_key_0;
219  uint32_t cond_r_key_1;
220  struct {
221  uint32_t res_0:4;
222  uint32_t res_1:4;
223  uint32_t ci_0:1;
224  uint32_t ci_1:1;
225  uint32_t key_res_0_set:1;
226  uint32_t key_res_1_set:1;
227  uint32_t f2_key_incr:2;
228  uint32_t f2f4_token:2;
229  uint32_t f3_tokens:12;
230  };
231  } cond_result;
232 
233  struct {
234  uint32_t q_count;
235  struct {
236  uint32_t addr_present:1;
237  uint32_t addr_match:1;
238  uint32_t count_present:1;
239  uint32_t q_type:4;
240  };
241  } Q_pkt;
242 
244  union {
245  uint32_t val;
246  struct {
247  uint32_t context_valid:1;
248  uint32_t ts_valid:1;
249  uint32_t spec_depth_valid:1;
250  uint32_t p0_key_valid:1;
251  uint32_t cond_c_key_valid:1;
252  uint32_t cond_r_key_valid:1;
253  uint32_t trace_info_valid:1;
254  uint32_t cc_thresh_valid:1;
255  uint32_t cc_valid:1;
256  uint32_t commit_elem_valid:1;
257  } bits;
258  } pkt_valid;
259 
260  // original header type when packet type changed to error on decode error.
262 
264 
265 
266 // D stream packets
268 {
269 // markers for unknown/bad packets
277 
278  // data sync markers
279  ETM4_PKT_DNUM_DS_MKR = 0x111, // ext packet, b0001xxx1
280  // extension header
282 
284  // event trace
286  // timestamp
288  // P1 Data address
296  // P2 Data value
303  // suppression
305  // synchronisation- extension packets - follow 0x00 header
307 
308  // extension packets - follow 0x00 header
312 
314 
315 
316 typedef struct _ocsd_etmv4_d_pkt
317 {
319 
321 
322  uint64_t pkt_val;
325 
327 
328 typedef struct _ocsd_etmv4_cfg
329 {
330  uint32_t reg_idr0;
331  uint32_t reg_idr1;
332  uint32_t reg_idr2;
333  uint32_t reg_idr8;
334  uint32_t reg_idr9;
335  uint32_t reg_idr10;
336  uint32_t reg_idr11;
337  uint32_t reg_idr12;
338  uint32_t reg_idr13;
339  uint32_t reg_configr;
340  uint32_t reg_traceidr;
344 
347 #endif // ARM_TRC_PKT_TYPES_ETMV4_H_INCLUDED
348 
349 /* End of File trc_pkt_types_etmv4.h */
350 
struct _etmv4_trace_info_t::@8 bits
bitfields for trace info value.
no sync found yet
uint32_t cc_enabled
1 if cycle count enabled
etmv4_trace_info_t trace_info
trace info structure - programmed configuration of trace capture.
b0110111x, b011010xx
uint32_t updated
updated this context packet (otherwise same as last time)
flushing incomplete packet at end of trace.
uint32_t ctxtID
Current ctxtID.
uint8_t dsm_val
Data Sync Marker number, or unnumbered atom count - packet type determines.
ocsd_etmv4_i_pkt_type type
uint64_t ocsd_vaddr_t
uint32_t VMID
current VMID
enum _ocsd_etmv4_i_pkt_type ocsd_etmv4_i_pkt_type
uint32_t exceptionType
exception number
uint32_t m_fault_pending
M class fault pending.
uint32_t cond_enabled
conditional trace enabeld type
ocsd_etmv4_i_pkt_type err_type
b11010101 - b11010111, b11110101
ocsd_etmv4_d_pkt_type type
ocsd_core_profile_t core_prof
enum _ocsd_etmv4_d_pkt_type ocsd_etmv4_d_pkt_type
b00101000 - b00101100
uint8_t addr_exact_match_idx
address match index in this packet.
struct _ocsd_etmv4_i_pkt ocsd_etmv4_i_pkt
uint32_t m_type
1 if M class exception.
struct _ocsd_etmv4_cfg ocsd_etmv4_cfg
uint32_t p0_load
1 if tracing with P0 load elements (for data trace)
uint32_t SF
sixty four bit
packet type reserved.
union _etmv4_trace_info_t etmv4_trace_info_t
invalid sequence for packet type
uint32_t cycle_count
cycle count
struct _etmv4_context_t etmv4_context_t
uint32_t EL
exception level.
enum _ocsd_core_profile ocsd_core_profile_t
etmv4_context_t context
current context for PE
b01000000 - b01000010
uint32_t val
trace info full value.
uint32_t updated_v
updated VMID
ocsd_etmv4_d_pkt_type err_type
uint32_t NS
none secure
ocsd_pkt_atom atom
atom elements - number of atoms indicates validity of packet
uint8_t bits_changed
bits updated in this timestamp packet.
uint32_t updated_c
updated CtxtID
struct _ocsd_etmv4_d_pkt ocsd_etmv4_d_pkt
uint8_t event_val
Event value on event packet.
uint32_t p0_key
current P0 key value for data packet synchronisation
waiting for a header byte
b0100010x, b01000110
error packet has no header based type. Use with unknown/res packet types.
uint32_t addr_interp
address value interpretation
b11000000 - b11010100, b11100000 - b11110100
OpenCSD: Common "C" types for trace packets.
ocsd_vaddr_t val
Address value.
struct _etmv4_addr_val_t etmv4_addr_val_t
uint8_t v_addr_ISA
ISA for the address packet. (0 = IS0 / 1 = IS1)
_ocsd_etmv4_d_pkt_type
invalid packet type for this trace mode.
uint8_t isa
instruction set.
uint64_t timestamp
current timestamp value
_ocsd_etmv4_i_pkt_type
b0100100x, b01001010, b0100110x, b01001110
ocsd_pkt_vaddr v_addr
most recently broadcast address packet
uint32_t cc_threshold
cycle count threshold - from trace info.
enum _ocsd_arch_version ocsd_arch_version_t
uint32_t curr_spec_depth
current speculation depth
ocsd_arch_version_t arch_ver