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