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/Generic/Sort/include/Parameters.h" |
---|
10 | #include <sstream> |
---|
11 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace generic { |
---|
15 | namespace sort { |
---|
16 | |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Sort::msg_error" |
---|
20 | Parameters_test Parameters::msg_error(void) |
---|
21 | { |
---|
22 | log_printf(FUNC,Sort,FUNCTION,"Begin"); |
---|
23 | |
---|
24 | Parameters_test test ("Sort"); |
---|
25 | |
---|
26 | // Test if param : n == 2^k |
---|
27 | if (is_positive(log2(_nb_input)) == false) |
---|
28 | test.error("nb_input is not a power of 2."); |
---|
29 | |
---|
30 | // Test functionnal |
---|
31 | if (_nb_input < _nb_output) |
---|
32 | test.error("nb_input must be higher than nb_output."); |
---|
33 | |
---|
34 | if (is_between_exclusive (_size_data,0 ,(8*sizeof(Tdata_t))) == false) |
---|
35 | test.error("type \"Tdata_t\" is too little to the size defined by size_data."); |
---|
36 | |
---|
37 | if (is_between_exclusive (static_cast<uint32_t>(log2(_nb_input)),0 ,(8*sizeof(Taddress_t))) == false) |
---|
38 | test.error("type \"Taddress_t\" is too little to the size defined by nb_input."); |
---|
39 | |
---|
40 | if ((not _have_port_index_out) and (not _have_port_data_out)) |
---|
41 | test.error("Need ouput : index, data (sorted) or both."); |
---|
42 | |
---|
43 | if (not _ascending) |
---|
44 | test.error("descending order not supported. (Coming Soon)"); |
---|
45 | |
---|
46 | log_printf(FUNC,Sort,FUNCTION,"End"); |
---|
47 | |
---|
48 | return test; |
---|
49 | }; |
---|
50 | |
---|
51 | }; // end namespace sort |
---|
52 | }; // end namespace generic |
---|
53 | |
---|
54 | }; // end namespace behavioural |
---|
55 | }; // end namespace morpheo |
---|