source: trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Types.h @ 77

Last change on this file since 77 was 77, checked in by rosiere, 16 years ago
  • Add two component :
    • network between read unit and execute unit
    • network between execute unit and write unit
  • remove parameters "nb_operation" and "nb_type"
  • in write_queue add the special case : load_speculative
File size: 3.1 KB
Line 
1#ifndef morpheo_behavioural_Types_h
2#define morpheo_behavioural_Types_h
3
4#include "Common/include/Types.h"
5#include "Common/include/ToString.h"
6#include "Behavioural/include/Constants.h"
7
8namespace morpheo {
9namespace behavioural {
10 
11  //============================================
12  // Type definition
13  //============================================
14
15  // ***** general
16  typedef bool          Tcontrol_t;
17  typedef uint32_t      Toperation_t;
18//typedef uint32_t      Tdestination1_t;
19//typedef uint32_t      Tdestination2_t;
20//typedef uint32_t      Texec_flag_t;
21//typedef bool          Texec_excep_t;
22//typedef uint32_t      Tcondition_t;
23//typedef uint32_t      Tbranch_state_t;
24
25  typedef uint32_t      Texception_t;
26  typedef uint32_t      Tcontext_t;
27  typedef uint32_t      Tpacket_t;
28  typedef uint32_t      Ttype_t;
29
30  // ***** Register
31  typedef uint32_t      Tgeneral_address_t;
32  typedef uint32_t      Tgeneral_data_t;
33  typedef uint32_t      Tspecial_address_t;
34  typedef uint32_t      Tspecial_data_t;
35
36  // ***** component dependant
37  // ~~~~~ load store queue
38  typedef uint32_t      Taccess_t;
39  typedef uint32_t      Tlsq_ptr_t;
40  typedef uint32_t      Tdcache_address_t;
41  typedef uint32_t      Tdcache_data_t;
42  typedef bool          Tdcache_error_t;
43  typedef uint32_t      Tdcache_type_t;
44
45  //----------------------------------------------[ spr_mode_access ]-----
46  class spr_access_mode_t
47  {
48  public : uint8_t _user_access_mode      ;
49  public : uint8_t _supervisor_access_mode;
50   
51  public : spr_access_mode_t (uint32_t user_access_mode       = SPR_ACCESS_MODE_NONE,
52                              uint32_t supervisor_access_mode = SPR_ACCESS_MODE_NONE)
53    {
54      _user_access_mode       = user_access_mode      ;
55      _supervisor_access_mode = supervisor_access_mode;
56    }
57  };
58
59  inline Tcontext_t get_num_thread (Tcontext_t num_context_id   , uint32_t size_context_id   ,
60                                    Tcontext_t num_front_end_id , uint32_t size_front_end_id ,
61                                    Tcontext_t num_ooo_engine_id, uint32_t size_ooo_engine_id)
62  {
63    return ((num_ooo_engine_id << (size_context_id + size_front_end_id)) |
64            (num_front_end_id  << (size_context_id)) |
65            (num_context_id));
66  }
67
68  inline uint32_t get_nb_thread (uint32_t nb_context ,
69                                 uint32_t nb_front_end ,
70                                 uint32_t nb_ooo_engine )
71  {
72    return (nb_ooo_engine *
73            nb_front_end  *
74            nb_context) ;
75  }
76
77}; // end namespace behavioural
78
79  inline std::string toString_type(const morpheo::behavioural::Ttype_t& x)
80  {
81    switch (x)
82      {
83      case TYPE_ALU     : return "ALU"    ; break;
84      case TYPE_SHIFT   : return "SHIFT"  ; break;
85      case TYPE_MOVE    : return "MOVE"   ; break;
86      case TYPE_TEST    : return "TEST"   ; break;
87      case TYPE_MUL_DIV : return "MUL_DIV"; break;
88      case TYPE_EXTEND  : return "EXTEND" ; break;
89      case TYPE_FIND    : return "FIND"   ; break;
90      case TYPE_SPECIAL : return "SPECIAL"; break;
91      case TYPE_CUSTOM  : return "CUSTOM" ; break;
92      case TYPE_BRANCH  : return "BRANCH" ; break;
93      case TYPE_MEMORY  : return "MEMORY" ; break;
94      default           : return ""       ; break;
95      }
96  };
97
98}; // end namespace morpheo             
99
100#endif
Note: See TracBrowser for help on using the repository browser.