[78] | 1 | /* |
---|
| 2 | * $Id: Parameters_msg_error.cpp 81 2008-04-15 18:40:01Z 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 ) |
---|
| 31 | test.error("size_counter must be >= 2."); |
---|
| 32 | |
---|
| 33 | if ((_associativity == 0) or |
---|
| 34 | (_associativity > _size_buffer)) |
---|
| 35 | test.error("associativity must be > 0 and <= size_buffer."); |
---|
| 36 | |
---|
| 37 | if (_associativity == 1) // special case : full assoc and direct map ... also we print direct map |
---|
| 38 | test.information("Branch Target Buffer is Direct Map"); |
---|
| 39 | else |
---|
| 40 | if (_associativity == _size_buffer) |
---|
| 41 | test.information("Branch Target Buffer is Full associative"); |
---|
| 42 | else |
---|
| 43 | test.information("Branch Target Buffer is Semi associative"); |
---|
| 44 | |
---|
| 45 | for (uint32_t i=0; i<_nb_context; i++) |
---|
| 46 | if (_associativity < (_nb_instruction[i]/2)) |
---|
| 47 | test.error("associativity must be >= nb_instruction["+toString(i)+"]/2."); |
---|
| 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 |
---|