|
OpenOCD
|

Go to the source code of this file.
Macros | |
| #define | BATCH_RESERVED_SCANS 1 |
| #define | DMI_SCAN_BUF_SIZE (DIV_ROUND_UP(DMI_SCAN_MAX_BIT_LENGTH, 8)) |
| #define | DMI_SCAN_MAX_BIT_LENGTH (DTM_DMI_MAX_ADDRESS_LENGTH + DTM_DMI_DATA_LENGTH + DTM_DMI_OP_LENGTH) |
| #define | DTM_DMI_MAX_ADDRESS_LENGTH ((1<<DTM_DTMCS_ABITS_LENGTH)-1) |
Functions | |
| static void | add_idle_before_batch (const struct riscv_batch *batch, size_t start_idx, const struct riscv_scan_delays *delays) |
| static unsigned int | decode_dmi (const struct riscv_batch *batch, char *text, uint32_t address, uint32_t data) |
| static unsigned int | get_delay (const struct riscv_batch *batch, size_t scan_idx, const struct riscv_scan_delays *delays, bool resets_delays, size_t reset_delays_after) |
| static unsigned int | get_dmi_scan_length (const struct target *target) |
| static void | log_batch (const struct riscv_batch *batch, size_t start_idx, const struct riscv_scan_delays *delays, bool resets_delays, size_t reset_delays_after) |
| static void | log_dmi_decoded (const struct riscv_batch *batch, bool write, uint32_t address, uint32_t data) |
| size_t | riscv_batch_add_dmi_read (struct riscv_batch *batch, uint32_t address, enum riscv_scan_delay_class delay_class) |
| 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) |
| void | riscv_batch_add_nop (struct riscv_batch *batch) |
| struct riscv_batch * | riscv_batch_alloc (struct target *target, size_t scans) |
| size_t | riscv_batch_available_scans (struct riscv_batch *batch) |
| size_t | riscv_batch_finished_scans (const struct riscv_batch *batch) |
| void | riscv_batch_free (struct riscv_batch *batch) |
| bool | riscv_batch_full (struct riscv_batch *batch) |
| uint32_t | riscv_batch_get_dmi_read_data (const struct riscv_batch *batch, size_t key) |
| uint32_t | riscv_batch_get_dmi_read_op (const struct riscv_batch *batch, size_t key) |
| 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_was_batch_busy (const struct riscv_batch *batch) |
| static bool | riscv_batch_was_scan_busy (const struct riscv_batch *batch, size_t scan_idx) |
| #define DMI_SCAN_BUF_SIZE (DIV_ROUND_UP(DMI_SCAN_MAX_BIT_LENGTH, 8)) |
| #define DMI_SCAN_MAX_BIT_LENGTH (DTM_DMI_MAX_ADDRESS_LENGTH + DTM_DMI_DATA_LENGTH + DTM_DMI_OP_LENGTH) |
| #define DTM_DMI_MAX_ADDRESS_LENGTH ((1<<DTM_DTMCS_ABITS_LENGTH)-1) |
|
static |
Definition at line 123 of file batch.c.
References riscv_batch::delay_classes, jtag_add_runtest(), riscv_batch::last_scan_delay, LOG_TARGET_DEBUG, RISCV_DELAY_BASE, riscv_scan_get_delay(), TAP_IDLE, riscv_batch::target, and riscv_batch::was_run.
Referenced by riscv_batch_run_from().
|
static |
Definition at line 158 of file batch.c.
References address, ARRAY_SIZE, description, DM_ABSTRACTCS, DM_ABSTRACTCS_ORDINAL, DM_COMMAND, DM_COMMAND_ORDINAL, DM_DMCONTROL, DM_DMCONTROL_ORDINAL, DM_DMSTATUS, DM_DMSTATUS_ORDINAL, DM_SBCS, DM_SBCS_ORDINAL, RISCV_DEBUG_REG_HIDE_ALL_0, riscv_debug_reg_to_s(), riscv_get_dmi_address(), riscv_batch::target, riscv_debug_reg_ctx::value, and riscv_debug_reg_ctx::XLEN.
Referenced by log_dmi_decoded().
|
static |
Definition at line 144 of file batch.c.
References riscv_batch::delay_classes, and riscv_scan_get_delay().
Referenced by log_batch(), and riscv_batch_run_from().
|
static |
Definition at line 22 of file batch.c.
References DTM_DMI_DATA_LENGTH, DTM_DMI_MAX_ADDRESS_LENGTH, DTM_DMI_OP_LENGTH, and riscv_get_dmi_address_bits().
Referenced by riscv_batch_add_dmi_read(), riscv_batch_add_dmi_write(), and riscv_batch_add_nop().
|
static |
Definition at line 203 of file batch.c.
References riscv_debug_reg_ctx::abits, buf_get_u32(), DTM_DMI_ADDRESS_OFFSET, DTM_DMI_DATA_LENGTH, DTM_DMI_DATA_OFFSET, DTM_DMI_OP_LENGTH, DTM_DMI_OP_OFFSET, DTM_DMI_OP_READ, DTM_DMI_OP_SUCCESS, DTM_DMI_OP_WRITE, riscv_batch::fields, get_delay(), scan_field::in_value, LOG_DEBUG, log_dmi_decoded(), LOG_LEVEL_IS, LOG_LVL_DEBUG, scan_field::num_bits, scan_field::out_value, riscv_get_dmi_address_bits(), riscv_batch::target, and riscv_batch::used_scans.
Referenced by riscv_batch_run_from().
|
static |
Definition at line 189 of file batch.c.
References address, decode_dmi(), LOG_DEBUG, LOG_ERROR, NULL, and size.
Referenced by log_batch().
| size_t riscv_batch_add_dmi_read | ( | struct riscv_batch * | batch, |
| uint32_t | address, | ||
| enum riscv_scan_delay_class | delay_class | ||
| ) |
Definition at line 361 of file batch.c.
References address, riscv_batch::allocated_scans, riscv_batch::data_in, riscv_batch::data_out, riscv_batch::delay_classes, DMI_SCAN_BUF_SIZE, DMI_SCAN_MAX_BIT_LENGTH, riscv_batch::fields, get_dmi_scan_length(), scan_field::in_value, riscv_batch::last_scan, scan_field::num_bits, scan_field::out_value, riscv_batch::read_keys, riscv_batch::read_keys_used, riscv_fill_dm_nop(), riscv_fill_dmi_read(), RISCV_SCAN_TYPE_READ, riscv_batch::target, and riscv_batch::used_scans.
Referenced by dmi_read(), and riscv_batch_add_dm_read().
| 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 | ||
| ) |
Definition at line 331 of file batch.c.
References address, riscv_batch::allocated_scans, riscv_batch::data_in, riscv_batch::data_out, riscv_batch::delay_classes, DMI_SCAN_BUF_SIZE, DMI_SCAN_MAX_BIT_LENGTH, riscv_batch::fields, get_dmi_scan_length(), scan_field::in_value, riscv_batch::last_scan, NULL, scan_field::num_bits, scan_field::out_value, riscv_fill_dm_nop(), riscv_fill_dmi_write(), RISCV_SCAN_TYPE_WRITE, riscv_batch::target, and riscv_batch::used_scans.
Referenced by dmi_write(), and riscv_batch_add_dm_write().
| void riscv_batch_add_nop | ( | struct riscv_batch * | batch | ) |
Definition at line 409 of file batch.c.
References riscv_batch::allocated_scans, riscv_batch::data_in, riscv_batch::data_out, riscv_batch::delay_classes, DMI_SCAN_BUF_SIZE, DMI_SCAN_MAX_BIT_LENGTH, riscv_batch::fields, get_dmi_scan_length(), scan_field::in_value, riscv_batch::last_scan, scan_field::num_bits, scan_field::out_value, RISCV_DELAY_BASE, riscv_fill_dm_nop(), RISCV_SCAN_TYPE_NOP, riscv_batch::target, and riscv_batch::used_scans.
Referenced by batch_run(), and batch_run_timeout().
| struct riscv_batch* riscv_batch_alloc | ( | struct target * | target, |
| size_t | scans | ||
| ) |
Definition at line 31 of file batch.c.
References riscv_batch::allocated_scans, BATCH_RESERVED_SCANS, riscv_batch::bscan_ctxt, bscan_tunnel_ir_width, riscv_batch::data_in, riscv_batch::data_out, riscv_batch::delay_classes, DMI_SCAN_BUF_SIZE, riscv_batch::fields, riscv_batch::last_scan, riscv_batch::last_scan_delay, LOG_ERROR, NULL, riscv_batch::read_keys, riscv_batch_free(), RISCV_SCAN_TYPE_INVALID, target, riscv_batch::target, and riscv_batch::was_run.
Referenced by dm_read_exec(), dmi_read(), dmi_write(), read_abstract_arg(), read_memory_bus_v1(), read_memory_progbuf_inner_try_to_read(), register_write_abstract(), riscv013_execute_abstract_command(), sample_memory_bus_v1(), sb_write_address(), write_memory_bus_v1(), and write_memory_progbuf_try_to_write().
| size_t riscv_batch_available_scans | ( | struct riscv_batch * | batch | ) |
Definition at line 432 of file batch.c.
References riscv_batch::allocated_scans, BATCH_RESERVED_SCANS, and riscv_batch::used_scans.
Referenced by abstract_cmd_fill_batch(), read_memory_progbuf_inner_fill_batch(), riscv_batch_full(), write_memory_bus_v1(), and write_memory_progbuf_fill_batch().
| size_t riscv_batch_finished_scans | ( | const struct riscv_batch * | batch | ) |
Definition at line 446 of file batch.c.
References riscv_batch_was_batch_busy(), riscv_batch_was_scan_busy(), and riscv_batch::used_scans.
Referenced by batch_run_timeout().
| void riscv_batch_free | ( | struct riscv_batch * | batch | ) |
Definition at line 96 of file batch.c.
References riscv_batch::bscan_ctxt, riscv_batch::data_in, riscv_batch::data_out, riscv_batch::delay_classes, riscv_batch::fields, and riscv_batch::read_keys.
Referenced by dm_read_exec(), dmi_read(), dmi_write(), read_abstract_arg(), read_memory_bus_v1(), read_memory_progbuf_inner_try_to_read(), register_write_abstract(), riscv013_execute_abstract_command(), riscv_batch_alloc(), sample_memory_bus_v1(), sb_write_address(), write_memory_bus_v1(), and write_memory_progbuf_try_to_write().
| bool riscv_batch_full | ( | struct riscv_batch * | batch | ) |
Definition at line 107 of file batch.c.
References riscv_batch_available_scans().
| uint32_t riscv_batch_get_dmi_read_data | ( | const struct riscv_batch * | batch, |
| size_t | key | ||
| ) |
Definition at line 399 of file batch.c.
References buf_get_u32(), riscv_batch::data_in, DMI_SCAN_BUF_SIZE, DTM_DMI_DATA_LENGTH, DTM_DMI_DATA_OFFSET, and riscv_batch::read_keys.
Referenced by abstract_cmd_batch_check_and_clear_cmderr(), abstract_data_get_from_batch(), dm_read_exec(), dmi_read(), read_memory_bus_v1(), read_memory_progbuf_inner_extract_batch_data(), and sample_memory_bus_v1().
| uint32_t riscv_batch_get_dmi_read_op | ( | const struct riscv_batch * | batch, |
| size_t | key | ||
| ) |
Definition at line 389 of file batch.c.
References buf_get_u32(), riscv_batch::data_in, DMI_SCAN_BUF_SIZE, DTM_DMI_OP_LENGTH, DTM_DMI_OP_OFFSET, and riscv_batch::read_keys.
Referenced by read_memory_progbuf_inner_extract_batch_data(), and sample_memory_bus_v1().
| 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 | ||
| ) |
Definition at line 278 of file batch.c.
References add_idle_before_batch(), riscv_batch::bscan_ctxt, bscan_tunnel_ir_width, buffer_shr(), DMI_SCAN_BUF_SIZE, ERROR_FAIL, ERROR_OK, riscv_batch::fields, get_delay(), jtag_add_dr_scan(), jtag_add_runtest(), jtag_execute_queue(), keep_alive(), riscv_batch::last_scan, riscv_batch::last_scan_delay, log_batch(), LOG_TARGET_DEBUG, LOG_TARGET_ERROR, riscv_add_bscan_tunneled_scan(), riscv_batch_was_scan_busy(), RISCV_SCAN_TYPE_NOP, target::tap, TAP_IDLE, riscv_batch::target, riscv_batch::used_scans, and riscv_batch::was_run.
Referenced by batch_run(), and batch_run_timeout().
| bool riscv_batch_was_batch_busy | ( | const struct riscv_batch * | batch | ) |
Definition at line 438 of file batch.c.
References riscv_batch::last_scan, riscv_batch_was_scan_busy(), RISCV_SCAN_TYPE_NOP, riscv_batch::used_scans, and riscv_batch::was_run.
Referenced by batch_run(), batch_run_timeout(), riscv_batch_finished_scans(), write_memory_bus_v1(), and write_memory_progbuf_run_batch().
|
static |
Definition at line 112 of file batch.c.
References buf_get_u64(), DTM_DMI_OP, DTM_DMI_OP_BUSY, riscv_batch::fields, get_field(), scan_field::in_value, scan_field::num_bits, riscv_batch::used_scans, and riscv_batch::was_run.
Referenced by riscv_batch_finished_scans(), riscv_batch_run_from(), and riscv_batch_was_batch_busy().