drivers/jtag_vpi: Group adapter commands

Use a command group 'jtag_vpi' with subcommands instead of individual
commands with 'jtag_vpi_' prefix.

The old commands are still available for backward compatibility but
marked as deprecated.

Change-Id: Ie1fcc2cc138796d27f1e862692bb9ef8b11bc10d
Signed-off-by: Marc Schink <dev@zapb.de>
Reviewed-on: http://openocd.zylin.com/6398
Tested-by: jenkins
Reviewed-by: Jan Matyas <matyas@codasip.com>
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
This commit is contained in:
Marc Schink 2021-07-30 18:39:27 +02:00 committed by Antonio Borneo
parent e57ffd84b8
commit b421d2a4c5
2 changed files with 33 additions and 4 deletions

View File

@ -640,23 +640,23 @@ COMMAND_HANDLER(jtag_vpi_stop_sim_on_exit_handler)
return ERROR_OK;
}
static const struct command_registration jtag_vpi_command_handlers[] = {
static const struct command_registration jtag_vpi_subcommand_handlers[] = {
{
.name = "jtag_vpi_set_port",
.name = "set_port",
.handler = &jtag_vpi_set_port,
.mode = COMMAND_CONFIG,
.help = "set the port of the VPI server",
.usage = "tcp_port_num",
},
{
.name = "jtag_vpi_set_address",
.name = "set_address",
.handler = &jtag_vpi_set_address,
.mode = COMMAND_CONFIG,
.help = "set the address of the VPI server",
.usage = "ipv4_addr",
},
{
.name = "jtag_vpi_stop_sim_on_exit",
.name = "stop_sim_on_exit",
.handler = &jtag_vpi_stop_sim_on_exit_handler,
.mode = COMMAND_CONFIG,
.help = "Configure if simulation stop command shall be sent "
@ -666,6 +666,17 @@ static const struct command_registration jtag_vpi_command_handlers[] = {
COMMAND_REGISTRATION_DONE
};
static const struct command_registration jtag_vpi_command_handlers[] = {
{
.name = "jtag_vpi",
.mode = COMMAND_ANY,
.help = "perform jtag_vpi management",
.chain = jtag_vpi_subcommand_handlers,
.usage = "",
},
COMMAND_REGISTRATION_DONE
};
static struct jtag_interface jtag_vpi_interface = {
.supported = DEBUG_CAP_TMS_SEQ,
.execute_queue = jtag_vpi_execute_queue,

View File

@ -321,6 +321,24 @@ proc jtag_dpi_set_address args {
eval jtag_dpi set_address $args
}
lappend _telnet_autocomplete_skip jtag_vpi_set_port
proc jtag_vpi_set_port args {
echo "DEPRECATED! use 'jtag_vpi set_port' not 'jtag_vpi_set_port'"
eval jtag_vpi set_port $args
}
lappend _telnet_autocomplete_skip jtag_vpi_set_address
proc jtag_vpi_set_address args {
echo "DEPRECATED! use 'jtag_vpi set_address' not 'jtag_vpi_set_address'"
eval jtag_vpi set_address $args
}
lappend _telnet_autocomplete_skip jtag_vpi_stop_sim_on_exit
proc jtag_vpi_stop_sim_on_exit args {
echo "DEPRECATED! use 'jtag_vpi stop_sim_on_exit' not 'jtag_vpi_stop_sim_on_exit'"
eval jtag_vpi stop_sim_on_exit $args
}
lappend _telnet_autocomplete_skip presto_serial
proc presto_serial args {
echo "DEPRECATED! use 'presto serial' not 'presto_serial'"