[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h" |
---|
| 9 | #include <sstream> |
---|
| 10 | using namespace std; |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace stage_1_ifetch { |
---|
| 15 | namespace predictor { |
---|
| 16 | namespace meta_predictor { |
---|
| 17 | namespace two_level_branch_predictor { |
---|
| 18 | |
---|
| 19 | |
---|
| 20 | string Parameters::print (uint32_t depth) |
---|
| 21 | { |
---|
| 22 | log_printf(FUNC,Two_Level_Branch_Predictor,"print","Begin"); |
---|
| 23 | |
---|
| 24 | string tab = string(depth,'\t'); |
---|
| 25 | ostringstream msg; |
---|
| 26 | msg << tab << "<two_level_branch_predictor>" << endl |
---|
| 27 | << tab << "\t<have bht value=\"" << _have_bht << "\" /> <!-- size bht : " << _bht_size_shifter * _bht_nb_shifter << " bits -->" << endl |
---|
| 28 | << tab << "\t<bht_size_shifter value=\"" << _bht_size_shifter << "\" />" << endl |
---|
| 29 | << tab << "\t<bht_nb_shifter value=\"" << _bht_nb_shifter << "\" />" << endl |
---|
| 30 | << tab << "\t<have pht value=\"" << _have_pht << "\" /> <!-- size pht : " << _pht_size_counter * _pht_nb_counter << " bits -->" << endl |
---|
| 31 | << tab << "\t<pht_size_counter value=\"" << _pht_size_counter << "\" />" << endl |
---|
| 32 | << tab << "\t<pht_nb_counter value=\"" << _pht_nb_counter << "\" />" << endl |
---|
| 33 | << tab << "\t<pht_size_address_share value=\"" << _pht_size_address_share << "\" />" << endl |
---|
| 34 | << tab << "\t<size_address value=\"" << _size_address << "\" />" << endl |
---|
| 35 | << tab << "\t<nb_prediction value=\"" << _nb_prediction << "\" />" << endl |
---|
| 36 | << tab << "\t<nb_branch_complete value=\"" << _nb_branch_complete << "\" />" << endl; |
---|
| 37 | if (_have_bht) |
---|
| 38 | msg << _param_branch_history_table ->print(depth+1); |
---|
| 39 | if (_have_pht) |
---|
| 40 | msg << _param_pattern_history_table->print(depth+1); |
---|
| 41 | msg << _param_two_level_branch_predictor_glue->print(depth+1); |
---|
| 42 | msg << tab << "</two_level_branch_predictor>" << endl; |
---|
| 43 | |
---|
| 44 | log_printf(FUNC,Two_Level_Branch_Predictor,"print","End"); |
---|
| 45 | |
---|
| 46 | return msg.str(); |
---|
| 47 | }; |
---|
| 48 | |
---|
| 49 | ostream& operator<< (ostream& output_stream , |
---|
| 50 | morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Parameters & x) |
---|
| 51 | { |
---|
| 52 | output_stream << x.print(0); |
---|
| 53 | |
---|
| 54 | return output_stream; |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | }; // end namespace two_level_branch_predictor |
---|
| 58 | }; // end namespace meta_predictor |
---|
| 59 | }; // end namespace predictor |
---|
| 60 | }; // end namespace stage_1_ifetch |
---|
| 61 | }; // end namespace behavioural |
---|
| 62 | }; // end namespace morpheo |
---|