source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Generic/Shifter/include/Types.h

Last change on this file was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 3.0 KB
Line 
1#ifndef morpheo_behavioural_generic_shifter_Type_h
2#define morpheo_behavioural_generic_shifter_Type_h
3
4/*
5 * $Id: Types.h 81 2008-04-15 18:40:01Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Behavioural/include/Types.h"
12#include "Common/include/ToString.h"
13
14namespace morpheo {
15namespace behavioural {
16namespace generic {
17namespace shifter {
18
19  typedef enum { without_rotate      ,
20                 internal_rotate     ,
21                 external_rotate     } rotate_t;
22
23  typedef enum { internal_right_shift,
24                 internal_left_shift ,
25                 external_direction  } direction_t;
26
27  typedef enum { internal_logic      ,
28                 internal_arithmetic ,
29                 external_carry      ,
30                 external_completion } carry_t;       
31
32  typedef uint32_t     Tdata_t     ;
33  typedef uint32_t     Tshift_t    ;
34  typedef bool         Tdirection_t;
35  typedef bool         Ttype_t     ;
36  typedef bool         Tcarry_t    ;
37
38  // A lot of constant
39  const   Tdirection_t _right      = false;
40  const   Tdirection_t _left       = true ;
41
42  const   Ttype_t      _shift      = false;
43  const   Ttype_t      _rotate     = true ;
44
45  const   Tcarry_t     _logic      = false;
46  const   Tcarry_t     _arithmetic = true ;
47
48}; // end namespace shifter
49}; // end namespace generic
50}; // end namespace behavioural
51
52  template<> inline std::string toString<morpheo::behavioural::generic::shifter::rotate_t>(const morpheo::behavioural::generic::shifter::rotate_t& x)
53    {
54      switch (x)
55        {
56        case morpheo::behavioural::generic::shifter::without_rotate            : return "without_rotate" ;
57        case morpheo::behavioural::generic::shifter::internal_rotate           : return "internal_rotate";
58        case morpheo::behavioural::generic::shifter::external_rotate           : return "external_rotate";     
59        default                        : return "";
60        }
61    };
62 
63  template<> inline std::string toString<morpheo::behavioural::generic::shifter::direction_t>(const morpheo::behavioural::generic::shifter::direction_t& x) 
64  {
65    switch (x)
66      {
67      case morpheo::behavioural::generic::shifter::internal_right_shift      : return "internal_right_shift";
68      case morpheo::behavioural::generic::shifter::internal_left_shift       : return "internal_left_shift" ;
69      case morpheo::behavioural::generic::shifter::external_direction        : return "external_direction"  ;
70      default                        : return "";
71      }
72  };
73 
74  template<> inline std::string toString<morpheo::behavioural::generic::shifter::carry_t>(const morpheo::behavioural::generic::shifter::carry_t& x)
75  {
76    switch (x)
77      {
78      case morpheo::behavioural::generic::shifter::internal_logic            : return "internal_logic"       ;
79      case morpheo::behavioural::generic::shifter::internal_arithmetic       : return "internal_arithmetic"  ;
80      case morpheo::behavioural::generic::shifter::external_carry            : return "external_carry"       ;
81      case morpheo::behavioural::generic::shifter::external_completion       : return "external_completion"  ;
82      default                        : return "";
83      }
84  };
85   
86
87}; // end namespace morpheo             
88
89#endif
Note: See TracBrowser for help on using the repository browser.