1 | #ifdef STATISTICS |
---|
2 | /* |
---|
3 | * $Id: Commit_unit_statistics_deallocation.cpp 142 2010-08-04 20:09:03Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h" |
---|
10 | #include "Behavioural/include/Allocation.h" |
---|
11 | #include "Common/include/BitManipulation.h" |
---|
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 | |
---|
31 | delete [] _stat_nb_inst_retire_ok; |
---|
32 | delete [] _stat_nb_inst_retire_ko; |
---|
33 | delete [] _stat_nb_inst_instruction; |
---|
34 | delete [] _stat_nb_inst_type; |
---|
35 | delete [] _stat_bank_nb_inst; |
---|
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 | |
---|
42 | delete [] _stat_nb_inst_insert; |
---|
43 | delete [] _stat_nb_inst_retire; |
---|
44 | delete [] _stat_nb_inst_commit; |
---|
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 | |
---|
50 | for (uint32_t i=0; i<_param->_nb_thread; ++i) |
---|
51 | for(stat_inst_fusion_t::iterator it = _stat_inst_fusion [i].begin(); |
---|
52 | it != _stat_inst_fusion [i].end(); |
---|
53 | ++it) |
---|
54 | { |
---|
55 | uint32_t value = it->second; |
---|
56 | |
---|
57 | if (value != 0) |
---|
58 | { |
---|
59 | uint32_t inst = it->first; |
---|
60 | |
---|
61 | type_t type_0 = static_cast<type_t>((inst>>(SIZE_TYPE+2*SIZE_OPERATION))&mask_type ); |
---|
62 | uint32_t operation_0 = (inst>>(SIZE_TYPE+ SIZE_OPERATION))&mask_operation ; |
---|
63 | type_t type_1 = static_cast<type_t>((inst>>( SIZE_OPERATION))&mask_type ); |
---|
64 | uint32_t operation_1 = inst &mask_operation ; |
---|
65 | |
---|
66 | // log_printf(STAT,Commit_unit,FUNCTION, |
---|
67 | msgInformation( |
---|
68 | //" * %s - %s : %d\n" |
---|
69 | //,toString_instruction((inst>>SIZE_INSTRUCTION)&mask_inst).c_str() |
---|
70 | //,toString_instruction( inst &mask_inst).c_str(),value |
---|
71 | " * %s.%s - %s.%s : %d\n" |
---|
72 | ,toString (type_0 ).c_str() |
---|
73 | ,toString_operation(type_0,operation_0).c_str() |
---|
74 | ,toString (type_1 ).c_str() |
---|
75 | ,toString_operation(type_1,operation_1).c_str() |
---|
76 | ,value |
---|
77 | ); |
---|
78 | } |
---|
79 | } |
---|
80 | |
---|
81 | // DELETE1(_stat_last_inst ,_param->_nb_thread); |
---|
82 | DELETE1(_stat_last_inst_type ,_param->_nb_thread); |
---|
83 | DELETE1(_stat_last_inst_operation,_param->_nb_thread); |
---|
84 | DELETE1(_stat_inst_fusion ,_param->_nb_thread); |
---|
85 | |
---|
86 | log_end(Commit_unit,FUNCTION); |
---|
87 | }; |
---|
88 | |
---|
89 | }; // end namespace commit_unit |
---|
90 | }; // end namespace ooo_engine |
---|
91 | }; // end namespace multi_ooo_engine |
---|
92 | }; // end namespace core |
---|
93 | |
---|
94 | }; // end namespace behavioural |
---|
95 | }; // end namespace morpheo |
---|
96 | #endif |
---|