source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Icache_Access/src/Icache_Access_statistics_allocation.cpp @ 88

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

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1#ifdef STATISTICS
2/*
3 * $Id: Icache_Access_statistics_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Icache_Access/include/Icache_Access.h"
10
11namespace morpheo {
12namespace behavioural {
13namespace core {
14namespace icache_access {
15
16
17#undef  FUNCTION
18#define FUNCTION "Icache_Access::statistics_allocation"
19  void Icache_Access::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics)
20  {
21    log_begin(Icache_Access,FUNCTION);
22
23    _stat = new Stat (static_cast<std::string>(_name),
24                      "Icache_Access",
25                      param_statistics);
26
27    _stat_nb_access         = new counter_t * [_param->_nb_icache_port];
28    _stat_nb_access_conflit = new counter_t * [_param->_nb_icache_port];
29
30    std::string _sum_nb_access         = "";
31    std::string _sum_nb_access_conflit = "";
32
33    for (uint32_t i=0; i<_param->_nb_icache_port; i++)
34      {
35        _stat_nb_access         [i] = _stat->create_counter("nb_access_"        +toString(i),"",toString(_("Total access achieved by all contexts (port %d)"),i));
36        _stat_nb_access_conflit [i] = _stat->create_counter("nb_access_conflit_"+toString(i),"",toString(_("Total access conducting a conflict (port %d)"),i));
37
38        if (i == 0)
39          {
40            _sum_nb_access         = "nb_access_0";
41            _sum_nb_access_conflit = "nb_access_conflit_0";
42          }
43        else
44          {
45            _sum_nb_access         = "+ nb_access_"         +toString(i)+" "+ _sum_nb_access        ;
46            _sum_nb_access_conflit = "+ nb_access_conflit_" +toString(i)+" "+ _sum_nb_access_conflit;
47          }
48       
49        _stat->create_expr_percent ("percent_access_conflit_"+toString(i), "nb_access_conflit_"+toString(i), "nb_access_"+toString(i),toString(_("Percent for total access conducting a conflict (port %d)"),i));
50
51
52        _stat->create_expr_average_by_cycle ("average_nb_icache_access_"+toString(i),"- nb_access_"+toString(i)+" nb_access_conflit_"+toString(i),"",toString(_("Average of icache access (port %d)"),i));
53      }
54
55    _stat->create_expr         ("nb_access"        , _sum_nb_access        , TYPE_COUNTER, "", _("Total access achieved by all contexts (all port)"));
56    _stat->create_expr         ("nb_access_conflit", _sum_nb_access_conflit, TYPE_COUNTER, "", _("Total access conducting a conflict (all port)"));
57
58    _stat->create_expr_percent ("percent_access_conflit", _sum_nb_access_conflit, _sum_nb_access,_("Percent for total access conducting a conflict"));
59
60    _stat->create_expr_average_by_cycle ("average_nb_icache_access","- nb_access nb_access_conflit","",_("Average of icache access (all port)"));
61    log_end(Icache_Access,FUNCTION);
62  };
63
64}; // end namespace icache_access
65}; // end namespace core
66
67}; // end namespace behavioural
68}; // end namespace morpheo             
69#endif
Note: See TracBrowser for help on using the repository browser.