source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h @ 59

Last change on this file since 59 was 59, checked in by rosiere, 17 years ago

Add Load store queue -> but not terminated and tested
Add article to sympa 2007 -> but no started

File size: 8.8 KB
Line 
1#ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_execute_unit_execute_unit_load_store_unit_Types_h
2#define morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_execute_unit_execute_unit_load_store_unit_Types_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#include "Behavioural/include/Types.h"
12#include "Common/include/ToString.h"
13#include "Common/include/FromString.h"
14#include "Common/include/ErrorMorpheo.h"
15
16namespace morpheo {
17namespace behavioural {
18namespace core {
19namespace multi_execute_loop {
20namespace execute_loop {
21namespace multi_execute_unit {
22namespace execute_unit {
23namespace load_store_unit {
24
25  typedef enum 
26    {
27      NO_SPECULATIVE_LOAD    , //each load wait all previous store before the data cache access
28      SPECULATIVE_LOAD_ACCESS, //each load wait all previous store before the commiting
29      SPECULATIVE_LOAD_COMMIT, //each load commit the result before the end of dependence's check
30      SPECULATIVE_LOAD_BYPASS  //each load bypass the result before the end of dependence's check
31    } Tspeculative_load_t; 
32 
33  typedef enum
34    {
35      SELECT_STORE_QUEUE,
36      SELECT_LOAD_QUEUE ,
37      SELECT_LOAD_QUEUE_SPECULATIVE
38    } Tselect_queue_t;
39 
40  // ----------------------------------------------------------
41  // Store Queue
42  // ----------------------------------------------------------
43
44  typedef enum
45    {
46      STORE_QUEUE_EMPTY                    //entry is empty
47      ,STORE_QUEUE_NO_VALID_NO_SPECULATIVE //entry is the top of rob, and operation isn't arrive
48      ,STORE_QUEUE_VALID_SPECULATIVE       //entry is arrive and wait the top of rob
49      ,STORE_QUEUE_VALID_NO_SPECULATIVE    //entry is ok, can be access at a dcache port.
50      ,STORE_QUEUE_COMMIT                  //entry have access at dcache
51    } Tstore_queue_state_t;
52
53  class Tstore_queue_entry_t
54  {
55  public    : Tstore_queue_state_t _state               ;
56  public    : Tcontext_t           _context_id          ;
57  public    : Tpacket_t            _packet_id           ;
58  public    : Taccess_t            _access              ;
59  public    : Tcontrol_t           _uncached            ;
60#ifdef HAVE_MEMORY_OUT_OPERATION
61  public    : Toperation_t         _operation           ;
62#endif                             
63#ifdef HAVE_MEMORY_OUT_TYPE                           
64  public    : Ttype_t              _type                ;
65#endif                             
66  public    : Tlsq_ptr_t           _load_queue_ptr_write;
67  public    : Tdcache_data_t       _address             ;
68  public    : Tgeneral_data_t      _wdata               ;
69//public    : Tcontrol_t           _write_rd            ;
70//public    : Tgeneral_address_t   _num_reg_rd          ;
71  public    : Texception_t         _exception           ;
72  };
73
74  // ----------------------------------------------------------
75  // Speculative_Access  Queue
76  // ----------------------------------------------------------
77
78  typedef enum
79    {
80      SPECULATIVE_ACCESS_QUEUE_EMPTY            //entry is empty
81      ,SPECULATIVE_ACCESS_QUEUE_WAIT_CACHE      //entry is valid and can access at the dcache
82      ,SPECULATIVE_ACCESS_QUEUE_WAIT_LOAD_QUEUE //entry wait an empty slot in load queue
83    } Tspeculative_access_queue_state_t;
84
85  class Tspeculative_access_queue_entry_t
86  {
87  public    : Tspeculative_access_queue_state_t  _state                ;
88  public    : Tcontext_t                         _context_id           ;
89  public    : Tpacket_t                          _packet_id            ;
90  public    : Taccess_t                          _access               ;
91  public    : Tcontrol_t                         _uncached             ;
92  public    : Tcontrol_t                         _sign_extension       ;
93#ifdef HAVE_MEMORY_OUT_OPERATION                                       
94  public    : Toperation_t                       _operation            ;
95#endif                                                                 
96#ifdef HAVE_MEMORY_OUT_TYPE                                           
97  public    : Ttype_t                            _type                 ;
98#endif                                                                 
99  public    : Tlsq_ptr_t                         _load_queue_ptr_write ;
100  public    : Tlsq_ptr_t                         _store_queue_ptr_write;
101  public    : Tdcache_address_t                  _address              ;
102  public    : Tgeneral_data_t                    _rdata                ;
103  public    : Tcontrol_t                         _write_rd             ;
104  public    : Tgeneral_address_t                 _num_reg_rd           ;
105  public    : Texception_t                       _exception            ;
106  };
107
108  // ----------------------------------------------------------
109  // Load  Queue
110  // ----------------------------------------------------------
111
112  typedef enum
113    {
114      LOAD_QUEUE_EMPTY         //entry is empty
115      ,LOAD_QUEUE_WAIT_CHECK   //entry must wait the respons and check dependence with store
116      ,LOAD_QUEUE_WAIT         //entry must wait the respons
117      ,LOAD_QUEUE_COMMIT_CHECK //entry must check dependence and can commit speculative
118      ,LOAD_QUEUE_CHECK        //entry must check dependence with store
119      ,LOAD_QUEUE_COMMIT       //entry must commit the instruction
120    } Tload_queue_state_t;
121
122  class Tload_queue_entry_t
123  {
124  public    : Tload_queue_state_t  _state               ;
125  public    : Tcontext_t           _context_id          ;
126  public    : Tpacket_t            _packet_id           ;
127  public    : Taccess_t            _access              ;
128  public    : Tcontrol_t           _uncached            ;
129  public    : Tcontrol_t           _sign_extension      ;
130#ifdef HAVE_MEMORY_OUT_OPERATION
131  public    : Toperation_t         _operation           ;
132#endif                             
133#ifdef HAVE_MEMORY_OUT_TYPE                           
134  public    : Ttype_t              _type                ;
135#endif                             
136  public    : Tlsq_ptr_t           _store_queue_ptr_write;
137  public    : Tdcache_address_t    _address             ;
138  public    : Tgeneral_data_t      _rdata               ;
139  public    : Tcontrol_t           _write_rd            ;
140  public    : Tgeneral_address_t   _num_reg_rd          ;
141  public    : Texception_t         _exception           ;
142  };
143
144}; // end namespace load_store_unit
145}; // end namespace execute_unit
146}; // end namespace multi_execute_unit
147}; // end namespace execute_loop
148}; // end namespace multi_execute_loop
149}; // end namespace core
150}; // end namespace behavioural
151
152  template<> inline std::string toString<morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t>(const morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t& x)
153  {
154    switch (x)
155      {
156      case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::NO_SPECULATIVE_LOAD     : return "no_speculative_load"    ; break;
157      case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_ACCESS : return "speculative_load_access"; break;
158      case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_COMMIT : return "speculative_load_commit"; break;
159      case morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_BYPASS : return "speculative_load_bypass"; break;
160      default    : return ""      ; break;
161      }
162  };
163
164  template<> inline morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t fromString<morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::Tspeculative_load_t>(const std::string& x)
165  {
166    if ( (x.compare("0")                       == 0) or
167         (x.compare("no_speculative_load")     == 0))
168      return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::NO_SPECULATIVE_LOAD;
169    if ( (x.compare("1")                       == 0) or
170         (x.compare("speculative_load_access") == 0))
171      return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_ACCESS;
172    if ( (x.compare("2")                       == 0) or
173         (x.compare("speculative_load_commit") == 0))
174      return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_COMMIT;
175    if ( (x.compare("3")                       == 0) or
176         (x.compare("speculative_load_bypass") == 0))
177      return morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::load_store_unit::SPECULATIVE_LOAD_BYPASS;
178   
179    throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\""));
180  };
181
182}; // end namespace morpheo             
183
184#endif
Note: See TracBrowser for help on using the repository browser.