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 "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h" |
---|
10 | #include <sstream> |
---|
11 | using namespace std; |
---|
12 | |
---|
13 | namespace morpheo { |
---|
14 | namespace behavioural { |
---|
15 | namespace stage_1_ifetch { |
---|
16 | namespace predictor { |
---|
17 | namespace meta_predictor { |
---|
18 | namespace two_level_branch_predictor { |
---|
19 | |
---|
20 | string Parameters::msg_error(void) |
---|
21 | { |
---|
22 | log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","Begin"); |
---|
23 | |
---|
24 | string msg = ""; |
---|
25 | |
---|
26 | if (is_positive (_nb_prediction) == false) |
---|
27 | { |
---|
28 | msg += " - nb_prediction must be > 0\n"; |
---|
29 | msg += " * nb_prediction : " + toString(_nb_prediction) + "\n"; |
---|
30 | } |
---|
31 | |
---|
32 | if (is_positive (_nb_branch_complete) == false) |
---|
33 | { |
---|
34 | msg += " - nb_branch_complete must be > 0\n"; |
---|
35 | msg += " * nb_branch_complete : " + toString(_nb_branch_complete) + "\n"; |
---|
36 | } |
---|
37 | |
---|
38 | if ((_have_bht or _have_pht) == false) |
---|
39 | { |
---|
40 | msg += " - you have no Branch History Table and no Pattern History Table. You need a less of a BHT or a PHT\n"; |
---|
41 | msg += " * have_bht : " + toString(_have_bht) + "\n"; |
---|
42 | msg += " * have_pht : " + toString(_have_pht) + "\n"; |
---|
43 | } |
---|
44 | |
---|
45 | if ( _have_bht and (_size_address < _bht_size_address)) |
---|
46 | { |
---|
47 | msg += " - the address's size must to large to the number of shifter in the Branch History Table.\n"; |
---|
48 | msg += " * size_address : " + toString(_size_address ) + "\n"; |
---|
49 | msg += " * have_bht : " + toString(_have_bht ) + "\n"; |
---|
50 | msg += " * bht_size_address : " + toString(_bht_size_address) + "\n"; |
---|
51 | msg += " * bht_nb_shifter : " + toString(_bht_nb_shifter ) + "\n"; |
---|
52 | } |
---|
53 | |
---|
54 | if (_have_pht and ( (_size_address < _pht_size_address) or |
---|
55 | (_have_bht and (_pht_size_address < _bht_size_address)))) |
---|
56 | { |
---|
57 | msg += " - the address's size concate with shifter_out must to large to the number of counter in the Pattern History Table.\n"; |
---|
58 | msg += " * size_address : " + toString(_size_address ) + "\n"; |
---|
59 | msg += " * have_bht : " + toString(_have_bht ) + "\n"; |
---|
60 | msg += " * bht_size_address : " + toString(_bht_size_address) + "\n"; |
---|
61 | msg += " * bht_nb_shifter : " + toString(_bht_nb_shifter ) + "\n"; |
---|
62 | msg += " * have_pht : " + toString(_have_bht ) + "\n"; |
---|
63 | msg += " * pht_size_address : " + toString(_pht_size_address) + "\n"; |
---|
64 | msg += " * pht_nb_counter : " + toString(_pht_nb_counter ) + "\n"; |
---|
65 | } |
---|
66 | |
---|
67 | // if ( not _have_bht and (_pht_size_address_share != 0)) |
---|
68 | // { |
---|
69 | // msg += " - you have no Branch History Table but size_address_share is > 0\n"; |
---|
70 | // msg += " * have_bht : " + toString(_have_bht ) + "\n"; |
---|
71 | // msg += " * pht_size_address_share : " + toString(_pht_size_address_share) + "\n"; |
---|
72 | // } |
---|
73 | |
---|
74 | return msg; |
---|
75 | |
---|
76 | log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","End"); |
---|
77 | }; |
---|
78 | |
---|
79 | }; // end namespace two_level_branch_predictor |
---|
80 | }; // end namespace meta_predictor |
---|
81 | }; // end namespace predictor |
---|
82 | }; // end namespace stage_1_ifetch |
---|
83 | }; // end namespace behavioural |
---|
84 | }; // end namespace morpheo |
---|