OpenCSD - CoreSight Trace Decode Library  0.12.1
trc_pkt_types_etmv4.h
Go to the documentation of this file.
1 /*
2  * \file trc_pkt_types_etmv4.h
3  * \brief OpenCSD : ETMv4 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 encodings 0x08-0xB b00001000 to b00001011 */
76 
77  /* cycle count packets */
82  // data synchronisation markers
86  // speculation
93  /* conditional instruction tracing */
97  /* unused encoding 0x47 b01000111 */
99  /* unused encodings 0x4B,0x4F b01001011, b01001111 */
101  /* unused encodings 0x60-0x67 b01100xxx */
106  // event trace
110  /* address and context */
114  /* unused encoding 0x84 b10000100 */
117  /* unused encoding 0x87 b10000111 */
118  /* unused encodings 0x88-0x8F b10001xxx */
120  /* unused encodings 0x93-0x94 b10010011 to b10010010 */
123  /* unused encodings 0x97 b10010111 to b10011001 0x99 */
126  /* unused encoding 0x9C b10011100 */
129  /* unused encoding 0x9F b10011111 */
130 
131  /* Q packets */
132  ETM4_PKT_I_Q = 0xA0,
134  /* unused encodings 0xB0-0xBF b1011xxxx */
135 
136  /* Atom packets */
144  // extension packets - follow 0x00 header
148 
150 
151 typedef union _etmv4_trace_info_t {
152  uint32_t val;
153  struct {
154  uint32_t cc_enabled:1;
155  uint32_t cond_enabled:3;
156  uint32_t p0_load:1;
157  uint32_t p0_store:1;
158  } bits;
160 
161 typedef struct _etmv4_context_t {
162  struct {
163  uint32_t EL:2;
164  uint32_t SF:1;
165  uint32_t NS:1;
166  uint32_t updated:1;
167  uint32_t updated_c:1;
168  uint32_t updated_v:1;
169  };
170  uint32_t ctxtID;
171  uint32_t VMID;
173 
175 typedef struct _etmv4_addr_val_t {
177  uint8_t isa;
179 
180 typedef struct _ocsd_etmv4_i_pkt
181 {
184  //** intra-packet data - valid across packets.
185 
187  uint8_t v_addr_ISA;
188 
190 
191  struct {
192  uint64_t timestamp;
193  uint8_t bits_changed;
194  } ts;
195 
196  uint32_t cc_threshold;
197 
198  // single packet data - only valid for specific packet types on packet instance.
200  uint32_t cycle_count;
201 
202  uint32_t curr_spec_depth;
203  uint32_t p0_key;
204 
205  uint32_t commit_elements; //<! commit elements indicated by this packet - valid dependent on the packet type.
206  uint32_t cancel_elements; //<! cancel elements indicated by this packet - valid dependent on the packet type.
207 
209 
210  struct {
211  uint32_t exceptionType:10;
212  uint32_t addr_interp:2;
213  uint32_t m_fault_pending:1;
214  uint32_t m_type:1;
215  } exception_info;
216 
217 
219  uint8_t dsm_val;
220  uint8_t event_val;
221 
222  struct {
223  uint32_t cond_c_key;
224  uint8_t num_c_elem;
225  struct {
226  uint32_t cond_key_set:1;
227  uint32_t f3_final_elem:1;
228  uint32_t f2_cond_incr:1;
229  };
230  } cond_instr;
231 
232  struct {
233  uint32_t cond_r_key_0;
234  uint32_t cond_r_key_1;
235  struct {
236  uint32_t res_0:4;
237  uint32_t res_1:4;
238  uint32_t ci_0:1;
239  uint32_t ci_1:1;
240  uint32_t key_res_0_set:1;
241  uint32_t key_res_1_set:1;
242  uint32_t f2_key_incr:2;
243  uint32_t f2f4_token:2;
244  uint32_t f3_tokens:12;
245  };
246  } cond_result;
247 
248  struct {
249  uint32_t q_count;
250  struct {
251  uint32_t addr_present:1;
252  uint32_t addr_match:1;
253  uint32_t count_present:1;
254  uint32_t q_type:4;
255  };
256  } Q_pkt;
257 
259  union {
260  uint32_t val;
261  struct {
262  uint32_t context_valid:1;
263  uint32_t ts_valid:1;
264  uint32_t spec_depth_valid:1;
265  uint32_t p0_key_valid:1;
266  uint32_t cond_c_key_valid:1;
267  uint32_t cond_r_key_valid:1;
268  uint32_t trace_info_valid:1;
269  uint32_t cc_thresh_valid:1;
270  uint32_t cc_valid:1;
271  uint32_t commit_elem_valid:1;
272  } bits;
273  } pkt_valid;
274 
275  // original header type when packet type changed to error on decode error.
277  uint8_t err_hdr_val;
278 
280 
281 
282 // D stream packets
284 {
285 // markers for unknown/bad packets
293 
294  // data sync markers
295  ETM4_PKT_DNUM_DS_MKR = 0x111, // ext packet, b0001xxx1
296  // extension header
298 
300  // event trace
302  // timestamp
304  // P1 Data address
312  // P2 Data value
319  // suppression
321  // synchronisation- extension packets - follow 0x00 header
323 
324  // extension packets - follow 0x00 header
328 
330 
331 
332 typedef struct _ocsd_etmv4_d_pkt
333 {
335 
337 
338  uint64_t pkt_val;
341 
343 
344 typedef struct _ocsd_etmv4_cfg
345 {
346  uint32_t reg_idr0;
347  uint32_t reg_idr1;
348  uint32_t reg_idr2;
349  uint32_t reg_idr8;
350  uint32_t reg_idr9;
351  uint32_t reg_idr10;
352  uint32_t reg_idr11;
353  uint32_t reg_idr12;
354  uint32_t reg_idr13;
355  uint32_t reg_configr;
356  uint32_t reg_traceidr;
360 
361 
364 #endif // ARM_TRC_PKT_TYPES_ETMV4_H_INCLUDED
365 
366 /* End of File trc_pkt_types_etmv4.h */
367 
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.
uint32_t updated
updated this context packet (otherwise same as last time)
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.
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
ocsd_etmv4_d_pkt_type type
ocsd_core_profile_t core_prof
enum _ocsd_etmv4_d_pkt_type ocsd_etmv4_d_pkt_type
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
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
error packet has no header based type. Use with unknown/res packet types.
uint32_t addr_interp
address value interpretation
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
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