[88] | 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/Icache_Access/include/Parameters.h" |
---|
| 10 | #include <sstream> |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace icache_access { |
---|
| 16 | |
---|
| 17 | |
---|
| 18 | #undef FUNCTION |
---|
| 19 | #define FUNCTION "Icache_Access::msg_error" |
---|
| 20 | Parameters_test Parameters::msg_error(void) |
---|
| 21 | { |
---|
| 22 | log_begin(Icache_Access,FUNCTION); |
---|
| 23 | |
---|
| 24 | Parameters_test test ("Icache_Access"); |
---|
| 25 | |
---|
| 26 | bool have_link [_nb_icache_port]; |
---|
| 27 | for (uint32_t i=0; i<_nb_icache_port; i++) |
---|
| 28 | have_link [i] = 0; |
---|
| 29 | |
---|
| 30 | for (uint32_t i=0; i<_nb_front_end; i++) |
---|
| 31 | for (uint32_t j=0; j<_nb_context [i]; j++) |
---|
| 32 | if (_table_routing [i][j] >= _nb_icache_port) |
---|
| 33 | test.error(toString(_("table_routing [%d][%d] : invalid value, must be < nb_icache_port.\n"),i,j)); |
---|
| 34 | else |
---|
| 35 | have_link [_table_routing [i][j]] = true; |
---|
| 36 | |
---|
| 37 | for (uint32_t i=0; i<_nb_icache_port; i++) |
---|
| 38 | if (not have_link [i]) |
---|
| 39 | test.error(toString(_("Port[%d] is not linked.\n"),i)); |
---|
| 40 | |
---|
| 41 | bool thread_link [_nb_thread]; |
---|
| 42 | for (uint32_t i=0; i<_nb_thread; ++i) |
---|
| 43 | thread_link [i] = false; |
---|
| 44 | |
---|
| 45 | for (uint32_t i=0; i<_nb_front_end; i++) |
---|
| 46 | for (uint32_t j=0; j<_nb_context [i]; j++) |
---|
| 47 | { |
---|
| 48 | uint32_t num_thread = _translate_context_to_thread [i][j]; |
---|
| 49 | if (num_thread >= _nb_thread) |
---|
| 50 | test.error(toString(_("Context [%d][%d] is linked with an invalid thread id.\n"),i,j)); |
---|
| 51 | else |
---|
| 52 | if (thread_link [num_thread] == true) |
---|
| 53 | test.error(toString(_("Context [%d][%d] is linked with an already used thread id.\n"),i,j)); |
---|
| 54 | else |
---|
| 55 | thread_link [num_thread] = true; |
---|
| 56 | } |
---|
| 57 | |
---|
| 58 | for (uint32_t i=0; i<_nb_thread; ++i) |
---|
| 59 | if (not thread_link [i]) |
---|
| 60 | test.error(toString(_("Thread [%d] is not linked.\n"),i)); |
---|
| 61 | |
---|
| 62 | log_end(Icache_Access,FUNCTION); |
---|
| 63 | |
---|
| 64 | return test; |
---|
| 65 | }; |
---|
| 66 | |
---|
| 67 | }; // end namespace icache_access |
---|
| 68 | }; // end namespace core |
---|
| 69 | |
---|
| 70 | }; // end namespace behavioural |
---|
| 71 | }; // end namespace morpheo |
---|