[78] | 1 | #ifdef STATISTICS |
---|
| 2 | /* |
---|
| 3 | * $Id: Free_List_unit_statistics_allocation.cpp 110 2009-02-19 16:31:47Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Free_List_unit/include/Free_List_unit.h" |
---|
| 10 | |
---|
| 11 | namespace morpheo { |
---|
| 12 | namespace behavioural { |
---|
| 13 | namespace core { |
---|
| 14 | namespace multi_ooo_engine { |
---|
| 15 | namespace ooo_engine { |
---|
| 16 | namespace rename_unit { |
---|
| 17 | namespace register_translation_unit { |
---|
| 18 | namespace free_list_unit { |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
[110] | 22 | #define FUNCTION "Free_List_unit::statistics_allocation" |
---|
| 23 | void Free_List_unit::statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics) |
---|
[78] | 24 | { |
---|
| 25 | log_printf(FUNC,Free_List_unit,FUNCTION,"Begin"); |
---|
| 26 | |
---|
| 27 | _stat = new Stat (static_cast<std::string>(_name), |
---|
| 28 | "Free_List_unit", |
---|
| 29 | param_statistics); |
---|
[110] | 30 | |
---|
| 31 | std::string sum_bank_gpr_nb_elt = "0"; |
---|
| 32 | _stat_bank_gpr_nb_elt = new counter_t * [_param->_nb_bank]; |
---|
[78] | 33 | |
---|
[110] | 34 | for (uint32_t i=0; i<_param->_nb_bank; ++i) |
---|
| 35 | { |
---|
| 36 | std::string str = "bank_gpr_nb_elt_"+toString(i); |
---|
| 37 | |
---|
| 38 | sum_bank_gpr_nb_elt = "+ "+str+" "+sum_bank_gpr_nb_elt; |
---|
| 39 | |
---|
| 40 | _stat_bank_gpr_nb_elt [i] = _stat->create_variable(str); |
---|
| 41 | |
---|
| 42 | _stat->create_expr_average_by_cycle("average_occupation_bank_gpr_"+toString(i), str, "", toString(_("Average free list occupation (bank %d)"),i)); |
---|
| 43 | _stat->create_expr_percent ("percent_occupation_bank_gpr_"+toString(i) , "average_occupation_bank_gpr_"+toString(i), toString(_param->_bank_gpr_nb_slot), toString(_("Percent free list occupation (bank %d)"),i)); |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | _stat->create_expr_average_by_cycle("average_occupation_bank_gpr", sum_bank_gpr_nb_elt, "", _("Average free list occupation (bank all)")); |
---|
| 47 | _stat->create_expr_percent ("percent_occupation_bank_gpr", "average_occupation_bank_gpr", toString(_param->_bank_gpr_nb_slot*_param->_nb_bank), _("Percent free list occupation (bank all)")); |
---|
| 48 | |
---|
| 49 | std::string sum_bank_spr_nb_elt = "0"; |
---|
| 50 | _stat_bank_spr_nb_elt = new counter_t * [_param->_nb_bank]; |
---|
| 51 | |
---|
| 52 | for (uint32_t i=0; i<_param->_nb_bank; ++i) |
---|
| 53 | { |
---|
| 54 | std::string str = "bank_spr_nb_elt_"+toString(i); |
---|
| 55 | |
---|
| 56 | sum_bank_spr_nb_elt = "+ "+str+" "+sum_bank_spr_nb_elt; |
---|
| 57 | |
---|
| 58 | _stat_bank_spr_nb_elt [i] = _stat->create_variable(str); |
---|
| 59 | |
---|
| 60 | _stat->create_expr_average_by_cycle("average_occupation_bank_spr_"+toString(i), str, "", toString(_("Average free list occupation (bank %d)"),i)); |
---|
| 61 | _stat->create_expr_percent ("percent_occupation_bank_spr_"+toString(i) , "average_occupation_bank_spr_"+toString(i), toString(_param->_bank_spr_nb_slot), toString(_("Percent free list occupation (bank %d)"),i)); |
---|
| 62 | } |
---|
| 63 | |
---|
| 64 | _stat->create_expr_average_by_cycle("average_occupation_bank_spr", sum_bank_spr_nb_elt, "", _("Average free list occupation (bank all)")); |
---|
| 65 | _stat->create_expr_percent ("percent_occupation_bank_spr", "average_occupation_bank_spr", toString(_param->_bank_spr_nb_slot*_param->_nb_bank), _("Percent free list occupation (bank all)")); |
---|
| 66 | |
---|
| 67 | _stat_nb_inst_pop = _stat->create_variable("nb_inst_pop" ); |
---|
| 68 | _stat_nb_inst_pop_gpr = _stat->create_variable("nb_inst_pop_gpr" ); |
---|
| 69 | _stat_nb_inst_pop_spr = _stat->create_variable("nb_inst_pop_spr" ); |
---|
| 70 | _stat_nb_inst_push_gpr = _stat->create_variable("nb_inst_push_gpr"); |
---|
| 71 | _stat_nb_inst_push_spr = _stat->create_variable("nb_inst_push_spr"); |
---|
| 72 | |
---|
| 73 | _stat->create_expr_average_by_cycle("average_use_interface_pop" , "nb_inst_pop" , "", _("Average instruction per cycle on pop interface")); |
---|
| 74 | _stat->create_expr_average_by_cycle("average_use_interface_pop_gpr" , "nb_inst_pop_gpr" , "", _("Average instruction per cycle on pop interface for gpr")); |
---|
| 75 | _stat->create_expr_average_by_cycle("average_use_interface_pop_spr" , "nb_inst_pop_spr" , "", _("Average instruction per cycle on pop interface for spr")); |
---|
| 76 | _stat->create_expr_average_by_cycle("average_use_interface_push_gpr", "nb_inst_push_gpr", "", _("Average instruction per cycle on push_gpr interface")); |
---|
| 77 | _stat->create_expr_average_by_cycle("average_use_interface_push_spr", "nb_inst_push_spr", "", _("Average instruction per cycle on push_spr interface")); |
---|
| 78 | |
---|
| 79 | _stat->create_expr_percent ("percent_inst_pop_need_gpr" , "nb_inst_pop_gpr" , "nb_inst_pop", _("Percent of pop instruction that need gpr")); |
---|
| 80 | _stat->create_expr_percent ("percent_inst_pop_need_spr" , "nb_inst_pop_spr" , "nb_inst_pop", _("Percent of pop instruction that need spr")); |
---|
| 81 | |
---|
[78] | 82 | log_printf(FUNC,Free_List_unit,FUNCTION,"End"); |
---|
| 83 | }; |
---|
| 84 | |
---|
| 85 | }; // end namespace free_list_unit |
---|
| 86 | }; // end namespace register_translation_unit |
---|
| 87 | }; // end namespace rename_unit |
---|
| 88 | }; // end namespace ooo_engine |
---|
| 89 | }; // end namespace multi_ooo_engine |
---|
| 90 | }; // end namespace core |
---|
| 91 | |
---|
| 92 | }; // end namespace behavioural |
---|
| 93 | }; // end namespace morpheo |
---|
| 94 | #endif |
---|