1 | #ifdef STATISTICS |
---|
2 | /* |
---|
3 | * $Id$ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Statistics.h" |
---|
10 | |
---|
11 | #include <sstream> |
---|
12 | using namespace std; |
---|
13 | |
---|
14 | namespace morpheo { |
---|
15 | namespace behavioural { |
---|
16 | namespace stage_1_ifetch { |
---|
17 | namespace predictor { |
---|
18 | namespace meta_predictor { |
---|
19 | namespace two_level_branch_predictor { |
---|
20 | namespace pattern_history_table { |
---|
21 | |
---|
22 | |
---|
23 | string Statistics::print (uint32_t depth , |
---|
24 | string component_stat) |
---|
25 | { |
---|
26 | log_printf(FUNC,Pattern_History_Table,"print","Begin"); |
---|
27 | |
---|
28 | string tab = string(depth,'\t'); |
---|
29 | ostringstream msg; |
---|
30 | |
---|
31 | msg << tab << "<pattern_history_table name=\"" << _name << "\" >" << endl |
---|
32 | << print_body(depth+1) |
---|
33 | << component_stat |
---|
34 | << tab << "</pattern_history_table>" << endl; |
---|
35 | |
---|
36 | log_printf(FUNC,Pattern_History_Table,"print","End"); |
---|
37 | |
---|
38 | return msg.str(); |
---|
39 | }; |
---|
40 | |
---|
41 | string Statistics::print (uint32_t depth) |
---|
42 | { |
---|
43 | string tab = string(depth,'\t'); |
---|
44 | ostringstream msg; |
---|
45 | |
---|
46 | msg << tab << "<pattern_history_table name=\"" << _name << "\" >" << endl |
---|
47 | << print_body(depth+1) << endl |
---|
48 | << tab << "</pattern_history_table>" << endl; |
---|
49 | |
---|
50 | return msg.str(); |
---|
51 | }; |
---|
52 | |
---|
53 | ostream& operator<< (ostream& output_stream , |
---|
54 | morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Statistics & x) |
---|
55 | { |
---|
56 | output_stream << x.print(0); |
---|
57 | |
---|
58 | return output_stream; |
---|
59 | }; |
---|
60 | |
---|
61 | }; // end namespace pattern_history_table |
---|
62 | }; // end namespace two_level_branch_predictor |
---|
63 | }; // end namespace meta_predictor |
---|
64 | }; // end namespace predictor |
---|
65 | }; // end namespace stage_1_ifetch |
---|
66 | |
---|
67 | }; // end namespace behavioural |
---|
68 | }; // end namespace morpheo |
---|
69 | #endif |
---|