[2] | 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/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 | |
---|
| 21 | string Statistics::print (uint32_t depth, |
---|
| 22 | string component_stat |
---|
| 23 | ) |
---|
| 24 | { |
---|
| 25 | log_printf(FUNC,Two_Level_Branch_Predictor,"print","Begin"); |
---|
| 26 | |
---|
| 27 | string tab = string(depth,'\t'); |
---|
| 28 | ostringstream msg; |
---|
| 29 | |
---|
| 30 | msg << tab << "<two_level_branch_predictor name=\"" << _name << "\" >" << endl |
---|
| 31 | << print_body(depth+1) |
---|
| 32 | << component_stat |
---|
| 33 | << tab << "</two_level_branch_predictor>" << endl; |
---|
| 34 | |
---|
| 35 | log_printf(FUNC,Two_Level_Branch_Predictor,"print","End"); |
---|
| 36 | |
---|
| 37 | return msg.str(); |
---|
| 38 | }; |
---|
| 39 | |
---|
| 40 | string Statistics::print (uint32_t depth) |
---|
| 41 | { |
---|
| 42 | return print(depth,""); |
---|
| 43 | }; |
---|
| 44 | |
---|
| 45 | ostream& operator<< (ostream& output_stream , |
---|
| 46 | morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Statistics & x) |
---|
| 47 | { |
---|
| 48 | output_stream << x.print(0); |
---|
| 49 | |
---|
| 50 | return output_stream; |
---|
| 51 | }; |
---|
| 52 | |
---|
| 53 | }; // end namespace two_level_branch_predictor |
---|
| 54 | }; // end namespace meta_predictor |
---|
| 55 | }; // end namespace predictor |
---|
| 56 | }; // end namespace stage_1_ifetch |
---|
| 57 | |
---|
| 58 | }; // end namespace behavioural |
---|
| 59 | }; // end namespace morpheo |
---|
| 60 | #endif |
---|