Skip to content

Commit 6c9e204

Browse files
authored
Merge pull request #5 from syntacore/en-sc/backport-jtag-exec-9
Update `jtag execute`-related patches.
2 parents a235419 + 5b2a3b9 commit 6c9e204

File tree

6 files changed

+17
-5
lines changed

6 files changed

+17
-5
lines changed

Makefile.am

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ DIST_SUBDIRS += testing
3434
SUBDIRS += tools/syntacore
3535
DIST_SUBDIRS += tools/syntacore
3636

37+
SUBDIRS += testing
38+
DIST_SUBDIRS += testing
39+
3740
# common flags used in openocd build
3841
AM_CFLAGS = $(GCC_WARNINGS)
3942
AM_LDFLAGS =

src/jtag/tcl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ static const struct command_registration jtag_subcommand_handlers[] = {
10171017
},
10181018
{
10191019
.name = "execute",
1020-
.mode = COMMAND_ANY,
1020+
.mode = COMMAND_EXEC,
10211021
.handler = handle_jtag_execute,
10221022
.help = "Execute a chain of JTAG commands",
10231023
.usage = "['scan' tap_name+ ['" JTAG_EXECUTE_SCAN_IR_START_ARG

testing/tcl_commands/test-drscan-command.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace import jtag_dummy_testing::*
55

66
set ntaps 1
77
setup $ntaps
8+
init
89

910
set tap [lindex [jtag names] 0]
1011

testing/tcl_commands/test-irscan-command.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ namespace import jtag_dummy_testing::*
55

66
set ntaps 1
77
setup $ntaps
8+
init
89

910
set tap [lindex [jtag names] 0]
1011

testing/tcl_commands/test-jtag-execute-command.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ namespace import testing_helpers::*
44
namespace import jtag_dummy_testing::*
55

66
set ntaps 2
7-
setup $ntaps
87

8+
setup $ntaps
99
set tap [lindex [jtag names] 0]
1010
set second_tap [lindex [jtag names] 1]
1111

12+
check_generic_error {jtag execute scan $tap -ir 0}
13+
14+
init
15+
1216
set escaped_tap [string map {. {\.}} $tap]
1317

1418
jtag execute scan $tap

testing/tcl_commands/utils.tcl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ namespace eval testing_helpers {
2626
}
2727
}
2828

29+
proc check_generic_error script {
30+
tailcall check_for_error 1 {} $script
31+
}
32+
2933
proc check_invalid_arg script {
3034
tailcall check_for_error -603 {} $script
3135
}
@@ -50,8 +54,8 @@ namespace eval testing_helpers {
5054
Was expecting '$pattern'."
5155
}
5256

53-
namespace export check_invalid_arg check_syntax_err check_overflow_err \
54-
check_underflow_err check_matches
57+
namespace export check_generic_error check_invalid_arg check_syntax_err \
58+
check_overflow_err check_underflow_err check_matches
5559
}
5660

5761
namespace eval jtag_dummy_testing {
@@ -67,7 +71,6 @@ namespace eval jtag_dummy_testing {
6771
for {set i 0} {$i < $ntaps} {incr i} {
6872
jtag newtap "tap$i" tap -irlen 1
6973
}
70-
init
7174
dummy update_context
7275
dummy_set_default_handlers
7376

0 commit comments

Comments
 (0)