[10] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
[15] | 8 | #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Parameters.h" |
---|
| 9 | #include "Behavioural/Generic/Victim/Victim_Pseudo_LRU/include/Types.h" |
---|
[10] | 10 | #include <sstream> |
---|
| 11 | using namespace std; |
---|
| 12 | |
---|
| 13 | namespace morpheo { |
---|
| 14 | namespace behavioural { |
---|
| 15 | namespace generic { |
---|
| 16 | namespace victim { |
---|
[15] | 17 | namespace victim_pseudo_lru { |
---|
[10] | 18 | |
---|
| 19 | string Parameters::msg_error(void) |
---|
| 20 | { |
---|
| 21 | string msg = ""; |
---|
| 22 | |
---|
| 23 | if (_nb_entity < 2) |
---|
| 24 | { |
---|
| 25 | msg += " - nb_entity must be >= 2\n"; |
---|
| 26 | msg += " * nb_entity : " + toString(_nb_entity) + "\n"; |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | if (is_positive(log2(_nb_entity)) == false) |
---|
| 30 | { |
---|
| 31 | msg += " - nb_entity is not a power of 2\n"; |
---|
| 32 | msg += " * nb_entity : " + toString(_nb_entity) + "\n"; |
---|
| 33 | } |
---|
| 34 | |
---|
| 35 | if (_nb_access < 1) |
---|
| 36 | { |
---|
| 37 | msg += " - nb_access must be >= 1\n"; |
---|
| 38 | msg += " * nb_access : " + toString(_nb_access) + "\n"; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | if (_size_table < 1) |
---|
| 42 | { |
---|
| 43 | msg += " - size_table must be >= 1\n"; |
---|
| 44 | msg += " * size_table : " + toString(_size_table) + "\n"; |
---|
| 45 | } |
---|
| 46 | |
---|
| 47 | if (is_between_inclusive (static_cast<uint32_t>(log2(_nb_entity)),0 ,(8*sizeof(Tentity_t))) == false) |
---|
| 48 | { |
---|
| 49 | msg += " - type \"Tentity_t\" is too little to the size defined by nb_entity\n"; |
---|
| 50 | msg += " * nb_entity : " + toString(_nb_entity) + "\n"; |
---|
| 51 | msg += " * Tentity_t (bits) : " + toString(8*(sizeof(Tentity_t))) + "\n"; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | if (is_between_inclusive (static_cast<uint32_t>(log2(_size_table)),0 ,(8*sizeof(Taddress_t))) == false) |
---|
| 55 | { |
---|
| 56 | msg += " - type \"Taddress_t\" is too little to the size defined by size_table\n"; |
---|
| 57 | msg += " * size_table : " + toString(_size_table) + "\n"; |
---|
| 58 | msg += " > size (bits) : " + toString(log2(_size_table)) + "\n"; |
---|
| 59 | msg += " * Taddress_t (bits) : " + toString(8*(sizeof(Taddress_t))) + "\n"; |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | return msg; |
---|
| 65 | }; |
---|
| 66 | |
---|
[15] | 67 | }; // end namespace victim_pseudo_lru |
---|
[10] | 68 | }; // end namespace victim |
---|
| 69 | }; // end namespace generic |
---|
| 70 | |
---|
| 71 | }; // end namespace behavioural |
---|
| 72 | }; // end namespace morpheo |
---|