ipdbg: simplify command chains

simplify ipdbg commands:
$hub_name ipdbg start -> $hub_name start

ipdbg/fix: While there, handle the multi-word deprecated commands
by adding quotes.

Change-Id: I5a56df2dbf2a5710442242727fa9384e5541ed53
Signed-off-by: Daniel Anselmi <danselmi@gmx.ch>
Fixes: https://sourceforge.net/p/openocd/tickets/434/
Reported-by: Evgeniy Naydanov <evgeniy.naydanov@syntacore.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8873
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
This commit is contained in:
Daniel Anselmi
2024-12-28 02:22:51 +01:00
committed by Antonio Borneo
parent 1afb3e75f0
commit 52ea420dd2
8 changed files with 29 additions and 41 deletions

View File

@@ -12675,7 +12675,7 @@ If your device/vendor is not supported you have to use the first variant.
@end deffn @end deffn
@deffn {Command} {$hub_name ipdbg start} @option{-tool @var{number}} @option{-port @var{number}} @deffn {Command} {$hub_name start} @option{-tool @var{number}} @option{-port @var{number}}
Starts a IPDBG JTAG-Host server. The remaining arguments can be specified in any order. Starts a IPDBG JTAG-Host server. The remaining arguments can be specified in any order.
Command options: Command options:
@@ -12685,7 +12685,7 @@ Command options:
@end itemize @end itemize
@end deffn @end deffn
@deffn {Command} {$hub_name ipdbg stop} @option{-tool @var{number}} @deffn {Command} {$hub_name stop} @option{-tool @var{number}}
Stops a IPDBG JTAG-Host server. Stops a IPDBG JTAG-Host server.
Command options: Command options:
@itemize @bullet @itemize @bullet
@@ -12696,21 +12696,21 @@ Command options:
Examples: Examples:
@example @example
ipdbg create-hub xc6s.ipdbghub -tap xc6s.tap -hub 0x02 ipdbg create-hub xc6s.ipdbghub -tap xc6s.tap -hub 0x02
xc6s.ipdbghub ipdbg start -port 4242 -tool 4 xc6s.ipdbghub start -port 4242 -tool 4
@end example @end example
Creates a IPDBG Hub and starts a server listening on tcp-port 4242 which connects to tool 4. Creates a IPDBG Hub and starts a server listening on tcp-port 4242 which connects to tool 4.
The connection is through the TAP of a Xilinx Spartan 6 on USER1 instruction (tested with a papillion pro board). The connection is through the TAP of a Xilinx Spartan 6 on USER1 instruction (tested with a papillion pro board).
@example @example
ipdbg create-hub max10m50.ipdbghub -tap max10m50.tap -hub 0x00C -vir ipdbg create-hub max10m50.ipdbghub -tap max10m50.tap -hub 0x00C -vir
max10m50.ipdbghub ipdbg start -tool 1 -port 60000 max10m50.ipdbghub start -tool 1 -port 60000
@end example @end example
Starts a server listening on tcp-port 60000 which connects to tool 1 (data_up_1/data_down_1). Starts a server listening on tcp-port 60000 which connects to tool 1 (data_up_1/data_down_1).
The connection is through the TAP of a Intel MAX10 virtual jtag component (sld_instance_index is 0; sld_ir_width is smaller than 5). The connection is through the TAP of a Intel MAX10 virtual jtag component (sld_instance_index is 0; sld_ir_width is smaller than 5).
@example @example
ipdbg create-hub xc7.ipdbghub -pld xc7.pld ipdbg create-hub xc7.ipdbghub -pld xc7.pld
xc7.ipdbghub ipdbg start -port 5555 -tool 0 xc7.ipdbghub start -port 5555 -tool 0
@end example @end example
Starts a server listening on tcp-port 5555 which connects to tool 0 (data_up_0/data_down_0). Starts a server listening on tcp-port 5555 which connects to tool 0 (data_up_0/data_down_0).
The TAP and ir value used to reach the JTAG Hub is given by the pld driver. The TAP and ir value used to reach the JTAG Hub is given by the pld driver.

View File

@@ -1205,7 +1205,7 @@ proc "pld device" {driver tap_name {opt 0}} {
lappend _telnet_autocomplete_skip "ipdbg -start" lappend _telnet_autocomplete_skip "ipdbg -start"
proc "ipdbg -start" {args} { proc "ipdbg -start" {args} {
echo "DEPRECATED! use 'ipdbg create-hub' and 'chip.ipdbghub ipdbg start ...', not 'ipdbg -start ...'" echo "DEPRECATED! use 'ipdbg create-hub' and 'chip.ipdbghub start ...', not 'ipdbg -start ...'"
set tap_name "" set tap_name ""
set pld_name "" set pld_name ""
set tool_num "1" set tool_num "1"
@@ -1271,17 +1271,14 @@ proc "ipdbg -start" {args} {
return return
} }
echo "name: $hub_name"
echo "ipdbg create-hub $hub_name $args"
catch {eval ipdbg create-hub $hub_name $args} catch {eval ipdbg create-hub $hub_name $args}
eval $hub_name ipdbg start -tool $tool_num -port $port_num eval $hub_name start -tool $tool_num -port $port_num
} }
lappend _telnet_autocomplete_skip "ipdbg -stop" lappend _telnet_autocomplete_skip "ipdbg -stop"
proc "ipdbg -stop" {args} { proc "ipdbg -stop" {args} {
echo "DEPRECATED! use 'chip.ipdbghub ipdbg stop ...', not 'ipdbg -stop ...'" echo "DEPRECATED! use 'chip.ipdbghub stop ...', not 'ipdbg -stop ...'"
set tap_name "" set tap_name ""
set pld_name "" set pld_name ""
set tool_num "1" set tool_num "1"
@@ -1328,7 +1325,11 @@ proc "ipdbg -stop" {args} {
return return
} }
eval $hub_name ipdbg stop -tool $tool_num eval $hub_name stop -tool $tool_num
}
proc ipdbg {cmd args} {
tailcall "ipdbg $cmd" {*}$args
} }
# END MIGRATION AIDS # END MIGRATION AIDS

View File

@@ -885,23 +885,6 @@ COMMAND_HANDLER(handle_ipdbg_stop_command)
return ipdbg_stop(hub, tool); return ipdbg_stop(hub, tool);
} }
static const struct command_registration ipdbg_hostserver_subcommand_handlers[] = {
{
.name = "start",
.mode = COMMAND_EXEC,
.handler = handle_ipdbg_start_command,
.help = "Starts a IPDBG Host server.",
.usage = "-tool number -port port"
}, {
.name = "stop",
.mode = COMMAND_EXEC,
.handler = handle_ipdbg_stop_command,
.help = "Stops a IPDBG Host server.",
.usage = "-tool number"
},
COMMAND_REGISTRATION_DONE
};
static COMMAND_HELPER(ipdbg_config_queuing, struct ipdbg_hub *hub, unsigned int size) static COMMAND_HELPER(ipdbg_config_queuing, struct ipdbg_hub *hub, unsigned int size)
{ {
if (!hub) if (!hub)
@@ -944,13 +927,18 @@ COMMAND_HANDLER(handle_ipdbg_cfg_queuing_command)
static const struct command_registration ipdbg_hub_subcommand_handlers[] = { static const struct command_registration ipdbg_hub_subcommand_handlers[] = {
{ {
.name = "ipdbg", .name = "start",
.mode = COMMAND_EXEC, .mode = COMMAND_EXEC,
.help = "IPDBG Hub commands.", .handler = handle_ipdbg_start_command,
.usage = "", .help = "Starts a IPDBG Host server.",
.chain = ipdbg_hostserver_subcommand_handlers .usage = "-tool number -port port"
}, }, {
{ .name = "stop",
.mode = COMMAND_EXEC,
.handler = handle_ipdbg_stop_command,
.help = "Stops a IPDBG Host server.",
.usage = "-tool number"
}, {
.name = "queuing", .name = "queuing",
.handler = handle_ipdbg_cfg_queuing_command, .handler = handle_ipdbg_cfg_queuing_command,
.mode = COMMAND_ANY, .mode = COMMAND_ANY,
@@ -1151,7 +1139,6 @@ static const struct command_registration ipdbg_command_handlers[] = {
}, },
COMMAND_REGISTRATION_DONE COMMAND_REGISTRATION_DONE
}; };
int ipdbg_register_commands(struct command_context *cmd_ctx) int ipdbg_register_commands(struct command_context *cmd_ctx)
{ {
return register_commands(cmd_ctx, NULL, ipdbg_command_handlers); return register_commands(cmd_ctx, NULL, ipdbg_command_handlers);

View File

@@ -18,7 +18,7 @@ source [find fpga/altera-cycloneiii.cfg]
#openocd -f board/bemicro_cycloneiii.cfg -c "init" -c "pld load cycloneiii.pld cycloneiii_blinker.rbf" #openocd -f board/bemicro_cycloneiii.cfg -c "init" -c "pld load cycloneiii.pld cycloneiii_blinker.rbf"
# "ipdbg create-hub cycloneiii.ipdbghub -tap cycloneiii.tap -ir 0x00e" # "ipdbg create-hub cycloneiii.ipdbghub -tap cycloneiii.tap -ir 0x00e"
# "cycloneiii.ipdbghub ipdbg start -tool 0 -port 5555" # "cycloneiii.ipdbghub start -tool 0 -port 5555"
set JTAGSPI_CHAIN_ID cycloneiii.pld set JTAGSPI_CHAIN_ID cycloneiii.pld

View File

@@ -16,7 +16,7 @@ adapter speed 10000
source [find cpld/xilinx-xc7.cfg] source [find cpld/xilinx-xc7.cfg]
# "ipdbg create-hub xc7.ipdbghub -tap xc7.tap -ir 0x02" # "ipdbg create-hub xc7.ipdbghub -tap xc7.tap -ir 0x02"
# "xc7.ipdbghub ipdbg start -tool 0 -port 5555" # "xc7.ipdbghub start -tool 0 -port 5555"
#openocd -f board/digilent_cmod_s7.cfg -c "init" -c "pld load xc7.pld shared_folder/cmod_s7_fast.bit" #openocd -f board/digilent_cmod_s7.cfg -c "init" -c "pld load xc7.pld shared_folder/cmod_s7_fast.bit"
set JTAGSPI_CHAIN_ID xc7.pld set JTAGSPI_CHAIN_ID xc7.pld

View File

@@ -17,7 +17,7 @@ source [find fpga/lattice_ecp5.cfg]
#openocd -f board/ecp5_evaluation.cfg -c "init" -c "pld load ecp5.pld shared_folder/ecp5_blinker_impl1.bit" #openocd -f board/ecp5_evaluation.cfg -c "init" -c "pld load ecp5.pld shared_folder/ecp5_blinker_impl1.bit"
#ipdbg create-hub ecp5.ipdbghub -tap ecp5.tap -ir 0x32 #ipdbg create-hub ecp5.ipdbghub -tap ecp5.tap -ir 0x32
#ecp5.ipdbghub ipdbg start -tool 0 -port 5555 #ecp5.ipdbghub start -tool 0 -port 5555
set JTAGSPI_CHAIN_ID ecp5.pld set JTAGSPI_CHAIN_ID ecp5.pld
source [find cpld/jtagspi.cfg] source [find cpld/jtagspi.cfg]

View File

@@ -17,4 +17,4 @@ source [find fpga/gowin_gw1n.cfg]
#openocd -f board/gowin_runber.cfg -c "init" -c "pld load 0 impl/pnr/gw1n_blinker.fs" #openocd -f board/gowin_runber.cfg -c "init" -c "pld load 0 impl/pnr/gw1n_blinker.fs"
#ipdbg create-hub gw1n.ipdbghub -tap gw1n.tap -ir 0x42 #ipdbg create-hub gw1n.ipdbghub -tap gw1n.tap -ir 0x42
#gw1n.ipdbghubipdbg start -tool 0 -port 5555 #gw1n.ipdbghub start -tool 0 -port 5555

View File

@@ -21,7 +21,7 @@ source [find fpga/efinix_trion.cfg]
#openocd -f board/trion_t20_bga256.cfg -c "init" -c "pld load trion.pld outflow/trion_blinker.bit" #openocd -f board/trion_t20_bga256.cfg -c "init" -c "pld load trion.pld outflow/trion_blinker.bit"
#ipdbg create-hub trion.ipdbghub -tap trion.tap -ir 0x8 #ipdbg create-hub trion.ipdbghub -tap trion.tap -ir 0x8
#trion.ipdbghub ipdbg start -tool 0 -port 5555 #trion.ipdbghub start -tool 0 -port 5555
set JTAGSPI_CHAIN_ID trion.pld set JTAGSPI_CHAIN_ID trion.pld
source [find cpld/jtagspi.cfg] source [find cpld/jtagspi.cfg]