From 9e0ca10a71cf1fc50f6cb6ff824e9e8dfedaedc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Dausseur?= Date: Tue, 18 Feb 2025 15:40:58 +0100 Subject: [PATCH] commands doc corrections. Added a "script" directory for examples. --- bsdl_files/{xilinx => }/xcku15p_ffve1517.bsd | 0 modules/script/script.c | 30 +++++++++----------- scripts/example_script.txt | 4 +++ 3 files changed, 18 insertions(+), 16 deletions(-) rename bsdl_files/{xilinx => }/xcku15p_ffve1517.bsd (100%) create mode 100644 scripts/example_script.txt diff --git a/bsdl_files/xilinx/xcku15p_ffve1517.bsd b/bsdl_files/xcku15p_ffve1517.bsd similarity index 100% rename from bsdl_files/xilinx/xcku15p_ffve1517.bsd rename to bsdl_files/xcku15p_ffve1517.bsd diff --git a/modules/script/script.c b/modules/script/script.c index 5d59ad7..252cec1 100644 --- a/modules/script/script.c +++ b/modules/script/script.c @@ -1129,7 +1129,7 @@ static int cmd_pause(script_ctx *ctx, char *line) const char *cmd_help_help[] = { "(string)", - "if no args, it prints the list of commandsm,", + "if no args, it prints the list of commands,", "otherwise the help of the .", ""}; static int cmd_help(script_ctx *ctx, char *line) @@ -1192,7 +1192,8 @@ static int cmd_help(script_ctx *ctx, char *line) const char *cmd_call_help[] = { "(string)", "Executes a script located at .", - ""}; + "" +}; static int cmd_call(script_ctx *ctx, char *line) { int offs; @@ -1719,6 +1720,7 @@ static int cmd_print_devs_list(script_ctx *ctx, char *line) ctx->script_printf(ctx, MSG_INFO_0, "%s\n", ptr); free(ptr); } + return JTAG_CORE_NO_ERROR; } return JTAG_CORE_NOT_FOUND; @@ -1792,9 +1794,8 @@ static int cmd_open_probe(script_ctx *ctx, char *line) } const char *cmd_load_bsdl_help[] = { - "", // Arguments "1(type) ..." - "explanations line one", // Explanations - "explanations line two", + "(string) (int)", + "Load/attach a bsdl file to a device into the chain.", "" }; static int cmd_load_bsdl(script_ctx *ctx, char *line) @@ -1829,9 +1830,9 @@ static int cmd_load_bsdl(script_ctx *ctx, char *line) } const char *cmd_set_scan_mode_help[] = { - "", // Arguments "1(type) ..." - "explanations line one", // Explanations - "explanations line two", + "(int) (string)", + "Set the scan mode for a particular device.", + "mode to be chosen in EXTEST or SAMPLE", "" }; static int cmd_set_scan_mode(script_ctx *ctx, char *line) @@ -1904,8 +1905,8 @@ static int cmd_push_and_pop(script_ctx *ctx, char *line) } const char *cmd_set_pin_mode_help[] = { - "(int) (string) (string)", - "Change the mode (input or output) of the pin of the given device.", + "(int) (string) (int)", + "Change the mode (input: 0 or output: 1) of the pin of the given device.", "" }; static int cmd_set_pin_mode(script_ctx *ctx, char *line) @@ -1990,7 +1991,7 @@ static int cmd_set_pin_state(script_ctx *ctx, char *line) } const char *cmd_get_pin_state_help[] = { - "(int) (string) (string)", + "(int) (string)", "Gets the state (0 or 1) of the pin of the given device.", "The mode is to be chosen between 'input' or 'output'.", "" @@ -2000,14 +2001,12 @@ static int cmd_get_pin_state(script_ctx *ctx, char *line) int i, j, k, ret, id; char dev_index[DEFAULT_BUFLEN]; char pinname[DEFAULT_BUFLEN]; - char mode[DEFAULT_BUFLEN]; jtag_core *jc; jc = (jtag_core *)ctx->app_ctx; i = get_param(ctx, line, 1, dev_index); j = get_param(ctx, line, 2, pinname); - k = get_param(ctx, line, 3, mode); if (i >= 0 && j >= 0 && k >= 0) { @@ -2660,9 +2659,8 @@ static int cmd_spi_rd_wr(script_ctx *ctx, char *line) } const char *cmd_get_pins_list_help[] = { - "", // Arguments "1(type) ..." - "explanations line one", // Explanations - "explanations line two", + "(int)", + "Lists the device pins and their properties", "" }; static int cmd_get_pins_list(script_ctx *ctx, char *line) diff --git a/scripts/example_script.txt b/scripts/example_script.txt new file mode 100644 index 0000000..2d8f69b --- /dev/null +++ b/scripts/example_script.txt @@ -0,0 +1,4 @@ + +jtag_open_probe 1 +jtag_autoinit +jtag_set_mode 0 EXTEST