- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
r83 r88 8 8 9 9 #-----[ Directory ]---------------------------------------- 10 DIR_BIN = bin11 DIR_LIB 12 DIR_CFG_GEN = configuration_generated10 DIR_BIN = $(DIR_TMP)/bin 11 DIR_LIB = ../lib 12 DIR_CFG_GEN = $(DIR_TMP)/configuration_generated 13 13 DIR_CFG_USER = configuration 14 14 DIR_LOG = log … … 34 34 @\ 35 35 $(MAKE) library;\ 36 37 38 execute : all_selftest36 $(MAKE) $(DIR_BIN)/$(EXEC).x; 37 38 execute_only : 39 39 @\ 40 40 $(MAKE) $(EXEC_LOG); \ … … 45 45 $(GREP) -q "Test KO" $$i; \ 46 46 declare -i test_ko=$$?; \ 47 if $(TEST) $$test_ko -eq 0 -o $$test_ok -ne 0; \ 47 $(GREP) -q "ERROR" $$i; \ 48 declare -i test_error=$$?; \ 49 if $(TEST) $$test_ko -eq 0 -o $$test_error -eq 0 -o $$test_ok -ne 0; \ 48 50 then all_ok=0; \ 49 51 fi; \ … … 54 56 fi; 55 57 58 execute : all_selftest 59 @\ 60 $(MAKE) execute_only; 61 56 62 reconfig : 57 63 @\ … … 74 80 fi; \ 75 81 \ 76 for file in $$files; do \ 77 \ 82 declare -i NB_CONFIG=0; \ 83 declare -i NB_DIGIT=0; \ 84 \ 85 for file in $${files}; do \ 86 declare -ai PERIOD=(); \ 87 declare -i IT=0; \ 88 \ 89 PERIOD[0]=1; \ 90 \ 91 while read line; do \ 92 declare -a LINE=($${line}); \ 93 \ 94 if $(TEST) $${IT} -ne 0; then \ 95 declare -a RANGE_LOCAL=($$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]})); \ 96 declare -i SIZE=$${#RANGE_LOCAL[*]}; \ 97 PERIOD[$${IT}]=$$(($${PERIOD[$$(($${IT}-1))]}*$${SIZE})); \ 98 fi; \ 99 \ 100 IT=$$(($${IT}+1)); \ 101 done < $${file}; \ 102 \ 103 NB_CONFIG=$$(($${NB_CONFIG} + $${PERIOD[$$(($${IT}-1))]})); \ 104 done; \ 105 \ 106 $(ECHO) " * They are $${NB_CONFIG} configurations"; \ 107 \ 108 declare -i x=$${NB_CONFIG}; \ 109 \ 110 while test $${x} -ne 0; do \ 111 NB_DIGIT=$$(($${NB_DIGIT} + 1)); \ 112 x=$$(($${x} / 10)); \ 113 done; \ 114 \ 115 for file in $${files}; do \ 78 116 declare NAME; \ 79 declare -ai MIN ; \ 80 declare -ai MAX ; \ 81 declare -a STEP; \ 82 declare -a LINE; \ 83 declare -ai PERIOD; \ 84 declare -a RANGE; \ 85 declare -a RANGE_LOCAL; \ 86 declare -a SIZE; \ 117 declare -ai MIN=(); \ 118 declare -ai PERIOD=(); \ 119 declare -a RANGE_LOCAL=(); \ 120 declare -a RANGE=(); \ 121 declare -a SIZE=(); \ 87 122 declare -i IT=0; \ 88 123 \ … … 90 125 \ 91 126 while read line; do \ 92 LINE=($$line);\93 \ 94 if $(TEST) $$ IT-eq 0; then \127 declare -a LINE=($${line}); \ 128 \ 129 if $(TEST) $${IT} -eq 0; then \ 95 130 NAME=$${LINE[0]}; \ 96 131 else \ 97 MIN[$$IT]=$${LINE[0]}; \ 98 MAX[$$IT]=$${LINE[1]}; \ 99 STEP[$$IT]=$${LINE[2]}; \ 100 RANGE[$$IT]=$$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]}); \ 101 RANGE_LOCAL=($${RANGE[$$IT]}); \ 102 SIZE[$$IT]=$${#RANGE_LOCAL[*]}; \ 103 PERIOD[$$IT]=$$(($${PERIOD[$$(($$IT-1))]}*$${SIZE[$$IT]})); \ 132 MIN[$${IT}]=$${LINE[0]}; \ 133 RANGE[$${IT}]=$$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]}); \ 134 RANGE_LOCAL=($${RANGE[$${IT}]}); \ 135 SIZE[$${IT}]=$${#RANGE_LOCAL[*]}; \ 136 PERIOD[$${IT}]=$$(($${PERIOD[$$(($${IT}-1))]}*$${SIZE[$${IT}]})); \ 104 137 fi; \ 105 138 \ 106 IT=$$(($$IT+1)); \ 107 done < $$file; \ 108 \ 109 declare -i x; \ 110 declare -a DATA; \ 111 declare -ai ENUM_CONFIG=($$($(DIR_SCRIPT)/range.sh 0 $$(($${PERIOD[$$(($$IT-1))]}-1)))); \ 139 IT=$$(($${IT}+1)); \ 140 done < $${file}; \ 141 \ 142 declare -a DATA=(); \ 143 declare -ai ENUM_CONFIG=($$($(DIR_SCRIPT)/range.sh 0 $$(($${PERIOD[$$(($${IT}-1))]}-1)))); \ 112 144 declare -ai ENUM_PARAM=($$($(DIR_SCRIPT)/range.sh 1 $${#MIN[*]})); \ 145 declare -i NB_PARAM=$${#MIN[*]}; \ 113 146 \ 114 147 $(ECHO) " * File : $$file"; \ 115 $(ECHO) " * They are $${ #MIN[*]} parameters";\116 $(ECHO) " * Generate $${PERIOD[$$(($$ IT-1))]} configurations"; \148 $(ECHO) " * They are $${NB_PARAM} parameters"; \ 149 $(ECHO) " * Generate $${PERIOD[$$(($${IT}-1))]} configurations"; \ 117 150 \ 118 151 for i in $${ENUM_CONFIG[*]}; do \ 119 152 x=$$i; \ 120 153 for j in $${ENUM_PARAM[*]}; do \ 121 RANGE_LOCAL=($${RANGE[$$j]}); \154 declare -a RANGE_LOCAL=($${RANGE[$$j]}); \ 122 155 DATA[$$j]="$${RANGE_LOCAL[$$((($$x % $${SIZE[$$j]})))]} "; \ 123 156 x=$$(($$x/$${SIZE[$$j]})); \ 124 157 done; \ 125 $(ECHO) $${DATA[*]} > "$(DIR_CFG_GEN)/$${NAME}_$$CPT.cfg"; \ 126 $(ECHO) " - {$$CPT} $${DATA[*]}"; \ 127 CPT=$$(($$CPT+1)); \ 158 declare NUM=$$($(PRINTF) %.$${NB_DIGIT}d $${CPT}); \ 159 $(ECHO) $${DATA[*]} > "$(DIR_CFG_GEN)/$${NAME}_$${NUM}.cfg"; \ 160 $(ECHO) " - {$${NUM}} $${DATA[*]}"; \ 161 CPT=$$(($${CPT}+1)); \ 128 162 done; \ 129 163 done; … … 132 166 @\ 133 167 $(ECHO) "Execute : $*";\ 134 export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \168 export SYSTEMC=$(SYSTEMC_$(SIMULATOR)); $(EXEC_PREFIX) $(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \ 135 169 declare timing=`$(GREP) -h "Timing" $@`; \ 136 170 $(GREP) -q "Test OK" $@; \ … … 138 172 $(GREP) -q "Test KO" $@; \ 139 173 declare -i test_ko=$$?; \ 140 if $(TEST) $$test_ko -ne 0 -a $$test_ok -eq 0; \ 174 $(GREP) -q "ERROR" $@; \ 175 declare -i test_error=$$?; \ 176 if $(TEST) $$test_ko -ne 0 -a $$test_error -ne 0 -a $$test_ok -eq 0; \ 141 177 then echo -e " $* ... OK\t$$timing";\ 142 178 else echo " $* ... KO"; \ … … 146 182 @\ 147 183 $(ECHO) "Execute : $*";\ 148 export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \184 export SYSTEMC=$(SYSTEMC_$(SIMULATOR)); $(EXEC_PREFIX) $(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \ 149 185 declare timing=`$(GREP) -h "Timing" $@`; \ 150 186 $(GREP) -q "Test OK" $@; \ … … 152 188 $(GREP) -q "Test KO" $@; \ 153 189 declare -i test_ko=$$?; \ 154 if $(TEST) $$test_ko -ne 0 -a $$test_ok -eq 0; \ 155 then echo -e " $* ... OK\t$$timing";\ 156 else echo " $* ... KO"; \ 190 $(GREP) -q "ERROR" $@; \ 191 declare -i test_error=$$?; \ 192 if $(TEST) $$test_ko -ne 0 -a $$test_error -ne 0 -a $$test_ok -eq 0; \ 193 then $(ECHO) -e " $* ... OK\t$$timing";\ 194 else $(ECHO) " $* ... KO"; \ 157 195 fi; 158 196 … … 162 200 $(CXX) $(LFLAGS) -o $@ $(OBJECTS) $(LIBS); 163 201 202 $(DIR_LIB) : 203 @\ 204 $(ECHO) "Create directory : $@";\ 205 $(MKDIR) $@; 206 164 207 $(DIR_BIN) : 165 208 @\ … … 177 220 $(MKDIR) $@; 178 221 179 selftest_clean_all : library_clean 180 181 selftest_clean : config_clean 222 selftest_clean : local_clean config_clean 182 223 @$(RM) $(DIR_LOG) \ 183 224 $(DIR_CFG_USER)/*~ \ … … 185 226 *.pos \ 186 227 *.stat \ 228 *.log \ 187 229 *.dot \ 188 230 *.txt \ 189 231 generated_by_systemcass \ 232 semantic.cache \ 190 233 core*; 234 235 selftest_clean_all : library_clean 236 191 237 192 238 selftest_help : … … 196 242 $(ECHO) " * all_selftest : compile all c++ file and execute";\ 197 243 $(ECHO) " * execute : execute all instance";\ 244 $(ECHO) " * execute_only : execute all instance without rebuild all libraries";\ 198 245 $(ECHO) " * config : generate configuration with configuration's file" ;\ 199 246 $(ECHO) " * reconfig : regenerate configuration with configuration's file" ;\
Note: See TracChangeset
for help on using the changeset viewer.