2009-09-11 Till Straumann <Till.Straumann@TU-Berlin.de>

* psim-top.in, psim-bottom: Added support for options
	-d (print device tree and exit), -h (usage info) and
	-n (enable NIC support).

	* psim-gdb-bottom: Added support for options -s (force sysv IPC),
	-h (usage info) and -n (enable NIC support).
	Allow user to override GDB variable from environment.

	* psim-shared: cat NIC properties into device file if the
	user had specified '-n'.

	* runtest-top.in: removed unsupported options -o, -d from
	usage info.
This commit is contained in:
Till Straumann
2009-09-11 22:42:00 +00:00
parent 507d38261d
commit 5a6d25fcd5
6 changed files with 99 additions and 42 deletions

View File

@@ -1,3 +1,19 @@
2009-09-11 Till Straumann <Till.Straumann@TU-Berlin.de>
* psim-top.in, psim-bottom: Added support for options
-d (print device tree and exit), -h (usage info) and
-n (enable NIC support).
* psim-gdb-bottom: Added support for options -s (force sysv IPC),
-h (usage info) and -n (enable NIC support).
Allow user to override GDB variable from environment.
* psim-shared: cat NIC properties into device file if the
user had specified '-n'.
* runtest-top.in: removed unsupported options -o, -d from
usage info.
2009-04-14 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> 2009-04-14 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>
* psim-gdb-bottom: Adapt name of assert function for breakpoint * psim-gdb-bottom: Adapt name of assert function for breakpoint

View File

@@ -7,14 +7,19 @@
verbose="" verbose=""
limit="0" limit="0"
use_sysv_ipc="auto" use_sysv_ipc="auto"
device_tree_only=""
enable_if_sim=""
## TODO: may want command line ability to turn on some psim tracing ## TODO: may want command line ability to turn on some psim tracing
while getopts vsl: OPT while getopts vhsdnl: OPT
do do
case "$OPT" in case "$OPT" in
v) verbose="yes";; v) verbose="yes";;
h) echo "$USAGE"; exit 0;;
l) limit="$OPTARG";; l) limit="$OPTARG";;
s) use_sysv_ipc="yes";; s) use_sysv_ipc="yes";;
d) device_tree_only="yes";;
n) enable_if_sim="yes";;
*) fatal;; *) fatal;;
esac esac
done done
@@ -27,6 +32,11 @@ if [ $# -eq 0 ] ; then
fatal fatal
fi fi
if [ X${device_tree_only} = Xyes ] ; then
gen_device_tree ${1} > "`basename ${1} .exe`".device
exit $?
fi
if [ X${RUN} = X ] ; then if [ X${RUN} = X ] ; then
RUN=${rtemsTarget}-run RUN=${rtemsTarget}-run
fi fi

View File

@@ -1,8 +1,31 @@
progname=${0##*/} # fast basename hack for ksh, bash
## TODO: may want command line ability to turn on some psim tracing USAGE=\
"usage: $progname [ -opts ] [prog]
-s -- force System V IPC support on (default=auto)
-n -- enable NIC support ***REQUIRES PATCHED GDB/PSIM***
-h -- this message
"
# Recognize special argument to force System V IPC support on # Recognize special argument to force System V IPC support on
use_sysv_ipc="auto" use_sysv_ipc="auto"
enable_if_sim=""
## TODO: may want command line ability to turn on some psim tracing
while getopts snh OPT
do
case "$OPT" in
s) use_sysv_ipc="yes";;
n) enable_if_sim="yes";;
h) echo "$USAGE"; exit 0;;
*) echo "unknown option"; echo "$USAGE"; exit 0;;
esac
done
shiftcount=`expr $OPTIND - 1`
shift $shiftcount
args=$*
if [ X${1} = "X-psim_sysv" ] ; then if [ X${1} = "X-psim_sysv" ] ; then
use_sysv_ipc="yes" use_sysv_ipc="yes"
shift shift
@@ -20,7 +43,9 @@ gen_gdb_script()
echo "printf \"Use run to start the RTEMS application\\n\"" echo "printf \"Use run to start the RTEMS application\\n\""
} }
GDB=${rtemsTarget}-gdb if [ X${GDB} = X ] ; then
GDB=${rtemsTarget}-gdb
fi
gen_device_tree ${1} >${TREE_FILE} gen_device_tree ${1} >${TREE_FILE}
gen_gdb_script >${GDB_FILE} gen_gdb_script >${GDB_FILE}

View File

@@ -44,7 +44,7 @@ gen_device_tree()
RAM_SIZE=`$NM ${1} | awk '/\<RamSize\>/{print "0x"$1}'` RAM_SIZE=`$NM ${1} | awk '/\<RamSize\>/{print "0x"$1}'`
fi fi
cat <<EOF cat <<EOF
# #
# Device Tree for PSIM # Device Tree for PSIM
# #
@@ -75,36 +75,41 @@ cat <<EOF
/opic@0x0c130000/device_type open-pic /opic@0x0c130000/device_type open-pic
# interupt out -> CPU's interrupt pin # interupt out -> CPU's interrupt pin
/opic@0x0c130000 > intr0 int /cpus/cpu@0 /opic@0x0c130000 > intr0 int /cpus/cpu@0
##### ETHTAP @ 0x0c100020 for 0x40
##
## NOTE 'ethtap' currently (200902) requires psim to
## be patched -- also, it is only supported on
## a linux host.
## the 'ethtap' device transfers data from/to the
## simulated network interface to/from a 'ethertap'
## interface on the linux host (consult tun/tap
## device documentation).
## A very useful tool is 'tunctl' which allows for
## configuring user-accessible, persistent 'tap'
## devices so that psim may be executed w/o special
## (root) privileges.
#
#/ethtap@0x0c100020/reg 0x0c100020 0x40
## route interrupt to open-pic
#/ethtap@0x0c100020 > 0 irq0 /opic@0x0c130000
## 'tun' device on host
#/ethtap@0x0c100020/tun-device "/dev/net/tun"
## name of 'tap' device to use
#/ethtap@0x0c100020/tap-ifname "tap0"
## ethernet address of simulated IF
#/ethtap@0x0c100020/hw-address "00:00:00:22:11:00"
## generate CRC and append to received packet before
## handing over to the simulation. This is mostly for
## debugging the rtems device driver. If unsure, leave 'false'.
#/ethtap@0x0c100020/enable-crc false
EOF EOF
if [ X${enable_if_sim} = Xyes ] ; then
cat <<EOF
#### ETHTAP @ 0x0c100020 for 0x40
#
# NOTE 'ethtap' currently (200902) requires psim to
# be patched -- also, it is only supported on
# a linux host.
# the 'ethtap' device transfers data from/to the
# simulated network interface to/from a 'ethertap'
# interface on the linux host (consult tun/tap
# device documentation).
# A very useful tool is 'tunctl' which allows for
# configuring user-accessible, persistent 'tap'
# devices so that psim may be executed w/o special
# (root) privileges.
/ethtap@0x0c100020/reg 0x0c100020 0x40
# route interrupt to open-pic
/ethtap@0x0c100020 > 0 irq0 /opic@0x0c130000
# 'tun' device on host
/ethtap@0x0c100020/tun-device "/dev/net/tun"
# name of 'tap' device to use
/ethtap@0x0c100020/tap-ifname "tap0"
# ethernet address of simulated IF
/ethtap@0x0c100020/hw-address "00:00:00:22:11:00"
# generate CRC and append to received packet before
# handing over to the simulation. This is mostly for
# debugging the rtems device driver. If unsure, leave 'false'.
/ethtap@0x0c100020/enable-crc false
EOF
fi
if [ ${enable_sysv_devices} = yes ] ; then if [ ${enable_sysv_devices} = yes ] ; then
echo "##### System V IPC (Semaphore) 0x0c100010 for 12" echo "##### System V IPC (Semaphore) 0x0c100010 for 12"
echo "/sem@0x0c100010/reg 0x0c100010 12" echo "/sem@0x0c100010/reg 0x0c100010 12"

View File

@@ -21,8 +21,11 @@ progname=${0##*/} # fast basename hack for ksh, bash
USAGE=\ USAGE=\
"usage: $progname [ -opts ] test [ test ... ] "usage: $progname [ -opts ] test [ test ... ]
-v -- verbose -v -- verbose
-h -- this message
-s -- force System V IPC support on (default=auto) -s -- force System V IPC support on (default=auto)
-l limit -- specify time limit (default is 'no limit') -l limit -- specify time limit (default is 'no limit')
-d -- generate device tree as 'test'.device and exit
-n -- enable NIC support ***REQUIRES PATCHED PSIM***
" "
# log an error to stderr # log an error to stderr

View File

@@ -23,9 +23,7 @@ fi
USAGE=\ USAGE=\
"usage: $progname [ -opts ] test [ test ... ] "usage: $progname [ -opts ] test [ test ... ]
-o options -- specify options to be passed to simulator
-v -- verbose -v -- verbose
-d -- generate device tree file (as 'test'.device) and exit
-l logdir -- specify log directory (default is 'logdir') -l logdir -- specify log directory (default is 'logdir')
Specify test as 'test' or 'test.exe'. Specify test as 'test' or 'test.exe'.