OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | svf_check_tdo_para |
struct | svf_para |
struct | svf_statemove |
struct | svf_xxr_para |
Macros | |
#define | MIN_CHUNK 16 /* Buffer is increased by this size each time as required */ |
#define | SVF_BUF_LOG(_lvl, _buf, _nbits, _desc) svf_hexbuf_print(LOG_LVL_##_lvl, __FILE__, __LINE__, __func__, _buf, _nbits, _desc) |
#define | SVF_CHECK_TDO_PARA_SIZE 1024 |
#define | SVF_MAX_BUFFER_SIZE_TO_COMMIT (1024 * 1024) |
#define | SVF_MAX_NUM_OF_OPTIONS 5 |
#define | SVF_MIN_NUM_OF_OPTIONS 1 |
#define | SVFP_CMD_INC_CNT 1024 |
#define | XXR_MASK (1 << 2) |
#define | XXR_SMASK (1 << 3) |
#define | XXR_TDI (1 << 0) |
#define | XXR_TDO (1 << 1) |
Enumerations | |
enum | svf_command { ENDDR , ENDIR , FREQUENCY , HDR , HIR , PIO , PIOMAP , RUNTEST , SDR , SIR , STATE , TDR , TIR , TRST } |
enum | trst_mode { TRST_ON , TRST_OFF , TRST_Z , TRST_ABSENT } |
Functions | |
COMMAND_HANDLER (handle_svf_command) | |
static int | svf_add_check_para (uint8_t enabled, int buffer_offset, int bit_len) |
int | svf_add_statemove (tap_state_t state_to) |
svf_add_statemove() moves from the current state to goal_state. More... | |
static int | svf_adjust_array_length (uint8_t **arr, int orig_bit_len, int new_bit_len) |
static int | svf_check_tdo (void) |
static int | svf_copy_hexstring_to_binary (char *str, uint8_t **bin, int orig_bit_len, int bit_len) |
static int | svf_execute_tap (void) |
static int | svf_find_string_in_array (char *str, char **strs, int num_of_element) |
static void | svf_free_xxd_para (struct svf_xxr_para *para) |
static int | svf_getline (char **lineptr, size_t *n, FILE *stream) |
static void | svf_hexbuf_print (int dbg_lvl, const char *file, unsigned line, const char *function, const uint8_t *buf, int bit_len, const char *desc) |
static int | svf_parse_cmd_string (char *str, int len, char **argus, int *num_of_argu) |
static int | svf_read_command_from_file (FILE *fd) |
static int | svf_realloc_buffers (size_t len) |
int | svf_register_commands (struct command_context *cmd_ctx) |
static int | svf_run_command (struct command_context *cmd_ctx, char *cmd_str) |
static int | svf_set_padding (struct svf_xxr_para *para, int len, unsigned char tdi) |
bool | svf_tap_state_is_stable (tap_state_t state) |
svf_tap_state_is_stable() returns true for stable non-SHIFT states More... | |
Variables | |
static int | svf_buffer_index |
static int | svf_buffer_size |
static struct svf_check_tdo_para * | svf_check_tdo_para |
static int | svf_check_tdo_para_index |
static char * | svf_command_buffer |
static size_t | svf_command_buffer_size |
static const struct command_registration | svf_command_handlers [] |
static const char * | svf_command_name [14] |
static FILE * | svf_fd |
static int | svf_ignore_error |
static int | svf_last_printed_percentage = -1 |
static int | svf_line_number |
static uint8_t * | svf_mask_buffer |
static int | svf_nil |
static struct svf_para | svf_para |
static const struct svf_para | svf_para_init |
static int | svf_percentage |
static int | svf_progress_enabled |
static int | svf_quiet |
static char * | svf_read_line |
static size_t | svf_read_line_size |
static const struct svf_statemove | svf_statemoves [] |
static int | svf_tap_is_specified |
static uint8_t * | svf_tdi_buffer |
static uint8_t * | svf_tdo_buffer |
static long | svf_total_lines |
static const char * | svf_trst_mode_name [4] |
#define MIN_CHUNK 16 /* Buffer is increased by this size each time as required */ |
#define SVF_BUF_LOG | ( | _lvl, | |
_buf, | |||
_nbits, | |||
_desc | |||
) | svf_hexbuf_print(LOG_LVL_##_lvl, __FILE__, __LINE__, __func__, _buf, _nbits, _desc) |
#define SVF_MAX_NUM_OF_OPTIONS 5 |
#define SVF_MIN_NUM_OF_OPTIONS 1 |
enum svf_command |
COMMAND_HANDLER | ( | handle_svf_command | ) |
Definition at line 343 of file svf.c.
References jtag_tap::abs_chain_position, CMD, CMD_ARGC, CMD_ARGV, CMD_CTX, command_print(), ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, svf_para::hdr_para, svf_para::hir_para, jtag_tap::ir_length, jtag_add_tlr(), jtag_all_taps(), jtag_execute_queue(), jtag_tap_by_string(), LOG_ERROR, LOG_USER, LOG_USER_N, jtag_tap::next_tap, NULL, svf_para::sdr_para, svf_para::sir_para, svf_buffer_index, svf_buffer_size, svf_check_tdo(), svf_check_tdo_para_index, SVF_CHECK_TDO_PARA_SIZE, svf_command_buffer, svf_command_buffer_size, svf_fd, svf_free_xxd_para(), svf_getline(), svf_ignore_error, svf_last_printed_percentage, svf_line_number, svf_mask_buffer, SVF_MAX_BUFFER_SIZE_TO_COMMIT, SVF_MAX_NUM_OF_OPTIONS, SVF_MIN_NUM_OF_OPTIONS, svf_nil, svf_para_init, svf_percentage, svf_progress_enabled, svf_quiet, svf_read_command_from_file(), svf_read_line, svf_realloc_buffers(), svf_run_command(), svf_set_padding(), svf_tap_is_specified, svf_tdi_buffer, svf_tdo_buffer, svf_total_lines, svf_para::tdr_para, timeval_ms(), and svf_para::tir_para.
|
static |
Definition at line 867 of file svf.c.
References svf_check_tdo_para::bit_len, svf_check_tdo_para::buffer_offset, jtag_tap::enabled, svf_check_tdo_para::enabled, ERROR_FAIL, ERROR_OK, svf_check_tdo_para::line_num, LOG_ERROR, svf_check_tdo_para_index, SVF_CHECK_TDO_PARA_SIZE, and svf_line_number.
int svf_add_statemove | ( | tap_state_t | goal_state | ) |
svf_add_statemove() moves from the current state to goal_state.
goal_state | The final TAP state. |
The current and goal states must satisfy svf_tap_state_is_stable(). State transition paths used by this routine are those given in the SVF specification for single-argument STATE commands (and also used for various other state transitions).
Definition at line 309 of file svf.c.
References ARRAY_SIZE, cmd_queue_cur_state, ERROR_FAIL, ERROR_OK, jtag_add_pathmove(), jtag_add_tlr(), LOG_ERROR, svf_nil, svf_statemoves, TAP_RESET, tap_state_name(), and svf_statemove::to.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 749 of file svf.c.
References ERROR_FAIL, ERROR_OK, and LOG_ERROR.
Referenced by svf_copy_hexstring_to_binary(), and svf_set_padding().
|
static |
Definition at line 840 of file svf.c.
References svf_check_tdo_para::bit_len, buf_cmp_mask(), svf_check_tdo_para::buffer_offset, jtag_tap::enabled, ERROR_FAIL, ERROR_OK, LOG_ERROR, SVF_BUF_LOG, svf_check_tdo_para_index, svf_ignore_error, svf_mask_buffer, svf_tdi_buffer, and svf_tdo_buffer.
Referenced by COMMAND_HANDLER(), and svf_execute_tap().
|
static |
Definition at line 777 of file svf.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, and svf_adjust_array_length().
|
static |
Definition at line 883 of file svf.c.
References ERROR_FAIL, ERROR_OK, jtag_execute_queue(), svf_buffer_index, svf_check_tdo(), and svf_nil.
Referenced by svf_realloc_buffers().
|
static |
|
static |
Definition at line 292 of file svf.c.
References svf_xxr_para::mask, NULL, svf_xxr_para::smask, svf_xxr_para::tdi, and svf_xxr_para::tdo.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 574 of file svf.c.
References MIN_CHUNK.
Referenced by COMMAND_HANDLER(), and svf_read_command_from_file().
|
static |
Definition at line 241 of file svf.c.
References svf_check_tdo_para::bit_len, DIV_ROUND_UP, and log_printf_lf().
|
static |
Definition at line 694 of file svf.c.
References ERROR_FAIL, ERROR_OK, and LOG_ERROR.
|
static |
Definition at line 605 of file svf.c.
References ERROR_FAIL, ERROR_OK, LOG_ERROR, svf_command_buffer, svf_command_buffer_size, svf_fd, svf_getline(), svf_line_number, svf_read_line, and svf_read_line_size.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 265 of file svf.c.
References ERROR_FAIL, ERROR_OK, svf_buffer_size, svf_execute_tap(), svf_mask_buffer, svf_tdi_buffer, and svf_tdo_buffer.
Referenced by COMMAND_HANDLER().
int svf_register_commands | ( | struct command_context * | cmd_ctx | ) |
Definition at line 1553 of file svf.c.
References NULL, register_commands(), and svf_command_handlers.
Referenced by jtag_select().
|
static |
Definition at line 895 of file svf.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 764 of file svf.c.
References svf_xxr_para::data_mask, ERROR_OK, svf_xxr_para::len, svf_xxr_para::mask, svf_adjust_array_length(), svf_xxr_para::tdi, svf_xxr_para::tdo, and XXR_TDI.
Referenced by COMMAND_HANDLER().
bool svf_tap_state_is_stable | ( | tap_state_t | state | ) |
svf_tap_state_is_stable() returns true for stable non-SHIFT states
state | The TAP state in question |
Definition at line 732 of file svf.c.
References state, TAP_DRPAUSE, TAP_IDLE, TAP_IRPAUSE, and TAP_RESET.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 219 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_execute_tap().
|
static |
Definition at line 219 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_realloc_buffers().
|
static |
|
static |
Definition at line 201 of file svf.c.
Referenced by COMMAND_HANDLER(), svf_add_check_para(), and svf_check_tdo().
|
static |
Definition at line 212 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_read_command_from_file().
|
static |
Definition at line 213 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_read_command_from_file().
|
static |
Definition at line 895 of file svf.c.
Referenced by svf_register_commands().
|
static |
|
static |
Definition at line 209 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_read_command_from_file().
|
static |
Definition at line 222 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_check_tdo().
|
static |
Definition at line 232 of file svf.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 214 of file svf.c.
Referenced by COMMAND_HANDLER(), svf_add_check_para(), and svf_read_command_from_file().
|
static |
Definition at line 218 of file svf.c.
Referenced by COMMAND_HANDLER(), svf_check_tdo(), and svf_realloc_buffers().
|
static |
Definition at line 221 of file svf.c.
Referenced by COMMAND_HANDLER(), svf_add_statemove(), and svf_execute_tap().
|
static |
|
static |
Definition at line 231 of file svf.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 229 of file svf.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 220 of file svf.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 210 of file svf.c.
Referenced by COMMAND_HANDLER(), and svf_read_command_from_file().
|
static |
Definition at line 211 of file svf.c.
Referenced by svf_read_command_from_file().
|
static |
Definition at line 68 of file svf.c.
Referenced by svf_add_statemove().
|
static |
Definition at line 225 of file svf.c.
Referenced by COMMAND_HANDLER().
|
static |
Definition at line 218 of file svf.c.
Referenced by COMMAND_HANDLER(), svf_check_tdo(), and svf_realloc_buffers().
|
static |
Definition at line 218 of file svf.c.
Referenced by COMMAND_HANDLER(), svf_check_tdo(), and svf_realloc_buffers().
|
static |
Definition at line 230 of file svf.c.
Referenced by COMMAND_HANDLER().