Changeset 113 for trunk/IPs/systemC/processor/Morpheo/Common
- Timestamp:
- Apr 14, 2009, 8:39:12 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Common
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Common/Makefile.defs
r81 r113 5 5 # 6 6 7 ENTITY = Common 8 7 9 #-----[ Directory ]---------------------------------------- 8 10 DIR_COMPONENT_MORPHEO = .. -
trunk/IPs/systemC/processor/Morpheo/Common/Makefile.deps
r81 r113 16 16 #-----[ Library ]------------------------------------------ 17 17 18 Common_SOURCES = $(Common_DIR)/src/*.cpp 19 18 20 Common_LIBRARY = -lCommon 19 21 -
trunk/IPs/systemC/processor/Morpheo/Common/include/BitManipulation.h
r88 r113 42 42 }; 43 43 44 template <typename T> 45 T gen_mask_not (uint32_t size) 46 { 47 return gen_mask_not<T>(size-1,0); 48 }; 49 44 50 //............................................................................ 45 51 // mask, mask_not ............................................................ -
trunk/IPs/systemC/processor/Morpheo/Common/include/Debug.h
r112 r113 24 24 */ 25 25 26 #include "Common/include/Systemc.h" 26 27 #include "Common/include/Message.h" 27 28 #include "Common/include/FromString.h" … … 64 65 #define debug_test_simulation_time \ 65 66 (not debug_cycle_test or \ 66 ( (s c_simulation_time() >= debug_cycle_start) and \67 ((s c_simulation_time() <= debug_cycle_stop) or \67 ( (simulation_cycle() >= debug_cycle_start) and \ 68 ((simulation_cycle() <= debug_cycle_stop) or \ 68 69 (debug_cycle_stop == -1)))) 69 70 #else … … 149 150 do \ 150 151 { \ 151 log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(s c_simulation_time()),name,func); \152 log_printf(TRACE,component,func,_("[%d] %s.%s"),static_cast<uint32_t>(simulation_cycle()),name,func); \ 152 153 } while(0) 153 154 -
trunk/IPs/systemC/processor/Morpheo/Common/include/Environment.h
r88 r113 14 14 15 15 #if (defined(STATISTICS) and not defined(SYSTEMC)) 16 # 16 # error "To have the statistics, you must set flags SYSTEMC" 17 17 #endif 18 18 19 19 #if (defined(INFORMATION) and not defined(STATISTICS)) 20 # 20 # error "To have the information, you must set flags STATISTICS" 21 21 #endif 22 22 23 23 #if (defined(VHDL_TESTBENCH) and not defined(SYSTEMC)) 24 # 24 # error "To have the vhdl's test bench, you must set flags SYSTEMC" 25 25 #endif 26 26 27 27 #if (defined(VHDL_TESTBENCH) and not defined(VHDL)) 28 # 28 # error "To have the vhdl's test bench, you must set flags VHDL" 29 29 #endif 30 30 31 31 #if (defined(VHDL_TESTBENCH_ASSERT) and not defined(VHDL_TESTBENCH)) 32 # 32 # error "To have an assert in vhdl's test bench, you must set flags VHDL_TESTBENCH" 33 33 #endif 34 34 35 35 #if (defined(VHDL_TESTBENCH) and defined(SYSTEMC)) 36 # 36 # define SYSTEMC_VHDL_COMPATIBILITY 37 37 #endif 38 38 39 39 #if (defined(DEBUG)) 40 # define DEBUG_TEST 40 # define DEBUG_TEST 41 #endif 42 43 #if defined(MTI_SYSTEMC) and defined(SYSTEMC) and defined(VHDL) 44 # define MODELSIM_COSIMULATION 41 45 #endif 42 46 -
trunk/IPs/systemC/processor/Morpheo/Common/include/Message.h
r97 r113 33 33 # define MSG_INFORMATION _("[1;32m[INFORMATION][0m") 34 34 # define MSG_BREAKPOINT _("[1;38m[ BREAK ][0m") 35 # define MSG_VHDL _("[1;34m[ VHDL ][0m") 35 36 #else 36 37 # define MSG_DEBUG _("[ DEBUG ]") … … 39 40 # define MSG_INFORMATION _("[INFORMATION]") 40 41 # define MSG_BREAKPOINT _("[ BREAK ]") 42 # define MSG_VHDL _("[ VHDL ]") 41 43 #endif 42 44 … … 84 86 85 87 #define msg(arg...) fmsg(stdout,arg) 88 #define err(arg...) fmsgError(stderr,arg) 89 86 90 #define msgDebug(arg...) fmsgDebug(stdout,arg) 87 91 #define msgError(arg...) fmsgError(stdout,arg) 88 92 #define msgWarning(arg...) fmsgWarning(stdout,arg) 89 93 #define msgInformation(arg...) fmsgInformation(stdout,arg) 90 #define err(arg...) fmsgError(stderr,arg)91 94 92 95 }; // end namespace morpheo -
trunk/IPs/systemC/processor/Morpheo/Common/include/Test.h
r88 r113 16 16 #include "Common/include/ErrorMorpheo.h" 17 17 #include "Common/include/ToString.h" 18 18 #include "Common/include/Systemc.h" 19 19 namespace morpheo { 20 20 … … 26 26 inline void test_ko_error (void) 27 27 { 28 std::string msg = "Test ko : error in test \""+morpheo::toString(num_test)+"\"";28 std::string msg = morpheo::toString(_("Test ko : error in test \"%d\""),num_test); 29 29 throw (morpheo::ErrorMorpheo (msg)); 30 30 } … … 33 33 inline void test_ko (char * file, uint32_t line, T exp1, T exp2) 34 34 { 35 fflush (stdout); 36 fflush (stderr); 37 38 std::cerr << "[" << num_test << "] : " << STR_KO 39 << "\tline " << line << std::endl 40 << " * Localisation" << std::endl 41 << " - File : " << file << std::endl 42 << " - Line : " << line << std::endl 43 << " * Expression is different" << std::endl 44 << " - exp1 : "+morpheo::toString(exp1) << std::endl 45 << " - exp2 : "+morpheo::toString(exp2) << std::endl; 35 msgError(_("[%d] : %s\n"),num_test,STR_KO); 36 msgError(_(" * Localisation\n")); 37 msgError(_(" - File : %s\n"),file); 38 msgError(_(" - Line : %d\n"),line); 39 msgError(_(" * Expression is different\n")); 40 msgError(_(" - exp1 : %s\n"),morpheo::toString(exp1).c_str()); 41 msgError(_(" - exp2 : %s\n"),morpheo::toString(exp2).c_str()); 46 42 47 43 test_ko_error (); … … 50 46 inline void test_ko (char * file, uint32_t line) 51 47 { 52 fflush (stdout); 53 fflush (stderr); 54 55 std::cerr << "[" << num_test << "] : " << STR_KO 56 << "\tline " << line << std::endl 57 << " * Localisation" << std::endl 58 << " - File : " << file << std::endl 59 << " - Line : " << line << std::endl; 48 msgError(_("[%d] : %s\n"),num_test,STR_KO); 49 msgError(_(" * Localisation\n")); 50 msgError(_(" - File : %s\n"),file); 51 msgError(_(" - Line : %d\n"),line); 60 52 61 53 test_ko_error (); … … 64 56 inline void test_ok () 65 57 { 66 fflush (stdout); 67 fflush (stderr); 68 69 msg (_("[%d] : %s\n"), num_test,STR_OK); 58 msgInformation (_("[%d] : %s\n"), num_test,STR_OK); 70 59 71 60 num_test ++; … … 74 63 inline void test_ok (char * file, uint32_t line) 75 64 { 76 fflush (stdout); 77 fflush (stderr); 78 79 msg (_("[%d] : %s\n"), num_test,STR_OK); 80 msg (_("\tline %d\n"), line); 65 msgInformation (_("[%d] : %s (line %d)\n"), num_test,STR_OK,line); 66 msgInformation (_(" - Line : %d\n"), line); 81 67 82 68 num_test ++; … … 86 72 inline void test_ok (char * file, uint32_t line, T exp) 87 73 { 88 fflush (stdout); 89 fflush (stderr); 90 91 msg (_("[%d] : %s\n"), num_test, STR_OK); 92 msg (_("\tline %d\n"), line); 93 msg (_("\tvalue %s\n"), (morpheo::toString(exp)).c_str()); 74 msgInformation (_("[%d] : %s\n"), num_test, STR_OK); 75 msgInformation (_(" - Line : %d\n"), line); 76 msgInformation (_(" - Value : %s\n"), (morpheo::toString(exp)).c_str()); 94 77 95 78 num_test ++; … … 112 95 #define LABEL(str...) \ 113 96 { \ 114 msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time())); \ 115 msg (str); \ 116 msg (_("\n")); \ 117 fflush (stdout); \ 97 msgInformation (_("{%.0f} "),simulation_cycle()); \ 98 msg (str); \ 99 msg (_("\n")); \ 118 100 } while(0) 119 101 … … 122 104 #endif 123 105 124 #define SC_ START(cycle_offset) \106 #define SC_CYCLE(cycle_offset) \ 125 107 do \ 126 108 { \ 127 /*cout << "SC_ START(begin)" << endl;*/ \109 /*cout << "SC_CYCLE (begin)" << endl;*/ \ 128 110 \ 129 uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time());\111 double cycle_current = simulation_cycle(); \ 130 112 if (cycle_offset != 0) \ 131 113 { \ 132 cout << "##########[ cycle "<< cycle_current+cycle_offset << " ] (" << __LINE__ << ")" << endl; \114 msgInformation(_("##########[ cycle %.0f ] (%d)\n"),cycle_current+cycle_offset,__LINE__); \ 133 115 } \ 134 116 \ … … 138 120 } \ 139 121 \ 140 s c_start(cycle_offset);\122 simulation_run(cycle_offset); \ 141 123 \ 142 /*cout << "SC_ START(end )" << endl;*/ \124 /*cout << "SC_CYCLE (end )" << endl;*/ \ 143 125 } while(0) 144 126 145 127 // old support 128 #ifndef MTI_SYSTEMC 129 # define SC_START(x) SC_CYCLE(x) 130 #endif 146 131 147 132 }; -
trunk/IPs/systemC/processor/Morpheo/Common/include/Time.h
r97 r113 9 9 #include <iostream> 10 10 #include <sys/time.h> 11 #include "Common/include/Systemc.h" 11 12 12 13 namespace morpheo { … … 28 29 { 29 30 #ifdef SYSTEMC 30 nb_cycles_begin = s c_simulation_time();31 nb_cycles_begin = simulation_cycle(); 31 32 #endif 32 33 gettimeofday(&time_begin,NULL); … … 48 49 if (x.systemc) 49 50 { 50 double nb_cycles_end = s c_simulation_time();51 double nb_cycles_end = simulation_cycle(); 51 52 double average = static_cast<double>(nb_cycles_end-x.nb_cycles_begin+1) / static_cast<double>(time_end.tv_sec-x.time_begin.tv_sec+1); 52 53 -
trunk/IPs/systemC/processor/Morpheo/Common/src/MemCheck.cpp
r112 r113 10 10 // Global flags set by macros in MemCheck.h 11 11 bool traceFlag = false; 12 bool activeFlag = true;12 bool activeFlag = false; 13 13 14 14 namespace {
Note: See TracChangeset
for help on using the changeset viewer.