- removed flash write_image - binary compare function has been moved to verify_image...
[openocd.git] / src / target / etm.h
index 595917885a56dcd93518a42dc81def870c62a410..bfa1252b761ca4284da449754785a326c1d0b73e 100644 (file)
@@ -23,6 +23,7 @@
 #ifndef ETM_H\r
 #define ETM_H\r
 \r
+#include "image.h"\r
 #include "trace.h"\r
 #include "target.h"\r
 #include "register.h"\r
@@ -102,7 +103,8 @@ typedef enum
        ETMV1_CONTEXTID_32   = 0x30,\r
        ETMV1_CONTEXTID_MASK = 0x30,\r
        /* Misc */\r
-       ETMV1_CYCLE_ACCURATE = 0x100\r
+       ETMV1_CYCLE_ACCURATE = 0x100,\r
+       ETMV1_BRANCH_OUTPUT = 0x200\r
 } etmv1_tracemode_t;\r
 \r
 /* forward-declare ETM context */\r
@@ -119,11 +121,17 @@ typedef struct etm_capture_driver_s
        int (*stop_capture)(struct etm_context_s *etm_ctx);\r
 } etm_capture_driver_t;\r
 \r
+enum\r
+{\r
+       ETMV1_TRACESYNC_CYCLE = 0x1,\r
+       ETMV1_TRIGGER_CYCLE = 0x2,\r
+};\r
+\r
 typedef struct etmv1_trace_data_s\r
 {\r
-       u8 pipestat;    /* pipeline cycle this packet belongs to */\r
-       u16 packet;     /* packet data (4, 8 or 16 bit) */\r
-       int tracesync;  /* 1 if tracesync was set on this packet */\r
+       u8 pipestat;    /* bits 0-2 pipeline status */\r
+       u16 packet;             /* packet data (4, 8 or 16 bit) */\r
+       int flags;              /* ETMV1_TRACESYNC_CYCLE, ETMV1_TRIGGER_CYCLE */\r
 } etmv1_trace_data_t;\r
 \r
 /* describe a trace context\r
@@ -133,23 +141,29 @@ typedef struct etmv1_trace_data_s
  */\r
 typedef struct etm_context_s\r
 {\r
+       target_t *target;                               /* target this ETM is connected to */\r
        reg_cache_t *reg_cache;                 /* ETM register cache */\r
        etm_capture_driver_t *capture_driver;   /* driver used to access ETM data */\r
        void *capture_driver_priv;              /* capture driver private data */\r
+       u32 trigger_percent;                    /* percent of trace buffer to be filled after the trigger */\r
        trace_status_t capture_status;  /* current state of capture run */ \r
        etmv1_trace_data_t *trace_data; /* trace data */\r
        u32 trace_depth;                                /* number of trace cycles to be analyzed, 0 if no trace data available */\r
        etm_portmode_t portmode;                /* normal, multiplexed or demultiplexed */\r
        etmv1_tracemode_t tracemode;    /* type of information the trace contains (data, addres, contextID, ...) */ \r
        armv4_5_state_t core_state;             /* current core state (ARM, Thumb, Jazelle) */\r
-//     trace_image_provider_t image_provider;  /* source for target opcodes */\r
+       image_t *image;                                 /* source for target opcodes */\r
        u32 pipe_index;                                 /* current trace cycle */\r
        u32 data_index;                                 /* cycle holding next data packet */\r
+       int data_half;                                  /* port half on a 16 bit port */\r
        u32 current_pc;                                 /* current program counter */\r
        u32 pc_ok;                                              /* full PC has been acquired */\r
        u32 last_branch;                                /* last branch address output */ \r
+       u32 last_branch_reason;                 /* branch reason code for the last branch encountered */\r
        u32 last_ptr;                                   /* address of the last data access */\r
+       u32 ptr_ok;                                             /* whether last_ptr is valid */ \r
        u32 context_id;                                 /* context ID of the code being traced */\r
+       u32 last_instruction;                   /* index of last instruction executed (to calculate cycle timings) */\r
 } etm_context_t;\r
 \r
 /* PIPESTAT values */\r
@@ -195,5 +209,6 @@ extern etm_context_t* etm_create_context(etm_portmode_t portmode, char *capture_
 #define ERROR_ETM_INVALID_DRIVER       (-1300)\r
 #define ERROR_ETM_PORTMODE_NOT_SUPPORTED       (-1301)\r
 #define ERROR_ETM_CAPTURE_INIT_FAILED  (-1302)\r
+#define ERROR_ETM_ANALYSIS_FAILED      (-1303)\r
 \r
 #endif /* ETM_H */\r

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)