Changeset 113 for trunk/Platforms/Test
- Timestamp:
- Apr 14, 2009, 8:39:12 PM (16 years ago)
- Location:
- trunk/Platforms/Test
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Platforms/Test/Makefile
r109 r113 29 29 #---------------------------------------------------------- 30 30 ENTITY = Test 31 SIMULATOR = modelsim 31 32 32 33 DIR_TMP = $(MORPHEO_TMP) … … 34 35 DIR_SRC = src 35 36 DIR_OBJ = $(DIR_TMP)/obj 37 DIR_LIB = $(DIR_TMP)/lib 36 38 DIR_BIN = $(DIR_TMP)/bin 37 39 DIR_LOG = $(DIR_TMP)/log … … 57 59 #---------------------------------------------------------- 58 60 59 OBJECTS = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(wildcard $(DIR_SRC)/*.cpp)) 61 SOURCES = $(wildcard $(DIR_SRC)/*.cpp) 62 OBJECTS = $(patsubst $(DIR_SRC)/%.cpp,$(DIR_OBJ)/%.o,$(SOURCES)) 60 63 LOGS = $(patsubst $(DIR_DATA_TEST)/%.cfg,$(DIR_LOG)/%.log,$(wildcard $(DIR_DATA_TEST)/*.cfg)) 61 64 BENCHS = $(patsubst $(DIR_DATA_BENCH)/%.cfg,$(DIR_LOG)/%.log,$(wildcard $(DIR_DATA_BENCH)/*.cfg)) … … 73 76 -I$(DIR_INC) 74 77 78 #LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR)) \ 79 # $(ENVIRONMENT_LIBDIR) \ 80 # $(MORPHEO_LIBDIR) 81 82 # FIXME !!! 75 83 LIBDIR = $(SYSTEMC_LIBDIR_$(SIMULATOR)) \ 76 $(ENVIRONMENT_LIBDIR) \ 77 $(MORPHEO_LIBDIR) 84 -L$(DIR_LIB) 78 85 79 86 LIBNAME = $(ENVIRONMENT_LIBNAME) \ … … 99 106 .PRECIOUS : $(DIR_OBJ)/%.o $(DIR_BIN)/%.x $(DIR_LOG)/%.log 100 107 101 all : $(DIR_OBJ) $(DIR_BIN) 102 @\ 103 $(MAKE) $(EXEC) 104 105 $(DIR_BIN)/%.x : $(OBJECTS) 106 @\ 107 $(ECHO) "Compilation : $*";\ 108 $(CXX) $(PLATFORMS_L_FLAGS) -o $@ $^ $(LIBNAME); 108 all : $(EXEC) 109 110 $(DIR_BIN)/%.x : $(DIR_OBJ) $(DIR_BIN) 111 @\ 112 $(ECHO) "Linkage : $*";\ 113 case "${SIMULATOR}" in \ 114 "modelsim") \ 115 $(MAKE) $(WORK_NAME); \ 116 $(MODELTECH_SCCOM) $(PLATFORMS_CXX_FLAGS) $(SOURCES); \ 117 $(MODELTECH_SCCOM) -link $(PLATFORMS_L_FLAGS) $(LIBNAME); \ 118 $(ECHO) "#!$(SHELL)" > $@; \ 119 $(ECHO) "cd $${PWD};" >> $@; \ 120 $(ECHO) "$(MODELTECH_VSIM) -sc_arg "'"$${*}"'" $(WORK_NAME).top;" >> $@;\ 121 $(ECHO) "cd -;" >> $@; \ 122 $(CHMOD) +x $@; \ 123 ;; \ 124 *) \ 125 $(MAKE) $(OBJECTS); \ 126 $(CXX) $(PLATFORMS_L_FLAGS) -o $@ $(OBJECTS) $(LIBNAME); \ 127 ;; \ 128 esac; \ 129 109 130 110 131 test : $(DIR_LOG) all … … 141 162 execute : bench 142 163 164 # $(ECHO) $${data} | $(EXEC_PREFIX) $(EXEC) &> $$log; \ 165 143 166 $(DIR_LOG)/%.log : %.cfg 144 167 @\ … … 158 181 fi; \ 159 182 160 161 183 #-----[ Library + Software ]------------------------------- 162 184 … … 177 199 $(CXX) $(PLATFORMS_CXX_FLAGS) -c -o $@ $<; 178 200 179 $(DIR_OBJ) 201 $(DIR_OBJ) $(DIR_BIN) $(DIR_LOG) : 180 202 @\ 181 203 $(ECHO) "Create directory : $@";\ 182 204 $(MKDIR) $@ 183 205 184 $(DIR_BIN) :185 @\186 $(ECHO) "Create directory : $@";\187 $(MKDIR) $@188 189 $(DIR_LOG) :190 @\191 $(ECHO) "Create directory : $@";\192 $(MKDIR) $@193 194 206 #-----[ Clean + help ]------------------------------------- 195 207 … … 197 209 @\ 198 210 $(ECHO) "Delete temporary files in directory $(PWD)";\ 199 $(RM) *~ $(DIR_SRC)/*~ $(DIR_INC)/*~ $(DIR_DATA_TEST)/*~ $(DIR_DATA_BENCH)/*~ *core* tty* *.vhdl *.log *.stat *.pos\ 200 $(DIR_OBJ) $(DIR_BIN) $(DIR_LOG); 211 $(RM) $(OBJECTS) $(EXEC) \ 212 *~ $(DIR_SRC)/*~ $(DIR_INC)/*~ $(DIR_DATA_TEST)/*~ $(DIR_DATA_BENCH)/*~ \ 213 *core* \ 214 tty* \ 215 *.vhdl \ 216 *.log \ 217 *.stat \ 218 *.pos \ 219 modelsim.ini transcript *wlf* $(WORK_NAME) 201 220 202 221 clean_all : clean 203 222 @\ 204 223 $(ECHO) "Delete generated files in directory $(PWD)";\ 224 $(RM) $(DIR_OBJ) $(DIR_BIN) $(DIR_LOG);\ 205 225 $(MAKE) --directory=$(DIR_SOFT) --makefile=Makefile clean_all; \ 206 226 $(MAKE) --directory=$(ENVIRONMENT_DIR) --makefile=Makefile clean_all; \ … … 223 243 $(ECHO) ""; 224 244 245 include $(MORPHEO_TOPLEVEL)/IPs/systemC/processor/Morpheo/Behavioural/Makefile.Synthesis 225 246 include $(MORPHEO_TOPLEVEL)/IPs/systemC/processor/Morpheo/Makefile.deps 226 247 include $(MORPHEO_TOPLEVEL)/IPs/systemC/Environment/Makefile.deps -
trunk/Platforms/Test/include/test.h
r88 r113 9 9 */ 10 10 11 #include <systemc.h> 11 12 #include "Morpheo.h" 12 13 #include <iostream> … … 23 24 ); 24 25 26 #ifdef MTI_SYSTEMC 27 class top : public sc_module 28 { 29 //public : top (int argc, char * argv[]); 30 public : top (sc_module_name name); 31 }; 25 32 #endif 33 #endif -
trunk/Platforms/Test/src/sc_main.cpp
r88 r113 12 12 using namespace morpheo; 13 13 14 void usage (int argc, char * argv[]) 14 void usage (int argc 15 #ifdef MTI_SYSTEMC 16 ,const char * const * argv 17 #else 18 ,char * argv[] 19 #endif 20 ) 15 21 { 16 cerr << "<Usage> " << argv[0] << " list_params." <<endl17 << " list_params is :" << endl22 cerr << "<Usage> " << argv[0] << endl 23 << "In input stream : " << endl 18 24 << " * filename_simulator (string )" << endl 19 25 << " * filename_generator (string )" << endl … … 27 33 } 28 34 35 #ifdef MTI_SYSTEMC 36 SC_MODULE_EXPORT(top); 37 38 top::top (sc_module_name name) 39 #else 29 40 int sc_main (int argc, char * argv[]) 41 #endif 30 42 { 31 43 cout << "<sc_main> Begin" << endl; 44 45 #ifdef MTI_SYSTEMC 46 // accessing command-line arguments with modelsim 47 int argc; 48 const char * const * argv; 49 50 argc = sc_argc (); 51 argv = sc_argv (); 52 #endif 32 53 33 54 for (int32_t i=0; i<argc; ++i) 34 55 cout << argv[i] << " "; 35 56 cout << endl; 36 57 37 58 //============================================================================== 38 59 //===== [ Parameters ]========================================================== 39 60 //============================================================================== 40 61 41 62 if (argc != 9) 42 63 usage (argc, argv); 43 64 44 65 uint32_t x = 1; 45 66 string filename_simulator = argv[x++]; … … 51 72 uint32_t cache_size = fromString<uint32_t>(argv[x++]); 52 73 uint32_t cache_ratio = fromString<uint32_t>(argv[x++]); 74 75 // string filename_simulator; 76 // string filename_generator; 77 // string filename_instance ; 78 // string filename_software ; 79 // uint32_t nb_cache_dedicated; 80 // uint32_t nb_cache_shared ; 81 // uint32_t cache_size ; 82 // uint32_t cache_ratio ; 83 84 // cout << "get filename_simulator ? " << endl; 85 // cin >> filename_simulator ; 86 87 // cout << "get filename_generator ? " << endl; 88 // cin >> filename_generator ; 89 90 // cout << "get filename_instance ? " << endl; 91 // cin >> filename_instance ; 92 93 // cout << "get filename_software ? " << endl; 94 // cin >> filename_software ; 95 96 // cout << "get nb_cache_dedicated ? " << endl; 97 // cin >> nb_cache_dedicated ; 98 99 // cout << "get nb_cache_shared ? " << endl; 100 // cin >> nb_cache_shared ; 101 102 // cout << "get size cache L1 (byte) ? " << endl; 103 // cin >> cache_size ; 104 105 // cout << "get ratio cache ? " << endl; 106 // cin >> cache_ratio ; 53 107 54 108 morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void) = NULL; … … 64 118 get_custom_information); 65 119 120 cout << " * return : " << _return << endl; 66 121 cout << "<sc_main> End" << endl; 67 122 123 #ifndef MTI_SYSTEMC 68 124 return _return; 125 #endif 69 126 }
Note: See TracChangeset
for help on using the changeset viewer.