source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/src/Meta_Predictor_allocation.cpp @ 5

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

Ajout du composant Meta_Predictor

File size: 25.8 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/include/Meta_Predictor.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace stage_1_ifetch {
14namespace predictor {
15namespace meta_predictor {
16
17
18  void Meta_Predictor::allocation (void)
19  {
20    string rename;
21
22    log_printf(FUNC,Meta_Predictor,"allocation","Begin");
23
24    in_CLOCK  = new SC_CLOCK           ("in_CLOCK");
25
26     in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
27    out_PREDICT_ACK                 = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
28     in_PREDICT_ADDRESS             = new SC_IN (Taddress_t)     * [_param._nb_prediction     ];
29    out_PREDICT_HISTORY             = new SC_OUT(Thistory_t)     * [_param._nb_prediction     ];
30    out_PREDICT_DIRECTION           = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
31
32    for (uint32_t i=0; i<_param._nb_prediction; i++)
33      {
34        rename = "in_PREDICT_VAL_"         +toString(i);
35         in_PREDICT_VAL                 [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
36
37        rename = "out_PREDICT_ACK_"        +toString(i);
38        out_PREDICT_ACK                 [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
39
40        rename = "in_PREDICT_ADDRESS_"     +toString(i);
41         in_PREDICT_ADDRESS             [i] = new SC_IN (Taddress_t)     (rename.c_str());
42
43        rename = "out_PREDICT_HISTORY_"    +toString(i);
44        out_PREDICT_HISTORY             [i] = new SC_OUT(Thistory_t)     (rename.c_str());
45
46        rename = "out_PREDICT_DIRECTION_"  +toString(i);
47        out_PREDICT_DIRECTION           [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
48      }
49
50     in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
51    out_BRANCH_COMPLETE_ACK         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete];
52     in_BRANCH_COMPLETE_ADDRESS     = new SC_IN (Taddress_t)     * [_param._nb_branch_complete];
53     in_BRANCH_COMPLETE_HISTORY     = new SC_IN (Thistory_t)     * [_param._nb_branch_complete];
54     in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
55
56    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
57      {
58        rename = "in_BRANCH_COMPLETE_VAL_"         +toString(i);
59         in_BRANCH_COMPLETE_VAL         [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
60
61        rename = "out_BRANCH_COMPLETE_ACK_"        +toString(i);
62        out_BRANCH_COMPLETE_ACK         [i] = new SC_OUT(Tcontrol_t)     (rename.c_str());
63
64        rename = "in_BRANCH_COMPLETE_ADDRESS_"     +toString(i);
65         in_BRANCH_COMPLETE_ADDRESS     [i] = new SC_IN (Taddress_t)     (rename.c_str());
66
67        rename = "in_BRANCH_COMPLETE_HISTORY_"     +toString(i);
68         in_BRANCH_COMPLETE_HISTORY     [i] = new SC_IN (Thistory_t)     (rename.c_str());
69
70        rename = "in_BRANCH_COMPLETE_DIRECTION_"   +toString(i);
71         in_BRANCH_COMPLETE_DIRECTION   [i] = new SC_IN (Tcontrol_t)     (rename.c_str());
72      }
73
74    // ~~~~~[ Signal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75
76    if (_param._have_meta_predictor)
77      {
78    signal_PREDICT_PREDICTOR_0_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
79    signal_PREDICT_PREDICTOR_1_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
80      }
81    signal_PREDICT_PREDICTOR_2_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
82
83    if (_param._have_meta_predictor)
84      {                                                                                                               
85    if (_param._predictor_0_have_bht)
86    signal_PREDICT_PREDICTOR_0_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
87    if (_param._predictor_0_have_pht)
88    signal_PREDICT_PREDICTOR_0_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
89    if (_param._predictor_0_have_bht)
90    signal_PREDICT_PREDICTOR_1_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
91    if (_param._predictor_1_have_pht)
92    signal_PREDICT_PREDICTOR_1_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
93      }                                                                                                               
94    if (_param._predictor_2_have_bht)
95    signal_PREDICT_PREDICTOR_2_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
96    if (_param._predictor_2_have_pht)
97    signal_PREDICT_PREDICTOR_2_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
98
99    for (uint32_t i=0; i<_param._nb_prediction; i++)
100      {
101        if (_param._have_meta_predictor)
102          {                                                                                                                   
103        rename = "signal_PREDICT_PREDICTOR_0_ACK_"+toString(i);
104        signal_PREDICT_PREDICTOR_0_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
105        rename = "signal_PREDICT_PREDICTOR_1_ACK_"+toString(i);
106        signal_PREDICT_PREDICTOR_1_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
107          }
108        rename = "signal_PREDICT_PREDICTOR_2_ACK_"+toString(i);
109        signal_PREDICT_PREDICTOR_2_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
110
111        if (_param._have_meta_predictor)
112          {                                                                                                                   
113        if (_param._predictor_0_have_bht)
114          {
115        rename = "signal_PREDICT_PREDICTOR_0_BHT_HISTORY_"+toString(i);
116        signal_PREDICT_PREDICTOR_0_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
117          }
118        if (_param._predictor_0_have_pht)
119          {
120        rename = "signal_PREDICT_PREDICTOR_0_PHT_HISTORY_"+toString(i);
121        signal_PREDICT_PREDICTOR_0_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
122          }
123        if (_param._predictor_1_have_bht)
124          {
125        rename = "signal_PREDICT_PREDICTOR_1_BHT_HISTORY_"+toString(i);
126        signal_PREDICT_PREDICTOR_1_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
127          }
128        if (_param._predictor_1_have_pht)
129          {
130        rename = "signal_PREDICT_PREDICTOR_1_PHT_HISTORY_"+toString(i);
131        signal_PREDICT_PREDICTOR_1_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
132          }
133          }
134        if (_param._predictor_2_have_bht)
135          {
136        rename = "signal_PREDICT_PREDICTOR_2_BHT_HISTORY_"+toString(i);
137        signal_PREDICT_PREDICTOR_2_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
138          }
139        if (_param._predictor_2_have_pht)
140          {
141        rename = "signal_PREDICT_PREDICTOR_2_PHT_HISTORY_"+toString(i);
142        signal_PREDICT_PREDICTOR_2_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
143          }
144      }
145    if (_param._have_meta_predictor)
146      {
147    signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
148    signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
149    signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
150    signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
151      }
152    signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         = new SC_SIGNAL(Tcontrol_t) * [_param._nb_prediction];
153
154    if (_param._have_meta_predictor)
155      {                                                                                                               
156    if (_param._predictor_0_have_bht)
157    signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
158    if (_param._predictor_0_have_pht)
159    signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
160    if (_param._predictor_0_have_bht)
161    signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
162    if (_param._predictor_1_have_pht)
163    signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
164      }                                                                                                               
165    if (_param._predictor_2_have_bht)
166    signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t) * [_param._nb_prediction];
167    if (_param._predictor_2_have_pht)
168    signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t) * [_param._nb_prediction];
169
170    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
171      {
172        if (_param._have_meta_predictor)
173          {                                                                                                                   
174        rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_ACK_"+toString(i);
175        signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
176        rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_ACK_"+toString(i);
177        signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
178        rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_VAL_"+toString(i);
179        signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
180        rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION_"+toString(i);
181        signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
182          }
183        rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_ACK_"+toString(i);
184        signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i] = new SC_SIGNAL(Tcontrol_t) (rename.c_str());
185
186        if (_param._have_meta_predictor)
187          {                                                                                                                   
188        if (_param._predictor_0_have_bht)
189          {
190        rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY_"+toString(i);
191        signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
192          }
193        if (_param._predictor_0_have_pht)
194          {
195        rename = "signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY_"+toString(i);
196        signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
197          }
198        if (_param._predictor_1_have_bht)
199          {
200        rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY_"+toString(i);
201        signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
202          }
203        if (_param._predictor_1_have_pht)
204          {
205        rename = "signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY_"+toString(i);
206        signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
207          }
208          }
209        if (_param._predictor_2_have_bht)
210          {
211        rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY_"+toString(i);
212        signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tbht_history_t)  (rename.c_str());
213          }
214        if (_param._predictor_2_have_pht)
215          {
216        rename = "signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY_"+toString(i);
217        signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i] = new SC_SIGNAL(morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::Tpht_history_t)  (rename.c_str());
218          }
219      }
220
221    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
222    string name_component;
223
224    // =====[ component_Meta_Predictor_Glue ]=============================
225
226    name_component = _name+"_Meta_Predictor_Glue";
227   
228    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
229   
230    component_Meta_Predictor_Glue = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue (name_component.c_str()               ,
231#ifdef STATISTICS       
232                                                                                                                                                     _param_statistics                    ,
233#endif
234                                                                                                                                                     *(_param._param_meta_predictor_glue));
235   
236    // Instantiation
237    (*(component_Meta_Predictor_Glue->in_CLOCK))        (*(in_CLOCK));
238   
239        // Interface Predict
240    for (uint32_t i=0; i<_param._nb_prediction; i++)
241      {
242        if (_param._have_meta_predictor)
243          {
244        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_0_ACK                 [i]));
245        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_1_ACK                 [i]));
246          }                                                                                                                   
247        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_2_ACK                 [i]));
248        (*(component_Meta_Predictor_Glue->out_PREDICT_ACK                             [i])) (*(   out_PREDICT_ACK                             [i]));
249        if (_param._have_meta_predictor)
250          {                                                                                                                   
251        if (_param._predictor_0_have_bht)
252        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_BHT_HISTORY         [i]));
253        if (_param._predictor_0_have_pht)
254        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_0_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_PHT_HISTORY         [i]));
255        if (_param._predictor_1_have_bht)
256        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_BHT_HISTORY         [i]));
257        if (_param._predictor_1_have_pht)
258        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_1_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_PHT_HISTORY         [i]));
259          }                                                                                                                   
260        if (_param._predictor_2_have_bht)
261        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_BHT_HISTORY         [i]));
262        if (_param._predictor_2_have_pht)
263        (*(component_Meta_Predictor_Glue-> in_PREDICT_PREDICTOR_2_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_PHT_HISTORY         [i]));
264        (*(component_Meta_Predictor_Glue->out_PREDICT_HISTORY                         [i])) (*(   out_PREDICT_HISTORY                         [i]));
265        (*(component_Meta_Predictor_Glue->out_PREDICT_DIRECTION                       [i])) (*(   out_PREDICT_DIRECTION                       [i]));
266      }
267
268    // Interface Branch_complete
269   
270    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
271      {
272        if (_param._have_meta_predictor)
273          {
274        (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_VAL                     [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
275        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i]));
276
277        (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i]));
278        (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i]));
279          }                                     
280        (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i]));
281        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_ACK                     [i])) (*(   out_BRANCH_COMPLETE_ACK                     [i]));
282                                               
283        if (_param._have_meta_predictor)       
284          {                                     
285        if (_param._predictor_0_have_bht)
286        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
287        if (_param._predictor_0_have_pht)
288        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
289        if (_param._predictor_1_have_bht)
290        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
291        if (_param._predictor_1_have_pht)
292        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
293          }                                     
294        if (_param._predictor_2_have_bht)
295        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
296        if (_param._predictor_2_have_pht)
297        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
298        (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_HISTORY                 [i])) (*(    in_BRANCH_COMPLETE_HISTORY                 [i]));
299        if (_param._have_meta_predictor)       
300          {
301        (*(component_Meta_Predictor_Glue-> in_BRANCH_COMPLETE_DIRECTION               [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));
302        (*(component_Meta_Predictor_Glue->out_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i]));
303          }
304      }
305
306    // =====[ component_Two_Level_Branch_Predictor_2 ]====================   
307
308    name_component = _name+"_Two_Level_Branch_Predictor_2";
309   
310    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
311   
312    component_Two_Level_Branch_Predictor_2 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
313#ifdef STATISTICS       
314                                                                                                                                                                           _param_statistics                    ,
315#endif
316                                                                                                                                                                           *(_param._param_two_level_branch_predictor_2));
317     
318    // Instantiation
319    (*(component_Two_Level_Branch_Predictor_2->in_CLOCK))        (*(in_CLOCK));
320   
321    for (uint32_t i=0; i<_param._nb_prediction; i++)
322      {
323        (*(component_Two_Level_Branch_Predictor_2-> in_PREDICT_VAL                 [i])) (*(    in_PREDICT_VAL                             [i]));
324        (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_2_ACK                 [i]));
325        (*(component_Two_Level_Branch_Predictor_2-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS                         [i]));
326        if (_param._predictor_2_have_bht)                                                                                     
327        (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_BHT_HISTORY         [i]));
328        if (_param._predictor_2_have_pht)
329        (*(component_Two_Level_Branch_Predictor_2->out_PREDICT_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_2_PHT_HISTORY         [i]));
330      }
331   
332    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
333      {
334        if (_param._have_meta_predictor)
335        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_VAL         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_VAL         [i]));
336        else
337        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_VAL         [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
338        (*(component_Two_Level_Branch_Predictor_2->out_BRANCH_COMPLETE_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_ACK         [i]));
339        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS                 [i]));
340        if (_param._predictor_2_have_bht)                                                                                       
341        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i]));
342        if (_param._predictor_2_have_pht)                                                                                       
343        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i]));
344        if (_param._have_meta_predictor)
345        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_2_DIRECTION   [i]));
346        else
347        (*(component_Two_Level_Branch_Predictor_2-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));       
348      }
349
350    if (_param._have_meta_predictor)
351      {
352    // =====[ component_Two_Level_Branch_Predictor_1 ]====================   
353
354    name_component = _name+"_Two_Level_Branch_Predictor_1";
355   
356    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
357   
358    component_Two_Level_Branch_Predictor_1 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
359#ifdef STATISTICS       
360                                                                                                                                                                           _param_statistics                    ,
361#endif
362                                                                                                                                                                           *(_param._param_two_level_branch_predictor_1));
363     
364    // Instantiation
365    (*(component_Two_Level_Branch_Predictor_1->in_CLOCK))        (*(in_CLOCK));
366   
367    for (uint32_t i=0; i<_param._nb_prediction; i++)
368      {
369        (*(component_Two_Level_Branch_Predictor_1-> in_PREDICT_VAL                 [i])) (*(    in_PREDICT_VAL                             [i]));
370        (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_1_ACK                 [i]));
371        (*(component_Two_Level_Branch_Predictor_1-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS                         [i]));
372        if (_param._predictor_1_have_bht)                                                                                     
373        (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_BHT_HISTORY         [i]));
374        if (_param._predictor_1_have_pht)
375        (*(component_Two_Level_Branch_Predictor_1->out_PREDICT_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_1_PHT_HISTORY         [i]));
376      }
377   
378    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
379      {
380        (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_VAL         [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
381        (*(component_Two_Level_Branch_Predictor_1->out_BRANCH_COMPLETE_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_ACK         [i]));
382        (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS                 [i]));
383        if (_param._predictor_1_have_bht)                                                                                       
384        (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i]));
385        if (_param._predictor_1_have_pht)                                                                                       
386        (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i]));
387        (*(component_Two_Level_Branch_Predictor_1-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));       
388      }
389
390    // =====[ component_Two_Level_Branch_Predictor_0 ]====================   
391
392    name_component = _name+"_Two_Level_Branch_Predictor_0";
393   
394    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
395   
396    component_Two_Level_Branch_Predictor_0 = new morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
397#ifdef STATISTICS       
398                                                                                                                                                                           _param_statistics                    ,
399#endif
400                                                                                                                                                                           *(_param._param_two_level_branch_predictor_0));
401     
402    // Instantiation
403    (*(component_Two_Level_Branch_Predictor_0->in_CLOCK))        (*(in_CLOCK));
404   
405    for (uint32_t i=0; i<_param._nb_prediction; i++)
406      {
407        (*(component_Two_Level_Branch_Predictor_0-> in_PREDICT_VAL                 [i])) (*(    in_PREDICT_VAL                             [i]));
408        (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_ACK                 [i])) (*(signal_PREDICT_PREDICTOR_0_ACK                 [i]));
409        (*(component_Two_Level_Branch_Predictor_0-> in_PREDICT_ADDRESS             [i])) (*(    in_PREDICT_ADDRESS                         [i]));
410        if (_param._predictor_0_have_bht)                                                                                     
411        (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_BHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_BHT_HISTORY         [i]));
412        if (_param._predictor_0_have_pht)
413        (*(component_Two_Level_Branch_Predictor_0->out_PREDICT_PHT_HISTORY         [i])) (*(signal_PREDICT_PREDICTOR_0_PHT_HISTORY         [i]));
414      }
415   
416    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
417      {
418        (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_VAL         [i])) (*(    in_BRANCH_COMPLETE_VAL                     [i]));
419        (*(component_Two_Level_Branch_Predictor_0->out_BRANCH_COMPLETE_ACK         [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_ACK         [i]));
420        (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_ADDRESS     [i])) (*(    in_BRANCH_COMPLETE_ADDRESS                 [i]));
421        if (_param._predictor_0_have_bht)                                                                                       
422        (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_BHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i]));
423        if (_param._predictor_0_have_pht)                                                                                       
424        (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_PHT_HISTORY [i])) (*(signal_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i]));
425        (*(component_Two_Level_Branch_Predictor_0-> in_BRANCH_COMPLETE_DIRECTION   [i])) (*(    in_BRANCH_COMPLETE_DIRECTION               [i]));       
426      }
427      }
428
429    log_printf(FUNC,Meta_Predictor,"allocation","End");
430  };
431
432}; // end namespace meta_predictor
433}; // end namespace predictor
434}; // end namespace stage_1_ifetch
435}; // end namespace behavioural
436}; // end namespace morpheo             
437#endif
Note: See TracBrowser for help on using the repository browser.