Index: trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
===================================================================
--- trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest	(revision 83)
+++ trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest	(revision 88)
@@ -8,7 +8,7 @@
 
 #-----[ Directory ]----------------------------------------
-DIR_BIN				= bin
-DIR_LIB				= ../lib
-DIR_CFG_GEN			= configuration_generated
+DIR_BIN				= $(DIR_TMP)/bin
+DIR_LIB                         = ../lib
+DIR_CFG_GEN			= $(DIR_TMP)/configuration_generated
 DIR_CFG_USER			= configuration
 DIR_LOG				= log
@@ -34,7 +34,7 @@
 				@\
 				$(MAKE) library;\
-				$(MAKE) $(DIR_BIN)/$(EXEC).x;
-
-execute				: all_selftest
+                                $(MAKE) $(DIR_BIN)/$(EXEC).x;
+
+execute_only                    : 
 				@\
 				$(MAKE) $(EXEC_LOG);					\
@@ -45,5 +45,7 @@
 				    $(GREP) -q "Test KO" $$i;				\
 				    declare -i test_ko=$$?;				\
-				    if $(TEST) $$test_ko -eq 0 -o $$test_ok -ne 0;	\
+				    $(GREP) -q "ERROR" $$i;				\
+				    declare -i test_error=$$?;				\
+				    if $(TEST) $$test_ko -eq 0 -o $$test_error -eq 0 -o $$test_ok -ne 0; \
 				    then all_ok=0;	    	     	       	   	\
 				    fi;							\
@@ -54,4 +56,8 @@
 				fi;
 
+execute				: all_selftest
+				@\
+				$(MAKE) execute_only;
+
 reconfig			:
 				@\
@@ -74,15 +80,44 @@
 				fi;													\
 																	\
-				for file in $$files; do											\
-																	\
+				declare -i NB_CONFIG=0;											\
+				declare -i NB_DIGIT=0;	 										\
+																	\
+				for file in $${files}; do										\
+					declare -ai PERIOD=();										\
+					declare -i  IT=0; 										\
+																	\
+					PERIOD[0]=1;											\
+																	\
+					while read line; do										\
+					        declare -a LINE=($${line});								\
+																	\
+						if $(TEST) $${IT} -ne 0; then 								\
+							declare -a RANGE_LOCAL=($$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]}));	\
+							declare -i SIZE=$${#RANGE_LOCAL[*]};						\
+							PERIOD[$${IT}]=$$(($${PERIOD[$$(($${IT}-1))]}*$${SIZE}));			\
+						fi;											\
+																	\
+						IT=$$(($${IT}+1));									\
+					done < $${file};										\
+																	\
+					NB_CONFIG=$$(($${NB_CONFIG} + $${PERIOD[$$(($${IT}-1))]}));					\
+				done;													\
+																	\
+ 				$(ECHO) " * They are $${NB_CONFIG} configurations";							\
+																	\
+				declare -i x=$${NB_CONFIG};										\
+																	\
+				while test $${x} -ne 0; do										\
+					NB_DIGIT=$$(($${NB_DIGIT} + 1));								\
+					x=$$(($${x} / 10));										\
+				done;													\
+																	\
+				for file in $${files}; do										\
 					declare     NAME;										\
-					declare -ai MIN ;										\
-					declare -ai MAX ;										\
-					declare -a  STEP; 										\
-					declare -a  LINE; 										\
-					declare -ai PERIOD;										\
-					declare -a  RANGE;										\
-					declare -a  RANGE_LOCAL;									\
-					declare -a  SIZE;										\
+					declare -ai MIN=();										\
+					declare -ai PERIOD=();										\
+					declare -a  RANGE_LOCAL=();									\
+					declare -a  RANGE=();										\
+					declare -a  SIZE=();										\
 					declare -i  IT=0; 										\
 																	\
@@ -90,40 +125,39 @@
 																	\
 					while read line; do										\
-					        LINE=($$line);										\
-																	\
-						if $(TEST) $$IT -eq 0; then 								\
+					        declare -a LINE=($${line});								\
+																	\
+						if $(TEST) $${IT} -eq 0; then 								\
 							NAME=$${LINE[0]};								\
 						else											\
-							MIN[$$IT]=$${LINE[0]};								\
-							MAX[$$IT]=$${LINE[1]};								\
-							STEP[$$IT]=$${LINE[2]};								\
-							RANGE[$$IT]=$$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]});	\
-							RANGE_LOCAL=($${RANGE[$$IT]});							\
-							SIZE[$$IT]=$${#RANGE_LOCAL[*]};							\
-							PERIOD[$$IT]=$$(($${PERIOD[$$(($$IT-1))]}*$${SIZE[$$IT]}));			\
+							MIN[$${IT}]=$${LINE[0]};							\
+							RANGE[$${IT}]=$$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]});	\
+							RANGE_LOCAL=($${RANGE[$${IT}]});						\
+							SIZE[$${IT}]=$${#RANGE_LOCAL[*]};						\
+							PERIOD[$${IT}]=$$(($${PERIOD[$$(($${IT}-1))]}*$${SIZE[$${IT}]}));		\
 						fi;											\
 																	\
-						IT=$$(($$IT+1));									\
-					done < $$file;											\
-																	\
-					declare -i x;											\
-					declare -a DATA;										\
-					declare -ai ENUM_CONFIG=($$($(DIR_SCRIPT)/range.sh 0 $$(($${PERIOD[$$(($$IT-1))]}-1))));	\
+						IT=$$(($${IT}+1));									\
+					done < $${file};										\
+																	\
+					declare -a  DATA=();										\
+					declare -ai ENUM_CONFIG=($$($(DIR_SCRIPT)/range.sh 0 $$(($${PERIOD[$$(($${IT}-1))]}-1))));	\
 					declare -ai ENUM_PARAM=($$($(DIR_SCRIPT)/range.sh 1 $${#MIN[*]}));            			\
+					declare -i  NB_PARAM=$${#MIN[*]};								\
 																	\
 					$(ECHO) " * File : $$file";									\
- 					$(ECHO) "   * They are $${#MIN[*]} parameters";							\
- 					$(ECHO) "   * Generate $${PERIOD[$$(($$IT-1))]} configurations";				\
+ 					$(ECHO) "   * They are $${NB_PARAM} parameters";						\
+ 					$(ECHO) "   * Generate $${PERIOD[$$(($${IT}-1))]} configurations";				\
 																	\
 					for i in $${ENUM_CONFIG[*]}; do									\
 						x=$$i;											\
 						for j in $${ENUM_PARAM[*]}; do								\
-							RANGE_LOCAL=($${RANGE[$$j]});							\
+							declare -a RANGE_LOCAL=($${RANGE[$$j]});							\
 							DATA[$$j]="$${RANGE_LOCAL[$$((($$x % $${SIZE[$$j]})))]} ";			\
 							x=$$(($$x/$${SIZE[$$j]})); 							\
 						done;											\
-						$(ECHO) $${DATA[*]} > "$(DIR_CFG_GEN)/$${NAME}_$$CPT.cfg";				\
-						$(ECHO) "   - {$$CPT} $${DATA[*]}";							\
-						CPT=$$(($$CPT+1));									\
+						declare NUM=$$($(PRINTF) %.$${NB_DIGIT}d $${CPT}); 					\
+						$(ECHO) $${DATA[*]} > "$(DIR_CFG_GEN)/$${NAME}_$${NUM}.cfg";				\
+						$(ECHO) "   - {$${NUM}} $${DATA[*]}";							\
+						CPT=$$(($${CPT}+1));									\
 					done;												\
 				done;
@@ -132,5 +166,5 @@
 				@\
 				$(ECHO) "Execute            : $*";\
-				export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \
+				export SYSTEMC=$(SYSTEMC_$(SIMULATOR)); $(EXEC_PREFIX) $(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \
 				declare timing=`$(GREP) -h "Timing"  $@`;		\
 				$(GREP) -q "Test OK" $@; 				\
@@ -138,5 +172,7 @@
 				$(GREP) -q "Test KO" $@; 				\
 				declare -i test_ko=$$?;					\
-				if $(TEST) $$test_ko -ne 0 -a $$test_ok -eq 0;		\
+				$(GREP) -q "ERROR" $@;				        \
+				declare -i test_error=$$?;				\
+				if $(TEST) $$test_ko -ne 0 -a $$test_error -ne 0 -a $$test_ok -eq 0; \
 				then echo -e "                     $* ... OK\t$$timing";\
 				else echo    "                     $* ... KO";          \
@@ -146,5 +182,5 @@
 				@\
 				$(ECHO) "Execute            : $*";\
-				export SYSTEMC=$(SYSTEMC_$(SIMULATOR)) ; $(EXEC_PREFIX) ./$(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \
+				export SYSTEMC=$(SYSTEMC_$(SIMULATOR)); $(EXEC_PREFIX) $(DIR_BIN)/$(EXEC).x $(EXEC_PARAMS) $* `$(CAT) $<` &> $@; \
 				declare timing=`$(GREP) -h "Timing"  $@`;		\
 				$(GREP) -q "Test OK" $@; 				\
@@ -152,7 +188,9 @@
 				$(GREP) -q "Test KO" $@; 				\
 				declare -i test_ko=$$?;					\
-				if $(TEST) $$test_ko -ne 0 -a $$test_ok -eq 0;		\
-				then echo -e "                     $* ... OK\t$$timing";\
-				else echo    "                     $* ... KO";		\
+				$(GREP) -q "ERROR" $@;				        \
+				declare -i test_error=$$?;				\
+				if $(TEST) $$test_ko -ne 0 -a $$test_error -ne 0 -a $$test_ok -eq 0; \
+				then $(ECHO) -e "                     $* ... OK\t$$timing";\
+				else $(ECHO)    "                     $* ... KO";	   \
 				fi;
 
@@ -162,4 +200,9 @@
 				$(CXX) $(LFLAGS) -o $@ $(OBJECTS) $(LIBS);
 
+$(DIR_LIB)			:
+				@\
+				$(ECHO) "Create directory   : $@";\
+				$(MKDIR) $@;
+
 $(DIR_BIN)			:
 				@\
@@ -177,7 +220,5 @@
 				$(MKDIR) $@;
 
-selftest_clean_all		: library_clean
-				
-selftest_clean			: config_clean 
+selftest_clean			: local_clean config_clean 
 				@$(RM) 	$(DIR_LOG)		\
 					$(DIR_CFG_USER)/*~	\
@@ -185,8 +226,13 @@
 					*.pos			\
 					*.stat			\
+					*.log 			\
 					*.dot 			\
 					*.txt			\
 					generated_by_systemcass \
+                                        semantic.cache          \
 					core*;
+
+selftest_clean_all		: library_clean
+				
 
 selftest_help			:
@@ -196,4 +242,5 @@
 				$(ECHO) " * all_selftest         : compile all c++ file and execute";\
 				$(ECHO) " * execute              : execute all instance";\
+				$(ECHO) " * execute_only         : execute all instance without rebuild all libraries";\
 				$(ECHO) " * config               : generate configuration with configuration's file" ;\
 				$(ECHO) " * reconfig             : regenerate configuration with configuration's file" ;\
