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

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

Ajout SystemC read_queue et reservation_station
Ajout port au bloc registerfile_monolithic (à ajouter également au bloc registerfile et registerfile_multi_banked)
Modif param : passage de pointeur (attention, tous les composants n'ont pas été tous modifier)

File size: 12.1 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 <vector>
17#include "Common/include/ToString.h"
18#include "Common/include/Debug.h"
19
20#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Parameters.h"
21#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Types.h"
22#ifdef STATISTICS
23#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Statistics.h"
24#endif
25#include "Behavioural/include/Component.h"
26#ifdef VHDL
27#include "Behavioural/include/Vhdl.h"
28#endif
29
30using namespace std;
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    : Tpacket_t          _packet_id   ;
45  public    : Toperation_t       _operation   ;
46  public    : Ttype_t            _type        ;
47  public    : Tcontrol_t         _has_immediat;
48  public    : Tgeneral_data_t    _immediat    ;
49//public    : Tcontrol_t         _read_ra     ;
50  public    : Tgeneral_address_t _num_reg_ra  ;
51  public    : Tcontrol_t         _data_ra_val ;
52  public    : Tgeneral_data_t    _data_ra     ;
53//public    : Tcontrol_t         _read_rb     ;
54  public    : Tgeneral_address_t _num_reg_rb  ;
55  public    : Tcontrol_t         _data_rb_val ;
56  public    : Tgeneral_data_t    _data_rb     ;
57//public    : Tcontrol_t         _read_rc     ;
58  public    : Tspecial_address_t _num_reg_rc  ;
59  public    : Tcontrol_t         _data_rc_val ;
60  public    : Tspecial_data_t    _data_rc     ;
61  public    : Tcontrol_t         _write_rd    ;
62  public    : Tgeneral_address_t _num_reg_rd  ;
63  public    : Tcontrol_t         _write_re    ;
64  public    : Tspecial_address_t _num_reg_re  ;
65
66    friend ostream& operator<< (ostream& output_stream,
67                                morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_read_unit::read_unit::reservation_station::Treservation_station_entry_t & x)
68    {
69      output_stream << " * _context_id  : " << toString(x._context_id  ) << endl
70                    << " * _packet_id   : " << toString(x._packet_id   ) << endl
71                    << " * _operation   : " << toString(x._operation   ) << endl
72                    << " * _type        : " << toString(x._type        ) << endl
73                    << " * _has_immediat: " << toString(x._has_immediat) << endl
74                    << " * _immediat    : " << toString(x._immediat    ) << endl
75//                  << " * _read_ra     : " << toString(x._read_ra     ) << endl
76                    << " * _num_reg_ra  : " << toString(x._num_reg_ra  ) << endl
77                    << " * _data_ra_val : " << toString(x._data_ra_val ) << endl
78                    << " * _data_ra     : " << toString(x._data_ra     ) << endl
79//                  << " * _read_rb     : " << toString(x._read_rb     ) << endl
80                    << " * _num_reg_rb  : " << toString(x._num_reg_rb  ) << endl
81                    << " * _data_rb_val : " << toString(x._data_rb_val ) << endl
82                    << " * _data_rb     : " << toString(x._data_rb     ) << endl
83//                  << " * _read_rc     : " << toString(x._read_rc     ) << endl
84                    << " * _num_reg_rc  : " << toString(x._num_reg_rc  ) << endl
85                    << " * _data_rc_val : " << toString(x._data_rc_val ) << endl
86                    << " * _data_rc     : " << toString(x._data_rc     ) << endl
87                    << " * _write_rd    : " << toString(x._write_rd    ) << endl
88                    << " * _num_reg_rd  : " << toString(x._num_reg_rd  ) << endl
89                    << " * _write_re    : " << toString(x._write_re    ) << endl
90                    << " * _num_reg_re  : " << toString(x._num_reg_re  ) << endl;
91
92      return output_stream;
93    }
94
95  };
96
97  class Reservation_station
98#if SYSTEMC
99    : public sc_module
100#endif
101  {
102    // -----[ fields ]----------------------------------------------------
103    // Parameters
104  protected : const string       _name;
105
106  protected : const Parameters * _param;
107//#ifdef STATISTICS
108//  protected : const morpheo::behavioural::Parameters_Statistics * _param_statistics;
109//#endif
110
111#ifdef STATISTICS
112  private   : Statistics                     * _stat;
113#endif
114
115  public    : Component                      * _component;
116  private   : Interfaces                     * _interfaces;
117
118#ifdef SYSTEMC
119    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
120    // Interface
121  public    : SC_CLOCK                      *  in_CLOCK        ;
122  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
123
124    // ~~~~~[ Interface "reservation_station_in" ]~~~~~~~~~~~~~~~~~~~~~~~~
125  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_VAL         ;
126  public    : SC_OUT(Tcontrol_t        )    * out_RESERVATION_STATION_IN_ACK         ;
127  public    : SC_IN (Tcontext_t        )    *  in_RESERVATION_STATION_IN_CONTEXT_ID  ;
128  public    : SC_IN (Tpacket_t         )    *  in_RESERVATION_STATION_IN_PACKET_ID   ;
129  public    : SC_IN (Toperation_t      )    *  in_RESERVATION_STATION_IN_OPERATION   ;
130  public    : SC_IN (Ttype_t           )    *  in_RESERVATION_STATION_IN_TYPE        ;
131  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_HAS_IMMEDIAT;
132  public    : SC_IN (Tgeneral_data_t   )    *  in_RESERVATION_STATION_IN_IMMEDIAT    ;
133//public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_READ_RA     ;
134  public    : SC_IN (Tgeneral_address_t)    *  in_RESERVATION_STATION_IN_NUM_REG_RA  ;
135  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_DATA_RA_VAL ;
136  public    : SC_IN (Tgeneral_data_t   )    *  in_RESERVATION_STATION_IN_DATA_RA     ;
137//public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_READ_RB     ;
138  public    : SC_IN (Tgeneral_address_t)    *  in_RESERVATION_STATION_IN_NUM_REG_RB  ;
139  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_DATA_RB_VAL ;
140  public    : SC_IN (Tgeneral_data_t   )    *  in_RESERVATION_STATION_IN_DATA_RB     ;
141//public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_READ_RC     ;
142  public    : SC_IN (Tspecial_address_t)    *  in_RESERVATION_STATION_IN_NUM_REG_RC  ;
143  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_DATA_RC_VAL ;
144  public    : SC_IN (Tspecial_data_t   )    *  in_RESERVATION_STATION_IN_DATA_RC     ;
145  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_WRITE_RD    ;
146  public    : SC_IN (Tgeneral_address_t)    *  in_RESERVATION_STATION_IN_NUM_REG_RD  ;
147  public    : SC_IN (Tcontrol_t        )    *  in_RESERVATION_STATION_IN_WRITE_RE    ;
148  public    : SC_IN (Tspecial_address_t)    *  in_RESERVATION_STATION_IN_NUM_REG_RE  ;
149
150    // ~~~~~[ Interface "reservation_station_out" ]~~~~~~~~~~~~~~~~~~~~~~~
151  public    : SC_OUT(Tcontrol_t        )   ** out_RESERVATION_STATION_OUT_VAL         ;
152  public    : SC_IN (Tcontrol_t        )   **  in_RESERVATION_STATION_OUT_ACK         ;
153  public    : SC_OUT(Tcontext_t        )   ** out_RESERVATION_STATION_OUT_CONTEXT_ID  ;
154  public    : SC_OUT(Tpacket_t         )   ** out_RESERVATION_STATION_OUT_PACKET_ID   ;
155  public    : SC_OUT(Toperation_t      )   ** out_RESERVATION_STATION_OUT_OPERATION   ;
156  public    : SC_OUT(Ttype_t           )   ** out_RESERVATION_STATION_OUT_TYPE        ;
157  public    : SC_OUT(Tcontrol_t        )   ** out_RESERVATION_STATION_OUT_HAS_IMMEDIAT;
158  public    : SC_OUT(Tgeneral_data_t   )   ** out_RESERVATION_STATION_OUT_IMMEDIAT    ;
159  public    : SC_OUT(Tgeneral_data_t   )   ** out_RESERVATION_STATION_OUT_DATA_RA     ;
160  public    : SC_OUT(Tgeneral_data_t   )   ** out_RESERVATION_STATION_OUT_DATA_RB     ;
161  public    : SC_OUT(Tspecial_data_t   )   ** out_RESERVATION_STATION_OUT_DATA_RC     ;
162  public    : SC_OUT(Tcontrol_t        )   ** out_RESERVATION_STATION_OUT_WRITE_RD    ;
163  public    : SC_OUT(Tgeneral_address_t)   ** out_RESERVATION_STATION_OUT_NUM_REG_RD  ;
164  public    : SC_OUT(Tcontrol_t        )   ** out_RESERVATION_STATION_OUT_WRITE_RE    ;
165  public    : SC_OUT(Tspecial_address_t)   ** out_RESERVATION_STATION_OUT_NUM_REG_RE  ;
166
167    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
168
169  public    : SC_IN (Tcontrol_t        )   **  in_GPR_WRITE_VAL       ; // val and ack
170  public    : SC_IN (Tcontext_t        )   **  in_GPR_WRITE_CONTEXT_ID;
171  public    : SC_IN (Tgeneral_address_t)   **  in_GPR_WRITE_NUM_REG   ;
172  public    : SC_IN (Tgeneral_data_t   )   **  in_GPR_WRITE_DATA      ;
173
174    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
175
176  public    : SC_IN (Tcontrol_t        )   **  in_SPR_WRITE_VAL       ; // val and ack
177  public    : SC_IN (Tcontext_t        )   **  in_SPR_WRITE_CONTEXT_ID;
178  public    : SC_IN (Tspecial_address_t)   **  in_SPR_WRITE_NUM_REG   ;
179  public    : SC_IN (Tspecial_data_t   )   **  in_SPR_WRITE_DATA      ;
180
181    // ~~~~~[ Interface "bypass_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
182
183  public    : SC_IN (Tcontext_t        )   **  in_BYPASS_WRITE_CONTEXT_ID ;
184  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_WRITE_GPR_VAL    ;
185  public    : SC_IN (Tgeneral_address_t)   **  in_BYPASS_WRITE_GPR_NUM_REG; // RD
186  public    : SC_IN (Tgeneral_data_t   )   **  in_BYPASS_WRITE_GPR_DATA   ;
187  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_WRITE_SPR_VAL    ;
188  public    : SC_IN (Tspecial_address_t)   **  in_BYPASS_WRITE_SPR_NUM_REG; // RE
189  public    : SC_IN (Tspecial_data_t   )   **  in_BYPASS_WRITE_SPR_DATA   ;
190
191    // ~~~~~[ Interface "bypass_memory" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
193  public    : SC_IN (Tcontrol_t        )   **  in_BYPASS_MEMORY_VAL       ;
194  public    : SC_IN (Tcontext_t        )   **  in_BYPASS_MEMORY_CONTEXT_ID;
195  public    : SC_IN (Tgeneral_address_t)   **  in_BYPASS_MEMORY_NUM_REG   ;
196  public    : SC_IN (Tgeneral_data_t   )   **  in_BYPASS_MEMORY_DATA      ;
197
198
199    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
200
201    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
202
203    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
204  protected : vector<uint32_t>              *  _queue_control;
205  protected : uint32_t                         _queue_nb_elt;
206  protected : Treservation_station_entry_t  *  _queue;
207
208  protected : Tcontrol_t                       internal_RESERVATION_STATION_IN_ACK;
209  protected : Tcontrol_t                    *  internal_RESERVATION_STATION_OUT_VAL;
210#endif
211
212    // -----[ methods ]---------------------------------------------------
213
214#ifdef SYSTEMC
215    SC_HAS_PROCESS (Reservation_station);
216#endif
217  public  :          Reservation_station              (
218#ifdef SYSTEMC
219                                              sc_module_name                                name,
220#else                                         
221                                              string                                        name,
222#endif                                         
223#ifdef STATISTICS
224                                              morpheo::behavioural::Parameters_Statistics * param_statistics,
225#endif
226                                              Parameters                                  * param );
227  public  :          ~Reservation_station             (void);
228                                               
229#ifdef SYSTEMC                                 
230  private : void     allocation                (void);
231  private : void     deallocation              (void);
232                                               
233  public  : void     transition                (void);
234  public  : void     genMoore                  (void);
235#endif                                         
236#ifdef STATISTICS
237  public  : string   statistics                (uint32_t depth);
238#endif
239                                               
240#if VHDL                                       
241  public  : void     vhdl                      (void);
242  private : void     vhdl_declaration          (Vhdl * & vhdl);
243  private : void     vhdl_body                 (Vhdl * & vhdl);
244#endif                                         
245                                               
246#ifdef VHDL_TESTBENCH                         
247  private : void     vhdl_testbench_transition (void);
248#endif
249  };
250
251}; // end namespace reservation_station
252}; // end namespace read_unit
253}; // end namespace multi_read_unit
254}; // end namespace execute_loop
255}; // end namespace multi_execute_loop
256}; // end namespace core
257
258}; // end namespace behavioural
259}; // end namespace morpheo             
260
261#endif
Note: See TracBrowser for help on using the repository browser.