1 | /* |
---|
2 | * $Id: Parameters.cpp 112 2009-03-18 22:36:26Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Generic/Shifter/include/Parameters.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace generic { |
---|
13 | namespace shifter { |
---|
14 | |
---|
15 | |
---|
16 | Parameters::Parameters (uint32_t size_data , |
---|
17 | uint32_t nb_port , |
---|
18 | uint32_t shift_value , |
---|
19 | rotate_t rotate , |
---|
20 | direction_t direction , |
---|
21 | carry_t carry , |
---|
22 | bool type_completion_bool): |
---|
23 | _size_data (size_data ), |
---|
24 | _nb_port (nb_port ), |
---|
25 | _shift_value (shift_value ), |
---|
26 | _rotate (rotate ), |
---|
27 | _direction (direction ), |
---|
28 | _carry (carry ), |
---|
29 | _size_data_completion ((carry != external_completion)?0:((_shift_value==0)?size_data:_shift_value)), |
---|
30 | _type_completion_bool (type_completion_bool), |
---|
31 | |
---|
32 | _size_shift (static_cast<uint32_t>(ceil(log2(_size_data)))), |
---|
33 | |
---|
34 | _internal_direction ((direction == internal_right_shift)?_right :_left ), |
---|
35 | _internal_type ((rotate == internal_rotate )?_rotate:_shift ), |
---|
36 | _internal_carry ((carry == internal_logic )?_logic :_arithmetic), |
---|
37 | |
---|
38 | _have_shift_logic_left ((rotate != internal_rotate) && |
---|
39 | (((carry == external_carry ) || |
---|
40 | (carry == external_completion) || |
---|
41 | (carry == internal_logic )) && |
---|
42 | ((direction == external_direction ) || |
---|
43 | (direction == internal_left_shift)))), |
---|
44 | _have_shift_logic_right ((rotate != internal_rotate) && |
---|
45 | (((carry == external_carry ) || |
---|
46 | (carry == external_completion) || |
---|
47 | (carry == internal_logic )) && |
---|
48 | ((direction == external_direction ) || |
---|
49 | (direction == internal_right_shift)))), |
---|
50 | _have_shift_logic (_have_shift_logic_left || _have_shift_logic_right), |
---|
51 | |
---|
52 | _have_shift_arithmetic_left ((rotate != internal_rotate) && |
---|
53 | (((carry == external_carry ) || |
---|
54 | (carry == internal_arithmetic )) && |
---|
55 | ((direction == external_direction ) || |
---|
56 | (direction == internal_left_shift)))), |
---|
57 | _have_shift_arithmetic_right ((rotate != internal_rotate) && |
---|
58 | (((carry == external_carry ) || |
---|
59 | (carry == internal_arithmetic )) && |
---|
60 | ((direction == external_direction ) || |
---|
61 | (direction == internal_right_shift)))), |
---|
62 | _have_shift_arithmetic (_have_shift_arithmetic_left || _have_shift_arithmetic_right), |
---|
63 | |
---|
64 | _have_shift (_have_shift_logic || _have_shift_arithmetic), |
---|
65 | |
---|
66 | _have_rotate_left ((rotate != without_rotate) && |
---|
67 | ((direction == external_direction ) || |
---|
68 | (direction == internal_left_shift))), |
---|
69 | _have_rotate_right ((rotate != without_rotate) && |
---|
70 | ((direction == external_direction ) || |
---|
71 | (direction == internal_right_shift))), |
---|
72 | _have_rotate ( _have_rotate_left || _have_rotate_right), |
---|
73 | |
---|
74 | _have_direction_left (_have_shift_logic_left || |
---|
75 | _have_shift_arithmetic_left || |
---|
76 | _have_rotate_left ), |
---|
77 | _have_direction_right (_have_shift_logic_right || |
---|
78 | _have_shift_arithmetic_right || |
---|
79 | _have_rotate_right ) |
---|
80 | { |
---|
81 | test(); |
---|
82 | }; |
---|
83 | |
---|
84 | // Parameters::Parameters (Parameters & param): |
---|
85 | // _size_data (param._size_data ), |
---|
86 | // _nb_port (param._nb_port ), |
---|
87 | // _shift_value (param._shift_value ), |
---|
88 | // _rotate (param._rotate ), |
---|
89 | // _direction (param._direction ), |
---|
90 | // _carry (param._carry ), |
---|
91 | // _size_data_completion (param._size_data_completion ), |
---|
92 | // _type_completion_bool (param._type_completion_bool ), |
---|
93 | |
---|
94 | // _internal_direction (param._internal_direction ), |
---|
95 | // _internal_type (param._internal_type ), |
---|
96 | // _internal_carry (param._internal_carry ), |
---|
97 | |
---|
98 | // _have_shift_logic_left (param._have_shift_logic_left ), |
---|
99 | // _have_shift_logic_right (param._have_shift_logic_right ), |
---|
100 | // _have_shift_logic (param._have_shift_logic ), |
---|
101 | // _have_shift_arithmetic_left (param._have_shift_arithmetic_left ), |
---|
102 | // _have_shift_arithmetic_right (param._have_shift_arithmetic_right ), |
---|
103 | // _have_shift_arithmetic (param._have_shift_arithmetic ), |
---|
104 | // _have_shift (param._have_shift ), |
---|
105 | // _have_rotate_left (param._have_rotate_left ), |
---|
106 | // _have_rotate_right (param._have_rotate_right ), |
---|
107 | // _have_rotate (param._have_rotate ), |
---|
108 | |
---|
109 | // _have_direction_left (param._have_direction_left ), |
---|
110 | // _have_direction_right (param._have_direction_right ) |
---|
111 | |
---|
112 | // { |
---|
113 | // test(); |
---|
114 | // }; |
---|
115 | |
---|
116 | Parameters::~Parameters () |
---|
117 | { |
---|
118 | }; |
---|
119 | |
---|
120 | void Parameters::copy (void) |
---|
121 | { |
---|
122 | }; |
---|
123 | |
---|
124 | }; // end namespace shifter |
---|
125 | }; // end namespace generic |
---|
126 | }; // end namespace behavioural |
---|
127 | }; // end namespace morpheo |
---|