Last change
on this file since 58 was
57,
checked in by rosiere, 17 years ago
|
- VHDL - RegisterFile_Multi_Banked (only partial_crossbar)
- SystemC - modif Component, interface and co -> ajout du type Tusage_T pour instancier un coposant mais ne demander que le VHDL ou le systemC.
- Séminaire interne
|
File size:
1.2 KB
|
Rev | Line | |
---|
[2] | 1 | #!/bin/sh |
---|
| 2 | |
---|
| 3 | #-----[ usage ]--------------------------------------------- |
---|
| 4 | function usage () |
---|
| 5 | { |
---|
| 6 | echo "Usage : $0 min max [step [iter]]"; |
---|
| 7 | echo " * min : value minimal"; |
---|
| 8 | echo " * max : value maximal"; |
---|
| 9 | echo " * step : step between two value. If no present, step = \"+1\""; |
---|
| 10 | echo " * iter : choose the Nième value"; |
---|
| 11 | exit; |
---|
| 12 | } |
---|
| 13 | |
---|
| 14 | #-----[ range ]--------------------------------------------- |
---|
| 15 | function range () |
---|
| 16 | { |
---|
| 17 | declare a=$1; |
---|
| 18 | declare b=$2; |
---|
| 19 | declare step=$3; |
---|
| 20 | |
---|
[57] | 21 | while test $a -lt $b; do |
---|
[2] | 22 | echo $a; |
---|
| 23 | a=$(($a $step)); |
---|
[57] | 24 | done |
---|
| 25 | |
---|
| 26 | if test $a -eq $b; then |
---|
| 27 | echo $a; |
---|
| 28 | fi; |
---|
[2] | 29 | } |
---|
| 30 | |
---|
| 31 | #-----[ range_max ]----------------------------------------- |
---|
| 32 | function range_max () |
---|
| 33 | { |
---|
| 34 | declare a=$1; |
---|
| 35 | declare b=$2; |
---|
| 36 | declare step=$3; |
---|
| 37 | declare iter=$4; |
---|
| 38 | |
---|
[57] | 39 | while test $a -lt $b -a $iter -gt 1; do |
---|
[2] | 40 | a=$(($a $step)); |
---|
| 41 | iter=$(($iter-1)); |
---|
| 42 | done; |
---|
| 43 | |
---|
[57] | 44 | if test $a -eq $b; then |
---|
| 45 | echo $a; |
---|
| 46 | fi; |
---|
| 47 | |
---|
[2] | 48 | if test $iter -eq 1; then |
---|
| 49 | echo $a; |
---|
| 50 | fi; |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | #-----[ main ]---------------------------------------------- |
---|
| 54 | function main () |
---|
| 55 | { |
---|
| 56 | # create operande |
---|
| 57 | case $# in |
---|
| 58 | 2) range $* "+1";; |
---|
| 59 | 3) range $* ;; |
---|
| 60 | 4) range_max $* ;; |
---|
| 61 | *) usage $* |
---|
| 62 | esac |
---|
| 63 | } |
---|
| 64 | |
---|
| 65 | #-----[ Corps ]--------------------------------------------- |
---|
| 66 | main $* |
---|
Note: See
TracBrowser
for help on using the repository browser.