OpenOCD
esirisc_trace.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 /***************************************************************************
4  * Copyright (C) 2018 by Square, Inc. *
5  * Steven Stallion <stallion@squareup.com> *
6  ***************************************************************************/
7 
8 #ifndef OPENOCD_TARGET_ESIRISC_TRACE_H
9 #define OPENOCD_TARGET_ESIRISC_TRACE_H
10 
11 #include <helper/command.h>
12 #include <helper/types.h>
13 #include <target/target.h>
14 
20 };
21 
26 };
27 
33 };
34 
46 };
47 
59 };
60 
61 struct esirisc_trace {
66 
68  int pc_bits;
69 
71  uint32_t start_data;
72  uint32_t start_mask;
73 
75  uint32_t stop_data;
76  uint32_t stop_mask;
77 
79  uint32_t delay_cycles;
80 };
81 
83 
84 static inline uint32_t esirisc_trace_buffer_size(struct esirisc_trace *trace_info)
85 {
86  return trace_info->buffer_end - trace_info->buffer_start;
87 }
88 
89 static inline bool esirisc_trace_is_fifo(struct esirisc_trace *trace_info)
90 {
91  return trace_info->buffer_start == trace_info->buffer_end;
92 }
93 
94 #endif /* OPENOCD_TARGET_ESIRISC_TRACE_H */
static uint32_t esirisc_trace_buffer_size(struct esirisc_trace *trace_info)
Definition: esirisc_trace.h:84
esirisc_trace_trigger
Definition: esirisc_trace.h:48
@ ESIRISC_TRACE_TRIGGER_HIGH
Definition: esirisc_trace.h:57
@ ESIRISC_TRACE_TRIGGER_STORE
Definition: esirisc_trace.h:52
@ ESIRISC_TRACE_TRIGGER_STOP
Definition: esirisc_trace.h:56
@ ESIRISC_TRACE_TRIGGER_NONE
Definition: esirisc_trace.h:49
@ ESIRISC_TRACE_TRIGGER_WAIT
Definition: esirisc_trace.h:55
@ ESIRISC_TRACE_TRIGGER_LOW
Definition: esirisc_trace.h:58
@ ESIRISC_TRACE_TRIGGER_LOAD
Definition: esirisc_trace.h:51
@ ESIRISC_TRACE_TRIGGER_ERET
Definition: esirisc_trace.h:54
@ ESIRISC_TRACE_TRIGGER_PC
Definition: esirisc_trace.h:50
@ ESIRISC_TRACE_TRIGGER_EXCEPTION
Definition: esirisc_trace.h:53
static bool esirisc_trace_is_fifo(struct esirisc_trace *trace_info)
Definition: esirisc_trace.h:89
esirisc_trace_format
Definition: esirisc_trace.h:22
@ ESIRISC_TRACE_FORMAT_ICACHE
Definition: esirisc_trace.h:25
@ ESIRISC_TRACE_FORMAT_FULL
Definition: esirisc_trace.h:23
@ ESIRISC_TRACE_FORMAT_BRANCH
Definition: esirisc_trace.h:24
const struct command_registration esirisc_trace_command_handlers[]
esirisc_trace_ext_id
Definition: esirisc_trace.h:35
@ ESIRISC_TRACE_EXT_ID_WAIT
Definition: esirisc_trace.h:39
@ ESIRISC_TRACE_EXT_ID_MULTICYCLE
Definition: esirisc_trace.h:40
@ ESIRISC_TRACE_EXT_ID_STOP
Definition: esirisc_trace.h:38
@ ESIRISC_TRACE_EXT_ID_END
Definition: esirisc_trace.h:44
@ ESIRISC_TRACE_EXT_ID_END_PC
Definition: esirisc_trace.h:45
@ ESIRISC_TRACE_EXT_ID_INDIRECT
Definition: esirisc_trace.h:43
@ ESIRISC_TRACE_EXT_ID_COUNT
Definition: esirisc_trace.h:41
@ ESIRISC_TRACE_EXT_ID_PC
Definition: esirisc_trace.h:42
@ ESIRISC_TRACE_EXT_ID_ERET
Definition: esirisc_trace.h:37
@ ESIRISC_TRACE_EXT_ID_EXCEPTION
Definition: esirisc_trace.h:36
esirisc_trace_delay
Definition: esirisc_trace.h:15
@ ESIRISC_TRACE_DELAY_NONE
Definition: esirisc_trace.h:16
@ ESIRISC_TRACE_DELAY_START
Definition: esirisc_trace.h:17
@ ESIRISC_TRACE_DELAY_BOTH
Definition: esirisc_trace.h:19
@ ESIRISC_TRACE_DELAY_STOP
Definition: esirisc_trace.h:18
esirisc_trace_id
Definition: esirisc_trace.h:28
@ ESIRISC_TRACE_ID_EXECUTE
Definition: esirisc_trace.h:29
@ ESIRISC_TRACE_ID_STALL
Definition: esirisc_trace.h:30
@ ESIRISC_TRACE_ID_BRANCH
Definition: esirisc_trace.h:31
@ ESIRISC_TRACE_ID_EXTENDED
Definition: esirisc_trace.h:32
uint32_t start_mask
Definition: esirisc_trace.h:72
target_addr_t buffer_end
Definition: esirisc_trace.h:63
enum esirisc_trace_format format
Definition: esirisc_trace.h:67
uint32_t stop_mask
Definition: esirisc_trace.h:76
uint32_t start_data
Definition: esirisc_trace.h:71
enum esirisc_trace_trigger stop_trigger
Definition: esirisc_trace.h:74
uint32_t stop_data
Definition: esirisc_trace.h:75
enum esirisc_trace_trigger start_trigger
Definition: esirisc_trace.h:70
uint32_t delay_cycles
Definition: esirisc_trace.h:79
enum esirisc_trace_delay delay
Definition: esirisc_trace.h:78
target_addr_t buffer_start
Definition: esirisc_trace.h:62
uint64_t target_addr_t
Definition: types.h:335