OpenOCD
|
Go to the source code of this file.
Data Structures | |
struct | vpi_cmd |
Macros | |
#define | CMD_RESET 0 |
#define | CMD_SCAN_CHAIN 2 |
#define | CMD_SCAN_CHAIN_FLIP_TMS 3 |
#define | CMD_STOP_SIMU 4 |
#define | CMD_TMS_SEQ 1 |
#define | DEFAULT_SERVER_ADDRESS "127.0.0.1" |
#define | DEFAULT_SERVER_PORT 5555 |
#define | NO_TAP_SHIFT 0 |
#define | TAP_SHIFT 1 |
#define | XFERT_MAX_SIZE 512 |
Functions | |
COMMAND_HANDLER (jtag_vpi_set_address) | |
COMMAND_HANDLER (jtag_vpi_set_port) | |
COMMAND_HANDLER (jtag_vpi_stop_sim_on_exit_handler) | |
static int | jtag_vpi_clock_tms (int tms) |
jtag_vpi_clock_tms - clock a TMS transition More... | |
static char * | jtag_vpi_cmd_to_str (int cmd_num) |
static int | jtag_vpi_execute_queue (struct jtag_command *cmd_queue) |
static int | jtag_vpi_init (void) |
static int | jtag_vpi_path_move (struct pathmove_command *cmd) |
jtag_vpi_path_move - ask a TMS sequence transition to JTAG More... | |
static int | jtag_vpi_queue_tdi (uint8_t *bits, int nb_bits, int tap_shift) |
jtag_vpi_queue_tdi - short description More... | |
static int | jtag_vpi_queue_tdi_xfer (uint8_t *bits, int nb_bits, int tap_shift) |
static int | jtag_vpi_quit (void) |
static int | jtag_vpi_receive_cmd (struct vpi_cmd *vpi) |
static int | jtag_vpi_reset (int trst, int srst) |
jtag_vpi_reset - ask to reset the JTAG device More... | |
static int | jtag_vpi_runtest (unsigned int num_cycles, tap_state_t state) |
static int | jtag_vpi_scan (struct scan_command *cmd) |
jtag_vpi_scan - launches a DR-scan or IR-scan More... | |
static int | jtag_vpi_send_cmd (struct vpi_cmd *vpi) |
static int | jtag_vpi_stableclocks (unsigned int num_cycles) |
static int | jtag_vpi_state_move (tap_state_t state) |
static int | jtag_vpi_stop_simulation (void) |
static int | jtag_vpi_tms (struct tms_command *cmd) |
jtag_vpi_tms - ask a tms command More... | |
static int | jtag_vpi_tms_seq (const uint8_t *bits, int nb_bits) |
jtag_vpi_tms_seq - ask a TMS sequence transition to JTAG More... | |
Variables | |
struct adapter_driver | jtag_vpi_adapter_driver |
static const struct command_registration | jtag_vpi_command_handlers [] |
static struct jtag_interface | jtag_vpi_interface |
static const struct command_registration | jtag_vpi_subcommand_handlers [] |
static struct sockaddr_in | serv_addr |
static char * | server_address |
static int | server_port = DEFAULT_SERVER_PORT |
static int | sockfd |
static bool | stop_sim_on_exit |
#define CMD_RESET 0 |
Definition at line 35 of file jtag_vpi.c.
#define CMD_SCAN_CHAIN 2 |
Definition at line 37 of file jtag_vpi.c.
#define CMD_SCAN_CHAIN_FLIP_TMS 3 |
Definition at line 38 of file jtag_vpi.c.
#define CMD_STOP_SIMU 4 |
Definition at line 39 of file jtag_vpi.c.
#define CMD_TMS_SEQ 1 |
Definition at line 36 of file jtag_vpi.c.
#define DEFAULT_SERVER_ADDRESS "127.0.0.1" |
Definition at line 30 of file jtag_vpi.c.
#define DEFAULT_SERVER_PORT 5555 |
Definition at line 31 of file jtag_vpi.c.
#define NO_TAP_SHIFT 0 |
Definition at line 27 of file jtag_vpi.c.
#define TAP_SHIFT 1 |
Definition at line 28 of file jtag_vpi.c.
#define XFERT_MAX_SIZE 512 |
Definition at line 33 of file jtag_vpi.c.
COMMAND_HANDLER | ( | jtag_vpi_set_address | ) |
Definition at line 603 of file jtag_vpi.c.
References CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, LOG_INFO, and server_address.
COMMAND_HANDLER | ( | jtag_vpi_set_port | ) |
Definition at line 592 of file jtag_vpi.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_NUMBER, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, LOG_INFO, and server_port.
COMMAND_HANDLER | ( | jtag_vpi_stop_sim_on_exit_handler | ) |
Definition at line 616 of file jtag_vpi.c.
References CMD_ARGC, CMD_ARGV, COMMAND_PARSE_ON_OFF, ERROR_COMMAND_SYNTAX_ERROR, ERROR_OK, and stop_sim_on_exit.
|
static |
jtag_vpi_clock_tms - clock a TMS transition
tms | the TMS to be sent |
Triggers a TMS transition (ie. one JTAG TAP state move).
Definition at line 369 of file jtag_vpi.c.
References jtag_vpi_tms_seq().
Referenced by jtag_vpi_scan().
|
static |
Definition at line 69 of file jtag_vpi.c.
References CMD_RESET, CMD_SCAN_CHAIN, CMD_SCAN_CHAIN_FLIP_TMS, CMD_STOP_SIMU, and CMD_TMS_SEQ.
Referenced by jtag_vpi_send_cmd().
|
static |
Definition at line 481 of file jtag_vpi.c.
References cmd, ERROR_FAIL, ERROR_OK, JTAG_PATHMOVE, JTAG_RESET, JTAG_RUNTEST, JTAG_SCAN, JTAG_SLEEP, jtag_sleep(), JTAG_STABLECLOCKS, JTAG_TLR_RESET, JTAG_TMS, jtag_vpi_path_move(), jtag_vpi_reset(), jtag_vpi_runtest(), jtag_vpi_scan(), jtag_vpi_stableclocks(), jtag_vpi_state_move(), jtag_vpi_tms(), and LOG_ERROR.
|
static |
Definition at line 525 of file jtag_vpi.c.
References DEFAULT_SERVER_ADDRESS, ERROR_COMMAND_CLOSE_CONNECTION, ERROR_FAIL, ERROR_OK, flag, LOG_ERROR, LOG_INFO, serv_addr, server_address, server_port, and sockfd.
|
static |
jtag_vpi_path_move - ask a TMS sequence transition to JTAG
cmd | path transition |
Write a series of TMS transitions, where each transition consists in :
Definition at line 251 of file jtag_vpi.c.
References buf_set_u32(), cmd, DIV_ROUND_UP, jtag_vpi_tms_seq(), tap_get_state(), tap_set_state, and tap_state_transition().
Referenced by jtag_vpi_execute_queue().
|
static |
jtag_vpi_queue_tdi - short description
bits | bits to be queued on TDI (or NULL if 0 are to be queued) |
nb_bits | number of bits |
tap_shift |
Definition at line 338 of file jtag_vpi.c.
References bits, DIV_ROUND_UP, ERROR_OK, jtag_vpi_queue_tdi_xfer(), vpi_cmd::nb_bits, NO_TAP_SHIFT, and XFERT_MAX_SIZE.
Referenced by jtag_vpi_runtest(), and jtag_vpi_scan().
|
static |
Definition at line 292 of file jtag_vpi.c.
References bits, buf_to_hex_str(), vpi_cmd::buffer_in, vpi_cmd::buffer_out, vpi_cmd::cmd, CMD_SCAN_CHAIN, CMD_SCAN_CHAIN_FLIP_TMS, DEBUG_JTAG_IOZ, DIV_ROUND_UP, ERROR_OK, jtag_vpi_receive_cmd(), jtag_vpi_send_cmd(), vpi_cmd::length, LOG_DEBUG_IO, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, and vpi_cmd::nb_bits.
Referenced by jtag_vpi_queue_tdi().
|
static |
Definition at line 578 of file jtag_vpi.c.
References close_socket(), ERROR_OK, jtag_vpi_stop_simulation(), log_socket_error(), LOG_WARNING, server_address, sockfd, and stop_sim_on_exit.
|
static |
Definition at line 159 of file jtag_vpi.c.
References vpi_cmd::cmd, vpi_cmd::cmd_buf, ERROR_OK, le_to_h_u32(), vpi_cmd::length, vpi_cmd::length_buf, LOG_ERROR, log_socket_error(), vpi_cmd::nb_bits, vpi_cmd::nb_bits_buf, read_socket(), and sockfd.
Referenced by jtag_vpi_queue_tdi_xfer().
|
static |
jtag_vpi_reset - ask to reset the JTAG device
trst | 1 if TRST is to be asserted |
srst | 1 if SRST is to be asserted |
Definition at line 203 of file jtag_vpi.c.
References vpi_cmd::cmd, CMD_RESET, jtag_vpi_send_cmd(), and vpi_cmd::length.
Referenced by jtag_vpi_execute_queue().
|
static |
Definition at line 443 of file jtag_vpi.c.
References ERROR_OK, jtag_vpi_queue_tdi(), jtag_vpi_state_move(), NO_TAP_SHIFT, NULL, state, and TAP_IDLE.
Referenced by jtag_vpi_execute_queue().
|
static |
jtag_vpi_scan - launches a DR-scan or IR-scan
cmd | the command to launch |
Launch a JTAG IR-scan or DR-scan
Returns ERROR_OK if OK, ERROR_xxx if a read/write error occurred.
Definition at line 385 of file jtag_vpi.c.
References cmd, ERROR_OK, jtag_build_buffer(), jtag_read_buffer(), jtag_vpi_clock_tms(), jtag_vpi_queue_tdi(), jtag_vpi_state_move(), NO_TAP_SHIFT, NULL, TAP_DRPAUSE, TAP_DRSHIFT, TAP_IRPAUSE, TAP_IRSHIFT, tap_set_state, and TAP_SHIFT.
Referenced by jtag_vpi_execute_queue().
|
static |
Definition at line 87 of file jtag_vpi.c.
References buf_to_hex_str(), vpi_cmd::buffer_out, vpi_cmd::cmd, vpi_cmd::cmd_buf, DEBUG_JTAG_IOZ, ERROR_OK, h_u32_to_le(), jtag_vpi_cmd_to_str(), vpi_cmd::length, vpi_cmd::length_buf, LOG_DEBUG_IO, LOG_ERROR, LOG_LEVEL_IS, LOG_LVL_DEBUG_IO, log_socket_error(), vpi_cmd::nb_bits, vpi_cmd::nb_bits_buf, sockfd, and write_socket().
Referenced by jtag_vpi_queue_tdi_xfer(), jtag_vpi_reset(), jtag_vpi_stop_simulation(), and jtag_vpi_tms_seq().
|
static |
Definition at line 458 of file jtag_vpi.c.
References ERROR_OK, jtag_vpi_tms_seq(), vpi_cmd::nb_bits, tap_get_state(), and TAP_RESET.
Referenced by jtag_vpi_execute_queue().
|
static |
Definition at line 275 of file jtag_vpi.c.
References ERROR_OK, jtag_vpi_tms_seq(), state, tap_get_state(), tap_get_tms_path(), tap_get_tms_path_len(), and tap_set_state.
Referenced by jtag_vpi_execute_queue(), jtag_vpi_runtest(), and jtag_vpi_scan().
|
static |
Definition at line 568 of file jtag_vpi.c.
References cmd, CMD_STOP_SIMU, and jtag_vpi_send_cmd().
Referenced by jtag_vpi_quit().
|
static |
jtag_vpi_tms - ask a tms command
cmd | tms command |
Definition at line 270 of file jtag_vpi.c.
References cmd, and jtag_vpi_tms_seq().
Referenced by jtag_vpi_execute_queue().
|
static |
jtag_vpi_tms_seq - ask a TMS sequence transition to JTAG
bits | TMS bits to be written (bit0, bit1 .. bitN) |
nb_bits | number of TMS bits (between 1 and 8) |
Write a series of TMS transitions, where each transition consists in :
Definition at line 224 of file jtag_vpi.c.
References bits, vpi_cmd::buffer_out, vpi_cmd::cmd, CMD_TMS_SEQ, DIV_ROUND_UP, jtag_vpi_send_cmd(), vpi_cmd::length, and vpi_cmd::nb_bits.
Referenced by jtag_vpi_clock_tms(), jtag_vpi_path_move(), jtag_vpi_stableclocks(), jtag_vpi_state_move(), and jtag_vpi_tms().
struct adapter_driver jtag_vpi_adapter_driver |
Definition at line 616 of file jtag_vpi.c.
|
static |
Definition at line 616 of file jtag_vpi.c.
|
static |
Definition at line 616 of file jtag_vpi.c.
|
static |
Definition at line 616 of file jtag_vpi.c.
|
static |
Definition at line 48 of file jtag_vpi.c.
Referenced by jtag_vpi_init().
|
static |
Definition at line 43 of file jtag_vpi.c.
Referenced by COMMAND_HANDLER(), jtag_vpi_init(), and jtag_vpi_quit().
|
static |
Definition at line 42 of file jtag_vpi.c.
Referenced by COMMAND_HANDLER(), and jtag_vpi_init().
|
static |
Definition at line 48 of file jtag_vpi.c.
Referenced by jtag_vpi_init(), jtag_vpi_quit(), jtag_vpi_receive_cmd(), and jtag_vpi_send_cmd().
|
static |
Definition at line 46 of file jtag_vpi.c.
Referenced by COMMAND_HANDLER(), and jtag_vpi_quit().