[88] | 1 | #ifdef STATISTICS |
---|
| 2 | /* |
---|
| 3 | * $Id: Dcache_Access_statistics_allocation.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Dcache_Access/include/Dcache_Access.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace dcache_access { |
---|
| 15 | |
---|
| 16 | |
---|
| 17 | #undef FUNCTION |
---|
| 18 | #define FUNCTION "Dcache_Access::statistics_allocation" |
---|
| 19 | void Dcache_Access::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics) |
---|
| 20 | { |
---|
| 21 | log_begin(Dcache_Access,FUNCTION); |
---|
| 22 | |
---|
| 23 | _stat = new Stat (static_cast<std::string>(_name), |
---|
| 24 | "Dcache_Access", |
---|
| 25 | param_statistics); |
---|
| 26 | |
---|
| 27 | _stat_nb_access = new counter_t * [_param->_nb_dcache_port]; |
---|
| 28 | _stat_nb_access_conflit = new counter_t * [_param->_nb_dcache_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_dcache_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_dcache_access_"+toString(i),"- nb_access_"+toString(i)+" nb_access_conflit_"+toString(i),"",toString(_("Average of dcache 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_dcache_access","- nb_access nb_access_conflit","",_("Average of dcache access (all port)")); |
---|
| 61 | |
---|
| 62 | log_end(Dcache_Access,FUNCTION); |
---|
| 63 | }; |
---|
| 64 | |
---|
| 65 | }; // end namespace dcache_access |
---|
| 66 | }; // end namespace core |
---|
| 67 | |
---|
| 68 | }; // end namespace behavioural |
---|
| 69 | }; // end namespace morpheo |
---|
| 70 | #endif |
---|