[2] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Generic/Shifter/include/Parameters.h" |
---|
| 9 | #include "Behavioural/Generic/Shifter/include/Types.h" |
---|
| 10 | #include <sstream> |
---|
| 11 | using namespace std; |
---|
| 12 | |
---|
| 13 | namespace morpheo { |
---|
| 14 | namespace behavioural { |
---|
| 15 | namespace generic { |
---|
| 16 | namespace shifter { |
---|
| 17 | |
---|
| 18 | string Parameters::msg_error(void) |
---|
| 19 | { |
---|
| 20 | string msg = ""; |
---|
| 21 | |
---|
| 22 | if (_size_data < 2) |
---|
| 23 | { |
---|
| 24 | msg += " - size_data must be > 1\n"; |
---|
| 25 | msg += " * size_data : " + toString(_size_data) + "\n"; |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | if (is_positive(_nb_port) == false) |
---|
| 29 | { |
---|
| 30 | msg += " - nb_port must be > 0\n"; |
---|
| 31 | msg += " * nb_port : " + toString(_nb_port) + "\n"; |
---|
| 32 | } |
---|
| 33 | |
---|
| 34 | if (_shift_value > _size_data) |
---|
| 35 | { |
---|
| 36 | msg += " - shift_value must be < size_data\n"; |
---|
| 37 | msg += " * shift_value : " + toString(_shift_value) + "\n"; |
---|
| 38 | msg += " * size_data : " + toString(_size_data) + "\n"; |
---|
| 39 | } |
---|
| 40 | |
---|
| 41 | if ( (_rotate == internal_rotate) && (_carry != internal_logic)) |
---|
| 42 | { |
---|
| 43 | msg += " - Incompatible parameters : internal_rotate have never carry (must be set at \"internal_logic\"\n"; |
---|
| 44 | msg += " * rotate : " + toString_rotate(_rotate) + "\n"; |
---|
| 45 | msg += " * carry : " + toString_carry (_carry ) + "\n"; |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | if (_type_completion_bool && (_size_data_completion != 1)) |
---|
| 49 | { |
---|
| 50 | msg += " - Incompatible parameters : you can't have the type of port in_SHIFTER_COMPLETION at bool. Because, This port must be more bits\n"; |
---|
| 51 | msg += " * size_data_completion : " + toString (_size_data_completion) + "\n"; |
---|
| 52 | } |
---|
| 53 | |
---|
| 54 | return msg; |
---|
| 55 | }; |
---|
| 56 | |
---|
| 57 | }; // end namespace shifter |
---|
| 58 | }; // end namespace generic |
---|
| 59 | }; // end namespace behavioural |
---|
| 60 | }; // end namespace morpheo |
---|