source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters.cpp @ 88

Last change on this file since 88 was 88, checked in by rosiere, 15 years ago

Almost complete design
with Test and test platform

  • Property svn:keywords set to Id
File size: 5.3 KB
Line 
1/*
2 * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Generic/Shifter/include/Parameters.h"
9
10namespace morpheo {
11namespace behavioural {
12namespace generic {
13namespace 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    _internal_direction            ((direction == internal_right_shift)?_right :_left      ),
33    _internal_type                 ((rotate    == internal_rotate     )?_rotate:_shift     ),
34    _internal_carry                ((carry     == internal_logic      )?_logic :_arithmetic),
35
36    _have_shift_logic_left         ((rotate != internal_rotate)         &&
37                                    (((carry     == external_carry     ) ||
38                                      (carry     == external_completion) ||
39                                      (carry     == internal_logic     )) && 
40                                    ((direction == external_direction ) ||
41                                     (direction == internal_left_shift)))),
42    _have_shift_logic_right        ((rotate != internal_rotate)         &&
43                                    (((carry     == external_carry     ) ||
44                                      (carry     == external_completion) ||
45                                      (carry     == internal_logic     )) && 
46                                    ((direction == external_direction ) ||
47                                     (direction == internal_right_shift)))),
48    _have_shift_logic              (_have_shift_logic_left || _have_shift_logic_right),
49
50    _have_shift_arithmetic_left    ((rotate != internal_rotate)         &&
51                                    (((carry    == external_carry     ) ||
52                                      (carry    == internal_arithmetic )) && 
53                                    ((direction == external_direction ) ||
54                                     (direction == internal_left_shift)))),
55    _have_shift_arithmetic_right   ((rotate != internal_rotate)         &&
56                                    (((carry     == external_carry     ) ||
57                                      (carry     == internal_arithmetic     )) && 
58                                     ((direction == external_direction ) ||
59                                      (direction == internal_right_shift)))),
60    _have_shift_arithmetic         (_have_shift_arithmetic_left || _have_shift_arithmetic_right),
61
62    _have_shift                    (_have_shift_logic || _have_shift_arithmetic),
63
64    _have_rotate_left              ((rotate != without_rotate)         &&
65                                    ((direction == external_direction ) ||
66                                     (direction == internal_left_shift))),
67    _have_rotate_right             ((rotate != without_rotate)         &&
68                                    ((direction == external_direction ) || 
69                                     (direction == internal_right_shift))),
70    _have_rotate                   ( _have_rotate_left || _have_rotate_right),
71
72    _have_direction_left           (_have_shift_logic_left       ||
73                                    _have_shift_arithmetic_left  ||
74                                    _have_rotate_left            ),
75    _have_direction_right          (_have_shift_logic_right      ||
76                                    _have_shift_arithmetic_right ||
77                                    _have_rotate_right           )
78  {
79    test();
80  };
81 
82//   Parameters::Parameters (Parameters & param):
83//     _size_data                   (param._size_data                   ),
84//     _nb_port                     (param._nb_port                     ),
85//     _shift_value                 (param._shift_value                 ),
86//     _rotate                      (param._rotate                      ),
87//     _direction                   (param._direction                   ),
88//     _carry                       (param._carry                       ),
89//     _size_data_completion        (param._size_data_completion        ),
90//     _type_completion_bool        (param._type_completion_bool        ),
91
92//     _internal_direction          (param._internal_direction          ),
93//     _internal_type               (param._internal_type               ),
94//     _internal_carry              (param._internal_carry              ),
95   
96//     _have_shift_logic_left       (param._have_shift_logic_left       ),
97//     _have_shift_logic_right      (param._have_shift_logic_right      ),
98//     _have_shift_logic            (param._have_shift_logic            ),
99//     _have_shift_arithmetic_left  (param._have_shift_arithmetic_left  ),
100//     _have_shift_arithmetic_right (param._have_shift_arithmetic_right ),
101//     _have_shift_arithmetic       (param._have_shift_arithmetic       ),
102//     _have_shift                  (param._have_shift                  ),
103//     _have_rotate_left            (param._have_rotate_left            ),
104//     _have_rotate_right           (param._have_rotate_right           ),
105//     _have_rotate                 (param._have_rotate                 ),
106
107//     _have_direction_left         (param._have_direction_left         ),
108//     _have_direction_right        (param._have_direction_right        )
109
110//   {
111//     test();
112//   };
113
114  Parameters::~Parameters () 
115  {
116  };
117
118  void Parameters::copy (void) 
119  {
120  };
121
122}; // end namespace shifter
123}; // end namespace generic
124}; // end namespace behavioural
125}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.