This is an automated email from Gerrit. "Daniel Anselmi <danse...@gmx.ch>" just uploaded a new patch set to Gerrit, which you can find at https://review.openocd.org/c/openocd/+/8873
-- gerrit commit beffce0455777e9060e3bfebb4be0287a9624efc Author: Daniel Anselmi <danse...@gmx.ch> Date: Sat Dec 28 02:22:51 2024 +0100 ipdbg: simplify command chains simplify ipdbg commands: ipdbg create-hub -> create-ipdbg-hub $hub_name ipdbg start -> $hub_name start Change-Id: I5a56df2dbf2a5710442242727fa9384e5541ed53 Signed-off-by: Daniel Anselmi <danse...@gmx.ch> diff --git a/doc/openocd.texi b/doc/openocd.texi index e0bdd5ca09..bc219d9d68 100644 --- a/doc/openocd.texi +++ b/doc/openocd.texi @@ -12448,8 +12448,8 @@ control-software. The JTAG-Hub is the circuit which transfers the data from JTAG different tools connected to the Hub. Hub implementations for most major FPGA vendors/families are provided. For more details see @url{http://ipdbg.org}. -@deffn {Command} {ipdbg create-hub} @var{hub_name} @option{-tap @var{tapname}} @option{-ir @var{ir_value} [@var{dr_length}]} [@option{-vir [@var{vir_value} [@var{length} [@var{instr_code}]]]}] -@deffnx {Command} {ipdbg create-hub} @var{hub_name} @option{-pld @var{pld_name} [@var{user}]} [@option{-vir [@var{vir_value} [@var{length} [@var{instr_code}]]]}] +@deffn {Command} {create-ipdbg-hub} @var{hub_name} @option{-tap @var{tapname}} @option{-ir @var{ir_value} [@var{dr_length}]} [@option{-vir [@var{vir_value} [@var{length} [@var{instr_code}]]]}] +@deffnx {Command} {create-ipdbg-hub} @var{hub_name} @option{-pld @var{pld_name} [@var{user}]} [@option{-vir [@var{vir_value} [@var{length} [@var{instr_code}]]]}] Creates a IPDBG JTAG Hub. The created hub is later used to start, stop and configure IPDBG JTAG Host servers. The first argument @var{hub_name} is the name of the created hub. It can be used later as a reference. @@ -12486,7 +12486,7 @@ If your device/vendor is not supported you have to use the first variant. @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. Command options: @@ -12496,7 +12496,7 @@ Command options: @end itemize @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. Command options: @itemize @bullet @@ -12506,22 +12506,22 @@ Command options: Examples: @example -ipdbg create-hub xc6s.ipdbghub -tap xc6s.tap -hub 0x02 -xc6s.ipdbghub ipdbg start -port 4242 -tool 4 +create-ipdbg-hub xc6s.ipdbghub -tap xc6s.tap -hub 0x02 +xc6s.ipdbghub start -port 4242 -tool 4 @end example 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). @example -ipdbg create-hub max10m50.ipdbghub -tap max10m50.tap -hub 0x00C -vir -max10m50.ipdbghub ipdbg start -tool 1 -port 60000 +create-ipdbg-hub max10m50.ipdbghub -tap max10m50.tap -hub 0x00C -vir +max10m50.ipdbghub start -tool 1 -port 60000 @end example 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). @example -ipdbg create-hub xc7.ipdbghub -pld xc7.pld -xc7.ipdbghub ipdbg start -port 5555 -tool 0 +create-ipdbg-hub xc7.ipdbghub -pld xc7.pld +xc7.ipdbghub start -port 5555 -tool 0 @end example 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. diff --git a/src/jtag/startup.tcl b/src/jtag/startup.tcl index 2d8ebf0410..0a8cae2a20 100644 --- a/src/jtag/startup.tcl +++ b/src/jtag/startup.tcl @@ -1178,7 +1178,7 @@ proc "pld device" {driver tap_name {opt 0}} { lappend _telnet_autocomplete_skip "ipdbg -start" proc "ipdbg -start" {args} { - echo "DEPRECATED! use 'ipdbg create-hub' and 'chip.ipdbghub ipdbg start ...', not 'ipdbg -start ...'" + echo "DEPRECATED! use 'create-ipdbg-hub' and 'chip.ipdbghub start ...', not 'ipdbg -start ...'" set tap_name "" set pld_name "" set tool_num "1" @@ -1244,17 +1244,14 @@ proc "ipdbg -start" {args} { return } - echo "name: $hub_name" - echo "ipdbg create-hub $hub_name $args" + catch {eval create-ipdbg-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" 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 pld_name "" set tool_num "1" @@ -1301,7 +1298,11 @@ proc "ipdbg -stop" {args} { 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 diff --git a/src/server/ipdbg.c b/src/server/ipdbg.c index 859fdb035e..023b5f426f 100644 --- a/src/server/ipdbg.c +++ b/src/server/ipdbg.c @@ -885,23 +885,6 @@ COMMAND_HANDLER(handle_ipdbg_stop_command) 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) { if (!hub) @@ -944,13 +927,18 @@ COMMAND_HANDLER(handle_ipdbg_cfg_queuing_command) static const struct command_registration ipdbg_hub_subcommand_handlers[] = { { - .name = "ipdbg", + .name = "start", .mode = COMMAND_EXEC, - .help = "IPDBG Hub commands.", - .usage = "", - .chain = ipdbg_hostserver_subcommand_handlers - }, - { + .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" + }, { .name = "queuing", .handler = handle_ipdbg_cfg_queuing_command, .mode = COMMAND_ANY, @@ -1129,29 +1117,18 @@ COMMAND_HANDLER(handle_ipdbg_create_hub_command) return ipdbg_create_hub(tap, user_instruction, data_register_length, virtual_ir, hub_name, cmd); } -static const struct command_registration ipdbg_config_command_handlers[] = { +static const struct command_registration ipdbg_command_handlers[] = { { - .name = "create-hub", + .name = "create-ipdbg-hub", .mode = COMMAND_ANY, .handler = handle_ipdbg_create_hub_command, - .help = "create a IPDBG Hub", + .help = "Creating IPDBG Hub", .usage = "name.ipdbghub (-tap device.tap -ir ir_value [dr_length] |" " -pld name.pld [user]) [-vir [vir_value [length [instr_code]]]]", }, COMMAND_REGISTRATION_DONE }; -static const struct command_registration ipdbg_command_handlers[] = { - { - .name = "ipdbg", - .mode = COMMAND_ANY, - .help = "IPDBG Hub/Host commands.", - .usage = "", - .chain = ipdbg_config_command_handlers, - }, - COMMAND_REGISTRATION_DONE -}; - int ipdbg_register_commands(struct command_context *cmd_ctx) { return register_commands(cmd_ctx, NULL, ipdbg_command_handlers); diff --git a/tcl/board/bemicro_cycloneiii.cfg b/tcl/board/bemicro_cycloneiii.cfg index 3c92b500c1..be56c5f7ab 100644 --- a/tcl/board/bemicro_cycloneiii.cfg +++ b/tcl/board/bemicro_cycloneiii.cfg @@ -17,8 +17,8 @@ source [find fpga/altera-cycloneiii.cfg] #quartus_cpf --option=bitstream_compression=off -c output_files\cycloneiii_blinker.sof 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" -# "cycloneiii.ipdbghub ipdbg start -tool 0 -port 5555" +# "create-ipdbg-hub cycloneiii.ipdbghub -tap cycloneiii.tap -ir 0x00e" +# "cycloneiii.ipdbghub start -tool 0 -port 5555" set JTAGSPI_CHAIN_ID cycloneiii.pld diff --git a/tcl/board/digilent_cmod_s7.cfg b/tcl/board/digilent_cmod_s7.cfg index 4fa45a17a7..b98885ec06 100644 --- a/tcl/board/digilent_cmod_s7.cfg +++ b/tcl/board/digilent_cmod_s7.cfg @@ -15,8 +15,8 @@ adapter speed 10000 source [find cpld/xilinx-xc7.cfg] -# "ipdbg create-hub xc7.ipdbghub -tap xc7.tap -ir 0x02" -# "xc7.ipdbghub ipdbg start -tool 0 -port 5555" +# "create-ipdbg-hub xc7.ipdbghub -tap xc7.tap -ir 0x02" +# "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" set JTAGSPI_CHAIN_ID xc7.pld diff --git a/tcl/board/ecp5_evaluation.cfg b/tcl/board/ecp5_evaluation.cfg index 71769f6074..301f3b7a99 100644 --- a/tcl/board/ecp5_evaluation.cfg +++ b/tcl/board/ecp5_evaluation.cfg @@ -16,8 +16,8 @@ adapter speed 6000 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" -#ipdbg create-hub ecp5.ipdbghub -tap ecp5.tap -ir 0x32 -#ecp5.ipdbghub ipdbg start -tool 0 -port 5555 +#create-ipdbg-hub ecp5.ipdbghub -tap ecp5.tap -ir 0x32 +#ecp5.ipdbghub start -tool 0 -port 5555 set JTAGSPI_CHAIN_ID ecp5.pld source [find cpld/jtagspi.cfg] diff --git a/tcl/board/gowin_runber.cfg b/tcl/board/gowin_runber.cfg index 6cb07362b9..24169e6b13 100644 --- a/tcl/board/gowin_runber.cfg +++ b/tcl/board/gowin_runber.cfg @@ -16,5 +16,5 @@ source [find fpga/gowin_gw1n.cfg] #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 -#gw1n.ipdbghubipdbg start -tool 0 -port 5555 +#create-ipdbg-hub gw1n.ipdbghub -tap gw1n.tap -ir 0x42 +#gw1n.ipdbghubipdbg -tool 0 -port 5555 diff --git a/tcl/board/trion_t20_bga256.cfg b/tcl/board/trion_t20_bga256.cfg index ca44f0b8ce..2884cc089e 100644 --- a/tcl/board/trion_t20_bga256.cfg +++ b/tcl/board/trion_t20_bga256.cfg @@ -20,8 +20,8 @@ adapter speed 6000 source [find fpga/efinix_trion.cfg] #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 -#trion.ipdbghub ipdbg start -tool 0 -port 5555 +#create-ipdbg-hub trion.ipdbghub -tap trion.tap -ir 0x8 +#trion.ipdbghub start -tool 0 -port 5555 set JTAGSPI_CHAIN_ID trion.pld source [find cpld/jtagspi.cfg] --