OpenOCD
|
Go to the source code of this file.
Macros | |
#define | BIT_MASK(x) ((1 << (x)) - 1) |
#define | CONTROL_FC (1<<3) /* Flow Control */ |
#define | CONTROL_FMT(x) (((x) << 4) & 0x30) /* Format */ |
#define | CONTROL_PCB(x) (((x) << 10) & 0x7c00) /* PC Bits */ |
#define | CONTROL_SP (1<<1) /* Stop */ |
#define | CONTROL_ST (1<<0) /* Start */ |
#define | CONTROL_W (1<<2) /* Wrap */ |
#define | STATUS_O (1<<3) /* Overflow */ |
#define | STATUS_T (1<<0) /* Trace Started */ |
#define | STATUS_TD (1<<1) /* Trace Disabled */ |
#define | STATUS_W (1<<2) /* Wrapped */ |
#define | TRIGGER_DSP (1<<15) /* Delay Start */ |
#define | TRIGGER_DST (1<<7) /* Delay Start */ |
#define | TRIGGER_TSP(x) (((x) << 8) & 0xf00) /* Trigger Stop */ |
#define | TRIGGER_TST(x) (((x) << 0) & 0xf) /* Trigger Start */ |
Functions | |
COMMAND_HANDLER (handle_esirisc_trace_analyze_command) | |
COMMAND_HANDLER (handle_esirisc_trace_buffer_command) | |
COMMAND_HANDLER (handle_esirisc_trace_dump_command) | |
COMMAND_HANDLER (handle_esirisc_trace_fifo_command) | |
COMMAND_HANDLER (handle_esirisc_trace_flow_control_command) | |
COMMAND_HANDLER (handle_esirisc_trace_format_command) | |
COMMAND_HANDLER (handle_esirisc_trace_info_command) | |
COMMAND_HANDLER (handle_esirisc_trace_init_command) | |
COMMAND_HANDLER (handle_esirisc_trace_start_command) | |
COMMAND_HANDLER (handle_esirisc_trace_status_command) | |
COMMAND_HANDLER (handle_esirisc_trace_stop_command) | |
COMMAND_HANDLER (handle_esirisc_trace_trigger_delay_command) | |
COMMAND_HANDLER (handle_esirisc_trace_trigger_start_command) | |
COMMAND_HANDLER (handle_esirisc_trace_trigger_stop_command) | |
static int | esirisc_trace_analyze (struct command_invocation *cmd, uint8_t *buffer, uint32_t size) |
static int | esirisc_trace_analyze_buffer (struct command_invocation *cmd) |
static int | esirisc_trace_analyze_full (struct command_invocation *cmd, uint8_t *buffer, uint32_t size) |
static int | esirisc_trace_analyze_memory (struct command_invocation *cmd, target_addr_t address, uint32_t size) |
static int | esirisc_trace_analyze_simple (struct command_invocation *cmd, uint8_t *buffer, uint32_t size) |
static int | esirisc_trace_buf_get_pc (struct target *target, uint8_t *buffer, uint32_t size, unsigned *pos, uint32_t *value) |
static int | esirisc_trace_buf_get_u32 (uint8_t *buffer, uint32_t size, unsigned *pos, unsigned count, uint32_t *value) |
static int | esirisc_trace_clear_status (struct target *target) |
static int | esirisc_trace_dump (struct command_invocation *cmd, const char *filename, uint8_t *buffer, uint32_t size) |
static int | esirisc_trace_dump_buffer (struct command_invocation *cmd, const char *filename) |
static int | esirisc_trace_dump_memory (struct command_invocation *cmd, const char *filename, target_addr_t address, uint32_t size) |
static int | esirisc_trace_get_status (struct target *target, uint32_t *status) |
static int | esirisc_trace_init (struct target *target) |
static int | esirisc_trace_read_buffer (struct target *target, uint8_t *buffer) |
static int | esirisc_trace_read_memory (struct target *target, target_addr_t address, uint32_t size, uint8_t *buffer) |
static int | esirisc_trace_start (struct target *target) |
static int | esirisc_trace_stop (struct target *target) |
Variables | |
static const struct command_registration | esirisc_trace_any_command_handlers [] |
const struct command_registration | esirisc_trace_command_handlers [] |
static const char *const | esirisc_trace_delay_strings [] |
static const struct command_registration | esirisc_trace_exec_command_handlers [] |
static const char *const | esirisc_trace_ext_id_strings [] |
static const char *const | esirisc_trace_format_strings [] |
static const char *const | esirisc_trace_id_strings [] |
static const struct command_registration | esirisc_trace_trigger_any_command_handlers [] |
static const char *const | esirisc_trace_trigger_strings [] |
#define BIT_MASK | ( | x | ) | ((1 << (x)) - 1) |
Definition at line 21 of file esirisc_trace.c.
#define CONTROL_FC (1<<3) /* Flow Control */ |
Definition at line 27 of file esirisc_trace.c.
#define CONTROL_FMT | ( | x | ) | (((x) << 4) & 0x30) /* Format */ |
Definition at line 28 of file esirisc_trace.c.
#define CONTROL_PCB | ( | x | ) | (((x) << 10) & 0x7c00) /* PC Bits */ |
Definition at line 29 of file esirisc_trace.c.
#define CONTROL_SP (1<<1) /* Stop */ |
Definition at line 25 of file esirisc_trace.c.
#define CONTROL_ST (1<<0) /* Start */ |
Definition at line 24 of file esirisc_trace.c.
#define CONTROL_W (1<<2) /* Wrap */ |
Definition at line 26 of file esirisc_trace.c.
#define STATUS_O (1<<3) /* Overflow */ |
Definition at line 35 of file esirisc_trace.c.
#define STATUS_T (1<<0) /* Trace Started */ |
Definition at line 32 of file esirisc_trace.c.
#define STATUS_TD (1<<1) /* Trace Disabled */ |
Definition at line 33 of file esirisc_trace.c.
#define STATUS_W (1<<2) /* Wrapped */ |
Definition at line 34 of file esirisc_trace.c.
#define TRIGGER_DSP (1<<15) /* Delay Start */ |
Definition at line 41 of file esirisc_trace.c.
#define TRIGGER_DST (1<<7) /* Delay Start */ |
Definition at line 39 of file esirisc_trace.c.
#define TRIGGER_TSP | ( | x | ) | (((x) << 8) & 0xf00) /* Trigger Stop */ |
Definition at line 40 of file esirisc_trace.c.
#define TRIGGER_TST | ( | x | ) | (((x) << 0) & 0xf) /* Trigger Start */ |
Definition at line 38 of file esirisc_trace.c.
COMMAND_HANDLER | ( | handle_esirisc_trace_analyze_command | ) |
Definition at line 784 of file esirisc_trace.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ADDRESS, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, esirisc_trace_analyze_buffer(), esirisc_trace_analyze_memory(), esirisc_trace_is_fifo(), get_current_target(), esirisc_common::has_trace, size, target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_buffer_command | ) |
Definition at line 854 of file esirisc_trace.c.
References esirisc_trace::buffer_end, esirisc_trace::buffer_start, esirisc_trace::buffer_wrap, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ADDRESS, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), size, target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_dump_command | ) |
Definition at line 822 of file esirisc_trace.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ADDRESS, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, esirisc_trace_dump_buffer(), esirisc_trace_dump_memory(), esirisc_trace_is_fifo(), get_current_target(), esirisc_common::has_trace, size, target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_fifo_command | ) |
Definition at line 879 of file esirisc_trace.c.
References esirisc_trace::buffer_end, esirisc_trace::buffer_start, esirisc_trace::buffer_wrap, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_ADDRESS, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, get_current_target(), target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_flow_control_command | ) |
Definition at line 897 of file esirisc_trace.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, esirisc_trace::flow_control, get_current_target(), target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_format_command | ) |
Definition at line 916 of file esirisc_trace.c.
References CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ESIRISC_TRACE_FORMAT_BRANCH, ESIRISC_TRACE_FORMAT_FULL, ESIRISC_TRACE_FORMAT_ICACHE, esirisc_trace::format, get_current_target(), esirisc_trace::pc_bits, target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_info_command | ) |
Definition at line 679 of file esirisc_trace.c.
References esirisc_trace::buffer_end, esirisc_trace::buffer_start, esirisc_trace::buffer_wrap, CMD, CMD_CTX, command_print(), esirisc_trace::delay, esirisc_trace::delay_cycles, ERROR_FAIL, ERROR_OK, esirisc_trace_delay_strings, esirisc_trace_format_strings, esirisc_trace_is_fifo(), esirisc_trace_trigger_strings, esirisc_trace::flow_control, esirisc_trace::format, get_current_target(), esirisc_common::has_trace, esirisc_trace::pc_bits, esirisc_trace::start_data, esirisc_trace::start_mask, esirisc_trace::start_trigger, esirisc_trace::stop_data, esirisc_trace::stop_mask, esirisc_trace::stop_trigger, TARGET_PRIxADDR, target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_init_command | ) |
Definition at line 662 of file esirisc_trace.c.
References CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_init(), get_current_target(), esirisc_common::has_trace, and target_to_esirisc().
COMMAND_HANDLER | ( | handle_esirisc_trace_start_command | ) |
Definition at line 750 of file esirisc_trace.c.
References CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_start(), get_current_target(), esirisc_common::has_trace, and target_to_esirisc().
COMMAND_HANDLER | ( | handle_esirisc_trace_status_command | ) |
Definition at line 726 of file esirisc_trace.c.
References CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_get_status(), get_current_target(), esirisc_common::has_trace, status, STATUS_O, STATUS_T, STATUS_TD, STATUS_W, and target_to_esirisc().
COMMAND_HANDLER | ( | handle_esirisc_trace_stop_command | ) |
Definition at line 767 of file esirisc_trace.c.
References CMD, CMD_CTX, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_stop(), get_current_target(), esirisc_common::has_trace, and target_to_esirisc().
COMMAND_HANDLER | ( | handle_esirisc_trace_trigger_delay_command | ) |
Definition at line 1029 of file esirisc_trace.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, esirisc_trace::delay, esirisc_trace::delay_cycles, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ESIRISC_TRACE_DELAY_BOTH, ESIRISC_TRACE_DELAY_NONE, ESIRISC_TRACE_DELAY_START, ESIRISC_TRACE_DELAY_STOP, get_current_target(), target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_trigger_start_command | ) |
Definition at line 947 of file esirisc_trace.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ESIRISC_TRACE_TRIGGER_ERET, ESIRISC_TRACE_TRIGGER_EXCEPTION, ESIRISC_TRACE_TRIGGER_HIGH, ESIRISC_TRACE_TRIGGER_LOAD, ESIRISC_TRACE_TRIGGER_LOW, ESIRISC_TRACE_TRIGGER_NONE, ESIRISC_TRACE_TRIGGER_PC, ESIRISC_TRACE_TRIGGER_STOP, ESIRISC_TRACE_TRIGGER_STORE, ESIRISC_TRACE_TRIGGER_WAIT, get_current_target(), esirisc_trace::start_data, esirisc_trace::start_mask, esirisc_trace::start_trigger, target_to_esirisc(), and esirisc_common::trace_info.
COMMAND_HANDLER | ( | handle_esirisc_trace_trigger_stop_command | ) |
Definition at line 990 of file esirisc_trace.c.
References CMD_ARGC, CMD_ARGV, CMD_CTX, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, ESIRISC_TRACE_TRIGGER_ERET, ESIRISC_TRACE_TRIGGER_EXCEPTION, ESIRISC_TRACE_TRIGGER_LOAD, ESIRISC_TRACE_TRIGGER_NONE, ESIRISC_TRACE_TRIGGER_PC, ESIRISC_TRACE_TRIGGER_STOP, ESIRISC_TRACE_TRIGGER_STORE, ESIRISC_TRACE_TRIGGER_WAIT, get_current_target(), esirisc_trace::stop_data, esirisc_trace::stop_mask, esirisc_trace::stop_trigger, target_to_esirisc(), and esirisc_common::trace_info.
|
static |
Definition at line 507 of file esirisc_trace.c.
References buffer, cmd, command_print(), ERROR_FAIL, esirisc_trace_analyze_full(), esirisc_trace_analyze_simple(), ESIRISC_TRACE_FORMAT_BRANCH, ESIRISC_TRACE_FORMAT_FULL, ESIRISC_TRACE_FORMAT_ICACHE, esirisc_trace::format, get_current_target(), size, target_to_esirisc(), and esirisc_common::trace_info.
Referenced by esirisc_trace_analyze_buffer(), and esirisc_trace_analyze_memory().
|
static |
Definition at line 532 of file esirisc_trace.c.
References buffer, cmd, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_analyze(), esirisc_trace_buffer_size(), esirisc_trace_read_buffer(), get_current_target(), size, target_to_esirisc(), and esirisc_common::trace_info.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 377 of file esirisc_trace.c.
References buffer, cmd, command_print(), count, ERROR_BUF_TOO_SMALL, ERROR_FAIL, ERROR_OK, esirisc_trace_buf_get_pc(), esirisc_trace_buf_get_u32(), ESIRISC_TRACE_EXT_ID_COUNT, ESIRISC_TRACE_EXT_ID_END, ESIRISC_TRACE_EXT_ID_END_PC, ESIRISC_TRACE_EXT_ID_ERET, ESIRISC_TRACE_EXT_ID_EXCEPTION, ESIRISC_TRACE_EXT_ID_INDIRECT, ESIRISC_TRACE_EXT_ID_MULTICYCLE, ESIRISC_TRACE_EXT_ID_PC, ESIRISC_TRACE_EXT_ID_STOP, esirisc_trace_ext_id_strings, ESIRISC_TRACE_EXT_ID_WAIT, ESIRISC_TRACE_ID_BRANCH, ESIRISC_TRACE_ID_EXECUTE, ESIRISC_TRACE_ID_EXTENDED, ESIRISC_TRACE_ID_STALL, esirisc_trace_id_strings, get_current_target(), id, and size.
Referenced by esirisc_trace_analyze().
|
static |
Definition at line 560 of file esirisc_trace.c.
References buffer, cmd, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_analyze(), esirisc_trace_read_memory(), get_current_target(), and size.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 478 of file esirisc_trace.c.
References BIT_MASK, buffer, cmd, command_print(), ERROR_BUF_TOO_SMALL, ERROR_OK, esirisc_trace_buf_get_pc(), get_current_target(), esirisc_trace::pc_bits, size, target_to_esirisc(), and esirisc_common::trace_info.
Referenced by esirisc_trace_analyze().
|
static |
Definition at line 303 of file esirisc_trace.c.
References buffer, ERROR_OK, esirisc_trace_buf_get_u32(), esirisc_common::num_bits, esirisc_trace::pc_bits, size, target_to_esirisc(), and esirisc_common::trace_info.
Referenced by esirisc_trace_analyze_full(), and esirisc_trace_analyze_simple().
|
static |
Definition at line 289 of file esirisc_trace.c.
References buf_get_u32(), buffer, count, ERROR_FAIL, ERROR_OK, and size.
Referenced by esirisc_trace_analyze_full(), and esirisc_trace_buf_get_pc().
|
static |
Definition at line 77 of file esirisc_trace.c.
References CSR_TRACE, CSR_TRACE_STATUS, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_jtag_write_csr(), esirisc_common::jtag_info, LOG_ERROR, target::state, TARGET_HALTED, target_name(), and target_to_esirisc().
Referenced by esirisc_trace_init().
|
static |
Definition at line 585 of file esirisc_trace.c.
References buffer, cmd, command_print(), ERROR_OK, FILEIO_BINARY, fileio_close(), fileio_open(), fileio_write(), FILEIO_WRITE, and size.
Referenced by esirisc_trace_dump_buffer(), and esirisc_trace_dump_memory().
|
static |
Definition at line 609 of file esirisc_trace.c.
References buffer, cmd, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_buffer_size(), esirisc_trace_dump(), esirisc_trace_read_buffer(), get_current_target(), size, target_to_esirisc(), and esirisc_common::trace_info.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 637 of file esirisc_trace.c.
References buffer, cmd, command_print(), ERROR_FAIL, ERROR_OK, esirisc_trace_dump(), esirisc_trace_read_memory(), get_current_target(), and size.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 95 of file esirisc_trace.c.
References CSR_TRACE, CSR_TRACE_STATUS, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_jtag_read_csr(), esirisc_common::jtag_info, LOG_ERROR, target::state, status, TARGET_HALTED, target_name(), and target_to_esirisc().
Referenced by COMMAND_HANDLER(), and esirisc_trace_read_buffer().
|
static |
Definition at line 166 of file esirisc_trace.c.
References esirisc_trace::buffer_end, esirisc_trace::buffer_start, esirisc_trace::buffer_wrap, CONTROL_FC, CONTROL_FMT, CONTROL_PCB, CONTROL_W, CSR_TRACE, CSR_TRACE_BUFFER_CUR, CSR_TRACE_BUFFER_END, CSR_TRACE_BUFFER_START, CSR_TRACE_CONTROL, CSR_TRACE_DELAY, CSR_TRACE_START_DATA, CSR_TRACE_START_MASK, CSR_TRACE_STOP_DATA, CSR_TRACE_STOP_MASK, CSR_TRACE_TRIGGER, esirisc_trace::delay, esirisc_trace::delay_cycles, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_jtag_write_csr(), esirisc_trace_clear_status(), ESIRISC_TRACE_DELAY_BOTH, ESIRISC_TRACE_DELAY_START, ESIRISC_TRACE_DELAY_STOP, esirisc_trace_stop(), esirisc_trace::flow_control, esirisc_trace::format, esirisc_common::jtag_info, LOG_ERROR, esirisc_trace::pc_bits, esirisc_trace::start_data, esirisc_trace::start_mask, esirisc_trace::start_trigger, target::state, esirisc_trace::stop_data, esirisc_trace::stop_mask, esirisc_trace::stop_trigger, TARGET_HALTED, target_name(), target_to_esirisc(), esirisc_common::trace_info, TRIGGER_DSP, TRIGGER_DST, TRIGGER_TSP, and TRIGGER_TST.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 336 of file esirisc_trace.c.
References buffer, esirisc_trace::buffer_end, esirisc_trace::buffer_start, CSR_TRACE, CSR_TRACE_BUFFER_CUR, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_jtag_read_csr(), esirisc_trace_get_status(), esirisc_trace_read_memory(), esirisc_common::jtag_info, LOG_ERROR, size, target::state, status, STATUS_W, TARGET_HALTED, target_name(), target_to_esirisc(), and esirisc_common::trace_info.
Referenced by esirisc_trace_analyze_buffer(), and esirisc_trace_dump_buffer().
|
static |
Definition at line 319 of file esirisc_trace.c.
References buffer, ERROR_OK, ERROR_TARGET_NOT_HALTED, LOG_ERROR, size, target::state, TARGET_HALTED, target_name(), and target_read_memory().
Referenced by esirisc_trace_analyze_memory(), esirisc_trace_dump_memory(), and esirisc_trace_read_buffer().
|
static |
Definition at line 112 of file esirisc_trace.c.
References CONTROL_ST, CSR_TRACE, CSR_TRACE_CONTROL, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_jtag_read_csr(), esirisc_jtag_write_csr(), esirisc_common::jtag_info, LOG_ERROR, target::state, TARGET_HALTED, target_name(), and target_to_esirisc().
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 139 of file esirisc_trace.c.
References CONTROL_SP, CSR_TRACE, CSR_TRACE_CONTROL, ERROR_OK, ERROR_TARGET_NOT_HALTED, esirisc_jtag_read_csr(), esirisc_jtag_write_csr(), esirisc_common::jtag_info, LOG_ERROR, target::state, TARGET_HALTED, target_name(), and target_to_esirisc().
Referenced by COMMAND_HANDLER(), and esirisc_trace_init().
|
static |
Definition at line 1029 of file esirisc_trace.c.
const struct command_registration esirisc_trace_command_handlers[] |
Definition at line 1029 of file esirisc_trace.c.
|
static |
Definition at line 43 of file esirisc_trace.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 1029 of file esirisc_trace.c.
|
static |
Definition at line 58 of file esirisc_trace.c.
Referenced by esirisc_trace_analyze_full().
|
static |
Definition at line 47 of file esirisc_trace.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 51 of file esirisc_trace.c.
Referenced by esirisc_trace_analyze_full().
|
static |
Definition at line 1029 of file esirisc_trace.c.
|
static |
Definition at line 72 of file esirisc_trace.c.
Referenced by COMMAND_HANDLER().