[2] | 1 | /* |
---|
| 2 | * $Id: Parameters_msg_error.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[48] | 8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h" |
---|
| 9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h" |
---|
[2] | 10 | #include <sstream> |
---|
| 11 | using namespace std; |
---|
| 12 | |
---|
| 13 | namespace morpheo { |
---|
| 14 | namespace behavioural { |
---|
[48] | 15 | namespace core { |
---|
| 16 | namespace multi_front_end { |
---|
| 17 | namespace front_end { |
---|
| 18 | namespace prediction_unit { |
---|
| 19 | namespace direction { |
---|
| 20 | |
---|
[2] | 21 | namespace meta_predictor { |
---|
| 22 | namespace two_level_branch_predictor { |
---|
| 23 | |
---|
| 24 | string Parameters::msg_error(void) |
---|
| 25 | { |
---|
| 26 | log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","Begin"); |
---|
| 27 | |
---|
| 28 | string msg = ""; |
---|
| 29 | |
---|
| 30 | if (is_positive (_nb_prediction) == false) |
---|
| 31 | { |
---|
| 32 | msg += " - nb_prediction must be > 0\n"; |
---|
| 33 | msg += " * nb_prediction : " + toString(_nb_prediction) + "\n"; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | if (is_positive (_nb_branch_complete) == false) |
---|
| 37 | { |
---|
| 38 | msg += " - nb_branch_complete must be > 0\n"; |
---|
| 39 | msg += " * nb_branch_complete : " + toString(_nb_branch_complete) + "\n"; |
---|
| 40 | } |
---|
| 41 | |
---|
| 42 | if ((_have_bht or _have_pht) == false) |
---|
| 43 | { |
---|
| 44 | msg += " - you have no Branch History Table and no Pattern History Table. You need a less of a BHT or a PHT\n"; |
---|
| 45 | msg += " * have_bht : " + toString(_have_bht) + "\n"; |
---|
| 46 | msg += " * have_pht : " + toString(_have_pht) + "\n"; |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | if ( _have_bht and (_size_address < _bht_size_address)) |
---|
| 50 | { |
---|
| 51 | msg += " - the address's size must to large to the number of shifter in the Branch History Table.\n"; |
---|
| 52 | msg += " * size_address : " + toString(_size_address ) + "\n"; |
---|
| 53 | msg += " * have_bht : " + toString(_have_bht ) + "\n"; |
---|
| 54 | msg += " * bht_size_address : " + toString(_bht_size_address) + "\n"; |
---|
| 55 | msg += " * bht_nb_shifter : " + toString(_bht_nb_shifter ) + "\n"; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | if (_have_pht and ( (_size_address < _pht_size_address) or |
---|
| 59 | (_have_bht and (_pht_size_address < _bht_size_address)))) |
---|
| 60 | { |
---|
| 61 | msg += " - the address's size concate with shifter_out must to large to the number of counter in the Pattern History Table.\n"; |
---|
| 62 | msg += " * size_address : " + toString(_size_address ) + "\n"; |
---|
| 63 | msg += " * have_bht : " + toString(_have_bht ) + "\n"; |
---|
| 64 | msg += " * bht_size_address : " + toString(_bht_size_address) + "\n"; |
---|
| 65 | msg += " * bht_nb_shifter : " + toString(_bht_nb_shifter ) + "\n"; |
---|
| 66 | msg += " * have_pht : " + toString(_have_bht ) + "\n"; |
---|
| 67 | msg += " * pht_size_address : " + toString(_pht_size_address) + "\n"; |
---|
| 68 | msg += " * pht_nb_counter : " + toString(_pht_nb_counter ) + "\n"; |
---|
| 69 | } |
---|
| 70 | |
---|
[3] | 71 | // if ( not _have_bht and (_pht_size_address_share != 0)) |
---|
| 72 | // { |
---|
| 73 | // msg += " - you have no Branch History Table but size_address_share is > 0\n"; |
---|
| 74 | // msg += " * have_bht : " + toString(_have_bht ) + "\n"; |
---|
| 75 | // msg += " * pht_size_address_share : " + toString(_pht_size_address_share) + "\n"; |
---|
| 76 | // } |
---|
| 77 | |
---|
[2] | 78 | return msg; |
---|
| 79 | |
---|
| 80 | log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","End"); |
---|
| 81 | }; |
---|
| 82 | |
---|
| 83 | }; // end namespace two_level_branch_predictor |
---|
| 84 | }; // end namespace meta_predictor |
---|
[48] | 85 | |
---|
| 86 | }; // end namespace core |
---|
| 87 | }; // end namespace multi_front_end |
---|
| 88 | }; // end namespace front_end |
---|
| 89 | }; // end namespace prediction_unit |
---|
| 90 | }; // end namespace direction |
---|
| 91 | |
---|
[2] | 92 | }; // end namespace behavioural |
---|
| 93 | }; // end namespace morpheo |
---|