- Timestamp:
- Jul 9, 2007, 11:04:26 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Selftest
r42 r43 15 15 16 16 #-----[ Variables ]---------------------------------------- 17 CFG_FILE = configuration.cfg17 CFG_FILE_EXTENSION = cfg 18 18 19 19 OBJECTS = $(OBJECTS_COMMON) … … 45 45 @$(ECHO) "Generate configuration" 46 46 @ \ 47 declare NAME; \48 declare -ai MIN ; \49 declare -ai MAX ; \50 declare -a STEP; \51 declare -a LINE; \52 47 declare -i CPT=0; \ 53 declare -ai PERIOD; \ 54 declare -a RANGE; \ 55 declare -a RANGE_LOCAL; \ 56 declare -a SIZE; \ 57 PERIOD[0]=1; \ 48 for file in $$($(LS) *.$(CFG_FILE_EXTENSION) ); do \ 58 49 \ 59 while $(READ) line; do \ 60 LINE=($$line); \ 50 declare NAME; \ 51 declare -ai MIN ; \ 52 declare -ai MAX ; \ 53 declare -a STEP; \ 54 declare -a LINE; \ 55 declare -ai PERIOD; \ 56 declare -a RANGE; \ 57 declare -a RANGE_LOCAL; \ 58 declare -a SIZE; \ 59 declare -i IT=0; \ 61 60 \ 62 if $(TEST) $$CPT -eq 0; then \ 63 NAME=$${LINE[0]}; \ 64 else \ 65 MIN[$$CPT]=$${LINE[0]}; \ 66 MAX[$$CPT]=$${LINE[1]}; \ 67 STEP[$$CPT]=$${LINE[2]}; \ 68 RANGE[$$CPT]=$$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]}); \ 69 RANGE_LOCAL=($${RANGE[$$CPT]}); \ 70 SIZE[$$CPT]=$${#RANGE_LOCAL[*]}; \ 71 PERIOD[$$CPT]=$$(($${PERIOD[$$(($$CPT-1))]}*$${SIZE[$$CPT]})); \ 72 fi; \ 61 PERIOD[0]=1; \ 73 62 \ 74 CPT=$$(($$CPT+1));\75 done < $(CFG_FILE);\63 while $(READ) line; do \ 64 LINE=($$line); \ 76 65 \ 77 declare -i x; \ 78 declare -a DATA; \ 79 declare -ai ENUM_CONFIG=($$($(DIR_SCRIPT)/range.sh 0 $$(($${PERIOD[$$(($$CPT-1))]}-1)))); \ 80 declare -ai ENUM_PARAM=($$($(DIR_SCRIPT)/range.sh 1 $${#MIN[*]})); \ 66 if $(TEST) $$IT -eq 0; then \ 67 NAME=$${LINE[0]}; \ 68 else \ 69 MIN[$$IT]=$${LINE[0]}; \ 70 MAX[$$IT]=$${LINE[1]}; \ 71 STEP[$$IT]=$${LINE[2]}; \ 72 RANGE[$$IT]=$$($(DIR_SCRIPT)/range.sh $${LINE[0]} $${LINE[1]} $${LINE[2]}); \ 73 RANGE_LOCAL=($${RANGE[$$IT]}); \ 74 SIZE[$$IT]=$${#RANGE_LOCAL[*]}; \ 75 PERIOD[$$IT]=$$(($${PERIOD[$$(($$IT-1))]}*$${SIZE[$$IT]})); \ 76 fi; \ 81 77 \ 82 $(ECHO) " * they are $${#MIN[*]} parameters";\83 $(ECHO) " * generate $${PERIOD[$$(($$CPT-1))]} configurations";\78 IT=$$(($$IT+1)); \ 79 done < $$file; \ 84 80 \ 85 for i in $${ENUM_CONFIG[*]}; do \ 86 x=$$i; \ 87 for j in $${ENUM_PARAM[*]}; do \ 88 RANGE_LOCAL=($${RANGE[$$j]}); \ 89 DATA[$$j]="$${RANGE_LOCAL[$$((($$x % $${SIZE[$$j]})))]} "; \ 90 x=$$(($$x/$${SIZE[$$j]})); \ 81 declare -i x; \ 82 declare -a DATA; \ 83 declare -ai ENUM_CONFIG=($$($(DIR_SCRIPT)/range.sh 0 $$(($${PERIOD[$$(($$IT-1))]}-1)))); \ 84 declare -ai ENUM_PARAM=($$($(DIR_SCRIPT)/range.sh 1 $${#MIN[*]})); \ 85 \ 86 $(ECHO) " * File : $$file"; \ 87 $(ECHO) " * They are $${#MIN[*]} parameters"; \ 88 $(ECHO) " * Generate $${PERIOD[$$(($$IT-1))]} configurations"; \ 89 \ 90 for i in $${ENUM_CONFIG[*]}; do \ 91 x=$$i; \ 92 for j in $${ENUM_PARAM[*]}; do \ 93 RANGE_LOCAL=($${RANGE[$$j]}); \ 94 DATA[$$j]="$${RANGE_LOCAL[$$((($$x % $${SIZE[$$j]})))]} "; \ 95 x=$$(($$x/$${SIZE[$$j]})); \ 96 done; \ 97 $(ECHO) $${DATA[*]} > "$(DIR_CFG_GEN)/$${NAME}_$$CPT.cfg"; \ 98 $(ECHO) " - {$$CPT} $${DATA[*]}"; \ 99 CPT=$$(($$CPT+1)); \ 91 100 done; \ 92 $(ECHO) $${DATA[*]} > "$(DIR_CFG_GEN)/$${NAME}_$${i}.cfg"; \93 $(ECHO) " - {$$i} $${DATA[*]}"; \94 101 done; 95 102
Note: See TracChangeset
for help on using the changeset viewer.