3 #ifndef OPENOCD_TARGET_RISCV_BATCH_H
4 #define OPENOCD_TARGET_RISCV_BATCH_H
31 static inline const char *
34 switch (delay_class) {
38 return "Abstract Command";
40 return "System Bus read";
42 return "System Bus write";
55 #define RISCV_SCAN_DELAY_MAX (INT_MAX / 2)
64 static inline unsigned int
68 switch (delay_class) {
88 switch (delay_class) {
109 const unsigned int delay_step = delay / 10 + 1;
115 LOG_ERROR(
"Delay for %s (%d) is not increased anymore (maximum was reached).",
187 size_t reset_delays_after);
202 read_back, delay_type);
bool riscv_batch_was_batch_busy(const struct riscv_batch *batch)
static int riscv_scan_increase_delay(struct riscv_scan_delays *delays, enum riscv_scan_delay_class delay_class)
uint32_t riscv_batch_get_dmi_read_op(const struct riscv_batch *batch, size_t key)
struct riscv_batch * riscv_batch_alloc(struct target *target, size_t scans)
void riscv_batch_add_nop(struct riscv_batch *batch)
void riscv_batch_add_dmi_write(struct riscv_batch *batch, uint32_t address, uint32_t data, bool read_back, enum riscv_scan_delay_class delay_class)
@ RISCV_DELAY_ABSTRACT_COMMAND
@ RISCV_DELAY_SYSBUS_READ
@ RISCV_DELAY_SYSBUS_WRITE
size_t riscv_batch_available_scans(struct riscv_batch *batch)
static size_t riscv_batch_add_dm_read(struct riscv_batch *batch, uint32_t address, enum riscv_scan_delay_class delay_type)
static void riscv_scan_set_delay(struct riscv_scan_delays *delays, enum riscv_scan_delay_class delay_class, unsigned int delay)
uint32_t riscv_batch_get_dmi_read_data(const struct riscv_batch *batch, size_t key)
size_t riscv_batch_finished_scans(const struct riscv_batch *batch)
#define RISCV_SCAN_DELAY_MAX
static unsigned int riscv_scan_get_delay(const struct riscv_scan_delays *delays, enum riscv_scan_delay_class delay_class)
static void riscv_batch_add_dm_write(struct riscv_batch *batch, uint32_t address, uint32_t data, bool read_back, enum riscv_scan_delay_class delay_type)
@ RISCV_SCAN_TYPE_INVALID
void riscv_batch_free(struct riscv_batch *batch)
size_t riscv_batch_add_dmi_read(struct riscv_batch *batch, uint32_t address, enum riscv_scan_delay_class delay_class)
static const char * riscv_scan_delay_class_name(enum riscv_scan_delay_class delay_class)
int riscv_batch_run_from(struct riscv_batch *batch, size_t start_idx, const struct riscv_scan_delays *delays, bool resets_delays, size_t reset_delays_after)
bool riscv_batch_full(struct riscv_batch *batch)
uint32_t address
Starting address. Sector aligned.
The JTAG interface can be implemented with a software or hardware fifo.
#define LOG_ERROR(expr ...)
#define LOG_DEBUG(expr ...)
uint32_t riscv_get_dmi_address(const struct target *target, uint32_t dm_address)
riscv_bscan_tunneled_scan_context_t * bscan_ctxt
enum riscv_scan_type last_scan
enum riscv_scan_delay_class * delay_classes
unsigned int last_scan_delay
struct scan_field * fields
unsigned int sb_read_delay
unsigned int sb_write_delay
This structure defines a single scan field in the scan.