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

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

Update all component (except front_end) to :

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