source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Group/src/Statistics_add.cpp @ 55

Last change on this file since 55 was 55, checked in by rosiere, 17 years ago

Ajout SystemC read_queue et reservation_station
Ajout port au bloc registerfile_monolithic (à ajouter également au bloc registerfile et registerfile_multi_banked)
Modif param : passage de pointeur (attention, tous les composants n'ont pas été tous modifier)

File size: 1.5 KB
Line 
1#ifdef STATISTICS
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Generic/Group/include/Statistics.h"
10#include "Behavioural/src/Statistics_test_if_save.cpp"
11#include "Behavioural/src/Statistics_save.cpp"
12#include <sstream>
13using namespace std;
14
15namespace morpheo                    {
16namespace behavioural                {
17namespace generic                    {
18namespace group                      {
19
20  // Explicite instanciation
21  template void behavioural::Statistics::test_if_save<behavioural::generic::group::Counters,
22                                                      behavioural::generic::group::Parameters>
23  (behavioural::generic::group::Counters ** &,
24   behavioural::generic::group::Parameters);
25
26  template void behavioural::Statistics::save        <behavioural::generic::group::Counters,
27                                                      behavioural::generic::group::Parameters>
28  (behavioural::generic::group::Counters ** &,
29   behavioural::generic::group::Parameters);
30       
31
32  void Statistics::add (uint32_t nb_use)
33  {
34    test_if_save<Counters,Parameters>(_counters,*_parameters);
35
36    if (_nb_statistics>0)
37      {
38        int i = _nb_statistics-1;
39        _counters[i]->_nb_use += nb_use;
40
41        if (nb_use == 0)
42          _counters[i]->_nb_cycle_none_use   ++;
43        else 
44          if (nb_use == _parameters->_nb_elt)
45            _counters[i]->_nb_cycle_full_use   ++;
46          else
47            _counters[i]->_nb_cycle_normal_use ++;
48      }
49  };
50
51}; // end namespace group
52}; // end namespace generic
53}; // end namespace behavioural         
54}; // end namespace morpheo             
55#endif
Note: See TracBrowser for help on using the repository browser.