source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/src/Meta_Predictor_allocation.cpp @ 81

Last change on this file since 81 was 81, checked in by rosiere, 16 years ago
  • Finish Environment (and test)
  • Continue predictor_unit
  • Add external tools
  • svn keyword "Id" set
  • Property svn:keywords set to Id
File size: 22.7 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id: Meta_Predictor_allocation.cpp 81 2008-04-15 18:40:01Z rosiere $
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/include/Meta_Predictor.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17namespace direction {
18
19namespace meta_predictor {
20
21
22  void Meta_Predictor::allocation (void)
23  {
24    log_printf(FUNC,Meta_Predictor,"allocation","Begin");
25
26    _component   = new Component ();
27
28    Entity * entity = _component->set_entity (_name                 
29                                             ,"Meta_Predictor"
30#ifdef POSITION
31                                             ,MIXTE
32#endif
33                                              );
34   
35    _interfaces = entity->set_interfaces();
36
37    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
38    {
39      Interface * interface = _interfaces->set_interface(""
40#ifdef POSITION
41                                                         , IN 
42                                                         , SOUTH
43                                                         , "Generalist interface"
44#endif
45                                                         );
46     
47      in_CLOCK              = interface->set_signal_clk              ("clock" ,1);
48      in_NRESET             = interface->set_signal_in  <Tcontrol_t> ("nreset",1,RESET_VHDL_YES);
49    }
50
51    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
52
53     in_PREDICT_VAL                 = new SC_IN (Tcontrol_t)     * [_param._nb_prediction     ];
54    out_PREDICT_ACK                 = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
55     in_PREDICT_ADDRESS             = new SC_IN (Taddress_t)     * [_param._nb_prediction     ];
56    out_PREDICT_HISTORY             = new SC_OUT(Thistory_t)     * [_param._nb_prediction     ];
57    out_PREDICT_DIRECTION           = new SC_OUT(Tcontrol_t)     * [_param._nb_prediction     ];
58
59    for (uint32_t i=0; i<_param._nb_prediction; i++)
60      {
61        Interface_fifo * interface = _interfaces->set_interface("predict_"+toString(i)
62#ifdef POSITION
63                                                                , IN 
64                                                                , WEST
65                                                                , "Interface Predict"
66#endif
67                                                                );
68
69         in_PREDICT_VAL                 [i] = interface->set_signal_valack_in        ("val"      , VAL);
70        out_PREDICT_ACK                 [i] = interface->set_signal_valack_out       ("ack"      , ACK);
71         in_PREDICT_ADDRESS             [i] = interface->set_signal_in  <Taddress_t> ("address"  , _param._size_address);
72        out_PREDICT_HISTORY             [i] = interface->set_signal_out <Thistory_t> ("history"  , _param._size_history);
73        out_PREDICT_DIRECTION           [i] = interface->set_signal_out <Tcontrol_t> ("direction", 1);
74      }
75
76    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77
78     in_BRANCH_COMPLETE_VAL         = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
79    out_BRANCH_COMPLETE_ACK         = new SC_OUT(Tcontrol_t)     * [_param._nb_branch_complete];
80     in_BRANCH_COMPLETE_ADDRESS     = new SC_IN (Taddress_t)     * [_param._nb_branch_complete];
81     in_BRANCH_COMPLETE_HISTORY     = new SC_IN (Thistory_t)     * [_param._nb_branch_complete];
82     in_BRANCH_COMPLETE_DIRECTION   = new SC_IN (Tcontrol_t)     * [_param._nb_branch_complete];
83
84    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
85      {
86        Interface_fifo * interface = _interfaces->set_interface("branch_complete_"+toString(i)
87#ifdef POSITION
88                                                                , IN 
89                                                                , EAST
90                                                                , "Interface branch complete"
91#endif
92                                                                );
93
94         in_BRANCH_COMPLETE_VAL         [i] = interface->set_signal_valack_in        ("val"        , VAL);                 
95        out_BRANCH_COMPLETE_ACK         [i] = interface->set_signal_valack_out       ("ack"        , ACK);                 
96         in_BRANCH_COMPLETE_ADDRESS     [i] = interface->set_signal_in  <Taddress_t> ("address"    , _param._size_address);
97         in_BRANCH_COMPLETE_HISTORY     [i] = interface->set_signal_in  <Thistory_t> ("history"    , _param._size_history);
98         in_BRANCH_COMPLETE_DIRECTION   [i] = interface->set_signal_in  <Tcontrol_t> ("direction"  , 1);
99      }
100
101    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
102    string name_component;
103
104    // =====[ component_Meta_Predictor_Glue ]=============================
105
106    name_component = _name+"_Meta_Predictor_Glue";
107   
108    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
109   
110    component_Meta_Predictor_Glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Meta_Predictor_Glue (name_component.c_str()               ,
111#ifdef STATISTICS       
112                                                                                                                                                   _param_statistics                    ,
113#endif
114                                                                                                                                                   *(_param._param_meta_predictor_glue));
115   
116   
117    _component->set_component (component_Meta_Predictor_Glue->_component
118#ifdef POSITION
119                               , 75
120                               , 25
121                               , 10
122                               , 10
123#endif
124                               );
125   
126
127    // =====[ component_Two_Level_Branch_Predictor_2 ]====================   
128
129    name_component = _name+"_Two_Level_Branch_Predictor_2";
130   
131    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
132   
133    component_Two_Level_Branch_Predictor_2 = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
134#ifdef STATISTICS       
135                                                                                                                                                                           _param_statistics                    ,
136#endif
137                                                                                                                                                                           *(_param._param_two_level_branch_predictor_2));
138   
139
140    _component->set_component (component_Two_Level_Branch_Predictor_2->_component
141#ifdef POSITION
142                               , 75
143                               , 25
144                               , 10
145                               , 10
146#endif
147                               );
148   
149
150
151    if (_param._have_meta_predictor)
152      {
153    // =====[ component_Two_Level_Branch_Predictor_1 ]====================   
154
155    name_component = _name+"_Two_Level_Branch_Predictor_1";
156   
157    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
158   
159    component_Two_Level_Branch_Predictor_1 = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
160#ifdef STATISTICS       
161                                                                                                                                                                           _param_statistics                    ,
162#endif
163                                                                                                                                                                           *(_param._param_two_level_branch_predictor_1));
164
165    _component->set_component (component_Two_Level_Branch_Predictor_1->_component
166#ifdef POSITION
167                               , 75
168                               , 25
169                               , 10
170                               , 10
171#endif
172                               );
173
174    // =====[ component_Two_Level_Branch_Predictor_0 ]====================   
175
176    name_component = _name+"_Two_Level_Branch_Predictor_0";
177   
178    log_printf(INFO,Meta_Predictor,"allocation","Allocation : %s",name_component.c_str());
179   
180    component_Two_Level_Branch_Predictor_0 = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::two_level_branch_predictor ::Two_Level_Branch_Predictor (name_component.c_str()               ,
181#ifdef STATISTICS       
182                                                                                                                                                                           _param_statistics                    ,
183#endif
184                                                                                                                                                                           *(_param._param_two_level_branch_predictor_0));
185   
186    _component->set_component (component_Two_Level_Branch_Predictor_0->_component
187#ifdef POSITION
188                               , 75
189                               , 25
190                               , 10
191                               , 10
192#endif
193                               );
194     
195      }
196
197    // ~~~~~[ Component - Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
198
199    // =====[ component_Meta_Predictor_Glue - Instanciation ]=============
200
201    name_component = _name+"_Meta_Predictor_Glue";
202
203    cout << "Instance : " << name_component << endl;
204
205#ifdef POSITION
206    _component->interface_map ("Meta_Predictor_Glue","",
207                               _name                ,"");
208#endif
209   
210    _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
211    _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
212   
213    // Interface Predict
214    for (uint32_t i=0; i<_param._nb_prediction; i++)
215      {
216#ifdef POSITION
217        _component->interface_map ("Meta_Predictor_Glue","predict_"+toString(i),
218                                   _name                ,"predict_"+toString(i));
219#endif
220       
221        if (_param._have_meta_predictor)
222          {
223        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK"        , _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_ACK");
224        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK"        , _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_ACK");
225          }
226        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK"        , _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_ACK");
227        _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_ACK"                    , _name , "out_PREDICT_"+toString(i)+"_ACK");
228        if (_param._have_meta_predictor)
229          {                                                                                                   
230        if (_param._predictor_0_have_bht)
231        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
232        if (_param._predictor_0_have_pht)
233        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_0" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
234        if (_param._predictor_1_have_bht)
235        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
236        if (_param._predictor_1_have_pht)
237        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_1" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
238          }                                                                                                   
239        if (_param._predictor_2_have_bht)
240        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_BHT_HISTORY");
241        if (_param._predictor_2_have_pht)
242        _component->port_map(name_component,  "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY", _name+"_Two_Level_Branch_Predictor_2" ,"out_PREDICT_"+toString(i)+"_PHT_HISTORY");
243        _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_HISTORY"                , _name , "out_PREDICT_"+toString(i)+"_HISTORY");
244        _component->port_map(name_component, "out_PREDICT_"+toString(i)+"_DIRECTION"              , _name , "out_PREDICT_"+toString(i)+"_DIRECTION");
245      }
246
247    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
248      {
249#ifdef POSITION
250        _component->interface_map ("Meta_Predictor_Glue","branch_complete_"+toString(i),
251                                   _name                ,"branch_complete_"+toString(i));
252#endif
253
254        if (_param._have_meta_predictor)
255          {
256        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
257        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL"         , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_VAL");
258
259        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK"         , _name+"_Two_Level_Branch_Predictor_0", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
260        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"         , _name+"_Two_Level_Branch_Predictor_1", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
261          }                                     
262        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK"         , _name+"_Two_Level_Branch_Predictor_2", "out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
263        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_ACK"                     , _name ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK");
264                                               
265        if (_param._have_meta_predictor)       
266          {                                     
267        if (_param._predictor_0_have_bht)
268        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
269        if (_param._predictor_0_have_pht)
270        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_0",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
271        if (_param._predictor_1_have_bht)
272        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
273        if (_param._predictor_1_have_pht)
274        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_1",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
275          }                                     
276        if (_param._predictor_2_have_bht)
277        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" );
278        if (_param._predictor_2_have_pht)
279        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" , _name+"_Two_Level_Branch_Predictor_2",  "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" );
280        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY"                 , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_HISTORY");
281        if (_param._have_meta_predictor)       
282          {
283        _component->port_map(name_component,  "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               , _name , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
284        _component->port_map(name_component, "out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION"   , _name+"_Two_Level_Branch_Predictor_2" , "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION");
285          }
286      }
287
288    // =====[ component_Two_Level_Branch_Predictor_2 - Instanciation ]====
289    name_component = _name+"_Two_Level_Branch_Predictor_2";
290
291    cout << "Instance : " << name_component << endl;
292
293#ifdef POSITION
294        _component->interface_map ("Two_Level_Branch_Predictor_2","",
295                                   _name         ,"");
296#endif
297       
298        _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
299        _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
300
301    for (uint32_t i=0; i<_param._nb_prediction; i++)
302      {
303#ifdef POSITION
304        _component->interface_map ("Two_Level_Branch_Predictor_2","predict_"+toString(i),
305                                   _name         ,"predict_"+toString(i));
306#endif
307
308        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
309        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_ACK");
310        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
311        if (_param._predictor_2_have_bht)                                                                             
312        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY");
313        if (_param._predictor_2_have_pht)
314        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY");
315      }
316   
317    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
318      {
319#ifdef POSITION
320        _component->interface_map ("Two_Level_Branch_Predictor_2","branch_complete_"+toString(i),
321                                   _name         ,"branch_complete_"+toString(i));
322#endif
323        if (_param._have_meta_predictor)
324        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_VAL"         );
325        else
326        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
327        _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_ACK"         );
328        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
329        if (_param._predictor_2_have_bht)                                                                                       
330        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_BHT_HISTORY" );
331        if (_param._predictor_2_have_pht)                                                                                       
332        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_PHT_HISTORY" );
333        if (_param._have_meta_predictor)
334        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_2_DIRECTION"   );
335        else
336        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );   
337      }
338
339    if (_param._have_meta_predictor)
340      {
341    // =====[ component_Two_Level_Branch_Predictor_1 - Instanciation ]====
342
343    name_component = _name+"_Two_Level_Branch_Predictor_1";
344
345    cout << "Instance : " << name_component << endl;
346
347#ifdef POSITION
348        _component->interface_map ("Two_Level_Branch_Predictor_1","",
349                                   _name         ,"");
350#endif
351       
352        _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
353        _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
354
355    for (uint32_t i=0; i<_param._nb_prediction; i++)
356      {
357#ifdef POSITION
358        _component->interface_map ("Two_Level_Branch_Predictor_1","predict_"+toString(i),
359                                   _name         ,"predict_"+toString(i));
360#endif
361
362        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
363        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_ACK");
364        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
365        if (_param._predictor_1_have_bht)                                                                             
366        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY");
367        if (_param._predictor_1_have_pht)
368        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY");
369      }
370   
371    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
372      {
373#ifdef POSITION
374        _component->interface_map ("Two_Level_Branch_Predictor_1","branch_complete_"+toString(i),
375                                   _name         ,"branch_complete_"+toString(i));
376#endif
377        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
378        _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_ACK"         );
379        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
380        if (_param._predictor_1_have_bht)                                                                                       
381        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_BHT_HISTORY" );
382        if (_param._predictor_1_have_pht)                                                                                       
383        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_1_PHT_HISTORY" );
384        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );   
385      }
386    // =====[ component_Two_Level_Branch_Predictor_0 - Instanciation ]====
387
388    name_component = _name+"_Two_Level_Branch_Predictor_0";
389
390    cout << "Instance : " << name_component << endl;
391
392#ifdef POSITION
393        _component->interface_map ("Two_Level_Branch_Predictor_0","",
394                                   _name         ,"");
395#endif
396       
397        _component->port_map(name_component, "in_CLOCK" , _name,"in_CLOCK" );
398        _component->port_map(name_component, "in_NRESET", _name,"in_NRESET");
399
400    for (uint32_t i=0; i<_param._nb_prediction; i++)
401      {
402#ifdef POSITION
403        _component->interface_map ("Two_Level_Branch_Predictor_0","predict_"+toString(i),
404                                   _name         ,"predict_"+toString(i));
405#endif
406
407        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_VAL"         , _name, "in_PREDICT_"+toString(i)+"_VAL");
408        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_ACK");
409        _component->port_map(name_component, "in_PREDICT_"+toString(i)+"_ADDRESS"     , _name, "in_PREDICT_"+toString(i)+"_ADDRESS");
410        if (_param._predictor_0_have_bht)                                                                             
411        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY");
412        if (_param._predictor_0_have_pht)
413        _component->port_map(name_component,"out_PREDICT_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue", "in_PREDICT_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY");
414      }
415   
416    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
417      {
418#ifdef POSITION
419        _component->interface_map ("Two_Level_Branch_Predictor_0","branch_complete_"+toString(i),
420                                   _name         ,"branch_complete_"+toString(i));
421#endif
422        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"         , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"                     );
423        _component->port_map(name_component,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"         , _name+"_Meta_Predictor_Glue", "in_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_ACK"         );
424        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"     , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"                 );
425        if (_param._predictor_0_have_bht)                                                                                       
426        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_BHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_BHT_HISTORY" );
427        if (_param._predictor_0_have_pht)                                                                                       
428        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_PHT_HISTORY" , _name+"_Meta_Predictor_Glue","out_BRANCH_COMPLETE_"+toString(i)+"_PREDICTOR_0_PHT_HISTORY" );
429        _component->port_map(name_component, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"   , _name, "in_BRANCH_COMPLETE_"+toString(i)+"_DIRECTION"               );   
430      }
431      }
432
433    log_printf(FUNC,Meta_Predictor,"allocation","End");
434  };
435
436}; // end namespace meta_predictor
437
438}; // end namespace core
439}; // end namespace multi_front_end
440}; // end namespace front_end
441}; // end namespace prediction_unit
442}; // end namespace direction
443
444}; // end namespace behavioural
445}; // end namespace morpheo             
446#endif
Note: See TracBrowser for help on using the repository browser.