source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Front_end_Glue.h @ 108

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

1) decod_queue : add reg_LAST_SLOT.
2) Commit : insert on event -> to pop decod_queue. Head test : add information (speculative or not)
3) Context State / UPT : Branch miss and Load miss in same cycle.
4) Free List : Bank is on LSB not MSB.
5) Platforms : move data

  • Property svn:keywords set to Id
File size: 11.3 KB
Line 
1#ifndef morpheo_behavioural_core_multi_front_end_front_end_front_end_glue_Front_end_Glue_h
2#define morpheo_behavioural_core_multi_front_end_front_end_front_end_glue_Front_end_Glue_h
3
4/*
5 * $Id: Front_end_Glue.h 108 2009-02-12 11:55:06Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15
16#include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Parameters.h"
17#include "Behavioural/Core/Multi_Front_end/Front_end/Front_end_Glue/include/Types.h"
18#ifdef STATISTICS
19#include "Behavioural/include/Stat.h"
20#endif
21#include "Behavioural/include/Component.h"
22#ifdef VHDL
23#include "Behavioural/include/Vhdl.h"
24#endif
25#include "Behavioural/include/Usage.h"
26
27#include "Common/include/ToString.h"
28#include "Common/include/Debug.h"
29
30#include <iostream>
31
32namespace morpheo {
33namespace behavioural {
34
35namespace core {
36namespace multi_front_end {
37namespace front_end {
38namespace front_end_glue {
39
40
41  class Front_end_Glue
42#if SYSTEMC
43    : public sc_module
44#endif
45  {
46    // -----[ fields ]----------------------------------------------------
47    // Parameters
48  protected : const std::string  _name;
49  protected : const Parameters * _param;
50  private   : const Tusage_t     _usage;
51
52#ifdef STATISTICS
53  public    : Stat                           * _stat;
54#endif
55
56  public    : Component                      * _component;
57  private   : Interfaces                     * _interfaces;
58
59#ifdef SYSTEMC
60    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
61    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62  public    : SC_CLOCK                        *  in_CLOCK        ;
63  public    : SC_IN (Tcontrol_t)              *  in_NRESET       ;
64
65    // ~~~~~[ Interface : "ifetch" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66  public    : SC_OUT(Tcontext_t           ) *** out_IFETCH_DECOD_UNIT_CONTEXT_ID                     ;//[nb_decod_unit][nb_decod_unit_context]
67
68    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69  public    : SC_OUT(Tcontext_t           ) *** out_DECOD_CONTEXT_ID                                 ;//[nb_decod_unit][nb_inst_decod]
70  public    : SC_IN (Tcontext_t           ) ***  in_DECOD_DECOD_UNIT_CONTEXT_ID                      ;//[nb_decod_unit][nb_inst_decod]
71   
72    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73  public    : SC_IN (Tcontrol_t           )  **  in_BRANCH_COMPLETE_VAL                              ;//[nb_inst_branch_complete]
74  public    : SC_OUT(Tcontrol_t           )  ** out_BRANCH_COMPLETE_ACK                              ;//[nb_inst_branch_complete]
75  public    : SC_OUT(Tcontrol_t           )  ** out_BRANCH_COMPLETE_MISS_PREDICTION                  ;//[nb_inst_branch_complete]
76                                           
77  public    : SC_OUT(Tcontrol_t           )  ** out_BRANCH_COMPLETE_PREDICTION_UNIT_VAL              ;//[nb_inst_branch_complete]
78  public    : SC_IN (Tcontrol_t           )  **  in_BRANCH_COMPLETE_PREDICTION_UNIT_ACK              ;//[nb_inst_branch_complete]
79  public    : SC_IN (Tcontrol_t           )  **  in_BRANCH_COMPLETE_PREDICTION_UNIT_MISS_PREDICTION  ;//[nb_inst_branch_complete]
80                                           
81  public    : SC_OUT(Tcontrol_t           )  ** out_BRANCH_COMPLETE_CONTEXT_STATE_VAL                ;//[nb_inst_branch_complete]
82  public    : SC_IN (Tcontrol_t           )  **  in_BRANCH_COMPLETE_CONTEXT_STATE_ACK                ;//[nb_inst_branch_complete]
83  public    : SC_OUT(Tcontrol_t           )  ** out_BRANCH_COMPLETE_CONTEXT_STATE_MISS_PREDICTION    ;//[nb_inst_branch_complete]
84
85    // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
86  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_VAL                                         ;//[nb_context]
87  public    : SC_IN (Tcontrol_t           )  **  in_EVENT_ACK                                         ;//[nb_context]
88  public    : SC_OUT(Taddress_t           )  ** out_EVENT_ADDRESS                                     ;//[nb_context]
89  public    : SC_OUT(Taddress_t           )  ** out_EVENT_ADDRESS_NEXT                                ;//[nb_context]
90  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_ADDRESS_NEXT_VAL                            ;//[nb_context]
91  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_IS_DS_TAKE                                  ;//[nb_context]
92                                           
93  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_IFETCH_UNIT_VAL                             ;//[nb_context]
94  public    : SC_IN (Tcontrol_t           )  **  in_EVENT_IFETCH_UNIT_ACK                             ;//[nb_context]
95  public    : SC_OUT(Taddress_t           )  ** out_EVENT_IFETCH_UNIT_ADDRESS                         ;//[nb_context]
96  public    : SC_OUT(Taddress_t           )  ** out_EVENT_IFETCH_UNIT_ADDRESS_NEXT                    ;//[nb_context]
97  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_IFETCH_UNIT_ADDRESS_NEXT_VAL                ;//[nb_context]
98  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_IFETCH_UNIT_IS_DS_TAKE                      ;//[nb_context]
99
100  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_PREDICTION_UNIT_VAL                         ;//[nb_context]
101  public    : SC_IN (Tcontrol_t           )  **  in_EVENT_PREDICTION_UNIT_ACK                         ;//[nb_context]
102  public    : SC_OUT(Tevent_type_t        )  ** out_EVENT_PREDICTION_UNIT_TYPE                        ;//[nb_context]
103  public    : SC_OUT(Tdepth_t             )  ** out_EVENT_PREDICTION_UNIT_DEPTH                       ;//[nb_context]
104                                           
105  public    : SC_IN (Tcontrol_t           )  **  in_EVENT_CONTEXT_STATE_VAL                           ;//[nb_context]
106  public    : SC_OUT(Tcontrol_t           )  ** out_EVENT_CONTEXT_STATE_ACK                           ;//[nb_context]
107  public    : SC_IN (Taddress_t           )  **  in_EVENT_CONTEXT_STATE_ADDRESS                       ;//[nb_context]
108  public    : SC_IN (Taddress_t           )  **  in_EVENT_CONTEXT_STATE_ADDRESS_NEXT                  ;//[nb_context]
109  public    : SC_IN (Tcontrol_t           )  **  in_EVENT_CONTEXT_STATE_ADDRESS_NEXT_VAL              ;//[nb_context]
110  public    : SC_IN (Tcontrol_t           )  **  in_EVENT_CONTEXT_STATE_IS_DS_TAKE                    ;//[nb_context]
111  public    : SC_IN (Tevent_type_t        )  **  in_EVENT_CONTEXT_STATE_TYPE                          ;//[nb_context]
112  public    : SC_IN (Tdepth_t             )  **  in_EVENT_CONTEXT_STATE_DEPTH                         ;//[nb_context]
113
114    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
115  public    : SC_OUT(Tdepth_t             )  ** out_DEPTH_MIN                                         ;//[nb_context]
116  public    : SC_OUT(Tdepth_t             )  ** out_DEPTH_MAX                                         ;//[nb_context]
117  public    : SC_OUT(Tcontrol_t           )  ** out_DEPTH_FULL                                        ;//[nb_context]
118                                           
119  public    : SC_IN (Tcontrol_t           )  **  in_DEPTH_PREDICTION_UNIT_VAL                         ;//[nb_context]
120  public    : SC_IN (Tdepth_t             )  **  in_DEPTH_PREDICTION_UNIT_CURRENT                     ;//[nb_context]
121  public    : SC_IN (Tdepth_t             )  **  in_DEPTH_PREDICTION_UNIT_MIN                         ;//[nb_context]
122  public    : SC_IN (Tdepth_t             )  **  in_DEPTH_PREDICTION_UNIT_MAX                         ;//[nb_context]
123  public    : SC_IN (Tcontrol_t           )  **  in_DEPTH_PREDICTION_UNIT_FULL                        ;//[nb_context]
124                                           
125//public    : SC_OUT(Tdepth_t             ) *** out_DEPTH_DECOD_UNIT_CURRENT                          ;//[nb_decod_unit][nb_decod_unit_context]
126  public    : SC_OUT(Tdepth_t             ) *** out_DEPTH_DECOD_UNIT_MIN                              ;//[nb_decod_unit][nb_decod_unit_context]
127  public    : SC_OUT(Tdepth_t             ) *** out_DEPTH_DECOD_UNIT_MAX                              ;//[nb_decod_unit][nb_decod_unit_context]
128  public    : SC_OUT(Tcontrol_t           ) *** out_DEPTH_DECOD_UNIT_FULL                             ;//[nb_decod_unit][nb_decod_unit_context]
129                                           
130  public    : SC_OUT(Tdepth_t             )  ** out_DEPTH_CONTEXT_STATE_MIN                           ;//[nb_context]
131
132    // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133  public    : SC_OUT(Tcontrol_t           ) *** out_CONTEXT_DECOD_UNIT_DEPTH_VAL                      ;//[nb_decod_unit][nb_decod_unit_context]
134  public    : SC_OUT(Tdepth_t             ) *** out_CONTEXT_DECOD_UNIT_DEPTH                          ;//[nb_decod_unit][nb_decod_unit_context]
135
136    // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137  public    : SC_OUT(Tcounter_t           ) ** out_NB_INST_DECOD_ALL                                  ;//[nb_context]
138
139  public    : SC_IN (Tcounter_t           ) **  in_NB_INST_DECOD_UNIT_DECOD_ALL                       ;//[nb_context]
140
141  public    : SC_OUT(Tcounter_t           ) ** out_NB_INST_CONTEXT_STATE_DECOD_ALL                    ;//[nb_context]
142
143
144    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
145
146    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
147
148    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
149#endif
150
151    // -----[ Methods ]---------------------------------------------------
152
153#ifdef SYSTEMC
154    SC_HAS_PROCESS (Front_end_Glue);
155#endif
156  public  :          Front_end_Glue             
157  (
158#ifdef SYSTEMC
159   sc_module_name                                name,
160#else                                         
161   std::string                                   name,
162#endif                                         
163#ifdef STATISTICS
164   morpheo::behavioural::Parameters_Statistics * param_statistics,
165#endif
166   Parameters                                  * param,
167   morpheo::behavioural::Tusage_t                usage
168   );
169  public  :          ~Front_end_Glue             (void);
170                                               
171  private : void        allocation                (
172#ifdef STATISTICS
173                                                   morpheo::behavioural::Parameters_Statistics * param_statistics
174#else
175                                                   void
176#endif
177                                                   );
178  private : void        deallocation              (void);
179                                               
180#ifdef SYSTEMC                                 
181  public  : void        transition                (void);
182//public  : void        genMoore                  (void);
183  public  : void        genMealy_decod            (void);
184  public  : void        genMealy_branch_complete  (void);
185  public  : void        genMealy_event            (void);
186  public  : void        genMealy_depth            (void);
187  public  : void        genMealy_nb_inst          (void);
188#endif                                         
189
190#if VHDL                                       
191  public  : void        vhdl                      (void);
192  private : void        vhdl_declaration          (Vhdl * & vhdl);
193  private : void        vhdl_body                 (Vhdl * & vhdl);
194#endif                                         
195
196#ifdef STATISTICS
197  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
198  public  : void        statistics_deallocation   (void);
199#endif
200#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
201  private : void        end_cycle                 (void);
202#endif
203  };
204
205}; // end namespace front_end_glue
206}; // end namespace front_end
207}; // end namespace multi_front_end
208}; // end namespace core
209
210}; // end namespace behavioural
211}; // end namespace morpheo             
212
213#endif
Note: See TracBrowser for help on using the repository browser.