source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h @ 76

Last change on this file since 76 was 76, checked in by rosiere, 16 years ago

Add new component : Read_unit (no tested)
Change functionnal_unit : now use type and operation to execute the good function
Change New_Component's script

File size: 13.2 KB
Line 
1#ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_read_unit_read_unit_reservation_station_Reservation_station_h
2#define morpheo_behavioural_core_multi_execute_loop_execute_loop_multi_read_unit_read_unit_reservation_station_Reservation_station_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15#include <iostream>
16#include "Common/include/ToString.h"
17#include "Common/include/Debug.h"
18
19#ifndef  SYSTEMC_VHDL_COMPATIBILITY
20#include "Behavioural/Generic/Queue_Control/include/Queue_Control.h"
21#endif
22#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Parameters.h"
23#include "Behavioural/include/Types.h"
24#ifdef STATISTICS
25#include "Behavioural/include/Stat.h"
26#endif
27#include "Behavioural/include/Component.h"
28#ifdef VHDL
29#include "Behavioural/include/Vhdl.h"
30#endif
31
32namespace morpheo {
33namespace behavioural {
34namespace core {
35namespace multi_execute_loop {
36namespace execute_loop {
37namespace multi_read_unit {
38namespace read_unit {
39namespace reservation_station {
40
41  class Treservation_station_entry_t
42  {
43  public    : Tcontext_t         _context_id     ;
44  public    : Tcontext_t         _front_end_id   ;
45  public    : Tcontext_t         _ooo_engine_id  ;
46  public    : Tpacket_t          _rob_id         ;
47  public    : Toperation_t       _operation   ;
48  public    : Ttype_t            _type        ;
49  public    : Tlsq_ptr_t         _store_queue_ptr_write;
50  public    : Tlsq_ptr_t         _load_queue_ptr_write ;
51  public    : Tcontrol_t         _has_immediat;
52  public    : Tgeneral_data_t    _immediat    ;
53//public    : Tcontrol_t         _read_ra     ;
54  public    : Tgeneral_address_t _num_reg_ra  ;
55  public    : Tcontrol_t         _data_ra_val ;
56  public    : Tgeneral_data_t    _data_ra     ;
57//public    : Tcontrol_t         _read_rb     ;
58  public    : Tgeneral_address_t _num_reg_rb  ;
59  public    : Tcontrol_t         _data_rb_val ;
60  public    : Tgeneral_data_t    _data_rb     ;
61//public    : Tcontrol_t         _read_rc     ;
62  public    : Tspecial_address_t _num_reg_rc  ;
63  public    : Tcontrol_t         _data_rc_val ;
64  public    : Tspecial_data_t    _data_rc     ;
65  public    : Tcontrol_t         _write_rd    ;
66  public    : Tgeneral_address_t _num_reg_rd  ;
67  public    : Tcontrol_t         _write_re    ;
68  public    : Tspecial_address_t _num_reg_re  ;
69
70    friend std::ostream& operator<< (std::ostream& output_stream,
71                                morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Treservation_station_entry_t & x)
72    {
73      output_stream << " * _context_id            : " << toString(x._context_id     ) << std::endl
74                    << " * _front_end_id          : " << toString(x._front_end_id   ) << std::endl
75                    << " * _ooo_engine_id         : " << toString(x._ooo_engine_id  ) << std::endl
76                    << " * _rob_id                : " << toString(x._rob_id         ) << std::endl
77                    << " * _operation             : " << toString(x._operation      ) << std::endl
78                    << " * _type                  : " << toString(x._type           ) << std::endl
79                    << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl
80                    << " * _load_queue_ptr_write  : " << toString(x._load_queue_ptr_write ) << std::endl
81                    << " * _has_immediat          : " << toString(x._has_immediat   ) << std::endl
82                    << " * _immediat              : " << toString(x._immediat       ) << std::endl
83//                  << " * _read_ra               : " << toString(x._read_ra        ) << std::endl
84                    << " * _num_reg_ra            : " << toString(x._num_reg_ra     ) << std::endl
85                    << " * _data_ra_val           : " << toString(x._data_ra_val    ) << std::endl
86                    << " * _data_ra               : " << toString(x._data_ra        ) << std::endl
87//                  << " * _read_rb               : " << toString(x._read_rb        ) << std::endl
88                    << " * _num_reg_rb            : " << toString(x._num_reg_rb     ) << std::endl
89                    << " * _data_rb_val           : " << toString(x._data_rb_val    ) << std::endl
90                    << " * _data_rb               : " << toString(x._data_rb        ) << std::endl
91//                  << " * _read_rc               : " << toString(x._read_rc        ) << std::endl
92                    << " * _num_reg_rc            : " << toString(x._num_reg_rc     ) << std::endl
93                    << " * _data_rc_val           : " << toString(x._data_rc_val    ) << std::endl
94                    << " * _data_rc               : " << toString(x._data_rc        ) << std::endl
95                    << " * _write_rd              : " << toString(x._write_rd       ) << std::endl
96                    << " * _num_reg_rd            : " << toString(x._num_reg_rd     ) << std::endl
97                    << " * _write_re              : " << toString(x._write_re       ) << std::endl
98                    << " * _num_reg_re            : " << toString(x._num_reg_re     ) << std::endl;
99
100      return output_stream;
101    }
102  };
103
104  class Reservation_station
105#if SYSTEMC
106    : public sc_module
107#endif
108  {
109    // -----[ fields ]----------------------------------------------------
110    // Parameters
111  protected : const std::string       _name;
112
113  protected : const Parameters * _param;
114
115#ifdef STATISTICS
116  public    : Stat                           * _stat;
117#endif
118
119  public    : Component                      * _component;
120  private   : Interfaces                     * _interfaces;
121
122#ifdef SYSTEMC
123    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
124    // Interface
125  public    : SC_CLOCK                      *  in_CLOCK        ;
126  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
127
128    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~
129  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_VAL            ;
130  public    : SC_OUT(Tcontrol_t        )    * out_INSERT_ACK            ;
131  public    : SC_IN (Tcontext_t        )    *  in_INSERT_CONTEXT_ID     ;
132  public    : SC_IN (Tcontext_t        )    *  in_INSERT_FRONT_END_ID   ;
133  public    : SC_IN (Tcontext_t        )    *  in_INSERT_OOO_ENGINE_ID  ;
134  public    : SC_IN (Tpacket_t         )    *  in_INSERT_ROB_ID         ;
135  public    : SC_IN (Toperation_t      )    *  in_INSERT_OPERATION      ;
136  public    : SC_IN (Ttype_t           )    *  in_INSERT_TYPE           ;
137  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_STORE_QUEUE_PTR_WRITE;
138  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_LOAD_QUEUE_PTR_WRITE ;
139  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_HAS_IMMEDIAT   ;
140  public    : SC_IN (Tgeneral_data_t   )    *  in_INSERT_IMMEDIAT       ;
141//public    : SC_IN (Tcontrol_t        )    *  in_INSERT_READ_RA        ;
142  public    : SC_IN (Tgeneral_address_t)    *  in_INSERT_NUM_REG_RA     ;
143  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_DATA_RA_VAL    ;
144  public    : SC_IN (Tgeneral_data_t   )    *  in_INSERT_DATA_RA        ;
145//public    : SC_IN (Tcontrol_t        )    *  in_INSERT_READ_RB        ;
146  public    : SC_IN (Tgeneral_address_t)    *  in_INSERT_NUM_REG_RB     ;
147  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_DATA_RB_VAL    ;
148  public    : SC_IN (Tgeneral_data_t   )    *  in_INSERT_DATA_RB        ;
149//public    : SC_IN (Tcontrol_t        )    *  in_INSERT_READ_RC        ;
150  public    : SC_IN (Tspecial_address_t)    *  in_INSERT_NUM_REG_RC     ;
151  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_DATA_RC_VAL    ;
152  public    : SC_IN (Tspecial_data_t   )    *  in_INSERT_DATA_RC        ;
153  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_WRITE_RD       ;
154  public    : SC_IN (Tgeneral_address_t)    *  in_INSERT_NUM_REG_RD     ;
155  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_WRITE_RE       ;
156  public    : SC_IN (Tspecial_address_t)    *  in_INSERT_NUM_REG_RE     ;
157
158    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~
159  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_VAL            ;
160  public    : SC_IN (Tcontrol_t        )   **  in_RETIRE_ACK            ;
161  public    : SC_OUT(Tcontext_t        )   ** out_RETIRE_CONTEXT_ID     ;
162  public    : SC_OUT(Tcontext_t        )   ** out_RETIRE_FRONT_END_ID   ;
163  public    : SC_OUT(Tcontext_t        )   ** out_RETIRE_OOO_ENGINE_ID  ;
164  public    : SC_OUT(Tpacket_t         )   ** out_RETIRE_ROB_ID         ;
165  public    : SC_OUT(Toperation_t      )   ** out_RETIRE_OPERATION      ;
166  public    : SC_OUT(Ttype_t           )   ** out_RETIRE_TYPE           ;
167  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_STORE_QUEUE_PTR_WRITE;
168  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_LOAD_QUEUE_PTR_WRITE ;
169  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_HAS_IMMEDIAT   ;
170  public    : SC_OUT(Tgeneral_data_t   )   ** out_RETIRE_IMMEDIAT       ;
171  public    : SC_OUT(Tgeneral_data_t   )   ** out_RETIRE_DATA_RA        ;
172  public    : SC_OUT(Tgeneral_data_t   )   ** out_RETIRE_DATA_RB        ;
173  public    : SC_OUT(Tspecial_data_t   )   ** out_RETIRE_DATA_RC        ;
174  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_WRITE_RD       ;
175  public    : SC_OUT(Tgeneral_address_t)   ** out_RETIRE_NUM_REG_RD     ;
176  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_WRITE_RE       ;
177  public    : SC_OUT(Tspecial_address_t)   ** out_RETIRE_NUM_REG_RE     ;
178
179    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
180
181  public    : SC_IN (Tcontrol_t        )   **  in_GPR_WRITE_VAL          ; // val and ack
182  public    : SC_IN (Tcontext_t        )   **  in_GPR_WRITE_OOO_ENGINE_ID;
183  public    : SC_IN (Tgeneral_address_t)   **  in_GPR_WRITE_NUM_REG      ;
184  public    : SC_IN (Tgeneral_data_t   )   **  in_GPR_WRITE_DATA         ;
185
186    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
187
188  public    : SC_IN (Tcontrol_t        )   **  in_SPR_WRITE_VAL          ; // val and ack
189  public    : SC_IN (Tcontext_t        )   **  in_SPR_WRITE_OOO_ENGINE_ID;
190  public    : SC_IN (Tspecial_address_t)   **  in_SPR_WRITE_NUM_REG      ;
191  public    : SC_IN (Tspecial_data_t   )   **  in_SPR_WRITE_DATA         ;
192
193    // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
194
195  public    : SC_IN (Tcontext_t        )   **  in_BYPASS_WRITE_OOO_ENGINE_ID ;
196  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_WRITE_GPR_VAL       ;
197  public    : SC_IN (Tgeneral_address_t)   **  in_BYPASS_WRITE_GPR_NUM_REG   ; // RD
198  public    : SC_IN (Tgeneral_data_t   )   **  in_BYPASS_WRITE_GPR_DATA      ;
199  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_WRITE_SPR_VAL       ;
200  public    : SC_IN (Tspecial_address_t)   **  in_BYPASS_WRITE_SPR_NUM_REG   ; // RE
201  public    : SC_IN (Tspecial_data_t   )   **  in_BYPASS_WRITE_SPR_DATA      ;
202
203    // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
204
205  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_MEMORY_VAL          ;
206  public    : SC_IN (Tcontext_t        )   **  in_BYPASS_MEMORY_OOO_ENGINE_ID;
207  public    : SC_IN (Tgeneral_address_t)   **  in_BYPASS_MEMORY_NUM_REG      ;
208  public    : SC_IN (Tgeneral_data_t   )   **  in_BYPASS_MEMORY_DATA         ;
209
210
211    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
212
213    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
214
215    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
216#ifdef  SYSTEMC_VHDL_COMPATIBILITY
217  protected : bool                          *  _queue_valid;
218  protected : uint32_t                         internal_INSERT_SLOT;
219#else
220  protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control;
221#endif
222  protected : Treservation_station_entry_t  *  _queue;
223
224  protected : Tcontrol_t                       internal_INSERT_ACK;
225  protected : Tcontrol_t                    *  internal_RETIRE_VAL;
226  protected : uint32_t                      *  internal_RETIRE_SLOT;
227#endif
228
229    // -----[ methods ]---------------------------------------------------
230
231#ifdef SYSTEMC
232    SC_HAS_PROCESS (Reservation_station);
233#endif
234  public  :          Reservation_station              (
235#ifdef SYSTEMC
236                                                       sc_module_name                                name,
237#else                                         
238                                                       string                                        name,
239#endif                                         
240#ifdef STATISTICS
241                                                       morpheo::behavioural::Parameters_Statistics * param_statistics,
242#endif
243                                                       Parameters                                  * param );
244  public  :          ~Reservation_station             (void);
245                                               
246#ifdef SYSTEMC                                 
247  private : void     allocation                (void);
248  private : void     deallocation              (void);
249                                               
250  public  : void     transition                (void);
251  public  : void     genMoore                  (void);
252#endif                                         
253
254#ifdef STATISTICS
255  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
256#endif
257                                               
258#if VHDL                                       
259  public  : void     vhdl                      (void);
260  private : void     vhdl_declaration          (Vhdl * & vhdl);
261  private : void     vhdl_body                 (Vhdl * & vhdl);
262#endif                                         
263                                               
264#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
265  private : void     end_cycle                 (void);
266#endif
267  };
268
269}; // end namespace reservation_station
270}; // end namespace read_unit
271}; // end namespace multi_read_unit
272}; // end namespace execute_loop
273}; // end namespace multi_execute_loop
274}; // end namespace core
275
276}; // end namespace behavioural
277}; // end namespace morpheo             
278
279#endif
Note: See TracBrowser for help on using the repository browser.