[2] | 1 | #ifndef morpheo_behavioural_generic_shifter_Parameters_h |
---|
| 2 | #define morpheo_behavioural_generic_shifter_Parameters_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include "Behavioural/include/Parameters.h" |
---|
| 12 | #include "Behavioural/Generic/Shifter/include/Types.h" |
---|
| 13 | #include <math.h> |
---|
| 14 | |
---|
| 15 | namespace morpheo { |
---|
| 16 | namespace behavioural { |
---|
| 17 | namespace generic { |
---|
| 18 | namespace shifter { |
---|
| 19 | |
---|
| 20 | class Parameters : public morpheo::behavioural::Parameters |
---|
| 21 | { |
---|
| 22 | //-----[ fields ]------------------------------------------------------------ |
---|
| 23 | public : const uint32_t _size_data ; |
---|
| 24 | public : const uint32_t _nb_port ; |
---|
| 25 | public : const uint32_t _shift_value ; // 0 = external shifter's value |
---|
| 26 | public : const rotate_t _rotate ; |
---|
| 27 | public : const direction_t _direction ; |
---|
| 28 | public : const carry_t _carry ; |
---|
| 29 | public : const uint32_t _size_data_completion; |
---|
| 30 | public : const bool _type_completion_bool; |
---|
| 31 | |
---|
| 32 | public : const bool _internal_direction; |
---|
| 33 | public : const bool _internal_type ; |
---|
| 34 | public : const bool _internal_carry ; |
---|
| 35 | |
---|
| 36 | public : const bool _have_shift_logic_left ; |
---|
| 37 | public : const bool _have_shift_logic_right ; |
---|
| 38 | public : const bool _have_shift_logic ; |
---|
| 39 | public : const bool _have_shift_arithmetic_left ; |
---|
| 40 | public : const bool _have_shift_arithmetic_right ; |
---|
| 41 | public : const bool _have_shift_arithmetic ; |
---|
| 42 | public : const bool _have_shift ; |
---|
| 43 | public : const bool _have_rotate_left ; |
---|
| 44 | public : const bool _have_rotate_right ; |
---|
| 45 | public : const bool _have_rotate ; |
---|
| 46 | |
---|
| 47 | public : const bool _have_direction_left ; |
---|
| 48 | public : const bool _have_direction_right ; |
---|
| 49 | |
---|
| 50 | string toString_rotate (rotate_t x) |
---|
| 51 | { |
---|
| 52 | switch (x) |
---|
| 53 | { |
---|
| 54 | case without_rotate : return "without_rotate" ; |
---|
| 55 | case internal_rotate : return "internal_rotate"; |
---|
| 56 | case external_rotate : return "external_rotate"; |
---|
| 57 | default : return ""; |
---|
| 58 | } |
---|
| 59 | }; |
---|
| 60 | |
---|
| 61 | string toString_direction (direction_t x) |
---|
| 62 | { |
---|
| 63 | switch (x) |
---|
| 64 | { |
---|
| 65 | case internal_right_shift : return "internal_right_shift"; |
---|
| 66 | case internal_left_shift : return "internal_left_shift" ; |
---|
| 67 | case external_direction : return "external_direction" ; |
---|
| 68 | default : return ""; |
---|
| 69 | } |
---|
| 70 | }; |
---|
| 71 | |
---|
| 72 | string toString_carry (carry_t x) |
---|
| 73 | { |
---|
| 74 | switch (x) |
---|
| 75 | { |
---|
| 76 | case internal_logic : return "internal_logic" ; |
---|
| 77 | case internal_arithmetic : return "internal_arithmetic" ; |
---|
| 78 | case external_carry : return "external_carry" ; |
---|
| 79 | case external_completion : return "external_completion" ; |
---|
| 80 | default : return ""; |
---|
| 81 | } |
---|
| 82 | }; |
---|
| 83 | |
---|
| 84 | //-----[ methods ]----------------------------------------------------------- |
---|
| 85 | public : Parameters (uint32_t size_data , |
---|
| 86 | uint32_t nb_port , |
---|
| 87 | uint32_t shift_value , |
---|
| 88 | rotate_t rotate , |
---|
| 89 | direction_t direction , |
---|
| 90 | carry_t carry , |
---|
| 91 | bool type_completion_bool = false); |
---|
| 92 | public : Parameters (Parameters & param) ; |
---|
| 93 | public : ~Parameters () ; |
---|
| 94 | |
---|
| 95 | public : string msg_error (void); |
---|
| 96 | |
---|
| 97 | public : string print (uint32_t depth); |
---|
| 98 | public : friend ostream& operator<< (ostream& output_stream, |
---|
| 99 | morpheo::behavioural::generic::shifter::Parameters & x); |
---|
| 100 | }; |
---|
| 101 | |
---|
| 102 | }; // end namespace shifter |
---|
| 103 | }; // end namespace generic |
---|
| 104 | }; // end namespace behavioural |
---|
| 105 | }; // end namespace morpheo |
---|
| 106 | |
---|
| 107 | #endif |
---|