source: trunk/IPs/systemC/processor/Morpheo/Script/execute_n.sh @ 78

Last change on this file since 78 was 78, checked in by rosiere, 16 years ago

Add :

  • Execute_loop (must be test systemC)
  • Prediction
    • Direction : predifined scheme
    • Branch Target Buffer
  • iFetch_unit
    • ifetch_queue
    • pc management
  • Decod_unit
    • coming soon : support for custom operation
  • Rename_unit
    • RAT
    • Free_list
    • Dependence RAW check
    • Load store unit pointer
  • New Environnement (hierarchy_memory will remove in a next version)


Modif :

  • Manage Custom Operation
  • All component in execute_loop to use the new statistics management

Not Finish :

  • Return Address Stack
  • Environnement
File size: 2.5 KB
Line 
1#!/bin/sh
2
3#-----[ variable ]------------------------------------------
4declare -a COMMAND;
5declare -i NB_PROCESS;
6declare -i CPT;
7declare    FILE_CMD;
8declare    FILE_CPT;
9declare    FILE_CPU;
10declare    ID="cpu-${HOSTNAME}-$$"
11
12#-----[ usage ]---------------------------------------------
13function usage ()
14{
15    echo "Usage     : $0 file [ nb_process ]";
16    echo "Arguments : ";
17    echo " * file       : list of command";
18    echo " * nb_process : number of process (default (and maximum) is the number of processor)";
19    echo "";
20    echo "Note      : ";
21    echo " * This script, for each command, create a directory : Task_X (X is the number of command), and execute the command in this directory.";
22    echo " * Two file is generate : \"output\" is the output of the execution, and \"command\" is the command lunch.";
23    echo " * A command empty (no command on a line of file) is a synchronisation with all process"
24    echo " * Don't forgot the final end of line (else the last command is not executed";
25    echo "";
26    exit;
27}
28
29#-----[ nb_cpu ]--------------------------------------------
30function nb_cpu ()
31{
32    local FILE_CPUINFO=/proc/cpuinfo;
33    if test ! -f $FILE_CPUINFO; then
34        echo "\"${FILE_CPUINFO}\" don't exist."
35        usage;
36    fi;
37
38    eval "$1=`grep -c \"processor\" ${FILE_CPUINFO}`";
39}
40
41#-----[ test_usage ]----------------------------------------
42function test_usage ()
43{
44    if test $# -ne 1 -a $# -ne 2; then
45        usage;
46    fi;
47
48    if test ! -f $1; then
49        echo "File \"$1\" don't exist";
50        usage;
51    fi;
52
53    if test ! -s $1; then
54        echo "File \"$1\" is empty";
55        usage;
56    fi;
57}
58
59#-----[ main ]----------------------------------------------
60function main ()
61{
62    nb_cpu NB_PROCESS;
63
64    test_usage $*;
65
66    if test $# -eq 2; then
67        if test $2 -lt $NB_PROCESS; then
68            NB_PROCESS=$2;
69        fi;
70    fi;
71
72    FILE_CMD=$1;
73    FILE_CPT="$HOME/control-"`basename $1`;
74    FILE_CPU="$HOME/$ID";
75
76    echo "<$0>"                                         ;
77    echo "  * Initialisation ...."                      ;
78    echo "    - host name                : $HOSTNAME"   ;
79    echo "    - number of process        : $NB_PROCESS" ;
80
81    local -i IT_NB_PROCESS=1;
82    local -i PID=$$;
83
84    echo "$NB_PROCESS" > $FILE_CPU;
85
86    # create the same number of thread that processor
87    while test $IT_NB_PROCESS -le $NB_PROCESS; do
88        execute.sh $FILE_CMD $FILE_CPT $FILE_CPU &
89        IT_NB_PROCESS=$(($IT_NB_PROCESS+1));
90
91        if test "$$" -ne $PID; then
92            break;
93        fi;
94    done
95}
96
97#-----[ Corps ]---------------------------------------------
98main $*;
Note: See TracBrowser for help on using the repository browser.