source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Stat_type.h @ 146

Last change on this file since 146 was 146, checked in by rosiere, 13 years ago

1) Integration of RegisterFile_Internal_Banked in RegisterFile?
2) Erase "read_write" interface in RegisterFile_Monolithic component
3) Add smith predictor parameters in Load_store_pointer_unit.
4) Fix not statistics flags

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.8 KB
Line 
1#ifndef morpheo_behavioural_Stat_type_h
2#define morpheo_behavioural_Stat_type_h
3
4#include <string>
5#include <map>
6#include <utility>
7#include <cassert>
8#include <stdint.h>
9
10namespace morpheo {
11namespace behavioural {
12
13  typedef double counter_t ;
14
15  typedef enum{add, sub, mul, div, inc, dec} operator_t;
16
17#ifdef STATISTICS
18
19  typedef enum{TYPE_VARIABLE, TYPE_COUNTER} counter_type_t;
20
21//typedef std::pair<operator_t, std::string> pair_operator_string_t;
22//typedef std::pair<std::string, operator_t> pair_string_operator_t;
23
24  class counters_t
25  {
26  private : const uint32_t     _nb_counter;
27  private :       counter_t ** _counter;
28
29  public  : counters_t (uint32_t nb_counter):
30    _nb_counter (nb_counter+1)
31    {
32      assert(nb_counter>0);
33
34      _counter = new counter_t * [_nb_counter];
35    }
36
37  // public : counters_t (const counters_t & x):
38  //   _nb_counter (x._nb_counter)
39  //   {
40  //     _counter = new counter_t [_nb_counter];
41     
42  //     for (uint32_t i=0; i<_nb_counter; ++i)
43  //       _counter[i] = x._counter[i];
44  //   }
45   
46  public  : ~counters_t (void)
47    {
48      delete [] _counter;
49    }
50
51  public  : void set_counter (counter_t * counter,
52                              uint32_t    index)
53    {
54      assert((index >= 0) and (index < _nb_counter));
55
56      _counter [index] = counter;
57    }
58
59  // public : friend const counters_t  operator+ (const counters_t & left,
60  //                                              const uint32_t     right)
61  //   {
62  //     assert((right >= 0) and (right <= left._nb_counter));
63     
64  //     counters_t tmp=left;
65     
66  //     tmp._counter[right] ++;
67   
68  //     return tmp;
69  //   }
70
71  public : const counters_t & operator+= (const uint32_t value)
72    {
73      assert((value >= 0) and (value <= _nb_counter));
74     
75      (*_counter[value]) ++;
76     
77      return *this;
78    }
79
80  };
81
82#endif
83
84};
85};
86#endif
Note: See TracBrowser for help on using the repository browser.