Ignore:
Timestamp:
Feb 16, 2010, 1:35:48 PM (14 years ago)
Author:
rosiere
Message:

Various modif (add test, and vhdl)

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Parameters.h

    r112 r137  
    2121  {
    2222    //-----[ 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;
     23  public : uint32_t    _size_data           ;
     24  public : uint32_t    _nb_port             ;
     25  public : uint32_t    _shift_value         ; // 0 = external shifter's value
     26  public : rotate_t    _rotate              ;
     27  public : direction_t _direction           ;
     28  public : carry_t     _carry               ;
     29  public : uint32_t    _size_data_completion;
     30  public : bool        _type_completion_bool;
    3131
    32   public : const uint32_t    _size_shift        ;
     32  public : uint32_t    _size_shift        ;
    3333
    34   public : const bool        _internal_direction;
    35   public : const bool        _internal_type     ;
    36   public : const bool        _internal_carry    ;
     34  public : bool        _internal_direction;
     35  public : bool        _internal_type     ;
     36  public : bool        _internal_carry    ;
    3737
    38   public : const bool        _have_shift_logic_left        ;
    39   public : const bool        _have_shift_logic_right       ;
    40   public : const bool        _have_shift_logic             ;
    41   public : const bool        _have_shift_arithmetic_left   ;
    42   public : const bool        _have_shift_arithmetic_right  ;
    43   public : const bool        _have_shift_arithmetic        ;
    44   public : const bool        _have_shift                   ;
    45   public : const bool        _have_rotate_left             ;
    46   public : const bool        _have_rotate_right            ;
    47   public : const bool        _have_rotate                  ;
     38  public : bool        _have_shift_logic_left        ;
     39  public : bool        _have_shift_logic_right       ;
     40  public : bool        _have_shift_logic             ;
     41  public : bool        _have_shift_arithmetic_left   ;
     42  public : bool        _have_shift_arithmetic_right  ;
     43  public : bool        _have_shift_arithmetic        ;
     44  public : bool        _have_shift                   ;
     45  public : bool        _have_rotate_left             ;
     46  public : bool        _have_rotate_right            ;
     47  public : bool        _have_rotate                  ;
    4848   
    49   public : const bool        _have_direction_left          ;
    50   public : const bool        _have_direction_right         ;
     49  public : bool        _have_direction_left          ;
     50  public : bool        _have_direction_right         ;
    5151
    5252    //-----[ methods ]-----------------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/src/Parameters.cpp

    r112 r137  
    2020                           direction_t direction           ,
    2121                           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),
     22                           bool        type_completion_bool)
     23  {
     24    _size_data                     = size_data     ;
     25    _nb_port                       = nb_port       ;
     26    _shift_value                   = shift_value   ;
     27    _rotate                        = rotate        ;
     28    _direction                     = direction     ;
     29    _carry                         = carry         ;
     30    _size_data_completion          = (carry != external_completion)?0:((_shift_value==0)?size_data:_shift_value);
     31    _type_completion_bool          = type_completion_bool;
    3132
    32     _size_shift                    (static_cast<uint32_t>(ceil(log2(_size_data)))),
     33    _size_shift                    = static_cast<uint32_t>(ceil(log2(_size_data)));
     34   
     35    _internal_direction            = (direction == internal_right_shift)?_right :_left      ;
     36    _internal_type                 = (rotate    == internal_rotate     )?_rotate:_shift     ;
     37    _internal_carry                = (carry     == internal_logic      )?_logic :_arithmetic;
    3338
    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),
     39    _have_shift_logic_left         = ((rotate != internal_rotate)         &&
     40                                      (((carry     == external_carry     ) ||
     41                                        (carry     == external_completion) ||
     42                                        (carry     == internal_logic     )) &&
     43                                       ((direction == external_direction ) ||
     44                                        (direction == internal_left_shift))));
     45    _have_shift_logic_right        = ((rotate != internal_rotate)         &&
     46                                      (((carry     == external_carry     ) ||
     47                                        (carry     == external_completion) ||
     48                                        (carry     == internal_logic     )) &&
     49                                       ((direction == external_direction ) ||
     50                                        (direction == internal_right_shift))));
     51    _have_shift_logic              = _have_shift_logic_left || _have_shift_logic_right;
    3752
    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),
     53    _have_shift_arithmetic_left    = ((rotate != internal_rotate)         &&
     54                                      (((carry    == external_carry     ) ||
     55                                        (carry    == internal_arithmetic )) &&
     56                                       ((direction == external_direction ) ||
     57                                        (direction == internal_left_shift))));
     58    _have_shift_arithmetic_right   = ((rotate != internal_rotate)         &&
     59                                      (((carry     == external_carry     ) ||
     60                                        (carry     == internal_arithmetic     )) &&
     61                                       ((direction == external_direction ) ||
     62                                        (direction == internal_right_shift))));
     63    _have_shift_arithmetic         = _have_shift_arithmetic_left || _have_shift_arithmetic_right;
    5164
    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),
     65    _have_shift                    = _have_shift_logic || _have_shift_arithmetic;
    6366
    64     _have_shift                    (_have_shift_logic || _have_shift_arithmetic),
     67    _have_rotate_left              = ((rotate != without_rotate)         &&
     68                                      ((direction == external_direction ) ||
     69                                       (direction == internal_left_shift)));
     70    _have_rotate_right             = ((rotate != without_rotate)         &&
     71                                      ((direction == external_direction ) ||
     72                                       (direction == internal_right_shift)));
     73    _have_rotate                   = _have_rotate_left || _have_rotate_right;
     74   
     75    _have_direction_left           = (_have_shift_logic_left       ||
     76                                      _have_shift_arithmetic_left  ||
     77                                      _have_rotate_left            );
     78    _have_direction_right          = (_have_shift_logic_right      ||
     79                                      _have_shift_arithmetic_right ||
     80                                      _have_rotate_right           );
    6581
    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   {
    8182    test();
    8283  };
Note: See TracChangeset for help on using the changeset viewer.