OpenCSD - CoreSight Trace Decode Library  0.12.1
trc_pkt_types_ptm.h
Go to the documentation of this file.
1 /*
2  * \file trc_pkt_ptm_types.h
3  * \brief OpenCSD : PTM specific types
4  *
5  * \copyright Copyright (c) 2015, ARM Limited. All Rights Reserved.
6  */
7 
8 /*
9  * Redistribution and use in source and binary forms, with or without modification,
10  * are permitted provided that the following conditions are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright notice,
13  * this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright notice,
16  * this list of conditions and the following disclaimer in the documentation
17  * and/or other materials provided with the distribution.
18  *
19  * 3. Neither the name of the copyright holder nor the names of its contributors
20  * may be used to endorse or promote products derived from this software without
21  * specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND
24  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26  * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
27  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
30  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  */
34 
35 #ifndef ARM_TRC_PKT_PTM_TYPES_H_INCLUDED
36 #define ARM_TRC_PKT_PTM_TYPES_H_INCLUDED
37 
38 #include "opencsd/trc_pkt_types.h"
39 
46 typedef enum _ocsd_ptm_pkt_type
47 {
48 // markers for unknown packets
52 
53 // markers for valid packets
65  PTM_PKT_BRANCH_OR_BYPASS_EOT, // interpreter FSM 'state' : unsure if branch 0 packet or bypass flush end of trace
66  PTM_PKT_TPIU_PAD_EOB, // pad end of a buffer - no valid trace at this point
67 
68 // markers for bad packets
71 
73 
74 typedef struct _ptm_context_t {
75  struct {
76  uint32_t curr_alt_isa:1;
77  uint32_t curr_NS:1;
78  uint32_t curr_Hyp:1;
79  uint32_t updated:1;
80  uint32_t updated_c:1;
81  uint32_t updated_v:1;
82  };
83  uint32_t ctxtID;
84  uint8_t VMID;
86 
87 typedef struct _ocsd_ptm_excep {
89  uint16_t number;
90  struct {
91  uint32_t present:1;
92  } bits;
94 
95 
96 typedef struct _ocsd_ptm_pkt
97 {
106 
109  uint32_t cycle_count;
110  uint8_t cc_valid;
112  uint64_t timestamp;
113  uint8_t ts_update_bits;
119 } ocsd_ptm_pkt;
120 
121 typedef struct _ocsd_ptm_cfg
122 {
123  uint32_t reg_idr;
124  uint32_t reg_ctrl;
125  uint32_t reg_ccer;
126  uint32_t reg_trc_id;
129 } ocsd_ptm_cfg;
130 
135 #endif // ARM_TRC_PKT_PTM_TYPES_H_INCLUDED
136 
137 /* End of File trc_pkt_ptm_types.h */
PTM_PKT_NOTSYNC
@ PTM_PKT_NOTSYNC
no sync found yet
Definition: trc_pkt_types_ptm.h:49
_ocsd_ptm_pkt::i_sync_reason
ocsd_iSync_reason i_sync_reason
Definition: trc_pkt_types_ptm.h:107
ocsd_ptm_excep
struct _ocsd_ptm_excep ocsd_ptm_excep
_ocsd_ptm_excep::present
uint32_t present
Definition: trc_pkt_types_ptm.h:91
PTM_PKT_INCOMPLETE_EOT
@ PTM_PKT_INCOMPLETE_EOT
flushing incomplete packet at end of trace.
Definition: trc_pkt_types_ptm.h:50
ocsd_iSync_reason
enum _ocsd_iSync_reason ocsd_iSync_reason
ocsd_ptm_pkt
struct _ocsd_ptm_pkt ocsd_ptm_pkt
ocsd_core_profile_t
enum _ocsd_core_profile ocsd_core_profile_t
_ocsd_ptm_pkt::cycle_count
uint32_t cycle_count
Definition: trc_pkt_types_ptm.h:109
ocsd_ptm_cfg
struct _ocsd_ptm_cfg ocsd_ptm_cfg
_ocsd_ptm_cfg::reg_ctrl
uint32_t reg_ctrl
Definition: trc_pkt_types_ptm.h:124
ocsd_armv7_exception
enum _ocsd_armv7_exception ocsd_armv7_exception
_ocsd_ptm_pkt::exception
ocsd_ptm_excep exception
Definition: trc_pkt_types_ptm.h:115
_ocsd_ptm_pkt::err_type
ocsd_ptm_pkt_type err_type
Definition: trc_pkt_types_ptm.h:117
_ptm_context_t::updated_c
uint32_t updated_c
Definition: trc_pkt_types_ptm.h:80
_ocsd_ptm_pkt
Definition: trc_pkt_types_ptm.h:96
_ptm_context_t::ctxtID
uint32_t ctxtID
Definition: trc_pkt_types_ptm.h:83
_ptm_context_t::updated_v
uint32_t updated_v
Definition: trc_pkt_types_ptm.h:81
_ocsd_ptm_excep::bits
struct _ocsd_ptm_excep::@27 bits
_ocsd_ptm_cfg
Definition: trc_pkt_types_ptm.h:121
PTM_PKT_TRIGGER
@ PTM_PKT_TRIGGER
trigger packet
Definition: trc_pkt_types_ptm.h:57
_ocsd_ptm_pkt::curr_isa
ocsd_isa curr_isa
Definition: trc_pkt_types_ptm.h:100
ocsd_arch_version_t
enum _ocsd_arch_version ocsd_arch_version_t
_ocsd_ptm_pkt::cc_valid
uint8_t cc_valid
Definition: trc_pkt_types_ptm.h:110
_ocsd_ptm_cfg::arch_ver
ocsd_arch_version_t arch_ver
Definition: trc_pkt_types_ptm.h:127
PTM_PKT_EXCEPTION_RET
@ PTM_PKT_EXCEPTION_RET
exception return.
Definition: trc_pkt_types_ptm.h:64
_ocsd_ptm_pkt::atom
ocsd_pkt_atom atom
Definition: trc_pkt_types_ptm.h:105
_ocsd_ptm_pkt::type
ocsd_ptm_pkt_type type
Definition: trc_pkt_types_ptm.h:98
_ocsd_ptm_cfg::reg_ccer
uint32_t reg_ccer
Definition: trc_pkt_types_ptm.h:125
_ocsd_ptm_excep
Definition: trc_pkt_types_ptm.h:87
PTM_PKT_CONTEXT_ID
@ PTM_PKT_CONTEXT_ID
context id packet.
Definition: trc_pkt_types_ptm.h:60
PTM_PKT_BRANCH_OR_BYPASS_EOT
@ PTM_PKT_BRANCH_OR_BYPASS_EOT
Definition: trc_pkt_types_ptm.h:65
_ocsd_ptm_pkt::timestamp
uint64_t timestamp
Definition: trc_pkt_types_ptm.h:112
PTM_PKT_TPIU_PAD_EOB
@ PTM_PKT_TPIU_PAD_EOB
Definition: trc_pkt_types_ptm.h:66
PTM_PKT_VMID
@ PTM_PKT_VMID
VMID packet.
Definition: trc_pkt_types_ptm.h:61
_ocsd_pkt_vaddr
Definition: trc_pkt_types.h:58
_ptm_context_t::curr_Hyp
uint32_t curr_Hyp
Definition: trc_pkt_types_ptm.h:78
_ocsd_ptm_pkt_type
_ocsd_ptm_pkt_type
Definition: trc_pkt_types_ptm.h:46
ocsd_ptm_pkt_type
enum _ocsd_ptm_pkt_type ocsd_ptm_pkt_type
_ocsd_ptm_cfg::reg_idr
uint32_t reg_idr
Definition: trc_pkt_types_ptm.h:123
_ptm_context_t::VMID
uint8_t VMID
Definition: trc_pkt_types_ptm.h:84
PTM_PKT_I_SYNC
@ PTM_PKT_I_SYNC
Instruction sync with address.
Definition: trc_pkt_types_ptm.h:56
_ocsd_ptm_cfg::reg_trc_id
uint32_t reg_trc_id
Definition: trc_pkt_types_ptm.h:126
PTM_PKT_IGNORE
@ PTM_PKT_IGNORE
ignore packet.
Definition: trc_pkt_types_ptm.h:59
_ocsd_ptm_pkt::ts_update_bits
uint8_t ts_update_bits
Definition: trc_pkt_types_ptm.h:113
trc_pkt_types.h
OpenCSD: Common "C" types for trace packets.
PTM_PKT_TIMESTAMP
@ PTM_PKT_TIMESTAMP
timestamp packet.
Definition: trc_pkt_types_ptm.h:63
_ocsd_pkt_atom
Definition: trc_pkt_types.h:84
_ptm_context_t
Definition: trc_pkt_types_ptm.h:74
_ocsd_ptm_excep::number
uint16_t number
Definition: trc_pkt_types_ptm.h:89
PTM_PKT_BAD_SEQUENCE
@ PTM_PKT_BAD_SEQUENCE
invalid sequence for packet type
Definition: trc_pkt_types_ptm.h:69
_ocsd_ptm_pkt::context
ptm_context_t context
Definition: trc_pkt_types_ptm.h:104
PTM_PKT_ATOM
@ PTM_PKT_ATOM
atom waypoint packet.
Definition: trc_pkt_types_ptm.h:62
PTM_PKT_RESERVED
@ PTM_PKT_RESERVED
Reserved packet encoding
Definition: trc_pkt_types_ptm.h:70
_ocsd_ptm_pkt::prev_isa
ocsd_isa prev_isa
Definition: trc_pkt_types_ptm.h:101
_ocsd_ptm_pkt::addr
ocsd_pkt_vaddr addr
Definition: trc_pkt_types_ptm.h:103
_ocsd_ptm_cfg::core_prof
ocsd_core_profile_t core_prof
Definition: trc_pkt_types_ptm.h:128
_ptm_context_t::updated
uint32_t updated
Definition: trc_pkt_types_ptm.h:79
PTM_PKT_A_SYNC
@ PTM_PKT_A_SYNC
Alignment Synchronisation.
Definition: trc_pkt_types_ptm.h:55
PTM_PKT_NOERROR
@ PTM_PKT_NOERROR
no error base type packet.
Definition: trc_pkt_types_ptm.h:51
ptm_context_t
struct _ptm_context_t ptm_context_t
_ptm_context_t::curr_alt_isa
uint32_t curr_alt_isa
Definition: trc_pkt_types_ptm.h:76
PTM_PKT_WPOINT_UPDATE
@ PTM_PKT_WPOINT_UPDATE
Waypoint update.
Definition: trc_pkt_types_ptm.h:58
_ocsd_ptm_excep::type
ocsd_armv7_exception type
Definition: trc_pkt_types_ptm.h:88
PTM_PKT_BRANCH_ADDRESS
@ PTM_PKT_BRANCH_ADDRESS
Branch address with optional exception.
Definition: trc_pkt_types_ptm.h:54
ocsd_isa
enum _ocsd_isa ocsd_isa
_ptm_context_t::curr_NS
uint32_t curr_NS
Definition: trc_pkt_types_ptm.h:77