[88] | 1 | #ifdef STATISTICS |
---|
| 2 | /* |
---|
| 3 | * $Id: Commit_unit_statistics_deallocation.cpp 145 2010-10-13 18:15:51Z rosiere $ |
---|
| 4 | * |
---|
| 5 | * [ Description ] |
---|
| 6 | * |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h" |
---|
[142] | 10 | #include "Behavioural/include/Allocation.h" |
---|
| 11 | #include "Common/include/BitManipulation.h" |
---|
[88] | 12 | |
---|
| 13 | namespace morpheo { |
---|
| 14 | namespace behavioural { |
---|
| 15 | namespace core { |
---|
| 16 | namespace multi_ooo_engine { |
---|
| 17 | namespace ooo_engine { |
---|
| 18 | namespace commit_unit { |
---|
| 19 | |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Commit_unit::statistics_deallocation" |
---|
| 23 | void Commit_unit::statistics_deallocation (void) |
---|
| 24 | { |
---|
| 25 | log_begin(Commit_unit,FUNCTION); |
---|
| 26 | |
---|
| 27 | log_printf(INFO,Commit_unit,FUNCTION,_("<%s> : Generate Statistics file"),_name.c_str()); |
---|
| 28 | |
---|
| 29 | delete _stat; |
---|
| 30 | |
---|
[98] | 31 | delete [] _stat_nb_inst_retire_ok; |
---|
| 32 | delete [] _stat_nb_inst_retire_ko; |
---|
[137] | 33 | delete [] _stat_nb_inst_instruction; |
---|
[110] | 34 | delete [] _stat_nb_inst_type; |
---|
[88] | 35 | delete [] _stat_bank_nb_inst; |
---|
[124] | 36 | |
---|
| 37 | delete [] _stat_nb_cycle_state_no_event ; |
---|
| 38 | delete [] _stat_nb_cycle_state_not_yet_event ; |
---|
| 39 | delete [] _stat_nb_cycle_state_event ; |
---|
| 40 | delete [] _stat_nb_cycle_state_wait_end ; |
---|
| 41 | |
---|
[141] | 42 | delete [] _stat_nb_inst_insert; |
---|
| 43 | delete [] _stat_nb_inst_retire; |
---|
| 44 | delete [] _stat_nb_inst_commit; |
---|
[142] | 45 | |
---|
| 46 | // uint32_t mask_inst = gen_mask<uint32_t>(SIZE_INSTRUCTION); |
---|
| 47 | uint32_t mask_type = gen_mask<uint32_t>(SIZE_TYPE ); |
---|
| 48 | uint32_t mask_operation = gen_mask<uint32_t>(SIZE_OPERATION ); |
---|
| 49 | |
---|
[145] | 50 | msgInformation("Number of iteration couple of instructions.\n"); |
---|
| 51 | |
---|
[142] | 52 | for (uint32_t i=0; i<_param->_nb_thread; ++i) |
---|
| 53 | for(stat_inst_fusion_t::iterator it = _stat_inst_fusion [i].begin(); |
---|
| 54 | it != _stat_inst_fusion [i].end(); |
---|
| 55 | ++it) |
---|
| 56 | { |
---|
| 57 | uint32_t value = it->second; |
---|
| 58 | |
---|
| 59 | if (value != 0) |
---|
| 60 | { |
---|
| 61 | uint32_t inst = it->first; |
---|
| 62 | |
---|
| 63 | type_t type_0 = static_cast<type_t>((inst>>(SIZE_TYPE+2*SIZE_OPERATION))&mask_type ); |
---|
| 64 | uint32_t operation_0 = (inst>>(SIZE_TYPE+ SIZE_OPERATION))&mask_operation ; |
---|
| 65 | type_t type_1 = static_cast<type_t>((inst>>( SIZE_OPERATION))&mask_type ); |
---|
| 66 | uint32_t operation_1 = inst &mask_operation ; |
---|
| 67 | |
---|
| 68 | msgInformation( |
---|
| 69 | //" * %s - %s : %d\n" |
---|
| 70 | //,toString_instruction((inst>>SIZE_INSTRUCTION)&mask_inst).c_str() |
---|
| 71 | //,toString_instruction( inst &mask_inst).c_str(),value |
---|
[145] | 72 | " * (%d) \t%s.%s - %s.%s\n" |
---|
| 73 | ,value |
---|
[142] | 74 | ,toString (type_0 ).c_str() |
---|
| 75 | ,toString_operation(type_0,operation_0).c_str() |
---|
| 76 | ,toString (type_1 ).c_str() |
---|
| 77 | ,toString_operation(type_1,operation_1).c_str() |
---|
| 78 | ); |
---|
| 79 | } |
---|
| 80 | } |
---|
| 81 | |
---|
| 82 | // DELETE1(_stat_last_inst ,_param->_nb_thread); |
---|
| 83 | DELETE1(_stat_last_inst_type ,_param->_nb_thread); |
---|
| 84 | DELETE1(_stat_last_inst_operation,_param->_nb_thread); |
---|
| 85 | DELETE1(_stat_inst_fusion ,_param->_nb_thread); |
---|
[141] | 86 | |
---|
[88] | 87 | log_end(Commit_unit,FUNCTION); |
---|
| 88 | }; |
---|
| 89 | |
---|
| 90 | }; // end namespace commit_unit |
---|
| 91 | }; // end namespace ooo_engine |
---|
| 92 | }; // end namespace multi_ooo_engine |
---|
| 93 | }; // end namespace core |
---|
| 94 | |
---|
| 95 | }; // end namespace behavioural |
---|
| 96 | }; // end namespace morpheo |
---|
| 97 | #endif |
---|