OpenOCD
riscv.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef OPENOCD_TARGET_RISCV_RISCV_H
4 #define OPENOCD_TARGET_RISCV_RISCV_H
5 
6 struct riscv_program;
7 
8 #include <stdint.h>
9 #include "opcodes.h"
10 #include "gdb_regs.h"
11 #include "jtag/jtag.h"
13 #include "target/target.h"
14 #include "target/register.h"
15 #include <helper/command.h>
16 #include <helper/bits.h>
17 
18 #define RISCV_COMMON_MAGIC 0x52495356U
19 
20 #define RISCV_MAX_TRIGGERS 32
21 #define RISCV_MAX_HWBPS 16
22 #define RISCV_MAX_DMS 100
23 
24 #define DEFAULT_COMMAND_TIMEOUT_SEC 5
25 
26 #define RISCV_SATP_MODE(xlen) ((xlen) == 32 ? SATP32_MODE : SATP64_MODE)
27 #define RISCV_SATP_PPN(xlen) ((xlen) == 32 ? SATP32_PPN : SATP64_PPN)
28 #define RISCV_HGATP_MODE(xlen) ((xlen) == 32 ? HGATP32_MODE : HGATP64_MODE)
29 #define RISCV_HGATP_PPN(xlen) ((xlen) == 32 ? HGATP32_PPN : HGATP64_PPN)
30 #define RISCV_PGSHIFT 12
31 #define RISCV_PGSIZE BIT(RISCV_PGSHIFT)
32 #define RISCV_PGBASE(addr) ((addr) & ~(RISCV_PGSIZE - 1))
33 #define RISCV_PGOFFSET(addr) ((addr) & (RISCV_PGSIZE - 1))
34 
35 #define PG_MAX_LEVEL 5
36 
37 #define RISCV_BATCH_ALLOC_SIZE 128
38 
39 extern struct target_type riscv011_target;
40 extern struct target_type riscv013_target;
41 
42 /*
43  * Definitions shared by code supporting all RISC-V versions.
44  */
45 typedef uint64_t riscv_reg_t;
46 typedef uint32_t riscv_insn_t;
47 typedef uint64_t riscv_addr_t;
48 
52  YNM_NO
53 };
54 
60 };
61 
66 };
67 
69 
78 };
79 
81  /* RISCV_ISRMASK_AUTO, */ /* not supported yet */
83  /* RISCV_ISRMASK_ON, */ /* not supported yet */
85 };
86 
92 };
93 
94 /* RISC-V-specific data assigned to a register. */
95 typedef struct {
96  struct target *target;
97  /* Abstract command's regno for a custom register. */
98  unsigned int custom_number;
100 
101 #define RISCV_SAMPLE_BUF_TIMESTAMP_BEFORE 0x80
102 #define RISCV_SAMPLE_BUF_TIMESTAMP_AFTER 0x81
104  uint8_t *buf;
105  unsigned int used;
106  unsigned int size;
107 };
108 
109 typedef struct {
110  bool enabled;
111  struct {
112  bool enabled;
114  uint32_t size_bytes;
115  } bucket[16];
117 
118 typedef struct {
119  struct list_head list;
120  uint16_t low, high;
121  char *name;
122 } range_list_t;
123 
124 #define DTM_DTMCS_VERSION_UNKNOWN ((unsigned int)-1)
125 #define RISCV_TINFO_VERSION_UNKNOWN (-1)
126 
127 #define RISCV013_DTMCS_ABITS_MIN 7
128 #define RISCV013_DTMCS_ABITS_MAX 32
129 
131  unsigned int num_entries;
132  char **reg_names;
133 };
134 
137 
138  const uint8_t *write_buffer;
139  uint8_t *read_buffer;
140 
141  uint32_t size;
142  uint32_t count;
143  uint32_t increment;
144 };
145 
146 static inline bool
148 {
149  return !args.read_buffer != !args.write_buffer;
150 }
151 
152 static inline bool
154 {
155  assert(riscv_mem_access_is_valid(args));
156  return !args.write_buffer && args.read_buffer;
157 }
158 
159 static inline bool
161 {
162  assert(riscv_mem_access_is_valid(args));
163  return !args.read_buffer && args.write_buffer;
164 }
165 
166 
167 struct riscv_info {
168  unsigned int common_magic;
169 
170  unsigned int dtm_version;
171 
174 
176  char **reg_names;
177 
178  /* It's possible that each core has a different supported ISA set. */
179  int xlen;
180  /* TODO: use the value from the register cache instead. */
182  /* TODO: use the value from the register cache instead.
183  * Cached value of vlenb. 0 indicates there is no vector support.
184  * Note that you can have vector support without misa.V set, because
185  * Zve* extensions implement vector registers without setting misa.V. */
186  unsigned int vlenb;
187 
188  /* The number of triggers per hart. */
189  unsigned int trigger_count;
190 
191  /* Data structure to record known unsupported tdata1+tdata2 trigger CSR values.
192  * This is to avoid repetitive attempts to set trigger configurations that are already
193  * known to be unsupported in the HW.
194  * A separate data structure is created for each trigger. */
196 
197  /* record the tinfo of each trigger */
199 
200  /* Version of the implemented Sdtrig extension */
202 
203  /* Record if single-step is needed prior to resuming
204  * from a software breakpoint or trigger.
205  * Single-step is needed if the instruction that
206  * caused the halt was not retired. That is,
207  * when we halted "before" that instruction.
208  */
210 
211  /* For each physical trigger contains:
212  * -1: the hwbp is available
213  * -4: The trigger is used by the itrigger command
214  * -5: The trigger is used by the etrigger command
215  * >= 0: unique_id of the breakpoint/watchpoint that is using it.
216  * Note that in RTOS mode the triggers are the same across all harts the
217  * target controls, while otherwise only a single hart is controlled. */
219 
220  /* The unique id of the trigger that caused the most recent halt. If the
221  * most recent halt was not caused by a trigger, then this is -1. */
222  int64_t trigger_hit;
223 
224  /* The configured approach to translate virtual addresses to physical */
226 
228 
229  /* Decremented every scan, and when it reaches 0 we clear the learned
230  * delays, causing them to be relearned. Used for testing. */
232 
233  /* This target has been prepped and is ready to step/resume. */
234  bool prepped;
235  /* This target was selected using hasel. */
236  bool selected;
237 
238  /* Used by riscv_openocd_poll(). */
242 
244 
245  /* Helper functions that target the various RISC-V debug spec
246  * implementations. */
247  int (*select_target)(struct target *target);
249  /* Resume this target, as well as every other prepped target that can be
250  * resumed near-simultaneously. Clear the prepped flag on any target that
251  * was resumed. */
252  int (*resume_go)(struct target *target);
253  int (*step_current_hart)(struct target *target);
254 
255  /* These get called from riscv_poll_hart(), which is a house of cards
256  * together with openocd_poll(), so be careful not to upset things too
257  * much. */
259  enum riscv_hart_state previous_riscv_state);
261  enum riscv_hart_state previous_riscv_state);
263  enum riscv_hart_state previous_riscv_state);
264 
265  /* Called periodically (no guarantees about frequency), while there's
266  * nothing else going on. */
267  int (*tick)(struct target *target);
268 
269  /* Get this target as ready as possible to resume, without actually
270  * resuming. */
271  int (*resume_prep)(struct target *target);
272  int (*halt_prep)(struct target *target);
273  int (*halt_go)(struct target *target);
274  int (*on_step)(struct target *target);
275  enum riscv_halt_reason (*halt_reason)(struct target *target);
276  int (*write_progbuf)(struct target *target, unsigned int index, riscv_insn_t d);
277  riscv_insn_t (*read_progbuf)(struct target *target, unsigned int index);
278  int (*execute_progbuf)(struct target *target, uint32_t *cmderr);
280  unsigned int (*get_dmi_address_bits)(const struct target *target);
281  void (*fill_dmi_write)(const struct target *target, uint8_t *buf, uint32_t a, uint32_t d);
282  void (*fill_dmi_read)(const struct target *target, uint8_t *buf, uint32_t a);
283  void (*fill_dm_nop)(const struct target *target, uint8_t *buf);
284 
285  int (*authdata_read)(struct target *target, uint32_t *value, unsigned int index);
286  int (*authdata_write)(struct target *target, uint32_t value, unsigned int index);
287 
288  int (*dmi_read)(struct target *target, uint32_t *value, uint32_t address);
289  int (*dmi_write)(struct target *target, uint32_t address, uint32_t value);
290 
291  bool (*get_impebreak)(const struct target *target);
292  unsigned int (*get_progbufsize)(const struct target *target);
293 
294  /* Get the DMI address of target's DM's register.
295  * The function should return the passed address
296  * if the target is not assigned a DM yet.
297  */
298  uint32_t (*get_dmi_address)(const struct target *target, uint32_t dm_address);
299 
300  int (*sample_memory)(struct target *target,
301  struct riscv_sample_buf *buf,
303  int64_t until_ms);
304 
305  int (*access_memory)(struct target *target, const struct riscv_mem_access_args args);
306 
307  unsigned int (*data_bits)(struct target *target);
308 
309  COMMAND_HELPER((*print_info), struct target *target);
310 
311  /* Storage for arch_info of non-custom registers. */
313 
314  /* Storage for vector register types. */
327  struct reg_data_type type_vector;
328 
330 
331  /* Memory access methods to use, ordered by priority, highest to lowest. */
333 
335 
336  /* Different memory regions may need different methods but single configuration is applied
337  * for all. Following flags are used to warn only once about failing memory access method. */
339 
340  /* In addition to the ones in the standard spec, we'll also expose additional
341  * CSRs in this list. */
342  struct list_head expose_csr;
343  /* Same, but for custom registers.
344  * Custom registers are for non-standard extensions and use abstract register numbers
345  * from range 0xc000 ... 0xffff. */
346  struct list_head expose_custom;
347 
348  /* The list of registers to mark as "hidden". Hidden registers are available
349  * but do not appear in gdb targets description or reg command output. */
350  struct list_head hide_csr;
351 
354 
355  /* Track when we were last asked to do something substantial. */
356  int64_t last_activity;
357 
359 
361 
365 
366  bool autofence;
367 };
368 
376 };
377 
380 };
381 
382 static inline struct riscv_private_config
384 {
385  assert(target->private_config);
386  return target->private_config;
387 }
388 
389 COMMAND_HELPER(riscv_print_info_line, const char *section, const char *key,
390  unsigned int value);
391 
392 typedef struct {
393  uint8_t tunneled_dr_width;
394  struct scan_field tunneled_dr[4];
396 
397 typedef struct {
398  const char *name;
399  int level;
400  unsigned int va_bits;
401  /* log2(PTESIZE) */
402  unsigned int pte_shift;
403  unsigned int vpn_shift[PG_MAX_LEVEL];
404  unsigned int vpn_mask[PG_MAX_LEVEL];
405  unsigned int pte_ppn_shift[PG_MAX_LEVEL];
406  unsigned int pte_ppn_mask[PG_MAX_LEVEL];
407  unsigned int pa_ppn_shift[PG_MAX_LEVEL];
408  unsigned int pa_ppn_mask[PG_MAX_LEVEL];
410 
411 bool riscv_virt2phys_mode_is_hw(const struct target *target);
412 bool riscv_virt2phys_mode_is_sw(const struct target *target);
413 
414 /* Wall-clock timeout for a command/access. Settable via RISC-V Target commands.*/
416 
417 /* Everything needs the RISC-V specific info structure, so here's a nice macro
418  * that provides that. */
419 static inline struct riscv_info *riscv_info(const struct target *target) __attribute__((unused));
420 static inline struct riscv_info *riscv_info(const struct target *target)
421 {
422  assert(target->arch_info);
423  return target->arch_info;
424 }
425 #define RISCV_INFO(R) struct riscv_info *R = riscv_info(target);
426 
427 static inline bool is_riscv(const struct riscv_info *riscv_info)
428 {
430 }
431 
432 extern struct scan_field select_dtmcontrol;
433 extern struct scan_field select_dbus;
434 extern struct scan_field select_idcode;
435 
436 int dtmcs_scan(struct jtag_tap *tap, uint32_t out, uint32_t *in_ptr);
437 
441 extern uint8_t bscan_tunnel_ir_width;
442 
443 void select_dmi_via_bscan(struct jtag_tap *tap);
444 
445 /*** OpenOCD Interface */
446 int riscv_openocd_poll(struct target *target);
447 
448 int riscv_halt(struct target *target);
449 
451  struct target *target,
452  bool current,
454  bool handle_breakpoints
455 );
456 
457 /*** RISC-V Interface ***/
458 
459 bool riscv_supports_extension(const struct target *target, char letter);
460 
461 /* Returns XLEN for the given (or current) hart. */
462 unsigned int riscv_xlen(const struct target *target);
463 
464 /* Returns VLENB for the given (or current) hart. */
465 unsigned int riscv_vlenb(const struct target *target);
466 
467 /*** Support functions for the RISC-V 'RTOS', which provides multihart support
468  * without requiring multiple targets. */
469 
470 /* Checks the state of the current hart -- "is_halted" checks the actual
471  * on-device register. */
473 
474 /* These helper functions let the generic program interface get target-specific
475  * information. */
476 unsigned int riscv_progbuf_size(struct target *target);
477 
478 riscv_insn_t riscv_read_progbuf(struct target *target, int index);
479 int riscv_write_progbuf(struct target *target, unsigned int index, riscv_insn_t insn);
480 int riscv_execute_progbuf(struct target *target, uint32_t *cmderr);
481 
482 void riscv_fill_dm_nop(const struct target *target, uint8_t *buf);
483 void riscv_fill_dmi_write(const struct target *target, uint8_t *buf, uint32_t a, uint32_t d);
484 void riscv_fill_dmi_read(const struct target *target, uint8_t *buf, uint32_t a);
485 unsigned int riscv_get_dmi_address_bits(const struct target *target);
486 
487 uint32_t riscv_get_dmi_address(const struct target *target, uint32_t dm_address);
488 
490 
493  struct watchpoint *watchpoint);
494 
495 void riscv_semihosting_init(struct target *target);
496 
497 enum semihosting_result riscv_semihosting(struct target *target, int *retval);
498 
499 void riscv_add_bscan_tunneled_scan(struct jtag_tap *tap, const struct scan_field *field,
501 
502 int riscv_read_by_any_size(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer);
503 int riscv_write_by_any_size(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer);
504 
505 #endif /* OPENOCD_TARGET_RISCV_RISCV_H */
enum arm_mode mode
Definition: armv4_5.c:280
uint64_t buffer
Pointer to data buffer to send over SPI.
Definition: dw-spi-helper.h:0
uint32_t size
Size of dw_spi_transaction::buffer.
Definition: dw-spi-helper.h:4
uint32_t address
Starting address. Sector aligned.
Definition: dw-spi-helper.h:0
The JTAG interface can be implemented with a software or hardware fifo.
struct qn908x_flash_bank __attribute__
Definition: armv8.c:1059
static bool riscv_mem_access_is_valid(const struct riscv_mem_access_args args)
Definition: riscv.h:147
struct scan_field select_idcode
Definition: riscv.c:53
unsigned int riscv_xlen(const struct target *target)
Definition: riscv.c:6121
struct target_type riscv011_target
Definition: riscv-011.c:2453
uint32_t bscan_tunneled_select_dmi_num_fields
struct scan_field select_dbus
Definition: riscv.c:48
void riscv_add_bscan_tunneled_scan(struct jtag_tap *tap, const struct scan_field *field, riscv_bscan_tunneled_scan_context_t *ctxt)
Definition: riscv.c:6353
static struct riscv_info * riscv_info(const struct target *target) __attribute__((unused))
Definition: riscv.h:420
static bool is_riscv(const struct riscv_info *riscv_info)
Definition: riscv.h:427
#define PG_MAX_LEVEL
Definition: riscv.h:35
unsigned int riscv_get_dmi_address_bits(const struct target *target)
Definition: riscv.c:6192
bool riscv_supports_extension(const struct target *target, char letter)
Definition: riscv.c:6108
void select_dmi_via_bscan(struct jtag_tap *tap)
Definition: riscv.c:319
int riscv_read_by_any_size(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
Read one memory item using any memory access size that will work.
Definition: riscv.c:1579
void riscv_semihosting_init(struct target *target)
Initialize RISC-V semihosting.
int riscv_halt(struct target *target)
Definition: riscv.c:2716
riscv_mem_access_method
Definition: riscv.h:55
@ RISCV_MEM_ACCESS_MAX_METHODS_NUM
Definition: riscv.h:59
@ RISCV_MEM_ACCESS_SYSBUS
Definition: riscv.h:57
@ RISCV_MEM_ACCESS_PROGBUF
Definition: riscv.h:56
@ RISCV_MEM_ACCESS_ABSTRACT
Definition: riscv.h:58
int riscv_write_by_any_size(struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer)
Write one memory item using any memory access size that will work.
Definition: riscv.c:1547
unsigned int riscv_vlenb(const struct target *target)
Definition: riscv.c:6127
int riscv_get_hart_state(struct target *target, enum riscv_hart_state *state)
Definition: riscv.c:6133
riscv_hart_state
Definition: riscv.h:87
@ RISCV_STATE_RUNNING
Definition: riscv.h:89
@ RISCV_STATE_UNAVAILABLE
Definition: riscv.h:91
@ RISCV_STATE_NON_EXISTENT
Definition: riscv.h:88
@ RISCV_STATE_HALTED
Definition: riscv.h:90
struct target_type riscv013_target
Definition: riscv-013.c:5126
bool riscv_virt2phys_mode_is_hw(const struct target *target)
Definition: riscv.c:144
COMMAND_HELPER(riscv_print_info_line, const char *section, const char *key, unsigned int value)
Definition: riscv.c:5402
unsigned int riscv_progbuf_size(struct target *target)
Definition: riscv.c:6150
#define RISCV_MAX_HWBPS
Definition: riscv.h:21
enum semihosting_result riscv_semihosting(struct target *target, int *retval)
Check for and process a semihosting request using the ARM protocol).
#define RISCV_MAX_TRIGGERS
Definition: riscv.h:20
uint8_t bscan_tunnel_ir_width
Definition: riscv.c:60
struct scan_field * bscan_tunneled_select_dmi
riscv_priv_mode
Definition: riscv.h:369
@ RISCV_MODE_M
Definition: riscv.h:370
@ RISCV_MODE_U
Definition: riscv.h:372
@ N_RISCV_MODE
Definition: riscv.h:375
@ RISCV_MODE_VU
Definition: riscv.h:374
@ RISCV_MODE_VS
Definition: riscv.h:373
@ RISCV_MODE_S
Definition: riscv.h:371
struct scan_field select_dtmcontrol
Definition: riscv.c:43
void riscv_fill_dmi_write(const struct target *target, uint8_t *buf, uint32_t a, uint32_t d)
Definition: riscv.c:6174
uint64_t riscv_reg_t
Definition: riscv.h:45
int dtmcs_scan(struct jtag_tap *tap, uint32_t out, uint32_t *in_ptr)
Definition: riscv.c:416
const char * riscv_virt2phys_mode_to_str(enum riscv_virt2phys_mode mode)
Definition: riscv.c:158
int riscv_openocd_poll(struct target *target)
Definition: riscv.c:4020
int riscv_add_watchpoint(struct target *target, struct watchpoint *watchpoint)
Definition: riscv.c:1735
#define RISCV_COMMON_MAGIC
Definition: riscv.h:18
uint32_t riscv_get_dmi_address(const struct target *target, uint32_t dm_address)
Definition: riscv.c:4653
static bool riscv_mem_access_is_write(const struct riscv_mem_access_args args)
Definition: riscv.h:160
int riscv_write_progbuf(struct target *target, unsigned int index, riscv_insn_t insn)
Definition: riscv.c:6156
riscv_insn_t riscv_read_progbuf(struct target *target, int index)
Definition: riscv.c:6162
bscan_tunnel_type_t
Definition: riscv.h:440
@ BSCAN_TUNNEL_NESTED_TAP
Definition: riscv.h:440
@ BSCAN_TUNNEL_DATA_REGISTER
Definition: riscv.h:440
void riscv_fill_dm_nop(const struct target *target, uint8_t *buf)
Definition: riscv.c:6186
static bool riscv_mem_access_is_read(const struct riscv_mem_access_args args)
Definition: riscv.h:153
void riscv_fill_dmi_read(const struct target *target, uint8_t *buf, uint32_t a)
Definition: riscv.c:6180
int riscv_execute_progbuf(struct target *target, uint32_t *cmderr)
Definition: riscv.c:6168
static struct riscv_private_config * riscv_private_config(const struct target *target)
Definition: riscv.h:383
bool riscv_virt2phys_mode_is_sw(const struct target *target)
Definition: riscv.c:151
yes_no_maybe
Definition: riscv.h:49
@ YNM_YES
Definition: riscv.h:51
@ YNM_MAYBE
Definition: riscv.h:50
@ YNM_NO
Definition: riscv.h:52
int riscv_remove_watchpoint(struct target *target, struct watchpoint *watchpoint)
Definition: riscv.c:1755
uint32_t riscv_insn_t
Definition: riscv.h:46
riscv_halt_reason
Definition: riscv.h:70
@ RISCV_HALT_INTERRUPT
Definition: riscv.h:71
@ RISCV_HALT_SINGLESTEP
Definition: riscv.h:73
@ RISCV_HALT_EBREAK
Definition: riscv.h:72
@ RISCV_HALT_UNKNOWN
Definition: riscv.h:75
@ RISCV_HALT_ERROR
Definition: riscv.h:77
@ RISCV_HALT_GROUP
Definition: riscv.h:76
@ RISCV_HALT_TRIGGER
Definition: riscv.h:74
int riscv_get_command_timeout_sec(void)
Definition: riscv.c:179
int riscv_enumerate_triggers(struct target *target)
Count triggers, and initialize trigger_count for each hart.
Definition: riscv.c:6277
uint64_t riscv_addr_t
Definition: riscv.h:47
int riscv_openocd_step(struct target *target, bool current, target_addr_t address, bool handle_breakpoints)
Definition: riscv.c:4291
riscv_virt2phys_mode
Definition: riscv.h:62
@ RISCV_VIRT2PHYS_MODE_HW
Definition: riscv.h:63
@ RISCV_VIRT2PHYS_MODE_OFF
Definition: riscv.h:65
@ RISCV_VIRT2PHYS_MODE_SW
Definition: riscv.h:64
riscv_isrmasking_mode
Definition: riscv.h:80
@ RISCV_ISRMASK_OFF
Definition: riscv.h:82
@ RISCV_ISRMASK_STEPONLY
Definition: riscv.h:84
struct target * target
Definition: rtt/rtt.c:26
semihosting_result
Definition: jtag.h:101
Definition: list.h:41
char * name
Definition: riscv.h:121
uint16_t high
Definition: riscv.h:120
char ** reg_names
Definition: riscv.h:132
unsigned int num_entries
Definition: riscv.h:131
int(* on_step)(struct target *target)
Definition: riscv.h:274
bool(* get_impebreak)(const struct target *target)
Definition: riscv.h:291
void * version_specific
Definition: riscv.h:173
int(* tick)(struct target *target)
Definition: riscv.h:267
int(* dmi_read)(struct target *target, uint32_t *value, uint32_t address)
Definition: riscv.h:288
struct reg_data_type_vector vector_uint8
Definition: riscv.h:315
enum target_event halted_callback_event
Definition: riscv.h:240
int(* select_target)(struct target *target)
Definition: riscv.h:247
enum riscv_virt2phys_mode virt2phys_mode
Definition: riscv.h:225
struct reg_data_type type_uint64_vector
Definition: riscv.h:323
unsigned int trigger_tinfo[RISCV_MAX_TRIGGERS]
Definition: riscv.h:198
struct reg_data_type type_uint16_vector
Definition: riscv.h:321
bool wp_allow_equality_match_trigger
Definition: riscv.h:362
struct list_head expose_custom
Definition: riscv.h:346
struct reg_data_type_vector vector_uint16
Definition: riscv.h:316
struct list_head * wp_triggers_negative_cache
Definition: riscv.h:195
int(* handle_became_unavailable)(struct target *target, enum riscv_hart_state previous_riscv_state)
Definition: riscv.h:262
int(* halt_go)(struct target *target)
Definition: riscv.h:273
struct reg_data_type type_vector
Definition: riscv.h:327
int tinfo_version
Definition: riscv.h:201
int(* handle_became_halted)(struct target *target, enum riscv_hart_state previous_riscv_state)
Definition: riscv.h:258
struct reg_data_type_union_field vector_fields[5]
Definition: riscv.h:325
unsigned int(* get_progbufsize)(const struct target *target)
Definition: riscv.h:292
int64_t trigger_unique_id[RISCV_MAX_HWBPS]
Definition: riscv.h:218
riscv_insn_t(* read_progbuf)(struct target *target, unsigned int index)
Definition: riscv.h:277
bool selected
Definition: riscv.h:236
bool * reserved_triggers
Definition: riscv.h:329
bool triggers_enumerated
Definition: riscv.h:227
int xlen
Definition: riscv.h:179
struct reg_data_type type_uint128_vector
Definition: riscv.h:324
unsigned int vlenb
Definition: riscv.h:186
bool prepped
Definition: riscv.h:234
unsigned int num_enabled_mem_access_methods
Definition: riscv.h:334
enum riscv_isrmasking_mode isrmask_mode
Definition: riscv.h:243
int(* handle_became_running)(struct target *target, enum riscv_hart_state previous_riscv_state)
Definition: riscv.h:260
unsigned int(* get_dmi_address_bits)(const struct target *target)
Definition: riscv.h:280
int(* authdata_write)(struct target *target, uint32_t value, unsigned int index)
Definition: riscv.h:286
int(* write_progbuf)(struct target *target, unsigned int index, riscv_insn_t d)
Definition: riscv.h:276
int64_t last_activity
Definition: riscv.h:356
unsigned int dtm_version
Definition: riscv.h:170
struct reg_name_table custom_register_names
Definition: riscv.h:175
int(* execute_progbuf)(struct target *target, uint32_t *cmderr)
Definition: riscv.h:278
unsigned int halt_group_repoll_count
Definition: riscv.h:241
unsigned int(* data_bits)(struct target *target)
Definition: riscv.h:307
struct list_head expose_csr
Definition: riscv.h:342
bool halted_needs_event_callback
Definition: riscv.h:239
struct reg_data_type type_uint32_vector
Definition: riscv.h:322
int(* resume_prep)(struct target *target)
Definition: riscv.h:271
int(* halt_prep)(struct target *target)
Definition: riscv.h:272
int64_t trigger_hit
Definition: riscv.h:222
int reset_delays_wait
Definition: riscv.h:231
enum yes_no_maybe vsew64_supported
Definition: riscv.h:358
int(* dmi_write)(struct target *target, uint32_t address, uint32_t value)
Definition: riscv.h:289
bool autofence
Definition: riscv.h:366
void(* fill_dmi_write)(const struct target *target, uint8_t *buf, uint32_t a, uint32_t d)
Definition: riscv.h:281
riscv_reg_t misa
Definition: riscv.h:181
void(* fill_dmi_read)(const struct target *target, uint8_t *buf, uint32_t a)
Definition: riscv.h:282
riscv_sample_config_t sample_config
Definition: riscv.h:352
COMMAND_HELPER((*print_info), struct target *target)
bool range_trigger_fallback_encountered
Definition: riscv.h:360
unsigned int common_magic
Definition: riscv.h:168
bool mem_access_warn[RISCV_MEM_ACCESS_MAX_METHODS_NUM]
Definition: riscv.h:338
int(* sample_memory)(struct target *target, struct riscv_sample_buf *buf, riscv_sample_config_t *config, int64_t until_ms)
Definition: riscv.h:300
int(* authdata_read)(struct target *target, uint32_t *value, unsigned int index)
Definition: riscv.h:285
int(* access_memory)(struct target *target, const struct riscv_mem_access_args args)
Definition: riscv.h:305
uint32_t(* get_dmi_address)(const struct target *target, uint32_t dm_address)
Definition: riscv.h:298
struct reg_data_type type_uint8_vector
Definition: riscv.h:320
bool wp_allow_ge_lt_trigger
Definition: riscv.h:364
int(* get_hart_state)(struct target *target, enum riscv_hart_state *state)
Definition: riscv.h:248
riscv_reg_info_t shared_reg_info
Definition: riscv.h:312
struct reg_data_type_vector vector_uint32
Definition: riscv.h:317
struct riscv_sample_buf sample_buf
Definition: riscv.h:353
char ** reg_names
Definition: riscv.h:176
struct reg_data_type_union vector_union
Definition: riscv.h:326
unsigned int trigger_count
Definition: riscv.h:189
int(* step_current_hart)(struct target *target)
Definition: riscv.h:253
struct reg_data_type_vector vector_uint64
Definition: riscv.h:318
struct command_context * cmd_ctx
Definition: riscv.h:172
void(* fill_dm_nop)(const struct target *target, uint8_t *buf)
Definition: riscv.h:283
enum riscv_halt_reason(* halt_reason)(struct target *target)
Definition: riscv.h:275
int(* invalidate_cached_progbuf)(struct target *target)
Definition: riscv.h:279
enum riscv_mem_access_method mem_access_methods[RISCV_MEM_ACCESS_MAX_METHODS_NUM]
Definition: riscv.h:332
bool wp_allow_napot_trigger
Definition: riscv.h:363
struct list_head hide_csr
Definition: riscv.h:350
bool need_single_step
Definition: riscv.h:209
struct reg_data_type_vector vector_uint128
Definition: riscv.h:319
int(* resume_go)(struct target *target)
Definition: riscv.h:252
uint32_t increment
Definition: riscv.h:143
uint8_t * read_buffer
Definition: riscv.h:139
const uint8_t * write_buffer
Definition: riscv.h:138
target_addr_t address
Definition: riscv.h:136
uint32_t count
Definition: riscv.h:142
bool dcsr_ebreak_fields[N_RISCV_MODE]
Definition: riscv.h:379
struct target * target
Definition: riscv.h:96
unsigned int custom_number
Definition: riscv.h:98
unsigned int size
Definition: riscv.h:106
uint8_t * buf
Definition: riscv.h:104
unsigned int used
Definition: riscv.h:105
target_addr_t address
Definition: riscv.h:113
This structure defines a single scan field in the scan.
Definition: jtag.h:87
This holds methods shared between all instances of a given target type.
Definition: target_type.h:27
Definition: target.h:119
void * private_config
Definition: target.h:175
void * arch_info
Definition: target.h:174
unsigned int pte_shift
Definition: riscv.h:402
const char * name
Definition: riscv.h:398
unsigned int va_bits
Definition: riscv.h:400
target_event
Definition: target.h:253
uint64_t target_addr_t
Definition: types.h:279
static struct ublast_lowlevel low
uint8_t state[4]
Definition: vdebug.c:21