OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [unix/] [posix/] [tools/] [looptest.in] - Blame information for rev 493

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
#!@KSH@ -p
2
#
3
# $Id: looptest.in,v 1.2 2001-09-27 12:01:15 chris Exp $
4
#
5
 
6
# progname=`basename $0`
7
progname=${0##*/}        # fast basename hack for ksh, bash
8
 
9
# must be uppercase hex; dc is feeble minded
10
clicks_per_tick="1"
11
# default is 0x3
12
hexbump=1
13
iterations=10
14
 
15
USAGE=\
16
"usage: $progname [ -opts ] file [ file ... ]
17
       -o options  -- specify options to be passed to runtest
18
       -c clicks   -- specify (hex) value for clicks / tick (default $clicks_per_tick)
19
        -n iterations -- num times to loop thru specified tests (default $iterations)
20
       -b hexbump  -- increment clicks-per-ticks this much each loop (default $hexbump)
21
       -v          -- verbose"
22
 
23
#   log an error to stderr
24
prerr()
25
{
26
    echo "$*" >&2
27
}
28
 
29
fatal() {
30
    [ "$1" ] && prerr $*
31
    prerr "$USAGE"
32
    exit 1
33
}
34
 
35
warn() {
36
    [ "$1" ] && prerr $*
37
}
38
 
39
#
40
# process the options
41
#
42
# defaults for getopt vars
43
#
44
 
45
verbose=""
46
extra_options=""
47
 
48
while getopts vo:c:n:b: OPT
49
do
50
    case "$OPT" in
51
        v)
52
            verbose="yes";;
53
        o)
54
            extra_options="$OPTARG";;
55
        c)
56
            clicks_per_ticks="$OPTARG";;
57
        n)
58
            iterations="$OPTARG";;
59
        b)
60
            hexbump="$OPTARG";;
61
        *)
62
            fatal;;
63
    esac
64
done
65
((shiftcount = $OPTIND - 1))
66
shift $shiftcount
67
 
68
args=$*
69
 
70
#
71
# Run the tests
72
# After each run, rename 'log' to log.$clicks_per_tick
73
#
74
 
75
tests="$args"
76
 
77
while [ $iterations -gt 0 ]
78
do
79
   ./runtest $extra_options -c $clicks_per_tick $tests
80
   rm -rf log.$clicks_per_tick.OLD
81
   [ -d log.$clicks_per_tick ] && mv log.$clicks_per_tick log.$clicks_per_tick.OLD
82
   mv log log.$clicks_per_tick
83
 
84
   ((iterations = $iterations - 1))
85
   clicks_per_tick=`echo 16 o 16 i $clicks_per_tick $hexbump + p q | dc`
86
done
87
 
88
exit 0
89
 
90
# Local Variables: ***
91
# mode:ksh ***
92
# End: ***
93
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.