OpenCSD - CoreSight Trace Decode Library  1.3.3
trc_pkt_types_etmv4.h
Go to the documentation of this file.
1 /*
2  * \file trc_pkt_types_etmv4.h
3  * \brief OpenCSD : ETMv4 / ETE packet info
4  *
5  * \copyright Copyright (c) 2015,2019 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 */
61 /* I stream packet types. */
62  /* extension header. */
65  /* sync */
67  // timestamp
71  // Exceptions
75  /* unused encoding 0x08 b00001000 */
80  /* cycle count packets */
85  // data synchronisation markers
89  // speculation
97  /* conditional instruction tracing - (reserved encodings ETE) */
101  /* unused encoding 0x47 b01000111 */
103  /* unused encodings 0x4B,0x4F b01001011, b01001111 */
105  /* unused encodings 0x60-0x67 b01100xxx */
110  // event trace
114  /* address and context */
118  /* unused encoding 0x84 b10000100 */
121  /* unused encoding 0x87 b10000111 */
123  /* unused encodings 0x89-0x8F b10001001 to b10001111 */
125  /* unused encodings 0x93-0x94 b10010011 to b10010010 */
128  /* unused encodings 0x97 b10010111 to b10011001 0x99 */
131  /* unused encoding 0x9C b10011100 */
134  /* unused encoding 0x9F b10011111 */
135 
136  /* Q packets */
137  ETM4_PKT_I_Q = 0xA0,
139  /* ETE source address packets, unused ETMv4 */
147  /* unused encodings 0xBA-0xBF b10111010 - b10111111 */
148 
149  /* Atom packets */
157  // extension packets - follow 0x00 header
161 
162  // ETE extended types
163  ETE_PKT_I_PE_RESET = 0x400, // base type is exception packet.
164  ETE_PKT_I_TRANS_FAIL = 0x401, // base type is exception packet.
165 
167 
168 typedef union _etmv4_trace_info_t {
169  uint32_t val;
170  struct {
171  uint32_t cc_enabled:1;
172  uint32_t cond_enabled:3;
173  uint32_t p0_load:1;
174  uint32_t p0_store:1;
175  uint32_t in_trans_state:1;
176  } bits;
178 
179 typedef struct _etmv4_context_t {
180  struct {
181  uint32_t EL:2;
182  uint32_t SF:1;
183  uint32_t NS:1;
184  uint32_t updated:1;
185  uint32_t updated_c:1;
186  uint32_t updated_v:1;
187  uint32_t NSE:1;
188  };
189  uint32_t ctxtID;
190  uint32_t VMID;
192 
194 typedef struct _etmv4_addr_val_t {
196  uint8_t isa;
198 
199 typedef struct _ocsd_etmv4_i_pkt
200 {
203  //** intra-packet data - valid across packets.
204 
206  uint8_t v_addr_ISA;
207 
209 
210  struct {
211  uint64_t timestamp;
212  uint8_t bits_changed;
213  } ts;
214 
215  uint32_t cc_threshold;
216 
217  // single packet data - only valid for specific packet types on packet instance.
219  uint32_t cycle_count;
220 
221  uint32_t curr_spec_depth;
222  uint32_t p0_key;
223 
224  uint32_t commit_elements; //<! commit elements indicated by this packet - valid dependent on the packet type.
225  uint32_t cancel_elements; //<! cancel elements indicated by this packet - valid dependent on the packet type.
226 
228 
229  struct {
230  uint32_t exceptionType:10;
231  uint32_t addr_interp:2;
232  uint32_t m_fault_pending:1;
233  uint32_t m_type:1;
235 
236 
238  uint8_t dsm_val;
239  uint8_t event_val;
240 
241  struct {
242  uint32_t cond_c_key;
243  uint8_t num_c_elem;
244  struct {
245  uint32_t cond_key_set:1;
246  uint32_t f3_final_elem:1;
247  uint32_t f2_cond_incr:1;
248  };
250 
251  struct {
252  uint32_t cond_r_key_0;
253  uint32_t cond_r_key_1;
254  struct {
255  uint32_t res_0:4;
256  uint32_t res_1:4;
257  uint32_t ci_0:1;
258  uint32_t ci_1:1;
259  uint32_t key_res_0_set:1;
260  uint32_t key_res_1_set:1;
261  uint32_t f2_key_incr:2;
262  uint32_t f2f4_token:2;
263  uint32_t f3_tokens:12;
264  };
266 
267  struct {
268  uint32_t q_count;
269  struct {
270  uint32_t addr_present:1;
271  uint32_t addr_match:1;
272  uint32_t count_present:1;
273  uint32_t q_type:4;
274  };
275  } Q_pkt;
276 
278  union {
279  uint32_t val;
280  struct {
281  uint32_t context_valid:1;
282  uint32_t ts_valid:1;
283  uint32_t spec_depth_valid:1;
284  uint32_t p0_key_valid:1;
285  uint32_t cond_c_key_valid:1;
286  uint32_t cond_r_key_valid:1;
287  uint32_t trace_info_valid:1;
288  uint32_t cc_thresh_valid:1;
289  uint32_t cc_valid:1;
290  uint32_t commit_elem_valid:1;
291  } bits;
293 
294  // original header type when packet type changed to error on decode error.
296  uint8_t err_hdr_val;
297 
298  // protocol version - validity of ETE specific fields 0xMm == v Major.minor
300 
302 
303 
304 // D stream packets
306 {
307 // markers for unknown/bad packets
315 
316  // data sync markers
317  ETM4_PKT_DNUM_DS_MKR = 0x111, // ext packet, b0001xxx1
318  // extension header
320 
322  // event trace
324  // timestamp
326  // P1 Data address
334  // P2 Data value
341  // suppression
343  // synchronisation- extension packets - follow 0x00 header
345 
346  // extension packets - follow 0x00 header
349  ETM4_PKT_D_OVERFLOW = 0x105
350 
352 
353 
354 typedef struct _ocsd_etmv4_d_pkt
355 {
357 
359 
360  uint64_t pkt_val;
363 
365 
366 typedef struct _ocsd_etmv4_cfg
367 {
368  uint32_t reg_idr0;
369  uint32_t reg_idr1;
370  uint32_t reg_idr2;
371  uint32_t reg_idr8;
372  uint32_t reg_idr9;
373  uint32_t reg_idr10;
374  uint32_t reg_idr11;
375  uint32_t reg_idr12;
376  uint32_t reg_idr13;
377  uint32_t reg_configr;
378  uint32_t reg_traceidr;
382 
383 #define ETE_ARCH_VERSION 0x5
384 
385 #define ETE_OPFLG_PKTDEC_SRCADDR_N_ATOMS 0x00010000
389 #endif // ARM_TRC_PKT_TYPES_ETMV4_H_INCLUDED
390 
391 /* End of File trc_pkt_types_etmv4.h */
392 
enum _ocsd_core_profile ocsd_core_profile_t
enum _ocsd_arch_version ocsd_arch_version_t
uint64_t ocsd_vaddr_t
_ocsd_etmv4_i_pkt_type
_ocsd_etmv4_d_pkt_type
struct _etmv4_addr_val_t etmv4_addr_val_t
struct _ocsd_etmv4_i_pkt ocsd_etmv4_i_pkt
struct _ocsd_etmv4_d_pkt ocsd_etmv4_d_pkt
enum _ocsd_etmv4_i_pkt_type ocsd_etmv4_i_pkt_type
struct _ocsd_etmv4_cfg ocsd_etmv4_cfg
enum _ocsd_etmv4_d_pkt_type ocsd_etmv4_d_pkt_type
struct _etmv4_context_t etmv4_context_t
union _etmv4_trace_info_t etmv4_trace_info_t
@ ETM4_PKT_I_CANCEL_F1
@ ETM4_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_L_32IS1
@ ETM4_PKT_I_TIMESTAMP
@ ETM4_PKT_I_COND_FLUSH
@ ETM4_PKT_I_FUNC_RET
@ ETM4_PKT_I_IGNORE
@ ETE_PKT_I_TRANS_COMMIT
@ ETM4_PKT_I_EXCEPT_RTN
@ ETE_PKT_I_TRANS_FAIL
@ ETM4_PKT_I_COND_RES_F2
@ ETM4_PKT_I_ADDR_S_IS0
@ ETM4_PKT_I_COND_I_F1
@ ETM4_PKT_I_NO_ERR_TYPE
@ ETM4_PKT_I_ADDR_L_64IS1
@ ETM4_PKT_I_ADDR_L_32IS0
@ ETM4_PKT_I_ATOM_F4
@ ETM4_PKT_I_ADDR_CTXT_L_64IS0
@ ETM4_PKT_I_ATOM_F5
@ ETM4_PKT_I_NUM_DS_MKR
@ ETM4_PKT_I_NOTSYNC
@ ETM4_PKT_I_CANCEL_F1_MISPRED
@ ETE_PKT_I_SRC_ADDR_S_IS1
@ ETM4_PKT_I_Q
@ ETM4_PKT_I_ADDR_S_IS1
@ ETE_PKT_I_SRC_ADDR_L_64IS0
@ ETM4_PKT_I_CCNT_F2
@ ETM4_PKT_D_BAD_SEQUENCE
invalid sequence for packet type
@ ETM4_PKT_DADDR_P1_F7
b11110101
@ ETM4_PKT_D_NOTSYNC
no sync found yet
@ ETM4_PKT_DVAL_P2_F2
b00110xxx
@ ETM4_PKT_DADDR_P1_F2
b10xxxxxx
@ ETM4_PKT_D_NO_HEADER
waiting for a header byte
@ ETM4_PKT_DSUPPRESSION
b00000011
@ ETM4_PKT_D_NO_ERR_TYPE
error packet has no header based type. Use with unknown/res packet types.
@ ETM4_PKT_DVAL_P2_F5
b00011xxx
@ ETM4_PKT_D_ASYNC
b00000000
@ ETM4_PKT_DADDR_P1_F4
b0110xxxx
@ ETM4_PKT_DADDR_P1_F3
b000101xx
@ ETM4_PKT_DTRACE_INFO
b00000001
@ ETM4_PKT_DADDR_P1_F6
b1111011x
@ ETM4_PKT_DVAL_P2_F4
b000100xx
@ ETM4_PKT_DVAL_P2_F1
b0010xxxx
@ ETM4_PKT_D_BAD_TRACEMODE
invalid packet type for this trace mode.
@ ETM4_PKT_DTIMESTAMP
b00000010
@ ETM4_PKT_D_OVERFLOW
b00000101
@ ETM4_PKT_DEVENT
b00000100
@ ETM4_PKT_DADDR_P1_F1
b0111xxxx
@ ETM4_PKT_DUNNUM_DS_MKR
b00000001
@ ETM4_PKT_DADDR_P1_F5
b11111xxx
@ ETM4_PKT_D_RESERVED
packet type reserved.
@ ETM4_PKT_D_DISCARD
b00000011
@ ETM4_PKT_DNUM_DS_MKR
@ ETM4_PKT_D_EXTENSION
b00000000
@ ETM4_PKT_D_INCOMPLETE_EOT
flushing incomplete packet at end of trace.
@ ETM4_PKT_DVAL_P2_F6
b00111xxx
@ ETM4_PKT_DVAL_P2_F3
b010xxxxx
ocsd_vaddr_t val
Address value.
uint8_t isa
instruction set.
uint32_t SF
sixty four bit
uint32_t VMID
current VMID
uint32_t NSE
PE FEAT_RME: root / realm indicator.
uint32_t updated_v
updated VMID
uint32_t updated_c
updated CtxtID
uint32_t ctxtID
Current ctxtID.
uint32_t updated
updated this context packet (otherwise same as last time)
uint32_t NS
none secure
uint32_t EL
exception level.
ocsd_core_profile_t core_prof
ocsd_arch_version_t arch_ver
ocsd_etmv4_d_pkt_type err_type
ocsd_etmv4_d_pkt_type type
struct _ocsd_etmv4_i_pkt::@17::@24 bits
uint8_t dsm_val
Data Sync Marker number, or unnumbered atom count - packet type determines.
struct _ocsd_etmv4_i_pkt::@13 exception_info
ocsd_etmv4_i_pkt_type type
struct _ocsd_etmv4_i_pkt::@16 Q_pkt
uint32_t p0_key
current P0 key value for data packet synchronisation
etmv4_trace_info_t trace_info
trace info structure - programmed configuration of trace capture.
ocsd_pkt_vaddr v_addr
most recently broadcast address packet
uint32_t addr_interp
address value interpretation
uint8_t bits_changed
bits updated in this timestamp packet.
struct _ocsd_etmv4_i_pkt::@14 cond_instr
ocsd_etmv4_i_pkt_type err_type
uint32_t m_fault_pending
M class fault pending.
uint32_t curr_spec_depth
current speculation depth
uint8_t v_addr_ISA
ISA for the address packet. (0 = IS0 / 1 = IS1)
struct _ocsd_etmv4_i_pkt::@12 ts
uint32_t cc_threshold
cycle count threshold - from trace info.
struct _ocsd_etmv4_i_pkt::@15 cond_result
uint32_t cycle_count
cycle count
ocsd_pkt_atom atom
atom elements - number of atoms indicates validity of packet
etmv4_context_t context
current context for PE
uint8_t event_val
Event value on event packet.
uint8_t addr_exact_match_idx
address match index in this packet.
uint32_t exceptionType
exception number
uint64_t timestamp
current timestamp value
union _ocsd_etmv4_i_pkt::@17 pkt_valid
valid bits for packet elements (addresses have their own valid bits).
uint32_t m_type
1 if M class exception.
OpenCSD: Common "C" types for trace packets.
uint32_t cond_enabled
conditional trace enabled type.
uint32_t cc_enabled
1 if cycle count enabled
uint32_t in_trans_state
1 if starting trace when in a transactional state (ETE trace).
uint32_t val
trace info full value.
uint32_t p0_load
1 if tracing with P0 load elements (for data trace)
uint32_t p0_store
1 if tracing with P0 store elements (for data trace)
struct _etmv4_trace_info_t::@9 bits
bitfields for trace info value.