source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_statistics_allocation.cpp @ 120

Last change on this file since 120 was 120, checked in by rosiere, 15 years ago

1) Context_state : Add statistics
2) Add configuration with multi front_end
3) Add optionnal pid at log filename

  • Property svn:keywords set to Id
File size: 5.7 KB
Line 
1#ifdef STATISTICS
2/*
3 * $Id: Context_State_statistics_allocation.cpp 120 2009-05-26 19:01:47Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Context_State.h"
10#include "Behavioural/include/Allocation.h"
11
12namespace morpheo {
13namespace behavioural {
14namespace core {
15namespace multi_front_end {
16namespace front_end {
17namespace context_state {
18
19
20#undef  FUNCTION
21#define FUNCTION "Context_State::statistics_allocation"
22  void Context_State::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics)
23  {
24    log_begin(Context_State,FUNCTION);
25
26    _stat = new Stat (static_cast<std::string>(_name),
27                      "Context_State",
28                      param_statistics);
29
30    ALLOC1(_stat_nb_cycle_state_ok                     ,counter_t *,_param->_nb_context);
31    ALLOC1(_stat_nb_cycle_state_ko_excep               ,counter_t *,_param->_nb_context);
32    ALLOC1(_stat_nb_cycle_state_ko_miss_branch         ,counter_t *,_param->_nb_context);
33    ALLOC1(_stat_nb_cycle_state_ko_miss_load           ,counter_t *,_param->_nb_context);
34    ALLOC1(_stat_nb_cycle_state_ko_miss_load_and_branch,counter_t *,_param->_nb_context);
35    ALLOC1(_stat_nb_cycle_state_ko_msync               ,counter_t *,_param->_nb_context);
36    ALLOC1(_stat_nb_cycle_state_ko_psync               ,counter_t *,_param->_nb_context);
37    ALLOC1(_stat_nb_cycle_state_ko_csync               ,counter_t *,_param->_nb_context);
38    ALLOC1(_stat_nb_cycle_state_ko_spr                 ,counter_t *,_param->_nb_context);
39
40    for (uint32_t i=0; i<_param->_nb_context; ++i)
41      {
42        _stat_nb_cycle_state_ok                      [i] = _stat->create_counter("nb_cycle_state_ok_"                     +toString(i),"",toString(_("Number of cycle in state ok                      (context %d)"),i));
43        _stat_nb_cycle_state_ko_excep                [i] = _stat->create_counter("nb_cycle_state_ko_excep_"               +toString(i),"",toString(_("Number of cycle in state ko_excep                (context %d)"),i));
44        _stat_nb_cycle_state_ko_miss_branch          [i] = _stat->create_counter("nb_cycle_state_ko_miss_branch_"         +toString(i),"",toString(_("Number of cycle in state ko_miss_branch          (context %d)"),i));
45        _stat_nb_cycle_state_ko_miss_load            [i] = _stat->create_counter("nb_cycle_state_ko_miss_load_"           +toString(i),"",toString(_("Number of cycle in state ko_miss_load            (context %d)"),i));
46        _stat_nb_cycle_state_ko_miss_load_and_branch [i] = _stat->create_counter("nb_cycle_state_ko_miss_load_and_branch_"+toString(i),"",toString(_("Number of cycle in state ko_miss_load_and_branch (context %d)"),i));
47        _stat_nb_cycle_state_ko_msync                [i] = _stat->create_counter("nb_cycle_state_ko_msync_"               +toString(i),"",toString(_("Number of cycle in state ko_msync                (context %d)"),i));
48        _stat_nb_cycle_state_ko_psync                [i] = _stat->create_counter("nb_cycle_state_ko_psync_"               +toString(i),"",toString(_("Number of cycle in state ko_psync                (context %d)"),i));
49        _stat_nb_cycle_state_ko_csync                [i] = _stat->create_counter("nb_cycle_state_ko_csync_"               +toString(i),"",toString(_("Number of cycle in state ko_csync                (context %d)"),i));
50        _stat_nb_cycle_state_ko_spr                  [i] = _stat->create_counter("nb_cycle_state_ko_spr_"                 +toString(i),"",toString(_("Number of cycle in state ko_spr                  (context %d)"),i));
51
52
53        _stat->create_expr_percent("percent_state_ok_"                     +toString(i),"nb_cycle_state_ok_"                     +toString(i),"cycle",toString(_("Percent of cycle in state ok                      (context %d)"),i));
54        _stat->create_expr_percent("percent_state_ko_excep_"               +toString(i),"nb_cycle_state_ko_excep_"               +toString(i),"cycle",toString(_("Percent of cycle in state ko_excep                (context %d)"),i));
55        _stat->create_expr_percent("percent_state_ko_miss_branch_"         +toString(i),"nb_cycle_state_ko_miss_branch_"         +toString(i),"cycle",toString(_("Percent of cycle in state ko_miss_branch          (context %d)"),i));
56        _stat->create_expr_percent("percent_state_ko_miss_load_"           +toString(i),"nb_cycle_state_ko_miss_load_"           +toString(i),"cycle",toString(_("Percent of cycle in state ko_miss_load            (context %d)"),i));
57        _stat->create_expr_percent("percent_state_ko_miss_load_and_branch_"+toString(i),"nb_cycle_state_ko_miss_load_and_branch_"+toString(i),"cycle",toString(_("Percent of cycle in state ko_miss_load_and_branch (context %d)"),i));
58        _stat->create_expr_percent("percent_state_ko_msync_"               +toString(i),"nb_cycle_state_ko_msync_"               +toString(i),"cycle",toString(_("Percent of cycle in state ko_msync                (context %d)"),i));
59        _stat->create_expr_percent("percent_state_ko_psync_"               +toString(i),"nb_cycle_state_ko_psync_"               +toString(i),"cycle",toString(_("Percent of cycle in state ko_psync                (context %d)"),i));
60        _stat->create_expr_percent("percent_state_ko_csync_"               +toString(i),"nb_cycle_state_ko_csync_"               +toString(i),"cycle",toString(_("Percent of cycle in state ko_csync                (context %d)"),i));
61        _stat->create_expr_percent("percent_state_ko_spr_"                 +toString(i),"nb_cycle_state_ko_spr_"                 +toString(i),"cycle",toString(_("Percent of cycle in state ko_spr                  (context %d)"),i));
62      }
63
64    log_end(Context_State,FUNCTION);
65  };
66
67}; // end namespace context_state
68}; // end namespace front_end
69}; // end namespace multi_front_end
70}; // end namespace core
71
72}; // end namespace behavioural
73}; // end namespace morpheo             
74#endif
Note: See TracBrowser for help on using the repository browser.