source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/src/Prediction_unit_allocation.cpp @ 82

Last change on this file since 82 was 82, checked in by rosiere, 16 years ago
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
  • Property svn:keywords set to Id
File size: 39.5 KB
Line 
1/*
2 * $Id: Prediction_unit_allocation.cpp 82 2008-05-01 16:48:45Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/include/Prediction_unit.h"
9#include "Behavioural/include/Allocation.h"
10
11namespace morpheo                    {
12namespace behavioural {
13namespace core {
14namespace multi_front_end {
15namespace front_end {
16namespace prediction_unit {
17
18#undef  FUNCTION
19#define FUNCTION "Prediction_unit::allocation"
20  void Prediction_unit::allocation (
21#ifdef STATISTICS
22                               morpheo::behavioural::Parameters_Statistics * param_statistics
23#else
24                               void
25#endif
26                               )
27  {
28    log_printf(FUNC,Prediction_unit,FUNCTION,"Begin");
29
30    _component   = new Component (_usage);
31
32    Entity * entity = _component->set_entity (_name       
33                                              ,"Prediction_unit"
34#ifdef POSITION
35                                              ,COMBINATORY
36#endif
37                                              );
38
39    _interfaces = entity->set_interfaces();
40   
41    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42    {
43      Interface * interface = _interfaces->set_interface(""
44#ifdef POSITION
45                                                         ,IN
46                                                         ,SOUTH,
47                                                         "Generalist interface"
48#endif
49                                                         );
50     
51      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
52      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
53    }
54
55    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
56    {
57      {
58        ALLOC1_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context);
59       
60        ALLOC1_VALACK_IN ( in_PREDICT_VAL                        ,VAL);
61        ALLOC1_VALACK_OUT(out_PREDICT_ACK                        ,ACK);
62        ALLOC1_SIGNAL_IN ( in_PREDICT_PC_PREVIOUS                ,"pc_previous"                ,Taddress_t         ,_param->_size_address);
63        ALLOC1_SIGNAL_IN ( in_PREDICT_PC_CURRENT                 ,"pc_current"                 ,Taddress_t         ,_param->_size_address);
64        ALLOC1_SIGNAL_IN ( in_PREDICT_PC_CURRENT_IS_DS_TAKE      ,"pc_current_is_ds_take"      ,Tcontrol_t         ,1);
65        ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT                    ,"pc_next"                    ,Taddress_t         ,_param->_size_address);
66        ALLOC1_SIGNAL_OUT(out_PREDICT_PC_NEXT_IS_DS_TAKE         ,"pc_next_is_ds_take"         ,Tcontrol_t         ,1);
67        ALLOC1_SIGNAL_OUT(out_PREDICT_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr [alloc_signal_it1]);
68        ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state);
69        ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth [alloc_signal_it1]);
70      }
71      {
72        ALLOC2_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context,_param->_nb_instruction[alloc_interface_it1]);
73        _ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE         ,"instruction_enable"         ,Tcontrol_t         ,1,_param->_nb_context,_param->_nb_instruction[alloc_signal_it1]);
74      }
75    }
76
77    // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
78    {
79      {
80        ALLOC2_INTERFACE("decod",IN,SOUTH,"Interface with decod unit",_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_interface_it1]);
81       
82        _ALLOC2_VALACK_IN ( in_DECOD_VAL                        ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
83        _ALLOC2_VALACK_OUT(out_DECOD_ACK                        ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
84        _ALLOC2_SIGNAL_IN ( in_DECOD_CONTEXT_ID                 ,"context_id"                 ,Tcontext_t         ,_param->_size_context_id      ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
85        _ALLOC2_SIGNAL_IN ( in_DECOD_MATCH_INST_IFETCH_PTR      ,"match_inst_ifetch_ptr"      ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
86        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state    ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
87        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_max_size_depth       ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
88        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_CONDITION           ,"branch_condition"           ,Tbranch_condition_t,_param->_size_branch_condition,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
89        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
90        _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC                ,"address_src"                ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
91        _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST               ,"address_dest"               ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[alloc_signal_it1]);
92      }
93    }
94
95    // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96    {
97      ALLOC1_INTERFACE("branch_complete", IN,SOUTH, "branch_complete", _param->_nb_inst_branch_complete);
98     
99      ALLOC1_VALACK_IN ( in_BRANCH_COMPLETE_VAL            ,VAL);
100      ALLOC1_VALACK_OUT(out_BRANCH_COMPLETE_ACK            ,ACK);
101      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id);
102      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_max_size_depth);
103      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS        ,"address"        ,Taddress_t,_param->_size_address);
104      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_FLAG           ,"flag"           ,Tcontrol_t,1);
105      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
106      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_TAKE           ,"take"           ,Tcontrol_t,1);
107      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_SRC    ,"address_src"    ,Taddress_t,_param->_size_address);
108      ALLOC1_SIGNAL_OUT(out_BRANCH_COMPLETE_ADDRESS_DEST   ,"address_dest"   ,Taddress_t,_param->_size_address);
109    }
110
111    // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112    {
113      ALLOC1_INTERFACE("branch_event", IN,SOUTH, "branch_event", _param->_nb_context);
114     
115      ALLOC1_VALACK_OUT(out_BRANCH_EVENT_VAL            ,VAL);
116      ALLOC1_VALACK_IN ( in_BRANCH_EVENT_ACK            ,ACK);
117//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_CONTEXT_ID     ,"context_id"     ,Tcontext_t,_param->_size_context_id);
118//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_DEPTH          ,"depth"          ,Tdepth_t  ,_param->_max_size_depth);
119//    ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1);
120      ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_SRC    ,"address_src"    ,Taddress_t,_param->_size_address);
121      ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_DEST   ,"address_dest"   ,Taddress_t,_param->_size_address);
122    }
123
124    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
125    {
126      ALLOC1_INTERFACE("depth",OUT,SOUTH,"Interface with depth",_param->_nb_context);
127
128      ALLOC1_SIGNAL_OUT(out_DEPTH_NB_BRANCH    ,"nb_branch"    ,Tdepth_t,_param->_size_depth[alloc_signal_it1]+1);
129      ALLOC1_SIGNAL_OUT(out_DEPTH_TAIL         ,"tail"         ,Tdepth_t,_param->_size_depth[alloc_signal_it1]);
130    }
131
132    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
133    std::string name;
134
135    {
136      name = _name+"_branch_target_buffer";
137      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
138     
139      _component_btb = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer::Branch_Target_Buffer
140        (name.c_str()
141#ifdef STATISTICS
142         ,param_statistics
143#endif
144         ,_param->_param_btb
145         ,_usage);
146     
147      _component->set_component (_component_btb->_component
148#ifdef POSITION
149                                 , 50, 50, 10, 10
150#endif
151                                 );
152    }
153
154    {
155      name = _name+"_direction";
156      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
157     
158      _component_dir = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::Direction
159        (name.c_str()
160#ifdef STATISTICS
161         ,param_statistics
162#endif
163         ,_param->_param_dir
164         ,_usage);
165     
166      _component->set_component (_component_dir->_component
167#ifdef POSITION
168                                 , 50, 50, 10, 10
169#endif
170                                 );
171    }
172   
173    {
174      name = _name+"_return_address_stack";
175      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
176     
177      _component_ras = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack::Return_Address_Stack
178        (name.c_str()
179#ifdef STATISTICS
180         ,param_statistics
181#endif
182         ,_param->_param_ras
183         ,_usage);
184     
185      _component->set_component (_component_ras->_component
186#ifdef POSITION
187                                 , 50, 50, 10, 10
188#endif
189                                 );
190    }
191   
192    {
193      name = _name+"_update_prediction_table";
194      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
195     
196      _component_upt = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::Update_Prediction_Table
197        (name.c_str()
198#ifdef STATISTICS
199         ,param_statistics
200#endif
201         ,_param->_param_upt
202         ,_usage);
203     
204      _component->set_component (_component_upt->_component
205#ifdef POSITION
206                                 , 50, 50, 10, 10
207#endif
208                                 );
209    }
210
211    {
212      name = _name+"_prediction_unit_glue";
213      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
214     
215      _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Prediction_unit_Glue
216        (name.c_str()
217#ifdef STATISTICS
218         ,param_statistics
219#endif
220         ,_param->_param_glue
221         ,_usage);
222     
223      _component->set_component (_component_glue->_component
224#ifdef POSITION
225                                 , 50, 50, 10, 10
226#endif
227                                 );
228    }
229   
230    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
231    std::string src,dest;
232
233    // ===================================================================
234    // =====[ branch_target_buffer ]======================================
235    // ===================================================================
236    {
237      src = _name+"_branch_target_buffer";
238      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
239           
240      {
241        dest = _name;
242#ifdef POSITION
243        _component->interface_map (src ,"",
244                                   dest,"");
245#endif
246        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
247        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
248      }
249
250      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
251        {
252          dest = _name+"_prediction_unit_glue";
253#ifdef POSITION
254          _component->interface_map (src ,"predict_"+toString(i),
255                                     dest,"predict_btb_"+toString(i));
256#endif
257
258          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"         ,
259                                   dest,"out_PREDICT_BTB_"+toString(i)+"_VAL"         ); 
260          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"         ,
261                                   dest, "in_PREDICT_BTB_"+toString(i)+"_ACK"         ); 
262          if (_param->_have_port_context_id)
263          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"  ,
264                                   dest,"out_PREDICT_BTB_"+toString(i)+"_CONTEXT_ID"  );
265          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_ADDRESS"     ,
266                                   dest,"out_PREDICT_BTB_"+toString(i)+"_ADDRESS"     );
267          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_HIT"         ,
268                                   dest, "in_PREDICT_BTB_"+toString(i)+"_HIT"         ); 
269          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ADDRESS_SRC" ,
270                                   dest, "in_PREDICT_BTB_"+toString(i)+"_ADDRESS_SRC" ); 
271          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ADDRESS_DEST",
272                                   dest, "in_PREDICT_BTB_"+toString(i)+"_ADDRESS_DEST"); 
273          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_CONDITION"   ,
274                                   dest, "in_PREDICT_BTB_"+toString(i)+"_CONDITION"   ); 
275          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_IS_ACCURATE" ,
276                                   dest, "in_PREDICT_BTB_"+toString(i)+"_IS_ACCURATE" );
277
278          dest = _name+"_direction";
279          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_LAST_TAKE" ,
280                                   dest, "in_PREDICT_"+toString(i)+"_LAST_TAKE" );
281        }
282
283      for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
284        {
285          dest = _name+"_prediction_unit_glue";
286#ifdef POSITION
287          _component->interface_map (src ,"decod_"+toString(i),
288                                     dest,"decod_btb_"+toString(i));
289#endif
290
291          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_VAL"            ,
292                                   dest,"out_DECOD_BTB_"+toString(i)+"_VAL"            );
293          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ACK"            ,
294                                   dest, "in_DECOD_BTB_"+toString(i)+"_ACK"            );
295          if (_param->_have_port_context_id)
296          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONTEXT_ID"     ,
297                                   dest,"out_DECOD_BTB_"+toString(i)+"_CONTEXT_ID"     );
298          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_ADDRESS_SRC"    ,
299                                   dest,"out_DECOD_BTB_"+toString(i)+"_ADDRESS_SRC"    );
300          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_ADDRESS_DEST"   ,
301                                   dest,"out_DECOD_BTB_"+toString(i)+"_ADDRESS_DEST"   );
302          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONDITION"      ,
303                                   dest,"out_DECOD_BTB_"+toString(i)+"_CONDITION"      );
304          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_LAST_TAKE"      ,
305                                   dest,"out_DECOD_BTB_"+toString(i)+"_LAST_TAKE"      );
306          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_PREDICTION",
307                                   dest,"out_DECOD_BTB_"+toString(i)+"_MISS_PREDICTION");
308          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_IS_ACCURATE"    ,
309                                   dest,"out_DECOD_BTB_"+toString(i)+"_IS_ACCURATE"    );
310        }
311
312      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
313        {
314          dest = _name+"_prediction_unit_glue";
315
316          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_VAL",
317                                   dest,"out_UPDATE_BTB_"+toString(i)+"_VAL");
318          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_ACK",
319                                   dest, "in_UPDATE_BTB_"+toString(i)+"_ACK");
320
321          dest = _name+"_update_prediction_table";
322#ifdef POSITION
323          _component->interface_map (src ,"update_"+toString(i),
324                                     dest,"update_"+toString(i));
325#endif
326
327          if (_param->_have_port_context_id)
328          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_CONTEXT_ID"     ,
329                                   dest,"out_UPDATE_"+toString(i)+    "_CONTEXT_ID"     );
330          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS_SRC"    ,
331                                   dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_SRC"    );
332          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS_DEST"   ,
333                                   dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_DEST"   );
334          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_CONDITION"      ,
335                                   dest,"out_UPDATE_"+toString(i)+"_BTB_CONDITION"      );
336          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_LAST_TAKE"      ,
337                                   dest,"out_UPDATE_"+toString(i)+    "_DIRECTION_GOOD" );
338          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_MISS_PREDICTION",
339                                   dest,"out_UPDATE_"+toString(i)+    "_MISS_PREDICTION");
340        }
341    }
342
343    // ===================================================================
344    // =====[ direction ]=================================================
345    // ===================================================================
346    {
347      src = _name+"_direction";
348      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
349           
350      {
351        dest = _name;
352#ifdef POSITION
353        _component->interface_map (src ,"",
354                                   dest,"");
355#endif
356        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
357        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
358      }
359
360      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
361        {
362          dest = _name+"_prediction_unit_glue";
363#ifdef POSITION
364          _component->interface_map (src ,"predict_"+toString(i),
365                                     dest,"predict_dir_"+toString(i));
366#endif
367
368          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"        ,
369                                   dest,"out_PREDICT_DIR_"+toString(i)+"_VAL"        );
370          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"        ,
371                                   dest, "in_PREDICT_DIR_"+toString(i)+"_ACK"        );
372          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_ADDRESS_SRC",
373                                   dest,"out_PREDICT_DIR_"+toString(i)+"_ADDRESS_SRC");
374          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_STATIC"     ,
375                                   dest,"out_PREDICT_DIR_"+toString(i)+"_STATIC"     );
376          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_DIRECTION"  ,
377                                   dest, "in_PREDICT_DIR_"+toString(i)+"_DIRECTION"  );
378
379          dest = _name+"_update_prediction_table";
380          if (_param->_have_port_history)
381          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_HISTORY"  ,
382                                   dest, "in_PREDICT_"    +toString(i)+"_HISTORY"  );
383          //out_PREDICT_DIR_LAST_TAKE - component_map branch_target_buffer
384        }
385
386      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
387        {
388          dest = _name+"_prediction_unit_glue";
389
390          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_VAL",
391                                   dest,"out_UPDATE_DIR_"+toString(i)+"_VAL");
392          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_ACK",
393                                   dest, "in_UPDATE_DIR_"+toString(i)+"_ACK");
394
395          dest = _name+"_update_prediction_table";
396#ifdef POSITION
397          _component->interface_map (src ,"update_"+toString(i),
398                                     dest,"update_"+toString(i));
399#endif
400
401          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS"  ,
402                                   dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_SRC");
403          if (_param->_have_port_history)
404          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_HISTORY"  ,
405                                   dest,"out_UPDATE_"+toString(i)+"_DIR_HISTORY"  );
406          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_DIRECTION",
407                                   dest,"out_UPDATE_"+toString(i)+    "_DIRECTION_GOOD");
408         
409        }
410    }
411
412    // ===================================================================
413    // =====[ return_address_stack ]======================================
414    // ===================================================================
415    {
416      src = _name+"_return_address_stack";
417      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
418
419           
420      {
421        dest = _name;
422#ifdef POSITION
423        _component->interface_map (src ,"",
424                                   dest,"");
425#endif
426        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
427        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
428      }
429
430      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
431        {
432          dest = _name+"_prediction_unit_glue";
433#ifdef POSITION
434          _component->interface_map (src ,"predict_"+toString(i),
435                                     dest,"predict_dir_"+toString(i));
436#endif
437         
438          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"         ,
439                                   dest,"out_PREDICT_RAS_"+toString(i)+"_VAL"         );
440          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"         ,
441                                   dest, "in_PREDICT_RAS_"+toString(i)+"_ACK"         );
442          if (_param->_have_port_context_id)
443          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"  ,
444                                   dest,"out_PREDICT_RAS_"+toString(i)+"_CONTEXT_ID"  );
445          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_HIT"         ,
446                                   dest, "in_PREDICT_RAS_"+toString(i)+"_HIT"         ); 
447          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_PUSH"        ,
448                                   dest,"out_PREDICT_RAS_"+toString(i)+"_PUSH"        );
449          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_ADDRESS_PUSH",
450                                   dest,"out_PREDICT_RAS_"+toString(i)+"_ADDRESS_PUSH");
451          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ADDRESS_POP" ,
452                                   dest, "in_PREDICT_RAS_"+toString(i)+"_ADDRESS_POP" );
453
454          dest = _name+"_update_prediction_table";
455          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_INDEX",
456                                   dest, "in_PREDICT_"    +toString(i)+"_RAS_INDEX");
457        }
458     
459      for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
460        {
461          dest = _name+"_prediction_unit_glue";
462#ifdef POSITION
463          _component->interface_map (src ,"decod_"+toString(i),
464                                     dest,"decod_ras_"+toString(i));
465#endif
466         
467          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_VAL"            ,
468                                   dest,"out_DECOD_RAS_"+toString(i)+"_VAL"            );
469          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ACK"            ,
470                                   dest, "in_DECOD_RAS_"+toString(i)+"_ACK"            );
471          if (_param->_have_port_context_id)
472          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONTEXT_ID"     ,
473                                   dest,"out_DECOD_RAS_"+toString(i)+"_CONTEXT_ID"     ); 
474          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_HIT"            ,
475                                   dest, "in_DECOD_RAS_"+toString(i)+"_HIT"            ); 
476          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_PUSH"           ,
477                                   dest,"out_DECOD_RAS_"+toString(i)+"_PUSH"           );
478          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_ADDRESS_PUSH"   ,
479                                   dest,"out_DECOD_RAS_"+toString(i)+"_ADDRESS_PUSH"   );
480          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ADDRESS_POP"    ,
481                                   dest, "in_DECOD_RAS_"+toString(i)+"_ADDRESS_POP"    );
482          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_PREDICTION",
483                                   dest,"out_DECOD_RAS_"+toString(i)+"_MISS_PREDICTION");
484
485          dest = _name+"_update_prediction_table";
486          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_INDEX"          ,
487                                   dest, "in_DECOD_"    +toString(i)+"_RAS_INDEX"      ); 
488        }
489
490      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
491        {
492          dest = _name+"_prediction_unit_glue";
493
494          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_VAL",
495                                   dest,"out_UPDATE_RAS_"+toString(i)+"_VAL");
496          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_ACK",
497                                   dest, "in_UPDATE_RAS_"+toString(i)+"_ACK");
498
499          dest = _name+"_update_prediction_table";
500#ifdef POSITION
501          _component->interface_map (src ,"update_"+toString(i),
502                                     dest,"update_"+toString(i));
503#endif
504
505          if (_param->_have_port_context_id)
506          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_CONTEXT_ID"       ,
507                                   dest,"out_UPDATE_"+toString(i)+    "_CONTEXT_ID"       );
508          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_PUSH"             ,
509                                   dest,"out_UPDATE_"+toString(i)+"_RAS_PUSH"             );
510          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS"          ,
511                                   dest,"out_UPDATE_"+toString(i)+"_RAS_ADDRESS"          );
512          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_INDEX"            ,
513                                   dest,"out_UPDATE_"+toString(i)+"_RAS_INDEX"            );
514          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_MISS_PREDICTION"  ,
515                                   dest,"out_UPDATE_"+toString(i)+    "_MISS_PREDICTION"  );
516          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_PREDICTION_IFETCH",
517                                   dest,"out_UPDATE_"+toString(i)+"_RAS_PREDICTION_IFETCH");
518        }
519    }
520
521    // ===================================================================
522    // =====[ update_prediction_table ]===================================
523    // ===================================================================
524    {
525      src = _name+"_update_prediction_table";
526      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
527           
528      {
529        dest = _name;
530#ifdef POSITION
531        _component->interface_map (src ,"",
532                                   dest,"");
533#endif
534        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
535        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
536      }
537
538      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
539        {
540          dest = _name+"_prediction_unit_glue";
541#ifdef POSITION
542          _component->interface_map (src ,"predict_"+toString(i),
543                                     dest,"predict_dir_"+toString(i));
544#endif
545     
546          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"             ,
547                                   dest,"out_PREDICT_UPT_"+toString(i)+"_VAL"             );
548          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"             ,
549                                   dest, "in_PREDICT_UPT_"+toString(i)+"_ACK"             );
550          if (_param->_have_port_context_id)
551          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"      ,
552                                   dest,"out_PREDICT_UPT_"+toString(i)+"_CONTEXT_ID"      );
553          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_ADDRESS_SRC" ,
554                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_SRC" );
555          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_ADDRESS_DEST",
556                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_DEST");
557          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_CONDITION"   ,
558                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_CONDITION"   );
559          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_LAST_TAKE"   ,
560                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_LAST_TAKE"   );
561          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_IS_ACCURATE" ,
562                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_IS_ACCURATE" );
563          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_RAS_ADDRESS"     ,
564                                   dest,"out_PREDICT_UPT_"+toString(i)+"_RAS_ADDRESS"     );
565
566          //out_PREDICT_HISTORY   - component_map direction
567          // in_PREDICT_RAS_INDEX - component_map return_address_stack
568        }
569
570      for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
571        {
572          dest = _name+"_prediction_unit_glue";
573         
574          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_VAL"                 ,
575                                   dest,"out_DECOD_UPT_"+toString(i)+"_VAL"                 );
576          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ACK"                 ,
577                                   dest, "in_DECOD_UPT_"+toString(i)+"_ACK"                 );
578          if (_param->_have_port_context_id)
579          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONTEXT_ID"          ,
580                                   dest,"out_DECOD_UPT_"+toString(i)+"_CONTEXT_ID"          );
581          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_ADDRESS_SRC"     ,
582                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_ADDRESS_SRC"     );
583          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_ADDRESS_DEST"    ,
584                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_ADDRESS_DEST"    );
585          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_CONDITION"       ,
586                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_CONDITION"       );
587          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_LAST_TAKE"       ,
588                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_LAST_TAKE"       );
589          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_RAS_ADDRESS"         ,
590                                   dest,"out_DECOD_UPT_"+toString(i)+"_RAS_ADDRESS"         );
591          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_IFETCH"         ,
592                                   dest,"out_DECOD_UPT_"+toString(i)+"_MISS_IFETCH"         ); 
593          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_DECOD"          ,
594                                   dest,"out_DECOD_UPT_"+toString(i)+"_MISS_DECOD"          ); 
595          if (_param->_have_port_max_depth)
596          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_UPDATE_PREDICTION_ID",
597                                   dest,"out_DECOD_UPT_"+toString(i)+"_UPDATE_PREDICTION_ID");
598         
599          //out_DECOD_UPT_RAS_INDEX - component_map return_address_stack
600        }
601
602      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
603        {
604          dest = _name+"_prediction_unit_glue";
605
606#ifdef POSITION
607          _component->interface_map (src ,"update_"+toString(i),
608                                     dest,"update_upt_"+toString(i));
609#endif
610
611          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_VAL",
612                                   dest, "in_UPDATE_UPT_"+toString(i)+"_VAL");
613          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_ACK",
614                                   dest,"out_UPDATE_UPT_"+toString(i)+"_ACK");
615
616          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_BTB_VAL",
617                                   dest, "in_UPDATE_UPT_"+toString(i)+"_BTB_VAL");
618          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_DIR_VAL",
619                                   dest, "in_UPDATE_UPT_"+toString(i)+"_DIR_VAL");
620          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_RAS_VAL",
621                                   dest, "in_UPDATE_UPT_"+toString(i)+"_RAS_VAL");
622
623          //in_UPDATE_UPT_CONTEXT_ID            - component_map branch_target_buffer
624          //in_UPDATE_UPT_MISS_PREDICTION       - component_map branch_target_buffer
625          //in_UPDATE_UPT_DIRECTION_GOOD        - component_map branch_target_buffer
626          //in_UPDATE_UPT_BTB_ADDRESS_SRC       - component_map branch_target_buffer
627          //in_UPDATE_UPT_BTB_ADDRESS_DEST      - component_map branch_target_buffer
628          //in_UPDATE_UPT_BTB_CONDITION         - component_map branch_target_buffer
629          //in_UPDATE_UPT_DIR_HISTORY           - component_map direction
630          //in_UPDATE_UPT_RAS_ADDRESS           - component_map return_address_stack
631          //in_UPDATE_UPT_RAS_PUSH              - component_map return_address_stack
632          //in_UPDATE_UPT_RAS_INDEX             - component_map return_address_stack
633          //in_UPDATE_UPT_RAS_PREDICTION_IFETCH - component_map return_address_stack
634        }
635
636      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
637        {
638          dest = _name;
639
640#ifdef POSITION
641          _component->interface_map (src ,"complete_"+toString(i),
642                                     dest,"complete_"+toString(i));
643#endif
644
645          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            ,
646                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            );
647          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            ,
648                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            );
649          if (_param->_have_port_context_id)
650          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     ,
651                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     );
652          if (_param->_have_port_max_depth)
653          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          ,
654                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          );
655          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"        ,
656                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"        );
657          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_FLAG"           ,
658                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_FLAG"           );
659          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION",
660                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION");
661          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE"           ,
662                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE"           );
663          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC"    ,
664                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC"    );
665          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST"   ,
666                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST"   );
667        }
668
669      for (uint32_t i=0; i<_param->_nb_context; i++)
670        {
671          dest = _name;
672
673#ifdef POSITION
674          _component->interface_map (src ,"branch_event_"+toString(i),
675                                     dest,"branch_event_"+toString(i));
676#endif
677
678          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_VAL"         ,dest,"out_BRANCH_EVENT_"+toString(i)+"_VAL"         );
679          PORT_MAP(_component,src , "in_BRANCH_EVENT_"+toString(i)+"_ACK"         ,dest, "in_BRANCH_EVENT_"+toString(i)+"_ACK"         );
680          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC" ,dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC" );
681          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST",dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST");
682        }
683
684      for (uint32_t i=0; i<_param->_nb_context; i++)
685        {
686          dest = _name+"_prediction_unit_glue";
687         
688#ifdef POSITION
689          _component->interface_map (src ,"depth_"+toString(i),
690                                     dest,"depth_"+toString(i));
691#endif
692         
693          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_NB_BRANCH",
694                                   dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH");
695
696          if (_param->_have_port_depth[i])
697          COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_TAIL"     ,
698                                   dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL"     );
699        }
700
701    }
702
703    // ===================================================================
704    // =====[ prediction_unit_glue ]======================================
705    // ===================================================================
706    {
707      src = _name+"_prediction_unit_glue";
708      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
709           
710      {
711        dest = _name;
712#ifdef POSITION
713        _component->interface_map (src ,"",
714                                   dest,"");
715#endif
716
717        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
718        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
719      }
720
721      for (uint32_t i=0; i<_param->_nb_context; i++)
722        {
723          dest = _name;
724#ifdef POSITION
725          _component->interface_map (src ,"predict_"+toString(i),
726                                     dest,"predict_"+toString(i));
727#endif
728         
729          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_VAL"                        ,
730                              dest, "in_PREDICT_"+toString(i)+"_VAL"                        );
731          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ACK"                        ,
732                              dest,"out_PREDICT_"+toString(i)+"_ACK"                        );
733          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_PREVIOUS"                ,
734                              dest, "in_PREDICT_"+toString(i)+"_PC_PREVIOUS"                );
735          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_CURRENT"                 ,
736                              dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT"                 );
737          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE"      ,
738                              dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE"      );
739          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT"                    ,
740                              dest,"out_PREDICT_"+toString(i)+"_PC_NEXT"                    );
741          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         ,
742                              dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         );
743          if (_param->_have_port_inst_ifetch_ptr [i])
744          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            ,
745                              dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            );
746          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               ,
747                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
748          if (_param->_have_port_depth [i])
749          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID",
750                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
751         
752          for (uint32_t j=0; j<_param->_nb_instruction[i]; j++)
753            {
754              dest = _name;
755#ifdef POSITION
756              _component->interface_map (src ,"predict_"+toString(i)+"_"+toString(j),
757                                         dest,"predict_"+toString(i)+"_"+toString(j));
758#endif
759             
760              PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE",
761                                  dest,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE");
762            }
763        }
764
765      for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
766        for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
767          {
768            dest = _name;
769#ifdef POSITION
770            _component->interface_map (src ,"decod_"+toString(i),
771                                       dest,"decod_"+toString(i));
772#endif
773           
774            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_VAL"                        ,
775                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_VAL"                        );
776            PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_ACK"                        ,
777                                dest,"out_DECOD_"+toString(i)+"_"+toString(j)+"_ACK"                        );
778            if (_param->_have_port_context_id)
779            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 ,
780                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 );
781            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      ,
782                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      );
783            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               ,
784                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
785            if (_param->_have_port_max_depth)
786            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID",
787                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
788            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           ,
789                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           );
790            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           ,
791                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           );
792            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                ,
793                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                );
794            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               ,
795                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               );
796          }
797
798      for (uint32_t i=0; i<_param->_nb_context; i++)
799        {
800          dest = _name;
801#ifdef POSITION
802          _component->interface_map (src ,"depth_"+toString(i),
803                                     dest,"depth_"+toString(i));
804#endif
805         
806          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH");
807          if (_param->_have_port_depth[i])
808          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL"     ,dest,"out_DEPTH_"+toString(i)+"_TAIL"     );
809        }
810    }
811
812    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
813    _component->test_map(false);
814
815#ifdef POSITION
816    _component->generate_file();
817#endif
818
819    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
820  };
821
822}; // end namespace prediction_unit
823}; // end namespace front_end
824}; // end namespace multi_front_end
825}; // end namespace core
826
827}; // end namespace behavioural
828}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.