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

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

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

  • Property svn:keywords set to Id
File size: 10.2 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 128 2009-06-26 08:43:23Z 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 "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
121  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_VAL                       ;
122  public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_ACK                       ;
123  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_RD_USE                    ;
124  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_RE_USE                    ;
125
126  public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_GPR_STATUS_VAL            ;
127  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_GPR_STATUS_ACK            ;
128  public    : SC_OUT(Tgeneral_data_t   )  *** out_INSERT_ROB_GPR_STATUS_DATA           ; // type for compatibility with the registerFile
129
130  public    : SC_OUT(Tcontrol_t        )  *** out_INSERT_ROB_SPR_STATUS_VAL            ;
131  public    : SC_IN (Tcontrol_t        )  ***  in_INSERT_ROB_SPR_STATUS_ACK            ;
132  public    : SC_OUT(Tspecial_data_t   )  *** out_INSERT_ROB_SPR_STATUS_DATA           ; // type for compatibility with the registerFile
133
134//     // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_VAL                       ;
136//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_ACK                       ;
137//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RD_OLD_USE                ;
138//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RD_NEW_USE                ;
139//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RE_OLD_USE                ;
140//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_RE_NEW_USE                ;
141
142//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_GPR_STATUS_NEW_VAL        ;
143//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_GPR_STATUS_NEW_ACK        ;
144//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_GPR_STATUS_OLD_VAL        ;
145//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_GPR_STATUS_OLD_ACK        ;
146
147//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_SPR_STATUS_NEW_VAL        ;
148//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_SPR_STATUS_NEW_ACK        ;
149//   public    : SC_OUT(Tcontrol_t        )  *** out_RETIRE_ROB_SPR_STATUS_OLD_VAL        ;
150//   public    : SC_IN (Tcontrol_t        )  ***  in_RETIRE_ROB_SPR_STATUS_OLD_ACK        ;
151
152    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
153
154    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
155
156    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
157#endif
158
159    // -----[ methods ]---------------------------------------------------
160
161#ifdef SYSTEMC
162    SC_HAS_PROCESS (Register_unit_Glue);
163#endif
164  public  :          Register_unit_Glue             
165  (
166#ifdef SYSTEMC
167   sc_module_name                                name,
168#else                                         
169   std::string                                        name,
170#endif                                         
171#ifdef STATISTICS
172   morpheo::behavioural::Parameters_Statistics * param_statistics,
173#endif
174   Parameters                                  * param,
175   morpheo::behavioural::Tusage_t                usage
176   );
177  public  :          ~Register_unit_Glue             (void);
178                                               
179  private : void     allocation                (void);
180  private : void     deallocation              (void);
181                                               
182#ifdef SYSTEMC                                 
183  public  : void     transition                      (void);
184  public  : void     genMealy_gpr_read               (void);
185  public  : void     genMealy_gpr_read_status        (void);
186  public  : void     genMealy_gpr_read_registerfile  (void);
187  public  : void     genMealy_gpr_write              (void);
188  public  : void     genMealy_gpr_write_status       (void);
189  public  : void     genMealy_gpr_write_registerfile (void);
190  public  : void     genMealy_spr_read               (void);
191  public  : void     genMealy_spr_read_status        (void);
192  public  : void     genMealy_spr_read_registerfile  (void);
193  public  : void     genMealy_spr_write              (void);
194  public  : void     genMealy_spr_write_status       (void);
195  public  : void     genMealy_spr_write_registerfile (void);
196  public  : void     genMealy_insert                 (void);
197  public  : void     genMealy_retire                 (void);
198#endif                                         
199
200#ifdef STATISTICS
201  public  : void     statistics_declaration    (morpheo::behavioural::Parameters_Statistics * param_statistics);
202#endif
203                                               
204#if VHDL                                       
205  public  : void     vhdl                      (void);
206  private : void     vhdl_declaration          (Vhdl * & vhdl);
207  private : void     vhdl_body                 (Vhdl * & vhdl);
208#endif                                         
209                                               
210#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
211  private : void     end_cycle                 (void);
212#endif
213  };
214
215}; // end namespace register_unit_glue
216}; // end namespace register_unit
217}; // end namespace execute_loop
218}; // end namespace multi_execute_loop
219}; // end namespace core
220
221}; // end namespace behavioural
222}; // end namespace morpheo             
223
224#endif
Note: See TracBrowser for help on using the repository browser.