source: trunk/IPs/systemC/processor/Morpheo/Script/SelfTest.sh @ 110

Last change on this file since 110 was 110, checked in by rosiere, 15 years ago

1) OOO_egine : add stat to depiste low perf source
2) Commit : add stat
3) LSU_Pointer : retire - always ack (else combinatory loop). insert - max nb_inst_memory
4) TopLevel? : add debug_idle_time to stop combinatory loop.
5) Issue_queue : add reexecute_queue, new implementation (routage after issue_queue)
6) Decod / Predictor : add "can_continue"

  • Property svn:executable set to *
File size: 11.0 KB
Line 
1#!/bin/bash
2
3#-----------------------------------------------------------
4# $Id$
5#-----------------------------------------------------------
6
7#-----[ variable ]------------------------------------------
8
9declare    test_ko="Test KO";
10declare    test_ok="Test OK";
11declare    test_unknow="???????";
12declare    tmp="${MORPHEO_HOME}/tmp/SelfTest";
13declare    path="${MORPHEO_TOPLEVEL}/IPs/systemC/processor/Morpheo/";
14
15declare -a directory=(
16    "Common"
17
18    "Behavioural"
19    "Behavioural/Configuration"
20    "Behavioural/Custom"
21
22    "Behavioural/Generic/Counter"
23    "Behavioural/Generic/Priority"
24    "Behavioural/Generic/Queue_Control"                                 
25    "Behavioural/Generic/Queue"                                 
26    "Behavioural/Generic/RegisterFile/RegisterFile_Monolithic" 
27    "Behavioural/Generic/RegisterFile/RegisterFile_Multi_Banked"
28    "Behavioural/Generic/RegisterFile"                         
29    "Behavioural/Generic/Select/Select_Priority_Fixed"           
30    "Behavioural/Generic/Select"                               
31    "Behavioural/Generic/Shifter"                               
32    "Behavioural/Generic/Sort"                                 
33    "Behavioural/Generic/Victim/Victim_Pseudo_LRU"             
34    "Behavioural/Generic/Victim"                               
35
36    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Execute_loop_Glue"
37    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/Operation"
38    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit"
39    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit"
40    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit"
41    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit"
42    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue"
43    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station"
44    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit"
45    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit"
46    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Execute_queue"
47    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue"
48    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit"
49    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit"
50    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Execution_unit_to_Write_unit"
51    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit"
52    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network"
53    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue"
54    "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit"
55    "Behavioural/Core/Multi_Execute_loop/Execute_loop"
56    "Behavioural/Core/Multi_Execute_loop"
57
58    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit"
59    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue"
60    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue"
61    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit"
62    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit"
63    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Dependency_checking_unit"
64    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit"
65    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit"
66    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_translation_unit_Glue"
67    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit"
68    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit"
69    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue"
70    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select"
71    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit"
72    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit"
73    "Behavioural/Core/Multi_OOO_Engine/OOO_Engine"
74    "Behavioural/Core/Multi_OOO_Engine"
75   
76    "Behavioural/Core/Multi_Front_end/Front_end/Context_State"
77    "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction"
78    "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod"
79    "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue"
80    "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit"
81    "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue"
82    "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Address_management"
83    "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_queue"
84    "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit/Ifetch_unit_Glue"
85    "Behavioural/Core/Multi_Front_end/Front_end/Ifetch_unit"
86    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Glue"
87    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register"
88    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer"
89    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Direction_Glue"
90    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction"
91    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue"
92#   "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue"
93#   "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table"
94#   "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table"
95    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor"
96    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor"
97    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue"
98    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Return_Address_Stack"
99    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table"
100    "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit"
101    "Behavioural/Core/Multi_Front_end/Front_end"
102    "Behavioural/Core/Multi_Front_end"
103
104    "Behavioural/Core/Icache_Access"
105    "Behavioural/Core/Dcache_Access"
106
107    "Behavioural/Core/Core_Glue"
108    "Behavioural/Core"
109
110    "TopLevel"
111    );
112                                           
113
114#-----[ usage ]---------------------------------------------
115function usage ()
116{
117    echo "Usage            : ${0} action";
118    echo "Arguments        : ";
119    echo " * action";
120    echo "   * systemc     : test all model systemC";
121    echo '                   for each component, create file in ${MORPHEO_HOME}/tmp/';
122    echo "   * systemc_all : same as test, but don't stop at the first error";
123    echo "   * vhdl        : test all model VHDL";
124    echo '                   for each component, create file in ${MORPHEO_HOME}/tmp/';
125    echo "   * vhdl_all    : same as test, but don't stop at the first error";
126    echo "   * result      : list test's resultat";
127    echo "   * list        : list test";
128    echo "   * clean       : erase file in ${MORPHEO_HOME}/tmp/ directory";
129    echo "   * clean_all   : clean all component";
130    echo "   * help        : print this message";
131    echo "";
132    echo "Notes            : ";
133    echo " * Morpheo environment must be positionned";
134    exit;
135}
136
137#-----[ simulation ]----------------------------------------
138# arg1 : cmd (execute / sim)
139# arg2 : all (stop)
140# arg3 : file suffix
141function simulation ()
142{
143    pwd=${PWD};
144
145    nb_cpu=$(cat /proc/cpuinfo |grep -c processor);
146
147    for i in ${directory[@]}; do
148        component=$(basename ${i});
149        dir="${path}/${i}/SelfTest";
150
151        if test -d "${dir}"; then
152            # have previous test ok ?
153            declare -i make_test=1;
154           
155            file="${tmp}/${component}.${3}"
156
157            if test -f ${file}; then
158                res_test=$(cat ${file});
159                if test "${test_ok}" = "${res_test}"; then
160                    make_test=0;
161                fi;
162            fi;
163
164            if test ${make_test} -eq 1; then
165                cd ${dir};
166                make config;
167                make -j${nb_cpu} ${1};
168                case ${?} in
169                    "0")
170                        echo ${test_ok} > ${file};
171                        ;;
172                    *)
173
174                        echo ${test_ko} > ${file};
175                        echo "";
176                        echo "${component} : ${test_ko}";
177                        echo "";
178                        if test ${2} = "1"; then
179                            exit 1;
180                        fi;
181                        ;;
182                esac;
183                make clean;
184            fi;
185        else
186            echo "${component} have not SelfTest directory.";
187        fi;
188
189        cd ${pwd};
190    done;
191}
192
193#-----[ main ]----------------------------------------------
194function main ()
195{
196    # Test operand
197    if test ${#} -ne 1; then
198        usage ${*};
199    fi;
200
201    if test -z "${MORPHEO_TOPLEVEL}"; then
202        usage ${*};
203    fi;
204
205    if test ! -d ${tmp}; then
206        mkdir -p ${tmp};
207    fi;
208
209    case ${1} in
210        "systemc" )
211            simulation "execute" "1" "systemc";
212            ;;
213
214        "systemc_all")
215            simulation "execute" "0" "systemc";
216            ;;
217
218        "vhdl" )
219            simulation "sim"     "1" "vhdl";
220            ;;
221
222        "vhdl_all")
223            simulation "sim"     "0" "vhdl";
224            ;;
225
226        "result")
227            for x in "systemc" "vhdl"; do
228                color=34; 
229                echo "[1;${color}m * ${x}[1;0m";
230
231                for i in ${tmp}/*.${x}; do
232                    if test -f ${i}; then
233                        component=$(basename ${i} .${x});
234                        res_test=$(cat ${i});
235                       
236                        case "${res_test}" in
237                            "${test_ok}") res_test=${test_ok};     color=32; 
238                                ;;
239                            "${test_ko}") res_test=${test_ko};     color=31; 
240                                ;;
241                            *)            res_test=${test_unknow}; color=39; 
242                                ;;
243                        esac
244                        echo "[1;${color}m   * ${res_test} - ${component}[1;0m";
245                    fi;
246                done;
247            done;
248            ;;
249
250
251        "list")
252            for i in ${directory[@]}; do
253                component=$(basename ${i});
254                echo "${i}";
255            done;
256            ;;
257
258        "clean")
259            rm -r ${tmp};
260            ;;
261           
262        "clean_all")
263            pwd=${PWD};
264
265            for i in ${directory[@]}; do
266                component=$(basename ${i});
267
268                cd ${path}/${i};
269
270                if test -f "Makefile"; then
271                    make clean;
272                    dir="SelfTest";
273                   
274                    if test -d ${dir}; then
275                        cd ${dir};
276                        make clean;
277                    else
278                        echo "${component} have not SelfTest directory.";
279                    fi;
280                    cd ${pwd};
281                fi;
282            done;
283            ;;
284
285        "help")
286            usage ${*};
287            ;;
288        *)
289            usage ${*};
290    esac
291}
292
293#-----[ Body ]----------------------------------------------
294main ${*};
295
Note: See TracBrowser for help on using the repository browser.