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

Last change on this file since 95 was 95, checked in by rosiere, 16 years ago

1) Update Prediction Table - New architecture (systemC) done (and tested) -> need change interface in top level
2) Change documentation on VHDL generation
3) Change VHDL constant (case std_logic and std_logic_vector)

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