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

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

1) Add soc test
2) fix bug (Pc management, Decod and execute, Update prediction ...)

  • Property svn:keywords set to Id
File size: 42.6 KB
Line 
1/*
2 * $Id: Prediction_unit_allocation.cpp 101 2009-01-15 17:19:08Z 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);
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);
70      }
71      {
72        ALLOC2_INTERFACE("predict",IN,SOUTH,"Interface with ifetch unit",_param->_nb_context,_param->_nb_instruction[it1]);
73        _ALLOC2_SIGNAL_OUT(out_PREDICT_INSTRUCTION_ENABLE         ,"instruction_enable"         ,Tcontrol_t         ,1,_param->_nb_context,_param->_nb_instruction[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[it1]);
81       
82        _ALLOC2_VALACK_IN ( in_DECOD_VAL                        ,VAL,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
83        _ALLOC2_VALACK_OUT(out_DECOD_ACK                        ,ACK,_param->_nb_decod_unit,_param->_nb_inst_decod[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[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[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[it1]);
87        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_UPDATE_PREDICTION_ID,"branch_update_prediction_id",Tprediction_ptr_t  ,_param->_size_depth           ,_param->_nb_decod_unit,_param->_nb_inst_decod[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[it1]);
89        _ALLOC2_SIGNAL_IN ( in_DECOD_BRANCH_DIRECTION           ,"branch_direction"           ,Tcontrol_t         ,1                             ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
90        _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_SRC                ,"address_src"                ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[it1]);
91        _ALLOC2_SIGNAL_IN ( in_DECOD_ADDRESS_DEST               ,"address_dest"               ,Taddress_t         ,_param->_size_address         ,_param->_nb_decod_unit,_param->_nb_inst_decod[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->_size_depth);
103      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS        ,"address"        ,Taddress_t,_param->_size_address);
104      ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_NO_SEQUENCE    ,"no_sequence"    ,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->_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_VAL ,"address_dest_val",Tcontrol_t,1);
122      ALLOC1_SIGNAL_OUT(out_BRANCH_EVENT_ADDRESS_DEST     ,"address_dest"    ,Taddress_t,_param->_size_address);
123    }
124
125    // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~           
126    {
127      ALLOC1_INTERFACE("depth",OUT,SOUTH,"Interface with depth",_param->_nb_context);
128
129      ALLOC1_SIGNAL_OUT(out_DEPTH_VAL          ,"val"          ,Tcontrol_t,1);
130      ALLOC1_SIGNAL_OUT(out_DEPTH_CURRENT      ,"current"      ,Tdepth_t  ,_param->_size_depth);
131      ALLOC1_SIGNAL_OUT(out_DEPTH_MIN          ,"min"          ,Tdepth_t  ,_param->_size_depth);
132      ALLOC1_SIGNAL_OUT(out_DEPTH_MAX          ,"max"          ,Tdepth_t  ,_param->_size_depth);
133      ALLOC1_SIGNAL_OUT(out_DEPTH_FULL         ,"full"         ,Tcontrol_t,1);
134    }
135
136    // ~~~~~[ Interface : "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137    {
138      ALLOC1_INTERFACE("event", IN,SOUTH,"event", _param->_nb_context);
139
140      ALLOC1_VALACK_IN ( in_EVENT_VAL    ,VAL);
141      ALLOC1_VALACK_OUT(out_EVENT_ACK    ,ACK);
142      ALLOC1_SIGNAL_IN ( in_EVENT_TYPE   ,"type" ,Tevent_type_t ,_param->_size_event_type );
143      ALLOC1_SIGNAL_IN ( in_EVENT_DEPTH  ,"depth",Tdepth_t      ,_param->_size_depth      );
144    }
145
146    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147    std::string name;
148
149    {
150      name = _name+"_branch_target_buffer";
151      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
152     
153      _component_btb = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::branch_target_buffer::Branch_Target_Buffer
154        (name.c_str()
155#ifdef STATISTICS
156         ,param_statistics
157#endif
158         ,_param->_param_btb
159         ,_usage);
160     
161      _component->set_component (_component_btb->_component
162#ifdef POSITION
163                                 , 50, 50, 10, 10
164#endif
165                                 );
166    }
167
168    {
169      name = _name+"_direction";
170      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
171     
172      _component_dir = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::Direction
173        (name.c_str()
174#ifdef STATISTICS
175         ,param_statistics
176#endif
177         ,_param->_param_dir
178         ,_usage);
179     
180      _component->set_component (_component_dir->_component
181#ifdef POSITION
182                                 , 50, 50, 10, 10
183#endif
184                                 );
185    }
186   
187    {
188      name = _name+"_return_address_stack";
189      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
190     
191      _component_ras = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::return_address_stack::Return_Address_Stack
192        (name.c_str()
193#ifdef STATISTICS
194         ,param_statistics
195#endif
196         ,_param->_param_ras
197         ,_usage);
198     
199      _component->set_component (_component_ras->_component
200#ifdef POSITION
201                                 , 50, 50, 10, 10
202#endif
203                                 );
204    }
205   
206    {
207      name = _name+"_update_prediction_table";
208      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
209     
210      _component_upt = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::Update_Prediction_Table
211        (name.c_str()
212#ifdef STATISTICS
213         ,param_statistics
214#endif
215         ,_param->_param_upt
216         ,_usage);
217     
218      _component->set_component (_component_upt->_component
219#ifdef POSITION
220                                 , 50, 50, 10, 10
221#endif
222                                 );
223    }
224
225    {
226      name = _name+"_prediction_unit_glue";
227      log_printf(INFO,Prediction_unit,FUNCTION,_("Create   : %s"),name.c_str());
228     
229      _component_glue = new morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::prediction_unit_glue::Prediction_unit_Glue
230        (name.c_str()
231#ifdef STATISTICS
232         ,param_statistics
233#endif
234         ,_param->_param_glue
235         ,_usage);
236     
237      _component->set_component (_component_glue->_component
238#ifdef POSITION
239                                 , 50, 50, 10, 10
240#endif
241                                 );
242    }
243   
244    // ~~~~~[ Instanciation ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
245    std::string src,dest;
246
247    // ===================================================================
248    // =====[ branch_target_buffer ]======================================
249    // ===================================================================
250    {
251      src = _name+"_branch_target_buffer";
252      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
253           
254      {
255        dest = _name;
256#ifdef POSITION
257        _component->interface_map (src ,"",
258                                   dest,"");
259#endif
260        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
261        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
262      }
263
264      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
265        {
266          dest = _name+"_prediction_unit_glue";
267#ifdef POSITION
268          _component->interface_map (src ,"predict_"+toString(i),
269                                     dest,"predict_btb_"+toString(i));
270#endif
271
272          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"         ,
273                                   dest,"out_PREDICT_BTB_"+toString(i)+"_VAL"         ); 
274          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"         ,
275                                   dest, "in_PREDICT_BTB_"+toString(i)+"_ACK"         ); 
276          if (_param->_have_port_context_id)
277          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"  ,
278                                   dest,"out_PREDICT_BTB_"+toString(i)+"_CONTEXT_ID"  );
279          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_ADDRESS"     ,
280                                   dest,"out_PREDICT_BTB_"+toString(i)+"_ADDRESS"     );
281          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_HIT"         ,
282                                   dest, "in_PREDICT_BTB_"+toString(i)+"_HIT"         ); 
283          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ADDRESS_SRC" ,
284                                   dest, "in_PREDICT_BTB_"+toString(i)+"_ADDRESS_SRC" ); 
285          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ADDRESS_DEST",
286                                   dest, "in_PREDICT_BTB_"+toString(i)+"_ADDRESS_DEST"); 
287          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_CONDITION"   ,
288                                   dest, "in_PREDICT_BTB_"+toString(i)+"_CONDITION"   ); 
289          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_IS_ACCURATE" ,
290                                   dest, "in_PREDICT_BTB_"+toString(i)+"_IS_ACCURATE" );
291
292          dest = _name+"_direction";
293          COMPONENT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_LAST_TAKE" ,
294                                   dest, "in_PREDICT_"+toString(i)+"_LAST_TAKE" );
295        }
296
297      for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
298        {
299          dest = _name+"_prediction_unit_glue";
300#ifdef POSITION
301          _component->interface_map (src ,"decod_"+toString(i),
302                                     dest,"decod_btb_"+toString(i));
303#endif
304
305          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_VAL"            ,
306                                   dest,"out_DECOD_BTB_"+toString(i)+"_VAL"            );
307          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ACK"            ,
308                                   dest, "in_DECOD_BTB_"+toString(i)+"_ACK"            );
309          if (_param->_have_port_context_id)
310          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONTEXT_ID"     ,
311                                   dest,"out_DECOD_BTB_"+toString(i)+"_CONTEXT_ID"     );
312          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_ADDRESS_SRC"    ,
313                                   dest,"out_DECOD_BTB_"+toString(i)+"_ADDRESS_SRC"    );
314          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_ADDRESS_DEST"   ,
315                                   dest,"out_DECOD_BTB_"+toString(i)+"_ADDRESS_DEST"   );
316          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONDITION"      ,
317                                   dest,"out_DECOD_BTB_"+toString(i)+"_CONDITION"      );
318          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_LAST_TAKE"      ,
319                                   dest,"out_DECOD_BTB_"+toString(i)+"_LAST_TAKE"      );
320          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_PREDICTION",
321                                   dest,"out_DECOD_BTB_"+toString(i)+"_MISS_PREDICTION");
322          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_IS_ACCURATE"    ,
323                                   dest,"out_DECOD_BTB_"+toString(i)+"_IS_ACCURATE"    );
324        }
325
326      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
327        {
328          dest = _name+"_prediction_unit_glue";
329
330          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_VAL",
331                                   dest,"out_UPDATE_BTB_"+toString(i)+"_VAL");
332          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_ACK",
333                                   dest, "in_UPDATE_BTB_"+toString(i)+"_ACK");
334
335          dest = _name+"_update_prediction_table";
336#ifdef POSITION
337          _component->interface_map (src ,"update_"+toString(i),
338                                     dest,"update_"+toString(i));
339#endif
340
341          if (_param->_have_port_context_id)
342          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_CONTEXT_ID"     ,
343                                   dest,"out_UPDATE_"+toString(i)+    "_CONTEXT_ID"     );
344          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS_SRC"    ,
345                                   dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_SRC"    );
346          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS_DEST"   ,
347                                   dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_DEST"   );
348          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_CONDITION"      ,
349                                   dest,"out_UPDATE_"+toString(i)+"_BTB_CONDITION"      );
350          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_LAST_TAKE"      ,
351                                   dest,"out_UPDATE_"+toString(i)+    "_DIRECTION_GOOD" );
352          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_MISS_PREDICTION",
353                                   dest,"out_UPDATE_"+toString(i)+    "_MISS_PREDICTION");
354        }
355    }
356
357    // ===================================================================
358    // =====[ direction ]=================================================
359    // ===================================================================
360    {
361      src = _name+"_direction";
362      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
363           
364      {
365        dest = _name;
366#ifdef POSITION
367        _component->interface_map (src ,"",
368                                   dest,"");
369#endif
370        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
371        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
372      }
373
374      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
375        {
376          dest = _name+"_prediction_unit_glue";
377#ifdef POSITION
378          _component->interface_map (src ,"predict_"+toString(i),
379                                     dest,"predict_dir_"+toString(i));
380#endif
381
382          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"        ,
383                                   dest,"out_PREDICT_DIR_"+toString(i)+"_VAL"        );
384          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"        ,
385                                   dest, "in_PREDICT_DIR_"+toString(i)+"_ACK"        );
386          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_ADDRESS_SRC",
387                                   dest,"out_PREDICT_DIR_"+toString(i)+"_ADDRESS_SRC");
388          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_STATIC"     ,
389                                   dest,"out_PREDICT_DIR_"+toString(i)+"_STATIC"     );
390          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_DIRECTION"  ,
391                                   dest, "in_PREDICT_DIR_"+toString(i)+"_DIRECTION"  );
392
393          dest = _name+"_update_prediction_table";
394          if (_param->_have_port_history)
395          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_HISTORY"  ,
396                                   dest, "in_PREDICT_"    +toString(i)+"_HISTORY"  );
397          //out_PREDICT_DIR_LAST_TAKE - component_map branch_target_buffer
398        }
399
400      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
401        {
402          dest = _name+"_prediction_unit_glue";
403
404          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_VAL",
405                                   dest,"out_UPDATE_DIR_"+toString(i)+"_VAL");
406          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_ACK",
407                                   dest, "in_UPDATE_DIR_"+toString(i)+"_ACK");
408
409          dest = _name+"_update_prediction_table";
410#ifdef POSITION
411          _component->interface_map (src ,"update_"+toString(i),
412                                     dest,"update_"+toString(i));
413#endif
414
415          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS"  ,
416                                   dest,"out_UPDATE_"+toString(i)+"_BTB_ADDRESS_SRC");
417          if (_param->_have_port_history)
418          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_HISTORY"  ,
419                                   dest,"out_UPDATE_"+toString(i)+"_DIR_HISTORY"  );
420          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_DIRECTION",
421                                   dest,"out_UPDATE_"+toString(i)+    "_DIRECTION_GOOD");
422         
423        }
424    }
425
426    // ===================================================================
427    // =====[ return_address_stack ]======================================
428    // ===================================================================
429    {
430      src = _name+"_return_address_stack";
431      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
432
433           
434      {
435        dest = _name;
436#ifdef POSITION
437        _component->interface_map (src ,"",
438                                   dest,"");
439#endif
440        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
441        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
442      }
443
444      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
445        {
446          dest = _name+"_prediction_unit_glue";
447#ifdef POSITION
448          _component->interface_map (src ,"predict_"+toString(i),
449                                     dest,"predict_dir_"+toString(i));
450#endif
451         
452          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"         ,
453                                   dest,"out_PREDICT_RAS_"+toString(i)+"_VAL"         );
454          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"         ,
455                                   dest, "in_PREDICT_RAS_"+toString(i)+"_ACK"         );
456          if (_param->_have_port_context_id)
457          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"  ,
458                                   dest,"out_PREDICT_RAS_"+toString(i)+"_CONTEXT_ID"  );
459          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_HIT"         ,
460                                   dest, "in_PREDICT_RAS_"+toString(i)+"_HIT"         ); 
461          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_PUSH"        ,
462                                   dest,"out_PREDICT_RAS_"+toString(i)+"_PUSH"        );
463          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_ADDRESS_PUSH",
464                                   dest,"out_PREDICT_RAS_"+toString(i)+"_ADDRESS_PUSH");
465          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ADDRESS_POP" ,
466                                   dest, "in_PREDICT_RAS_"+toString(i)+"_ADDRESS_POP" );
467
468          dest = _name+"_update_prediction_table";
469          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_INDEX",
470                                   dest, "in_PREDICT_"    +toString(i)+"_RAS_INDEX");
471        }
472     
473      for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
474        {
475          dest = _name+"_prediction_unit_glue";
476#ifdef POSITION
477          _component->interface_map (src ,"decod_"+toString(i),
478                                     dest,"decod_ras_"+toString(i));
479#endif
480         
481          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_VAL"            ,
482                                   dest,"out_DECOD_RAS_"+toString(i)+"_VAL"            );
483          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ACK"            ,
484                                   dest, "in_DECOD_RAS_"+toString(i)+"_ACK"            );
485          if (_param->_have_port_context_id)
486          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONTEXT_ID"     ,
487                                   dest,"out_DECOD_RAS_"+toString(i)+"_CONTEXT_ID"     ); 
488          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_HIT"            ,
489                                   dest, "in_DECOD_RAS_"+toString(i)+"_HIT"            ); 
490          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_PUSH"           ,
491                                   dest,"out_DECOD_RAS_"+toString(i)+"_PUSH"           );
492          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_ADDRESS_PUSH"   ,
493                                   dest,"out_DECOD_RAS_"+toString(i)+"_ADDRESS_PUSH"   );
494          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ADDRESS_POP"    ,
495                                   dest, "in_DECOD_RAS_"+toString(i)+"_ADDRESS_POP"    );
496          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_PREDICTION",
497                                   dest,"out_DECOD_RAS_"+toString(i)+"_MISS_PREDICTION");
498
499          dest = _name+"_update_prediction_table";
500          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_INDEX"          ,
501                                   dest, "in_DECOD_"    +toString(i)+"_RAS_INDEX"      ); 
502        }
503
504      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
505        {
506          dest = _name+"_prediction_unit_glue";
507
508          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_VAL",
509                                   dest,"out_UPDATE_RAS_"+toString(i)+"_VAL");
510          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_ACK",
511                                   dest, "in_UPDATE_RAS_"+toString(i)+"_ACK");
512
513          dest = _name+"_update_prediction_table";
514#ifdef POSITION
515          _component->interface_map (src ,"update_"+toString(i),
516                                     dest,"update_"+toString(i));
517#endif
518
519          if (_param->_have_port_context_id)
520          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_CONTEXT_ID"       ,
521                                   dest,"out_UPDATE_"+toString(i)+    "_CONTEXT_ID"       );
522          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_PUSH"             ,
523                                   dest,"out_UPDATE_"+toString(i)+"_RAS_PUSH"             );
524          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_FLUSH"            ,
525                                   dest,"out_UPDATE_"+toString(i)+"_RAS_FLUSH"            );
526          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_ADDRESS"          ,
527                                   dest,"out_UPDATE_"+toString(i)+"_RAS_ADDRESS"          );
528          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_INDEX"            ,
529                                   dest,"out_UPDATE_"+toString(i)+"_RAS_INDEX"            );
530          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_MISS_PREDICTION"  ,
531                                   dest,"out_UPDATE_"+toString(i)+    "_MISS_PREDICTION"  );
532          COMPONENT_MAP(_component,src , "in_UPDATE_"+toString(i)+    "_PREDICTION_IFETCH",
533                                   dest,"out_UPDATE_"+toString(i)+"_RAS_PREDICTION_IFETCH");
534        }
535    }
536
537    // ===================================================================
538    // =====[ update_prediction_table ]===================================
539    // ===================================================================
540    {
541      src = _name+"_update_prediction_table";
542      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
543           
544      {
545        dest = _name;
546#ifdef POSITION
547        _component->interface_map (src ,"",
548                                   dest,"");
549#endif
550        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
551        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
552      }
553
554      for (uint32_t i=0; i<_param->_nb_inst_branch_predict; i++)
555        {
556          dest = _name+"_prediction_unit_glue";
557#ifdef POSITION
558          _component->interface_map (src ,"predict_"+toString(i),
559                                     dest,"predict_dir_"+toString(i));
560#endif
561     
562          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_VAL"             ,
563                                   dest,"out_PREDICT_UPT_"+toString(i)+"_VAL"             );
564          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+"_ACK"             ,
565                                   dest, "in_PREDICT_UPT_"+toString(i)+"_ACK"             );
566          if (_param->_have_port_context_id)
567          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_CONTEXT_ID"      ,
568                                   dest,"out_PREDICT_UPT_"+toString(i)+"_CONTEXT_ID"      );
569          if (_param->_have_port_depth)
570          COMPONENT_MAP(_component,src ,"out_PREDICT_"    +toString(i)+       "_UPDATE_PREDICTION_ID",
571                                   dest, "in_PREDICT_UPT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
572          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_ADDRESS_SRC" ,
573                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_SRC" );
574          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_ADDRESS_DEST",
575                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_ADDRESS_DEST");
576          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_CONDITION"   ,
577                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_CONDITION"   );
578          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_LAST_TAKE"   ,
579                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_LAST_TAKE"   );
580          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_BTB_IS_ACCURATE" ,
581                                   dest,"out_PREDICT_UPT_"+toString(i)+"_BTB_IS_ACCURATE" );
582          COMPONENT_MAP(_component,src , "in_PREDICT_"    +toString(i)+"_RAS_ADDRESS"     ,
583                                   dest,"out_PREDICT_UPT_"+toString(i)+"_RAS_ADDRESS"     );
584
585          //out_PREDICT_HISTORY   - component_map direction
586          // in_PREDICT_RAS_INDEX - component_map return_address_stack
587        }
588
589      for (uint32_t i=0; i<_param->_nb_inst_branch_decod; i++)
590        {
591          dest = _name+"_prediction_unit_glue";
592         
593          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_VAL"                 ,
594                                   dest,"out_DECOD_UPT_"+toString(i)+"_VAL"                 );
595          COMPONENT_MAP(_component,src ,"out_DECOD_"    +toString(i)+"_ACK"                 ,
596                                   dest, "in_DECOD_UPT_"+toString(i)+"_ACK"                 );
597          if (_param->_have_port_context_id)
598          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_CONTEXT_ID"          ,
599                                   dest,"out_DECOD_UPT_"+toString(i)+"_CONTEXT_ID"          );
600          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_ADDRESS_SRC"     ,
601                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_ADDRESS_SRC"     );
602          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_ADDRESS_DEST"    ,
603                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_ADDRESS_DEST"    );
604          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_CONDITION"       ,
605                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_CONDITION"       );
606          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_BTB_LAST_TAKE"       ,
607                                   dest,"out_DECOD_UPT_"+toString(i)+"_BTB_LAST_TAKE"       );
608          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_RAS_ADDRESS"         ,
609                                   dest,"out_DECOD_UPT_"+toString(i)+"_RAS_ADDRESS"         );
610          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_IFETCH"         ,
611                                   dest,"out_DECOD_UPT_"+toString(i)+"_MISS_IFETCH"         ); 
612          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_MISS_DECOD"          ,
613                                   dest,"out_DECOD_UPT_"+toString(i)+"_MISS_DECOD"          ); 
614          if (_param->_have_port_depth)
615          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_UPDATE_PREDICTION_ID",
616                                   dest,"out_DECOD_UPT_"+toString(i)+"_UPDATE_PREDICTION_ID");
617          COMPONENT_MAP(_component,src , "in_DECOD_"    +toString(i)+"_IS_ACCURATE"         ,
618                                   dest,"out_DECOD_UPT_"+toString(i)+"_IS_ACCURATE"         );
619         
620          //out_DECOD_UPT_RAS_INDEX - component_map return_address_stack
621        }
622
623      for (uint32_t i=0; i<_param->_nb_inst_branch_update; i++)
624        {
625          dest = _name+"_prediction_unit_glue";
626
627#ifdef POSITION
628          _component->interface_map (src ,"update_"+toString(i),
629                                     dest,"update_upt_"+toString(i));
630#endif
631
632          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_VAL",
633                                   dest, "in_UPDATE_UPT_"+toString(i)+"_VAL");
634          COMPONENT_MAP(_component,src , "in_UPDATE_"    +toString(i)+"_ACK",
635                                   dest,"out_UPDATE_UPT_"+toString(i)+"_ACK");
636
637          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_BTB_VAL",
638                                   dest, "in_UPDATE_UPT_"+toString(i)+"_BTB_VAL");
639          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_DIR_VAL",
640                                   dest, "in_UPDATE_UPT_"+toString(i)+"_DIR_VAL");
641          COMPONENT_MAP(_component,src ,"out_UPDATE_"    +toString(i)+"_RAS_VAL",
642                                   dest, "in_UPDATE_UPT_"+toString(i)+"_RAS_VAL");
643
644          //in_UPDATE_UPT_CONTEXT_ID            - component_map branch_target_buffer
645          //in_UPDATE_UPT_MISS_PREDICTION       - component_map branch_target_buffer
646          //in_UPDATE_UPT_DIRECTION_GOOD        - component_map branch_target_buffer
647          //in_UPDATE_UPT_BTB_ADDRESS_SRC       - component_map branch_target_buffer
648          //in_UPDATE_UPT_BTB_ADDRESS_DEST      - component_map branch_target_buffer
649          //in_UPDATE_UPT_BTB_CONDITION         - component_map branch_target_buffer
650          //in_UPDATE_UPT_DIR_HISTORY           - component_map direction
651          //in_UPDATE_UPT_RAS_ADDRESS           - component_map return_address_stack
652          //in_UPDATE_UPT_RAS_PUSH              - component_map return_address_stack
653          //in_UPDATE_UPT_RAS_FLUSH             - component_map return_address_stack
654          //in_UPDATE_UPT_RAS_INDEX             - component_map return_address_stack
655          //in_UPDATE_UPT_RAS_PREDICTION_IFETCH - component_map return_address_stack
656        }
657
658      for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
659        {
660          dest = _name;
661
662#ifdef POSITION
663          _component->interface_map (src ,"complete_"+toString(i),
664                                     dest,"complete_"+toString(i));
665#endif
666
667          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            ,
668                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_VAL"            );
669          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            ,
670                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ACK"            );
671          if (_param->_have_port_context_id)
672          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     ,
673                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_CONTEXT_ID"     );
674          if (_param->_have_port_depth)
675          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          ,
676                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_DEPTH"          );
677          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"        ,
678                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS"        );
679          PORT_MAP(_component,src , "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE"    ,
680                              dest, "in_BRANCH_COMPLETE_"+toString(i)+"_NO_SEQUENCE"    );
681          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION",
682                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_MISS_PREDICTION");
683          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE"           ,
684                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_TAKE"           );
685          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC"    ,
686                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_SRC"    );
687          PORT_MAP(_component,src ,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST"   ,
688                              dest,"out_BRANCH_COMPLETE_"+toString(i)+"_ADDRESS_DEST"   );
689        }
690
691      for (uint32_t i=0; i<_param->_nb_context; i++)
692        {
693          dest = _name;
694
695#ifdef POSITION
696          _component->interface_map (src ,"branch_event_"+toString(i),
697                                     dest,"branch_event_"+toString(i));
698#endif
699
700          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_VAL"             ,dest,"out_BRANCH_EVENT_"+toString(i)+"_VAL"             );
701          PORT_MAP(_component,src , "in_BRANCH_EVENT_"+toString(i)+"_ACK"             ,dest, "in_BRANCH_EVENT_"+toString(i)+"_ACK"             );
702          if (_param->_have_port_depth)
703          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH"           ,dest,"out_BRANCH_EVENT_"+toString(i)+"_DEPTH"           );
704          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     ,dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_SRC"     );
705          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL",dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST_VAL");
706          PORT_MAP(_component,src ,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    ,dest,"out_BRANCH_EVENT_"+toString(i)+"_ADDRESS_DEST"    );
707        }
708
709      for (uint32_t i=0; i<_param->_nb_context; i++)
710        {
711          dest = _name;
712
713#ifdef POSITION
714          _component->interface_map (src ,"event_"+toString(i),
715                                     dest,"event_"+toString(i));
716#endif
717
718          PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_VAL"  ,dest, "in_EVENT_"+toString(i)+"_VAL"  );
719          PORT_MAP(_component,src ,"out_EVENT_"+toString(i)+"_ACK"  ,dest,"out_EVENT_"+toString(i)+"_ACK"  );
720          PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_TYPE" ,dest, "in_EVENT_"+toString(i)+"_TYPE" );
721          if (_param->_have_port_depth)
722          PORT_MAP(_component,src , "in_EVENT_"+toString(i)+"_DEPTH",dest, "in_EVENT_"+toString(i)+"_DEPTH");
723        }
724
725      for (uint32_t i=0; i<_param->_nb_context; i++)
726        {
727          dest = _name;
728#ifdef POSITION
729          _component->interface_map (src ,"depth_"+toString(i),
730                                     dest,"depth_"+toString(i));
731#endif
732         
733          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_VAL",
734                              dest,"out_DEPTH_"+toString(i)+"_VAL");
735          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_FULL",
736                              dest,"out_DEPTH_"+toString(i)+"_FULL");
737          if (_param->_have_port_depth)
738            {
739          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_CURRENT",
740                              dest,"out_DEPTH_"+toString(i)+"_CURRENT");
741          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MIN",
742                              dest,"out_DEPTH_"+toString(i)+"_MIN");
743          PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_MAX",
744                              dest,"out_DEPTH_"+toString(i)+"_MAX");
745            }
746        }
747
748//       for (uint32_t i=0; i<_param->_nb_context; i++)
749//      {
750//        dest = _name+"_prediction_unit_glue";
751         
752// #ifdef POSITION
753//        _component->interface_map (src ,"depth_"+toString(i),
754//                                   dest,"depth_"+toString(i));
755// #endif
756         
757//        COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_NB_BRANCH",
758//                                 dest, "in_DEPTH_"+toString(i)+"_UPT_NB_BRANCH");
759
760//        if (_param->_have_port_depth)
761//        COMPONENT_MAP(_component,src ,"out_DEPTH_"+toString(i)+    "_TAIL"     ,
762//                                 dest, "in_DEPTH_"+toString(i)+"_UPT_TAIL"     );
763//      }
764    }
765
766    // ===================================================================
767    // =====[ prediction_unit_glue ]======================================
768    // ===================================================================
769    {
770      src = _name+"_prediction_unit_glue";
771      log_printf(INFO,Prediction_unit,FUNCTION,_("Instance : %s"),src.c_str());
772           
773      {
774        dest = _name;
775#ifdef POSITION
776        _component->interface_map (src ,"",
777                                   dest,"");
778#endif
779
780        PORT_MAP(_component,src , "in_CLOCK" ,dest, "in_CLOCK");
781        PORT_MAP(_component,src , "in_NRESET",dest, "in_NRESET");
782      }
783
784      for (uint32_t i=0; i<_param->_nb_context; i++)
785        {
786          dest = _name;
787#ifdef POSITION
788          _component->interface_map (src ,"predict_"+toString(i),
789                                     dest,"predict_"+toString(i));
790#endif
791         
792          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_VAL"                        ,
793                              dest, "in_PREDICT_"+toString(i)+"_VAL"                        );
794          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_ACK"                        ,
795                              dest,"out_PREDICT_"+toString(i)+"_ACK"                        );
796          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_PREVIOUS"                ,
797                              dest, "in_PREDICT_"+toString(i)+"_PC_PREVIOUS"                );
798          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_CURRENT"                 ,
799                              dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT"                 );
800          PORT_MAP(_component,src , "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE"      ,
801                              dest, "in_PREDICT_"+toString(i)+"_PC_CURRENT_IS_DS_TAKE"      );
802          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT"                    ,
803                              dest,"out_PREDICT_"+toString(i)+"_PC_NEXT"                    );
804          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         ,
805                              dest,"out_PREDICT_"+toString(i)+"_PC_NEXT_IS_DS_TAKE"         );
806          if (_param->_have_port_inst_ifetch_ptr)
807          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            ,
808                              dest,"out_PREDICT_"+toString(i)+"_INST_IFETCH_PTR"            );
809          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               ,
810                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_STATE"               );
811          if (_param->_have_port_depth)
812          PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID",
813                              dest,"out_PREDICT_"+toString(i)+"_BRANCH_UPDATE_PREDICTION_ID");
814         
815          for (uint32_t j=0; j<_param->_nb_instruction[i]; j++)
816            {
817              dest = _name;
818#ifdef POSITION
819              _component->interface_map (src ,"predict_"+toString(i)+"_"+toString(j),
820                                         dest,"predict_"+toString(i)+"_"+toString(j));
821#endif
822             
823              PORT_MAP(_component,src ,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE",
824                                  dest,"out_PREDICT_"+toString(i)+"_"+toString(j)+"_INSTRUCTION_ENABLE");
825            }
826        }
827
828      for (uint32_t i=0; i<_param->_nb_decod_unit; i++)
829        for (uint32_t j=0; j<_param->_nb_inst_decod[i]; j++)
830          {
831            dest = _name;
832#ifdef POSITION
833            _component->interface_map (src ,"decod_"+toString(i),
834                                       dest,"decod_"+toString(i));
835#endif
836           
837            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_VAL"                        ,
838                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_VAL"                        );
839            PORT_MAP(_component,src ,"out_DECOD_"+toString(i)+"_"+toString(j)+"_ACK"                        ,
840                                dest,"out_DECOD_"+toString(i)+"_"+toString(j)+"_ACK"                        );
841            if (_param->_have_port_context_id)
842            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 ,
843                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_CONTEXT_ID"                 );
844            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      ,
845                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_MATCH_INST_IFETCH_PTR"      );
846            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               ,
847                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_STATE"               );
848            if (_param->_have_port_depth)
849            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID",
850                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_UPDATE_PREDICTION_ID");
851            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           ,
852                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_CONDITION"           );
853            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           ,
854                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_BRANCH_DIRECTION"           );
855            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                ,
856                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_SRC"                );
857            PORT_MAP(_component,src , "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               ,
858                                dest, "in_DECOD_"+toString(i)+"_"+toString(j)+"_ADDRESS_DEST"               );
859          }
860
861//       for (uint32_t i=0; i<_param->_nb_context; i++)
862//      {
863//        dest = _name;
864// #ifdef POSITION
865//        _component->interface_map (src ,"depth_"+toString(i),
866//                                   dest,"depth_"+toString(i));
867// #endif
868         
869//        PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_NB_BRANCH",dest,"out_DEPTH_"+toString(i)+"_NB_BRANCH");
870//        if (_param->_have_port_depth)
871//        PORT_MAP(_component,src ,"out_DEPTH_"+toString(i)+"_TAIL"     ,dest,"out_DEPTH_"+toString(i)+"_TAIL"     );
872//      }
873    }
874
875    // ~~~~~[ Others ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
876#if DEBUG_Prediction_unit == true
877    _component->test_map();
878#endif
879
880#ifdef POSITION
881    if (usage_is_set(_usage,USE_POSITION))
882      _component->generate_file();
883#endif
884
885    log_printf(FUNC,Prediction_unit,FUNCTION,"End");
886  };
887
888}; // end namespace prediction_unit
889}; // end namespace front_end
890}; // end namespace multi_front_end
891}; // end namespace core
892
893}; // end namespace behavioural
894}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.