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

Last change on this file since 122 was 122, checked in by rosiere, 15 years ago

Modif for performance :
1) Load Store Unit : store send request to valid exeception
2) Commit_unit : retire can bypass store
3) Commit_unit : add stat to manage store instruction
4) Load Store Unit and Load Store Pointer Manager : add store_queue_ptr_read
5) Fix lot of bug

  • Property svn:keywords set to Id
File size: 10.0 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: Reservation_station.h 122 2009-06-03 08:15:51Z rosiere $
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/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/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#include "Behavioural/include/Usage.h"
32
33namespace morpheo {
34namespace behavioural {
35namespace core {
36namespace multi_execute_loop {
37namespace execute_loop {
38namespace multi_read_unit {
39namespace read_unit {
40namespace reservation_station {
41
42  class Reservation_station
43#if SYSTEMC
44    : public sc_module
45#endif
46  {
47    // -----[ fields ]----------------------------------------------------
48    // Parameters
49  protected : const std::string  _name;
50  protected : const Parameters * _param;
51  private   : const Tusage_t     _usage;
52
53#ifdef STATISTICS
54  public    : Stat                           * _stat;
55#endif
56
57  public    : Component                      * _component;
58  private   : Interfaces                     * _interfaces;
59
60#ifdef SYSTEMC
61    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62    // Interface
63  public    : SC_CLOCK                      *  in_CLOCK        ;
64  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
65
66    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~
67  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_VAL            ;
68  public    : SC_OUT(Tcontrol_t        )    * out_INSERT_ACK            ;
69  public    : SC_IN (Tcontext_t        )    *  in_INSERT_CONTEXT_ID     ;
70  public    : SC_IN (Tcontext_t        )    *  in_INSERT_FRONT_END_ID   ;
71  public    : SC_IN (Tcontext_t        )    *  in_INSERT_OOO_ENGINE_ID  ;
72  public    : SC_IN (Tpacket_t         )    *  in_INSERT_ROB_ID         ;
73  public    : SC_IN (Toperation_t      )    *  in_INSERT_OPERATION      ;
74  public    : SC_IN (Ttype_t           )    *  in_INSERT_TYPE           ;
75  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_STORE_QUEUE_PTR_WRITE;
76  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_STORE_QUEUE_PTR_READ ;
77  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_STORE_QUEUE_EMPTY    ;
78  public    : SC_IN (Tlsq_ptr_t        )    *  in_INSERT_LOAD_QUEUE_PTR_WRITE ;
79  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_HAS_IMMEDIAT   ;
80  public    : SC_IN (Tgeneral_data_t   )    *  in_INSERT_IMMEDIAT       ;
81//public    : SC_IN (Tcontrol_t        )    *  in_INSERT_READ_RA        ;
82  public    : SC_IN (Tgeneral_address_t)    *  in_INSERT_NUM_REG_RA     ;
83  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_DATA_RA_VAL    ;
84  public    : SC_IN (Tgeneral_data_t   )    *  in_INSERT_DATA_RA        ;
85//public    : SC_IN (Tcontrol_t        )    *  in_INSERT_READ_RB        ;
86  public    : SC_IN (Tgeneral_address_t)    *  in_INSERT_NUM_REG_RB     ;
87  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_DATA_RB_VAL    ;
88  public    : SC_IN (Tgeneral_data_t   )    *  in_INSERT_DATA_RB        ;
89//public    : SC_IN (Tcontrol_t        )    *  in_INSERT_READ_RC        ;
90  public    : SC_IN (Tspecial_address_t)    *  in_INSERT_NUM_REG_RC     ;
91  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_DATA_RC_VAL    ;
92  public    : SC_IN (Tspecial_data_t   )    *  in_INSERT_DATA_RC        ;
93  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_WRITE_RD       ;
94  public    : SC_IN (Tgeneral_address_t)    *  in_INSERT_NUM_REG_RD     ;
95  public    : SC_IN (Tcontrol_t        )    *  in_INSERT_WRITE_RE       ;
96  public    : SC_IN (Tspecial_address_t)    *  in_INSERT_NUM_REG_RE     ;
97
98    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~
99  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_VAL            ;
100  public    : SC_IN (Tcontrol_t        )   **  in_RETIRE_ACK            ;
101  public    : SC_OUT(Tcontext_t        )   ** out_RETIRE_CONTEXT_ID     ;
102  public    : SC_OUT(Tcontext_t        )   ** out_RETIRE_FRONT_END_ID   ;
103  public    : SC_OUT(Tcontext_t        )   ** out_RETIRE_OOO_ENGINE_ID  ;
104  public    : SC_OUT(Tpacket_t         )   ** out_RETIRE_ROB_ID         ;
105  public    : SC_OUT(Toperation_t      )   ** out_RETIRE_OPERATION      ;
106  public    : SC_OUT(Ttype_t           )   ** out_RETIRE_TYPE           ;
107  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_STORE_QUEUE_PTR_WRITE;
108  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_STORE_QUEUE_PTR_READ ;
109  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_STORE_QUEUE_EMPTY    ;
110  public    : SC_OUT(Tlsq_ptr_t        )   ** out_RETIRE_LOAD_QUEUE_PTR_WRITE ;
111  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_HAS_IMMEDIAT   ;
112  public    : SC_OUT(Tgeneral_data_t   )   ** out_RETIRE_IMMEDIAT       ;
113  public    : SC_OUT(Tgeneral_data_t   )   ** out_RETIRE_DATA_RA        ;
114  public    : SC_OUT(Tgeneral_data_t   )   ** out_RETIRE_DATA_RB        ;
115  public    : SC_OUT(Tspecial_data_t   )   ** out_RETIRE_DATA_RC        ;
116  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_WRITE_RD       ;
117  public    : SC_OUT(Tgeneral_address_t)   ** out_RETIRE_NUM_REG_RD     ;
118  public    : SC_OUT(Tcontrol_t        )   ** out_RETIRE_WRITE_RE       ;
119  public    : SC_OUT(Tspecial_address_t)   ** out_RETIRE_NUM_REG_RE     ;
120
121    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122
123  public    : SC_IN (Tcontrol_t        )   **  in_GPR_WRITE_VAL          ; // val and ack
124  public    : SC_IN (Tcontext_t        )   **  in_GPR_WRITE_OOO_ENGINE_ID;
125  public    : SC_IN (Tgeneral_address_t)   **  in_GPR_WRITE_NUM_REG      ;
126  public    : SC_IN (Tgeneral_data_t   )   **  in_GPR_WRITE_DATA         ;
127
128    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
129
130  public    : SC_IN (Tcontrol_t        )   **  in_SPR_WRITE_VAL          ; // val and ack
131  public    : SC_IN (Tcontext_t        )   **  in_SPR_WRITE_OOO_ENGINE_ID;
132  public    : SC_IN (Tspecial_address_t)   **  in_SPR_WRITE_NUM_REG      ;
133  public    : SC_IN (Tspecial_data_t   )   **  in_SPR_WRITE_DATA         ;
134
135    // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136
137  public    : SC_IN (Tcontext_t        )   **  in_BYPASS_WRITE_OOO_ENGINE_ID ;
138  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_WRITE_GPR_VAL       ;
139  public    : SC_IN (Tgeneral_address_t)   **  in_BYPASS_WRITE_GPR_NUM_REG   ; // RD
140  public    : SC_IN (Tgeneral_data_t   )   **  in_BYPASS_WRITE_GPR_DATA      ;
141  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_WRITE_SPR_VAL       ;
142  public    : SC_IN (Tspecial_address_t)   **  in_BYPASS_WRITE_SPR_NUM_REG   ; // RE
143  public    : SC_IN (Tspecial_data_t   )   **  in_BYPASS_WRITE_SPR_DATA      ;
144
145    // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
146
147  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_MEMORY_VAL          ;
148  public    : SC_IN (Tcontext_t        )   **  in_BYPASS_MEMORY_OOO_ENGINE_ID;
149  public    : SC_IN (Tgeneral_address_t)   **  in_BYPASS_MEMORY_NUM_REG      ;
150  public    : SC_IN (Tgeneral_data_t   )   **  in_BYPASS_MEMORY_DATA         ;
151
152
153    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
154
155    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
156
157    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
158#ifdef  SYSTEMC_VHDL_COMPATIBILITY
159  protected : bool                          *  _queue_valid;
160  protected : uint32_t                         internal_INSERT_SLOT;
161#else
162  protected : morpheo::behavioural::generic::queue_control::Queue_Control * _queue_control;
163#endif
164  protected : Treservation_station_entry_t  *  _queue;
165
166  protected : Tcontrol_t                       internal_INSERT_ACK;
167  protected : Tcontrol_t                    *  internal_RETIRE_VAL;
168  protected : uint32_t                      *  internal_RETIRE_SLOT;
169#endif
170
171    // -----[ methods ]---------------------------------------------------
172
173#ifdef SYSTEMC
174    SC_HAS_PROCESS (Reservation_station);
175#endif
176  public  :          Reservation_station              (
177#ifdef SYSTEMC
178                                                       sc_module_name                                name,
179#else                                         
180                                                       string                                        name,
181#endif                                         
182#ifdef STATISTICS
183                                                       morpheo::behavioural::Parameters_Statistics * param_statistics,
184#endif
185                                                       Parameters                                  * param,
186                                                       morpheo::behavioural::Tusage_t                usage );
187
188  public  :          ~Reservation_station             (void);
189                                               
190#ifdef SYSTEMC                                 
191  private : void     allocation                (void);
192  private : void     deallocation              (void);
193                                               
194  public  : void     transition                (void);
195  public  : void     genMoore                  (void);
196#endif                                         
197
198#ifdef STATISTICS
199  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
200#endif
201                                               
202#if VHDL                                       
203  public  : void     vhdl                      (void);
204  private : void     vhdl_declaration          (Vhdl * & vhdl);
205  private : void     vhdl_body                 (Vhdl * & vhdl);
206#endif                                         
207                                               
208#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
209  private : void     end_cycle                 (void);
210#endif
211  };
212
213}; // end namespace reservation_station
214}; // end namespace read_unit
215}; // end namespace multi_read_unit
216}; // end namespace execute_loop
217}; // end namespace multi_execute_loop
218}; // end namespace core
219
220}; // end namespace behavioural
221}; // end namespace morpheo             
222
223#endif
Note: See TracBrowser for help on using the repository browser.