Last change
on this file since 71 was
71,
checked in by rosiere, 16 years ago
|
Modification of Statisctics
Add a new systemC component : Load_Store_Queue (tested with one benchmark and one configuration). Store don't supported the Data Buss Error (Load is supported)
|
File size:
1.5 KB
|
Rev | Line | |
---|
[2] | 1 | #ifdef STATISTICS |
---|
| 2 | |
---|
| 3 | /* |
---|
| 4 | * $Id$ |
---|
| 5 | * |
---|
| 6 | * [ Description ] |
---|
| 7 | * |
---|
| 8 | */ |
---|
| 9 | |
---|
| 10 | #include "Behavioural/include/Statistics.h" |
---|
| 11 | #include <time.h> |
---|
| 12 | #include <sstream> |
---|
| 13 | #include <fstream> |
---|
| 14 | |
---|
| 15 | namespace morpheo { |
---|
| 16 | namespace behavioural { |
---|
| 17 | |
---|
[43] | 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Statistics::generate_file" |
---|
[71] | 20 | void Statistics::generate_file(std::string stat) |
---|
[2] | 21 | { |
---|
[43] | 22 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 23 | |
---|
[71] | 24 | std::stringstream filename; |
---|
[2] | 25 | filename << _name << ".stat"; |
---|
| 26 | |
---|
[71] | 27 | std::cout << "Generate file \""<< filename.str() << "\"" << std::endl; |
---|
[2] | 28 | |
---|
[71] | 29 | std::ofstream file; |
---|
| 30 | file.open(filename.str().c_str(),std::ios::out | std::ios::trunc); |
---|
[2] | 31 | |
---|
| 32 | time_t current_time; |
---|
| 33 | time (¤t_time); |
---|
| 34 | |
---|
| 35 | // print header |
---|
[71] | 36 | file << "<!-- " << std::endl |
---|
| 37 | << "\tfile : " << filename.str() << std::endl |
---|
[2] | 38 | << "\tdate : " << ctime (¤t_time ) |
---|
[71] | 39 | << "\tcomment : it's a autogenerated file : don't modify" << std::endl |
---|
| 40 | << "-->" << std::endl |
---|
| 41 | << std::endl; |
---|
[2] | 42 | |
---|
| 43 | file << stat; |
---|
| 44 | |
---|
| 45 | file.close(); |
---|
[43] | 46 | |
---|
| 47 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
[2] | 48 | } |
---|
| 49 | |
---|
[43] | 50 | #undef FUNCTION |
---|
| 51 | #define FUNCTION "Statistics::generate_file" |
---|
[2] | 52 | void Statistics::generate_file(void) |
---|
| 53 | { |
---|
[43] | 54 | log_printf(FUNC,Behavioural,FUNCTION,"Begin"); |
---|
| 55 | |
---|
[2] | 56 | generate_file(print(0)); |
---|
[43] | 57 | |
---|
| 58 | log_printf(FUNC,Behavioural,FUNCTION,"End"); |
---|
[2] | 59 | }; |
---|
| 60 | |
---|
| 61 | }; // end namespace behavioural |
---|
| 62 | }; // end namespace morpheo |
---|
| 63 | |
---|
| 64 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.