source: trunk/IPs/systemC/processor/Morpheo/Behavioural/src/Statistics_generate_file.cpp @ 71

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
Line 
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
15namespace morpheo              {
16namespace behavioural          {
17
18#undef  FUNCTION
19#define FUNCTION "Statistics::generate_file"
20  void Statistics::generate_file(std::string stat)
21  {
22    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
23
24    std::stringstream filename;
25    filename << _name << ".stat";
26
27    std::cout << "Generate file \""<< filename.str() << "\"" << std::endl;
28
29    std::ofstream file;
30    file.open(filename.str().c_str(),std::ios::out | std::ios::trunc);
31
32    time_t current_time;
33    time (&current_time);
34
35    // print header
36    file << "<!-- "                                                    << std::endl
37         << "\tfile        : " << filename.str()                       << std::endl
38         << "\tdate        : " << ctime (&current_time )
39         << "\tcomment     : it's a autogenerated file : don't modify" << std::endl
40         << "-->"                                                      << std::endl
41         <<                                                               std::endl;
42         
43    file << stat;
44   
45    file.close();
46
47    log_printf(FUNC,Behavioural,FUNCTION,"End");
48  }
49
50#undef  FUNCTION
51#define FUNCTION "Statistics::generate_file"
52  void Statistics::generate_file(void)
53  {
54    log_printf(FUNC,Behavioural,FUNCTION,"Begin");
55
56    generate_file(print(0));
57
58    log_printf(FUNC,Behavioural,FUNCTION,"End");
59  };
60
61}; // end namespace behavioural         
62}; // end namespace morpheo             
63
64#endif
Note: See TracBrowser for help on using the repository browser.