[78] | 1 | /* |
---|
| 2 | * $Id: Parameters_msg_error.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/include/Types.h" |
---|
| 9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Branch_Target_Buffer/Branch_Target_Buffer_Register/include/Parameters.h" |
---|
| 10 | #include <sstream> |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace multi_front_end { |
---|
| 16 | namespace front_end { |
---|
| 17 | namespace prediction_unit { |
---|
| 18 | namespace branch_target_buffer { |
---|
| 19 | namespace branch_target_buffer_register { |
---|
| 20 | |
---|
| 21 | |
---|
| 22 | #undef FUNCTION |
---|
| 23 | #define FUNCTION "Branch_Target_Buffer_Register::msg_error" |
---|
| 24 | Parameters_test Parameters::msg_error(void) |
---|
| 25 | { |
---|
| 26 | log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"Begin"); |
---|
| 27 | |
---|
| 28 | Parameters_test test ("Branch_Target_Buffer_Register"); |
---|
| 29 | |
---|
| 30 | if (_size_counter < 2 ) |
---|
[88] | 31 | test.error(_("size_counter must be >= 2.\n")); |
---|
[78] | 32 | |
---|
| 33 | if ((_associativity == 0) or |
---|
| 34 | (_associativity > _size_buffer)) |
---|
[88] | 35 | test.error(_("associativity must be > 0 and <= size_buffer.\n")); |
---|
[78] | 36 | |
---|
| 37 | if (_associativity == 1) // special case : full assoc and direct map ... also we print direct map |
---|
[88] | 38 | test.information(_("Branch Target Buffer is Direct Map.\n")); |
---|
[78] | 39 | else |
---|
| 40 | if (_associativity == _size_buffer) |
---|
[88] | 41 | test.information(_("Branch Target Buffer is Full associative.\n")); |
---|
[78] | 42 | else |
---|
[88] | 43 | test.information(_("Branch Target Buffer is Semi associative.\n")); |
---|
[78] | 44 | |
---|
| 45 | for (uint32_t i=0; i<_nb_context; i++) |
---|
| 46 | if (_associativity < (_nb_instruction[i]/2)) |
---|
[88] | 47 | test.error(toString(_("associativity must be >= nb_instruction[%d]/2.\n"),i)); |
---|
[78] | 48 | |
---|
| 49 | log_printf(FUNC,Branch_Target_Buffer_Register,FUNCTION,"End"); |
---|
| 50 | |
---|
| 51 | return test; |
---|
| 52 | }; |
---|
| 53 | |
---|
| 54 | }; // end namespace branch_target_buffer_register |
---|
| 55 | }; // end namespace branch_target_buffer |
---|
| 56 | }; // end namespace prediction_unit |
---|
| 57 | }; // end namespace front_end |
---|
| 58 | }; // end namespace multi_front_end |
---|
| 59 | }; // end namespace core |
---|
| 60 | |
---|
| 61 | }; // end namespace behavioural |
---|
| 62 | }; // end namespace morpheo |
---|