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

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

1) Fix bug (read unit, RAT -> write in R0, SPR desallocation ...)
2) Change VHDL Execute_queue -> use Generic/Queue?
3) Complete document on VHDL generation
4) Add soc test

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