source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h @ 146

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

1) Add new algo in ifetch queue
2) Add Cancel bit
3) new config

  • Property svn:keywords set to Id
File size: 11.3 KB
Line 
1#ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_register_unit_glue_Register_unit_Glue_h
2#define morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_register_unit_glue_Register_unit_Glue_h
3
4/*
5 * $Id: Register_unit_Glue.h 136 2009-10-20 18:52:15Z 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#include "Behavioural/include/Types.h"
19
20#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Parameters.h"
21#ifdef STATISTICS
22#include "Behavioural/include/Stat.h"
23#endif
24#include "Behavioural/include/Component.h"
25#ifdef VHDL
26#include "Behavioural/include/Vhdl.h"
27#endif
28#include "Behavioural/include/Usage.h"
29
30namespace morpheo {
31namespace behavioural {
32
33namespace core {
34namespace multi_execute_loop {
35namespace execute_loop {
36namespace register_unit {
37namespace register_unit_glue {
38
39
40  class Register_unit_Glue
41#if SYSTEMC
42    : public sc_module
43#endif
44  {
45    // -----[ fields ]----------------------------------------------------
46    // Parameters
47  protected : const std::string       _name;
48  protected : const Parameters * _param;
49  private   : const Tusage_t     _usage;
50
51#ifdef STATISTICS
52  public    : Stat                           * _stat;
53#endif
54
55  public    : Component                      * _component;
56  private   : Interfaces                     * _interfaces;
57
58#ifdef SYSTEMC
59    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60    // Interface
61  public    : SC_CLOCK                      *  in_CLOCK  ;
62  public    : SC_IN (Tcontrol_t)            *  in_NRESET ;
63//public    : SC_OUT(Tcontrol_t        )    * out_CONST_0;
64//public    : SC_OUT(Tcontrol_t        )    * out_CONST_1;
65
66    // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
67  public    : SC_IN (Tcontrol_t        )   **  in_GPR_READ_VAL              ;
68  public    : SC_OUT(Tcontrol_t        )   ** out_GPR_READ_ACK              ;
69  public    : SC_IN (Tcontext_t        )   **  in_GPR_READ_OOO_ENGINE_ID    ;
70  public    : SC_OUT(Tgeneral_data_t   )   ** out_GPR_READ_DATA             ;
71  public    : SC_OUT(Tcontrol_t        )   ** out_GPR_READ_DATA_VAL         ;
72
73  public    : SC_OUT(Tcontrol_t        )  *** out_GPR_READ_REGISTERFILE_VAL ;
74  public    : SC_IN (Tcontrol_t        )  ***  in_GPR_READ_REGISTERFILE_ACK ;
75  public    : SC_IN (Tgeneral_data_t   )  ***  in_GPR_READ_REGISTERFILE_DATA;
76
77  public    : SC_OUT(Tcontrol_t        )  *** out_GPR_READ_STATUS_VAL       ;
78  public    : SC_IN (Tcontrol_t        )  ***  in_GPR_READ_STATUS_ACK       ;
79  public    : SC_IN (Tgeneral_data_t   )  ***  in_GPR_READ_STATUS_DATA_VAL  ; // type for compatibility with the registerFile
80
81    // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82  public    : SC_IN (Tcontrol_t        )   **  in_SPR_READ_VAL              ;
83  public    : SC_OUT(Tcontrol_t        )   ** out_SPR_READ_ACK              ;
84  public    : SC_IN (Tcontext_t        )   **  in_SPR_READ_OOO_ENGINE_ID    ;
85  public    : SC_OUT(Tspecial_data_t   )   ** out_SPR_READ_DATA             ;
86  public    : SC_OUT(Tcontrol_t        )   ** out_SPR_READ_DATA_VAL         ;
87
88  public    : SC_OUT(Tcontrol_t        )  *** out_SPR_READ_REGISTERFILE_VAL ;
89  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_READ_REGISTERFILE_ACK ;
90  public    : SC_IN (Tspecial_data_t   )  ***  in_SPR_READ_REGISTERFILE_DATA;
91
92  public    : SC_OUT(Tcontrol_t        )  *** out_SPR_READ_STATUS_VAL       ;
93  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_READ_STATUS_ACK       ;
94  public    : SC_IN (Tspecial_data_t   )  ***  in_SPR_READ_STATUS_DATA_VAL  ; // type for compatibility with the registerFile
95
96    // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
97  public    : SC_IN (Tcontrol_t        )   **  in_GPR_WRITE_VAL             ;
98  public    : SC_OUT(Tcontrol_t        )   ** out_GPR_WRITE_ACK             ;
99  public    : SC_IN (Tcontext_t        )   **  in_GPR_WRITE_OOO_ENGINE_ID   ;
100
101  public    : SC_OUT(Tcontrol_t        )  *** out_GPR_WRITE_REGISTERFILE_VAL;
102  public    : SC_IN (Tcontrol_t        )  ***  in_GPR_WRITE_REGISTERFILE_ACK;
103
104  public    : SC_OUT(Tcontrol_t        )  *** out_GPR_WRITE_STATUS_VAL      ;
105  public    : SC_IN (Tcontrol_t        )  ***  in_GPR_WRITE_STATUS_ACK      ;
106  public    : SC_OUT(Tgeneral_data_t   )  *** out_GPR_WRITE_STATUS_DATA     ; // type for compatibility with the registerFile
107   
108    // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
109  public    : SC_IN (Tcontrol_t        )   **  in_SPR_WRITE_VAL             ;
110  public    : SC_OUT(Tcontrol_t        )   ** out_SPR_WRITE_ACK             ;
111  public    : SC_IN (Tcontext_t        )   **  in_SPR_WRITE_OOO_ENGINE_ID   ;
112
113  public    : SC_OUT(Tcontrol_t        )  *** out_SPR_WRITE_REGISTERFILE_VAL;
114  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_WRITE_REGISTERFILE_ACK;
115
116  public    : SC_OUT(Tcontrol_t        )  *** out_SPR_WRITE_STATUS_VAL      ;
117  public    : SC_IN (Tcontrol_t        )  ***  in_SPR_WRITE_STATUS_ACK      ;
118  public    : SC_OUT(Tspecial_data_t   )  *** out_SPR_WRITE_STATUS_DATA     ; // type for compatibility with the registerFile
119
120    // ~~~~~[ Interface "issue" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121  public    : SC_IN (Tcontrol_t        )  **  in_ISSUE_VAL                  ;
122  public    : SC_OUT(Tcontrol_t        )  ** out_ISSUE_ACK                  ;
123  public    : SC_IN (Tcontext_t        )  **  in_ISSUE_OOO_ENGINE_ID        ;
124  public    : SC_IN (Tcontrol_t        )  **  in_ISSUE_RD_USE               ;
125  public    : SC_IN (Tcontrol_t        )  **  in_ISSUE_RE_USE               ;
126
127  public    : SC_OUT(Tcontrol_t        ) *** out_ISSUE_GPR_STATUS_VAL       ;
128  public    : SC_IN (Tcontrol_t        ) ***  in_ISSUE_GPR_STATUS_ACK       ;
129  public    : SC_OUT(Tgeneral_data_t   ) *** out_ISSUE_GPR_STATUS_DATA      ; // type for compatibility with the registerFile
130
131  public    : SC_OUT(Tcontrol_t        ) *** out_ISSUE_SPR_STATUS_VAL       ;
132  public    : SC_IN (Tcontrol_t        ) ***  in_ISSUE_SPR_STATUS_ACK       ;
133  public    : SC_OUT(Tspecial_data_t   ) *** out_ISSUE_SPR_STATUS_DATA      ; // type for compatibility with the registerFile
134
135//     // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136//   public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_VAL                       ;
137//   public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_ACK                       ;
138//   public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_RD_USE                    ;
139//   public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_RE_USE                    ;
140
141//   public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_GPR_STATUS_VAL            ;
142//   public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_GPR_STATUS_ACK            ;
143//   public    : SC_OUT(Tgeneral_data_t   )  *** out_INSERT_ROB_GPR_STATUS_DATA           ; // type for compatibility with the registerFile
144
145//   public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_SPR_STATUS_VAL            ;
146//   public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_SPR_STATUS_ACK            ;
147//   public    : SC_OUT(Tspecial_data_t   )  *** out_INSERT_ROB_SPR_STATUS_DATA           ; // type for compatibility with the registerFile
148
149//     // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
150//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_VAL                       ;
151//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_ACK                       ;
152//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RD_OLD_USE                ;
153//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RD_NEW_USE                ;
154//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RE_OLD_USE                ;
155//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RE_NEW_USE                ;
156
157//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_GPR_STATUS_NEW_VAL        ;
158//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_GPR_STATUS_NEW_ACK        ;
159//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_GPR_STATUS_OLD_VAL        ;
160//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_GPR_STATUS_OLD_ACK        ;
161
162//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_SPR_STATUS_NEW_VAL        ;
163//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_SPR_STATUS_NEW_ACK        ;
164//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_SPR_STATUS_OLD_VAL        ;
165//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_SPR_STATUS_OLD_ACK        ;
166
167    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
168
169    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
170
171    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
172#endif
173
174    // -----[ methods ]---------------------------------------------------
175
176#ifdef SYSTEMC
177    SC_HAS_PROCESS (Register_unit_Glue);
178#endif
179  public  :          Register_unit_Glue             
180  (
181#ifdef SYSTEMC
182   sc_module_name                                name,
183#else                                         
184   std::string                                        name,
185#endif                                         
186#ifdef STATISTICS
187   morpheo::behavioural::Parameters_Statistics * param_statistics,
188#endif
189   Parameters                                  * param,
190   morpheo::behavioural::Tusage_t                usage
191   );
192  public  :          ~Register_unit_Glue             (void);
193                                               
194  private : void     allocation                (void);
195  private : void     deallocation              (void);
196                                               
197#ifdef SYSTEMC                                 
198  public  : void     constant                        (void);
199  public  : void     transition                      (void);
200  public  : void     genMealy_gpr_read               (void);
201  public  : void     genMealy_gpr_read_status        (void);
202  public  : void     genMealy_gpr_read_registerfile  (void);
203  public  : void     genMealy_gpr_write              (void);
204  public  : void     genMealy_gpr_write_status       (void);
205  public  : void     genMealy_gpr_write_registerfile (void);
206  public  : void     genMealy_spr_read               (void);
207  public  : void     genMealy_spr_read_status        (void);
208  public  : void     genMealy_spr_read_registerfile  (void);
209  public  : void     genMealy_spr_write              (void);
210  public  : void     genMealy_spr_write_status       (void);
211  public  : void     genMealy_spr_write_registerfile (void);
212  public  : void     genMealy_insert                 (void);
213  public  : void     genMealy_retire                 (void);
214#endif                                         
215
216#ifdef STATISTICS
217  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
218#endif
219                                               
220#if VHDL                                       
221  public  : void     vhdl                      (void);
222  private : void     vhdl_declaration          (Vhdl * & vhdl);
223  private : void     vhdl_body                 (Vhdl * & vhdl);
224#endif                                         
225                                               
226#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
227  private : void     end_cycle                 (void);
228#endif
229  };
230
231}; // end namespace register_unit_glue
232}; // end namespace register_unit
233}; // end namespace execute_loop
234}; // end namespace multi_execute_loop
235}; // end namespace core
236
237}; // end namespace behavioural
238}; // end namespace morpheo             
239
240#endif
Note: See TracBrowser for help on using the repository browser.