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

Last change on this file since 145 was 145, checked in by rosiere, 14 years ago

1) add test with SPECINT2K
2) new config of Selftest
3) modif RAT to support multiple depth_save ... but not finish (need fix Update Prediction Table)
4) add Function_pointer but need fix

  • Property svn:keywords set to Id
File size: 5.0 KB
Line 
1#ifdef STATISTICS
2/*
3 * $Id: Context_State_statistics_allocation.cpp 145 2010-10-13 18:15:51Z 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_variable("nb_cycle_state_ok_"                     +toString(i));
43        _stat_nb_cycle_state_ko_excep                [i] = _stat->create_variable("nb_cycle_state_ko_excep_"               +toString(i));
44        _stat_nb_cycle_state_ko_miss_branch          [i] = _stat->create_variable("nb_cycle_state_ko_miss_branch_"         +toString(i));
45        _stat_nb_cycle_state_ko_miss_load            [i] = _stat->create_variable("nb_cycle_state_ko_miss_load_"           +toString(i));
46        _stat_nb_cycle_state_ko_miss_load_and_branch [i] = _stat->create_variable("nb_cycle_state_ko_miss_load_and_branch_"+toString(i));
47        _stat_nb_cycle_state_ko_msync                [i] = _stat->create_variable("nb_cycle_state_ko_msync_"               +toString(i));
48        _stat_nb_cycle_state_ko_psync                [i] = _stat->create_variable("nb_cycle_state_ko_psync_"               +toString(i));
49        _stat_nb_cycle_state_ko_csync                [i] = _stat->create_variable("nb_cycle_state_ko_csync_"               +toString(i));
50        _stat_nb_cycle_state_ko_spr                  [i] = _stat->create_variable("nb_cycle_state_ko_spr_"                 +toString(i));
51
52        _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));
53        _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));
54        _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));
55        _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));
56        _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));
57        _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));
58        _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));
59        _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));
60        _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));
61      }
62
63    log_end(Context_State,FUNCTION);
64  };
65
66}; // end namespace context_state
67}; // end namespace front_end
68}; // end namespace multi_front_end
69}; // end namespace core
70
71}; // end namespace behavioural
72}; // end namespace morpheo             
73#endif
Note: See TracBrowser for help on using the repository browser.