Skip to content

Commit 16eb17d

Browse files
Add support for TCF files in tests
Add option --elf32-nsim-tcf to run-tests.sh to specify TCF files to use, instead of nSIM props file. Signed-off-by: Anton Kolesov <[email protected]>
1 parent ac8e233 commit 16eb17d

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

dejagnu/nsim-extra.exp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ proc nsim_open { portnum } {
6767
# it is blocked and it stops responding to TCP connection and Dejagnu is
6868
# forced to restart it. I don't know a way to redirect nsim_gdb output to
6969
# null from Expect, so we have to use a shell to help as here.
70-
spawn sh -c "$env(NSIM_HOME)/bin/nsimdrv -gdb -port $portnum -propsfile $env(ARC_NSIM_PROPS) -reconnect >/dev/null 2>/dev/null"
70+
71+
# Use either TCF or props file. TCF has higher priority.
72+
if [info exists env(ARC_NSIM_TCF)] {
73+
spawn sh -c "$env(NSIM_HOME)/bin/nsimdrv -gdb -port $portnum -tcf $env(ARC_NSIM_TCF) -reconnect >/dev/null 2>/dev/null"
74+
} else {
75+
spawn sh -c "$env(NSIM_HOME)/bin/nsimdrv -gdb -port $portnum -propsfile $env(ARC_NSIM_PROPS) -reconnect >/dev/null 2>/dev/null"
76+
}
7177
unset_board_info nsim_id
7278
set_board_info nsim_id $spawn_id
7379
unset_board_info nsim_port

run-tests.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@
7575
# matches multilib and endian options. This option makes sense only when
7676
# target board is arc-nsim.
7777

78+
# --elf32-nsim-tcf <path/to/nsim/tcf/file>
79+
80+
# Kind of like the --elf32-nsim-props, but specifies tcf file instead. If
81+
# this option is set, then --elf32-nsim-props will be ignored.
82+
7883
# --elf32-hostlink-library <path/to/hostlink/library>
7984

8085
# Path to hostlink library archive. Required for test runs with Metaware.
@@ -140,6 +145,7 @@ ARC_TEST_ADDR_ELF32=
140145
ARC_TEST_ADDR_UCLIBC=aa4_32
141146
ARC_MULTILIB_OPTIONS=""
142147
ARC_NSIM_PROPS="${NSIM_HOME}/systemc/configs/nsim_a700.props"
148+
ARC_NSIM_TCF="${NSIM_HOME}/etc/tcf/templates/hs36.tcf"
143149
ARC_HOSTLINK_LIBRARY=
144150
make_load="`(echo processor; cat /proc/cpuinfo 2>/dev/null echo processor) \
145151
| grep -c processor`"
@@ -188,9 +194,14 @@ case ${opt} in
188194
;;
189195

190196
--elf32-nsim-props)
191-
shift
192-
ARC_NSIM_PROPS=$1
193-
;;
197+
shift
198+
ARC_NSIM_PROPS=$1
199+
;;
200+
201+
--elf32-nsim-tcf)
202+
shift
203+
ARC_NSIM_TCF=$1
204+
;;
194205

195206
--elf32-hostlink-library)
196207
shift
@@ -321,6 +332,7 @@ case ${opt} in
321332
echo " [--elf32-target-addr <address>]"
322333
echo " [--uclibc-target-addr <address>]"
323334
echo " [--elf32-nsim-props <path>]"
335+
echo " [--elf32-nsim-tcf <path>]"
324336
echo " [--elf32-hostlink-library <path>]"
325337
echo " [--elf32 | --no-elf32]"
326338
echo " [--uclibc | --no-uclibc]"
@@ -388,6 +400,11 @@ export DO_LIBSTDCPP
388400
export DO_SIM
389401
export DO_GDB
390402

403+
if [ "x$ARC_NSIM_TCF" != x ]
404+
then
405+
export ARC_NSIM_TCF
406+
fi
407+
391408
if [ "x${ARC_HOSTLINK_LIBRARY}" != x ]
392409
then
393410
export ARC_HOSTLINK_LIBRARY

0 commit comments

Comments
 (0)