source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/src/Parameters_msg_error.cpp @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 3.0 KB
Line 
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>
11using namespace std;
12
13namespace morpheo {
14namespace behavioural {
15namespace stage_1_ifetch {
16namespace predictor {
17namespace meta_predictor {
18namespace 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    return msg;
68
69    log_printf(FUNC,Two_Level_Branch_Predictor,"msg_error","End");
70  };
71
72}; // end namespace two_level_branch_predictor
73}; // end namespace meta_predictor
74}; // end namespace predictor
75}; // end namespace stage_1_ifetch
76}; // end namespace behavioural
77}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.