Changeset 117 for trunk/Platforms
- Timestamp:
- May 16, 2009, 4:42:39 PM (15 years ago)
- Location:
- trunk/Platforms/Test
- Files:
-
- 900 added
- 67 deleted
- 2 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platforms/Test/Makefile
r114 r117 1 1 2 # 2 3 # $Id$ … … 21 22 ifeq ($(origin MORPHEO_TMP), undefined) 22 23 $(error "variable MORPHEO_TMP is undefined") 24 endif 25 26 DATA_ALL = * 27 ifeq ($(origin DATA), undefined) 28 DATA = $(DATA_ALL) 29 endif 30 ifeq ($(origin PRIORITY), undefined) 31 PRIORITY = 0 23 32 endif 24 33 … … 37 46 DIR_BIN = $(DIR_TMP)/bin 38 47 DIR_LOG = $(DIR_TMP)/log 39 DIR_DATA_TEST = ./data_test 40 DIR_DATA_BENCH = ./data_bench 48 DIR_DATA = ./data 49 DIR_LOGS = $(patsubst $(DIR_DATA)/%,$(DIR_LOG)/%,$(wildcard $(DIR_DATA)/*)) 50 41 51 DIR_SOFT = $(MORPHEO_TOPLEVEL)/Softwares 42 52 … … 57 67 #---------------------------------------------------------- 58 68 #---------------------------------------------------------- 59 60 69 SOURCES = $(wildcard $(DIR_SRC)/*.cpp) 61 70 OBJECTS = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(SOURCES)) 62 LOGS = $(patsubst $(DIR_DATA_TEST)/%.cfg,$(DIR_LOG)/%.log,$(wildcard $(DIR_DATA_TEST)/*.cfg)) 63 BENCHS = $(patsubst $(DIR_DATA_BENCH)/%.cfg,$(DIR_LOG)/%.log,$(wildcard $(DIR_DATA_BENCH)/*.cfg)) 64 DEBUG_CFG = $(DIR_DATA_TEST)/debug.cfg 65 DEBUG_LOG = $(DIR_LOG)/debug.log 66 71 LOGS = $(patsubst $(DIR_DATA)/%.cfg,$(DIR_LOG)/%.log,$(wildcard $(DIR_DATA)/$(DATA)/*.cfg)) 67 72 EXEC = $(DIR_BIN)/soft.x 68 EXEC_PREFIX = 73 EXEC_PREFIX = $(NICE) -n $(PRIORITY) 69 74 #$(VALGRIND) 70 75 71 76 #-----[ Compilation ]-------------------------------------- 72 INCDIR = $(SYSTEMC_INCDIR_$(SIMULATOR )) \77 INCDIR = $(SYSTEMC_INCDIR_$(SIMULATOR_SYSTEMC)) \ 73 78 $(MORPHEO_INCDIR) \ 74 79 $(ENVIRONMENT_INCDIR) \ 75 80 -I$(DIR_INC) 76 81 77 #LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR )) \82 #LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR_SYSTEMC)) \ 78 83 # $(ENVIRONMENT_LIBDIR) \ 79 84 # $(MORPHEO_LIBDIR) 80 85 81 86 # FIXME !!! 82 LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR )) \87 LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR_SYSTEMC)) \ 83 88 -L$(DIR_LIB) 84 89 85 90 LIBNAME = $(ENVIRONMENT_LIBNAME) \ 86 91 $(MORPHEO_LIBNAME) \ 87 $(SYSTEMC_LIBNAME_$(SIMULATOR ))88 89 FLAGS = $(SYSTEMC_CFLAGS_$(SIMULATOR ))92 $(SYSTEMC_LIBNAME_$(SIMULATOR_SYSTEMC)) 93 94 FLAGS = $(SYSTEMC_CFLAGS_$(SIMULATOR_SYSTEMC)) 90 95 91 96 PLATFORMS_CXX_FLAGS = $(MORPHEO_FLAGS) $(CXX_FLAGS) $(FLAGS) $(INCDIR) … … 101 106 vpath %.cpp $(DIR_SRC) 102 107 vpath %.o $(DIR_OBJ) 103 vpath %.cfg $(DIR_DATA _TEST) $(DIR_DATA_BENCH)108 vpath %.cfg $(DIR_DATA)/*/ 104 109 105 110 .PRECIOUS : $(DIR_OBJ)/%.o $(DIR_BIN)/%.x $(DIR_LOG)/%.log … … 110 115 @\ 111 116 $(ECHO) "Linkage : $*";\ 112 case "${SIMULATOR }" in \117 case "${SIMULATOR_SYSTEMC}" in \ 113 118 "modelsim") \ 114 119 $(MAKE) $(WORK_NAME); \ … … 127 132 esac; \ 128 133 129 130 test : $(DIR_LOG) all 131 @\ 132 declare logs; \ 133 if $(TEST) -f "$(DEBUG_CFG)"; then \ 134 logs="$(DEBUG_LOG)"; \ 135 else \ 136 logs="$(LOGS)"; \ 134 run : all 135 @\ 136 if $(TEST) "$(DATA)" != "$(DATA_ALL)"; then \ 137 $(RM) $(DIR_LOG)/$(DATA); \ 137 138 fi; \ 139 $(MAKE) $(DIR_LOGS); \ 140 declare logs="$(LOGS)"; \ 138 141 $(MAKE) $$logs; \ 139 142 declare -i nb_test=0; \ … … 154 157 fi; 155 158 156 bench : $(DIR_LOG) all 157 @\ 158 declare logs="$(BENCHS)"; \ 159 $(MAKE) $$logs; 160 161 execute : bench 162 163 # $(ECHO) $${data} | $(EXEC_PREFIX) $(EXEC) &> $$log; \ 164 165 $(DIR_LOG)/%.log : %.cfg 159 execute : run 160 161 debug : 162 @\ 163 $(MAKE) run DATA=debug; 164 165 bench : 166 @\ 167 $(MAKE) run DATA=bench; 168 169 $(DIR_LOG)/%.log : $(DIR_DATA)/%.cfg 166 170 @\ 167 171 file=$$($(BASENAME) $<); \ 168 172 data=$$($(CAT) $<); \ 169 173 log=$@; \ 170 $(ECHO) "Run : $ $file"; \174 $(ECHO) "Run : $*"; \ 171 175 $(EXEC_PREFIX) $(EXEC) $${data} &> $$log; \ 172 176 $(GREP) -q "Test OK" $$log; \ … … 176 180 declare timing=$$($(GREP) -h "Timing" $$log); \ 177 181 if $(TEST) $$test_ko -ne 0 -a $$test_ok -eq 0; \ 178 then $(ECHO) -e " $$file ... OK \t$$timing";\179 else $(ECHO) -e " $$file ... KO !!!\t$$timing";\182 then test="... OK "; \ 183 else test="... KO !!!"; \ 180 184 fi; \ 185 $(ECHO) -e " $* $${test}\t$${timing}";\ 186 echo "{$$($(date))} $* $${test} $${timing}" >> $$($(DIRNAME) $*).res;\ 181 187 182 188 #-----[ Library + Software ]------------------------------- … … 198 204 $(CXX) $(PLATFORMS_CXX_FLAGS) -c -o $@ $<; 199 205 200 $(DIR_OBJ) $(DIR_BIN) $(DIR_LOG ) :206 $(DIR_OBJ) $(DIR_BIN) $(DIR_LOGS) : 201 207 @\ 202 208 $(ECHO) "Create directory : $@";\ … … 208 214 @\ 209 215 $(ECHO) "Delete temporary files in directory $(PWD)";\ 210 $(RM) $(OBJECTS) $(EXEC) \211 *~ $(DIR_SRC)/*~ $(DIR_INC)/*~ $(DIR_DATA _TEST)/*~ $(DIR_DATA_BENCH)/*~\216 $(RM) $(OBJECTS) $(EXEC) $(LOGS) \ 217 *~ $(DIR_SRC)/*~ $(DIR_INC)/*~ $(DIR_DATA)/*/*~ *.res *.txt\ 212 218 *core* \ 213 219 tty* \ … … 232 238 $(ECHO) "";\ 233 239 $(ECHO) " * all (default rules) : create software";\ 234 $(ECHO) " * test : execute platforms with test configuration";\ 235 $(ECHO) " * bench : execute platforms with bench configuration";\ 240 $(ECHO) " * run : execute platforms with test configuration";\ 241 $(ECHO) " set DATA to select a specific directory in $(DIR_DATA) (default : all)";\ 242 $(ECHO) " set PRIORITY to nice the execution (default : 0)";\ 243 $(ECHO) " example : make run DATA=debug PRIORITY=10";\ 244 $(ECHO) " * execute : cf 'make run'";\ 245 $(ECHO) " * debug : cf 'make run DATA=debug'";\ 246 $(ECHO) " * bench : cf 'make run DATA=bench'";\ 236 247 $(ECHO) " * lib : make library";\ 237 248 $(ECHO) " * soft : make software";\ 238 $(ECHO) " * execute : cf 'make bench'";\239 249 $(ECHO) " * clean : erase temporary files";\ 240 250 $(ECHO) " * clean_all : erase generated files";\ -
trunk/Platforms/Test/src/test.cpp
r114 r117 60 60 //~~~~~ [ Environment ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 61 61 //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 62 62 63 uint32_t nb_thread = morpheo->_nb_thread; 63 64 uint32_t nb_entity = 1; 64 65 … … 212 213 { 213 214 tty_address [i] = TTY_BASE; 214 nb_tty [i] = 4;215 nb_tty [i] = nb_thread; 215 216 } 216 217 string ** name_tty = new string * [nb_component_tty]; … … 229 230 { 230 231 ramlock_address [i] = RAMLOCK_BASE; 231 nb_lock [i] = 10 ;232 nb_lock [i] = 100*nb_thread; 232 233 } 233 234 … … 247 248 248 249 Parameters * param_environment = new Parameters 249 (nb_entity, 250 (nb_thread, 251 nb_entity, 250 252 251 253 iaccess_nb_context, … … 293 295 nb_tty, 294 296 name_tty, 295 false,297 true, 296 298 297 299 nb_component_ramlock,
Note: See TracChangeset
for help on using the changeset viewer.